diff --git a/assets/icon/icon-optimized.svg b/assets/icon/icon-optimized.svg new file mode 100644 index 0000000..d5009e7 --- /dev/null +++ b/assets/icon/icon-optimized.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/icon/icon-transparent-optimized.svg b/assets/icon/icon-transparent-optimized.svg new file mode 100644 index 0000000..b20beb0 --- /dev/null +++ b/assets/icon/icon-transparent-optimized.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icon/icon-transparent.svg b/assets/icon/icon-transparent.svg new file mode 100644 index 0000000..654805c --- /dev/null +++ b/assets/icon/icon-transparent.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + diff --git a/assets/icon/icon.svg b/assets/icon/icon.svg new file mode 100644 index 0000000..fa405e8 --- /dev/null +++ b/assets/icon/icon.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..6cf2ff4 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.0.1" + } +} diff --git a/package.json b/package.json index 8c1a7d0..0000354 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "vitest", "lint": "prettier --plugin-search-dir . --check . && eslint .", "format": "prettier --plugin-search-dir . --write .", - "api:generate": "openapi -i ./src/lib/api/firefly-iii-2.0.10-v1.yaml -o ./src/lib/api --request ./src/lib/api/request.ts" + "api:generate": "openapi-generator-cli generate -g typescript-fetch -i ./src/lib/api/firefly-iii-2.0.10-v1.yaml -o ./src/lib/api" }, "dependencies": { "@iconify/svelte": "^3.1.4", @@ -23,7 +23,6 @@ "chart.js": "^4.4.0", "d3-scale-chromatic": "^3.0.0", "dayjs": "^1.11.10", - "firefly-iii-typescript-sdk-fetch": "github:michaelhthomas/firefly-iii-typescript-sdk-fetch#main", "flowbite": "^2.0.0", "flowbite-svelte": "^0.44.19", "svelte-chartjs": "^3.1.2", @@ -34,6 +33,7 @@ "zod": "^3.22.4" }, "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.7.0", "@sveltejs/adapter-auto": "^2.1.0", "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/kit": "^1.25.2", @@ -49,7 +49,6 @@ "eslint-config-prettier": "^8.10.0", "eslint-plugin-svelte": "^2.34.0", "eslint-plugin-unused-imports": "^3.0.0", - "openapi-typescript-codegen": "^0.25.0", "postcss": "8.4.31", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c849bc1..e262cdd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,9 +29,6 @@ dependencies: dayjs: specifier: ^1.11.10 version: 1.11.10 - firefly-iii-typescript-sdk-fetch: - specifier: github:michaelhthomas/firefly-iii-typescript-sdk-fetch#main - version: github.com/michaelhthomas/firefly-iii-typescript-sdk-fetch/70f794d824bd19dfaaa482710ef40e76984b8910 flowbite: specifier: ^2.0.0 version: 2.0.0 @@ -58,6 +55,9 @@ dependencies: version: 3.22.4 devDependencies: + '@openapitools/openapi-generator-cli': + specifier: ^2.7.0 + version: 2.7.0 '@sveltejs/adapter-auto': specifier: ^2.1.0 version: 2.1.0(@sveltejs/kit@1.25.2) @@ -103,9 +103,6 @@ devDependencies: eslint-plugin-unused-imports: specifier: ^3.0.0 version: 3.0.0(@typescript-eslint/eslint-plugin@6.7.5)(eslint@8.51.0) - openapi-typescript-codegen: - specifier: ^0.25.0 - version: 0.25.0 postcss: specifier: 8.4.31 version: 8.4.31 @@ -165,21 +162,11 @@ packages: '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.19 - /@apidevtools/json-schema-ref-parser@9.0.9: - resolution: {integrity: sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==} - dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.13 - call-me-maybe: 1.0.2 - js-yaml: 4.1.0 - dev: true - /@babel/runtime@7.23.2: resolution: {integrity: sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.0 - dev: false /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} @@ -480,14 +467,84 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 - /@jsdevtools/ono@7.1.3: - resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} - dev: true - /@kurkle/color@0.3.2: resolution: {integrity: sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==} dev: false + /@lukeed/csprng@1.1.0: + resolution: {integrity: sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==} + engines: {node: '>=8'} + dev: true + + /@nestjs/axios@0.1.0(@nestjs/common@9.3.11)(reflect-metadata@0.1.13)(rxjs@7.8.0): + resolution: {integrity: sha512-b2TT2X6BFbnNoeteiaxCIiHaFcSbVW+S5yygYqiIq5i6H77yIU3IVuLdpQkHq8/EqOWFwMopLN8jdkUT71Am9w==} + peerDependencies: + '@nestjs/common': ^7.0.0 || ^8.0.0 || ^9.0.0 + reflect-metadata: ^0.1.12 + rxjs: ^6.0.0 || ^7.0.0 + dependencies: + '@nestjs/common': 9.3.11(reflect-metadata@0.1.13)(rxjs@7.8.0) + axios: 0.27.2 + reflect-metadata: 0.1.13 + rxjs: 7.8.0 + transitivePeerDependencies: + - debug + dev: true + + /@nestjs/common@9.3.11(reflect-metadata@0.1.13)(rxjs@7.8.0): + resolution: {integrity: sha512-IFZ2G/5UKWC2Uo7tJ4SxGed2+aiA+sJyWeWsGTogKVDhq90oxVBToh+uCDeI31HNUpqYGoWmkletfty42zUd8A==} + peerDependencies: + cache-manager: <=5 + class-transformer: '*' + class-validator: '*' + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + cache-manager: + optional: true + class-transformer: + optional: true + class-validator: + optional: true + dependencies: + iterare: 1.2.1 + reflect-metadata: 0.1.13 + rxjs: 7.8.0 + tslib: 2.5.0 + uid: 2.0.1 + dev: true + + /@nestjs/core@9.3.11(@nestjs/common@9.3.11)(reflect-metadata@0.1.13)(rxjs@7.8.0): + resolution: {integrity: sha512-CI27a2JFd5rvvbgkalWqsiwQNhcP4EAG5BUK8usjp29wVp1kx30ghfBT8FLqIgmkRVo65A0IcEnWsxeXMntkxQ==} + requiresBuild: true + peerDependencies: + '@nestjs/common': ^9.0.0 + '@nestjs/microservices': ^9.0.0 + '@nestjs/platform-express': ^9.0.0 + '@nestjs/websockets': ^9.0.0 + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + '@nestjs/microservices': + optional: true + '@nestjs/platform-express': + optional: true + '@nestjs/websockets': + optional: true + dependencies: + '@nestjs/common': 9.3.11(reflect-metadata@0.1.13)(rxjs@7.8.0) + '@nuxtjs/opencollective': 0.3.2 + fast-safe-stringify: 2.1.1 + iterare: 1.2.1 + path-to-regexp: 3.2.0 + reflect-metadata: 0.1.13 + rxjs: 7.8.0 + tslib: 2.5.0 + uid: 2.0.1 + transitivePeerDependencies: + - encoding + dev: true + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -509,6 +566,51 @@ packages: fastq: 1.15.0 dev: true + /@nuxtjs/opencollective@0.3.2: + resolution: {integrity: sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==} + engines: {node: '>=8.0.0', npm: '>=5.0.0'} + hasBin: true + dependencies: + chalk: 4.1.2 + consola: 2.15.3 + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + dev: true + + /@openapitools/openapi-generator-cli@2.7.0: + resolution: {integrity: sha512-ieEpHTA/KsDz7ANw03lLPYyjdedDEXYEyYoGBRWdduqXWSX65CJtttjqa8ZaB1mNmIjMtchUHwAYQmTLVQ8HYg==} + engines: {node: '>=10.0.0'} + hasBin: true + requiresBuild: true + dependencies: + '@nestjs/axios': 0.1.0(@nestjs/common@9.3.11)(reflect-metadata@0.1.13)(rxjs@7.8.0) + '@nestjs/common': 9.3.11(reflect-metadata@0.1.13)(rxjs@7.8.0) + '@nestjs/core': 9.3.11(@nestjs/common@9.3.11)(reflect-metadata@0.1.13)(rxjs@7.8.0) + '@nuxtjs/opencollective': 0.3.2 + chalk: 4.1.2 + commander: 8.3.0 + compare-versions: 4.1.4 + concurrently: 6.5.1 + console.table: 0.10.0 + fs-extra: 10.1.0 + glob: 7.1.6 + inquirer: 8.2.5 + lodash: 4.17.21 + reflect-metadata: 0.1.13 + rxjs: 7.8.0 + tslib: 2.0.3 + transitivePeerDependencies: + - '@nestjs/microservices' + - '@nestjs/platform-express' + - '@nestjs/websockets' + - cache-manager + - class-transformer + - class-validator + - debug + - encoding + dev: true + /@polka/url@1.0.0-next.23: resolution: {integrity: sha512-C16M+IYz0rgRhWZdCmK+h58JMv8vijAA61gmz2rspCSwKwzBebpdcsiUmwrtJRdphuY30i6BSLEOP8ppbNLyLg==} @@ -883,6 +985,13 @@ packages: uri-js: 4.4.1 dev: true + /ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.21.3 + dev: true + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -946,6 +1055,10 @@ packages: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true + /autoprefixer@10.4.16(postcss@8.4.31): resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} engines: {node: ^10 || ^12 || >=14} @@ -962,6 +1075,15 @@ packages: postcss-value-parser: 4.2.0 dev: true + /axios@0.27.2: + resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + dependencies: + follow-redirects: 1.15.3 + form-data: 4.0.0 + transitivePeerDependencies: + - debug + dev: true + /axobject-query@3.2.1: resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} dependencies: @@ -971,11 +1093,23 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true + /base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: true + /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: true + /bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + dev: true + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1011,15 +1145,18 @@ packages: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} dev: true + /buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} dev: true - /call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - dev: true - /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1030,11 +1167,6 @@ packages: engines: {node: '>= 6'} dev: true - /camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - dev: true - /caniuse-lite@1.0.30001549: resolution: {integrity: sha512-qRp48dPYSCYaP+KurZLhDYdVE+yEyht/3NlmcJgVQ2VMGt6JL36ndQ/7rgspdZsJuxDPFIo/OzBT2+GmIJ53BA==} dev: true @@ -1060,6 +1192,10 @@ packages: supports-color: 7.2.0 dev: true + /chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + dev: true + /chart.js@4.4.0: resolution: {integrity: sha512-vQEj6d+z0dcsKLlQvbKIMYFHd3t8W/7L2vfJIbYcfyPcRx92CsHqECpueN8qVGNlKyDcr5wBrYAYKnfu/9Q1hQ==} engines: {pnpm: '>=7'} @@ -1088,6 +1224,37 @@ packages: fsevents: 2.3.3 dev: true + /cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + dependencies: + restore-cursor: 3.1.0 + dev: true + + /cli-spinners@2.9.1: + resolution: {integrity: sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==} + engines: {node: '>=6'} + dev: true + + /cli-width@3.0.0: + resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} + engines: {node: '>= 10'} + dev: true + + /cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /clone@1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + requiresBuild: true + dev: true + /code-red@1.0.4: resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} dependencies: @@ -1108,25 +1275,62 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: true + /commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} dev: true - /commander@11.1.0: - resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} - engines: {node: '>=16'} - dev: true - /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} dev: true + /commander@8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + dev: true + + /compare-versions@4.1.4: + resolution: {integrity: sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==} + dev: true + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true + /concurrently@6.5.1: + resolution: {integrity: sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==} + engines: {node: '>=10.0.0'} + hasBin: true + dependencies: + chalk: 4.1.2 + date-fns: 2.30.0 + lodash: 4.17.21 + rxjs: 6.6.7 + spawn-command: 0.0.2-1 + supports-color: 8.1.1 + tree-kill: 1.2.2 + yargs: 16.2.0 + dev: true + + /consola@2.15.3: + resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} + dev: true + + /console.table@0.10.0: + resolution: {integrity: sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==} + engines: {node: '> 0.10'} + dependencies: + easy-table: 1.1.0 + dev: true + /cookie@0.5.0: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} @@ -1173,6 +1377,13 @@ packages: d3-interpolate: 3.0.1 dev: false + /date-fns@2.30.0: + resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} + engines: {node: '>=0.11'} + dependencies: + '@babel/runtime': 7.23.2 + dev: true + /dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false @@ -1203,6 +1414,18 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + /defaults@1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + requiresBuild: true + dependencies: + clone: 1.0.4 + dev: true + + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: true + /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -1247,10 +1470,20 @@ packages: engines: {node: '>=12'} dev: true + /easy-table@1.1.0: + resolution: {integrity: sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==} + optionalDependencies: + wcwidth: 1.0.1 + dev: true + /electron-to-chromium@1.4.554: resolution: {integrity: sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==} dev: true + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + /es6-promise@3.3.1: resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} dev: true @@ -1289,6 +1522,11 @@ packages: engines: {node: '>=6'} dev: true + /escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -1451,6 +1689,15 @@ packages: engines: {node: '>=0.10.0'} dev: true + /external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + dev: true + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -1474,12 +1721,23 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + dev: true + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 dev: true + /figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + dependencies: + escape-string-regexp: 1.0.5 + dev: true + /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -1535,13 +1793,32 @@ packages: mini-svg-data-uri: 1.4.4 dev: false + /follow-redirects@1.15.3: + resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true - /fs-extra@11.1.1: - resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} - engines: {node: '>=14.14'} + /fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} dependencies: graceful-fs: 4.2.11 jsonfile: 6.1.0 @@ -1559,6 +1836,11 @@ packages: requiresBuild: true optional: true + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + /get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true @@ -1643,19 +1925,6 @@ packages: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true - /handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.17.4 - dev: true - /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1666,6 +1935,17 @@ packages: engines: {node: '>= 0.4.0'} dev: true + /iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: true + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -1699,6 +1979,27 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true + /inquirer@8.2.5: + resolution: {integrity: sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==} + engines: {node: '>=12.0.0'} + dependencies: + ansi-escapes: 4.3.2 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-width: 3.0.0 + external-editor: 3.1.0 + figures: 3.2.0 + lodash: 4.17.21 + mute-stream: 0.0.8 + ora: 5.4.1 + run-async: 2.4.1 + rxjs: 7.8.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + through: 2.3.8 + wrap-ansi: 7.0.0 + dev: true + /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -1717,6 +2018,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1724,6 +2030,11 @@ packages: is-extglob: 2.1.1 dev: true + /is-interactive@1.0.0: + resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} + engines: {node: '>=8'} + dev: true + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1739,10 +2050,20 @@ packages: dependencies: '@types/estree': 1.0.2 + /is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true + /iterare@1.2.1: + resolution: {integrity: sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==} + engines: {node: '>=6'} + dev: true + /jiti@1.20.0: resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} hasBin: true @@ -1759,14 +2080,6 @@ packages: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true - /json-schema-ref-parser@9.0.9: - resolution: {integrity: sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==} - engines: {node: '>=10'} - deprecated: Please switch to @apidevtools/json-schema-ref-parser - dependencies: - '@apidevtools/json-schema-ref-parser': 9.0.9 - dev: true - /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} dev: true @@ -1845,6 +2158,18 @@ packages: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + dev: true + /loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: @@ -1887,11 +2212,28 @@ packages: picomatch: 2.3.1 dev: true + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + /mime@3.0.0: resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} engines: {node: '>=10.0.0'} hasBin: true + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -1945,6 +2287,10 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + /mute-stream@0.0.8: + resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + dev: true + /mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} dependencies: @@ -1962,8 +2308,16 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 dev: true /node-releases@2.0.13: @@ -1996,15 +2350,11 @@ packages: wrappy: 1.0.2 dev: true - /openapi-typescript-codegen@0.25.0: - resolution: {integrity: sha512-nN/TnIcGbP58qYgwEEy5FrAAjePcYgfMaCe3tsmYyTgI3v4RR9v8os14L+LEWDvV50+CmqiyTzRkKKtJeb6Ybg==} - hasBin: true + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} dependencies: - camelcase: 6.3.0 - commander: 11.1.0 - fs-extra: 11.1.1 - handlebars: 4.7.8 - json-schema-ref-parser: 9.0.9 + mimic-fn: 2.1.0 dev: true /optionator@0.9.3: @@ -2019,6 +2369,26 @@ packages: type-check: 0.4.0 dev: true + /ora@5.4.1: + resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} + engines: {node: '>=10'} + dependencies: + bl: 4.1.0 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-spinners: 2.9.1 + is-interactive: 1.0.0 + is-unicode-supported: 0.1.0 + log-symbols: 4.1.0 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + dev: true + + /os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + dev: true + /p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -2066,6 +2436,10 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true + /path-to-regexp@3.2.0: + resolution: {integrity: sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==} + dev: true + /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -2283,6 +2657,15 @@ packages: pify: 2.3.0 dev: true + /readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: true + /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -2290,9 +2673,17 @@ packages: picomatch: 2.3.1 dev: true + /reflect-metadata@0.1.13: + resolution: {integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==} + dev: true + /regenerator-runtime@0.14.0: resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} - dev: false + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} @@ -2308,6 +2699,14 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true + /restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -2334,18 +2733,44 @@ packages: optionalDependencies: fsevents: 2.3.3 + /run-async@2.4.1: + resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} + engines: {node: '>=0.12.0'} + dev: true + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 dev: true + /rxjs@6.6.7: + resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} + engines: {npm: '>=2.0.0'} + dependencies: + tslib: 1.14.1 + dev: true + + /rxjs@7.8.0: + resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==} + dependencies: + tslib: 2.6.2 + dev: true + /sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} dependencies: mri: 1.2.0 + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + /sander@0.5.1: resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} dependencies: @@ -2382,6 +2807,10 @@ packages: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: true + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + /sirv@2.0.3: resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} @@ -2409,9 +2838,8 @@ packages: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} + /spawn-command@0.0.2-1: + resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==} dev: true /stackback@0.0.2: @@ -2422,6 +2850,21 @@ packages: resolution: {integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==} dev: true + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + dev: true + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -2468,6 +2911,13 @@ packages: has-flag: 4.0.0 dev: true + /supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -2765,6 +3215,10 @@ packages: any-promise: 1.3.0 dev: true + /through@2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + dev: true + /tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} dependencies: @@ -2785,6 +3239,13 @@ packages: engines: {node: '>=14.0.0'} dev: true + /tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: true + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -2796,6 +3257,15 @@ packages: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} + /tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: true + + /tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + dev: true + /ts-api-utils@1.0.3(typescript@5.2.2): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} @@ -2813,6 +3283,18 @@ packages: resolution: {integrity: sha512-tL0w8U/pgaacOmkb9fRlYzWEUDCfVjjv9dD4wHTgZ61MjhuMt46VNWTG747NqW6vRzoWIKABVhFSOJ82FvXrfA==} dev: false + /tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true + + /tslib@2.0.3: + resolution: {integrity: sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==} + dev: true + + /tslib@2.5.0: + resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + dev: true + /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true @@ -2834,6 +3316,11 @@ packages: engines: {node: '>=10'} dev: true + /type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true + /typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} @@ -2844,13 +3331,12 @@ packages: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} - hasBin: true - requiresBuild: true + /uid@2.0.1: + resolution: {integrity: sha512-PF+1AnZgycpAIEmNtjxGBVmKbZAQguaa4pBUq6KNaGEcpzZ2klCNZLM34tsjp76maN00TttiiUf6zkIBpJQm2A==} + engines: {node: '>=8'} + dependencies: + '@lukeed/csprng': 1.1.0 dev: true - optional: true /undici-types@5.25.3: resolution: {integrity: sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==} @@ -3029,6 +3515,23 @@ packages: - terser dev: true + /wcwidth@1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + dependencies: + defaults: 1.0.4 + dev: true + + /webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: true + + /whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3046,14 +3549,24 @@ packages: stackback: 0.0.2 dev: true - /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 dev: true /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true @@ -3068,6 +3581,24 @@ packages: engines: {node: '>= 14'} dev: true + /yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + + /yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -3081,9 +3612,3 @@ packages: /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - - github.com/michaelhthomas/firefly-iii-typescript-sdk-fetch/70f794d824bd19dfaaa482710ef40e76984b8910: - resolution: {tarball: https://codeload.github.com/michaelhthomas/firefly-iii-typescript-sdk-fetch/tar.gz/70f794d824bd19dfaaa482710ef40e76984b8910} - name: firefly-iii-typescript-sdk-fetch - version: 1.0.0 - dev: false diff --git a/src/app.html b/src/app.html index 297699f..e3c1ea0 100644 --- a/src/app.html +++ b/src/app.html @@ -2,9 +2,19 @@ - %sveltekit.head% + + + + + + + + + + + > { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/about`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SystemInfoFromJSON(jsonValue)); + } + + /** + * Returns general system information and versions of the (supporting) software. + * System information end point. + */ + async getAbout(requestParameters: GetAboutRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAboutRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users. + * Cron job endpoint + */ + async getCronRaw(requestParameters: GetCronRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.cliToken === null || requestParameters.cliToken === undefined) { + throw new runtime.RequiredError('cliToken','Required parameter requestParameters.cliToken was null or undefined when calling getCron.'); + } + + const queryParameters: any = {}; + + if (requestParameters.date !== undefined) { + queryParameters['date'] = (requestParameters.date as any).toISOString().substring(0,10); + } + + if (requestParameters.force !== undefined) { + queryParameters['force'] = requestParameters.force; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/cron/{cliToken}`.replace(`{${"cliToken"}}`, encodeURIComponent(String(requestParameters.cliToken))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CronResultFromJSON(jsonValue)); + } + + /** + * Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users. + * Cron job endpoint + */ + async getCron(requestParameters: GetCronRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCronRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns the currently authenticated user. + * Currently authenticated user endpoint. + */ + async getCurrentUserRaw(requestParameters: GetCurrentUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/about/user`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserSingleFromJSON(jsonValue)); + } + + /** + * Returns the currently authenticated user. + * Currently authenticated user endpoint. + */ + async getCurrentUser(requestParameters: GetCurrentUserRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCurrentUserRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/AccountsApi.ts b/src/lib/api/apis/AccountsApi.ts new file mode 100644 index 0000000..f31bec3 --- /dev/null +++ b/src/lib/api/apis/AccountsApi.ts @@ -0,0 +1,576 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AccountArray, + AccountSingle, + AccountStore, + AccountTypeFilter, + AccountUpdate, + AttachmentArray, + BadRequest, + InternalException, + NotFound, + PiggyBankArray, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AccountArrayFromJSON, + AccountArrayToJSON, + AccountSingleFromJSON, + AccountSingleToJSON, + AccountStoreFromJSON, + AccountStoreToJSON, + AccountTypeFilterFromJSON, + AccountTypeFilterToJSON, + AccountUpdateFromJSON, + AccountUpdateToJSON, + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + PiggyBankArrayFromJSON, + PiggyBankArrayToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteAccountRequest { + id: string; + xTraceId?: string; +} + +export interface GetAccountRequest { + id: string; + xTraceId?: string; + date?: Date; +} + +export interface ListAccountRequest { + xTraceId?: string; + limit?: number; + page?: number; + date?: Date; + type?: AccountTypeFilter; +} + +export interface ListAttachmentByAccountRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListPiggyBankByAccountRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionByAccountRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreAccountRequest { + accountStore: AccountStore; + xTraceId?: string; +} + +export interface UpdateAccountRequest { + id: string; + accountUpdate: AccountUpdate; + xTraceId?: string; +} + +/** + * + */ +export class AccountsApi extends runtime.BaseAPI { + + /** + * Will permanently delete an account. Any associated transactions and piggy banks are ALSO deleted. Cannot be recovered from. + * Permanently delete account. + */ + async deleteAccountRaw(requestParameters: DeleteAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteAccount.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Will permanently delete an account. Any associated transactions and piggy banks are ALSO deleted. Cannot be recovered from. + * Permanently delete account. + */ + async deleteAccount(requestParameters: DeleteAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteAccountRaw(requestParameters, initOverrides); + } + + /** + * Returns a single account by its ID. + * Get single account. + */ + async getAccountRaw(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getAccount.'); + } + + const queryParameters: any = {}; + + if (requestParameters.date !== undefined) { + queryParameters['date'] = (requestParameters.date as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountSingleFromJSON(jsonValue)); + } + + /** + * Returns a single account by its ID. + * Get single account. + */ + async getAccount(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint returns a list of all the accounts owned by the authenticated user. + * List all accounts. + */ + async listAccountRaw(requestParameters: ListAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.date !== undefined) { + queryParameters['date'] = (requestParameters.date as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountArrayFromJSON(jsonValue)); + } + + /** + * This endpoint returns a list of all the accounts owned by the authenticated user. + * List all accounts. + */ + async listAccount(requestParameters: ListAccountRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByAccountRaw(requestParameters: ListAttachmentByAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listAttachmentByAccount.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts/{id}/attachments`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByAccount(requestParameters: ListAttachmentByAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint returns a list of all the piggy banks connected to the account. + * List all piggy banks related to the account. + */ + async listPiggyBankByAccountRaw(requestParameters: ListPiggyBankByAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listPiggyBankByAccount.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts/{id}/piggy-banks`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankArrayFromJSON(jsonValue)); + } + + /** + * This endpoint returns a list of all the piggy banks connected to the account. + * List all piggy banks related to the account. + */ + async listPiggyBankByAccount(requestParameters: ListPiggyBankByAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPiggyBankByAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint returns a list of all the transactions connected to the account. + * List all transactions related to the account. + */ + async listTransactionByAccountRaw(requestParameters: ListTransactionByAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByAccount.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts/{id}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * This endpoint returns a list of all the transactions connected to the account. + * List all transactions related to the account. + */ + async listTransactionByAccount(requestParameters: ListTransactionByAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). + * Create new account. + */ + async storeAccountRaw(requestParameters: StoreAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.accountStore === null || requestParameters.accountStore === undefined) { + throw new runtime.RequiredError('accountStore','Required parameter requestParameters.accountStore was null or undefined when calling storeAccount.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AccountStoreToJSON(requestParameters.accountStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountSingleFromJSON(jsonValue)); + } + + /** + * Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). + * Create new account. + */ + async storeAccount(requestParameters: StoreAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Used to update a single account. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. + * Update existing account. + */ + async updateAccountRaw(requestParameters: UpdateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateAccount.'); + } + + if (requestParameters.accountUpdate === null || requestParameters.accountUpdate === undefined) { + throw new runtime.RequiredError('accountUpdate','Required parameter requestParameters.accountUpdate was null or undefined when calling updateAccount.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/accounts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: AccountUpdateToJSON(requestParameters.accountUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountSingleFromJSON(jsonValue)); + } + + /** + * Used to update a single account. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. + * Update existing account. + */ + async updateAccount(requestParameters: UpdateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateAccountRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/AttachmentsApi.ts b/src/lib/api/apis/AttachmentsApi.ts new file mode 100644 index 0000000..cf9f5da --- /dev/null +++ b/src/lib/api/apis/AttachmentsApi.ts @@ -0,0 +1,450 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + AttachmentSingle, + AttachmentStore, + AttachmentUpdate, + BadRequest, + InternalException, + NotFound, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + AttachmentSingleFromJSON, + AttachmentSingleToJSON, + AttachmentStoreFromJSON, + AttachmentStoreToJSON, + AttachmentUpdateFromJSON, + AttachmentUpdateToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteAttachmentRequest { + id: string; + xTraceId?: string; +} + +export interface DownloadAttachmentRequest { + id: string; + xTraceId?: string; +} + +export interface GetAttachmentRequest { + id: string; + xTraceId?: string; +} + +export interface ListAttachmentRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StoreAttachmentRequest { + attachmentStore: AttachmentStore; + xTraceId?: string; +} + +export interface UpdateAttachmentRequest { + id: string; + attachmentUpdate: AttachmentUpdate; + xTraceId?: string; +} + +export interface UploadAttachmentRequest { + id: string; + xTraceId?: string; + body?: Blob; +} + +/** + * + */ +export class AttachmentsApi extends runtime.BaseAPI { + + /** + * With this endpoint you delete an attachment, including any stored file data. + * Delete an attachment. + */ + async deleteAttachmentRaw(requestParameters: DeleteAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteAttachment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * With this endpoint you delete an attachment, including any stored file data. + * Delete an attachment. + */ + async deleteAttachment(requestParameters: DeleteAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteAttachmentRaw(requestParameters, initOverrides); + } + + /** + * This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \"application/octet-stream\" and content disposition \"attachment; filename=example.pdf\". + * Download a single attachment. + */ + async downloadAttachmentRaw(requestParameters: DownloadAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling downloadAttachment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments/{id}/download`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \"application/octet-stream\" and content disposition \"attachment; filename=example.pdf\". + * Download a single attachment. + */ + async downloadAttachment(requestParameters: DownloadAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.downloadAttachmentRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below). + * Get a single attachment. + */ + async getAttachmentRaw(requestParameters: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getAttachment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentSingleFromJSON(jsonValue)); + } + + /** + * Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below). + * Get a single attachment. + */ + async getAttachment(requestParameters: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAttachmentRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint lists all attachments. + * List all attachments. + */ + async listAttachmentRaw(requestParameters: ListAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * This endpoint lists all attachments. + * List all attachments. + */ + async listAttachment(requestParameters: ListAttachmentRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object. + * Store a new attachment. + */ + async storeAttachmentRaw(requestParameters: StoreAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.attachmentStore === null || requestParameters.attachmentStore === undefined) { + throw new runtime.RequiredError('attachmentStore','Required parameter requestParameters.attachmentStore was null or undefined when calling storeAttachment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AttachmentStoreToJSON(requestParameters.attachmentStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentSingleFromJSON(jsonValue)); + } + + /** + * Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object. + * Store a new attachment. + */ + async storeAttachment(requestParameters: StoreAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeAttachmentRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below. + * Update existing attachment. + */ + async updateAttachmentRaw(requestParameters: UpdateAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateAttachment.'); + } + + if (requestParameters.attachmentUpdate === null || requestParameters.attachmentUpdate === undefined) { + throw new runtime.RequiredError('attachmentUpdate','Required parameter requestParameters.attachmentUpdate was null or undefined when calling updateAttachment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: AttachmentUpdateToJSON(requestParameters.attachmentUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentSingleFromJSON(jsonValue)); + } + + /** + * Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below. + * Update existing attachment. + */ + async updateAttachment(requestParameters: UpdateAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateAttachmentRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data. + * Upload an attachment. + */ + async uploadAttachmentRaw(requestParameters: UploadAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadAttachment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/octet-stream'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/attachments/{id}/upload`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.body as any, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data. + * Upload an attachment. + */ + async uploadAttachment(requestParameters: UploadAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.uploadAttachmentRaw(requestParameters, initOverrides); + } + +} diff --git a/src/lib/api/apis/AutocompleteApi.ts b/src/lib/api/apis/AutocompleteApi.ts new file mode 100644 index 0000000..e6359c1 --- /dev/null +++ b/src/lib/api/apis/AutocompleteApi.ts @@ -0,0 +1,1012 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AccountTypeFilter, + AutocompleteAccount, + AutocompleteBill, + AutocompleteBudget, + AutocompleteCategory, + AutocompleteCurrency, + AutocompleteCurrencyCode, + AutocompleteObjectGroup, + AutocompletePiggy, + AutocompletePiggyBalance, + AutocompleteRecurrence, + AutocompleteRule, + AutocompleteRuleGroup, + AutocompleteTag, + AutocompleteTransaction, + AutocompleteTransactionID, + AutocompleteTransactionType, + BadRequest, + InternalException, + NotFound, + Unauthenticated, +} from '../models/index'; +import { + AccountTypeFilterFromJSON, + AccountTypeFilterToJSON, + AutocompleteAccountFromJSON, + AutocompleteAccountToJSON, + AutocompleteBillFromJSON, + AutocompleteBillToJSON, + AutocompleteBudgetFromJSON, + AutocompleteBudgetToJSON, + AutocompleteCategoryFromJSON, + AutocompleteCategoryToJSON, + AutocompleteCurrencyFromJSON, + AutocompleteCurrencyToJSON, + AutocompleteCurrencyCodeFromJSON, + AutocompleteCurrencyCodeToJSON, + AutocompleteObjectGroupFromJSON, + AutocompleteObjectGroupToJSON, + AutocompletePiggyFromJSON, + AutocompletePiggyToJSON, + AutocompletePiggyBalanceFromJSON, + AutocompletePiggyBalanceToJSON, + AutocompleteRecurrenceFromJSON, + AutocompleteRecurrenceToJSON, + AutocompleteRuleFromJSON, + AutocompleteRuleToJSON, + AutocompleteRuleGroupFromJSON, + AutocompleteRuleGroupToJSON, + AutocompleteTagFromJSON, + AutocompleteTagToJSON, + AutocompleteTransactionFromJSON, + AutocompleteTransactionToJSON, + AutocompleteTransactionIDFromJSON, + AutocompleteTransactionIDToJSON, + AutocompleteTransactionTypeFromJSON, + AutocompleteTransactionTypeToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface GetAccountsACRequest { + xTraceId?: string; + query?: string; + limit?: number; + date?: string; + types?: Array; +} + +export interface GetBillsACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetBudgetsACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetCategoriesACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetCurrenciesACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetCurrenciesCodeACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetObjectGroupsACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetPiggiesACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetPiggiesBalanceACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetRecurringACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetRuleGroupsACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetRulesACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetTagACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetTransactionTypesACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetTransactionsACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +export interface GetTransactionsIDACRequest { + xTraceId?: string; + query?: string; + limit?: number; +} + +/** + * + */ +export class AutocompleteApi extends runtime.BaseAPI { + + /** + * Returns all accounts of the user returned in a basic auto-complete array. + */ + async getAccountsACRaw(requestParameters: GetAccountsACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.date !== undefined) { + queryParameters['date'] = requestParameters.date; + } + + if (requestParameters.types) { + queryParameters['types'] = requestParameters.types.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/accounts`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteAccountFromJSON)); + } + + /** + * Returns all accounts of the user returned in a basic auto-complete array. + */ + async getAccountsAC(requestParameters: GetAccountsACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getAccountsACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all bills of the user returned in a basic auto-complete array. + */ + async getBillsACRaw(requestParameters: GetBillsACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/bills`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteBillFromJSON)); + } + + /** + * Returns all bills of the user returned in a basic auto-complete array. + */ + async getBillsAC(requestParameters: GetBillsACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getBillsACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all budgets of the user returned in a basic auto-complete array. + */ + async getBudgetsACRaw(requestParameters: GetBudgetsACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/budgets`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteBudgetFromJSON)); + } + + /** + * Returns all budgets of the user returned in a basic auto-complete array. + */ + async getBudgetsAC(requestParameters: GetBudgetsACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getBudgetsACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all categories of the user returned in a basic auto-complete array. + */ + async getCategoriesACRaw(requestParameters: GetCategoriesACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/categories`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteCategoryFromJSON)); + } + + /** + * Returns all categories of the user returned in a basic auto-complete array. + */ + async getCategoriesAC(requestParameters: GetCategoriesACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getCategoriesACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all currencies of the user returned in a basic auto-complete array. + */ + async getCurrenciesACRaw(requestParameters: GetCurrenciesACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/currencies`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteCurrencyFromJSON)); + } + + /** + * Returns all currencies of the user returned in a basic auto-complete array. + */ + async getCurrenciesAC(requestParameters: GetCurrenciesACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getCurrenciesACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + */ + async getCurrenciesCodeACRaw(requestParameters: GetCurrenciesCodeACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/currencies-with-code`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteCurrencyCodeFromJSON)); + } + + /** + * Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + */ + async getCurrenciesCodeAC(requestParameters: GetCurrenciesCodeACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getCurrenciesCodeACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all object groups of the user returned in a basic auto-complete array. + */ + async getObjectGroupsACRaw(requestParameters: GetObjectGroupsACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/object-groups`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteObjectGroupFromJSON)); + } + + /** + * Returns all object groups of the user returned in a basic auto-complete array. + */ + async getObjectGroupsAC(requestParameters: GetObjectGroupsACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getObjectGroupsACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all piggy banks of the user returned in a basic auto-complete array. + */ + async getPiggiesACRaw(requestParameters: GetPiggiesACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/piggy-banks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompletePiggyFromJSON)); + } + + /** + * Returns all piggy banks of the user returned in a basic auto-complete array. + */ + async getPiggiesAC(requestParameters: GetPiggiesACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getPiggiesACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. + */ + async getPiggiesBalanceACRaw(requestParameters: GetPiggiesBalanceACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/piggy-banks-with-balance`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompletePiggyBalanceFromJSON)); + } + + /** + * Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. + */ + async getPiggiesBalanceAC(requestParameters: GetPiggiesBalanceACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getPiggiesBalanceACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all recurring transactions of the user returned in a basic auto-complete array. + */ + async getRecurringACRaw(requestParameters: GetRecurringACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/recurring`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteRecurrenceFromJSON)); + } + + /** + * Returns all recurring transactions of the user returned in a basic auto-complete array. + */ + async getRecurringAC(requestParameters: GetRecurringACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getRecurringACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all rule groups of the user returned in a basic auto-complete array. + */ + async getRuleGroupsACRaw(requestParameters: GetRuleGroupsACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/rule-groups`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteRuleGroupFromJSON)); + } + + /** + * Returns all rule groups of the user returned in a basic auto-complete array. + */ + async getRuleGroupsAC(requestParameters: GetRuleGroupsACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getRuleGroupsACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all rules of the user returned in a basic auto-complete array. + */ + async getRulesACRaw(requestParameters: GetRulesACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/rules`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteRuleFromJSON)); + } + + /** + * Returns all rules of the user returned in a basic auto-complete array. + */ + async getRulesAC(requestParameters: GetRulesACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getRulesACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all tags of the user returned in a basic auto-complete array. + */ + async getTagACRaw(requestParameters: GetTagACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/tags`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteTagFromJSON)); + } + + /** + * Returns all tags of the user returned in a basic auto-complete array. + */ + async getTagAC(requestParameters: GetTagACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getTagACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all transaction types returned in a basic auto-complete array. English only. + */ + async getTransactionTypesACRaw(requestParameters: GetTransactionTypesACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/transaction-types`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteTransactionTypeFromJSON)); + } + + /** + * Returns all transaction types returned in a basic auto-complete array. English only. + */ + async getTransactionTypesAC(requestParameters: GetTransactionTypesACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getTransactionTypesACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all transaction descriptions of the user returned in a basic auto-complete array. + */ + async getTransactionsACRaw(requestParameters: GetTransactionsACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteTransactionFromJSON)); + } + + /** + * Returns all transaction descriptions of the user returned in a basic auto-complete array. + */ + async getTransactionsAC(requestParameters: GetTransactionsACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getTransactionsACRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + */ + async getTransactionsIDACRaw(requestParameters: GetTransactionsIDACRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/autocomplete/transactions-with-id`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutocompleteTransactionIDFromJSON)); + } + + /** + * Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + */ + async getTransactionsIDAC(requestParameters: GetTransactionsIDACRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getTransactionsIDACRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/AvailableBudgetsApi.ts b/src/lib/api/apis/AvailableBudgetsApi.ts new file mode 100644 index 0000000..25ddc91 --- /dev/null +++ b/src/lib/api/apis/AvailableBudgetsApi.ts @@ -0,0 +1,168 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AvailableBudgetArray, + AvailableBudgetSingle, + BadRequest, + InternalException, + NotFound, + Unauthenticated, +} from '../models/index'; +import { + AvailableBudgetArrayFromJSON, + AvailableBudgetArrayToJSON, + AvailableBudgetSingleFromJSON, + AvailableBudgetSingleToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface GetAvailableBudgetRequest { + id: string; + xTraceId?: string; +} + +export interface ListAvailableBudgetRequest { + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; +} + +/** + * + */ +export class AvailableBudgetsApi extends runtime.BaseAPI { + + /** + * Get a single available budget, by ID. + * Get a single available budget. + */ + async getAvailableBudgetRaw(requestParameters: GetAvailableBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getAvailableBudget.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/available-budgets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AvailableBudgetSingleFromJSON(jsonValue)); + } + + /** + * Get a single available budget, by ID. + * Get a single available budget. + */ + async getAvailableBudget(requestParameters: GetAvailableBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAvailableBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Firefly III allows users to set the amount that is available to be budgeted in so-called \"available budgets\". For example, the user could have 1200,- available to be divided during the coming month. This amount is used on the /budgets page. This endpoint returns all of these amounts and the periods for which they are set. + * List all available budget amounts. + */ + async listAvailableBudgetRaw(requestParameters: ListAvailableBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/available-budgets`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AvailableBudgetArrayFromJSON(jsonValue)); + } + + /** + * Firefly III allows users to set the amount that is available to be budgeted in so-called \"available budgets\". For example, the user could have 1200,- available to be divided during the coming month. This amount is used on the /budgets page. This endpoint returns all of these amounts and the periods for which they are set. + * List all available budget amounts. + */ + async listAvailableBudget(requestParameters: ListAvailableBudgetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAvailableBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/BillsApi.ts b/src/lib/api/apis/BillsApi.ts new file mode 100644 index 0000000..8d5f372 --- /dev/null +++ b/src/lib/api/apis/BillsApi.ts @@ -0,0 +1,558 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + BadRequest, + BillArray, + BillSingle, + BillStore, + BillUpdate, + InternalException, + NotFound, + RuleArray, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + BillArrayFromJSON, + BillArrayToJSON, + BillSingleFromJSON, + BillSingleToJSON, + BillStoreFromJSON, + BillStoreToJSON, + BillUpdateFromJSON, + BillUpdateToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + RuleArrayFromJSON, + RuleArrayToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteBillRequest { + id: string; + xTraceId?: string; +} + +export interface GetBillRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; +} + +export interface ListAttachmentByBillRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListBillRequest { + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; +} + +export interface ListRuleByBillRequest { + id: string; + xTraceId?: string; +} + +export interface ListTransactionByBillRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreBillRequest { + billStore: BillStore; + xTraceId?: string; +} + +export interface UpdateBillRequest { + id: string; + billUpdate: BillUpdate; + xTraceId?: string; +} + +/** + * + */ +export class BillsApi extends runtime.BaseAPI { + + /** + * Delete a bill. This will not delete any associated rules. Will not remove associated transactions. WILL remove all associated attachments. + * Delete a bill. + */ + async deleteBillRaw(requestParameters: DeleteBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteBill.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a bill. This will not delete any associated rules. Will not remove associated transactions. WILL remove all associated attachments. + * Delete a bill. + */ + async deleteBill(requestParameters: DeleteBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteBillRaw(requestParameters, initOverrides); + } + + /** + * Get a single bill. + * Get a single bill. + */ + async getBillRaw(requestParameters: GetBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getBill.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillSingleFromJSON(jsonValue)); + } + + /** + * Get a single bill. + * Get a single bill. + */ + async getBill(requestParameters: GetBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint will list all attachments linked to the bill. + * List all attachments uploaded to the bill. + */ + async listAttachmentByBillRaw(requestParameters: ListAttachmentByBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listAttachmentByBill.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills/{id}/attachments`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * This endpoint will list all attachments linked to the bill. + * List all attachments uploaded to the bill. + */ + async listAttachmentByBill(requestParameters: ListAttachmentByBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint will list all the user\'s bills. + * List all bills. + */ + async listBillRaw(requestParameters: ListBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillArrayFromJSON(jsonValue)); + } + + /** + * This endpoint will list all the user\'s bills. + * List all bills. + */ + async listBill(requestParameters: ListBillRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint will list all rules that have an action to set the bill to this bill. + * List all rules associated with the bill. + */ + async listRuleByBillRaw(requestParameters: ListRuleByBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listRuleByBill.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills/{id}/rules`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleArrayFromJSON(jsonValue)); + } + + /** + * This endpoint will list all rules that have an action to set the bill to this bill. + * List all rules associated with the bill. + */ + async listRuleByBill(requestParameters: ListRuleByBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRuleByBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint will list all transactions linked to this bill. + * List all transactions associated with the bill. + */ + async listTransactionByBillRaw(requestParameters: ListTransactionByBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByBill.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills/{id}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * This endpoint will list all transactions linked to this bill. + * List all transactions associated with the bill. + */ + async listTransactionByBill(requestParameters: ListTransactionByBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new bill. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new bill + */ + async storeBillRaw(requestParameters: StoreBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.billStore === null || requestParameters.billStore === undefined) { + throw new runtime.RequiredError('billStore','Required parameter requestParameters.billStore was null or undefined when calling storeBill.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BillStoreToJSON(requestParameters.billStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillSingleFromJSON(jsonValue)); + } + + /** + * Creates a new bill. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new bill + */ + async storeBill(requestParameters: StoreBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing bill. + * Update existing bill. + */ + async updateBillRaw(requestParameters: UpdateBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateBill.'); + } + + if (requestParameters.billUpdate === null || requestParameters.billUpdate === undefined) { + throw new runtime.RequiredError('billUpdate','Required parameter requestParameters.billUpdate was null or undefined when calling updateBill.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/bills/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: BillUpdateToJSON(requestParameters.billUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillSingleFromJSON(jsonValue)); + } + + /** + * Update existing bill. + * Update existing bill. + */ + async updateBill(requestParameters: UpdateBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateBillRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/BudgetsApi.ts b/src/lib/api/apis/BudgetsApi.ts new file mode 100644 index 0000000..1115210 --- /dev/null +++ b/src/lib/api/apis/BudgetsApi.ts @@ -0,0 +1,972 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + BadRequest, + BudgetArray, + BudgetLimit, + BudgetLimitArray, + BudgetLimitSingle, + BudgetLimitStore, + BudgetSingle, + BudgetStore, + BudgetUpdate, + InternalException, + NotFound, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + BudgetArrayFromJSON, + BudgetArrayToJSON, + BudgetLimitFromJSON, + BudgetLimitToJSON, + BudgetLimitArrayFromJSON, + BudgetLimitArrayToJSON, + BudgetLimitSingleFromJSON, + BudgetLimitSingleToJSON, + BudgetLimitStoreFromJSON, + BudgetLimitStoreToJSON, + BudgetSingleFromJSON, + BudgetSingleToJSON, + BudgetStoreFromJSON, + BudgetStoreToJSON, + BudgetUpdateFromJSON, + BudgetUpdateToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteBudgetRequest { + id: string; + xTraceId?: string; +} + +export interface DeleteBudgetLimitRequest { + id: string; + limitId: string; + xTraceId?: string; +} + +export interface GetBudgetRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; +} + +export interface GetBudgetLimitRequest { + id: string; + limitId: number; + xTraceId?: string; +} + +export interface ListAttachmentByBudgetRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListBudgetRequest { + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; +} + +export interface ListBudgetLimitRequest { + start: Date; + end: Date; + xTraceId?: string; +} + +export interface ListBudgetLimitByBudgetRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; +} + +export interface ListTransactionByBudgetRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface ListTransactionByBudgetLimitRequest { + id: string; + limitId: string; + xTraceId?: string; + limit?: number; + page?: number; + type?: TransactionTypeFilter; +} + +export interface StoreBudgetRequest { + budgetStore: BudgetStore; + xTraceId?: string; +} + +export interface StoreBudgetLimitRequest { + id: string; + budgetLimitStore: BudgetLimitStore; + xTraceId?: string; +} + +export interface UpdateBudgetRequest { + id: string; + budgetUpdate: BudgetUpdate; + xTraceId?: string; +} + +export interface UpdateBudgetLimitRequest { + id: string; + limitId: string; + budgetLimit: BudgetLimit; + xTraceId?: string; +} + +/** + * + */ +export class BudgetsApi extends runtime.BaseAPI { + + /** + * Delete a budget. Transactions will not be deleted. + * Delete a budget. + */ + async deleteBudgetRaw(requestParameters: DeleteBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteBudget.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a budget. Transactions will not be deleted. + * Delete a budget. + */ + async deleteBudget(requestParameters: DeleteBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteBudgetRaw(requestParameters, initOverrides); + } + + /** + * Delete a budget limit. + * Delete a budget limit. + */ + async deleteBudgetLimitRaw(requestParameters: DeleteBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteBudgetLimit.'); + } + + if (requestParameters.limitId === null || requestParameters.limitId === undefined) { + throw new runtime.RequiredError('limitId','Required parameter requestParameters.limitId was null or undefined when calling deleteBudgetLimit.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/limits/{limitId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"limitId"}}`, encodeURIComponent(String(requestParameters.limitId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a budget limit. + * Delete a budget limit. + */ + async deleteBudgetLimit(requestParameters: DeleteBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteBudgetLimitRaw(requestParameters, initOverrides); + } + + /** + * Get a single budget. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. + * Get a single budget. + */ + async getBudgetRaw(requestParameters: GetBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getBudget.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetSingleFromJSON(jsonValue)); + } + + /** + * Get a single budget. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. + * Get a single budget. + */ + async getBudget(requestParameters: GetBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get single budget limit. + */ + async getBudgetLimitRaw(requestParameters: GetBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getBudgetLimit.'); + } + + if (requestParameters.limitId === null || requestParameters.limitId === undefined) { + throw new runtime.RequiredError('limitId','Required parameter requestParameters.limitId was null or undefined when calling getBudgetLimit.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/limits/{limitId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"limitId"}}`, encodeURIComponent(String(requestParameters.limitId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetLimitSingleFromJSON(jsonValue)); + } + + /** + * Get single budget limit. + */ + async getBudgetLimit(requestParameters: GetBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getBudgetLimitRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all attachments. + * Lists all attachments of a budget. + */ + async listAttachmentByBudgetRaw(requestParameters: ListAttachmentByBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listAttachmentByBudget.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/attachments`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * Lists all attachments. + * Lists all attachments of a budget. + */ + async listAttachmentByBudget(requestParameters: ListAttachmentByBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the budgets the user has made. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. + * List all budgets. + */ + async listBudgetRaw(requestParameters: ListBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetArrayFromJSON(jsonValue)); + } + + /** + * List all the budgets the user has made. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. + * List all budgets. + */ + async listBudget(requestParameters: ListBudgetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get all budget limits for for this date range. + * Get list of budget limits by date + */ + async listBudgetLimitRaw(requestParameters: ListBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling listBudgetLimit.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling listBudgetLimit.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budget-limits`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetLimitArrayFromJSON(jsonValue)); + } + + /** + * Get all budget limits for for this date range. + * Get list of budget limits by date + */ + async listBudgetLimit(requestParameters: ListBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBudgetLimitRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get all budget limits for this budget and the money spent, and money left. You can limit the list by submitting a date range as well. The \"spent\" array for each budget limit is NOT influenced by the start and end date of your query, but by the start and end date of the budget limit itself. + * Get all limits for a budget. + */ + async listBudgetLimitByBudgetRaw(requestParameters: ListBudgetLimitByBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listBudgetLimitByBudget.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/limits`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetLimitArrayFromJSON(jsonValue)); + } + + /** + * Get all budget limits for this budget and the money spent, and money left. You can limit the list by submitting a date range as well. The \"spent\" array for each budget limit is NOT influenced by the start and end date of your query, but by the start and end date of the budget limit itself. + * Get all limits for a budget. + */ + async listBudgetLimitByBudget(requestParameters: ListBudgetLimitByBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBudgetLimitByBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get all transactions linked to a budget, possibly limited by start and end + * All transactions to a budget. + */ + async listTransactionByBudgetRaw(requestParameters: ListTransactionByBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByBudget.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * Get all transactions linked to a budget, possibly limited by start and end + * All transactions to a budget. + */ + async listTransactionByBudget(requestParameters: ListTransactionByBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the transactions within one budget limit. The start and end date are dictated by the budget limit. + * List all transactions by a budget limit ID. + */ + async listTransactionByBudgetLimitRaw(requestParameters: ListTransactionByBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByBudgetLimit.'); + } + + if (requestParameters.limitId === null || requestParameters.limitId === undefined) { + throw new runtime.RequiredError('limitId','Required parameter requestParameters.limitId was null or undefined when calling listTransactionByBudgetLimit.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/limits/{limitId}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"limitId"}}`, encodeURIComponent(String(requestParameters.limitId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all the transactions within one budget limit. The start and end date are dictated by the budget limit. + * List all transactions by a budget limit ID. + */ + async listTransactionByBudgetLimit(requestParameters: ListTransactionByBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByBudgetLimitRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new budget. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new budget + */ + async storeBudgetRaw(requestParameters: StoreBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.budgetStore === null || requestParameters.budgetStore === undefined) { + throw new runtime.RequiredError('budgetStore','Required parameter requestParameters.budgetStore was null or undefined when calling storeBudget.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BudgetStoreToJSON(requestParameters.budgetStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetSingleFromJSON(jsonValue)); + } + + /** + * Creates a new budget. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new budget + */ + async storeBudget(requestParameters: StoreBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Store a new budget limit under this budget. + * Store new budget limit. + */ + async storeBudgetLimitRaw(requestParameters: StoreBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling storeBudgetLimit.'); + } + + if (requestParameters.budgetLimitStore === null || requestParameters.budgetLimitStore === undefined) { + throw new runtime.RequiredError('budgetLimitStore','Required parameter requestParameters.budgetLimitStore was null or undefined when calling storeBudgetLimit.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/limits`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BudgetLimitStoreToJSON(requestParameters.budgetLimitStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetLimitSingleFromJSON(jsonValue)); + } + + /** + * Store a new budget limit under this budget. + * Store new budget limit. + */ + async storeBudgetLimit(requestParameters: StoreBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeBudgetLimitRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing budget. This endpoint cannot be used to set budget amount limits. + * Update existing budget. + */ + async updateBudgetRaw(requestParameters: UpdateBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateBudget.'); + } + + if (requestParameters.budgetUpdate === null || requestParameters.budgetUpdate === undefined) { + throw new runtime.RequiredError('budgetUpdate','Required parameter requestParameters.budgetUpdate was null or undefined when calling updateBudget.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: BudgetUpdateToJSON(requestParameters.budgetUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetSingleFromJSON(jsonValue)); + } + + /** + * Update existing budget. This endpoint cannot be used to set budget amount limits. + * Update existing budget. + */ + async updateBudget(requestParameters: UpdateBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing budget limit. + * Update existing budget limit. + */ + async updateBudgetLimitRaw(requestParameters: UpdateBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateBudgetLimit.'); + } + + if (requestParameters.limitId === null || requestParameters.limitId === undefined) { + throw new runtime.RequiredError('limitId','Required parameter requestParameters.limitId was null or undefined when calling updateBudgetLimit.'); + } + + if (requestParameters.budgetLimit === null || requestParameters.budgetLimit === undefined) { + throw new runtime.RequiredError('budgetLimit','Required parameter requestParameters.budgetLimit was null or undefined when calling updateBudgetLimit.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/budgets/{id}/limits/{limitId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"limitId"}}`, encodeURIComponent(String(requestParameters.limitId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: BudgetLimitToJSON(requestParameters.budgetLimit), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetLimitSingleFromJSON(jsonValue)); + } + + /** + * Update existing budget limit. + * Update existing budget limit. + */ + async updateBudgetLimit(requestParameters: UpdateBudgetLimitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateBudgetLimitRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/CategoriesApi.ts b/src/lib/api/apis/CategoriesApi.ts new file mode 100644 index 0000000..676a5e4 --- /dev/null +++ b/src/lib/api/apis/CategoriesApi.ts @@ -0,0 +1,501 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + BadRequest, + Category, + CategoryArray, + CategorySingle, + CategoryUpdate, + InternalException, + NotFound, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + CategoryFromJSON, + CategoryToJSON, + CategoryArrayFromJSON, + CategoryArrayToJSON, + CategorySingleFromJSON, + CategorySingleToJSON, + CategoryUpdateFromJSON, + CategoryUpdateToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteCategoryRequest { + id: string; + xTraceId?: string; +} + +export interface GetCategoryRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; +} + +export interface ListAttachmentByCategoryRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListCategoryRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionByCategoryRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreCategoryRequest { + category: Category; + xTraceId?: string; +} + +export interface UpdateCategoryRequest { + id: string; + categoryUpdate: CategoryUpdate; + xTraceId?: string; +} + +/** + * + */ +export class CategoriesApi extends runtime.BaseAPI { + + /** + * Delete a category. Transactions will not be removed. + * Delete a category. + */ + async deleteCategoryRaw(requestParameters: DeleteCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteCategory.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a category. Transactions will not be removed. + * Delete a category. + */ + async deleteCategory(requestParameters: DeleteCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteCategoryRaw(requestParameters, initOverrides); + } + + /** + * Get a single category. + * Get a single category. + */ + async getCategoryRaw(requestParameters: GetCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CategorySingleFromJSON(jsonValue)); + } + + /** + * Get a single category. + * Get a single category. + */ + async getCategory(requestParameters: GetCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByCategoryRaw(requestParameters: ListAttachmentByCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listAttachmentByCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories/{id}/attachments`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByCategory(requestParameters: ListAttachmentByCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all categories. + * List all categories. + */ + async listCategoryRaw(requestParameters: ListCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CategoryArrayFromJSON(jsonValue)); + } + + /** + * List all categories. + * List all categories. + */ + async listCategory(requestParameters: ListCategoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all transactions in a category, optionally limited to the date ranges specified. + * List all transactions in a category. + */ + async listTransactionByCategoryRaw(requestParameters: ListTransactionByCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories/{id}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all transactions in a category, optionally limited to the date ranges specified. + * List all transactions in a category. + */ + async listTransactionByCategory(requestParameters: ListTransactionByCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new category. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new category + */ + async storeCategoryRaw(requestParameters: StoreCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.category === null || requestParameters.category === undefined) { + throw new runtime.RequiredError('category','Required parameter requestParameters.category was null or undefined when calling storeCategory.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CategoryToJSON(requestParameters.category), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CategorySingleFromJSON(jsonValue)); + } + + /** + * Creates a new category. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new category + */ + async storeCategory(requestParameters: StoreCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing category. + * Update existing category. + */ + async updateCategoryRaw(requestParameters: UpdateCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateCategory.'); + } + + if (requestParameters.categoryUpdate === null || requestParameters.categoryUpdate === undefined) { + throw new runtime.RequiredError('categoryUpdate','Required parameter requestParameters.categoryUpdate was null or undefined when calling updateCategory.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/categories/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: CategoryUpdateToJSON(requestParameters.categoryUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CategorySingleFromJSON(jsonValue)); + } + + /** + * Update existing category. + * Update existing category. + */ + async updateCategory(requestParameters: UpdateCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/ChartsApi.ts b/src/lib/api/apis/ChartsApi.ts new file mode 100644 index 0000000..f31964c --- /dev/null +++ b/src/lib/api/apis/ChartsApi.ts @@ -0,0 +1,109 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + ChartDataSet, + InternalException, + NotFound, + Unauthenticated, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + ChartDataSetFromJSON, + ChartDataSetToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface GetChartAccountOverviewRequest { + start: Date; + end: Date; + xTraceId?: string; +} + +/** + * + */ +export class ChartsApi extends runtime.BaseAPI { + + /** + * This endpoint returns the data required to generate a chart with basic asset account balance information. + * Dashboard chart with asset account balance information. + */ + async getChartAccountOverviewRaw(requestParameters: GetChartAccountOverviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling getChartAccountOverview.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling getChartAccountOverview.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/chart/account/overview`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ChartDataSetFromJSON)); + } + + /** + * This endpoint returns the data required to generate a chart with basic asset account balance information. + * Dashboard chart with asset account balance information. + */ + async getChartAccountOverview(requestParameters: GetChartAccountOverviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getChartAccountOverviewRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/ConfigurationApi.ts b/src/lib/api/apis/ConfigurationApi.ts new file mode 100644 index 0000000..4438523 --- /dev/null +++ b/src/lib/api/apis/ConfigurationApi.ts @@ -0,0 +1,239 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + ConfigValueFilter, + ConfigValueUpdateFilter, + ConfigurationSingle, + InternalException, + ModelConfiguration, + NotFound, + PolymorphicProperty, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + ConfigValueFilterFromJSON, + ConfigValueFilterToJSON, + ConfigValueUpdateFilterFromJSON, + ConfigValueUpdateFilterToJSON, + ConfigurationSingleFromJSON, + ConfigurationSingleToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + ModelConfigurationFromJSON, + ModelConfigurationToJSON, + NotFoundFromJSON, + NotFoundToJSON, + PolymorphicPropertyFromJSON, + PolymorphicPropertyToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface GetConfigurationRequest { + xTraceId?: string; +} + +export interface GetSingleConfigurationRequest { + name: ConfigValueFilter; + xTraceId?: string; +} + +export interface SetConfigurationRequest { + name: ConfigValueUpdateFilter; + value: PolymorphicProperty; + xTraceId?: string; +} + +/** + * + */ +export class ConfigurationApi extends runtime.BaseAPI { + + /** + * Returns all editable and not-editable configuration values for this Firefly III installation + * Get Firefly III system configuration values. + */ + async getConfigurationRaw(requestParameters: GetConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/configuration`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ModelConfigurationFromJSON)); + } + + /** + * Returns all editable and not-editable configuration values for this Firefly III installation + * Get Firefly III system configuration values. + */ + async getConfiguration(requestParameters: GetConfigurationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getConfigurationRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns one configuration variable for this Firefly III installation + * Get a single Firefly III system configuration value + */ + async getSingleConfigurationRaw(requestParameters: GetSingleConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getSingleConfiguration.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/configuration/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConfigurationSingleFromJSON(jsonValue)); + } + + /** + * Returns one configuration variable for this Firefly III installation + * Get a single Firefly III system configuration value + */ + async getSingleConfiguration(requestParameters: GetSingleConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getSingleConfigurationRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small. + * Update configuration value + */ + async setConfigurationRaw(requestParameters: SetConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling setConfiguration.'); + } + + if (requestParameters.value === null || requestParameters.value === undefined) { + throw new runtime.RequiredError('value','Required parameter requestParameters.value was null or undefined when calling setConfiguration.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + { contentType: 'application/json' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.value !== undefined) { + formParams.append('value', new Blob([JSON.stringify(PolymorphicPropertyToJSON(requestParameters.value))], { type: "application/json", })); + } + + const response = await this.request({ + path: `/v1/configuration/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConfigurationSingleFromJSON(jsonValue)); + } + + /** + * Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small. + * Update configuration value + */ + async setConfiguration(requestParameters: SetConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.setConfigurationRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/CurrenciesApi.ts b/src/lib/api/apis/CurrenciesApi.ts new file mode 100644 index 0000000..9223e4e --- /dev/null +++ b/src/lib/api/apis/CurrenciesApi.ts @@ -0,0 +1,1060 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AccountArray, + AccountTypeFilter, + AvailableBudgetArray, + BadRequest, + BillArray, + BudgetLimitArray, + CurrencyArray, + CurrencySingle, + CurrencyStore, + CurrencyUpdate, + InternalException, + NotFound, + RecurrenceArray, + RuleArray, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AccountArrayFromJSON, + AccountArrayToJSON, + AccountTypeFilterFromJSON, + AccountTypeFilterToJSON, + AvailableBudgetArrayFromJSON, + AvailableBudgetArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + BillArrayFromJSON, + BillArrayToJSON, + BudgetLimitArrayFromJSON, + BudgetLimitArrayToJSON, + CurrencyArrayFromJSON, + CurrencyArrayToJSON, + CurrencySingleFromJSON, + CurrencySingleToJSON, + CurrencyStoreFromJSON, + CurrencyStoreToJSON, + CurrencyUpdateFromJSON, + CurrencyUpdateToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + RecurrenceArrayFromJSON, + RecurrenceArrayToJSON, + RuleArrayFromJSON, + RuleArrayToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DefaultCurrencyRequest { + code: string; + xTraceId?: string; +} + +export interface DeleteCurrencyRequest { + code: string; + xTraceId?: string; +} + +export interface DisableCurrencyRequest { + code: string; + xTraceId?: string; +} + +export interface EnableCurrencyRequest { + code: string; + xTraceId?: string; +} + +export interface GetCurrencyRequest { + code: string; + xTraceId?: string; +} + +export interface GetDefaultCurrencyRequest { + xTraceId?: string; +} + +export interface ListAccountByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; + date?: Date; + type?: AccountTypeFilter; +} + +export interface ListAvailableBudgetByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListBillByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListBudgetLimitByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; +} + +export interface ListCurrencyRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListRecurrenceByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListRuleByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionByCurrencyRequest { + code: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreCurrencyRequest { + currencyStore: CurrencyStore; + xTraceId?: string; +} + +export interface UpdateCurrencyRequest { + code: string; + currencyUpdate: CurrencyUpdate; + xTraceId?: string; +} + +/** + * + */ +export class CurrenciesApi extends runtime.BaseAPI { + + /** + * Make this currency the default currency for the user. If the currency is not enabled, it will be enabled as well. + * Make currency default currency. + */ + async defaultCurrencyRaw(requestParameters: DefaultCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling defaultCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/default`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Make this currency the default currency for the user. If the currency is not enabled, it will be enabled as well. + * Make currency default currency. + */ + async defaultCurrency(requestParameters: DefaultCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.defaultCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a currency. + * Delete a currency. + */ + async deleteCurrencyRaw(requestParameters: DeleteCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling deleteCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a currency. + * Delete a currency. + */ + async deleteCurrency(requestParameters: DeleteCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteCurrencyRaw(requestParameters, initOverrides); + } + + /** + * Disable a currency. + * Disable a currency. + */ + async disableCurrencyRaw(requestParameters: DisableCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling disableCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/disable`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Disable a currency. + * Disable a currency. + */ + async disableCurrency(requestParameters: DisableCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.disableCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Enable a single currency. + * Enable a single currency. + */ + async enableCurrencyRaw(requestParameters: EnableCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling enableCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/enable`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Enable a single currency. + * Enable a single currency. + */ + async enableCurrency(requestParameters: EnableCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.enableCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a single currency. + * Get a single currency. + */ + async getCurrencyRaw(requestParameters: GetCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling getCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Get a single currency. + * Get a single currency. + */ + async getCurrency(requestParameters: GetCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get the user\'s default currency. + * Get the user\'s default currency. + */ + async getDefaultCurrencyRaw(requestParameters: GetDefaultCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/default`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Get the user\'s default currency. + * Get the user\'s default currency. + */ + async getDefaultCurrency(requestParameters: GetDefaultCurrencyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDefaultCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all accounts with this currency. + * List all accounts with this currency. + */ + async listAccountByCurrencyRaw(requestParameters: ListAccountByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listAccountByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.date !== undefined) { + queryParameters['date'] = (requestParameters.date as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/accounts`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountArrayFromJSON(jsonValue)); + } + + /** + * List all accounts with this currency. + * List all accounts with this currency. + */ + async listAccountByCurrency(requestParameters: ListAccountByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAccountByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all available budgets with this currency. + * List all available budgets with this currency. + */ + async listAvailableBudgetByCurrencyRaw(requestParameters: ListAvailableBudgetByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listAvailableBudgetByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/available-budgets`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AvailableBudgetArrayFromJSON(jsonValue)); + } + + /** + * List all available budgets with this currency. + * List all available budgets with this currency. + */ + async listAvailableBudgetByCurrency(requestParameters: ListAvailableBudgetByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAvailableBudgetByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all bills with this currency. + * List all bills with this currency. + */ + async listBillByCurrencyRaw(requestParameters: ListBillByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listBillByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/bills`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillArrayFromJSON(jsonValue)); + } + + /** + * List all bills with this currency. + * List all bills with this currency. + */ + async listBillByCurrency(requestParameters: ListBillByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBillByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all budget limits with this currency + * List all budget limits with this currency + */ + async listBudgetLimitByCurrencyRaw(requestParameters: ListBudgetLimitByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listBudgetLimitByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/budget_limits`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BudgetLimitArrayFromJSON(jsonValue)); + } + + /** + * List all budget limits with this currency + * List all budget limits with this currency + */ + async listBudgetLimitByCurrency(requestParameters: ListBudgetLimitByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBudgetLimitByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all currencies. + * List all currencies. + */ + async listCurrencyRaw(requestParameters: ListCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencyArrayFromJSON(jsonValue)); + } + + /** + * List all currencies. + * List all currencies. + */ + async listCurrency(requestParameters: ListCurrencyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all recurring transactions with this currency. + * List all recurring transactions with this currency. + */ + async listRecurrenceByCurrencyRaw(requestParameters: ListRecurrenceByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listRecurrenceByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/recurrences`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RecurrenceArrayFromJSON(jsonValue)); + } + + /** + * List all recurring transactions with this currency. + * List all recurring transactions with this currency. + */ + async listRecurrenceByCurrency(requestParameters: ListRecurrenceByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRecurrenceByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all rules with this currency. + * List all rules with this currency. + */ + async listRuleByCurrencyRaw(requestParameters: ListRuleByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listRuleByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/rules`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleArrayFromJSON(jsonValue)); + } + + /** + * List all rules with this currency. + * List all rules with this currency. + */ + async listRuleByCurrency(requestParameters: ListRuleByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRuleByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all transactions with this currency. + * List all transactions with this currency. + */ + async listTransactionByCurrencyRaw(requestParameters: ListTransactionByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling listTransactionByCurrency.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}/transactions`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all transactions with this currency. + * List all transactions with this currency. + */ + async listTransactionByCurrency(requestParameters: ListTransactionByCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new currency + */ + async storeCurrencyRaw(requestParameters: StoreCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.currencyStore === null || requestParameters.currencyStore === undefined) { + throw new runtime.RequiredError('currencyStore','Required parameter requestParameters.currencyStore was null or undefined when calling storeCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CurrencyStoreToJSON(requestParameters.currencyStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new currency + */ + async storeCurrency(requestParameters: StoreCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing currency. + * Update existing currency. + */ + async updateCurrencyRaw(requestParameters: UpdateCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.code === null || requestParameters.code === undefined) { + throw new runtime.RequiredError('code','Required parameter requestParameters.code was null or undefined when calling updateCurrency.'); + } + + if (requestParameters.currencyUpdate === null || requestParameters.currencyUpdate === undefined) { + throw new runtime.RequiredError('currencyUpdate','Required parameter requestParameters.currencyUpdate was null or undefined when calling updateCurrency.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.api+json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/currencies/{code}`.replace(`{${"code"}}`, encodeURIComponent(String(requestParameters.code))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: CurrencyUpdateToJSON(requestParameters.currencyUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CurrencySingleFromJSON(jsonValue)); + } + + /** + * Update existing currency. + * Update existing currency. + */ + async updateCurrency(requestParameters: UpdateCurrencyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateCurrencyRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/DataApi.ts b/src/lib/api/apis/DataApi.ts new file mode 100644 index 0000000..c76ae91 --- /dev/null +++ b/src/lib/api/apis/DataApi.ts @@ -0,0 +1,711 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + DataDestroyObject, + ExportFileFilter, + InternalException, + NotFound, + Unauthenticated, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + DataDestroyObjectFromJSON, + DataDestroyObjectToJSON, + ExportFileFilterFromJSON, + ExportFileFilterToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface BulkUpdateTransactionsRequest { + query: string; +} + +export interface DestroyDataRequest { + objects: DataDestroyObject; + xTraceId?: string; +} + +export interface ExportAccountsRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportBillsRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportBudgetsRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportCategoriesRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportPiggiesRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportRecurringRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportRulesRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportTagsRequest { + xTraceId?: string; + type?: ExportFileFilter; +} + +export interface ExportTransactionsRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: string; + type?: ExportFileFilter; +} + +export interface PurgeDataRequest { + xTraceId?: string; +} + +/** + * + */ +export class DataApi extends runtime.BaseAPI { + + /** + * Allows you to update transactions in bulk. + * Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials + */ + async bulkUpdateTransactionsRaw(requestParameters: BulkUpdateTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.query === null || requestParameters.query === undefined) { + throw new runtime.RequiredError('query','Required parameter requestParameters.query was null or undefined when calling bulkUpdateTransactions.'); + } + + const queryParameters: any = {}; + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/bulk/transactions`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Allows you to update transactions in bulk. + * Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials + */ + async bulkUpdateTransactions(requestParameters: BulkUpdateTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.bulkUpdateTransactionsRaw(requestParameters, initOverrides); + } + + /** + * A call to this endpoint deletes the requested data type. Use it with care and always with user permission. The demo user is incapable of using this endpoint. + * Endpoint to destroy user data + */ + async destroyDataRaw(requestParameters: DestroyDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.objects === null || requestParameters.objects === undefined) { + throw new runtime.RequiredError('objects','Required parameter requestParameters.objects was null or undefined when calling destroyData.'); + } + + const queryParameters: any = {}; + + if (requestParameters.objects !== undefined) { + queryParameters['objects'] = requestParameters.objects; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/destroy`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * A call to this endpoint deletes the requested data type. Use it with care and always with user permission. The demo user is incapable of using this endpoint. + * Endpoint to destroy user data + */ + async destroyData(requestParameters: DestroyDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.destroyDataRaw(requestParameters, initOverrides); + } + + /** + * This endpoint allows you to export your accounts from Firefly III into a file. Currently supports CSV exports only. + * Export account data from Firefly III + */ + async exportAccountsRaw(requestParameters: ExportAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/accounts`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your accounts from Firefly III into a file. Currently supports CSV exports only. + * Export account data from Firefly III + */ + async exportAccounts(requestParameters: ExportAccountsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportAccountsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your bills from Firefly III into a file. Currently supports CSV exports only. + * Export bills from Firefly III + */ + async exportBillsRaw(requestParameters: ExportBillsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/bills`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your bills from Firefly III into a file. Currently supports CSV exports only. + * Export bills from Firefly III + */ + async exportBills(requestParameters: ExportBillsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportBillsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your budgets and associated budget data from Firefly III into a file. Currently supports CSV exports only. + * Export budgets and budget amount data from Firefly III + */ + async exportBudgetsRaw(requestParameters: ExportBudgetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/budgets`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your budgets and associated budget data from Firefly III into a file. Currently supports CSV exports only. + * Export budgets and budget amount data from Firefly III + */ + async exportBudgets(requestParameters: ExportBudgetsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportBudgetsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your categories from Firefly III into a file. Currently supports CSV exports only. + * Export category data from Firefly III + */ + async exportCategoriesRaw(requestParameters: ExportCategoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/categories`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your categories from Firefly III into a file. Currently supports CSV exports only. + * Export category data from Firefly III + */ + async exportCategories(requestParameters: ExportCategoriesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportCategoriesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your piggy banks from Firefly III into a file. Currently supports CSV exports only. + * Export piggy banks from Firefly III + */ + async exportPiggiesRaw(requestParameters: ExportPiggiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/piggy-banks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your piggy banks from Firefly III into a file. Currently supports CSV exports only. + * Export piggy banks from Firefly III + */ + async exportPiggies(requestParameters: ExportPiggiesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportPiggiesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your recurring transactions from Firefly III into a file. Currently supports CSV exports only. + * Export recurring transaction data from Firefly III + */ + async exportRecurringRaw(requestParameters: ExportRecurringRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/recurring`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your recurring transactions from Firefly III into a file. Currently supports CSV exports only. + * Export recurring transaction data from Firefly III + */ + async exportRecurring(requestParameters: ExportRecurringRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportRecurringRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your rules and rule groups from Firefly III into a file. Currently supports CSV exports only. + * Export rule groups and rule data from Firefly III + */ + async exportRulesRaw(requestParameters: ExportRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/rules`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your rules and rule groups from Firefly III into a file. Currently supports CSV exports only. + * Export rule groups and rule data from Firefly III + */ + async exportRules(requestParameters: ExportRulesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportRulesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export your tags from Firefly III into a file. Currently supports CSV exports only. + * Export tag data from Firefly III + */ + async exportTagsRaw(requestParameters: ExportTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/tags`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export your tags from Firefly III into a file. Currently supports CSV exports only. + * Export tag data from Firefly III + */ + async exportTags(requestParameters: ExportTagsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint allows you to export transactions from Firefly III into a file. Currently supports CSV exports only. + * Export transaction data from Firefly III + */ + async exportTransactionsRaw(requestParameters: ExportTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling exportTransactions.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling exportTransactions.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts !== undefined) { + queryParameters['accounts'] = requestParameters.accounts; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/export/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * This endpoint allows you to export transactions from Firefly III into a file. Currently supports CSV exports only. + * Export transaction data from Firefly III + */ + async exportTransactions(requestParameters: ExportTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportTransactionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A call to this endpoint purges all previously deleted data. Use it with care and always with user permission. The demo user is incapable of using this endpoint. + * Endpoint to purge user data + */ + async purgeDataRaw(requestParameters: PurgeDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/data/purge`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * A call to this endpoint purges all previously deleted data. Use it with care and always with user permission. The demo user is incapable of using this endpoint. + * Endpoint to purge user data + */ + async purgeData(requestParameters: PurgeDataRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.purgeDataRaw(requestParameters, initOverrides); + } + +} diff --git a/src/lib/api/apis/InsightApi.ts b/src/lib/api/apis/InsightApi.ts new file mode 100644 index 0000000..ffcdf3c --- /dev/null +++ b/src/lib/api/apis/InsightApi.ts @@ -0,0 +1,1816 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InsightGroupEntry, + InsightTotalEntry, + InsightTransferEntry, + InternalException, + NotFound, + Unauthenticated, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InsightGroupEntryFromJSON, + InsightGroupEntryToJSON, + InsightTotalEntryFromJSON, + InsightTotalEntryToJSON, + InsightTransferEntryFromJSON, + InsightTransferEntryToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface InsightExpenseAssetRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightExpenseBillRequest { + start: Date; + end: Date; + xTraceId?: string; + bills?: Array; + accounts?: Array; +} + +export interface InsightExpenseBudgetRequest { + start: Date; + end: Date; + xTraceId?: string; + budgets?: Array; + accounts?: Array; +} + +export interface InsightExpenseCategoryRequest { + start: Date; + end: Date; + xTraceId?: string; + categories?: Array; + accounts?: Array; +} + +export interface InsightExpenseExpenseRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightExpenseNoBillRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightExpenseNoBudgetRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightExpenseNoCategoryRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightExpenseNoTagRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightExpenseTagRequest { + start: Date; + end: Date; + xTraceId?: string; + tags?: Array; + accounts?: Array; +} + +export interface InsightExpenseTotalRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightIncomeAssetRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightIncomeCategoryRequest { + start: Date; + end: Date; + xTraceId?: string; + categories?: Array; + accounts?: Array; +} + +export interface InsightIncomeNoCategoryRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightIncomeNoTagRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightIncomeRevenueRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightIncomeTagRequest { + start: Date; + end: Date; + xTraceId?: string; + tags?: Array; + accounts?: Array; +} + +export interface InsightIncomeTotalRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightTransferCategoryRequest { + start: Date; + end: Date; + xTraceId?: string; + categories?: Array; + accounts?: Array; +} + +export interface InsightTransferNoCategoryRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightTransferNoTagRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightTransferTagRequest { + start: Date; + end: Date; + xTraceId?: string; + tags?: Array; + accounts?: Array; +} + +export interface InsightTransferTotalRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +export interface InsightTransfersRequest { + start: Date; + end: Date; + xTraceId?: string; + accounts?: Array; +} + +/** + * + */ +export class InsightApi extends runtime.BaseAPI { + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by asset account. + * Insight into expenses, grouped by asset account. + */ + async insightExpenseAssetRaw(requestParameters: InsightExpenseAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseAsset.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseAsset.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/asset`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by asset account. + * Insight into expenses, grouped by asset account. + */ + async insightExpenseAsset(requestParameters: InsightExpenseAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseAssetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) bill. + * Insight into expenses, grouped by bill. + */ + async insightExpenseBillRaw(requestParameters: InsightExpenseBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseBill.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseBill.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.bills) { + queryParameters['bills[]'] = requestParameters.bills; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/bill`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) bill. + * Insight into expenses, grouped by bill. + */ + async insightExpenseBill(requestParameters: InsightExpenseBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) budget. + * Insight into expenses, grouped by budget. + */ + async insightExpenseBudgetRaw(requestParameters: InsightExpenseBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseBudget.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseBudget.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.budgets) { + queryParameters['budgets[]'] = requestParameters.budgets; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/budget`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) budget. + * Insight into expenses, grouped by budget. + */ + async insightExpenseBudget(requestParameters: InsightExpenseBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) category. + * Insight into expenses, grouped by category. + */ + async insightExpenseCategoryRaw(requestParameters: InsightExpenseCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseCategory.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.categories) { + queryParameters['categories[]'] = requestParameters.categories; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/category`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) category. + * Insight into expenses, grouped by category. + */ + async insightExpenseCategory(requestParameters: InsightExpenseCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by expense account. + * Insight into expenses, grouped by expense account. + */ + async insightExpenseExpenseRaw(requestParameters: InsightExpenseExpenseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseExpense.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseExpense.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/expense`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by expense account. + * Insight into expenses, grouped by expense account. + */ + async insightExpenseExpense(requestParameters: InsightExpenseExpenseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseExpenseRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no bill. + * Insight into expenses, without bill. + */ + async insightExpenseNoBillRaw(requestParameters: InsightExpenseNoBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseNoBill.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseNoBill.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/no-bill`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no bill. + * Insight into expenses, without bill. + */ + async insightExpenseNoBill(requestParameters: InsightExpenseNoBillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseNoBillRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no budget. + * Insight into expenses, without budget. + */ + async insightExpenseNoBudgetRaw(requestParameters: InsightExpenseNoBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseNoBudget.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseNoBudget.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/no-budget`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no budget. + * Insight into expenses, without budget. + */ + async insightExpenseNoBudget(requestParameters: InsightExpenseNoBudgetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseNoBudgetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no category. + * Insight into expenses, without category. + */ + async insightExpenseNoCategoryRaw(requestParameters: InsightExpenseNoCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseNoCategory.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseNoCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/no-category`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no category. + * Insight into expenses, without category. + */ + async insightExpenseNoCategory(requestParameters: InsightExpenseNoCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseNoCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no tag. + * Insight into expenses, without tag. + */ + async insightExpenseNoTagRaw(requestParameters: InsightExpenseNoTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseNoTag.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseNoTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/no-tag`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, including only expenses with no tag. + * Insight into expenses, without tag. + */ + async insightExpenseNoTag(requestParameters: InsightExpenseNoTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseNoTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) tag. + * Insight into expenses, grouped by tag. + */ + async insightExpenseTagRaw(requestParameters: InsightExpenseTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseTag.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.tags) { + queryParameters['tags[]'] = requestParameters.tags; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/tag`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the expenses made by the user, grouped by (any) tag. + * Insight into expenses, grouped by tag. + */ + async insightExpenseTag(requestParameters: InsightExpenseTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a sum of the total expenses made by the user. + * Insight into total expenses. + */ + async insightExpenseTotalRaw(requestParameters: InsightExpenseTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightExpenseTotal.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightExpenseTotal.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/expense/total`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a sum of the total expenses made by the user. + * Insight into total expenses. + */ + async insightExpenseTotal(requestParameters: InsightExpenseTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightExpenseTotalRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by asset account. + * Insight into income, grouped by asset account. + */ + async insightIncomeAssetRaw(requestParameters: InsightIncomeAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeAsset.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeAsset.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/asset`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by asset account. + * Insight into income, grouped by asset account. + */ + async insightIncomeAsset(requestParameters: InsightIncomeAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeAssetRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by (any) category. + * Insight into income, grouped by category. + */ + async insightIncomeCategoryRaw(requestParameters: InsightIncomeCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeCategory.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.categories) { + queryParameters['categories[]'] = requestParameters.categories; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/category`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by (any) category. + * Insight into income, grouped by category. + */ + async insightIncomeCategory(requestParameters: InsightIncomeCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the income received by the user, including only income with no category. + * Insight into income, without category. + */ + async insightIncomeNoCategoryRaw(requestParameters: InsightIncomeNoCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeNoCategory.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeNoCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/no-category`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the income received by the user, including only income with no category. + * Insight into income, without category. + */ + async insightIncomeNoCategory(requestParameters: InsightIncomeNoCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeNoCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the income received by the user, including only income with no tag. + * Insight into income, without tag. + */ + async insightIncomeNoTagRaw(requestParameters: InsightIncomeNoTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeNoTag.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeNoTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/no-tag`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the income received by the user, including only income with no tag. + * Insight into income, without tag. + */ + async insightIncomeNoTag(requestParameters: InsightIncomeNoTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeNoTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by revenue account. + * Insight into income, grouped by revenue account. + */ + async insightIncomeRevenueRaw(requestParameters: InsightIncomeRevenueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeRevenue.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeRevenue.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/revenue`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by revenue account. + * Insight into income, grouped by revenue account. + */ + async insightIncomeRevenue(requestParameters: InsightIncomeRevenueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeRevenueRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by (any) tag. + * Insight into income, grouped by tag. + */ + async insightIncomeTagRaw(requestParameters: InsightIncomeTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeTag.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.tags) { + queryParameters['tags[]'] = requestParameters.tags; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/tag`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the income received by the user, grouped by (any) tag. + * Insight into income, grouped by tag. + */ + async insightIncomeTag(requestParameters: InsightIncomeTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a sum of the total income received by the user. + * Insight into total income. + */ + async insightIncomeTotalRaw(requestParameters: InsightIncomeTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightIncomeTotal.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightIncomeTotal.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/income/total`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a sum of the total income received by the user. + * Insight into total income. + */ + async insightIncomeTotal(requestParameters: InsightIncomeTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightIncomeTotalRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the transfers made by the user, grouped by (any) category. + * Insight into transfers, grouped by category. + */ + async insightTransferCategoryRaw(requestParameters: InsightTransferCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightTransferCategory.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightTransferCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.categories) { + queryParameters['categories[]'] = requestParameters.categories; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/transfer/category`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the transfers made by the user, grouped by (any) category. + * Insight into transfers, grouped by category. + */ + async insightTransferCategory(requestParameters: InsightTransferCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightTransferCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the transfers made by the user, including only transfers with no category. + * Insight into transfers, without category. + */ + async insightTransferNoCategoryRaw(requestParameters: InsightTransferNoCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightTransferNoCategory.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightTransferNoCategory.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/transfer/no-category`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the transfers made by the user, including only transfers with no category. + * Insight into transfers, without category. + */ + async insightTransferNoCategory(requestParameters: InsightTransferNoCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightTransferNoCategoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the transfers made by the user, including only transfers with no tag. + * Insight into expenses, without tag. + */ + async insightTransferNoTagRaw(requestParameters: InsightTransferNoTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightTransferNoTag.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightTransferNoTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/transfer/no-tag`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the transfers made by the user, including only transfers with no tag. + * Insight into expenses, without tag. + */ + async insightTransferNoTag(requestParameters: InsightTransferNoTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightTransferNoTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the transfers created by the user, grouped by (any) tag. + * Insight into transfers, grouped by tag. + */ + async insightTransferTagRaw(requestParameters: InsightTransferTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightTransferTag.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightTransferTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.tags) { + queryParameters['tags[]'] = requestParameters.tags; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/transfer/tag`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightGroupEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the transfers created by the user, grouped by (any) tag. + * Insight into transfers, grouped by tag. + */ + async insightTransferTag(requestParameters: InsightTransferTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightTransferTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a sum of the total amount transfers made by the user. + * Insight into total transfers. + */ + async insightTransferTotalRaw(requestParameters: InsightTransferTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightTransferTotal.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightTransferTotal.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/transfer/total`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTotalEntryFromJSON)); + } + + /** + * This endpoint gives a sum of the total amount transfers made by the user. + * Insight into total transfers. + */ + async insightTransferTotal(requestParameters: InsightTransferTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightTransferTotalRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint gives a summary of the transfers made by the user, grouped by asset account or lability. + * Insight into transfers, grouped by account. + */ + async insightTransfersRaw(requestParameters: InsightTransfersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling insightTransfers.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling insightTransfers.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/insight/transfer/asset`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InsightTransferEntryFromJSON)); + } + + /** + * This endpoint gives a summary of the transfers made by the user, grouped by asset account or lability. + * Insight into transfers, grouped by account. + */ + async insightTransfers(requestParameters: InsightTransfersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.insightTransfersRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/LinksApi.ts b/src/lib/api/apis/LinksApi.ts new file mode 100644 index 0000000..2b0509d --- /dev/null +++ b/src/lib/api/apis/LinksApi.ts @@ -0,0 +1,721 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + LinkType, + LinkTypeArray, + LinkTypeSingle, + LinkTypeUpdate, + NotFound, + TransactionArray, + TransactionLinkArray, + TransactionLinkSingle, + TransactionLinkStore, + TransactionLinkUpdate, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + LinkTypeFromJSON, + LinkTypeToJSON, + LinkTypeArrayFromJSON, + LinkTypeArrayToJSON, + LinkTypeSingleFromJSON, + LinkTypeSingleToJSON, + LinkTypeUpdateFromJSON, + LinkTypeUpdateToJSON, + NotFoundFromJSON, + NotFoundToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionLinkArrayFromJSON, + TransactionLinkArrayToJSON, + TransactionLinkSingleFromJSON, + TransactionLinkSingleToJSON, + TransactionLinkStoreFromJSON, + TransactionLinkStoreToJSON, + TransactionLinkUpdateFromJSON, + TransactionLinkUpdateToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteLinkTypeRequest { + id: string; + xTraceId?: string; +} + +export interface DeleteTransactionLinkRequest { + id: string; + xTraceId?: string; +} + +export interface GetLinkTypeRequest { + id: string; + xTraceId?: string; +} + +export interface GetTransactionLinkRequest { + id: string; + xTraceId?: string; +} + +export interface ListLinkTypeRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionByLinkTypeRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface ListTransactionLinkRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StoreLinkTypeRequest { + linkType: LinkType; + xTraceId?: string; +} + +export interface StoreTransactionLinkRequest { + transactionLinkStore: TransactionLinkStore; + xTraceId?: string; +} + +export interface UpdateLinkTypeRequest { + id: string; + linkTypeUpdate: LinkTypeUpdate; + xTraceId?: string; +} + +export interface UpdateTransactionLinkRequest { + id: string; + transactionLinkUpdate: TransactionLinkUpdate; + xTraceId?: string; +} + +/** + * + */ +export class LinksApi extends runtime.BaseAPI { + + /** + * Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it. + * Permanently delete link type. + */ + async deleteLinkTypeRaw(requestParameters: DeleteLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteLinkType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/link-types/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it. + * Permanently delete link type. + */ + async deleteLinkType(requestParameters: DeleteLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteLinkTypeRaw(requestParameters, initOverrides); + } + + /** + * Will permanently delete link. Transactions remain. + * Permanently delete link between transactions. + */ + async deleteTransactionLinkRaw(requestParameters: DeleteTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteTransactionLink.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-links/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Will permanently delete link. Transactions remain. + * Permanently delete link between transactions. + */ + async deleteTransactionLink(requestParameters: DeleteTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteTransactionLinkRaw(requestParameters, initOverrides); + } + + /** + * Returns a single link type by its ID. + * Get single a link type. + */ + async getLinkTypeRaw(requestParameters: GetLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getLinkType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/link-types/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => LinkTypeSingleFromJSON(jsonValue)); + } + + /** + * Returns a single link type by its ID. + * Get single a link type. + */ + async getLinkType(requestParameters: GetLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getLinkTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns a single link by its ID. + * Get a single link. + */ + async getTransactionLinkRaw(requestParameters: GetTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getTransactionLink.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-links/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionLinkSingleFromJSON(jsonValue)); + } + + /** + * Returns a single link by its ID. + * Get a single link. + */ + async getTransactionLink(requestParameters: GetTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTransactionLinkRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the link types the system has. These include the default ones as well as any new ones. + * List all types of links. + */ + async listLinkTypeRaw(requestParameters: ListLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/link-types`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => LinkTypeArrayFromJSON(jsonValue)); + } + + /** + * List all the link types the system has. These include the default ones as well as any new ones. + * List all types of links. + */ + async listLinkType(requestParameters: ListLinkTypeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listLinkTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all transactions under this link type, both the inward and outward transactions. + * List all transactions under this link type. + */ + async listTransactionByLinkTypeRaw(requestParameters: ListTransactionByLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByLinkType.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/link-types/{id}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all transactions under this link type, both the inward and outward transactions. + * List all transactions under this link type. + */ + async listTransactionByLinkType(requestParameters: ListTransactionByLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByLinkTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the transaction links. + * List all transaction links. + */ + async listTransactionLinkRaw(requestParameters: ListTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-links`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionLinkArrayFromJSON(jsonValue)); + } + + /** + * List all the transaction links. + * List all transaction links. + */ + async listTransactionLink(requestParameters: ListTransactionLinkRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionLinkRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). + * Create a new link type + */ + async storeLinkTypeRaw(requestParameters: StoreLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.linkType === null || requestParameters.linkType === undefined) { + throw new runtime.RequiredError('linkType','Required parameter requestParameters.linkType was null or undefined when calling storeLinkType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/link-types`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: LinkTypeToJSON(requestParameters.linkType), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => LinkTypeSingleFromJSON(jsonValue)); + } + + /** + * Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). + * Create a new link type + */ + async storeLinkType(requestParameters: StoreLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeLinkTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Store a new link between two transactions. For this end point you need the journal_id from a transaction. + * Create a new link between transactions + */ + async storeTransactionLinkRaw(requestParameters: StoreTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.transactionLinkStore === null || requestParameters.transactionLinkStore === undefined) { + throw new runtime.RequiredError('transactionLinkStore','Required parameter requestParameters.transactionLinkStore was null or undefined when calling storeTransactionLink.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-links`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TransactionLinkStoreToJSON(requestParameters.transactionLinkStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionLinkSingleFromJSON(jsonValue)); + } + + /** + * Store a new link between two transactions. For this end point you need the journal_id from a transaction. + * Create a new link between transactions + */ + async storeTransactionLink(requestParameters: StoreTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeTransactionLinkRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable=false flag when you list it. + * Update existing link type. + */ + async updateLinkTypeRaw(requestParameters: UpdateLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateLinkType.'); + } + + if (requestParameters.linkTypeUpdate === null || requestParameters.linkTypeUpdate === undefined) { + throw new runtime.RequiredError('linkTypeUpdate','Required parameter requestParameters.linkTypeUpdate was null or undefined when calling updateLinkType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/link-types/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: LinkTypeUpdateToJSON(requestParameters.linkTypeUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => LinkTypeSingleFromJSON(jsonValue)); + } + + /** + * Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable=false flag when you list it. + * Update existing link type. + */ + async updateLinkType(requestParameters: UpdateLinkTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateLinkTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Used to update a single existing link. + * Update an existing link between transactions. + */ + async updateTransactionLinkRaw(requestParameters: UpdateTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateTransactionLink.'); + } + + if (requestParameters.transactionLinkUpdate === null || requestParameters.transactionLinkUpdate === undefined) { + throw new runtime.RequiredError('transactionLinkUpdate','Required parameter requestParameters.transactionLinkUpdate was null or undefined when calling updateTransactionLink.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-links/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: TransactionLinkUpdateToJSON(requestParameters.transactionLinkUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionLinkSingleFromJSON(jsonValue)); + } + + /** + * Used to update a single existing link. + * Update an existing link between transactions. + */ + async updateTransactionLink(requestParameters: UpdateTransactionLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTransactionLinkRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/ObjectGroupsApi.ts b/src/lib/api/apis/ObjectGroupsApi.ts new file mode 100644 index 0000000..f98f5b7 --- /dev/null +++ b/src/lib/api/apis/ObjectGroupsApi.ts @@ -0,0 +1,413 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + BillArray, + InternalException, + NotFound, + ObjectGroupArray, + ObjectGroupSingle, + ObjectGroupUpdate, + PiggyBankArray, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + BillArrayFromJSON, + BillArrayToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + ObjectGroupArrayFromJSON, + ObjectGroupArrayToJSON, + ObjectGroupSingleFromJSON, + ObjectGroupSingleToJSON, + ObjectGroupUpdateFromJSON, + ObjectGroupUpdateToJSON, + PiggyBankArrayFromJSON, + PiggyBankArrayToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteObjectGroupRequest { + id: string; + xTraceId?: string; +} + +export interface GetObjectGroupRequest { + id: string; + xTraceId?: string; +} + +export interface ListBillByObjectGroupRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListObjectGroupsRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListPiggyBankByObjectGroupRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface UpdateObjectGroupRequest { + id: string; + objectGroupUpdate: ObjectGroupUpdate; + xTraceId?: string; +} + +/** + * + */ +export class ObjectGroupsApi extends runtime.BaseAPI { + + /** + * Delete a object group. + * Delete a object group. + */ + async deleteObjectGroupRaw(requestParameters: DeleteObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteObjectGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/object-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a object group. + * Delete a object group. + */ + async deleteObjectGroup(requestParameters: DeleteObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteObjectGroupRaw(requestParameters, initOverrides); + } + + /** + * Get a single object group. + * Get a single object group. + */ + async getObjectGroupRaw(requestParameters: GetObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getObjectGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/object-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ObjectGroupSingleFromJSON(jsonValue)); + } + + /** + * Get a single object group. + * Get a single object group. + */ + async getObjectGroup(requestParameters: GetObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getObjectGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all bills with this object group. + * List all bills with this object group. + */ + async listBillByObjectGroupRaw(requestParameters: ListBillByObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listBillByObjectGroup.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/object-groups/{id}/bills`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BillArrayFromJSON(jsonValue)); + } + + /** + * List all bills with this object group. + * List all bills with this object group. + */ + async listBillByObjectGroup(requestParameters: ListBillByObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBillByObjectGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all oject groups. + * List all oject groups. + */ + async listObjectGroupsRaw(requestParameters: ListObjectGroupsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/object-groups`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ObjectGroupArrayFromJSON(jsonValue)); + } + + /** + * List all oject groups. + * List all oject groups. + */ + async listObjectGroups(requestParameters: ListObjectGroupsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listObjectGroupsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint returns a list of all the piggy banks connected to the object group. + * List all piggy banks related to the object group. + */ + async listPiggyBankByObjectGroupRaw(requestParameters: ListPiggyBankByObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listPiggyBankByObjectGroup.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/object-groups/{id}/piggy-banks`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankArrayFromJSON(jsonValue)); + } + + /** + * This endpoint returns a list of all the piggy banks connected to the object group. + * List all piggy banks related to the object group. + */ + async listPiggyBankByObjectGroup(requestParameters: ListPiggyBankByObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPiggyBankByObjectGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing object group. + * Update existing object group. + */ + async updateObjectGroupRaw(requestParameters: UpdateObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateObjectGroup.'); + } + + if (requestParameters.objectGroupUpdate === null || requestParameters.objectGroupUpdate === undefined) { + throw new runtime.RequiredError('objectGroupUpdate','Required parameter requestParameters.objectGroupUpdate was null or undefined when calling updateObjectGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/object-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: ObjectGroupUpdateToJSON(requestParameters.objectGroupUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ObjectGroupSingleFromJSON(jsonValue)); + } + + /** + * Update existing object group. + * Update existing object group. + */ + async updateObjectGroup(requestParameters: UpdateObjectGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateObjectGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/PiggyBanksApi.ts b/src/lib/api/apis/PiggyBanksApi.ts new file mode 100644 index 0000000..d440dd6 --- /dev/null +++ b/src/lib/api/apis/PiggyBanksApi.ts @@ -0,0 +1,473 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + BadRequest, + InternalException, + NotFound, + PiggyBankArray, + PiggyBankEventArray, + PiggyBankSingle, + PiggyBankStore, + PiggyBankUpdate, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + PiggyBankArrayFromJSON, + PiggyBankArrayToJSON, + PiggyBankEventArrayFromJSON, + PiggyBankEventArrayToJSON, + PiggyBankSingleFromJSON, + PiggyBankSingleToJSON, + PiggyBankStoreFromJSON, + PiggyBankStoreToJSON, + PiggyBankUpdateFromJSON, + PiggyBankUpdateToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeletePiggyBankRequest { + id: string; + xTraceId?: string; +} + +export interface GetPiggyBankRequest { + id: string; + xTraceId?: string; +} + +export interface ListAttachmentByPiggyBankRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListEventByPiggyBankRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListPiggyBankRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StorePiggyBankRequest { + piggyBankStore: PiggyBankStore; + xTraceId?: string; +} + +export interface UpdatePiggyBankRequest { + id: string; + piggyBankUpdate: PiggyBankUpdate; + xTraceId?: string; +} + +/** + * + */ +export class PiggyBanksApi extends runtime.BaseAPI { + + /** + * Delete a piggy bank. + * Delete a piggy bank. + */ + async deletePiggyBankRaw(requestParameters: DeletePiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deletePiggyBank.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a piggy bank. + * Delete a piggy bank. + */ + async deletePiggyBank(requestParameters: DeletePiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deletePiggyBankRaw(requestParameters, initOverrides); + } + + /** + * Get a single piggy bank. + * Get a single piggy bank. + */ + async getPiggyBankRaw(requestParameters: GetPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getPiggyBank.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankSingleFromJSON(jsonValue)); + } + + /** + * Get a single piggy bank. + * Get a single piggy bank. + */ + async getPiggyBank(requestParameters: GetPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPiggyBankRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByPiggyBankRaw(requestParameters: ListAttachmentByPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listAttachmentByPiggyBank.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks/{id}/attachments`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByPiggyBank(requestParameters: ListAttachmentByPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByPiggyBankRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all events linked to a piggy bank (adding and removing money). + * List all events linked to a piggy bank. + */ + async listEventByPiggyBankRaw(requestParameters: ListEventByPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listEventByPiggyBank.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks/{id}/events`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankEventArrayFromJSON(jsonValue)); + } + + /** + * List all events linked to a piggy bank (adding and removing money). + * List all events linked to a piggy bank. + */ + async listEventByPiggyBank(requestParameters: ListEventByPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listEventByPiggyBankRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all piggy banks. + * List all piggy banks. + */ + async listPiggyBankRaw(requestParameters: ListPiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankArrayFromJSON(jsonValue)); + } + + /** + * List all piggy banks. + * List all piggy banks. + */ + async listPiggyBank(requestParameters: ListPiggyBankRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPiggyBankRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new piggy bank. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new piggy bank + */ + async storePiggyBankRaw(requestParameters: StorePiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.piggyBankStore === null || requestParameters.piggyBankStore === undefined) { + throw new runtime.RequiredError('piggyBankStore','Required parameter requestParameters.piggyBankStore was null or undefined when calling storePiggyBank.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PiggyBankStoreToJSON(requestParameters.piggyBankStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankSingleFromJSON(jsonValue)); + } + + /** + * Creates a new piggy bank. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new piggy bank + */ + async storePiggyBank(requestParameters: StorePiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storePiggyBankRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing piggy bank. + * Update existing piggy bank. + */ + async updatePiggyBankRaw(requestParameters: UpdatePiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updatePiggyBank.'); + } + + if (requestParameters.piggyBankUpdate === null || requestParameters.piggyBankUpdate === undefined) { + throw new runtime.RequiredError('piggyBankUpdate','Required parameter requestParameters.piggyBankUpdate was null or undefined when calling updatePiggyBank.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/piggy-banks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PiggyBankUpdateToJSON(requestParameters.piggyBankUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankSingleFromJSON(jsonValue)); + } + + /** + * Update existing piggy bank. + * Update existing piggy bank. + */ + async updatePiggyBank(requestParameters: UpdatePiggyBankRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePiggyBankRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/PreferencesApi.ts b/src/lib/api/apis/PreferencesApi.ts new file mode 100644 index 0000000..fbfe527 --- /dev/null +++ b/src/lib/api/apis/PreferencesApi.ts @@ -0,0 +1,286 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + NotFound, + Preference, + PreferenceArray, + PreferenceSingle, + PreferenceUpdate, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + PreferenceFromJSON, + PreferenceToJSON, + PreferenceArrayFromJSON, + PreferenceArrayToJSON, + PreferenceSingleFromJSON, + PreferenceSingleToJSON, + PreferenceUpdateFromJSON, + PreferenceUpdateToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface GetPreferenceRequest { + name: string; + xTraceId?: string; +} + +export interface ListPreferenceRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StorePreferenceRequest { + preference: Preference; + xTraceId?: string; +} + +export interface UpdatePreferenceRequest { + name: string; + preferenceUpdate: PreferenceUpdate; + xTraceId?: string; +} + +/** + * + */ +export class PreferencesApi extends runtime.BaseAPI { + + /** + * Return a single preference and the value. + * Return a single preference. + */ + async getPreferenceRaw(requestParameters: GetPreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getPreference.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/preferences/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PreferenceSingleFromJSON(jsonValue)); + } + + /** + * Return a single preference and the value. + * Return a single preference. + */ + async getPreference(requestParameters: GetPreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPreferenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all of the preferences of the user. + * List all users preferences. + */ + async listPreferenceRaw(requestParameters: ListPreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/preferences`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PreferenceArrayFromJSON(jsonValue)); + } + + /** + * List all of the preferences of the user. + * List all users preferences. + */ + async listPreference(requestParameters: ListPreferenceRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPreferenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app. + * Store a new preference for this user. + */ + async storePreferenceRaw(requestParameters: StorePreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.preference === null || requestParameters.preference === undefined) { + throw new runtime.RequiredError('preference','Required parameter requestParameters.preference was null or undefined when calling storePreference.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/preferences`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PreferenceToJSON(requestParameters.preference), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PreferenceSingleFromJSON(jsonValue)); + } + + /** + * This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app. + * Store a new preference for this user. + */ + async storePreference(requestParameters: StorePreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storePreferenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a user\'s preference. + * Update preference + */ + async updatePreferenceRaw(requestParameters: UpdatePreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updatePreference.'); + } + + if (requestParameters.preferenceUpdate === null || requestParameters.preferenceUpdate === undefined) { + throw new runtime.RequiredError('preferenceUpdate','Required parameter requestParameters.preferenceUpdate was null or undefined when calling updatePreference.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/preferences/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PreferenceUpdateToJSON(requestParameters.preferenceUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PreferenceSingleFromJSON(jsonValue)); + } + + /** + * Update a user\'s preference. + * Update preference + */ + async updatePreference(requestParameters: UpdatePreferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePreferenceRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/RecurrencesApi.ts b/src/lib/api/apis/RecurrencesApi.ts new file mode 100644 index 0000000..c2a59de --- /dev/null +++ b/src/lib/api/apis/RecurrencesApi.ts @@ -0,0 +1,424 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + NotFound, + RecurrenceArray, + RecurrenceSingle, + RecurrenceStore, + RecurrenceUpdate, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + RecurrenceArrayFromJSON, + RecurrenceArrayToJSON, + RecurrenceSingleFromJSON, + RecurrenceSingleToJSON, + RecurrenceStoreFromJSON, + RecurrenceStoreToJSON, + RecurrenceUpdateFromJSON, + RecurrenceUpdateToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteRecurrenceRequest { + id: string; + xTraceId?: string; +} + +export interface GetRecurrenceRequest { + id: string; + xTraceId?: string; +} + +export interface ListRecurrenceRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionByRecurrenceRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreRecurrenceRequest { + recurrenceStore: RecurrenceStore; + xTraceId?: string; +} + +export interface UpdateRecurrenceRequest { + id: string; + recurrenceUpdate: RecurrenceUpdate; + xTraceId?: string; +} + +/** + * + */ +export class RecurrencesApi extends runtime.BaseAPI { + + /** + * Delete a recurring transaction. Transactions created by the recurring transaction will not be deleted. + * Delete a recurring transaction. + */ + async deleteRecurrenceRaw(requestParameters: DeleteRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteRecurrence.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/recurrences/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a recurring transaction. Transactions created by the recurring transaction will not be deleted. + * Delete a recurring transaction. + */ + async deleteRecurrence(requestParameters: DeleteRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteRecurrenceRaw(requestParameters, initOverrides); + } + + /** + * Get a single recurring transaction. + * Get a single recurring transaction. + */ + async getRecurrenceRaw(requestParameters: GetRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getRecurrence.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/recurrences/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RecurrenceSingleFromJSON(jsonValue)); + } + + /** + * Get a single recurring transaction. + * Get a single recurring transaction. + */ + async getRecurrence(requestParameters: GetRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRecurrenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all recurring transactions. + * List all recurring transactions. + */ + async listRecurrenceRaw(requestParameters: ListRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/recurrences`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RecurrenceArrayFromJSON(jsonValue)); + } + + /** + * List all recurring transactions. + * List all recurring transactions. + */ + async listRecurrence(requestParameters: ListRecurrenceRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRecurrenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all transactions created by a recurring transaction, optionally limited to the date ranges specified. + * List all transactions created by a recurring transaction. + */ + async listTransactionByRecurrenceRaw(requestParameters: ListTransactionByRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listTransactionByRecurrence.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/recurrences/{id}/transactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all transactions created by a recurring transaction, optionally limited to the date ranges specified. + * List all transactions created by a recurring transaction. + */ + async listTransactionByRecurrence(requestParameters: ListTransactionByRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByRecurrenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new recurring transaction. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new recurring transaction + */ + async storeRecurrenceRaw(requestParameters: StoreRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.recurrenceStore === null || requestParameters.recurrenceStore === undefined) { + throw new runtime.RequiredError('recurrenceStore','Required parameter requestParameters.recurrenceStore was null or undefined when calling storeRecurrence.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/recurrences`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RecurrenceStoreToJSON(requestParameters.recurrenceStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RecurrenceSingleFromJSON(jsonValue)); + } + + /** + * Creates a new recurring transaction. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new recurring transaction + */ + async storeRecurrence(requestParameters: StoreRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeRecurrenceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing recurring transaction. + * Update existing recurring transaction. + */ + async updateRecurrenceRaw(requestParameters: UpdateRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateRecurrence.'); + } + + if (requestParameters.recurrenceUpdate === null || requestParameters.recurrenceUpdate === undefined) { + throw new runtime.RequiredError('recurrenceUpdate','Required parameter requestParameters.recurrenceUpdate was null or undefined when calling updateRecurrence.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/recurrences/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: RecurrenceUpdateToJSON(requestParameters.recurrenceUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RecurrenceSingleFromJSON(jsonValue)); + } + + /** + * Update existing recurring transaction. + * Update existing recurring transaction. + */ + async updateRecurrence(requestParameters: UpdateRecurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateRecurrenceRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/RuleGroupsApi.ts b/src/lib/api/apis/RuleGroupsApi.ts new file mode 100644 index 0000000..8058970 --- /dev/null +++ b/src/lib/api/apis/RuleGroupsApi.ts @@ -0,0 +1,566 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + NotFound, + RuleArray, + RuleGroupArray, + RuleGroupSingle, + RuleGroupStore, + RuleGroupUpdate, + TransactionArray, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + RuleArrayFromJSON, + RuleArrayToJSON, + RuleGroupArrayFromJSON, + RuleGroupArrayToJSON, + RuleGroupSingleFromJSON, + RuleGroupSingleToJSON, + RuleGroupStoreFromJSON, + RuleGroupStoreToJSON, + RuleGroupUpdateFromJSON, + RuleGroupUpdateToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteRuleGroupRequest { + id: string; + xTraceId?: string; +} + +export interface FireRuleGroupRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; + accounts?: Array; +} + +export interface GetRuleGroupRequest { + id: string; + xTraceId?: string; +} + +export interface ListRuleByGroupRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListRuleGroupRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StoreRuleGroupRequest { + ruleGroupStore: RuleGroupStore; + xTraceId?: string; +} + +export interface TestRuleGroupRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + searchLimit?: number; + triggeredLimit?: number; + accounts?: Array; +} + +export interface UpdateRuleGroupRequest { + id: string; + ruleGroupUpdate: RuleGroupUpdate; + xTraceId?: string; +} + +/** + * + */ +export class RuleGroupsApi extends runtime.BaseAPI { + + /** + * Delete a rule group. + * Delete a rule group. + */ + async deleteRuleGroupRaw(requestParameters: DeleteRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteRuleGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a rule group. + * Delete a rule group. + */ + async deleteRuleGroup(requestParameters: DeleteRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteRuleGroupRaw(requestParameters, initOverrides); + } + + /** + * Fire the rule group on your transactions. Changes will be made by the rules in the rule group! Limit the result if you want to. + * Fire the rule group on your transactions. + */ + async fireRuleGroupRaw(requestParameters: FireRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling fireRuleGroup.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups/{id}/trigger`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Fire the rule group on your transactions. Changes will be made by the rules in the rule group! Limit the result if you want to. + * Fire the rule group on your transactions. + */ + async fireRuleGroup(requestParameters: FireRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.fireRuleGroupRaw(requestParameters, initOverrides); + } + + /** + * Get a single rule group. This does not include the rules. For that, see below. + * Get a single rule group. + */ + async getRuleGroupRaw(requestParameters: GetRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getRuleGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleGroupSingleFromJSON(jsonValue)); + } + + /** + * Get a single rule group. This does not include the rules. For that, see below. + * Get a single rule group. + */ + async getRuleGroup(requestParameters: GetRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRuleGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List rules in this rule group. + * List rules in this rule group. + */ + async listRuleByGroupRaw(requestParameters: ListRuleByGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listRuleByGroup.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups/{id}/rules`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleArrayFromJSON(jsonValue)); + } + + /** + * List rules in this rule group. + * List rules in this rule group. + */ + async listRuleByGroup(requestParameters: ListRuleByGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRuleByGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all rule groups. + * List all rule groups. + */ + async listRuleGroupRaw(requestParameters: ListRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleGroupArrayFromJSON(jsonValue)); + } + + /** + * List all rule groups. + * List all rule groups. + */ + async listRuleGroup(requestParameters: ListRuleGroupRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRuleGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new rule group. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new rule group. + */ + async storeRuleGroupRaw(requestParameters: StoreRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.ruleGroupStore === null || requestParameters.ruleGroupStore === undefined) { + throw new runtime.RequiredError('ruleGroupStore','Required parameter requestParameters.ruleGroupStore was null or undefined when calling storeRuleGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RuleGroupStoreToJSON(requestParameters.ruleGroupStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleGroupSingleFromJSON(jsonValue)); + } + + /** + * Creates a new rule group. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new rule group. + */ + async storeRuleGroup(requestParameters: StoreRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeRuleGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Test which transactions would be hit by the rule group. No changes will be made. Limit the result if you want to. + * Test which transactions would be hit by the rule group. No changes will be made. + */ + async testRuleGroupRaw(requestParameters: TestRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling testRuleGroup.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.searchLimit !== undefined) { + queryParameters['search_limit'] = requestParameters.searchLimit; + } + + if (requestParameters.triggeredLimit !== undefined) { + queryParameters['triggered_limit'] = requestParameters.triggeredLimit; + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups/{id}/test`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * Test which transactions would be hit by the rule group. No changes will be made. Limit the result if you want to. + * Test which transactions would be hit by the rule group. No changes will be made. + */ + async testRuleGroup(requestParameters: TestRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.testRuleGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing rule group. + * Update existing rule group. + */ + async updateRuleGroupRaw(requestParameters: UpdateRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateRuleGroup.'); + } + + if (requestParameters.ruleGroupUpdate === null || requestParameters.ruleGroupUpdate === undefined) { + throw new runtime.RequiredError('ruleGroupUpdate','Required parameter requestParameters.ruleGroupUpdate was null or undefined when calling updateRuleGroup.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rule-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: RuleGroupUpdateToJSON(requestParameters.ruleGroupUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleGroupSingleFromJSON(jsonValue)); + } + + /** + * Update existing rule group. + * Update existing rule group. + */ + async updateRuleGroup(requestParameters: UpdateRuleGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateRuleGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/RulesApi.ts b/src/lib/api/apis/RulesApi.ts new file mode 100644 index 0000000..fa14632 --- /dev/null +++ b/src/lib/api/apis/RulesApi.ts @@ -0,0 +1,479 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + NotFound, + RuleArray, + RuleSingle, + RuleStore, + RuleUpdate, + TransactionArray, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + RuleArrayFromJSON, + RuleArrayToJSON, + RuleSingleFromJSON, + RuleSingleToJSON, + RuleStoreFromJSON, + RuleStoreToJSON, + RuleUpdateFromJSON, + RuleUpdateToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteRuleRequest { + id: string; + xTraceId?: string; +} + +export interface FireRuleRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; + accounts?: Array; +} + +export interface GetRuleRequest { + id: string; + xTraceId?: string; +} + +export interface ListRuleRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StoreRuleRequest { + ruleStore: RuleStore; + xTraceId?: string; +} + +export interface TestRuleRequest { + id: string; + xTraceId?: string; + start?: Date; + end?: Date; + accounts?: Array; +} + +export interface UpdateRuleRequest { + id: string; + ruleUpdate: RuleUpdate; + xTraceId?: string; +} + +/** + * + */ +export class RulesApi extends runtime.BaseAPI { + + /** + * Delete an rule. + * Delete an rule. + */ + async deleteRuleRaw(requestParameters: DeleteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteRule.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete an rule. + * Delete an rule. + */ + async deleteRule(requestParameters: DeleteRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteRuleRaw(requestParameters, initOverrides); + } + + /** + * Fire the rule group on your transactions. Changes will be made by the rules in the group! Limit the result if you want to. + * Fire the rule on your transactions. + */ + async fireRuleRaw(requestParameters: FireRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling fireRule.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules/{id}/trigger`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Fire the rule group on your transactions. Changes will be made by the rules in the group! Limit the result if you want to. + * Fire the rule on your transactions. + */ + async fireRule(requestParameters: FireRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.fireRuleRaw(requestParameters, initOverrides); + } + + /** + * Get a single rule. + * Get a single rule. + */ + async getRuleRaw(requestParameters: GetRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getRule.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleSingleFromJSON(jsonValue)); + } + + /** + * Get a single rule. + * Get a single rule. + */ + async getRule(requestParameters: GetRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all rules. + * List all rules. + */ + async listRuleRaw(requestParameters: ListRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleArrayFromJSON(jsonValue)); + } + + /** + * List all rules. + * List all rules. + */ + async listRule(requestParameters: ListRuleRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new rule + */ + async storeRuleRaw(requestParameters: StoreRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.ruleStore === null || requestParameters.ruleStore === undefined) { + throw new runtime.RequiredError('ruleStore','Required parameter requestParameters.ruleStore was null or undefined when calling storeRule.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RuleStoreToJSON(requestParameters.ruleStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleSingleFromJSON(jsonValue)); + } + + /** + * Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new rule + */ + async storeRule(requestParameters: StoreRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Test which transactions would be hit by the rule. No changes will be made. Limit the result if you want to. + * Test which transactions would be hit by the rule. No changes will be made. + */ + async testRuleRaw(requestParameters: TestRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling testRule.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.accounts) { + queryParameters['accounts[]'] = requestParameters.accounts; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules/{id}/test`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * Test which transactions would be hit by the rule. No changes will be made. Limit the result if you want to. + * Test which transactions would be hit by the rule. No changes will be made. + */ + async testRule(requestParameters: TestRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.testRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing rule. + * Update existing rule. + */ + async updateRuleRaw(requestParameters: UpdateRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateRule.'); + } + + if (requestParameters.ruleUpdate === null || requestParameters.ruleUpdate === undefined) { + throw new runtime.RequiredError('ruleUpdate','Required parameter requestParameters.ruleUpdate was null or undefined when calling updateRule.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/rules/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: RuleUpdateToJSON(requestParameters.ruleUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RuleSingleFromJSON(jsonValue)); + } + + /** + * Update existing rule. + * Update existing rule. + */ + async updateRule(requestParameters: UpdateRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateRuleRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/SearchApi.ts b/src/lib/api/apis/SearchApi.ts new file mode 100644 index 0000000..2652d8d --- /dev/null +++ b/src/lib/api/apis/SearchApi.ts @@ -0,0 +1,201 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AccountArray, + AccountSearchFieldFilter, + AccountTypeFilter, + BadRequest, + InternalException, + NotFound, + TransactionArray, + Unauthenticated, +} from '../models/index'; +import { + AccountArrayFromJSON, + AccountArrayToJSON, + AccountSearchFieldFilterFromJSON, + AccountSearchFieldFilterToJSON, + AccountTypeFilterFromJSON, + AccountTypeFilterToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface SearchAccountsRequest { + query: string; + field: AccountSearchFieldFilter; + xTraceId?: string; + limit?: number; + page?: number; + type?: AccountTypeFilter; +} + +export interface SearchTransactionsRequest { + query: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +/** + * + */ +export class SearchApi extends runtime.BaseAPI { + + /** + * Search for accounts + * Search for accounts + */ + async searchAccountsRaw(requestParameters: SearchAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.query === null || requestParameters.query === undefined) { + throw new runtime.RequiredError('query','Required parameter requestParameters.query was null or undefined when calling searchAccounts.'); + } + + if (requestParameters.field === null || requestParameters.field === undefined) { + throw new runtime.RequiredError('field','Required parameter requestParameters.field was null or undefined when calling searchAccounts.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + if (requestParameters.field !== undefined) { + queryParameters['field'] = requestParameters.field; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/search/accounts`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccountArrayFromJSON(jsonValue)); + } + + /** + * Search for accounts + * Search for accounts + */ + async searchAccounts(requestParameters: SearchAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.searchAccountsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Searches through the users transactions. + * Search for transactions + */ + async searchTransactionsRaw(requestParameters: SearchTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.query === null || requestParameters.query === undefined) { + throw new runtime.RequiredError('query','Required parameter requestParameters.query was null or undefined when calling searchTransactions.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/search/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * Searches through the users transactions. + * Search for transactions + */ + async searchTransactions(requestParameters: SearchTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.searchTransactionsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/SummaryApi.ts b/src/lib/api/apis/SummaryApi.ts new file mode 100644 index 0000000..1d66543 --- /dev/null +++ b/src/lib/api/apis/SummaryApi.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + BasicSummaryEntry, + InternalException, + NotFound, + Unauthenticated, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + BasicSummaryEntryFromJSON, + BasicSummaryEntryToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, +} from '../models/index'; + +export interface GetBasicSummaryRequest { + start: Date; + end: Date; + xTraceId?: string; + currencyCode?: string; +} + +/** + * + */ +export class SummaryApi extends runtime.BaseAPI { + + /** + * Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is used in Firefly III to populate the dashboard. + * Returns basic sums of the users data. + */ + async getBasicSummaryRaw(requestParameters: GetBasicSummaryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.start === null || requestParameters.start === undefined) { + throw new runtime.RequiredError('start','Required parameter requestParameters.start was null or undefined when calling getBasicSummary.'); + } + + if (requestParameters.end === null || requestParameters.end === undefined) { + throw new runtime.RequiredError('end','Required parameter requestParameters.end was null or undefined when calling getBasicSummary.'); + } + + const queryParameters: any = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.currencyCode !== undefined) { + queryParameters['currency_code'] = requestParameters.currencyCode; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/summary/basic`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => runtime.mapValues(jsonValue, BasicSummaryEntryFromJSON)); + } + + /** + * Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is used in Firefly III to populate the dashboard. + * Returns basic sums of the users data. + */ + async getBasicSummary(requestParameters: GetBasicSummaryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: BasicSummaryEntry; }> { + const response = await this.getBasicSummaryRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/TagsApi.ts b/src/lib/api/apis/TagsApi.ts new file mode 100644 index 0000000..25b262f --- /dev/null +++ b/src/lib/api/apis/TagsApi.ts @@ -0,0 +1,501 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + BadRequest, + InternalException, + NotFound, + TagArray, + TagModelStore, + TagModelUpdate, + TagSingle, + TransactionArray, + TransactionTypeFilter, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + TagArrayFromJSON, + TagArrayToJSON, + TagModelStoreFromJSON, + TagModelStoreToJSON, + TagModelUpdateFromJSON, + TagModelUpdateToJSON, + TagSingleFromJSON, + TagSingleToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteTagRequest { + tag: string; + xTraceId?: string; +} + +export interface GetTagRequest { + tag: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListAttachmentByTagRequest { + tag: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTagRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionByTagRequest { + tag: string; + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreTagRequest { + tagModelStore: TagModelStore; + xTraceId?: string; +} + +export interface UpdateTagRequest { + tag: string; + tagModelUpdate: TagModelUpdate; + xTraceId?: string; +} + +/** + * + */ +export class TagsApi extends runtime.BaseAPI { + + /** + * Delete an tag. + * Delete an tag. + */ + async deleteTagRaw(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tag === null || requestParameters.tag === undefined) { + throw new runtime.RequiredError('tag','Required parameter requestParameters.tag was null or undefined when calling deleteTag.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags/{tag}`.replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete an tag. + * Delete an tag. + */ + async deleteTag(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteTagRaw(requestParameters, initOverrides); + } + + /** + * Get a single tag. + * Get a single tag. + */ + async getTagRaw(requestParameters: GetTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tag === null || requestParameters.tag === undefined) { + throw new runtime.RequiredError('tag','Required parameter requestParameters.tag was null or undefined when calling getTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags/{tag}`.replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TagSingleFromJSON(jsonValue)); + } + + /** + * Get a single tag. + * Get a single tag. + */ + async getTag(requestParameters: GetTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByTagRaw(requestParameters: ListAttachmentByTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tag === null || requestParameters.tag === undefined) { + throw new runtime.RequiredError('tag','Required parameter requestParameters.tag was null or undefined when calling listAttachmentByTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags/{tag}/attachments`.replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByTag(requestParameters: ListAttachmentByTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all of the user\'s tags. + * List all tags. + */ + async listTagRaw(requestParameters: ListTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TagArrayFromJSON(jsonValue)); + } + + /** + * List all of the user\'s tags. + * List all tags. + */ + async listTag(requestParameters: ListTagRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all transactions with this tag. + * List all transactions with this tag. + */ + async listTransactionByTagRaw(requestParameters: ListTransactionByTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tag === null || requestParameters.tag === undefined) { + throw new runtime.RequiredError('tag','Required parameter requestParameters.tag was null or undefined when calling listTransactionByTag.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags/{tag}/transactions`.replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all transactions with this tag. + * List all transactions with this tag. + */ + async listTransactionByTag(requestParameters: ListTransactionByTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionByTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new tag. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new tag + */ + async storeTagRaw(requestParameters: StoreTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tagModelStore === null || requestParameters.tagModelStore === undefined) { + throw new runtime.RequiredError('tagModelStore','Required parameter requestParameters.tagModelStore was null or undefined when calling storeTag.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TagModelStoreToJSON(requestParameters.tagModelStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TagSingleFromJSON(jsonValue)); + } + + /** + * Creates a new tag. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new tag + */ + async storeTag(requestParameters: StoreTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing tag. + * Update existing tag. + */ + async updateTagRaw(requestParameters: UpdateTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tag === null || requestParameters.tag === undefined) { + throw new runtime.RequiredError('tag','Required parameter requestParameters.tag was null or undefined when calling updateTag.'); + } + + if (requestParameters.tagModelUpdate === null || requestParameters.tagModelUpdate === undefined) { + throw new runtime.RequiredError('tagModelUpdate','Required parameter requestParameters.tagModelUpdate was null or undefined when calling updateTag.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/tags/{tag}`.replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: TagModelUpdateToJSON(requestParameters.tagModelUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TagSingleFromJSON(jsonValue)); + } + + /** + * Update existing tag. + * Update existing tag. + */ + async updateTag(requestParameters: UpdateTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTagRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/TransactionsApi.ts b/src/lib/api/apis/TransactionsApi.ts new file mode 100644 index 0000000..b80abf4 --- /dev/null +++ b/src/lib/api/apis/TransactionsApi.ts @@ -0,0 +1,665 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentArray, + BadRequest, + InternalException, + NotFound, + PiggyBankEventArray, + TransactionArray, + TransactionLinkArray, + TransactionSingle, + TransactionStore, + TransactionTypeFilter, + TransactionUpdate, + Unauthenticated, + ValidationError, +} from '../models/index'; +import { + AttachmentArrayFromJSON, + AttachmentArrayToJSON, + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + PiggyBankEventArrayFromJSON, + PiggyBankEventArrayToJSON, + TransactionArrayFromJSON, + TransactionArrayToJSON, + TransactionLinkArrayFromJSON, + TransactionLinkArrayToJSON, + TransactionSingleFromJSON, + TransactionSingleToJSON, + TransactionStoreFromJSON, + TransactionStoreToJSON, + TransactionTypeFilterFromJSON, + TransactionTypeFilterToJSON, + TransactionUpdateFromJSON, + TransactionUpdateToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteTransactionRequest { + id: string; + xTraceId?: string; +} + +export interface DeleteTransactionJournalRequest { + id: string; + xTraceId?: string; +} + +export interface GetTransactionRequest { + id: string; + xTraceId?: string; +} + +export interface GetTransactionByJournalRequest { + id: string; + xTraceId?: string; +} + +export interface ListAttachmentByTransactionRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListEventByTransactionRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListLinksByJournalRequest { + id: string; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface ListTransactionRequest { + xTraceId?: string; + limit?: number; + page?: number; + start?: Date; + end?: Date; + type?: TransactionTypeFilter; +} + +export interface StoreTransactionRequest { + transactionStore: TransactionStore; + xTraceId?: string; +} + +export interface UpdateTransactionRequest { + id: string; + transactionUpdate: TransactionUpdate; + xTraceId?: string; +} + +/** + * + */ +export class TransactionsApi extends runtime.BaseAPI { + + /** + * Delete a transaction. + * Delete a transaction. + */ + async deleteTransactionRaw(requestParameters: DeleteTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteTransaction.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a transaction. + * Delete a transaction. + */ + async deleteTransaction(requestParameters: DeleteTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteTransactionRaw(requestParameters, initOverrides); + } + + /** + * Delete an individual journal (split) from a transaction. + * Delete split from transaction + */ + async deleteTransactionJournalRaw(requestParameters: DeleteTransactionJournalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteTransactionJournal.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-journals/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete an individual journal (split) from a transaction. + * Delete split from transaction + */ + async deleteTransactionJournal(requestParameters: DeleteTransactionJournalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteTransactionJournalRaw(requestParameters, initOverrides); + } + + /** + * Get a single transaction. + * Get a single transaction. + */ + async getTransactionRaw(requestParameters: GetTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getTransaction.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionSingleFromJSON(jsonValue)); + } + + /** + * Get a single transaction. + * Get a single transaction. + */ + async getTransaction(requestParameters: GetTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get a single transaction by underlying journal (split). + * Get a single transaction, based on one of the underlying transaction journals (transaction splits). + */ + async getTransactionByJournalRaw(requestParameters: GetTransactionByJournalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getTransactionByJournal.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-journals/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionSingleFromJSON(jsonValue)); + } + + /** + * Get a single transaction by underlying journal (split). + * Get a single transaction, based on one of the underlying transaction journals (transaction splits). + */ + async getTransactionByJournal(requestParameters: GetTransactionByJournalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTransactionByJournalRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByTransactionRaw(requestParameters: ListAttachmentByTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listAttachmentByTransaction.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions/{id}/attachments`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentArrayFromJSON(jsonValue)); + } + + /** + * Lists all attachments. + * Lists all attachments. + */ + async listAttachmentByTransaction(requestParameters: ListAttachmentByTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAttachmentByTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all piggy bank events. + * Lists all piggy bank events. + */ + async listEventByTransactionRaw(requestParameters: ListEventByTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listEventByTransaction.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions/{id}/piggy-bank-events`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PiggyBankEventArrayFromJSON(jsonValue)); + } + + /** + * Lists all piggy bank events. + * Lists all piggy bank events. + */ + async listEventByTransaction(requestParameters: ListEventByTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listEventByTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists all the transaction links for an individual journal (a split). Don\'t use the group ID, you need the actual underlying journal (the split). + * Lists all the transaction links for an individual journal (individual split). + */ + async listLinksByJournalRaw(requestParameters: ListLinksByJournalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling listLinksByJournal.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction-journals/{id}/links`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionLinkArrayFromJSON(jsonValue)); + } + + /** + * Lists all the transaction links for an individual journal (a split). Don\'t use the group ID, you need the actual underlying journal (the split). + * Lists all the transaction links for an individual journal (individual split). + */ + async listLinksByJournal(requestParameters: ListLinksByJournalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listLinksByJournalRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the user\'s transactions. + * List all the user\'s transactions. + */ + async listTransactionRaw(requestParameters: ListTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.start !== undefined) { + queryParameters['start'] = (requestParameters.start as any).toISOString().substring(0,10); + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = (requestParameters.end as any).toISOString().substring(0,10); + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionArrayFromJSON(jsonValue)); + } + + /** + * List all the user\'s transactions. + * List all the user\'s transactions. + */ + async listTransaction(requestParameters: ListTransactionRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new transaction. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new transaction + */ + async storeTransactionRaw(requestParameters: StoreTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.transactionStore === null || requestParameters.transactionStore === undefined) { + throw new runtime.RequiredError('transactionStore','Required parameter requestParameters.transactionStore was null or undefined when calling storeTransaction.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TransactionStoreToJSON(requestParameters.transactionStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionSingleFromJSON(jsonValue)); + } + + /** + * Creates a new transaction. The data required can be submitted as a JSON body or as a list of parameters. + * Store a new transaction + */ + async storeTransaction(requestParameters: StoreTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an existing transaction. + * Update existing transaction. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials + */ + async updateTransactionRaw(requestParameters: UpdateTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateTransaction.'); + } + + if (requestParameters.transactionUpdate === null || requestParameters.transactionUpdate === undefined) { + throw new runtime.RequiredError('transactionUpdate','Required parameter requestParameters.transactionUpdate was null or undefined when calling updateTransaction.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transactions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: TransactionUpdateToJSON(requestParameters.transactionUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionSingleFromJSON(jsonValue)); + } + + /** + * Update an existing transaction. + * Update existing transaction. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials + */ + async updateTransaction(requestParameters: UpdateTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/UsersApi.ts b/src/lib/api/apis/UsersApi.ts new file mode 100644 index 0000000..af684eb --- /dev/null +++ b/src/lib/api/apis/UsersApi.ts @@ -0,0 +1,336 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + NotFound, + Unauthenticated, + User, + UserArray, + UserSingle, + ValidationError, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + UserFromJSON, + UserToJSON, + UserArrayFromJSON, + UserArrayToJSON, + UserSingleFromJSON, + UserSingleToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, +} from '../models/index'; + +export interface DeleteUserRequest { + id: string; + xTraceId?: string; +} + +export interface GetUserRequest { + id: string; + xTraceId?: string; +} + +export interface ListUserRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StoreUserRequest { + user: User; + xTraceId?: string; +} + +export interface UpdateUserRequest { + id: string; + user: User; + xTraceId?: string; +} + +/** + * + */ +export class UsersApi extends runtime.BaseAPI { + + /** + * Delete a user. You cannot delete the user you\'re authenticated with. This cannot be undone. Be careful! + * Delete a user. + */ + async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a user. You cannot delete the user you\'re authenticated with. This cannot be undone. Be careful! + * Delete a user. + */ + async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteUserRaw(requestParameters, initOverrides); + } + + /** + * Gets all info of a single user. + * Get a single user. + */ + async getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserSingleFromJSON(jsonValue)); + } + + /** + * Gets all info of a single user. + * Get a single user. + */ + async getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the users in this instance of Firefly III. + * List all users. + */ + async listUserRaw(requestParameters: ListUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/users`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserArrayFromJSON(jsonValue)); + } + + /** + * List all the users in this instance of Firefly III. + * List all users. + */ + async listUser(requestParameters: ListUserRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \"forgot password\" function. + * Store a new user + */ + async storeUserRaw(requestParameters: StoreUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling storeUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/users`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.user), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserSingleFromJSON(jsonValue)); + } + + /** + * Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \"forgot password\" function. + * Store a new user + */ + async storeUser(requestParameters: StoreUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing user. + * Update an existing user\'s information. + */ + async updateUserRaw(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateUser.'); + } + + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.user), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserSingleFromJSON(jsonValue)); + } + + /** + * Update existing user. + * Update an existing user\'s information. + */ + async updateUser(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateUserRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/WebhooksApi.ts b/src/lib/api/apis/WebhooksApi.ts new file mode 100644 index 0000000..c385804 --- /dev/null +++ b/src/lib/api/apis/WebhooksApi.ts @@ -0,0 +1,771 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BadRequest, + InternalException, + NotFound, + Unauthenticated, + ValidationError, + WebhookArray, + WebhookAttemptArray, + WebhookAttemptSingle, + WebhookMessageArray, + WebhookMessageSingle, + WebhookSingle, + WebhookStore, + WebhookUpdate, +} from '../models/index'; +import { + BadRequestFromJSON, + BadRequestToJSON, + InternalExceptionFromJSON, + InternalExceptionToJSON, + NotFoundFromJSON, + NotFoundToJSON, + UnauthenticatedFromJSON, + UnauthenticatedToJSON, + ValidationErrorFromJSON, + ValidationErrorToJSON, + WebhookArrayFromJSON, + WebhookArrayToJSON, + WebhookAttemptArrayFromJSON, + WebhookAttemptArrayToJSON, + WebhookAttemptSingleFromJSON, + WebhookAttemptSingleToJSON, + WebhookMessageArrayFromJSON, + WebhookMessageArrayToJSON, + WebhookMessageSingleFromJSON, + WebhookMessageSingleToJSON, + WebhookSingleFromJSON, + WebhookSingleToJSON, + WebhookStoreFromJSON, + WebhookStoreToJSON, + WebhookUpdateFromJSON, + WebhookUpdateToJSON, +} from '../models/index'; + +export interface DeleteWebhookRequest { + id: string; + xTraceId?: string; +} + +export interface DeleteWebhookMessageRequest { + id: string; + messageId: number; + xTraceId?: string; +} + +export interface DeleteWebhookMessageAttemptRequest { + id: string; + messageId: number; + attemptId: number; + xTraceId?: string; +} + +export interface GetSingleWebhookMessageRequest { + id: string; + messageId: number; + xTraceId?: string; +} + +export interface GetSingleWebhookMessageAttemptRequest { + id: string; + messageId: number; + attemptId: number; + xTraceId?: string; +} + +export interface GetWebhookRequest { + id: string; + xTraceId?: string; +} + +export interface GetWebhookMessageAttemptsRequest { + id: string; + messageId: number; + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface GetWebhookMessagesRequest { + id: string; + xTraceId?: string; +} + +export interface ListWebhookRequest { + xTraceId?: string; + limit?: number; + page?: number; +} + +export interface StoreWebhookRequest { + webhookStore: WebhookStore; + xTraceId?: string; +} + +export interface SubmitWebookRequest { + id: string; + xTraceId?: string; +} + +export interface UpdateWebhookRequest { + id: string; + webhookUpdate: WebhookUpdate; + xTraceId?: string; +} + +/** + * + */ +export class WebhooksApi extends runtime.BaseAPI { + + /** + * Delete a webhook. + * Delete a webhook. + */ + async deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteWebhook.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a webhook. + * Delete a webhook. + */ + async deleteWebhook(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteWebhookRaw(requestParameters, initOverrides); + } + + /** + * Delete a webhook message. Any time a webhook is triggered the message is stored before it\'s sent. You can delete them before or after sending. + * Delete a webhook message. + */ + async deleteWebhookMessageRaw(requestParameters: DeleteWebhookMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteWebhookMessage.'); + } + + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling deleteWebhookMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/messages/{messageId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters.messageId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a webhook message. Any time a webhook is triggered the message is stored before it\'s sent. You can delete them before or after sending. + * Delete a webhook message. + */ + async deleteWebhookMessage(requestParameters: DeleteWebhookMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteWebhookMessageRaw(requestParameters, initOverrides); + } + + /** + * Delete a webhook message attempt. If you delete all attempts for a webhook message, Firefly III will (once again) assume all is well with the webhook message and will try to send it again. + * Delete a webhook attempt. + */ + async deleteWebhookMessageAttemptRaw(requestParameters: DeleteWebhookMessageAttemptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteWebhookMessageAttempt.'); + } + + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling deleteWebhookMessageAttempt.'); + } + + if (requestParameters.attemptId === null || requestParameters.attemptId === undefined) { + throw new runtime.RequiredError('attemptId','Required parameter requestParameters.attemptId was null or undefined when calling deleteWebhookMessageAttempt.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters.messageId))).replace(`{${"attemptId"}}`, encodeURIComponent(String(requestParameters.attemptId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a webhook message attempt. If you delete all attempts for a webhook message, Firefly III will (once again) assume all is well with the webhook message and will try to send it again. + * Delete a webhook attempt. + */ + async deleteWebhookMessageAttempt(requestParameters: DeleteWebhookMessageAttemptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteWebhookMessageAttemptRaw(requestParameters, initOverrides); + } + + /** + * When a webhook is triggered it will store the actual content of the webhook in a webhook message. You can view and analyse a single one using this endpoint. + * Get a single message from a webhook. + */ + async getSingleWebhookMessageRaw(requestParameters: GetSingleWebhookMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getSingleWebhookMessage.'); + } + + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling getSingleWebhookMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/messages/{messageId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters.messageId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookMessageSingleFromJSON(jsonValue)); + } + + /** + * When a webhook is triggered it will store the actual content of the webhook in a webhook message. You can view and analyse a single one using this endpoint. + * Get a single message from a webhook. + */ + async getSingleWebhookMessage(requestParameters: GetSingleWebhookMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getSingleWebhookMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhooks messages that receive too many attempts (failures) will not be fired. You must first clear out old attempts and try again. This endpoint shows you the details of a single attempt. The ID of the attempt must match the corresponding webhook and webhook message. + * Get a single failed attempt from a single webhook message. + */ + async getSingleWebhookMessageAttemptRaw(requestParameters: GetSingleWebhookMessageAttemptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getSingleWebhookMessageAttempt.'); + } + + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling getSingleWebhookMessageAttempt.'); + } + + if (requestParameters.attemptId === null || requestParameters.attemptId === undefined) { + throw new runtime.RequiredError('attemptId','Required parameter requestParameters.attemptId was null or undefined when calling getSingleWebhookMessageAttempt.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters.messageId))).replace(`{${"attemptId"}}`, encodeURIComponent(String(requestParameters.attemptId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookAttemptSingleFromJSON(jsonValue)); + } + + /** + * When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhooks messages that receive too many attempts (failures) will not be fired. You must first clear out old attempts and try again. This endpoint shows you the details of a single attempt. The ID of the attempt must match the corresponding webhook and webhook message. + * Get a single failed attempt from a single webhook message. + */ + async getSingleWebhookMessageAttempt(requestParameters: GetSingleWebhookMessageAttemptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getSingleWebhookMessageAttemptRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Gets all info of a single webhook. + * Get a single webhook. + */ + async getWebhookRaw(requestParameters: GetWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getWebhook.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSingleFromJSON(jsonValue)); + } + + /** + * Gets all info of a single webhook. + * Get a single webhook. + */ + async getWebhook(requestParameters: GetWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getWebhookRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhook messages that receive too many attempts (failures) will not be sent again. You must first clear out old attempts before the message can go out again. + * Get all the failed attempts of a single webhook message. + */ + async getWebhookMessageAttemptsRaw(requestParameters: GetWebhookMessageAttemptsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getWebhookMessageAttempts.'); + } + + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling getWebhookMessageAttempts.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/messages/{messageId}/attempts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters.messageId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookAttemptArrayFromJSON(jsonValue)); + } + + /** + * When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhook messages that receive too many attempts (failures) will not be sent again. You must first clear out old attempts before the message can go out again. + * Get all the failed attempts of a single webhook message. + */ + async getWebhookMessageAttempts(requestParameters: GetWebhookMessageAttemptsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getWebhookMessageAttemptsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * When a webhook is triggered the actual message that will be send is stored in a \"message\". You can view and analyse these messages. + * Get all the messages of a single webhook. + */ + async getWebhookMessagesRaw(requestParameters: GetWebhookMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getWebhookMessages.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/messages`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookMessageArrayFromJSON(jsonValue)); + } + + /** + * When a webhook is triggered the actual message that will be send is stored in a \"message\". You can view and analyse these messages. + * Get all the messages of a single webhook. + */ + async getWebhookMessages(requestParameters: GetWebhookMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getWebhookMessagesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all the user\'s webhooks. + * List all webhooks. + */ + async listWebhookRaw(requestParameters: ListWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookArrayFromJSON(jsonValue)); + } + + /** + * List all the user\'s webhooks. + * List all webhooks. + */ + async listWebhook(requestParameters: ListWebhookRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listWebhookRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new webhook. The data required can be submitted as a JSON body or as a list of parameters. The webhook will be given a random secret. + * Store a new webhook + */ + async storeWebhookRaw(requestParameters: StoreWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.webhookStore === null || requestParameters.webhookStore === undefined) { + throw new runtime.RequiredError('webhookStore','Required parameter requestParameters.webhookStore was null or undefined when calling storeWebhook.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: WebhookStoreToJSON(requestParameters.webhookStore), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSingleFromJSON(jsonValue)); + } + + /** + * Creates a new webhook. The data required can be submitted as a JSON body or as a list of parameters. The webhook will be given a random secret. + * Store a new webhook + */ + async storeWebhook(requestParameters: StoreWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.storeWebhookRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This endpoint will submit any open messages for this webhook. This is an asynchronous operation, so you can\'t see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. + * Submit messages for a webhook. + */ + async submitWebookRaw(requestParameters: SubmitWebookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling submitWebook.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}/submit`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * This endpoint will submit any open messages for this webhook. This is an asynchronous operation, so you can\'t see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. + * Submit messages for a webhook. + */ + async submitWebook(requestParameters: SubmitWebookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.submitWebookRaw(requestParameters, initOverrides); + } + + /** + * Update an existing webhook\'s information. If you wish to reset the secret, submit any value as the \"secret\". Firefly III will take this as a hint and reset the secret of the webhook. + * Update existing webhook. + */ + async updateWebhookRaw(requestParameters: UpdateWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateWebhook.'); + } + + if (requestParameters.webhookUpdate === null || requestParameters.webhookUpdate === undefined) { + throw new runtime.RequiredError('webhookUpdate','Required parameter requestParameters.webhookUpdate was null or undefined when calling updateWebhook.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters.xTraceId !== undefined && requestParameters.xTraceId !== null) { + headerParameters['X-Trace-Id'] = String(requestParameters.xTraceId); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("firefly_iii_auth", []); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("local_bearer_auth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/webhooks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: WebhookUpdateToJSON(requestParameters.webhookUpdate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookSingleFromJSON(jsonValue)); + } + + /** + * Update an existing webhook\'s information. If you wish to reset the secret, submit any value as the \"secret\". Firefly III will take this as a hint and reset the secret of the webhook. + * Update existing webhook. + */ + async updateWebhook(requestParameters: UpdateWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateWebhookRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/lib/api/apis/index.ts b/src/lib/api/apis/index.ts new file mode 100644 index 0000000..659a7d7 --- /dev/null +++ b/src/lib/api/apis/index.ts @@ -0,0 +1,28 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AboutApi'; +export * from './AccountsApi'; +export * from './AttachmentsApi'; +export * from './AutocompleteApi'; +export * from './AvailableBudgetsApi'; +export * from './BillsApi'; +export * from './BudgetsApi'; +export * from './CategoriesApi'; +export * from './ChartsApi'; +export * from './ConfigurationApi'; +export * from './CurrenciesApi'; +export * from './DataApi'; +export * from './InsightApi'; +export * from './LinksApi'; +export * from './ObjectGroupsApi'; +export * from './PiggyBanksApi'; +export * from './PreferencesApi'; +export * from './RecurrencesApi'; +export * from './RuleGroupsApi'; +export * from './RulesApi'; +export * from './SearchApi'; +export * from './SummaryApi'; +export * from './TagsApi'; +export * from './TransactionsApi'; +export * from './UsersApi'; +export * from './WebhooksApi'; diff --git a/src/lib/api/core/ApiError.ts b/src/lib/api/core/ApiError.ts deleted file mode 100644 index d6b8fcc..0000000 --- a/src/lib/api/core/ApiError.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: any; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} diff --git a/src/lib/api/core/ApiRequestOptions.ts b/src/lib/api/core/ApiRequestOptions.ts deleted file mode 100644 index c19adcc..0000000 --- a/src/lib/api/core/ApiRequestOptions.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiRequestOptions = { - readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; - readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; - readonly body?: any; - readonly mediaType?: string; - readonly responseHeader?: string; - readonly errors?: Record; -}; diff --git a/src/lib/api/core/ApiResult.ts b/src/lib/api/core/ApiResult.ts deleted file mode 100644 index ad8fef2..0000000 --- a/src/lib/api/core/ApiResult.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly body: any; -}; diff --git a/src/lib/api/core/CancelablePromise.ts b/src/lib/api/core/CancelablePromise.ts deleted file mode 100644 index 55fef85..0000000 --- a/src/lib/api/core/CancelablePromise.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export class CancelError extends Error { - - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - #isResolved: boolean; - #isRejected: boolean; - #isCancelled: boolean; - readonly #cancelHandlers: (() => void)[]; - readonly #promise: Promise; - #resolve?: (value: T | PromiseLike) => void; - #reject?: (reason?: any) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: OnCancel - ) => void - ) { - this.#isResolved = false; - this.#isRejected = false; - this.#isCancelled = false; - this.#cancelHandlers = []; - this.#promise = new Promise((resolve, reject) => { - this.#resolve = resolve; - this.#reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isResolved = true; - this.#resolve?.(value); - }; - - const onReject = (reason?: any): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isRejected = true; - this.#reject?.(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this.#isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this.#isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this.#isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null - ): Promise { - return this.#promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null - ): Promise { - return this.#promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.#promise.finally(onFinally); - } - - public cancel(): void { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isCancelled = true; - if (this.#cancelHandlers.length) { - try { - for (const cancelHandler of this.#cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.#cancelHandlers.length = 0; - this.#reject?.(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this.#isCancelled; - } -} diff --git a/src/lib/api/core/OpenAPI.ts b/src/lib/api/core/OpenAPI.ts deleted file mode 100644 index 4c13ba0..0000000 --- a/src/lib/api/core/OpenAPI.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Resolver = (options: ApiRequestOptions) => Promise; -type Headers = Record; - -export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - HEADERS?: Headers | Resolver | undefined; - ENCODE_PATH?: ((path: string) => string) | undefined; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'https://demo.firefly-iii.org/api', - VERSION: '2.0.10', - WITH_CREDENTIALS: false, - CREDENTIALS: 'include', - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, -}; diff --git a/src/lib/api/core/request.ts b/src/lib/api/core/request.ts deleted file mode 100644 index b72e82e..0000000 --- a/src/lib/api/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -/** - * This file is copied to ./core during the client generation process, and is - * preserved between builds. - */ - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isDefined = ( - value: T | null | undefined -): value is NonNullable> => { - return value !== undefined && value !== null; -}; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: unknown): value is Blob => { - return ( - isDefined(value) && - typeof value === 'object' && - 'type' in value && - typeof value.type === 'string' && - 'stream' in value && - typeof value.stream === 'function' && - 'arrayBuffer' in value && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - Symbol.toStringTag in value && - /^(Blob|File)$/.test(value[Symbol.toStringTag] as string) - ); -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const process = (key: string, value: unknown) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach((v) => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; - - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); - - if (qs.length > 0) { - return `?${qs.join('&')}`; - } - - return ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path && Object.hasOwn(options.path, group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async ( - options: ApiRequestOptions, - resolver?: T | Resolver -): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async ( - config: OpenAPIConfig, - options: ApiRequestOptions -): Promise => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers - }) - .filter(([_, value]) => isDefined(value)) - .reduce( - (headers, [key, value]) => ({ - ...headers, - [key]: String(value) - }), - {} as Record - ); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -type RequestBody = string | Blob | FormData | undefined; - -export const getRequestBody = (options: ApiRequestOptions): RequestBody => { - if (options.body !== undefined) { - if (options.mediaType?.includes('/json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: RequestBody, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - const request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = ( - response: Response, - responseHeader?: string -): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const jsonTypes = [ - 'application/json', - 'application/problem+json', - 'application/vnd.api+json' - ]; - const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type)); - if (isJSON) { - return await response.json(); - } else { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors - }; - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError( - options, - result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = ( - config: OpenAPIConfig, - options: ApiRequestOptions -): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - const response = await sendRequest(config, options, url, body, formData, headers, onCancel); - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/src/lib/api/errors.ts b/src/lib/api/errors.ts index 8203eab..400baad 100644 --- a/src/lib/api/errors.ts +++ b/src/lib/api/errors.ts @@ -1,29 +1,28 @@ -import type { ApiError } from "./core/ApiError"; +import type { ResponseError } from "./runtime"; import type { ValidationError } from "./models/ValidationError"; -function isApiError(e: unknown): e is ApiError { - return e != null - && +function isResponseError(e: unknown): e is ResponseError { + return e != null && typeof e === 'object' && !Array.isArray(e) && 'name' in e && - e.name === 'ApiError' + e.name === 'ResponseError' } -type ValidationApiError = ApiError & { - status: 422, - body: ValidationError +type ValidationResponseError = ResponseError & { + response: Response & { + status: 422, + body: ValidationError + } } -function isValidationError(e: ApiError): e is ValidationApiError { - return e.status === 422 +function isValidationResponseError(e: ResponseError): e is ValidationResponseError { + return e.response.status === 422; } export function prettyPrintError(e: unknown): string { - if (!isApiError(e)) return String(e); - - if (isValidationError(e)) { - return e.body.message; + if (isResponseError(e) && isValidationResponseError(e)) { + return e.response.body.message ?? "The given data was invalid."; } return String(e); diff --git a/src/lib/api/firefly-iii-2.0.10-v1.yaml b/src/lib/api/firefly-iii-2.0.10-v1.yaml index 29bb1e4..407fe6c 100644 --- a/src/lib/api/firefly-iii-2.0.10-v1.yaml +++ b/src/lib/api/firefly-iii-2.0.10-v1.yaml @@ -19434,7 +19434,7 @@ components: - DESTROY_TRANSACTION BasicSummary: type: object - items: + additionalProperties: $ref: '#/components/schemas/BasicSummaryEntry' BasicSummaryEntry: type: object diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index 42dcb66..bebe8bb 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -1,265 +1,5 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI } from './core/OpenAPI'; -export type { OpenAPIConfig } from './core/OpenAPI'; - -export type { Account } from './models/Account'; -export type { AccountArray } from './models/AccountArray'; -export type { AccountRead } from './models/AccountRead'; -export { AccountRoleProperty } from './models/AccountRoleProperty'; -export { AccountSearchFieldFilter } from './models/AccountSearchFieldFilter'; -export type { AccountSingle } from './models/AccountSingle'; -export type { AccountStore } from './models/AccountStore'; -export { AccountTypeFilter } from './models/AccountTypeFilter'; -export { AccountTypeProperty } from './models/AccountTypeProperty'; -export type { AccountUpdate } from './models/AccountUpdate'; -export { AttachableType } from './models/AttachableType'; -export type { Attachment } from './models/Attachment'; -export type { AttachmentArray } from './models/AttachmentArray'; -export type { AttachmentRead } from './models/AttachmentRead'; -export type { AttachmentSingle } from './models/AttachmentSingle'; -export type { AttachmentStore } from './models/AttachmentStore'; -export type { AttachmentUpdate } from './models/AttachmentUpdate'; -export { AutoBudgetPeriod } from './models/AutoBudgetPeriod'; -export { AutoBudgetType } from './models/AutoBudgetType'; -export type { AutocompleteAccount } from './models/AutocompleteAccount'; -export type { AutocompleteAccountArray } from './models/AutocompleteAccountArray'; -export type { AutocompleteBill } from './models/AutocompleteBill'; -export type { AutocompleteBillArray } from './models/AutocompleteBillArray'; -export type { AutocompleteBudget } from './models/AutocompleteBudget'; -export type { AutocompleteBudgetArray } from './models/AutocompleteBudgetArray'; -export type { AutocompleteCategory } from './models/AutocompleteCategory'; -export type { AutocompleteCategoryArray } from './models/AutocompleteCategoryArray'; -export type { AutocompleteCurrency } from './models/AutocompleteCurrency'; -export type { AutocompleteCurrencyArray } from './models/AutocompleteCurrencyArray'; -export type { AutocompleteCurrencyCode } from './models/AutocompleteCurrencyCode'; -export type { AutocompleteCurrencyCodeArray } from './models/AutocompleteCurrencyCodeArray'; -export type { AutocompleteObjectGroup } from './models/AutocompleteObjectGroup'; -export type { AutocompleteObjectGroupArray } from './models/AutocompleteObjectGroupArray'; -export type { AutocompletePiggy } from './models/AutocompletePiggy'; -export type { AutocompletePiggyArray } from './models/AutocompletePiggyArray'; -export type { AutocompletePiggyBalance } from './models/AutocompletePiggyBalance'; -export type { AutocompletePiggyBalanceArray } from './models/AutocompletePiggyBalanceArray'; -export type { AutocompleteRecurrence } from './models/AutocompleteRecurrence'; -export type { AutocompleteRecurrenceArray } from './models/AutocompleteRecurrenceArray'; -export type { AutocompleteRule } from './models/AutocompleteRule'; -export type { AutocompleteRuleArray } from './models/AutocompleteRuleArray'; -export type { AutocompleteRuleGroup } from './models/AutocompleteRuleGroup'; -export type { AutocompleteRuleGroupArray } from './models/AutocompleteRuleGroupArray'; -export type { AutocompleteTag } from './models/AutocompleteTag'; -export type { AutocompleteTagArray } from './models/AutocompleteTagArray'; -export type { AutocompleteTransaction } from './models/AutocompleteTransaction'; -export type { AutocompleteTransactionArray } from './models/AutocompleteTransactionArray'; -export type { AutocompleteTransactionID } from './models/AutocompleteTransactionID'; -export type { AutocompleteTransactionIDArray } from './models/AutocompleteTransactionIDArray'; -export type { AutocompleteTransactionType } from './models/AutocompleteTransactionType'; -export type { AutocompleteTransactionTypeArray } from './models/AutocompleteTransactionTypeArray'; -export type { AvailableBudget } from './models/AvailableBudget'; -export type { AvailableBudgetArray } from './models/AvailableBudgetArray'; -export type { AvailableBudgetRead } from './models/AvailableBudgetRead'; -export type { AvailableBudgetSingle } from './models/AvailableBudgetSingle'; -export type { BadRequest } from './models/BadRequest'; -export type { BasicSummary } from './models/BasicSummary'; -export type { BasicSummaryEntry } from './models/BasicSummaryEntry'; -export type { Bill } from './models/Bill'; -export type { BillArray } from './models/BillArray'; -export type { BillRead } from './models/BillRead'; -export { BillRepeatFrequency } from './models/BillRepeatFrequency'; -export type { BillSingle } from './models/BillSingle'; -export type { BillStore } from './models/BillStore'; -export type { BillUpdate } from './models/BillUpdate'; -export type { Budget } from './models/Budget'; -export type { BudgetArray } from './models/BudgetArray'; -export type { BudgetLimit } from './models/BudgetLimit'; -export type { BudgetLimitArray } from './models/BudgetLimitArray'; -export type { BudgetLimitRead } from './models/BudgetLimitRead'; -export type { BudgetLimitSingle } from './models/BudgetLimitSingle'; -export type { BudgetLimitStore } from './models/BudgetLimitStore'; -export type { BudgetRead } from './models/BudgetRead'; -export type { BudgetSingle } from './models/BudgetSingle'; -export type { BudgetSpent } from './models/BudgetSpent'; -export type { BudgetStore } from './models/BudgetStore'; -export type { BudgetUpdate } from './models/BudgetUpdate'; -export type { Category } from './models/Category'; -export type { CategoryArray } from './models/CategoryArray'; -export type { CategoryEarned } from './models/CategoryEarned'; -export type { CategoryRead } from './models/CategoryRead'; -export type { CategorySingle } from './models/CategorySingle'; -export type { CategorySpent } from './models/CategorySpent'; -export type { CategoryUpdate } from './models/CategoryUpdate'; -export type { ChartDataPoint } from './models/ChartDataPoint'; -export type { ChartDataSet } from './models/ChartDataSet'; -export type { ChartLine } from './models/ChartLine'; -export type { Configuration } from './models/Configuration'; -export type { ConfigurationArray } from './models/ConfigurationArray'; -export type { ConfigurationSingle } from './models/ConfigurationSingle'; -export type { ConfigurationUpdate } from './models/ConfigurationUpdate'; -export { ConfigValueFilter } from './models/ConfigValueFilter'; -export { ConfigValueUpdateFilter } from './models/ConfigValueUpdateFilter'; -export { CreditCardType } from './models/CreditCardType'; -export type { CronResult } from './models/CronResult'; -export type { CronResultRow } from './models/CronResultRow'; -export type { Currency } from './models/Currency'; -export type { CurrencyArray } from './models/CurrencyArray'; -export type { CurrencyRead } from './models/CurrencyRead'; -export type { CurrencySingle } from './models/CurrencySingle'; -export type { CurrencyStore } from './models/CurrencyStore'; -export type { CurrencyUpdate } from './models/CurrencyUpdate'; -export { DataDestroyObject } from './models/DataDestroyObject'; -export { ExportFileFilter } from './models/ExportFileFilter'; -export type { InsightGroup } from './models/InsightGroup'; -export type { InsightGroupEntry } from './models/InsightGroupEntry'; -export type { InsightTotal } from './models/InsightTotal'; -export type { InsightTotalEntry } from './models/InsightTotalEntry'; -export type { InsightTransfer } from './models/InsightTransfer'; -export type { InsightTransferEntry } from './models/InsightTransferEntry'; -export { InterestPeriod } from './models/InterestPeriod'; -export type { InternalException } from './models/InternalException'; -export { LiabilityDirection } from './models/LiabilityDirection'; -export { LiabilityType } from './models/LiabilityType'; -export type { LinkType } from './models/LinkType'; -export type { LinkTypeArray } from './models/LinkTypeArray'; -export type { LinkTypeRead } from './models/LinkTypeRead'; -export type { LinkTypeSingle } from './models/LinkTypeSingle'; -export type { LinkTypeUpdate } from './models/LinkTypeUpdate'; -export type { Meta } from './models/Meta'; -export type { NotFound } from './models/NotFound'; -export type { ObjectGroup } from './models/ObjectGroup'; -export type { ObjectGroupArray } from './models/ObjectGroupArray'; -export type { ObjectGroupRead } from './models/ObjectGroupRead'; -export type { ObjectGroupSingle } from './models/ObjectGroupSingle'; -export type { ObjectGroupUpdate } from './models/ObjectGroupUpdate'; -export type { ObjectLink } from './models/ObjectLink'; -export type { PageLink } from './models/PageLink'; -export type { PiggyBank } from './models/PiggyBank'; -export type { PiggyBankArray } from './models/PiggyBankArray'; -export type { PiggyBankEvent } from './models/PiggyBankEvent'; -export type { PiggyBankEventArray } from './models/PiggyBankEventArray'; -export type { PiggyBankEventRead } from './models/PiggyBankEventRead'; -export type { PiggyBankRead } from './models/PiggyBankRead'; -export type { PiggyBankSingle } from './models/PiggyBankSingle'; -export type { PiggyBankStore } from './models/PiggyBankStore'; -export type { PiggyBankUpdate } from './models/PiggyBankUpdate'; -export type { PolymorphicProperty } from './models/PolymorphicProperty'; -export type { Preference } from './models/Preference'; -export type { PreferenceArray } from './models/PreferenceArray'; -export type { PreferenceRead } from './models/PreferenceRead'; -export type { PreferenceSingle } from './models/PreferenceSingle'; -export type { PreferenceUpdate } from './models/PreferenceUpdate'; -export type { Recurrence } from './models/Recurrence'; -export type { RecurrenceArray } from './models/RecurrenceArray'; -export type { RecurrenceRead } from './models/RecurrenceRead'; -export type { RecurrenceRepetition } from './models/RecurrenceRepetition'; -export type { RecurrenceRepetitionStore } from './models/RecurrenceRepetitionStore'; -export { RecurrenceRepetitionType } from './models/RecurrenceRepetitionType'; -export type { RecurrenceRepetitionUpdate } from './models/RecurrenceRepetitionUpdate'; -export type { RecurrenceSingle } from './models/RecurrenceSingle'; -export type { RecurrenceStore } from './models/RecurrenceStore'; -export type { RecurrenceTransaction } from './models/RecurrenceTransaction'; -export type { RecurrenceTransactionStore } from './models/RecurrenceTransactionStore'; -export { RecurrenceTransactionType } from './models/RecurrenceTransactionType'; -export type { RecurrenceTransactionUpdate } from './models/RecurrenceTransactionUpdate'; -export type { RecurrenceUpdate } from './models/RecurrenceUpdate'; -export type { Rule } from './models/Rule'; -export type { RuleAction } from './models/RuleAction'; -export { RuleActionKeyword } from './models/RuleActionKeyword'; -export type { RuleActionStore } from './models/RuleActionStore'; -export type { RuleActionUpdate } from './models/RuleActionUpdate'; -export type { RuleArray } from './models/RuleArray'; -export type { RuleGroup } from './models/RuleGroup'; -export type { RuleGroupArray } from './models/RuleGroupArray'; -export type { RuleGroupRead } from './models/RuleGroupRead'; -export type { RuleGroupSingle } from './models/RuleGroupSingle'; -export type { RuleGroupStore } from './models/RuleGroupStore'; -export type { RuleGroupUpdate } from './models/RuleGroupUpdate'; -export type { RuleRead } from './models/RuleRead'; -export type { RuleSingle } from './models/RuleSingle'; -export type { RuleStore } from './models/RuleStore'; -export type { RuleTrigger } from './models/RuleTrigger'; -export { RuleTriggerKeyword } from './models/RuleTriggerKeyword'; -export type { RuleTriggerStore } from './models/RuleTriggerStore'; -export { RuleTriggerType } from './models/RuleTriggerType'; -export type { RuleTriggerUpdate } from './models/RuleTriggerUpdate'; -export type { RuleUpdate } from './models/RuleUpdate'; -export { ShortAccountTypeProperty } from './models/ShortAccountTypeProperty'; -export type { StringArrayItem } from './models/StringArrayItem'; -export type { SystemInfo } from './models/SystemInfo'; -export type { TagArray } from './models/TagArray'; -export type { TagModel } from './models/TagModel'; -export type { TagModelStore } from './models/TagModelStore'; -export type { TagModelUpdate } from './models/TagModelUpdate'; -export type { TagRead } from './models/TagRead'; -export type { TagSingle } from './models/TagSingle'; -export type { Transaction } from './models/Transaction'; -export type { TransactionArray } from './models/TransactionArray'; -export type { TransactionLink } from './models/TransactionLink'; -export type { TransactionLinkArray } from './models/TransactionLinkArray'; -export type { TransactionLinkRead } from './models/TransactionLinkRead'; -export type { TransactionLinkSingle } from './models/TransactionLinkSingle'; -export type { TransactionLinkStore } from './models/TransactionLinkStore'; -export type { TransactionLinkUpdate } from './models/TransactionLinkUpdate'; -export type { TransactionRead } from './models/TransactionRead'; -export type { TransactionSingle } from './models/TransactionSingle'; -export type { TransactionSplit } from './models/TransactionSplit'; -export type { TransactionSplitStore } from './models/TransactionSplitStore'; -export type { TransactionSplitUpdate } from './models/TransactionSplitUpdate'; -export type { TransactionStore } from './models/TransactionStore'; -export { TransactionTypeFilter } from './models/TransactionTypeFilter'; -export { TransactionTypeProperty } from './models/TransactionTypeProperty'; -export type { TransactionUpdate } from './models/TransactionUpdate'; -export type { Unauthenticated } from './models/Unauthenticated'; -export type { User } from './models/User'; -export type { UserArray } from './models/UserArray'; -export { UserBlockedCodeProperty } from './models/UserBlockedCodeProperty'; -export type { UserRead } from './models/UserRead'; -export { UserRoleProperty } from './models/UserRoleProperty'; -export type { UserSingle } from './models/UserSingle'; -export type { ValidationError } from './models/ValidationError'; -export type { Webhook } from './models/Webhook'; -export type { WebhookArray } from './models/WebhookArray'; -export type { WebhookAttempt } from './models/WebhookAttempt'; -export type { WebhookAttemptArray } from './models/WebhookAttemptArray'; -export type { WebhookAttemptRead } from './models/WebhookAttemptRead'; -export type { WebhookAttemptSingle } from './models/WebhookAttemptSingle'; -export { WebhookDelivery } from './models/WebhookDelivery'; -export type { WebhookMessage } from './models/WebhookMessage'; -export type { WebhookMessageArray } from './models/WebhookMessageArray'; -export type { WebhookMessageRead } from './models/WebhookMessageRead'; -export type { WebhookMessageSingle } from './models/WebhookMessageSingle'; -export type { WebhookRead } from './models/WebhookRead'; -export { WebhookResponse } from './models/WebhookResponse'; -export type { WebhookSingle } from './models/WebhookSingle'; -export type { WebhookStore } from './models/WebhookStore'; -export { WebhookTrigger } from './models/WebhookTrigger'; -export type { WebhookUpdate } from './models/WebhookUpdate'; - -export { AboutService } from './services/AboutService'; -export { AccountsService } from './services/AccountsService'; -export { AttachmentsService } from './services/AttachmentsService'; -export { AutocompleteService } from './services/AutocompleteService'; -export { AvailableBudgetsService } from './services/AvailableBudgetsService'; -export { BillsService } from './services/BillsService'; -export { BudgetsService } from './services/BudgetsService'; -export { CategoriesService } from './services/CategoriesService'; -export { ChartsService } from './services/ChartsService'; -export { ConfigurationService } from './services/ConfigurationService'; -export { CurrenciesService } from './services/CurrenciesService'; -export { DataService } from './services/DataService'; -export { InsightService } from './services/InsightService'; -export { LinksService } from './services/LinksService'; -export { ObjectGroupsService } from './services/ObjectGroupsService'; -export { PiggyBanksService } from './services/PiggyBanksService'; -export { PreferencesService } from './services/PreferencesService'; -export { RecurrencesService } from './services/RecurrencesService'; -export { RuleGroupsService } from './services/RuleGroupsService'; -export { RulesService } from './services/RulesService'; -export { SearchService } from './services/SearchService'; -export { SummaryService } from './services/SummaryService'; -export { TagsService } from './services/TagsService'; -export { TransactionsService } from './services/TransactionsService'; -export { UsersService } from './services/UsersService'; -export { WebhooksService } from './services/WebhooksService'; +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/src/lib/api/models/Account.ts b/src/lib/api/models/Account.ts index 349b3e9..45c887b 100644 --- a/src/lib/api/models/Account.ts +++ b/src/lib/api/models/Account.ts @@ -1,88 +1,338 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountRoleProperty } from './AccountRoleProperty'; +import { + AccountRolePropertyFromJSON, + AccountRolePropertyFromJSONTyped, + AccountRolePropertyToJSON, +} from './AccountRoleProperty'; import type { CreditCardType } from './CreditCardType'; +import { + CreditCardTypeFromJSON, + CreditCardTypeFromJSONTyped, + CreditCardTypeToJSON, +} from './CreditCardType'; import type { InterestPeriod } from './InterestPeriod'; +import { + InterestPeriodFromJSON, + InterestPeriodFromJSONTyped, + InterestPeriodToJSON, +} from './InterestPeriod'; import type { LiabilityDirection } from './LiabilityDirection'; +import { + LiabilityDirectionFromJSON, + LiabilityDirectionFromJSONTyped, + LiabilityDirectionToJSON, +} from './LiabilityDirection'; import type { LiabilityType } from './LiabilityType'; +import { + LiabilityTypeFromJSON, + LiabilityTypeFromJSONTyped, + LiabilityTypeToJSON, +} from './LiabilityType'; import type { ShortAccountTypeProperty } from './ShortAccountTypeProperty'; +import { + ShortAccountTypePropertyFromJSON, + ShortAccountTypePropertyFromJSONTyped, + ShortAccountTypePropertyToJSON, +} from './ShortAccountTypeProperty'; -export type Account = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Account + */ +export interface Account { + /** + * + * @type {Date} + * @memberof Account + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Account + */ + readonly updatedAt?: Date; /** * If omitted, defaults to true. + * @type {boolean} + * @memberof Account */ active?: boolean; /** * Order of the account. Is NULL if account is not asset or liability. + * @type {number} + * @memberof Account */ order?: number | null; + /** + * + * @type {string} + * @memberof Account + */ name: string; + /** + * + * @type {ShortAccountTypeProperty} + * @memberof Account + */ type: ShortAccountTypeProperty; - account_role?: AccountRoleProperty; + /** + * + * @type {AccountRoleProperty} + * @memberof Account + */ + accountRole?: AccountRoleProperty | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof Account */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof Account */ - currency_code?: string; - readonly currency_symbol?: string; - readonly currency_decimal_places?: number; - readonly current_balance?: string; + currencyCode?: string; + /** + * + * @type {string} + * @memberof Account + */ + readonly currencySymbol?: string; + /** + * + * @type {number} + * @memberof Account + */ + readonly currencyDecimalPlaces?: number; + /** + * + * @type {string} + * @memberof Account + */ + readonly currentBalance?: string; /** * The timestamp for this date is always 23:59:59, to indicate it's the balance at the very END of that particular day. + * @type {Date} + * @memberof Account + */ + readonly currentBalanceDate?: Date; + /** + * + * @type {string} + * @memberof Account */ - readonly current_balance_date?: string; iban?: string | null; + /** + * + * @type {string} + * @memberof Account + */ bic?: string | null; - account_number?: string | null; + /** + * + * @type {string} + * @memberof Account + */ + accountNumber?: string | null; /** * Represents the opening balance, the initial amount this account holds. + * @type {string} + * @memberof Account */ - opening_balance?: string; + openingBalance?: string; /** * Represents the current debt for liabilities. + * @type {string} + * @memberof Account */ - current_debt?: string | null; + currentDebt?: string | null; /** * Represents the date of the opening balance. + * @type {Date} + * @memberof Account */ - opening_balance_date?: string | null; - virtual_balance?: string; + openingBalanceDate?: Date | null; + /** + * + * @type {string} + * @memberof Account + */ + virtualBalance?: string; /** * If omitted, defaults to true. + * @type {boolean} + * @memberof Account + */ + includeNetWorth?: boolean; + /** + * + * @type {CreditCardType} + * @memberof Account */ - include_net_worth?: boolean; - credit_card_type?: CreditCardType; + creditCardType?: CreditCardType | null; /** * Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. + * @type {Date} + * @memberof Account + */ + monthlyPaymentDate?: Date | null; + /** + * + * @type {LiabilityType} + * @memberof Account + */ + liabilityType?: LiabilityType | null; + /** + * + * @type {LiabilityDirection} + * @memberof Account */ - monthly_payment_date?: string | null; - liability_type?: LiabilityType; - liability_direction?: LiabilityDirection; + liabilityDirection?: LiabilityDirection | null; /** * Mandatory when type is liability. Interest percentage. + * @type {string} + * @memberof Account */ interest?: string | null; - interest_period?: InterestPeriod; + /** + * + * @type {InterestPeriod} + * @memberof Account + */ + interestPeriod?: InterestPeriod | null; + /** + * + * @type {string} + * @memberof Account + */ notes?: string | null; /** * Latitude of the accounts's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof Account */ latitude?: number | null; /** * Latitude of the accounts's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof Account */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + * @type {number} + * @memberof Account */ - zoom_level?: number | null; -}; + zoomLevel?: number | null; +} + +/** + * Check if a given object implements the Account interface. + */ +export function instanceOfAccount(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function AccountFromJSON(json: any): Account { + return AccountFromJSONTyped(json, false); +} + +export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): Account { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'active': !exists(json, 'active') ? undefined : json['active'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'name': json['name'], + 'type': ShortAccountTypePropertyFromJSON(json['type']), + 'accountRole': !exists(json, 'account_role') ? undefined : AccountRolePropertyFromJSON(json['account_role']), + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'currentBalance': !exists(json, 'current_balance') ? undefined : json['current_balance'], + 'currentBalanceDate': !exists(json, 'current_balance_date') ? undefined : (new Date(json['current_balance_date'])), + 'iban': !exists(json, 'iban') ? undefined : json['iban'], + 'bic': !exists(json, 'bic') ? undefined : json['bic'], + 'accountNumber': !exists(json, 'account_number') ? undefined : json['account_number'], + 'openingBalance': !exists(json, 'opening_balance') ? undefined : json['opening_balance'], + 'currentDebt': !exists(json, 'current_debt') ? undefined : json['current_debt'], + 'openingBalanceDate': !exists(json, 'opening_balance_date') ? undefined : (json['opening_balance_date'] === null ? null : new Date(json['opening_balance_date'])), + 'virtualBalance': !exists(json, 'virtual_balance') ? undefined : json['virtual_balance'], + 'includeNetWorth': !exists(json, 'include_net_worth') ? undefined : json['include_net_worth'], + 'creditCardType': !exists(json, 'credit_card_type') ? undefined : CreditCardTypeFromJSON(json['credit_card_type']), + 'monthlyPaymentDate': !exists(json, 'monthly_payment_date') ? undefined : (json['monthly_payment_date'] === null ? null : new Date(json['monthly_payment_date'])), + 'liabilityType': !exists(json, 'liability_type') ? undefined : LiabilityTypeFromJSON(json['liability_type']), + 'liabilityDirection': !exists(json, 'liability_direction') ? undefined : LiabilityDirectionFromJSON(json['liability_direction']), + 'interest': !exists(json, 'interest') ? undefined : json['interest'], + 'interestPeriod': !exists(json, 'interest_period') ? undefined : InterestPeriodFromJSON(json['interest_period']), + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + }; +} + +export function AccountToJSON(value?: Account | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'active': value.active, + 'order': value.order, + 'name': value.name, + 'type': ShortAccountTypePropertyToJSON(value.type), + 'account_role': AccountRolePropertyToJSON(value.accountRole), + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'iban': value.iban, + 'bic': value.bic, + 'account_number': value.accountNumber, + 'opening_balance': value.openingBalance, + 'current_debt': value.currentDebt, + 'opening_balance_date': value.openingBalanceDate === undefined ? undefined : (value.openingBalanceDate === null ? null : value.openingBalanceDate.toISOString()), + 'virtual_balance': value.virtualBalance, + 'include_net_worth': value.includeNetWorth, + 'credit_card_type': CreditCardTypeToJSON(value.creditCardType), + 'monthly_payment_date': value.monthlyPaymentDate === undefined ? undefined : (value.monthlyPaymentDate === null ? null : value.monthlyPaymentDate.toISOString()), + 'liability_type': LiabilityTypeToJSON(value.liabilityType), + 'liability_direction': LiabilityDirectionToJSON(value.liabilityDirection), + 'interest': value.interest, + 'interest_period': InterestPeriodToJSON(value.interestPeriod), + 'notes': value.notes, + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + }; +} diff --git a/src/lib/api/models/AccountArray.ts b/src/lib/api/models/AccountArray.ts index 483d411..b42a014 100644 --- a/src/lib/api/models/AccountArray.ts +++ b/src/lib/api/models/AccountArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountRead } from './AccountRead'; +import { + AccountReadFromJSON, + AccountReadFromJSONTyped, + AccountReadToJSON, +} from './AccountRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type AccountArray = { +/** + * + * @export + * @interface AccountArray + */ +export interface AccountArray { + /** + * + * @type {Array} + * @memberof AccountArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof AccountArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the AccountArray interface. + */ +export function instanceOfAccountArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function AccountArrayFromJSON(json: any): AccountArray { + return AccountArrayFromJSONTyped(json, false); +} + +export function AccountArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(AccountReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function AccountArrayToJSON(value?: AccountArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(AccountReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/AccountRead.ts b/src/lib/api/models/AccountRead.ts index b2e2704..67c926f 100644 --- a/src/lib/api/models/AccountRead.ts +++ b/src/lib/api/models/AccountRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Account } from './Account'; +import { + AccountFromJSON, + AccountFromJSONTyped, + AccountToJSON, +} from './Account'; -export type AccountRead = { +/** + * + * @export + * @interface AccountRead + */ +export interface AccountRead { /** * Immutable value + * @type {string} + * @memberof AccountRead */ type: string; + /** + * + * @type {string} + * @memberof AccountRead + */ id: string; + /** + * + * @type {Account} + * @memberof AccountRead + */ attributes: Account; -}; +} + +/** + * Check if a given object implements the AccountRead interface. + */ +export function instanceOfAccountRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function AccountReadFromJSON(json: any): AccountRead { + return AccountReadFromJSONTyped(json, false); +} + +export function AccountReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': AccountFromJSON(json['attributes']), + }; +} + +export function AccountReadToJSON(value?: AccountRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': AccountToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/AccountRoleProperty.ts b/src/lib/api/models/AccountRoleProperty.ts index 6fc54af..199f970 100644 --- a/src/lib/api/models/AccountRoleProperty.ts +++ b/src/lib/api/models/AccountRoleProperty.ts @@ -1,15 +1,42 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Is only mandatory when the type is asset. + * @export */ -export enum AccountRoleProperty { - DEFAULT_ASSET = 'defaultAsset', - SHARED_ASSET = 'sharedAsset', - SAVING_ASSET = 'savingAsset', - CC_ASSET = 'ccAsset', - CASH_WALLET_ASSET = 'cashWalletAsset', +export const AccountRoleProperty = { + DefaultAsset: 'defaultAsset', + SharedAsset: 'sharedAsset', + SavingAsset: 'savingAsset', + CcAsset: 'ccAsset', + CashWalletAsset: 'cashWalletAsset', + Null: 'null' +} as const; +export type AccountRoleProperty = typeof AccountRoleProperty[keyof typeof AccountRoleProperty]; + + +export function AccountRolePropertyFromJSON(json: any): AccountRoleProperty { + return AccountRolePropertyFromJSONTyped(json, false); } + +export function AccountRolePropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountRoleProperty { + return json as AccountRoleProperty; +} + +export function AccountRolePropertyToJSON(value?: AccountRoleProperty | null): any { + return value as any; +} + diff --git a/src/lib/api/models/AccountSearchFieldFilter.ts b/src/lib/api/models/AccountSearchFieldFilter.ts index a96364d..1cf609a 100644 --- a/src/lib/api/models/AccountSearchFieldFilter.ts +++ b/src/lib/api/models/AccountSearchFieldFilter.ts @@ -1,12 +1,41 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum AccountSearchFieldFilter { - ALL = 'all', - IBAN = 'iban', - NAME = 'name', - NUMBER = 'number', - ID = 'id', + +/** + * + * @export + */ +export const AccountSearchFieldFilter = { + All: 'all', + Iban: 'iban', + Name: 'name', + Number: 'number', + Id: 'id' +} as const; +export type AccountSearchFieldFilter = typeof AccountSearchFieldFilter[keyof typeof AccountSearchFieldFilter]; + + +export function AccountSearchFieldFilterFromJSON(json: any): AccountSearchFieldFilter { + return AccountSearchFieldFilterFromJSONTyped(json, false); +} + +export function AccountSearchFieldFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountSearchFieldFilter { + return json as AccountSearchFieldFilter; +} + +export function AccountSearchFieldFilterToJSON(value?: AccountSearchFieldFilter | null): any { + return value as any; } + diff --git a/src/lib/api/models/AccountSingle.ts b/src/lib/api/models/AccountSingle.ts index 67fe555..1f4ab95 100644 --- a/src/lib/api/models/AccountSingle.ts +++ b/src/lib/api/models/AccountSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountRead } from './AccountRead'; +import { + AccountReadFromJSON, + AccountReadFromJSONTyped, + AccountReadToJSON, +} from './AccountRead'; -export type AccountSingle = { +/** + * + * @export + * @interface AccountSingle + */ +export interface AccountSingle { + /** + * + * @type {AccountRead} + * @memberof AccountSingle + */ data: AccountRead; -}; +} + +/** + * Check if a given object implements the AccountSingle interface. + */ +export function instanceOfAccountSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function AccountSingleFromJSON(json: any): AccountSingle { + return AccountSingleFromJSONTyped(json, false); +} + +export function AccountSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': AccountReadFromJSON(json['data']), + }; +} + +export function AccountSingleToJSON(value?: AccountSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': AccountReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/AccountStore.ts b/src/lib/api/models/AccountStore.ts index 0bd3367..d5fa11d 100644 --- a/src/lib/api/models/AccountStore.ts +++ b/src/lib/api/models/AccountStore.ts @@ -1,75 +1,288 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountRoleProperty } from './AccountRoleProperty'; +import { + AccountRolePropertyFromJSON, + AccountRolePropertyFromJSONTyped, + AccountRolePropertyToJSON, +} from './AccountRoleProperty'; import type { CreditCardType } from './CreditCardType'; +import { + CreditCardTypeFromJSON, + CreditCardTypeFromJSONTyped, + CreditCardTypeToJSON, +} from './CreditCardType'; import type { InterestPeriod } from './InterestPeriod'; +import { + InterestPeriodFromJSON, + InterestPeriodFromJSONTyped, + InterestPeriodToJSON, +} from './InterestPeriod'; import type { LiabilityDirection } from './LiabilityDirection'; +import { + LiabilityDirectionFromJSON, + LiabilityDirectionFromJSONTyped, + LiabilityDirectionToJSON, +} from './LiabilityDirection'; import type { LiabilityType } from './LiabilityType'; +import { + LiabilityTypeFromJSON, + LiabilityTypeFromJSONTyped, + LiabilityTypeToJSON, +} from './LiabilityType'; import type { ShortAccountTypeProperty } from './ShortAccountTypeProperty'; +import { + ShortAccountTypePropertyFromJSON, + ShortAccountTypePropertyFromJSONTyped, + ShortAccountTypePropertyToJSON, +} from './ShortAccountTypeProperty'; -export type AccountStore = { +/** + * + * @export + * @interface AccountStore + */ +export interface AccountStore { + /** + * + * @type {string} + * @memberof AccountStore + */ name: string; + /** + * + * @type {ShortAccountTypeProperty} + * @memberof AccountStore + */ type: ShortAccountTypeProperty; + /** + * + * @type {string} + * @memberof AccountStore + */ iban?: string | null; + /** + * + * @type {string} + * @memberof AccountStore + */ bic?: string | null; - account_number?: string | null; + /** + * + * @type {string} + * @memberof AccountStore + */ + accountNumber?: string | null; /** * Represents the opening balance, the initial amount this account holds. + * @type {string} + * @memberof AccountStore */ - opening_balance?: string; + openingBalance?: string; /** * Represents the date of the opening balance. + * @type {Date} + * @memberof AccountStore + */ + openingBalanceDate?: Date | null; + /** + * + * @type {string} + * @memberof AccountStore */ - opening_balance_date?: string | null; - virtual_balance?: string; + virtualBalance?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof AccountStore */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof AccountStore */ - currency_code?: string; + currencyCode?: string; /** * If omitted, defaults to true. + * @type {boolean} + * @memberof AccountStore */ active?: boolean; /** * Order of the account + * @type {number} + * @memberof AccountStore */ order?: number; /** * If omitted, defaults to true. + * @type {boolean} + * @memberof AccountStore */ - include_net_worth?: boolean; - account_role?: AccountRoleProperty; - credit_card_type?: CreditCardType; + includeNetWorth?: boolean; + /** + * + * @type {AccountRoleProperty} + * @memberof AccountStore + */ + accountRole?: AccountRoleProperty | null; + /** + * + * @type {CreditCardType} + * @memberof AccountStore + */ + creditCardType?: CreditCardType | null; /** * Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. + * @type {Date} + * @memberof AccountStore + */ + monthlyPaymentDate?: Date | null; + /** + * + * @type {LiabilityType} + * @memberof AccountStore */ - monthly_payment_date?: string | null; - liability_type?: LiabilityType; - liability_direction?: LiabilityDirection; + liabilityType?: LiabilityType | null; + /** + * + * @type {LiabilityDirection} + * @memberof AccountStore + */ + liabilityDirection?: LiabilityDirection | null; /** * Mandatory when type is liability. Interest percentage. + * @type {string} + * @memberof AccountStore */ interest?: string | null; - interest_period?: InterestPeriod; + /** + * + * @type {InterestPeriod} + * @memberof AccountStore + */ + interestPeriod?: InterestPeriod | null; + /** + * + * @type {string} + * @memberof AccountStore + */ notes?: string | null; /** * Latitude of the accounts's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof AccountStore */ latitude?: number | null; /** * Latitude of the accounts's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof AccountStore */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + * @type {number} + * @memberof AccountStore */ - zoom_level?: number | null; -}; + zoomLevel?: number | null; +} + +/** + * Check if a given object implements the AccountStore interface. + */ +export function instanceOfAccountStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function AccountStoreFromJSON(json: any): AccountStore { + return AccountStoreFromJSONTyped(json, false); +} + +export function AccountStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'type': ShortAccountTypePropertyFromJSON(json['type']), + 'iban': !exists(json, 'iban') ? undefined : json['iban'], + 'bic': !exists(json, 'bic') ? undefined : json['bic'], + 'accountNumber': !exists(json, 'account_number') ? undefined : json['account_number'], + 'openingBalance': !exists(json, 'opening_balance') ? undefined : json['opening_balance'], + 'openingBalanceDate': !exists(json, 'opening_balance_date') ? undefined : (json['opening_balance_date'] === null ? null : new Date(json['opening_balance_date'])), + 'virtualBalance': !exists(json, 'virtual_balance') ? undefined : json['virtual_balance'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'includeNetWorth': !exists(json, 'include_net_worth') ? undefined : json['include_net_worth'], + 'accountRole': !exists(json, 'account_role') ? undefined : AccountRolePropertyFromJSON(json['account_role']), + 'creditCardType': !exists(json, 'credit_card_type') ? undefined : CreditCardTypeFromJSON(json['credit_card_type']), + 'monthlyPaymentDate': !exists(json, 'monthly_payment_date') ? undefined : (json['monthly_payment_date'] === null ? null : new Date(json['monthly_payment_date'])), + 'liabilityType': !exists(json, 'liability_type') ? undefined : LiabilityTypeFromJSON(json['liability_type']), + 'liabilityDirection': !exists(json, 'liability_direction') ? undefined : LiabilityDirectionFromJSON(json['liability_direction']), + 'interest': !exists(json, 'interest') ? undefined : json['interest'], + 'interestPeriod': !exists(json, 'interest_period') ? undefined : InterestPeriodFromJSON(json['interest_period']), + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + }; +} + +export function AccountStoreToJSON(value?: AccountStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'type': ShortAccountTypePropertyToJSON(value.type), + 'iban': value.iban, + 'bic': value.bic, + 'account_number': value.accountNumber, + 'opening_balance': value.openingBalance, + 'opening_balance_date': value.openingBalanceDate === undefined ? undefined : (value.openingBalanceDate === null ? null : value.openingBalanceDate.toISOString()), + 'virtual_balance': value.virtualBalance, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'active': value.active, + 'order': value.order, + 'include_net_worth': value.includeNetWorth, + 'account_role': AccountRolePropertyToJSON(value.accountRole), + 'credit_card_type': CreditCardTypeToJSON(value.creditCardType), + 'monthly_payment_date': value.monthlyPaymentDate === undefined ? undefined : (value.monthlyPaymentDate === null ? null : value.monthlyPaymentDate.toISOString()), + 'liability_type': LiabilityTypeToJSON(value.liabilityType), + 'liability_direction': LiabilityDirectionToJSON(value.liabilityDirection), + 'interest': value.interest, + 'interest_period': InterestPeriodToJSON(value.interestPeriod), + 'notes': value.notes, + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + }; +} diff --git a/src/lib/api/models/AccountTypeFilter.ts b/src/lib/api/models/AccountTypeFilter.ts index 507c7ba..d48c9f1 100644 --- a/src/lib/api/models/AccountTypeFilter.ts +++ b/src/lib/api/models/AccountTypeFilter.ts @@ -1,28 +1,57 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum AccountTypeFilter { - ALL = 'all', - ASSET = 'asset', - CASH = 'cash', - EXPENSE = 'expense', - REVENUE = 'revenue', - SPECIAL = 'special', - HIDDEN = 'hidden', - LIABILITY = 'liability', - LIABILITIES = 'liabilities', - DEFAULT_ACCOUNT = 'Default account', - CASH_ACCOUNT = 'Cash account', - ASSET_ACCOUNT = 'Asset account', - EXPENSE_ACCOUNT = 'Expense account', - REVENUE_ACCOUNT = 'Revenue account', - INITIAL_BALANCE_ACCOUNT = 'Initial balance account', - BENEFICIARY_ACCOUNT = 'Beneficiary account', - IMPORT_ACCOUNT = 'Import account', - RECONCILIATION_ACCOUNT = 'Reconciliation account', - LOAN = 'Loan', - DEBT = 'Debt', - MORTGAGE = 'Mortgage', + +/** + * + * @export + */ +export const AccountTypeFilter = { + All: 'all', + Asset: 'asset', + Cash: 'cash', + Expense: 'expense', + Revenue: 'revenue', + Special: 'special', + Hidden: 'hidden', + Liability: 'liability', + Liabilities: 'liabilities', + DefaultAccount: 'Default account', + CashAccount: 'Cash account', + AssetAccount: 'Asset account', + ExpenseAccount: 'Expense account', + RevenueAccount: 'Revenue account', + InitialBalanceAccount: 'Initial balance account', + BeneficiaryAccount: 'Beneficiary account', + ImportAccount: 'Import account', + ReconciliationAccount: 'Reconciliation account', + Loan: 'Loan', + Debt: 'Debt', + Mortgage: 'Mortgage' +} as const; +export type AccountTypeFilter = typeof AccountTypeFilter[keyof typeof AccountTypeFilter]; + + +export function AccountTypeFilterFromJSON(json: any): AccountTypeFilter { + return AccountTypeFilterFromJSONTyped(json, false); +} + +export function AccountTypeFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountTypeFilter { + return json as AccountTypeFilter; +} + +export function AccountTypeFilterToJSON(value?: AccountTypeFilter | null): any { + return value as any; } + diff --git a/src/lib/api/models/AccountTypeProperty.ts b/src/lib/api/models/AccountTypeProperty.ts index 6edb1de..4cf4c22 100644 --- a/src/lib/api/models/AccountTypeProperty.ts +++ b/src/lib/api/models/AccountTypeProperty.ts @@ -1,19 +1,48 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum AccountTypeProperty { - DEFAULT_ACCOUNT = 'Default account', - CASH_ACCOUNT = 'Cash account', - ASSET_ACCOUNT = 'Asset account', - EXPENSE_ACCOUNT = 'Expense account', - REVENUE_ACCOUNT = 'Revenue account', - INITIAL_BALANCE_ACCOUNT = 'Initial balance account', - BENEFICIARY_ACCOUNT = 'Beneficiary account', - IMPORT_ACCOUNT = 'Import account', - RECONCILIATION_ACCOUNT = 'Reconciliation account', - LOAN = 'Loan', - DEBT = 'Debt', - MORTGAGE = 'Mortgage', + +/** + * + * @export + */ +export const AccountTypeProperty = { + DefaultAccount: 'Default account', + CashAccount: 'Cash account', + AssetAccount: 'Asset account', + ExpenseAccount: 'Expense account', + RevenueAccount: 'Revenue account', + InitialBalanceAccount: 'Initial balance account', + BeneficiaryAccount: 'Beneficiary account', + ImportAccount: 'Import account', + ReconciliationAccount: 'Reconciliation account', + Loan: 'Loan', + Debt: 'Debt', + Mortgage: 'Mortgage' +} as const; +export type AccountTypeProperty = typeof AccountTypeProperty[keyof typeof AccountTypeProperty]; + + +export function AccountTypePropertyFromJSON(json: any): AccountTypeProperty { + return AccountTypePropertyFromJSONTyped(json, false); +} + +export function AccountTypePropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountTypeProperty { + return json as AccountTypeProperty; +} + +export function AccountTypePropertyToJSON(value?: AccountTypeProperty | null): any { + return value as any; } + diff --git a/src/lib/api/models/AccountUpdate.ts b/src/lib/api/models/AccountUpdate.ts index 23f31fe..3cee3b5 100644 --- a/src/lib/api/models/AccountUpdate.ts +++ b/src/lib/api/models/AccountUpdate.ts @@ -1,65 +1,259 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountRoleProperty } from './AccountRoleProperty'; +import { + AccountRolePropertyFromJSON, + AccountRolePropertyFromJSONTyped, + AccountRolePropertyToJSON, +} from './AccountRoleProperty'; import type { CreditCardType } from './CreditCardType'; +import { + CreditCardTypeFromJSON, + CreditCardTypeFromJSONTyped, + CreditCardTypeToJSON, +} from './CreditCardType'; import type { InterestPeriod } from './InterestPeriod'; +import { + InterestPeriodFromJSON, + InterestPeriodFromJSONTyped, + InterestPeriodToJSON, +} from './InterestPeriod'; import type { LiabilityType } from './LiabilityType'; +import { + LiabilityTypeFromJSON, + LiabilityTypeFromJSONTyped, + LiabilityTypeToJSON, +} from './LiabilityType'; -export type AccountUpdate = { +/** + * + * @export + * @interface AccountUpdate + */ +export interface AccountUpdate { + /** + * + * @type {string} + * @memberof AccountUpdate + */ name: string; + /** + * + * @type {string} + * @memberof AccountUpdate + */ iban?: string | null; + /** + * + * @type {string} + * @memberof AccountUpdate + */ bic?: string | null; - account_number?: string | null; - opening_balance?: string; - opening_balance_date?: string | null; - virtual_balance?: string; + /** + * + * @type {string} + * @memberof AccountUpdate + */ + accountNumber?: string | null; + /** + * + * @type {string} + * @memberof AccountUpdate + */ + openingBalance?: string; + /** + * + * @type {Date} + * @memberof AccountUpdate + */ + openingBalanceDate?: Date | null; + /** + * + * @type {string} + * @memberof AccountUpdate + */ + virtualBalance?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof AccountUpdate */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof AccountUpdate */ - currency_code?: string; + currencyCode?: string; /** * If omitted, defaults to true. + * @type {boolean} + * @memberof AccountUpdate */ active?: boolean; /** * Order of the account + * @type {number} + * @memberof AccountUpdate */ order?: number; /** * If omitted, defaults to true. + * @type {boolean} + * @memberof AccountUpdate */ - include_net_worth?: boolean; - account_role?: AccountRoleProperty; - credit_card_type?: CreditCardType; + includeNetWorth?: boolean; + /** + * + * @type {AccountRoleProperty} + * @memberof AccountUpdate + */ + accountRole?: AccountRoleProperty | null; + /** + * + * @type {CreditCardType} + * @memberof AccountUpdate + */ + creditCardType?: CreditCardType | null; /** * Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. + * @type {Date} + * @memberof AccountUpdate */ - monthly_payment_date?: string | null; - liability_type?: LiabilityType; + monthlyPaymentDate?: Date | null; + /** + * + * @type {LiabilityType} + * @memberof AccountUpdate + */ + liabilityType?: LiabilityType | null; /** * Mandatory when type is liability. Interest percentage. + * @type {string} + * @memberof AccountUpdate */ interest?: string | null; - interest_period?: InterestPeriod; + /** + * + * @type {InterestPeriod} + * @memberof AccountUpdate + */ + interestPeriod?: InterestPeriod | null; + /** + * + * @type {string} + * @memberof AccountUpdate + */ notes?: string | null; /** * Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. + * @type {number} + * @memberof AccountUpdate */ latitude?: number | null; /** * Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. + * @type {number} + * @memberof AccountUpdate */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. + * @type {number} + * @memberof AccountUpdate */ - zoom_level?: number | null; -}; + zoomLevel?: number | null; +} + +/** + * Check if a given object implements the AccountUpdate interface. + */ +export function instanceOfAccountUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AccountUpdateFromJSON(json: any): AccountUpdate { + return AccountUpdateFromJSONTyped(json, false); +} + +export function AccountUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'iban': !exists(json, 'iban') ? undefined : json['iban'], + 'bic': !exists(json, 'bic') ? undefined : json['bic'], + 'accountNumber': !exists(json, 'account_number') ? undefined : json['account_number'], + 'openingBalance': !exists(json, 'opening_balance') ? undefined : json['opening_balance'], + 'openingBalanceDate': !exists(json, 'opening_balance_date') ? undefined : (json['opening_balance_date'] === null ? null : new Date(json['opening_balance_date'])), + 'virtualBalance': !exists(json, 'virtual_balance') ? undefined : json['virtual_balance'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'includeNetWorth': !exists(json, 'include_net_worth') ? undefined : json['include_net_worth'], + 'accountRole': !exists(json, 'account_role') ? undefined : AccountRolePropertyFromJSON(json['account_role']), + 'creditCardType': !exists(json, 'credit_card_type') ? undefined : CreditCardTypeFromJSON(json['credit_card_type']), + 'monthlyPaymentDate': !exists(json, 'monthly_payment_date') ? undefined : (json['monthly_payment_date'] === null ? null : new Date(json['monthly_payment_date'])), + 'liabilityType': !exists(json, 'liability_type') ? undefined : LiabilityTypeFromJSON(json['liability_type']), + 'interest': !exists(json, 'interest') ? undefined : json['interest'], + 'interestPeriod': !exists(json, 'interest_period') ? undefined : InterestPeriodFromJSON(json['interest_period']), + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + }; +} + +export function AccountUpdateToJSON(value?: AccountUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'iban': value.iban, + 'bic': value.bic, + 'account_number': value.accountNumber, + 'opening_balance': value.openingBalance, + 'opening_balance_date': value.openingBalanceDate === undefined ? undefined : (value.openingBalanceDate === null ? null : value.openingBalanceDate.toISOString()), + 'virtual_balance': value.virtualBalance, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'active': value.active, + 'order': value.order, + 'include_net_worth': value.includeNetWorth, + 'account_role': AccountRolePropertyToJSON(value.accountRole), + 'credit_card_type': CreditCardTypeToJSON(value.creditCardType), + 'monthly_payment_date': value.monthlyPaymentDate === undefined ? undefined : (value.monthlyPaymentDate === null ? null : value.monthlyPaymentDate.toISOString()), + 'liability_type': LiabilityTypeToJSON(value.liabilityType), + 'interest': value.interest, + 'interest_period': InterestPeriodToJSON(value.interestPeriod), + 'notes': value.notes, + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + }; +} diff --git a/src/lib/api/models/AttachableType.ts b/src/lib/api/models/AttachableType.ts index 56b609f..def08b8 100644 --- a/src/lib/api/models/AttachableType.ts +++ b/src/lib/api/models/AttachableType.ts @@ -1,16 +1,42 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * The object class to which the attachment must be linked. + * @export */ -export enum AttachableType { - ACCOUNT = 'Account', - BUDGET = 'Budget', - BILL = 'Bill', - TRANSACTION_JOURNAL = 'TransactionJournal', - PIGGY_BANK = 'PiggyBank', - TAG = 'Tag', +export const AttachableType = { + Account: 'Account', + Budget: 'Budget', + Bill: 'Bill', + TransactionJournal: 'TransactionJournal', + PiggyBank: 'PiggyBank', + Tag: 'Tag' +} as const; +export type AttachableType = typeof AttachableType[keyof typeof AttachableType]; + + +export function AttachableTypeFromJSON(json: any): AttachableType { + return AttachableTypeFromJSONTyped(json, false); } + +export function AttachableTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachableType { + return json as AttachableType; +} + +export function AttachableTypeToJSON(value?: AttachableType | null): any { + return value as any; +} + diff --git a/src/lib/api/models/Attachment.ts b/src/lib/api/models/Attachment.ts index b2260a6..08af25c 100644 --- a/src/lib/api/models/Attachment.ts +++ b/src/lib/api/models/Attachment.ts @@ -1,28 +1,159 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AttachableType } from './AttachableType'; +import { + AttachableTypeFromJSON, + AttachableTypeFromJSONTyped, + AttachableTypeToJSON, +} from './AttachableType'; -export type Attachment = { - readonly created_at?: string; - readonly updated_at?: string; - attachable_type: AttachableType; +/** + * + * @export + * @interface Attachment + */ +export interface Attachment { + /** + * + * @type {Date} + * @memberof Attachment + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Attachment + */ + readonly updatedAt?: Date; + /** + * + * @type {AttachableType} + * @memberof Attachment + */ + attachableType: AttachableType; /** * ID of the model this attachment is linked to. + * @type {string} + * @memberof Attachment */ - attachable_id: string; + attachableId: string; /** * MD5 hash of the file for basic duplicate detection. + * @type {string} + * @memberof Attachment */ md5?: string; + /** + * + * @type {string} + * @memberof Attachment + */ filename: string; - download_url?: string; - upload_url?: string; + /** + * + * @type {string} + * @memberof Attachment + */ + downloadUrl?: string; + /** + * + * @type {string} + * @memberof Attachment + */ + uploadUrl?: string; + /** + * + * @type {string} + * @memberof Attachment + */ title?: string; + /** + * + * @type {string} + * @memberof Attachment + */ notes?: string | null; + /** + * + * @type {string} + * @memberof Attachment + */ readonly mime?: string; + /** + * + * @type {number} + * @memberof Attachment + */ readonly size?: number; -}; +} + +/** + * Check if a given object implements the Attachment interface. + */ +export function instanceOfAttachment(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "attachableType" in value; + isInstance = isInstance && "attachableId" in value; + isInstance = isInstance && "filename" in value; + + return isInstance; +} + +export function AttachmentFromJSON(json: any): Attachment { + return AttachmentFromJSONTyped(json, false); +} + +export function AttachmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachment { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'attachableType': AttachableTypeFromJSON(json['attachable_type']), + 'attachableId': json['attachable_id'], + 'md5': !exists(json, 'md5') ? undefined : json['md5'], + 'filename': json['filename'], + 'downloadUrl': !exists(json, 'download_url') ? undefined : json['download_url'], + 'uploadUrl': !exists(json, 'upload_url') ? undefined : json['upload_url'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'mime': !exists(json, 'mime') ? undefined : json['mime'], + 'size': !exists(json, 'size') ? undefined : json['size'], + }; +} + +export function AttachmentToJSON(value?: Attachment | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'attachable_type': AttachableTypeToJSON(value.attachableType), + 'attachable_id': value.attachableId, + 'md5': value.md5, + 'filename': value.filename, + 'download_url': value.downloadUrl, + 'upload_url': value.uploadUrl, + 'title': value.title, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/AttachmentArray.ts b/src/lib/api/models/AttachmentArray.ts index d4210a5..98a078b 100644 --- a/src/lib/api/models/AttachmentArray.ts +++ b/src/lib/api/models/AttachmentArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AttachmentRead } from './AttachmentRead'; +import { + AttachmentReadFromJSON, + AttachmentReadFromJSONTyped, + AttachmentReadToJSON, +} from './AttachmentRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type AttachmentArray = { +/** + * + * @export + * @interface AttachmentArray + */ +export interface AttachmentArray { + /** + * + * @type {Array} + * @memberof AttachmentArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof AttachmentArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the AttachmentArray interface. + */ +export function instanceOfAttachmentArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function AttachmentArrayFromJSON(json: any): AttachmentArray { + return AttachmentArrayFromJSONTyped(json, false); +} + +export function AttachmentArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(AttachmentReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function AttachmentArrayToJSON(value?: AttachmentArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(AttachmentReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/AttachmentRead.ts b/src/lib/api/models/AttachmentRead.ts index 538d9dd..e8126be 100644 --- a/src/lib/api/models/AttachmentRead.ts +++ b/src/lib/api/models/AttachmentRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Attachment } from './Attachment'; +import { + AttachmentFromJSON, + AttachmentFromJSONTyped, + AttachmentToJSON, +} from './Attachment'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; -export type AttachmentRead = { +/** + * + * @export + * @interface AttachmentRead + */ +export interface AttachmentRead { /** * Immutable value + * @type {string} + * @memberof AttachmentRead */ type: string; + /** + * + * @type {string} + * @memberof AttachmentRead + */ id: string; + /** + * + * @type {Attachment} + * @memberof AttachmentRead + */ attributes: Attachment; + /** + * + * @type {ObjectLink} + * @memberof AttachmentRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the AttachmentRead interface. + */ +export function instanceOfAttachmentRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function AttachmentReadFromJSON(json: any): AttachmentRead { + return AttachmentReadFromJSONTyped(json, false); +} + +export function AttachmentReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': AttachmentFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function AttachmentReadToJSON(value?: AttachmentRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': AttachmentToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/AttachmentSingle.ts b/src/lib/api/models/AttachmentSingle.ts index 18d3781..0c0f077 100644 --- a/src/lib/api/models/AttachmentSingle.ts +++ b/src/lib/api/models/AttachmentSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AttachmentRead } from './AttachmentRead'; +import { + AttachmentReadFromJSON, + AttachmentReadFromJSONTyped, + AttachmentReadToJSON, +} from './AttachmentRead'; -export type AttachmentSingle = { +/** + * + * @export + * @interface AttachmentSingle + */ +export interface AttachmentSingle { + /** + * + * @type {AttachmentRead} + * @memberof AttachmentSingle + */ data: AttachmentRead; -}; +} + +/** + * Check if a given object implements the AttachmentSingle interface. + */ +export function instanceOfAttachmentSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function AttachmentSingleFromJSON(json: any): AttachmentSingle { + return AttachmentSingleFromJSONTyped(json, false); +} + +export function AttachmentSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': AttachmentReadFromJSON(json['data']), + }; +} + +export function AttachmentSingleToJSON(value?: AttachmentSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': AttachmentReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/AttachmentStore.ts b/src/lib/api/models/AttachmentStore.ts index 1734d9c..8cb6b8d 100644 --- a/src/lib/api/models/AttachmentStore.ts +++ b/src/lib/api/models/AttachmentStore.ts @@ -1,18 +1,107 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AttachableType } from './AttachableType'; +import { + AttachableTypeFromJSON, + AttachableTypeFromJSONTyped, + AttachableTypeToJSON, +} from './AttachableType'; -export type AttachmentStore = { +/** + * + * @export + * @interface AttachmentStore + */ +export interface AttachmentStore { + /** + * + * @type {string} + * @memberof AttachmentStore + */ filename: string; - attachable_type: AttachableType; + /** + * + * @type {AttachableType} + * @memberof AttachmentStore + */ + attachableType: AttachableType; /** * ID of the model this attachment is linked to. + * @type {string} + * @memberof AttachmentStore + */ + attachableId: string; + /** + * + * @type {string} + * @memberof AttachmentStore */ - attachable_id: string; title?: string; + /** + * + * @type {string} + * @memberof AttachmentStore + */ notes?: string | null; -}; +} + +/** + * Check if a given object implements the AttachmentStore interface. + */ +export function instanceOfAttachmentStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "filename" in value; + isInstance = isInstance && "attachableType" in value; + isInstance = isInstance && "attachableId" in value; + + return isInstance; +} + +export function AttachmentStoreFromJSON(json: any): AttachmentStore { + return AttachmentStoreFromJSONTyped(json, false); +} + +export function AttachmentStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'filename': json['filename'], + 'attachableType': AttachableTypeFromJSON(json['attachable_type']), + 'attachableId': json['attachable_id'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + }; +} + +export function AttachmentStoreToJSON(value?: AttachmentStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'filename': value.filename, + 'attachable_type': AttachableTypeToJSON(value.attachableType), + 'attachable_id': value.attachableId, + 'title': value.title, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/AttachmentUpdate.ts b/src/lib/api/models/AttachmentUpdate.ts index e04fcaa..3740bc1 100644 --- a/src/lib/api/models/AttachmentUpdate.ts +++ b/src/lib/api/models/AttachmentUpdate.ts @@ -1,11 +1,81 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AttachmentUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AttachmentUpdate + */ +export interface AttachmentUpdate { + /** + * + * @type {string} + * @memberof AttachmentUpdate + */ filename?: string; + /** + * + * @type {string} + * @memberof AttachmentUpdate + */ title?: string; + /** + * + * @type {string} + * @memberof AttachmentUpdate + */ notes?: string | null; -}; +} + +/** + * Check if a given object implements the AttachmentUpdate interface. + */ +export function instanceOfAttachmentUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function AttachmentUpdateFromJSON(json: any): AttachmentUpdate { + return AttachmentUpdateFromJSONTyped(json, false); +} + +export function AttachmentUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'filename': !exists(json, 'filename') ? undefined : json['filename'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + }; +} + +export function AttachmentUpdateToJSON(value?: AttachmentUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'filename': value.filename, + 'title': value.title, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/AutoBudgetPeriod.ts b/src/lib/api/models/AutoBudgetPeriod.ts index 7997fe3..3e5cc6d 100644 --- a/src/lib/api/models/AutoBudgetPeriod.ts +++ b/src/lib/api/models/AutoBudgetPeriod.ts @@ -1,16 +1,43 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Period for the auto budget + * @export */ -export enum AutoBudgetPeriod { - DAILY = 'daily', - WEEKLY = 'weekly', - MONTHLY = 'monthly', - QUARTERLY = 'quarterly', - HALF_YEAR = 'half-year', - YEARLY = 'yearly', +export const AutoBudgetPeriod = { + Daily: 'daily', + Weekly: 'weekly', + Monthly: 'monthly', + Quarterly: 'quarterly', + HalfYear: 'half-year', + Yearly: 'yearly', + Null: 'null' +} as const; +export type AutoBudgetPeriod = typeof AutoBudgetPeriod[keyof typeof AutoBudgetPeriod]; + + +export function AutoBudgetPeriodFromJSON(json: any): AutoBudgetPeriod { + return AutoBudgetPeriodFromJSONTyped(json, false); } + +export function AutoBudgetPeriodFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoBudgetPeriod { + return json as AutoBudgetPeriod; +} + +export function AutoBudgetPeriodToJSON(value?: AutoBudgetPeriod | null): any { + return value as any; +} + diff --git a/src/lib/api/models/AutoBudgetType.ts b/src/lib/api/models/AutoBudgetType.ts index 87f4664..09e50b3 100644 --- a/src/lib/api/models/AutoBudgetType.ts +++ b/src/lib/api/models/AutoBudgetType.ts @@ -1,13 +1,40 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * The type of auto-budget that Firefly III must create. + * @export */ -export enum AutoBudgetType { - RESET = 'reset', - ROLLOVER = 'rollover', - NONE = 'none', +export const AutoBudgetType = { + Reset: 'reset', + Rollover: 'rollover', + None: 'none', + Null: 'null' +} as const; +export type AutoBudgetType = typeof AutoBudgetType[keyof typeof AutoBudgetType]; + + +export function AutoBudgetTypeFromJSON(json: any): AutoBudgetType { + return AutoBudgetTypeFromJSONTyped(json, false); } + +export function AutoBudgetTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoBudgetType { + return json as AutoBudgetType; +} + +export function AutoBudgetTypeToJSON(value?: AutoBudgetType | null): any { + return value as any; +} + diff --git a/src/lib/api/models/AutocompleteAccount.ts b/src/lib/api/models/AutocompleteAccount.ts index 9520f54..d32ffcc 100644 --- a/src/lib/api/models/AutocompleteAccount.ts +++ b/src/lib/api/models/AutocompleteAccount.ts @@ -1,41 +1,138 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteAccount = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteAccount + */ +export interface AutocompleteAccount { + /** + * + * @type {string} + * @memberof AutocompleteAccount + */ id: string; /** * Name of the account found by an auto-complete search. + * @type {string} + * @memberof AutocompleteAccount */ name: string; /** * Asset accounts and liabilities have a second field with the given date's account balance. + * @type {string} + * @memberof AutocompleteAccount */ - name_with_balance: string; + nameWithBalance: string; /** * Account type of the account found by the auto-complete search. + * @type {string} + * @memberof AutocompleteAccount */ type: string; /** * ID for the currency used by this account. + * @type {string} + * @memberof AutocompleteAccount */ - currency_id: string; + currencyId: string; /** * Currency name for the currency used by this account. + * @type {string} + * @memberof AutocompleteAccount */ - currency_name: string; + currencyName: string; /** * Currency code for the currency used by this account. + * @type {string} + * @memberof AutocompleteAccount */ - currency_code: string; + currencyCode: string; /** * Currency symbol for the currency used by this account. + * @type {string} + * @memberof AutocompleteAccount */ - currency_symbol: string; + currencySymbol: string; /** * Number of decimal places for the currency used by this account. + * @type {number} + * @memberof AutocompleteAccount */ - currency_decimal_places: number; -}; + currencyDecimalPlaces: number; +} + +/** + * Check if a given object implements the AutocompleteAccount interface. + */ +export function instanceOfAutocompleteAccount(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "nameWithBalance" in value; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "currencyId" in value; + isInstance = isInstance && "currencyName" in value; + isInstance = isInstance && "currencyCode" in value; + isInstance = isInstance && "currencySymbol" in value; + isInstance = isInstance && "currencyDecimalPlaces" in value; + + return isInstance; +} + +export function AutocompleteAccountFromJSON(json: any): AutocompleteAccount { + return AutocompleteAccountFromJSONTyped(json, false); +} + +export function AutocompleteAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteAccount { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'nameWithBalance': json['name_with_balance'], + 'type': json['type'], + 'currencyId': json['currency_id'], + 'currencyName': json['currency_name'], + 'currencyCode': json['currency_code'], + 'currencySymbol': json['currency_symbol'], + 'currencyDecimalPlaces': json['currency_decimal_places'], + }; +} + +export function AutocompleteAccountToJSON(value?: AutocompleteAccount | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'name_with_balance': value.nameWithBalance, + 'type': value.type, + 'currency_id': value.currencyId, + 'currency_name': value.currencyName, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + }; +} diff --git a/src/lib/api/models/AutocompleteAccountArray.ts b/src/lib/api/models/AutocompleteAccountArray.ts deleted file mode 100644 index 9572c2f..0000000 --- a/src/lib/api/models/AutocompleteAccountArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteAccount } from './AutocompleteAccount'; - -export type AutocompleteAccountArray = Array; diff --git a/src/lib/api/models/AutocompleteBill.ts b/src/lib/api/models/AutocompleteBill.ts index df6fdb9..3ed26fa 100644 --- a/src/lib/api/models/AutocompleteBill.ts +++ b/src/lib/api/models/AutocompleteBill.ts @@ -1,17 +1,83 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteBill = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteBill + */ +export interface AutocompleteBill { + /** + * + * @type {string} + * @memberof AutocompleteBill + */ id: string; /** * Name of the bill found by an auto-complete search. + * @type {string} + * @memberof AutocompleteBill */ name: string; /** * Is the bill active or not? + * @type {boolean} + * @memberof AutocompleteBill */ active?: boolean; -}; +} + +/** + * Check if a given object implements the AutocompleteBill interface. + */ +export function instanceOfAutocompleteBill(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteBillFromJSON(json: any): AutocompleteBill { + return AutocompleteBillFromJSONTyped(json, false); +} + +export function AutocompleteBillFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteBill { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'active': !exists(json, 'active') ? undefined : json['active'], + }; +} + +export function AutocompleteBillToJSON(value?: AutocompleteBill | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'active': value.active, + }; +} diff --git a/src/lib/api/models/AutocompleteBillArray.ts b/src/lib/api/models/AutocompleteBillArray.ts deleted file mode 100644 index 651ddd9..0000000 --- a/src/lib/api/models/AutocompleteBillArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteBill } from './AutocompleteBill'; - -export type AutocompleteBillArray = Array; diff --git a/src/lib/api/models/AutocompleteBudget.ts b/src/lib/api/models/AutocompleteBudget.ts index c21055e..fedeb15 100644 --- a/src/lib/api/models/AutocompleteBudget.ts +++ b/src/lib/api/models/AutocompleteBudget.ts @@ -1,13 +1,75 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteBudget = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteBudget + */ +export interface AutocompleteBudget { + /** + * + * @type {string} + * @memberof AutocompleteBudget + */ id: string; /** * Name of the budget found by an auto-complete search. + * @type {string} + * @memberof AutocompleteBudget */ name: string; -}; +} + +/** + * Check if a given object implements the AutocompleteBudget interface. + */ +export function instanceOfAutocompleteBudget(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteBudgetFromJSON(json: any): AutocompleteBudget { + return AutocompleteBudgetFromJSONTyped(json, false); +} + +export function AutocompleteBudgetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteBudget { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + }; +} + +export function AutocompleteBudgetToJSON(value?: AutocompleteBudget | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + }; +} diff --git a/src/lib/api/models/AutocompleteBudgetArray.ts b/src/lib/api/models/AutocompleteBudgetArray.ts deleted file mode 100644 index dd4c809..0000000 --- a/src/lib/api/models/AutocompleteBudgetArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteBudget } from './AutocompleteBudget'; - -export type AutocompleteBudgetArray = Array; diff --git a/src/lib/api/models/AutocompleteCategory.ts b/src/lib/api/models/AutocompleteCategory.ts index 7079cd4..d6f9056 100644 --- a/src/lib/api/models/AutocompleteCategory.ts +++ b/src/lib/api/models/AutocompleteCategory.ts @@ -1,13 +1,75 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteCategory = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteCategory + */ +export interface AutocompleteCategory { + /** + * + * @type {string} + * @memberof AutocompleteCategory + */ id: string; /** * Name of the category found by an auto-complete search. + * @type {string} + * @memberof AutocompleteCategory */ name: string; -}; +} + +/** + * Check if a given object implements the AutocompleteCategory interface. + */ +export function instanceOfAutocompleteCategory(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteCategoryFromJSON(json: any): AutocompleteCategory { + return AutocompleteCategoryFromJSONTyped(json, false); +} + +export function AutocompleteCategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteCategory { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + }; +} + +export function AutocompleteCategoryToJSON(value?: AutocompleteCategory | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + }; +} diff --git a/src/lib/api/models/AutocompleteCategoryArray.ts b/src/lib/api/models/AutocompleteCategoryArray.ts deleted file mode 100644 index 180787f..0000000 --- a/src/lib/api/models/AutocompleteCategoryArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteCategory } from './AutocompleteCategory'; - -export type AutocompleteCategoryArray = Array; diff --git a/src/lib/api/models/AutocompleteCurrency.ts b/src/lib/api/models/AutocompleteCurrency.ts index b5a3b13..67733cc 100644 --- a/src/lib/api/models/AutocompleteCurrency.ts +++ b/src/lib/api/models/AutocompleteCurrency.ts @@ -1,19 +1,102 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteCurrency = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteCurrency + */ +export interface AutocompleteCurrency { + /** + * + * @type {string} + * @memberof AutocompleteCurrency + */ id: string; /** * Currency name. + * @type {string} + * @memberof AutocompleteCurrency */ name: string; /** * Currency code. + * @type {string} + * @memberof AutocompleteCurrency */ code: string; + /** + * + * @type {string} + * @memberof AutocompleteCurrency + */ symbol: string; - decimal_places: number; -}; + /** + * + * @type {number} + * @memberof AutocompleteCurrency + */ + decimalPlaces: number; +} + +/** + * Check if a given object implements the AutocompleteCurrency interface. + */ +export function instanceOfAutocompleteCurrency(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "code" in value; + isInstance = isInstance && "symbol" in value; + isInstance = isInstance && "decimalPlaces" in value; + + return isInstance; +} + +export function AutocompleteCurrencyFromJSON(json: any): AutocompleteCurrency { + return AutocompleteCurrencyFromJSONTyped(json, false); +} + +export function AutocompleteCurrencyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteCurrency { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'code': json['code'], + 'symbol': json['symbol'], + 'decimalPlaces': json['decimal_places'], + }; +} + +export function AutocompleteCurrencyToJSON(value?: AutocompleteCurrency | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'code': value.code, + 'symbol': value.symbol, + 'decimal_places': value.decimalPlaces, + }; +} diff --git a/src/lib/api/models/AutocompleteCurrencyArray.ts b/src/lib/api/models/AutocompleteCurrencyArray.ts deleted file mode 100644 index 5d46280..0000000 --- a/src/lib/api/models/AutocompleteCurrencyArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteCurrency } from './AutocompleteCurrency'; - -export type AutocompleteCurrencyArray = Array; diff --git a/src/lib/api/models/AutocompleteCurrencyCode.ts b/src/lib/api/models/AutocompleteCurrencyCode.ts index 55712cb..d552fc6 100644 --- a/src/lib/api/models/AutocompleteCurrencyCode.ts +++ b/src/lib/api/models/AutocompleteCurrencyCode.ts @@ -1,19 +1,102 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteCurrencyCode = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteCurrencyCode + */ +export interface AutocompleteCurrencyCode { + /** + * + * @type {string} + * @memberof AutocompleteCurrencyCode + */ id: string; /** * Currency name with the code between brackets. + * @type {string} + * @memberof AutocompleteCurrencyCode */ name: string; /** * Currency code. + * @type {string} + * @memberof AutocompleteCurrencyCode */ code: string; + /** + * + * @type {string} + * @memberof AutocompleteCurrencyCode + */ symbol: string; - decimal_places: number; -}; + /** + * + * @type {number} + * @memberof AutocompleteCurrencyCode + */ + decimalPlaces: number; +} + +/** + * Check if a given object implements the AutocompleteCurrencyCode interface. + */ +export function instanceOfAutocompleteCurrencyCode(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "code" in value; + isInstance = isInstance && "symbol" in value; + isInstance = isInstance && "decimalPlaces" in value; + + return isInstance; +} + +export function AutocompleteCurrencyCodeFromJSON(json: any): AutocompleteCurrencyCode { + return AutocompleteCurrencyCodeFromJSONTyped(json, false); +} + +export function AutocompleteCurrencyCodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteCurrencyCode { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'code': json['code'], + 'symbol': json['symbol'], + 'decimalPlaces': json['decimal_places'], + }; +} + +export function AutocompleteCurrencyCodeToJSON(value?: AutocompleteCurrencyCode | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'code': value.code, + 'symbol': value.symbol, + 'decimal_places': value.decimalPlaces, + }; +} diff --git a/src/lib/api/models/AutocompleteCurrencyCodeArray.ts b/src/lib/api/models/AutocompleteCurrencyCodeArray.ts deleted file mode 100644 index d3a8683..0000000 --- a/src/lib/api/models/AutocompleteCurrencyCodeArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteCurrencyCode } from './AutocompleteCurrencyCode'; - -export type AutocompleteCurrencyCodeArray = Array; diff --git a/src/lib/api/models/AutocompleteObjectGroup.ts b/src/lib/api/models/AutocompleteObjectGroup.ts index ef0399e..baf6181 100644 --- a/src/lib/api/models/AutocompleteObjectGroup.ts +++ b/src/lib/api/models/AutocompleteObjectGroup.ts @@ -1,17 +1,84 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteObjectGroup = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteObjectGroup + */ +export interface AutocompleteObjectGroup { + /** + * + * @type {string} + * @memberof AutocompleteObjectGroup + */ id: string; /** * Title of the object group found by an auto-complete search. + * @type {string} + * @memberof AutocompleteObjectGroup */ title: string; /** * Title of the object group found by an auto-complete search. + * @type {string} + * @memberof AutocompleteObjectGroup */ name: string; -}; +} + +/** + * Check if a given object implements the AutocompleteObjectGroup interface. + */ +export function instanceOfAutocompleteObjectGroup(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteObjectGroupFromJSON(json: any): AutocompleteObjectGroup { + return AutocompleteObjectGroupFromJSONTyped(json, false); +} + +export function AutocompleteObjectGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteObjectGroup { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'title': json['title'], + 'name': json['name'], + }; +} + +export function AutocompleteObjectGroupToJSON(value?: AutocompleteObjectGroup | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'title': value.title, + 'name': value.name, + }; +} diff --git a/src/lib/api/models/AutocompleteObjectGroupArray.ts b/src/lib/api/models/AutocompleteObjectGroupArray.ts deleted file mode 100644 index 688a844..0000000 --- a/src/lib/api/models/AutocompleteObjectGroupArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteObjectGroup } from './AutocompleteObjectGroup'; - -export type AutocompleteObjectGroupArray = Array; diff --git a/src/lib/api/models/AutocompletePiggy.ts b/src/lib/api/models/AutocompletePiggy.ts index 1ac4f07..8022885 100644 --- a/src/lib/api/models/AutocompletePiggy.ts +++ b/src/lib/api/models/AutocompletePiggy.ts @@ -1,35 +1,131 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompletePiggy = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompletePiggy + */ +export interface AutocompletePiggy { + /** + * + * @type {string} + * @memberof AutocompletePiggy + */ id: string; /** * Name of the piggy bank found by an auto-complete search. + * @type {string} + * @memberof AutocompletePiggy */ name: string; /** * Currency ID for this piggy bank. + * @type {string} + * @memberof AutocompletePiggy */ - currency_id?: string; + currencyId?: string; /** * Currency code for this piggy bank. + * @type {string} + * @memberof AutocompletePiggy + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof AutocompletePiggy */ - currency_code?: string; - currency_symbol?: string; + currencySymbol?: string; /** * Currency name for the currency used by this account. + * @type {string} + * @memberof AutocompletePiggy + */ + currencyName?: string; + /** + * + * @type {number} + * @memberof AutocompletePiggy */ - currency_name?: string; - currency_decimal_places?: number; + currencyDecimalPlaces?: number; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof AutocompletePiggy */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof AutocompletePiggy */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the AutocompletePiggy interface. + */ +export function instanceOfAutocompletePiggy(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompletePiggyFromJSON(json: any): AutocompletePiggy { + return AutocompletePiggyFromJSONTyped(json, false); +} + +export function AutocompletePiggyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompletePiggy { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyName': !exists(json, 'currency_name') ? undefined : json['currency_name'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function AutocompletePiggyToJSON(value?: AutocompletePiggy | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_name': value.currencyName, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/AutocompletePiggyArray.ts b/src/lib/api/models/AutocompletePiggyArray.ts deleted file mode 100644 index 1acfc5d..0000000 --- a/src/lib/api/models/AutocompletePiggyArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompletePiggy } from './AutocompletePiggy'; - -export type AutocompletePiggyArray = Array; diff --git a/src/lib/api/models/AutocompletePiggyBalance.ts b/src/lib/api/models/AutocompletePiggyBalance.ts index f91fc01..f905c54 100644 --- a/src/lib/api/models/AutocompletePiggyBalance.ts +++ b/src/lib/api/models/AutocompletePiggyBalance.ts @@ -1,35 +1,131 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompletePiggyBalance = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompletePiggyBalance + */ +export interface AutocompletePiggyBalance { + /** + * + * @type {string} + * @memberof AutocompletePiggyBalance + */ id: string; /** * Name of the piggy bank found by an auto-complete search. + * @type {string} + * @memberof AutocompletePiggyBalance */ name: string; /** * Name of the piggy bank found by an auto-complete search with the current balance formatted nicely. + * @type {string} + * @memberof AutocompletePiggyBalance */ - name_with_balance?: string; + nameWithBalance?: string; /** * Currency ID for this piggy bank. + * @type {string} + * @memberof AutocompletePiggyBalance */ - currency_id?: string; + currencyId?: string; /** * Currency code for this piggy bank. + * @type {string} + * @memberof AutocompletePiggyBalance + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof AutocompletePiggyBalance + */ + currencySymbol?: string; + /** + * + * @type {number} + * @memberof AutocompletePiggyBalance */ - currency_code?: string; - currency_symbol?: string; - currency_decimal_places?: number; + currencyDecimalPlaces?: number; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof AutocompletePiggyBalance */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof AutocompletePiggyBalance */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the AutocompletePiggyBalance interface. + */ +export function instanceOfAutocompletePiggyBalance(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompletePiggyBalanceFromJSON(json: any): AutocompletePiggyBalance { + return AutocompletePiggyBalanceFromJSONTyped(json, false); +} + +export function AutocompletePiggyBalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompletePiggyBalance { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'nameWithBalance': !exists(json, 'name_with_balance') ? undefined : json['name_with_balance'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function AutocompletePiggyBalanceToJSON(value?: AutocompletePiggyBalance | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'name_with_balance': value.nameWithBalance, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/AutocompletePiggyBalanceArray.ts b/src/lib/api/models/AutocompletePiggyBalanceArray.ts deleted file mode 100644 index 7c37be0..0000000 --- a/src/lib/api/models/AutocompletePiggyBalanceArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompletePiggyBalance } from './AutocompletePiggyBalance'; - -export type AutocompletePiggyBalanceArray = Array; diff --git a/src/lib/api/models/AutocompleteRecurrence.ts b/src/lib/api/models/AutocompleteRecurrence.ts index f3b3db1..8ccac51 100644 --- a/src/lib/api/models/AutocompleteRecurrence.ts +++ b/src/lib/api/models/AutocompleteRecurrence.ts @@ -1,17 +1,83 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteRecurrence = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteRecurrence + */ +export interface AutocompleteRecurrence { + /** + * + * @type {string} + * @memberof AutocompleteRecurrence + */ id: string; /** * Name of the recurrence found by an auto-complete search. + * @type {string} + * @memberof AutocompleteRecurrence */ name: string; /** * Description of the recurrence found by auto-complete. + * @type {string} + * @memberof AutocompleteRecurrence */ description?: string; -}; +} + +/** + * Check if a given object implements the AutocompleteRecurrence interface. + */ +export function instanceOfAutocompleteRecurrence(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteRecurrenceFromJSON(json: any): AutocompleteRecurrence { + return AutocompleteRecurrenceFromJSONTyped(json, false); +} + +export function AutocompleteRecurrenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteRecurrence { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': !exists(json, 'description') ? undefined : json['description'], + }; +} + +export function AutocompleteRecurrenceToJSON(value?: AutocompleteRecurrence | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'description': value.description, + }; +} diff --git a/src/lib/api/models/AutocompleteRecurrenceArray.ts b/src/lib/api/models/AutocompleteRecurrenceArray.ts deleted file mode 100644 index 9367171..0000000 --- a/src/lib/api/models/AutocompleteRecurrenceArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteRecurrence } from './AutocompleteRecurrence'; - -export type AutocompleteRecurrenceArray = Array; diff --git a/src/lib/api/models/AutocompleteRule.ts b/src/lib/api/models/AutocompleteRule.ts index 586f766..2790bf3 100644 --- a/src/lib/api/models/AutocompleteRule.ts +++ b/src/lib/api/models/AutocompleteRule.ts @@ -1,17 +1,83 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteRule = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteRule + */ +export interface AutocompleteRule { + /** + * + * @type {string} + * @memberof AutocompleteRule + */ id: string; /** * Name of the rule found by an auto-complete search. + * @type {string} + * @memberof AutocompleteRule */ name: string; /** * Description of the rule found by auto-complete. + * @type {string} + * @memberof AutocompleteRule */ description?: string; -}; +} + +/** + * Check if a given object implements the AutocompleteRule interface. + */ +export function instanceOfAutocompleteRule(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteRuleFromJSON(json: any): AutocompleteRule { + return AutocompleteRuleFromJSONTyped(json, false); +} + +export function AutocompleteRuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteRule { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': !exists(json, 'description') ? undefined : json['description'], + }; +} + +export function AutocompleteRuleToJSON(value?: AutocompleteRule | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'description': value.description, + }; +} diff --git a/src/lib/api/models/AutocompleteRuleArray.ts b/src/lib/api/models/AutocompleteRuleArray.ts deleted file mode 100644 index 3f74022..0000000 --- a/src/lib/api/models/AutocompleteRuleArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteRule } from './AutocompleteRule'; - -export type AutocompleteRuleArray = Array; diff --git a/src/lib/api/models/AutocompleteRuleGroup.ts b/src/lib/api/models/AutocompleteRuleGroup.ts index 30d772e..699f1d3 100644 --- a/src/lib/api/models/AutocompleteRuleGroup.ts +++ b/src/lib/api/models/AutocompleteRuleGroup.ts @@ -1,17 +1,83 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteRuleGroup = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteRuleGroup + */ +export interface AutocompleteRuleGroup { + /** + * + * @type {string} + * @memberof AutocompleteRuleGroup + */ id: string; /** * Name of the rule group found by an auto-complete search. + * @type {string} + * @memberof AutocompleteRuleGroup */ name: string; /** * Description of the rule group found by auto-complete. + * @type {string} + * @memberof AutocompleteRuleGroup */ description?: string; -}; +} + +/** + * Check if a given object implements the AutocompleteRuleGroup interface. + */ +export function instanceOfAutocompleteRuleGroup(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function AutocompleteRuleGroupFromJSON(json: any): AutocompleteRuleGroup { + return AutocompleteRuleGroupFromJSONTyped(json, false); +} + +export function AutocompleteRuleGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteRuleGroup { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': !exists(json, 'description') ? undefined : json['description'], + }; +} + +export function AutocompleteRuleGroupToJSON(value?: AutocompleteRuleGroup | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'description': value.description, + }; +} diff --git a/src/lib/api/models/AutocompleteRuleGroupArray.ts b/src/lib/api/models/AutocompleteRuleGroupArray.ts deleted file mode 100644 index 412df44..0000000 --- a/src/lib/api/models/AutocompleteRuleGroupArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteRuleGroup } from './AutocompleteRuleGroup'; - -export type AutocompleteRuleGroupArray = Array; diff --git a/src/lib/api/models/AutocompleteTag.ts b/src/lib/api/models/AutocompleteTag.ts index 4d78ba9..9a686a7 100644 --- a/src/lib/api/models/AutocompleteTag.ts +++ b/src/lib/api/models/AutocompleteTag.ts @@ -1,17 +1,84 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteTag = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteTag + */ +export interface AutocompleteTag { + /** + * + * @type {string} + * @memberof AutocompleteTag + */ id: string; /** * Name of the tag found by an auto-complete search. + * @type {string} + * @memberof AutocompleteTag */ name: string; /** * Name of the tag found by an auto-complete search. + * @type {string} + * @memberof AutocompleteTag */ tag: string; -}; +} + +/** + * Check if a given object implements the AutocompleteTag interface. + */ +export function instanceOfAutocompleteTag(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "tag" in value; + + return isInstance; +} + +export function AutocompleteTagFromJSON(json: any): AutocompleteTag { + return AutocompleteTagFromJSONTyped(json, false); +} + +export function AutocompleteTagFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteTag { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'tag': json['tag'], + }; +} + +export function AutocompleteTagToJSON(value?: AutocompleteTag | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'tag': value.tag, + }; +} diff --git a/src/lib/api/models/AutocompleteTagArray.ts b/src/lib/api/models/AutocompleteTagArray.ts deleted file mode 100644 index 0c9ec09..0000000 --- a/src/lib/api/models/AutocompleteTagArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteTag } from './AutocompleteTag'; - -export type AutocompleteTagArray = Array; diff --git a/src/lib/api/models/AutocompleteTransaction.ts b/src/lib/api/models/AutocompleteTransaction.ts index 19ca9c9..20a8f2f 100644 --- a/src/lib/api/models/AutocompleteTransaction.ts +++ b/src/lib/api/models/AutocompleteTransaction.ts @@ -1,24 +1,92 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteTransaction = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteTransaction + */ +export interface AutocompleteTransaction { /** * The ID of a transaction journal (basically a single split). + * @type {string} + * @memberof AutocompleteTransaction */ id: string; /** * The ID of the underlying transaction group. + * @type {string} + * @memberof AutocompleteTransaction */ - transaction_group_id?: string; + transactionGroupId?: string; /** * Transaction description + * @type {string} + * @memberof AutocompleteTransaction */ name: string; /** * Transaction description + * @type {string} + * @memberof AutocompleteTransaction */ description: string; -}; +} + +/** + * Check if a given object implements the AutocompleteTransaction interface. + */ +export function instanceOfAutocompleteTransaction(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "description" in value; + + return isInstance; +} + +export function AutocompleteTransactionFromJSON(json: any): AutocompleteTransaction { + return AutocompleteTransactionFromJSONTyped(json, false); +} + +export function AutocompleteTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteTransaction { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'transactionGroupId': !exists(json, 'transaction_group_id') ? undefined : json['transaction_group_id'], + 'name': json['name'], + 'description': json['description'], + }; +} + +export function AutocompleteTransactionToJSON(value?: AutocompleteTransaction | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'transaction_group_id': value.transactionGroupId, + 'name': value.name, + 'description': value.description, + }; +} diff --git a/src/lib/api/models/AutocompleteTransactionArray.ts b/src/lib/api/models/AutocompleteTransactionArray.ts deleted file mode 100644 index 18e2a83..0000000 --- a/src/lib/api/models/AutocompleteTransactionArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteTransaction } from './AutocompleteTransaction'; - -export type AutocompleteTransactionArray = Array; diff --git a/src/lib/api/models/AutocompleteTransactionID.ts b/src/lib/api/models/AutocompleteTransactionID.ts index d5903e1..c915bd0 100644 --- a/src/lib/api/models/AutocompleteTransactionID.ts +++ b/src/lib/api/models/AutocompleteTransactionID.ts @@ -1,24 +1,92 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteTransactionID = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteTransactionID + */ +export interface AutocompleteTransactionID { /** * The ID of a transaction journal (basically a single split). + * @type {string} + * @memberof AutocompleteTransactionID */ id: string; /** * The ID of the underlying transaction group. + * @type {string} + * @memberof AutocompleteTransactionID */ - transaction_group_id?: string; + transactionGroupId?: string; /** * Transaction description with ID in the name. + * @type {string} + * @memberof AutocompleteTransactionID */ name: string; /** * Transaction description with ID in the name. + * @type {string} + * @memberof AutocompleteTransactionID */ description: string; -}; +} + +/** + * Check if a given object implements the AutocompleteTransactionID interface. + */ +export function instanceOfAutocompleteTransactionID(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "description" in value; + + return isInstance; +} + +export function AutocompleteTransactionIDFromJSON(json: any): AutocompleteTransactionID { + return AutocompleteTransactionIDFromJSONTyped(json, false); +} + +export function AutocompleteTransactionIDFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteTransactionID { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'transactionGroupId': !exists(json, 'transaction_group_id') ? undefined : json['transaction_group_id'], + 'name': json['name'], + 'description': json['description'], + }; +} + +export function AutocompleteTransactionIDToJSON(value?: AutocompleteTransactionID | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'transaction_group_id': value.transactionGroupId, + 'name': value.name, + 'description': value.description, + }; +} diff --git a/src/lib/api/models/AutocompleteTransactionIDArray.ts b/src/lib/api/models/AutocompleteTransactionIDArray.ts deleted file mode 100644 index 0350633..0000000 --- a/src/lib/api/models/AutocompleteTransactionIDArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteTransactionID } from './AutocompleteTransactionID'; - -export type AutocompleteTransactionIDArray = Array; diff --git a/src/lib/api/models/AutocompleteTransactionType.ts b/src/lib/api/models/AutocompleteTransactionType.ts index 5bc25e8..7ccb45f 100644 --- a/src/lib/api/models/AutocompleteTransactionType.ts +++ b/src/lib/api/models/AutocompleteTransactionType.ts @@ -1,17 +1,84 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type AutocompleteTransactionType = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface AutocompleteTransactionType + */ +export interface AutocompleteTransactionType { + /** + * + * @type {string} + * @memberof AutocompleteTransactionType + */ id: string; /** * Type of the object found by an auto-complete search. + * @type {string} + * @memberof AutocompleteTransactionType */ name: string; /** * Name of the object found by an auto-complete search. + * @type {string} + * @memberof AutocompleteTransactionType */ type: string; -}; +} + +/** + * Check if a given object implements the AutocompleteTransactionType interface. + */ +export function instanceOfAutocompleteTransactionType(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function AutocompleteTransactionTypeFromJSON(json: any): AutocompleteTransactionType { + return AutocompleteTransactionTypeFromJSONTyped(json, false); +} + +export function AutocompleteTransactionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutocompleteTransactionType { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'type': json['type'], + }; +} + +export function AutocompleteTransactionTypeToJSON(value?: AutocompleteTransactionType | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'type': value.type, + }; +} diff --git a/src/lib/api/models/AutocompleteTransactionTypeArray.ts b/src/lib/api/models/AutocompleteTransactionTypeArray.ts deleted file mode 100644 index ba9d048..0000000 --- a/src/lib/api/models/AutocompleteTransactionTypeArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { AutocompleteTransactionType } from './AutocompleteTransactionType'; - -export type AutocompleteTransactionTypeArray = Array; diff --git a/src/lib/api/models/AvailableBudget.ts b/src/lib/api/models/AvailableBudget.ts index de7341f..81bfd08 100644 --- a/src/lib/api/models/AvailableBudget.ts +++ b/src/lib/api/models/AvailableBudget.ts @@ -1,33 +1,149 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BudgetSpent } from './BudgetSpent'; +import { + BudgetSpentFromJSON, + BudgetSpentFromJSONTyped, + BudgetSpentToJSON, +} from './BudgetSpent'; -export type AvailableBudget = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface AvailableBudget + */ +export interface AvailableBudget { + /** + * + * @type {Date} + * @memberof AvailableBudget + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof AvailableBudget + */ + readonly updatedAt?: Date; /** * Use either currency_id or currency_code. + * @type {string} + * @memberof AvailableBudget */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code. + * @type {string} + * @memberof AvailableBudget + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof AvailableBudget + */ + readonly currencySymbol?: string; + /** + * + * @type {number} + * @memberof AvailableBudget + */ + readonly currencyDecimalPlaces?: number; + /** + * + * @type {string} + * @memberof AvailableBudget */ - currency_code?: string; - readonly currency_symbol?: string; - readonly currency_decimal_places?: number; amount: string; /** * Start date of the available budget. + * @type {Date} + * @memberof AvailableBudget */ - start: string; + start: Date; /** * End date of the available budget. + * @type {Date} + * @memberof AvailableBudget */ - end: string; - readonly spent_in_budgets?: Array; - readonly spent_outside_budget?: Array; -}; + end: Date; + /** + * + * @type {Array} + * @memberof AvailableBudget + */ + readonly spentInBudgets?: Array; + /** + * + * @type {Array} + * @memberof AvailableBudget + */ + readonly spentOutsideBudget?: Array; +} + +/** + * Check if a given object implements the AvailableBudget interface. + */ +export function instanceOfAvailableBudget(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "amount" in value; + isInstance = isInstance && "start" in value; + isInstance = isInstance && "end" in value; + + return isInstance; +} + +export function AvailableBudgetFromJSON(json: any): AvailableBudget { + return AvailableBudgetFromJSONTyped(json, false); +} + +export function AvailableBudgetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AvailableBudget { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'amount': json['amount'], + 'start': (new Date(json['start'])), + 'end': (new Date(json['end'])), + 'spentInBudgets': !exists(json, 'spent_in_budgets') ? undefined : ((json['spent_in_budgets'] as Array).map(BudgetSpentFromJSON)), + 'spentOutsideBudget': !exists(json, 'spent_outside_budget') ? undefined : ((json['spent_outside_budget'] as Array).map(BudgetSpentFromJSON)), + }; +} + +export function AvailableBudgetToJSON(value?: AvailableBudget | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'amount': value.amount, + 'start': (value.start.toISOString()), + 'end': (value.end.toISOString()), + }; +} diff --git a/src/lib/api/models/AvailableBudgetArray.ts b/src/lib/api/models/AvailableBudgetArray.ts index 196ade7..8a63929 100644 --- a/src/lib/api/models/AvailableBudgetArray.ts +++ b/src/lib/api/models/AvailableBudgetArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AvailableBudgetRead } from './AvailableBudgetRead'; +import { + AvailableBudgetReadFromJSON, + AvailableBudgetReadFromJSONTyped, + AvailableBudgetReadToJSON, +} from './AvailableBudgetRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type AvailableBudgetArray = { +/** + * + * @export + * @interface AvailableBudgetArray + */ +export interface AvailableBudgetArray { + /** + * + * @type {Array} + * @memberof AvailableBudgetArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof AvailableBudgetArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the AvailableBudgetArray interface. + */ +export function instanceOfAvailableBudgetArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function AvailableBudgetArrayFromJSON(json: any): AvailableBudgetArray { + return AvailableBudgetArrayFromJSONTyped(json, false); +} + +export function AvailableBudgetArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): AvailableBudgetArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(AvailableBudgetReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function AvailableBudgetArrayToJSON(value?: AvailableBudgetArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(AvailableBudgetReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/AvailableBudgetRead.ts b/src/lib/api/models/AvailableBudgetRead.ts index 86dd67e..a5d6127 100644 --- a/src/lib/api/models/AvailableBudgetRead.ts +++ b/src/lib/api/models/AvailableBudgetRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AvailableBudget } from './AvailableBudget'; +import { + AvailableBudgetFromJSON, + AvailableBudgetFromJSONTyped, + AvailableBudgetToJSON, +} from './AvailableBudget'; -export type AvailableBudgetRead = { +/** + * + * @export + * @interface AvailableBudgetRead + */ +export interface AvailableBudgetRead { /** * Immutable value + * @type {string} + * @memberof AvailableBudgetRead */ type: string; + /** + * + * @type {string} + * @memberof AvailableBudgetRead + */ id: string; + /** + * + * @type {AvailableBudget} + * @memberof AvailableBudgetRead + */ attributes: AvailableBudget; -}; +} + +/** + * Check if a given object implements the AvailableBudgetRead interface. + */ +export function instanceOfAvailableBudgetRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function AvailableBudgetReadFromJSON(json: any): AvailableBudgetRead { + return AvailableBudgetReadFromJSONTyped(json, false); +} + +export function AvailableBudgetReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AvailableBudgetRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': AvailableBudgetFromJSON(json['attributes']), + }; +} + +export function AvailableBudgetReadToJSON(value?: AvailableBudgetRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': AvailableBudgetToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/AvailableBudgetSingle.ts b/src/lib/api/models/AvailableBudgetSingle.ts index c597cf8..7a0b655 100644 --- a/src/lib/api/models/AvailableBudgetSingle.ts +++ b/src/lib/api/models/AvailableBudgetSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AvailableBudgetRead } from './AvailableBudgetRead'; +import { + AvailableBudgetReadFromJSON, + AvailableBudgetReadFromJSONTyped, + AvailableBudgetReadToJSON, +} from './AvailableBudgetRead'; -export type AvailableBudgetSingle = { +/** + * + * @export + * @interface AvailableBudgetSingle + */ +export interface AvailableBudgetSingle { + /** + * + * @type {AvailableBudgetRead} + * @memberof AvailableBudgetSingle + */ data: AvailableBudgetRead; -}; +} + +/** + * Check if a given object implements the AvailableBudgetSingle interface. + */ +export function instanceOfAvailableBudgetSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function AvailableBudgetSingleFromJSON(json: any): AvailableBudgetSingle { + return AvailableBudgetSingleFromJSONTyped(json, false); +} + +export function AvailableBudgetSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AvailableBudgetSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': AvailableBudgetReadFromJSON(json['data']), + }; +} + +export function AvailableBudgetSingleToJSON(value?: AvailableBudgetSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': AvailableBudgetReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/BadRequest.ts b/src/lib/api/models/BadRequest.ts index 3019ac1..d7c31b9 100644 --- a/src/lib/api/models/BadRequest.ts +++ b/src/lib/api/models/BadRequest.ts @@ -1,10 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type BadRequest = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BadRequest + */ +export interface BadRequest { + /** + * + * @type {string} + * @memberof BadRequest + */ message?: string; + /** + * + * @type {string} + * @memberof BadRequest + */ exception?: string; -}; +} + +/** + * Check if a given object implements the BadRequest interface. + */ +export function instanceOfBadRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function BadRequestFromJSON(json: any): BadRequest { + return BadRequestFromJSONTyped(json, false); +} + +export function BadRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BadRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'message': !exists(json, 'message') ? undefined : json['message'], + 'exception': !exists(json, 'exception') ? undefined : json['exception'], + }; +} + +export function BadRequestToJSON(value?: BadRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'message': value.message, + 'exception': value.exception, + }; +} diff --git a/src/lib/api/models/BasicSummary.ts b/src/lib/api/models/BasicSummary.ts deleted file mode 100644 index f84f052..0000000 --- a/src/lib/api/models/BasicSummary.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type BasicSummary = Record; diff --git a/src/lib/api/models/BasicSummaryEntry.ts b/src/lib/api/models/BasicSummaryEntry.ts index ad6e536..9d0fac8 100644 --- a/src/lib/api/models/BasicSummaryEntry.ts +++ b/src/lib/api/models/BasicSummaryEntry.ts @@ -1,42 +1,137 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type BasicSummaryEntry = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BasicSummaryEntry + */ +export interface BasicSummaryEntry { /** * This is a reference to the type of info shared, not influenced by translations or user preferences. The EUR value is a reference to the currency code. Possibilities are: balance-in-ABC, spent-in-ABC, earned-in-ABC, bills-paid-in-ABC, bills-unpaid-in-ABC, left-to-spend-in-ABC and net-worth-in-ABC. + * @type {string} + * @memberof BasicSummaryEntry */ key?: string; /** * A translated title for the information shared. + * @type {string} + * @memberof BasicSummaryEntry */ title?: string; /** * The amount as a float. + * @type {number} + * @memberof BasicSummaryEntry */ - monetary_value?: number; + monetaryValue?: number; /** * The currency ID of the associated currency. + * @type {string} + * @memberof BasicSummaryEntry */ - currency_id?: string; - currency_code?: string; - currency_symbol?: string; + currencyId?: string; + /** + * + * @type {string} + * @memberof BasicSummaryEntry + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof BasicSummaryEntry + */ + currencySymbol?: string; /** * Number of decimals for the associated currency. + * @type {number} + * @memberof BasicSummaryEntry */ - currency_decimal_places?: number; + currencyDecimalPlaces?: number; /** * The amount formatted according to the users locale + * @type {string} + * @memberof BasicSummaryEntry */ - value_parsed?: string; + valueParsed?: string; /** * Reference to a font-awesome icon without the fa- part. + * @type {string} + * @memberof BasicSummaryEntry */ - local_icon?: string; + localIcon?: string; /** * A short explanation of the amounts origin. Already formatted according to the locale of the user or translated, if relevant. + * @type {string} + * @memberof BasicSummaryEntry */ - sub_title?: string; -}; + subTitle?: string; +} + +/** + * Check if a given object implements the BasicSummaryEntry interface. + */ +export function instanceOfBasicSummaryEntry(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function BasicSummaryEntryFromJSON(json: any): BasicSummaryEntry { + return BasicSummaryEntryFromJSONTyped(json, false); +} + +export function BasicSummaryEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): BasicSummaryEntry { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'key': !exists(json, 'key') ? undefined : json['key'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'monetaryValue': !exists(json, 'monetary_value') ? undefined : json['monetary_value'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'valueParsed': !exists(json, 'value_parsed') ? undefined : json['value_parsed'], + 'localIcon': !exists(json, 'local_icon') ? undefined : json['local_icon'], + 'subTitle': !exists(json, 'sub_title') ? undefined : json['sub_title'], + }; +} + +export function BasicSummaryEntryToJSON(value?: BasicSummaryEntry | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'key': value.key, + 'title': value.title, + 'monetary_value': value.monetaryValue, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'value_parsed': value.valueParsed, + 'local_icon': value.localIcon, + 'sub_title': value.subTitle, + }; +} diff --git a/src/lib/api/models/Bill.ts b/src/lib/api/models/Bill.ts index cca5903..647498d 100644 --- a/src/lib/api/models/Bill.ts +++ b/src/lib/api/models/Bill.ts @@ -1,89 +1,258 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; +import type { BillPaidDatesInner } from './BillPaidDatesInner'; +import { + BillPaidDatesInnerFromJSON, + BillPaidDatesInnerFromJSONTyped, + BillPaidDatesInnerToJSON, +} from './BillPaidDatesInner'; import type { BillRepeatFrequency } from './BillRepeatFrequency'; +import { + BillRepeatFrequencyFromJSON, + BillRepeatFrequencyFromJSONTyped, + BillRepeatFrequencyToJSON, +} from './BillRepeatFrequency'; -export type Bill = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Bill + */ +export interface Bill { + /** + * + * @type {Date} + * @memberof Bill + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Bill + */ + readonly updatedAt?: Date; /** * Use either currency_id or currency_code + * @type {string} + * @memberof Bill */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code + * @type {string} + * @memberof Bill + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof Bill + */ + readonly currencySymbol?: string; + /** + * + * @type {number} + * @memberof Bill + */ + readonly currencyDecimalPlaces?: number; + /** + * + * @type {string} + * @memberof Bill */ - currency_code?: string; - readonly currency_symbol?: string; - readonly currency_decimal_places?: number; name: string; - amount_min: string; - amount_max: string; - date: string; + /** + * + * @type {string} + * @memberof Bill + */ + amountMin: string; + /** + * + * @type {string} + * @memberof Bill + */ + amountMax: string; + /** + * + * @type {Date} + * @memberof Bill + */ + date: Date; /** * The date after which this bill is no longer valid or applicable + * @type {Date} + * @memberof Bill */ - end_date?: string; + endDate?: Date; /** * The date before which the bill must be renewed (or cancelled) + * @type {Date} + * @memberof Bill */ - extension_date?: string; - repeat_freq: BillRepeatFrequency; + extensionDate?: Date; + /** + * + * @type {BillRepeatFrequency} + * @memberof Bill + */ + repeatFreq: BillRepeatFrequency; /** * How often the bill must be skipped. 1 means a bi-monthly bill. + * @type {number} + * @memberof Bill */ skip?: number; /** * If the bill is active. + * @type {boolean} + * @memberof Bill */ active?: boolean; /** * Order of the bill. + * @type {number} + * @memberof Bill */ order?: number; + /** + * + * @type {string} + * @memberof Bill + */ notes?: string | null; /** * When the bill is expected to be due. + * @type {Date} + * @memberof Bill */ - readonly next_expected_match?: string | null; + readonly nextExpectedMatch?: Date | null; /** * Formatted (locally) when the bill is due. + * @type {string} + * @memberof Bill */ - readonly next_expected_match_diff?: string | null; + readonly nextExpectedMatchDiff?: string | null; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof Bill */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The order of the group. At least 1, for the highest sorting. + * @type {number} + * @memberof Bill */ - readonly object_group_order?: number | null; + readonly objectGroupOrder?: number | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof Bill */ - object_group_title?: string | null; + objectGroupTitle?: string | null; /** * Array of future dates when the bill is expected to be paid. Autogenerated. + * @type {Array} + * @memberof Bill */ - readonly pay_dates?: Array; + readonly payDates?: Array; /** * Array of past transactions when the bill was paid. + * @type {Array} + * @memberof Bill */ - readonly paid_dates?: Array<{ - /** - * Transaction group ID of the paid bill. - */ - readonly transaction_group_id?: string; - /** - * Transaction journal ID of the paid bill. - */ - readonly transaction_journal_id?: string; - /** - * Date the bill was paid. - */ - readonly date?: string; - }>; -}; + readonly paidDates?: Array; +} + +/** + * Check if a given object implements the Bill interface. + */ +export function instanceOfBill(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "amountMin" in value; + isInstance = isInstance && "amountMax" in value; + isInstance = isInstance && "date" in value; + isInstance = isInstance && "repeatFreq" in value; + + return isInstance; +} + +export function BillFromJSON(json: any): Bill { + return BillFromJSONTyped(json, false); +} + +export function BillFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bill { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'name': json['name'], + 'amountMin': json['amount_min'], + 'amountMax': json['amount_max'], + 'date': (new Date(json['date'])), + 'endDate': !exists(json, 'end_date') ? undefined : (new Date(json['end_date'])), + 'extensionDate': !exists(json, 'extension_date') ? undefined : (new Date(json['extension_date'])), + 'repeatFreq': BillRepeatFrequencyFromJSON(json['repeat_freq']), + 'skip': !exists(json, 'skip') ? undefined : json['skip'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'nextExpectedMatch': !exists(json, 'next_expected_match') ? undefined : (json['next_expected_match'] === null ? null : new Date(json['next_expected_match'])), + 'nextExpectedMatchDiff': !exists(json, 'next_expected_match_diff') ? undefined : json['next_expected_match_diff'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupOrder': !exists(json, 'object_group_order') ? undefined : json['object_group_order'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + 'payDates': !exists(json, 'pay_dates') ? undefined : json['pay_dates'], + 'paidDates': !exists(json, 'paid_dates') ? undefined : ((json['paid_dates'] as Array).map(BillPaidDatesInnerFromJSON)), + }; +} + +export function BillToJSON(value?: Bill | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'name': value.name, + 'amount_min': value.amountMin, + 'amount_max': value.amountMax, + 'date': (value.date.toISOString()), + 'end_date': value.endDate === undefined ? undefined : (value.endDate.toISOString()), + 'extension_date': value.extensionDate === undefined ? undefined : (value.extensionDate.toISOString()), + 'repeat_freq': BillRepeatFrequencyToJSON(value.repeatFreq), + 'skip': value.skip, + 'active': value.active, + 'order': value.order, + 'notes': value.notes, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/BillArray.ts b/src/lib/api/models/BillArray.ts index 49119b9..aa38ab6 100644 --- a/src/lib/api/models/BillArray.ts +++ b/src/lib/api/models/BillArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BillRead } from './BillRead'; +import { + BillReadFromJSON, + BillReadFromJSONTyped, + BillReadToJSON, +} from './BillRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type BillArray = { +/** + * + * @export + * @interface BillArray + */ +export interface BillArray { + /** + * + * @type {Array} + * @memberof BillArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof BillArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the BillArray interface. + */ +export function instanceOfBillArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function BillArrayFromJSON(json: any): BillArray { + return BillArrayFromJSONTyped(json, false); +} + +export function BillArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(BillReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function BillArrayToJSON(value?: BillArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(BillReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/BillPaidDatesInner.ts b/src/lib/api/models/BillPaidDatesInner.ts new file mode 100644 index 0000000..2a4f969 --- /dev/null +++ b/src/lib/api/models/BillPaidDatesInner.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BillPaidDatesInner + */ +export interface BillPaidDatesInner { + /** + * Transaction group ID of the paid bill. + * @type {string} + * @memberof BillPaidDatesInner + */ + readonly transactionGroupId?: string; + /** + * Transaction journal ID of the paid bill. + * @type {string} + * @memberof BillPaidDatesInner + */ + readonly transactionJournalId?: string; + /** + * Date the bill was paid. + * @type {Date} + * @memberof BillPaidDatesInner + */ + readonly date?: Date; +} + +/** + * Check if a given object implements the BillPaidDatesInner interface. + */ +export function instanceOfBillPaidDatesInner(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function BillPaidDatesInnerFromJSON(json: any): BillPaidDatesInner { + return BillPaidDatesInnerFromJSONTyped(json, false); +} + +export function BillPaidDatesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillPaidDatesInner { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'transactionGroupId': !exists(json, 'transaction_group_id') ? undefined : json['transaction_group_id'], + 'transactionJournalId': !exists(json, 'transaction_journal_id') ? undefined : json['transaction_journal_id'], + 'date': !exists(json, 'date') ? undefined : (new Date(json['date'])), + }; +} + +export function BillPaidDatesInnerToJSON(value?: BillPaidDatesInner | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/src/lib/api/models/BillRead.ts b/src/lib/api/models/BillRead.ts index 1964229..af4ee4c 100644 --- a/src/lib/api/models/BillRead.ts +++ b/src/lib/api/models/BillRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Bill } from './Bill'; +import { + BillFromJSON, + BillFromJSONTyped, + BillToJSON, +} from './Bill'; -export type BillRead = { +/** + * + * @export + * @interface BillRead + */ +export interface BillRead { /** * Immutable value + * @type {string} + * @memberof BillRead */ type: string; + /** + * + * @type {string} + * @memberof BillRead + */ id: string; + /** + * + * @type {Bill} + * @memberof BillRead + */ attributes: Bill; -}; +} + +/** + * Check if a given object implements the BillRead interface. + */ +export function instanceOfBillRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function BillReadFromJSON(json: any): BillRead { + return BillReadFromJSONTyped(json, false); +} + +export function BillReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': BillFromJSON(json['attributes']), + }; +} + +export function BillReadToJSON(value?: BillRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': BillToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/BillRepeatFrequency.ts b/src/lib/api/models/BillRepeatFrequency.ts index d6415bd..b060729 100644 --- a/src/lib/api/models/BillRepeatFrequency.ts +++ b/src/lib/api/models/BillRepeatFrequency.ts @@ -1,15 +1,41 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * How often the bill must be paid. + * @export */ -export enum BillRepeatFrequency { - WEEKLY = 'weekly', - MONTHLY = 'monthly', - QUARTERLY = 'quarterly', - HALF_YEAR = 'half-year', - YEARLY = 'yearly', +export const BillRepeatFrequency = { + Weekly: 'weekly', + Monthly: 'monthly', + Quarterly: 'quarterly', + HalfYear: 'half-year', + Yearly: 'yearly' +} as const; +export type BillRepeatFrequency = typeof BillRepeatFrequency[keyof typeof BillRepeatFrequency]; + + +export function BillRepeatFrequencyFromJSON(json: any): BillRepeatFrequency { + return BillRepeatFrequencyFromJSONTyped(json, false); } + +export function BillRepeatFrequencyFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillRepeatFrequency { + return json as BillRepeatFrequency; +} + +export function BillRepeatFrequencyToJSON(value?: BillRepeatFrequency | null): any { + return value as any; +} + diff --git a/src/lib/api/models/BillSingle.ts b/src/lib/api/models/BillSingle.ts index e962dd5..a153572 100644 --- a/src/lib/api/models/BillSingle.ts +++ b/src/lib/api/models/BillSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BillRead } from './BillRead'; +import { + BillReadFromJSON, + BillReadFromJSONTyped, + BillReadToJSON, +} from './BillRead'; -export type BillSingle = { +/** + * + * @export + * @interface BillSingle + */ +export interface BillSingle { + /** + * + * @type {BillRead} + * @memberof BillSingle + */ data: BillRead; -}; +} + +/** + * Check if a given object implements the BillSingle interface. + */ +export function instanceOfBillSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function BillSingleFromJSON(json: any): BillSingle { + return BillSingleFromJSONTyped(json, false); +} + +export function BillSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': BillReadFromJSON(json['data']), + }; +} + +export function BillSingleToJSON(value?: BillSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': BillReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/BillStore.ts b/src/lib/api/models/BillStore.ts index 950cfdc..436bbe5 100644 --- a/src/lib/api/models/BillStore.ts +++ b/src/lib/api/models/BillStore.ts @@ -1,48 +1,181 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BillRepeatFrequency } from './BillRepeatFrequency'; +import { + BillRepeatFrequencyFromJSON, + BillRepeatFrequencyFromJSONTyped, + BillRepeatFrequencyToJSON, +} from './BillRepeatFrequency'; -export type BillStore = { +/** + * + * @export + * @interface BillStore + */ +export interface BillStore { /** * Use either currency_id or currency_code + * @type {string} + * @memberof BillStore */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code + * @type {string} + * @memberof BillStore + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof BillStore */ - currency_code?: string; name: string; - amount_min: string; - amount_max: string; - date: string; + /** + * + * @type {string} + * @memberof BillStore + */ + amountMin: string; + /** + * + * @type {string} + * @memberof BillStore + */ + amountMax: string; + /** + * + * @type {Date} + * @memberof BillStore + */ + date: Date; /** * The date after which this bill is no longer valid or applicable + * @type {Date} + * @memberof BillStore */ - end_date?: string; + endDate?: Date; /** * The date before which the bill must be renewed (or cancelled) + * @type {Date} + * @memberof BillStore */ - extension_date?: string; - repeat_freq: BillRepeatFrequency; + extensionDate?: Date; + /** + * + * @type {BillRepeatFrequency} + * @memberof BillStore + */ + repeatFreq: BillRepeatFrequency; /** * How often the bill must be skipped. 1 means a bi-monthly bill. + * @type {number} + * @memberof BillStore */ skip?: number; /** * If the bill is active. + * @type {boolean} + * @memberof BillStore */ active?: boolean; + /** + * + * @type {string} + * @memberof BillStore + */ notes?: string | null; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof BillStore */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof BillStore */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the BillStore interface. + */ +export function instanceOfBillStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "amountMin" in value; + isInstance = isInstance && "amountMax" in value; + isInstance = isInstance && "date" in value; + isInstance = isInstance && "repeatFreq" in value; + + return isInstance; +} + +export function BillStoreFromJSON(json: any): BillStore { + return BillStoreFromJSONTyped(json, false); +} + +export function BillStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'name': json['name'], + 'amountMin': json['amount_min'], + 'amountMax': json['amount_max'], + 'date': (new Date(json['date'])), + 'endDate': !exists(json, 'end_date') ? undefined : (new Date(json['end_date'])), + 'extensionDate': !exists(json, 'extension_date') ? undefined : (new Date(json['extension_date'])), + 'repeatFreq': BillRepeatFrequencyFromJSON(json['repeat_freq']), + 'skip': !exists(json, 'skip') ? undefined : json['skip'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function BillStoreToJSON(value?: BillStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'name': value.name, + 'amount_min': value.amountMin, + 'amount_max': value.amountMax, + 'date': (value.date.toISOString()), + 'end_date': value.endDate === undefined ? undefined : (value.endDate.toISOString()), + 'extension_date': value.extensionDate === undefined ? undefined : (value.extensionDate.toISOString()), + 'repeat_freq': BillRepeatFrequencyToJSON(value.repeatFreq), + 'skip': value.skip, + 'active': value.active, + 'notes': value.notes, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/BillUpdate.ts b/src/lib/api/models/BillUpdate.ts index 1153a80..07dac66 100644 --- a/src/lib/api/models/BillUpdate.ts +++ b/src/lib/api/models/BillUpdate.ts @@ -1,48 +1,177 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BillRepeatFrequency } from './BillRepeatFrequency'; +import { + BillRepeatFrequencyFromJSON, + BillRepeatFrequencyFromJSONTyped, + BillRepeatFrequencyToJSON, +} from './BillRepeatFrequency'; -export type BillUpdate = { +/** + * + * @export + * @interface BillUpdate + */ +export interface BillUpdate { /** * Use either currency_id or currency_code + * @type {string} + * @memberof BillUpdate */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code + * @type {string} + * @memberof BillUpdate + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof BillUpdate */ - currency_code?: string; name: string; - amount_min?: string; - amount_max?: string; - date?: string; + /** + * + * @type {string} + * @memberof BillUpdate + */ + amountMin?: string; + /** + * + * @type {string} + * @memberof BillUpdate + */ + amountMax?: string; + /** + * + * @type {Date} + * @memberof BillUpdate + */ + date?: Date; /** * The date after which this bill is no longer valid or applicable + * @type {Date} + * @memberof BillUpdate */ - end_date?: string; + endDate?: Date; /** * The date before which the bill must be renewed (or cancelled) + * @type {Date} + * @memberof BillUpdate */ - extension_date?: string; - repeat_freq?: BillRepeatFrequency; + extensionDate?: Date; + /** + * + * @type {BillRepeatFrequency} + * @memberof BillUpdate + */ + repeatFreq?: BillRepeatFrequency; /** * How often the bill must be skipped. 1 means a bi-monthly bill. + * @type {number} + * @memberof BillUpdate */ skip?: number; /** * If the bill is active. + * @type {boolean} + * @memberof BillUpdate */ active?: boolean; + /** + * + * @type {string} + * @memberof BillUpdate + */ notes?: string | null; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof BillUpdate */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof BillUpdate */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the BillUpdate interface. + */ +export function instanceOfBillUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function BillUpdateFromJSON(json: any): BillUpdate { + return BillUpdateFromJSONTyped(json, false); +} + +export function BillUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'name': json['name'], + 'amountMin': !exists(json, 'amount_min') ? undefined : json['amount_min'], + 'amountMax': !exists(json, 'amount_max') ? undefined : json['amount_max'], + 'date': !exists(json, 'date') ? undefined : (new Date(json['date'])), + 'endDate': !exists(json, 'end_date') ? undefined : (new Date(json['end_date'])), + 'extensionDate': !exists(json, 'extension_date') ? undefined : (new Date(json['extension_date'])), + 'repeatFreq': !exists(json, 'repeat_freq') ? undefined : BillRepeatFrequencyFromJSON(json['repeat_freq']), + 'skip': !exists(json, 'skip') ? undefined : json['skip'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function BillUpdateToJSON(value?: BillUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'name': value.name, + 'amount_min': value.amountMin, + 'amount_max': value.amountMax, + 'date': value.date === undefined ? undefined : (value.date.toISOString()), + 'end_date': value.endDate === undefined ? undefined : (value.endDate.toISOString()), + 'extension_date': value.extensionDate === undefined ? undefined : (value.extensionDate.toISOString()), + 'repeat_freq': BillRepeatFrequencyToJSON(value.repeatFreq), + 'skip': value.skip, + 'active': value.active, + 'notes': value.notes, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/Budget.ts b/src/lib/api/models/Budget.ts index d6223f9..f266fd9 100644 --- a/src/lib/api/models/Budget.ts +++ b/src/lib/api/models/Budget.ts @@ -1,33 +1,169 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AutoBudgetPeriod } from './AutoBudgetPeriod'; +import { + AutoBudgetPeriodFromJSON, + AutoBudgetPeriodFromJSONTyped, + AutoBudgetPeriodToJSON, +} from './AutoBudgetPeriod'; import type { AutoBudgetType } from './AutoBudgetType'; +import { + AutoBudgetTypeFromJSON, + AutoBudgetTypeFromJSONTyped, + AutoBudgetTypeToJSON, +} from './AutoBudgetType'; import type { BudgetSpent } from './BudgetSpent'; +import { + BudgetSpentFromJSON, + BudgetSpentFromJSONTyped, + BudgetSpentToJSON, +} from './BudgetSpent'; -export type Budget = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Budget + */ +export interface Budget { + /** + * + * @type {Date} + * @memberof Budget + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Budget + */ + readonly updatedAt?: Date; + /** + * + * @type {string} + * @memberof Budget + */ name: string; + /** + * + * @type {boolean} + * @memberof Budget + */ active?: boolean; + /** + * + * @type {string} + * @memberof Budget + */ notes?: string | null; + /** + * + * @type {number} + * @memberof Budget + */ readonly order?: number; - auto_budget_type?: AutoBudgetType; + /** + * + * @type {AutoBudgetType} + * @memberof Budget + */ + autoBudgetType?: AutoBudgetType | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof Budget */ - auto_budget_currency_id?: string | null; + autoBudgetCurrencyId?: string | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof Budget + */ + autoBudgetCurrencyCode?: string | null; + /** + * + * @type {string} + * @memberof Budget + */ + autoBudgetAmount?: string | null; + /** + * + * @type {AutoBudgetPeriod} + * @memberof Budget */ - auto_budget_currency_code?: string | null; - auto_budget_amount?: string | null; - auto_budget_period?: AutoBudgetPeriod; + autoBudgetPeriod?: AutoBudgetPeriod | null; /** * Information on how much was spent in this budget. Is only filled in when the start and end date are submitted. + * @type {Array} + * @memberof Budget */ readonly spent?: Array; -}; +} + +/** + * Check if a given object implements the Budget interface. + */ +export function instanceOfBudget(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function BudgetFromJSON(json: any): Budget { + return BudgetFromJSONTyped(json, false); +} + +export function BudgetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Budget { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'name': json['name'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'autoBudgetType': !exists(json, 'auto_budget_type') ? undefined : AutoBudgetTypeFromJSON(json['auto_budget_type']), + 'autoBudgetCurrencyId': !exists(json, 'auto_budget_currency_id') ? undefined : json['auto_budget_currency_id'], + 'autoBudgetCurrencyCode': !exists(json, 'auto_budget_currency_code') ? undefined : json['auto_budget_currency_code'], + 'autoBudgetAmount': !exists(json, 'auto_budget_amount') ? undefined : json['auto_budget_amount'], + 'autoBudgetPeriod': !exists(json, 'auto_budget_period') ? undefined : AutoBudgetPeriodFromJSON(json['auto_budget_period']), + 'spent': !exists(json, 'spent') ? undefined : ((json['spent'] as Array).map(BudgetSpentFromJSON)), + }; +} + +export function BudgetToJSON(value?: Budget | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'active': value.active, + 'notes': value.notes, + 'auto_budget_type': AutoBudgetTypeToJSON(value.autoBudgetType), + 'auto_budget_currency_id': value.autoBudgetCurrencyId, + 'auto_budget_currency_code': value.autoBudgetCurrencyCode, + 'auto_budget_amount': value.autoBudgetAmount, + 'auto_budget_period': AutoBudgetPeriodToJSON(value.autoBudgetPeriod), + }; +} diff --git a/src/lib/api/models/BudgetArray.ts b/src/lib/api/models/BudgetArray.ts index 44e882c..f30cdae 100644 --- a/src/lib/api/models/BudgetArray.ts +++ b/src/lib/api/models/BudgetArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BudgetRead } from './BudgetRead'; +import { + BudgetReadFromJSON, + BudgetReadFromJSONTyped, + BudgetReadToJSON, +} from './BudgetRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type BudgetArray = { +/** + * + * @export + * @interface BudgetArray + */ +export interface BudgetArray { + /** + * + * @type {Array} + * @memberof BudgetArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof BudgetArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the BudgetArray interface. + */ +export function instanceOfBudgetArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function BudgetArrayFromJSON(json: any): BudgetArray { + return BudgetArrayFromJSONTyped(json, false); +} + +export function BudgetArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(BudgetReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function BudgetArrayToJSON(value?: BudgetArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(BudgetReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/BudgetLimit.ts b/src/lib/api/models/BudgetLimit.ts index bf7723e..37817ae 100644 --- a/src/lib/api/models/BudgetLimit.ts +++ b/src/lib/api/models/BudgetLimit.ts @@ -1,39 +1,157 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type BudgetLimit = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BudgetLimit + */ +export interface BudgetLimit { + /** + * + * @type {Date} + * @memberof BudgetLimit + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof BudgetLimit + */ + readonly updatedAt?: Date; /** * Start date of the budget limit. + * @type {Date} + * @memberof BudgetLimit */ - start: string; + start: Date; /** * End date of the budget limit. + * @type {Date} + * @memberof BudgetLimit */ - end: string; + end: Date; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetLimit */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetLimit + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof BudgetLimit + */ + readonly currencyName?: string; + /** + * + * @type {string} + * @memberof BudgetLimit + */ + readonly currencySymbol?: string; + /** + * + * @type {number} + * @memberof BudgetLimit */ - currency_code?: string; - readonly currency_name?: string; - readonly currency_symbol?: string; - readonly currency_decimal_places?: number; + readonly currencyDecimalPlaces?: number; /** * The budget ID of the associated budget. + * @type {string} + * @memberof BudgetLimit */ - readonly budget_id: string; + readonly budgetId: string; /** * Period of the budget limit. Only used when auto-generated by auto-budget. + * @type {string} + * @memberof BudgetLimit */ readonly period?: string | null; + /** + * + * @type {string} + * @memberof BudgetLimit + */ amount: string; + /** + * + * @type {string} + * @memberof BudgetLimit + */ readonly spent?: string | null; -}; +} + +/** + * Check if a given object implements the BudgetLimit interface. + */ +export function instanceOfBudgetLimit(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "start" in value; + isInstance = isInstance && "end" in value; + isInstance = isInstance && "budgetId" in value; + isInstance = isInstance && "amount" in value; + + return isInstance; +} + +export function BudgetLimitFromJSON(json: any): BudgetLimit { + return BudgetLimitFromJSONTyped(json, false); +} + +export function BudgetLimitFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetLimit { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'start': (new Date(json['start'])), + 'end': (new Date(json['end'])), + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencyName': !exists(json, 'currency_name') ? undefined : json['currency_name'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'budgetId': json['budget_id'], + 'period': !exists(json, 'period') ? undefined : json['period'], + 'amount': json['amount'], + 'spent': !exists(json, 'spent') ? undefined : json['spent'], + }; +} + +export function BudgetLimitToJSON(value?: BudgetLimit | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'start': (value.start.toISOString()), + 'end': (value.end.toISOString()), + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'amount': value.amount, + }; +} diff --git a/src/lib/api/models/BudgetLimitArray.ts b/src/lib/api/models/BudgetLimitArray.ts index d6ab960..be21465 100644 --- a/src/lib/api/models/BudgetLimitArray.ts +++ b/src/lib/api/models/BudgetLimitArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BudgetLimitRead } from './BudgetLimitRead'; +import { + BudgetLimitReadFromJSON, + BudgetLimitReadFromJSONTyped, + BudgetLimitReadToJSON, +} from './BudgetLimitRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type BudgetLimitArray = { +/** + * + * @export + * @interface BudgetLimitArray + */ +export interface BudgetLimitArray { + /** + * + * @type {Array} + * @memberof BudgetLimitArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof BudgetLimitArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the BudgetLimitArray interface. + */ +export function instanceOfBudgetLimitArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function BudgetLimitArrayFromJSON(json: any): BudgetLimitArray { + return BudgetLimitArrayFromJSONTyped(json, false); +} + +export function BudgetLimitArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetLimitArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(BudgetLimitReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function BudgetLimitArrayToJSON(value?: BudgetLimitArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(BudgetLimitReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/BudgetLimitRead.ts b/src/lib/api/models/BudgetLimitRead.ts index c3ad4b1..181af6e 100644 --- a/src/lib/api/models/BudgetLimitRead.ts +++ b/src/lib/api/models/BudgetLimitRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BudgetLimit } from './BudgetLimit'; +import { + BudgetLimitFromJSON, + BudgetLimitFromJSONTyped, + BudgetLimitToJSON, +} from './BudgetLimit'; -export type BudgetLimitRead = { +/** + * + * @export + * @interface BudgetLimitRead + */ +export interface BudgetLimitRead { /** * Immutable value + * @type {string} + * @memberof BudgetLimitRead */ type: string; + /** + * + * @type {string} + * @memberof BudgetLimitRead + */ id: string; + /** + * + * @type {BudgetLimit} + * @memberof BudgetLimitRead + */ attributes: BudgetLimit; -}; +} + +/** + * Check if a given object implements the BudgetLimitRead interface. + */ +export function instanceOfBudgetLimitRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function BudgetLimitReadFromJSON(json: any): BudgetLimitRead { + return BudgetLimitReadFromJSONTyped(json, false); +} + +export function BudgetLimitReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetLimitRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': BudgetLimitFromJSON(json['attributes']), + }; +} + +export function BudgetLimitReadToJSON(value?: BudgetLimitRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': BudgetLimitToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/BudgetLimitSingle.ts b/src/lib/api/models/BudgetLimitSingle.ts index 0a19a7b..521b7e1 100644 --- a/src/lib/api/models/BudgetLimitSingle.ts +++ b/src/lib/api/models/BudgetLimitSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BudgetLimitRead } from './BudgetLimitRead'; +import { + BudgetLimitReadFromJSON, + BudgetLimitReadFromJSONTyped, + BudgetLimitReadToJSON, +} from './BudgetLimitRead'; -export type BudgetLimitSingle = { +/** + * + * @export + * @interface BudgetLimitSingle + */ +export interface BudgetLimitSingle { + /** + * + * @type {BudgetLimitRead} + * @memberof BudgetLimitSingle + */ data: BudgetLimitRead; -}; +} + +/** + * Check if a given object implements the BudgetLimitSingle interface. + */ +export function instanceOfBudgetLimitSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function BudgetLimitSingleFromJSON(json: any): BudgetLimitSingle { + return BudgetLimitSingleFromJSONTyped(json, false); +} + +export function BudgetLimitSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetLimitSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': BudgetLimitReadFromJSON(json['data']), + }; +} + +export function BudgetLimitSingleToJSON(value?: BudgetLimitSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': BudgetLimitReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/BudgetLimitStore.ts b/src/lib/api/models/BudgetLimitStore.ts index 58b43ce..0971636 100644 --- a/src/lib/api/models/BudgetLimitStore.ts +++ b/src/lib/api/models/BudgetLimitStore.ts @@ -1,33 +1,115 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type BudgetLimitStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BudgetLimitStore + */ +export interface BudgetLimitStore { /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetLimitStore */ - currency_id?: string; + currencyId?: string; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetLimitStore */ - currency_code?: string; + currencyCode?: string; /** * The budget ID of the associated budget. + * @type {string} + * @memberof BudgetLimitStore */ - readonly budget_id: string; + readonly budgetId: string; /** * Start date of the budget limit. + * @type {Date} + * @memberof BudgetLimitStore */ - start: string; + start: Date; /** * Period of the budget limit. Only used when auto-generated by auto-budget. + * @type {string} + * @memberof BudgetLimitStore */ readonly period?: string | null; /** * End date of the budget limit. + * @type {Date} + * @memberof BudgetLimitStore + */ + end: Date; + /** + * + * @type {string} + * @memberof BudgetLimitStore */ - end: string; amount: string; -}; +} + +/** + * Check if a given object implements the BudgetLimitStore interface. + */ +export function instanceOfBudgetLimitStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "budgetId" in value; + isInstance = isInstance && "start" in value; + isInstance = isInstance && "end" in value; + isInstance = isInstance && "amount" in value; + + return isInstance; +} + +export function BudgetLimitStoreFromJSON(json: any): BudgetLimitStore { + return BudgetLimitStoreFromJSONTyped(json, false); +} + +export function BudgetLimitStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetLimitStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'budgetId': json['budget_id'], + 'start': (new Date(json['start'])), + 'period': !exists(json, 'period') ? undefined : json['period'], + 'end': (new Date(json['end'])), + 'amount': json['amount'], + }; +} + +export function BudgetLimitStoreToJSON(value?: BudgetLimitStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'start': (value.start.toISOString().substring(0,10)), + 'end': (value.end.toISOString().substring(0,10)), + 'amount': value.amount, + }; +} diff --git a/src/lib/api/models/BudgetRead.ts b/src/lib/api/models/BudgetRead.ts index a981363..cb70323 100644 --- a/src/lib/api/models/BudgetRead.ts +++ b/src/lib/api/models/BudgetRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Budget } from './Budget'; +import { + BudgetFromJSON, + BudgetFromJSONTyped, + BudgetToJSON, +} from './Budget'; -export type BudgetRead = { +/** + * + * @export + * @interface BudgetRead + */ +export interface BudgetRead { /** * Immutable value + * @type {string} + * @memberof BudgetRead */ type: string; + /** + * + * @type {string} + * @memberof BudgetRead + */ id: string; + /** + * + * @type {Budget} + * @memberof BudgetRead + */ attributes: Budget; -}; +} + +/** + * Check if a given object implements the BudgetRead interface. + */ +export function instanceOfBudgetRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function BudgetReadFromJSON(json: any): BudgetRead { + return BudgetReadFromJSONTyped(json, false); +} + +export function BudgetReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': BudgetFromJSON(json['attributes']), + }; +} + +export function BudgetReadToJSON(value?: BudgetRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': BudgetToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/BudgetSingle.ts b/src/lib/api/models/BudgetSingle.ts index fc14517..edd8d6f 100644 --- a/src/lib/api/models/BudgetSingle.ts +++ b/src/lib/api/models/BudgetSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { BudgetRead } from './BudgetRead'; +import { + BudgetReadFromJSON, + BudgetReadFromJSONTyped, + BudgetReadToJSON, +} from './BudgetRead'; -export type BudgetSingle = { +/** + * + * @export + * @interface BudgetSingle + */ +export interface BudgetSingle { + /** + * + * @type {BudgetRead} + * @memberof BudgetSingle + */ data: BudgetRead; -}; +} + +/** + * Check if a given object implements the BudgetSingle interface. + */ +export function instanceOfBudgetSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function BudgetSingleFromJSON(json: any): BudgetSingle { + return BudgetSingleFromJSONTyped(json, false); +} + +export function BudgetSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': BudgetReadFromJSON(json['data']), + }; +} + +export function BudgetSingleToJSON(value?: BudgetSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': BudgetReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/BudgetSpent.ts b/src/lib/api/models/BudgetSpent.ts index 3a8a422..239ecec 100644 --- a/src/lib/api/models/BudgetSpent.ts +++ b/src/lib/api/models/BudgetSpent.ts @@ -1,19 +1,97 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type BudgetSpent = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BudgetSpent + */ +export interface BudgetSpent { /** * The amount spent. + * @type {string} + * @memberof BudgetSpent */ sum?: string; - currency_id?: string; - currency_code?: string; - currency_symbol?: string; + /** + * + * @type {string} + * @memberof BudgetSpent + */ + currencyId?: string; + /** + * + * @type {string} + * @memberof BudgetSpent + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof BudgetSpent + */ + currencySymbol?: string; /** * Number of decimals supported by the currency + * @type {number} + * @memberof BudgetSpent */ - currency_decimal_places?: number; -}; + currencyDecimalPlaces?: number; +} + +/** + * Check if a given object implements the BudgetSpent interface. + */ +export function instanceOfBudgetSpent(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function BudgetSpentFromJSON(json: any): BudgetSpent { + return BudgetSpentFromJSONTyped(json, false); +} + +export function BudgetSpentFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetSpent { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'sum': !exists(json, 'sum') ? undefined : json['sum'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + }; +} + +export function BudgetSpentToJSON(value?: BudgetSpent | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'sum': value.sum, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + }; +} diff --git a/src/lib/api/models/BudgetStore.ts b/src/lib/api/models/BudgetStore.ts index abeb4e6..288cf23 100644 --- a/src/lib/api/models/BudgetStore.ts +++ b/src/lib/api/models/BudgetStore.ts @@ -1,26 +1,142 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AutoBudgetPeriod } from './AutoBudgetPeriod'; +import { + AutoBudgetPeriodFromJSON, + AutoBudgetPeriodFromJSONTyped, + AutoBudgetPeriodToJSON, +} from './AutoBudgetPeriod'; import type { AutoBudgetType } from './AutoBudgetType'; +import { + AutoBudgetTypeFromJSON, + AutoBudgetTypeFromJSONTyped, + AutoBudgetTypeToJSON, +} from './AutoBudgetType'; -export type BudgetStore = { +/** + * + * @export + * @interface BudgetStore + */ +export interface BudgetStore { + /** + * + * @type {string} + * @memberof BudgetStore + */ name: string; + /** + * + * @type {boolean} + * @memberof BudgetStore + */ active?: boolean; + /** + * + * @type {number} + * @memberof BudgetStore + */ readonly order?: number; + /** + * + * @type {string} + * @memberof BudgetStore + */ notes?: string | null; - auto_budget_type?: AutoBudgetType; + /** + * + * @type {AutoBudgetType} + * @memberof BudgetStore + */ + autoBudgetType?: AutoBudgetType | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetStore */ - auto_budget_currency_id?: string | null; + autoBudgetCurrencyId?: string | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetStore */ - auto_budget_currency_code?: string | null; - auto_budget_amount?: string | null; - auto_budget_period?: AutoBudgetPeriod; -}; + autoBudgetCurrencyCode?: string | null; + /** + * + * @type {string} + * @memberof BudgetStore + */ + autoBudgetAmount?: string | null; + /** + * + * @type {AutoBudgetPeriod} + * @memberof BudgetStore + */ + autoBudgetPeriod?: AutoBudgetPeriod | null; +} + +/** + * Check if a given object implements the BudgetStore interface. + */ +export function instanceOfBudgetStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function BudgetStoreFromJSON(json: any): BudgetStore { + return BudgetStoreFromJSONTyped(json, false); +} + +export function BudgetStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'autoBudgetType': !exists(json, 'auto_budget_type') ? undefined : AutoBudgetTypeFromJSON(json['auto_budget_type']), + 'autoBudgetCurrencyId': !exists(json, 'auto_budget_currency_id') ? undefined : json['auto_budget_currency_id'], + 'autoBudgetCurrencyCode': !exists(json, 'auto_budget_currency_code') ? undefined : json['auto_budget_currency_code'], + 'autoBudgetAmount': !exists(json, 'auto_budget_amount') ? undefined : json['auto_budget_amount'], + 'autoBudgetPeriod': !exists(json, 'auto_budget_period') ? undefined : AutoBudgetPeriodFromJSON(json['auto_budget_period']), + }; +} + +export function BudgetStoreToJSON(value?: BudgetStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'active': value.active, + 'notes': value.notes, + 'auto_budget_type': AutoBudgetTypeToJSON(value.autoBudgetType), + 'auto_budget_currency_id': value.autoBudgetCurrencyId, + 'auto_budget_currency_code': value.autoBudgetCurrencyCode, + 'auto_budget_amount': value.autoBudgetAmount, + 'auto_budget_period': AutoBudgetPeriodToJSON(value.autoBudgetPeriod), + }; +} diff --git a/src/lib/api/models/BudgetUpdate.ts b/src/lib/api/models/BudgetUpdate.ts index 2f6fd1a..4d928e7 100644 --- a/src/lib/api/models/BudgetUpdate.ts +++ b/src/lib/api/models/BudgetUpdate.ts @@ -1,26 +1,143 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AutoBudgetPeriod } from './AutoBudgetPeriod'; +import { + AutoBudgetPeriodFromJSON, + AutoBudgetPeriodFromJSONTyped, + AutoBudgetPeriodToJSON, +} from './AutoBudgetPeriod'; import type { AutoBudgetType } from './AutoBudgetType'; +import { + AutoBudgetTypeFromJSON, + AutoBudgetTypeFromJSONTyped, + AutoBudgetTypeToJSON, +} from './AutoBudgetType'; -export type BudgetUpdate = { +/** + * + * @export + * @interface BudgetUpdate + */ +export interface BudgetUpdate { + /** + * + * @type {string} + * @memberof BudgetUpdate + */ name: string; + /** + * + * @type {boolean} + * @memberof BudgetUpdate + */ active?: boolean; + /** + * + * @type {number} + * @memberof BudgetUpdate + */ order?: number; + /** + * + * @type {string} + * @memberof BudgetUpdate + */ notes?: string | null; - auto_budget_type?: AutoBudgetType; + /** + * + * @type {AutoBudgetType} + * @memberof BudgetUpdate + */ + autoBudgetType?: AutoBudgetType | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetUpdate */ - auto_budget_currency_id?: string | null; + autoBudgetCurrencyId?: string | null; /** * Use either currency_id or currency_code. Defaults to the user's default currency. + * @type {string} + * @memberof BudgetUpdate */ - auto_budget_currency_code?: string | null; - auto_budget_amount?: string | null; - auto_budget_period?: AutoBudgetPeriod; -}; + autoBudgetCurrencyCode?: string | null; + /** + * + * @type {string} + * @memberof BudgetUpdate + */ + autoBudgetAmount?: string | null; + /** + * + * @type {AutoBudgetPeriod} + * @memberof BudgetUpdate + */ + autoBudgetPeriod?: AutoBudgetPeriod | null; +} + +/** + * Check if a given object implements the BudgetUpdate interface. + */ +export function instanceOfBudgetUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function BudgetUpdateFromJSON(json: any): BudgetUpdate { + return BudgetUpdateFromJSONTyped(json, false); +} + +export function BudgetUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'autoBudgetType': !exists(json, 'auto_budget_type') ? undefined : AutoBudgetTypeFromJSON(json['auto_budget_type']), + 'autoBudgetCurrencyId': !exists(json, 'auto_budget_currency_id') ? undefined : json['auto_budget_currency_id'], + 'autoBudgetCurrencyCode': !exists(json, 'auto_budget_currency_code') ? undefined : json['auto_budget_currency_code'], + 'autoBudgetAmount': !exists(json, 'auto_budget_amount') ? undefined : json['auto_budget_amount'], + 'autoBudgetPeriod': !exists(json, 'auto_budget_period') ? undefined : AutoBudgetPeriodFromJSON(json['auto_budget_period']), + }; +} + +export function BudgetUpdateToJSON(value?: BudgetUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'active': value.active, + 'order': value.order, + 'notes': value.notes, + 'auto_budget_type': AutoBudgetTypeToJSON(value.autoBudgetType), + 'auto_budget_currency_id': value.autoBudgetCurrencyId, + 'auto_budget_currency_code': value.autoBudgetCurrencyCode, + 'auto_budget_amount': value.autoBudgetAmount, + 'auto_budget_period': AutoBudgetPeriodToJSON(value.autoBudgetPeriod), + }; +} diff --git a/src/lib/api/models/Category.ts b/src/lib/api/models/Category.ts index 4783e50..d0b39e9 100644 --- a/src/lib/api/models/Category.ts +++ b/src/lib/api/models/Category.ts @@ -1,17 +1,115 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { CategoryEarned } from './CategoryEarned'; +import { + CategoryEarnedFromJSON, + CategoryEarnedFromJSONTyped, + CategoryEarnedToJSON, +} from './CategoryEarned'; import type { CategorySpent } from './CategorySpent'; +import { + CategorySpentFromJSON, + CategorySpentFromJSONTyped, + CategorySpentToJSON, +} from './CategorySpent'; -export type Category = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {Date} + * @memberof Category + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Category + */ + readonly updatedAt?: Date; + /** + * + * @type {string} + * @memberof Category + */ name: string; + /** + * + * @type {string} + * @memberof Category + */ notes?: string | null; + /** + * + * @type {Array} + * @memberof Category + */ readonly spent?: Array; + /** + * + * @type {Array} + * @memberof Category + */ readonly earned?: Array; -}; +} + +/** + * Check if a given object implements the Category interface. + */ +export function instanceOfCategory(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'name': json['name'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'spent': !exists(json, 'spent') ? undefined : ((json['spent'] as Array).map(CategorySpentFromJSON)), + 'earned': !exists(json, 'earned') ? undefined : ((json['earned'] as Array).map(CategoryEarnedFromJSON)), + }; +} + +export function CategoryToJSON(value?: Category | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/CategoryArray.ts b/src/lib/api/models/CategoryArray.ts index 4940610..917b312 100644 --- a/src/lib/api/models/CategoryArray.ts +++ b/src/lib/api/models/CategoryArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { CategoryRead } from './CategoryRead'; +import { + CategoryReadFromJSON, + CategoryReadFromJSONTyped, + CategoryReadToJSON, +} from './CategoryRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; -export type CategoryArray = { +/** + * + * @export + * @interface CategoryArray + */ +export interface CategoryArray { + /** + * + * @type {Array} + * @memberof CategoryArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof CategoryArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the CategoryArray interface. + */ +export function instanceOfCategoryArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function CategoryArrayFromJSON(json: any): CategoryArray { + return CategoryArrayFromJSONTyped(json, false); +} + +export function CategoryArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategoryArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(CategoryReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function CategoryArrayToJSON(value?: CategoryArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(CategoryReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/CategoryEarned.ts b/src/lib/api/models/CategoryEarned.ts index 0ea5072..299e9c8 100644 --- a/src/lib/api/models/CategoryEarned.ts +++ b/src/lib/api/models/CategoryEarned.ts @@ -1,19 +1,97 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type CategoryEarned = { - currency_id?: string; - currency_code?: string; - currency_symbol?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface CategoryEarned + */ +export interface CategoryEarned { + /** + * + * @type {string} + * @memberof CategoryEarned + */ + currencyId?: string; + /** + * + * @type {string} + * @memberof CategoryEarned + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof CategoryEarned + */ + currencySymbol?: string; /** * Number of decimals supported by the currency + * @type {number} + * @memberof CategoryEarned */ - currency_decimal_places?: number; + currencyDecimalPlaces?: number; /** * The amount earned. + * @type {string} + * @memberof CategoryEarned */ sum?: string; -}; +} + +/** + * Check if a given object implements the CategoryEarned interface. + */ +export function instanceOfCategoryEarned(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function CategoryEarnedFromJSON(json: any): CategoryEarned { + return CategoryEarnedFromJSONTyped(json, false); +} + +export function CategoryEarnedFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategoryEarned { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'sum': !exists(json, 'sum') ? undefined : json['sum'], + }; +} + +export function CategoryEarnedToJSON(value?: CategoryEarned | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'sum': value.sum, + }; +} diff --git a/src/lib/api/models/CategoryRead.ts b/src/lib/api/models/CategoryRead.ts index 5415c31..1679edf 100644 --- a/src/lib/api/models/CategoryRead.ts +++ b/src/lib/api/models/CategoryRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Category } from './Category'; +import { + CategoryFromJSON, + CategoryFromJSONTyped, + CategoryToJSON, +} from './Category'; -export type CategoryRead = { +/** + * + * @export + * @interface CategoryRead + */ +export interface CategoryRead { /** * Immutable value + * @type {string} + * @memberof CategoryRead */ type: string; + /** + * + * @type {string} + * @memberof CategoryRead + */ id: string; + /** + * + * @type {Category} + * @memberof CategoryRead + */ attributes: Category; -}; +} + +/** + * Check if a given object implements the CategoryRead interface. + */ +export function instanceOfCategoryRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function CategoryReadFromJSON(json: any): CategoryRead { + return CategoryReadFromJSONTyped(json, false); +} + +export function CategoryReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategoryRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': CategoryFromJSON(json['attributes']), + }; +} + +export function CategoryReadToJSON(value?: CategoryRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': CategoryToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/CategorySingle.ts b/src/lib/api/models/CategorySingle.ts index c22ccc2..8847eb9 100644 --- a/src/lib/api/models/CategorySingle.ts +++ b/src/lib/api/models/CategorySingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { CategoryRead } from './CategoryRead'; +import { + CategoryReadFromJSON, + CategoryReadFromJSONTyped, + CategoryReadToJSON, +} from './CategoryRead'; -export type CategorySingle = { +/** + * + * @export + * @interface CategorySingle + */ +export interface CategorySingle { + /** + * + * @type {CategoryRead} + * @memberof CategorySingle + */ data: CategoryRead; -}; +} + +/** + * Check if a given object implements the CategorySingle interface. + */ +export function instanceOfCategorySingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function CategorySingleFromJSON(json: any): CategorySingle { + return CategorySingleFromJSONTyped(json, false); +} + +export function CategorySingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategorySingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': CategoryReadFromJSON(json['data']), + }; +} + +export function CategorySingleToJSON(value?: CategorySingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': CategoryReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/CategorySpent.ts b/src/lib/api/models/CategorySpent.ts index 5d11fac..0115b83 100644 --- a/src/lib/api/models/CategorySpent.ts +++ b/src/lib/api/models/CategorySpent.ts @@ -1,19 +1,97 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type CategorySpent = { - currency_id?: string; - currency_code?: string; - currency_symbol?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface CategorySpent + */ +export interface CategorySpent { + /** + * + * @type {string} + * @memberof CategorySpent + */ + currencyId?: string; + /** + * + * @type {string} + * @memberof CategorySpent + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof CategorySpent + */ + currencySymbol?: string; /** * Number of decimals supported by the currency + * @type {number} + * @memberof CategorySpent */ - currency_decimal_places?: number; + currencyDecimalPlaces?: number; /** * The amount spent. + * @type {string} + * @memberof CategorySpent */ sum?: string; -}; +} + +/** + * Check if a given object implements the CategorySpent interface. + */ +export function instanceOfCategorySpent(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function CategorySpentFromJSON(json: any): CategorySpent { + return CategorySpentFromJSONTyped(json, false); +} + +export function CategorySpentFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategorySpent { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'sum': !exists(json, 'sum') ? undefined : json['sum'], + }; +} + +export function CategorySpentToJSON(value?: CategorySpent | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'sum': value.sum, + }; +} diff --git a/src/lib/api/models/CategoryUpdate.ts b/src/lib/api/models/CategoryUpdate.ts index b08b520..4ed9a11 100644 --- a/src/lib/api/models/CategoryUpdate.ts +++ b/src/lib/api/models/CategoryUpdate.ts @@ -1,10 +1,74 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type CategoryUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface CategoryUpdate + */ +export interface CategoryUpdate { + /** + * + * @type {string} + * @memberof CategoryUpdate + */ name: string; + /** + * + * @type {string} + * @memberof CategoryUpdate + */ notes?: string | null; -}; +} + +/** + * Check if a given object implements the CategoryUpdate interface. + */ +export function instanceOfCategoryUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function CategoryUpdateFromJSON(json: any): CategoryUpdate { + return CategoryUpdateFromJSONTyped(json, false); +} + +export function CategoryUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): CategoryUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + }; +} + +export function CategoryUpdateToJSON(value?: CategoryUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/ChartDataPoint.ts b/src/lib/api/models/ChartDataPoint.ts index 7616787..8f48fc3 100644 --- a/src/lib/api/models/ChartDataPoint.ts +++ b/src/lib/api/models/ChartDataPoint.ts @@ -1,12 +1,65 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type ChartDataPoint = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ChartDataPoint + */ +export interface ChartDataPoint { /** * The key is the label of the value, so for example: '2018-01-01' => 13 or 'Groceries' => -123. + * @type {string} + * @memberof ChartDataPoint */ key?: string; -}; +} + +/** + * Check if a given object implements the ChartDataPoint interface. + */ +export function instanceOfChartDataPoint(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function ChartDataPointFromJSON(json: any): ChartDataPoint { + return ChartDataPointFromJSONTyped(json, false); +} + +export function ChartDataPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChartDataPoint { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'key': !exists(json, 'key') ? undefined : json['key'], + }; +} + +export function ChartDataPointToJSON(value?: ChartDataPoint | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'key': value.key, + }; +} diff --git a/src/lib/api/models/ChartDataSet.ts b/src/lib/api/models/ChartDataSet.ts index 0fba2d0..9c94897 100644 --- a/src/lib/api/models/ChartDataSet.ts +++ b/src/lib/api/models/ChartDataSet.ts @@ -1,36 +1,144 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type ChartDataSet = { +import { exists, mapValues } from '../runtime'; +import type { ChartDataPoint } from './ChartDataPoint'; +import { + ChartDataPointFromJSON, + ChartDataPointFromJSONTyped, + ChartDataPointToJSON, +} from './ChartDataPoint'; + +/** + * + * @export + * @interface ChartDataSet + */ +export interface ChartDataSet { /** * This is the title of the current set. It can refer to an account, a budget or another object (by name). + * @type {string} + * @memberof ChartDataSet */ label?: string; /** * The currency ID of the currency associated to the data in the entries. + * @type {string} + * @memberof ChartDataSet + */ + currencyId?: string; + /** + * + * @type {string} + * @memberof ChartDataSet */ - currency_id?: string; - currency_code?: string; - currency_symbol?: string; + currencyCode?: string; + /** + * + * @type {string} + * @memberof ChartDataSet + */ + currencySymbol?: string; /** * Number of decimals for the currency associated to the data in the entries. + * @type {number} + * @memberof ChartDataSet + */ + currencyDecimalPlaces?: number; + /** + * + * @type {Date} + * @memberof ChartDataSet */ - currency_decimal_places?: number; - start_date?: string; - end_date?: string; + startDate?: Date; + /** + * + * @type {Date} + * @memberof ChartDataSet + */ + endDate?: Date; /** * Indicated the type of chart that is expected to be rendered. You can safely ignore this if you want. + * @type {string} + * @memberof ChartDataSet */ type?: string; /** * Used to indicate the Y axis for this data set. Is usually between 0 and 1 (left and right side of the chart). + * @type {number} + * @memberof ChartDataSet */ yAxisID?: number; /** * The actual entries for this data set. They 'key' value is the label for the data point. The value is the actual (numerical) value. + * @type {Array} + * @memberof ChartDataSet */ - entries?: Record; -}; + entries?: Array; +} + +/** + * Check if a given object implements the ChartDataSet interface. + */ +export function instanceOfChartDataSet(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function ChartDataSetFromJSON(json: any): ChartDataSet { + return ChartDataSetFromJSONTyped(json, false); +} + +export function ChartDataSetFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChartDataSet { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'label': !exists(json, 'label') ? undefined : json['label'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'startDate': !exists(json, 'start_date') ? undefined : (new Date(json['start_date'])), + 'endDate': !exists(json, 'end_date') ? undefined : (new Date(json['end_date'])), + 'type': !exists(json, 'type') ? undefined : json['type'], + 'yAxisID': !exists(json, 'yAxisID') ? undefined : json['yAxisID'], + 'entries': !exists(json, 'entries') ? undefined : ((json['entries'] as Array).map(ChartDataPointFromJSON)), + }; +} + +export function ChartDataSetToJSON(value?: ChartDataSet | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'label': value.label, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'start_date': value.startDate === undefined ? undefined : (value.startDate.toISOString()), + 'end_date': value.endDate === undefined ? undefined : (value.endDate.toISOString()), + 'type': value.type, + 'yAxisID': value.yAxisID, + 'entries': value.entries === undefined ? undefined : ((value.entries as Array).map(ChartDataPointToJSON)), + }; +} diff --git a/src/lib/api/models/ChartLine.ts b/src/lib/api/models/ChartLine.ts deleted file mode 100644 index 1cbdd7a..0000000 --- a/src/lib/api/models/ChartLine.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ChartDataSet } from './ChartDataSet'; - -export type ChartLine = Array; diff --git a/src/lib/api/models/ConfigValueFilter.ts b/src/lib/api/models/ConfigValueFilter.ts index 3878fdf..15df257 100644 --- a/src/lib/api/models/ConfigValueFilter.ts +++ b/src/lib/api/models/ConfigValueFilter.ts @@ -1,29 +1,55 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Title of the configuration value. + * @export */ -export enum ConfigValueFilter { - CONFIGURATION_IS_DEMO_SITE = 'configuration.is_demo_site', - CONFIGURATION_PERMISSION_UPDATE_CHECK = 'configuration.permission_update_check', - CONFIGURATION_LAST_UPDATE_CHECK = 'configuration.last_update_check', - CONFIGURATION_SINGLE_USER_MODE = 'configuration.single_user_mode', - FIREFLY_VERSION = 'firefly.version', - FIREFLY_API_VERSION = 'firefly.api_version', - FIREFLY_DEFAULT_LOCATION = 'firefly.default_location', - FIREFLY_ACCOUNT_TO_TRANSACTION = 'firefly.account_to_transaction', - FIREFLY_ALLOWED_OPPOSING_TYPES = 'firefly.allowed_opposing_types', - FIREFLY_ACCOUNT_ROLES = 'firefly.accountRoles', - FIREFLY_VALID_LIABILITIES = 'firefly.valid_liabilities', - FIREFLY_INTEREST_PERIODS = 'firefly.interest_periods', - FIREFLY_ENABLE_EXTERNAL_MAP = 'firefly.enable_external_map', - FIREFLY_EXPECTED_SOURCE_TYPES = 'firefly.expected_source_types', - APP_TIMEZONE = 'app.timezone', - FIREFLY_BILL_PERIODS = 'firefly.bill_periods', - FIREFLY_CREDIT_CARD_TYPES = 'firefly.credit_card_types', - FIREFLY_LANGUAGES = 'firefly.languages', - FIREFLY_VALID_VIEW_RANGES = 'firefly.valid_view_ranges', +export const ConfigValueFilter = { + ConfigurationIsDemoSite: 'configuration.is_demo_site', + ConfigurationPermissionUpdateCheck: 'configuration.permission_update_check', + ConfigurationLastUpdateCheck: 'configuration.last_update_check', + ConfigurationSingleUserMode: 'configuration.single_user_mode', + FireflyVersion: 'firefly.version', + FireflyApiVersion: 'firefly.api_version', + FireflyDefaultLocation: 'firefly.default_location', + FireflyAccountToTransaction: 'firefly.account_to_transaction', + FireflyAllowedOpposingTypes: 'firefly.allowed_opposing_types', + FireflyAccountRoles: 'firefly.accountRoles', + FireflyValidLiabilities: 'firefly.valid_liabilities', + FireflyInterestPeriods: 'firefly.interest_periods', + FireflyEnableExternalMap: 'firefly.enable_external_map', + FireflyExpectedSourceTypes: 'firefly.expected_source_types', + AppTimezone: 'app.timezone', + FireflyBillPeriods: 'firefly.bill_periods', + FireflyCreditCardTypes: 'firefly.credit_card_types', + FireflyLanguages: 'firefly.languages', + FireflyValidViewRanges: 'firefly.valid_view_ranges' +} as const; +export type ConfigValueFilter = typeof ConfigValueFilter[keyof typeof ConfigValueFilter]; + + +export function ConfigValueFilterFromJSON(json: any): ConfigValueFilter { + return ConfigValueFilterFromJSONTyped(json, false); } + +export function ConfigValueFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConfigValueFilter { + return json as ConfigValueFilter; +} + +export function ConfigValueFilterToJSON(value?: ConfigValueFilter | null): any { + return value as any; +} + diff --git a/src/lib/api/models/ConfigValueUpdateFilter.ts b/src/lib/api/models/ConfigValueUpdateFilter.ts index 99a10a9..ea3d165 100644 --- a/src/lib/api/models/ConfigValueUpdateFilter.ts +++ b/src/lib/api/models/ConfigValueUpdateFilter.ts @@ -1,11 +1,40 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum ConfigValueUpdateFilter { - CONFIGURATION_IS_DEMO_SITE = 'configuration.is_demo_site', - CONFIGURATION_PERMISSION_UPDATE_CHECK = 'configuration.permission_update_check', - CONFIGURATION_LAST_UPDATE_CHECK = 'configuration.last_update_check', - CONFIGURATION_SINGLE_USER_MODE = 'configuration.single_user_mode', + +/** + * + * @export + */ +export const ConfigValueUpdateFilter = { + IsDemoSite: 'configuration.is_demo_site', + PermissionUpdateCheck: 'configuration.permission_update_check', + LastUpdateCheck: 'configuration.last_update_check', + SingleUserMode: 'configuration.single_user_mode' +} as const; +export type ConfigValueUpdateFilter = typeof ConfigValueUpdateFilter[keyof typeof ConfigValueUpdateFilter]; + + +export function ConfigValueUpdateFilterFromJSON(json: any): ConfigValueUpdateFilter { + return ConfigValueUpdateFilterFromJSONTyped(json, false); +} + +export function ConfigValueUpdateFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConfigValueUpdateFilter { + return json as ConfigValueUpdateFilter; +} + +export function ConfigValueUpdateFilterToJSON(value?: ConfigValueUpdateFilter | null): any { + return value as any; } + diff --git a/src/lib/api/models/Configuration.ts b/src/lib/api/models/Configuration.ts deleted file mode 100644 index 200c517..0000000 --- a/src/lib/api/models/Configuration.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ConfigValueFilter } from './ConfigValueFilter'; -import type { PolymorphicProperty } from './PolymorphicProperty'; - -export type Configuration = { - title: ConfigValueFilter; - value: PolymorphicProperty; - /** - * If this config variable can be edited by the user - */ - editable: boolean; -}; - diff --git a/src/lib/api/models/ConfigurationArray.ts b/src/lib/api/models/ConfigurationArray.ts deleted file mode 100644 index 2b47add..0000000 --- a/src/lib/api/models/ConfigurationArray.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { Configuration } from './Configuration'; - -export type ConfigurationArray = Array; diff --git a/src/lib/api/models/ConfigurationSingle.ts b/src/lib/api/models/ConfigurationSingle.ts index dcc9bf7..c33035e 100644 --- a/src/lib/api/models/ConfigurationSingle.ts +++ b/src/lib/api/models/ConfigurationSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -import type { Configuration } from './Configuration'; +import { exists, mapValues } from '../runtime'; +import type { ModelConfiguration } from './ModelConfiguration'; +import { + ModelConfigurationFromJSON, + ModelConfigurationFromJSONTyped, + ModelConfigurationToJSON, +} from './ModelConfiguration'; -export type ConfigurationSingle = { - data: Configuration; -}; +/** + * + * @export + * @interface ConfigurationSingle + */ +export interface ConfigurationSingle { + /** + * + * @type {ModelConfiguration} + * @memberof ConfigurationSingle + */ + data: ModelConfiguration; +} + +/** + * Check if a given object implements the ConfigurationSingle interface. + */ +export function instanceOfConfigurationSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function ConfigurationSingleFromJSON(json: any): ConfigurationSingle { + return ConfigurationSingleFromJSONTyped(json, false); +} + +export function ConfigurationSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConfigurationSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ModelConfigurationFromJSON(json['data']), + }; +} + +export function ConfigurationSingleToJSON(value?: ConfigurationSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ModelConfigurationToJSON(value.data), + }; +} diff --git a/src/lib/api/models/ConfigurationUpdate.ts b/src/lib/api/models/ConfigurationUpdate.ts index f709267..c7036fc 100644 --- a/src/lib/api/models/ConfigurationUpdate.ts +++ b/src/lib/api/models/ConfigurationUpdate.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { PolymorphicProperty } from './PolymorphicProperty'; +import { + PolymorphicPropertyFromJSON, + PolymorphicPropertyFromJSONTyped, + PolymorphicPropertyToJSON, +} from './PolymorphicProperty'; -export type ConfigurationUpdate = { +/** + * + * @export + * @interface ConfigurationUpdate + */ +export interface ConfigurationUpdate { + /** + * + * @type {PolymorphicProperty} + * @memberof ConfigurationUpdate + */ value: PolymorphicProperty; -}; +} + +/** + * Check if a given object implements the ConfigurationUpdate interface. + */ +export function instanceOfConfigurationUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "value" in value; + + return isInstance; +} + +export function ConfigurationUpdateFromJSON(json: any): ConfigurationUpdate { + return ConfigurationUpdateFromJSONTyped(json, false); +} + +export function ConfigurationUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConfigurationUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'value': PolymorphicPropertyFromJSON(json['value']), + }; +} + +export function ConfigurationUpdateToJSON(value?: ConfigurationUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'value': PolymorphicPropertyToJSON(value.value), + }; +} diff --git a/src/lib/api/models/CreditCardType.ts b/src/lib/api/models/CreditCardType.ts index 16395c5..7822f06 100644 --- a/src/lib/api/models/CreditCardType.ts +++ b/src/lib/api/models/CreditCardType.ts @@ -1,11 +1,38 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Mandatory when the account_role is ccAsset. Can only be monthlyFull or null. + * @export */ -export enum CreditCardType { - MONTHLY_FULL = 'monthlyFull', +export const CreditCardType = { + MonthlyFull: 'monthlyFull', + Null: 'null' +} as const; +export type CreditCardType = typeof CreditCardType[keyof typeof CreditCardType]; + + +export function CreditCardTypeFromJSON(json: any): CreditCardType { + return CreditCardTypeFromJSONTyped(json, false); } + +export function CreditCardTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreditCardType { + return json as CreditCardType; +} + +export function CreditCardTypeToJSON(value?: CreditCardType | null): any { + return value as any; +} + diff --git a/src/lib/api/models/CronResult.ts b/src/lib/api/models/CronResult.ts index a40e510..0f259c8 100644 --- a/src/lib/api/models/CronResult.ts +++ b/src/lib/api/models/CronResult.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { CronResultRow } from './CronResultRow'; +import { + CronResultRowFromJSON, + CronResultRowFromJSONTyped, + CronResultRowToJSON, +} from './CronResultRow'; -export type CronResult = { - recurring_transactions?: CronResultRow; - auto_budgets?: CronResultRow; +/** + * + * @export + * @interface CronResult + */ +export interface CronResult { + /** + * + * @type {CronResultRow} + * @memberof CronResult + */ + recurringTransactions?: CronResultRow; + /** + * + * @type {CronResultRow} + * @memberof CronResult + */ + autoBudgets?: CronResultRow; + /** + * + * @type {CronResultRow} + * @memberof CronResult + */ telemetry?: CronResultRow; -}; +} + +/** + * Check if a given object implements the CronResult interface. + */ +export function instanceOfCronResult(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function CronResultFromJSON(json: any): CronResult { + return CronResultFromJSONTyped(json, false); +} + +export function CronResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): CronResult { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'recurringTransactions': !exists(json, 'recurring_transactions') ? undefined : CronResultRowFromJSON(json['recurring_transactions']), + 'autoBudgets': !exists(json, 'auto_budgets') ? undefined : CronResultRowFromJSON(json['auto_budgets']), + 'telemetry': !exists(json, 'telemetry') ? undefined : CronResultRowFromJSON(json['telemetry']), + }; +} + +export function CronResultToJSON(value?: CronResult | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'recurring_transactions': CronResultRowToJSON(value.recurringTransactions), + 'auto_budgets': CronResultRowToJSON(value.autoBudgets), + 'telemetry': CronResultRowToJSON(value.telemetry), + }; +} diff --git a/src/lib/api/models/CronResultRow.ts b/src/lib/api/models/CronResultRow.ts index 237209a..768eabc 100644 --- a/src/lib/api/models/CronResultRow.ts +++ b/src/lib/api/models/CronResultRow.ts @@ -1,30 +1,92 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type CronResultRow = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface CronResultRow + */ +export interface CronResultRow { /** * This value tells you if this specific cron job actually fired. It may not fire. Some cron jobs * only fire every 24 hours, for example. - * + * @type {boolean} + * @memberof CronResultRow */ - job_fired?: boolean | null; + jobFired?: boolean | null; /** * This value tells you if this specific cron job actually did something. The job may fire but not * change anything. - * + * @type {boolean} + * @memberof CronResultRow */ - job_succeeded?: boolean | null; + jobSucceeded?: boolean | null; /** * If the cron job ran into some kind of an error, this value will be true. + * @type {boolean} + * @memberof CronResultRow */ - job_errored?: boolean | null; + jobErrored?: boolean | null; /** * If the cron job ran into some kind of an error, this value will be the error message. The success message * if the job actually ran OK. - * + * @type {string} + * @memberof CronResultRow */ message?: string | null; -}; +} + +/** + * Check if a given object implements the CronResultRow interface. + */ +export function instanceOfCronResultRow(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function CronResultRowFromJSON(json: any): CronResultRow { + return CronResultRowFromJSONTyped(json, false); +} + +export function CronResultRowFromJSONTyped(json: any, ignoreDiscriminator: boolean): CronResultRow { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'jobFired': !exists(json, 'job_fired') ? undefined : json['job_fired'], + 'jobSucceeded': !exists(json, 'job_succeeded') ? undefined : json['job_succeeded'], + 'jobErrored': !exists(json, 'job_errored') ? undefined : json['job_errored'], + 'message': !exists(json, 'message') ? undefined : json['message'], + }; +} + +export function CronResultRowToJSON(value?: CronResultRow | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'job_fired': value.jobFired, + 'job_succeeded': value.jobSucceeded, + 'job_errored': value.jobErrored, + 'message': value.message, + }; +} diff --git a/src/lib/api/models/Currency.ts b/src/lib/api/models/Currency.ts index 84611b0..3014a5a 100644 --- a/src/lib/api/models/Currency.ts +++ b/src/lib/api/models/Currency.ts @@ -1,25 +1,122 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type Currency = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Currency + */ +export interface Currency { + /** + * + * @type {Date} + * @memberof Currency + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Currency + */ + readonly updatedAt?: Date; /** * Defaults to true + * @type {boolean} + * @memberof Currency */ enabled?: boolean; /** * Make this currency the default currency. + * @type {boolean} + * @memberof Currency + */ + _default?: boolean; + /** + * + * @type {string} + * @memberof Currency */ - default?: boolean; code: string; + /** + * + * @type {string} + * @memberof Currency + */ name: string; + /** + * + * @type {string} + * @memberof Currency + */ symbol: string; /** * Supports 0-16 decimals. + * @type {number} + * @memberof Currency */ - decimal_places?: number; -}; + decimalPlaces?: number; +} + +/** + * Check if a given object implements the Currency interface. + */ +export function instanceOfCurrency(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "code" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "symbol" in value; + + return isInstance; +} + +export function CurrencyFromJSON(json: any): Currency { + return CurrencyFromJSONTyped(json, false); +} + +export function CurrencyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Currency { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], + '_default': !exists(json, 'default') ? undefined : json['default'], + 'code': json['code'], + 'name': json['name'], + 'symbol': json['symbol'], + 'decimalPlaces': !exists(json, 'decimal_places') ? undefined : json['decimal_places'], + }; +} + +export function CurrencyToJSON(value?: Currency | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'enabled': value.enabled, + 'default': value._default, + 'code': value.code, + 'name': value.name, + 'symbol': value.symbol, + 'decimal_places': value.decimalPlaces, + }; +} diff --git a/src/lib/api/models/CurrencyArray.ts b/src/lib/api/models/CurrencyArray.ts index 4183e86..d389cce 100644 --- a/src/lib/api/models/CurrencyArray.ts +++ b/src/lib/api/models/CurrencyArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { CurrencyRead } from './CurrencyRead'; +import { + CurrencyReadFromJSON, + CurrencyReadFromJSONTyped, + CurrencyReadToJSON, +} from './CurrencyRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; -export type CurrencyArray = { +/** + * + * @export + * @interface CurrencyArray + */ +export interface CurrencyArray { + /** + * + * @type {Array} + * @memberof CurrencyArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof CurrencyArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof CurrencyArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the CurrencyArray interface. + */ +export function instanceOfCurrencyArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function CurrencyArrayFromJSON(json: any): CurrencyArray { + return CurrencyArrayFromJSONTyped(json, false); +} + +export function CurrencyArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrencyArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(CurrencyReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function CurrencyArrayToJSON(value?: CurrencyArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(CurrencyReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/CurrencyRead.ts b/src/lib/api/models/CurrencyRead.ts index 9ef2290..f239704 100644 --- a/src/lib/api/models/CurrencyRead.ts +++ b/src/lib/api/models/CurrencyRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Currency } from './Currency'; +import { + CurrencyFromJSON, + CurrencyFromJSONTyped, + CurrencyToJSON, +} from './Currency'; -export type CurrencyRead = { +/** + * + * @export + * @interface CurrencyRead + */ +export interface CurrencyRead { /** * Immutable value + * @type {string} + * @memberof CurrencyRead */ type: string; + /** + * + * @type {string} + * @memberof CurrencyRead + */ id: string; + /** + * + * @type {Currency} + * @memberof CurrencyRead + */ attributes: Currency; -}; +} + +/** + * Check if a given object implements the CurrencyRead interface. + */ +export function instanceOfCurrencyRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function CurrencyReadFromJSON(json: any): CurrencyRead { + return CurrencyReadFromJSONTyped(json, false); +} + +export function CurrencyReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrencyRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': CurrencyFromJSON(json['attributes']), + }; +} + +export function CurrencyReadToJSON(value?: CurrencyRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': CurrencyToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/CurrencySingle.ts b/src/lib/api/models/CurrencySingle.ts index bfef561..04f7da0 100644 --- a/src/lib/api/models/CurrencySingle.ts +++ b/src/lib/api/models/CurrencySingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { CurrencyRead } from './CurrencyRead'; +import { + CurrencyReadFromJSON, + CurrencyReadFromJSONTyped, + CurrencyReadToJSON, +} from './CurrencyRead'; -export type CurrencySingle = { +/** + * + * @export + * @interface CurrencySingle + */ +export interface CurrencySingle { + /** + * + * @type {CurrencyRead} + * @memberof CurrencySingle + */ data: CurrencyRead; -}; +} + +/** + * Check if a given object implements the CurrencySingle interface. + */ +export function instanceOfCurrencySingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function CurrencySingleFromJSON(json: any): CurrencySingle { + return CurrencySingleFromJSONTyped(json, false); +} + +export function CurrencySingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrencySingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': CurrencyReadFromJSON(json['data']), + }; +} + +export function CurrencySingleToJSON(value?: CurrencySingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': CurrencyReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/CurrencyStore.ts b/src/lib/api/models/CurrencyStore.ts index dda4271..d6f84b2 100644 --- a/src/lib/api/models/CurrencyStore.ts +++ b/src/lib/api/models/CurrencyStore.ts @@ -1,23 +1,108 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type CurrencyStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface CurrencyStore + */ +export interface CurrencyStore { /** * Defaults to true + * @type {boolean} + * @memberof CurrencyStore */ enabled?: boolean; /** * Make this currency the default currency. + * @type {boolean} + * @memberof CurrencyStore + */ + _default?: boolean; + /** + * + * @type {string} + * @memberof CurrencyStore */ - default?: boolean; code: string; + /** + * + * @type {string} + * @memberof CurrencyStore + */ name: string; + /** + * + * @type {string} + * @memberof CurrencyStore + */ symbol: string; /** * Supports 0-16 decimals. + * @type {number} + * @memberof CurrencyStore */ - decimal_places?: number; -}; + decimalPlaces?: number; +} + +/** + * Check if a given object implements the CurrencyStore interface. + */ +export function instanceOfCurrencyStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "code" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "symbol" in value; + + return isInstance; +} + +export function CurrencyStoreFromJSON(json: any): CurrencyStore { + return CurrencyStoreFromJSONTyped(json, false); +} + +export function CurrencyStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrencyStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], + '_default': !exists(json, 'default') ? undefined : json['default'], + 'code': json['code'], + 'name': json['name'], + 'symbol': json['symbol'], + 'decimalPlaces': !exists(json, 'decimal_places') ? undefined : json['decimal_places'], + }; +} + +export function CurrencyStoreToJSON(value?: CurrencyStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'enabled': value.enabled, + 'default': value._default, + 'code': value.code, + 'name': value.name, + 'symbol': value.symbol, + 'decimal_places': value.decimalPlaces, + }; +} diff --git a/src/lib/api/models/CurrencyUpdate.ts b/src/lib/api/models/CurrencyUpdate.ts index b55b3a2..c7d3470 100644 --- a/src/lib/api/models/CurrencyUpdate.ts +++ b/src/lib/api/models/CurrencyUpdate.ts @@ -1,32 +1,105 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type CurrencyUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface CurrencyUpdate + */ +export interface CurrencyUpdate { /** * If the currency is enabled + * @type {boolean} + * @memberof CurrencyUpdate */ enabled?: boolean; /** * If the currency must be the default for the user. You can only submit TRUE. + * @type {boolean} + * @memberof CurrencyUpdate */ - default?: boolean; + _default?: boolean; /** * The currency code + * @type {string} + * @memberof CurrencyUpdate */ code?: string; /** * The currency name + * @type {string} + * @memberof CurrencyUpdate */ name?: string; /** * The currency symbol + * @type {string} + * @memberof CurrencyUpdate */ symbol?: string; /** * How many decimals to use when displaying this currency. Between 0 and 16. + * @type {number} + * @memberof CurrencyUpdate */ - decimal_places?: number; -}; + decimalPlaces?: number; +} + +/** + * Check if a given object implements the CurrencyUpdate interface. + */ +export function instanceOfCurrencyUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function CurrencyUpdateFromJSON(json: any): CurrencyUpdate { + return CurrencyUpdateFromJSONTyped(json, false); +} + +export function CurrencyUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrencyUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], + '_default': !exists(json, 'default') ? undefined : json['default'], + 'code': !exists(json, 'code') ? undefined : json['code'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'symbol': !exists(json, 'symbol') ? undefined : json['symbol'], + 'decimalPlaces': !exists(json, 'decimal_places') ? undefined : json['decimal_places'], + }; +} + +export function CurrencyUpdateToJSON(value?: CurrencyUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'enabled': value.enabled, + 'default': value._default, + 'code': value.code, + 'name': value.name, + 'symbol': value.symbol, + 'decimal_places': value.decimalPlaces, + }; +} diff --git a/src/lib/api/models/DataDestroyObject.ts b/src/lib/api/models/DataDestroyObject.ts index c615ee7..fd6a20c 100644 --- a/src/lib/api/models/DataDestroyObject.ts +++ b/src/lib/api/models/DataDestroyObject.ts @@ -1,25 +1,54 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum DataDestroyObject { - NOT_ASSETS_LIABILITIES = 'not_assets_liabilities', - BUDGETS = 'budgets', - BILLS = 'bills', - PIGGY_BANKS = 'piggy_banks', - RULES = 'rules', - RECURRING = 'recurring', - CATEGORIES = 'categories', - TAGS = 'tags', - OBJECT_GROUPS = 'object_groups', - ACCOUNTS = 'accounts', - ASSET_ACCOUNTS = 'asset_accounts', - EXPENSE_ACCOUNTS = 'expense_accounts', - REVENUE_ACCOUNTS = 'revenue_accounts', - LIABILITIES = 'liabilities', - TRANSACTIONS = 'transactions', - WITHDRAWALS = 'withdrawals', - DEPOSITS = 'deposits', - TRANSFERS = 'transfers', + +/** + * + * @export + */ +export const DataDestroyObject = { + NotAssetsLiabilities: 'not_assets_liabilities', + Budgets: 'budgets', + Bills: 'bills', + PiggyBanks: 'piggy_banks', + Rules: 'rules', + Recurring: 'recurring', + Categories: 'categories', + Tags: 'tags', + ObjectGroups: 'object_groups', + Accounts: 'accounts', + AssetAccounts: 'asset_accounts', + ExpenseAccounts: 'expense_accounts', + RevenueAccounts: 'revenue_accounts', + Liabilities: 'liabilities', + Transactions: 'transactions', + Withdrawals: 'withdrawals', + Deposits: 'deposits', + Transfers: 'transfers' +} as const; +export type DataDestroyObject = typeof DataDestroyObject[keyof typeof DataDestroyObject]; + + +export function DataDestroyObjectFromJSON(json: any): DataDestroyObject { + return DataDestroyObjectFromJSONTyped(json, false); +} + +export function DataDestroyObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataDestroyObject { + return json as DataDestroyObject; +} + +export function DataDestroyObjectToJSON(value?: DataDestroyObject | null): any { + return value as any; } + diff --git a/src/lib/api/models/ExportFileFilter.ts b/src/lib/api/models/ExportFileFilter.ts index 9fb4e09..a83151e 100644 --- a/src/lib/api/models/ExportFileFilter.ts +++ b/src/lib/api/models/ExportFileFilter.ts @@ -1,8 +1,37 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum ExportFileFilter { - CSV = 'csv', + +/** + * + * @export + */ +export const ExportFileFilter = { + Csv: 'csv' +} as const; +export type ExportFileFilter = typeof ExportFileFilter[keyof typeof ExportFileFilter]; + + +export function ExportFileFilterFromJSON(json: any): ExportFileFilter { + return ExportFileFilterFromJSONTyped(json, false); +} + +export function ExportFileFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExportFileFilter { + return json as ExportFileFilter; +} + +export function ExportFileFilterToJSON(value?: ExportFileFilter | null): any { + return value as any; } + diff --git a/src/lib/api/models/InsightGroup.ts b/src/lib/api/models/InsightGroup.ts deleted file mode 100644 index 46d7243..0000000 --- a/src/lib/api/models/InsightGroup.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { InsightGroupEntry } from './InsightGroupEntry'; - -export type InsightGroup = Array; diff --git a/src/lib/api/models/InsightGroupEntry.ts b/src/lib/api/models/InsightGroupEntry.ts index 95b41bc..bcbb4c3 100644 --- a/src/lib/api/models/InsightGroupEntry.ts +++ b/src/lib/api/models/InsightGroupEntry.ts @@ -1,32 +1,105 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type InsightGroupEntry = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InsightGroupEntry + */ +export interface InsightGroupEntry { /** * This ID is a reference to the original object. + * @type {string} + * @memberof InsightGroupEntry */ id?: string; /** * This is the name of the object. + * @type {string} + * @memberof InsightGroupEntry */ name?: string; /** * The amount spent or earned between start date and end date, a number defined as a string, for this object and all asset accounts. + * @type {string} + * @memberof InsightGroupEntry */ difference?: string; /** * The amount spent or earned between start date and end date, a number as a float, for this object and all asset accounts. May have rounding errors. + * @type {number} + * @memberof InsightGroupEntry */ - difference_float?: number; + differenceFloat?: number; /** * The currency ID of the expenses listed for this account. + * @type {string} + * @memberof InsightGroupEntry */ - currency_id?: string; + currencyId?: string; /** * The currency code of the expenses listed for this account. + * @type {string} + * @memberof InsightGroupEntry */ - currency_code?: string; -}; + currencyCode?: string; +} + +/** + * Check if a given object implements the InsightGroupEntry interface. + */ +export function instanceOfInsightGroupEntry(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function InsightGroupEntryFromJSON(json: any): InsightGroupEntry { + return InsightGroupEntryFromJSONTyped(json, false); +} + +export function InsightGroupEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsightGroupEntry { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'difference': !exists(json, 'difference') ? undefined : json['difference'], + 'differenceFloat': !exists(json, 'difference_float') ? undefined : json['difference_float'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + }; +} + +export function InsightGroupEntryToJSON(value?: InsightGroupEntry | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'difference': value.difference, + 'difference_float': value.differenceFloat, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + }; +} diff --git a/src/lib/api/models/InsightTotal.ts b/src/lib/api/models/InsightTotal.ts deleted file mode 100644 index 790d072..0000000 --- a/src/lib/api/models/InsightTotal.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { InsightTotalEntry } from './InsightTotalEntry'; - -export type InsightTotal = Array; diff --git a/src/lib/api/models/InsightTotalEntry.ts b/src/lib/api/models/InsightTotalEntry.ts index e58da9a..a5db4c5 100644 --- a/src/lib/api/models/InsightTotalEntry.ts +++ b/src/lib/api/models/InsightTotalEntry.ts @@ -1,24 +1,89 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type InsightTotalEntry = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InsightTotalEntry + */ +export interface InsightTotalEntry { /** * The amount spent between start date and end date, defined as a string, for this expense account and all asset accounts. + * @type {string} + * @memberof InsightTotalEntry */ difference?: string; /** * The amount spent between start date and end date, defined as a string, for this expense account and all asset accounts. This number is a float (double) and may have rounding errors. + * @type {number} + * @memberof InsightTotalEntry */ - difference_float?: number; + differenceFloat?: number; /** * The currency ID of the expenses listed for this expense account. + * @type {string} + * @memberof InsightTotalEntry */ - currency_id?: string; + currencyId?: string; /** * The currency code of the expenses listed for this expense account. + * @type {string} + * @memberof InsightTotalEntry */ - currency_code?: string; -}; + currencyCode?: string; +} + +/** + * Check if a given object implements the InsightTotalEntry interface. + */ +export function instanceOfInsightTotalEntry(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function InsightTotalEntryFromJSON(json: any): InsightTotalEntry { + return InsightTotalEntryFromJSONTyped(json, false); +} + +export function InsightTotalEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsightTotalEntry { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'difference': !exists(json, 'difference') ? undefined : json['difference'], + 'differenceFloat': !exists(json, 'difference_float') ? undefined : json['difference_float'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + }; +} + +export function InsightTotalEntryToJSON(value?: InsightTotalEntry | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'difference': value.difference, + 'difference_float': value.differenceFloat, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + }; +} diff --git a/src/lib/api/models/InsightTransfer.ts b/src/lib/api/models/InsightTransfer.ts deleted file mode 100644 index c862d72..0000000 --- a/src/lib/api/models/InsightTransfer.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { InsightTransferEntry } from './InsightTransferEntry'; - -export type InsightTransfer = Array; diff --git a/src/lib/api/models/InsightTransferEntry.ts b/src/lib/api/models/InsightTransferEntry.ts index e1bcb2e..987f5da 100644 --- a/src/lib/api/models/InsightTransferEntry.ts +++ b/src/lib/api/models/InsightTransferEntry.ts @@ -1,48 +1,137 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type InsightTransferEntry = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InsightTransferEntry + */ +export interface InsightTransferEntry { /** * This ID is a reference to the original object. + * @type {string} + * @memberof InsightTransferEntry */ id?: string; /** * This is the name of the object. + * @type {string} + * @memberof InsightTransferEntry */ name?: string; /** * The total amount transferred between start date and end date, a number defined as a string, for this asset account. + * @type {string} + * @memberof InsightTransferEntry */ difference?: string; /** * The total amount transferred between start date and end date, a number as a float, for this asset account. May have rounding errors. + * @type {number} + * @memberof InsightTransferEntry */ - difference_float?: number; + differenceFloat?: number; /** * The total amount transferred TO this account between start date and end date, a number defined as a string, for this asset account. + * @type {string} + * @memberof InsightTransferEntry */ - in?: string; + _in?: string; /** * The total amount transferred FROM this account between start date and end date, a number as a float, for this asset account. May have rounding errors. + * @type {number} + * @memberof InsightTransferEntry */ - in_float?: number; + inFloat?: number; /** * The total amount transferred FROM this account between start date and end date, a number defined as a string, for this asset account. + * @type {string} + * @memberof InsightTransferEntry */ out?: string; /** * The total amount transferred TO this account between start date and end date, a number as a float, for this asset account. May have rounding errors. + * @type {number} + * @memberof InsightTransferEntry */ - out_float?: number; + outFloat?: number; /** * The currency ID of the expenses listed for this account. + * @type {string} + * @memberof InsightTransferEntry */ - currency_id?: string; + currencyId?: string; /** * The currency code of the expenses listed for this account. + * @type {string} + * @memberof InsightTransferEntry */ - currency_code?: string; -}; + currencyCode?: string; +} + +/** + * Check if a given object implements the InsightTransferEntry interface. + */ +export function instanceOfInsightTransferEntry(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function InsightTransferEntryFromJSON(json: any): InsightTransferEntry { + return InsightTransferEntryFromJSONTyped(json, false); +} + +export function InsightTransferEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsightTransferEntry { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'difference': !exists(json, 'difference') ? undefined : json['difference'], + 'differenceFloat': !exists(json, 'difference_float') ? undefined : json['difference_float'], + '_in': !exists(json, 'in') ? undefined : json['in'], + 'inFloat': !exists(json, 'in_float') ? undefined : json['in_float'], + 'out': !exists(json, 'out') ? undefined : json['out'], + 'outFloat': !exists(json, 'out_float') ? undefined : json['out_float'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + }; +} + +export function InsightTransferEntryToJSON(value?: InsightTransferEntry | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'difference': value.difference, + 'difference_float': value.differenceFloat, + 'in': value._in, + 'in_float': value.inFloat, + 'out': value.out, + 'out_float': value.outFloat, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + }; +} diff --git a/src/lib/api/models/InterestPeriod.ts b/src/lib/api/models/InterestPeriod.ts index 0d7b04d..3f823bb 100644 --- a/src/lib/api/models/InterestPeriod.ts +++ b/src/lib/api/models/InterestPeriod.ts @@ -1,15 +1,42 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Mandatory when type is liability. Period over which the interest is calculated. + * @export */ -export enum InterestPeriod { - WEEKLY = 'weekly', - MONTHLY = 'monthly', - QUARTERLY = 'quarterly', - HALF_YEAR = 'half-year', - YEARLY = 'yearly', +export const InterestPeriod = { + Weekly: 'weekly', + Monthly: 'monthly', + Quarterly: 'quarterly', + HalfYear: 'half-year', + Yearly: 'yearly', + Null: 'null' +} as const; +export type InterestPeriod = typeof InterestPeriod[keyof typeof InterestPeriod]; + + +export function InterestPeriodFromJSON(json: any): InterestPeriod { + return InterestPeriodFromJSONTyped(json, false); } + +export function InterestPeriodFromJSONTyped(json: any, ignoreDiscriminator: boolean): InterestPeriod { + return json as InterestPeriod; +} + +export function InterestPeriodToJSON(value?: InterestPeriod | null): any { + return value as any; +} + diff --git a/src/lib/api/models/InternalException.ts b/src/lib/api/models/InternalException.ts index 9775aec..d7f4197 100644 --- a/src/lib/api/models/InternalException.ts +++ b/src/lib/api/models/InternalException.ts @@ -1,10 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type InternalException = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InternalException + */ +export interface InternalException { + /** + * + * @type {string} + * @memberof InternalException + */ message?: string; + /** + * + * @type {string} + * @memberof InternalException + */ exception?: string; -}; +} + +/** + * Check if a given object implements the InternalException interface. + */ +export function instanceOfInternalException(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function InternalExceptionFromJSON(json: any): InternalException { + return InternalExceptionFromJSONTyped(json, false); +} + +export function InternalExceptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): InternalException { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'message': !exists(json, 'message') ? undefined : json['message'], + 'exception': !exists(json, 'exception') ? undefined : json['exception'], + }; +} + +export function InternalExceptionToJSON(value?: InternalException | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'message': value.message, + 'exception': value.exception, + }; +} diff --git a/src/lib/api/models/LiabilityDirection.ts b/src/lib/api/models/LiabilityDirection.ts index b6b3597..dda08f2 100644 --- a/src/lib/api/models/LiabilityDirection.ts +++ b/src/lib/api/models/LiabilityDirection.ts @@ -1,12 +1,39 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * 'credit' indicates somebody owes you the liability. 'debit' Indicates you owe this debt yourself. Works only for liabiltiies. + * @export */ -export enum LiabilityDirection { - CREDIT = 'credit', - DEBIT = 'debit', +export const LiabilityDirection = { + Credit: 'credit', + Debit: 'debit', + Null: 'null' +} as const; +export type LiabilityDirection = typeof LiabilityDirection[keyof typeof LiabilityDirection]; + + +export function LiabilityDirectionFromJSON(json: any): LiabilityDirection { + return LiabilityDirectionFromJSONTyped(json, false); } + +export function LiabilityDirectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): LiabilityDirection { + return json as LiabilityDirection; +} + +export function LiabilityDirectionToJSON(value?: LiabilityDirection | null): any { + return value as any; +} + diff --git a/src/lib/api/models/LiabilityType.ts b/src/lib/api/models/LiabilityType.ts index 3785465..99fb1a5 100644 --- a/src/lib/api/models/LiabilityType.ts +++ b/src/lib/api/models/LiabilityType.ts @@ -1,13 +1,40 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Mandatory when type is liability. Specifies the exact type. + * @export */ -export enum LiabilityType { - LOAN = 'loan', - DEBT = 'debt', - MORTGAGE = 'mortgage', +export const LiabilityType = { + Loan: 'loan', + Debt: 'debt', + Mortgage: 'mortgage', + Null: 'null' +} as const; +export type LiabilityType = typeof LiabilityType[keyof typeof LiabilityType]; + + +export function LiabilityTypeFromJSON(json: any): LiabilityType { + return LiabilityTypeFromJSONTyped(json, false); } + +export function LiabilityTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): LiabilityType { + return json as LiabilityType; +} + +export function LiabilityTypeToJSON(value?: LiabilityType | null): any { + return value as any; +} + diff --git a/src/lib/api/models/LinkType.ts b/src/lib/api/models/LinkType.ts index 2203d43..b5d3c14 100644 --- a/src/lib/api/models/LinkType.ts +++ b/src/lib/api/models/LinkType.ts @@ -1,12 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type LinkType = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface LinkType + */ +export interface LinkType { + /** + * + * @type {string} + * @memberof LinkType + */ name: string; + /** + * + * @type {string} + * @memberof LinkType + */ inward: string; + /** + * + * @type {string} + * @memberof LinkType + */ outward: string; + /** + * + * @type {boolean} + * @memberof LinkType + */ readonly editable?: boolean; -}; +} + +/** + * Check if a given object implements the LinkType interface. + */ +export function instanceOfLinkType(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "inward" in value; + isInstance = isInstance && "outward" in value; + + return isInstance; +} + +export function LinkTypeFromJSON(json: any): LinkType { + return LinkTypeFromJSONTyped(json, false); +} + +export function LinkTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinkType { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'inward': json['inward'], + 'outward': json['outward'], + 'editable': !exists(json, 'editable') ? undefined : json['editable'], + }; +} + +export function LinkTypeToJSON(value?: LinkType | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'inward': value.inward, + 'outward': value.outward, + }; +} diff --git a/src/lib/api/models/LinkTypeArray.ts b/src/lib/api/models/LinkTypeArray.ts index b960747..9c8f4e2 100644 --- a/src/lib/api/models/LinkTypeArray.ts +++ b/src/lib/api/models/LinkTypeArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { LinkTypeRead } from './LinkTypeRead'; +import { + LinkTypeReadFromJSON, + LinkTypeReadFromJSONTyped, + LinkTypeReadToJSON, +} from './LinkTypeRead'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; -export type LinkTypeArray = { +/** + * + * @export + * @interface LinkTypeArray + */ +export interface LinkTypeArray { + /** + * + * @type {Array} + * @memberof LinkTypeArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof LinkTypeArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof LinkTypeArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the LinkTypeArray interface. + */ +export function instanceOfLinkTypeArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function LinkTypeArrayFromJSON(json: any): LinkTypeArray { + return LinkTypeArrayFromJSONTyped(json, false); +} + +export function LinkTypeArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinkTypeArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(LinkTypeReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function LinkTypeArrayToJSON(value?: LinkTypeArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(LinkTypeReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/LinkTypeRead.ts b/src/lib/api/models/LinkTypeRead.ts index 4ca47b7..fabe223 100644 --- a/src/lib/api/models/LinkTypeRead.ts +++ b/src/lib/api/models/LinkTypeRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { LinkType } from './LinkType'; +import { + LinkTypeFromJSON, + LinkTypeFromJSONTyped, + LinkTypeToJSON, +} from './LinkType'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; -export type LinkTypeRead = { +/** + * + * @export + * @interface LinkTypeRead + */ +export interface LinkTypeRead { /** * Immutable value + * @type {string} + * @memberof LinkTypeRead */ type: string; + /** + * + * @type {string} + * @memberof LinkTypeRead + */ id: string; + /** + * + * @type {LinkType} + * @memberof LinkTypeRead + */ attributes: LinkType; + /** + * + * @type {ObjectLink} + * @memberof LinkTypeRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the LinkTypeRead interface. + */ +export function instanceOfLinkTypeRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function LinkTypeReadFromJSON(json: any): LinkTypeRead { + return LinkTypeReadFromJSONTyped(json, false); +} + +export function LinkTypeReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinkTypeRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': LinkTypeFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function LinkTypeReadToJSON(value?: LinkTypeRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': LinkTypeToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/LinkTypeSingle.ts b/src/lib/api/models/LinkTypeSingle.ts index 1fe8eae..5f62754 100644 --- a/src/lib/api/models/LinkTypeSingle.ts +++ b/src/lib/api/models/LinkTypeSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { LinkTypeRead } from './LinkTypeRead'; +import { + LinkTypeReadFromJSON, + LinkTypeReadFromJSONTyped, + LinkTypeReadToJSON, +} from './LinkTypeRead'; -export type LinkTypeSingle = { +/** + * + * @export + * @interface LinkTypeSingle + */ +export interface LinkTypeSingle { + /** + * + * @type {LinkTypeRead} + * @memberof LinkTypeSingle + */ data: LinkTypeRead; -}; +} + +/** + * Check if a given object implements the LinkTypeSingle interface. + */ +export function instanceOfLinkTypeSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function LinkTypeSingleFromJSON(json: any): LinkTypeSingle { + return LinkTypeSingleFromJSONTyped(json, false); +} + +export function LinkTypeSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinkTypeSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': LinkTypeReadFromJSON(json['data']), + }; +} + +export function LinkTypeSingleToJSON(value?: LinkTypeSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': LinkTypeReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/LinkTypeUpdate.ts b/src/lib/api/models/LinkTypeUpdate.ts index 478bc33..423d875 100644 --- a/src/lib/api/models/LinkTypeUpdate.ts +++ b/src/lib/api/models/LinkTypeUpdate.ts @@ -1,11 +1,81 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type LinkTypeUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface LinkTypeUpdate + */ +export interface LinkTypeUpdate { + /** + * + * @type {string} + * @memberof LinkTypeUpdate + */ name?: string; + /** + * + * @type {string} + * @memberof LinkTypeUpdate + */ inward?: string; + /** + * + * @type {string} + * @memberof LinkTypeUpdate + */ outward?: string; -}; +} + +/** + * Check if a given object implements the LinkTypeUpdate interface. + */ +export function instanceOfLinkTypeUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function LinkTypeUpdateFromJSON(json: any): LinkTypeUpdate { + return LinkTypeUpdateFromJSONTyped(json, false); +} + +export function LinkTypeUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinkTypeUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': !exists(json, 'name') ? undefined : json['name'], + 'inward': !exists(json, 'inward') ? undefined : json['inward'], + 'outward': !exists(json, 'outward') ? undefined : json['outward'], + }; +} + +export function LinkTypeUpdateToJSON(value?: LinkTypeUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'inward': value.inward, + 'outward': value.outward, + }; +} diff --git a/src/lib/api/models/Meta.ts b/src/lib/api/models/Meta.ts index 2868874..5431651 100644 --- a/src/lib/api/models/Meta.ts +++ b/src/lib/api/models/Meta.ts @@ -1,15 +1,72 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type Meta = { - pagination?: { - total?: number; - count?: number; - per_page?: number; - current_page?: number; - total_pages?: number; +import { exists, mapValues } from '../runtime'; +import type { MetaPagination } from './MetaPagination'; +import { + MetaPaginationFromJSON, + MetaPaginationFromJSONTyped, + MetaPaginationToJSON, +} from './MetaPagination'; + +/** + * + * @export + * @interface Meta + */ +export interface Meta { + /** + * + * @type {MetaPagination} + * @memberof Meta + */ + pagination?: MetaPagination; +} + +/** + * Check if a given object implements the Meta interface. + */ +export function instanceOfMeta(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function MetaFromJSON(json: any): Meta { + return MetaFromJSONTyped(json, false); +} + +export function MetaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Meta { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'pagination': !exists(json, 'pagination') ? undefined : MetaPaginationFromJSON(json['pagination']), + }; +} + +export function MetaToJSON(value?: Meta | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'pagination': MetaPaginationToJSON(value.pagination), }; -}; +} diff --git a/src/lib/api/models/MetaPagination.ts b/src/lib/api/models/MetaPagination.ts new file mode 100644 index 0000000..07d9d3a --- /dev/null +++ b/src/lib/api/models/MetaPagination.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface MetaPagination + */ +export interface MetaPagination { + /** + * + * @type {number} + * @memberof MetaPagination + */ + total?: number; + /** + * + * @type {number} + * @memberof MetaPagination + */ + count?: number; + /** + * + * @type {number} + * @memberof MetaPagination + */ + perPage?: number; + /** + * + * @type {number} + * @memberof MetaPagination + */ + currentPage?: number; + /** + * + * @type {number} + * @memberof MetaPagination + */ + totalPages?: number; +} + +/** + * Check if a given object implements the MetaPagination interface. + */ +export function instanceOfMetaPagination(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function MetaPaginationFromJSON(json: any): MetaPagination { + return MetaPaginationFromJSONTyped(json, false); +} + +export function MetaPaginationFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaPagination { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'total': !exists(json, 'total') ? undefined : json['total'], + 'count': !exists(json, 'count') ? undefined : json['count'], + 'perPage': !exists(json, 'per_page') ? undefined : json['per_page'], + 'currentPage': !exists(json, 'current_page') ? undefined : json['current_page'], + 'totalPages': !exists(json, 'total_pages') ? undefined : json['total_pages'], + }; +} + +export function MetaPaginationToJSON(value?: MetaPagination | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'total': value.total, + 'count': value.count, + 'per_page': value.perPage, + 'current_page': value.currentPage, + 'total_pages': value.totalPages, + }; +} + diff --git a/src/lib/api/models/ModelConfiguration.ts b/src/lib/api/models/ModelConfiguration.ts new file mode 100644 index 0000000..2e61b12 --- /dev/null +++ b/src/lib/api/models/ModelConfiguration.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { ConfigValueFilter } from './ConfigValueFilter'; +import { + ConfigValueFilterFromJSON, + ConfigValueFilterFromJSONTyped, + ConfigValueFilterToJSON, +} from './ConfigValueFilter'; +import type { PolymorphicProperty } from './PolymorphicProperty'; +import { + PolymorphicPropertyFromJSON, + PolymorphicPropertyFromJSONTyped, + PolymorphicPropertyToJSON, +} from './PolymorphicProperty'; + +/** + * + * @export + * @interface ModelConfiguration + */ +export interface ModelConfiguration { + /** + * + * @type {ConfigValueFilter} + * @memberof ModelConfiguration + */ + title: ConfigValueFilter; + /** + * + * @type {PolymorphicProperty} + * @memberof ModelConfiguration + */ + value: PolymorphicProperty; + /** + * If this config variable can be edited by the user + * @type {boolean} + * @memberof ModelConfiguration + */ + editable: boolean; +} + +/** + * Check if a given object implements the ModelConfiguration interface. + */ +export function instanceOfModelConfiguration(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "value" in value; + isInstance = isInstance && "editable" in value; + + return isInstance; +} + +export function ModelConfigurationFromJSON(json: any): ModelConfiguration { + return ModelConfigurationFromJSONTyped(json, false); +} + +export function ModelConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelConfiguration { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': ConfigValueFilterFromJSON(json['title']), + 'value': PolymorphicPropertyFromJSON(json['value']), + 'editable': json['editable'], + }; +} + +export function ModelConfigurationToJSON(value?: ModelConfiguration | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': ConfigValueFilterToJSON(value.title), + 'value': PolymorphicPropertyToJSON(value.value), + 'editable': value.editable, + }; +} + diff --git a/src/lib/api/models/NotFound.ts b/src/lib/api/models/NotFound.ts index aee3b87..c5a3a2c 100644 --- a/src/lib/api/models/NotFound.ts +++ b/src/lib/api/models/NotFound.ts @@ -1,10 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type NotFound = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface NotFound + */ +export interface NotFound { + /** + * + * @type {string} + * @memberof NotFound + */ message?: string; + /** + * + * @type {string} + * @memberof NotFound + */ exception?: string; -}; +} + +/** + * Check if a given object implements the NotFound interface. + */ +export function instanceOfNotFound(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function NotFoundFromJSON(json: any): NotFound { + return NotFoundFromJSONTyped(json, false); +} + +export function NotFoundFromJSONTyped(json: any, ignoreDiscriminator: boolean): NotFound { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'message': !exists(json, 'message') ? undefined : json['message'], + 'exception': !exists(json, 'exception') ? undefined : json['exception'], + }; +} + +export function NotFoundToJSON(value?: NotFound | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'message': value.message, + 'exception': value.exception, + }; +} diff --git a/src/lib/api/models/ObjectGroup.ts b/src/lib/api/models/ObjectGroup.ts index 2009146..6a52232 100644 --- a/src/lib/api/models/ObjectGroup.ts +++ b/src/lib/api/models/ObjectGroup.ts @@ -1,15 +1,89 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type ObjectGroup = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ObjectGroup + */ +export interface ObjectGroup { + /** + * + * @type {Date} + * @memberof ObjectGroup + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof ObjectGroup + */ + readonly updatedAt?: Date; + /** + * + * @type {string} + * @memberof ObjectGroup + */ title: string; /** * Order of the object group + * @type {number} + * @memberof ObjectGroup */ order: number; -}; +} + +/** + * Check if a given object implements the ObjectGroup interface. + */ +export function instanceOfObjectGroup(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "order" in value; + + return isInstance; +} + +export function ObjectGroupFromJSON(json: any): ObjectGroup { + return ObjectGroupFromJSONTyped(json, false); +} + +export function ObjectGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectGroup { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'title': json['title'], + 'order': json['order'], + }; +} + +export function ObjectGroupToJSON(value?: ObjectGroup | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'order': value.order, + }; +} diff --git a/src/lib/api/models/ObjectGroupArray.ts b/src/lib/api/models/ObjectGroupArray.ts index 807173d..fd26aff 100644 --- a/src/lib/api/models/ObjectGroupArray.ts +++ b/src/lib/api/models/ObjectGroupArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { ObjectGroupRead } from './ObjectGroupRead'; +import { + ObjectGroupReadFromJSON, + ObjectGroupReadFromJSONTyped, + ObjectGroupReadToJSON, +} from './ObjectGroupRead'; -export type ObjectGroupArray = { +/** + * + * @export + * @interface ObjectGroupArray + */ +export interface ObjectGroupArray { + /** + * + * @type {Array} + * @memberof ObjectGroupArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof ObjectGroupArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the ObjectGroupArray interface. + */ +export function instanceOfObjectGroupArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function ObjectGroupArrayFromJSON(json: any): ObjectGroupArray { + return ObjectGroupArrayFromJSONTyped(json, false); +} + +export function ObjectGroupArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectGroupArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(ObjectGroupReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function ObjectGroupArrayToJSON(value?: ObjectGroupArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(ObjectGroupReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/ObjectGroupRead.ts b/src/lib/api/models/ObjectGroupRead.ts index e8a47cd..1e28a11 100644 --- a/src/lib/api/models/ObjectGroupRead.ts +++ b/src/lib/api/models/ObjectGroupRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectGroup } from './ObjectGroup'; +import { + ObjectGroupFromJSON, + ObjectGroupFromJSONTyped, + ObjectGroupToJSON, +} from './ObjectGroup'; -export type ObjectGroupRead = { +/** + * + * @export + * @interface ObjectGroupRead + */ +export interface ObjectGroupRead { /** * Immutable value + * @type {string} + * @memberof ObjectGroupRead */ type: string; + /** + * + * @type {string} + * @memberof ObjectGroupRead + */ id: string; + /** + * + * @type {ObjectGroup} + * @memberof ObjectGroupRead + */ attributes: ObjectGroup; -}; +} + +/** + * Check if a given object implements the ObjectGroupRead interface. + */ +export function instanceOfObjectGroupRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function ObjectGroupReadFromJSON(json: any): ObjectGroupRead { + return ObjectGroupReadFromJSONTyped(json, false); +} + +export function ObjectGroupReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectGroupRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': ObjectGroupFromJSON(json['attributes']), + }; +} + +export function ObjectGroupReadToJSON(value?: ObjectGroupRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': ObjectGroupToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/ObjectGroupSingle.ts b/src/lib/api/models/ObjectGroupSingle.ts index f32966a..2295a33 100644 --- a/src/lib/api/models/ObjectGroupSingle.ts +++ b/src/lib/api/models/ObjectGroupSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectGroupRead } from './ObjectGroupRead'; +import { + ObjectGroupReadFromJSON, + ObjectGroupReadFromJSONTyped, + ObjectGroupReadToJSON, +} from './ObjectGroupRead'; -export type ObjectGroupSingle = { +/** + * + * @export + * @interface ObjectGroupSingle + */ +export interface ObjectGroupSingle { + /** + * + * @type {ObjectGroupRead} + * @memberof ObjectGroupSingle + */ data: ObjectGroupRead; -}; +} + +/** + * Check if a given object implements the ObjectGroupSingle interface. + */ +export function instanceOfObjectGroupSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function ObjectGroupSingleFromJSON(json: any): ObjectGroupSingle { + return ObjectGroupSingleFromJSONTyped(json, false); +} + +export function ObjectGroupSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectGroupSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ObjectGroupReadFromJSON(json['data']), + }; +} + +export function ObjectGroupSingleToJSON(value?: ObjectGroupSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ObjectGroupReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/ObjectGroupUpdate.ts b/src/lib/api/models/ObjectGroupUpdate.ts index 3f771a9..49bfc19 100644 --- a/src/lib/api/models/ObjectGroupUpdate.ts +++ b/src/lib/api/models/ObjectGroupUpdate.ts @@ -1,13 +1,74 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type ObjectGroupUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ObjectGroupUpdate + */ +export interface ObjectGroupUpdate { + /** + * + * @type {string} + * @memberof ObjectGroupUpdate + */ title: string; /** * Order of the object group + * @type {number} + * @memberof ObjectGroupUpdate */ order?: number; -}; +} + +/** + * Check if a given object implements the ObjectGroupUpdate interface. + */ +export function instanceOfObjectGroupUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + + return isInstance; +} + +export function ObjectGroupUpdateFromJSON(json: any): ObjectGroupUpdate { + return ObjectGroupUpdateFromJSONTyped(json, false); +} + +export function ObjectGroupUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectGroupUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': json['title'], + 'order': !exists(json, 'order') ? undefined : json['order'], + }; +} + +export function ObjectGroupUpdateToJSON(value?: ObjectGroupUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'order': value.order, + }; +} diff --git a/src/lib/api/models/ObjectLink.ts b/src/lib/api/models/ObjectLink.ts index 38edb88..b043edc 100644 --- a/src/lib/api/models/ObjectLink.ts +++ b/src/lib/api/models/ObjectLink.ts @@ -1,13 +1,80 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type ObjectLink = { - '0'?: { - rel?: string; - uri?: string; - }; +import { exists, mapValues } from '../runtime'; +import type { ObjectLink0 } from './ObjectLink0'; +import { + ObjectLink0FromJSON, + ObjectLink0FromJSONTyped, + ObjectLink0ToJSON, +} from './ObjectLink0'; + +/** + * + * @export + * @interface ObjectLink + */ +export interface ObjectLink { + /** + * + * @type {ObjectLink0} + * @memberof ObjectLink + */ + _0?: ObjectLink0; + /** + * + * @type {string} + * @memberof ObjectLink + */ self?: string; -}; +} + +/** + * Check if a given object implements the ObjectLink interface. + */ +export function instanceOfObjectLink(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function ObjectLinkFromJSON(json: any): ObjectLink { + return ObjectLinkFromJSONTyped(json, false); +} + +export function ObjectLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectLink { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + '_0': !exists(json, '0') ? undefined : ObjectLink0FromJSON(json['0']), + 'self': !exists(json, 'self') ? undefined : json['self'], + }; +} + +export function ObjectLinkToJSON(value?: ObjectLink | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + '0': ObjectLink0ToJSON(value._0), + 'self': value.self, + }; +} diff --git a/src/lib/api/models/ObjectLink0.ts b/src/lib/api/models/ObjectLink0.ts new file mode 100644 index 0000000..f277627 --- /dev/null +++ b/src/lib/api/models/ObjectLink0.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ObjectLink0 + */ +export interface ObjectLink0 { + /** + * + * @type {string} + * @memberof ObjectLink0 + */ + rel?: string; + /** + * + * @type {string} + * @memberof ObjectLink0 + */ + uri?: string; +} + +/** + * Check if a given object implements the ObjectLink0 interface. + */ +export function instanceOfObjectLink0(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function ObjectLink0FromJSON(json: any): ObjectLink0 { + return ObjectLink0FromJSONTyped(json, false); +} + +export function ObjectLink0FromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectLink0 { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'rel': !exists(json, 'rel') ? undefined : json['rel'], + 'uri': !exists(json, 'uri') ? undefined : json['uri'], + }; +} + +export function ObjectLink0ToJSON(value?: ObjectLink0 | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'rel': value.rel, + 'uri': value.uri, + }; +} + diff --git a/src/lib/api/models/PageLink.ts b/src/lib/api/models/PageLink.ts index 8969671..cf5b3bb 100644 --- a/src/lib/api/models/PageLink.ts +++ b/src/lib/api/models/PageLink.ts @@ -1,13 +1,97 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type PageLink = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface PageLink + */ +export interface PageLink { + /** + * + * @type {string} + * @memberof PageLink + */ self?: string; + /** + * + * @type {string} + * @memberof PageLink + */ first?: string; + /** + * + * @type {string} + * @memberof PageLink + */ next?: string; + /** + * + * @type {string} + * @memberof PageLink + */ prev?: string; + /** + * + * @type {string} + * @memberof PageLink + */ last?: string; -}; +} + +/** + * Check if a given object implements the PageLink interface. + */ +export function instanceOfPageLink(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PageLinkFromJSON(json: any): PageLink { + return PageLinkFromJSONTyped(json, false); +} + +export function PageLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): PageLink { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'self': !exists(json, 'self') ? undefined : json['self'], + 'first': !exists(json, 'first') ? undefined : json['first'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'prev': !exists(json, 'prev') ? undefined : json['prev'], + 'last': !exists(json, 'last') ? undefined : json['last'], + }; +} + +export function PageLinkToJSON(value?: PageLink | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'self': value.self, + 'first': value.first, + 'next': value.next, + 'prev': value.prev, + 'last': value.last, + }; +} diff --git a/src/lib/api/models/PiggyBank.ts b/src/lib/api/models/PiggyBank.ts index b239ea6..3183a94 100644 --- a/src/lib/api/models/PiggyBank.ts +++ b/src/lib/api/models/PiggyBank.ts @@ -1,54 +1,224 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type PiggyBank = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface PiggyBank + */ +export interface PiggyBank { + /** + * + * @type {Date} + * @memberof PiggyBank + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof PiggyBank + */ + readonly updatedAt?: Date; /** * The ID of the asset account this piggy bank is connected to. + * @type {string} + * @memberof PiggyBank */ - account_id: string; + accountId: string; /** * The name of the asset account this piggy bank is connected to. + * @type {string} + * @memberof PiggyBank + */ + readonly accountName?: string; + /** + * + * @type {string} + * @memberof PiggyBank */ - readonly account_name?: string; name: string; - readonly currency_id?: string; - readonly currency_code?: string; - readonly currency_symbol?: string; + /** + * + * @type {string} + * @memberof PiggyBank + */ + readonly currencyId?: string; + /** + * + * @type {string} + * @memberof PiggyBank + */ + readonly currencyCode?: string; + /** + * + * @type {string} + * @memberof PiggyBank + */ + readonly currencySymbol?: string; /** * Number of decimals supported by the currency + * @type {number} + * @memberof PiggyBank + */ + readonly currencyDecimalPlaces?: number; + /** + * + * @type {string} + * @memberof PiggyBank + */ + targetAmount: string | null; + /** + * + * @type {number} + * @memberof PiggyBank */ - readonly currency_decimal_places?: number; - target_amount: string | null; readonly percentage?: number | null; - current_amount?: string; - readonly left_to_save?: string | null; - readonly save_per_month?: string | null; + /** + * + * @type {string} + * @memberof PiggyBank + */ + currentAmount?: string; + /** + * + * @type {string} + * @memberof PiggyBank + */ + readonly leftToSave?: string | null; + /** + * + * @type {string} + * @memberof PiggyBank + */ + readonly savePerMonth?: string | null; /** * The date you started with this piggy bank. + * @type {Date} + * @memberof PiggyBank */ - start_date?: string; + startDate?: Date; /** * The date you intend to finish saving money. + * @type {Date} + * @memberof PiggyBank + */ + targetDate?: Date | null; + /** + * + * @type {number} + * @memberof PiggyBank */ - target_date?: string | null; order?: number; + /** + * + * @type {boolean} + * @memberof PiggyBank + */ readonly active?: boolean; + /** + * + * @type {string} + * @memberof PiggyBank + */ notes?: string | null; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof PiggyBank */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The order of the group. At least 1, for the highest sorting. + * @type {number} + * @memberof PiggyBank */ - readonly object_group_order?: number | null; + readonly objectGroupOrder?: number | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof PiggyBank */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the PiggyBank interface. + */ +export function instanceOfPiggyBank(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "accountId" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "targetAmount" in value; + + return isInstance; +} + +export function PiggyBankFromJSON(json: any): PiggyBank { + return PiggyBankFromJSONTyped(json, false); +} + +export function PiggyBankFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBank { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'accountId': json['account_id'], + 'accountName': !exists(json, 'account_name') ? undefined : json['account_name'], + 'name': json['name'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'targetAmount': json['target_amount'], + 'percentage': !exists(json, 'percentage') ? undefined : json['percentage'], + 'currentAmount': !exists(json, 'current_amount') ? undefined : json['current_amount'], + 'leftToSave': !exists(json, 'left_to_save') ? undefined : json['left_to_save'], + 'savePerMonth': !exists(json, 'save_per_month') ? undefined : json['save_per_month'], + 'startDate': !exists(json, 'start_date') ? undefined : (new Date(json['start_date'])), + 'targetDate': !exists(json, 'target_date') ? undefined : (json['target_date'] === null ? null : new Date(json['target_date'])), + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupOrder': !exists(json, 'object_group_order') ? undefined : json['object_group_order'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function PiggyBankToJSON(value?: PiggyBank | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'account_id': value.accountId, + 'name': value.name, + 'target_amount': value.targetAmount, + 'current_amount': value.currentAmount, + 'start_date': value.startDate === undefined ? undefined : (value.startDate.toISOString().substring(0,10)), + 'target_date': value.targetDate === undefined ? undefined : (value.targetDate === null ? null : value.targetDate.toISOString().substring(0,10)), + 'order': value.order, + 'notes': value.notes, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/PiggyBankArray.ts b/src/lib/api/models/PiggyBankArray.ts index 83923b4..d7b08e3 100644 --- a/src/lib/api/models/PiggyBankArray.ts +++ b/src/lib/api/models/PiggyBankArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { PiggyBankRead } from './PiggyBankRead'; +import { + PiggyBankReadFromJSON, + PiggyBankReadFromJSONTyped, + PiggyBankReadToJSON, +} from './PiggyBankRead'; -export type PiggyBankArray = { +/** + * + * @export + * @interface PiggyBankArray + */ +export interface PiggyBankArray { + /** + * + * @type {Array} + * @memberof PiggyBankArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof PiggyBankArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof PiggyBankArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the PiggyBankArray interface. + */ +export function instanceOfPiggyBankArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function PiggyBankArrayFromJSON(json: any): PiggyBankArray { + return PiggyBankArrayFromJSONTyped(json, false); +} + +export function PiggyBankArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(PiggyBankReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function PiggyBankArrayToJSON(value?: PiggyBankArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(PiggyBankReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/PiggyBankEvent.ts b/src/lib/api/models/PiggyBankEvent.ts index a7ae6fb..e1cddd7 100644 --- a/src/lib/api/models/PiggyBankEvent.ts +++ b/src/lib/api/models/PiggyBankEvent.ts @@ -1,23 +1,129 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type PiggyBankEvent = { - created_at?: string; - updated_at?: string; - currency_id?: string; - currency_code?: string; - currency_symbol?: string; - currency_decimal_places?: number; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface PiggyBankEvent + */ +export interface PiggyBankEvent { + /** + * + * @type {Date} + * @memberof PiggyBankEvent + */ + createdAt?: Date; + /** + * + * @type {Date} + * @memberof PiggyBankEvent + */ + updatedAt?: Date; + /** + * + * @type {string} + * @memberof PiggyBankEvent + */ + currencyId?: string; + /** + * + * @type {string} + * @memberof PiggyBankEvent + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof PiggyBankEvent + */ + currencySymbol?: string; + /** + * + * @type {number} + * @memberof PiggyBankEvent + */ + currencyDecimalPlaces?: number; + /** + * + * @type {string} + * @memberof PiggyBankEvent + */ amount?: string; /** * The journal associated with the event. + * @type {string} + * @memberof PiggyBankEvent */ - transaction_journal_id?: string; + transactionJournalId?: string; /** * The transaction group associated with the event. + * @type {string} + * @memberof PiggyBankEvent */ - transaction_group_id?: string; -}; + transactionGroupId?: string; +} + +/** + * Check if a given object implements the PiggyBankEvent interface. + */ +export function instanceOfPiggyBankEvent(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PiggyBankEventFromJSON(json: any): PiggyBankEvent { + return PiggyBankEventFromJSONTyped(json, false); +} + +export function PiggyBankEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankEvent { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'amount': !exists(json, 'amount') ? undefined : json['amount'], + 'transactionJournalId': !exists(json, 'transaction_journal_id') ? undefined : json['transaction_journal_id'], + 'transactionGroupId': !exists(json, 'transaction_group_id') ? undefined : json['transaction_group_id'], + }; +} + +export function PiggyBankEventToJSON(value?: PiggyBankEvent | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()), + 'updated_at': value.updatedAt === undefined ? undefined : (value.updatedAt.toISOString()), + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'currency_symbol': value.currencySymbol, + 'currency_decimal_places': value.currencyDecimalPlaces, + 'amount': value.amount, + 'transaction_journal_id': value.transactionJournalId, + 'transaction_group_id': value.transactionGroupId, + }; +} diff --git a/src/lib/api/models/PiggyBankEventArray.ts b/src/lib/api/models/PiggyBankEventArray.ts index 4b1fcc8..34312a1 100644 --- a/src/lib/api/models/PiggyBankEventArray.ts +++ b/src/lib/api/models/PiggyBankEventArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { PiggyBankEventRead } from './PiggyBankEventRead'; +import { + PiggyBankEventReadFromJSON, + PiggyBankEventReadFromJSONTyped, + PiggyBankEventReadToJSON, +} from './PiggyBankEventRead'; -export type PiggyBankEventArray = { +/** + * + * @export + * @interface PiggyBankEventArray + */ +export interface PiggyBankEventArray { + /** + * + * @type {Array} + * @memberof PiggyBankEventArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof PiggyBankEventArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof PiggyBankEventArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the PiggyBankEventArray interface. + */ +export function instanceOfPiggyBankEventArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function PiggyBankEventArrayFromJSON(json: any): PiggyBankEventArray { + return PiggyBankEventArrayFromJSONTyped(json, false); +} + +export function PiggyBankEventArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankEventArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(PiggyBankEventReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function PiggyBankEventArrayToJSON(value?: PiggyBankEventArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(PiggyBankEventReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/PiggyBankEventRead.ts b/src/lib/api/models/PiggyBankEventRead.ts index aac63d6..d1f9c2b 100644 --- a/src/lib/api/models/PiggyBankEventRead.ts +++ b/src/lib/api/models/PiggyBankEventRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { PiggyBankEvent } from './PiggyBankEvent'; +import { + PiggyBankEventFromJSON, + PiggyBankEventFromJSONTyped, + PiggyBankEventToJSON, +} from './PiggyBankEvent'; -export type PiggyBankEventRead = { +/** + * + * @export + * @interface PiggyBankEventRead + */ +export interface PiggyBankEventRead { /** * Immutable value + * @type {string} + * @memberof PiggyBankEventRead */ type: string; + /** + * + * @type {string} + * @memberof PiggyBankEventRead + */ id: string; + /** + * + * @type {PiggyBankEvent} + * @memberof PiggyBankEventRead + */ attributes: PiggyBankEvent; + /** + * + * @type {ObjectLink} + * @memberof PiggyBankEventRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the PiggyBankEventRead interface. + */ +export function instanceOfPiggyBankEventRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function PiggyBankEventReadFromJSON(json: any): PiggyBankEventRead { + return PiggyBankEventReadFromJSONTyped(json, false); +} + +export function PiggyBankEventReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankEventRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': PiggyBankEventFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function PiggyBankEventReadToJSON(value?: PiggyBankEventRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': PiggyBankEventToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/PiggyBankRead.ts b/src/lib/api/models/PiggyBankRead.ts index 463ed12..b4850c2 100644 --- a/src/lib/api/models/PiggyBankRead.ts +++ b/src/lib/api/models/PiggyBankRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { PiggyBank } from './PiggyBank'; +import { + PiggyBankFromJSON, + PiggyBankFromJSONTyped, + PiggyBankToJSON, +} from './PiggyBank'; -export type PiggyBankRead = { +/** + * + * @export + * @interface PiggyBankRead + */ +export interface PiggyBankRead { /** * Immutable value + * @type {string} + * @memberof PiggyBankRead */ type: string; + /** + * + * @type {string} + * @memberof PiggyBankRead + */ id: string; + /** + * + * @type {PiggyBank} + * @memberof PiggyBankRead + */ attributes: PiggyBank; + /** + * + * @type {ObjectLink} + * @memberof PiggyBankRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the PiggyBankRead interface. + */ +export function instanceOfPiggyBankRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function PiggyBankReadFromJSON(json: any): PiggyBankRead { + return PiggyBankReadFromJSONTyped(json, false); +} + +export function PiggyBankReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': PiggyBankFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function PiggyBankReadToJSON(value?: PiggyBankRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': PiggyBankToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/PiggyBankSingle.ts b/src/lib/api/models/PiggyBankSingle.ts index fba3c8f..788f3e0 100644 --- a/src/lib/api/models/PiggyBankSingle.ts +++ b/src/lib/api/models/PiggyBankSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { PiggyBankRead } from './PiggyBankRead'; +import { + PiggyBankReadFromJSON, + PiggyBankReadFromJSONTyped, + PiggyBankReadToJSON, +} from './PiggyBankRead'; -export type PiggyBankSingle = { +/** + * + * @export + * @interface PiggyBankSingle + */ +export interface PiggyBankSingle { + /** + * + * @type {PiggyBankRead} + * @memberof PiggyBankSingle + */ data: PiggyBankRead; -}; +} + +/** + * Check if a given object implements the PiggyBankSingle interface. + */ +export function instanceOfPiggyBankSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function PiggyBankSingleFromJSON(json: any): PiggyBankSingle { + return PiggyBankSingleFromJSONTyped(json, false); +} + +export function PiggyBankSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': PiggyBankReadFromJSON(json['data']), + }; +} + +export function PiggyBankSingleToJSON(value?: PiggyBankSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': PiggyBankReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/PiggyBankStore.ts b/src/lib/api/models/PiggyBankStore.ts index b9a7229..5491e2e 100644 --- a/src/lib/api/models/PiggyBankStore.ts +++ b/src/lib/api/models/PiggyBankStore.ts @@ -1,34 +1,147 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type PiggyBankStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface PiggyBankStore + */ +export interface PiggyBankStore { + /** + * + * @type {string} + * @memberof PiggyBankStore + */ name: string; /** * The ID of the asset account this piggy bank is connected to. + * @type {string} + * @memberof PiggyBankStore */ - account_id: string; - target_amount: string | null; - current_amount?: string; + accountId: string; + /** + * + * @type {string} + * @memberof PiggyBankStore + */ + targetAmount: string | null; + /** + * + * @type {string} + * @memberof PiggyBankStore + */ + currentAmount?: string; /** * The date you started with this piggy bank. + * @type {Date} + * @memberof PiggyBankStore */ - start_date?: string; + startDate?: Date; /** * The date you intend to finish saving money. + * @type {Date} + * @memberof PiggyBankStore + */ + targetDate?: Date | null; + /** + * + * @type {number} + * @memberof PiggyBankStore */ - target_date?: string | null; order?: number; + /** + * + * @type {boolean} + * @memberof PiggyBankStore + */ readonly active?: boolean; + /** + * + * @type {string} + * @memberof PiggyBankStore + */ notes?: string | null; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof PiggyBankStore */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof PiggyBankStore */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the PiggyBankStore interface. + */ +export function instanceOfPiggyBankStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "accountId" in value; + isInstance = isInstance && "targetAmount" in value; + + return isInstance; +} + +export function PiggyBankStoreFromJSON(json: any): PiggyBankStore { + return PiggyBankStoreFromJSONTyped(json, false); +} + +export function PiggyBankStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': json['name'], + 'accountId': json['account_id'], + 'targetAmount': json['target_amount'], + 'currentAmount': !exists(json, 'current_amount') ? undefined : json['current_amount'], + 'startDate': !exists(json, 'start_date') ? undefined : (new Date(json['start_date'])), + 'targetDate': !exists(json, 'target_date') ? undefined : (json['target_date'] === null ? null : new Date(json['target_date'])), + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function PiggyBankStoreToJSON(value?: PiggyBankStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'account_id': value.accountId, + 'target_amount': value.targetAmount, + 'current_amount': value.currentAmount, + 'start_date': value.startDate === undefined ? undefined : (value.startDate.toISOString().substring(0,10)), + 'target_date': value.targetDate === undefined ? undefined : (value.targetDate === null ? null : value.targetDate.toISOString().substring(0,10)), + 'order': value.order, + 'notes': value.notes, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/PiggyBankUpdate.ts b/src/lib/api/models/PiggyBankUpdate.ts index b02d940..bd883db 100644 --- a/src/lib/api/models/PiggyBankUpdate.ts +++ b/src/lib/api/models/PiggyBankUpdate.ts @@ -1,36 +1,158 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type PiggyBankUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface PiggyBankUpdate + */ +export interface PiggyBankUpdate { + /** + * + * @type {string} + * @memberof PiggyBankUpdate + */ name?: string; /** * The ID of the asset account this piggy bank is connected to. + * @type {string} + * @memberof PiggyBankUpdate + */ + accountId?: string; + /** + * + * @type {string} + * @memberof PiggyBankUpdate + */ + readonly currencyId?: string; + /** + * + * @type {string} + * @memberof PiggyBankUpdate */ - account_id?: string; - readonly currency_id?: string; - readonly currency_code?: string; - target_amount?: string | null; - current_amount?: string; + readonly currencyCode?: string; + /** + * + * @type {string} + * @memberof PiggyBankUpdate + */ + targetAmount?: string | null; + /** + * + * @type {string} + * @memberof PiggyBankUpdate + */ + currentAmount?: string; /** * The date you started with this piggy bank. + * @type {Date} + * @memberof PiggyBankUpdate */ - start_date?: string; + startDate?: Date; /** * The date you intend to finish saving money. + * @type {Date} + * @memberof PiggyBankUpdate + */ + targetDate?: Date | null; + /** + * + * @type {number} + * @memberof PiggyBankUpdate */ - target_date?: string | null; order?: number; + /** + * + * @type {boolean} + * @memberof PiggyBankUpdate + */ readonly active?: boolean; + /** + * + * @type {string} + * @memberof PiggyBankUpdate + */ notes?: string | null; /** * The group ID of the group this object is part of. NULL if no group. + * @type {string} + * @memberof PiggyBankUpdate */ - object_group_id?: string | null; + objectGroupId?: string | null; /** * The name of the group. NULL if no group. + * @type {string} + * @memberof PiggyBankUpdate */ - object_group_title?: string | null; -}; + objectGroupTitle?: string | null; +} + +/** + * Check if a given object implements the PiggyBankUpdate interface. + */ +export function instanceOfPiggyBankUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PiggyBankUpdateFromJSON(json: any): PiggyBankUpdate { + return PiggyBankUpdateFromJSONTyped(json, false); +} + +export function PiggyBankUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PiggyBankUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name': !exists(json, 'name') ? undefined : json['name'], + 'accountId': !exists(json, 'account_id') ? undefined : json['account_id'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'targetAmount': !exists(json, 'target_amount') ? undefined : json['target_amount'], + 'currentAmount': !exists(json, 'current_amount') ? undefined : json['current_amount'], + 'startDate': !exists(json, 'start_date') ? undefined : (new Date(json['start_date'])), + 'targetDate': !exists(json, 'target_date') ? undefined : (json['target_date'] === null ? null : new Date(json['target_date'])), + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'objectGroupId': !exists(json, 'object_group_id') ? undefined : json['object_group_id'], + 'objectGroupTitle': !exists(json, 'object_group_title') ? undefined : json['object_group_title'], + }; +} + +export function PiggyBankUpdateToJSON(value?: PiggyBankUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'account_id': value.accountId, + 'target_amount': value.targetAmount, + 'current_amount': value.currentAmount, + 'start_date': value.startDate === undefined ? undefined : (value.startDate.toISOString().substring(0,10)), + 'target_date': value.targetDate === undefined ? undefined : (value.targetDate === null ? null : value.targetDate.toISOString().substring(0,10)), + 'order': value.order, + 'notes': value.notes, + 'object_group_id': value.objectGroupId, + 'object_group_title': value.objectGroupTitle, + }; +} diff --git a/src/lib/api/models/PolymorphicProperty.ts b/src/lib/api/models/PolymorphicProperty.ts index a1f8782..39ded3d 100644 --- a/src/lib/api/models/PolymorphicProperty.ts +++ b/src/lib/api/models/PolymorphicProperty.ts @@ -1,9 +1,64 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2022-04-04T03:54:41+00:00 + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * This file requires manual edits due to a bug in openapi-generator. + * https://github.com/OpenAPITools/openapi-generator/issues/5202 + */ -import type { StringArrayItem } from './StringArrayItem'; +/** + * @type PolymorphicProperty + * + * @export + */ +export type PolymorphicProperty = Array | boolean | object | string; -export type PolymorphicProperty = (boolean | string | Record | Array); +export function PolymorphicPropertyFromJSON(json: any): PolymorphicProperty { + return PolymorphicPropertyFromJSONTyped(json, false); +} +export function PolymorphicPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PolymorphicProperty { + if ((json === undefined) || (json === null)) { + return json; + } + + try { + return JSON.parse(json); + } catch { + return json; + } +} + +export function PolymorphicPropertyToJSON(value?: PolymorphicProperty | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { ...stringArrayToJSON(value), ...booleanToJSON(value), ...objectToJSON(value), ...stringToJSON(value) }; +} + +function booleanToJSON(v: PolymorphicProperty | null): Array { + return [`${v}`]; +} + +function objectToJSON(v: PolymorphicProperty | null): Array { + return [`${JSON.stringify(v)}`]; +} + +function stringToJSON(v: PolymorphicProperty | null): Array { + return [`"${v}"`]; +} + +function stringArrayToJSON(v: PolymorphicProperty | null): Array { + return v as any as Array; +} diff --git a/src/lib/api/models/Preference.ts b/src/lib/api/models/Preference.ts index 03b442e..a3d2156 100644 --- a/src/lib/api/models/Preference.ts +++ b/src/lib/api/models/Preference.ts @@ -1,14 +1,96 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { PolymorphicProperty } from './PolymorphicProperty'; +import { + PolymorphicPropertyFromJSON, + PolymorphicPropertyFromJSONTyped, + PolymorphicPropertyToJSON, +} from './PolymorphicProperty'; -export type Preference = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Preference + */ +export interface Preference { + /** + * + * @type {Date} + * @memberof Preference + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Preference + */ + readonly updatedAt?: Date; + /** + * + * @type {string} + * @memberof Preference + */ name: string; + /** + * + * @type {PolymorphicProperty} + * @memberof Preference + */ data: PolymorphicProperty; -}; +} + +/** + * Check if a given object implements the Preference interface. + */ +export function instanceOfPreference(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function PreferenceFromJSON(json: any): Preference { + return PreferenceFromJSONTyped(json, false); +} + +export function PreferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Preference { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'name': json['name'], + 'data': PolymorphicPropertyFromJSON(json['data']), + }; +} + +export function PreferenceToJSON(value?: Preference | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'data': PolymorphicPropertyToJSON(value.data), + }; +} diff --git a/src/lib/api/models/PreferenceArray.ts b/src/lib/api/models/PreferenceArray.ts index 988811e..4212b68 100644 --- a/src/lib/api/models/PreferenceArray.ts +++ b/src/lib/api/models/PreferenceArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { PreferenceRead } from './PreferenceRead'; +import { + PreferenceReadFromJSON, + PreferenceReadFromJSONTyped, + PreferenceReadToJSON, +} from './PreferenceRead'; -export type PreferenceArray = { +/** + * + * @export + * @interface PreferenceArray + */ +export interface PreferenceArray { + /** + * + * @type {Array} + * @memberof PreferenceArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof PreferenceArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof PreferenceArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the PreferenceArray interface. + */ +export function instanceOfPreferenceArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function PreferenceArrayFromJSON(json: any): PreferenceArray { + return PreferenceArrayFromJSONTyped(json, false); +} + +export function PreferenceArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): PreferenceArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(PreferenceReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function PreferenceArrayToJSON(value?: PreferenceArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(PreferenceReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/PreferenceRead.ts b/src/lib/api/models/PreferenceRead.ts index 00e893c..ddfcfaf 100644 --- a/src/lib/api/models/PreferenceRead.ts +++ b/src/lib/api/models/PreferenceRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Preference } from './Preference'; +import { + PreferenceFromJSON, + PreferenceFromJSONTyped, + PreferenceToJSON, +} from './Preference'; -export type PreferenceRead = { +/** + * + * @export + * @interface PreferenceRead + */ +export interface PreferenceRead { /** * Immutable value + * @type {string} + * @memberof PreferenceRead */ type: string; + /** + * + * @type {string} + * @memberof PreferenceRead + */ id: string; + /** + * + * @type {Preference} + * @memberof PreferenceRead + */ attributes: Preference; -}; +} + +/** + * Check if a given object implements the PreferenceRead interface. + */ +export function instanceOfPreferenceRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function PreferenceReadFromJSON(json: any): PreferenceRead { + return PreferenceReadFromJSONTyped(json, false); +} + +export function PreferenceReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): PreferenceRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': PreferenceFromJSON(json['attributes']), + }; +} + +export function PreferenceReadToJSON(value?: PreferenceRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': PreferenceToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/PreferenceSingle.ts b/src/lib/api/models/PreferenceSingle.ts index 8deeb96..1c0ac78 100644 --- a/src/lib/api/models/PreferenceSingle.ts +++ b/src/lib/api/models/PreferenceSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { PreferenceRead } from './PreferenceRead'; +import { + PreferenceReadFromJSON, + PreferenceReadFromJSONTyped, + PreferenceReadToJSON, +} from './PreferenceRead'; -export type PreferenceSingle = { +/** + * + * @export + * @interface PreferenceSingle + */ +export interface PreferenceSingle { + /** + * + * @type {PreferenceRead} + * @memberof PreferenceSingle + */ data: PreferenceRead; -}; +} + +/** + * Check if a given object implements the PreferenceSingle interface. + */ +export function instanceOfPreferenceSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function PreferenceSingleFromJSON(json: any): PreferenceSingle { + return PreferenceSingleFromJSONTyped(json, false); +} + +export function PreferenceSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): PreferenceSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': PreferenceReadFromJSON(json['data']), + }; +} + +export function PreferenceSingleToJSON(value?: PreferenceSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': PreferenceReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/PreferenceUpdate.ts b/src/lib/api/models/PreferenceUpdate.ts index fd7215e..646bd79 100644 --- a/src/lib/api/models/PreferenceUpdate.ts +++ b/src/lib/api/models/PreferenceUpdate.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { PolymorphicProperty } from './PolymorphicProperty'; +import { + PolymorphicPropertyFromJSON, + PolymorphicPropertyFromJSONTyped, + PolymorphicPropertyToJSON, +} from './PolymorphicProperty'; -export type PreferenceUpdate = { +/** + * + * @export + * @interface PreferenceUpdate + */ +export interface PreferenceUpdate { + /** + * + * @type {PolymorphicProperty} + * @memberof PreferenceUpdate + */ data: PolymorphicProperty; -}; +} + +/** + * Check if a given object implements the PreferenceUpdate interface. + */ +export function instanceOfPreferenceUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function PreferenceUpdateFromJSON(json: any): PreferenceUpdate { + return PreferenceUpdateFromJSONTyped(json, false); +} + +export function PreferenceUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PreferenceUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': PolymorphicPropertyFromJSON(json['data']), + }; +} + +export function PreferenceUpdateToJSON(value?: PreferenceUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': PolymorphicPropertyToJSON(value.data), + }; +} diff --git a/src/lib/api/models/Recurrence.ts b/src/lib/api/models/Recurrence.ts index 3725cf8..b9f66f5 100644 --- a/src/lib/api/models/Recurrence.ts +++ b/src/lib/api/models/Recurrence.ts @@ -1,47 +1,185 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRepetition } from './RecurrenceRepetition'; +import { + RecurrenceRepetitionFromJSON, + RecurrenceRepetitionFromJSONTyped, + RecurrenceRepetitionToJSON, +} from './RecurrenceRepetition'; import type { RecurrenceTransaction } from './RecurrenceTransaction'; +import { + RecurrenceTransactionFromJSON, + RecurrenceTransactionFromJSONTyped, + RecurrenceTransactionToJSON, +} from './RecurrenceTransaction'; import type { RecurrenceTransactionType } from './RecurrenceTransactionType'; +import { + RecurrenceTransactionTypeFromJSON, + RecurrenceTransactionTypeFromJSONTyped, + RecurrenceTransactionTypeToJSON, +} from './RecurrenceTransactionType'; -export type Recurrence = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Recurrence + */ +export interface Recurrence { + /** + * + * @type {Date} + * @memberof Recurrence + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Recurrence + */ + readonly updatedAt?: Date; + /** + * + * @type {RecurrenceTransactionType} + * @memberof Recurrence + */ type?: RecurrenceTransactionType; + /** + * + * @type {string} + * @memberof Recurrence + */ title?: string; /** * Not to be confused with the description of the actual transaction(s) being created. + * @type {string} + * @memberof Recurrence */ description?: string; /** * First time the recurring transaction will fire. Must be after today. + * @type {Date} + * @memberof Recurrence */ - first_date?: string; + firstDate?: Date; /** * Last time the recurring transaction has fired. + * @type {Date} + * @memberof Recurrence */ - readonly latest_date?: string | null; + readonly latestDate?: Date | null; /** * Date until the recurring transaction can fire. Use either this field or repetitions. + * @type {Date} + * @memberof Recurrence */ - repeat_until?: string | null; + repeatUntil?: Date | null; /** * Max number of created transactions. Use either this field or repeat_until. + * @type {number} + * @memberof Recurrence */ - nr_of_repetitions?: number | null; + nrOfRepetitions?: number | null; /** * Whether or not to fire the rules after the creation of a transaction. + * @type {boolean} + * @memberof Recurrence */ - apply_rules?: boolean; + applyRules?: boolean; /** * If the recurrence is even active. + * @type {boolean} + * @memberof Recurrence */ active?: boolean; + /** + * + * @type {string} + * @memberof Recurrence + */ notes?: string | null; + /** + * + * @type {Array} + * @memberof Recurrence + */ repetitions?: Array; + /** + * + * @type {Array} + * @memberof Recurrence + */ transactions?: Array; -}; +} + +/** + * Check if a given object implements the Recurrence interface. + */ +export function instanceOfRecurrence(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RecurrenceFromJSON(json: any): Recurrence { + return RecurrenceFromJSONTyped(json, false); +} + +export function RecurrenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Recurrence { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'type': !exists(json, 'type') ? undefined : RecurrenceTransactionTypeFromJSON(json['type']), + 'title': !exists(json, 'title') ? undefined : json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'firstDate': !exists(json, 'first_date') ? undefined : (new Date(json['first_date'])), + 'latestDate': !exists(json, 'latest_date') ? undefined : (json['latest_date'] === null ? null : new Date(json['latest_date'])), + 'repeatUntil': !exists(json, 'repeat_until') ? undefined : (json['repeat_until'] === null ? null : new Date(json['repeat_until'])), + 'nrOfRepetitions': !exists(json, 'nr_of_repetitions') ? undefined : json['nr_of_repetitions'], + 'applyRules': !exists(json, 'apply_rules') ? undefined : json['apply_rules'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'repetitions': !exists(json, 'repetitions') ? undefined : ((json['repetitions'] as Array).map(RecurrenceRepetitionFromJSON)), + 'transactions': !exists(json, 'transactions') ? undefined : ((json['transactions'] as Array).map(RecurrenceTransactionFromJSON)), + }; +} + +export function RecurrenceToJSON(value?: Recurrence | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RecurrenceTransactionTypeToJSON(value.type), + 'title': value.title, + 'description': value.description, + 'first_date': value.firstDate === undefined ? undefined : (value.firstDate.toISOString().substring(0,10)), + 'repeat_until': value.repeatUntil === undefined ? undefined : (value.repeatUntil === null ? null : value.repeatUntil.toISOString().substring(0,10)), + 'nr_of_repetitions': value.nrOfRepetitions, + 'apply_rules': value.applyRules, + 'active': value.active, + 'notes': value.notes, + 'repetitions': value.repetitions === undefined ? undefined : ((value.repetitions as Array).map(RecurrenceRepetitionToJSON)), + 'transactions': value.transactions === undefined ? undefined : ((value.transactions as Array).map(RecurrenceTransactionToJSON)), + }; +} diff --git a/src/lib/api/models/RecurrenceArray.ts b/src/lib/api/models/RecurrenceArray.ts index cd75d59..b14d4a0 100644 --- a/src/lib/api/models/RecurrenceArray.ts +++ b/src/lib/api/models/RecurrenceArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { RecurrenceRead } from './RecurrenceRead'; +import { + RecurrenceReadFromJSON, + RecurrenceReadFromJSONTyped, + RecurrenceReadToJSON, +} from './RecurrenceRead'; -export type RecurrenceArray = { +/** + * + * @export + * @interface RecurrenceArray + */ +export interface RecurrenceArray { + /** + * + * @type {Array} + * @memberof RecurrenceArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof RecurrenceArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof RecurrenceArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the RecurrenceArray interface. + */ +export function instanceOfRecurrenceArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function RecurrenceArrayFromJSON(json: any): RecurrenceArray { + return RecurrenceArrayFromJSONTyped(json, false); +} + +export function RecurrenceArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(RecurrenceReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function RecurrenceArrayToJSON(value?: RecurrenceArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(RecurrenceReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/RecurrenceRead.ts b/src/lib/api/models/RecurrenceRead.ts index 48253c0..16e1f73 100644 --- a/src/lib/api/models/RecurrenceRead.ts +++ b/src/lib/api/models/RecurrenceRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { Recurrence } from './Recurrence'; +import { + RecurrenceFromJSON, + RecurrenceFromJSONTyped, + RecurrenceToJSON, +} from './Recurrence'; -export type RecurrenceRead = { +/** + * + * @export + * @interface RecurrenceRead + */ +export interface RecurrenceRead { /** * Immutable value + * @type {string} + * @memberof RecurrenceRead */ type: string; + /** + * + * @type {string} + * @memberof RecurrenceRead + */ id: string; + /** + * + * @type {Recurrence} + * @memberof RecurrenceRead + */ attributes: Recurrence; + /** + * + * @type {ObjectLink} + * @memberof RecurrenceRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the RecurrenceRead interface. + */ +export function instanceOfRecurrenceRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function RecurrenceReadFromJSON(json: any): RecurrenceRead { + return RecurrenceReadFromJSONTyped(json, false); +} + +export function RecurrenceReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': RecurrenceFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function RecurrenceReadToJSON(value?: RecurrenceRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': RecurrenceToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/RecurrenceRepetition.ts b/src/lib/api/models/RecurrenceRepetition.ts index 42264c8..cd16aa4 100644 --- a/src/lib/api/models/RecurrenceRepetition.ts +++ b/src/lib/api/models/RecurrenceRepetition.ts @@ -1,14 +1,54 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRepetitionType } from './RecurrenceRepetitionType'; +import { + RecurrenceRepetitionTypeFromJSON, + RecurrenceRepetitionTypeFromJSONTyped, + RecurrenceRepetitionTypeToJSON, +} from './RecurrenceRepetitionType'; -export type RecurrenceRepetition = { +/** + * + * @export + * @interface RecurrenceRepetition + */ +export interface RecurrenceRepetition { + /** + * + * @type {string} + * @memberof RecurrenceRepetition + */ readonly id?: string; - readonly created_at?: string; - readonly updated_at?: string; + /** + * + * @type {Date} + * @memberof RecurrenceRepetition + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof RecurrenceRepetition + */ + readonly updatedAt?: Date; + /** + * + * @type {RecurrenceRepetitionType} + * @memberof RecurrenceRepetition + */ type: RecurrenceRepetitionType; /** * Information that defined the type of repetition. @@ -17,11 +57,14 @@ export type RecurrenceRepetition = { * - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month * - For 'monthly' it is the day of the month (1 - 31) * - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. - * + * @type {string} + * @memberof RecurrenceRepetition */ moment: string; /** * How many occurrences to skip. 0 means skip nothing. 1 means every other. + * @type {number} + * @memberof RecurrenceRepetition */ skip?: number; /** @@ -30,16 +73,70 @@ export type RecurrenceRepetition = { * 2. Create no transaction. * 3. Skip to the previous Friday. * 4. Skip to the next Monday. - * + * @type {number} + * @memberof RecurrenceRepetition */ weekend?: number; /** * Auto-generated repetition description. + * @type {string} + * @memberof RecurrenceRepetition */ readonly description?: string; /** * Array of future dates when the repetition will apply to. Auto generated. + * @type {Array} + * @memberof RecurrenceRepetition */ - readonly occurrences?: Array; -}; + readonly occurrences?: Array; +} + +/** + * Check if a given object implements the RecurrenceRepetition interface. + */ +export function instanceOfRecurrenceRepetition(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "moment" in value; + + return isInstance; +} + +export function RecurrenceRepetitionFromJSON(json: any): RecurrenceRepetition { + return RecurrenceRepetitionFromJSONTyped(json, false); +} + +export function RecurrenceRepetitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceRepetition { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'type': RecurrenceRepetitionTypeFromJSON(json['type']), + 'moment': json['moment'], + 'skip': !exists(json, 'skip') ? undefined : json['skip'], + 'weekend': !exists(json, 'weekend') ? undefined : json['weekend'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'occurrences': !exists(json, 'occurrences') ? undefined : json['occurrences'], + }; +} + +export function RecurrenceRepetitionToJSON(value?: RecurrenceRepetition | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RecurrenceRepetitionTypeToJSON(value.type), + 'moment': value.moment, + 'skip': value.skip, + 'weekend': value.weekend, + }; +} diff --git a/src/lib/api/models/RecurrenceRepetitionStore.ts b/src/lib/api/models/RecurrenceRepetitionStore.ts index 2db8194..932b950 100644 --- a/src/lib/api/models/RecurrenceRepetitionStore.ts +++ b/src/lib/api/models/RecurrenceRepetitionStore.ts @@ -1,11 +1,36 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRepetitionType } from './RecurrenceRepetitionType'; +import { + RecurrenceRepetitionTypeFromJSON, + RecurrenceRepetitionTypeFromJSONTyped, + RecurrenceRepetitionTypeToJSON, +} from './RecurrenceRepetitionType'; -export type RecurrenceRepetitionStore = { +/** + * + * @export + * @interface RecurrenceRepetitionStore + */ +export interface RecurrenceRepetitionStore { + /** + * + * @type {RecurrenceRepetitionType} + * @memberof RecurrenceRepetitionStore + */ type: RecurrenceRepetitionType; /** * Information that defined the type of repetition. @@ -14,11 +39,14 @@ export type RecurrenceRepetitionStore = { * - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month * - For 'monthly' it is the day of the month (1 - 31) * - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. - * + * @type {string} + * @memberof RecurrenceRepetitionStore */ moment: string; /** * How many occurrences to skip. 0 means skip nothing. 1 means every other. + * @type {number} + * @memberof RecurrenceRepetitionStore */ skip?: number; /** @@ -27,8 +55,53 @@ export type RecurrenceRepetitionStore = { * 2. Create no transaction. * 3. Skip to the previous Friday. * 4. Skip to the next Monday. - * + * @type {number} + * @memberof RecurrenceRepetitionStore */ weekend?: number; -}; +} + +/** + * Check if a given object implements the RecurrenceRepetitionStore interface. + */ +export function instanceOfRecurrenceRepetitionStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "moment" in value; + + return isInstance; +} + +export function RecurrenceRepetitionStoreFromJSON(json: any): RecurrenceRepetitionStore { + return RecurrenceRepetitionStoreFromJSONTyped(json, false); +} + +export function RecurrenceRepetitionStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceRepetitionStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': RecurrenceRepetitionTypeFromJSON(json['type']), + 'moment': json['moment'], + 'skip': !exists(json, 'skip') ? undefined : json['skip'], + 'weekend': !exists(json, 'weekend') ? undefined : json['weekend'], + }; +} + +export function RecurrenceRepetitionStoreToJSON(value?: RecurrenceRepetitionStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RecurrenceRepetitionTypeToJSON(value.type), + 'moment': value.moment, + 'skip': value.skip, + 'weekend': value.weekend, + }; +} diff --git a/src/lib/api/models/RecurrenceRepetitionType.ts b/src/lib/api/models/RecurrenceRepetitionType.ts index cfbfb11..260cab0 100644 --- a/src/lib/api/models/RecurrenceRepetitionType.ts +++ b/src/lib/api/models/RecurrenceRepetitionType.ts @@ -1,15 +1,41 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * The type of the repetition. ndom means: the n-th weekday of the month, where you can also specify which day of the week. + * @export */ -export enum RecurrenceRepetitionType { - DAILY = 'daily', - WEEKLY = 'weekly', - NDOM = 'ndom', - MONTHLY = 'monthly', - YEARLY = 'yearly', +export const RecurrenceRepetitionType = { + Daily: 'daily', + Weekly: 'weekly', + Ndom: 'ndom', + Monthly: 'monthly', + Yearly: 'yearly' +} as const; +export type RecurrenceRepetitionType = typeof RecurrenceRepetitionType[keyof typeof RecurrenceRepetitionType]; + + +export function RecurrenceRepetitionTypeFromJSON(json: any): RecurrenceRepetitionType { + return RecurrenceRepetitionTypeFromJSONTyped(json, false); } + +export function RecurrenceRepetitionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceRepetitionType { + return json as RecurrenceRepetitionType; +} + +export function RecurrenceRepetitionTypeToJSON(value?: RecurrenceRepetitionType | null): any { + return value as any; +} + diff --git a/src/lib/api/models/RecurrenceRepetitionUpdate.ts b/src/lib/api/models/RecurrenceRepetitionUpdate.ts index 88df5fe..037cae4 100644 --- a/src/lib/api/models/RecurrenceRepetitionUpdate.ts +++ b/src/lib/api/models/RecurrenceRepetitionUpdate.ts @@ -1,11 +1,36 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRepetitionType } from './RecurrenceRepetitionType'; +import { + RecurrenceRepetitionTypeFromJSON, + RecurrenceRepetitionTypeFromJSONTyped, + RecurrenceRepetitionTypeToJSON, +} from './RecurrenceRepetitionType'; -export type RecurrenceRepetitionUpdate = { +/** + * + * @export + * @interface RecurrenceRepetitionUpdate + */ +export interface RecurrenceRepetitionUpdate { + /** + * + * @type {RecurrenceRepetitionType} + * @memberof RecurrenceRepetitionUpdate + */ type?: RecurrenceRepetitionType; /** * Information that defined the type of repetition. @@ -14,11 +39,14 @@ export type RecurrenceRepetitionUpdate = { * - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month * - For 'monthly' it is the day of the month (1 - 31) * - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. - * + * @type {string} + * @memberof RecurrenceRepetitionUpdate */ moment?: string; /** * How many occurrences to skip. 0 means skip nothing. 1 means every other. + * @type {number} + * @memberof RecurrenceRepetitionUpdate */ skip?: number; /** @@ -27,8 +55,51 @@ export type RecurrenceRepetitionUpdate = { * 2. Create no transaction. * 3. Skip to the previous Friday. * 4. Skip to the next Monday. - * + * @type {number} + * @memberof RecurrenceRepetitionUpdate */ weekend?: number; -}; +} + +/** + * Check if a given object implements the RecurrenceRepetitionUpdate interface. + */ +export function instanceOfRecurrenceRepetitionUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RecurrenceRepetitionUpdateFromJSON(json: any): RecurrenceRepetitionUpdate { + return RecurrenceRepetitionUpdateFromJSONTyped(json, false); +} + +export function RecurrenceRepetitionUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceRepetitionUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': !exists(json, 'type') ? undefined : RecurrenceRepetitionTypeFromJSON(json['type']), + 'moment': !exists(json, 'moment') ? undefined : json['moment'], + 'skip': !exists(json, 'skip') ? undefined : json['skip'], + 'weekend': !exists(json, 'weekend') ? undefined : json['weekend'], + }; +} + +export function RecurrenceRepetitionUpdateToJSON(value?: RecurrenceRepetitionUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RecurrenceRepetitionTypeToJSON(value.type), + 'moment': value.moment, + 'skip': value.skip, + 'weekend': value.weekend, + }; +} diff --git a/src/lib/api/models/RecurrenceSingle.ts b/src/lib/api/models/RecurrenceSingle.ts index a9c8e8f..ea41a9c 100644 --- a/src/lib/api/models/RecurrenceSingle.ts +++ b/src/lib/api/models/RecurrenceSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRead } from './RecurrenceRead'; +import { + RecurrenceReadFromJSON, + RecurrenceReadFromJSONTyped, + RecurrenceReadToJSON, +} from './RecurrenceRead'; -export type RecurrenceSingle = { +/** + * + * @export + * @interface RecurrenceSingle + */ +export interface RecurrenceSingle { + /** + * + * @type {RecurrenceRead} + * @memberof RecurrenceSingle + */ data: RecurrenceRead; -}; +} + +/** + * Check if a given object implements the RecurrenceSingle interface. + */ +export function instanceOfRecurrenceSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function RecurrenceSingleFromJSON(json: any): RecurrenceSingle { + return RecurrenceSingleFromJSONTyped(json, false); +} + +export function RecurrenceSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': RecurrenceReadFromJSON(json['data']), + }; +} + +export function RecurrenceSingleToJSON(value?: RecurrenceSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': RecurrenceReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/RecurrenceStore.ts b/src/lib/api/models/RecurrenceStore.ts index 15b9dfc..3ad7624 100644 --- a/src/lib/api/models/RecurrenceStore.ts +++ b/src/lib/api/models/RecurrenceStore.ts @@ -1,41 +1,170 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRepetitionStore } from './RecurrenceRepetitionStore'; +import { + RecurrenceRepetitionStoreFromJSON, + RecurrenceRepetitionStoreFromJSONTyped, + RecurrenceRepetitionStoreToJSON, +} from './RecurrenceRepetitionStore'; import type { RecurrenceTransactionStore } from './RecurrenceTransactionStore'; +import { + RecurrenceTransactionStoreFromJSON, + RecurrenceTransactionStoreFromJSONTyped, + RecurrenceTransactionStoreToJSON, +} from './RecurrenceTransactionStore'; import type { RecurrenceTransactionType } from './RecurrenceTransactionType'; +import { + RecurrenceTransactionTypeFromJSON, + RecurrenceTransactionTypeFromJSONTyped, + RecurrenceTransactionTypeToJSON, +} from './RecurrenceTransactionType'; -export type RecurrenceStore = { +/** + * + * @export + * @interface RecurrenceStore + */ +export interface RecurrenceStore { + /** + * + * @type {RecurrenceTransactionType} + * @memberof RecurrenceStore + */ type: RecurrenceTransactionType; + /** + * + * @type {string} + * @memberof RecurrenceStore + */ title: string; /** * Not to be confused with the description of the actual transaction(s) being created. + * @type {string} + * @memberof RecurrenceStore */ description?: string; /** * First time the recurring transaction will fire. Must be after today. + * @type {Date} + * @memberof RecurrenceStore */ - first_date: string; + firstDate: Date; /** * Date until the recurring transaction can fire. Use either this field or repetitions. + * @type {Date} + * @memberof RecurrenceStore */ - repeat_until: string | null; + repeatUntil: Date | null; /** * Max number of created transactions. Use either this field or repeat_until. + * @type {number} + * @memberof RecurrenceStore */ - nr_of_repetitions?: number | null; + nrOfRepetitions?: number | null; /** * Whether or not to fire the rules after the creation of a transaction. + * @type {boolean} + * @memberof RecurrenceStore */ - apply_rules?: boolean; + applyRules?: boolean; /** * If the recurrence is even active. + * @type {boolean} + * @memberof RecurrenceStore */ active?: boolean; + /** + * + * @type {string} + * @memberof RecurrenceStore + */ notes?: string | null; + /** + * + * @type {Array} + * @memberof RecurrenceStore + */ repetitions: Array; + /** + * + * @type {Array} + * @memberof RecurrenceStore + */ transactions: Array; -}; +} + +/** + * Check if a given object implements the RecurrenceStore interface. + */ +export function instanceOfRecurrenceStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "firstDate" in value; + isInstance = isInstance && "repeatUntil" in value; + isInstance = isInstance && "repetitions" in value; + isInstance = isInstance && "transactions" in value; + + return isInstance; +} + +export function RecurrenceStoreFromJSON(json: any): RecurrenceStore { + return RecurrenceStoreFromJSONTyped(json, false); +} + +export function RecurrenceStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': RecurrenceTransactionTypeFromJSON(json['type']), + 'title': json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'firstDate': (new Date(json['first_date'])), + 'repeatUntil': (json['repeat_until'] === null ? null : new Date(json['repeat_until'])), + 'nrOfRepetitions': !exists(json, 'nr_of_repetitions') ? undefined : json['nr_of_repetitions'], + 'applyRules': !exists(json, 'apply_rules') ? undefined : json['apply_rules'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'repetitions': ((json['repetitions'] as Array).map(RecurrenceRepetitionStoreFromJSON)), + 'transactions': ((json['transactions'] as Array).map(RecurrenceTransactionStoreFromJSON)), + }; +} + +export function RecurrenceStoreToJSON(value?: RecurrenceStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RecurrenceTransactionTypeToJSON(value.type), + 'title': value.title, + 'description': value.description, + 'first_date': (value.firstDate.toISOString().substring(0,10)), + 'repeat_until': (value.repeatUntil === null ? null : value.repeatUntil.toISOString().substring(0,10)), + 'nr_of_repetitions': value.nrOfRepetitions, + 'apply_rules': value.applyRules, + 'active': value.active, + 'notes': value.notes, + 'repetitions': ((value.repetitions as Array).map(RecurrenceRepetitionStoreToJSON)), + 'transactions': ((value.transactions as Array).map(RecurrenceTransactionStoreToJSON)), + }; +} diff --git a/src/lib/api/models/RecurrenceTransaction.ts b/src/lib/api/models/RecurrenceTransaction.ts index c6bd722..f8eb485 100644 --- a/src/lib/api/models/RecurrenceTransaction.ts +++ b/src/lib/api/models/RecurrenceTransaction.ts @@ -1,102 +1,291 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountTypeProperty } from './AccountTypeProperty'; +import { + AccountTypePropertyFromJSON, + AccountTypePropertyFromJSONTyped, + AccountTypePropertyToJSON, +} from './AccountTypeProperty'; -export type RecurrenceTransaction = { +/** + * + * @export + * @interface RecurrenceTransaction + */ +export interface RecurrenceTransaction { + /** + * + * @type {string} + * @memberof RecurrenceTransaction + */ id?: string; + /** + * + * @type {string} + * @memberof RecurrenceTransaction + */ description: string; /** * Amount of the transaction. + * @type {string} + * @memberof RecurrenceTransaction */ amount: string; /** * Foreign amount of the transaction. + * @type {string} + * @memberof RecurrenceTransaction */ - foreign_amount?: string | null; + foreignAmount?: string | null; /** * Submit either a currency_id or a currency_code. + * @type {string} + * @memberof RecurrenceTransaction */ - currency_id?: string; + currencyId?: string; /** * Submit either a currency_id or a currency_code. + * @type {string} + * @memberof RecurrenceTransaction + */ + currencyCode?: string; + /** + * + * @type {string} + * @memberof RecurrenceTransaction */ - currency_code?: string; - readonly currency_symbol?: string; + readonly currencySymbol?: string; /** * Number of decimals in the currency + * @type {number} + * @memberof RecurrenceTransaction */ - readonly currency_decimal_places?: number; + readonly currencyDecimalPlaces?: number; /** * Submit either a foreign_currency_id or a foreign_currency_code, or neither. + * @type {string} + * @memberof RecurrenceTransaction */ - foreign_currency_id?: string | null; + foreignCurrencyId?: string | null; /** * Submit either a foreign_currency_id or a foreign_currency_code, or neither. + * @type {string} + * @memberof RecurrenceTransaction */ - foreign_currency_code?: string | null; - readonly foreign_currency_symbol?: string | null; + foreignCurrencyCode?: string | null; + /** + * + * @type {string} + * @memberof RecurrenceTransaction + */ + readonly foreignCurrencySymbol?: string | null; /** * Number of decimals in the currency + * @type {number} + * @memberof RecurrenceTransaction */ - readonly foreign_currency_decimal_places?: number | null; + readonly foreignCurrencyDecimalPlaces?: number | null; /** * The budget ID for this transaction. + * @type {string} + * @memberof RecurrenceTransaction */ - budget_id?: string; + budgetId?: string; /** * The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored. + * @type {string} + * @memberof RecurrenceTransaction */ - readonly budget_name?: string | null; + readonly budgetName?: string | null; /** * Category ID for this transaction. + * @type {string} + * @memberof RecurrenceTransaction */ - category_id?: string; + categoryId?: string; /** * Category name for this transaction. + * @type {string} + * @memberof RecurrenceTransaction */ - category_name?: string; + categoryName?: string; /** * ID of the source account. Submit either this or source_name. + * @type {string} + * @memberof RecurrenceTransaction */ - source_id?: string; + sourceId?: string; /** * Name of the source account. Submit either this or source_id. + * @type {string} + * @memberof RecurrenceTransaction */ - source_name?: string; - readonly source_iban?: string | null; - source_type?: AccountTypeProperty; + sourceName?: string; + /** + * + * @type {string} + * @memberof RecurrenceTransaction + */ + readonly sourceIban?: string | null; + /** + * + * @type {AccountTypeProperty} + * @memberof RecurrenceTransaction + */ + sourceType?: AccountTypeProperty; /** * ID of the destination account. Submit either this or destination_name. + * @type {string} + * @memberof RecurrenceTransaction */ - destination_id?: string; + destinationId?: string; /** * Name of the destination account. Submit either this or destination_id. + * @type {string} + * @memberof RecurrenceTransaction + */ + destinationName?: string; + /** + * + * @type {string} + * @memberof RecurrenceTransaction + */ + readonly destinationIban?: string | null; + /** + * + * @type {AccountTypeProperty} + * @memberof RecurrenceTransaction */ - destination_name?: string; - readonly destination_iban?: string | null; - destination_type?: AccountTypeProperty; + destinationType?: AccountTypeProperty; /** * Array of tags. + * @type {Array} + * @memberof RecurrenceTransaction */ tags?: Array | null; /** * Optional. Use either this or the piggy_bank_name + * @type {string} + * @memberof RecurrenceTransaction */ - piggy_bank_id?: string | null; + piggyBankId?: string | null; /** * Optional. Use either this or the piggy_bank_id + * @type {string} + * @memberof RecurrenceTransaction */ - piggy_bank_name?: string | null; + piggyBankName?: string | null; /** * Optional. Use either this or the bill_name + * @type {string} + * @memberof RecurrenceTransaction */ - bill_id?: string | null; + billId?: string | null; /** * Optional. Use either this or the bill_id + * @type {string} + * @memberof RecurrenceTransaction */ - bill_name?: string | null; -}; + billName?: string | null; +} + +/** + * Check if a given object implements the RecurrenceTransaction interface. + */ +export function instanceOfRecurrenceTransaction(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "description" in value; + isInstance = isInstance && "amount" in value; + + return isInstance; +} + +export function RecurrenceTransactionFromJSON(json: any): RecurrenceTransaction { + return RecurrenceTransactionFromJSONTyped(json, false); +} + +export function RecurrenceTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceTransaction { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'description': json['description'], + 'amount': json['amount'], + 'foreignAmount': !exists(json, 'foreign_amount') ? undefined : json['foreign_amount'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'foreignCurrencyId': !exists(json, 'foreign_currency_id') ? undefined : json['foreign_currency_id'], + 'foreignCurrencyCode': !exists(json, 'foreign_currency_code') ? undefined : json['foreign_currency_code'], + 'foreignCurrencySymbol': !exists(json, 'foreign_currency_symbol') ? undefined : json['foreign_currency_symbol'], + 'foreignCurrencyDecimalPlaces': !exists(json, 'foreign_currency_decimal_places') ? undefined : json['foreign_currency_decimal_places'], + 'budgetId': !exists(json, 'budget_id') ? undefined : json['budget_id'], + 'budgetName': !exists(json, 'budget_name') ? undefined : json['budget_name'], + 'categoryId': !exists(json, 'category_id') ? undefined : json['category_id'], + 'categoryName': !exists(json, 'category_name') ? undefined : json['category_name'], + 'sourceId': !exists(json, 'source_id') ? undefined : json['source_id'], + 'sourceName': !exists(json, 'source_name') ? undefined : json['source_name'], + 'sourceIban': !exists(json, 'source_iban') ? undefined : json['source_iban'], + 'sourceType': !exists(json, 'source_type') ? undefined : AccountTypePropertyFromJSON(json['source_type']), + 'destinationId': !exists(json, 'destination_id') ? undefined : json['destination_id'], + 'destinationName': !exists(json, 'destination_name') ? undefined : json['destination_name'], + 'destinationIban': !exists(json, 'destination_iban') ? undefined : json['destination_iban'], + 'destinationType': !exists(json, 'destination_type') ? undefined : AccountTypePropertyFromJSON(json['destination_type']), + 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'piggyBankId': !exists(json, 'piggy_bank_id') ? undefined : json['piggy_bank_id'], + 'piggyBankName': !exists(json, 'piggy_bank_name') ? undefined : json['piggy_bank_name'], + 'billId': !exists(json, 'bill_id') ? undefined : json['bill_id'], + 'billName': !exists(json, 'bill_name') ? undefined : json['bill_name'], + }; +} + +export function RecurrenceTransactionToJSON(value?: RecurrenceTransaction | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'description': value.description, + 'amount': value.amount, + 'foreign_amount': value.foreignAmount, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'foreign_currency_id': value.foreignCurrencyId, + 'foreign_currency_code': value.foreignCurrencyCode, + 'budget_id': value.budgetId, + 'category_id': value.categoryId, + 'category_name': value.categoryName, + 'source_id': value.sourceId, + 'source_name': value.sourceName, + 'source_type': AccountTypePropertyToJSON(value.sourceType), + 'destination_id': value.destinationId, + 'destination_name': value.destinationName, + 'destination_type': AccountTypePropertyToJSON(value.destinationType), + 'tags': value.tags, + 'piggy_bank_id': value.piggyBankId, + 'piggy_bank_name': value.piggyBankName, + 'bill_id': value.billId, + 'bill_name': value.billName, + }; +} diff --git a/src/lib/api/models/RecurrenceTransactionStore.ts b/src/lib/api/models/RecurrenceTransactionStore.ts index ed390eb..d6e7818 100644 --- a/src/lib/api/models/RecurrenceTransactionStore.ts +++ b/src/lib/api/models/RecurrenceTransactionStore.ts @@ -1,61 +1,173 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type RecurrenceTransactionStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RecurrenceTransactionStore + */ +export interface RecurrenceTransactionStore { + /** + * + * @type {string} + * @memberof RecurrenceTransactionStore + */ description: string; /** * Amount of the transaction. + * @type {string} + * @memberof RecurrenceTransactionStore */ amount: string; /** * Foreign amount of the transaction. + * @type {string} + * @memberof RecurrenceTransactionStore */ - foreign_amount?: string | null; + foreignAmount?: string | null; /** * Submit either a currency_id or a currency_code. + * @type {string} + * @memberof RecurrenceTransactionStore */ - currency_id?: string; + currencyId?: string; /** * Submit either a currency_id or a currency_code. + * @type {string} + * @memberof RecurrenceTransactionStore */ - currency_code?: string; + currencyCode?: string; /** * Submit either a foreign_currency_id or a foreign_currency_code, or neither. + * @type {string} + * @memberof RecurrenceTransactionStore */ - foreign_currency_id?: string | null; + foreignCurrencyId?: string | null; /** * Submit either a foreign_currency_id or a foreign_currency_code, or neither. + * @type {string} + * @memberof RecurrenceTransactionStore */ - foreign_currency_code?: string | null; + foreignCurrencyCode?: string | null; /** * The budget ID for this transaction. + * @type {string} + * @memberof RecurrenceTransactionStore */ - budget_id?: string; + budgetId?: string; /** * Category ID for this transaction. + * @type {string} + * @memberof RecurrenceTransactionStore */ - category_id?: string; + categoryId?: string; /** * ID of the source account. + * @type {string} + * @memberof RecurrenceTransactionStore */ - source_id: string; + sourceId: string; /** * ID of the destination account. + * @type {string} + * @memberof RecurrenceTransactionStore */ - destination_id: string; + destinationId: string; /** * Array of tags. + * @type {Array} + * @memberof RecurrenceTransactionStore */ tags?: Array | null; /** * Optional. + * @type {string} + * @memberof RecurrenceTransactionStore */ - piggy_bank_id?: string | null; + piggyBankId?: string | null; /** * Optional. + * @type {string} + * @memberof RecurrenceTransactionStore */ - bill_id?: string | null; -}; + billId?: string | null; +} + +/** + * Check if a given object implements the RecurrenceTransactionStore interface. + */ +export function instanceOfRecurrenceTransactionStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "description" in value; + isInstance = isInstance && "amount" in value; + isInstance = isInstance && "sourceId" in value; + isInstance = isInstance && "destinationId" in value; + + return isInstance; +} + +export function RecurrenceTransactionStoreFromJSON(json: any): RecurrenceTransactionStore { + return RecurrenceTransactionStoreFromJSONTyped(json, false); +} + +export function RecurrenceTransactionStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceTransactionStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'description': json['description'], + 'amount': json['amount'], + 'foreignAmount': !exists(json, 'foreign_amount') ? undefined : json['foreign_amount'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'foreignCurrencyId': !exists(json, 'foreign_currency_id') ? undefined : json['foreign_currency_id'], + 'foreignCurrencyCode': !exists(json, 'foreign_currency_code') ? undefined : json['foreign_currency_code'], + 'budgetId': !exists(json, 'budget_id') ? undefined : json['budget_id'], + 'categoryId': !exists(json, 'category_id') ? undefined : json['category_id'], + 'sourceId': json['source_id'], + 'destinationId': json['destination_id'], + 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'piggyBankId': !exists(json, 'piggy_bank_id') ? undefined : json['piggy_bank_id'], + 'billId': !exists(json, 'bill_id') ? undefined : json['bill_id'], + }; +} + +export function RecurrenceTransactionStoreToJSON(value?: RecurrenceTransactionStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'description': value.description, + 'amount': value.amount, + 'foreign_amount': value.foreignAmount, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'foreign_currency_id': value.foreignCurrencyId, + 'foreign_currency_code': value.foreignCurrencyCode, + 'budget_id': value.budgetId, + 'category_id': value.categoryId, + 'source_id': value.sourceId, + 'destination_id': value.destinationId, + 'tags': value.tags, + 'piggy_bank_id': value.piggyBankId, + 'bill_id': value.billId, + }; +} diff --git a/src/lib/api/models/RecurrenceTransactionType.ts b/src/lib/api/models/RecurrenceTransactionType.ts index 247b98e..d9f17bb 100644 --- a/src/lib/api/models/RecurrenceTransactionType.ts +++ b/src/lib/api/models/RecurrenceTransactionType.ts @@ -1,10 +1,39 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum RecurrenceTransactionType { - WITHDRAWAL = 'withdrawal', - TRANSFER = 'transfer', - DEPOSIT = 'deposit', + +/** + * + * @export + */ +export const RecurrenceTransactionType = { + Withdrawal: 'withdrawal', + Transfer: 'transfer', + Deposit: 'deposit' +} as const; +export type RecurrenceTransactionType = typeof RecurrenceTransactionType[keyof typeof RecurrenceTransactionType]; + + +export function RecurrenceTransactionTypeFromJSON(json: any): RecurrenceTransactionType { + return RecurrenceTransactionTypeFromJSONTyped(json, false); +} + +export function RecurrenceTransactionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceTransactionType { + return json as RecurrenceTransactionType; +} + +export function RecurrenceTransactionTypeToJSON(value?: RecurrenceTransactionType | null): any { + return value as any; } + diff --git a/src/lib/api/models/RecurrenceTransactionUpdate.ts b/src/lib/api/models/RecurrenceTransactionUpdate.ts index 20d45cc..abac259 100644 --- a/src/lib/api/models/RecurrenceTransactionUpdate.ts +++ b/src/lib/api/models/RecurrenceTransactionUpdate.ts @@ -1,55 +1,170 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type RecurrenceTransactionUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RecurrenceTransactionUpdate + */ +export interface RecurrenceTransactionUpdate { + /** + * + * @type {string} + * @memberof RecurrenceTransactionUpdate + */ id: string; + /** + * + * @type {string} + * @memberof RecurrenceTransactionUpdate + */ description?: string; /** * Amount of the transaction. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ amount?: string; /** * Foreign amount of the transaction. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - foreign_amount?: string | null; + foreignAmount?: string | null; /** * Submit either a currency_id or a currency_code. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - currency_id?: string; + currencyId?: string; /** * Submit either a currency_id or a currency_code. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - currency_code?: string; + currencyCode?: string; /** * Submit either a foreign_currency_id or a foreign_currency_code, or neither. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - foreign_currency_id?: string | null; + foreignCurrencyId?: string | null; /** * The budget ID for this transaction. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - budget_id?: string; + budgetId?: string; /** * Category ID for this transaction. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - category_id?: string; + categoryId?: string; /** * ID of the source account. Submit either this or source_name. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - source_id?: string; + sourceId?: string; /** * ID of the destination account. Submit either this or destination_name. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - destination_id?: string; + destinationId?: string; /** * Array of tags. + * @type {Array} + * @memberof RecurrenceTransactionUpdate */ tags?: Array | null; - piggy_bank_id?: string | null; + /** + * + * @type {string} + * @memberof RecurrenceTransactionUpdate + */ + piggyBankId?: string | null; /** * Optional. + * @type {string} + * @memberof RecurrenceTransactionUpdate */ - bill_id?: string | null; -}; + billId?: string | null; +} + +/** + * Check if a given object implements the RecurrenceTransactionUpdate interface. + */ +export function instanceOfRecurrenceTransactionUpdate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + + return isInstance; +} + +export function RecurrenceTransactionUpdateFromJSON(json: any): RecurrenceTransactionUpdate { + return RecurrenceTransactionUpdateFromJSONTyped(json, false); +} + +export function RecurrenceTransactionUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceTransactionUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'amount': !exists(json, 'amount') ? undefined : json['amount'], + 'foreignAmount': !exists(json, 'foreign_amount') ? undefined : json['foreign_amount'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'foreignCurrencyId': !exists(json, 'foreign_currency_id') ? undefined : json['foreign_currency_id'], + 'budgetId': !exists(json, 'budget_id') ? undefined : json['budget_id'], + 'categoryId': !exists(json, 'category_id') ? undefined : json['category_id'], + 'sourceId': !exists(json, 'source_id') ? undefined : json['source_id'], + 'destinationId': !exists(json, 'destination_id') ? undefined : json['destination_id'], + 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'piggyBankId': !exists(json, 'piggy_bank_id') ? undefined : json['piggy_bank_id'], + 'billId': !exists(json, 'bill_id') ? undefined : json['bill_id'], + }; +} + +export function RecurrenceTransactionUpdateToJSON(value?: RecurrenceTransactionUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'description': value.description, + 'amount': value.amount, + 'foreign_amount': value.foreignAmount, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'foreign_currency_id': value.foreignCurrencyId, + 'budget_id': value.budgetId, + 'category_id': value.categoryId, + 'source_id': value.sourceId, + 'destination_id': value.destinationId, + 'tags': value.tags, + 'piggy_bank_id': value.piggyBankId, + 'bill_id': value.billId, + }; +} diff --git a/src/lib/api/models/RecurrenceUpdate.ts b/src/lib/api/models/RecurrenceUpdate.ts index afcd651..f18eecd 100644 --- a/src/lib/api/models/RecurrenceUpdate.ts +++ b/src/lib/api/models/RecurrenceUpdate.ts @@ -1,39 +1,150 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RecurrenceRepetitionUpdate } from './RecurrenceRepetitionUpdate'; +import { + RecurrenceRepetitionUpdateFromJSON, + RecurrenceRepetitionUpdateFromJSONTyped, + RecurrenceRepetitionUpdateToJSON, +} from './RecurrenceRepetitionUpdate'; import type { RecurrenceTransactionUpdate } from './RecurrenceTransactionUpdate'; +import { + RecurrenceTransactionUpdateFromJSON, + RecurrenceTransactionUpdateFromJSONTyped, + RecurrenceTransactionUpdateToJSON, +} from './RecurrenceTransactionUpdate'; -export type RecurrenceUpdate = { +/** + * + * @export + * @interface RecurrenceUpdate + */ +export interface RecurrenceUpdate { + /** + * + * @type {string} + * @memberof RecurrenceUpdate + */ title?: string; /** * Not to be confused with the description of the actual transaction(s) being created. + * @type {string} + * @memberof RecurrenceUpdate */ description?: string; /** * First time the recurring transaction will fire. + * @type {Date} + * @memberof RecurrenceUpdate */ - first_date?: string; + firstDate?: Date; /** * Date until the recurring transaction can fire. After that date, it's basically inactive. Use either this field or repetitions. + * @type {Date} + * @memberof RecurrenceUpdate */ - repeat_until?: string | null; + repeatUntil?: Date | null; /** * Max number of created transactions. Use either this field or repeat_until. + * @type {number} + * @memberof RecurrenceUpdate */ - nr_of_repetitions?: number | null; + nrOfRepetitions?: number | null; /** * Whether or not to fire the rules after the creation of a transaction. + * @type {boolean} + * @memberof RecurrenceUpdate */ - apply_rules?: boolean; + applyRules?: boolean; /** * If the recurrence is even active. + * @type {boolean} + * @memberof RecurrenceUpdate */ active?: boolean; + /** + * + * @type {string} + * @memberof RecurrenceUpdate + */ notes?: string | null; + /** + * + * @type {Array} + * @memberof RecurrenceUpdate + */ repetitions?: Array; + /** + * + * @type {Array} + * @memberof RecurrenceUpdate + */ transactions?: Array; -}; +} + +/** + * Check if a given object implements the RecurrenceUpdate interface. + */ +export function instanceOfRecurrenceUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RecurrenceUpdateFromJSON(json: any): RecurrenceUpdate { + return RecurrenceUpdateFromJSONTyped(json, false); +} + +export function RecurrenceUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecurrenceUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': !exists(json, 'title') ? undefined : json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'firstDate': !exists(json, 'first_date') ? undefined : (new Date(json['first_date'])), + 'repeatUntil': !exists(json, 'repeat_until') ? undefined : (json['repeat_until'] === null ? null : new Date(json['repeat_until'])), + 'nrOfRepetitions': !exists(json, 'nr_of_repetitions') ? undefined : json['nr_of_repetitions'], + 'applyRules': !exists(json, 'apply_rules') ? undefined : json['apply_rules'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'repetitions': !exists(json, 'repetitions') ? undefined : ((json['repetitions'] as Array).map(RecurrenceRepetitionUpdateFromJSON)), + 'transactions': !exists(json, 'transactions') ? undefined : ((json['transactions'] as Array).map(RecurrenceTransactionUpdateFromJSON)), + }; +} + +export function RecurrenceUpdateToJSON(value?: RecurrenceUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'first_date': value.firstDate === undefined ? undefined : (value.firstDate.toISOString().substring(0,10)), + 'repeat_until': value.repeatUntil === undefined ? undefined : (value.repeatUntil === null ? null : value.repeatUntil.toISOString().substring(0,10)), + 'nr_of_repetitions': value.nrOfRepetitions, + 'apply_rules': value.applyRules, + 'active': value.active, + 'notes': value.notes, + 'repetitions': value.repetitions === undefined ? undefined : ((value.repetitions as Array).map(RecurrenceRepetitionUpdateToJSON)), + 'transactions': value.transactions === undefined ? undefined : ((value.transactions as Array).map(RecurrenceTransactionUpdateToJSON)), + }; +} diff --git a/src/lib/api/models/Rule.ts b/src/lib/api/models/Rule.ts index ff3e62b..c3cde83 100644 --- a/src/lib/api/models/Rule.ts +++ b/src/lib/api/models/Rule.ts @@ -1,40 +1,182 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleAction } from './RuleAction'; +import { + RuleActionFromJSON, + RuleActionFromJSONTyped, + RuleActionToJSON, +} from './RuleAction'; import type { RuleTrigger } from './RuleTrigger'; +import { + RuleTriggerFromJSON, + RuleTriggerFromJSONTyped, + RuleTriggerToJSON, +} from './RuleTrigger'; import type { RuleTriggerType } from './RuleTriggerType'; +import { + RuleTriggerTypeFromJSON, + RuleTriggerTypeFromJSONTyped, + RuleTriggerTypeToJSON, +} from './RuleTriggerType'; -export type Rule = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Rule + */ +export interface Rule { + /** + * + * @type {Date} + * @memberof Rule + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Rule + */ + readonly updatedAt?: Date; + /** + * + * @type {string} + * @memberof Rule + */ title: string; + /** + * + * @type {string} + * @memberof Rule + */ description?: string; /** * ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. + * @type {string} + * @memberof Rule */ - rule_group_id: string; + ruleGroupId: string; /** * Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory. + * @type {string} + * @memberof Rule + */ + ruleGroupTitle?: string; + /** + * + * @type {number} + * @memberof Rule */ - rule_group_title?: string; readonly order?: number; + /** + * + * @type {RuleTriggerType} + * @memberof Rule + */ trigger: RuleTriggerType; /** * Whether or not the rule is even active. Default is true. + * @type {boolean} + * @memberof Rule */ active?: boolean; /** * If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. + * @type {boolean} + * @memberof Rule */ strict?: boolean; /** * If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. + * @type {boolean} + * @memberof Rule + */ + stopProcessing?: boolean; + /** + * + * @type {Array} + * @memberof Rule */ - stop_processing?: boolean; triggers: Array; + /** + * + * @type {Array} + * @memberof Rule + */ actions: Array; -}; +} + +/** + * Check if a given object implements the Rule interface. + */ +export function instanceOfRule(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "ruleGroupId" in value; + isInstance = isInstance && "trigger" in value; + isInstance = isInstance && "triggers" in value; + isInstance = isInstance && "actions" in value; + + return isInstance; +} + +export function RuleFromJSON(json: any): Rule { + return RuleFromJSONTyped(json, false); +} + +export function RuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Rule { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'title': json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'ruleGroupId': json['rule_group_id'], + 'ruleGroupTitle': !exists(json, 'rule_group_title') ? undefined : json['rule_group_title'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'trigger': RuleTriggerTypeFromJSON(json['trigger']), + 'active': !exists(json, 'active') ? undefined : json['active'], + 'strict': !exists(json, 'strict') ? undefined : json['strict'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + 'triggers': ((json['triggers'] as Array).map(RuleTriggerFromJSON)), + 'actions': ((json['actions'] as Array).map(RuleActionFromJSON)), + }; +} + +export function RuleToJSON(value?: Rule | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'rule_group_id': value.ruleGroupId, + 'rule_group_title': value.ruleGroupTitle, + 'trigger': RuleTriggerTypeToJSON(value.trigger), + 'active': value.active, + 'strict': value.strict, + 'stop_processing': value.stopProcessing, + 'triggers': ((value.triggers as Array).map(RuleTriggerToJSON)), + 'actions': ((value.actions as Array).map(RuleActionToJSON)), + }; +} diff --git a/src/lib/api/models/RuleAction.ts b/src/lib/api/models/RuleAction.ts index c265e1d..a9f8936 100644 --- a/src/lib/api/models/RuleAction.ts +++ b/src/lib/api/models/RuleAction.ts @@ -1,30 +1,127 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleActionKeyword } from './RuleActionKeyword'; +import { + RuleActionKeywordFromJSON, + RuleActionKeywordFromJSONTyped, + RuleActionKeywordToJSON, +} from './RuleActionKeyword'; -export type RuleAction = { +/** + * + * @export + * @interface RuleAction + */ +export interface RuleAction { + /** + * + * @type {string} + * @memberof RuleAction + */ readonly id?: string; - readonly created_at?: string; - readonly updated_at?: string; + /** + * + * @type {Date} + * @memberof RuleAction + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof RuleAction + */ + readonly updatedAt?: Date; + /** + * + * @type {RuleActionKeyword} + * @memberof RuleAction + */ type: RuleActionKeyword; /** * The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. + * @type {string} + * @memberof RuleAction */ value: string | null; /** * Order of the action + * @type {number} + * @memberof RuleAction */ order?: number; /** * If the action is active. Defaults to true. + * @type {boolean} + * @memberof RuleAction */ active?: boolean; /** * When true, other actions will not be fired after this action has fired. Defaults to false. + * @type {boolean} + * @memberof RuleAction */ - stop_processing?: boolean; -}; + stopProcessing?: boolean; +} + +/** + * Check if a given object implements the RuleAction interface. + */ +export function instanceOfRuleAction(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "value" in value; + + return isInstance; +} + +export function RuleActionFromJSON(json: any): RuleAction { + return RuleActionFromJSONTyped(json, false); +} + +export function RuleActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleAction { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'type': RuleActionKeywordFromJSON(json['type']), + 'value': json['value'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + }; +} + +export function RuleActionToJSON(value?: RuleAction | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RuleActionKeywordToJSON(value.type), + 'value': value.value, + 'order': value.order, + 'active': value.active, + 'stop_processing': value.stopProcessing, + }; +} diff --git a/src/lib/api/models/RuleActionKeyword.ts b/src/lib/api/models/RuleActionKeyword.ts index 011d45d..6bb900c 100644 --- a/src/lib/api/models/RuleActionKeyword.ts +++ b/src/lib/api/models/RuleActionKeyword.ts @@ -1,32 +1,58 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * The type of thing this action will do. A limited set is possible. + * @export */ -export enum RuleActionKeyword { - USER_ACTION = 'user_action', - SET_CATEGORY = 'set_category', - CLEAR_CATEGORY = 'clear_category', - SET_BUDGET = 'set_budget', - CLEAR_BUDGET = 'clear_budget', - ADD_TAG = 'add_tag', - REMOVE_TAG = 'remove_tag', - REMOVE_ALL_TAGS = 'remove_all_tags', - SET_DESCRIPTION = 'set_description', - APPEND_DESCRIPTION = 'append_description', - PREPEND_DESCRIPTION = 'prepend_description', - SET_SOURCE_ACCOUNT = 'set_source_account', - SET_DESTINATION_ACCOUNT = 'set_destination_account', - SET_NOTES = 'set_notes', - APPEND_NOTES = 'append_notes', - PREPEND_NOTES = 'prepend_notes', - CLEAR_NOTES = 'clear_notes', - LINK_TO_BILL = 'link_to_bill', - CONVERT_WITHDRAWAL = 'convert_withdrawal', - CONVERT_DEPOSIT = 'convert_deposit', - CONVERT_TRANSFER = 'convert_transfer', - DELETE_TRANSACTION = 'delete_transaction', +export const RuleActionKeyword = { + UserAction: 'user_action', + SetCategory: 'set_category', + ClearCategory: 'clear_category', + SetBudget: 'set_budget', + ClearBudget: 'clear_budget', + AddTag: 'add_tag', + RemoveTag: 'remove_tag', + RemoveAllTags: 'remove_all_tags', + SetDescription: 'set_description', + AppendDescription: 'append_description', + PrependDescription: 'prepend_description', + SetSourceAccount: 'set_source_account', + SetDestinationAccount: 'set_destination_account', + SetNotes: 'set_notes', + AppendNotes: 'append_notes', + PrependNotes: 'prepend_notes', + ClearNotes: 'clear_notes', + LinkToBill: 'link_to_bill', + ConvertWithdrawal: 'convert_withdrawal', + ConvertDeposit: 'convert_deposit', + ConvertTransfer: 'convert_transfer', + DeleteTransaction: 'delete_transaction' +} as const; +export type RuleActionKeyword = typeof RuleActionKeyword[keyof typeof RuleActionKeyword]; + + +export function RuleActionKeywordFromJSON(json: any): RuleActionKeyword { + return RuleActionKeywordFromJSONTyped(json, false); } + +export function RuleActionKeywordFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleActionKeyword { + return json as RuleActionKeyword; +} + +export function RuleActionKeywordToJSON(value?: RuleActionKeyword | null): any { + return value as any; +} + diff --git a/src/lib/api/models/RuleActionStore.ts b/src/lib/api/models/RuleActionStore.ts index c7cfe49..204694d 100644 --- a/src/lib/api/models/RuleActionStore.ts +++ b/src/lib/api/models/RuleActionStore.ts @@ -1,27 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleActionKeyword } from './RuleActionKeyword'; +import { + RuleActionKeywordFromJSON, + RuleActionKeywordFromJSONTyped, + RuleActionKeywordToJSON, +} from './RuleActionKeyword'; -export type RuleActionStore = { +/** + * + * @export + * @interface RuleActionStore + */ +export interface RuleActionStore { + /** + * + * @type {RuleActionKeyword} + * @memberof RuleActionStore + */ type: RuleActionKeyword; /** * The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. + * @type {string} + * @memberof RuleActionStore */ value: string | null; /** * Order of the action + * @type {number} + * @memberof RuleActionStore */ order?: number; /** * If the action is active. Defaults to true. + * @type {boolean} + * @memberof RuleActionStore */ active?: boolean; /** * When true, other actions will not be fired after this action has fired. Defaults to false. + * @type {boolean} + * @memberof RuleActionStore */ - stop_processing?: boolean; -}; + stopProcessing?: boolean; +} + +/** + * Check if a given object implements the RuleActionStore interface. + */ +export function instanceOfRuleActionStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "value" in value; + + return isInstance; +} + +export function RuleActionStoreFromJSON(json: any): RuleActionStore { + return RuleActionStoreFromJSONTyped(json, false); +} + +export function RuleActionStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleActionStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': RuleActionKeywordFromJSON(json['type']), + 'value': json['value'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + }; +} + +export function RuleActionStoreToJSON(value?: RuleActionStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RuleActionKeywordToJSON(value.type), + 'value': value.value, + 'order': value.order, + 'active': value.active, + 'stop_processing': value.stopProcessing, + }; +} diff --git a/src/lib/api/models/RuleActionUpdate.ts b/src/lib/api/models/RuleActionUpdate.ts index 6647b8e..396658e 100644 --- a/src/lib/api/models/RuleActionUpdate.ts +++ b/src/lib/api/models/RuleActionUpdate.ts @@ -1,27 +1,104 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleActionKeyword } from './RuleActionKeyword'; +import { + RuleActionKeywordFromJSON, + RuleActionKeywordFromJSONTyped, + RuleActionKeywordToJSON, +} from './RuleActionKeyword'; -export type RuleActionUpdate = { +/** + * + * @export + * @interface RuleActionUpdate + */ +export interface RuleActionUpdate { + /** + * + * @type {RuleActionKeyword} + * @memberof RuleActionUpdate + */ type?: RuleActionKeyword; /** * The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. + * @type {string} + * @memberof RuleActionUpdate */ value?: string | null; /** * Order of the action + * @type {number} + * @memberof RuleActionUpdate */ order?: number; /** * If the action is active. + * @type {boolean} + * @memberof RuleActionUpdate */ active?: boolean; /** * When true, other actions will not be fired after this action has fired. + * @type {boolean} + * @memberof RuleActionUpdate */ - stop_processing?: boolean; -}; + stopProcessing?: boolean; +} + +/** + * Check if a given object implements the RuleActionUpdate interface. + */ +export function instanceOfRuleActionUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RuleActionUpdateFromJSON(json: any): RuleActionUpdate { + return RuleActionUpdateFromJSONTyped(json, false); +} + +export function RuleActionUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleActionUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': !exists(json, 'type') ? undefined : RuleActionKeywordFromJSON(json['type']), + 'value': !exists(json, 'value') ? undefined : json['value'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + }; +} + +export function RuleActionUpdateToJSON(value?: RuleActionUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RuleActionKeywordToJSON(value.type), + 'value': value.value, + 'order': value.order, + 'active': value.active, + 'stop_processing': value.stopProcessing, + }; +} diff --git a/src/lib/api/models/RuleArray.ts b/src/lib/api/models/RuleArray.ts index 14ee669..424d488 100644 --- a/src/lib/api/models/RuleArray.ts +++ b/src/lib/api/models/RuleArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { RuleRead } from './RuleRead'; +import { + RuleReadFromJSON, + RuleReadFromJSONTyped, + RuleReadToJSON, +} from './RuleRead'; -export type RuleArray = { +/** + * + * @export + * @interface RuleArray + */ +export interface RuleArray { + /** + * + * @type {Array} + * @memberof RuleArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof RuleArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof RuleArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the RuleArray interface. + */ +export function instanceOfRuleArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function RuleArrayFromJSON(json: any): RuleArray { + return RuleArrayFromJSONTyped(json, false); +} + +export function RuleArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(RuleReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function RuleArrayToJSON(value?: RuleArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(RuleReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/RuleGroup.ts b/src/lib/api/models/RuleGroup.ts index ffd83e7..8c18fcc 100644 --- a/src/lib/api/models/RuleGroup.ts +++ b/src/lib/api/models/RuleGroup.ts @@ -1,14 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type RuleGroup = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuleGroup + */ +export interface RuleGroup { + /** + * + * @type {Date} + * @memberof RuleGroup + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof RuleGroup + */ + readonly updatedAt?: Date; + /** + * + * @type {string} + * @memberof RuleGroup + */ title: string; + /** + * + * @type {string} + * @memberof RuleGroup + */ description?: string | null; + /** + * + * @type {number} + * @memberof RuleGroup + */ readonly order?: number; + /** + * + * @type {boolean} + * @memberof RuleGroup + */ active?: boolean; -}; +} + +/** + * Check if a given object implements the RuleGroup interface. + */ +export function instanceOfRuleGroup(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + + return isInstance; +} + +export function RuleGroupFromJSON(json: any): RuleGroup { + return RuleGroupFromJSONTyped(json, false); +} + +export function RuleGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleGroup { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'title': json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + }; +} + +export function RuleGroupToJSON(value?: RuleGroup | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'active': value.active, + }; +} diff --git a/src/lib/api/models/RuleGroupArray.ts b/src/lib/api/models/RuleGroupArray.ts index 0b763c0..7d7c5e1 100644 --- a/src/lib/api/models/RuleGroupArray.ts +++ b/src/lib/api/models/RuleGroupArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { RuleGroupRead } from './RuleGroupRead'; +import { + RuleGroupReadFromJSON, + RuleGroupReadFromJSONTyped, + RuleGroupReadToJSON, +} from './RuleGroupRead'; -export type RuleGroupArray = { +/** + * + * @export + * @interface RuleGroupArray + */ +export interface RuleGroupArray { + /** + * + * @type {Array} + * @memberof RuleGroupArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof RuleGroupArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof RuleGroupArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the RuleGroupArray interface. + */ +export function instanceOfRuleGroupArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function RuleGroupArrayFromJSON(json: any): RuleGroupArray { + return RuleGroupArrayFromJSONTyped(json, false); +} + +export function RuleGroupArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleGroupArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(RuleGroupReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function RuleGroupArrayToJSON(value?: RuleGroupArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(RuleGroupReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/RuleGroupRead.ts b/src/lib/api/models/RuleGroupRead.ts index d5fa080..b183be3 100644 --- a/src/lib/api/models/RuleGroupRead.ts +++ b/src/lib/api/models/RuleGroupRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { RuleGroup } from './RuleGroup'; +import { + RuleGroupFromJSON, + RuleGroupFromJSONTyped, + RuleGroupToJSON, +} from './RuleGroup'; -export type RuleGroupRead = { +/** + * + * @export + * @interface RuleGroupRead + */ +export interface RuleGroupRead { /** * Immutable value + * @type {string} + * @memberof RuleGroupRead */ type: string; + /** + * + * @type {string} + * @memberof RuleGroupRead + */ id: string; + /** + * + * @type {RuleGroup} + * @memberof RuleGroupRead + */ attributes: RuleGroup; + /** + * + * @type {ObjectLink} + * @memberof RuleGroupRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the RuleGroupRead interface. + */ +export function instanceOfRuleGroupRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function RuleGroupReadFromJSON(json: any): RuleGroupRead { + return RuleGroupReadFromJSONTyped(json, false); +} + +export function RuleGroupReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleGroupRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': RuleGroupFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function RuleGroupReadToJSON(value?: RuleGroupRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': RuleGroupToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/RuleGroupSingle.ts b/src/lib/api/models/RuleGroupSingle.ts index 4914793..0ebc6c4 100644 --- a/src/lib/api/models/RuleGroupSingle.ts +++ b/src/lib/api/models/RuleGroupSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleGroupRead } from './RuleGroupRead'; +import { + RuleGroupReadFromJSON, + RuleGroupReadFromJSONTyped, + RuleGroupReadToJSON, +} from './RuleGroupRead'; -export type RuleGroupSingle = { +/** + * + * @export + * @interface RuleGroupSingle + */ +export interface RuleGroupSingle { + /** + * + * @type {RuleGroupRead} + * @memberof RuleGroupSingle + */ data: RuleGroupRead; -}; +} + +/** + * Check if a given object implements the RuleGroupSingle interface. + */ +export function instanceOfRuleGroupSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function RuleGroupSingleFromJSON(json: any): RuleGroupSingle { + return RuleGroupSingleFromJSONTyped(json, false); +} + +export function RuleGroupSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleGroupSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': RuleGroupReadFromJSON(json['data']), + }; +} + +export function RuleGroupSingleToJSON(value?: RuleGroupSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': RuleGroupReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/RuleGroupStore.ts b/src/lib/api/models/RuleGroupStore.ts index 8bbd953..a51d1fe 100644 --- a/src/lib/api/models/RuleGroupStore.ts +++ b/src/lib/api/models/RuleGroupStore.ts @@ -1,12 +1,90 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type RuleGroupStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuleGroupStore + */ +export interface RuleGroupStore { + /** + * + * @type {string} + * @memberof RuleGroupStore + */ title: string; + /** + * + * @type {string} + * @memberof RuleGroupStore + */ description?: string | null; + /** + * + * @type {number} + * @memberof RuleGroupStore + */ order?: number; + /** + * + * @type {boolean} + * @memberof RuleGroupStore + */ active?: boolean; -}; +} + +/** + * Check if a given object implements the RuleGroupStore interface. + */ +export function instanceOfRuleGroupStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + + return isInstance; +} + +export function RuleGroupStoreFromJSON(json: any): RuleGroupStore { + return RuleGroupStoreFromJSONTyped(json, false); +} + +export function RuleGroupStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleGroupStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + }; +} + +export function RuleGroupStoreToJSON(value?: RuleGroupStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'order': value.order, + 'active': value.active, + }; +} diff --git a/src/lib/api/models/RuleGroupUpdate.ts b/src/lib/api/models/RuleGroupUpdate.ts index 050d295..c65591f 100644 --- a/src/lib/api/models/RuleGroupUpdate.ts +++ b/src/lib/api/models/RuleGroupUpdate.ts @@ -1,12 +1,89 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type RuleGroupUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RuleGroupUpdate + */ +export interface RuleGroupUpdate { + /** + * + * @type {string} + * @memberof RuleGroupUpdate + */ title?: string; + /** + * + * @type {string} + * @memberof RuleGroupUpdate + */ description?: string | null; + /** + * + * @type {number} + * @memberof RuleGroupUpdate + */ order?: number; + /** + * + * @type {boolean} + * @memberof RuleGroupUpdate + */ active?: boolean; -}; +} + +/** + * Check if a given object implements the RuleGroupUpdate interface. + */ +export function instanceOfRuleGroupUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RuleGroupUpdateFromJSON(json: any): RuleGroupUpdate { + return RuleGroupUpdateFromJSONTyped(json, false); +} + +export function RuleGroupUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleGroupUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': !exists(json, 'title') ? undefined : json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + }; +} + +export function RuleGroupUpdateToJSON(value?: RuleGroupUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'order': value.order, + 'active': value.active, + }; +} diff --git a/src/lib/api/models/RuleRead.ts b/src/lib/api/models/RuleRead.ts index d2b504b..dad6124 100644 --- a/src/lib/api/models/RuleRead.ts +++ b/src/lib/api/models/RuleRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { Rule } from './Rule'; +import { + RuleFromJSON, + RuleFromJSONTyped, + RuleToJSON, +} from './Rule'; -export type RuleRead = { +/** + * + * @export + * @interface RuleRead + */ +export interface RuleRead { /** * Immutable value + * @type {string} + * @memberof RuleRead */ type: string; + /** + * + * @type {string} + * @memberof RuleRead + */ id: string; + /** + * + * @type {Rule} + * @memberof RuleRead + */ attributes: Rule; + /** + * + * @type {ObjectLink} + * @memberof RuleRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the RuleRead interface. + */ +export function instanceOfRuleRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function RuleReadFromJSON(json: any): RuleRead { + return RuleReadFromJSONTyped(json, false); +} + +export function RuleReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': RuleFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function RuleReadToJSON(value?: RuleRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': RuleToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/RuleSingle.ts b/src/lib/api/models/RuleSingle.ts index e3897dd..d468df6 100644 --- a/src/lib/api/models/RuleSingle.ts +++ b/src/lib/api/models/RuleSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleRead } from './RuleRead'; +import { + RuleReadFromJSON, + RuleReadFromJSONTyped, + RuleReadToJSON, +} from './RuleRead'; -export type RuleSingle = { +/** + * + * @export + * @interface RuleSingle + */ +export interface RuleSingle { + /** + * + * @type {RuleRead} + * @memberof RuleSingle + */ data: RuleRead; -}; +} + +/** + * Check if a given object implements the RuleSingle interface. + */ +export function instanceOfRuleSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function RuleSingleFromJSON(json: any): RuleSingle { + return RuleSingleFromJSONTyped(json, false); +} + +export function RuleSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': RuleReadFromJSON(json['data']), + }; +} + +export function RuleSingleToJSON(value?: RuleSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': RuleReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/RuleStore.ts b/src/lib/api/models/RuleStore.ts index b2aefcb..a8fcc1c 100644 --- a/src/lib/api/models/RuleStore.ts +++ b/src/lib/api/models/RuleStore.ts @@ -1,38 +1,169 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleActionStore } from './RuleActionStore'; +import { + RuleActionStoreFromJSON, + RuleActionStoreFromJSONTyped, + RuleActionStoreToJSON, +} from './RuleActionStore'; import type { RuleTriggerStore } from './RuleTriggerStore'; +import { + RuleTriggerStoreFromJSON, + RuleTriggerStoreFromJSONTyped, + RuleTriggerStoreToJSON, +} from './RuleTriggerStore'; import type { RuleTriggerType } from './RuleTriggerType'; +import { + RuleTriggerTypeFromJSON, + RuleTriggerTypeFromJSONTyped, + RuleTriggerTypeToJSON, +} from './RuleTriggerType'; -export type RuleStore = { +/** + * + * @export + * @interface RuleStore + */ +export interface RuleStore { + /** + * + * @type {string} + * @memberof RuleStore + */ title: string; + /** + * + * @type {string} + * @memberof RuleStore + */ description?: string; /** * ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. + * @type {string} + * @memberof RuleStore */ - rule_group_id: string; + ruleGroupId: string; /** * Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory. + * @type {string} + * @memberof RuleStore + */ + ruleGroupTitle?: string; + /** + * + * @type {number} + * @memberof RuleStore */ - rule_group_title?: string; order?: number; + /** + * + * @type {RuleTriggerType} + * @memberof RuleStore + */ trigger: RuleTriggerType; /** * Whether or not the rule is even active. Default is true. + * @type {boolean} + * @memberof RuleStore */ active?: boolean; /** * If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. + * @type {boolean} + * @memberof RuleStore */ strict?: boolean; /** * If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. + * @type {boolean} + * @memberof RuleStore + */ + stopProcessing?: boolean; + /** + * + * @type {Array} + * @memberof RuleStore */ - stop_processing?: boolean; triggers: Array; + /** + * + * @type {Array} + * @memberof RuleStore + */ actions: Array; -}; +} + +/** + * Check if a given object implements the RuleStore interface. + */ +export function instanceOfRuleStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "ruleGroupId" in value; + isInstance = isInstance && "trigger" in value; + isInstance = isInstance && "triggers" in value; + isInstance = isInstance && "actions" in value; + + return isInstance; +} + +export function RuleStoreFromJSON(json: any): RuleStore { + return RuleStoreFromJSONTyped(json, false); +} + +export function RuleStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'ruleGroupId': json['rule_group_id'], + 'ruleGroupTitle': !exists(json, 'rule_group_title') ? undefined : json['rule_group_title'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'trigger': RuleTriggerTypeFromJSON(json['trigger']), + 'active': !exists(json, 'active') ? undefined : json['active'], + 'strict': !exists(json, 'strict') ? undefined : json['strict'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + 'triggers': ((json['triggers'] as Array).map(RuleTriggerStoreFromJSON)), + 'actions': ((json['actions'] as Array).map(RuleActionStoreFromJSON)), + }; +} + +export function RuleStoreToJSON(value?: RuleStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'rule_group_id': value.ruleGroupId, + 'rule_group_title': value.ruleGroupTitle, + 'order': value.order, + 'trigger': RuleTriggerTypeToJSON(value.trigger), + 'active': value.active, + 'strict': value.strict, + 'stop_processing': value.stopProcessing, + 'triggers': ((value.triggers as Array).map(RuleTriggerStoreToJSON)), + 'actions': ((value.actions as Array).map(RuleActionStoreToJSON)), + }; +} diff --git a/src/lib/api/models/RuleTrigger.ts b/src/lib/api/models/RuleTrigger.ts index 36299a2..14ebf13 100644 --- a/src/lib/api/models/RuleTrigger.ts +++ b/src/lib/api/models/RuleTrigger.ts @@ -1,30 +1,126 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleTriggerKeyword } from './RuleTriggerKeyword'; +import { + RuleTriggerKeywordFromJSON, + RuleTriggerKeywordFromJSONTyped, + RuleTriggerKeywordToJSON, +} from './RuleTriggerKeyword'; -export type RuleTrigger = { +/** + * + * @export + * @interface RuleTrigger + */ +export interface RuleTrigger { + /** + * + * @type {string} + * @memberof RuleTrigger + */ readonly id?: string; - readonly created_at?: string; - readonly updated_at?: string; + /** + * + * @type {Date} + * @memberof RuleTrigger + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof RuleTrigger + */ + readonly updatedAt?: Date; + /** + * + * @type {RuleTriggerKeyword} + * @memberof RuleTrigger + */ type: RuleTriggerKeyword; /** * The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. + * @type {string} + * @memberof RuleTrigger */ value: string; /** * Order of the trigger + * @type {number} + * @memberof RuleTrigger */ readonly order?: number; /** * If the trigger is active. Defaults to true. + * @type {boolean} + * @memberof RuleTrigger */ active?: boolean; /** * When true, other triggers will not be checked if this trigger was triggered. Defaults to false. + * @type {boolean} + * @memberof RuleTrigger */ - stop_processing?: boolean; -}; + stopProcessing?: boolean; +} + +/** + * Check if a given object implements the RuleTrigger interface. + */ +export function instanceOfRuleTrigger(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "value" in value; + + return isInstance; +} + +export function RuleTriggerFromJSON(json: any): RuleTrigger { + return RuleTriggerFromJSONTyped(json, false); +} + +export function RuleTriggerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleTrigger { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'type': RuleTriggerKeywordFromJSON(json['type']), + 'value': json['value'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + }; +} + +export function RuleTriggerToJSON(value?: RuleTrigger | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RuleTriggerKeywordToJSON(value.type), + 'value': value.value, + 'active': value.active, + 'stop_processing': value.stopProcessing, + }; +} diff --git a/src/lib/api/models/RuleTriggerKeyword.ts b/src/lib/api/models/RuleTriggerKeyword.ts index 464d0cb..5d3306c 100644 --- a/src/lib/api/models/RuleTriggerKeyword.ts +++ b/src/lib/api/models/RuleTriggerKeyword.ts @@ -1,46 +1,72 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * The type of thing this trigger responds to. A limited set is possible + * @export */ -export enum RuleTriggerKeyword { - FROM_ACCOUNT_STARTS = 'from_account_starts', - FROM_ACCOUNT_ENDS = 'from_account_ends', - FROM_ACCOUNT_IS = 'from_account_is', - FROM_ACCOUNT_CONTAINS = 'from_account_contains', - TO_ACCOUNT_STARTS = 'to_account_starts', - TO_ACCOUNT_ENDS = 'to_account_ends', - TO_ACCOUNT_IS = 'to_account_is', - TO_ACCOUNT_CONTAINS = 'to_account_contains', - AMOUNT_LESS = 'amount_less', - AMOUNT_EXACTLY = 'amount_exactly', - AMOUNT_MORE = 'amount_more', - DESCRIPTION_STARTS = 'description_starts', - DESCRIPTION_ENDS = 'description_ends', - DESCRIPTION_CONTAINS = 'description_contains', - DESCRIPTION_IS = 'description_is', - TRANSACTION_TYPE = 'transaction_type', - CATEGORY_IS = 'category_is', - BUDGET_IS = 'budget_is', - TAG_IS = 'tag_is', - CURRENCY_IS = 'currency_is', - HAS_ATTACHMENTS = 'has_attachments', - HAS_NO_CATEGORY = 'has_no_category', - HAS_ANY_CATEGORY = 'has_any_category', - HAS_NO_BUDGET = 'has_no_budget', - HAS_ANY_BUDGET = 'has_any_budget', - HAS_NO_TAG = 'has_no_tag', - HAS_ANY_TAG = 'has_any_tag', - NOTES_CONTAINS = 'notes_contains', - NOTES_START = 'notes_start', - NOTES_END = 'notes_end', - NOTES_ARE = 'notes_are', - NO_NOTES = 'no_notes', - ANY_NOTES = 'any_notes', - SOURCE_ACCOUNT_IS = 'source_account_is', - DESTINATION_ACCOUNT_IS = 'destination_account_is', - SOURCE_ACCOUNT_STARTS = 'source_account_starts', +export const RuleTriggerKeyword = { + FromAccountStarts: 'from_account_starts', + FromAccountEnds: 'from_account_ends', + FromAccountIs: 'from_account_is', + FromAccountContains: 'from_account_contains', + ToAccountStarts: 'to_account_starts', + ToAccountEnds: 'to_account_ends', + ToAccountIs: 'to_account_is', + ToAccountContains: 'to_account_contains', + AmountLess: 'amount_less', + AmountExactly: 'amount_exactly', + AmountMore: 'amount_more', + DescriptionStarts: 'description_starts', + DescriptionEnds: 'description_ends', + DescriptionContains: 'description_contains', + DescriptionIs: 'description_is', + TransactionType: 'transaction_type', + CategoryIs: 'category_is', + BudgetIs: 'budget_is', + TagIs: 'tag_is', + CurrencyIs: 'currency_is', + HasAttachments: 'has_attachments', + HasNoCategory: 'has_no_category', + HasAnyCategory: 'has_any_category', + HasNoBudget: 'has_no_budget', + HasAnyBudget: 'has_any_budget', + HasNoTag: 'has_no_tag', + HasAnyTag: 'has_any_tag', + NotesContains: 'notes_contains', + NotesStart: 'notes_start', + NotesEnd: 'notes_end', + NotesAre: 'notes_are', + NoNotes: 'no_notes', + AnyNotes: 'any_notes', + SourceAccountIs: 'source_account_is', + DestinationAccountIs: 'destination_account_is', + SourceAccountStarts: 'source_account_starts' +} as const; +export type RuleTriggerKeyword = typeof RuleTriggerKeyword[keyof typeof RuleTriggerKeyword]; + + +export function RuleTriggerKeywordFromJSON(json: any): RuleTriggerKeyword { + return RuleTriggerKeywordFromJSONTyped(json, false); } + +export function RuleTriggerKeywordFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleTriggerKeyword { + return json as RuleTriggerKeyword; +} + +export function RuleTriggerKeywordToJSON(value?: RuleTriggerKeyword | null): any { + return value as any; +} + diff --git a/src/lib/api/models/RuleTriggerStore.ts b/src/lib/api/models/RuleTriggerStore.ts index f0dceda..af3c473 100644 --- a/src/lib/api/models/RuleTriggerStore.ts +++ b/src/lib/api/models/RuleTriggerStore.ts @@ -1,27 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleTriggerKeyword } from './RuleTriggerKeyword'; +import { + RuleTriggerKeywordFromJSON, + RuleTriggerKeywordFromJSONTyped, + RuleTriggerKeywordToJSON, +} from './RuleTriggerKeyword'; -export type RuleTriggerStore = { +/** + * + * @export + * @interface RuleTriggerStore + */ +export interface RuleTriggerStore { + /** + * + * @type {RuleTriggerKeyword} + * @memberof RuleTriggerStore + */ type: RuleTriggerKeyword; /** * The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. + * @type {string} + * @memberof RuleTriggerStore */ value: string; /** * Order of the trigger + * @type {number} + * @memberof RuleTriggerStore */ order?: number; /** * If the trigger is active. Defaults to true. + * @type {boolean} + * @memberof RuleTriggerStore */ active?: boolean; /** * When true, other triggers will not be checked if this trigger was triggered. Defaults to false. + * @type {boolean} + * @memberof RuleTriggerStore */ - stop_processing?: boolean; -}; + stopProcessing?: boolean; +} + +/** + * Check if a given object implements the RuleTriggerStore interface. + */ +export function instanceOfRuleTriggerStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "value" in value; + + return isInstance; +} + +export function RuleTriggerStoreFromJSON(json: any): RuleTriggerStore { + return RuleTriggerStoreFromJSONTyped(json, false); +} + +export function RuleTriggerStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleTriggerStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': RuleTriggerKeywordFromJSON(json['type']), + 'value': json['value'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + }; +} + +export function RuleTriggerStoreToJSON(value?: RuleTriggerStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RuleTriggerKeywordToJSON(value.type), + 'value': value.value, + 'order': value.order, + 'active': value.active, + 'stop_processing': value.stopProcessing, + }; +} diff --git a/src/lib/api/models/RuleTriggerType.ts b/src/lib/api/models/RuleTriggerType.ts index 17ad780..65d9aed 100644 --- a/src/lib/api/models/RuleTriggerType.ts +++ b/src/lib/api/models/RuleTriggerType.ts @@ -1,12 +1,38 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Which action is necessary for the rule to fire? Use either store-journal or update-journal. + * @export */ -export enum RuleTriggerType { - STORE_JOURNAL = 'store-journal', - UPDATE_JOURNAL = 'update-journal', +export const RuleTriggerType = { + StoreJournal: 'store-journal', + UpdateJournal: 'update-journal' +} as const; +export type RuleTriggerType = typeof RuleTriggerType[keyof typeof RuleTriggerType]; + + +export function RuleTriggerTypeFromJSON(json: any): RuleTriggerType { + return RuleTriggerTypeFromJSONTyped(json, false); } + +export function RuleTriggerTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleTriggerType { + return json as RuleTriggerType; +} + +export function RuleTriggerTypeToJSON(value?: RuleTriggerType | null): any { + return value as any; +} + diff --git a/src/lib/api/models/RuleTriggerUpdate.ts b/src/lib/api/models/RuleTriggerUpdate.ts index a6c75eb..21846f8 100644 --- a/src/lib/api/models/RuleTriggerUpdate.ts +++ b/src/lib/api/models/RuleTriggerUpdate.ts @@ -1,27 +1,104 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleTriggerKeyword } from './RuleTriggerKeyword'; +import { + RuleTriggerKeywordFromJSON, + RuleTriggerKeywordFromJSONTyped, + RuleTriggerKeywordToJSON, +} from './RuleTriggerKeyword'; -export type RuleTriggerUpdate = { +/** + * + * @export + * @interface RuleTriggerUpdate + */ +export interface RuleTriggerUpdate { + /** + * + * @type {RuleTriggerKeyword} + * @memberof RuleTriggerUpdate + */ type?: RuleTriggerKeyword; /** * The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. + * @type {string} + * @memberof RuleTriggerUpdate */ value?: string; /** * Order of the trigger + * @type {number} + * @memberof RuleTriggerUpdate */ order?: number; /** * If the trigger is active. + * @type {boolean} + * @memberof RuleTriggerUpdate */ active?: boolean; /** * When true, other triggers will not be checked if this trigger was triggered. + * @type {boolean} + * @memberof RuleTriggerUpdate */ - stop_processing?: boolean; -}; + stopProcessing?: boolean; +} + +/** + * Check if a given object implements the RuleTriggerUpdate interface. + */ +export function instanceOfRuleTriggerUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RuleTriggerUpdateFromJSON(json: any): RuleTriggerUpdate { + return RuleTriggerUpdateFromJSONTyped(json, false); +} + +export function RuleTriggerUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleTriggerUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': !exists(json, 'type') ? undefined : RuleTriggerKeywordFromJSON(json['type']), + 'value': !exists(json, 'value') ? undefined : json['value'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'active': !exists(json, 'active') ? undefined : json['active'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + }; +} + +export function RuleTriggerUpdateToJSON(value?: RuleTriggerUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': RuleTriggerKeywordToJSON(value.type), + 'value': value.value, + 'order': value.order, + 'active': value.active, + 'stop_processing': value.stopProcessing, + }; +} diff --git a/src/lib/api/models/RuleUpdate.ts b/src/lib/api/models/RuleUpdate.ts index 7f0bc15..2ebb575 100644 --- a/src/lib/api/models/RuleUpdate.ts +++ b/src/lib/api/models/RuleUpdate.ts @@ -1,34 +1,156 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { RuleActionUpdate } from './RuleActionUpdate'; +import { + RuleActionUpdateFromJSON, + RuleActionUpdateFromJSONTyped, + RuleActionUpdateToJSON, +} from './RuleActionUpdate'; import type { RuleTriggerType } from './RuleTriggerType'; +import { + RuleTriggerTypeFromJSON, + RuleTriggerTypeFromJSONTyped, + RuleTriggerTypeToJSON, +} from './RuleTriggerType'; import type { RuleTriggerUpdate } from './RuleTriggerUpdate'; +import { + RuleTriggerUpdateFromJSON, + RuleTriggerUpdateFromJSONTyped, + RuleTriggerUpdateToJSON, +} from './RuleTriggerUpdate'; -export type RuleUpdate = { +/** + * + * @export + * @interface RuleUpdate + */ +export interface RuleUpdate { + /** + * + * @type {string} + * @memberof RuleUpdate + */ title?: string; + /** + * + * @type {string} + * @memberof RuleUpdate + */ description?: string; /** * ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. + * @type {string} + * @memberof RuleUpdate + */ + ruleGroupId?: string; + /** + * + * @type {number} + * @memberof RuleUpdate */ - rule_group_id?: string; order?: number; + /** + * + * @type {RuleTriggerType} + * @memberof RuleUpdate + */ trigger?: RuleTriggerType; /** * Whether or not the rule is even active. Default is true. + * @type {boolean} + * @memberof RuleUpdate */ active?: boolean; /** * If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. + * @type {boolean} + * @memberof RuleUpdate */ strict?: boolean; /** * If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. + * @type {boolean} + * @memberof RuleUpdate + */ + stopProcessing?: boolean; + /** + * + * @type {Array} + * @memberof RuleUpdate */ - stop_processing?: boolean; triggers?: Array; + /** + * + * @type {Array} + * @memberof RuleUpdate + */ actions?: Array; -}; +} + +/** + * Check if a given object implements the RuleUpdate interface. + */ +export function instanceOfRuleUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RuleUpdateFromJSON(json: any): RuleUpdate { + return RuleUpdateFromJSONTyped(json, false); +} + +export function RuleUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): RuleUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'title': !exists(json, 'title') ? undefined : json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'ruleGroupId': !exists(json, 'rule_group_id') ? undefined : json['rule_group_id'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'trigger': !exists(json, 'trigger') ? undefined : RuleTriggerTypeFromJSON(json['trigger']), + 'active': !exists(json, 'active') ? undefined : json['active'], + 'strict': !exists(json, 'strict') ? undefined : json['strict'], + 'stopProcessing': !exists(json, 'stop_processing') ? undefined : json['stop_processing'], + 'triggers': !exists(json, 'triggers') ? undefined : ((json['triggers'] as Array).map(RuleTriggerUpdateFromJSON)), + 'actions': !exists(json, 'actions') ? undefined : ((json['actions'] as Array).map(RuleActionUpdateFromJSON)), + }; +} + +export function RuleUpdateToJSON(value?: RuleUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'title': value.title, + 'description': value.description, + 'rule_group_id': value.ruleGroupId, + 'order': value.order, + 'trigger': RuleTriggerTypeToJSON(value.trigger), + 'active': value.active, + 'strict': value.strict, + 'stop_processing': value.stopProcessing, + 'triggers': value.triggers === undefined ? undefined : ((value.triggers as Array).map(RuleTriggerUpdateToJSON)), + 'actions': value.actions === undefined ? undefined : ((value.actions as Array).map(RuleActionUpdateToJSON)), + }; +} diff --git a/src/lib/api/models/ShortAccountTypeProperty.ts b/src/lib/api/models/ShortAccountTypeProperty.ts index ab87f76..ba5db9e 100644 --- a/src/lib/api/models/ShortAccountTypeProperty.ts +++ b/src/lib/api/models/ShortAccountTypeProperty.ts @@ -1,19 +1,45 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually. + * @export */ -export enum ShortAccountTypeProperty { - ASSET = 'asset', - EXPENSE = 'expense', - IMPORT = 'import', - REVENUE = 'revenue', - CASH = 'cash', - LIABILITY = 'liability', - LIABILITIES = 'liabilities', - INITIAL_BALANCE = 'initial-balance', - RECONCILIATION = 'reconciliation', +export const ShortAccountTypeProperty = { + Asset: 'asset', + Expense: 'expense', + Import: 'import', + Revenue: 'revenue', + Cash: 'cash', + Liability: 'liability', + Liabilities: 'liabilities', + InitialBalance: 'initial-balance', + Reconciliation: 'reconciliation' +} as const; +export type ShortAccountTypeProperty = typeof ShortAccountTypeProperty[keyof typeof ShortAccountTypeProperty]; + + +export function ShortAccountTypePropertyFromJSON(json: any): ShortAccountTypeProperty { + return ShortAccountTypePropertyFromJSONTyped(json, false); } + +export function ShortAccountTypePropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ShortAccountTypeProperty { + return json as ShortAccountTypeProperty; +} + +export function ShortAccountTypePropertyToJSON(value?: ShortAccountTypeProperty | null): any { + return value as any; +} + diff --git a/src/lib/api/models/StringArrayItem.ts b/src/lib/api/models/StringArrayItem.ts deleted file mode 100644 index 7c69642..0000000 --- a/src/lib/api/models/StringArrayItem.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -/** - * The actual preference content. - */ -export type StringArrayItem = string; diff --git a/src/lib/api/models/SystemInfo.ts b/src/lib/api/models/SystemInfo.ts index 0828fc4..85b382a 100644 --- a/src/lib/api/models/SystemInfo.ts +++ b/src/lib/api/models/SystemInfo.ts @@ -1,15 +1,72 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type SystemInfo = { - data?: { - version?: string; - api_version?: string; - php_version?: string; - os?: string; - driver?: string; +import { exists, mapValues } from '../runtime'; +import type { SystemInfoData } from './SystemInfoData'; +import { + SystemInfoDataFromJSON, + SystemInfoDataFromJSONTyped, + SystemInfoDataToJSON, +} from './SystemInfoData'; + +/** + * + * @export + * @interface SystemInfo + */ +export interface SystemInfo { + /** + * + * @type {SystemInfoData} + * @memberof SystemInfo + */ + data?: SystemInfoData; +} + +/** + * Check if a given object implements the SystemInfo interface. + */ +export function instanceOfSystemInfo(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SystemInfoFromJSON(json: any): SystemInfo { + return SystemInfoFromJSONTyped(json, false); +} + +export function SystemInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): SystemInfo { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': !exists(json, 'data') ? undefined : SystemInfoDataFromJSON(json['data']), + }; +} + +export function SystemInfoToJSON(value?: SystemInfo | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': SystemInfoDataToJSON(value.data), }; -}; +} diff --git a/src/lib/api/models/SystemInfoData.ts b/src/lib/api/models/SystemInfoData.ts new file mode 100644 index 0000000..e0f0055 --- /dev/null +++ b/src/lib/api/models/SystemInfoData.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SystemInfoData + */ +export interface SystemInfoData { + /** + * + * @type {string} + * @memberof SystemInfoData + */ + version?: string; + /** + * + * @type {string} + * @memberof SystemInfoData + */ + apiVersion?: string; + /** + * + * @type {string} + * @memberof SystemInfoData + */ + phpVersion?: string; + /** + * + * @type {string} + * @memberof SystemInfoData + */ + os?: string; + /** + * + * @type {string} + * @memberof SystemInfoData + */ + driver?: string; +} + +/** + * Check if a given object implements the SystemInfoData interface. + */ +export function instanceOfSystemInfoData(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SystemInfoDataFromJSON(json: any): SystemInfoData { + return SystemInfoDataFromJSONTyped(json, false); +} + +export function SystemInfoDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SystemInfoData { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'version': !exists(json, 'version') ? undefined : json['version'], + 'apiVersion': !exists(json, 'api_version') ? undefined : json['api_version'], + 'phpVersion': !exists(json, 'php_version') ? undefined : json['php_version'], + 'os': !exists(json, 'os') ? undefined : json['os'], + 'driver': !exists(json, 'driver') ? undefined : json['driver'], + }; +} + +export function SystemInfoDataToJSON(value?: SystemInfoData | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'version': value.version, + 'api_version': value.apiVersion, + 'php_version': value.phpVersion, + 'os': value.os, + 'driver': value.driver, + }; +} + diff --git a/src/lib/api/models/TagArray.ts b/src/lib/api/models/TagArray.ts index 03488c5..f480ed8 100644 --- a/src/lib/api/models/TagArray.ts +++ b/src/lib/api/models/TagArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { TagRead } from './TagRead'; +import { + TagReadFromJSON, + TagReadFromJSONTyped, + TagReadToJSON, +} from './TagRead'; -export type TagArray = { +/** + * + * @export + * @interface TagArray + */ +export interface TagArray { + /** + * + * @type {Array} + * @memberof TagArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof TagArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof TagArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the TagArray interface. + */ +export function instanceOfTagArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function TagArrayFromJSON(json: any): TagArray { + return TagArrayFromJSONTyped(json, false); +} + +export function TagArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(TagReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function TagArrayToJSON(value?: TagArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(TagReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/TagModel.ts b/src/lib/api/models/TagModel.ts index 2c050be..fc0b223 100644 --- a/src/lib/api/models/TagModel.ts +++ b/src/lib/api/models/TagModel.ts @@ -1,31 +1,120 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type TagModel = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TagModel + */ +export interface TagModel { + /** + * + * @type {Date} + * @memberof TagModel + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof TagModel + */ + readonly updatedAt?: Date; /** * The tag + * @type {string} + * @memberof TagModel */ tag: string; /** * The date to which the tag is applicable. + * @type {Date} + * @memberof TagModel + */ + date?: Date | null; + /** + * + * @type {string} + * @memberof TagModel */ - date?: string | null; description?: string | null; /** * Latitude of the tag's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TagModel */ latitude?: number | null; /** * Latitude of the tag's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TagModel */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + * @type {number} + * @memberof TagModel */ - zoom_level?: number | null; -}; + zoomLevel?: number | null; +} + +/** + * Check if a given object implements the TagModel interface. + */ +export function instanceOfTagModel(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "tag" in value; + + return isInstance; +} + +export function TagModelFromJSON(json: any): TagModel { + return TagModelFromJSONTyped(json, false); +} + +export function TagModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagModel { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'tag': json['tag'], + 'date': !exists(json, 'date') ? undefined : (json['date'] === null ? null : new Date(json['date'])), + 'description': !exists(json, 'description') ? undefined : json['description'], + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + }; +} + +export function TagModelToJSON(value?: TagModel | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'tag': value.tag, + 'date': value.date === undefined ? undefined : (value.date === null ? null : value.date.toISOString().substring(0,10)), + 'description': value.description, + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + }; +} diff --git a/src/lib/api/models/TagModelStore.ts b/src/lib/api/models/TagModelStore.ts index a58e282..792a9c8 100644 --- a/src/lib/api/models/TagModelStore.ts +++ b/src/lib/api/models/TagModelStore.ts @@ -1,29 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type TagModelStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TagModelStore + */ +export interface TagModelStore { /** * The tag + * @type {string} + * @memberof TagModelStore */ tag: string; /** * The date to which the tag is applicable. + * @type {Date} + * @memberof TagModelStore + */ + date?: Date | null; + /** + * + * @type {string} + * @memberof TagModelStore */ - date?: string | null; description?: string | null; /** * Latitude of the tag's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TagModelStore */ latitude?: number | null; /** * Latitude of the tag's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TagModelStore */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + * @type {number} + * @memberof TagModelStore */ - zoom_level?: number | null; -}; + zoomLevel?: number | null; +} + +/** + * Check if a given object implements the TagModelStore interface. + */ +export function instanceOfTagModelStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "tag" in value; + + return isInstance; +} + +export function TagModelStoreFromJSON(json: any): TagModelStore { + return TagModelStoreFromJSONTyped(json, false); +} + +export function TagModelStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagModelStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'tag': json['tag'], + 'date': !exists(json, 'date') ? undefined : (json['date'] === null ? null : new Date(json['date'])), + 'description': !exists(json, 'description') ? undefined : json['description'], + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + }; +} + +export function TagModelStoreToJSON(value?: TagModelStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'tag': value.tag, + 'date': value.date === undefined ? undefined : (value.date === null ? null : value.date.toISOString().substring(0,10)), + 'description': value.description, + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + }; +} diff --git a/src/lib/api/models/TagModelUpdate.ts b/src/lib/api/models/TagModelUpdate.ts index da4617b..aa9fb44 100644 --- a/src/lib/api/models/TagModelUpdate.ts +++ b/src/lib/api/models/TagModelUpdate.ts @@ -1,29 +1,105 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type TagModelUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TagModelUpdate + */ +export interface TagModelUpdate { /** * The tag + * @type {string} + * @memberof TagModelUpdate */ tag?: string; /** * The date to which the tag is applicable. + * @type {Date} + * @memberof TagModelUpdate + */ + date?: Date | null; + /** + * + * @type {string} + * @memberof TagModelUpdate */ - date?: string | null; description?: string | null; /** * Latitude of the tag's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TagModelUpdate */ latitude?: number | null; /** * Latitude of the tag's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TagModelUpdate */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + * @type {number} + * @memberof TagModelUpdate */ - zoom_level?: number | null; -}; + zoomLevel?: number | null; +} + +/** + * Check if a given object implements the TagModelUpdate interface. + */ +export function instanceOfTagModelUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TagModelUpdateFromJSON(json: any): TagModelUpdate { + return TagModelUpdateFromJSONTyped(json, false); +} + +export function TagModelUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagModelUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'tag': !exists(json, 'tag') ? undefined : json['tag'], + 'date': !exists(json, 'date') ? undefined : (json['date'] === null ? null : new Date(json['date'])), + 'description': !exists(json, 'description') ? undefined : json['description'], + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + }; +} + +export function TagModelUpdateToJSON(value?: TagModelUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'tag': value.tag, + 'date': value.date === undefined ? undefined : (value.date === null ? null : value.date.toISOString().substring(0,10)), + 'description': value.description, + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + }; +} diff --git a/src/lib/api/models/TagRead.ts b/src/lib/api/models/TagRead.ts index 65729af..1bd3c73 100644 --- a/src/lib/api/models/TagRead.ts +++ b/src/lib/api/models/TagRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { TagModel } from './TagModel'; +import { + TagModelFromJSON, + TagModelFromJSONTyped, + TagModelToJSON, +} from './TagModel'; -export type TagRead = { +/** + * + * @export + * @interface TagRead + */ +export interface TagRead { /** * Immutable value + * @type {string} + * @memberof TagRead */ type: string; + /** + * + * @type {string} + * @memberof TagRead + */ id: string; + /** + * + * @type {TagModel} + * @memberof TagRead + */ attributes: TagModel; + /** + * + * @type {ObjectLink} + * @memberof TagRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the TagRead interface. + */ +export function instanceOfTagRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function TagReadFromJSON(json: any): TagRead { + return TagReadFromJSONTyped(json, false); +} + +export function TagReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': TagModelFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function TagReadToJSON(value?: TagRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': TagModelToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/TagSingle.ts b/src/lib/api/models/TagSingle.ts index 3668357..4ef714c 100644 --- a/src/lib/api/models/TagSingle.ts +++ b/src/lib/api/models/TagSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TagRead } from './TagRead'; +import { + TagReadFromJSON, + TagReadFromJSONTyped, + TagReadToJSON, +} from './TagRead'; -export type TagSingle = { +/** + * + * @export + * @interface TagSingle + */ +export interface TagSingle { + /** + * + * @type {TagRead} + * @memberof TagSingle + */ data: TagRead; -}; +} + +/** + * Check if a given object implements the TagSingle interface. + */ +export function instanceOfTagSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function TagSingleFromJSON(json: any): TagSingle { + return TagSingleFromJSONTyped(json, false); +} + +export function TagSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': TagReadFromJSON(json['data']), + }; +} + +export function TagSingleToJSON(value?: TagSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': TagReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/Transaction.ts b/src/lib/api/models/Transaction.ts index 076d28e..a76501e 100644 --- a/src/lib/api/models/Transaction.ts +++ b/src/lib/api/models/Transaction.ts @@ -1,21 +1,102 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionSplit } from './TransactionSplit'; +import { + TransactionSplitFromJSON, + TransactionSplitFromJSONTyped, + TransactionSplitToJSON, +} from './TransactionSplit'; -export type Transaction = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Transaction + */ +export interface Transaction { + /** + * + * @type {Date} + * @memberof Transaction + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Transaction + */ + readonly updatedAt?: Date; /** * User ID + * @type {string} + * @memberof Transaction */ readonly user?: string; /** * Title of the transaction if it has been split in more than one piece. Empty otherwise. + * @type {string} + * @memberof Transaction + */ + groupTitle?: string | null; + /** + * + * @type {Array} + * @memberof Transaction */ - group_title?: string | null; transactions: Array; -}; +} + +/** + * Check if a given object implements the Transaction interface. + */ +export function instanceOfTransaction(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "transactions" in value; + + return isInstance; +} + +export function TransactionFromJSON(json: any): Transaction { + return TransactionFromJSONTyped(json, false); +} + +export function TransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Transaction { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'user': !exists(json, 'user') ? undefined : json['user'], + 'groupTitle': !exists(json, 'group_title') ? undefined : json['group_title'], + 'transactions': ((json['transactions'] as Array).map(TransactionSplitFromJSON)), + }; +} + +export function TransactionToJSON(value?: Transaction | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'group_title': value.groupTitle, + 'transactions': ((value.transactions as Array).map(TransactionSplitToJSON)), + }; +} diff --git a/src/lib/api/models/TransactionArray.ts b/src/lib/api/models/TransactionArray.ts index a4b6d10..b711271 100644 --- a/src/lib/api/models/TransactionArray.ts +++ b/src/lib/api/models/TransactionArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { TransactionRead } from './TransactionRead'; +import { + TransactionReadFromJSON, + TransactionReadFromJSONTyped, + TransactionReadToJSON, +} from './TransactionRead'; -export type TransactionArray = { +/** + * + * @export + * @interface TransactionArray + */ +export interface TransactionArray { + /** + * + * @type {Array} + * @memberof TransactionArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof TransactionArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof TransactionArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the TransactionArray interface. + */ +export function instanceOfTransactionArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function TransactionArrayFromJSON(json: any): TransactionArray { + return TransactionArrayFromJSONTyped(json, false); +} + +export function TransactionArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(TransactionReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function TransactionArrayToJSON(value?: TransactionArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(TransactionReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/TransactionLink.ts b/src/lib/api/models/TransactionLink.ts index 73190d8..2aa525c 100644 --- a/src/lib/api/models/TransactionLink.ts +++ b/src/lib/api/models/TransactionLink.ts @@ -1,30 +1,114 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type TransactionLink = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionLink + */ +export interface TransactionLink { + /** + * + * @type {Date} + * @memberof TransactionLink + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof TransactionLink + */ + readonly updatedAt?: Date; /** * The link type ID to use. You can also use the link_type_name field. + * @type {string} + * @memberof TransactionLink */ - link_type_id: string; + linkTypeId: string; /** * The link type name to use. You can also use the link_type_id field. + * @type {string} + * @memberof TransactionLink */ - link_type_name?: string; + linkTypeName?: string; /** * The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. + * @type {string} + * @memberof TransactionLink */ - inward_id: string; + inwardId: string; /** * The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. + * @type {string} + * @memberof TransactionLink */ - outward_id: string; + outwardId: string; /** * Optional. Some notes. + * @type {string} + * @memberof TransactionLink */ notes?: string | null; -}; +} + +/** + * Check if a given object implements the TransactionLink interface. + */ +export function instanceOfTransactionLink(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "linkTypeId" in value; + isInstance = isInstance && "inwardId" in value; + isInstance = isInstance && "outwardId" in value; + + return isInstance; +} + +export function TransactionLinkFromJSON(json: any): TransactionLink { + return TransactionLinkFromJSONTyped(json, false); +} + +export function TransactionLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLink { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'linkTypeId': json['link_type_id'], + 'linkTypeName': !exists(json, 'link_type_name') ? undefined : json['link_type_name'], + 'inwardId': json['inward_id'], + 'outwardId': json['outward_id'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + }; +} + +export function TransactionLinkToJSON(value?: TransactionLink | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'link_type_id': value.linkTypeId, + 'link_type_name': value.linkTypeName, + 'inward_id': value.inwardId, + 'outward_id': value.outwardId, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/TransactionLinkArray.ts b/src/lib/api/models/TransactionLinkArray.ts index bfca8c3..f1d85c8 100644 --- a/src/lib/api/models/TransactionLinkArray.ts +++ b/src/lib/api/models/TransactionLinkArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { TransactionLinkRead } from './TransactionLinkRead'; +import { + TransactionLinkReadFromJSON, + TransactionLinkReadFromJSONTyped, + TransactionLinkReadToJSON, +} from './TransactionLinkRead'; -export type TransactionLinkArray = { +/** + * + * @export + * @interface TransactionLinkArray + */ +export interface TransactionLinkArray { + /** + * + * @type {Array} + * @memberof TransactionLinkArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof TransactionLinkArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof TransactionLinkArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the TransactionLinkArray interface. + */ +export function instanceOfTransactionLinkArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function TransactionLinkArrayFromJSON(json: any): TransactionLinkArray { + return TransactionLinkArrayFromJSONTyped(json, false); +} + +export function TransactionLinkArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLinkArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(TransactionLinkReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function TransactionLinkArrayToJSON(value?: TransactionLinkArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(TransactionLinkReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/TransactionLinkRead.ts b/src/lib/api/models/TransactionLinkRead.ts index fde20cf..df01751 100644 --- a/src/lib/api/models/TransactionLinkRead.ts +++ b/src/lib/api/models/TransactionLinkRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { TransactionLink } from './TransactionLink'; +import { + TransactionLinkFromJSON, + TransactionLinkFromJSONTyped, + TransactionLinkToJSON, +} from './TransactionLink'; -export type TransactionLinkRead = { +/** + * + * @export + * @interface TransactionLinkRead + */ +export interface TransactionLinkRead { /** * Immutable value + * @type {string} + * @memberof TransactionLinkRead */ type: string; + /** + * + * @type {string} + * @memberof TransactionLinkRead + */ id: string; + /** + * + * @type {TransactionLink} + * @memberof TransactionLinkRead + */ attributes: TransactionLink; + /** + * + * @type {ObjectLink} + * @memberof TransactionLinkRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the TransactionLinkRead interface. + */ +export function instanceOfTransactionLinkRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function TransactionLinkReadFromJSON(json: any): TransactionLinkRead { + return TransactionLinkReadFromJSONTyped(json, false); +} + +export function TransactionLinkReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLinkRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': TransactionLinkFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function TransactionLinkReadToJSON(value?: TransactionLinkRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': TransactionLinkToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/TransactionLinkSingle.ts b/src/lib/api/models/TransactionLinkSingle.ts index 84ea94e..95fb8d0 100644 --- a/src/lib/api/models/TransactionLinkSingle.ts +++ b/src/lib/api/models/TransactionLinkSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionLinkRead } from './TransactionLinkRead'; +import { + TransactionLinkReadFromJSON, + TransactionLinkReadFromJSONTyped, + TransactionLinkReadToJSON, +} from './TransactionLinkRead'; -export type TransactionLinkSingle = { +/** + * + * @export + * @interface TransactionLinkSingle + */ +export interface TransactionLinkSingle { + /** + * + * @type {TransactionLinkRead} + * @memberof TransactionLinkSingle + */ data: TransactionLinkRead; -}; +} + +/** + * Check if a given object implements the TransactionLinkSingle interface. + */ +export function instanceOfTransactionLinkSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function TransactionLinkSingleFromJSON(json: any): TransactionLinkSingle { + return TransactionLinkSingleFromJSONTyped(json, false); +} + +export function TransactionLinkSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLinkSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': TransactionLinkReadFromJSON(json['data']), + }; +} + +export function TransactionLinkSingleToJSON(value?: TransactionLinkSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': TransactionLinkReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/TransactionLinkStore.ts b/src/lib/api/models/TransactionLinkStore.ts index 5f59113..2e0c3b9 100644 --- a/src/lib/api/models/TransactionLinkStore.ts +++ b/src/lib/api/models/TransactionLinkStore.ts @@ -1,28 +1,100 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type TransactionLinkStore = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionLinkStore + */ +export interface TransactionLinkStore { /** * The link type ID to use. You can also use the link_type_name field. + * @type {string} + * @memberof TransactionLinkStore */ - link_type_id: string; + linkTypeId: string; /** * The link type name to use. You can also use the link_type_id field. + * @type {string} + * @memberof TransactionLinkStore */ - link_type_name?: string; + linkTypeName?: string; /** * The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. + * @type {string} + * @memberof TransactionLinkStore */ - inward_id: string; + inwardId: string; /** * The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. + * @type {string} + * @memberof TransactionLinkStore */ - outward_id: string; + outwardId: string; /** * Optional. Some notes. + * @type {string} + * @memberof TransactionLinkStore */ notes?: string | null; -}; +} + +/** + * Check if a given object implements the TransactionLinkStore interface. + */ +export function instanceOfTransactionLinkStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "linkTypeId" in value; + isInstance = isInstance && "inwardId" in value; + isInstance = isInstance && "outwardId" in value; + + return isInstance; +} + +export function TransactionLinkStoreFromJSON(json: any): TransactionLinkStore { + return TransactionLinkStoreFromJSONTyped(json, false); +} + +export function TransactionLinkStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLinkStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'linkTypeId': json['link_type_id'], + 'linkTypeName': !exists(json, 'link_type_name') ? undefined : json['link_type_name'], + 'inwardId': json['inward_id'], + 'outwardId': json['outward_id'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + }; +} + +export function TransactionLinkStoreToJSON(value?: TransactionLinkStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'link_type_id': value.linkTypeId, + 'link_type_name': value.linkTypeName, + 'inward_id': value.inwardId, + 'outward_id': value.outwardId, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/TransactionLinkUpdate.ts b/src/lib/api/models/TransactionLinkUpdate.ts index f4b190e..e958bde 100644 --- a/src/lib/api/models/TransactionLinkUpdate.ts +++ b/src/lib/api/models/TransactionLinkUpdate.ts @@ -1,28 +1,97 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type TransactionLinkUpdate = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionLinkUpdate + */ +export interface TransactionLinkUpdate { /** * The link type ID to use. Use this field OR use the link_type_name field. + * @type {string} + * @memberof TransactionLinkUpdate */ - link_type_id?: string; + linkTypeId?: string; /** * The link type name to use. Use this field OR use the link_type_id field. + * @type {string} + * @memberof TransactionLinkUpdate */ - link_type_name?: string; + linkTypeName?: string; /** * The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. + * @type {string} + * @memberof TransactionLinkUpdate */ - inward_id?: string; + inwardId?: string; /** * The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. + * @type {string} + * @memberof TransactionLinkUpdate */ - outward_id?: string; + outwardId?: string; /** * Optional. Some notes. If you submit an empty string the current notes will be removed + * @type {string} + * @memberof TransactionLinkUpdate */ notes?: string | null; -}; +} + +/** + * Check if a given object implements the TransactionLinkUpdate interface. + */ +export function instanceOfTransactionLinkUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TransactionLinkUpdateFromJSON(json: any): TransactionLinkUpdate { + return TransactionLinkUpdateFromJSONTyped(json, false); +} + +export function TransactionLinkUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLinkUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'linkTypeId': !exists(json, 'link_type_id') ? undefined : json['link_type_id'], + 'linkTypeName': !exists(json, 'link_type_name') ? undefined : json['link_type_name'], + 'inwardId': !exists(json, 'inward_id') ? undefined : json['inward_id'], + 'outwardId': !exists(json, 'outward_id') ? undefined : json['outward_id'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + }; +} + +export function TransactionLinkUpdateToJSON(value?: TransactionLinkUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'link_type_id': value.linkTypeId, + 'link_type_name': value.linkTypeName, + 'inward_id': value.inwardId, + 'outward_id': value.outwardId, + 'notes': value.notes, + }; +} diff --git a/src/lib/api/models/TransactionRead.ts b/src/lib/api/models/TransactionRead.ts index cfbbe35..ec87f15 100644 --- a/src/lib/api/models/TransactionRead.ts +++ b/src/lib/api/models/TransactionRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { Transaction } from './Transaction'; +import { + TransactionFromJSON, + TransactionFromJSONTyped, + TransactionToJSON, +} from './Transaction'; -export type TransactionRead = { +/** + * + * @export + * @interface TransactionRead + */ +export interface TransactionRead { /** * Immutable value + * @type {string} + * @memberof TransactionRead */ type: string; + /** + * + * @type {string} + * @memberof TransactionRead + */ id: string; + /** + * + * @type {Transaction} + * @memberof TransactionRead + */ attributes: Transaction; + /** + * + * @type {ObjectLink} + * @memberof TransactionRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the TransactionRead interface. + */ +export function instanceOfTransactionRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function TransactionReadFromJSON(json: any): TransactionRead { + return TransactionReadFromJSONTyped(json, false); +} + +export function TransactionReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': TransactionFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function TransactionReadToJSON(value?: TransactionRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': TransactionToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/TransactionSingle.ts b/src/lib/api/models/TransactionSingle.ts index 03069ff..54e5c47 100644 --- a/src/lib/api/models/TransactionSingle.ts +++ b/src/lib/api/models/TransactionSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionRead } from './TransactionRead'; +import { + TransactionReadFromJSON, + TransactionReadFromJSONTyped, + TransactionReadToJSON, +} from './TransactionRead'; -export type TransactionSingle = { +/** + * + * @export + * @interface TransactionSingle + */ +export interface TransactionSingle { + /** + * + * @type {TransactionRead} + * @memberof TransactionSingle + */ data: TransactionRead; -}; +} + +/** + * Check if a given object implements the TransactionSingle interface. + */ +export function instanceOfTransactionSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function TransactionSingleFromJSON(json: any): TransactionSingle { + return TransactionSingleFromJSONTyped(json, false); +} + +export function TransactionSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': TransactionReadFromJSON(json['data']), + }; +} + +export function TransactionSingleToJSON(value?: TransactionSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': TransactionReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/TransactionSplit.ts b/src/lib/api/models/TransactionSplit.ts index be08e42..3f3aabb 100644 --- a/src/lib/api/models/TransactionSplit.ts +++ b/src/lib/api/models/TransactionSplit.ts @@ -1,212 +1,550 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { AccountTypeProperty } from './AccountTypeProperty'; +import { + AccountTypePropertyFromJSON, + AccountTypePropertyFromJSONTyped, + AccountTypePropertyToJSON, +} from './AccountTypeProperty'; import type { TransactionTypeProperty } from './TransactionTypeProperty'; +import { + TransactionTypePropertyFromJSON, + TransactionTypePropertyFromJSONTyped, + TransactionTypePropertyToJSON, +} from './TransactionTypeProperty'; -export type TransactionSplit = { +/** + * + * @export + * @interface TransactionSplit + */ +export interface TransactionSplit { /** * User ID + * @type {string} + * @memberof TransactionSplit */ readonly user?: string; /** * ID of the underlying transaction journal. Each transaction consists of a transaction group (see the top ID) and one or more journals * making up the splits of the transaction. - * + * @type {string} + * @memberof TransactionSplit + */ + readonly transactionJournalId?: string; + /** + * + * @type {TransactionTypeProperty} + * @memberof TransactionSplit */ - readonly transaction_journal_id?: string; type: TransactionTypeProperty; /** * Date of the transaction + * @type {Date} + * @memberof TransactionSplit */ - date: string; + date: Date; /** * Order of this entry in the list of transactions. + * @type {number} + * @memberof TransactionSplit */ order?: number | null; /** * Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code. + * @type {string} + * @memberof TransactionSplit */ - currency_id?: string | null; + currencyId?: string | null; /** * Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id. + * @type {string} + * @memberof TransactionSplit */ - currency_code?: string | null; - readonly currency_symbol?: string; - readonly currency_name?: string; + currencyCode?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplit + */ + readonly currencySymbol?: string; + /** + * + * @type {string} + * @memberof TransactionSplit + */ + readonly currencyName?: string; /** * Number of decimals used in this currency. + * @type {number} + * @memberof TransactionSplit */ - readonly currency_decimal_places?: number; + readonly currencyDecimalPlaces?: number; /** * Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. + * @type {string} + * @memberof TransactionSplit */ - foreign_currency_id?: string | null; + foreignCurrencyId?: string | null; /** * Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. + * @type {string} + * @memberof TransactionSplit + */ + foreignCurrencyCode?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplit */ - foreign_currency_code?: string | null; - readonly foreign_currency_symbol?: string | null; + readonly foreignCurrencySymbol?: string | null; /** * Number of decimals in the currency + * @type {number} + * @memberof TransactionSplit */ - readonly foreign_currency_decimal_places?: number | null; + readonly foreignCurrencyDecimalPlaces?: number | null; /** * Amount of the transaction. + * @type {string} + * @memberof TransactionSplit */ amount: string; /** * The amount in a foreign currency. + * @type {string} + * @memberof TransactionSplit */ - foreign_amount?: string | null; + foreignAmount?: string | null; /** * Description of the transaction. + * @type {string} + * @memberof TransactionSplit */ description: string; /** * ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. + * @type {string} + * @memberof TransactionSplit */ - source_id: string | null; + sourceId: string | null; /** * Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name. + * @type {string} + * @memberof TransactionSplit + */ + sourceName?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplit + */ + readonly sourceIban?: string | null; + /** + * + * @type {AccountTypeProperty} + * @memberof TransactionSplit */ - source_name?: string | null; - readonly source_iban?: string | null; - source_type?: AccountTypeProperty; + sourceType?: AccountTypeProperty; /** * ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account. + * @type {string} + * @memberof TransactionSplit */ - destination_id: string | null; + destinationId: string | null; /** * Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough. + * @type {string} + * @memberof TransactionSplit + */ + destinationName?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplit */ - destination_name?: string | null; - readonly destination_iban?: string | null; - destination_type?: AccountTypeProperty; + readonly destinationIban?: string | null; + /** + * + * @type {AccountTypeProperty} + * @memberof TransactionSplit + */ + destinationType?: AccountTypeProperty; /** * The budget ID for this transaction. + * @type {string} + * @memberof TransactionSplit */ - budget_id?: string | null; + budgetId?: string | null; /** * The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored. + * @type {string} + * @memberof TransactionSplit */ - readonly budget_name?: string | null; + readonly budgetName?: string | null; /** * The category ID for this transaction. + * @type {string} + * @memberof TransactionSplit */ - category_id?: string | null; + categoryId?: string | null; /** * The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name. + * @type {string} + * @memberof TransactionSplit */ - category_name?: string | null; + categoryName?: string | null; /** * Optional. Use either this or the bill_name + * @type {string} + * @memberof TransactionSplit */ - bill_id?: string | null; + billId?: string | null; /** * Optional. Use either this or the bill_id + * @type {string} + * @memberof TransactionSplit */ - bill_name?: string | null; + billName?: string | null; /** * If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. + * @type {boolean} + * @memberof TransactionSplit */ reconciled?: boolean; + /** + * + * @type {string} + * @memberof TransactionSplit + */ notes?: string | null; /** * Array of tags. + * @type {Array} + * @memberof TransactionSplit */ tags?: Array | null; /** * Reference to internal reference of other systems. + * @type {string} + * @memberof TransactionSplit */ - internal_reference?: string | null; + internalReference?: string | null; /** * Reference to external ID in other systems. + * @type {string} + * @memberof TransactionSplit */ - external_id?: string | null; + externalId?: string | null; /** * External, custom URL for this transaction. + * @type {string} + * @memberof TransactionSplit */ - external_url?: string | null; + externalUrl?: string | null; /** * System generated identifier for original creator of transaction. + * @type {string} + * @memberof TransactionSplit */ - readonly original_source?: string | null; + readonly originalSource?: string | null; /** * Reference to recurrence that made the transaction. + * @type {number} + * @memberof TransactionSplit */ - readonly recurrence_id?: number | null; + readonly recurrenceId?: number | null; /** * Total number of transactions expected to be created by this recurrence repetition. Will be 0 if infinite. + * @type {number} + * @memberof TransactionSplit */ - readonly recurrence_total?: number | null; + readonly recurrenceTotal?: number | null; /** * The # of the current transaction created under this recurrence. + * @type {number} + * @memberof TransactionSplit */ - readonly recurrence_count?: number | null; + readonly recurrenceCount?: number | null; /** * Internal ID of bunq transaction. DEPRECATED + * @type {string} + * @memberof TransactionSplit */ - bunq_payment_id?: string | null; + bunqPaymentId?: string | null; /** * Hash value of original import transaction (for duplicate detection). + * @type {string} + * @memberof TransactionSplit */ - readonly import_hash_v2?: string | null; + readonly importHashV2?: string | null; /** * SEPA Clearing Code + * @type {string} + * @memberof TransactionSplit */ - sepa_cc?: string | null; + sepaCc?: string | null; /** * SEPA Opposing Account Identifier + * @type {string} + * @memberof TransactionSplit */ - sepa_ct_op?: string | null; + sepaCtOp?: string | null; /** * SEPA end-to-end Identifier + * @type {string} + * @memberof TransactionSplit */ - sepa_ct_id?: string | null; + sepaCtId?: string | null; /** * SEPA mandate identifier + * @type {string} + * @memberof TransactionSplit */ - sepa_db?: string | null; + sepaDb?: string | null; /** * SEPA Country + * @type {string} + * @memberof TransactionSplit */ - sepa_country?: string | null; + sepaCountry?: string | null; /** * SEPA External Purpose indicator + * @type {string} + * @memberof TransactionSplit */ - sepa_ep?: string | null; + sepaEp?: string | null; /** * SEPA Creditor Identifier + * @type {string} + * @memberof TransactionSplit */ - sepa_ci?: string | null; + sepaCi?: string | null; /** * SEPA Batch ID + * @type {string} + * @memberof TransactionSplit */ - sepa_batch_id?: string | null; - interest_date?: string | null; - book_date?: string | null; - process_date?: string | null; - due_date?: string | null; - payment_date?: string | null; - invoice_date?: string | null; + sepaBatchId?: string | null; + /** + * + * @type {Date} + * @memberof TransactionSplit + */ + interestDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplit + */ + bookDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplit + */ + processDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplit + */ + dueDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplit + */ + paymentDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplit + */ + invoiceDate?: Date | null; /** * Latitude of the transaction's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TransactionSplit */ latitude?: number | null; /** * Latitude of the transaction's location, if applicable. Can be used to draw a map. + * @type {number} + * @memberof TransactionSplit */ longitude?: number | null; /** * Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + * @type {number} + * @memberof TransactionSplit */ - zoom_level?: number | null; + zoomLevel?: number | null; /** * If the transaction has attachments. + * @type {boolean} + * @memberof TransactionSplit */ - has_attachments?: boolean; -}; + hasAttachments?: boolean; +} + +/** + * Check if a given object implements the TransactionSplit interface. + */ +export function instanceOfTransactionSplit(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "date" in value; + isInstance = isInstance && "amount" in value; + isInstance = isInstance && "description" in value; + isInstance = isInstance && "sourceId" in value; + isInstance = isInstance && "destinationId" in value; + + return isInstance; +} + +export function TransactionSplitFromJSON(json: any): TransactionSplit { + return TransactionSplitFromJSONTyped(json, false); +} + +export function TransactionSplitFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionSplit { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'user': !exists(json, 'user') ? undefined : json['user'], + 'transactionJournalId': !exists(json, 'transaction_journal_id') ? undefined : json['transaction_journal_id'], + 'type': TransactionTypePropertyFromJSON(json['type']), + 'date': (new Date(json['date'])), + 'order': !exists(json, 'order') ? undefined : json['order'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyName': !exists(json, 'currency_name') ? undefined : json['currency_name'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'foreignCurrencyId': !exists(json, 'foreign_currency_id') ? undefined : json['foreign_currency_id'], + 'foreignCurrencyCode': !exists(json, 'foreign_currency_code') ? undefined : json['foreign_currency_code'], + 'foreignCurrencySymbol': !exists(json, 'foreign_currency_symbol') ? undefined : json['foreign_currency_symbol'], + 'foreignCurrencyDecimalPlaces': !exists(json, 'foreign_currency_decimal_places') ? undefined : json['foreign_currency_decimal_places'], + 'amount': json['amount'], + 'foreignAmount': !exists(json, 'foreign_amount') ? undefined : json['foreign_amount'], + 'description': json['description'], + 'sourceId': json['source_id'], + 'sourceName': !exists(json, 'source_name') ? undefined : json['source_name'], + 'sourceIban': !exists(json, 'source_iban') ? undefined : json['source_iban'], + 'sourceType': !exists(json, 'source_type') ? undefined : AccountTypePropertyFromJSON(json['source_type']), + 'destinationId': json['destination_id'], + 'destinationName': !exists(json, 'destination_name') ? undefined : json['destination_name'], + 'destinationIban': !exists(json, 'destination_iban') ? undefined : json['destination_iban'], + 'destinationType': !exists(json, 'destination_type') ? undefined : AccountTypePropertyFromJSON(json['destination_type']), + 'budgetId': !exists(json, 'budget_id') ? undefined : json['budget_id'], + 'budgetName': !exists(json, 'budget_name') ? undefined : json['budget_name'], + 'categoryId': !exists(json, 'category_id') ? undefined : json['category_id'], + 'categoryName': !exists(json, 'category_name') ? undefined : json['category_name'], + 'billId': !exists(json, 'bill_id') ? undefined : json['bill_id'], + 'billName': !exists(json, 'bill_name') ? undefined : json['bill_name'], + 'reconciled': !exists(json, 'reconciled') ? undefined : json['reconciled'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'internalReference': !exists(json, 'internal_reference') ? undefined : json['internal_reference'], + 'externalId': !exists(json, 'external_id') ? undefined : json['external_id'], + 'externalUrl': !exists(json, 'external_url') ? undefined : json['external_url'], + 'originalSource': !exists(json, 'original_source') ? undefined : json['original_source'], + 'recurrenceId': !exists(json, 'recurrence_id') ? undefined : json['recurrence_id'], + 'recurrenceTotal': !exists(json, 'recurrence_total') ? undefined : json['recurrence_total'], + 'recurrenceCount': !exists(json, 'recurrence_count') ? undefined : json['recurrence_count'], + 'bunqPaymentId': !exists(json, 'bunq_payment_id') ? undefined : json['bunq_payment_id'], + 'importHashV2': !exists(json, 'import_hash_v2') ? undefined : json['import_hash_v2'], + 'sepaCc': !exists(json, 'sepa_cc') ? undefined : json['sepa_cc'], + 'sepaCtOp': !exists(json, 'sepa_ct_op') ? undefined : json['sepa_ct_op'], + 'sepaCtId': !exists(json, 'sepa_ct_id') ? undefined : json['sepa_ct_id'], + 'sepaDb': !exists(json, 'sepa_db') ? undefined : json['sepa_db'], + 'sepaCountry': !exists(json, 'sepa_country') ? undefined : json['sepa_country'], + 'sepaEp': !exists(json, 'sepa_ep') ? undefined : json['sepa_ep'], + 'sepaCi': !exists(json, 'sepa_ci') ? undefined : json['sepa_ci'], + 'sepaBatchId': !exists(json, 'sepa_batch_id') ? undefined : json['sepa_batch_id'], + 'interestDate': !exists(json, 'interest_date') ? undefined : (json['interest_date'] === null ? null : new Date(json['interest_date'])), + 'bookDate': !exists(json, 'book_date') ? undefined : (json['book_date'] === null ? null : new Date(json['book_date'])), + 'processDate': !exists(json, 'process_date') ? undefined : (json['process_date'] === null ? null : new Date(json['process_date'])), + 'dueDate': !exists(json, 'due_date') ? undefined : (json['due_date'] === null ? null : new Date(json['due_date'])), + 'paymentDate': !exists(json, 'payment_date') ? undefined : (json['payment_date'] === null ? null : new Date(json['payment_date'])), + 'invoiceDate': !exists(json, 'invoice_date') ? undefined : (json['invoice_date'] === null ? null : new Date(json['invoice_date'])), + 'latitude': !exists(json, 'latitude') ? undefined : json['latitude'], + 'longitude': !exists(json, 'longitude') ? undefined : json['longitude'], + 'zoomLevel': !exists(json, 'zoom_level') ? undefined : json['zoom_level'], + 'hasAttachments': !exists(json, 'has_attachments') ? undefined : json['has_attachments'], + }; +} + +export function TransactionSplitToJSON(value?: TransactionSplit | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': TransactionTypePropertyToJSON(value.type), + 'date': (value.date.toISOString()), + 'order': value.order, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'foreign_currency_id': value.foreignCurrencyId, + 'foreign_currency_code': value.foreignCurrencyCode, + 'amount': value.amount, + 'foreign_amount': value.foreignAmount, + 'description': value.description, + 'source_id': value.sourceId, + 'source_name': value.sourceName, + 'source_type': AccountTypePropertyToJSON(value.sourceType), + 'destination_id': value.destinationId, + 'destination_name': value.destinationName, + 'destination_type': AccountTypePropertyToJSON(value.destinationType), + 'budget_id': value.budgetId, + 'category_id': value.categoryId, + 'category_name': value.categoryName, + 'bill_id': value.billId, + 'bill_name': value.billName, + 'reconciled': value.reconciled, + 'notes': value.notes, + 'tags': value.tags, + 'internal_reference': value.internalReference, + 'external_id': value.externalId, + 'external_url': value.externalUrl, + 'bunq_payment_id': value.bunqPaymentId, + 'sepa_cc': value.sepaCc, + 'sepa_ct_op': value.sepaCtOp, + 'sepa_ct_id': value.sepaCtId, + 'sepa_db': value.sepaDb, + 'sepa_country': value.sepaCountry, + 'sepa_ep': value.sepaEp, + 'sepa_ci': value.sepaCi, + 'sepa_batch_id': value.sepaBatchId, + 'interest_date': value.interestDate === undefined ? undefined : (value.interestDate === null ? null : value.interestDate.toISOString()), + 'book_date': value.bookDate === undefined ? undefined : (value.bookDate === null ? null : value.bookDate.toISOString()), + 'process_date': value.processDate === undefined ? undefined : (value.processDate === null ? null : value.processDate.toISOString()), + 'due_date': value.dueDate === undefined ? undefined : (value.dueDate === null ? null : value.dueDate.toISOString()), + 'payment_date': value.paymentDate === undefined ? undefined : (value.paymentDate === null ? null : value.paymentDate.toISOString()), + 'invoice_date': value.invoiceDate === undefined ? undefined : (value.invoiceDate === null ? null : value.invoiceDate.toISOString()), + 'latitude': value.latitude, + 'longitude': value.longitude, + 'zoom_level': value.zoomLevel, + 'has_attachments': value.hasAttachments, + }; +} diff --git a/src/lib/api/models/TransactionSplitStore.ts b/src/lib/api/models/TransactionSplitStore.ts index 4306016..3aa6c10 100644 --- a/src/lib/api/models/TransactionSplitStore.ts +++ b/src/lib/api/models/TransactionSplitStore.ts @@ -1,158 +1,411 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionTypeProperty } from './TransactionTypeProperty'; +import { + TransactionTypePropertyFromJSON, + TransactionTypePropertyFromJSONTyped, + TransactionTypePropertyToJSON, +} from './TransactionTypeProperty'; -export type TransactionSplitStore = { +/** + * + * @export + * @interface TransactionSplitStore + */ +export interface TransactionSplitStore { + /** + * + * @type {TransactionTypeProperty} + * @memberof TransactionSplitStore + */ type: TransactionTypeProperty; /** * Date of the transaction + * @type {Date} + * @memberof TransactionSplitStore */ - date: string; + date: Date; /** * Amount of the transaction. + * @type {string} + * @memberof TransactionSplitStore */ amount: string; /** * Description of the transaction. + * @type {string} + * @memberof TransactionSplitStore */ description: string; /** * Order of this entry in the list of transactions. + * @type {number} + * @memberof TransactionSplitStore */ order?: number | null; /** * Currency ID. Default is the source account's currency, or the user's default currency. The value you submit may be overruled by the source or destination account. + * @type {string} + * @memberof TransactionSplitStore */ - currency_id?: string | null; + currencyId?: string | null; /** * Currency code. Default is the source account's currency, or the user's default currency. The value you submit may be overruled by the source or destination account. + * @type {string} + * @memberof TransactionSplitStore */ - currency_code?: string | null; + currencyCode?: string | null; /** * The amount in a foreign currency. + * @type {string} + * @memberof TransactionSplitStore */ - foreign_amount?: string | null; + foreignAmount?: string | null; /** * Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. + * @type {string} + * @memberof TransactionSplitStore */ - foreign_currency_id?: string | null; + foreignCurrencyId?: string | null; /** * Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. + * @type {string} + * @memberof TransactionSplitStore */ - foreign_currency_code?: string | null; + foreignCurrencyCode?: string | null; /** * The budget ID for this transaction. + * @type {string} + * @memberof TransactionSplitStore */ - budget_id?: string | null; + budgetId?: string | null; /** * The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored. + * @type {string} + * @memberof TransactionSplitStore */ - readonly budget_name?: string | null; + readonly budgetName?: string | null; /** * The category ID for this transaction. + * @type {string} + * @memberof TransactionSplitStore */ - category_id?: string | null; + categoryId?: string | null; /** * The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name. + * @type {string} + * @memberof TransactionSplitStore */ - category_name?: string | null; + categoryName?: string | null; /** * ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. + * @type {string} + * @memberof TransactionSplitStore */ - source_id?: string | null; + sourceId?: string | null; /** * Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name. + * @type {string} + * @memberof TransactionSplitStore */ - source_name?: string | null; + sourceName?: string | null; /** * ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account. + * @type {string} + * @memberof TransactionSplitStore */ - destination_id?: string | null; + destinationId?: string | null; /** * Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough. + * @type {string} + * @memberof TransactionSplitStore */ - destination_name?: string | null; + destinationName?: string | null; /** * If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. + * @type {boolean} + * @memberof TransactionSplitStore */ reconciled?: boolean; /** * Optional. Use either this or the piggy_bank_name + * @type {number} + * @memberof TransactionSplitStore */ - piggy_bank_id?: number; + piggyBankId?: number; /** * Optional. Use either this or the piggy_bank_id + * @type {string} + * @memberof TransactionSplitStore */ - piggy_bank_name?: string; + piggyBankName?: string; /** * Optional. Use either this or the bill_name + * @type {string} + * @memberof TransactionSplitStore */ - bill_id?: string | null; + billId?: string | null; /** * Optional. Use either this or the bill_id + * @type {string} + * @memberof TransactionSplitStore */ - bill_name?: string | null; + billName?: string | null; /** * Array of tags. + * @type {Array} + * @memberof TransactionSplitStore */ tags?: Array | null; + /** + * + * @type {string} + * @memberof TransactionSplitStore + */ notes?: string | null; /** * Reference to internal reference of other systems. + * @type {string} + * @memberof TransactionSplitStore */ - internal_reference?: string | null; + internalReference?: string | null; /** * Reference to external ID in other systems. + * @type {string} + * @memberof TransactionSplitStore */ - external_id?: string | null; + externalId?: string | null; /** * External, custom URL for this transaction. + * @type {string} + * @memberof TransactionSplitStore */ - external_url?: string | null; + externalUrl?: string | null; /** * Internal ID of bunq transaction. Field is no longer used but still works. + * @type {string} + * @memberof TransactionSplitStore */ - bunq_payment_id?: string | null; + bunqPaymentId?: string | null; /** * SEPA Clearing Code + * @type {string} + * @memberof TransactionSplitStore */ - sepa_cc?: string | null; + sepaCc?: string | null; /** * SEPA Opposing Account Identifier + * @type {string} + * @memberof TransactionSplitStore */ - sepa_ct_op?: string | null; + sepaCtOp?: string | null; /** * SEPA end-to-end Identifier + * @type {string} + * @memberof TransactionSplitStore */ - sepa_ct_id?: string | null; + sepaCtId?: string | null; /** * SEPA mandate identifier + * @type {string} + * @memberof TransactionSplitStore */ - sepa_db?: string | null; + sepaDb?: string | null; /** * SEPA Country + * @type {string} + * @memberof TransactionSplitStore */ - sepa_country?: string | null; + sepaCountry?: string | null; /** * SEPA External Purpose indicator + * @type {string} + * @memberof TransactionSplitStore */ - sepa_ep?: string | null; + sepaEp?: string | null; /** * SEPA Creditor Identifier + * @type {string} + * @memberof TransactionSplitStore */ - sepa_ci?: string | null; + sepaCi?: string | null; /** * SEPA Batch ID + * @type {string} + * @memberof TransactionSplitStore + */ + sepaBatchId?: string | null; + /** + * + * @type {Date} + * @memberof TransactionSplitStore */ - sepa_batch_id?: string | null; - interest_date?: string | null; - book_date?: string | null; - process_date?: string | null; - due_date?: string | null; - payment_date?: string | null; - invoice_date?: string | null; -}; + interestDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitStore + */ + bookDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitStore + */ + processDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitStore + */ + dueDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitStore + */ + paymentDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitStore + */ + invoiceDate?: Date | null; +} + +/** + * Check if a given object implements the TransactionSplitStore interface. + */ +export function instanceOfTransactionSplitStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "date" in value; + isInstance = isInstance && "amount" in value; + isInstance = isInstance && "description" in value; + + return isInstance; +} + +export function TransactionSplitStoreFromJSON(json: any): TransactionSplitStore { + return TransactionSplitStoreFromJSONTyped(json, false); +} + +export function TransactionSplitStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionSplitStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': TransactionTypePropertyFromJSON(json['type']), + 'date': (new Date(json['date'])), + 'amount': json['amount'], + 'description': json['description'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'foreignAmount': !exists(json, 'foreign_amount') ? undefined : json['foreign_amount'], + 'foreignCurrencyId': !exists(json, 'foreign_currency_id') ? undefined : json['foreign_currency_id'], + 'foreignCurrencyCode': !exists(json, 'foreign_currency_code') ? undefined : json['foreign_currency_code'], + 'budgetId': !exists(json, 'budget_id') ? undefined : json['budget_id'], + 'budgetName': !exists(json, 'budget_name') ? undefined : json['budget_name'], + 'categoryId': !exists(json, 'category_id') ? undefined : json['category_id'], + 'categoryName': !exists(json, 'category_name') ? undefined : json['category_name'], + 'sourceId': !exists(json, 'source_id') ? undefined : json['source_id'], + 'sourceName': !exists(json, 'source_name') ? undefined : json['source_name'], + 'destinationId': !exists(json, 'destination_id') ? undefined : json['destination_id'], + 'destinationName': !exists(json, 'destination_name') ? undefined : json['destination_name'], + 'reconciled': !exists(json, 'reconciled') ? undefined : json['reconciled'], + 'piggyBankId': !exists(json, 'piggy_bank_id') ? undefined : json['piggy_bank_id'], + 'piggyBankName': !exists(json, 'piggy_bank_name') ? undefined : json['piggy_bank_name'], + 'billId': !exists(json, 'bill_id') ? undefined : json['bill_id'], + 'billName': !exists(json, 'bill_name') ? undefined : json['bill_name'], + 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'internalReference': !exists(json, 'internal_reference') ? undefined : json['internal_reference'], + 'externalId': !exists(json, 'external_id') ? undefined : json['external_id'], + 'externalUrl': !exists(json, 'external_url') ? undefined : json['external_url'], + 'bunqPaymentId': !exists(json, 'bunq_payment_id') ? undefined : json['bunq_payment_id'], + 'sepaCc': !exists(json, 'sepa_cc') ? undefined : json['sepa_cc'], + 'sepaCtOp': !exists(json, 'sepa_ct_op') ? undefined : json['sepa_ct_op'], + 'sepaCtId': !exists(json, 'sepa_ct_id') ? undefined : json['sepa_ct_id'], + 'sepaDb': !exists(json, 'sepa_db') ? undefined : json['sepa_db'], + 'sepaCountry': !exists(json, 'sepa_country') ? undefined : json['sepa_country'], + 'sepaEp': !exists(json, 'sepa_ep') ? undefined : json['sepa_ep'], + 'sepaCi': !exists(json, 'sepa_ci') ? undefined : json['sepa_ci'], + 'sepaBatchId': !exists(json, 'sepa_batch_id') ? undefined : json['sepa_batch_id'], + 'interestDate': !exists(json, 'interest_date') ? undefined : (json['interest_date'] === null ? null : new Date(json['interest_date'])), + 'bookDate': !exists(json, 'book_date') ? undefined : (json['book_date'] === null ? null : new Date(json['book_date'])), + 'processDate': !exists(json, 'process_date') ? undefined : (json['process_date'] === null ? null : new Date(json['process_date'])), + 'dueDate': !exists(json, 'due_date') ? undefined : (json['due_date'] === null ? null : new Date(json['due_date'])), + 'paymentDate': !exists(json, 'payment_date') ? undefined : (json['payment_date'] === null ? null : new Date(json['payment_date'])), + 'invoiceDate': !exists(json, 'invoice_date') ? undefined : (json['invoice_date'] === null ? null : new Date(json['invoice_date'])), + }; +} + +export function TransactionSplitStoreToJSON(value?: TransactionSplitStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': TransactionTypePropertyToJSON(value.type), + 'date': (value.date.toISOString()), + 'amount': value.amount, + 'description': value.description, + 'order': value.order, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'foreign_amount': value.foreignAmount, + 'foreign_currency_id': value.foreignCurrencyId, + 'foreign_currency_code': value.foreignCurrencyCode, + 'budget_id': value.budgetId, + 'category_id': value.categoryId, + 'category_name': value.categoryName, + 'source_id': value.sourceId, + 'source_name': value.sourceName, + 'destination_id': value.destinationId, + 'destination_name': value.destinationName, + 'reconciled': value.reconciled, + 'piggy_bank_id': value.piggyBankId, + 'piggy_bank_name': value.piggyBankName, + 'bill_id': value.billId, + 'bill_name': value.billName, + 'tags': value.tags, + 'notes': value.notes, + 'internal_reference': value.internalReference, + 'external_id': value.externalId, + 'external_url': value.externalUrl, + 'bunq_payment_id': value.bunqPaymentId, + 'sepa_cc': value.sepaCc, + 'sepa_ct_op': value.sepaCtOp, + 'sepa_ct_id': value.sepaCtId, + 'sepa_db': value.sepaDb, + 'sepa_country': value.sepaCountry, + 'sepa_ep': value.sepaEp, + 'sepa_ci': value.sepaCi, + 'sepa_batch_id': value.sepaBatchId, + 'interest_date': value.interestDate === undefined ? undefined : (value.interestDate === null ? null : value.interestDate.toISOString()), + 'book_date': value.bookDate === undefined ? undefined : (value.bookDate === null ? null : value.bookDate.toISOString()), + 'process_date': value.processDate === undefined ? undefined : (value.processDate === null ? null : value.processDate.toISOString()), + 'due_date': value.dueDate === undefined ? undefined : (value.dueDate === null ? null : value.dueDate.toISOString()), + 'payment_date': value.paymentDate === undefined ? undefined : (value.paymentDate === null ? null : value.paymentDate.toISOString()), + 'invoice_date': value.invoiceDate === undefined ? undefined : (value.invoiceDate === null ? null : value.invoiceDate.toISOString()), + }; +} diff --git a/src/lib/api/models/TransactionSplitUpdate.ts b/src/lib/api/models/TransactionSplitUpdate.ts index ba8558d..b3b6103 100644 --- a/src/lib/api/models/TransactionSplitUpdate.ts +++ b/src/lib/api/models/TransactionSplitUpdate.ts @@ -1,167 +1,450 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionTypeProperty } from './TransactionTypeProperty'; +import { + TransactionTypePropertyFromJSON, + TransactionTypePropertyFromJSONTyped, + TransactionTypePropertyToJSON, +} from './TransactionTypeProperty'; -export type TransactionSplitUpdate = { +/** + * + * @export + * @interface TransactionSplitUpdate + */ +export interface TransactionSplitUpdate { /** * Transaction journal ID of current transaction (split). + * @type {string} + * @memberof TransactionSplitUpdate + */ + transactionJournalId?: string; + /** + * + * @type {TransactionTypeProperty} + * @memberof TransactionSplitUpdate */ - transaction_journal_id?: string; type?: TransactionTypeProperty; /** * Date of the transaction + * @type {Date} + * @memberof TransactionSplitUpdate */ - date?: string; + date?: Date; /** * Amount of the transaction. + * @type {string} + * @memberof TransactionSplitUpdate */ amount?: string; /** * Description of the transaction. + * @type {string} + * @memberof TransactionSplitUpdate */ description?: string; /** * Order of this entry in the list of transactions. + * @type {number} + * @memberof TransactionSplitUpdate */ order?: number | null; /** * Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code. + * @type {string} + * @memberof TransactionSplitUpdate */ - currency_id?: string | null; + currencyId?: string | null; /** * Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id. + * @type {string} + * @memberof TransactionSplitUpdate + */ + currencyCode?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplitUpdate */ - currency_code?: string | null; - readonly currency_symbol?: string; - readonly currency_name?: string; + readonly currencySymbol?: string; + /** + * + * @type {string} + * @memberof TransactionSplitUpdate + */ + readonly currencyName?: string; /** * Number of decimals used in this currency. + * @type {number} + * @memberof TransactionSplitUpdate */ - readonly currency_decimal_places?: number; + readonly currencyDecimalPlaces?: number; /** * The amount in a foreign currency. + * @type {string} + * @memberof TransactionSplitUpdate */ - foreign_amount?: string | null; + foreignAmount?: string | null; /** * Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. + * @type {string} + * @memberof TransactionSplitUpdate */ - foreign_currency_id?: string | null; + foreignCurrencyId?: string | null; /** * Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. + * @type {string} + * @memberof TransactionSplitUpdate + */ + foreignCurrencyCode?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplitUpdate */ - foreign_currency_code?: string | null; - readonly foreign_currency_symbol?: string | null; + readonly foreignCurrencySymbol?: string | null; /** * Number of decimals in the currency + * @type {number} + * @memberof TransactionSplitUpdate */ - readonly foreign_currency_decimal_places?: number | null; + readonly foreignCurrencyDecimalPlaces?: number | null; /** * The budget ID for this transaction. + * @type {string} + * @memberof TransactionSplitUpdate */ - budget_id?: string | null; + budgetId?: string | null; /** * The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored. + * @type {string} + * @memberof TransactionSplitUpdate */ - readonly budget_name?: string | null; + readonly budgetName?: string | null; /** * The category ID for this transaction. + * @type {string} + * @memberof TransactionSplitUpdate */ - category_id?: string | null; + categoryId?: string | null; /** * The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name. + * @type {string} + * @memberof TransactionSplitUpdate */ - category_name?: string | null; + categoryName?: string | null; /** * ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. + * @type {string} + * @memberof TransactionSplitUpdate */ - source_id?: string | null; + sourceId?: string | null; /** * Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name. + * @type {string} + * @memberof TransactionSplitUpdate */ - source_name?: string | null; - source_iban?: string | null; + sourceName?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplitUpdate + */ + sourceIban?: string | null; /** * ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account. + * @type {string} + * @memberof TransactionSplitUpdate */ - destination_id?: string | null; + destinationId?: string | null; /** * Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough. + * @type {string} + * @memberof TransactionSplitUpdate + */ + destinationName?: string | null; + /** + * + * @type {string} + * @memberof TransactionSplitUpdate */ - destination_name?: string | null; - destination_iban?: string | null; + destinationIban?: string | null; /** * If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. + * @type {boolean} + * @memberof TransactionSplitUpdate */ reconciled?: boolean; /** * Optional. Use either this or the bill_name + * @type {string} + * @memberof TransactionSplitUpdate */ - bill_id?: string | null; + billId?: string | null; /** * Optional. Use either this or the bill_id + * @type {string} + * @memberof TransactionSplitUpdate */ - bill_name?: string | null; + billName?: string | null; /** * Array of tags. + * @type {Array} + * @memberof TransactionSplitUpdate */ tags?: Array | null; + /** + * + * @type {string} + * @memberof TransactionSplitUpdate + */ notes?: string | null; /** * Reference to internal reference of other systems. + * @type {string} + * @memberof TransactionSplitUpdate */ - internal_reference?: string | null; + internalReference?: string | null; /** * Reference to external ID in other systems. + * @type {string} + * @memberof TransactionSplitUpdate */ - external_id?: string | null; + externalId?: string | null; /** * External, custom URL for this transaction. + * @type {string} + * @memberof TransactionSplitUpdate */ - external_url?: string | null; + externalUrl?: string | null; /** * Internal ID of bunq transaction. + * @type {string} + * @memberof TransactionSplitUpdate */ - bunq_payment_id?: string | null; + bunqPaymentId?: string | null; /** * SEPA Clearing Code + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_cc?: string | null; + sepaCc?: string | null; /** * SEPA Opposing Account Identifier + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_ct_op?: string | null; + sepaCtOp?: string | null; /** * SEPA end-to-end Identifier + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_ct_id?: string | null; + sepaCtId?: string | null; /** * SEPA mandate identifier + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_db?: string | null; + sepaDb?: string | null; /** * SEPA Country + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_country?: string | null; + sepaCountry?: string | null; /** * SEPA External Purpose indicator + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_ep?: string | null; + sepaEp?: string | null; /** * SEPA Creditor Identifier + * @type {string} + * @memberof TransactionSplitUpdate */ - sepa_ci?: string | null; + sepaCi?: string | null; /** * SEPA Batch ID + * @type {string} + * @memberof TransactionSplitUpdate + */ + sepaBatchId?: string | null; + /** + * + * @type {Date} + * @memberof TransactionSplitUpdate */ - sepa_batch_id?: string | null; - interest_date?: string | null; - book_date?: string | null; - process_date?: string | null; - due_date?: string | null; - payment_date?: string | null; - invoice_date?: string | null; -}; + interestDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitUpdate + */ + bookDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitUpdate + */ + processDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitUpdate + */ + dueDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitUpdate + */ + paymentDate?: Date | null; + /** + * + * @type {Date} + * @memberof TransactionSplitUpdate + */ + invoiceDate?: Date | null; +} + +/** + * Check if a given object implements the TransactionSplitUpdate interface. + */ +export function instanceOfTransactionSplitUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TransactionSplitUpdateFromJSON(json: any): TransactionSplitUpdate { + return TransactionSplitUpdateFromJSONTyped(json, false); +} + +export function TransactionSplitUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionSplitUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'transactionJournalId': !exists(json, 'transaction_journal_id') ? undefined : json['transaction_journal_id'], + 'type': !exists(json, 'type') ? undefined : TransactionTypePropertyFromJSON(json['type']), + 'date': !exists(json, 'date') ? undefined : (new Date(json['date'])), + 'amount': !exists(json, 'amount') ? undefined : json['amount'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'order': !exists(json, 'order') ? undefined : json['order'], + 'currencyId': !exists(json, 'currency_id') ? undefined : json['currency_id'], + 'currencyCode': !exists(json, 'currency_code') ? undefined : json['currency_code'], + 'currencySymbol': !exists(json, 'currency_symbol') ? undefined : json['currency_symbol'], + 'currencyName': !exists(json, 'currency_name') ? undefined : json['currency_name'], + 'currencyDecimalPlaces': !exists(json, 'currency_decimal_places') ? undefined : json['currency_decimal_places'], + 'foreignAmount': !exists(json, 'foreign_amount') ? undefined : json['foreign_amount'], + 'foreignCurrencyId': !exists(json, 'foreign_currency_id') ? undefined : json['foreign_currency_id'], + 'foreignCurrencyCode': !exists(json, 'foreign_currency_code') ? undefined : json['foreign_currency_code'], + 'foreignCurrencySymbol': !exists(json, 'foreign_currency_symbol') ? undefined : json['foreign_currency_symbol'], + 'foreignCurrencyDecimalPlaces': !exists(json, 'foreign_currency_decimal_places') ? undefined : json['foreign_currency_decimal_places'], + 'budgetId': !exists(json, 'budget_id') ? undefined : json['budget_id'], + 'budgetName': !exists(json, 'budget_name') ? undefined : json['budget_name'], + 'categoryId': !exists(json, 'category_id') ? undefined : json['category_id'], + 'categoryName': !exists(json, 'category_name') ? undefined : json['category_name'], + 'sourceId': !exists(json, 'source_id') ? undefined : json['source_id'], + 'sourceName': !exists(json, 'source_name') ? undefined : json['source_name'], + 'sourceIban': !exists(json, 'source_iban') ? undefined : json['source_iban'], + 'destinationId': !exists(json, 'destination_id') ? undefined : json['destination_id'], + 'destinationName': !exists(json, 'destination_name') ? undefined : json['destination_name'], + 'destinationIban': !exists(json, 'destination_iban') ? undefined : json['destination_iban'], + 'reconciled': !exists(json, 'reconciled') ? undefined : json['reconciled'], + 'billId': !exists(json, 'bill_id') ? undefined : json['bill_id'], + 'billName': !exists(json, 'bill_name') ? undefined : json['bill_name'], + 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'notes': !exists(json, 'notes') ? undefined : json['notes'], + 'internalReference': !exists(json, 'internal_reference') ? undefined : json['internal_reference'], + 'externalId': !exists(json, 'external_id') ? undefined : json['external_id'], + 'externalUrl': !exists(json, 'external_url') ? undefined : json['external_url'], + 'bunqPaymentId': !exists(json, 'bunq_payment_id') ? undefined : json['bunq_payment_id'], + 'sepaCc': !exists(json, 'sepa_cc') ? undefined : json['sepa_cc'], + 'sepaCtOp': !exists(json, 'sepa_ct_op') ? undefined : json['sepa_ct_op'], + 'sepaCtId': !exists(json, 'sepa_ct_id') ? undefined : json['sepa_ct_id'], + 'sepaDb': !exists(json, 'sepa_db') ? undefined : json['sepa_db'], + 'sepaCountry': !exists(json, 'sepa_country') ? undefined : json['sepa_country'], + 'sepaEp': !exists(json, 'sepa_ep') ? undefined : json['sepa_ep'], + 'sepaCi': !exists(json, 'sepa_ci') ? undefined : json['sepa_ci'], + 'sepaBatchId': !exists(json, 'sepa_batch_id') ? undefined : json['sepa_batch_id'], + 'interestDate': !exists(json, 'interest_date') ? undefined : (json['interest_date'] === null ? null : new Date(json['interest_date'])), + 'bookDate': !exists(json, 'book_date') ? undefined : (json['book_date'] === null ? null : new Date(json['book_date'])), + 'processDate': !exists(json, 'process_date') ? undefined : (json['process_date'] === null ? null : new Date(json['process_date'])), + 'dueDate': !exists(json, 'due_date') ? undefined : (json['due_date'] === null ? null : new Date(json['due_date'])), + 'paymentDate': !exists(json, 'payment_date') ? undefined : (json['payment_date'] === null ? null : new Date(json['payment_date'])), + 'invoiceDate': !exists(json, 'invoice_date') ? undefined : (json['invoice_date'] === null ? null : new Date(json['invoice_date'])), + }; +} + +export function TransactionSplitUpdateToJSON(value?: TransactionSplitUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'transaction_journal_id': value.transactionJournalId, + 'type': TransactionTypePropertyToJSON(value.type), + 'date': value.date === undefined ? undefined : (value.date.toISOString()), + 'amount': value.amount, + 'description': value.description, + 'order': value.order, + 'currency_id': value.currencyId, + 'currency_code': value.currencyCode, + 'foreign_amount': value.foreignAmount, + 'foreign_currency_id': value.foreignCurrencyId, + 'foreign_currency_code': value.foreignCurrencyCode, + 'budget_id': value.budgetId, + 'category_id': value.categoryId, + 'category_name': value.categoryName, + 'source_id': value.sourceId, + 'source_name': value.sourceName, + 'source_iban': value.sourceIban, + 'destination_id': value.destinationId, + 'destination_name': value.destinationName, + 'destination_iban': value.destinationIban, + 'reconciled': value.reconciled, + 'bill_id': value.billId, + 'bill_name': value.billName, + 'tags': value.tags, + 'notes': value.notes, + 'internal_reference': value.internalReference, + 'external_id': value.externalId, + 'external_url': value.externalUrl, + 'bunq_payment_id': value.bunqPaymentId, + 'sepa_cc': value.sepaCc, + 'sepa_ct_op': value.sepaCtOp, + 'sepa_ct_id': value.sepaCtId, + 'sepa_db': value.sepaDb, + 'sepa_country': value.sepaCountry, + 'sepa_ep': value.sepaEp, + 'sepa_ci': value.sepaCi, + 'sepa_batch_id': value.sepaBatchId, + 'interest_date': value.interestDate === undefined ? undefined : (value.interestDate === null ? null : value.interestDate.toISOString()), + 'book_date': value.bookDate === undefined ? undefined : (value.bookDate === null ? null : value.bookDate.toISOString()), + 'process_date': value.processDate === undefined ? undefined : (value.processDate === null ? null : value.processDate.toISOString()), + 'due_date': value.dueDate === undefined ? undefined : (value.dueDate === null ? null : value.dueDate.toISOString()), + 'payment_date': value.paymentDate === undefined ? undefined : (value.paymentDate === null ? null : value.paymentDate.toISOString()), + 'invoice_date': value.invoiceDate === undefined ? undefined : (value.invoiceDate === null ? null : value.invoiceDate.toISOString()), + }; +} diff --git a/src/lib/api/models/TransactionStore.ts b/src/lib/api/models/TransactionStore.ts index 52aca80..d63cd93 100644 --- a/src/lib/api/models/TransactionStore.ts +++ b/src/lib/api/models/TransactionStore.ts @@ -1,27 +1,105 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionSplitStore } from './TransactionSplitStore'; +import { + TransactionSplitStoreFromJSON, + TransactionSplitStoreFromJSONTyped, + TransactionSplitStoreToJSON, +} from './TransactionSplitStore'; -export type TransactionStore = { +/** + * + * @export + * @interface TransactionStore + */ +export interface TransactionStore { /** * Break if the submitted transaction exists already. + * @type {boolean} + * @memberof TransactionStore */ - error_if_duplicate_hash?: boolean; + errorIfDuplicateHash?: boolean; /** * Whether or not to apply rules when submitting transaction. + * @type {boolean} + * @memberof TransactionStore */ - apply_rules?: boolean; + applyRules?: boolean; /** * Whether or not to fire the webhooks that are related to this event. + * @type {boolean} + * @memberof TransactionStore */ - fire_webhooks?: boolean; + fireWebhooks?: boolean; /** * Title of the transaction if it has been split in more than one piece. Empty otherwise. + * @type {string} + * @memberof TransactionStore + */ + groupTitle?: string | null; + /** + * + * @type {Array} + * @memberof TransactionStore */ - group_title?: string | null; transactions: Array; -}; +} + +/** + * Check if a given object implements the TransactionStore interface. + */ +export function instanceOfTransactionStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "transactions" in value; + + return isInstance; +} + +export function TransactionStoreFromJSON(json: any): TransactionStore { + return TransactionStoreFromJSONTyped(json, false); +} + +export function TransactionStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'errorIfDuplicateHash': !exists(json, 'error_if_duplicate_hash') ? undefined : json['error_if_duplicate_hash'], + 'applyRules': !exists(json, 'apply_rules') ? undefined : json['apply_rules'], + 'fireWebhooks': !exists(json, 'fire_webhooks') ? undefined : json['fire_webhooks'], + 'groupTitle': !exists(json, 'group_title') ? undefined : json['group_title'], + 'transactions': ((json['transactions'] as Array).map(TransactionSplitStoreFromJSON)), + }; +} + +export function TransactionStoreToJSON(value?: TransactionStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'error_if_duplicate_hash': value.errorIfDuplicateHash, + 'apply_rules': value.applyRules, + 'fire_webhooks': value.fireWebhooks, + 'group_title': value.groupTitle, + 'transactions': ((value.transactions as Array).map(TransactionSplitStoreToJSON)), + }; +} diff --git a/src/lib/api/models/TransactionTypeFilter.ts b/src/lib/api/models/TransactionTypeFilter.ts index 881f05b..1bdcc3b 100644 --- a/src/lib/api/models/TransactionTypeFilter.ts +++ b/src/lib/api/models/TransactionTypeFilter.ts @@ -1,21 +1,50 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum TransactionTypeFilter { - ALL = 'all', - WITHDRAWAL = 'withdrawal', - WITHDRAWALS = 'withdrawals', - EXPENSE = 'expense', - DEPOSIT = 'deposit', - DEPOSITS = 'deposits', - INCOME = 'income', - TRANSFER = 'transfer', - TRANSFERS = 'transfers', - OPENING_BALANCE = 'opening_balance', - RECONCILIATION = 'reconciliation', - SPECIAL = 'special', - SPECIALS = 'specials', - DEFAULT = 'default', + +/** + * + * @export + */ +export const TransactionTypeFilter = { + All: 'all', + Withdrawal: 'withdrawal', + Withdrawals: 'withdrawals', + Expense: 'expense', + Deposit: 'deposit', + Deposits: 'deposits', + Income: 'income', + Transfer: 'transfer', + Transfers: 'transfers', + OpeningBalance: 'opening_balance', + Reconciliation: 'reconciliation', + Special: 'special', + Specials: 'specials', + Default: 'default' +} as const; +export type TransactionTypeFilter = typeof TransactionTypeFilter[keyof typeof TransactionTypeFilter]; + + +export function TransactionTypeFilterFromJSON(json: any): TransactionTypeFilter { + return TransactionTypeFilterFromJSONTyped(json, false); +} + +export function TransactionTypeFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionTypeFilter { + return json as TransactionTypeFilter; +} + +export function TransactionTypeFilterToJSON(value?: TransactionTypeFilter | null): any { + return value as any; } + diff --git a/src/lib/api/models/TransactionTypeProperty.ts b/src/lib/api/models/TransactionTypeProperty.ts index b0cd7b3..cabad53 100644 --- a/src/lib/api/models/TransactionTypeProperty.ts +++ b/src/lib/api/models/TransactionTypeProperty.ts @@ -1,12 +1,41 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export enum TransactionTypeProperty { - WITHDRAWAL = 'withdrawal', - DEPOSIT = 'deposit', - TRANSFER = 'transfer', - RECONCILIATION = 'reconciliation', - OPENING_BALANCE = 'opening balance', + +/** + * + * @export + */ +export const TransactionTypeProperty = { + Withdrawal: 'withdrawal', + Deposit: 'deposit', + Transfer: 'transfer', + Reconciliation: 'reconciliation', + OpeningBalance: 'opening balance' +} as const; +export type TransactionTypeProperty = typeof TransactionTypeProperty[keyof typeof TransactionTypeProperty]; + + +export function TransactionTypePropertyFromJSON(json: any): TransactionTypeProperty { + return TransactionTypePropertyFromJSONTyped(json, false); +} + +export function TransactionTypePropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionTypeProperty { + return json as TransactionTypeProperty; +} + +export function TransactionTypePropertyToJSON(value?: TransactionTypeProperty | null): any { + return value as any; } + diff --git a/src/lib/api/models/TransactionUpdate.ts b/src/lib/api/models/TransactionUpdate.ts index 47fee93..3c022b8 100644 --- a/src/lib/api/models/TransactionUpdate.ts +++ b/src/lib/api/models/TransactionUpdate.ts @@ -1,23 +1,96 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { TransactionSplitUpdate } from './TransactionSplitUpdate'; +import { + TransactionSplitUpdateFromJSON, + TransactionSplitUpdateFromJSONTyped, + TransactionSplitUpdateToJSON, +} from './TransactionSplitUpdate'; -export type TransactionUpdate = { +/** + * + * @export + * @interface TransactionUpdate + */ +export interface TransactionUpdate { /** * Whether or not to apply rules when submitting transaction. + * @type {boolean} + * @memberof TransactionUpdate */ - apply_rules?: boolean; + applyRules?: boolean; /** * Whether or not to fire the webhooks that are related to this event. + * @type {boolean} + * @memberof TransactionUpdate */ - fire_webhooks?: boolean; + fireWebhooks?: boolean; /** * Title of the transaction if it has been split in more than one piece. Empty otherwise. + * @type {string} + * @memberof TransactionUpdate + */ + groupTitle?: string | null; + /** + * + * @type {Array} + * @memberof TransactionUpdate */ - group_title?: string | null; transactions?: Array; -}; +} + +/** + * Check if a given object implements the TransactionUpdate interface. + */ +export function instanceOfTransactionUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TransactionUpdateFromJSON(json: any): TransactionUpdate { + return TransactionUpdateFromJSONTyped(json, false); +} + +export function TransactionUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'applyRules': !exists(json, 'apply_rules') ? undefined : json['apply_rules'], + 'fireWebhooks': !exists(json, 'fire_webhooks') ? undefined : json['fire_webhooks'], + 'groupTitle': !exists(json, 'group_title') ? undefined : json['group_title'], + 'transactions': !exists(json, 'transactions') ? undefined : ((json['transactions'] as Array).map(TransactionSplitUpdateFromJSON)), + }; +} + +export function TransactionUpdateToJSON(value?: TransactionUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'apply_rules': value.applyRules, + 'fire_webhooks': value.fireWebhooks, + 'group_title': value.groupTitle, + 'transactions': value.transactions === undefined ? undefined : ((value.transactions as Array).map(TransactionSplitUpdateToJSON)), + }; +} diff --git a/src/lib/api/models/Unauthenticated.ts b/src/lib/api/models/Unauthenticated.ts index c5ee192..20b4d3c 100644 --- a/src/lib/api/models/Unauthenticated.ts +++ b/src/lib/api/models/Unauthenticated.ts @@ -1,10 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type Unauthenticated = { +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Unauthenticated + */ +export interface Unauthenticated { + /** + * + * @type {string} + * @memberof Unauthenticated + */ message?: string; + /** + * + * @type {string} + * @memberof Unauthenticated + */ exception?: string; -}; +} + +/** + * Check if a given object implements the Unauthenticated interface. + */ +export function instanceOfUnauthenticated(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function UnauthenticatedFromJSON(json: any): Unauthenticated { + return UnauthenticatedFromJSONTyped(json, false); +} + +export function UnauthenticatedFromJSONTyped(json: any, ignoreDiscriminator: boolean): Unauthenticated { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'message': !exists(json, 'message') ? undefined : json['message'], + 'exception': !exists(json, 'exception') ? undefined : json['exception'], + }; +} + +export function UnauthenticatedToJSON(value?: Unauthenticated | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'message': value.message, + 'exception': value.exception, + }; +} diff --git a/src/lib/api/models/User.ts b/src/lib/api/models/User.ts index ea30c78..3b9b4b8 100644 --- a/src/lib/api/models/User.ts +++ b/src/lib/api/models/User.ts @@ -1,23 +1,117 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { UserBlockedCodeProperty } from './UserBlockedCodeProperty'; +import { + UserBlockedCodePropertyFromJSON, + UserBlockedCodePropertyFromJSONTyped, + UserBlockedCodePropertyToJSON, +} from './UserBlockedCodeProperty'; import type { UserRoleProperty } from './UserRoleProperty'; +import { + UserRolePropertyFromJSON, + UserRolePropertyFromJSONTyped, + UserRolePropertyToJSON, +} from './UserRoleProperty'; -export type User = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface User + */ +export interface User { + /** + * + * @type {Date} + * @memberof User + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof User + */ + readonly updatedAt?: Date; /** * The new users email address. + * @type {string} + * @memberof User */ email: string; /** * Boolean to indicate if the user is blocked. + * @type {boolean} + * @memberof User */ blocked?: boolean; - blocked_code?: UserBlockedCodeProperty; - role?: UserRoleProperty; -}; + /** + * + * @type {UserBlockedCodeProperty} + * @memberof User + */ + blockedCode?: UserBlockedCodeProperty | null; + /** + * + * @type {UserRoleProperty} + * @memberof User + */ + role?: UserRoleProperty | null; +} + +/** + * Check if a given object implements the User interface. + */ +export function instanceOfUser(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "email" in value; + + return isInstance; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'email': json['email'], + 'blocked': !exists(json, 'blocked') ? undefined : json['blocked'], + 'blockedCode': !exists(json, 'blocked_code') ? undefined : UserBlockedCodePropertyFromJSON(json['blocked_code']), + 'role': !exists(json, 'role') ? undefined : UserRolePropertyFromJSON(json['role']), + }; +} + +export function UserToJSON(value?: User | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'email': value.email, + 'blocked': value.blocked, + 'blocked_code': UserBlockedCodePropertyToJSON(value.blockedCode), + 'role': UserRolePropertyToJSON(value.role), + }; +} diff --git a/src/lib/api/models/UserArray.ts b/src/lib/api/models/UserArray.ts index 4d2696d..6f53348 100644 --- a/src/lib/api/models/UserArray.ts +++ b/src/lib/api/models/UserArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { UserRead } from './UserRead'; +import { + UserReadFromJSON, + UserReadFromJSONTyped, + UserReadToJSON, +} from './UserRead'; -export type UserArray = { +/** + * + * @export + * @interface UserArray + */ +export interface UserArray { + /** + * + * @type {Array} + * @memberof UserArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof UserArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof UserArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the UserArray interface. + */ +export function instanceOfUserArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function UserArrayFromJSON(json: any): UserArray { + return UserArrayFromJSONTyped(json, false); +} + +export function UserArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(UserReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function UserArrayToJSON(value?: UserArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(UserReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/UserBlockedCodeProperty.ts b/src/lib/api/models/UserBlockedCodeProperty.ts index 6d28e9a..5cb7d4d 100644 --- a/src/lib/api/models/UserBlockedCodeProperty.ts +++ b/src/lib/api/models/UserBlockedCodeProperty.ts @@ -1,11 +1,38 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * If you say the user must be blocked, this will be the reason code. + * @export */ -export enum UserBlockedCodeProperty { - EMAIL_CHANGED = 'email_changed', +export const UserBlockedCodeProperty = { + EmailChanged: 'email_changed', + Null: 'null' +} as const; +export type UserBlockedCodeProperty = typeof UserBlockedCodeProperty[keyof typeof UserBlockedCodeProperty]; + + +export function UserBlockedCodePropertyFromJSON(json: any): UserBlockedCodeProperty { + return UserBlockedCodePropertyFromJSONTyped(json, false); } + +export function UserBlockedCodePropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserBlockedCodeProperty { + return json as UserBlockedCodeProperty; +} + +export function UserBlockedCodePropertyToJSON(value?: UserBlockedCodeProperty | null): any { + return value as any; +} + diff --git a/src/lib/api/models/UserRead.ts b/src/lib/api/models/UserRead.ts index 672a022..f1ecf8a 100644 --- a/src/lib/api/models/UserRead.ts +++ b/src/lib/api/models/UserRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, +} from './User'; -export type UserRead = { +/** + * + * @export + * @interface UserRead + */ +export interface UserRead { /** * Immutable value + * @type {string} + * @memberof UserRead */ type: string; + /** + * + * @type {string} + * @memberof UserRead + */ id: string; + /** + * + * @type {User} + * @memberof UserRead + */ attributes: User; + /** + * + * @type {ObjectLink} + * @memberof UserRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the UserRead interface. + */ +export function instanceOfUserRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function UserReadFromJSON(json: any): UserRead { + return UserReadFromJSONTyped(json, false); +} + +export function UserReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': UserFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function UserReadToJSON(value?: UserRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': UserToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/UserRoleProperty.ts b/src/lib/api/models/UserRoleProperty.ts index 2d7ba08..f02100d 100644 --- a/src/lib/api/models/UserRoleProperty.ts +++ b/src/lib/api/models/UserRoleProperty.ts @@ -1,12 +1,39 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Role for the user. Can be empty or omitted. + * @export */ -export enum UserRoleProperty { - OWNER = 'owner', - DEMO = 'demo', +export const UserRoleProperty = { + Owner: 'owner', + Demo: 'demo', + Null: 'null' +} as const; +export type UserRoleProperty = typeof UserRoleProperty[keyof typeof UserRoleProperty]; + + +export function UserRolePropertyFromJSON(json: any): UserRoleProperty { + return UserRolePropertyFromJSONTyped(json, false); } + +export function UserRolePropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRoleProperty { + return json as UserRoleProperty; +} + +export function UserRolePropertyToJSON(value?: UserRoleProperty | null): any { + return value as any; +} + diff --git a/src/lib/api/models/UserSingle.ts b/src/lib/api/models/UserSingle.ts index 7569181..c198739 100644 --- a/src/lib/api/models/UserSingle.ts +++ b/src/lib/api/models/UserSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { UserRead } from './UserRead'; +import { + UserReadFromJSON, + UserReadFromJSONTyped, + UserReadToJSON, +} from './UserRead'; -export type UserSingle = { +/** + * + * @export + * @interface UserSingle + */ +export interface UserSingle { + /** + * + * @type {UserRead} + * @memberof UserSingle + */ data: UserRead; -}; +} + +/** + * Check if a given object implements the UserSingle interface. + */ +export function instanceOfUserSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function UserSingleFromJSON(json: any): UserSingle { + return UserSingleFromJSONTyped(json, false); +} + +export function UserSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': UserReadFromJSON(json['data']), + }; +} + +export function UserSingleToJSON(value?: UserSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': UserReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/ValidationError.ts b/src/lib/api/models/ValidationError.ts index bcf679b..09be693 100644 --- a/src/lib/api/models/ValidationError.ts +++ b/src/lib/api/models/ValidationError.ts @@ -1,21 +1,80 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type ValidationError = { +import { exists, mapValues } from '../runtime'; +import type { ValidationErrorErrors } from './ValidationErrorErrors'; +import { + ValidationErrorErrorsFromJSON, + ValidationErrorErrorsFromJSONTyped, + ValidationErrorErrorsToJSON, +} from './ValidationErrorErrors'; + +/** + * + * @export + * @interface ValidationError + */ +export interface ValidationError { + /** + * + * @type {string} + * @memberof ValidationError + */ message?: string; - errors?: { - email?: Array; - blocked?: Array; - role?: Array; - blocked_code?: Array; - name?: Array; - type?: Array; - iban?: Array; - start?: Array; - end?: Array; - date?: Array; + /** + * + * @type {ValidationErrorErrors} + * @memberof ValidationError + */ + errors?: ValidationErrorErrors; +} + +/** + * Check if a given object implements the ValidationError interface. + */ +export function instanceOfValidationError(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function ValidationErrorFromJSON(json: any): ValidationError { + return ValidationErrorFromJSONTyped(json, false); +} + +export function ValidationErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationError { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'message': !exists(json, 'message') ? undefined : json['message'], + 'errors': !exists(json, 'errors') ? undefined : ValidationErrorErrorsFromJSON(json['errors']), + }; +} + +export function ValidationErrorToJSON(value?: ValidationError | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'message': value.message, + 'errors': ValidationErrorErrorsToJSON(value.errors), }; -}; +} diff --git a/src/lib/api/models/ValidationErrorErrors.ts b/src/lib/api/models/ValidationErrorErrors.ts new file mode 100644 index 0000000..5e2347f --- /dev/null +++ b/src/lib/api/models/ValidationErrorErrors.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidationErrorErrors + */ +export interface ValidationErrorErrors { + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + email?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + blocked?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + role?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + blockedCode?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + name?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + type?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + iban?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + start?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + end?: Array; + /** + * + * @type {Array} + * @memberof ValidationErrorErrors + */ + date?: Array; +} + +/** + * Check if a given object implements the ValidationErrorErrors interface. + */ +export function instanceOfValidationErrorErrors(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function ValidationErrorErrorsFromJSON(json: any): ValidationErrorErrors { + return ValidationErrorErrorsFromJSONTyped(json, false); +} + +export function ValidationErrorErrorsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationErrorErrors { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'email': !exists(json, 'email') ? undefined : json['email'], + 'blocked': !exists(json, 'blocked') ? undefined : json['blocked'], + 'role': !exists(json, 'role') ? undefined : json['role'], + 'blockedCode': !exists(json, 'blocked_code') ? undefined : json['blocked_code'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'type': !exists(json, 'type') ? undefined : json['type'], + 'iban': !exists(json, 'iban') ? undefined : json['iban'], + 'start': !exists(json, 'start') ? undefined : json['start'], + 'end': !exists(json, 'end') ? undefined : json['end'], + 'date': !exists(json, 'date') ? undefined : json['date'], + }; +} + +export function ValidationErrorErrorsToJSON(value?: ValidationErrorErrors | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'email': value.email, + 'blocked': value.blocked, + 'role': value.role, + 'blocked_code': value.blockedCode, + 'name': value.name, + 'type': value.type, + 'iban': value.iban, + 'start': value.start, + 'end': value.end, + 'date': value.date, + }; +} + diff --git a/src/lib/api/models/Webhook.ts b/src/lib/api/models/Webhook.ts index 7fd83b6..04c468a 100644 --- a/src/lib/api/models/Webhook.ts +++ b/src/lib/api/models/Webhook.ts @@ -1,33 +1,150 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookDelivery } from './WebhookDelivery'; +import { + WebhookDeliveryFromJSON, + WebhookDeliveryFromJSONTyped, + WebhookDeliveryToJSON, +} from './WebhookDelivery'; import type { WebhookResponse } from './WebhookResponse'; +import { + WebhookResponseFromJSON, + WebhookResponseFromJSONTyped, + WebhookResponseToJSON, +} from './WebhookResponse'; import type { WebhookTrigger } from './WebhookTrigger'; +import { + WebhookTriggerFromJSON, + WebhookTriggerFromJSONTyped, + WebhookTriggerToJSON, +} from './WebhookTrigger'; -export type Webhook = { - readonly created_at?: string; - readonly updated_at?: string; +/** + * + * @export + * @interface Webhook + */ +export interface Webhook { + /** + * + * @type {Date} + * @memberof Webhook + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof Webhook + */ + readonly updatedAt?: Date; /** * Boolean to indicate if the webhook is active + * @type {boolean} + * @memberof Webhook */ active?: boolean; /** * A title for the webhook for easy recognition. + * @type {string} + * @memberof Webhook */ title: string; /** * A 24-character secret for the webhook. It's generated by Firefly III when saving a new webhook. If you submit a new secret through the PUT endpoint it will generate a new secret for the selected webhook, a new secret bearing no relation to whatever you just submitted. + * @type {string} + * @memberof Webhook */ readonly secret?: string; + /** + * + * @type {WebhookTrigger} + * @memberof Webhook + */ trigger: WebhookTrigger; + /** + * + * @type {WebhookResponse} + * @memberof Webhook + */ response: WebhookResponse; + /** + * + * @type {WebhookDelivery} + * @memberof Webhook + */ delivery: WebhookDelivery; /** * The URL of the webhook. Has to start with `https`. + * @type {string} + * @memberof Webhook */ url: string; -}; +} + +/** + * Check if a given object implements the Webhook interface. + */ +export function instanceOfWebhook(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "trigger" in value; + isInstance = isInstance && "response" in value; + isInstance = isInstance && "delivery" in value; + isInstance = isInstance && "url" in value; + + return isInstance; +} + +export function WebhookFromJSON(json: any): Webhook { + return WebhookFromJSONTyped(json, false); +} + +export function WebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): Webhook { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'active': !exists(json, 'active') ? undefined : json['active'], + 'title': json['title'], + 'secret': !exists(json, 'secret') ? undefined : json['secret'], + 'trigger': WebhookTriggerFromJSON(json['trigger']), + 'response': WebhookResponseFromJSON(json['response']), + 'delivery': WebhookDeliveryFromJSON(json['delivery']), + 'url': json['url'], + }; +} + +export function WebhookToJSON(value?: Webhook | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'active': value.active, + 'title': value.title, + 'trigger': WebhookTriggerToJSON(value.trigger), + 'response': WebhookResponseToJSON(value.response), + 'delivery': WebhookDeliveryToJSON(value.delivery), + 'url': value.url, + }; +} diff --git a/src/lib/api/models/WebhookArray.ts b/src/lib/api/models/WebhookArray.ts index 348f3ec..43744a4 100644 --- a/src/lib/api/models/WebhookArray.ts +++ b/src/lib/api/models/WebhookArray.ts @@ -1,15 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { PageLink } from './PageLink'; +import { + PageLinkFromJSON, + PageLinkFromJSONTyped, + PageLinkToJSON, +} from './PageLink'; import type { WebhookRead } from './WebhookRead'; +import { + WebhookReadFromJSON, + WebhookReadFromJSONTyped, + WebhookReadToJSON, +} from './WebhookRead'; -export type WebhookArray = { +/** + * + * @export + * @interface WebhookArray + */ +export interface WebhookArray { + /** + * + * @type {Array} + * @memberof WebhookArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof WebhookArray + */ meta: Meta; + /** + * + * @type {PageLink} + * @memberof WebhookArray + */ links: PageLink; -}; +} + +/** + * Check if a given object implements the WebhookArray interface. + */ +export function instanceOfWebhookArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function WebhookArrayFromJSON(json: any): WebhookArray { + return WebhookArrayFromJSONTyped(json, false); +} + +export function WebhookArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(WebhookReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + 'links': PageLinkFromJSON(json['links']), + }; +} + +export function WebhookArrayToJSON(value?: WebhookArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(WebhookReadToJSON)), + 'meta': MetaToJSON(value.meta), + 'links': PageLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/WebhookAttempt.ts b/src/lib/api/models/WebhookAttempt.ts index 325735b..f989d66 100644 --- a/src/lib/api/models/WebhookAttempt.ts +++ b/src/lib/api/models/WebhookAttempt.ts @@ -1,26 +1,103 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type WebhookAttempt = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface WebhookAttempt + */ +export interface WebhookAttempt { + /** + * + * @type {Date} + * @memberof WebhookAttempt + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof WebhookAttempt + */ + readonly updatedAt?: Date; /** * The ID of the webhook message this attempt belongs to. + * @type {string} + * @memberof WebhookAttempt */ - webhook_message_id?: string; + webhookMessageId?: string; /** * The HTTP status code of the error, if any. + * @type {number} + * @memberof WebhookAttempt */ - status_code?: number | null; + statusCode?: number | null; /** * Internal log for this attempt. May contain sensitive user data. + * @type {string} + * @memberof WebhookAttempt */ logs?: string | null; /** * Webhook receiver response for this attempt, if any. May contain sensitive user data. + * @type {string} + * @memberof WebhookAttempt */ response?: string | null; -}; +} + +/** + * Check if a given object implements the WebhookAttempt interface. + */ +export function instanceOfWebhookAttempt(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function WebhookAttemptFromJSON(json: any): WebhookAttempt { + return WebhookAttemptFromJSONTyped(json, false); +} + +export function WebhookAttemptFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookAttempt { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'webhookMessageId': !exists(json, 'webhook_message_id') ? undefined : json['webhook_message_id'], + 'statusCode': !exists(json, 'status_code') ? undefined : json['status_code'], + 'logs': !exists(json, 'logs') ? undefined : json['logs'], + 'response': !exists(json, 'response') ? undefined : json['response'], + }; +} + +export function WebhookAttemptToJSON(value?: WebhookAttempt | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'webhook_message_id': value.webhookMessageId, + 'status_code': value.statusCode, + 'logs': value.logs, + 'response': value.response, + }; +} diff --git a/src/lib/api/models/WebhookAttemptArray.ts b/src/lib/api/models/WebhookAttemptArray.ts index fc9a926..cca589e 100644 --- a/src/lib/api/models/WebhookAttemptArray.ts +++ b/src/lib/api/models/WebhookAttemptArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { WebhookAttemptRead } from './WebhookAttemptRead'; +import { + WebhookAttemptReadFromJSON, + WebhookAttemptReadFromJSONTyped, + WebhookAttemptReadToJSON, +} from './WebhookAttemptRead'; -export type WebhookAttemptArray = { +/** + * + * @export + * @interface WebhookAttemptArray + */ +export interface WebhookAttemptArray { + /** + * + * @type {Array} + * @memberof WebhookAttemptArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof WebhookAttemptArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the WebhookAttemptArray interface. + */ +export function instanceOfWebhookAttemptArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function WebhookAttemptArrayFromJSON(json: any): WebhookAttemptArray { + return WebhookAttemptArrayFromJSONTyped(json, false); +} + +export function WebhookAttemptArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookAttemptArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(WebhookAttemptReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function WebhookAttemptArrayToJSON(value?: WebhookAttemptArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(WebhookAttemptReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/WebhookAttemptRead.ts b/src/lib/api/models/WebhookAttemptRead.ts index f6e0dc7..d115fed 100644 --- a/src/lib/api/models/WebhookAttemptRead.ts +++ b/src/lib/api/models/WebhookAttemptRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookAttempt } from './WebhookAttempt'; +import { + WebhookAttemptFromJSON, + WebhookAttemptFromJSONTyped, + WebhookAttemptToJSON, +} from './WebhookAttempt'; -export type WebhookAttemptRead = { +/** + * + * @export + * @interface WebhookAttemptRead + */ +export interface WebhookAttemptRead { /** * Immutable value + * @type {string} + * @memberof WebhookAttemptRead */ type: string; + /** + * + * @type {string} + * @memberof WebhookAttemptRead + */ id: string; + /** + * + * @type {WebhookAttempt} + * @memberof WebhookAttemptRead + */ attributes: WebhookAttempt; -}; +} + +/** + * Check if a given object implements the WebhookAttemptRead interface. + */ +export function instanceOfWebhookAttemptRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function WebhookAttemptReadFromJSON(json: any): WebhookAttemptRead { + return WebhookAttemptReadFromJSONTyped(json, false); +} + +export function WebhookAttemptReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookAttemptRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': WebhookAttemptFromJSON(json['attributes']), + }; +} + +export function WebhookAttemptReadToJSON(value?: WebhookAttemptRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': WebhookAttemptToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/WebhookAttemptSingle.ts b/src/lib/api/models/WebhookAttemptSingle.ts index 3a52347..e4b13d9 100644 --- a/src/lib/api/models/WebhookAttemptSingle.ts +++ b/src/lib/api/models/WebhookAttemptSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookAttemptRead } from './WebhookAttemptRead'; +import { + WebhookAttemptReadFromJSON, + WebhookAttemptReadFromJSONTyped, + WebhookAttemptReadToJSON, +} from './WebhookAttemptRead'; -export type WebhookAttemptSingle = { +/** + * + * @export + * @interface WebhookAttemptSingle + */ +export interface WebhookAttemptSingle { + /** + * + * @type {WebhookAttemptRead} + * @memberof WebhookAttemptSingle + */ data: WebhookAttemptRead; -}; +} + +/** + * Check if a given object implements the WebhookAttemptSingle interface. + */ +export function instanceOfWebhookAttemptSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function WebhookAttemptSingleFromJSON(json: any): WebhookAttemptSingle { + return WebhookAttemptSingleFromJSONTyped(json, false); +} + +export function WebhookAttemptSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookAttemptSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': WebhookAttemptReadFromJSON(json['data']), + }; +} + +export function WebhookAttemptSingleToJSON(value?: WebhookAttemptSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': WebhookAttemptReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/WebhookDelivery.ts b/src/lib/api/models/WebhookDelivery.ts index 5b5ed1a..0d6644f 100644 --- a/src/lib/api/models/WebhookDelivery.ts +++ b/src/lib/api/models/WebhookDelivery.ts @@ -1,11 +1,37 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Format of the delivered response. + * @export */ -export enum WebhookDelivery { - JSON = 'JSON', +export const WebhookDelivery = { + Json: 'JSON' +} as const; +export type WebhookDelivery = typeof WebhookDelivery[keyof typeof WebhookDelivery]; + + +export function WebhookDeliveryFromJSON(json: any): WebhookDelivery { + return WebhookDeliveryFromJSONTyped(json, false); } + +export function WebhookDeliveryFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookDelivery { + return json as WebhookDelivery; +} + +export function WebhookDeliveryToJSON(value?: WebhookDelivery | null): any { + return value as any; +} + diff --git a/src/lib/api/models/WebhookMessage.ts b/src/lib/api/models/WebhookMessage.ts index 3df70c8..37442e6 100644 --- a/src/lib/api/models/WebhookMessage.ts +++ b/src/lib/api/models/WebhookMessage.ts @@ -1,30 +1,111 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ -export type WebhookMessage = { - readonly created_at?: string; - readonly updated_at?: string; +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface WebhookMessage + */ +export interface WebhookMessage { + /** + * + * @type {Date} + * @memberof WebhookMessage + */ + readonly createdAt?: Date; + /** + * + * @type {Date} + * @memberof WebhookMessage + */ + readonly updatedAt?: Date; /** * If this message is sent yet. + * @type {boolean} + * @memberof WebhookMessage */ sent?: boolean; /** * If this message has errored out. + * @type {boolean} + * @memberof WebhookMessage */ errored?: boolean; /** * The ID of the webhook this message belongs to. + * @type {string} + * @memberof WebhookMessage */ - webhook_id?: string; + webhookId?: string; /** * Long UUID string for identification of this webhook message. + * @type {string} + * @memberof WebhookMessage */ uuid?: string; /** * The actual message that is sent or will be sent as JSON string. + * @type {string} + * @memberof WebhookMessage */ string?: string | null; -}; +} + +/** + * Check if a given object implements the WebhookMessage interface. + */ +export function instanceOfWebhookMessage(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function WebhookMessageFromJSON(json: any): WebhookMessage { + return WebhookMessageFromJSONTyped(json, false); +} + +export function WebhookMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookMessage { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), + 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), + 'sent': !exists(json, 'sent') ? undefined : json['sent'], + 'errored': !exists(json, 'errored') ? undefined : json['errored'], + 'webhookId': !exists(json, 'webhook_id') ? undefined : json['webhook_id'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'string': !exists(json, 'string') ? undefined : json['string'], + }; +} + +export function WebhookMessageToJSON(value?: WebhookMessage | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'sent': value.sent, + 'errored': value.errored, + 'webhook_id': value.webhookId, + 'uuid': value.uuid, + 'string': value.string, + }; +} diff --git a/src/lib/api/models/WebhookMessageArray.ts b/src/lib/api/models/WebhookMessageArray.ts index c2295d9..4caf4f6 100644 --- a/src/lib/api/models/WebhookMessageArray.ts +++ b/src/lib/api/models/WebhookMessageArray.ts @@ -1,13 +1,88 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { Meta } from './Meta'; +import { + MetaFromJSON, + MetaFromJSONTyped, + MetaToJSON, +} from './Meta'; import type { WebhookMessageRead } from './WebhookMessageRead'; +import { + WebhookMessageReadFromJSON, + WebhookMessageReadFromJSONTyped, + WebhookMessageReadToJSON, +} from './WebhookMessageRead'; -export type WebhookMessageArray = { +/** + * + * @export + * @interface WebhookMessageArray + */ +export interface WebhookMessageArray { + /** + * + * @type {Array} + * @memberof WebhookMessageArray + */ data: Array; + /** + * + * @type {Meta} + * @memberof WebhookMessageArray + */ meta: Meta; -}; +} + +/** + * Check if a given object implements the WebhookMessageArray interface. + */ +export function instanceOfWebhookMessageArray(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + isInstance = isInstance && "meta" in value; + + return isInstance; +} + +export function WebhookMessageArrayFromJSON(json: any): WebhookMessageArray { + return WebhookMessageArrayFromJSONTyped(json, false); +} + +export function WebhookMessageArrayFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookMessageArray { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': ((json['data'] as Array).map(WebhookMessageReadFromJSON)), + 'meta': MetaFromJSON(json['meta']), + }; +} + +export function WebhookMessageArrayToJSON(value?: WebhookMessageArray | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': ((value.data as Array).map(WebhookMessageReadToJSON)), + 'meta': MetaToJSON(value.meta), + }; +} diff --git a/src/lib/api/models/WebhookMessageRead.ts b/src/lib/api/models/WebhookMessageRead.ts index d9681ba..8618810 100644 --- a/src/lib/api/models/WebhookMessageRead.ts +++ b/src/lib/api/models/WebhookMessageRead.ts @@ -1,16 +1,91 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookMessage } from './WebhookMessage'; +import { + WebhookMessageFromJSON, + WebhookMessageFromJSONTyped, + WebhookMessageToJSON, +} from './WebhookMessage'; -export type WebhookMessageRead = { +/** + * + * @export + * @interface WebhookMessageRead + */ +export interface WebhookMessageRead { /** * Immutable value + * @type {string} + * @memberof WebhookMessageRead */ type: string; + /** + * + * @type {string} + * @memberof WebhookMessageRead + */ id: string; + /** + * + * @type {WebhookMessage} + * @memberof WebhookMessageRead + */ attributes: WebhookMessage; -}; +} + +/** + * Check if a given object implements the WebhookMessageRead interface. + */ +export function instanceOfWebhookMessageRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + + return isInstance; +} + +export function WebhookMessageReadFromJSON(json: any): WebhookMessageRead { + return WebhookMessageReadFromJSONTyped(json, false); +} + +export function WebhookMessageReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookMessageRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': WebhookMessageFromJSON(json['attributes']), + }; +} + +export function WebhookMessageReadToJSON(value?: WebhookMessageRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': WebhookMessageToJSON(value.attributes), + }; +} diff --git a/src/lib/api/models/WebhookMessageSingle.ts b/src/lib/api/models/WebhookMessageSingle.ts index 5a769ef..c0e7b35 100644 --- a/src/lib/api/models/WebhookMessageSingle.ts +++ b/src/lib/api/models/WebhookMessageSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookMessageRead } from './WebhookMessageRead'; +import { + WebhookMessageReadFromJSON, + WebhookMessageReadFromJSONTyped, + WebhookMessageReadToJSON, +} from './WebhookMessageRead'; -export type WebhookMessageSingle = { +/** + * + * @export + * @interface WebhookMessageSingle + */ +export interface WebhookMessageSingle { + /** + * + * @type {WebhookMessageRead} + * @memberof WebhookMessageSingle + */ data: WebhookMessageRead; -}; +} + +/** + * Check if a given object implements the WebhookMessageSingle interface. + */ +export function instanceOfWebhookMessageSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function WebhookMessageSingleFromJSON(json: any): WebhookMessageSingle { + return WebhookMessageSingleFromJSONTyped(json, false); +} + +export function WebhookMessageSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookMessageSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': WebhookMessageReadFromJSON(json['data']), + }; +} + +export function WebhookMessageSingleToJSON(value?: WebhookMessageSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': WebhookMessageReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/WebhookRead.ts b/src/lib/api/models/WebhookRead.ts index 57cc0c8..7e2e7a0 100644 --- a/src/lib/api/models/WebhookRead.ts +++ b/src/lib/api/models/WebhookRead.ts @@ -1,18 +1,106 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { ObjectLink } from './ObjectLink'; +import { + ObjectLinkFromJSON, + ObjectLinkFromJSONTyped, + ObjectLinkToJSON, +} from './ObjectLink'; import type { Webhook } from './Webhook'; +import { + WebhookFromJSON, + WebhookFromJSONTyped, + WebhookToJSON, +} from './Webhook'; -export type WebhookRead = { +/** + * + * @export + * @interface WebhookRead + */ +export interface WebhookRead { /** * Immutable value + * @type {string} + * @memberof WebhookRead */ type: string; + /** + * + * @type {string} + * @memberof WebhookRead + */ id: string; + /** + * + * @type {Webhook} + * @memberof WebhookRead + */ attributes: Webhook; + /** + * + * @type {ObjectLink} + * @memberof WebhookRead + */ links: ObjectLink; -}; +} + +/** + * Check if a given object implements the WebhookRead interface. + */ +export function instanceOfWebhookRead(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "attributes" in value; + isInstance = isInstance && "links" in value; + + return isInstance; +} + +export function WebhookReadFromJSON(json: any): WebhookRead { + return WebhookReadFromJSONTyped(json, false); +} + +export function WebhookReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookRead { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'id': json['id'], + 'attributes': WebhookFromJSON(json['attributes']), + 'links': ObjectLinkFromJSON(json['links']), + }; +} + +export function WebhookReadToJSON(value?: WebhookRead | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'id': value.id, + 'attributes': WebhookToJSON(value.attributes), + 'links': ObjectLinkToJSON(value.links), + }; +} diff --git a/src/lib/api/models/WebhookResponse.ts b/src/lib/api/models/WebhookResponse.ts index 058702e..d8212f2 100644 --- a/src/lib/api/models/WebhookResponse.ts +++ b/src/lib/api/models/WebhookResponse.ts @@ -1,13 +1,39 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * Indicator for what Firefly III will deliver to the webhook URL. + * @export */ -export enum WebhookResponse { - TRANSACTIONS = 'TRANSACTIONS', - ACCOUNTS = 'ACCOUNTS', - NONE = 'NONE', +export const WebhookResponse = { + Transactions: 'TRANSACTIONS', + Accounts: 'ACCOUNTS', + None: 'NONE' +} as const; +export type WebhookResponse = typeof WebhookResponse[keyof typeof WebhookResponse]; + + +export function WebhookResponseFromJSON(json: any): WebhookResponse { + return WebhookResponseFromJSONTyped(json, false); } + +export function WebhookResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookResponse { + return json as WebhookResponse; +} + +export function WebhookResponseToJSON(value?: WebhookResponse | null): any { + return value as any; +} + diff --git a/src/lib/api/models/WebhookSingle.ts b/src/lib/api/models/WebhookSingle.ts index 237034b..115989f 100644 --- a/src/lib/api/models/WebhookSingle.ts +++ b/src/lib/api/models/WebhookSingle.ts @@ -1,11 +1,73 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookRead } from './WebhookRead'; +import { + WebhookReadFromJSON, + WebhookReadFromJSONTyped, + WebhookReadToJSON, +} from './WebhookRead'; -export type WebhookSingle = { +/** + * + * @export + * @interface WebhookSingle + */ +export interface WebhookSingle { + /** + * + * @type {WebhookRead} + * @memberof WebhookSingle + */ data: WebhookRead; -}; +} + +/** + * Check if a given object implements the WebhookSingle interface. + */ +export function instanceOfWebhookSingle(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "data" in value; + + return isInstance; +} + +export function WebhookSingleFromJSON(json: any): WebhookSingle { + return WebhookSingleFromJSONTyped(json, false); +} + +export function WebhookSingleFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookSingle { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'data': WebhookReadFromJSON(json['data']), + }; +} + +export function WebhookSingleToJSON(value?: WebhookSingle | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'data': WebhookReadToJSON(value.data), + }; +} diff --git a/src/lib/api/models/WebhookStore.ts b/src/lib/api/models/WebhookStore.ts index 77f6668..b9df28a 100644 --- a/src/lib/api/models/WebhookStore.ts +++ b/src/lib/api/models/WebhookStore.ts @@ -1,27 +1,129 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookDelivery } from './WebhookDelivery'; +import { + WebhookDeliveryFromJSON, + WebhookDeliveryFromJSONTyped, + WebhookDeliveryToJSON, +} from './WebhookDelivery'; import type { WebhookResponse } from './WebhookResponse'; +import { + WebhookResponseFromJSON, + WebhookResponseFromJSONTyped, + WebhookResponseToJSON, +} from './WebhookResponse'; import type { WebhookTrigger } from './WebhookTrigger'; +import { + WebhookTriggerFromJSON, + WebhookTriggerFromJSONTyped, + WebhookTriggerToJSON, +} from './WebhookTrigger'; -export type WebhookStore = { +/** + * + * @export + * @interface WebhookStore + */ +export interface WebhookStore { /** * Boolean to indicate if the webhook is active + * @type {boolean} + * @memberof WebhookStore */ active?: boolean; /** * A title for the webhook for easy recognition. + * @type {string} + * @memberof WebhookStore */ title: string; + /** + * + * @type {WebhookTrigger} + * @memberof WebhookStore + */ trigger: WebhookTrigger; + /** + * + * @type {WebhookResponse} + * @memberof WebhookStore + */ response: WebhookResponse; + /** + * + * @type {WebhookDelivery} + * @memberof WebhookStore + */ delivery: WebhookDelivery; /** * The URL of the webhook. Has to start with `https`. + * @type {string} + * @memberof WebhookStore */ url: string; -}; +} + +/** + * Check if a given object implements the WebhookStore interface. + */ +export function instanceOfWebhookStore(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "trigger" in value; + isInstance = isInstance && "response" in value; + isInstance = isInstance && "delivery" in value; + isInstance = isInstance && "url" in value; + + return isInstance; +} + +export function WebhookStoreFromJSON(json: any): WebhookStore { + return WebhookStoreFromJSONTyped(json, false); +} + +export function WebhookStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookStore { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'active': !exists(json, 'active') ? undefined : json['active'], + 'title': json['title'], + 'trigger': WebhookTriggerFromJSON(json['trigger']), + 'response': WebhookResponseFromJSON(json['response']), + 'delivery': WebhookDeliveryFromJSON(json['delivery']), + 'url': json['url'], + }; +} + +export function WebhookStoreToJSON(value?: WebhookStore | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'active': value.active, + 'title': value.title, + 'trigger': WebhookTriggerToJSON(value.trigger), + 'response': WebhookResponseToJSON(value.response), + 'delivery': WebhookDeliveryToJSON(value.delivery), + 'url': value.url, + }; +} diff --git a/src/lib/api/models/WebhookTrigger.ts b/src/lib/api/models/WebhookTrigger.ts index 47f8643..5d3ba69 100644 --- a/src/lib/api/models/WebhookTrigger.ts +++ b/src/lib/api/models/WebhookTrigger.ts @@ -1,13 +1,39 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + /** * The trigger for the webhook. + * @export */ -export enum WebhookTrigger { - STORE_TRANSACTION = 'STORE_TRANSACTION', - UPDATE_TRANSACTION = 'UPDATE_TRANSACTION', - DESTROY_TRANSACTION = 'DESTROY_TRANSACTION', +export const WebhookTrigger = { + StoreTransaction: 'STORE_TRANSACTION', + UpdateTransaction: 'UPDATE_TRANSACTION', + DestroyTransaction: 'DESTROY_TRANSACTION' +} as const; +export type WebhookTrigger = typeof WebhookTrigger[keyof typeof WebhookTrigger]; + + +export function WebhookTriggerFromJSON(json: any): WebhookTrigger { + return WebhookTriggerFromJSONTyped(json, false); } + +export function WebhookTriggerFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookTrigger { + return json as WebhookTrigger; +} + +export function WebhookTriggerToJSON(value?: WebhookTrigger | null): any { + return value as any; +} + diff --git a/src/lib/api/models/WebhookUpdate.ts b/src/lib/api/models/WebhookUpdate.ts index ce4f411..cee949c 100644 --- a/src/lib/api/models/WebhookUpdate.ts +++ b/src/lib/api/models/WebhookUpdate.ts @@ -1,31 +1,132 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { exists, mapValues } from '../runtime'; import type { WebhookDelivery } from './WebhookDelivery'; +import { + WebhookDeliveryFromJSON, + WebhookDeliveryFromJSONTyped, + WebhookDeliveryToJSON, +} from './WebhookDelivery'; import type { WebhookResponse } from './WebhookResponse'; +import { + WebhookResponseFromJSON, + WebhookResponseFromJSONTyped, + WebhookResponseToJSON, +} from './WebhookResponse'; import type { WebhookTrigger } from './WebhookTrigger'; +import { + WebhookTriggerFromJSON, + WebhookTriggerFromJSONTyped, + WebhookTriggerToJSON, +} from './WebhookTrigger'; -export type WebhookUpdate = { +/** + * + * @export + * @interface WebhookUpdate + */ +export interface WebhookUpdate { /** * Boolean to indicate if the webhook is active + * @type {boolean} + * @memberof WebhookUpdate */ active?: boolean; /** * A title for the webhook for easy recognition. + * @type {string} + * @memberof WebhookUpdate */ title?: string; /** * A 24-character secret for the webhook. It's generated by Firefly III when saving a new webhook. If you submit a new secret through the PUT endpoint it will generate a new secret for the selected webhook, a new secret bearing no relation to whatever you just submitted. + * @type {string} + * @memberof WebhookUpdate */ secret?: string; + /** + * + * @type {WebhookTrigger} + * @memberof WebhookUpdate + */ trigger?: WebhookTrigger; + /** + * + * @type {WebhookResponse} + * @memberof WebhookUpdate + */ response?: WebhookResponse; + /** + * + * @type {WebhookDelivery} + * @memberof WebhookUpdate + */ delivery?: WebhookDelivery; /** * The URL of the webhook. Has to start with `https`. + * @type {string} + * @memberof WebhookUpdate */ url?: string; -}; +} + +/** + * Check if a given object implements the WebhookUpdate interface. + */ +export function instanceOfWebhookUpdate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function WebhookUpdateFromJSON(json: any): WebhookUpdate { + return WebhookUpdateFromJSONTyped(json, false); +} + +export function WebhookUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookUpdate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'active': !exists(json, 'active') ? undefined : json['active'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'secret': !exists(json, 'secret') ? undefined : json['secret'], + 'trigger': !exists(json, 'trigger') ? undefined : WebhookTriggerFromJSON(json['trigger']), + 'response': !exists(json, 'response') ? undefined : WebhookResponseFromJSON(json['response']), + 'delivery': !exists(json, 'delivery') ? undefined : WebhookDeliveryFromJSON(json['delivery']), + 'url': !exists(json, 'url') ? undefined : json['url'], + }; +} + +export function WebhookUpdateToJSON(value?: WebhookUpdate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'active': value.active, + 'title': value.title, + 'secret': value.secret, + 'trigger': WebhookTriggerToJSON(value.trigger), + 'response': WebhookResponseToJSON(value.response), + 'delivery': WebhookDeliveryToJSON(value.delivery), + 'url': value.url, + }; +} diff --git a/src/lib/api/models/index.ts b/src/lib/api/models/index.ts new file mode 100644 index 0000000..a56f0bc --- /dev/null +++ b/src/lib/api/models/index.ts @@ -0,0 +1,213 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Account'; +export * from './AccountArray'; +export * from './AccountRead'; +export * from './AccountRoleProperty'; +export * from './AccountSearchFieldFilter'; +export * from './AccountSingle'; +export * from './AccountStore'; +export * from './AccountTypeFilter'; +export * from './AccountTypeProperty'; +export * from './AccountUpdate'; +export * from './AttachableType'; +export * from './Attachment'; +export * from './AttachmentArray'; +export * from './AttachmentRead'; +export * from './AttachmentSingle'; +export * from './AttachmentStore'; +export * from './AttachmentUpdate'; +export * from './AutoBudgetPeriod'; +export * from './AutoBudgetType'; +export * from './AutocompleteAccount'; +export * from './AutocompleteBill'; +export * from './AutocompleteBudget'; +export * from './AutocompleteCategory'; +export * from './AutocompleteCurrency'; +export * from './AutocompleteCurrencyCode'; +export * from './AutocompleteObjectGroup'; +export * from './AutocompletePiggy'; +export * from './AutocompletePiggyBalance'; +export * from './AutocompleteRecurrence'; +export * from './AutocompleteRule'; +export * from './AutocompleteRuleGroup'; +export * from './AutocompleteTag'; +export * from './AutocompleteTransaction'; +export * from './AutocompleteTransactionID'; +export * from './AutocompleteTransactionType'; +export * from './AvailableBudget'; +export * from './AvailableBudgetArray'; +export * from './AvailableBudgetRead'; +export * from './AvailableBudgetSingle'; +export * from './BadRequest'; +export * from './BasicSummaryEntry'; +export * from './Bill'; +export * from './BillArray'; +export * from './BillPaidDatesInner'; +export * from './BillRead'; +export * from './BillRepeatFrequency'; +export * from './BillSingle'; +export * from './BillStore'; +export * from './BillUpdate'; +export * from './Budget'; +export * from './BudgetArray'; +export * from './BudgetLimit'; +export * from './BudgetLimitArray'; +export * from './BudgetLimitRead'; +export * from './BudgetLimitSingle'; +export * from './BudgetLimitStore'; +export * from './BudgetRead'; +export * from './BudgetSingle'; +export * from './BudgetSpent'; +export * from './BudgetStore'; +export * from './BudgetUpdate'; +export * from './Category'; +export * from './CategoryArray'; +export * from './CategoryEarned'; +export * from './CategoryRead'; +export * from './CategorySingle'; +export * from './CategorySpent'; +export * from './CategoryUpdate'; +export * from './ChartDataPoint'; +export * from './ChartDataSet'; +export * from './ConfigValueFilter'; +export * from './ConfigValueUpdateFilter'; +export * from './ConfigurationSingle'; +export * from './ConfigurationUpdate'; +export * from './CreditCardType'; +export * from './CronResult'; +export * from './CronResultRow'; +export * from './Currency'; +export * from './CurrencyArray'; +export * from './CurrencyRead'; +export * from './CurrencySingle'; +export * from './CurrencyStore'; +export * from './CurrencyUpdate'; +export * from './DataDestroyObject'; +export * from './ExportFileFilter'; +export * from './InsightGroupEntry'; +export * from './InsightTotalEntry'; +export * from './InsightTransferEntry'; +export * from './InterestPeriod'; +export * from './InternalException'; +export * from './LiabilityDirection'; +export * from './LiabilityType'; +export * from './LinkType'; +export * from './LinkTypeArray'; +export * from './LinkTypeRead'; +export * from './LinkTypeSingle'; +export * from './LinkTypeUpdate'; +export * from './Meta'; +export * from './MetaPagination'; +export * from './ModelConfiguration'; +export * from './NotFound'; +export * from './ObjectGroup'; +export * from './ObjectGroupArray'; +export * from './ObjectGroupRead'; +export * from './ObjectGroupSingle'; +export * from './ObjectGroupUpdate'; +export * from './ObjectLink'; +export * from './ObjectLink0'; +export * from './PageLink'; +export * from './PiggyBank'; +export * from './PiggyBankArray'; +export * from './PiggyBankEvent'; +export * from './PiggyBankEventArray'; +export * from './PiggyBankEventRead'; +export * from './PiggyBankRead'; +export * from './PiggyBankSingle'; +export * from './PiggyBankStore'; +export * from './PiggyBankUpdate'; +export * from './PolymorphicProperty'; +export * from './Preference'; +export * from './PreferenceArray'; +export * from './PreferenceRead'; +export * from './PreferenceSingle'; +export * from './PreferenceUpdate'; +export * from './Recurrence'; +export * from './RecurrenceArray'; +export * from './RecurrenceRead'; +export * from './RecurrenceRepetition'; +export * from './RecurrenceRepetitionStore'; +export * from './RecurrenceRepetitionType'; +export * from './RecurrenceRepetitionUpdate'; +export * from './RecurrenceSingle'; +export * from './RecurrenceStore'; +export * from './RecurrenceTransaction'; +export * from './RecurrenceTransactionStore'; +export * from './RecurrenceTransactionType'; +export * from './RecurrenceTransactionUpdate'; +export * from './RecurrenceUpdate'; +export * from './Rule'; +export * from './RuleAction'; +export * from './RuleActionKeyword'; +export * from './RuleActionStore'; +export * from './RuleActionUpdate'; +export * from './RuleArray'; +export * from './RuleGroup'; +export * from './RuleGroupArray'; +export * from './RuleGroupRead'; +export * from './RuleGroupSingle'; +export * from './RuleGroupStore'; +export * from './RuleGroupUpdate'; +export * from './RuleRead'; +export * from './RuleSingle'; +export * from './RuleStore'; +export * from './RuleTrigger'; +export * from './RuleTriggerKeyword'; +export * from './RuleTriggerStore'; +export * from './RuleTriggerType'; +export * from './RuleTriggerUpdate'; +export * from './RuleUpdate'; +export * from './ShortAccountTypeProperty'; +export * from './SystemInfo'; +export * from './SystemInfoData'; +export * from './TagArray'; +export * from './TagModel'; +export * from './TagModelStore'; +export * from './TagModelUpdate'; +export * from './TagRead'; +export * from './TagSingle'; +export * from './Transaction'; +export * from './TransactionArray'; +export * from './TransactionLink'; +export * from './TransactionLinkArray'; +export * from './TransactionLinkRead'; +export * from './TransactionLinkSingle'; +export * from './TransactionLinkStore'; +export * from './TransactionLinkUpdate'; +export * from './TransactionRead'; +export * from './TransactionSingle'; +export * from './TransactionSplit'; +export * from './TransactionSplitStore'; +export * from './TransactionSplitUpdate'; +export * from './TransactionStore'; +export * from './TransactionTypeFilter'; +export * from './TransactionTypeProperty'; +export * from './TransactionUpdate'; +export * from './Unauthenticated'; +export * from './User'; +export * from './UserArray'; +export * from './UserBlockedCodeProperty'; +export * from './UserRead'; +export * from './UserRoleProperty'; +export * from './UserSingle'; +export * from './ValidationError'; +export * from './ValidationErrorErrors'; +export * from './Webhook'; +export * from './WebhookArray'; +export * from './WebhookAttempt'; +export * from './WebhookAttemptArray'; +export * from './WebhookAttemptRead'; +export * from './WebhookAttemptSingle'; +export * from './WebhookDelivery'; +export * from './WebhookMessage'; +export * from './WebhookMessageArray'; +export * from './WebhookMessageRead'; +export * from './WebhookMessageSingle'; +export * from './WebhookRead'; +export * from './WebhookResponse'; +export * from './WebhookSingle'; +export * from './WebhookStore'; +export * from './WebhookTrigger'; +export * from './WebhookUpdate'; diff --git a/src/lib/api/request.ts b/src/lib/api/request.ts deleted file mode 100644 index 8f57d68..0000000 --- a/src/lib/api/request.ts +++ /dev/null @@ -1,353 +0,0 @@ -/** - * This file is copied to ./core during the client generation process, and is - * preserved between builds. - */ - -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-nocheck - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isDefined = ( - value: T | null | undefined -): value is NonNullable> => { - return value !== undefined && value !== null; -}; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: unknown): value is Blob => { - return ( - isDefined(value) && - typeof value === 'object' && - 'type' in value && - typeof value.type === 'string' && - 'stream' in value && - typeof value.stream === 'function' && - 'arrayBuffer' in value && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - Symbol.toStringTag in value && - /^(Blob|File)$/.test(value[Symbol.toStringTag] as string) - ); -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const process = (key: string, value: unknown) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach((v) => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; - - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); - - if (qs.length > 0) { - return `?${qs.join('&')}`; - } - - return ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path && Object.hasOwn(options.path, group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async ( - options: ApiRequestOptions, - resolver?: T | Resolver -): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async ( - config: OpenAPIConfig, - options: ApiRequestOptions -): Promise => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers - }) - .filter(([_, value]) => isDefined(value)) - .reduce( - (headers, [key, value]) => ({ - ...headers, - [key]: String(value) - }), - {} as Record - ); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -type RequestBody = string | Blob | FormData | undefined; - -export const getRequestBody = (options: ApiRequestOptions): RequestBody => { - if (options.body !== undefined) { - if (options.mediaType?.includes('/json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: RequestBody, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - const request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = ( - response: Response, - responseHeader?: string -): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const jsonTypes = [ - 'application/json', - 'application/problem+json', - 'application/vnd.api+json' - ]; - const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type)); - if (isJSON) { - return await response.json(); - } else { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors - }; - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError( - options, - result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = ( - config: OpenAPIConfig, - options: ApiRequestOptions -): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - const response = await sendRequest(config, options, url, body, formData, headers, onCancel); - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/src/lib/api/runtime.ts b/src/lib/api/runtime.ts new file mode 100644 index 0000000..b8fa581 --- /dev/null +++ b/src/lib/api/runtime.ts @@ -0,0 +1,431 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Firefly III API v2.0.10 + * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-10-15T12:13:25+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.0.10 + * Contact: james@firefly-iii.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "https://demo.firefly-iii.org/api".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/src/lib/api/services/AboutService.ts b/src/lib/api/services/AboutService.ts deleted file mode 100644 index 0d74628..0000000 --- a/src/lib/api/services/AboutService.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CronResult } from '../models/CronResult'; -import type { SystemInfo } from '../models/SystemInfo'; -import type { UserSingle } from '../models/UserSingle'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class AboutService { - - /** - * System information end point. - * Returns general system information and versions of the (supporting) software. - * - * @param xTraceId Unique identifier associated with this request. - * @returns SystemInfo The available system information - * @throws ApiError - */ - public static getAbout( - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/about', - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Currently authenticated user endpoint. - * Returns the currently authenticated user. - * - * @param xTraceId Unique identifier associated with this request. - * @returns UserSingle The user - * @throws ApiError - */ - public static getCurrentUser( - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/about/user', - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Cron job endpoint - * Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint - * to run the cron. The cron requires the CLI token to be present. The cron job will fire for all - * users. - * - * @param cliToken The CLI token of any user in Firefly III, required to run the cron job. - * @param xTraceId Unique identifier associated with this request. - * @param date A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it's running - * on another day. - * - * @param force Forces the cron job to fire, regardless of whether it has fired before. This may result - * in double transactions or weird budgets, so be careful. - * - * @returns CronResult The result of the cron job(s) firing. - * @throws ApiError - */ - public static getCron( - cliToken: string, - xTraceId?: string, - date?: string, - force?: boolean, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/cron/{cliToken}', - path: { - 'cliToken': cliToken, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'date': date, - 'force': force, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/AccountsService.ts b/src/lib/api/services/AccountsService.ts deleted file mode 100644 index ff16482..0000000 --- a/src/lib/api/services/AccountsService.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AccountArray } from '../models/AccountArray'; -import type { AccountSingle } from '../models/AccountSingle'; -import type { AccountStore } from '../models/AccountStore'; -import type { AccountTypeFilter } from '../models/AccountTypeFilter'; -import type { AccountUpdate } from '../models/AccountUpdate'; -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { PiggyBankArray } from '../models/PiggyBankArray'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class AccountsService { - - /** - * List all transactions related to the account. - * This endpoint returns a list of all the transactions connected to the account. - * - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param type Optional filter on the transaction type(s) returned. - * @returns TransactionArray A list of transactions - * @throws ApiError - */ - public static listTransactionByAccount( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/accounts/{id}/transactions', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Lists all attachments. - * Lists all attachments. - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByAccount( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/accounts/{id}/attachments', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all piggy banks related to the account. - * This endpoint returns a list of all the piggy banks connected to the account. - * - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns PiggyBankArray A list of piggy banks - * @throws ApiError - */ - public static listPiggyBankByAccount( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/accounts/{id}/piggy-banks', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all accounts. - * This endpoint returns a list of all the accounts owned by the authenticated user. - * - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param date A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day. - * - * @param type Optional filter on the account type(s) returned - * @returns AccountArray A list of accounts - * @throws ApiError - */ - public static listAccount( - xTraceId?: string, - limit?: number, - page?: number, - date?: string, - type?: AccountTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/accounts', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'date': date, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Create new account. - * Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). - * @param requestBody JSON array with the necessary account information or key=value pairs. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns AccountSingle New account stored, result in response. - * @throws ApiError - */ - public static storeAccount( - requestBody: AccountStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/accounts', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get single account. - * Returns a single account by its ID. - * - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @param date A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day. - * - * @returns AccountSingle The requested account - * @throws ApiError - */ - public static getAccount( - id: string, - xTraceId?: string, - date?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/accounts/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'date': date, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing account. - * Used to update a single account. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. - * - * @param id The ID of the account. - * @param requestBody JSON array or formdata with updated account information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns AccountSingle Updated account stored, result in response - * @throws ApiError - */ - public static updateAccount( - id: string, - requestBody: AccountUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/accounts/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Permanently delete account. - * Will permanently delete an account. Any associated transactions and piggy banks are ALSO deleted. Cannot be recovered from. - * - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteAccount( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/accounts/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/AttachmentsService.ts b/src/lib/api/services/AttachmentsService.ts deleted file mode 100644 index 0ba2fe5..0000000 --- a/src/lib/api/services/AttachmentsService.ts +++ /dev/null @@ -1,246 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { AttachmentSingle } from '../models/AttachmentSingle'; -import type { AttachmentStore } from '../models/AttachmentStore'; -import type { AttachmentUpdate } from '../models/AttachmentUpdate'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class AttachmentsService { - - /** - * List all attachments. - * This endpoint lists all attachments. - * - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments. - * @throws ApiError - */ - public static listAttachment( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/attachments', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new attachment. - * Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object. - * - * @param requestBody JSON array or key=value pairs with the necessary attachment information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns AttachmentSingle New attachment stored, result in response. - * @throws ApiError - */ - public static storeAttachment( - requestBody: AttachmentStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/attachments', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single attachment. - * Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below). - * - * @param id The ID of the attachment. - * @param xTraceId Unique identifier associated with this request. - * @returns AttachmentSingle The requested attachment - * @throws ApiError - */ - public static getAttachment( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/attachments/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing attachment. - * Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below. - * - * @param id The ID of the attachment. - * @param requestBody JSON array with updated attachment information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns AttachmentSingle Updated attachment stored, result in response - * @throws ApiError - */ - public static updateAttachment( - id: string, - requestBody: AttachmentUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/attachments/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete an attachment. - * With this endpoint you delete an attachment, including any stored file data. - * - * @param id The ID of the single attachment. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteAttachment( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/attachments/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Download a single attachment. - * This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type "application/octet-stream" and content disposition "attachment; filename=example.pdf". - * - * @param id The ID of the attachment. - * @param xTraceId Unique identifier associated with this request. - * @returns binary The requested attachment - * @throws ApiError - */ - public static downloadAttachment( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/attachments/{id}/download', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Upload an attachment. - * Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data. - * - * @param id The ID of the attachment. - * @param xTraceId Unique identifier associated with this request. - * @param requestBody - * @returns void - * @throws ApiError - */ - public static uploadAttachment( - id: string, - xTraceId?: string, - requestBody?: Blob, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/attachments/{id}/upload', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/octet-stream', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/AutocompleteService.ts b/src/lib/api/services/AutocompleteService.ts deleted file mode 100644 index be5904b..0000000 --- a/src/lib/api/services/AutocompleteService.ts +++ /dev/null @@ -1,547 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AccountTypeFilter } from '../models/AccountTypeFilter'; -import type { AutocompleteAccountArray } from '../models/AutocompleteAccountArray'; -import type { AutocompleteBillArray } from '../models/AutocompleteBillArray'; -import type { AutocompleteBudgetArray } from '../models/AutocompleteBudgetArray'; -import type { AutocompleteCategoryArray } from '../models/AutocompleteCategoryArray'; -import type { AutocompleteCurrencyArray } from '../models/AutocompleteCurrencyArray'; -import type { AutocompleteCurrencyCodeArray } from '../models/AutocompleteCurrencyCodeArray'; -import type { AutocompleteObjectGroupArray } from '../models/AutocompleteObjectGroupArray'; -import type { AutocompletePiggyArray } from '../models/AutocompletePiggyArray'; -import type { AutocompletePiggyBalanceArray } from '../models/AutocompletePiggyBalanceArray'; -import type { AutocompleteRecurrenceArray } from '../models/AutocompleteRecurrenceArray'; -import type { AutocompleteRuleArray } from '../models/AutocompleteRuleArray'; -import type { AutocompleteRuleGroupArray } from '../models/AutocompleteRuleGroupArray'; -import type { AutocompleteTagArray } from '../models/AutocompleteTagArray'; -import type { AutocompleteTransactionArray } from '../models/AutocompleteTransactionArray'; -import type { AutocompleteTransactionIDArray } from '../models/AutocompleteTransactionIDArray'; -import type { AutocompleteTransactionTypeArray } from '../models/AutocompleteTransactionTypeArray'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class AutocompleteService { - - /** - * Returns all accounts of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @param date If the account is an asset account or a liability, the autocomplete will also return the balance of the account on this date. - * @param types Optional filter on the account type(s) used in the autocomplete. - * @returns AutocompleteAccountArray A list of accounts with very basic information. - * @throws ApiError - */ - public static getAccountsAc( - xTraceId?: string, - query?: string, - limit?: number, - date?: string, - types?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/accounts', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - 'date': date, - 'types': types, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all bills of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteBillArray A list of bills with very basic information. - * @throws ApiError - */ - public static getBillsAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/bills', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all budgets of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteBudgetArray A list of budgets with very basic information. - * @throws ApiError - */ - public static getBudgetsAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/budgets', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all categories of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteCategoryArray A list of categories with very basic information. - * @throws ApiError - */ - public static getCategoriesAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/categories', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all currencies of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteCurrencyArray A list of currencies with very basic information. - * @throws ApiError - */ - public static getCurrenciesAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/currencies', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteCurrencyCodeArray A list of currencies with very basic information and the currency code between brackets. This endpoint is DEPRECATED and I suggest you DO NOT use it. - * @throws ApiError - */ - public static getCurrenciesCodeAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/currencies-with-code', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all object groups of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteObjectGroupArray A list of object groups with very basic information. - * @throws ApiError - */ - public static getObjectGroupsAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/object-groups', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all piggy banks of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompletePiggyArray A list of piggy banks with very basic information. - * @throws ApiError - */ - public static getPiggiesAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/piggy-banks', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompletePiggyBalanceArray A list of piggy banks with very basic balance information. - * @throws ApiError - */ - public static getPiggiesBalanceAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/piggy-banks-with-balance', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all recurring transactions of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteRecurrenceArray A list of recurring transactions with very basic information. - * @throws ApiError - */ - public static getRecurringAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/recurring', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all rule groups of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteRuleGroupArray A list of rule groups with very basic information. - * @throws ApiError - */ - public static getRuleGroupsAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/rule-groups', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all rules of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteRuleArray A list of rules with very basic information. - * @throws ApiError - */ - public static getRulesAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/rules', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all tags of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteTagArray A list of tags with very basic information. - * @throws ApiError - */ - public static getTagAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/tags', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all transaction types returned in a basic auto-complete array. English only. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteTransactionTypeArray A list of transaction types with very basic information. - * @throws ApiError - */ - public static getTransactionTypesAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/transaction-types', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all transaction descriptions of the user returned in a basic auto-complete array. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteTransactionArray A list of transaction descriptions with very basic information. - * @throws ApiError - */ - public static getTransactionsAc( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/transactions', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. - * @param xTraceId Unique identifier associated with this request. - * @param query The autocomplete search query. - * @param limit The number of items returned. - * @returns AutocompleteTransactionIDArray A list of transactions with very basic information. This endpoint is DEPRECATED and I suggest you DO NOT use it. - * @throws ApiError - */ - public static getTransactionsIdac( - xTraceId?: string, - query?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/autocomplete/transactions-with-id', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'query': query, - 'limit': limit, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/AvailableBudgetsService.ts b/src/lib/api/services/AvailableBudgetsService.ts deleted file mode 100644 index c3ac4d2..0000000 --- a/src/lib/api/services/AvailableBudgetsService.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AvailableBudgetArray } from '../models/AvailableBudgetArray'; -import type { AvailableBudgetSingle } from '../models/AvailableBudgetSingle'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class AvailableBudgetsService { - - /** - * List all available budget amounts. - * Firefly III allows users to set the amount that is available to be budgeted in so-called "available budgets". For example, the user could have 1200,- available to be divided during the coming month. This amount is used on the /budgets page. This endpoint returns all of these amounts and the periods for which they are set. - * - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @returns AvailableBudgetArray A list of available budget amounts. - * @throws ApiError - */ - public static listAvailableBudget( - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/available-budgets', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single available budget. - * Get a single available budget, by ID. - * @param id The ID of the available budget. - * @param xTraceId Unique identifier associated with this request. - * @returns AvailableBudgetSingle The requested available budget - * @throws ApiError - */ - public static getAvailableBudget( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/available-budgets/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/BillsService.ts b/src/lib/api/services/BillsService.ts deleted file mode 100644 index b47a2e2..0000000 --- a/src/lib/api/services/BillsService.ts +++ /dev/null @@ -1,307 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { BillArray } from '../models/BillArray'; -import type { BillSingle } from '../models/BillSingle'; -import type { BillStore } from '../models/BillStore'; -import type { BillUpdate } from '../models/BillUpdate'; -import type { RuleArray } from '../models/RuleArray'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class BillsService { - - /** - * List all attachments uploaded to the bill. - * This endpoint will list all attachments linked to the bill. - * @param id The ID of the bill. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByBill( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/bills/{id}/attachments', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all rules associated with the bill. - * This endpoint will list all rules that have an action to set the bill to this bill. - * @param id The ID of the bill. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleArray A list of rules - * @throws ApiError - */ - public static listRuleByBill( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/bills/{id}/rules', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all transactions associated with the bill. - * This endpoint will list all transactions linked to this bill. - * @param id The ID of the bill. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param type Optional filter on the transaction type(s) returned - * @returns TransactionArray A list of transactions - * @throws ApiError - */ - public static listTransactionByBill( - id: string, - xTraceId?: string, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/bills/{id}/transactions', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all bills. - * This endpoint will list all the user's bills. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. If it is are added to the request, Firefly III will calculate the appropriate payment and paid dates. - * - * @param end A date formatted YYYY-MM-DD. If it is added to the request, Firefly III will calculate the appropriate payment and paid dates. - * - * @returns BillArray A list of bills - * @throws ApiError - */ - public static listBill( - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/bills', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new bill - * Creates a new bill. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary bill information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns BillSingle New bill stored, result in response. - * @throws ApiError - */ - public static storeBill( - requestBody: BillStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/bills', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single bill. - * Get a single bill. - * @param id The ID of the bill. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD. If it is are added to the request, Firefly III will calculate the appropriate payment and paid dates. - * - * @param end A date formatted YYYY-MM-DD. If it is added to the request, Firefly III will calculate the appropriate payment and paid dates. - * - * @returns BillSingle The requested bill - * @throws ApiError - */ - public static getBill( - id: string, - xTraceId?: string, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/bills/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing bill. - * Update existing bill. - * @param id The ID of the bill. - * @param requestBody JSON array or key=value pairs with updated bill information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns BillSingle Updated bill stored, result in response - * @throws ApiError - */ - public static updateBill( - id: string, - requestBody: BillUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/bills/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a bill. - * Delete a bill. This will not delete any associated rules. Will not remove associated transactions. WILL remove all associated attachments. - * @param id The ID of the bill. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteBill( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/bills/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/BudgetsService.ts b/src/lib/api/services/BudgetsService.ts deleted file mode 100644 index f02a146..0000000 --- a/src/lib/api/services/BudgetsService.ts +++ /dev/null @@ -1,545 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { BudgetArray } from '../models/BudgetArray'; -import type { BudgetLimit } from '../models/BudgetLimit'; -import type { BudgetLimitArray } from '../models/BudgetLimitArray'; -import type { BudgetLimitSingle } from '../models/BudgetLimitSingle'; -import type { BudgetLimitStore } from '../models/BudgetLimitStore'; -import type { BudgetSingle } from '../models/BudgetSingle'; -import type { BudgetStore } from '../models/BudgetStore'; -import type { BudgetUpdate } from '../models/BudgetUpdate'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class BudgetsService { - - /** - * List all transactions by a budget limit ID. - * List all the transactions within one budget limit. The start and end date are dictated by the budget limit. - * @param id The ID of the budget. The budget limit MUST be associated to the budget ID. - * @param limitId The ID of the budget limit. The budget limit MUST be associated to the budget ID. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param type Optional filter on the transaction type(s) returned - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static listTransactionByBudgetLimit( - id: string, - limitId: string, - xTraceId?: string, - limit?: number, - page?: number, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets/{id}/limits/{limitId}/transactions', - path: { - 'id': id, - 'limitId': limitId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get all limits for a budget. - * Get all budget limits for this budget and the money spent, and money left. You can limit the list by submitting a date range as well. The "spent" array for each budget limit is NOT influenced by the start and end date of your query, but by the start and end date of the budget limit itself. - * - * @param id The ID of the requested budget. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @returns BudgetLimitArray A list of budget limits applicable to this budget. - * @throws ApiError - */ - public static listBudgetLimitByBudget( - id: string, - xTraceId?: string, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets/{id}/limits', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store new budget limit. - * Store a new budget limit under this budget. - * @param id The ID of the budget. - * @param requestBody JSON array or key=value pairs with the necessary budget information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns BudgetLimitSingle New budget limit stored, result in response. - * @throws ApiError - */ - public static storeBudgetLimit( - id: string, - requestBody: BudgetLimitStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/budgets/{id}/limits', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get single budget limit. - * @param id The ID of the budget. The budget limit MUST be associated to the budget ID. - * @param limitId The ID of the budget limit. The budget limit MUST be associated to the budget ID. - * @param xTraceId Unique identifier associated with this request. - * @returns BudgetLimitSingle The requested budget limit - * @throws ApiError - */ - public static getBudgetLimit( - id: string, - limitId: number, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets/{id}/limits/{limitId}', - path: { - 'id': id, - 'limitId': limitId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing budget limit. - * Update existing budget limit. - * @param id The ID of the budget. The budget limit MUST be associated to the budget ID. - * @param limitId The ID of the budget limit. The budget limit MUST be associated to the budget ID. - * @param requestBody JSON array with updated budget limit information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns BudgetLimitSingle Updated budget limit stored, result in response - * @throws ApiError - */ - public static updateBudgetLimit( - id: string, - limitId: string, - requestBody: BudgetLimit, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/budgets/{id}/limits/{limitId}', - path: { - 'id': id, - 'limitId': limitId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a budget limit. - * Delete a budget limit. - * @param id The ID of the budget. The budget limit MUST be associated to the budget ID. - * @param limitId The ID of the budget limit. The budget limit MUST be associated to the budget ID. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteBudgetLimit( - id: string, - limitId: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/budgets/{id}/limits/{limitId}', - path: { - 'id': id, - 'limitId': limitId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get list of budget limits by date - * Get all budget limits for for this date range. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @returns BudgetLimitArray A list of budget limits. - * @throws ApiError - */ - public static listBudgetLimit( - start: string, - end: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budget-limits', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * All transactions to a budget. - * Get all transactions linked to a budget, possibly limited by start and end - * @param id The ID of the budget. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param type Optional filter on the transaction type(s) returned - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static listTransactionByBudget( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets/{id}/transactions', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Lists all attachments of a budget. - * Lists all attachments. - * @param id The ID of the budget. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByBudget( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets/{id}/attachments', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all budgets. - * List all the budgets the user has made. If the start date and end date are submitted as well, the "spent" array will be updated accordingly. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD, to get info on how much the user has spent. You must submit both start and end. - * - * @param end A date formatted YYYY-MM-DD, to get info on how much the user has spent. You must submit both start and end. - * - * @returns BudgetArray A list of budgets. - * @throws ApiError - */ - public static listBudget( - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new budget - * Creates a new budget. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary budget information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns BudgetSingle New budget stored, result in response. - * @throws ApiError - */ - public static storeBudget( - requestBody: BudgetStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/budgets', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single budget. - * Get a single budget. If the start date and end date are submitted as well, the "spent" array will be updated accordingly. - * @param id The ID of the requested budget. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD, to get info on how much the user has spent. - * - * @param end A date formatted YYYY-MM-DD, to get info on how much the user has spent. - * - * @returns BudgetSingle The requested budget - * @throws ApiError - */ - public static getBudget( - id: string, - xTraceId?: string, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/budgets/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing budget. - * Update existing budget. This endpoint cannot be used to set budget amount limits. - * @param id The ID of the budget. - * @param requestBody JSON array with updated budget information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns BudgetSingle Updated budget stored, result in response - * @throws ApiError - */ - public static updateBudget( - id: string, - requestBody: BudgetUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/budgets/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a budget. - * Delete a budget. Transactions will not be deleted. - * @param id The ID of the budget. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteBudget( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/budgets/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/CategoriesService.ts b/src/lib/api/services/CategoriesService.ts deleted file mode 100644 index 0521d49..0000000 --- a/src/lib/api/services/CategoriesService.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { Category } from '../models/Category'; -import type { CategoryArray } from '../models/CategoryArray'; -import type { CategorySingle } from '../models/CategorySingle'; -import type { CategoryUpdate } from '../models/CategoryUpdate'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class CategoriesService { - - /** - * List all transactions in a category. - * List all transactions in a category, optionally limited to the date ranges specified. - * @param id The ID of the category. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD, to limit the result list. - * - * @param end A date formatted YYYY-MM-DD, to limit the result list. - * - * @param type Optional filter on the transaction type(s) returned - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static listTransactionByCategory( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/categories/{id}/transactions', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Lists all attachments. - * Lists all attachments. - * @param id The ID of the category. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByCategory( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/categories/{id}/attachments', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all categories. - * List all categories. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns CategoryArray A list of categories. - * @throws ApiError - */ - public static listCategory( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/categories', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new category - * Creates a new category. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary category information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns CategorySingle New category stored, result in response. - * @throws ApiError - */ - public static storeCategory( - requestBody: Category, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/categories', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single category. - * Get a single category. - * @param id The ID of the category. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD, to show spent and earned info. - * - * @param end A date formatted YYYY-MM-DD, to show spent and earned info. - * - * @returns CategorySingle The requested category - * @throws ApiError - */ - public static getCategory( - id: string, - xTraceId?: string, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/categories/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing category. - * Update existing category. - * @param id The ID of the category. - * @param requestBody JSON array with updated category information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns CategorySingle Updated category stored, result in response - * @throws ApiError - */ - public static updateCategory( - id: string, - requestBody: CategoryUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/categories/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a category. - * Delete a category. Transactions will not be removed. - * @param id The ID of the category. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteCategory( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/categories/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/ChartsService.ts b/src/lib/api/services/ChartsService.ts deleted file mode 100644 index 17beb37..0000000 --- a/src/lib/api/services/ChartsService.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ChartLine } from '../models/ChartLine'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class ChartsService { - - /** - * Dashboard chart with asset account balance information. - * This endpoint returns the data required to generate a chart with basic asset account balance information. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @returns ChartLine Line chart oriented chart information. Check out the model for more details. Each entry is a line (or bar) in the chart. - * @throws ApiError - */ - public static getChartAccountOverview( - start: string, - end: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/chart/account/overview', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/ConfigurationService.ts b/src/lib/api/services/ConfigurationService.ts deleted file mode 100644 index 6bc3d05..0000000 --- a/src/lib/api/services/ConfigurationService.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ConfigurationArray } from '../models/ConfigurationArray'; -import type { ConfigurationSingle } from '../models/ConfigurationSingle'; -import type { ConfigurationUpdate } from '../models/ConfigurationUpdate'; -import type { ConfigValueFilter } from '../models/ConfigValueFilter'; -import type { ConfigValueUpdateFilter } from '../models/ConfigValueUpdateFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class ConfigurationService { - - /** - * Get Firefly III system configuration values. - * Returns all editable and not-editable configuration values for this Firefly III installation - * @param xTraceId Unique identifier associated with this request. - * @returns ConfigurationArray System configuration values - * @throws ApiError - */ - public static getConfiguration( - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/configuration', - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single Firefly III system configuration value - * Returns one configuration variable for this Firefly III installation - * @param name The name of the configuration value you want to know. - * @param xTraceId Unique identifier associated with this request. - * @returns ConfigurationSingle One system configuration value - * @throws ApiError - */ - public static getSingleConfiguration( - name: ConfigValueFilter, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/configuration/{name}', - path: { - 'name': name, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update configuration value - * Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small. - * @param name The name of the configuration value you want to update. - * @param formData JSON array with the necessary account information or key=value pairs. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns ConfigurationSingle New configuration value stored, result in response. - * @throws ApiError - */ - public static setConfiguration( - name: ConfigValueUpdateFilter, - formData: ConfigurationUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/configuration/{name}', - path: { - 'name': name, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - formData: formData, - mediaType: 'application/x-www-form-urlencoded', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/CurrenciesService.ts b/src/lib/api/services/CurrenciesService.ts deleted file mode 100644 index 7900e05..0000000 --- a/src/lib/api/services/CurrenciesService.ts +++ /dev/null @@ -1,589 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AccountArray } from '../models/AccountArray'; -import type { AccountTypeFilter } from '../models/AccountTypeFilter'; -import type { AvailableBudgetArray } from '../models/AvailableBudgetArray'; -import type { BillArray } from '../models/BillArray'; -import type { BudgetLimitArray } from '../models/BudgetLimitArray'; -import type { CurrencyArray } from '../models/CurrencyArray'; -import type { CurrencySingle } from '../models/CurrencySingle'; -import type { CurrencyStore } from '../models/CurrencyStore'; -import type { CurrencyUpdate } from '../models/CurrencyUpdate'; -import type { RecurrenceArray } from '../models/RecurrenceArray'; -import type { RuleArray } from '../models/RuleArray'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class CurrenciesService { - - /** - * List all accounts with this currency. - * List all accounts with this currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param date A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day. - * - * @param type Optional filter on the account type(s) returned - * @returns AccountArray A list of accounts - * @throws ApiError - */ - public static listAccountByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - date?: string, - type?: AccountTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/accounts', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'date': date, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all available budgets with this currency. - * List all available budgets with this currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AvailableBudgetArray A list of available budgets - * @throws ApiError - */ - public static listAvailableBudgetByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/available-budgets', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all bills with this currency. - * List all bills with this currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns BillArray A list of bills. - * @throws ApiError - */ - public static listBillByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/bills', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all budget limits with this currency - * List all budget limits with this currency - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start Start date for the budget limit list. - * @param end End date for the budget limit list. - * @returns BudgetLimitArray A list of budget limits. - * @throws ApiError - */ - public static listBudgetLimitByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/budget_limits', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all recurring transactions with this currency. - * List all recurring transactions with this currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns RecurrenceArray A list of recurring transactions - * @throws ApiError - */ - public static listRecurrenceByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/recurrences', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all rules with this currency. - * List all rules with this currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns RuleArray A list of rules - * @throws ApiError - */ - public static listRuleByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/rules', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all transactions with this currency. - * List all transactions with this currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD, to limit the list of transactions. - * - * @param end A date formatted YYYY-MM-DD, to limit the list of transactions. - * - * @param type Optional filter on the transaction type(s) returned - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static listTransactionByCurrency( - code: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}/transactions', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all currencies. - * List all currencies. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns CurrencyArray A list of currencies. - * @throws ApiError - */ - public static listCurrency( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new currency - * Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary currency information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns CurrencySingle New currency stored, result in response. - * @throws ApiError - */ - public static storeCurrency( - requestBody: CurrencyStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/currencies', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Enable a single currency. - * Enable a single currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static enableCurrency( - code: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/currencies/{code}/enable', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Disable a currency. - * Disable a currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static disableCurrency( - code: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/currencies/{code}/disable', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 409: `Currency cannot be disabled, because it is still in use.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Make currency default currency. - * Make this currency the default currency for the user. If the currency is not enabled, it will be enabled as well. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static defaultCurrency( - code: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/currencies/{code}/default', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single currency. - * Get a single currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @returns CurrencySingle The requested currency - * @throws ApiError - */ - public static getCurrency( - code: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/{code}', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing currency. - * Update existing currency. - * @param code The currency code. - * @param formData JSON array with updated currency information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns CurrencySingle Updated currency stored, result in response - * @throws ApiError - */ - public static updateCurrency( - code: string, - formData: CurrencyUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/currencies/{code}', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - formData: formData, - mediaType: 'application/x-www-form-urlencoded', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a currency. - * Delete a currency. - * @param code The currency code. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteCurrency( - code: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/currencies/{code}', - path: { - 'code': code, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get the user's default currency. - * Get the user's default currency. - * @param xTraceId Unique identifier associated with this request. - * @returns CurrencySingle The default currency - * @throws ApiError - */ - public static getDefaultCurrency( - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/currencies/default', - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/DataService.ts b/src/lib/api/services/DataService.ts deleted file mode 100644 index 0d186ad..0000000 --- a/src/lib/api/services/DataService.ts +++ /dev/null @@ -1,389 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DataDestroyObject } from '../models/DataDestroyObject'; -import type { ExportFileFilter } from '../models/ExportFileFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class DataService { - - /** - * Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials - * Allows you to update transactions in bulk. - * - * @param query The JSON query. - * @returns void - * @throws ApiError - */ - public static bulkUpdateTransactions( - query: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/data/bulk/transactions', - query: { - 'query': query, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Endpoint to destroy user data - * A call to this endpoint deletes the requested data type. Use it with care and always with user permission. - * The demo user is incapable of using this endpoint. - * - * @param objects The type of data that you wish to destroy. You can only use one at a time. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static destroyData( - objects: DataDestroyObject, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/data/destroy', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'objects': objects, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export account data from Firefly III - * This endpoint allows you to export your accounts from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportAccounts( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/accounts', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export bills from Firefly III - * This endpoint allows you to export your bills from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportBills( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/bills', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export budgets and budget amount data from Firefly III - * This endpoint allows you to export your budgets and associated budget data from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportBudgets( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/budgets', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export category data from Firefly III - * This endpoint allows you to export your categories from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportCategories( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/categories', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export piggy banks from Firefly III - * This endpoint allows you to export your piggy banks from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportPiggies( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/piggy-banks', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export recurring transaction data from Firefly III - * This endpoint allows you to export your recurring transactions from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportRecurring( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/recurring', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export rule groups and rule data from Firefly III - * This endpoint allows you to export your rules and rule groups from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportRules( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/rules', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export tag data from Firefly III - * This endpoint allows you to export your tags from Firefly III into a file. Currently supports CSV exports only. - * - * @param xTraceId Unique identifier associated with this request. - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportTags( - xTraceId?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/tags', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Export transaction data from Firefly III - * This endpoint allows you to export transactions from Firefly III into a file. Currently supports CSV exports only. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accounts Limit the export of transactions to these accounts only. Only asset accounts will be accepted. Other types will be silently dropped. - * - * @param type The file type the export file (CSV is currently the only option). - * @returns binary The exported transaction in a file. - * @throws ApiError - */ - public static exportTransactions( - start: string, - end: string, - xTraceId?: string, - accounts?: string, - type?: ExportFileFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/data/export/transactions', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts': accounts, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Endpoint to purge user data - * A call to this endpoint purges all previously deleted data. Use it with care and always with user permission. - * The demo user is incapable of using this endpoint. - * - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static purgeData( - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/data/purge', - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/InsightService.ts b/src/lib/api/services/InsightService.ts deleted file mode 100644 index 6eed415..0000000 --- a/src/lib/api/services/InsightService.ts +++ /dev/null @@ -1,1035 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { InsightGroup } from '../models/InsightGroup'; -import type { InsightTotal } from '../models/InsightTotal'; -import type { InsightTransfer } from '../models/InsightTransfer'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class InsightService { - - /** - * Insight into expenses, grouped by expense account. - * This endpoint gives a summary of the expenses made by the user, grouped by expense account. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you add the accounts ID's of expense accounts, only those accounts - * are included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. You can combine both asset / liability and expense account ID's. - * Other account ID's will be ignored. - * - * @returns InsightGroup A list of expense accounts and expense details. Each expense acccount has one row per currency. - * @throws ApiError - */ - public static insightExpenseExpense( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/expense', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, grouped by asset account. - * This endpoint gives a summary of the expenses made by the user, grouped by asset account. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of asset accounts and expense details. Each asset account has one row per currency. - * @throws ApiError - */ - public static insightExpenseAsset( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/asset', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into income, grouped by revenue account. - * This endpoint gives a summary of the income received by the user, grouped by revenue account. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you add the accounts ID's of revenue accounts, only those accounts - * are included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. You can combine both asset / liability and deposit account ID's. - * Other account ID's will be ignored. - * - * @returns InsightGroup A list of revenue accounts and income details. Each revenue acccount has one row per currency. - * @throws ApiError - */ - public static insightIncomeRevenue( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/revenue', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into income, grouped by asset account. - * This endpoint gives a summary of the income received by the user, grouped by asset account. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of asset accounts and income details. Each asset account has one row per currency. - * @throws ApiError - */ - public static insightIncomeAsset( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/asset', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into transfers, grouped by account. - * This endpoint gives a summary of the transfers made by the user, grouped by asset account or lability. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTransfer A list of asset accounts and transfer details. Each asset account has one row per currency. - * @throws ApiError - */ - public static insightTransfers( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/transfer/asset', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, grouped by bill. - * This endpoint gives a summary of the expenses made by the user, grouped by (any) bill. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param billsArray The bills to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of budget and expense details. Each budget has one row per currency. - * @throws ApiError - */ - public static insightExpenseBill( - start: string, - end: string, - xTraceId?: string, - billsArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/bill', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'bills[]': billsArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, without bill. - * This endpoint gives a summary of the expenses made by the user, including only expenses with no bill. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of expense details. One row per currency. - * @throws ApiError - */ - public static insightExpenseNoBill( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/no-bill', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, grouped by budget. - * This endpoint gives a summary of the expenses made by the user, grouped by (any) budget. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param budgetsArray The budgets to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of budget and expense details. Each budget has one row per currency. - * @throws ApiError - */ - public static insightExpenseBudget( - start: string, - end: string, - xTraceId?: string, - budgetsArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/budget', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'budgets[]': budgetsArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, without budget. - * This endpoint gives a summary of the expenses made by the user, including only expenses with no budget. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of expense details. One row per currency. - * @throws ApiError - */ - public static insightExpenseNoBudget( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/no-budget', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, grouped by category. - * This endpoint gives a summary of the expenses made by the user, grouped by (any) category. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param categoriesArray The categories to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of category and expense details. Each category has one row per currency. - * @throws ApiError - */ - public static insightExpenseCategory( - start: string, - end: string, - xTraceId?: string, - categoriesArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/category', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'categories[]': categoriesArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, without category. - * This endpoint gives a summary of the expenses made by the user, including only expenses with no category. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of expense details. One row per currency. - * @throws ApiError - */ - public static insightExpenseNoCategory( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/no-category', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into income, grouped by category. - * This endpoint gives a summary of the income received by the user, grouped by (any) category. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param categoriesArray The categories to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of category and income details. Each category has one row per currency. - * @throws ApiError - */ - public static insightIncomeCategory( - start: string, - end: string, - xTraceId?: string, - categoriesArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/category', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'categories[]': categoriesArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into income, without category. - * This endpoint gives a summary of the income received by the user, including only income with no category. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of income details. One row per currency. - * @throws ApiError - */ - public static insightIncomeNoCategory( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/no-category', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into transfers, grouped by category. - * This endpoint gives a summary of the transfers made by the user, grouped by (any) category. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param categoriesArray The categories to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of category and transfer details. Each category has one row per currency. - * @throws ApiError - */ - public static insightTransferCategory( - start: string, - end: string, - xTraceId?: string, - categoriesArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/transfer/category', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'categories[]': categoriesArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into transfers, without category. - * This endpoint gives a summary of the transfers made by the user, including only transfers with no category. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of transfer details. One row per currency. - * @throws ApiError - */ - public static insightTransferNoCategory( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/transfer/no-category', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, grouped by tag. - * This endpoint gives a summary of the expenses made by the user, grouped by (any) tag. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param tagsArray The tags to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of tag and expense details. Each tag has one row per currency. - * @throws ApiError - */ - public static insightExpenseTag( - start: string, - end: string, - xTraceId?: string, - tagsArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/tag', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'tags[]': tagsArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, without tag. - * This endpoint gives a summary of the expenses made by the user, including only expenses with no tag. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of expense details. One row per currency. - * @throws ApiError - */ - public static insightExpenseNoTag( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/no-tag', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into income, grouped by tag. - * This endpoint gives a summary of the income received by the user, grouped by (any) tag. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param tagsArray The tags to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of tag and income details. Each tag has one row per currency. - * @throws ApiError - */ - public static insightIncomeTag( - start: string, - end: string, - xTraceId?: string, - tagsArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/tag', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'tags[]': tagsArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into income, without tag. - * This endpoint gives a summary of the income received by the user, including only income with no tag. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of income details. One row per currency. - * @throws ApiError - */ - public static insightIncomeNoTag( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/no-tag', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into transfers, grouped by tag. - * This endpoint gives a summary of the transfers created by the user, grouped by (any) tag. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param tagsArray The tags to be included in the results. - * - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightGroup A list of tag and transfer details. Each tag has one row per currency. - * @throws ApiError - */ - public static insightTransferTag( - start: string, - end: string, - xTraceId?: string, - tagsArray?: Array, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/transfer/tag', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'tags[]': tagsArray, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into expenses, without tag. - * This endpoint gives a summary of the transfers made by the user, including only transfers with no tag. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of transfer details. One row per currency. - * @throws ApiError - */ - public static insightTransferNoTag( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/transfer/no-tag', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into total expenses. - * This endpoint gives a sum of the total expenses made by the user. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of sums in different currencies. - * @throws ApiError - */ - public static insightExpenseTotal( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/expense/total', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into total income. - * This endpoint gives a sum of the total income received by the user. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of sums in different currencies. - * @throws ApiError - */ - public static insightIncomeTotal( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/income/total', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Insight into total transfers. - * This endpoint gives a sum of the total amount transfers made by the user. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param accountsArray The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those - * asset accounts / liabilities will be included. Other account ID's will be ignored. - * - * @returns InsightTotal A list of sums in different currencies. - * @throws ApiError - */ - public static insightTransferTotal( - start: string, - end: string, - xTraceId?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/insight/transfer/total', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/LinksService.ts b/src/lib/api/services/LinksService.ts deleted file mode 100644 index 490342c..0000000 --- a/src/lib/api/services/LinksService.ts +++ /dev/null @@ -1,396 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { LinkType } from '../models/LinkType'; -import type { LinkTypeArray } from '../models/LinkTypeArray'; -import type { LinkTypeSingle } from '../models/LinkTypeSingle'; -import type { LinkTypeUpdate } from '../models/LinkTypeUpdate'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionLinkArray } from '../models/TransactionLinkArray'; -import type { TransactionLinkSingle } from '../models/TransactionLinkSingle'; -import type { TransactionLinkStore } from '../models/TransactionLinkStore'; -import type { TransactionLinkUpdate } from '../models/TransactionLinkUpdate'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class LinksService { - - /** - * List all transactions under this link type. - * List all transactions under this link type, both the inward and outward transactions. - * - * @param id The ID of the link type. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD, to limit the results. - * - * @param end A date formatted YYYY-MM-DD, to limit the results. - * - * @param type Optional filter on the transaction type(s) returned. - * @returns TransactionArray A list of transactions - * @throws ApiError - */ - public static listTransactionByLinkType( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/link-types/{id}/transactions', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all types of links. - * List all the link types the system has. These include the default ones as well as any new ones. - * - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns LinkTypeArray A list of link types. - * @throws ApiError - */ - public static listLinkType( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/link-types', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Create a new link type - * Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). - * @param requestBody JSON array with the necessary link type information or key=value pairs. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns LinkTypeSingle New link type stored, result in response. - * @throws ApiError - */ - public static storeLinkType( - requestBody: LinkType, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/link-types', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get single a link type. - * Returns a single link type by its ID. - * - * @param id The ID of the link type. - * @param xTraceId Unique identifier associated with this request. - * @returns LinkTypeSingle The requested link type - * @throws ApiError - */ - public static getLinkType( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/link-types/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing link type. - * Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable=false flag when you list it. - * - * @param id The ID of the link type. - * @param requestBody JSON array or formdata with updated link type information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns LinkTypeSingle Updated link type stored, result in response - * @throws ApiError - */ - public static updateLinkType( - id: string, - requestBody: LinkTypeUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/link-types/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Permanently delete link type. - * Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it. - * - * @param id The ID of the link type. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteLinkType( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/link-types/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all transaction links. - * List all the transaction links. - * - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns TransactionLinkArray A list of transaction links - * @throws ApiError - */ - public static listTransactionLink( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transaction-links', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Create a new link between transactions - * Store a new link between two transactions. For this end point you need the journal_id from a transaction. - * @param requestBody JSON array with the necessary link type information or key=value pairs. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionLinkSingle New transaction link stored, result in response. - * @throws ApiError - */ - public static storeTransactionLink( - requestBody: TransactionLinkStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/transaction-links', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single link. - * Returns a single link by its ID. - * - * @param id The ID of the transaction link. - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionLinkSingle The requested link - * @throws ApiError - */ - public static getTransactionLink( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transaction-links/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Permanently delete link between transactions. - * Will permanently delete link. Transactions remain. - * - * @param id The ID of the transaction link. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteTransactionLink( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/transaction-links/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update an existing link between transactions. - * Used to update a single existing link. - * - * @param id The ID of the transaction link. - * @param requestBody JSON array or formdata with updated link type information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionLinkSingle Updated link type stored, result in response - * @throws ApiError - */ - public static updateTransactionLink( - id: string, - requestBody: TransactionLinkUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/transaction-links/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/ObjectGroupsService.ts b/src/lib/api/services/ObjectGroupsService.ts deleted file mode 100644 index 0563096..0000000 --- a/src/lib/api/services/ObjectGroupsService.ts +++ /dev/null @@ -1,222 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BillArray } from '../models/BillArray'; -import type { ObjectGroupArray } from '../models/ObjectGroupArray'; -import type { ObjectGroupSingle } from '../models/ObjectGroupSingle'; -import type { ObjectGroupUpdate } from '../models/ObjectGroupUpdate'; -import type { PiggyBankArray } from '../models/PiggyBankArray'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class ObjectGroupsService { - - /** - * List all piggy banks related to the object group. - * This endpoint returns a list of all the piggy banks connected to the object group. - * - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns PiggyBankArray A list of piggy banks - * @throws ApiError - */ - public static listPiggyBankByObjectGroup( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/object-groups/{id}/piggy-banks', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all bills with this object group. - * List all bills with this object group. - * @param id The ID of the account. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns BillArray A list of bills. - * @throws ApiError - */ - public static listBillByObjectGroup( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/object-groups/{id}/bills', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all oject groups. - * List all oject groups. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns ObjectGroupArray A list of object groups - * @throws ApiError - */ - public static listObjectGroups( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/object-groups', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single object group. - * Get a single object group. - * @param id The ID of the object group. - * @param xTraceId Unique identifier associated with this request. - * @returns ObjectGroupSingle The requested object group - * @throws ApiError - */ - public static getObjectGroup( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/object-groups/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing object group. - * Update existing object group. - * @param id The ID of the object group - * @param requestBody JSON array with updated piggy bank information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns ObjectGroupSingle Updated object group stored, result in response - * @throws ApiError - */ - public static updateObjectGroup( - id: string, - requestBody: ObjectGroupUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/object-groups/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a object group. - * Delete a object group. - * @param id The ID of the object group. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteObjectGroup( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/object-groups/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/PiggyBanksService.ts b/src/lib/api/services/PiggyBanksService.ts deleted file mode 100644 index 38bdc48..0000000 --- a/src/lib/api/services/PiggyBanksService.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { PiggyBankArray } from '../models/PiggyBankArray'; -import type { PiggyBankEventArray } from '../models/PiggyBankEventArray'; -import type { PiggyBankSingle } from '../models/PiggyBankSingle'; -import type { PiggyBankStore } from '../models/PiggyBankStore'; -import type { PiggyBankUpdate } from '../models/PiggyBankUpdate'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class PiggyBanksService { - - /** - * List all events linked to a piggy bank. - * List all events linked to a piggy bank (adding and removing money). - * @param id The ID of the piggy bank - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns PiggyBankEventArray A list of piggy bank related events - * @throws ApiError - */ - public static listEventByPiggyBank( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/piggy-banks/{id}/events', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Lists all attachments. - * Lists all attachments. - * @param id The ID of the piggy bank. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByPiggyBank( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/piggy-banks/{id}/attachments', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all piggy banks. - * List all piggy banks. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns PiggyBankArray A list of piggy banks - * @throws ApiError - */ - public static listPiggyBank( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/piggy-banks', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new piggy bank - * Creates a new piggy bank. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary piggy bank information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns PiggyBankSingle New piggy bank stored, result in response. - * @throws ApiError - */ - public static storePiggyBank( - requestBody: PiggyBankStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/piggy-banks', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single piggy bank. - * Get a single piggy bank. - * @param id The ID of the piggy bank. - * @param xTraceId Unique identifier associated with this request. - * @returns PiggyBankSingle The requested piggy bank - * @throws ApiError - */ - public static getPiggyBank( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/piggy-banks/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing piggy bank. - * Update existing piggy bank. - * @param id The ID of the piggy bank - * @param requestBody JSON array with updated piggy bank information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns PiggyBankSingle Updated piggy bank stored, result in response - * @throws ApiError - */ - public static updatePiggyBank( - id: string, - requestBody: PiggyBankUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/piggy-banks/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a piggy bank. - * Delete a piggy bank. - * @param id The ID of the piggy bank. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deletePiggyBank( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/piggy-banks/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/PreferencesService.ts b/src/lib/api/services/PreferencesService.ts deleted file mode 100644 index 41c86b7..0000000 --- a/src/lib/api/services/PreferencesService.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Preference } from '../models/Preference'; -import type { PreferenceArray } from '../models/PreferenceArray'; -import type { PreferenceSingle } from '../models/PreferenceSingle'; -import type { PreferenceUpdate } from '../models/PreferenceUpdate'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class PreferencesService { - - /** - * List all users preferences. - * List all of the preferences of the user. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns PreferenceArray A list of preferences. - * @throws ApiError - */ - public static listPreference( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/preferences', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new preference for this user. - * This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app. - * @param requestBody JSON array with the necessary preference information or key=value pairs. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns PreferenceSingle New account stored, result in response. - * @throws ApiError - */ - public static storePreference( - requestBody: Preference, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/preferences', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Return a single preference. - * Return a single preference and the value. - * @param name The name of the preference. - * @param xTraceId Unique identifier associated with this request. - * @returns PreferenceSingle A single preference. - * @throws ApiError - */ - public static getPreference( - name: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/preferences/{name}', - path: { - 'name': name, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update preference - * Update a user's preference. - * @param name The name of the preference. Will always overwrite. Will be created if it does not exist. - * @param requestBody JSON array or key=value pairs with the necessary preference information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns PreferenceSingle Updated preference. - * @throws ApiError - */ - public static updatePreference( - name: string, - requestBody: PreferenceUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/preferences/{name}', - path: { - 'name': name, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/RecurrencesService.ts b/src/lib/api/services/RecurrencesService.ts deleted file mode 100644 index 393bc50..0000000 --- a/src/lib/api/services/RecurrencesService.ts +++ /dev/null @@ -1,225 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { RecurrenceArray } from '../models/RecurrenceArray'; -import type { RecurrenceSingle } from '../models/RecurrenceSingle'; -import type { RecurrenceStore } from '../models/RecurrenceStore'; -import type { RecurrenceUpdate } from '../models/RecurrenceUpdate'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class RecurrencesService { - - /** - * List all transactions created by a recurring transaction. - * List all transactions created by a recurring transaction, optionally limited to the date ranges specified. - * @param id The ID of the recurring transaction. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. Both the start and end date must be present. - * - * @param end A date formatted YYYY-MM-DD. Both the start and end date must be present. - * - * @param type Optional filter on the transaction type(s) returned - * @returns TransactionArray A list of transactions - * @throws ApiError - */ - public static listTransactionByRecurrence( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/recurrences/{id}/transactions', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all recurring transactions. - * List all recurring transactions. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns RecurrenceArray A list of recurring transactions. - * @throws ApiError - */ - public static listRecurrence( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/recurrences', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new recurring transaction - * Creates a new recurring transaction. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary recurring transaction information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns RecurrenceSingle New recurring transaction stored, result in response. - * @throws ApiError - */ - public static storeRecurrence( - requestBody: RecurrenceStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/recurrences', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single recurring transaction. - * Get a single recurring transaction. - * @param id The ID of the recurring transaction. - * @param xTraceId Unique identifier associated with this request. - * @returns RecurrenceSingle The requested recurring transaction - * @throws ApiError - */ - public static getRecurrence( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/recurrences/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing recurring transaction. - * Update existing recurring transaction. - * @param id The ID of the recurring transaction. - * @param requestBody JSON array with updated recurring transaction information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns RecurrenceSingle Updated recurring transaction stored, result in response - * @throws ApiError - */ - public static updateRecurrence( - id: string, - requestBody: RecurrenceUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/recurrences/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a recurring transaction. - * Delete a recurring transaction. Transactions created by the recurring transaction will not be deleted. - * @param id The ID of the recurring transaction. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteRecurrence( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/recurrences/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/RuleGroupsService.ts b/src/lib/api/services/RuleGroupsService.ts deleted file mode 100644 index 6f63fbb..0000000 --- a/src/lib/api/services/RuleGroupsService.ts +++ /dev/null @@ -1,316 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { RuleArray } from '../models/RuleArray'; -import type { RuleGroupArray } from '../models/RuleGroupArray'; -import type { RuleGroupSingle } from '../models/RuleGroupSingle'; -import type { RuleGroupStore } from '../models/RuleGroupStore'; -import type { RuleGroupUpdate } from '../models/RuleGroupUpdate'; -import type { TransactionArray } from '../models/TransactionArray'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class RuleGroupsService { - - /** - * List rules in this rule group. - * List rules in this rule group. - * @param id The ID of the rule group. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns RuleArray A list of rules. - * @throws ApiError - */ - public static listRuleByGroup( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rule-groups/{id}/rules', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Test which transactions would be hit by the rule group. No changes will be made. - * Test which transactions would be hit by the rule group. No changes will be made. Limit the result if you want to. - * @param id The ID of the rule group. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. - * - * @param end A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. - * - * @param searchLimit Maximum number of transactions Firefly III will try. Don't set this too high, or it will take Firefly III very long to run the test. I suggest a max of 200. - * - * @param triggeredLimit Maximum number of transactions the rule group can actually trigger on, before Firefly III stops. I would suggest setting this to 10 or 15. Don't go above the user's page size, because browsing to page 2 or 3 of a test result would fire the test again, making any navigation efforts very slow. - * - * @param accountsArray Limit the testing of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. - * - * @returns TransactionArray A list of transactions that would be changed by any of the rules of the rule group. No changes will be made. - * @throws ApiError - */ - public static testRuleGroup( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - searchLimit?: number, - triggeredLimit?: number, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rule-groups/{id}/test', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'search_limit': searchLimit, - 'triggered_limit': triggeredLimit, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Fire the rule group on your transactions. - * Fire the rule group on your transactions. Changes will be made by the rules in the rule group! Limit the result if you want to. - * @param id The ID of the rule group. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present. - * - * @param end A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present. - * - * @param accountsArray Limit the triggering of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. - * - * @returns void - * @throws ApiError - */ - public static fireRuleGroup( - id: string, - xTraceId?: string, - start?: string, - end?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/rule-groups/{id}/trigger', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all rule groups. - * List all rule groups. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns RuleGroupArray A list of rule groups. - * @throws ApiError - */ - public static listRuleGroup( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rule-groups', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new rule group. - * Creates a new rule group. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary rule group information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleGroupSingle New rule group stored, result in response. - * @throws ApiError - */ - public static storeRuleGroup( - requestBody: RuleGroupStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/rule-groups', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single rule group. - * Get a single rule group. This does not include the rules. For that, see below. - * @param id The ID of the rule group. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleGroupSingle The requested rule group - * @throws ApiError - */ - public static getRuleGroup( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rule-groups/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing rule group. - * Update existing rule group. - * @param id The ID of the rule group. - * @param requestBody JSON array with updated rule group information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleGroupSingle Updated rule group stored, result in response - * @throws ApiError - */ - public static updateRuleGroup( - id: string, - requestBody: RuleGroupUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/rule-groups/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a rule group. - * Delete a rule group. - * @param id The ID of the rule group. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteRuleGroup( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/rule-groups/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/RulesService.ts b/src/lib/api/services/RulesService.ts deleted file mode 100644 index fbcf573..0000000 --- a/src/lib/api/services/RulesService.ts +++ /dev/null @@ -1,263 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { RuleArray } from '../models/RuleArray'; -import type { RuleSingle } from '../models/RuleSingle'; -import type { RuleStore } from '../models/RuleStore'; -import type { RuleUpdate } from '../models/RuleUpdate'; -import type { TransactionArray } from '../models/TransactionArray'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class RulesService { - - /** - * Test which transactions would be hit by the rule. No changes will be made. - * Test which transactions would be hit by the rule. No changes will be made. Limit the result if you want to. - * @param id The ID of the rule. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. - * - * @param end A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. - * - * @param accountsArray Limit the testing of the rule to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. - * - * @returns TransactionArray A list of transactions that would be changed by the rule. No changes will be made. - * @throws ApiError - */ - public static testRule( - id: string, - xTraceId?: string, - start?: string, - end?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rules/{id}/test', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Fire the rule on your transactions. - * Fire the rule group on your transactions. Changes will be made by the rules in the group! Limit the result if you want to. - * @param id The ID of the rule. - * @param xTraceId Unique identifier associated with this request. - * @param start A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. If the start date is not present, it will be set to one year ago. If you use this field, both the start date and the end date must be present. - * - * @param end A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. If the end date is not present, it will be set to today. If you use this field, both the start date and the end date must be present. - * - * @param accountsArray Limit the triggering of the rule to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. - * - * @returns void - * @throws ApiError - */ - public static fireRule( - id: string, - xTraceId?: string, - start?: string, - end?: string, - accountsArray?: Array, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/rules/{id}/trigger', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'accounts[]': accountsArray, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all rules. - * List all rules. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns RuleArray A list of rules - * @throws ApiError - */ - public static listRule( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rules', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new rule - * Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary rule information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleSingle New rule stored, result in response. - * @throws ApiError - */ - public static storeRule( - requestBody: RuleStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/rules', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single rule. - * Get a single rule. - * @param id The ID of the object. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleSingle The requested rule - * @throws ApiError - */ - public static getRule( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/rules/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing rule. - * Update existing rule. - * @param id The ID of the object. - * @param requestBody JSON array with updated rule information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns RuleSingle Updated rule stored, result in response - * @throws ApiError - */ - public static updateRule( - id: string, - requestBody: RuleUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/rules/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete an rule. - * Delete an rule. - * @param id The ID of the rule. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteRule( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/rules/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/SearchService.ts b/src/lib/api/services/SearchService.ts deleted file mode 100644 index 3ca0941..0000000 --- a/src/lib/api/services/SearchService.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AccountArray } from '../models/AccountArray'; -import type { AccountSearchFieldFilter } from '../models/AccountSearchFieldFilter'; -import type { AccountTypeFilter } from '../models/AccountTypeFilter'; -import type { TransactionArray } from '../models/TransactionArray'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class SearchService { - - /** - * Search for accounts - * Search for accounts - * @param query The query you wish to search for. - * @param field The account field(s) you want to search in. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param type The type of accounts you wish to limit the search to. - * @returns AccountArray A list of accounts. - * @throws ApiError - */ - public static searchAccounts( - query: string, - field: AccountSearchFieldFilter, - xTraceId?: string, - limit?: number, - page?: number, - type?: AccountTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/search/accounts', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'query': query, - 'type': type, - 'field': field, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Search for transactions - * Searches through the users transactions. - * @param query The query you wish to search for. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static searchTransactions( - query: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/search/transactions', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'query': query, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/SummaryService.ts b/src/lib/api/services/SummaryService.ts deleted file mode 100644 index c044c71..0000000 --- a/src/lib/api/services/SummaryService.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BasicSummary } from '../models/BasicSummary'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class SummaryService { - - /** - * Returns basic sums of the users data. - * Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is used in Firefly III to populate the dashboard. - * - * @param start A date formatted YYYY-MM-DD. - * - * @param end A date formatted YYYY-MM-DD. - * - * @param xTraceId Unique identifier associated with this request. - * @param currencyCode A currency code like EUR or USD, to filter the result. - * - * @returns BasicSummary An array of sums. It depends on the user what you can expect to get back, so please try this out on the demo site. - * @throws ApiError - */ - public static getBasicSummary( - start: string, - end: string, - xTraceId?: string, - currencyCode?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/summary/basic', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'start': start, - 'end': end, - 'currency_code': currencyCode, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/TagsService.ts b/src/lib/api/services/TagsService.ts deleted file mode 100644 index a3d1d5c..0000000 --- a/src/lib/api/services/TagsService.ts +++ /dev/null @@ -1,272 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { TagArray } from '../models/TagArray'; -import type { TagModelStore } from '../models/TagModelStore'; -import type { TagModelUpdate } from '../models/TagModelUpdate'; -import type { TagSingle } from '../models/TagSingle'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class TagsService { - - /** - * Lists all attachments. - * Lists all attachments. - * @param tag Either the tag itself or the tag ID. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByTag( - tag: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/tags/{tag}/attachments', - path: { - 'tag': tag, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all transactions with this tag. - * List all transactions with this tag. - * @param tag Either the tag itself or the tag ID. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. This is the start date of the selected range (inclusive). - * - * @param end A date formatted YYYY-MM-DD. This is the end date of the selected range (inclusive). - * - * @param type Optional filter on the transaction type(s) returned. - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static listTransactionByTag( - tag: string, - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/tags/{tag}/transactions', - path: { - 'tag': tag, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all tags. - * List all of the user's tags. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns TagArray A list of tags - * @throws ApiError - */ - public static listTag( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/tags', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new tag - * Creates a new tag. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary tag information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns TagSingle New tag stored, result in response. - * @throws ApiError - */ - public static storeTag( - requestBody: TagModelStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/tags', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single tag. - * Get a single tag. - * @param tag Either the tag itself or the tag ID. If you use the tag itself, and it contains international (non-ASCII) characters, your milage may vary. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns TagSingle The requested tag - * @throws ApiError - */ - public static getTag( - tag: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/tags/{tag}', - path: { - 'tag': tag, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing tag. - * Update existing tag. - * @param tag Either the tag itself or the tag ID. If you use the tag itself, and it contains international (non-ASCII) characters, your milage may vary. - * @param requestBody JSON array with updated tag information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns TagSingle Updated tag stored, result in response - * @throws ApiError - */ - public static updateTag( - tag: string, - requestBody: TagModelUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/tags/{tag}', - path: { - 'tag': tag, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete an tag. - * Delete an tag. - * @param tag Either the tag itself or the tag ID. If you use the tag itself, and it contains international (non-ASCII) characters, your milage may vary. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteTag( - tag: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/tags/{tag}', - path: { - 'tag': tag, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/TransactionsService.ts b/src/lib/api/services/TransactionsService.ts deleted file mode 100644 index 9e0dc4d..0000000 --- a/src/lib/api/services/TransactionsService.ts +++ /dev/null @@ -1,364 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AttachmentArray } from '../models/AttachmentArray'; -import type { PiggyBankEventArray } from '../models/PiggyBankEventArray'; -import type { TransactionArray } from '../models/TransactionArray'; -import type { TransactionLinkArray } from '../models/TransactionLinkArray'; -import type { TransactionSingle } from '../models/TransactionSingle'; -import type { TransactionStore } from '../models/TransactionStore'; -import type { TransactionTypeFilter } from '../models/TransactionTypeFilter'; -import type { TransactionUpdate } from '../models/TransactionUpdate'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class TransactionsService { - - /** - * Lists all the transaction links for an individual journal (individual split). - * Lists all the transaction links for an individual journal (a split). Don't use the group ID, you need the actual underlying journal (the split). - * @param id The ID of the transaction journal / the split. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns TransactionLinkArray A list of transaction links. - * @throws ApiError - */ - public static listLinksByJournal( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transaction-journals/{id}/links', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single transaction, based on one of the underlying transaction journals (transaction splits). - * Get a single transaction by underlying journal (split). - * @param id The ID of the transaction journal (split). - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionSingle The requested transaction. - * @throws ApiError - */ - public static getTransactionByJournal( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transaction-journals/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete split from transaction - * Delete an individual journal (split) from a transaction. - * @param id The ID of the transaction journal (the split) you wish to delete. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteTransactionJournal( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/transaction-journals/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Lists all attachments. - * Lists all attachments. - * @param id The ID of the transaction. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns AttachmentArray A list of attachments - * @throws ApiError - */ - public static listAttachmentByTransaction( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transactions/{id}/attachments', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Lists all piggy bank events. - * Lists all piggy bank events. - * @param id The ID of the transaction. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns PiggyBankEventArray A list of piggy bank events. - * @throws ApiError - */ - public static listEventByTransaction( - id: string, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transactions/{id}/piggy-bank-events', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * List all the user's transactions. - * - * List all the user's transactions. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @param start A date formatted YYYY-MM-DD. This is the start date of the selected range (inclusive). - * - * @param end A date formatted YYYY-MM-DD. This is the end date of the selected range (inclusive). - * - * @param type Optional filter on the transaction type(s) returned. - * @returns TransactionArray A list of transactions. - * @throws ApiError - */ - public static listTransaction( - xTraceId?: string, - limit?: number, - page?: number, - start?: string, - end?: string, - type?: TransactionTypeFilter, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transactions', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - 'start': start, - 'end': end, - 'type': type, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new transaction - * Creates a new transaction. The data required can be submitted as a JSON body or as a list of parameters. - * @param requestBody JSON array or key=value pairs with the necessary transaction information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionSingle New transaction stored(s), result in response. - * @throws ApiError - */ - public static storeTransaction( - requestBody: TransactionStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/transactions', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single transaction. - * Get a single transaction. - * @param id The ID of the transaction. - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionSingle The requested transaction. - * @throws ApiError - */ - public static getTransaction( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/transactions/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing transaction. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials - * Update an existing transaction. - * @param id The ID of the transaction. - * @param requestBody JSON array with updated transaction information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns TransactionSingle Updated transaction stored, result in response - * @throws ApiError - */ - public static updateTransaction( - id: string, - requestBody: TransactionUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/transactions/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a transaction. - * Delete a transaction. - * @param id The ID of the transaction. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteTransaction( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/transactions/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/UsersService.ts b/src/lib/api/services/UsersService.ts deleted file mode 100644 index 7fe6fa8..0000000 --- a/src/lib/api/services/UsersService.ts +++ /dev/null @@ -1,174 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { User } from '../models/User'; -import type { UserArray } from '../models/UserArray'; -import type { UserSingle } from '../models/UserSingle'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class UsersService { - - /** - * List all users. - * List all the users in this instance of Firefly III. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns UserArray A list of users. - * @throws ApiError - */ - public static listUser( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/users', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new user - * Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the "forgot password" function. - * - * @param requestBody JSON array or key=value pairs with the necessary user information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns UserSingle New user stored, result in response. - * @throws ApiError - */ - public static storeUser( - requestBody: User, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/users', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single user. - * Gets all info of a single user. - * @param id The user ID. - * @param xTraceId Unique identifier associated with this request. - * @returns UserSingle The requested user. - * @throws ApiError - */ - public static getUser( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/users/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update an existing user's information. - * Update existing user. - * @param id The user ID. - * @param requestBody JSON array with updated user information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns UserSingle Updated user stored, result in response - * @throws ApiError - */ - public static updateUser( - id: string, - requestBody: User, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/users/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a user. - * Delete a user. You cannot delete the user you're authenticated with. This cannot be undone. Be careful! - * @param id The user ID. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteUser( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/users/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/api/services/WebhooksService.ts b/src/lib/api/services/WebhooksService.ts deleted file mode 100644 index 67cf819..0000000 --- a/src/lib/api/services/WebhooksService.ts +++ /dev/null @@ -1,416 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { WebhookArray } from '../models/WebhookArray'; -import type { WebhookAttemptArray } from '../models/WebhookAttemptArray'; -import type { WebhookAttemptSingle } from '../models/WebhookAttemptSingle'; -import type { WebhookMessageArray } from '../models/WebhookMessageArray'; -import type { WebhookMessageSingle } from '../models/WebhookMessageSingle'; -import type { WebhookSingle } from '../models/WebhookSingle'; -import type { WebhookStore } from '../models/WebhookStore'; -import type { WebhookUpdate } from '../models/WebhookUpdate'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class WebhooksService { - - /** - * Get all the messages of a single webhook. - * When a webhook is triggered the actual message that will be send is stored in a "message". You can view and analyse these messages. - * @param id The webhook ID. - * @param xTraceId Unique identifier associated with this request. - * @returns WebhookMessageArray A list of webhook messages. - * @throws ApiError - */ - public static getWebhookMessages( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/webhooks/{id}/messages', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single message from a webhook. - * When a webhook is triggered it will store the actual content of the webhook in a webhook message. You can view and analyse a single one using this endpoint. - * @param id The webhook ID. - * @param messageId The webhook message ID. - * @param xTraceId Unique identifier associated with this request. - * @returns WebhookMessageSingle A single webhook message. - * @throws ApiError - */ - public static getSingleWebhookMessage( - id: string, - messageId: number, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/webhooks/{id}/messages/{messageId}', - path: { - 'id': id, - 'messageId': messageId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a webhook message. - * Delete a webhook message. Any time a webhook is triggered the message is stored before it's sent. You can delete them before or after sending. - * @param id The webhook ID. - * @param messageId The webhook message ID. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteWebhookMessage( - id: string, - messageId: number, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/webhooks/{id}/messages/{messageId}', - path: { - 'id': id, - 'messageId': messageId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get all the failed attempts of a single webhook message. - * When a webhook message fails to send it will store the failure in an "attempt". You can view and analyse these. Webhook messages that receive too many attempts (failures) will not be sent again. You must first clear out old attempts before the message can go out again. - * @param id The webhook ID. - * @param messageId The webhook message ID. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns WebhookAttemptArray A list of webhook attempts. - * @throws ApiError - */ - public static getWebhookMessageAttempts( - id: string, - messageId: number, - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/webhooks/{id}/messages/{messageId}/attempts', - path: { - 'id': id, - 'messageId': messageId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single failed attempt from a single webhook message. - * When a webhook message fails to send it will store the failure in an "attempt". You can view and analyse these. Webhooks messages that receive too many attempts (failures) will not be fired. You must first clear out old attempts and try again. This endpoint shows you the details of a single attempt. The ID of the attempt must match the corresponding webhook and webhook message. - * @param id The webhook ID. - * @param messageId The webhook message ID. - * @param attemptId The webhook attempt ID. - * @param xTraceId Unique identifier associated with this request. - * @returns WebhookAttemptSingle A single webhook attempt. - * @throws ApiError - */ - public static getSingleWebhookMessageAttempt( - id: string, - messageId: number, - attemptId: number, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}', - path: { - 'id': id, - 'messageId': messageId, - 'attemptId': attemptId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a webhook attempt. - * Delete a webhook message attempt. If you delete all attempts for a webhook message, Firefly III will (once again) assume all is well with the webhook message and will try to send it again. - * @param id The webhook ID. - * @param messageId The webhook message ID. - * @param attemptId The webhook message attempt ID. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteWebhookMessageAttempt( - id: string, - messageId: number, - attemptId: number, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}', - path: { - 'id': id, - 'messageId': messageId, - 'attemptId': attemptId, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Submit messages for a webhook. - * This endpoint will submit any open messages for this webhook. This is an asynchronous operation, so you can't see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. - * @param id The webhook ID. - * @param xTraceId Unique identifier associated with this request. - * @returns any OK! - * @throws ApiError - */ - public static submitWebook( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/webhooks/{id}/submit', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 404: `Webhook not found.`, - 500: `Error while sending.`, - }, - }); - } - - /** - * List all webhooks. - * List all the user's webhooks. - * @param xTraceId Unique identifier associated with this request. - * @param limit Number of items per page. The default pagination is per 50 items. - * @param page Page number. The default pagination is per 50 items. - * @returns WebhookArray A list of webhooks. - * @throws ApiError - */ - public static listWebhook( - xTraceId?: string, - limit?: number, - page?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/webhooks', - headers: { - 'X-Trace-Id': xTraceId, - }, - query: { - 'limit': limit, - 'page': page, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Store a new webhook - * Creates a new webhook. The data required can be submitted as a JSON body or as a list of parameters. The webhook will be given a random secret. - * - * @param requestBody JSON array or key=value pairs with the necessary webhook information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns WebhookSingle New webhook stored, result in response. - * @throws ApiError - */ - public static storeWebhook( - requestBody: WebhookStore, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v1/webhooks', - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Get a single webhook. - * Gets all info of a single webhook. - * @param id The webhook ID. - * @param xTraceId Unique identifier associated with this request. - * @returns WebhookSingle The requested webhook. - * @throws ApiError - */ - public static getWebhook( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v1/webhooks/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - - /** - * Update existing webhook. - * Update an existing webhook's information. If you wish to reset the secret, submit any value as the "secret". Firefly III will take this as a hint and reset the secret of the webhook. - * @param id The webhook ID. - * @param requestBody JSON array with updated webhook information. See the model for the exact specifications. - * @param xTraceId Unique identifier associated with this request. - * @returns WebhookSingle Updated webhook stored, result in response - * @throws ApiError - */ - public static updateWebhook( - id: string, - requestBody: WebhookUpdate, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v1/webhooks/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 422: `Validation error. The body will have the exact details.`, - 500: `Internal exception`, - }, - }); - } - - /** - * Delete a webhook. - * Delete a webhook. - * @param id The webhook ID. - * @param xTraceId Unique identifier associated with this request. - * @returns void - * @throws ApiError - */ - public static deleteWebhook( - id: string, - xTraceId?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v1/webhooks/{id}', - path: { - 'id': id, - }, - headers: { - 'X-Trace-Id': xTraceId, - }, - errors: { - 400: `Bad request`, - 401: `Unauthenticated`, - 404: `Page not found`, - 500: `Internal exception`, - }, - }); - } - -} diff --git a/src/lib/components/dashboard/BasicSummary.svelte b/src/lib/components/dashboard/BasicSummary.svelte index 32ef1cf..1e69c45 100644 --- a/src/lib/components/dashboard/BasicSummary.svelte +++ b/src/lib/components/dashboard/BasicSummary.svelte @@ -1,5 +1,5 @@ diff --git a/src/routes/export/+page.svelte b/src/routes/export/+page.svelte index fc7f1ca..7ead8c9 100644 --- a/src/routes/export/+page.svelte +++ b/src/routes/export/+page.svelte @@ -1,6 +1,6 @@