From 34140596bf5b01ed83fceeee03b1e5d6c35d42fa Mon Sep 17 00:00:00 2001 From: nael Date: Wed, 1 Nov 2023 19:02:34 +0100 Subject: [PATCH] feat: fix --- .github/workflows/update_prisma_schema.yml | 9 +- packages/api/package.json | 4 + pnpm-lock.yaml | 181 +++++++++++++++++---- 3 files changed, 163 insertions(+), 31 deletions(-) diff --git a/.github/workflows/update_prisma_schema.yml b/.github/workflows/update_prisma_schema.yml index 558573295..26de76b21 100644 --- a/.github/workflows/update_prisma_schema.yml +++ b/.github/workflows/update_prisma_schema.yml @@ -3,10 +3,15 @@ name: Update Prisma Schema on: schedule: # Runs every 30 minutes - - cron: "*/5 * * * *" + - cron: "*/2 * * * *" jobs: update-schema: + permissions: + contents: write + issues: write + pull-requests: write + env: DATABASE_URL: ${{ secrets.DATABASE_URL }} runs-on: ubuntu-latest @@ -59,7 +64,7 @@ jobs: if: steps.git-check.outputs.changes_detected == 'true' uses: pascalgn/automerge-action@v0.14.3 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} mergeMethod: squash commitMessage: "chore: Update Prisma schema" pullRequestFilterLabels: "auto-merge" diff --git a/packages/api/package.json b/packages/api/package.json index 58f7f85e1..6896d36a9 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -24,10 +24,13 @@ "@nestjs/common": "^10.0.0", "@nestjs/core": "^10.0.0", "@nestjs/mapped-types": "*", + "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^10.0.0", "@nestjs/swagger": "^7.1.14", "@prisma/client": "^5.4.2", "axios": "^1.5.1", + "passport": "^0.6.0", + "passport-local": "^1.0.0", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1", "uuid": "^9.0.1" @@ -39,6 +42,7 @@ "@types/express": "^4.17.17", "@types/jest": "^29.5.2", "@types/node": "^20.3.1", + "@types/passport-local": "^1.0.37", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ce74a53f..1029454ba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,6 +75,9 @@ importers: '@nestjs/mapped-types': specifier: '*' version: 0.0.1(class-transformer@0.2.3)(class-validator@0.11.1)(reflect-metadata@0.1.13) + '@nestjs/passport': + specifier: ^10.0.2 + version: 10.0.2(@nestjs/common@10.0.0)(passport@0.6.0) '@nestjs/platform-express': specifier: ^10.0.0 version: 10.0.0(@nestjs/common@10.0.0)(@nestjs/core@10.0.0) @@ -87,6 +90,12 @@ importers: axios: specifier: ^1.5.1 version: 1.5.1 + passport: + specifier: ^0.6.0 + version: 0.6.0 + passport-local: + specifier: ^1.0.0 + version: 1.0.0 reflect-metadata: specifier: ^0.1.13 version: 0.1.13 @@ -115,6 +124,9 @@ importers: '@types/node': specifier: ^20.3.1 version: 20.3.1 + '@types/passport-local': + specifier: ^1.0.37 + version: 1.0.37 '@types/supertest': specifier: ^2.0.12 version: 2.0.12 @@ -172,10 +184,10 @@ importers: devDependencies: '@typescript-eslint/eslint-plugin': specifier: ^6.9.0 - version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@4.9.5) + version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.1.3) '@typescript-eslint/parser': specifier: ^6.9.0 - version: 6.9.0(eslint@8.52.0)(typescript@4.9.5) + version: 6.9.0(eslint@8.52.0)(typescript@5.1.3) eslint: specifier: ^8.52.0 version: 8.52.0 @@ -184,7 +196,53 @@ importers: version: 7.33.2(eslint@8.52.0) tsup: specifier: ^7.2.0 - version: 7.2.0(typescript@4.9.5) + version: 7.2.0(typescript@5.1.3) + + website-docs: + dependencies: + '@docusaurus/core': + specifier: 2.4.3 + version: 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@17.0.2)(react@17.0.2)(typescript@4.9.5) + '@docusaurus/preset-classic': + specifier: 2.4.3 + version: 2.4.3(@algolia/client-search@4.20.0)(eslint@8.52.0)(react-dom@17.0.2)(react@17.0.2)(search-insights@2.9.0)(typescript@4.9.5) + '@mdx-js/react': + specifier: ^1.6.22 + version: 1.6.22(react@17.0.2) + clsx: + specifier: ^1.2.1 + version: 1.2.1 + prism-react-renderer: + specifier: ^1.3.5 + version: 1.3.5(react@17.0.2) + react: + specifier: ^17.0.2 + version: 17.0.2 + react-dom: + specifier: ^17.0.2 + version: 17.0.2(react@17.0.2) + devDependencies: + '@docusaurus/module-type-aliases': + specifier: 2.4.3 + version: 2.4.3(react-dom@17.0.2)(react@17.0.2) + '@tsconfig/docusaurus': + specifier: ^1.0.7 + version: 1.0.7 + '@typescript-eslint/eslint-plugin': + specifier: ^6.9.1 + version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^6.9.1 + version: 6.9.1(eslint@8.52.0)(typescript@4.9.5) + eslint: + specifier: ^8.52.0 + version: 8.52.0 + eslint-plugin-react: + specifier: ^7.33.2 + version: 7.33.2(eslint@8.52.0) + typescript: + specifier: ^4.9.5 + version: 4.9.5 packages: @@ -3434,6 +3492,16 @@ packages: reflect-metadata: 0.1.13 dev: false + /@nestjs/passport@10.0.2(@nestjs/common@10.0.0)(passport@0.6.0): + resolution: {integrity: sha512-od31vfB2z3y05IDB5dWSbCGE2+pAf2k2WCBinNuTTOxN0O0+wtO1L3kawj/aCW3YR9uxsTOVbTDwtwgpNNsnjQ==} + peerDependencies: + '@nestjs/common': ^8.0.0 || ^9.0.0 || ^10.0.0 + passport: ^0.4.0 || ^0.5.0 || ^0.6.0 + dependencies: + '@nestjs/common': 10.0.0(class-transformer@0.2.3)(class-validator@0.11.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + passport: 0.6.0 + dev: false + /@nestjs/platform-express@10.0.0(@nestjs/common@10.0.0)(@nestjs/core@10.0.0): resolution: {integrity: sha512-jOQBPVpk7B4JFXZZwxHSsY6odIqZlea9CbqKzu/hfDyqRv+AwuJk5gprvvL6RpWAHNyRMH1r5/14bqcXD3+WGw==} peerDependencies: @@ -3988,6 +4056,27 @@ packages: resolution: {integrity: sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==} dev: false + /@types/passport-local@1.0.37: + resolution: {integrity: sha512-c57CwMHhMP2BBiOLyQZGRP43F8JtC84H976YVJdiU4EIWvqRCZ3F7QtsEgksOEIgMOk1Kz3EEKGA93OiDPQtRQ==} + dependencies: + '@types/express': 4.17.17 + '@types/passport': 1.0.14 + '@types/passport-strategy': 0.2.37 + dev: true + + /@types/passport-strategy@0.2.37: + resolution: {integrity: sha512-ltgwLnwHVfpjK7/66lpv43hiz90nIVb36JmeB0iF3FAZoHX6+LbkY5Ey97Bm8Jr0uGhQyDFEsSOOfejp5PJehg==} + dependencies: + '@types/express': 4.17.17 + '@types/passport': 1.0.14 + dev: true + + /@types/passport@1.0.14: + resolution: {integrity: sha512-D6p2ygR2S7Cq5PO7iUaEIQu/5WrM0tONu6Lxgk0C9r3lafQIlVpWCo3V/KI9To3OqHBxcfQaOeK+8AvwW5RYmw==} + dependencies: + '@types/express': 4.17.17 + dev: true + /@types/prop-types@15.7.9: resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==} @@ -4137,7 +4226,7 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@4.9.5): + /@typescript-eslint/eslint-plugin@6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.1.3): resolution: {integrity: sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -4149,10 +4238,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@4.9.5) + '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.1.3) '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/type-utils': 6.9.0(eslint@8.52.0)(typescript@4.9.5) - '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@4.9.5) + '@typescript-eslint/type-utils': 6.9.0(eslint@8.52.0)(typescript@5.1.3) + '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.1.3) '@typescript-eslint/visitor-keys': 6.9.0 debug: 4.3.4 eslint: 8.52.0 @@ -4160,8 +4249,8 @@ packages: ignore: 5.2.4 natural-compare: 1.4.0 semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@4.9.5) - typescript: 4.9.5 + ts-api-utils: 1.0.3(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true @@ -4215,7 +4304,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@4.9.5): + /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@5.1.3): resolution: {integrity: sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -4227,11 +4316,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.9.0 '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/typescript-estree': 6.9.0(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.1.3) '@typescript-eslint/visitor-keys': 6.9.0 debug: 4.3.4 eslint: 8.52.0 - typescript: 4.9.5 + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true @@ -4301,7 +4390,7 @@ packages: - supports-color dev: true - /@typescript-eslint/type-utils@6.9.0(eslint@8.52.0)(typescript@4.9.5): + /@typescript-eslint/type-utils@6.9.0(eslint@8.52.0)(typescript@5.1.3): resolution: {integrity: sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -4311,12 +4400,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.9.0(typescript@4.9.5) - '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.1.3) + '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.1.3) debug: 4.3.4 eslint: 8.52.0 - ts-api-utils: 1.0.3(typescript@4.9.5) - typescript: 4.9.5 + ts-api-utils: 1.0.3(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true @@ -4377,7 +4466,7 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.9.0(typescript@4.9.5): + /@typescript-eslint/typescript-estree@6.9.0(typescript@5.1.3): resolution: {integrity: sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -4392,8 +4481,8 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@4.9.5) - typescript: 4.9.5 + ts-api-utils: 1.0.3(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true @@ -4439,7 +4528,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.9.0(eslint@8.52.0)(typescript@4.9.5): + /@typescript-eslint/utils@6.9.0(eslint@8.52.0)(typescript@5.1.3): resolution: {integrity: sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -4450,7 +4539,7 @@ packages: '@types/semver': 7.5.4 '@typescript-eslint/scope-manager': 6.9.0 '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/typescript-estree': 6.9.0(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.1.3) eslint: 8.52.0 semver: 7.5.4 transitivePeerDependencies: @@ -9817,6 +9906,27 @@ packages: tslib: 2.6.2 dev: false + /passport-local@1.0.0: + resolution: {integrity: sha512-9wCE6qKznvf9mQYYbgJ3sVOHmCWoUNMVFoZzNoznmISbhnNNPhN9xfY3sLmScHMetEJeoY7CXwfhCe7argfQow==} + engines: {node: '>= 0.4.0'} + dependencies: + passport-strategy: 1.0.0 + dev: false + + /passport-strategy@1.0.0: + resolution: {integrity: sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==} + engines: {node: '>= 0.4.0'} + dev: false + + /passport@0.6.0: + resolution: {integrity: sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug==} + engines: {node: '>= 0.4.0'} + dependencies: + passport-strategy: 1.0.0 + pause: 0.0.1 + utils-merge: 1.0.1 + dev: false + /path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -9874,6 +9984,10 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + /pause@0.0.1: + resolution: {integrity: sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==} + dev: false + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -12026,6 +12140,15 @@ packages: typescript: 4.9.5 dev: true + /ts-api-utils@1.0.3(typescript@5.1.3): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.1.3 + dev: true + /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true @@ -12138,7 +12261,7 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsup@7.2.0(typescript@4.9.5): + /tsup@7.2.0(typescript@5.1.3): resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} engines: {node: '>=16.14'} hasBin: true @@ -12168,7 +12291,7 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.34.0 tree-kill: 1.2.2 - typescript: 4.9.5 + typescript: 5.1.3 transitivePeerDependencies: - supports-color - ts-node @@ -12560,13 +12683,13 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} -<<<<<<< HEAD - /uuid@9.0.1: - resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} -======= /uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} ->>>>>>> main + hasBin: true + dev: false + + /uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true dev: false