From 7692cd751c7d8cd0048d2e0f96ed725e5fd59ced Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Fri, 27 Sep 2024 21:08:42 +0200 Subject: [PATCH] Generate typescript client from fastapi openapi.json - add export.py script to backend to generate openapi.json - add generated openapi.json file - add autogenerated typescript fetch api client in src/lib/client using hey-api/openapi-ts - add hey-api/openapi-ts and hey-api/client-fetch to frontend deps - add openapi-ts to package.json scripts - add openapi-ts config file - run pnpm openapi-ts - automatically export openapi.json and generate openapi-ts client code in CI --- .github/workflows/{format.yml => codegen.yml} | 16 +- .pre-commit-config.yaml | 8 +- frontend/openapi-ts.config.ts | 10 + frontend/package.json | 5 +- frontend/pnpm-lock.yaml | 357 +++++++++ frontend/src/lib/client/index.ts | 4 + frontend/src/lib/client/schemas.gen.ts | 731 ++++++++++++++++++ frontend/src/lib/client/services.gen.ts | 586 ++++++++++++++ frontend/src/lib/client/types.gen.ts | 396 ++++++++++ mondey_backend/openapi.json | 1 + mondey_backend/pyproject.toml | 2 + mondey_backend/src/mondey_backend/export.py | 27 + mondey_backend/tests/conftest.py | 9 +- 13 files changed, 2141 insertions(+), 11 deletions(-) rename .github/workflows/{format.yml => codegen.yml} (72%) create mode 100644 frontend/openapi-ts.config.ts create mode 100644 frontend/src/lib/client/index.ts create mode 100644 frontend/src/lib/client/schemas.gen.ts create mode 100644 frontend/src/lib/client/services.gen.ts create mode 100644 frontend/src/lib/client/types.gen.ts create mode 100644 mondey_backend/openapi.json create mode 100644 mondey_backend/src/mondey_backend/export.py diff --git a/.github/workflows/format.yml b/.github/workflows/codegen.yml similarity index 72% rename from .github/workflows/format.yml rename to .github/workflows/codegen.yml index c6eb1846..81513a3b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/codegen.yml @@ -1,11 +1,11 @@ -name: format code +name: codegen and format on: pull_request: branches: - main jobs: - format-frontend: + codegen-and-format: runs-on: ubuntu-latest defaults: run: @@ -22,6 +22,9 @@ jobs: with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} + - uses: actions/setup-python@v5 + with: + python-version: "3.12" - uses: pnpm/action-setup@v4 with: version: 9 @@ -30,11 +33,18 @@ jobs: node-version: 22 cache: 'pnpm' cache-dependency-path: frontend/pnpm-lock.yaml + - name: "Export openapi.json from fastapi app" + run: | + cd ../mondey_backend + pip install . + mondey-export-openapi-json - run: pnpm install + - name: "Generate frontend fetch API client code" + run: pnpm openapi-ts - run: pnpm format - uses: EndBug/add-and-commit@v9 with: add: "*" author_name: "github-actions[bot]" author_email: "github-actions[bot]@users.noreply.github.com" - message: "pnpm format" + message: "update openapi.json & openapi-ts client, run pnpm format" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a8f4728..122128f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: check-toml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.5 + rev: v0.6.8 hooks: - id: ruff types_or: [python, pyi, jupyter] @@ -18,7 +18,7 @@ repos: types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.1 + rev: v1.11.2 hooks: - id: mypy additional_dependencies: ["sqlmodel"] @@ -30,6 +30,8 @@ repos: ] - repo: https://github.com/rhysd/actionlint - rev: "v1.7.1" + rev: "v1.7.2" hooks: - id: actionlint + +exclude: "mondey_backend/openapi.json" diff --git a/frontend/openapi-ts.config.ts b/frontend/openapi-ts.config.ts new file mode 100644 index 00000000..5fc57569 --- /dev/null +++ b/frontend/openapi-ts.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from '@hey-api/openapi-ts'; + +export default defineConfig({ + client: '@hey-api/client-fetch', + input: '../mondey_backend/openapi.json', + output: { + path: 'src/lib/client', + format: 'prettier' + } +}); diff --git a/frontend/package.json b/frontend/package.json index 418495bf..d634339b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,9 +10,11 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "test": "vitest --coverage", "lint": "prettier --check . && eslint .", - "format": "prettier --write ." + "format": "prettier --write .", + "openapi-ts": "openapi-ts" }, "devDependencies": { + "@hey-api/openapi-ts": "0.53.5", "@sveltejs/adapter-auto": "^3.2.5", "@sveltejs/adapter-static": "^3.0.5", "@sveltejs/kit": "^2.5.28", @@ -43,6 +45,7 @@ }, "type": "module", "dependencies": { + "@hey-api/client-fetch": "0.4.0", "iso-639-1": "3.1.3", "svelte-i18n": "^4.0.0" } diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index d91f9c38..cbaf27fe 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@hey-api/client-fetch': + specifier: 0.4.0 + version: 0.4.0 iso-639-1: specifier: 3.1.3 version: 3.1.3 @@ -15,6 +18,9 @@ importers: specifier: ^4.0.0 version: 4.0.0(svelte@4.2.19) devDependencies: + '@hey-api/openapi-ts': + specifier: 0.53.5 + version: 0.53.5(magicast@0.3.5)(typescript@5.6.2) '@sveltejs/adapter-auto': specifier: ^3.2.5 version: 3.2.5(@sveltejs/kit@2.5.28(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.7))(svelte@4.2.19)(vite@5.4.7)) @@ -107,6 +113,10 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@apidevtools/json-schema-ref-parser@11.7.0': + resolution: {integrity: sha512-pRrmXMCwnmrkS3MLgAIW5dXRzeTv6GLjkjb4HmxNnvAKXN1Nfzp4KmGADBQvlVUcqi+a5D+hfGDLLnd5NnYxog==} + engines: {node: '>= 16'} + '@babel/code-frame@7.24.7': resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} @@ -473,6 +483,16 @@ packages: '@formatjs/intl-localematcher@0.5.4': resolution: {integrity: sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==} + '@hey-api/client-fetch@0.4.0': + resolution: {integrity: sha512-T8T3yCl2+AiVVDP6tvfnU/rXOkEHddMTOYCZXUVbydj7URVErh5BelIa8UWBkFYZBP2/mi2nViScNhe9eBolPw==} + + '@hey-api/openapi-ts@0.53.5': + resolution: {integrity: sha512-8IeY4J3Mbb6B/8Za5CGzxpqkDLsYLJ4cKLGIuGh6y3PQXMXOXjLxJOa6NfM+kky6SNpeoPGC4ZP6depy8EJWtg==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + typescript: ^5.x + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} @@ -507,6 +527,9 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jsdevtools/ono@7.1.3': + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -914,6 +937,14 @@ packages: resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} engines: {node: '>=8.0.0'} + c12@1.11.2: + resolution: {integrity: sha512-oBs8a4uvSDO9dm8b7OCFW7+dgtVrwmwnrVXYzLm43ta7ep2jCn/0MhoUFygIWtxhyy6+/MG7/agvpY0U1Iemew==} + peerDependencies: + magicast: ^0.3.4 + peerDependenciesMeta: + magicast: + optional: true + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -949,6 +980,13 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} + chownr@2.0.0: + resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} + engines: {node: '>=10'} + + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + cli-color@2.0.4: resolution: {integrity: sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==} engines: {node: '>=0.10'} @@ -973,6 +1011,10 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} @@ -980,6 +1022,13 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + confbox@0.1.7: + resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + + consola@3.2.3: + resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} + engines: {node: ^14.18.0 || >=16.10.0} + cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} @@ -1032,6 +1081,9 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -1040,6 +1092,9 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + destr@2.0.3: + resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} + detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} @@ -1056,6 +1111,10 @@ packages: dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + dotenv@16.4.5: + resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} + engines: {node: '>=12'} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -1199,6 +1258,10 @@ packages: event-emitter@0.3.5: resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} + execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + ext@1.7.0: resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} @@ -1267,6 +1330,10 @@ packages: fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} + fs-minipass@2.1.0: + resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} + engines: {node: '>= 8'} + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -1281,6 +1348,14 @@ packages: get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + + giget@1.2.3: + resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==} + hasBin: true + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1317,6 +1392,11 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -1344,6 +1424,10 @@ packages: resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==} engines: {node: '>= 14'} + human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1413,6 +1497,10 @@ packages: is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} + is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -1539,6 +1627,9 @@ packages: resolution: {integrity: sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA==} engines: {node: '>=0.12'} + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -1555,6 +1646,10 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} + mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -1573,14 +1668,34 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minipass@3.3.6: + resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} + engines: {node: '>=8'} + + minipass@5.0.0: + resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} + engines: {node: '>=8'} + minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + minizlib@2.1.2: + resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} + engines: {node: '>= 8'} + mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true + mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + + mlly@1.7.1: + resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -1603,9 +1718,15 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + node-fetch-native@1.6.4: + resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} + node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} @@ -1617,9 +1738,18 @@ packages: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} engines: {node: '>=0.10.0'} + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + nwsapi@2.2.12: resolution: {integrity: sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==} + nypm@0.3.12: + resolution: {integrity: sha512-D3pzNDWIvgA+7IORhD/IuWzEk4uXv6GsgOxiid4UU3h9oq5IqV1KtPDi63n4sZJ/xcWlr88c0QM2RgN5VbOhFA==} + engines: {node: ^14.16.0 || >=16.10.0} + hasBin: true + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -1628,9 +1758,16 @@ packages: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} + ohash@1.1.4: + resolution: {integrity: sha512-FlDryZAahJmEF3VR3w1KogSEdWX3WhA5GPakFx4J81kEAiHyLMpdLLElS8n8dfNadMgAne/MywcvmogzscVt4g==} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -1665,6 +1802,10 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -1679,6 +1820,9 @@ packages: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} @@ -1697,6 +1841,9 @@ packages: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} + pkg-types@1.2.0: + resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + postcss-import@15.1.0: resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} @@ -1847,6 +1994,9 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + rc9@2.1.2: + resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} @@ -1937,6 +2087,10 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1959,6 +2113,10 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -2095,6 +2253,10 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + tar@6.2.1: + resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} + engines: {node: '>=10'} + test-exclude@7.0.1: resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} engines: {node: '>=18'} @@ -2194,6 +2356,14 @@ packages: engines: {node: '>=14.17'} hasBin: true + ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + update-browserslist-db@1.1.0: resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} hasBin: true @@ -2309,6 +2479,9 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + 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'} @@ -2339,6 +2512,9 @@ packages: xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} @@ -2361,6 +2537,12 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + '@apidevtools/json-schema-ref-parser@11.7.0': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + '@babel/code-frame@7.24.7': dependencies: '@babel/highlight': 7.24.7 @@ -2605,6 +2787,18 @@ snapshots: dependencies: tslib: 2.7.0 + '@hey-api/client-fetch@0.4.0': {} + + '@hey-api/openapi-ts@0.53.5(magicast@0.3.5)(typescript@5.6.2)': + dependencies: + '@apidevtools/json-schema-ref-parser': 11.7.0 + c12: 1.11.2(magicast@0.3.5) + commander: 12.1.0 + handlebars: 4.7.8 + typescript: 5.6.2 + transitivePeerDependencies: + - magicast + '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/retry@0.3.0': {} @@ -2637,6 +2831,8 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@jsdevtools/ono@7.1.3': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -3063,6 +3259,23 @@ snapshots: buffer-crc32@1.0.0: {} + c12@1.11.2(magicast@0.3.5): + dependencies: + chokidar: 3.6.0 + confbox: 0.1.7 + defu: 6.1.4 + dotenv: 16.4.5 + giget: 1.2.3 + jiti: 1.21.6 + mlly: 1.7.1 + ohash: 1.1.4 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.2.0 + rc9: 2.1.2 + optionalDependencies: + magicast: 0.3.5 + cac@6.7.14: {} callsites@3.1.0: {} @@ -3104,6 +3317,12 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chownr@2.0.0: {} + + citty@0.1.6: + dependencies: + consola: 3.2.3 + cli-color@2.0.4: dependencies: d: 1.0.2 @@ -3136,10 +3355,16 @@ snapshots: dependencies: delayed-stream: 1.0.0 + commander@12.1.0: {} + commander@4.1.1: {} concat-map@0.0.1: {} + confbox@0.1.7: {} + + consola@3.2.3: {} + cookie@0.6.0: {} cross-spawn@7.0.3: @@ -3181,10 +3406,14 @@ snapshots: deepmerge@4.3.1: {} + defu@6.1.4: {} + delayed-stream@1.0.0: {} dequal@2.0.3: {} + destr@2.0.3: {} + detect-indent@6.1.0: {} devalue@5.0.0: {} @@ -3195,6 +3424,8 @@ snapshots: dom-accessibility-api@0.5.16: {} + dotenv@16.4.5: {} + eastasianwidth@0.2.0: {} electron-to-chromium@1.5.28: {} @@ -3420,6 +3651,18 @@ snapshots: d: 1.0.2 es5-ext: 0.10.64 + execa@8.0.1: + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + ext@1.7.0: dependencies: type: 2.7.3 @@ -3506,6 +3749,10 @@ snapshots: fraction.js@4.3.7: {} + fs-minipass@2.1.0: + dependencies: + minipass: 3.3.6 + fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -3515,6 +3762,19 @@ snapshots: get-func-name@2.0.2: {} + get-stream@8.0.1: {} + + giget@1.2.3: + dependencies: + citty: 0.1.6 + consola: 3.2.3 + defu: 6.1.4 + node-fetch-native: 1.6.4 + nypm: 0.3.12 + ohash: 1.1.4 + pathe: 1.1.2 + tar: 6.2.1 + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -3553,6 +3813,15 @@ snapshots: graphemer@1.4.0: {} + handlebars@4.7.8: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + has-flag@3.0.0: {} has-flag@4.0.0: {} @@ -3581,6 +3850,8 @@ snapshots: transitivePeerDependencies: - supports-color + human-signals@5.0.0: {} + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -3640,6 +3911,8 @@ snapshots: dependencies: '@types/estree': 1.0.6 + is-stream@3.0.0: {} + isexe@2.0.0: {} iso-639-1@3.1.3: {} @@ -3783,6 +4056,8 @@ snapshots: next-tick: 1.1.0 timers-ext: 0.1.8 + merge-stream@2.0.0: {} + merge2@1.4.1: {} micromatch@4.0.8: @@ -3796,6 +4071,8 @@ snapshots: dependencies: mime-db: 1.52.0 + mimic-fn@4.0.0: {} + min-indent@1.0.1: {} mini-svg-data-uri@1.4.4: {} @@ -3810,12 +4087,32 @@ snapshots: minimist@1.2.8: {} + minipass@3.3.6: + dependencies: + yallist: 4.0.0 + + minipass@5.0.0: {} + minipass@7.1.2: {} + minizlib@2.1.2: + dependencies: + minipass: 3.3.6 + yallist: 4.0.0 + mkdirp@0.5.6: dependencies: minimist: 1.2.8 + mkdirp@1.0.4: {} + + mlly@1.7.1: + dependencies: + acorn: 8.12.1 + pathe: 1.1.2 + pkg-types: 1.2.0 + ufo: 1.5.4 + mri@1.2.0: {} mrmime@2.0.0: {} @@ -3832,24 +4129,47 @@ snapshots: natural-compare@1.4.0: {} + neo-async@2.6.2: {} + next-tick@1.1.0: {} + node-fetch-native@1.6.4: {} + node-releases@2.0.18: {} normalize-path@3.0.0: {} normalize-range@0.1.2: {} + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + nwsapi@2.2.12: {} + nypm@0.3.12: + dependencies: + citty: 0.1.6 + consola: 3.2.3 + execa: 8.0.1 + pathe: 1.1.2 + pkg-types: 1.2.0 + ufo: 1.5.4 + object-assign@4.1.1: {} object-hash@3.0.0: {} + ohash@1.1.4: {} + once@1.4.0: dependencies: wrappy: 1.0.2 + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -3883,6 +4203,8 @@ snapshots: path-key@3.1.1: {} + path-key@4.0.0: {} + path-parse@1.0.7: {} path-scurry@1.11.1: @@ -3894,6 +4216,8 @@ snapshots: pathval@2.0.0: {} + perfect-debounce@1.0.0: {} + periscopic@3.1.0: dependencies: '@types/estree': 1.0.6 @@ -3908,6 +4232,12 @@ snapshots: pirates@4.0.6: {} + pkg-types@1.2.0: + dependencies: + confbox: 0.1.7 + mlly: 1.7.1 + pathe: 1.1.2 + postcss-import@15.1.0(postcss@8.4.47): dependencies: postcss: 8.4.47 @@ -3990,6 +4320,11 @@ snapshots: queue-microtask@1.2.3: {} + rc9@2.1.2: + dependencies: + defu: 6.1.4 + destr: 2.0.3 + react-is@17.0.2: {} read-cache@1.0.0: @@ -4090,6 +4425,8 @@ snapshots: source-map-js@1.2.1: {} + source-map@0.6.1: {} + stackback@0.0.2: {} std-env@3.7.0: {} @@ -4114,6 +4451,8 @@ snapshots: dependencies: ansi-regex: 6.1.0 + strip-final-newline@3.0.0: {} + strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -4277,6 +4616,15 @@ snapshots: transitivePeerDependencies: - ts-node + tar@6.2.1: + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 5.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + test-exclude@7.0.1: dependencies: '@istanbuljs/schema': 0.1.3 @@ -4362,6 +4710,11 @@ snapshots: typescript@5.6.2: {} + ufo@1.5.4: {} + + uglify-js@3.19.3: + optional: true + update-browserslist-db@1.1.0(browserslist@4.23.3): dependencies: browserslist: 4.23.3 @@ -4465,6 +4818,8 @@ snapshots: word-wrap@1.2.5: {} + wordwrap@1.0.0: {} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -4485,6 +4840,8 @@ snapshots: xmlchars@2.2.0: {} + yallist@4.0.0: {} + yaml@1.10.2: {} yaml@2.5.1: {} diff --git a/frontend/src/lib/client/index.ts b/frontend/src/lib/client/index.ts new file mode 100644 index 00000000..002afc33 --- /dev/null +++ b/frontend/src/lib/client/index.ts @@ -0,0 +1,4 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './schemas.gen'; +export * from './services.gen'; +export * from './types.gen'; diff --git a/frontend/src/lib/client/schemas.gen.ts b/frontend/src/lib/client/schemas.gen.ts new file mode 100644 index 00000000..b96d2b98 --- /dev/null +++ b/frontend/src/lib/client/schemas.gen.ts @@ -0,0 +1,731 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const Body_auth_cookie_login_auth_login_postSchema = { + properties: { + grant_type: { + anyOf: [ + { + type: 'string', + pattern: 'password' + }, + { + type: 'null' + } + ], + title: 'Grant Type' + }, + username: { + type: 'string', + title: 'Username' + }, + password: { + type: 'string', + title: 'Password' + }, + scope: { + type: 'string', + title: 'Scope', + default: '' + }, + client_id: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Client Id' + }, + client_secret: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Client Secret' + } + }, + type: 'object', + required: ['username', 'password'], + title: 'Body_auth_cookie_login_auth_login_post' +} as const; + +export const Body_reset_forgot_password_auth_forgot_password_postSchema = { + properties: { + email: { + type: 'string', + format: 'email', + title: 'Email' + } + }, + type: 'object', + required: ['email'], + title: 'Body_reset_forgot_password_auth_forgot_password_post' +} as const; + +export const Body_reset_reset_password_auth_reset_password_postSchema = { + properties: { + token: { + type: 'string', + title: 'Token' + }, + password: { + type: 'string', + title: 'Password' + } + }, + type: 'object', + required: ['token', 'password'], + title: 'Body_reset_reset_password_auth_reset_password_post' +} as const; + +export const Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__putSchema = + { + properties: { + file: { + type: 'string', + format: 'binary', + title: 'File' + } + }, + type: 'object', + required: ['file'], + title: 'Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put' + } as const; + +export const Body_upload_milestone_image_admin_milestone_images__milestone_id__postSchema = { + properties: { + file: { + type: 'string', + format: 'binary', + title: 'File' + } + }, + type: 'object', + required: ['file'], + title: 'Body_upload_milestone_image_admin_milestone_images__milestone_id__post' +} as const; + +export const Body_verify_request_token_auth_request_verify_token_postSchema = { + properties: { + email: { + type: 'string', + format: 'email', + title: 'Email' + } + }, + type: 'object', + required: ['email'], + title: 'Body_verify_request_token_auth_request_verify_token_post' +} as const; + +export const Body_verify_verify_auth_verify_postSchema = { + properties: { + token: { + type: 'string', + title: 'Token' + } + }, + type: 'object', + required: ['token'], + title: 'Body_verify_verify_auth_verify_post' +} as const; + +export const ErrorModelSchema = { + properties: { + detail: { + anyOf: [ + { + type: 'string' + }, + { + additionalProperties: { + type: 'string' + }, + type: 'object' + } + ], + title: 'Detail' + } + }, + type: 'object', + required: ['detail'], + title: 'ErrorModel' +} as const; + +export const HTTPValidationErrorSchema = { + properties: { + detail: { + items: { + $ref: '#/components/schemas/ValidationError' + }, + type: 'array', + title: 'Detail' + } + }, + type: 'object', + title: 'HTTPValidationError' +} as const; + +export const LanguageSchema = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + lang: { + type: 'string', + maxLength: 2, + title: 'Lang' + } + }, + type: 'object', + required: ['lang'], + title: 'Language' +} as const; + +export const LanguageCreateSchema = { + properties: { + lang: { + type: 'string', + maxLength: 2, + title: 'Lang' + } + }, + type: 'object', + required: ['lang'], + title: 'LanguageCreate' +} as const; + +export const MilestoneAdminSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + group_id: { + type: 'integer', + title: 'Group Id' + }, + order: { + type: 'integer', + title: 'Order' + }, + text: { + additionalProperties: { + $ref: '#/components/schemas/MilestoneText' + }, + type: 'object', + title: 'Text', + default: {} + }, + images: { + items: { + $ref: '#/components/schemas/MilestoneImage' + }, + type: 'array', + title: 'Images', + default: [] + } + }, + type: 'object', + required: ['id', 'group_id', 'order'], + title: 'MilestoneAdmin' +} as const; + +export const MilestoneGroupAdmin_InputSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + order: { + type: 'integer', + title: 'Order' + }, + text: { + additionalProperties: { + $ref: '#/components/schemas/MilestoneGroupText' + }, + type: 'object', + title: 'Text', + default: {} + }, + milestones: { + items: { + $ref: '#/components/schemas/MilestoneAdmin' + }, + type: 'array', + title: 'Milestones', + default: [] + } + }, + type: 'object', + required: ['id', 'order'], + title: 'MilestoneGroupAdmin' +} as const; + +export const MilestoneGroupAdmin_OutputSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + order: { + type: 'integer', + title: 'Order' + }, + text: { + additionalProperties: { + $ref: '#/components/schemas/MilestoneGroupText' + }, + type: 'object', + title: 'Text', + default: {} + }, + milestones: { + items: { + $ref: '#/components/schemas/MilestoneAdmin' + }, + type: 'array', + title: 'Milestones', + default: [] + } + }, + type: 'object', + required: ['id', 'order'], + title: 'MilestoneGroupAdmin' +} as const; + +export const MilestoneGroupPublicSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + text: { + additionalProperties: { + $ref: '#/components/schemas/MilestoneGroupTextPublic' + }, + type: 'object', + title: 'Text', + default: {} + }, + milestones: { + items: { + $ref: '#/components/schemas/MilestonePublic' + }, + type: 'array', + title: 'Milestones', + default: [] + } + }, + type: 'object', + required: ['id'], + title: 'MilestoneGroupPublic' +} as const; + +export const MilestoneGroupTextSchema = { + properties: { + title: { + type: 'string', + title: 'Title', + default: '' + }, + desc: { + type: 'string', + title: 'Desc', + default: '' + }, + group_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Group Id' + }, + lang_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Lang Id' + } + }, + type: 'object', + title: 'MilestoneGroupText' +} as const; + +export const MilestoneGroupTextPublicSchema = { + properties: { + title: { + type: 'string', + title: 'Title', + default: '' + }, + desc: { + type: 'string', + title: 'Desc', + default: '' + } + }, + type: 'object', + title: 'MilestoneGroupTextPublic' +} as const; + +export const MilestoneImageSchema = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + milestone_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Milestone Id' + }, + filename: { + type: 'string', + title: 'Filename', + default: '' + }, + approved: { + type: 'boolean', + title: 'Approved', + default: false + } + }, + type: 'object', + title: 'MilestoneImage' +} as const; + +export const MilestoneImagePublicSchema = { + properties: { + filename: { + type: 'string', + title: 'Filename' + }, + approved: { + type: 'boolean', + title: 'Approved' + } + }, + type: 'object', + required: ['filename', 'approved'], + title: 'MilestoneImagePublic' +} as const; + +export const MilestonePublicSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + text: { + additionalProperties: { + $ref: '#/components/schemas/MilestoneGroupTextPublic' + }, + type: 'object', + title: 'Text', + default: {} + }, + images: { + items: { + $ref: '#/components/schemas/MilestoneImagePublic' + }, + type: 'array', + title: 'Images', + default: [] + } + }, + type: 'object', + required: ['id'], + title: 'MilestonePublic' +} as const; + +export const MilestoneTextSchema = { + properties: { + title: { + type: 'string', + title: 'Title', + default: '' + }, + desc: { + type: 'string', + title: 'Desc', + default: '' + }, + obs: { + type: 'string', + title: 'Obs', + default: '' + }, + help: { + type: 'string', + title: 'Help', + default: '' + }, + milestone_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Milestone Id' + }, + lang_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Lang Id' + } + }, + type: 'object', + title: 'MilestoneText' +} as const; + +export const UserCreateSchema = { + properties: { + email: { + type: 'string', + format: 'email', + title: 'Email' + }, + password: { + type: 'string', + title: 'Password' + }, + is_active: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Active', + default: true + }, + is_superuser: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Superuser', + default: false + }, + is_verified: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Verified', + default: false + }, + is_researcher: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Researcher', + default: false + } + }, + type: 'object', + required: ['email', 'password'], + title: 'UserCreate' +} as const; + +export const UserReadSchema = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + email: { + type: 'string', + format: 'email', + title: 'Email' + }, + is_active: { + type: 'boolean', + title: 'Is Active', + default: true + }, + is_superuser: { + type: 'boolean', + title: 'Is Superuser', + default: false + }, + is_verified: { + type: 'boolean', + title: 'Is Verified', + default: false + }, + is_researcher: { + type: 'boolean', + title: 'Is Researcher' + } + }, + type: 'object', + required: ['id', 'email', 'is_researcher'], + title: 'UserRead' +} as const; + +export const UserUpdateSchema = { + properties: { + password: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Password' + }, + email: { + anyOf: [ + { + type: 'string', + format: 'email' + }, + { + type: 'null' + } + ], + title: 'Email' + }, + is_active: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Active' + }, + is_superuser: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Superuser' + }, + is_verified: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Verified' + }, + is_researcher: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Researcher' + } + }, + type: 'object', + title: 'UserUpdate' +} as const; + +export const ValidationErrorSchema = { + properties: { + loc: { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'integer' + } + ] + }, + type: 'array', + title: 'Location' + }, + msg: { + type: 'string', + title: 'Message' + }, + type: { + type: 'string', + title: 'Error Type' + } + }, + type: 'object', + required: ['loc', 'msg', 'type'], + title: 'ValidationError' +} as const; diff --git a/frontend/src/lib/client/services.gen.ts b/frontend/src/lib/client/services.gen.ts new file mode 100644 index 00000000..95ef15b9 --- /dev/null +++ b/frontend/src/lib/client/services.gen.ts @@ -0,0 +1,586 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { + createClient, + createConfig, + type Options, + formDataBodySerializer, + urlSearchParamsBodySerializer +} from '@hey-api/client-fetch'; +import type { + GetLanguagesLanguagesGetError, + GetLanguagesLanguagesGetResponse, + GetMilestonesMilestonesGetError, + GetMilestonesMilestonesGetResponse, + GetMilestoneMilestonesMilestoneIdGetData, + GetMilestoneMilestonesMilestoneIdGetError, + GetMilestoneMilestonesMilestoneIdGetResponse, + GetMilestoneGroupsMilestoneGroupsGetError, + GetMilestoneGroupsMilestoneGroupsGetResponse, + GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetData, + GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetError, + GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetResponse, + CreateLanguageAdminLanguagesPostData, + CreateLanguageAdminLanguagesPostError, + CreateLanguageAdminLanguagesPostResponse, + DeleteLanguageAdminLanguagesLanguageIdDeleteData, + DeleteLanguageAdminLanguagesLanguageIdDeleteError, + DeleteLanguageAdminLanguagesLanguageIdDeleteResponse, + GetMilestoneGroupsAdminMilestoneGroupsGetError, + GetMilestoneGroupsAdminMilestoneGroupsGetResponse, + CreateMilestoneGroupAdminMilestoneGroupsPostError, + CreateMilestoneGroupAdminMilestoneGroupsPostResponse, + UpdateMilestoneGroupAdminMilestoneGroupsPutData, + UpdateMilestoneGroupAdminMilestoneGroupsPutError, + UpdateMilestoneGroupAdminMilestoneGroupsPutResponse, + DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteData, + DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteError, + DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteResponse, + UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutData, + UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutError, + UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutResponse, + CreateMilestoneAdminMilestonesMilestoneGroupIdPostData, + CreateMilestoneAdminMilestonesMilestoneGroupIdPostError, + CreateMilestoneAdminMilestonesMilestoneGroupIdPostResponse, + UpdateMilestoneAdminMilestonesPutData, + UpdateMilestoneAdminMilestonesPutError, + UpdateMilestoneAdminMilestonesPutResponse, + DeleteMilestoneAdminMilestonesMilestoneIdDeleteData, + DeleteMilestoneAdminMilestonesMilestoneIdDeleteError, + DeleteMilestoneAdminMilestonesMilestoneIdDeleteResponse, + UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostData, + UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostError, + UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostResponse, + UsersCurrentUserUsersMeGetError, + UsersCurrentUserUsersMeGetResponse, + UsersPatchCurrentUserUsersMePatchData, + UsersPatchCurrentUserUsersMePatchError, + UsersPatchCurrentUserUsersMePatchResponse, + UsersUserUsersIdGetData, + UsersUserUsersIdGetError, + UsersUserUsersIdGetResponse, + UsersPatchUserUsersIdPatchData, + UsersPatchUserUsersIdPatchError, + UsersPatchUserUsersIdPatchResponse, + UsersDeleteUserUsersIdDeleteData, + UsersDeleteUserUsersIdDeleteError, + UsersDeleteUserUsersIdDeleteResponse, + AuthCookieLoginAuthLoginPostData, + AuthCookieLoginAuthLoginPostError, + AuthCookieLoginAuthLoginPostResponse, + AuthCookieLogoutAuthLogoutPostError, + AuthCookieLogoutAuthLogoutPostResponse, + RegisterRegisterAuthRegisterPostData, + RegisterRegisterAuthRegisterPostError, + RegisterRegisterAuthRegisterPostResponse, + ResetForgotPasswordAuthForgotPasswordPostData, + ResetForgotPasswordAuthForgotPasswordPostError, + ResetForgotPasswordAuthForgotPasswordPostResponse, + ResetResetPasswordAuthResetPasswordPostData, + ResetResetPasswordAuthResetPasswordPostError, + ResetResetPasswordAuthResetPasswordPostResponse, + VerifyRequestTokenAuthRequestVerifyTokenPostData, + VerifyRequestTokenAuthRequestVerifyTokenPostError, + VerifyRequestTokenAuthRequestVerifyTokenPostResponse, + VerifyVerifyAuthVerifyPostData, + VerifyVerifyAuthVerifyPostError, + VerifyVerifyAuthVerifyPostResponse, + AuthResearchAuthGetError, + AuthResearchAuthGetResponse +} from './types.gen'; + +export const client = createClient(createConfig()); + +/** + * Get Languages + */ +export const getLanguagesLanguagesGet = ( + options?: Options +) => { + return (options?.client ?? client).get< + GetLanguagesLanguagesGetResponse, + GetLanguagesLanguagesGetError, + ThrowOnError + >({ + ...options, + url: '/languages/' + }); +}; + +/** + * Get Milestones + */ +export const getMilestonesMilestonesGet = ( + options?: Options +) => { + return (options?.client ?? client).get< + GetMilestonesMilestonesGetResponse, + GetMilestonesMilestonesGetError, + ThrowOnError + >({ + ...options, + url: '/milestones/' + }); +}; + +/** + * Get Milestone + */ +export const getMilestoneMilestonesMilestoneIdGet = ( + options: Options +) => { + return (options?.client ?? client).get< + GetMilestoneMilestonesMilestoneIdGetResponse, + GetMilestoneMilestonesMilestoneIdGetError, + ThrowOnError + >({ + ...options, + url: '/milestones/{milestone_id}' + }); +}; + +/** + * Get Milestone Groups + */ +export const getMilestoneGroupsMilestoneGroupsGet = ( + options?: Options +) => { + return (options?.client ?? client).get< + GetMilestoneGroupsMilestoneGroupsGetResponse, + GetMilestoneGroupsMilestoneGroupsGetError, + ThrowOnError + >({ + ...options, + url: '/milestone-groups/' + }); +}; + +/** + * Get Milestone Group + */ +export const getMilestoneGroupMilestoneGroupsMilestoneGroupIdGet = < + ThrowOnError extends boolean = false +>( + options: Options +) => { + return (options?.client ?? client).get< + GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetResponse, + GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetError, + ThrowOnError + >({ + ...options, + url: '/milestone-groups/{milestone_group_id}' + }); +}; + +/** + * Create Language + */ +export const createLanguageAdminLanguagesPost = ( + options: Options +) => { + return (options?.client ?? client).post< + CreateLanguageAdminLanguagesPostResponse, + CreateLanguageAdminLanguagesPostError, + ThrowOnError + >({ + ...options, + url: '/admin/languages/' + }); +}; + +/** + * Delete Language + */ +export const deleteLanguageAdminLanguagesLanguageIdDelete = ( + options: Options +) => { + return (options?.client ?? client).delete< + DeleteLanguageAdminLanguagesLanguageIdDeleteResponse, + DeleteLanguageAdminLanguagesLanguageIdDeleteError, + ThrowOnError + >({ + ...options, + url: '/admin/languages/{language_id}' + }); +}; + +/** + * Get Milestone Groups + */ +export const getMilestoneGroupsAdminMilestoneGroupsGet = ( + options?: Options +) => { + return (options?.client ?? client).get< + GetMilestoneGroupsAdminMilestoneGroupsGetResponse, + GetMilestoneGroupsAdminMilestoneGroupsGetError, + ThrowOnError + >({ + ...options, + url: '/admin/milestone-groups/' + }); +}; + +/** + * Create Milestone Group + */ +export const createMilestoneGroupAdminMilestoneGroupsPost = ( + options?: Options +) => { + return (options?.client ?? client).post< + CreateMilestoneGroupAdminMilestoneGroupsPostResponse, + CreateMilestoneGroupAdminMilestoneGroupsPostError, + ThrowOnError + >({ + ...options, + url: '/admin/milestone-groups/' + }); +}; + +/** + * Update Milestone Group + */ +export const updateMilestoneGroupAdminMilestoneGroupsPut = ( + options: Options +) => { + return (options?.client ?? client).put< + UpdateMilestoneGroupAdminMilestoneGroupsPutResponse, + UpdateMilestoneGroupAdminMilestoneGroupsPutError, + ThrowOnError + >({ + ...options, + url: '/admin/milestone-groups' + }); +}; + +/** + * Delete Milestone Group + */ +export const deleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDelete = < + ThrowOnError extends boolean = false +>( + options: Options +) => { + return (options?.client ?? client).delete< + DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteResponse, + DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteError, + ThrowOnError + >({ + ...options, + url: '/admin/milestone-groups/{milestone_group_id}' + }); +}; + +/** + * Upload Milestone Group Image + */ +export const uploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPut = < + ThrowOnError extends boolean = false +>( + options: Options< + UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutData, + ThrowOnError + > +) => { + return (options?.client ?? client).put< + UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutResponse, + UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutError, + ThrowOnError + >({ + ...options, + ...formDataBodySerializer, + headers: { + 'Content-Type': null, + ...options?.headers + }, + url: '/admin/milestone-group-images/{milestone_group_id}' + }); +}; + +/** + * Create Milestone + */ +export const createMilestoneAdminMilestonesMilestoneGroupIdPost = < + ThrowOnError extends boolean = false +>( + options: Options +) => { + return (options?.client ?? client).post< + CreateMilestoneAdminMilestonesMilestoneGroupIdPostResponse, + CreateMilestoneAdminMilestonesMilestoneGroupIdPostError, + ThrowOnError + >({ + ...options, + url: '/admin/milestones/{milestone_group_id}' + }); +}; + +/** + * Update Milestone + */ +export const updateMilestoneAdminMilestonesPut = ( + options: Options +) => { + return (options?.client ?? client).put< + UpdateMilestoneAdminMilestonesPutResponse, + UpdateMilestoneAdminMilestonesPutError, + ThrowOnError + >({ + ...options, + url: '/admin/milestones' + }); +}; + +/** + * Delete Milestone + */ +export const deleteMilestoneAdminMilestonesMilestoneIdDelete = < + ThrowOnError extends boolean = false +>( + options: Options +) => { + return (options?.client ?? client).delete< + DeleteMilestoneAdminMilestonesMilestoneIdDeleteResponse, + DeleteMilestoneAdminMilestonesMilestoneIdDeleteError, + ThrowOnError + >({ + ...options, + url: '/admin/milestones/{milestone_id}' + }); +}; + +/** + * Upload Milestone Image + */ +export const uploadMilestoneImageAdminMilestoneImagesMilestoneIdPost = < + ThrowOnError extends boolean = false +>( + options: Options +) => { + return (options?.client ?? client).post< + UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostResponse, + UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostError, + ThrowOnError + >({ + ...options, + ...formDataBodySerializer, + headers: { + 'Content-Type': null, + ...options?.headers + }, + url: '/admin/milestone-images/{milestone_id}' + }); +}; + +/** + * Users:Current User + */ +export const usersCurrentUserUsersMeGet = ( + options?: Options +) => { + return (options?.client ?? client).get< + UsersCurrentUserUsersMeGetResponse, + UsersCurrentUserUsersMeGetError, + ThrowOnError + >({ + ...options, + url: '/users/me' + }); +}; + +/** + * Users:Patch Current User + */ +export const usersPatchCurrentUserUsersMePatch = ( + options: Options +) => { + return (options?.client ?? client).patch< + UsersPatchCurrentUserUsersMePatchResponse, + UsersPatchCurrentUserUsersMePatchError, + ThrowOnError + >({ + ...options, + url: '/users/me' + }); +}; + +/** + * Users:User + */ +export const usersUserUsersIdGet = ( + options: Options +) => { + return (options?.client ?? client).get< + UsersUserUsersIdGetResponse, + UsersUserUsersIdGetError, + ThrowOnError + >({ + ...options, + url: '/users/{id}' + }); +}; + +/** + * Users:Patch User + */ +export const usersPatchUserUsersIdPatch = ( + options: Options +) => { + return (options?.client ?? client).patch< + UsersPatchUserUsersIdPatchResponse, + UsersPatchUserUsersIdPatchError, + ThrowOnError + >({ + ...options, + url: '/users/{id}' + }); +}; + +/** + * Users:Delete User + */ +export const usersDeleteUserUsersIdDelete = ( + options: Options +) => { + return (options?.client ?? client).delete< + UsersDeleteUserUsersIdDeleteResponse, + UsersDeleteUserUsersIdDeleteError, + ThrowOnError + >({ + ...options, + url: '/users/{id}' + }); +}; + +/** + * Auth:Cookie.Login + */ +export const authCookieLoginAuthLoginPost = ( + options: Options +) => { + return (options?.client ?? client).post< + AuthCookieLoginAuthLoginPostResponse, + AuthCookieLoginAuthLoginPostError, + ThrowOnError + >({ + ...options, + ...urlSearchParamsBodySerializer, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options?.headers + }, + url: '/auth/login' + }); +}; + +/** + * Auth:Cookie.Logout + */ +export const authCookieLogoutAuthLogoutPost = ( + options?: Options +) => { + return (options?.client ?? client).post< + AuthCookieLogoutAuthLogoutPostResponse, + AuthCookieLogoutAuthLogoutPostError, + ThrowOnError + >({ + ...options, + url: '/auth/logout' + }); +}; + +/** + * Register:Register + */ +export const registerRegisterAuthRegisterPost = ( + options: Options +) => { + return (options?.client ?? client).post< + RegisterRegisterAuthRegisterPostResponse, + RegisterRegisterAuthRegisterPostError, + ThrowOnError + >({ + ...options, + url: '/auth/register' + }); +}; + +/** + * Reset:Forgot Password + */ +export const resetForgotPasswordAuthForgotPasswordPost = ( + options: Options +) => { + return (options?.client ?? client).post< + ResetForgotPasswordAuthForgotPasswordPostResponse, + ResetForgotPasswordAuthForgotPasswordPostError, + ThrowOnError + >({ + ...options, + url: '/auth/forgot-password' + }); +}; + +/** + * Reset:Reset Password + */ +export const resetResetPasswordAuthResetPasswordPost = ( + options: Options +) => { + return (options?.client ?? client).post< + ResetResetPasswordAuthResetPasswordPostResponse, + ResetResetPasswordAuthResetPasswordPostError, + ThrowOnError + >({ + ...options, + url: '/auth/reset-password' + }); +}; + +/** + * Verify:Request-Token + */ +export const verifyRequestTokenAuthRequestVerifyTokenPost = ( + options: Options +) => { + return (options?.client ?? client).post< + VerifyRequestTokenAuthRequestVerifyTokenPostResponse, + VerifyRequestTokenAuthRequestVerifyTokenPostError, + ThrowOnError + >({ + ...options, + url: '/auth/request-verify-token' + }); +}; + +/** + * Verify:Verify + */ +export const verifyVerifyAuthVerifyPost = ( + options: Options +) => { + return (options?.client ?? client).post< + VerifyVerifyAuthVerifyPostResponse, + VerifyVerifyAuthVerifyPostError, + ThrowOnError + >({ + ...options, + url: '/auth/verify' + }); +}; + +/** + * Auth + */ +export const authResearchAuthGet = ( + options?: Options +) => { + return (options?.client ?? client).get< + AuthResearchAuthGetResponse, + AuthResearchAuthGetError, + ThrowOnError + >({ + ...options, + url: '/research/auth/' + }); +}; diff --git a/frontend/src/lib/client/types.gen.ts b/frontend/src/lib/client/types.gen.ts new file mode 100644 index 00000000..fa540a40 --- /dev/null +++ b/frontend/src/lib/client/types.gen.ts @@ -0,0 +1,396 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Body_auth_cookie_login_auth_login_post = { + grant_type?: string | null; + username: string; + password: string; + scope?: string; + client_id?: string | null; + client_secret?: string | null; +}; + +export type Body_reset_forgot_password_auth_forgot_password_post = { + email: string; +}; + +export type Body_reset_reset_password_auth_reset_password_post = { + token: string; + password: string; +}; + +export type Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put = + { + file: Blob | File; + }; + +export type Body_upload_milestone_image_admin_milestone_images__milestone_id__post = { + file: Blob | File; +}; + +export type Body_verify_request_token_auth_request_verify_token_post = { + email: string; +}; + +export type Body_verify_verify_auth_verify_post = { + token: string; +}; + +export type ErrorModel = { + detail: + | string + | { + [key: string]: string; + }; +}; + +export type HTTPValidationError = { + detail?: Array; +}; + +export type Language = { + id?: number | null; + lang: string; +}; + +export type LanguageCreate = { + lang: string; +}; + +export type MilestoneAdmin = { + id: number; + group_id: number; + order: number; + text?: { + [key: string]: MilestoneText; + }; + images?: Array; +}; + +export type MilestoneGroupAdmin_Input = { + id: number; + order: number; + text?: { + [key: string]: MilestoneGroupText; + }; + milestones?: Array; +}; + +export type MilestoneGroupAdmin_Output = { + id: number; + order: number; + text?: { + [key: string]: MilestoneGroupText; + }; + milestones?: Array; +}; + +export type MilestoneGroupPublic = { + id: number; + text?: { + [key: string]: MilestoneGroupTextPublic; + }; + milestones?: Array; +}; + +export type MilestoneGroupText = { + title?: string; + desc?: string; + group_id?: number | null; + lang_id?: number | null; +}; + +export type MilestoneGroupTextPublic = { + title?: string; + desc?: string; +}; + +export type MilestoneImage = { + id?: number | null; + milestone_id?: number | null; + filename?: string; + approved?: boolean; +}; + +export type MilestoneImagePublic = { + filename: string; + approved: boolean; +}; + +export type MilestonePublic = { + id: number; + text?: { + [key: string]: MilestoneGroupTextPublic; + }; + images?: Array; +}; + +export type MilestoneText = { + title?: string; + desc?: string; + obs?: string; + help?: string; + milestone_id?: number | null; + lang_id?: number | null; +}; + +export type UserCreate = { + email: string; + password: string; + is_active?: boolean | null; + is_superuser?: boolean | null; + is_verified?: boolean | null; + is_researcher?: boolean | null; +}; + +export type UserRead = { + id: number; + email: string; + is_active?: boolean; + is_superuser?: boolean; + is_verified?: boolean; + is_researcher: boolean; +}; + +export type UserUpdate = { + password?: string | null; + email?: string | null; + is_active?: boolean | null; + is_superuser?: boolean | null; + is_verified?: boolean | null; + is_researcher?: boolean | null; +}; + +export type ValidationError = { + loc: Array; + msg: string; + type: string; +}; + +export type GetLanguagesLanguagesGetResponse = { + [key: string]: string; +}; + +export type GetLanguagesLanguagesGetError = unknown; + +export type GetMilestonesMilestonesGetResponse = Array; + +export type GetMilestonesMilestonesGetError = unknown; + +export type GetMilestoneMilestonesMilestoneIdGetData = { + path: { + milestone_id: number; + }; +}; + +export type GetMilestoneMilestonesMilestoneIdGetResponse = MilestonePublic; + +export type GetMilestoneMilestonesMilestoneIdGetError = HTTPValidationError; + +export type GetMilestoneGroupsMilestoneGroupsGetResponse = Array; + +export type GetMilestoneGroupsMilestoneGroupsGetError = unknown; + +export type GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetData = { + path: { + milestone_group_id: number; + }; +}; + +export type GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetResponse = MilestoneGroupPublic; + +export type GetMilestoneGroupMilestoneGroupsMilestoneGroupIdGetError = HTTPValidationError; + +export type CreateLanguageAdminLanguagesPostData = { + body: LanguageCreate; +}; + +export type CreateLanguageAdminLanguagesPostResponse = Language; + +export type CreateLanguageAdminLanguagesPostError = HTTPValidationError; + +export type DeleteLanguageAdminLanguagesLanguageIdDeleteData = { + path: { + language_id: number; + }; +}; + +export type DeleteLanguageAdminLanguagesLanguageIdDeleteResponse = Language; + +export type DeleteLanguageAdminLanguagesLanguageIdDeleteError = HTTPValidationError; + +export type GetMilestoneGroupsAdminMilestoneGroupsGetResponse = Array; + +export type GetMilestoneGroupsAdminMilestoneGroupsGetError = unknown; + +export type CreateMilestoneGroupAdminMilestoneGroupsPostResponse = MilestoneGroupAdmin_Output; + +export type CreateMilestoneGroupAdminMilestoneGroupsPostError = unknown; + +export type UpdateMilestoneGroupAdminMilestoneGroupsPutData = { + body: MilestoneGroupAdmin_Input; +}; + +export type UpdateMilestoneGroupAdminMilestoneGroupsPutResponse = MilestoneGroupAdmin_Output; + +export type UpdateMilestoneGroupAdminMilestoneGroupsPutError = HTTPValidationError; + +export type DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteData = { + path: { + milestone_group_id: number; + }; +}; + +export type DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteResponse = unknown; + +export type DeleteMilestoneGroupAdminMilestoneGroupsMilestoneGroupIdDeleteError = + HTTPValidationError; + +export type UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutData = { + body: Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put; + path: { + milestone_group_id: number; + }; +}; + +export type UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutResponse = unknown; + +export type UploadMilestoneGroupImageAdminMilestoneGroupImagesMilestoneGroupIdPutError = + HTTPValidationError; + +export type CreateMilestoneAdminMilestonesMilestoneGroupIdPostData = { + path: { + milestone_group_id: number; + }; +}; + +export type CreateMilestoneAdminMilestonesMilestoneGroupIdPostResponse = MilestoneAdmin; + +export type CreateMilestoneAdminMilestonesMilestoneGroupIdPostError = HTTPValidationError; + +export type UpdateMilestoneAdminMilestonesPutData = { + body: MilestoneAdmin; +}; + +export type UpdateMilestoneAdminMilestonesPutResponse = MilestoneAdmin; + +export type UpdateMilestoneAdminMilestonesPutError = HTTPValidationError; + +export type DeleteMilestoneAdminMilestonesMilestoneIdDeleteData = { + path: { + milestone_id: number; + }; +}; + +export type DeleteMilestoneAdminMilestonesMilestoneIdDeleteResponse = unknown; + +export type DeleteMilestoneAdminMilestonesMilestoneIdDeleteError = HTTPValidationError; + +export type UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostData = { + body: Body_upload_milestone_image_admin_milestone_images__milestone_id__post; + path: { + milestone_id: number; + }; +}; + +export type UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostResponse = MilestoneImage; + +export type UploadMilestoneImageAdminMilestoneImagesMilestoneIdPostError = HTTPValidationError; + +export type UsersCurrentUserUsersMeGetResponse = UserRead; + +export type UsersCurrentUserUsersMeGetError = unknown; + +export type UsersPatchCurrentUserUsersMePatchData = { + body: UserUpdate; +}; + +export type UsersPatchCurrentUserUsersMePatchResponse = UserRead; + +export type UsersPatchCurrentUserUsersMePatchError = ErrorModel | unknown | HTTPValidationError; + +export type UsersUserUsersIdGetData = { + path: { + id: string; + }; +}; + +export type UsersUserUsersIdGetResponse = UserRead; + +export type UsersUserUsersIdGetError = unknown | HTTPValidationError; + +export type UsersPatchUserUsersIdPatchData = { + body: UserUpdate; + path: { + id: string; + }; +}; + +export type UsersPatchUserUsersIdPatchResponse = UserRead; + +export type UsersPatchUserUsersIdPatchError = ErrorModel | unknown | HTTPValidationError; + +export type UsersDeleteUserUsersIdDeleteData = { + path: { + id: string; + }; +}; + +export type UsersDeleteUserUsersIdDeleteResponse = void; + +export type UsersDeleteUserUsersIdDeleteError = unknown | HTTPValidationError; + +export type AuthCookieLoginAuthLoginPostData = { + body: Body_auth_cookie_login_auth_login_post; +}; + +export type AuthCookieLoginAuthLoginPostResponse = unknown | void; + +export type AuthCookieLoginAuthLoginPostError = ErrorModel | HTTPValidationError; + +export type AuthCookieLogoutAuthLogoutPostResponse = unknown | void; + +export type AuthCookieLogoutAuthLogoutPostError = unknown; + +export type RegisterRegisterAuthRegisterPostData = { + body: UserCreate; +}; + +export type RegisterRegisterAuthRegisterPostResponse = UserRead; + +export type RegisterRegisterAuthRegisterPostError = ErrorModel | HTTPValidationError; + +export type ResetForgotPasswordAuthForgotPasswordPostData = { + body: Body_reset_forgot_password_auth_forgot_password_post; +}; + +export type ResetForgotPasswordAuthForgotPasswordPostResponse = unknown; + +export type ResetForgotPasswordAuthForgotPasswordPostError = HTTPValidationError; + +export type ResetResetPasswordAuthResetPasswordPostData = { + body: Body_reset_reset_password_auth_reset_password_post; +}; + +export type ResetResetPasswordAuthResetPasswordPostResponse = unknown; + +export type ResetResetPasswordAuthResetPasswordPostError = ErrorModel | HTTPValidationError; + +export type VerifyRequestTokenAuthRequestVerifyTokenPostData = { + body: Body_verify_request_token_auth_request_verify_token_post; +}; + +export type VerifyRequestTokenAuthRequestVerifyTokenPostResponse = unknown; + +export type VerifyRequestTokenAuthRequestVerifyTokenPostError = HTTPValidationError; + +export type VerifyVerifyAuthVerifyPostData = { + body: Body_verify_verify_auth_verify_post; +}; + +export type VerifyVerifyAuthVerifyPostResponse = UserRead; + +export type VerifyVerifyAuthVerifyPostError = ErrorModel | HTTPValidationError; + +export type AuthResearchAuthGetResponse = unknown; + +export type AuthResearchAuthGetError = unknown; diff --git a/mondey_backend/openapi.json b/mondey_backend/openapi.json new file mode 100644 index 00000000..506b6e81 --- /dev/null +++ b/mondey_backend/openapi.json @@ -0,0 +1 @@ +{"openapi": "3.1.0", "info": {"title": "MONDEY API", "version": "0.1.0"}, "paths": {"/languages/": {"get": {"tags": ["milestones"], "summary": "Get Languages", "operationId": "get_languages_languages__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Response Get Languages Languages Get"}}}}}}}, "/milestones/": {"get": {"tags": ["milestones"], "summary": "Get Milestones", "operationId": "get_milestones_milestones__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/MilestonePublic"}, "type": "array", "title": "Response Get Milestones Milestones Get"}}}}}}}, "/milestones/{milestone_id}": {"get": {"tags": ["milestones"], "summary": "Get Milestone", "operationId": "get_milestone_milestones__milestone_id__get", "parameters": [{"name": "milestone_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestonePublic"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/milestone-groups/": {"get": {"tags": ["milestones"], "summary": "Get Milestone Groups", "operationId": "get_milestone_groups_milestone_groups__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/MilestoneGroupPublic"}, "type": "array", "title": "Response Get Milestone Groups Milestone Groups Get"}}}}}}}, "/milestone-groups/{milestone_group_id}": {"get": {"tags": ["milestones"], "summary": "Get Milestone Group", "operationId": "get_milestone_group_milestone_groups__milestone_group_id__get", "parameters": [{"name": "milestone_group_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Group Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneGroupPublic"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/admin/languages/": {"post": {"tags": ["admin"], "summary": "Create Language", "operationId": "create_language_admin_languages__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/LanguageCreate"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Language"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"APIKeyCookie": []}]}}, "/admin/languages/{language_id}": {"delete": {"tags": ["admin"], "summary": "Delete Language", "operationId": "delete_language_admin_languages__language_id__delete", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "language_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Language Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Language"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/admin/milestone-groups/": {"get": {"tags": ["admin"], "summary": "Get Milestone Groups", "operationId": "get_milestone_groups_admin_milestone_groups__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/MilestoneGroupAdmin-Output"}, "type": "array", "title": "Response Get Milestone Groups Admin Milestone Groups Get"}}}}}, "security": [{"APIKeyCookie": []}]}, "post": {"tags": ["admin"], "summary": "Create Milestone Group", "operationId": "create_milestone_group_admin_milestone_groups__post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneGroupAdmin-Output"}}}}}, "security": [{"APIKeyCookie": []}]}}, "/admin/milestone-groups": {"put": {"tags": ["admin"], "summary": "Update Milestone Group", "operationId": "update_milestone_group_admin_milestone_groups_put", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneGroupAdmin-Input"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneGroupAdmin-Output"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"APIKeyCookie": []}]}}, "/admin/milestone-groups/{milestone_group_id}": {"delete": {"tags": ["admin"], "summary": "Delete Milestone Group", "operationId": "delete_milestone_group_admin_milestone_groups__milestone_group_id__delete", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "milestone_group_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Group Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/admin/milestone-group-images/{milestone_group_id}": {"put": {"tags": ["admin"], "summary": "Upload Milestone Group Image", "operationId": "upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "milestone_group_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Group Id"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/admin/milestones/{milestone_group_id}": {"post": {"tags": ["admin"], "summary": "Create Milestone", "operationId": "create_milestone_admin_milestones__milestone_group_id__post", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "milestone_group_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Group Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneAdmin"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/admin/milestones": {"put": {"tags": ["admin"], "summary": "Update Milestone", "operationId": "update_milestone_admin_milestones_put", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneAdmin"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneAdmin"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"APIKeyCookie": []}]}}, "/admin/milestones/{milestone_id}": {"delete": {"tags": ["admin"], "summary": "Delete Milestone", "operationId": "delete_milestone_admin_milestones__milestone_id__delete", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "milestone_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/admin/milestone-images/{milestone_id}": {"post": {"tags": ["admin"], "summary": "Upload Milestone Image", "operationId": "upload_milestone_image_admin_milestone_images__milestone_id__post", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "milestone_id", "in": "path", "required": true, "schema": {"type": "integer", "title": "Milestone Id"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_milestone_image_admin_milestone_images__milestone_id__post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MilestoneImage"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/users/me": {"get": {"tags": ["users"], "summary": "Users:Current User", "operationId": "users_current_user_users_me_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserRead"}}}}, "401": {"description": "Missing token or inactive user."}}, "security": [{"APIKeyCookie": []}]}, "patch": {"tags": ["users"], "summary": "Users:Patch Current User", "operationId": "users_patch_current_user_users_me_patch", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserUpdate"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserRead"}}}}, "401": {"description": "Missing token or inactive user."}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorModel"}, "examples": {"UPDATE_USER_EMAIL_ALREADY_EXISTS": {"summary": "A user with this email already exists.", "value": {"detail": "UPDATE_USER_EMAIL_ALREADY_EXISTS"}}, "UPDATE_USER_INVALID_PASSWORD": {"summary": "Password validation failed.", "value": {"detail": {"code": "UPDATE_USER_INVALID_PASSWORD", "reason": "Password should beat least 3 characters"}}}}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"APIKeyCookie": []}]}}, "/users/{id}": {"get": {"tags": ["users"], "summary": "Users:User", "operationId": "users_user_users__id__get", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserRead"}}}}, "401": {"description": "Missing token or inactive user."}, "403": {"description": "Not a superuser."}, "404": {"description": "The user does not exist."}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["users"], "summary": "Users:Patch User", "operationId": "users_patch_user_users__id__patch", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserRead"}}}}, "401": {"description": "Missing token or inactive user."}, "403": {"description": "Not a superuser."}, "404": {"description": "The user does not exist."}, "400": {"content": {"application/json": {"examples": {"UPDATE_USER_EMAIL_ALREADY_EXISTS": {"summary": "A user with this email already exists.", "value": {"detail": "UPDATE_USER_EMAIL_ALREADY_EXISTS"}}, "UPDATE_USER_INVALID_PASSWORD": {"summary": "Password validation failed.", "value": {"detail": {"code": "UPDATE_USER_INVALID_PASSWORD", "reason": "Password should beat least 3 characters"}}}}, "schema": {"$ref": "#/components/schemas/ErrorModel"}}}, "description": "Bad Request"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["users"], "summary": "Users:Delete User", "operationId": "users_delete_user_users__id__delete", "security": [{"APIKeyCookie": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "responses": {"204": {"description": "Successful Response"}, "401": {"description": "Missing token or inactive user."}, "403": {"description": "Not a superuser."}, "404": {"description": "The user does not exist."}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/auth/login": {"post": {"tags": ["auth"], "summary": "Auth:Cookie.Login", "operationId": "auth_cookie_login_auth_login_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/Body_auth_cookie_login_auth_login_post"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorModel"}, "examples": {"LOGIN_BAD_CREDENTIALS": {"summary": "Bad credentials or the user is inactive.", "value": {"detail": "LOGIN_BAD_CREDENTIALS"}}, "LOGIN_USER_NOT_VERIFIED": {"summary": "The user is not verified.", "value": {"detail": "LOGIN_USER_NOT_VERIFIED"}}}}}}, "204": {"description": "No Content"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/auth/logout": {"post": {"tags": ["auth"], "summary": "Auth:Cookie.Logout", "operationId": "auth_cookie_logout_auth_logout_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "401": {"description": "Missing token or inactive user."}, "204": {"description": "No Content"}}, "security": [{"APIKeyCookie": []}]}}, "/auth/register": {"post": {"tags": ["auth"], "summary": "Register:Register", "operationId": "register_register_auth_register_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserCreate"}}}, "required": true}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserRead"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorModel"}, "examples": {"REGISTER_USER_ALREADY_EXISTS": {"summary": "A user with this email already exists.", "value": {"detail": "REGISTER_USER_ALREADY_EXISTS"}}, "REGISTER_INVALID_PASSWORD": {"summary": "Password validation failed.", "value": {"detail": {"code": "REGISTER_INVALID_PASSWORD", "reason": "Password should beat least 3 characters"}}}}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/auth/forgot-password": {"post": {"tags": ["auth"], "summary": "Reset:Forgot Password", "operationId": "reset_forgot_password_auth_forgot_password_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_reset_forgot_password_auth_forgot_password_post"}}}, "required": true}, "responses": {"202": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/auth/reset-password": {"post": {"tags": ["auth"], "summary": "Reset:Reset Password", "operationId": "reset_reset_password_auth_reset_password_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_reset_reset_password_auth_reset_password_post"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorModel"}, "examples": {"RESET_PASSWORD_BAD_TOKEN": {"summary": "Bad or expired token.", "value": {"detail": "RESET_PASSWORD_BAD_TOKEN"}}, "RESET_PASSWORD_INVALID_PASSWORD": {"summary": "Password validation failed.", "value": {"detail": {"code": "RESET_PASSWORD_INVALID_PASSWORD", "reason": "Password should be at least 3 characters"}}}}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/auth/request-verify-token": {"post": {"tags": ["auth"], "summary": "Verify:Request-Token", "operationId": "verify_request_token_auth_request_verify_token_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_verify_request_token_auth_request_verify_token_post"}}}, "required": true}, "responses": {"202": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/auth/verify": {"post": {"tags": ["auth"], "summary": "Verify:Verify", "operationId": "verify_verify_auth_verify_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_verify_verify_auth_verify_post"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserRead"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorModel"}, "examples": {"VERIFY_USER_BAD_TOKEN": {"summary": "Bad token, not existing user ornot the e-mail currently set for the user.", "value": {"detail": "VERIFY_USER_BAD_TOKEN"}}, "VERIFY_USER_ALREADY_VERIFIED": {"summary": "The user is already verified.", "value": {"detail": "VERIFY_USER_ALREADY_VERIFIED"}}}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/research/auth/": {"get": {"tags": ["research"], "summary": "Auth", "operationId": "auth_research_auth__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}, "security": [{"APIKeyCookie": []}]}}}, "components": {"schemas": {"Body_auth_cookie_login_auth_login_post": {"properties": {"grant_type": {"anyOf": [{"type": "string", "pattern": "password"}, {"type": "null"}], "title": "Grant Type"}, "username": {"type": "string", "title": "Username"}, "password": {"type": "string", "title": "Password"}, "scope": {"type": "string", "title": "Scope", "default": ""}, "client_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Id"}, "client_secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Secret"}}, "type": "object", "required": ["username", "password"], "title": "Body_auth_cookie_login_auth_login_post"}, "Body_reset_forgot_password_auth_forgot_password_post": {"properties": {"email": {"type": "string", "format": "email", "title": "Email"}}, "type": "object", "required": ["email"], "title": "Body_reset_forgot_password_auth_forgot_password_post"}, "Body_reset_reset_password_auth_reset_password_post": {"properties": {"token": {"type": "string", "title": "Token"}, "password": {"type": "string", "title": "Password"}}, "type": "object", "required": ["token", "password"], "title": "Body_reset_reset_password_auth_reset_password_post"}, "Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put": {"properties": {"file": {"type": "string", "format": "binary", "title": "File"}}, "type": "object", "required": ["file"], "title": "Body_upload_milestone_group_image_admin_milestone_group_images__milestone_group_id__put"}, "Body_upload_milestone_image_admin_milestone_images__milestone_id__post": {"properties": {"file": {"type": "string", "format": "binary", "title": "File"}}, "type": "object", "required": ["file"], "title": "Body_upload_milestone_image_admin_milestone_images__milestone_id__post"}, "Body_verify_request_token_auth_request_verify_token_post": {"properties": {"email": {"type": "string", "format": "email", "title": "Email"}}, "type": "object", "required": ["email"], "title": "Body_verify_request_token_auth_request_verify_token_post"}, "Body_verify_verify_auth_verify_post": {"properties": {"token": {"type": "string", "title": "Token"}}, "type": "object", "required": ["token"], "title": "Body_verify_verify_auth_verify_post"}, "ErrorModel": {"properties": {"detail": {"anyOf": [{"type": "string"}, {"additionalProperties": {"type": "string"}, "type": "object"}], "title": "Detail"}}, "type": "object", "required": ["detail"], "title": "ErrorModel"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "Language": {"properties": {"id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Id"}, "lang": {"type": "string", "maxLength": 2, "title": "Lang"}}, "type": "object", "required": ["lang"], "title": "Language"}, "LanguageCreate": {"properties": {"lang": {"type": "string", "maxLength": 2, "title": "Lang"}}, "type": "object", "required": ["lang"], "title": "LanguageCreate"}, "MilestoneAdmin": {"properties": {"id": {"type": "integer", "title": "Id"}, "group_id": {"type": "integer", "title": "Group Id"}, "order": {"type": "integer", "title": "Order"}, "text": {"additionalProperties": {"$ref": "#/components/schemas/MilestoneText"}, "type": "object", "title": "Text", "default": {}}, "images": {"items": {"$ref": "#/components/schemas/MilestoneImage"}, "type": "array", "title": "Images", "default": []}}, "type": "object", "required": ["id", "group_id", "order"], "title": "MilestoneAdmin"}, "MilestoneGroupAdmin-Input": {"properties": {"id": {"type": "integer", "title": "Id"}, "order": {"type": "integer", "title": "Order"}, "text": {"additionalProperties": {"$ref": "#/components/schemas/MilestoneGroupText"}, "type": "object", "title": "Text", "default": {}}, "milestones": {"items": {"$ref": "#/components/schemas/MilestoneAdmin"}, "type": "array", "title": "Milestones", "default": []}}, "type": "object", "required": ["id", "order"], "title": "MilestoneGroupAdmin"}, "MilestoneGroupAdmin-Output": {"properties": {"id": {"type": "integer", "title": "Id"}, "order": {"type": "integer", "title": "Order"}, "text": {"additionalProperties": {"$ref": "#/components/schemas/MilestoneGroupText"}, "type": "object", "title": "Text", "default": {}}, "milestones": {"items": {"$ref": "#/components/schemas/MilestoneAdmin"}, "type": "array", "title": "Milestones", "default": []}}, "type": "object", "required": ["id", "order"], "title": "MilestoneGroupAdmin"}, "MilestoneGroupPublic": {"properties": {"id": {"type": "integer", "title": "Id"}, "text": {"additionalProperties": {"$ref": "#/components/schemas/MilestoneGroupTextPublic"}, "type": "object", "title": "Text", "default": {}}, "milestones": {"items": {"$ref": "#/components/schemas/MilestonePublic"}, "type": "array", "title": "Milestones", "default": []}}, "type": "object", "required": ["id"], "title": "MilestoneGroupPublic"}, "MilestoneGroupText": {"properties": {"title": {"type": "string", "title": "Title", "default": ""}, "desc": {"type": "string", "title": "Desc", "default": ""}, "group_id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Group Id"}, "lang_id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Lang Id"}}, "type": "object", "title": "MilestoneGroupText"}, "MilestoneGroupTextPublic": {"properties": {"title": {"type": "string", "title": "Title", "default": ""}, "desc": {"type": "string", "title": "Desc", "default": ""}}, "type": "object", "title": "MilestoneGroupTextPublic"}, "MilestoneImage": {"properties": {"id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Id"}, "milestone_id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Milestone Id"}, "filename": {"type": "string", "title": "Filename", "default": ""}, "approved": {"type": "boolean", "title": "Approved", "default": false}}, "type": "object", "title": "MilestoneImage"}, "MilestoneImagePublic": {"properties": {"filename": {"type": "string", "title": "Filename"}, "approved": {"type": "boolean", "title": "Approved"}}, "type": "object", "required": ["filename", "approved"], "title": "MilestoneImagePublic"}, "MilestonePublic": {"properties": {"id": {"type": "integer", "title": "Id"}, "text": {"additionalProperties": {"$ref": "#/components/schemas/MilestoneGroupTextPublic"}, "type": "object", "title": "Text", "default": {}}, "images": {"items": {"$ref": "#/components/schemas/MilestoneImagePublic"}, "type": "array", "title": "Images", "default": []}}, "type": "object", "required": ["id"], "title": "MilestonePublic"}, "MilestoneText": {"properties": {"title": {"type": "string", "title": "Title", "default": ""}, "desc": {"type": "string", "title": "Desc", "default": ""}, "obs": {"type": "string", "title": "Obs", "default": ""}, "help": {"type": "string", "title": "Help", "default": ""}, "milestone_id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Milestone Id"}, "lang_id": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Lang Id"}}, "type": "object", "title": "MilestoneText"}, "UserCreate": {"properties": {"email": {"type": "string", "format": "email", "title": "Email"}, "password": {"type": "string", "title": "Password"}, "is_active": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Active", "default": true}, "is_superuser": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Superuser", "default": false}, "is_verified": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Verified", "default": false}, "is_researcher": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Researcher", "default": false}}, "type": "object", "required": ["email", "password"], "title": "UserCreate"}, "UserRead": {"properties": {"id": {"type": "integer", "title": "Id"}, "email": {"type": "string", "format": "email", "title": "Email"}, "is_active": {"type": "boolean", "title": "Is Active", "default": true}, "is_superuser": {"type": "boolean", "title": "Is Superuser", "default": false}, "is_verified": {"type": "boolean", "title": "Is Verified", "default": false}, "is_researcher": {"type": "boolean", "title": "Is Researcher"}}, "type": "object", "required": ["id", "email", "is_researcher"], "title": "UserRead"}, "UserUpdate": {"properties": {"password": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Password"}, "email": {"anyOf": [{"type": "string", "format": "email"}, {"type": "null"}], "title": "Email"}, "is_active": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Active"}, "is_superuser": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Superuser"}, "is_verified": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Verified"}, "is_researcher": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Researcher"}}, "type": "object", "title": "UserUpdate"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}, "securitySchemes": {"APIKeyCookie": {"type": "apiKey", "in": "cookie", "name": "fastapiusersauth"}}}} \ No newline at end of file diff --git a/mondey_backend/pyproject.toml b/mondey_backend/pyproject.toml index 53b1e749..42ac27bc 100644 --- a/mondey_backend/pyproject.toml +++ b/mondey_backend/pyproject.toml @@ -17,6 +17,7 @@ dependencies = [ "aiosqlite", "python-multipart", "pydantic-settings", + "click", ] dynamic = ["version"] @@ -29,6 +30,7 @@ tests = [ [project.scripts] mondey-backend = "mondey_backend.main:main" +mondey-export-openapi-json = "mondey_backend.export:export_openapi_json" [tool.hatch.version] path = "src/mondey_backend/__init__.py" diff --git a/mondey_backend/src/mondey_backend/export.py b/mondey_backend/src/mondey_backend/export.py new file mode 100644 index 00000000..5135b67e --- /dev/null +++ b/mondey_backend/src/mondey_backend/export.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +import json + +import click +from fastapi.openapi.utils import get_openapi + +from .main import create_app + + +@click.command() +@click.argument("filename", default="openapi.json") +def export_openapi_json(filename: str) -> None: + app = create_app() + click.echo(f"Exporting MONDEY OpenAPI spec to {filename}...", nl=False) + with open(filename, "w") as f: + json.dump( + get_openapi( + title=app.title, + version=app.version, + openapi_version=app.openapi_version, + description=app.description, + routes=app.routes, + ), + f, + ) + click.echo("done.") diff --git a/mondey_backend/tests/conftest.py b/mondey_backend/tests/conftest.py index 447a29ad..ea59c858 100644 --- a/mondey_backend/tests/conftest.py +++ b/mondey_backend/tests/conftest.py @@ -5,6 +5,11 @@ import pytest from fastapi import FastAPI from fastapi.testclient import TestClient +from sqlmodel import Session +from sqlmodel import SQLModel +from sqlmodel import create_engine +from sqlmodel.pool import StaticPool + from mondey_backend import settings from mondey_backend.dependencies import current_active_researcher from mondey_backend.dependencies import current_active_superuser @@ -18,10 +23,6 @@ from mondey_backend.models.milestones import MilestoneImage from mondey_backend.models.milestones import MilestoneText from mondey_backend.models.users import UserRead -from sqlmodel import Session -from sqlmodel import SQLModel -from sqlmodel import create_engine -from sqlmodel.pool import StaticPool @pytest.fixture(scope="session")