From e1235a26408979b45d383e97122e43fb0485f5f4 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Thu, 22 Sep 2022 13:05:20 +0545 Subject: [PATCH] feat(swagger): add swagger comment introspection feat(swagger): add swagger stats --- README.md | 9 +- nest-cli.json | 2 + package.json | 26 +- pnpm-lock.yaml | 376 +++++++++++--------- src/common/classes/pagination.ts | 56 ++- src/common/helpers/app.utils.ts | 9 +- src/common/helpers/helpers.utils.ts | 23 -- src/common/misc/misc.ts | 25 +- src/common/types/enums/misc.enum.ts | 8 + src/modules/post/dtos/create-comment.dto.ts | 5 + src/modules/post/dtos/create-post.dto.ts | 20 ++ src/modules/user/dtos/create-user.dto.ts | 35 +- src/modules/user/user.controller.ts | 9 +- 13 files changed, 369 insertions(+), 234 deletions(-) diff --git a/README.md b/README.md index bcbedb89..089009b5 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Note: If you are using windows, `SET NODE_ENV=dev npm run start` ## Features covered: - ๐ŸŒ **i18n** - Internationalization +- ๐Ÿงต **Stats** - swagger stats for common server metrics - ๐Ÿงต **piscina** - threads for cpu extensive tasks - ๐Ÿ’ฌ **Twillio** - sms support - ๐Ÿ“ฑ **NestJS** โ€” latest version @@ -83,23 +84,24 @@ Additionally, you can also see the scripts in `makefile` # Migration and seeding Migrations are used to update the database schema. The migration files are stored in `migrations` directory. + ```sh env=dev make migrate # applies migration for dev env ``` + Seeding is used to insert data into the database. The seeding files are stored in `common/database/seeders` directory. + ```sh env=dev USER_PASSWORD=Test@1234 make seed # seeds data for dev env with user password set as Test@1234 ``` - - - ## Start application - `NODE_ENV=[env name] npm run start` (without ssl) - `NODE_ENV=[env name] SSL=true npm run start` (with ssl) - Test api by browsing to `http://localhost:[port]/v1/user` - View automatically generated swagger api docs by browsing to `http://localhost:[port]/docs` +- View automatically generated swagger stats dashboard by browsing to `http://localhost:[port]/stats`. The username and password is the values set in the env file under `SWAGGER_USERNAME` and `SWAGGER_PASS` respectively --- @@ -107,7 +109,6 @@ Seeding is used to insert data into the database. The seeding files are stored i This applications uses JSON Web Token (JWT) to handle authentication. The token is passed with each request using the `Authorization` header with `Token` scheme. The JWT authentication middleware handles the validation and authentication of the token. - # Deployment You need to have docker and docker-compose installed. Also since we are using makefiles for deployment, you need to have make installed. diff --git a/nest-cli.json b/nest-cli.json index 7e5da4da..0b910285 100755 --- a/nest-cli.json +++ b/nest-cli.json @@ -7,6 +7,8 @@ "name": "@nestjs/swagger/plugin", "options": { "classValidatorShim": true, + "introspectComments": true, + "controllerKeyOfComment": "description", "dtoFileNameSuffix": [".entity.ts", ".dto.ts"], "controllerFileNameSuffix": [".controller.ts"] } diff --git a/package.json b/package.json index 2aa65452..8084d724 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ultimate-nest", - "version": "1.6.0", + "version": "1.6.5", "description": "NestJS + MikroORM realworld API example", "license": "MIT", "repository": "https://github.com/rubiin/ultimate-nest", @@ -22,9 +22,9 @@ }, "dependencies": { "@aws-sdk/client-ses": "^3.171.0", - "@casl/ability": "^6.1.1", + "@casl/ability": "^6.2.0", "@golevelup/nestjs-modules": "^0.6.1", - "@golevelup/nestjs-rabbitmq": "^3.2.0", + "@golevelup/nestjs-rabbitmq": "^3.3.0", "@mikro-orm/core": "^5.4.2", "@mikro-orm/migrations": "^5.4.2", "@mikro-orm/nestjs": "^5.1.2", @@ -34,12 +34,12 @@ "@nestjs/axios": "^0.1.0", "@nestjs/class-transformer": "^0.4.0", "@nestjs/class-validator": "^0.13.4", - "@nestjs/common": "9.0.11", + "@nestjs/common": "9.1.1", "@nestjs/config": "^2.2.0", - "@nestjs/core": "9.0.11", + "@nestjs/core": "9.1.1", "@nestjs/jwt": "^9.0.0", "@nestjs/passport": "^9.0.0", - "@nestjs/platform-express": "^9.0.11", + "@nestjs/platform-express": "^9.1.1", "@nestjs/serve-static": "^3.0.0", "@nestjs/swagger": "^6.1.2", "@nestjs/terminus": "^9.1.1", @@ -58,11 +58,11 @@ "eta": "^1.12.3", "firebase-admin": "^11.0.1", "helmet": "^6.0.0", - "helper-fns": "^2.5.14", + "helper-fns": "^2.5.15", "joi": "^17.6.0", "nanoid": "^4.0.0", "nestjs-i18n": "^9.1.10", - "nestjs-minio": "^2.2.0", + "nestjs-minio": "^2.2.1", "nestjs-pino": "^3.1.1", "nodemailer": "^6.7.8", "passport": "0.6.0", @@ -77,7 +77,7 @@ "rxjs": "^7.5.6", "sharp": "^0.31.0", "swagger-stats": "^0.99.2", - "twilio": "^3.82.0" + "twilio": "^3.82.1" }, "devDependencies": { "@firebase/app-compat": "0.x", @@ -87,7 +87,7 @@ "@mikro-orm/seeder": "^5.4.2", "@nestjs/cli": "9.1.3", "@nestjs/schematics": "9.0.3", - "@nestjs/testing": "9.0.11", + "@nestjs/testing": "9.1.1", "@types/cache-manager": "^4.0.2", "@types/cache-manager-redis-store": "^2.0.1", "@types/compression": "^1.7.2", @@ -104,8 +104,8 @@ "@types/sharp": "^0.31.0", "@types/supertest": "2.0.12", "@types/swagger-ui-express": "^4.1.3", - "@typescript-eslint/eslint-plugin": "^5.37.0", - "@typescript-eslint/parser": "^5.37.0", + "@typescript-eslint/eslint-plugin": "^5.38.0", + "@typescript-eslint/parser": "^5.38.0", "cz-conventional-changelog": "3.3.0", "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", @@ -122,7 +122,7 @@ "sample-env": "^1.0.2", "supertest": "6.2.4", "ts-jest": "29.0.1", - "ts-loader": "9.3.1", + "ts-loader": "9.4.1", "ts-node": "10.9.1", "tsconfig-paths": "4.1.0", "typescript": "^4.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a4ed2eb3..8b9f21ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,11 +2,11 @@ lockfileVersion: 5.4 specifiers: "@aws-sdk/client-ses": ^3.171.0 - "@casl/ability": ^6.1.1 + "@casl/ability": ^6.2.0 "@firebase/app-compat": 0.x "@firebase/app-types": 0.x "@golevelup/nestjs-modules": ^0.6.1 - "@golevelup/nestjs-rabbitmq": ^3.2.0 + "@golevelup/nestjs-rabbitmq": ^3.3.0 "@golevelup/ts-jest": ^0.3.3 "@mikro-orm/cli": ^5.4.2 "@mikro-orm/core": ^5.4.2 @@ -20,17 +20,17 @@ specifiers: "@nestjs/class-transformer": ^0.4.0 "@nestjs/class-validator": ^0.13.4 "@nestjs/cli": 9.1.3 - "@nestjs/common": 9.0.11 + "@nestjs/common": 9.1.1 "@nestjs/config": ^2.2.0 - "@nestjs/core": 9.0.11 + "@nestjs/core": 9.1.1 "@nestjs/jwt": ^9.0.0 "@nestjs/passport": ^9.0.0 - "@nestjs/platform-express": ^9.0.11 + "@nestjs/platform-express": ^9.1.1 "@nestjs/schematics": 9.0.3 "@nestjs/serve-static": ^3.0.0 "@nestjs/swagger": ^6.1.2 "@nestjs/terminus": ^9.1.1 - "@nestjs/testing": 9.0.11 + "@nestjs/testing": 9.1.1 "@nestjs/throttler": ^3.0.0 "@sentry/hub": ^7.13.0 "@sentry/node": ^7.13.0 @@ -52,8 +52,8 @@ specifiers: "@types/sharp": ^0.31.0 "@types/supertest": 2.0.12 "@types/swagger-ui-express": ^4.1.3 - "@typescript-eslint/eslint-plugin": ^5.37.0 - "@typescript-eslint/parser": ^5.37.0 + "@typescript-eslint/eslint-plugin": ^5.38.0 + "@typescript-eslint/parser": ^5.38.0 "@xiifain/nestjs-sentry": ^4.0.2 argon2: ^0.29.1 cache-manager: ^4.1.0 @@ -66,7 +66,6 @@ specifiers: eslint-config-prettier: ^8.5.0 eslint-import-resolver-typescript: ^3.5.1 eslint-plugin-import: ^2.26.0 - eslint-plugin-no-secrets: ^0.8.9 eslint-plugin-prettier: ^4.2.1 eslint-plugin-simple-import-sort: ^8.0.0 eslint-plugin-unicorn: ^43.0.2 @@ -74,14 +73,14 @@ specifiers: express: ^4.18.1 firebase-admin: ^11.0.1 helmet: ^6.0.0 - helper-fns: ^2.5.14 + helper-fns: ^2.5.15 husky: ^8.0.1 jest: 29.0.3 joi: ^17.6.0 lint-staged: ^13.0.3 nanoid: ^4.0.0 nestjs-i18n: ^9.1.10 - nestjs-minio: ^2.2.0 + nestjs-minio: ^2.2.1 nestjs-pino: ^3.1.1 nodemailer: ^6.7.8 passport: 0.6.0 @@ -100,42 +99,42 @@ specifiers: supertest: 6.2.4 swagger-stats: ^0.99.2 ts-jest: 29.0.1 - ts-loader: 9.3.1 + ts-loader: 9.4.1 ts-node: 10.9.1 tsconfig-paths: 4.1.0 - twilio: ^3.82.0 + twilio: ^3.82.1 typescript: ^4.8 webpack: ^5.74.0 dependencies: "@aws-sdk/client-ses": 3.171.0 - "@casl/ability": 6.1.1 - "@golevelup/nestjs-modules": 0.6.1_bn6reqtvhrta6qnzhyw65epcha - "@golevelup/nestjs-rabbitmq": 3.2.0_bn6reqtvhrta6qnzhyw65epcha + "@casl/ability": 6.2.0 + "@golevelup/nestjs-modules": 0.6.1_qppydktqusgsmilzmmjwjzbxni + "@golevelup/nestjs-rabbitmq": 3.3.0_qppydktqusgsmilzmmjwjzbxni "@mikro-orm/core": 5.4.2_slxuuie7mcjdrnj4kog3o76q34 "@mikro-orm/migrations": 5.4.2_gx4qpbej4qnj53to75in55gjcu - "@mikro-orm/nestjs": 5.1.2_n7uo52so5jbxtemyhiia2vuztq + "@mikro-orm/nestjs": 5.1.2_cl6lrx567qpyzuqvgbbem3l5iu "@mikro-orm/postgresql": 5.4.2_kdfmmkkd46hr2266p3exwsatv4 "@mikro-orm/reflection": 5.4.2_@mikro-orm+core@5.4.2 "@mikro-orm/sql-highlighter": 1.0.1 - "@nestjs/axios": 0.1.0_3mdbamkp7cmelffjfexsjo7tau + "@nestjs/axios": 0.1.0_4n3ycpsuqlpcarpvaa3djcpybe "@nestjs/class-transformer": 0.4.0 "@nestjs/class-validator": 0.13.4 - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/config": 2.2.0_3mdbamkp7cmelffjfexsjo7tau - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa - "@nestjs/jwt": 9.0.0_@nestjs+common@9.0.11 - "@nestjs/passport": 9.0.0_qmmxbt2dwte7f4tgsyyoa7ob5i - "@nestjs/platform-express": 9.0.11_khr6mt6ojlxbw7bo55fknouh34 - "@nestjs/serve-static": 3.0.0_khr6mt6ojlxbw7bo55fknouh34 - "@nestjs/swagger": 6.1.2_gxognro6jnhbk3hfbqy2jlgnri - "@nestjs/terminus": 9.1.1_mr622mjrz7hsw5sxbt7k6brday - "@nestjs/throttler": 3.0.0_fvppslgepxggj3fnmtlnh4cori + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/config": 2.2.0_4n3ycpsuqlpcarpvaa3djcpybe + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie + "@nestjs/jwt": 9.0.0_@nestjs+common@9.1.1 + "@nestjs/passport": 9.0.0_tnwnmclzqpvlo4qhkmv7ek5dsi + "@nestjs/platform-express": 9.1.1_xhkir6qpcnigaiptpizzepd5vm + "@nestjs/serve-static": 3.0.0_xhkir6qpcnigaiptpizzepd5vm + "@nestjs/swagger": 6.1.2_tlns3lhb3swoijjkdbond3dwfq + "@nestjs/terminus": 9.1.1_lvyuu442bprgqcs24ahm77yfdm + "@nestjs/throttler": 3.0.0_cuyymkxypo2mw5ephsyhgkx76q "@sentry/hub": 7.13.0 "@sentry/node": 7.13.0 "@sentry/types": 7.13.0 "@supercharge/request-ip": 1.2.0 - "@xiifain/nestjs-sentry": 4.0.2_fjwmy3kxb4c622ysgycg3yr5fm + "@xiifain/nestjs-sentry": 4.0.2_d6cjlp4t6l5dxaeykm2lfdmrbu argon2: 0.29.1 cache-manager: 4.1.0 cache-manager-redis-store: 2.0.0 @@ -145,12 +144,12 @@ dependencies: eta: 1.12.3 firebase-admin: 11.0.1_@firebase+app-types@0.7.0 helmet: 6.0.0 - helper-fns: 2.5.14 + helper-fns: 2.5.15 joi: 17.6.0 nanoid: 4.0.0 - nestjs-i18n: 9.1.10_oonymkv6qq72ebvisdbbroskp4 - nestjs-minio: 2.2.0_khr6mt6ojlxbw7bo55fknouh34 - nestjs-pino: 3.1.1_i6unz6wuqvgkfrilibx2liv5zi + nestjs-i18n: 9.1.10_kiigyizlxskbbhbpzivd6qwmqu + nestjs-minio: 2.2.1_xhkir6qpcnigaiptpizzepd5vm + nestjs-pino: 3.1.1_ilg3hsl3ydt2anwg54qfgy62bm nodemailer: 6.7.8 passport: 0.6.0 passport-facebook: 3.0.0 @@ -164,7 +163,7 @@ dependencies: rxjs: 7.5.6 sharp: 0.31.0 swagger-stats: 0.99.2_prom-client@13.2.0 - twilio: 3.82.0 + twilio: 3.82.1 devDependencies: "@firebase/app-compat": 0.1.32 @@ -173,8 +172,8 @@ devDependencies: "@mikro-orm/cli": 5.4.2_l3uc5zmdswm3nhfgs76dgkrz5a "@mikro-orm/seeder": 5.4.2_@mikro-orm+core@5.4.2 "@nestjs/cli": 9.1.3 - "@nestjs/schematics": 9.0.3_whhyl7r7sm4vygdnh5naaknfkm - "@nestjs/testing": 9.0.11_z6gh3n3qpn6ig2eqi2q57zofvq + "@nestjs/schematics": 9.0.3_typescript@4.8.2 + "@nestjs/testing": 9.1.1_mrvf6oiohgioswfsj2oeprwxai "@types/cache-manager": 4.0.2 "@types/cache-manager-redis-store": 2.0.1 "@types/compression": 1.7.2 @@ -191,14 +190,13 @@ devDependencies: "@types/sharp": 0.31.0 "@types/supertest": 2.0.12 "@types/swagger-ui-express": 4.1.3 - "@typescript-eslint/eslint-plugin": 5.37.0_m7vbfyqz7vwgmaprqgrrvj5ea4 - "@typescript-eslint/parser": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/eslint-plugin": 5.38.0_aarjygsz6gts43wtwsljfcbzn4 + "@typescript-eslint/parser": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u cz-conventional-changelog: 3.3.0 eslint: 8.23.1 eslint-config-prettier: 8.5.0_eslint@8.23.1 eslint-import-resolver-typescript: 3.5.1_hdzsmr7kawaomymueo2tso6fjq - eslint-plugin-import: 2.26.0_dnpzw43gx7nu2gqo7farhnkjku - eslint-plugin-no-secrets: 0.8.9_eslint@8.23.1 + eslint-plugin-import: 2.26.0_qidincc6lbiur5hfuez2qbs5ge eslint-plugin-prettier: 4.2.1_cabrci5exjdaojcvd6xoxgeowu eslint-plugin-simple-import-sort: 8.0.0_eslint@8.23.1 eslint-plugin-unicorn: 43.0.2_eslint@8.23.1 @@ -210,7 +208,7 @@ devDependencies: sample-env: 1.0.2 supertest: 6.2.4 ts-jest: 29.0.1_nvdms5j6cbx2df2dp3lmfbhotq - ts-loader: 9.3.1_frxmcuunqqqeqipt45cd6rjuvu + ts-loader: 9.4.1_frxmcuunqqqeqipt45cd6rjuvu ts-node: 10.9.1_sqdlidqb5kymhugfdzbb24uaie tsconfig-paths: 4.1.0 typescript: 4.8.2 @@ -228,6 +226,26 @@ packages: "@jridgewell/trace-mapping": 0.3.15 dev: true + /@angular-devkit/core/14.2.1: + resolution: + { + integrity: sha512-lW8oNGuJqr4r31FWBjfWQYkSXdiOHBGOThIEtHvUVBKfPF/oVrupLueCUgBPel+NvxENXdo93uPsqHN7bZbmsQ==, + } + engines: + { node: ^14.15.0 || >=16.10.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: ">= 1.13.0" } + peerDependencies: + chokidar: ^3.5.2 + peerDependenciesMeta: + chokidar: + optional: true + dependencies: + ajv: 8.11.0 + ajv-formats: 2.1.1_ajv@8.11.0 + jsonc-parser: 3.1.0 + rxjs: 6.6.7 + source-map: 0.7.4 + dev: true + /@angular-devkit/core/14.2.1_chokidar@3.5.3: resolution: { @@ -289,6 +307,23 @@ packages: - chokidar dev: true + /@angular-devkit/schematics/14.2.1: + resolution: + { + integrity: sha512-0U18FwDYt4zROBPrvewH6iBTkf2ozVHN4/gxUb9jWrqVw8mPU5AWc/iYxQLHBSinkr2Egjo1H/i9aBqgJSeh3g==, + } + engines: + { node: ^14.15.0 || >=16.10.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: ">= 1.13.0" } + dependencies: + "@angular-devkit/core": 14.2.1 + jsonc-parser: 3.1.0 + magic-string: 0.26.2 + ora: 5.4.1 + rxjs: 6.6.7 + transitivePeerDependencies: + - chokidar + dev: true + /@angular-devkit/schematics/14.2.1_chokidar@3.5.3: resolution: { @@ -1586,10 +1621,10 @@ packages: } dev: true - /@casl/ability/6.1.1: + /@casl/ability/6.2.0: resolution: { - integrity: sha512-PGh/KKYQ69SZ+TPLzjtAzdudDPzPAtPOTyozRgJ9du1VEUkS9yk0jckK8yj9CauBBnJ3hP1OMLaBPjhYbRZ4gw==, + integrity: sha512-TjVLUGbbqmfzGNa4pKSct6ickOtIMMF9tvC7551dE14PLFQzkyUmxqSsePL+j8eejMc3ofwUJTGimN5IcguM8A==, } dependencies: "@ucast/mongo2js": 1.3.3 @@ -1855,7 +1890,7 @@ packages: lodash: 4.17.21 dev: false - /@golevelup/nestjs-modules/0.6.1_bn6reqtvhrta6qnzhyw65epcha: + /@golevelup/nestjs-modules/0.6.1_qppydktqusgsmilzmmjwjzbxni: resolution: { integrity: sha512-E0STg8In8fhIivnGDJAA70+XLPHzK5bMTkCnif9FbZ8waTYDQ3T/QQL0h73k+CUFeznn1hmuEW14sNaE+8cd7w==, @@ -1864,20 +1899,20 @@ packages: "@nestjs/common": ^9.x rxjs: ^7.x dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq lodash: 4.17.21 rxjs: 7.5.6 dev: false - /@golevelup/nestjs-rabbitmq/3.2.0_bn6reqtvhrta6qnzhyw65epcha: + /@golevelup/nestjs-rabbitmq/3.3.0_qppydktqusgsmilzmmjwjzbxni: resolution: { - integrity: sha512-nzaE3LdxxWfqXM+O+V+YqEh4jDdAsg8eC97twJJASTbHw1q1ssVC7BuQiGoy04CvxVfU6tQE28FnHl+/yjVFwQ==, + integrity: sha512-BLTeELIIAyvkmrRPUgCp2vnKxZqtOTak+L1rGI9Bgw9wqPRXZMjwBUEo9KlHDrdcvgRNal6FjRVBcMHKeCtA8A==, } dependencies: "@golevelup/nestjs-common": 1.4.4 "@golevelup/nestjs-discovery": 3.0.0 - "@golevelup/nestjs-modules": 0.6.1_bn6reqtvhrta6qnzhyw65epcha + "@golevelup/nestjs-modules": 0.6.1_qppydktqusgsmilzmmjwjzbxni amqp-connection-manager: 3.9.0_amqplib@0.8.0 amqplib: 0.8.0 transitivePeerDependencies: @@ -2696,7 +2731,7 @@ packages: - supports-color - tedious - /@mikro-orm/nestjs/5.1.2_n7uo52so5jbxtemyhiia2vuztq: + /@mikro-orm/nestjs/5.1.2_cl6lrx567qpyzuqvgbbem3l5iu: resolution: { integrity: sha512-kHvrcZoIsZUwaahWIjuJDII0rfikGucsyZg9UJRDLcDIYm9nm39Qtos9uGgTAySejll/g/XdOM6QirPHtgR8FQ==, @@ -2745,8 +2780,8 @@ packages: "@mikro-orm/migrations": 5.4.2_gx4qpbej4qnj53to75in55gjcu "@mikro-orm/postgresql": 5.4.2_kdfmmkkd46hr2266p3exwsatv4 "@mikro-orm/seeder": 5.4.2_@mikro-orm+core@5.4.2 - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie dev: false /@mikro-orm/postgresql/5.4.2_kdfmmkkd46hr2266p3exwsatv4: @@ -2821,7 +2856,7 @@ packages: ansi-colors: 4.1.3 dev: false - /@nestjs/axios/0.1.0_3mdbamkp7cmelffjfexsjo7tau: + /@nestjs/axios/0.1.0_4n3ycpsuqlpcarpvaa3djcpybe: resolution: { integrity: sha512-b2TT2X6BFbnNoeteiaxCIiHaFcSbVW+S5yygYqiIq5i6H77yIU3IVuLdpQkHq8/EqOWFwMopLN8jdkUT71Am9w==, @@ -2831,7 +2866,7 @@ packages: reflect-metadata: ^0.1.12 rxjs: ^6.0.0 || ^7.0.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq axios: 0.27.2 reflect-metadata: 0.1.13 rxjs: 7.5.6 @@ -2894,10 +2929,10 @@ packages: - webpack-cli dev: true - /@nestjs/common/9.0.11_gh5mief3wkwrsfciuhcd7owmpq: + /@nestjs/common/9.1.1_gh5mief3wkwrsfciuhcd7owmpq: resolution: { - integrity: sha512-oYLIcOal3QOwcqt6goXovRNg8ZkalyOMjH0oYYzfJLrait6P7c6nAeWHu4qFDThY7GoZHEanLgji1qlqVEW09g==, + integrity: sha512-qrrCnc7FwYzJDjGJTRdL68nULFV0dkEa1DTJgtR7nHXzwcJU8EC+9wfMkahQdyB7ZPAQNJSuyarwmbgVFFNoLg==, } peerDependencies: cache-manager: "*" @@ -2919,9 +2954,9 @@ packages: reflect-metadata: 0.1.13 rxjs: 7.5.6 tslib: 2.4.0 - uuid: 8.3.2 + uuid: 9.0.0 - /@nestjs/config/2.2.0_3mdbamkp7cmelffjfexsjo7tau: + /@nestjs/config/2.2.0_4n3ycpsuqlpcarpvaa3djcpybe: resolution: { integrity: sha512-78Eg6oMbCy3D/YvqeiGBTOWei1Jwi3f2pSIZcZ1QxY67kYsJzTRTkwRT8Iv30DbK0sGKc1mcloDLD5UXgZAZtg==, @@ -2931,7 +2966,7 @@ packages: reflect-metadata: ^0.1.13 rxjs: ^6.0.0 || ^7.2.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq dotenv: 16.0.1 dotenv-expand: 8.0.3 lodash: 4.17.21 @@ -2940,10 +2975,10 @@ packages: uuid: 8.3.2 dev: false - /@nestjs/core/9.0.11_psficsz3mqirqwo2ujbfhdr2aa: + /@nestjs/core/9.1.1_rnu4wbspjtr3am5p7vy7xio2ie: resolution: { - integrity: sha512-DYyoiWSGebDAG8WSfG/ue88HBU39kAJTi2YXftWdVSl1LFveV+pwKY83P2qX0ND38TS8WktFYpaMkXslf97BBQ==, + integrity: sha512-IFL9DAGFAFgVvIQDoXh248KH8Hqwj6x3Nz1ud4V1Gzv6FnsjANe4nhUAO9IJbUydtFAiNuclXC5gs2vbhBtqqg==, } requiresBuild: true peerDependencies: @@ -2961,8 +2996,8 @@ packages: "@nestjs/websockets": optional: true dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/platform-express": 9.0.11_khr6mt6ojlxbw7bo55fknouh34 + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/platform-express": 9.1.1_xhkir6qpcnigaiptpizzepd5vm "@nuxtjs/opencollective": 0.3.2 fast-safe-stringify: 2.1.1 iterare: 1.2.1 @@ -2971,11 +3006,11 @@ packages: reflect-metadata: 0.1.13 rxjs: 7.5.6 tslib: 2.4.0 - uuid: 8.3.2 + uuid: 9.0.0 transitivePeerDependencies: - encoding - /@nestjs/graphql/10.1.1_fv75qjio762foiiuscgaj3i7pm: + /@nestjs/graphql/10.1.1_m253sabeulentkwn5n2vktijkm: resolution: { integrity: sha512-j7f3TSH8whFbUeO0xLZ7iw40N7gVrsyB+qnTjInNoJ3A+gs7SiYobszxia9LaeBLs0X/We+uCA9kofeXYI+jnw==, @@ -2997,9 +3032,9 @@ packages: "@graphql-tools/merge": 8.3.0_graphql@15.8.0 "@graphql-tools/schema": 9.0.2_graphql@15.8.0 "@graphql-tools/utils": 8.8.0_graphql@15.8.0 - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa - "@nestjs/mapped-types": 1.1.0_tqmdse6qmtytdi6db7pggninv4 + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie + "@nestjs/mapped-types": 1.1.0_d45y3xaibnblgcbrl2bnx24una chokidar: 3.5.3 fast-glob: 3.2.11 graphql: 15.8.0 @@ -3020,7 +3055,7 @@ packages: dev: false optional: true - /@nestjs/jwt/9.0.0_@nestjs+common@9.0.11: + /@nestjs/jwt/9.0.0_@nestjs+common@9.1.1: resolution: { integrity: sha512-ZsXGY/wMYKzEhymw2+dxiwrHTRKIKrGszx6r2EjQqNLypdXMQu0QrujwZJ8k3+XQV4snmuJwwNakQoA2ILfq8w==, @@ -3028,12 +3063,12 @@ packages: peerDependencies: "@nestjs/common": ^8.0.0 || ^9.0.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq "@types/jsonwebtoken": 8.5.8 jsonwebtoken: 8.5.1 dev: false - /@nestjs/mapped-types/1.1.0_tqmdse6qmtytdi6db7pggninv4: + /@nestjs/mapped-types/1.1.0_d45y3xaibnblgcbrl2bnx24una: resolution: { integrity: sha512-+2kSly4P1QI+9eGt+/uGyPdEG1hVz7nbpqPHWZVYgoqz8eOHljpXPag+UCVRw9zo2XCu4sgNUIGe8Uk0+OvUQg==, @@ -3049,12 +3084,12 @@ packages: class-validator: optional: true dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq class-validator: 0.13.2 reflect-metadata: 0.1.13 dev: false - /@nestjs/passport/9.0.0_qmmxbt2dwte7f4tgsyyoa7ob5i: + /@nestjs/passport/9.0.0_tnwnmclzqpvlo4qhkmv7ek5dsi: resolution: { integrity: sha512-Gnh8n1wzFPOLSS/94X1sUP4IRAoXTgG4odl7/AO5h+uwscEGXxJFercrZfqdAwkWhqkKWbsntM3j5mRy/6ZQDA==, @@ -3063,21 +3098,21 @@ packages: "@nestjs/common": ^8.0.0 || ^9.0.0 passport: ^0.4.0 || ^0.5.0 || ^0.6.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq passport: 0.6.0 dev: false - /@nestjs/platform-express/9.0.11_khr6mt6ojlxbw7bo55fknouh34: + /@nestjs/platform-express/9.1.1_xhkir6qpcnigaiptpizzepd5vm: resolution: { - integrity: sha512-Up1Ps08n2Y07AYakTKKU5uofGQoAQoUaRyfXdH0G54OnICCUiqcFH0QveNYLCkHoMP4iFs6vMr3xhvO6y91NBQ==, + integrity: sha512-2+W4TIVExANTS1Zna8Z+G0I4Fo6S8htzFZNea/oO5ptPtb9IWKSqaNlJU4L8cCQyJBYM82stDDjZ0JzsMMSJug==, } peerDependencies: "@nestjs/common": ^9.0.0 "@nestjs/core": ^9.0.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie body-parser: 1.20.0 cors: 2.8.5 express: 4.18.1 @@ -3104,7 +3139,7 @@ packages: - chokidar dev: true - /@nestjs/schematics/9.0.3_whhyl7r7sm4vygdnh5naaknfkm: + /@nestjs/schematics/9.0.3_typescript@4.8.2: resolution: { integrity: sha512-kZrU/lrpVd2cnK8I3ibDb3Wi1ppl3wX3U3lVWoL+DzRRoezWKkh8upEL4q0koKmuXnsmLiu3UPxFeMOrJV7TSA==, @@ -3112,8 +3147,8 @@ packages: peerDependencies: typescript: ^4.3.5 dependencies: - "@angular-devkit/core": 14.2.1_chokidar@3.5.3 - "@angular-devkit/schematics": 14.2.1_chokidar@3.5.3 + "@angular-devkit/core": 14.2.1 + "@angular-devkit/schematics": 14.2.1 fs-extra: 10.1.0 jsonc-parser: 3.2.0 pluralize: 8.0.0 @@ -3122,7 +3157,7 @@ packages: - chokidar dev: true - /@nestjs/serve-static/3.0.0_khr6mt6ojlxbw7bo55fknouh34: + /@nestjs/serve-static/3.0.0_xhkir6qpcnigaiptpizzepd5vm: resolution: { integrity: sha512-TpXjgs4136dQqWUjEcONqppqXDsrJhRkmKWzuBMOUAnP4HjHpNmlycvkHnDnWSoG2YD4a7Enh4ViYGWqCfHStA==, @@ -3131,12 +3166,12 @@ packages: "@nestjs/common": ^9.0.0 "@nestjs/core": ^9.0.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie path-to-regexp: 0.2.5 dev: false - /@nestjs/swagger/6.1.2_gxognro6jnhbk3hfbqy2jlgnri: + /@nestjs/swagger/6.1.2_tlns3lhb3swoijjkdbond3dwfq: resolution: { integrity: sha512-RU1DeTDyuN/lRXKFWaf7I9LYF34/ale3IIGeY3romAcXL/N9W0+50Ek3ou+Ajd5FqpLqzt7saYhnaQegVuU4UQ==, @@ -3150,9 +3185,9 @@ packages: "@fastify/static": optional: true dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa - "@nestjs/mapped-types": 1.1.0_tqmdse6qmtytdi6db7pggninv4 + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie + "@nestjs/mapped-types": 1.1.0_d45y3xaibnblgcbrl2bnx24una js-yaml: 4.1.0 lodash: 4.17.21 path-to-regexp: 3.2.0 @@ -3163,7 +3198,7 @@ packages: - class-validator dev: false - /@nestjs/terminus/9.1.1_mr622mjrz7hsw5sxbt7k6brday: + /@nestjs/terminus/9.1.1_lvyuu442bprgqcs24ahm77yfdm: resolution: { integrity: sha512-8XrXOTseUO8eQZYm/JZbRnznpyS1sVvMkHLW8BOi02s7Bzxw3UPiFOOF34ueKp4ONUjUCoKq36BmwY00dpjofA==, @@ -3174,18 +3209,18 @@ packages: reflect-metadata: 0.1.x rxjs: 7.x dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie boxen: 5.1.2 check-disk-space: 3.3.1 reflect-metadata: 0.1.13 rxjs: 7.5.6 dev: false - /@nestjs/testing/9.0.11_z6gh3n3qpn6ig2eqi2q57zofvq: + /@nestjs/testing/9.1.1_mrvf6oiohgioswfsj2oeprwxai: resolution: { - integrity: sha512-tT+yj3av7ZJb9Cy09C4+FoUULvzUntf81g5eK5shRVeQ35RWqr7E5Uq77B7ePUF2Er/TictVZk43d7rKq1ClNA==, + integrity: sha512-ijphiRhJ9kTaE4cxQSrMU053pIb5uKbGUWcLnBEJ0pCa3qCPosBV/TKMt3YlL5KuOKydDRaHW04pCtXAY5Avyw==, } peerDependencies: "@nestjs/common": ^9.0.0 @@ -3198,13 +3233,13 @@ packages: "@nestjs/platform-express": optional: true dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa - "@nestjs/platform-express": 9.0.11_khr6mt6ojlxbw7bo55fknouh34 + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie + "@nestjs/platform-express": 9.1.1_xhkir6qpcnigaiptpizzepd5vm tslib: 2.4.0 dev: true - /@nestjs/throttler/3.0.0_fvppslgepxggj3fnmtlnh4cori: + /@nestjs/throttler/3.0.0_cuyymkxypo2mw5ephsyhgkx76q: resolution: { integrity: sha512-E5aLstJ1a3yZE6AgcN+BgHLiRd8lonR5E4E4I3wzVHRGfgglHQS1sa2zEUuD/pdzLPlbI8pvVDJom8Z2D1oDug==, @@ -3214,8 +3249,8 @@ packages: "@nestjs/core": ^7.0.0 || ^8.0.0 || ^9.0.0 reflect-metadata: ^0.1.13 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie md5: 2.3.0 reflect-metadata: 0.1.13 dev: false @@ -4021,10 +4056,10 @@ packages: "@types/yargs-parser": 21.0.0 dev: true - /@typescript-eslint/eslint-plugin/5.37.0_m7vbfyqz7vwgmaprqgrrvj5ea4: + /@typescript-eslint/eslint-plugin/5.38.0_aarjygsz6gts43wtwsljfcbzn4: resolution: { - integrity: sha512-Fde6W0IafXktz1UlnhGkrrmnnGpAo1kyX7dnyHHVrmwJOn72Oqm3eYtddrpOwwel2W8PAK9F3pIL5S+lfoM0og==, + integrity: sha512-GgHi/GNuUbTOeoJiEANi0oI6fF3gBQc3bGFYj40nnAPCbhrtEDf2rjBmefFadweBmO1Du1YovHeDP2h5JLhtTQ==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: @@ -4035,13 +4070,12 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/parser": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u - "@typescript-eslint/scope-manager": 5.37.0 - "@typescript-eslint/type-utils": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u - "@typescript-eslint/utils": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/parser": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/scope-manager": 5.38.0 + "@typescript-eslint/type-utils": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/utils": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u debug: 4.3.4 eslint: 8.23.1 - functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.7 @@ -4051,10 +4085,10 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u: + /@typescript-eslint/parser/5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u: resolution: { - integrity: sha512-01VzI/ipYKuaG5PkE5+qyJ6m02fVALmMPY3Qq5BHflDx3y4VobbLdHQkSMg9VPRS4KdNt4oYTMaomFoHonBGAw==, + integrity: sha512-/F63giJGLDr0ms1Cr8utDAxP2SPiglaD6V+pCOcG35P2jCqdfR7uuEhz1GIC3oy4hkUF8xA1XSXmd9hOh/a5EA==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: @@ -4064,9 +4098,9 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/scope-manager": 5.37.0 - "@typescript-eslint/types": 5.37.0 - "@typescript-eslint/typescript-estree": 5.37.0_typescript@4.8.2 + "@typescript-eslint/scope-manager": 5.38.0 + "@typescript-eslint/types": 5.38.0 + "@typescript-eslint/typescript-estree": 5.38.0_typescript@4.8.2 debug: 4.3.4 eslint: 8.23.1 typescript: 4.8.2 @@ -4074,21 +4108,21 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.37.0: + /@typescript-eslint/scope-manager/5.38.0: resolution: { - integrity: sha512-F67MqrmSXGd/eZnujjtkPgBQzgespu/iCZ+54Ok9X5tALb9L2v3G+QBSoWkXG0p3lcTJsL+iXz5eLUEdSiJU9Q==, + integrity: sha512-ByhHIuNyKD9giwkkLqzezZ9y5bALW8VNY6xXcP+VxoH4JBDKjU5WNnsiD4HJdglHECdV+lyaxhvQjTUbRboiTA==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: - "@typescript-eslint/types": 5.37.0 - "@typescript-eslint/visitor-keys": 5.37.0 + "@typescript-eslint/types": 5.38.0 + "@typescript-eslint/visitor-keys": 5.38.0 dev: true - /@typescript-eslint/type-utils/5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u: + /@typescript-eslint/type-utils/5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u: resolution: { - integrity: sha512-BSx/O0Z0SXOF5tY0bNTBcDEKz2Ec20GVYvq/H/XNKiUorUFilH7NPbFUuiiyzWaSdN3PA8JV0OvYx0gH/5aFAQ==, + integrity: sha512-iZq5USgybUcj/lfnbuelJ0j3K9dbs1I3RICAJY9NZZpDgBYXmuUlYQGzftpQA9wC8cKgtS6DASTvF3HrXwwozA==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: @@ -4098,8 +4132,8 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/typescript-estree": 5.37.0_typescript@4.8.2 - "@typescript-eslint/utils": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/typescript-estree": 5.38.0_typescript@4.8.2 + "@typescript-eslint/utils": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u debug: 4.3.4 eslint: 8.23.1 tsutils: 3.21.0_typescript@4.8.2 @@ -4108,18 +4142,18 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.37.0: + /@typescript-eslint/types/5.38.0: resolution: { - integrity: sha512-3frIJiTa5+tCb2iqR/bf7XwU20lnU05r/sgPJnRpwvfZaqCJBrl8Q/mw9vr3NrNdB/XtVyMA0eppRMMBqdJ1bA==, + integrity: sha512-HHu4yMjJ7i3Cb+8NUuRCdOGu2VMkfmKyIJsOr9PfkBVYLYrtMCK/Ap50Rpov+iKpxDTfnqvDbuPLgBE5FwUNfA==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dev: true - /@typescript-eslint/typescript-estree/5.37.0_typescript@4.8.2: + /@typescript-eslint/typescript-estree/5.38.0_typescript@4.8.2: resolution: { - integrity: sha512-JkFoFIt/cx59iqEDSgIGnQpCTRv96MQnXCYvJi7QhBC24uyuzbD8wVbajMB1b9x4I0octYFJ3OwjAwNqk1AjDA==, + integrity: sha512-6P0RuphkR+UuV7Avv7MU3hFoWaGcrgOdi8eTe1NwhMp2/GjUJoODBTRWzlHpZh6lFOaPmSvgxGlROa0Sg5Zbyg==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: @@ -4128,8 +4162,8 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/types": 5.37.0 - "@typescript-eslint/visitor-keys": 5.37.0 + "@typescript-eslint/types": 5.38.0 + "@typescript-eslint/visitor-keys": 5.38.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -4140,19 +4174,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u: + /@typescript-eslint/utils/5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u: resolution: { - integrity: sha512-jUEJoQrWbZhmikbcWSMDuUSxEE7ID2W/QCV/uz10WtQqfOuKZUqFGjqLJ+qhDd17rjgp+QJPqTdPIBWwoob2NQ==, + integrity: sha512-6sdeYaBgk9Fh7N2unEXGz+D+som2QCQGPAf1SxrkEr+Z32gMreQ0rparXTNGRRfYUWk/JzbGdcM8NSSd6oqnTA==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: "@types/json-schema": 7.0.11 - "@typescript-eslint/scope-manager": 5.37.0 - "@typescript-eslint/types": 5.37.0 - "@typescript-eslint/typescript-estree": 5.37.0_typescript@4.8.2 + "@typescript-eslint/scope-manager": 5.38.0 + "@typescript-eslint/types": 5.38.0 + "@typescript-eslint/typescript-estree": 5.38.0_typescript@4.8.2 eslint: 8.23.1 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.23.1 @@ -4161,14 +4195,14 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.37.0: + /@typescript-eslint/visitor-keys/5.38.0: resolution: { - integrity: sha512-Hp7rT4cENBPIzMwrlehLW/28EVCOcE9U1Z1BQTc8EA8v5qpr7GRGuG+U58V5tTY48zvUOA3KHvw3rA8tY9fbdA==, + integrity: sha512-MxnrdIyArnTi+XyFLR+kt/uNAcdOnmT+879os7qDRI+EYySR4crXJq9BXPfRzzLGq0wgxkwidrCJ9WCAoacm1w==, } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: - "@typescript-eslint/types": 5.37.0 + "@typescript-eslint/types": 5.38.0 eslint-visitor-keys: 3.3.0 dev: true @@ -4359,7 +4393,7 @@ packages: "@xtuc/long": 4.2.2 dev: true - /@xiifain/nestjs-sentry/4.0.2_fjwmy3kxb4c622ysgycg3yr5fm: + /@xiifain/nestjs-sentry/4.0.2_d6cjlp4t6l5dxaeykm2lfdmrbu: resolution: { integrity: sha512-i+MGEgR7wCrm4uwHWKrX7eI981L8SYkqRPvk2M6z+tlOdQHkMBPFoPcKGSW1YuLziOj7ABL75h1WOPqDCyp3Wg==, @@ -4373,15 +4407,15 @@ packages: rimraf: ^3.0.2 rxjs: ^7.2.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie "@sentry/hub": 7.13.0 "@sentry/node": 7.13.0 reflect-metadata: 0.1.13 rimraf: 3.0.2 rxjs: 7.5.6 optionalDependencies: - "@nestjs/graphql": 10.1.1_fv75qjio762foiiuscgaj3i7pm + "@nestjs/graphql": 10.1.1_m253sabeulentkwn5n2vktijkm transitivePeerDependencies: - "@apollo/subgraph" - bufferutil @@ -7060,7 +7094,7 @@ packages: debug: 4.3.4 enhanced-resolve: 5.10.0 eslint: 8.23.1 - eslint-plugin-import: 2.26.0_dnpzw43gx7nu2gqo7farhnkjku + eslint-plugin-import: 2.26.0_qidincc6lbiur5hfuez2qbs5ge get-tsconfig: 4.2.0 globby: 13.1.2 is-core-module: 2.10.0 @@ -7070,7 +7104,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.4_qvkbajpzjqw3u6rs5s4w7u2bau: + /eslint-module-utils/2.7.4_hm5uhrsezvrmv7cxvacxm66s4i: resolution: { integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==, @@ -7094,7 +7128,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - "@typescript-eslint/parser": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/parser": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u debug: 3.2.7 eslint: 8.23.1 eslint-import-resolver-node: 0.3.6 @@ -7103,7 +7137,7 @@ packages: - supports-color dev: true - /eslint-plugin-import/2.26.0_dnpzw43gx7nu2gqo7farhnkjku: + /eslint-plugin-import/2.26.0_qidincc6lbiur5hfuez2qbs5ge: resolution: { integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==, @@ -7116,14 +7150,14 @@ packages: "@typescript-eslint/parser": optional: true dependencies: - "@typescript-eslint/parser": 5.37.0_nbcbbd7lfrdtsoifdu7ts5ch5u + "@typescript-eslint/parser": 5.38.0_nbcbbd7lfrdtsoifdu7ts5ch5u array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 doctrine: 2.1.0 eslint: 8.23.1 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.4_qvkbajpzjqw3u6rs5s4w7u2bau + eslint-module-utils: 2.7.4_hm5uhrsezvrmv7cxvacxm66s4i has: 1.0.3 is-core-module: 2.10.0 is-glob: 4.0.3 @@ -7137,18 +7171,6 @@ packages: - supports-color dev: true - /eslint-plugin-no-secrets/0.8.9_eslint@8.23.1: - resolution: - { - integrity: sha512-CqaBxXrImABCtxMWspAnm8d5UKkpNylC7zqVveb+fJHEvsSiNGJlSWzdSIvBUnW1XhJXkzifNIZQC08rEII5Ng==, - } - engines: { node: ">=10.0.0", npm: ">=6.9.0" } - peerDependencies: - eslint: ">=3.0.0" - dependencies: - eslint: 8.23.1 - dev: true - /eslint-plugin-prettier/4.2.1_cabrci5exjdaojcvd6xoxgeowu: resolution: { @@ -8126,6 +8148,8 @@ packages: { integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==, } + dev: false + optional: true /functions-have-names/1.2.3: resolution: @@ -8836,10 +8860,10 @@ packages: readable-stream: 3.6.0 dev: false - /helper-fns/2.5.14: + /helper-fns/2.5.15: resolution: { - integrity: sha512-uDvULLCPiDjzJozY85fcvsEYJijp64oj9pSYECjpQ8u8q1/XzkIbnsoXdl+21LAh+LavtNs7n0nUJEItQBTFlg==, + integrity: sha512-+08XcfLoKziMoIhQoHiLq7BY2fTgjDroSxRH6LfeBx8QmSluEyEjtANaAKbKLJWoL8/rj4YT8nwQzJvGWQdFnQ==, } dev: false @@ -11178,10 +11202,10 @@ packages: integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==, } - /minio/7.0.31: + /minio/7.0.32: resolution: { - integrity: sha512-owtqQot7UP9snjYnpQKTzf1mT5koRilvKgr9tKZnWEwyHnFRFA/qOnY/Ayn25BX3eaagFdr8mFMp25qThbL8dA==, + integrity: sha512-txa7Vr0N24MKzeAybP/wY1jxbLnfGHXwZYyfFXuMW55HX2+HOcKEIgH4hU6Qj/kiMgyXs/ozHjAuLIDrR8nwLg==, } engines: { node: ">8 <=18" } dependencies: @@ -11363,7 +11387,7 @@ packages: } dev: true - /nestjs-i18n/9.1.10_oonymkv6qq72ebvisdbbroskp4: + /nestjs-i18n/9.1.10_kiigyizlxskbbhbpzivd6qwmqu: resolution: { integrity: sha512-+2xRg+H5FLKsSiDhiCzoTZmQtiENdVZZZ/lzK5d4P+8TZ2Rh8MBqhoJXrUtk2bJX44kLOPccznH4scLJC5kiCw==, @@ -11374,8 +11398,8 @@ packages: class-validator: ~0.13 rxjs: "*" dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie accept-language-parser: 1.5.0 chokidar: 3.5.3 class-validator: 0.13.2 @@ -11386,21 +11410,21 @@ packages: string-format: 2.0.0 dev: false - /nestjs-minio/2.2.0_khr6mt6ojlxbw7bo55fknouh34: + /nestjs-minio/2.2.1_xhkir6qpcnigaiptpizzepd5vm: resolution: { - integrity: sha512-MgD6KRF6wecMzQNoPmFf2j7pybYDPLGHrSaUEur3OEusBYVPsAkfr/uhJVZ1wR2eRSuzS7HfnDaMWOo8qyRA5g==, + integrity: sha512-WoOqGPaZ7+Nr9REpzMOGp2sXsOvA7gwa0ZvWiauTyIHdjXr90Ln3VopHryEQbfwomaJ7iqjuCsL1dOyCFvlI7g==, } peerDependencies: "@nestjs/common": ">7.0.0" "@nestjs/core": ">7.0.0" dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq - "@nestjs/core": 9.0.11_psficsz3mqirqwo2ujbfhdr2aa - minio: 7.0.31 + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/core": 9.1.1_rnu4wbspjtr3am5p7vy7xio2ie + minio: 7.0.32 dev: false - /nestjs-pino/3.1.1_i6unz6wuqvgkfrilibx2liv5zi: + /nestjs-pino/3.1.1_ilg3hsl3ydt2anwg54qfgy62bm: resolution: { integrity: sha512-T7ajfqYTSHKrirzrElQJ3EWO/OZF5fFFkgaRvD+I7F5YY2hU3X295E/CnTkgpHZozL0s/3Ud4OtTZlT3NisTBw==, @@ -11411,7 +11435,7 @@ packages: "@nestjs/common": ^8.0.0 || ^9.0.0 pino-http: ^6.4.0 || ^7.0.0 || ^8.0.0 dependencies: - "@nestjs/common": 9.0.11_gh5mief3wkwrsfciuhcd7owmpq + "@nestjs/common": 9.1.1_gh5mief3wkwrsfciuhcd7owmpq pino-http: 8.2.0 dev: false @@ -14788,10 +14812,10 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-loader/9.3.1_frxmcuunqqqeqipt45cd6rjuvu: + /ts-loader/9.4.1_frxmcuunqqqeqipt45cd6rjuvu: resolution: { - integrity: sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw==, + integrity: sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==, } engines: { node: ">=12.0.0" } peerDependencies: @@ -14970,10 +14994,10 @@ packages: } dev: false - /twilio/3.82.0: + /twilio/3.82.1: resolution: { - integrity: sha512-7j21FIb0tq3udzlOitrnMaIBIMrnB0gO9sDzxHytNfZlMAZXWVIRSP3SodU9lxLTVjyZeFLfr7Qqs1Xafo36uQ==, + integrity: sha512-3OIFYUjd0g25x2uZbCqsuT1o5r1r9o2/VDYcl1s+WS6323wxm/dvcMfAlMnLx0+YfG2XB7XS3u7BWZGNJoxtGA==, } engines: { node: ">=6.0" } dependencies: @@ -15229,6 +15253,14 @@ packages: integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==, } hasBin: true + dev: false + + /uuid/9.0.0: + resolution: + { + integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==, + } + hasBin: true /v8-compile-cache-lib/3.0.1: resolution: diff --git a/src/common/classes/pagination.ts b/src/common/classes/pagination.ts index 94dff9d8..2fd44002 100644 --- a/src/common/classes/pagination.ts +++ b/src/common/classes/pagination.ts @@ -1,29 +1,61 @@ import { Order } from "@common/types/enums/misc.enum"; import { Type } from "@nestjs/class-transformer"; import { IsEnum, IsInt, IsOptional, Max, Min } from "@nestjs/class-validator"; +import { enumToString } from "helper-fns"; import { i18nValidationMessage } from "nestjs-i18n"; export class PageOptionsDto { - @IsEnum(Order) - @IsOptional() - readonly order?: Order = Order.DESC; - - @IsOptional() - readonly sort?: string = "createdAt"; - + /** + * Results page you want to retrieve (0..N) + */ @Type(() => Number) - @IsInt() - @Min(1, { message: i18nValidationMessage("validation.minLength") }) + @IsInt({ + message: i18nValidationMessage("validation.isDataType", { + type: "number", + }), + }) + @Min(1, { message: i18nValidationMessage("validation.min") }) @IsOptional() readonly page?: number = 1; + /** + * Number of results per page + */ @Type(() => Number) - @IsInt() - @Min(1, { message: i18nValidationMessage("validation.minLength") }) - @Max(50, { message: i18nValidationMessage("validation.maxLength") }) + @IsInt({ + message: i18nValidationMessage("validation.isDataType", { + type: "number", + }), + }) + @Min(1, { message: i18nValidationMessage("validation.min") }) + @Max(50, { message: i18nValidationMessage("validation.max") }) @IsOptional() readonly limit?: number = 10; + /** + * Sorting order + */ + @IsEnum(Order, { + message: i18nValidationMessage("validation.isEnum", { + values: enumToString(Order), + }), + }) + @IsOptional() + readonly order?: Order = Order.DESC; + + /** + * Sorting criteria + */ + @IsOptional() + readonly sort: string = "createdAt"; + + /** + * Search query + * @example John + */ + @IsOptional() + readonly search?: string; + get offset(): number { return (this.page - 1) * this.limit; } diff --git a/src/common/helpers/app.utils.ts b/src/common/helpers/app.utils.ts index 1328d2f6..7d0f7774 100644 --- a/src/common/helpers/app.utils.ts +++ b/src/common/helpers/app.utils.ts @@ -1,6 +1,7 @@ -import { INestApplication, Logger } from "@nestjs/common"; -import { DocumentBuilder, SwaggerModule, OpenAPIObject } from "@nestjs/swagger"; import fs from "node:fs"; + +import { INestApplication, Logger } from "@nestjs/common"; +import { DocumentBuilder, OpenAPIObject, SwaggerModule } from "@nestjs/swagger"; import * as swaggerStats from "swagger-stats"; export const AppUtils = { @@ -53,9 +54,9 @@ export const AppUtils = { swaggerStats.getMiddleware({ swaggerSpec: document, authentication: true, - hostname: "cit", + hostname: "nestify", uriPath: "/stats", - onAuthenticate: function (request: any, username: string, password: string) { + onAuthenticate: function (_request: any, username: string, password: string) { // simple check for username and password return username === user && password === pass; }, diff --git a/src/common/helpers/helpers.utils.ts b/src/common/helpers/helpers.utils.ts index f58bdde3..32b9e261 100644 --- a/src/common/helpers/helpers.utils.ts +++ b/src/common/helpers/helpers.utils.ts @@ -8,29 +8,6 @@ import { from, Observable } from "rxjs"; import sharp from "sharp"; export const HelperService = { - /** - * - * - * @param {*} op - * @param {...any[]} args - * @return {*} {*} - */ - makeTask: (op: any, ...arguments_: any[]): any => { - return { op, args: arguments_ }; - }, - - /** - * - * - * @param {Record} obj - * @return {*} - */ - dispatcher: (object: Record) => { - return async ({ op, args }) => { - return await object[op](...args); - }; - }, - resourceLink: (resource: string, id: string) => { return `${process.env.API_URL}/v1/${resource}/${id}`; }, diff --git a/src/common/misc/misc.ts b/src/common/misc/misc.ts index b7825e60..a5263619 100644 --- a/src/common/misc/misc.ts +++ b/src/common/misc/misc.ts @@ -1,8 +1,11 @@ +import fs from "node:fs"; +import { extname } from "node:path"; + +import { FileSizes, FileTypes } from "@common/types/enums"; +import { HttpStatus, ParseFilePipeBuilder } from "@nestjs/common"; import { MulterOptions } from "@nestjs/platform-express/multer/interfaces/multer-options.interface"; import { Request } from "express"; -import fs from "node:fs"; import mime from "mime-types"; -import { extname } from "node:path"; import { diskStorage, memoryStorage } from "multer"; const allowedExtensions = new Set(["png", "jpg", "jpeg"]); @@ -55,3 +58,21 @@ export const randomFileName = (file: { originalname: string }): string => { return `${name}-${randomName}${fileExtensionName}`; }; + +export const fileValidatorPipe = ({ + fileType = FileTypes.IMAGE, + fileSize = FileSizes.IMAGE, + required = true, +}) => { + return new ParseFilePipeBuilder() + .addFileTypeValidator({ + fileType, + }) + .addMaxSizeValidator({ + maxSize: fileSize, + }) + .build({ + errorHttpStatusCode: HttpStatus.UNPROCESSABLE_ENTITY, + fileIsRequired: required, + }); +}; diff --git a/src/common/types/enums/misc.enum.ts b/src/common/types/enums/misc.enum.ts index 6f1f9626..30bbcc56 100644 --- a/src/common/types/enums/misc.enum.ts +++ b/src/common/types/enums/misc.enum.ts @@ -28,3 +28,11 @@ export enum Status { ENABLED = "ENABLED", DISABLED = "DISABLED", } + +export enum FileSizes { + IMAGE = 5 * 1024 * 1000, // 5mb +} + +export const FileTypes = { + IMAGE: /(jpg|jpeg|png|gif)$/i, +}; diff --git a/src/modules/post/dtos/create-comment.dto.ts b/src/modules/post/dtos/create-comment.dto.ts index 6c6c4d7f..ec5356ac 100644 --- a/src/modules/post/dtos/create-comment.dto.ts +++ b/src/modules/post/dtos/create-comment.dto.ts @@ -2,6 +2,11 @@ import { IsNotEmpty, IsString } from "@nestjs/class-validator"; import { i18nValidationMessage } from "nestjs-i18n"; export class CreateCommentDto { + /** + * Content of comment + * @example "This is a comment" + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { diff --git a/src/modules/post/dtos/create-post.dto.ts b/src/modules/post/dtos/create-post.dto.ts index 6c3553fc..e4891e89 100644 --- a/src/modules/post/dtos/create-post.dto.ts +++ b/src/modules/post/dtos/create-post.dto.ts @@ -2,6 +2,11 @@ import { IsArray, IsNotEmpty, IsString } from "@nestjs/class-validator"; import { i18nValidationMessage } from "nestjs-i18n"; export class CreatePostDto { + /** + * Title of post + * @example "Lorem ipsum dolor sit" + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { @@ -10,6 +15,11 @@ export class CreatePostDto { }) title: string; + /** + * Description of post + * @example "Some paragraph of text" + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { @@ -18,6 +28,11 @@ export class CreatePostDto { }) description: string; + /** + * Content of post + * @example "Long paragraph of text" + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { @@ -26,6 +41,11 @@ export class CreatePostDto { }) content: string; + /** + * Tags of post + * @example ["fantasy", "adventure"] + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { diff --git a/src/modules/user/dtos/create-user.dto.ts b/src/modules/user/dtos/create-user.dto.ts index 0f2f5257..e55b1915 100644 --- a/src/modules/user/dtos/create-user.dto.ts +++ b/src/modules/user/dtos/create-user.dto.ts @@ -9,10 +9,16 @@ import { MaxLength, MinLength, } from "@nestjs/class-validator"; +import { ApiProperty } from "@nestjs/swagger"; import { enumToString } from "helper-fns"; import { i18nValidationMessage } from "nestjs-i18n"; export class CreateUserDto { + /** + * Username of user + * @example rubiin + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { @@ -23,6 +29,11 @@ export class CreateUserDto { @MaxLength(100, { message: i18nValidationMessage("validation.maxLength") }) username: string; + /** + * Firstname of user + * @example John + */ + @IsString({ message: i18nValidationMessage("validation.isDataType", { type: "string", @@ -32,6 +43,11 @@ export class CreateUserDto { @MaxLength(100, { message: i18nValidationMessage("validation.maxLength") }) firstName: string; + /** + * Lastname of user + * @example Doe + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsString({ message: i18nValidationMessage("validation.isDataType", { @@ -42,8 +58,16 @@ export class CreateUserDto { @MaxLength(100, { message: i18nValidationMessage("validation.maxLength") }) lastName: string; - avatar: string; + /** + * Indicates the profile picture of user + */ + @ApiProperty({ type: "string", format: "binary", required: false, name: "image" }) + avatar?: string; + /** + * Email of user + * @example someemail@gmail.com + */ @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsEmail( {}, @@ -55,12 +79,21 @@ export class CreateUserDto { ) email: string; + /** + * Password of user + * @example SomePassword@123 + */ + @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @MinLength(8, { message: i18nValidationMessage("validation.minLength") }) @MaxLength(25, { message: i18nValidationMessage("validation.maxLength") }) @IsPassword({ message: i18nValidationMessage("validation.isPassword") }) password: string; + /** + * Roles of user + * @example ["ADMIN"] + */ @IsNotEmpty({ message: i18nValidationMessage("validation.isNotEmpty") }) @IsArray({ message: i18nValidationMessage("validation.isDataType", { diff --git a/src/modules/user/user.controller.ts b/src/modules/user/user.controller.ts index 945f26fc..34cb3efa 100644 --- a/src/modules/user/user.controller.ts +++ b/src/modules/user/user.controller.ts @@ -1,7 +1,7 @@ import { PageOptionsDto } from "@common/classes/pagination"; import { ApiFile, Public, SwaggerDecorator } from "@common/decorators"; import { ControllerDecorator } from "@common/decorators/controller.decorator"; -import { ParseFilePipe } from "@common/pipes/parse-file.pipe"; +import { fileValidatorPipe } from "@common/misc"; import { ApiPaginatedResponse } from "@common/swagger/ApiPaginated"; import { Roles } from "@common/types/enums"; import { User } from "@entities"; @@ -21,6 +21,7 @@ import { } from "@nestjs/common"; import { ApiOperation } from "@nestjs/swagger"; import { Observable } from "rxjs"; + import { CreateUserDto, EditUserDto, UserRegistrationDto } from "./dtos"; import { UserService } from "./user.service"; @@ -43,8 +44,9 @@ export class UserController { }) @ApiFile("avatar") async publicRegistration( - @UploadedFile(ParseFilePipe) image: Express.Multer.File, @Body() dto: UserRegistrationDto, + @UploadedFile(fileValidatorPipe({})) + image: Express.Multer.File, ) { return this.userService.createOne({ ...dto, @@ -71,8 +73,9 @@ export class UserController { @CheckPolicies(new GenericPolicyHandler(User, Action.Create)) @ApiFile("avatar") async createOne( - @UploadedFile(ParseFilePipe) image: Express.Multer.File, @Body() dto: CreateUserDto, + @UploadedFile(fileValidatorPipe({})) + image: Express.Multer.File, ) { return this.userService.createOne({ ...dto, image }); }