From a0f7c864c3e890ba6a5a6136593cab9816bdda1f Mon Sep 17 00:00:00 2001 From: Prakhargarg-2010196 <23prakhargarg2002@gmail.com> Date: Tue, 17 Sep 2024 23:10:39 +0530 Subject: [PATCH 1/6] feat(api): Add resend otp implementation --- .env.example | 7 +- apps/api/package.json | 3 +- apps/api/src/app/app.module.ts | 18 +- .../src/auth/controller/auth.controller.ts | 13 +- apps/api/src/auth/service/auth.service.ts | 34 +- pnpm-lock.yaml | 320 +++++++++++++----- 6 files changed, 302 insertions(+), 93 deletions(-) diff --git a/.env.example b/.env.example index 03d1412e..f76a2a4a 100644 --- a/.env.example +++ b/.env.example @@ -48,4 +48,9 @@ DOMAIN=localhost FEEDBACK_FORWARD_EMAIL= BACKEND_URL=http://localhost:4200 -NEXT_PUBLIC_BACKEND_URL=http://localhost:4200 \ No newline at end of file +NEXT_PUBLIC_BACKEND_URL=http://localhost:4200 + + +# Enter time in secs +THROTTLE_TTL= +THROTTLE_LIMIT= \ No newline at end of file diff --git a/apps/api/package.json b/apps/api/package.json index ca6f224f..750a2ff1 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -32,6 +32,7 @@ "@nestjs/platform-socket.io": "^10.3.7", "@nestjs/schedule": "^4.0.1", "@nestjs/swagger": "^7.3.0", + "@nestjs/throttler": "^6.2.1", "@nestjs/websockets": "^10.3.7", "@socket.io/redis-adapter": "^8.3.0", "@supabase/supabase-js": "^2.39.6", @@ -50,7 +51,6 @@ "uuid": "^9.0.1" }, "devDependencies": { - "reflect-metadata": "^0.2.2", "@nestjs/cli": "^10.0.0", "@nestjs/schematics": "^10.0.0", "@nestjs/testing": "^10.0.0", @@ -67,6 +67,7 @@ "jest-mock-extended": "^3.0.5", "prettier": "^3.0.0", "prisma": "5.19.1", + "reflect-metadata": "^0.2.2", "source-map-support": "^0.5.21", "supertest": "^6.3.3", "ts-jest": "^29.1.0", diff --git a/apps/api/src/app/app.module.ts b/apps/api/src/app/app.module.ts index c4ee6c77..5c5ee05a 100644 --- a/apps/api/src/app/app.module.ts +++ b/apps/api/src/app/app.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common' import { AppController } from './app.controller' -import { ConfigModule } from '@nestjs/config' +import { ConfigModule, ConfigService } from '@nestjs/config' import { PassportModule } from '@nestjs/passport' import { AuthModule } from '@/auth/auth.module' import { PrismaModule } from '@/prisma/prisma.module' @@ -25,7 +25,7 @@ import { IntegrationModule } from '@/integration/integration.module' import { FeedbackModule } from '@/feedback/feedback.module' import { CacheModule } from '@/cache/cache.module' import { WorkspaceMembershipModule } from '@/workspace-membership/workspace-membership.module' - +import { seconds, ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler' @Module({ controllers: [AppController], imports: [ @@ -38,6 +38,16 @@ import { WorkspaceMembershipModule } from '@/workspace-membership/workspace-memb abortEarly: true } }), + ThrottlerModule.forRootAsync({ + imports: [ConfigModule], + inject: [ConfigService], + useFactory: (config: ConfigService) => [ + { + ttl: seconds(config.get('THROTTLE_TTL')), + limit: config.get('THROTTLE_LIMIT') + } + ] + }), ScheduleModule.forRoot(), PassportModule, AuthModule, @@ -67,6 +77,10 @@ import { WorkspaceMembershipModule } from '@/workspace-membership/workspace-memb { provide: APP_GUARD, useClass: ApiKeyGuard + }, + { + provide: APP_GUARD, + useClass: ThrottlerGuard } ] }) diff --git a/apps/api/src/auth/controller/auth.controller.ts b/apps/api/src/auth/controller/auth.controller.ts index ba3facea..7f1dcdd9 100644 --- a/apps/api/src/auth/controller/auth.controller.ts +++ b/apps/api/src/auth/controller/auth.controller.ts @@ -25,7 +25,7 @@ import { sendOAuthSuccessRedirect } from '@/common/redirect' import { setCookie } from '@/common/util' - +import { seconds, Throttle, ThrottlerGuard } from '@nestjs/throttler' @Controller('auth') export class AuthController { private readonly logger = new Logger(AuthController.name) @@ -46,6 +46,17 @@ export class AuthController { await this.authService.sendOtp(email) } + @Public() + @Post('resend-otp/:email') + @UseGuards(ThrottlerGuard) + @Throttle({ default: { ttl: seconds(1), limit: 2 } }) + async resendOtp( + @Param('email') + email: string + ): Promise { + return await this.authService.resendOtp(email) + } + /* istanbul ignore next */ @Public() @Post('validate-otp') diff --git a/apps/api/src/auth/service/auth.service.ts b/apps/api/src/auth/service/auth.service.ts index 7363154b..2e5e3727 100644 --- a/apps/api/src/auth/service/auth.service.ts +++ b/apps/api/src/auth/service/auth.service.ts @@ -41,15 +41,39 @@ export class AuthService { this.logger.error(`Invalid email address: ${email}`) throw new BadRequestException('Please enter a valid email address') } + try { + const user = await this.createUserIfNotExists( + email, + AuthProvider.EMAIL_OTP + ) + const otp = await generateOtp(email, user.id, this.prisma) + await this.mailService.sendOtp(email, otp.code) + } catch (e) { + throw e + } - const user = await this.createUserIfNotExists(email, AuthProvider.EMAIL_OTP) - - const otp = await generateOtp(email, user.id, this.prisma) - - await this.mailService.sendOtp(email, otp.code) this.logger.log(`Login code sent to ${email}`) } + /** + * resend a login code to the given email address after resend otp button is pressed + * @throws {BadRequestException} If the email address is invalid + * @param email The email address to resend the login code to + */ + async resendOtp(email: string): Promise { + /** + *TODO Resend the otp based on another function send otp but + *TODO with a throttler to rate limit the api + */ + try { + const user = await getUserByEmailOrId(email, this.prisma) + const otp = await generateOtp(email, user.id, this.prisma) + await this.mailService.sendOtp(email, otp.code) + } catch (e) { + this.logger.error(`Resending OTP failed ${e}`) + } + } + /* istanbul ignore next */ /** * Validates a login code sent to the given email address diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db433b1f..f3ae2c7e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,7 +64,7 @@ importers: version: 2.4.0 ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4) + version: 10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4) tsc-alias: specifier: ^1.8.10 version: 1.8.10 @@ -83,7 +83,7 @@ importers: version: 2.33.0 '@sentry/webpack-plugin': specifier: ^2.14.2 - version: 2.21.1(webpack@5.92.1(@swc/core@1.7.3)) + version: 2.21.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))) '@types/jest': specifier: ^29.5.2 version: 29.5.12 @@ -113,7 +113,7 @@ importers: version: 9.1.4 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + version: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) prettier: specifier: ^3.0.0 version: 3.3.3 @@ -122,7 +122,7 @@ importers: version: 0.5.14(prettier@3.3.3) ts-jest: specifier: ^29.1.0 - version: 29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@5.5.4) + version: 29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)))(typescript@5.5.4) tsconfig: specifier: workspace:* version: link:packages/tsconfig @@ -165,6 +165,9 @@ importers: '@nestjs/swagger': specifier: ^7.3.0 version: 7.4.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) + '@nestjs/throttler': + specifier: ^6.2.1 + version: 6.2.1(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2) '@nestjs/websockets': specifier: ^10.3.7 version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(@nestjs/platform-socket.io@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -216,7 +219,7 @@ importers: devDependencies: '@nestjs/cli': specifier: ^10.0.0 - version: 10.4.2(@swc/cli@0.4.0(@swc/core@1.7.3)(chokidar@3.6.0))(@swc/core@1.7.3) + version: 10.4.2(@swc/cli@0.4.0(@swc/core@1.7.3(@swc/helpers@0.5.2))(chokidar@3.6.0))(@swc/core@1.7.3(@swc/helpers@0.5.2)) '@nestjs/schematics': specifier: ^10.0.0 version: 10.1.3(chokidar@3.6.0)(typescript@5.3.3) @@ -252,10 +255,10 @@ importers: version: 7.4.2 jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + version: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) jest-mock-extended: specifier: ^3.0.5 - version: 3.0.7(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3) + version: 3.0.7(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3) prettier: specifier: ^3.0.0 version: 3.3.3 @@ -273,10 +276,10 @@ importers: version: 6.3.4 ts-jest: specifier: ^29.1.0 - version: 29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3) + version: 29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3) ts-loader: specifier: ^9.4.3 - version: 9.5.1(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3)) + version: 9.5.1(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))) apps/cli: dependencies: @@ -445,7 +448,7 @@ importers: version: 2.4.0 tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4))) + version: 1.0.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4))) zod: specifier: ^3.23.8 version: 3.23.8 @@ -458,7 +461,7 @@ importers: version: 8.1.0(typescript@5.5.4) '@tailwindcss/forms': specifier: ^0.5.7 - version: 0.5.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4))) + version: 0.5.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4))) '@types/dayjs-precise-range': specifier: ^1.0.5 version: 1.0.5 @@ -482,7 +485,7 @@ importers: version: 8.4.40 tailwindcss: specifier: ^3.3.3 - version: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + version: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) tsconfig: specifier: workspace:* version: link:../../packages/tsconfig @@ -491,13 +494,13 @@ importers: dependencies: '@mdx-js/loader': specifier: ^3.0.1 - version: 3.0.1(webpack@5.92.1(@swc/core@1.7.3)) + version: 3.0.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))) '@mdx-js/react': specifier: ^3.0.1 version: 3.0.1(@types/react@18.3.3)(react@18.3.1) '@next/mdx': specifier: ^14.2.3 - version: 14.2.5(@mdx-js/loader@3.0.1(webpack@5.92.1(@swc/core@1.7.3)))(@mdx-js/react@3.0.1(@types/react@18.3.3)(react@18.3.1)) + version: 14.2.5(@mdx-js/loader@3.0.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))))(@mdx-js/react@3.0.1(@types/react@18.3.3)(react@18.3.1)) '@tsparticles/engine': specifier: ^3.3.0 version: 3.5.0 @@ -546,7 +549,7 @@ importers: version: 8.1.0(typescript@5.5.4) '@tailwindcss/forms': specifier: ^0.5.7 - version: 0.5.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4))) + version: 0.5.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4))) '@types/react': specifier: ^18.0.22 version: 18.3.3 @@ -564,7 +567,7 @@ importers: version: 8.4.40 tailwindcss: specifier: ^3.3.3 - version: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + version: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) tsconfig: specifier: workspace:* version: link:../../packages/tsconfig @@ -575,7 +578,7 @@ importers: devDependencies: '@vercel/style-guide': specifier: ^5.0.0 - version: 5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(prettier@3.3.3)(typescript@4.9.5) + version: 5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(prettier@3.3.3)(typescript@4.9.5) eslint-config-turbo: specifier: ^1.10.12 version: 1.13.4(eslint@8.57.0) @@ -1738,6 +1741,13 @@ packages: '@nestjs/platform-express': optional: true + '@nestjs/throttler@6.2.1': + resolution: {integrity: sha512-vdt6VjhKC6vcLBJRUb97IuR6Htykn5kokZzmT8+S5XFOLLjUF7rzRpr+nUOhK9pi1L0hhbzSf2v2FJl4v64EJA==} + peerDependencies: + '@nestjs/common': ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + '@nestjs/core': ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + reflect-metadata: ^0.1.13 || ^0.2.0 + '@nestjs/websockets@10.3.10': resolution: {integrity: sha512-F/fhAC0ylAhjfCZj4Xrgc0yTJ/qltooDCa+fke7BFZLofLmE0yj7WzBVrBHsk/46kppyRcs5XrYjIQLqcDze8g==} peerDependencies: @@ -9780,7 +9790,43 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3))': + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.14.13 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.7 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + optional: true + + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -9794,7 +9840,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -9815,7 +9861,7 @@ snapshots: - supports-color - ts-node - '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4))': + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -9829,7 +9875,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -10001,11 +10047,11 @@ snapshots: '@lukeed/csprng@1.1.0': {} - '@mdx-js/loader@3.0.1(webpack@5.92.1(@swc/core@1.7.3))': + '@mdx-js/loader@3.0.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)))': dependencies: '@mdx-js/mdx': 3.0.1 source-map: 0.7.4 - webpack: 5.92.1(@swc/core@1.7.3) + webpack: 5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)) transitivePeerDependencies: - supports-color @@ -10065,7 +10111,7 @@ snapshots: got: 11.8.6 os-filter-obj: 2.0.0 - '@nestjs/cli@10.4.2(@swc/cli@0.4.0(@swc/core@1.7.3)(chokidar@3.6.0))(@swc/core@1.7.3)': + '@nestjs/cli@10.4.2(@swc/cli@0.4.0(@swc/core@1.7.3(@swc/helpers@0.5.2))(chokidar@3.6.0))(@swc/core@1.7.3(@swc/helpers@0.5.2))': dependencies: '@angular-devkit/core': 17.3.8(chokidar@3.6.0) '@angular-devkit/schematics': 17.3.8(chokidar@3.6.0) @@ -10075,7 +10121,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.5 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3)) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))) glob: 10.4.2 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10084,7 +10130,7 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.92.1(@swc/core@1.7.3) + webpack: 5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)) webpack-node-externals: 3.0.0 optionalDependencies: '@swc/cli': 0.4.0(@swc/core@1.7.3(@swc/helpers@0.5.2))(chokidar@3.6.0) @@ -10226,6 +10272,12 @@ snapshots: optionalDependencies: '@nestjs/platform-express': 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10) + '@nestjs/throttler@6.2.1(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)': + dependencies: + '@nestjs/common': 10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) + reflect-metadata: 0.2.2 + '@nestjs/websockets@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(@nestjs/platform-socket.io@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1)': dependencies: '@nestjs/common': 10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -10244,11 +10296,11 @@ snapshots: dependencies: glob: 7.1.7 - '@next/mdx@14.2.5(@mdx-js/loader@3.0.1(webpack@5.92.1(@swc/core@1.7.3)))(@mdx-js/react@3.0.1(@types/react@18.3.3)(react@18.3.1))': + '@next/mdx@14.2.5(@mdx-js/loader@3.0.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))))(@mdx-js/react@3.0.1(@types/react@18.3.3)(react@18.3.1))': dependencies: source-map: 0.7.4 optionalDependencies: - '@mdx-js/loader': 3.0.1(webpack@5.92.1(@swc/core@1.7.3)) + '@mdx-js/loader': 3.0.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))) '@mdx-js/react': 3.0.1(@types/react@18.3.3)(react@18.3.1) '@next/swc-darwin-arm64@13.5.6': @@ -11251,12 +11303,12 @@ snapshots: dependencies: '@sentry/types': 7.118.0 - '@sentry/webpack-plugin@2.21.1(webpack@5.92.1(@swc/core@1.7.3))': + '@sentry/webpack-plugin@2.21.1(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)))': dependencies: '@sentry/bundler-plugin-core': 2.21.1 unplugin: 1.0.1 uuid: 9.0.1 - webpack: 5.92.1(@swc/core@1.7.3) + webpack: 5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)) transitivePeerDependencies: - encoding - supports-color @@ -11499,10 +11551,10 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tailwindcss/forms@0.5.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))': + '@tailwindcss/forms@0.5.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)))': dependencies: mini-svg-data-uri: 1.4.4 - tailwindcss: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + tailwindcss: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) '@tanstack/react-table@8.19.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: @@ -12127,7 +12179,7 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vercel/style-guide@5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(prettier@3.3.3)(typescript@4.9.5)': + '@vercel/style-guide@5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(prettier@3.3.3)(typescript@4.9.5)': dependencies: '@babel/core': 7.25.2 '@babel/eslint-parser': 7.25.1(@babel/core@7.25.2)(eslint@8.57.0) @@ -12139,9 +12191,9 @@ snapshots: eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@4.9.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(typescript@4.9.5) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) - eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@4.9.5))(eslint@8.57.0) + eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(typescript@4.9.5))(eslint@8.57.0) eslint-plugin-react: 7.35.0(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) eslint-plugin-testing-library: 6.2.2(eslint@8.57.0)(typescript@4.9.5) @@ -13103,13 +13155,13 @@ snapshots: sha.js: 2.4.11 optional: true - create-jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)): + create-jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -13117,14 +13169,30 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + optional: true - create-jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)): + create-jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + create-jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -13759,13 +13827,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@4.9.5): + eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(typescript@4.9.5): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@4.9.5) eslint: 8.57.0 optionalDependencies: '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5) - jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) transitivePeerDependencies: - supports-color - typescript @@ -13815,11 +13883,11 @@ snapshots: resolve: 1.22.8 semver: 6.3.1 - eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@4.9.5))(eslint@8.57.0): + eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(typescript@4.9.5))(eslint@8.57.0): dependencies: eslint: 8.57.0 optionalDependencies: - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@4.9.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)))(typescript@4.9.5) eslint-plugin-prettier@5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.3): dependencies: @@ -14323,7 +14391,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3)): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14338,7 +14406,7 @@ snapshots: semver: 7.6.3 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.92.1(@swc/core@1.7.3) + webpack: 5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)) form-data@4.0.0: dependencies: @@ -15115,16 +15183,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)): + jest-cli@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + create-jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -15133,17 +15201,18 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + optional: true - jest-cli@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)): + jest-cli@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + create-jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -15153,7 +15222,26 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)): + jest-cli@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest-config@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)): dependencies: '@babel/core': 7.25.2 '@jest/test-sequencer': 29.7.0 @@ -15179,12 +15267,13 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.14.13 - ts-node: 10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3) + ts-node: 10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5) transitivePeerDependencies: - babel-plugin-macros - supports-color + optional: true - jest-config@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)): + jest-config@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)): dependencies: '@babel/core': 7.25.2 '@jest/test-sequencer': 29.7.0 @@ -15210,7 +15299,38 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.14.13 - ts-node: 10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4) + ts-node: 10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-config@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)): + dependencies: + '@babel/core': 7.25.2 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.2) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.7 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.14.13 + ts-node: 10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -15285,9 +15405,9 @@ snapshots: slash: 3.0.0 stack-utils: 2.0.6 - jest-mock-extended@3.0.7(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3): + jest-mock-extended@3.0.7(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3): dependencies: - jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) ts-essentials: 10.0.1(typescript@5.3.3) typescript: 5.3.3 @@ -15442,24 +15562,37 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)): + jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + optional: true + + jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + jest-cli: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros - supports-color - ts-node - jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)): + jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + jest-cli: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -16642,13 +16775,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.40 - postcss-load-config@4.0.2(postcss@8.4.40)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)): + postcss-load-config@4.0.2(postcss@8.4.40)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)): dependencies: lilconfig: 3.1.2 yaml: 2.5.0 optionalDependencies: postcss: 8.4.40 - ts-node: 10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4) + ts-node: 10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4) postcss-nested@6.2.0(postcss@8.4.40): dependencies: @@ -17662,11 +17795,11 @@ snapshots: tailwind-merge@2.4.0: {} - tailwindcss-animate@1.0.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4))): dependencies: - tailwindcss: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + tailwindcss: 3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) - tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)): + tailwindcss@3.4.7(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -17685,7 +17818,7 @@ snapshots: postcss: 8.4.40 postcss-import: 15.1.0(postcss@8.4.40) postcss-js: 4.0.1(postcss@8.4.40) - postcss-load-config: 4.0.2(postcss@8.4.40)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + postcss-load-config: 4.0.2(postcss@8.4.40)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) postcss-nested: 6.2.0(postcss@8.4.40) postcss-selector-parser: 6.1.1 resolve: 1.22.8 @@ -17704,14 +17837,14 @@ snapshots: type-fest: 2.19.0 unique-string: 3.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.7.3)(webpack@5.92.1(@swc/core@1.7.3)): + terser-webpack-plugin@5.3.10(@swc/core@1.7.3(@swc/helpers@0.5.2))(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.3 - webpack: 5.92.1(@swc/core@1.7.3) + webpack: 5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)) optionalDependencies: '@swc/core': 1.7.3(@swc/helpers@0.5.2) @@ -17810,12 +17943,12 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3): + ts-jest@29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)))(typescript@5.3.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3)) + jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -17829,12 +17962,12 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.2) - ts-jest@29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)))(typescript@5.5.4): + ts-jest@29.2.3(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)))(typescript@5.5.4): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4)) + jest: 29.7.0(@types/node@20.14.13)(ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -17848,7 +17981,7 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.2) - ts-loader@9.5.1(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3)): + ts-loader@9.5.1(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))): dependencies: chalk: 4.1.2 enhanced-resolve: 5.17.1 @@ -17856,9 +17989,30 @@ snapshots: semver: 7.6.3 source-map: 0.7.4 typescript: 5.3.3 - webpack: 5.92.1(@swc/core@1.7.3) + webpack: 5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)) + + ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@4.9.5): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.14.13 + acorn: 8.12.1 + acorn-walk: 8.3.3 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.7.3(@swc/helpers@0.5.2) + optional: true - ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.3.3): + ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.3.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -17879,7 +18033,7 @@ snapshots: '@swc/core': 1.7.3(@swc/helpers@0.5.2) optional: true - ts-node@10.9.2(@swc/core@1.7.3)(@types/node@20.14.13)(typescript@5.5.4): + ts-node@10.9.2(@swc/core@1.7.3(@swc/helpers@0.5.2))(@types/node@20.14.13)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -18243,7 +18397,7 @@ snapshots: webpack-virtual-modules@0.6.2: {} - webpack@5.92.1(@swc/core@1.7.3): + webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2)): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -18266,7 +18420,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.7.3)(webpack@5.92.1(@swc/core@1.7.3)) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.3(@swc/helpers@0.5.2))(webpack@5.92.1(@swc/core@1.7.3(@swc/helpers@0.5.2))) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: From a434e07bc0e00059772773e7450b05bb4e522ff8 Mon Sep 17 00:00:00 2001 From: Prakhargarg-2010196 <23prakhargarg2002@gmail.com> Date: Sat, 5 Oct 2024 00:33:29 +0530 Subject: [PATCH 2/6] fix(api):Fix throttle feature Fixes the throttle feature and moved the env variables to env.schema for validation of the env variables needed for throttle configuration. --- .env.example | 4 -- apps/api/src/app/app.module.ts | 16 +----- apps/api/src/auth/auth.module.ts | 14 ++++- .../src/auth/controller/auth.controller.ts | 4 +- apps/api/src/auth/service/auth.service.ts | 28 +++------- apps/api/src/common/env/env.schema.ts | 4 +- pnpm-lock.yaml | 52 ++++++++++--------- 7 files changed, 55 insertions(+), 67 deletions(-) diff --git a/.env.example b/.env.example index f76a2a4a..c10a2da3 100644 --- a/.env.example +++ b/.env.example @@ -50,7 +50,3 @@ FEEDBACK_FORWARD_EMAIL= BACKEND_URL=http://localhost:4200 NEXT_PUBLIC_BACKEND_URL=http://localhost:4200 - -# Enter time in secs -THROTTLE_TTL= -THROTTLE_LIMIT= \ No newline at end of file diff --git a/apps/api/src/app/app.module.ts b/apps/api/src/app/app.module.ts index 5c5ee05a..5e73d2b7 100644 --- a/apps/api/src/app/app.module.ts +++ b/apps/api/src/app/app.module.ts @@ -26,6 +26,7 @@ import { FeedbackModule } from '@/feedback/feedback.module' import { CacheModule } from '@/cache/cache.module' import { WorkspaceMembershipModule } from '@/workspace-membership/workspace-membership.module' import { seconds, ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler' + @Module({ controllers: [AppController], imports: [ @@ -38,16 +39,7 @@ import { seconds, ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler' abortEarly: true } }), - ThrottlerModule.forRootAsync({ - imports: [ConfigModule], - inject: [ConfigService], - useFactory: (config: ConfigService) => [ - { - ttl: seconds(config.get('THROTTLE_TTL')), - limit: config.get('THROTTLE_LIMIT') - } - ] - }), + ScheduleModule.forRoot(), PassportModule, AuthModule, @@ -77,10 +69,6 @@ import { seconds, ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler' { provide: APP_GUARD, useClass: ApiKeyGuard - }, - { - provide: APP_GUARD, - useClass: ThrottlerGuard } ] }) diff --git a/apps/api/src/auth/auth.module.ts b/apps/api/src/auth/auth.module.ts index fea8b073..b0acb5f7 100644 --- a/apps/api/src/auth/auth.module.ts +++ b/apps/api/src/auth/auth.module.ts @@ -9,6 +9,8 @@ import { GoogleOAuthStrategyFactory } from '@/config/factory/google/google-strat import { GoogleStrategy } from '@/config/oauth-strategy/google/google.strategy' import { GitlabOAuthStrategyFactory } from '@/config/factory/gitlab/gitlab-strategy.factory' import { GitlabStrategy } from '@/config/oauth-strategy/gitlab/gitlab.strategy' +import { seconds, ThrottlerModule } from '@nestjs/throttler' +import { ConfigModule, ConfigService } from '@nestjs/config' @Module({ imports: [ @@ -21,7 +23,17 @@ import { GitlabStrategy } from '@/config/oauth-strategy/gitlab/gitlab.strategy' algorithm: 'HS256' } }), - UserModule + UserModule, + ThrottlerModule.forRootAsync({ + imports: [ConfigModule], + useFactory: (config: ConfigService) => [ + { + ttl: seconds(config.get('THROTTLE_TTL')), + limit: config.get('THROTTLE_LIMIT') + } + ], + inject: [ConfigService] + }) ], providers: [ AuthService, diff --git a/apps/api/src/auth/controller/auth.controller.ts b/apps/api/src/auth/controller/auth.controller.ts index 7f1dcdd9..d3411477 100644 --- a/apps/api/src/auth/controller/auth.controller.ts +++ b/apps/api/src/auth/controller/auth.controller.ts @@ -25,7 +25,8 @@ import { sendOAuthSuccessRedirect } from '@/common/redirect' import { setCookie } from '@/common/util' -import { seconds, Throttle, ThrottlerGuard } from '@nestjs/throttler' +import { ThrottlerGuard } from '@nestjs/throttler' + @Controller('auth') export class AuthController { private readonly logger = new Logger(AuthController.name) @@ -49,7 +50,6 @@ export class AuthController { @Public() @Post('resend-otp/:email') @UseGuards(ThrottlerGuard) - @Throttle({ default: { ttl: seconds(1), limit: 2 } }) async resendOtp( @Param('email') email: string diff --git a/apps/api/src/auth/service/auth.service.ts b/apps/api/src/auth/service/auth.service.ts index 2e5e3727..2fec728c 100644 --- a/apps/api/src/auth/service/auth.service.ts +++ b/apps/api/src/auth/service/auth.service.ts @@ -41,16 +41,10 @@ export class AuthService { this.logger.error(`Invalid email address: ${email}`) throw new BadRequestException('Please enter a valid email address') } - try { - const user = await this.createUserIfNotExists( - email, - AuthProvider.EMAIL_OTP - ) - const otp = await generateOtp(email, user.id, this.prisma) - await this.mailService.sendOtp(email, otp.code) - } catch (e) { - throw e - } + + const user = await this.createUserIfNotExists(email, AuthProvider.EMAIL_OTP) + const otp = await generateOtp(email, user.id, this.prisma) + await this.mailService.sendOtp(email, otp.code) this.logger.log(`Login code sent to ${email}`) } @@ -61,17 +55,9 @@ export class AuthService { * @param email The email address to resend the login code to */ async resendOtp(email: string): Promise { - /** - *TODO Resend the otp based on another function send otp but - *TODO with a throttler to rate limit the api - */ - try { - const user = await getUserByEmailOrId(email, this.prisma) - const otp = await generateOtp(email, user.id, this.prisma) - await this.mailService.sendOtp(email, otp.code) - } catch (e) { - this.logger.error(`Resending OTP failed ${e}`) - } + const user = await getUserByEmailOrId(email, this.prisma) + const otp = await generateOtp(email, user.id, this.prisma) + await this.mailService.sendOtp(email, otp.code) } /* istanbul ignore next */ diff --git a/apps/api/src/common/env/env.schema.ts b/apps/api/src/common/env/env.schema.ts index 4f92a9c9..a2662344 100644 --- a/apps/api/src/common/env/env.schema.ts +++ b/apps/api/src/common/env/env.schema.ts @@ -78,7 +78,9 @@ const generalSchema = z.object({ MINIO_BUCKET_NAME: z.string().optional(), MINIO_USE_SSL: z.string().optional(), - FEEDBACK_FORWARD_EMAIL: z.string().email() + FEEDBACK_FORWARD_EMAIL: z.string().email(), + THROTTLE_TTL: z.string().transform((val) => parseInt(val, 10)), // Convert string to number + THROTTLE_LIMIT: z.string().transform((val) => parseInt(val, 10)) // Convert string to number }) export type EnvSchemaType = z.infer diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3ae2c7e..b6301192 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -155,19 +155,19 @@ importers: version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10) '@nestjs/platform-fastify': specifier: ^10.3.3 - version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1)) + version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10) '@nestjs/platform-socket.io': specifier: ^10.3.7 version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/websockets@10.3.10)(rxjs@7.8.1) '@nestjs/schedule': specifier: ^4.0.1 - version: 4.1.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1)) + version: 4.1.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10) '@nestjs/swagger': specifier: ^7.3.0 - version: 7.4.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) + version: 7.4.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) '@nestjs/throttler': specifier: ^6.2.1 - version: 6.2.1(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2) + version: 6.2.1(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(reflect-metadata@0.2.2) '@nestjs/websockets': specifier: ^10.3.7 version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(@nestjs/platform-socket.io@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -225,7 +225,7 @@ importers: version: 10.1.3(chokidar@3.6.0)(typescript@5.3.3) '@nestjs/testing': specifier: ^10.0.0 - version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)) + version: 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(@nestjs/platform-express@10.3.10) '@prisma/client': specifier: ^5.19.1 version: 5.19.1(prisma@5.19.1) @@ -8745,7 +8745,7 @@ snapshots: '@babel/traverse': 7.25.2 '@babel/types': 7.25.2 convert-source-map: 2.0.0 - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -9566,7 +9566,7 @@ snapshots: '@babel/parser': 7.25.0 '@babel/template': 7.25.0 '@babel/types': 7.25.2 - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -10207,7 +10207,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@nestjs/platform-fastify@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))': + '@nestjs/platform-fastify@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)': dependencies: '@fastify/cors': 9.0.1 '@fastify/formbody': 7.4.0 @@ -10231,7 +10231,7 @@ snapshots: - supports-color - utf-8-validate - '@nestjs/schedule@4.1.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))': + '@nestjs/schedule@4.1.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)': dependencies: '@nestjs/common': 10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/core': 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -10249,7 +10249,7 @@ snapshots: transitivePeerDependencies: - chokidar - '@nestjs/swagger@7.4.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)': + '@nestjs/swagger@7.4.0(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)': dependencies: '@microsoft/tsdoc': 0.15.0 '@nestjs/common': 10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -10264,7 +10264,7 @@ snapshots: class-transformer: 0.5.1 class-validator: 0.14.1 - '@nestjs/testing@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10))': + '@nestjs/testing@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(@nestjs/platform-express@10.3.10)': dependencies: '@nestjs/common': 10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/core': 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -10272,7 +10272,7 @@ snapshots: optionalDependencies: '@nestjs/platform-express': 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10) - '@nestjs/throttler@6.2.1(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)': + '@nestjs/throttler@6.2.1(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)(reflect-metadata@0.2.2)': dependencies: '@nestjs/common': 10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/core': 10.3.10(@nestjs/common@10.3.10(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(@nestjs/websockets@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -11333,7 +11333,7 @@ snapshots: '@socket.io/redis-adapter@8.3.0(socket.io-adapter@2.5.5)': dependencies: - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 notepack.io: 3.0.1 socket.io-adapter: 2.5.5 uid2: 1.0.0 @@ -12187,7 +12187,7 @@ snapshots: '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint@8.57.0)(typescript@4.9.5) '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@4.9.5) eslint-config-prettier: 9.1.0(eslint@8.57.0) - eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)) + eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.29.1) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) @@ -13286,6 +13286,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.3.6: + dependencies: + ms: 2.1.2 + debug@4.3.6(supports-color@5.5.0): dependencies: ms: 2.1.2 @@ -13517,7 +13521,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 engine.io-parser: 5.2.3 ws: 8.17.1 transitivePeerDependencies: @@ -13704,7 +13708,7 @@ snapshots: eslint: 8.57.0 eslint-plugin-turbo: 1.13.4(eslint@8.57.0) - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1): dependencies: eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) @@ -13721,7 +13725,7 @@ snapshots: debug: 4.3.6(supports-color@5.5.0) enhanced-resolve: 5.17.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.6 @@ -13733,7 +13737,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -13783,7 +13787,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.15.0 is-glob: 4.0.3 @@ -15115,7 +15119,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -17452,7 +17456,7 @@ snapshots: socket.io-adapter@2.5.5: dependencies: - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 ws: 8.17.1 transitivePeerDependencies: - bufferutil @@ -17473,7 +17477,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -17482,7 +17486,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 engine.io: 6.5.5 socket.io-adapter: 2.5.5 socket.io-parser: 4.2.4 @@ -17735,7 +17739,7 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.3.6(supports-color@5.5.0) + debug: 4.3.6 fast-safe-stringify: 2.1.1 form-data: 4.0.0 formidable: 2.1.2 From 2e1568a859ef136e62f38948864a6ff43e3007ea Mon Sep 17 00:00:00 2001 From: Prakhargarg-2010196 <23prakhargarg2002@gmail.com> Date: Sun, 6 Oct 2024 22:42:33 +0530 Subject: [PATCH 3/6] fix(api):Resolve merge conflict --- apps/cli/src/commands/environment/list.environment.ts | 2 +- apps/cli/src/commands/workspace/list.workspace.ts | 5 ++++- apps/cli/src/commands/workspace/role/get.role.ts | 6 +++--- apps/cli/src/commands/workspace/role/list.role.ts | 2 +- apps/cli/src/commands/workspace/role/update.role.ts | 8 ++++---- apps/cli/src/util/pagination-options.ts | 2 +- apps/platform/src/app/auth/page.tsx | 7 ++++++- apps/web/src/app/(main)/career/page.tsx | 2 +- .../api-client/src/controllers/workspace-membership.ts | 2 +- 9 files changed, 22 insertions(+), 14 deletions(-) diff --git a/apps/cli/src/commands/environment/list.environment.ts b/apps/cli/src/commands/environment/list.environment.ts index 454f9b80..456b1925 100644 --- a/apps/cli/src/commands/environment/list.environment.ts +++ b/apps/cli/src/commands/environment/list.environment.ts @@ -1,7 +1,7 @@ import BaseCommand from '../base.command' import { EnvironmentController } from '@keyshade/api-client' import { - CommandOption, + type CommandOption, type CommandActionData, type CommandArgument } from 'src/types/command/command.types' diff --git a/apps/cli/src/commands/workspace/list.workspace.ts b/apps/cli/src/commands/workspace/list.workspace.ts index 4f0dfda0..20c8cab3 100644 --- a/apps/cli/src/commands/workspace/list.workspace.ts +++ b/apps/cli/src/commands/workspace/list.workspace.ts @@ -1,7 +1,10 @@ import BaseCommand from '@/commands/base.command' import { Logger } from '@/util/logger' import ControllerInstance from '@/util/controller-instance' -import { CommandActionData, CommandOption } from '@/types/command/command.types' +import { + type CommandActionData, + type CommandOption +} from '@/types/command/command.types' import { PAGINATION_OPTION } from '@/util/pagination-options' export default class ListWorkspace extends BaseCommand { diff --git a/apps/cli/src/commands/workspace/role/get.role.ts b/apps/cli/src/commands/workspace/role/get.role.ts index 19634009..8c8ce372 100644 --- a/apps/cli/src/commands/workspace/role/get.role.ts +++ b/apps/cli/src/commands/workspace/role/get.role.ts @@ -36,16 +36,16 @@ export default class GetRoleCommand extends BaseCommand { ) if (success) { - Logger.info(`Workspace role fetched successfully!`) + Logger.info('Workspace role fetched successfully!') Logger.info(`Workspace role: ${data.name} (${data.slug})`) Logger.info(`Description: ${data.description || 'N/A'}`) Logger.info(`Created at ${data.createdAt}`) Logger.info(`Updated at ${data.updatedAt}`) - Logger.info(`Authorities:`) + Logger.info('Authorities:') for (const authority of data.authorities) { Logger.info(`- ${authority}`) } - Logger.info(`Projects:`) + Logger.info('Projects:') for (const project of data.projects) { Logger.info(`- ${project.project.name} (${project.project.slug})`) } diff --git a/apps/cli/src/commands/workspace/role/list.role.ts b/apps/cli/src/commands/workspace/role/list.role.ts index 430f3251..8d28d199 100644 --- a/apps/cli/src/commands/workspace/role/list.role.ts +++ b/apps/cli/src/commands/workspace/role/list.role.ts @@ -2,7 +2,7 @@ import BaseCommand from '@/commands/base.command' import { type CommandActionData, type CommandArgument, - CommandOption + type CommandOption } from '@/types/command/command.types' import { Logger } from '@/util/logger' import ControllerInstance from '@/util/controller-instance' diff --git a/apps/cli/src/commands/workspace/role/update.role.ts b/apps/cli/src/commands/workspace/role/update.role.ts index f2919951..c78f6d84 100644 --- a/apps/cli/src/commands/workspace/role/update.role.ts +++ b/apps/cli/src/commands/workspace/role/update.role.ts @@ -1,6 +1,6 @@ import BaseCommand from '@/commands/base.command' import { - CommandOption, + type CommandOption, type CommandActionData, type CommandArgument } from '@/types/command/command.types' @@ -76,17 +76,17 @@ export default class UpdateRoleCommand extends BaseCommand { ) if (success) { - Logger.info(`Workspace role updated successfully:`) + Logger.info('Workspace role updated successfully:') Logger.info(`Workspace role: ${data.name} (${data.slug})`) Logger.info(`Description: ${data.description || 'N/A'}`) Logger.info(`Created at ${data.createdAt}`) Logger.info(`Updated at ${data.updatedAt}`) Logger.info(`Color code: ${data.colorCode}`) - Logger.info(`Authorities:`) + Logger.info('Authorities:') for (const authority of data.authorities) { Logger.info(`- ${authority}`) } - Logger.info(`Projects:`) + Logger.info('Projects:') for (const project of data.projects) { Logger.info(`- ${project.project.name} (${project.project.slug})`) } diff --git a/apps/cli/src/util/pagination-options.ts b/apps/cli/src/util/pagination-options.ts index d7f50440..b602a46c 100644 --- a/apps/cli/src/util/pagination-options.ts +++ b/apps/cli/src/util/pagination-options.ts @@ -1,4 +1,4 @@ -import { CommandOption } from '@/types/command/command.types' +import { type CommandOption } from '@/types/command/command.types' export const PAGINATION_OPTION: CommandOption[] = [ { diff --git a/apps/platform/src/app/auth/page.tsx b/apps/platform/src/app/auth/page.tsx index 3ed23133..f7d672c7 100644 --- a/apps/platform/src/app/auth/page.tsx +++ b/apps/platform/src/app/auth/page.tsx @@ -6,7 +6,12 @@ import { useRouter } from 'next/navigation' import { useAtom } from 'jotai' import Cookies from 'js-cookie' import { LoadingSVG } from '@public/svg/shared' -import { GithubSVG, GoogleSVG, KeyshadeBigSVG ,GitlabSVG} from '@public/svg/auth' +import { + GithubSVG, + GoogleSVG, + KeyshadeBigSVG, + GitlabSVG +} from '@public/svg/auth' import { Input } from '@/components/ui/input' import { Button } from '@/components/ui/button' import { authEmailAtom } from '@/store' diff --git a/apps/web/src/app/(main)/career/page.tsx b/apps/web/src/app/(main)/career/page.tsx index 24d0b8c2..d95f777c 100644 --- a/apps/web/src/app/(main)/career/page.tsx +++ b/apps/web/src/app/(main)/career/page.tsx @@ -1,5 +1,5 @@ -import { ColorBGSVG } from '@public/hero' import Link from 'next/link' +import { ColorBGSVG } from '@public/hero' import EncryptButton from '@/components/ui/encrypt-btn' function Career(): React.JSX.Element { diff --git a/packages/api-client/src/controllers/workspace-membership.ts b/packages/api-client/src/controllers/workspace-membership.ts index f6ec72fe..c6324fb4 100644 --- a/packages/api-client/src/controllers/workspace-membership.ts +++ b/packages/api-client/src/controllers/workspace-membership.ts @@ -139,7 +139,7 @@ export default class WorkspaceMembershipController { request: GetMembersRequest, headers?: Record ): Promise> { - let url = parsePaginationUrl( + const url = parsePaginationUrl( `/api/workspace-membership/${request.workspaceSlug}/members`, request ) From a1583596b89833a21bc46b9e27b030dada51c459 Mon Sep 17 00:00:00 2001 From: Prakhargarg-2010196 <23prakhargarg2002@gmail.com> Date: Thu, 10 Oct 2024 22:45:46 +0530 Subject: [PATCH 4/6] fix(env):Add NODE_ENV to the .env.example --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index c10a2da3..ceeb58bd 100644 --- a/.env.example +++ b/.env.example @@ -50,3 +50,4 @@ FEEDBACK_FORWARD_EMAIL= BACKEND_URL=http://localhost:4200 NEXT_PUBLIC_BACKEND_URL=http://localhost:4200 +NODE_ENV= \ No newline at end of file From 703e1451143a1287243bb93329fc7dc149733d2d Mon Sep 17 00:00:00 2001 From: Prakhargarg-2010196 <23prakhargarg2002@gmail.com> Date: Thu, 10 Oct 2024 22:47:52 +0530 Subject: [PATCH 5/6] fix(testing):Add Mock tests for Throttler Guard The current auth.controller.spec.ts wasn't working with the throttler Guard, so created default/empty mocks which can be modified further. --- .../auth/controller/auth.controller.spec.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/api/src/auth/controller/auth.controller.spec.ts b/apps/api/src/auth/controller/auth.controller.spec.ts index cf12312f..68a186a7 100644 --- a/apps/api/src/auth/controller/auth.controller.spec.ts +++ b/apps/api/src/auth/controller/auth.controller.spec.ts @@ -12,6 +12,8 @@ import { GoogleOAuthStrategyFactory } from '@/config/factory/google/google-strat import { GitlabOAuthStrategyFactory } from '@/config/factory/gitlab/gitlab-strategy.factory' import { CacheService } from '@/cache/cache.service' import { REDIS_CLIENT } from '@/provider/redis.provider' +import { ThrottlerGuard, ThrottlerStorage } from '@nestjs/throttler' +import { Reflector } from '@nestjs/core' describe('AuthController', () => { let controller: AuthController @@ -40,7 +42,21 @@ describe('AuthController', () => { keys: jest.fn() } } - } + }, + //Mocked values for throttler + { + provide: ThrottlerGuard, + useValue: { canActivate: jest.fn(() => true) } // Mocking ThrottlerGuard + }, + { + provide: 'THROTTLER:MODULE_OPTIONS', // Mocking THROTTLER:MODULE_OPTIONS + useValue: {} // Empty or default value to satisfy dependency + }, + { + provide: ThrottlerStorage, // Mocking Symbol(ThrottlerStorage) + useValue: {} // Empty or default value to satisfy dependency + }, + Reflector ] }) .overrideProvider(PrismaService) @@ -53,4 +69,7 @@ describe('AuthController', () => { it('should be defined', () => { expect(controller).toBeDefined() }) + it('should be defined', () => { + expect(controller).toBeDefined() + }) }) From 8b684e38fa13650fdaf9d0bf5a9e098e07a75492 Mon Sep 17 00:00:00 2001 From: Prakhar Garg <23prakhargarg2002@gmail.com> Date: Fri, 11 Oct 2024 16:35:51 +0530 Subject: [PATCH 6/6] chore(env):Update .env.example with default --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index ceeb58bd..ba49429c 100644 --- a/.env.example +++ b/.env.example @@ -50,4 +50,4 @@ FEEDBACK_FORWARD_EMAIL= BACKEND_URL=http://localhost:4200 NEXT_PUBLIC_BACKEND_URL=http://localhost:4200 -NODE_ENV= \ No newline at end of file +NODE_ENV=dev