From ce3e023a00a49970647592a3bb63de6f59c2f435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20M?= Date: Wed, 19 Jul 2023 14:01:32 +0200 Subject: [PATCH] feat: server lint import & order (#750) --- .vscode/settings.json | 3 +- server/.eslintrc.js | 54 +- server/package.json | 1 + server/src/ability/ability.factory.ts | 4 +- server/src/ability/ability.module.ts | 2 + .../handlers/attachment.ability-handler.ts | 13 +- .../comment-thread-target.ability-handler.ts | 15 +- .../comment-thread.ability-handler.ts | 13 +- .../handlers/comment.ability-handler.ts | 15 +- .../handlers/company.ability-handler.ts | 15 +- .../handlers/person.ability-handler.ts | 15 +- .../pipeline-progress.ability-handler.ts | 13 +- .../pipeline-stage.ability-handler.ts | 15 +- .../handlers/pipeline.ability-handler.ts | 15 +- .../handlers/refresh-token.ability-handler.ts | 15 +- .../ability/handlers/user.ability-handler.ts | 15 +- .../workspace-member.ability-handler.ts | 15 +- .../handlers/workspace.ability-handler.ts | 15 +- .../interfaces/ability-handler.interface.ts | 3 +- server/src/app.module.ts | 12 +- .../settings/interfaces/settings.interface.ts | 1 + server/src/core/analytics/analytics.module.ts | 1 + .../core/analytics/analytics.resolver.spec.ts | 4 +- .../src/core/analytics/analytics.resolver.ts | 14 +- .../core/analytics/analytics.service.spec.ts | 4 +- .../src/core/analytics/analytics.service.ts | 5 +- .../analytics/dto/create-analytics.input.ts | 1 + .../src/core/attachment/attachment.module.ts | 4 +- .../resolvers/attachment.resolver.spec.ts | 6 +- .../resolvers/attachment.resolver.ts | 11 +- .../services/attachment.service.spec.ts | 2 + .../attachment/services/attachment.service.ts | 2 + server/src/core/auth/auth.module.ts | 13 +- server/src/core/auth/auth.resolver.spec.ts | 2 + server/src/core/auth/auth.resolver.ts | 15 +- .../controllers/google-auth.controller.ts | 10 +- .../verify-auth.controller.spec.ts | 6 +- .../controllers/verify-auth.controller.ts | 9 +- server/src/core/auth/dto/challenge.input.ts | 1 + .../src/core/auth/dto/login-token.entity.ts | 1 + .../src/core/auth/dto/refresh-token.input.ts | 1 + server/src/core/auth/dto/sign-up.input.ts | 1 + server/src/core/auth/dto/user-exists.input.ts | 1 + server/src/core/auth/dto/verify.entity.ts | 4 +- server/src/core/auth/dto/verify.input.ts | 1 + .../auth/dto/workspace-invite-hash.input.ts | 1 + .../guards/google-provider-enabled.guard.ts | 4 +- .../core/auth/services/auth.service.spec.ts | 6 +- server/src/core/auth/services/auth.service.ts | 23 +- .../core/auth/services/token.service.spec.ts | 6 +- .../src/core/auth/services/token.service.ts | 10 +- .../auth/strategies/google.auth.strategy.ts | 5 +- .../core/auth/strategies/jwt.auth.strategy.ts | 6 +- .../client-config/client-config.module.ts | 1 + .../client-config.resolver.spec.ts | 4 +- .../client-config/client-config.resolver.ts | 2 + server/src/core/comment/comment.module.ts | 1 + .../resolvers/comment-thread.resolver.spec.ts | 6 +- .../resolvers/comment-thread.resolver.ts | 20 +- .../resolvers/comment.resolver.spec.ts | 8 +- .../comment/resolvers/comment.resolver.ts | 16 +- .../comment-thread-target.service.spec.ts | 4 +- .../services/comment-thread-target.service.ts | 1 + .../services/comment-thread.service.spec.ts | 4 +- .../services/comment-thread.service.ts | 1 + .../comment/services/comment.service.spec.ts | 4 +- .../core/comment/services/comment.service.ts | 1 + .../company-relations.resolver.spec.ts | 6 +- .../company/company-relations.resolver.ts | 5 +- server/src/core/company/company.module.ts | 4 +- .../src/core/company/company.resolver.spec.ts | 8 +- server/src/core/company/company.resolver.ts | 29 +- .../src/core/company/company.service.spec.ts | 4 +- server/src/core/company/company.service.ts | 1 + server/src/core/core.module.ts | 1 + .../file/controllers/file.controller.spec.ts | 4 +- .../core/file/controllers/file.controller.ts | 6 +- server/src/core/file/file.module.ts | 1 + server/src/core/file/file.utils.ts | 10 +- .../resolvers/file-upload.resolver.spec.ts | 4 +- .../file/resolvers/file-upload.resolver.ts | 9 +- .../file/services/file-upload.service.spec.ts | 4 +- .../core/file/services/file-upload.service.ts | 7 +- .../core/file/services/file.service.spec.ts | 4 +- server/src/core/file/services/file.service.ts | 1 + .../person/person-relations.resolver.spec.ts | 6 +- .../core/person/person-relations.resolver.ts | 5 +- server/src/core/person/person.module.ts | 4 +- .../src/core/person/person.resolver.spec.ts | 8 +- server/src/core/person/person.resolver.ts | 31 +- server/src/core/person/person.service.spec.ts | 4 +- server/src/core/person/person.service.ts | 1 + server/src/core/pipeline/pipeline.module.ts | 1 + .../pipeline-progress.resolver.spec.ts | 6 +- .../resolvers/pipeline-progress.resolver.ts | 22 +- .../resolvers/pipeline-stage.resolver.spec.ts | 6 +- .../resolvers/pipeline-stage.resolver.ts | 10 +- .../resolvers/pipeline.resolver.spec.ts | 6 +- .../pipeline/resolvers/pipeline.resolver.ts | 8 +- .../pipeline-progress.service.spec.ts | 4 +- .../services/pipeline-progress.service.ts | 1 + .../services/pipeline-stage.service.spec.ts | 4 +- .../services/pipeline-stage.service.ts | 3 +- .../services/pipeline.service.spec.ts | 4 +- .../pipeline/services/pipeline.service.ts | 6 +- server/src/core/user/user.module.ts | 6 +- server/src/core/user/user.resolver.spec.ts | 6 +- server/src/core/user/user.resolver.ts | 20 +- server/src/core/user/user.service.spec.ts | 6 +- server/src/core/user/user.service.ts | 6 +- .../workspace-member.resolver.spec.ts | 6 +- .../resolvers/workspace-member.resolver.ts | 8 +- .../resolvers/workspace.resolver.spec.ts | 6 +- .../workspace/resolvers/workspace.resolver.ts | 11 +- .../services/workspace-member.service.spec.ts | 4 +- .../services/workspace-member.service.ts | 1 + .../services/workspace.service.spec.ts | 4 +- .../workspace/services/workspace.service.ts | 1 + server/src/core/workspace/workspace.module.ts | 6 +- server/src/database/prisma.module.ts | 1 + server/src/database/prisma.service.ts | 2 + server/src/database/seeds/index.ts | 1 + server/src/decorators/auth-user.decorator.ts | 1 + .../decorators/auth-workspace.decorator.ts | 1 + .../decorators/check-abilities.decorator.ts | 1 + .../src/decorators/prisma-select.decorator.ts | 2 + .../src/decorators/user-ability.decorator.ts | 1 + server/src/filters/exception.filter.ts | 1 + server/src/guards/ability.guard.ts | 4 +- .../guards/create-one-comment-thread.guard.ts | 1 + server/src/guards/create-one-comment.guard.ts | 1 + server/src/guards/create-one.guard.ts | 1 + server/src/guards/delete-many.guard.ts | 1 + server/src/guards/jwt.auth.guard.ts | 2 + server/src/guards/optional-jwt.auth.guard.ts | 1 + server/src/guards/update-one.guard.ts | 1 + server/src/health/health.controller.spec.ts | 1 + server/src/health/health.controller.ts | 1 + server/src/health/health.module.ts | 1 + .../indicators/prisma-health-indicator.ts | 1 + .../environment/environment.module.ts | 3 +- .../environment/environment.service.spec.ts | 3 +- .../environment/environment.service.ts | 1 + .../environment/environment.validation.ts | 2 + .../file-storage/drivers/local.driver.ts | 3 +- .../file-storage/drivers/s3.driver.ts | 4 +- .../file-storage.module-definition.ts | 1 + .../file-storage/file-storage.module.ts | 6 +- .../file-storage/file-storage.service.spec.ts | 1 + .../file-storage/file-storage.service.ts | 7 +- .../interfaces/file-storage.interface.ts | 8 +- .../src/integrations/integrations.module.ts | 2 + server/src/main.ts | 4 +- server/src/utils/prisma-select/index.ts | 1 + server/yarn.lock | 535 +++++++++++++++++- 155 files changed, 1165 insertions(+), 304 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2311f1916..a2335b672 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,5 +37,6 @@ ], "cSpell.words": [ "twentyhq" - ] + ], + "typescript.preferences.importModuleSpecifier": "project-relative" } \ No newline at end of file diff --git a/server/.eslintrc.js b/server/.eslintrc.js index 495f70b1e..8888d79c7 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -5,7 +5,7 @@ module.exports = { tsconfigRootDir : __dirname, sourceType: 'module', }, - plugins: ['@typescript-eslint/eslint-plugin'], + plugins: ['@typescript-eslint/eslint-plugin', 'import'], extends: [ 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', @@ -22,5 +22,57 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', 'func-style':['error', 'declaration', { 'allowArrowFunctions': true }], + 'no-restricted-imports': [ + 'error', + { + 'patterns': [ + { + 'group': ['**../'], + 'message': 'Relative imports are not allowed.', + }, + ], + }, + ], + 'import/order': [ + 'error', + { + 'newlines-between': 'always', + groups: [ + 'builtin', + 'external', + 'internal', + 'type', + 'parent', + 'sibling', + 'object', + 'index', + ], + pathGroups: [ + { + pattern: '@nestjs/**', + group: 'builtin', + position: 'before', + }, + { + pattern: '**/interfaces/**', + group: 'type', + position: 'before', + }, + { + pattern: 'src/**', + group: 'parent', + position: 'before', + }, + { + pattern: './*', + group: 'sibling', + position: 'before', + }, + ], + distinctGroup: true, + warnOnUnassignedImports: true, + pathGroupsExcludedImportTypes: ['@nestjs/**'], + }, + ], }, }; diff --git a/server/package.json b/server/package.json index 0f2457982..1773ce22f 100644 --- a/server/package.json +++ b/server/package.json @@ -97,6 +97,7 @@ "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.0.1", "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.27.5", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", "prettier": "^2.3.2", diff --git a/server/src/ability/ability.factory.ts b/server/src/ability/ability.factory.ts index c3217f20c..f916d3b2d 100644 --- a/server/src/ability/ability.factory.ts +++ b/server/src/ability/ability.factory.ts @@ -1,6 +1,7 @@ +import { Injectable } from '@nestjs/common'; + import { PureAbility, AbilityBuilder } from '@casl/ability'; import { createPrismaAbility, PrismaQuery, Subjects } from '@casl/prisma'; -import { Injectable } from '@nestjs/common'; import { CommentThread, Company, @@ -16,6 +17,7 @@ import { PipelineProgress, Attachment, } from '@prisma/client'; + import { AbilityAction } from './ability.action'; type SubjectsAbility = Subjects<{ diff --git a/server/src/ability/ability.module.ts b/server/src/ability/ability.module.ts index 41586d2ff..5b4607c46 100644 --- a/server/src/ability/ability.module.ts +++ b/server/src/ability/ability.module.ts @@ -1,6 +1,8 @@ import { Global, Module } from '@nestjs/common'; + import { AbilityFactory } from 'src/ability/ability.factory'; import { PrismaService } from 'src/database/prisma.service'; + import { CreateUserAbilityHandler, DeleteUserAbilityHandler, diff --git a/server/src/ability/handlers/attachment.ability-handler.ts b/server/src/ability/handlers/attachment.ability-handler.ts index 314d4de23..d5d0f1c19 100644 --- a/server/src/ability/handlers/attachment.ability-handler.ts +++ b/server/src/ability/handlers/attachment.ability-handler.ts @@ -1,17 +1,20 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, ForbiddenException, Injectable, NotFoundException, } from '@nestjs/common'; -import { assert } from 'src/utils/assert'; import { GqlExecutionContext } from '@nestjs/graphql'; + import { subject } from '@casl/ability'; +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { assert } from 'src/utils/assert'; + class AttachmentArgs { activityId?: string; } diff --git a/server/src/ability/handlers/comment-thread-target.ability-handler.ts b/server/src/ability/handlers/comment-thread-target.ability-handler.ts index bfc0df1da..23c58a6b5 100644 --- a/server/src/ability/handlers/comment-thread-target.ability-handler.ts +++ b/server/src/ability/handlers/comment-thread-target.ability-handler.ts @@ -1,17 +1,20 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { CommentThreadTargetWhereInput } from 'src/core/@generated/comment-thread-target/comment-thread-target-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; -import { assert } from 'src/utils/assert'; + import { subject } from '@casl/ability'; +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { CommentThreadTargetWhereInput } from 'src/core/@generated/comment-thread-target/comment-thread-target-where.input'; +import { assert } from 'src/utils/assert'; + class CommentThreadTargetArgs { where?: CommentThreadTargetWhereInput; } diff --git a/server/src/ability/handlers/comment-thread.ability-handler.ts b/server/src/ability/handlers/comment-thread.ability-handler.ts index ac838db1e..ad1e663d9 100644 --- a/server/src/ability/handlers/comment-thread.ability-handler.ts +++ b/server/src/ability/handlers/comment-thread.ability-handler.ts @@ -1,16 +1,19 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; + +import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; import { CommentThreadWhereInput } from 'src/core/@generated/comment-thread/comment-thread-where.input'; import { assert } from 'src/utils/assert'; -import { subject } from '@casl/ability'; class CommentThreadArgs { where?: CommentThreadWhereInput; diff --git a/server/src/ability/handlers/comment.ability-handler.ts b/server/src/ability/handlers/comment.ability-handler.ts index d4893d965..693bdbf9c 100644 --- a/server/src/ability/handlers/comment.ability-handler.ts +++ b/server/src/ability/handlers/comment.ability-handler.ts @@ -1,15 +1,18 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { subject } from '@casl/ability'; -import { CommentWhereInput } from 'src/core/@generated/comment/comment-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; + +import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { CommentWhereInput } from 'src/core/@generated/comment/comment-where.input'; import { assert } from 'src/utils/assert'; class CommentArgs { diff --git a/server/src/ability/handlers/company.ability-handler.ts b/server/src/ability/handlers/company.ability-handler.ts index 8ae6f063e..1d2d35d18 100644 --- a/server/src/ability/handlers/company.ability-handler.ts +++ b/server/src/ability/handlers/company.ability-handler.ts @@ -1,17 +1,20 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { CompanyWhereInput } from 'src/core/@generated/company/company-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; -import { assert } from 'src/utils/assert'; + import { subject } from '@casl/ability'; +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { CompanyWhereInput } from 'src/core/@generated/company/company-where.input'; +import { assert } from 'src/utils/assert'; + class CompanyArgs { where?: CompanyWhereInput; } diff --git a/server/src/ability/handlers/person.ability-handler.ts b/server/src/ability/handlers/person.ability-handler.ts index a3c0f1c00..73528b1e1 100644 --- a/server/src/ability/handlers/person.ability-handler.ts +++ b/server/src/ability/handlers/person.ability-handler.ts @@ -1,17 +1,20 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { PersonWhereInput } from 'src/core/@generated/person/person-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; -import { assert } from 'src/utils/assert'; + import { subject } from '@casl/ability'; +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { PersonWhereInput } from 'src/core/@generated/person/person-where.input'; +import { assert } from 'src/utils/assert'; + class PersonArgs { where?: PersonWhereInput; } diff --git a/server/src/ability/handlers/pipeline-progress.ability-handler.ts b/server/src/ability/handlers/pipeline-progress.ability-handler.ts index f70d8c184..cebd32ea6 100644 --- a/server/src/ability/handlers/pipeline-progress.ability-handler.ts +++ b/server/src/ability/handlers/pipeline-progress.ability-handler.ts @@ -1,15 +1,18 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; -import { assert } from 'src/utils/assert'; + import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { assert } from 'src/utils/assert'; import { PipelineProgressWhereInput } from 'src/core/@generated/pipeline-progress/pipeline-progress-where.input'; class PipelineProgressArgs { diff --git a/server/src/ability/handlers/pipeline-stage.ability-handler.ts b/server/src/ability/handlers/pipeline-stage.ability-handler.ts index cb2c95c42..878272bcd 100644 --- a/server/src/ability/handlers/pipeline-stage.ability-handler.ts +++ b/server/src/ability/handlers/pipeline-stage.ability-handler.ts @@ -1,17 +1,20 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { PipelineStageWhereInput } from 'src/core/@generated/pipeline-stage/pipeline-stage-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; -import { assert } from 'src/utils/assert'; + import { subject } from '@casl/ability'; +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { PipelineStageWhereInput } from 'src/core/@generated/pipeline-stage/pipeline-stage-where.input'; +import { assert } from 'src/utils/assert'; + class PipelineStageArgs { where?: PipelineStageWhereInput; } diff --git a/server/src/ability/handlers/pipeline.ability-handler.ts b/server/src/ability/handlers/pipeline.ability-handler.ts index 23ca2da3e..7554d6200 100644 --- a/server/src/ability/handlers/pipeline.ability-handler.ts +++ b/server/src/ability/handlers/pipeline.ability-handler.ts @@ -1,17 +1,20 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { PipelineWhereInput } from 'src/core/@generated/pipeline/pipeline-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; -import { assert } from 'src/utils/assert'; + import { subject } from '@casl/ability'; +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { PipelineWhereInput } from 'src/core/@generated/pipeline/pipeline-where.input'; +import { assert } from 'src/utils/assert'; + class PipelineArgs { where?: PipelineWhereInput; } diff --git a/server/src/ability/handlers/refresh-token.ability-handler.ts b/server/src/ability/handlers/refresh-token.ability-handler.ts index bfe6fe3c8..ec1936407 100644 --- a/server/src/ability/handlers/refresh-token.ability-handler.ts +++ b/server/src/ability/handlers/refresh-token.ability-handler.ts @@ -1,15 +1,18 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { subject } from '@casl/ability'; -import { RefreshTokenWhereInput } from 'src/core/@generated/refresh-token/refresh-token-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; + +import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { RefreshTokenWhereInput } from 'src/core/@generated/refresh-token/refresh-token-where.input'; import { assert } from 'src/utils/assert'; class RefreshTokenArgs { diff --git a/server/src/ability/handlers/user.ability-handler.ts b/server/src/ability/handlers/user.ability-handler.ts index 664f5f5f5..2b2a83c2c 100644 --- a/server/src/ability/handlers/user.ability-handler.ts +++ b/server/src/ability/handlers/user.ability-handler.ts @@ -1,16 +1,19 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; +import { GqlExecutionContext } from '@nestjs/graphql'; + +import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; import { assert } from 'src/utils/assert'; import { UserWhereInput } from 'src/core/@generated/user/user-where.input'; -import { GqlExecutionContext } from '@nestjs/graphql'; -import { subject } from '@casl/ability'; class UserArgs { where?: UserWhereInput; diff --git a/server/src/ability/handlers/workspace-member.ability-handler.ts b/server/src/ability/handlers/workspace-member.ability-handler.ts index 0d2c62498..fc1cbd106 100644 --- a/server/src/ability/handlers/workspace-member.ability-handler.ts +++ b/server/src/ability/handlers/workspace-member.ability-handler.ts @@ -1,15 +1,18 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, Injectable, NotFoundException, } from '@nestjs/common'; -import { subject } from '@casl/ability'; -import { WorkspaceMemberWhereInput } from 'src/core/@generated/workspace-member/workspace-member-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; + +import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { WorkspaceMemberWhereInput } from 'src/core/@generated/workspace-member/workspace-member-where.input'; import { assert } from 'src/utils/assert'; class WorksapceMemberArgs { diff --git a/server/src/ability/handlers/workspace.ability-handler.ts b/server/src/ability/handlers/workspace.ability-handler.ts index 6041bb300..be44f7bd9 100644 --- a/server/src/ability/handlers/workspace.ability-handler.ts +++ b/server/src/ability/handlers/workspace.ability-handler.ts @@ -1,16 +1,19 @@ -import { PrismaService } from 'src/database/prisma.service'; -import { AbilityAction } from '../ability.action'; -import { AppAbility } from '../ability.factory'; -import { IAbilityHandler } from '../interfaces/ability-handler.interface'; import { ExecutionContext, ForbiddenException, Injectable, NotFoundException, } from '@nestjs/common'; -import { subject } from '@casl/ability'; -import { WorkspaceWhereInput } from 'src/core/@generated/workspace/workspace-where.input'; import { GqlExecutionContext } from '@nestjs/graphql'; + +import { subject } from '@casl/ability'; + +import { IAbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + +import { PrismaService } from 'src/database/prisma.service'; +import { AbilityAction } from 'src/ability/ability.action'; +import { AppAbility } from 'src/ability/ability.factory'; +import { WorkspaceWhereInput } from 'src/core/@generated/workspace/workspace-where.input'; import { assert } from 'src/utils/assert'; import { getRequest } from 'src/utils/extract-request'; diff --git a/server/src/ability/interfaces/ability-handler.interface.ts b/server/src/ability/interfaces/ability-handler.interface.ts index 40d46bc68..28cda745d 100644 --- a/server/src/ability/interfaces/ability-handler.interface.ts +++ b/server/src/ability/interfaces/ability-handler.interface.ts @@ -1,5 +1,6 @@ import { ExecutionContext, Type } from '@nestjs/common'; -import { AppAbility } from '../ability.factory'; + +import { AppAbility } from 'src/ability/ability.factory'; export interface IAbilityHandler { handle( diff --git a/server/src/app.module.ts b/server/src/app.module.ts index b53b27ed2..79cee3713 100644 --- a/server/src/app.module.ts +++ b/server/src/app.module.ts @@ -1,17 +1,19 @@ import { Module } from '@nestjs/common'; import { GraphQLModule } from '@nestjs/graphql'; -import { AppService } from './app.service'; - import { ConfigModule } from '@nestjs/config'; -import { CoreModule } from './core/core.module'; -import { IntegrationsModule } from './integrations/integrations.module'; import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo'; + import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default'; import { GraphQLError } from 'graphql'; +import GraphQLJSON from 'graphql-type-json'; + +import { AppService } from './app.service'; + +import { CoreModule } from './core/core.module'; +import { IntegrationsModule } from './integrations/integrations.module'; import { PrismaModule } from './database/prisma.module'; import { HealthModule } from './health/health.module'; import { AbilityModule } from './ability/ability.module'; -import GraphQLJSON from 'graphql-type-json'; @Module({ imports: [ diff --git a/server/src/constants/settings/interfaces/settings.interface.ts b/server/src/constants/settings/interfaces/settings.interface.ts index bbf8e1a3b..f7240f0b2 100644 --- a/server/src/constants/settings/interfaces/settings.interface.ts +++ b/server/src/constants/settings/interfaces/settings.interface.ts @@ -1,4 +1,5 @@ import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; + import { ShortCropSize } from 'src/utils/image'; type ValueOfFileFolder = `${FileFolder}`; diff --git a/server/src/core/analytics/analytics.module.ts b/server/src/core/analytics/analytics.module.ts index 85f100ec2..63d44f2bc 100644 --- a/server/src/core/analytics/analytics.module.ts +++ b/server/src/core/analytics/analytics.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { AnalyticsService } from './analytics.service'; import { AnalyticsResolver } from './analytics.resolver'; diff --git a/server/src/core/analytics/analytics.resolver.spec.ts b/server/src/core/analytics/analytics.resolver.spec.ts index efd0272d0..1cde8cacf 100644 --- a/server/src/core/analytics/analytics.resolver.spec.ts +++ b/server/src/core/analytics/analytics.resolver.spec.ts @@ -1,7 +1,9 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { EnvironmentService } from 'src/integrations/environment/environment.service'; + import { AnalyticsResolver } from './analytics.resolver'; import { AnalyticsService } from './analytics.service'; -import { EnvironmentService } from 'src/integrations/environment/environment.service'; describe('AnalyticsResolver', () => { let resolver: AnalyticsResolver; diff --git a/server/src/core/analytics/analytics.resolver.ts b/server/src/core/analytics/analytics.resolver.ts index 2504c17dc..dda499ff4 100644 --- a/server/src/core/analytics/analytics.resolver.ts +++ b/server/src/core/analytics/analytics.resolver.ts @@ -1,12 +1,16 @@ import { Resolver, Mutation, Args } from '@nestjs/graphql'; +import { UseGuards } from '@nestjs/common'; + +import { User, Workspace } from '@prisma/client'; + +import { OptionalJwtAuthGuard } from 'src/guards/optional-jwt.auth.guard'; +import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; +import { AuthUser } from 'src/decorators/auth-user.decorator'; + import { AnalyticsService } from './analytics.service'; import { Analytics } from './analytics.entity'; + import { CreateAnalyticsInput } from './dto/create-analytics.input'; -import { OptionalJwtAuthGuard } from 'src/guards/optional-jwt.auth.guard'; -import { UseGuards } from '@nestjs/common'; -import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; -import { User, Workspace } from '@prisma/client'; -import { AuthUser } from 'src/decorators/auth-user.decorator'; @UseGuards(OptionalJwtAuthGuard) @Resolver(() => Analytics) diff --git a/server/src/core/analytics/analytics.service.spec.ts b/server/src/core/analytics/analytics.service.spec.ts index 554f3cba6..3a18c131f 100644 --- a/server/src/core/analytics/analytics.service.spec.ts +++ b/server/src/core/analytics/analytics.service.spec.ts @@ -1,7 +1,9 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { AnalyticsService } from './analytics.service'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; +import { AnalyticsService } from './analytics.service'; + describe('AnalyticsService', () => { let service: AnalyticsService; diff --git a/server/src/core/analytics/analytics.service.ts b/server/src/core/analytics/analytics.service.ts index b778eaa60..20ef2c377 100644 --- a/server/src/core/analytics/analytics.service.ts +++ b/server/src/core/analytics/analytics.service.ts @@ -1,10 +1,13 @@ import { Injectable } from '@nestjs/common'; + import { User, Workspace } from '@prisma/client'; import axios, { AxiosInstance } from 'axios'; -import { CreateAnalyticsInput } from './dto/create-analytics.input'; + import { anonymize } from 'src/utils/anonymize'; import { EnvironmentService } from 'src/integrations/environment/environment.service'; +import { CreateAnalyticsInput } from './dto/create-analytics.input'; + @Injectable() export class AnalyticsService { private readonly httpService: AxiosInstance; diff --git a/server/src/core/analytics/dto/create-analytics.input.ts b/server/src/core/analytics/dto/create-analytics.input.ts index 3a16041cf..dc201f345 100644 --- a/server/src/core/analytics/dto/create-analytics.input.ts +++ b/server/src/core/analytics/dto/create-analytics.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import GraphQLJSON from 'graphql-type-json'; import { IsNotEmpty, IsString, IsObject } from 'class-validator'; diff --git a/server/src/core/attachment/attachment.module.ts b/server/src/core/attachment/attachment.module.ts index ffa08530e..1350ddf95 100644 --- a/server/src/core/attachment/attachment.module.ts +++ b/server/src/core/attachment/attachment.module.ts @@ -1,6 +1,8 @@ import { Module } from '@nestjs/common'; + +import { FileUploadService } from 'src/core/file/services/file-upload.service'; + import { AttachmentResolver } from './resolvers/attachment.resolver'; -import { FileUploadService } from '../file/services/file-upload.service'; import { AttachmentService } from './services/attachment.service'; @Module({ diff --git a/server/src/core/attachment/resolvers/attachment.resolver.spec.ts b/server/src/core/attachment/resolvers/attachment.resolver.spec.ts index 141609527..5c2f2c19e 100644 --- a/server/src/core/attachment/resolvers/attachment.resolver.spec.ts +++ b/server/src/core/attachment/resolvers/attachment.resolver.spec.ts @@ -1,9 +1,11 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { AttachmentResolver } from './attachment.resolver'; + import { FileUploadService } from 'src/core/file/services/file-upload.service'; -import { AttachmentService } from '../services/attachment.service'; +import { AttachmentService } from 'src/core/attachment/services/attachment.service'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { AttachmentResolver } from './attachment.resolver'; + describe('AttachmentResolver', () => { let resolver: AttachmentResolver; diff --git a/server/src/core/attachment/resolvers/attachment.resolver.ts b/server/src/core/attachment/resolvers/attachment.resolver.ts index 0b49bdfa7..80a84328d 100644 --- a/server/src/core/attachment/resolvers/attachment.resolver.ts +++ b/server/src/core/attachment/resolvers/attachment.resolver.ts @@ -1,14 +1,17 @@ import { Resolver, Args, Mutation } from '@nestjs/graphql'; +import { UseGuards } from '@nestjs/common'; + import { User, Workspace } from '@prisma/client'; import { GraphQLUpload, FileUpload } from 'graphql-upload'; +import { v4 as uuidV4 } from 'uuid'; + +import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; + import { AuthUser } from 'src/decorators/auth-user.decorator'; import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; import { streamToBuffer } from 'src/utils/stream-to-buffer'; -import { v4 as uuidV4 } from 'uuid'; -import { AttachmentService } from '../services/attachment.service'; +import { AttachmentService } from 'src/core/attachment/services/attachment.service'; import { FileUploadService } from 'src/core/file/services/file-upload.service'; -import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; -import { UseGuards } from '@nestjs/common'; import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; import { Attachment } from 'src/core/@generated/attachment/attachment.model'; import { AbilityGuard } from 'src/guards/ability.guard'; diff --git a/server/src/core/attachment/services/attachment.service.spec.ts b/server/src/core/attachment/services/attachment.service.spec.ts index b2fa152da..f40eab92f 100644 --- a/server/src/core/attachment/services/attachment.service.spec.ts +++ b/server/src/core/attachment/services/attachment.service.spec.ts @@ -1,6 +1,8 @@ import { Test, TestingModule } from '@nestjs/testing'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; + import { AttachmentService } from './attachment.service'; describe('AttachmentService', () => { diff --git a/server/src/core/attachment/services/attachment.service.ts b/server/src/core/attachment/services/attachment.service.ts index 6f7e4656a..4b5c3c962 100644 --- a/server/src/core/attachment/services/attachment.service.ts +++ b/server/src/core/attachment/services/attachment.service.ts @@ -1,5 +1,7 @@ import { Injectable } from '@nestjs/common'; + import { AttachmentType } from '@prisma/client'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/auth/auth.module.ts b/server/src/core/auth/auth.module.ts index 3d6f754df..ef67e03c6 100644 --- a/server/src/core/auth/auth.module.ts +++ b/server/src/core/auth/auth.module.ts @@ -1,15 +1,18 @@ import { Module } from '@nestjs/common'; import { JwtModule } from '@nestjs/jwt'; + +import { PrismaService } from 'src/database/prisma.service'; +import { UserModule } from 'src/core/user/user.module'; +import { EnvironmentService } from 'src/integrations/environment/environment.service'; +import { WorkspaceModule } from 'src/core/workspace/workspace.module'; + +import { AuthResolver } from './auth.resolver'; + import { JwtAuthStrategy } from './strategies/jwt.auth.strategy'; import { AuthService } from './services/auth.service'; import { GoogleAuthController } from './controllers/google-auth.controller'; -import { PrismaService } from 'src/database/prisma.service'; -import { UserModule } from '../user/user.module'; import { VerifyAuthController } from './controllers/verify-auth.controller'; import { TokenService } from './services/token.service'; -import { AuthResolver } from './auth.resolver'; -import { EnvironmentService } from 'src/integrations/environment/environment.service'; -import { WorkspaceModule } from '../workspace/workspace.module'; const jwtModule = JwtModule.registerAsync({ useFactory: async (environmentService: EnvironmentService) => { diff --git a/server/src/core/auth/auth.resolver.spec.ts b/server/src/core/auth/auth.resolver.spec.ts index 0c9ae4bc7..f2e06f421 100644 --- a/server/src/core/auth/auth.resolver.spec.ts +++ b/server/src/core/auth/auth.resolver.spec.ts @@ -1,5 +1,7 @@ import { Test, TestingModule } from '@nestjs/testing'; + import { AuthResolver } from './auth.resolver'; + import { TokenService } from './services/token.service'; import { AuthService } from './services/auth.service'; diff --git a/server/src/core/auth/auth.resolver.ts b/server/src/core/auth/auth.resolver.ts index a234f8cb0..60fb9d24b 100644 --- a/server/src/core/auth/auth.resolver.ts +++ b/server/src/core/auth/auth.resolver.ts @@ -1,18 +1,21 @@ import { Args, Mutation, Query, Resolver } from '@nestjs/graphql'; +import { BadRequestException } from '@nestjs/common'; + +import { Prisma } from '@prisma/client'; + +import { + PrismaSelect, + PrismaSelector, +} from 'src/decorators/prisma-select.decorator'; + import { AuthTokens } from './dto/token.entity'; import { TokenService } from './services/token.service'; import { RefreshTokenInput } from './dto/refresh-token.input'; -import { BadRequestException } from '@nestjs/common'; import { Verify } from './dto/verify.entity'; import { VerifyInput } from './dto/verify.input'; import { AuthService } from './services/auth.service'; import { LoginToken } from './dto/login-token.entity'; import { ChallengeInput } from './dto/challenge.input'; -import { - PrismaSelect, - PrismaSelector, -} from 'src/decorators/prisma-select.decorator'; -import { Prisma } from '@prisma/client'; import { UserExists } from './dto/user-exists.entity'; import { CheckUserExistsInput } from './dto/user-exists.input'; import { WorkspaceInviteHashValid } from './dto/workspace-invite-hash-valid.entity'; diff --git a/server/src/core/auth/controllers/google-auth.controller.ts b/server/src/core/auth/controllers/google-auth.controller.ts index 6fec7e78a..9e62537ba 100644 --- a/server/src/core/auth/controllers/google-auth.controller.ts +++ b/server/src/core/auth/controllers/google-auth.controller.ts @@ -7,11 +7,13 @@ import { UseGuards, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; + import { Response } from 'express'; -import { GoogleRequest } from '../strategies/google.auth.strategy'; -import { UserService } from '../../user/user.service'; -import { TokenService } from '../services/token.service'; -import { GoogleProviderEnabledGuard } from '../guards/google-provider-enabled.guard'; + +import { GoogleRequest } from 'src/core/auth/strategies/google.auth.strategy'; +import { UserService } from 'src/core/user/user.service'; +import { TokenService } from 'src/core/auth/services/token.service'; +import { GoogleProviderEnabledGuard } from 'src/core/auth/guards/google-provider-enabled.guard'; @Controller('auth/google') export class GoogleAuthController { diff --git a/server/src/core/auth/controllers/verify-auth.controller.spec.ts b/server/src/core/auth/controllers/verify-auth.controller.spec.ts index b5d989a34..3c9c72625 100644 --- a/server/src/core/auth/controllers/verify-auth.controller.spec.ts +++ b/server/src/core/auth/controllers/verify-auth.controller.spec.ts @@ -1,7 +1,9 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { AuthService } from 'src/core/auth/services/auth.service'; +import { TokenService } from 'src/core/auth/services/token.service'; + import { VerifyAuthController } from './verify-auth.controller'; -import { AuthService } from '../services/auth.service'; -import { TokenService } from '../services/token.service'; describe('VerifyAuthController', () => { let controller: VerifyAuthController; diff --git a/server/src/core/auth/controllers/verify-auth.controller.ts b/server/src/core/auth/controllers/verify-auth.controller.ts index 0fd2fd98d..0323c5c8b 100644 --- a/server/src/core/auth/controllers/verify-auth.controller.ts +++ b/server/src/core/auth/controllers/verify-auth.controller.ts @@ -1,8 +1,9 @@ import { Body, Controller, Post } from '@nestjs/common'; -import { AuthService } from '../services/auth.service'; -import { VerifyInput } from '../dto/verify.input'; -import { Verify } from '../dto/verify.entity'; -import { TokenService } from '../services/token.service'; + +import { AuthService } from 'src/core/auth/services/auth.service'; +import { VerifyInput } from 'src/core/auth/dto/verify.input'; +import { Verify } from 'src/core/auth/dto/verify.entity'; +import { TokenService } from 'src/core/auth/services/token.service'; @Controller('auth/verify') export class VerifyAuthController { diff --git a/server/src/core/auth/dto/challenge.input.ts b/server/src/core/auth/dto/challenge.input.ts index 8c6dc82f0..6e1cee036 100644 --- a/server/src/core/auth/dto/challenge.input.ts +++ b/server/src/core/auth/dto/challenge.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import { IsEmail, IsNotEmpty, IsString } from 'class-validator'; @ArgsType() diff --git a/server/src/core/auth/dto/login-token.entity.ts b/server/src/core/auth/dto/login-token.entity.ts index 93dde970e..847043671 100644 --- a/server/src/core/auth/dto/login-token.entity.ts +++ b/server/src/core/auth/dto/login-token.entity.ts @@ -1,4 +1,5 @@ import { Field, ObjectType } from '@nestjs/graphql'; + import { AuthToken } from './token.entity'; @ObjectType() diff --git a/server/src/core/auth/dto/refresh-token.input.ts b/server/src/core/auth/dto/refresh-token.input.ts index ebd1aeb94..efc69d2b2 100644 --- a/server/src/core/auth/dto/refresh-token.input.ts +++ b/server/src/core/auth/dto/refresh-token.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import { IsNotEmpty, IsString } from 'class-validator'; @ArgsType() diff --git a/server/src/core/auth/dto/sign-up.input.ts b/server/src/core/auth/dto/sign-up.input.ts index 49931338d..675376577 100644 --- a/server/src/core/auth/dto/sign-up.input.ts +++ b/server/src/core/auth/dto/sign-up.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import { IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator'; @ArgsType() diff --git a/server/src/core/auth/dto/user-exists.input.ts b/server/src/core/auth/dto/user-exists.input.ts index 86b6a5203..9dfe662d2 100644 --- a/server/src/core/auth/dto/user-exists.input.ts +++ b/server/src/core/auth/dto/user-exists.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import { IsNotEmpty, IsString } from 'class-validator'; @ArgsType() diff --git a/server/src/core/auth/dto/verify.entity.ts b/server/src/core/auth/dto/verify.entity.ts index f8ed483f1..3b327a8c7 100644 --- a/server/src/core/auth/dto/verify.entity.ts +++ b/server/src/core/auth/dto/verify.entity.ts @@ -1,7 +1,9 @@ import { Field, ObjectType } from '@nestjs/graphql'; -import { AuthTokens } from './token.entity'; + import { User } from 'src/core/@generated/user/user.model'; +import { AuthTokens } from './token.entity'; + @ObjectType() export class Verify extends AuthTokens { @Field(() => User) diff --git a/server/src/core/auth/dto/verify.input.ts b/server/src/core/auth/dto/verify.input.ts index 635f2d8c7..af544f4e1 100644 --- a/server/src/core/auth/dto/verify.input.ts +++ b/server/src/core/auth/dto/verify.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import { IsNotEmpty, IsString } from 'class-validator'; @ArgsType() diff --git a/server/src/core/auth/dto/workspace-invite-hash.input.ts b/server/src/core/auth/dto/workspace-invite-hash.input.ts index 848fdb531..8ac7109c3 100644 --- a/server/src/core/auth/dto/workspace-invite-hash.input.ts +++ b/server/src/core/auth/dto/workspace-invite-hash.input.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from '@nestjs/graphql'; + import { IsNotEmpty, IsString, MinLength } from 'class-validator'; @ArgsType() diff --git a/server/src/core/auth/guards/google-provider-enabled.guard.ts b/server/src/core/auth/guards/google-provider-enabled.guard.ts index 5dd4365bb..614e7e165 100644 --- a/server/src/core/auth/guards/google-provider-enabled.guard.ts +++ b/server/src/core/auth/guards/google-provider-enabled.guard.ts @@ -1,7 +1,9 @@ import { Injectable, CanActivate, NotFoundException } from '@nestjs/common'; + import { Observable } from 'rxjs'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; -import { GoogleStrategy } from '../strategies/google.auth.strategy'; +import { GoogleStrategy } from 'src/core/auth/strategies/google.auth.strategy'; @Injectable() export class GoogleProviderEnabledGuard implements CanActivate { diff --git a/server/src/core/auth/services/auth.service.spec.ts b/server/src/core/auth/services/auth.service.spec.ts index 8b4739906..271f8a7b2 100644 --- a/server/src/core/auth/services/auth.service.spec.ts +++ b/server/src/core/auth/services/auth.service.spec.ts @@ -1,9 +1,11 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { AuthService } from './auth.service'; -import { TokenService } from './token.service'; + import { UserService } from 'src/core/user/user.service'; import { WorkspaceService } from 'src/core/workspace/services/workspace.service'; +import { AuthService } from './auth.service'; +import { TokenService } from './token.service'; + describe('AuthService', () => { let service: AuthService; diff --git a/server/src/core/auth/services/auth.service.ts b/server/src/core/auth/services/auth.service.ts index b3bdaec8e..930d605c6 100644 --- a/server/src/core/auth/services/auth.service.ts +++ b/server/src/core/auth/services/auth.service.ts @@ -4,17 +4,24 @@ import { Injectable, NotFoundException, } from '@nestjs/common'; -import { ChallengeInput } from '../dto/challenge.input'; + +import { Prisma } from '@prisma/client'; + +import { ChallengeInput } from 'src/core/auth/dto/challenge.input'; import { UserService } from 'src/core/user/user.service'; import { assert } from 'src/utils/assert'; -import { PASSWORD_REGEX, compareHash, hashPassword } from '../auth.util'; -import { Verify } from '../dto/verify.entity'; -import { TokenService } from './token.service'; -import { Prisma } from '@prisma/client'; -import { UserExists } from '../dto/user-exists.entity'; +import { + PASSWORD_REGEX, + compareHash, + hashPassword, +} from 'src/core/auth/auth.util'; +import { Verify } from 'src/core/auth/dto/verify.entity'; +import { UserExists } from 'src/core/auth/dto/user-exists.entity'; import { WorkspaceService } from 'src/core/workspace/services/workspace.service'; -import { WorkspaceInviteHashValid } from '../dto/workspace-invite-hash-valid.entity'; -import { SignUpInput } from '../dto/sign-up.input'; +import { WorkspaceInviteHashValid } from 'src/core/auth/dto/workspace-invite-hash-valid.entity'; +import { SignUpInput } from 'src/core/auth/dto/sign-up.input'; + +import { TokenService } from './token.service'; export type UserPayload = { firstName: string; diff --git a/server/src/core/auth/services/token.service.spec.ts b/server/src/core/auth/services/token.service.spec.ts index 78c706fa3..c28e5be87 100644 --- a/server/src/core/auth/services/token.service.spec.ts +++ b/server/src/core/auth/services/token.service.spec.ts @@ -1,10 +1,12 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { TokenService } from './token.service'; +import { JwtService } from '@nestjs/jwt'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; -import { JwtService } from '@nestjs/jwt'; import { EnvironmentService } from 'src/integrations/environment/environment.service'; +import { TokenService } from './token.service'; + describe('TokenService', () => { let service: TokenService; diff --git a/server/src/core/auth/services/token.service.ts b/server/src/core/auth/services/token.service.ts index e01b9d3bd..fceeac7a3 100644 --- a/server/src/core/auth/services/token.service.ts +++ b/server/src/core/auth/services/token.service.ts @@ -7,13 +7,15 @@ import { UnprocessableEntityException, } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; -import { JwtPayload } from '../strategies/jwt.auth.strategy'; -import { PrismaService } from 'src/database/prisma.service'; -import { assert } from 'src/utils/assert'; + import { addMilliseconds } from 'date-fns'; import ms from 'ms'; -import { AuthToken } from '../dto/token.entity'; import { TokenExpiredError } from 'jsonwebtoken'; + +import { JwtPayload } from 'src/core/auth/strategies/jwt.auth.strategy'; +import { PrismaService } from 'src/database/prisma.service'; +import { assert } from 'src/utils/assert'; +import { AuthToken } from 'src/core/auth/dto/token.entity'; import { EnvironmentService } from 'src/integrations/environment/environment.service'; @Injectable() diff --git a/server/src/core/auth/strategies/google.auth.strategy.ts b/server/src/core/auth/strategies/google.auth.strategy.ts index a14f52f7a..f83d185dc 100644 --- a/server/src/core/auth/strategies/google.auth.strategy.ts +++ b/server/src/core/auth/strategies/google.auth.strategy.ts @@ -1,8 +1,9 @@ import { PassportStrategy } from '@nestjs/passport'; -import { Strategy, VerifyCallback } from 'passport-google-oauth20'; - import { Injectable } from '@nestjs/common'; + +import { Strategy, VerifyCallback } from 'passport-google-oauth20'; import { Request } from 'express'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; export type GoogleRequest = Request & { diff --git a/server/src/core/auth/strategies/jwt.auth.strategy.ts b/server/src/core/auth/strategies/jwt.auth.strategy.ts index 5934a6515..3a40c4ed5 100644 --- a/server/src/core/auth/strategies/jwt.auth.strategy.ts +++ b/server/src/core/auth/strategies/jwt.auth.strategy.ts @@ -1,8 +1,10 @@ -import { Strategy, ExtractJwt } from 'passport-jwt'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, UnauthorizedException } from '@nestjs/common'; -import { PrismaService } from 'src/database/prisma.service'; + +import { Strategy, ExtractJwt } from 'passport-jwt'; import { User, Workspace } from '@prisma/client'; + +import { PrismaService } from 'src/database/prisma.service'; import { EnvironmentService } from 'src/integrations/environment/environment.service'; export type JwtPayload = { sub: string; workspaceId: string }; diff --git a/server/src/core/client-config/client-config.module.ts b/server/src/core/client-config/client-config.module.ts index 6cc205856..04c78007f 100644 --- a/server/src/core/client-config/client-config.module.ts +++ b/server/src/core/client-config/client-config.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { ClientConfigResolver } from './client-config.resolver'; @Module({ diff --git a/server/src/core/client-config/client-config.resolver.spec.ts b/server/src/core/client-config/client-config.resolver.spec.ts index 3d26757d8..3004995e1 100644 --- a/server/src/core/client-config/client-config.resolver.spec.ts +++ b/server/src/core/client-config/client-config.resolver.spec.ts @@ -1,7 +1,9 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { ClientConfigResolver } from './client-config.resolver'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; +import { ClientConfigResolver } from './client-config.resolver'; + describe('ClientConfigResolver', () => { let resolver: ClientConfigResolver; diff --git a/server/src/core/client-config/client-config.resolver.ts b/server/src/core/client-config/client-config.resolver.ts index 66b11014d..eaa9a0d6f 100644 --- a/server/src/core/client-config/client-config.resolver.ts +++ b/server/src/core/client-config/client-config.resolver.ts @@ -1,5 +1,7 @@ import { Resolver, Query } from '@nestjs/graphql'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; + import { ClientConfig } from './client-config.entity'; @Resolver() diff --git a/server/src/core/comment/comment.module.ts b/server/src/core/comment/comment.module.ts index c685e53e1..8db99c7e7 100644 --- a/server/src/core/comment/comment.module.ts +++ b/server/src/core/comment/comment.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { CommentService } from './services/comment.service'; import { CommentResolver } from './resolvers/comment.resolver'; import { CommentThreadTargetService } from './services/comment-thread-target.service'; diff --git a/server/src/core/comment/resolvers/comment-thread.resolver.spec.ts b/server/src/core/comment/resolvers/comment-thread.resolver.spec.ts index 3a90ff3d0..3dfb312a2 100644 --- a/server/src/core/comment/resolvers/comment-thread.resolver.spec.ts +++ b/server/src/core/comment/resolvers/comment-thread.resolver.spec.ts @@ -1,11 +1,13 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CommentThreadResolver } from './comment-thread.resolver'; -import { CommentThreadService } from '../services/comment-thread.service'; import { CanActivate } from '@nestjs/common'; + +import { CommentThreadService } from 'src/core/comment/services/comment-thread.service'; import { CreateOneCommentGuard } from 'src/guards/create-one-comment.guard'; import { CreateOneCommentThreadGuard } from 'src/guards/create-one-comment-thread.guard'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { CommentThreadResolver } from './comment-thread.resolver'; + describe('CommentThreadResolver', () => { let resolver: CommentThreadResolver; diff --git a/server/src/core/comment/resolvers/comment-thread.resolver.ts b/server/src/core/comment/resolvers/comment-thread.resolver.ts index e08e683e9..976af6121 100644 --- a/server/src/core/comment/resolvers/comment-thread.resolver.ts +++ b/server/src/core/comment/resolvers/comment-thread.resolver.ts @@ -1,13 +1,17 @@ import { Resolver, Args, Mutation, Query } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + +import { accessibleBy } from '@casl/prisma'; +import { Prisma } from '@prisma/client'; + import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { Workspace } from '../../../core/@generated/workspace/workspace.model'; -import { AuthWorkspace } from '../../../decorators/auth-workspace.decorator'; -import { CommentThread } from '../../../core/@generated/comment-thread/comment-thread.model'; -import { CreateOneCommentThreadArgs } from '../../../core/@generated/comment-thread/create-one-comment-thread.args'; -import { CreateOneCommentThreadGuard } from '../../../guards/create-one-comment-thread.guard'; -import { FindManyCommentThreadArgs } from '../../../core/@generated/comment-thread/find-many-comment-thread.args'; -import { CommentThreadService } from '../services/comment-thread.service'; +import { Workspace } from 'src/core/@generated/workspace/workspace.model'; +import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; +import { CommentThread } from 'src/core/@generated/comment-thread/comment-thread.model'; +import { CreateOneCommentThreadArgs } from 'src/core/@generated/comment-thread/create-one-comment-thread.args'; +import { CreateOneCommentThreadGuard } from 'src/guards/create-one-comment-thread.guard'; +import { FindManyCommentThreadArgs } from 'src/core/@generated/comment-thread/find-many-comment-thread.args'; +import { CommentThreadService } from 'src/core/comment/services/comment-thread.service'; import { UpdateOneCommentThreadArgs } from 'src/core/@generated/comment-thread/update-one-comment-thread.args'; import { PrismaSelector, @@ -23,10 +27,8 @@ import { } from 'src/ability/handlers/comment-thread.ability-handler'; import { UserAbility } from 'src/decorators/user-ability.decorator'; import { AppAbility } from 'src/ability/ability.factory'; -import { accessibleBy } from '@casl/prisma'; import { AffectedRows } from 'src/core/@generated/prisma/affected-rows.output'; import { DeleteManyCommentThreadArgs } from 'src/core/@generated/comment-thread/delete-many-comment-thread.args'; -import { Prisma } from '@prisma/client'; @UseGuards(JwtAuthGuard) @Resolver(() => CommentThread) diff --git a/server/src/core/comment/resolvers/comment.resolver.spec.ts b/server/src/core/comment/resolvers/comment.resolver.spec.ts index 8955ec7bc..633bc5549 100644 --- a/server/src/core/comment/resolvers/comment.resolver.spec.ts +++ b/server/src/core/comment/resolvers/comment.resolver.spec.ts @@ -1,10 +1,12 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CommentResolver } from './comment.resolver'; -import { CommentService } from '../services/comment.service'; -import { CreateOneCommentGuard } from 'src/guards/create-one-comment.guard'; import { CanActivate } from '@nestjs/common'; + +import { CommentService } from 'src/core/comment/services/comment.service'; +import { CreateOneCommentGuard } from 'src/guards/create-one-comment.guard'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { CommentResolver } from './comment.resolver'; + describe('CommentResolver', () => { let resolver: CommentResolver; diff --git a/server/src/core/comment/resolvers/comment.resolver.ts b/server/src/core/comment/resolvers/comment.resolver.ts index 6db68b5a9..0ede50f1a 100644 --- a/server/src/core/comment/resolvers/comment.resolver.ts +++ b/server/src/core/comment/resolvers/comment.resolver.ts @@ -1,12 +1,15 @@ import { Resolver, Args, Mutation } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + +import { Prisma } from '@prisma/client'; + import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { Workspace } from '../../../core/@generated/workspace/workspace.model'; -import { AuthWorkspace } from '../../../decorators/auth-workspace.decorator'; -import { CreateOneCommentArgs } from '../../../core/@generated/comment/create-one-comment.args'; -import { Comment } from '../../../core/@generated/comment/comment.model'; -import { CreateOneCommentGuard } from '../../../guards/create-one-comment.guard'; -import { CommentService } from '../services/comment.service'; +import { Workspace } from 'src/core/@generated/workspace/workspace.model'; +import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; +import { CreateOneCommentArgs } from 'src/core/@generated/comment/create-one-comment.args'; +import { Comment } from 'src/core/@generated/comment/comment.model'; +import { CreateOneCommentGuard } from 'src/guards/create-one-comment.guard'; +import { CommentService } from 'src/core/comment/services/comment.service'; import { PrismaSelector, PrismaSelect, @@ -16,7 +19,6 @@ import { CheckAbilities } from 'src/decorators/check-abilities.decorator'; import { CreateCommentAbilityHandler } from 'src/ability/handlers/comment.ability-handler'; import { AuthUser } from 'src/decorators/auth-user.decorator'; import { User } from 'src/core/@generated/user/user.model'; -import { Prisma } from '@prisma/client'; @UseGuards(JwtAuthGuard) @Resolver(() => Comment) diff --git a/server/src/core/comment/services/comment-thread-target.service.spec.ts b/server/src/core/comment/services/comment-thread-target.service.spec.ts index 2ac9c14c9..57ecf929e 100644 --- a/server/src/core/comment/services/comment-thread-target.service.spec.ts +++ b/server/src/core/comment/services/comment-thread-target.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CommentThreadTargetService } from './comment-thread-target.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { CommentThreadTargetService } from './comment-thread-target.service'; + describe('CommentThreadTargetService', () => { let service: CommentThreadTargetService; diff --git a/server/src/core/comment/services/comment-thread-target.service.ts b/server/src/core/comment/services/comment-thread-target.service.ts index fafbb16c4..f557f4310 100644 --- a/server/src/core/comment/services/comment-thread-target.service.ts +++ b/server/src/core/comment/services/comment-thread-target.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/comment/services/comment-thread.service.spec.ts b/server/src/core/comment/services/comment-thread.service.spec.ts index 792ce34c1..f65fb76aa 100644 --- a/server/src/core/comment/services/comment-thread.service.spec.ts +++ b/server/src/core/comment/services/comment-thread.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CommentThreadService } from './comment-thread.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { CommentThreadService } from './comment-thread.service'; + describe('CommentThreadService', () => { let service: CommentThreadService; diff --git a/server/src/core/comment/services/comment-thread.service.ts b/server/src/core/comment/services/comment-thread.service.ts index 550322288..a093966c2 100644 --- a/server/src/core/comment/services/comment-thread.service.ts +++ b/server/src/core/comment/services/comment-thread.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/comment/services/comment.service.spec.ts b/server/src/core/comment/services/comment.service.spec.ts index 75cd8c1df..049d0c6c2 100644 --- a/server/src/core/comment/services/comment.service.spec.ts +++ b/server/src/core/comment/services/comment.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CommentService } from './comment.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { CommentService } from './comment.service'; + describe('CommentService', () => { let service: CommentService; diff --git a/server/src/core/comment/services/comment.service.ts b/server/src/core/comment/services/comment.service.ts index 51c8c61fd..1f5a2070b 100644 --- a/server/src/core/comment/services/comment.service.ts +++ b/server/src/core/comment/services/comment.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/company/company-relations.resolver.spec.ts b/server/src/core/company/company-relations.resolver.spec.ts index 312b4a2e8..b222a28fd 100644 --- a/server/src/core/company/company-relations.resolver.spec.ts +++ b/server/src/core/company/company-relations.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { CommentThreadService } from 'src/core/comment/services/comment-thread.service'; +import { CommentService } from 'src/core/comment/services/comment.service'; + import { CompanyRelationsResolver } from './company-relations.resolver'; import { CompanyService } from './company.service'; -import { CommentThreadService } from '../comment/services/comment-thread.service'; -import { CommentService } from '../comment/services/comment.service'; describe('CompanyRelationsResolver', () => { let resolver: CompanyRelationsResolver; diff --git a/server/src/core/company/company-relations.resolver.ts b/server/src/core/company/company-relations.resolver.ts index 5f8425964..2c2932b8b 100644 --- a/server/src/core/company/company-relations.resolver.ts +++ b/server/src/core/company/company-relations.resolver.ts @@ -1,9 +1,10 @@ import { Resolver, ResolveField, Root, Int } from '@nestjs/graphql'; + import { CommentThread } from 'src/core/@generated/comment-thread/comment-thread.model'; import { Comment } from 'src/core/@generated/comment/comment.model'; import { Company } from 'src/core/@generated/company/company.model'; -import { CommentThreadService } from '../comment/services/comment-thread.service'; -import { CommentService } from '../comment/services/comment.service'; +import { CommentThreadService } from 'src/core/comment/services/comment-thread.service'; +import { CommentService } from 'src/core/comment/services/comment.service'; import { PrismaSelect, PrismaSelector, diff --git a/server/src/core/company/company.module.ts b/server/src/core/company/company.module.ts index e0bfcb9fc..e8f7e3e09 100644 --- a/server/src/core/company/company.module.ts +++ b/server/src/core/company/company.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; + +import { CommentModule } from 'src/core/comment/comment.module'; + import { CompanyService } from './company.service'; import { CompanyResolver } from './company.resolver'; import { CompanyRelationsResolver } from './company-relations.resolver'; -import { CommentModule } from '../comment/comment.module'; @Module({ imports: [CommentModule], diff --git a/server/src/core/company/company.resolver.spec.ts b/server/src/core/company/company.resolver.spec.ts index c93c65b1f..02a58e8d9 100644 --- a/server/src/core/company/company.resolver.spec.ts +++ b/server/src/core/company/company.resolver.spec.ts @@ -1,12 +1,14 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CompanyResolver } from './company.resolver'; -import { CompanyService } from './company.service'; -import { UpdateOneGuard } from 'src/guards/update-one.guard'; import { CanActivate } from '@nestjs/common'; + +import { UpdateOneGuard } from 'src/guards/update-one.guard'; import { DeleteManyGuard } from 'src/guards/delete-many.guard'; import { CreateOneGuard } from 'src/guards/create-one.guard'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { CompanyService } from './company.service'; +import { CompanyResolver } from './company.resolver'; + describe('CompanyResolver', () => { let resolver: CompanyResolver; diff --git a/server/src/core/company/company.resolver.ts b/server/src/core/company/company.resolver.ts index 5f759305e..db46f6ef3 100644 --- a/server/src/core/company/company.resolver.ts +++ b/server/src/core/company/company.resolver.ts @@ -1,18 +1,20 @@ import { Resolver, Query, Args, Mutation } from '@nestjs/graphql'; -import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; import { UseGuards } from '@nestjs/common'; -import { AuthWorkspace } from '../../decorators/auth-workspace.decorator'; -import { Company } from '../../core/@generated/company/company.model'; -import { FindManyCompanyArgs } from '../../core/@generated/company/find-many-company.args'; -import { UpdateOneCompanyArgs } from '../../core/@generated/company/update-one-company.args'; -import { CreateOneCompanyArgs } from '../../core/@generated/company/create-one-company.args'; -import { AffectedRows } from '../../core/@generated/prisma/affected-rows.output'; -import { DeleteManyCompanyArgs } from '../../core/@generated/company/delete-many-company.args'; + import { Prisma, Workspace } from '@prisma/client'; -import { UpdateOneGuard } from '../../guards/update-one.guard'; -import { DeleteManyGuard } from '../../guards/delete-many.guard'; -import { CreateOneGuard } from '../../guards/create-one.guard'; -import { CompanyService } from './company.service'; +import { accessibleBy } from '@casl/prisma'; + +import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; +import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; +import { Company } from 'src/core/@generated/company/company.model'; +import { FindManyCompanyArgs } from 'src/core/@generated/company/find-many-company.args'; +import { UpdateOneCompanyArgs } from 'src/core/@generated/company/update-one-company.args'; +import { CreateOneCompanyArgs } from 'src/core/@generated/company/create-one-company.args'; +import { AffectedRows } from 'src/core/@generated/prisma/affected-rows.output'; +import { DeleteManyCompanyArgs } from 'src/core/@generated/company/delete-many-company.args'; +import { UpdateOneGuard } from 'src/guards/update-one.guard'; +import { DeleteManyGuard } from 'src/guards/delete-many.guard'; +import { CreateOneGuard } from 'src/guards/create-one.guard'; import { PrismaSelect, PrismaSelector, @@ -27,7 +29,8 @@ import { } from 'src/ability/handlers/company.ability-handler'; import { UserAbility } from 'src/decorators/user-ability.decorator'; import { AppAbility } from 'src/ability/ability.factory'; -import { accessibleBy } from '@casl/prisma'; + +import { CompanyService } from './company.service'; @UseGuards(JwtAuthGuard) @Resolver(() => Company) diff --git a/server/src/core/company/company.service.spec.ts b/server/src/core/company/company.service.spec.ts index 5c929517b..b5a09b25f 100644 --- a/server/src/core/company/company.service.spec.ts +++ b/server/src/core/company/company.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CompanyService } from './company.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { CompanyService } from './company.service'; + describe('CompanyService', () => { let service: CompanyService; diff --git a/server/src/core/company/company.service.ts b/server/src/core/company/company.service.ts index 169f7514f..e4d924732 100644 --- a/server/src/core/company/company.service.ts +++ b/server/src/core/company/company.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/core.module.ts b/server/src/core/core.module.ts index 4bc6afdbe..5ddf91f0c 100644 --- a/server/src/core/core.module.ts +++ b/server/src/core/core.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { UserModule } from './user/user.module'; import { CommentModule } from './comment/comment.module'; import { CompanyModule } from './company/company.module'; diff --git a/server/src/core/file/controllers/file.controller.spec.ts b/server/src/core/file/controllers/file.controller.spec.ts index 20bff93c9..b177d22b6 100644 --- a/server/src/core/file/controllers/file.controller.spec.ts +++ b/server/src/core/file/controllers/file.controller.spec.ts @@ -1,6 +1,8 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { FileService } from 'src/core/file/services/file.service'; + import { FileController } from './file.controller'; -import { FileService } from '../services/file.service'; describe('FileController', () => { let controller: FileController; diff --git a/server/src/core/file/controllers/file.controller.ts b/server/src/core/file/controllers/file.controller.ts index 7b7761aee..ead58094d 100644 --- a/server/src/core/file/controllers/file.controller.ts +++ b/server/src/core/file/controllers/file.controller.ts @@ -1,7 +1,9 @@ import { Controller, Get, Param, Res } from '@nestjs/common'; + import { Response } from 'express'; -import { checkFilePath, checkFilename } from '../file.utils'; -import { FileService } from '../services/file.service'; + +import { checkFilePath, checkFilename } from 'src/core/file/file.utils'; +import { FileService } from 'src/core/file/services/file.service'; // TODO: Add cookie authentication @Controller('files') diff --git a/server/src/core/file/file.module.ts b/server/src/core/file/file.module.ts index 1595393ae..7d68ad3ce 100644 --- a/server/src/core/file/file.module.ts +++ b/server/src/core/file/file.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { FileService } from './services/file.service'; import { FileUploadService } from './services/file-upload.service'; import { FileUploadResolver } from './resolvers/file-upload.resolver'; diff --git a/server/src/core/file/file.utils.ts b/server/src/core/file/file.utils.ts index 6e2654092..5cc8559ea 100644 --- a/server/src/core/file/file.utils.ts +++ b/server/src/core/file/file.utils.ts @@ -1,10 +1,14 @@ -import { kebabCase } from 'src/utils/kebab-case'; -import { FileFolder } from './interfaces/file-folder.interface'; -import { KebabCase } from 'type-fest'; import { BadRequestException } from '@nestjs/common'; + import { basename } from 'path'; + +import { KebabCase } from 'type-fest'; + +import { kebabCase } from 'src/utils/kebab-case'; import { settings } from 'src/constants/settings'; +import { FileFolder } from './interfaces/file-folder.interface'; + type AllowedFolders = KebabCase; export function checkFilePath(filePath: string): string { diff --git a/server/src/core/file/resolvers/file-upload.resolver.spec.ts b/server/src/core/file/resolvers/file-upload.resolver.spec.ts index ebe8dae33..78c6f55a0 100644 --- a/server/src/core/file/resolvers/file-upload.resolver.spec.ts +++ b/server/src/core/file/resolvers/file-upload.resolver.spec.ts @@ -1,6 +1,8 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { FileUploadService } from 'src/core/file/services/file-upload.service'; + import { FileUploadResolver } from './file-upload.resolver'; -import { FileUploadService } from '../services/file-upload.service'; describe('FileUploadResolver', () => { let resolver: FileUploadResolver; diff --git a/server/src/core/file/resolvers/file-upload.resolver.ts b/server/src/core/file/resolvers/file-upload.resolver.ts index 04acebdae..5b320c046 100644 --- a/server/src/core/file/resolvers/file-upload.resolver.ts +++ b/server/src/core/file/resolvers/file-upload.resolver.ts @@ -1,10 +1,13 @@ import { Args, Mutation, Resolver } from '@nestjs/graphql'; -import { GraphQLUpload, FileUpload } from 'graphql-upload'; -import { FileUploadService } from '../services/file-upload.service'; import { UseGuards } from '@nestjs/common'; + +import { GraphQLUpload, FileUpload } from 'graphql-upload'; + +import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; + +import { FileUploadService } from 'src/core/file/services/file-upload.service'; import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; import { streamToBuffer } from 'src/utils/stream-to-buffer'; -import { FileFolder } from '../interfaces/file-folder.interface'; @UseGuards(JwtAuthGuard) @Resolver() diff --git a/server/src/core/file/services/file-upload.service.spec.ts b/server/src/core/file/services/file-upload.service.spec.ts index ae39c8df5..52219e25d 100644 --- a/server/src/core/file/services/file-upload.service.spec.ts +++ b/server/src/core/file/services/file-upload.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { FileUploadService } from './file-upload.service'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; import { FileStorageService } from 'src/integrations/file-storage/file-storage.service'; +import { FileUploadService } from './file-upload.service'; + describe('FileUploadService', () => { let service: FileUploadService; diff --git a/server/src/core/file/services/file-upload.service.ts b/server/src/core/file/services/file-upload.service.ts index 2424660ff..7825f78fb 100644 --- a/server/src/core/file/services/file-upload.service.ts +++ b/server/src/core/file/services/file-upload.service.ts @@ -1,10 +1,13 @@ import { Injectable } from '@nestjs/common'; + import sharp from 'sharp'; +import { v4 as uuidV4 } from 'uuid'; + +import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; + import { getCropSize } from 'src/utils/image'; import { settings } from 'src/constants/settings'; -import { FileFolder } from '../interfaces/file-folder.interface'; import { FileStorageService } from 'src/integrations/file-storage/file-storage.service'; -import { v4 as uuidV4 } from 'uuid'; @Injectable() export class FileUploadService { diff --git a/server/src/core/file/services/file.service.spec.ts b/server/src/core/file/services/file.service.spec.ts index 69ebbf7d7..89e8d98bd 100644 --- a/server/src/core/file/services/file.service.spec.ts +++ b/server/src/core/file/services/file.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { FileService } from './file.service'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; import { FileStorageService } from 'src/integrations/file-storage/file-storage.service'; +import { FileService } from './file.service'; + describe('FileService', () => { let service: FileService; diff --git a/server/src/core/file/services/file.service.ts b/server/src/core/file/services/file.service.ts index 23e584d6c..f2fe510cd 100644 --- a/server/src/core/file/services/file.service.ts +++ b/server/src/core/file/services/file.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { FileStorageService } from 'src/integrations/file-storage/file-storage.service'; @Injectable() diff --git a/server/src/core/person/person-relations.resolver.spec.ts b/server/src/core/person/person-relations.resolver.spec.ts index 236c68abc..5f7cd6dc0 100644 --- a/server/src/core/person/person-relations.resolver.spec.ts +++ b/server/src/core/person/person-relations.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { CommentThreadService } from 'src/core/comment/services/comment-thread.service'; +import { CommentService } from 'src/core/comment/services/comment.service'; + import { PersonRelationsResolver } from './person-relations.resolver'; import { PersonService } from './person.service'; -import { CommentThreadService } from '../comment/services/comment-thread.service'; -import { CommentService } from '../comment/services/comment.service'; describe('PersonRelationsResolver', () => { let resolver: PersonRelationsResolver; diff --git a/server/src/core/person/person-relations.resolver.ts b/server/src/core/person/person-relations.resolver.ts index 0e9e0e2c1..275aeaa30 100644 --- a/server/src/core/person/person-relations.resolver.ts +++ b/server/src/core/person/person-relations.resolver.ts @@ -1,9 +1,10 @@ import { Resolver, Root, ResolveField, Int } from '@nestjs/graphql'; + import { CommentThread } from 'src/core/@generated/comment-thread/comment-thread.model'; import { Comment } from 'src/core/@generated/comment/comment.model'; import { Person } from 'src/core/@generated/person/person.model'; -import { CommentThreadService } from '../comment/services/comment-thread.service'; -import { CommentService } from '../comment/services/comment.service'; +import { CommentThreadService } from 'src/core/comment/services/comment-thread.service'; +import { CommentService } from 'src/core/comment/services/comment.service'; import { PrismaSelect, PrismaSelector, diff --git a/server/src/core/person/person.module.ts b/server/src/core/person/person.module.ts index 52a252d94..d57c0c1e4 100644 --- a/server/src/core/person/person.module.ts +++ b/server/src/core/person/person.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; + +import { CommentModule } from 'src/core/comment/comment.module'; + import { PersonService } from './person.service'; import { PersonResolver } from './person.resolver'; import { PersonRelationsResolver } from './person-relations.resolver'; -import { CommentModule } from '../comment/comment.module'; @Module({ imports: [CommentModule, CommentModule], diff --git a/server/src/core/person/person.resolver.spec.ts b/server/src/core/person/person.resolver.spec.ts index eec60604b..a21257d5f 100644 --- a/server/src/core/person/person.resolver.spec.ts +++ b/server/src/core/person/person.resolver.spec.ts @@ -1,12 +1,14 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PersonResolver } from './person.resolver'; -import { PersonService } from './person.service'; -import { UpdateOneGuard } from 'src/guards/update-one.guard'; import { CanActivate } from '@nestjs/common'; + +import { UpdateOneGuard } from 'src/guards/update-one.guard'; import { DeleteManyGuard } from 'src/guards/delete-many.guard'; import { CreateOneGuard } from 'src/guards/create-one.guard'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { PersonService } from './person.service'; +import { PersonResolver } from './person.resolver'; + describe('PersonResolver', () => { let resolver: PersonResolver; diff --git a/server/src/core/person/person.resolver.ts b/server/src/core/person/person.resolver.ts index 2a3722052..9d68527b3 100644 --- a/server/src/core/person/person.resolver.ts +++ b/server/src/core/person/person.resolver.ts @@ -7,19 +7,22 @@ import { Parent, } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + +import { accessibleBy } from '@casl/prisma'; +import { Prisma } from '@prisma/client'; + import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { Person } from '../../core/@generated/person/person.model'; -import { FindManyPersonArgs } from '../../core/@generated/person/find-many-person.args'; -import { UpdateOnePersonArgs } from '../../core/@generated/person/update-one-person.args'; -import { CreateOnePersonArgs } from '../../core/@generated/person/create-one-person.args'; -import { AffectedRows } from '../../core/@generated/prisma/affected-rows.output'; -import { DeleteManyPersonArgs } from '../../core/@generated/person/delete-many-person.args'; -import { Workspace } from '../../core/@generated/workspace/workspace.model'; -import { AuthWorkspace } from '../../decorators/auth-workspace.decorator'; -import { UpdateOneGuard } from '../../guards/update-one.guard'; -import { DeleteManyGuard } from '../../guards/delete-many.guard'; -import { CreateOneGuard } from '../../guards/create-one.guard'; -import { PersonService } from './person.service'; +import { Person } from 'src/core/@generated/person/person.model'; +import { FindManyPersonArgs } from 'src/core/@generated/person/find-many-person.args'; +import { UpdateOnePersonArgs } from 'src/core/@generated/person/update-one-person.args'; +import { CreateOnePersonArgs } from 'src/core/@generated/person/create-one-person.args'; +import { AffectedRows } from 'src/core/@generated/prisma/affected-rows.output'; +import { DeleteManyPersonArgs } from 'src/core/@generated/person/delete-many-person.args'; +import { Workspace } from 'src/core/@generated/workspace/workspace.model'; +import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; +import { UpdateOneGuard } from 'src/guards/update-one.guard'; +import { DeleteManyGuard } from 'src/guards/delete-many.guard'; +import { CreateOneGuard } from 'src/guards/create-one.guard'; import { PrismaSelect, PrismaSelector, @@ -34,8 +37,8 @@ import { } from 'src/ability/handlers/person.ability-handler'; import { UserAbility } from 'src/decorators/user-ability.decorator'; import { AppAbility } from 'src/ability/ability.factory'; -import { accessibleBy } from '@casl/prisma'; -import { Prisma } from '@prisma/client'; + +import { PersonService } from './person.service'; @UseGuards(JwtAuthGuard) @Resolver(() => Person) diff --git a/server/src/core/person/person.service.spec.ts b/server/src/core/person/person.service.spec.ts index 552df3aa3..de97b9453 100644 --- a/server/src/core/person/person.service.spec.ts +++ b/server/src/core/person/person.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PersonService } from './person.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { PersonService } from './person.service'; + describe('PersonService', () => { let service: PersonService; diff --git a/server/src/core/person/person.service.ts b/server/src/core/person/person.service.ts index 7b0ca725c..ef8598aca 100644 --- a/server/src/core/person/person.service.ts +++ b/server/src/core/person/person.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/pipeline/pipeline.module.ts b/server/src/core/pipeline/pipeline.module.ts index 57451ae64..820c0998d 100644 --- a/server/src/core/pipeline/pipeline.module.ts +++ b/server/src/core/pipeline/pipeline.module.ts @@ -1,4 +1,5 @@ import { Module } from '@nestjs/common'; + import { PipelineService } from './services/pipeline.service'; import { PipelineResolver } from './resolvers/pipeline.resolver'; import { PipelineStageResolver } from './resolvers/pipeline-stage.resolver'; diff --git a/server/src/core/pipeline/resolvers/pipeline-progress.resolver.spec.ts b/server/src/core/pipeline/resolvers/pipeline-progress.resolver.spec.ts index ea2c5cba1..1a01f6709 100644 --- a/server/src/core/pipeline/resolvers/pipeline-progress.resolver.spec.ts +++ b/server/src/core/pipeline/resolvers/pipeline-progress.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PipelineProgressResolver } from './pipeline-progress.resolver'; -import { PipelineProgressService } from '../services/pipeline-progress.service'; + +import { PipelineProgressService } from 'src/core/pipeline/services/pipeline-progress.service'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { PipelineProgressResolver } from './pipeline-progress.resolver'; + describe('PipelineProgressResolver', () => { let resolver: PipelineProgressResolver; diff --git a/server/src/core/pipeline/resolvers/pipeline-progress.resolver.ts b/server/src/core/pipeline/resolvers/pipeline-progress.resolver.ts index 59d6ebaca..d0579f817 100644 --- a/server/src/core/pipeline/resolvers/pipeline-progress.resolver.ts +++ b/server/src/core/pipeline/resolvers/pipeline-progress.resolver.ts @@ -1,16 +1,19 @@ import { Resolver, Args, Query, Mutation } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + import { accessibleBy } from '@casl/prisma'; +import { Prisma } from '@prisma/client'; + import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { Workspace } from '../../../core/@generated/workspace/workspace.model'; -import { AuthWorkspace } from '../../../decorators/auth-workspace.decorator'; -import { FindManyPipelineProgressArgs } from '../../@generated/pipeline-progress/find-many-pipeline-progress.args'; -import { PipelineProgress } from '../../@generated/pipeline-progress/pipeline-progress.model'; -import { UpdateOnePipelineProgressArgs } from '../../@generated/pipeline-progress/update-one-pipeline-progress.args'; -import { AffectedRows } from '../../@generated/prisma/affected-rows.output'; -import { DeleteManyPipelineProgressArgs } from '../../@generated/pipeline-progress/delete-many-pipeline-progress.args'; -import { CreateOnePipelineProgressArgs } from '../../@generated/pipeline-progress/create-one-pipeline-progress.args'; -import { PipelineProgressService } from '../services/pipeline-progress.service'; +import { Workspace } from 'src/core/@generated/workspace/workspace.model'; +import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; +import { FindManyPipelineProgressArgs } from 'src/core/@generated/pipeline-progress/find-many-pipeline-progress.args'; +import { PipelineProgress } from 'src/core/@generated/pipeline-progress/pipeline-progress.model'; +import { UpdateOnePipelineProgressArgs } from 'src/core/@generated/pipeline-progress/update-one-pipeline-progress.args'; +import { AffectedRows } from 'src/core/@generated/prisma/affected-rows.output'; +import { DeleteManyPipelineProgressArgs } from 'src/core/@generated/pipeline-progress/delete-many-pipeline-progress.args'; +import { CreateOnePipelineProgressArgs } from 'src/core/@generated/pipeline-progress/create-one-pipeline-progress.args'; +import { PipelineProgressService } from 'src/core/pipeline/services/pipeline-progress.service'; import { AbilityGuard } from 'src/guards/ability.guard'; import { CheckAbilities } from 'src/decorators/check-abilities.decorator'; import { @@ -25,7 +28,6 @@ import { PrismaSelector, PrismaSelect, } from 'src/decorators/prisma-select.decorator'; -import { Prisma } from '@prisma/client'; @UseGuards(JwtAuthGuard) @Resolver(() => PipelineProgress) diff --git a/server/src/core/pipeline/resolvers/pipeline-stage.resolver.spec.ts b/server/src/core/pipeline/resolvers/pipeline-stage.resolver.spec.ts index b8dfc2768..9cd093701 100644 --- a/server/src/core/pipeline/resolvers/pipeline-stage.resolver.spec.ts +++ b/server/src/core/pipeline/resolvers/pipeline-stage.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PipelineStageResolver } from './pipeline-stage.resolver'; -import { PipelineStageService } from '../services/pipeline-stage.service'; + +import { PipelineStageService } from 'src/core/pipeline/services/pipeline-stage.service'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { PipelineStageResolver } from './pipeline-stage.resolver'; + describe('PipelineStageResolver', () => { let resolver: PipelineStageResolver; diff --git a/server/src/core/pipeline/resolvers/pipeline-stage.resolver.ts b/server/src/core/pipeline/resolvers/pipeline-stage.resolver.ts index 84a87356a..3e1e53d64 100644 --- a/server/src/core/pipeline/resolvers/pipeline-stage.resolver.ts +++ b/server/src/core/pipeline/resolvers/pipeline-stage.resolver.ts @@ -1,10 +1,13 @@ import { Resolver, Args, Query, Mutation } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + import { accessibleBy } from '@casl/prisma'; +import { Prisma } from '@prisma/client'; + import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { PipelineStage } from '../../../core/@generated/pipeline-stage/pipeline-stage.model'; -import { FindManyPipelineStageArgs } from '../../../core/@generated/pipeline-stage/find-many-pipeline-stage.args'; -import { PipelineStageService } from '../services/pipeline-stage.service'; +import { PipelineStage } from 'src/core/@generated/pipeline-stage/pipeline-stage.model'; +import { FindManyPipelineStageArgs } from 'src/core/@generated/pipeline-stage/find-many-pipeline-stage.args'; +import { PipelineStageService } from 'src/core/pipeline/services/pipeline-stage.service'; import { AbilityGuard } from 'src/guards/ability.guard'; import { CheckAbilities } from 'src/decorators/check-abilities.decorator'; import { @@ -18,7 +21,6 @@ import { PrismaSelect, } from 'src/decorators/prisma-select.decorator'; import { UpdateOnePipelineStageArgs } from 'src/core/@generated/pipeline-stage/update-one-pipeline-stage.args'; -import { Prisma } from '@prisma/client'; @UseGuards(JwtAuthGuard) @Resolver(() => PipelineStage) diff --git a/server/src/core/pipeline/resolvers/pipeline.resolver.spec.ts b/server/src/core/pipeline/resolvers/pipeline.resolver.spec.ts index 0eebfb9c9..0297a250e 100644 --- a/server/src/core/pipeline/resolvers/pipeline.resolver.spec.ts +++ b/server/src/core/pipeline/resolvers/pipeline.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PipelineResolver } from './pipeline.resolver'; -import { PipelineService } from '../services/pipeline.service'; + +import { PipelineService } from 'src/core/pipeline/services/pipeline.service'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { PipelineResolver } from './pipeline.resolver'; + describe('PipelineResolver', () => { let resolver: PipelineResolver; diff --git a/server/src/core/pipeline/resolvers/pipeline.resolver.ts b/server/src/core/pipeline/resolvers/pipeline.resolver.ts index 11003eac2..486b073eb 100644 --- a/server/src/core/pipeline/resolvers/pipeline.resolver.ts +++ b/server/src/core/pipeline/resolvers/pipeline.resolver.ts @@ -1,10 +1,12 @@ import { Resolver, Args, Query } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + import { accessibleBy } from '@casl/prisma'; + import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { Pipeline } from '../../@generated/pipeline/pipeline.model'; -import { FindManyPipelineArgs } from '../../@generated/pipeline/find-many-pipeline.args'; -import { PipelineService } from '../services/pipeline.service'; +import { Pipeline } from 'src/core/@generated/pipeline/pipeline.model'; +import { FindManyPipelineArgs } from 'src/core/@generated/pipeline/find-many-pipeline.args'; +import { PipelineService } from 'src/core/pipeline/services/pipeline.service'; import { AbilityGuard } from 'src/guards/ability.guard'; import { CheckAbilities } from 'src/decorators/check-abilities.decorator'; import { ReadPipelineAbilityHandler } from 'src/ability/handlers/pipeline.ability-handler'; diff --git a/server/src/core/pipeline/services/pipeline-progress.service.spec.ts b/server/src/core/pipeline/services/pipeline-progress.service.spec.ts index c17c0b5ad..b85147fcb 100644 --- a/server/src/core/pipeline/services/pipeline-progress.service.spec.ts +++ b/server/src/core/pipeline/services/pipeline-progress.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PipelineProgressService } from './pipeline-progress.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { PipelineProgressService } from './pipeline-progress.service'; + describe('PipelineProgressService', () => { let service: PipelineProgressService; diff --git a/server/src/core/pipeline/services/pipeline-progress.service.ts b/server/src/core/pipeline/services/pipeline-progress.service.ts index 21e914ceb..8929db9b7 100644 --- a/server/src/core/pipeline/services/pipeline-progress.service.ts +++ b/server/src/core/pipeline/services/pipeline-progress.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/pipeline/services/pipeline-stage.service.spec.ts b/server/src/core/pipeline/services/pipeline-stage.service.spec.ts index da462ef1e..9295f6df0 100644 --- a/server/src/core/pipeline/services/pipeline-stage.service.spec.ts +++ b/server/src/core/pipeline/services/pipeline-stage.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PipelineStageService } from './pipeline-stage.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { PipelineStageService } from './pipeline-stage.service'; + describe('PipelineStageService', () => { let service: PipelineStageService; diff --git a/server/src/core/pipeline/services/pipeline-stage.service.ts b/server/src/core/pipeline/services/pipeline-stage.service.ts index c2fa64b0c..a249c3835 100644 --- a/server/src/core/pipeline/services/pipeline-stage.service.ts +++ b/server/src/core/pipeline/services/pipeline-stage.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; -import seedPipelineStages from '../seed-data/pipeline-stages.json'; +import seedPipelineStages from 'src/core/pipeline/seed-data/pipeline-stages.json'; @Injectable() export class PipelineStageService { diff --git a/server/src/core/pipeline/services/pipeline.service.spec.ts b/server/src/core/pipeline/services/pipeline.service.spec.ts index c4c397315..17a110b10 100644 --- a/server/src/core/pipeline/services/pipeline.service.spec.ts +++ b/server/src/core/pipeline/services/pipeline.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { PipelineService } from './pipeline.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { PipelineService } from './pipeline.service'; + describe('PipelineService', () => { let service: PipelineService; diff --git a/server/src/core/pipeline/services/pipeline.service.ts b/server/src/core/pipeline/services/pipeline.service.ts index 713a5dbb6..568bbcec5 100644 --- a/server/src/core/pipeline/services/pipeline.service.ts +++ b/server/src/core/pipeline/services/pipeline.service.ts @@ -1,8 +1,10 @@ import { Injectable } from '@nestjs/common'; -import { PrismaService } from 'src/database/prisma.service'; -import seedSalesPipeline from '../seed-data/sales-pipeline.json'; + import { PipelineProgressableType } from '@prisma/client'; +import { PrismaService } from 'src/database/prisma.service'; +import seedSalesPipeline from 'src/core/pipeline/seed-data/sales-pipeline.json'; + @Injectable() export class PipelineService { constructor(private readonly prismaService: PrismaService) {} diff --git a/server/src/core/user/user.module.ts b/server/src/core/user/user.module.ts index d70bc8ca7..93d653773 100644 --- a/server/src/core/user/user.module.ts +++ b/server/src/core/user/user.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; + +import { FileModule } from 'src/core/file/file.module'; +import { WorkspaceModule } from 'src/core/workspace/workspace.module'; + import { UserService } from './user.service'; import { UserResolver } from './user.resolver'; -import { FileModule } from '../file/file.module'; -import { WorkspaceModule } from '../workspace/workspace.module'; @Module({ imports: [FileModule, WorkspaceModule], diff --git a/server/src/core/user/user.resolver.spec.ts b/server/src/core/user/user.resolver.spec.ts index 34b6e4a19..54290676b 100644 --- a/server/src/core/user/user.resolver.spec.ts +++ b/server/src/core/user/user.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; + +import { AbilityFactory } from 'src/ability/ability.factory'; +import { FileUploadService } from 'src/core/file/services/file-upload.service'; + import { UserResolver } from './user.resolver'; import { UserService } from './user.service'; -import { AbilityFactory } from 'src/ability/ability.factory'; -import { FileUploadService } from '../file/services/file-upload.service'; describe('UserResolver', () => { let resolver: UserResolver; diff --git a/server/src/core/user/user.resolver.ts b/server/src/core/user/user.resolver.ts index 10fef0e24..d5169a0d1 100644 --- a/server/src/core/user/user.resolver.ts +++ b/server/src/core/user/user.resolver.ts @@ -6,11 +6,17 @@ import { Parent, Mutation, } from '@nestjs/graphql'; -import { UserService } from './user.service'; +import { UseFilters, UseGuards } from '@nestjs/common'; + +import { accessibleBy } from '@casl/prisma'; +import { Prisma } from '@prisma/client'; +import { FileUpload, GraphQLUpload } from 'graphql-upload'; + +import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; + import { FindManyUserArgs } from 'src/core/@generated/user/find-many-user.args'; import { User } from 'src/core/@generated/user/user.model'; import { ExceptionFilter } from 'src/filters/exception.filter'; -import { UseFilters, UseGuards } from '@nestjs/common'; import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; import { PrismaSelect, @@ -24,15 +30,13 @@ import { } from 'src/ability/handlers/user.ability-handler'; import { UserAbility } from 'src/decorators/user-ability.decorator'; import { AppAbility } from 'src/ability/ability.factory'; -import { accessibleBy } from '@casl/prisma'; import { AuthUser } from 'src/decorators/auth-user.decorator'; import { assert } from 'src/utils/assert'; -import { UpdateOneUserArgs } from '../@generated/user/update-one-user.args'; -import { Prisma } from '@prisma/client'; -import { FileUpload, GraphQLUpload } from 'graphql-upload'; +import { UpdateOneUserArgs } from 'src/core/@generated/user/update-one-user.args'; import { streamToBuffer } from 'src/utils/stream-to-buffer'; -import { FileUploadService } from '../file/services/file-upload.service'; -import { FileFolder } from '../file/interfaces/file-folder.interface'; +import { FileUploadService } from 'src/core/file/services/file-upload.service'; + +import { UserService } from './user.service'; @UseGuards(JwtAuthGuard) @Resolver(() => User) diff --git a/server/src/core/user/user.service.spec.ts b/server/src/core/user/user.service.spec.ts index e3d0f3546..60afaa23e 100644 --- a/server/src/core/user/user.service.spec.ts +++ b/server/src/core/user/user.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { UserService } from './user.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; -import { WorkspaceService } from '../workspace/services/workspace.service'; +import { WorkspaceService } from 'src/core/workspace/services/workspace.service'; + +import { UserService } from './user.service'; describe('UserService', () => { let service: UserService; diff --git a/server/src/core/user/user.service.ts b/server/src/core/user/user.service.ts index c3a075a90..d572109a8 100644 --- a/server/src/core/user/user.service.ts +++ b/server/src/core/user/user.service.ts @@ -1,8 +1,10 @@ import { BadRequestException, Injectable } from '@nestjs/common'; -import { PrismaService } from 'src/database/prisma.service'; + import { Prisma } from '@prisma/client'; + +import { PrismaService } from 'src/database/prisma.service'; import { assert } from 'src/utils/assert'; -import { WorkspaceService } from '../workspace/services/workspace.service'; +import { WorkspaceService } from 'src/core/workspace/services/workspace.service'; export type UserPayload = { displayName: string | undefined | null; diff --git a/server/src/core/workspace/resolvers/workspace-member.resolver.spec.ts b/server/src/core/workspace/resolvers/workspace-member.resolver.spec.ts index 04169163b..4e1a74e36 100644 --- a/server/src/core/workspace/resolvers/workspace-member.resolver.spec.ts +++ b/server/src/core/workspace/resolvers/workspace-member.resolver.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { WorkspaceMemberResolver } from './workspace-member.resolver'; -import { WorkspaceMemberService } from '../services/workspace-member.service'; + +import { WorkspaceMemberService } from 'src/core/workspace/services/workspace-member.service'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { WorkspaceMemberResolver } from './workspace-member.resolver'; + describe('WorkspaceMemberResolver', () => { let resolver: WorkspaceMemberResolver; diff --git a/server/src/core/workspace/resolvers/workspace-member.resolver.ts b/server/src/core/workspace/resolvers/workspace-member.resolver.ts index 4bb2ac667..42bcb76cc 100644 --- a/server/src/core/workspace/resolvers/workspace-member.resolver.ts +++ b/server/src/core/workspace/resolvers/workspace-member.resolver.ts @@ -1,6 +1,9 @@ import { Args, Query, Resolver, Mutation } from '@nestjs/graphql'; -import { WorkspaceMember } from '../../@generated/workspace-member/workspace-member.model'; import { UseGuards } from '@nestjs/common'; + +import { accessibleBy } from '@casl/prisma'; + +import { WorkspaceMember } from 'src/core/@generated/workspace-member/workspace-member.model'; import { AbilityGuard } from 'src/guards/ability.guard'; import { CheckAbilities } from 'src/decorators/check-abilities.decorator'; import { @@ -14,8 +17,7 @@ import { PrismaSelect, PrismaSelector, } from 'src/decorators/prisma-select.decorator'; -import { WorkspaceMemberService } from '../services/workspace-member.service'; -import { accessibleBy } from '@casl/prisma'; +import { WorkspaceMemberService } from 'src/core/workspace/services/workspace-member.service'; import { DeleteOneWorkspaceMemberArgs } from 'src/core/@generated/workspace-member/delete-one-workspace-member.args'; import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; diff --git a/server/src/core/workspace/resolvers/workspace.resolver.spec.ts b/server/src/core/workspace/resolvers/workspace.resolver.spec.ts index a6772b23b..638899181 100644 --- a/server/src/core/workspace/resolvers/workspace.resolver.spec.ts +++ b/server/src/core/workspace/resolvers/workspace.resolver.spec.ts @@ -1,9 +1,11 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { WorkspaceResolver } from './workspace.resolver'; -import { WorkspaceService } from '../services/workspace.service'; + +import { WorkspaceService } from 'src/core/workspace/services/workspace.service'; import { FileUploadService } from 'src/core/file/services/file-upload.service'; import { AbilityFactory } from 'src/ability/ability.factory'; +import { WorkspaceResolver } from './workspace.resolver'; + describe('WorkspaceResolver', () => { let resolver: WorkspaceResolver; diff --git a/server/src/core/workspace/resolvers/workspace.resolver.ts b/server/src/core/workspace/resolvers/workspace.resolver.ts index 3f60b0f43..355ff07f3 100644 --- a/server/src/core/workspace/resolvers/workspace.resolver.ts +++ b/server/src/core/workspace/resolvers/workspace.resolver.ts @@ -1,7 +1,13 @@ import { Query, Args, Mutation, Resolver } from '@nestjs/graphql'; import { UseGuards } from '@nestjs/common'; + +import { Prisma } from '@prisma/client'; +import { FileUpload, GraphQLUpload } from 'graphql-upload'; + +import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; + import { Workspace } from 'src/core/@generated/workspace/workspace.model'; -import { WorkspaceService } from '../services/workspace.service'; +import { WorkspaceService } from 'src/core/workspace/services/workspace.service'; import { PrismaSelect, PrismaSelector, @@ -9,12 +15,9 @@ import { import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator'; import { WorkspaceUpdateInput } from 'src/core/@generated/workspace/workspace-update.input'; import { JwtAuthGuard } from 'src/guards/jwt.auth.guard'; -import { Prisma } from '@prisma/client'; import { assert } from 'src/utils/assert'; import { FileUploadService } from 'src/core/file/services/file-upload.service'; -import { FileUpload, GraphQLUpload } from 'graphql-upload'; import { streamToBuffer } from 'src/utils/stream-to-buffer'; -import { FileFolder } from 'src/core/file/interfaces/file-folder.interface'; import { AbilityGuard } from 'src/guards/ability.guard'; import { CheckAbilities } from 'src/decorators/check-abilities.decorator'; import { UpdateWorkspaceAbilityHandler } from 'src/ability/handlers/workspace.ability-handler'; diff --git a/server/src/core/workspace/services/workspace-member.service.spec.ts b/server/src/core/workspace/services/workspace-member.service.spec.ts index e4eacfc80..2017a0b32 100644 --- a/server/src/core/workspace/services/workspace-member.service.spec.ts +++ b/server/src/core/workspace/services/workspace-member.service.spec.ts @@ -1,8 +1,10 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { WorkspaceMemberService } from './workspace-member.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; +import { WorkspaceMemberService } from './workspace-member.service'; + describe('WorkspaceMemberService', () => { let service: WorkspaceMemberService; diff --git a/server/src/core/workspace/services/workspace-member.service.ts b/server/src/core/workspace/services/workspace-member.service.ts index 0ec266b6c..7950c0f9d 100644 --- a/server/src/core/workspace/services/workspace-member.service.ts +++ b/server/src/core/workspace/services/workspace-member.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/core/workspace/services/workspace.service.spec.ts b/server/src/core/workspace/services/workspace.service.spec.ts index 396767c42..a71fae3ed 100644 --- a/server/src/core/workspace/services/workspace.service.spec.ts +++ b/server/src/core/workspace/services/workspace.service.spec.ts @@ -1,10 +1,12 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { WorkspaceService } from './workspace.service'; + import { PrismaService } from 'src/database/prisma.service'; import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton'; import { PipelineService } from 'src/core/pipeline/services/pipeline.service'; import { PipelineStageService } from 'src/core/pipeline/services/pipeline-stage.service'; +import { WorkspaceService } from './workspace.service'; + describe('WorkspaceService', () => { let service: WorkspaceService; diff --git a/server/src/core/workspace/services/workspace.service.ts b/server/src/core/workspace/services/workspace.service.ts index 75ecd16f5..f97bc8b4d 100644 --- a/server/src/core/workspace/services/workspace.service.ts +++ b/server/src/core/workspace/services/workspace.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common'; + import { PipelineStageService } from 'src/core/pipeline/services/pipeline-stage.service'; import { PipelineService } from 'src/core/pipeline/services/pipeline.service'; import { PrismaService } from 'src/database/prisma.service'; diff --git a/server/src/core/workspace/workspace.module.ts b/server/src/core/workspace/workspace.module.ts index f3456f537..a087fee34 100644 --- a/server/src/core/workspace/workspace.module.ts +++ b/server/src/core/workspace/workspace.module.ts @@ -1,10 +1,12 @@ import { Module } from '@nestjs/common'; + +import { FileUploadService } from 'src/core/file/services/file-upload.service'; +import { PipelineModule } from 'src/core/pipeline/pipeline.module'; + import { WorkspaceService } from './services/workspace.service'; import { WorkspaceMemberService } from './services/workspace-member.service'; import { WorkspaceMemberResolver } from './resolvers/workspace-member.resolver'; import { WorkspaceResolver } from './resolvers/workspace.resolver'; -import { FileUploadService } from '../file/services/file-upload.service'; -import { PipelineModule } from '../pipeline/pipeline.module'; @Module({ imports: [PipelineModule], diff --git a/server/src/database/prisma.module.ts b/server/src/database/prisma.module.ts index 7207426f6..d30ce68b3 100644 --- a/server/src/database/prisma.module.ts +++ b/server/src/database/prisma.module.ts @@ -1,4 +1,5 @@ import { Global, Module } from '@nestjs/common'; + import { PrismaService } from './prisma.service'; @Global() diff --git a/server/src/database/prisma.service.ts b/server/src/database/prisma.service.ts index 9d6b30698..6808f2202 100644 --- a/server/src/database/prisma.service.ts +++ b/server/src/database/prisma.service.ts @@ -4,8 +4,10 @@ import { Logger, OnModuleInit, } from '@nestjs/common'; + import { PrismaClient } from '@prisma/client'; import { createPrismaQueryEventHandler } from 'prisma-query-log'; + import { EnvironmentService } from 'src/integrations/environment/environment.service'; // TODO: Check if this is still needed diff --git a/server/src/database/seeds/index.ts b/server/src/database/seeds/index.ts index 2e9c2d52a..d2a42cae3 100644 --- a/server/src/database/seeds/index.ts +++ b/server/src/database/seeds/index.ts @@ -1,4 +1,5 @@ import { PrismaClient } from '@prisma/client'; + import { seedCompanies } from './companies'; import { seedWorkspaces } from './workspaces'; import { seedPeople } from './people'; diff --git a/server/src/decorators/auth-user.decorator.ts b/server/src/decorators/auth-user.decorator.ts index f7fe3133a..b14e69523 100644 --- a/server/src/decorators/auth-user.decorator.ts +++ b/server/src/decorators/auth-user.decorator.ts @@ -1,4 +1,5 @@ import { ExecutionContext, createParamDecorator } from '@nestjs/common'; + import { getRequest } from 'src/utils/extract-request'; export const AuthUser = createParamDecorator( diff --git a/server/src/decorators/auth-workspace.decorator.ts b/server/src/decorators/auth-workspace.decorator.ts index 78e6e856a..f8fb2d35a 100644 --- a/server/src/decorators/auth-workspace.decorator.ts +++ b/server/src/decorators/auth-workspace.decorator.ts @@ -1,4 +1,5 @@ import { ExecutionContext, createParamDecorator } from '@nestjs/common'; + import { getRequest } from 'src/utils/extract-request'; export const AuthWorkspace = createParamDecorator( diff --git a/server/src/decorators/check-abilities.decorator.ts b/server/src/decorators/check-abilities.decorator.ts index fedd12f00..f50916d6c 100644 --- a/server/src/decorators/check-abilities.decorator.ts +++ b/server/src/decorators/check-abilities.decorator.ts @@ -1,4 +1,5 @@ import { SetMetadata } from '@nestjs/common'; + import { AbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; export const CHECK_ABILITIES_KEY = 'check_abilities'; diff --git a/server/src/decorators/prisma-select.decorator.ts b/server/src/decorators/prisma-select.decorator.ts index 69668ddcd..2efd8fbe7 100644 --- a/server/src/decorators/prisma-select.decorator.ts +++ b/server/src/decorators/prisma-select.decorator.ts @@ -1,6 +1,8 @@ import { createParamDecorator, ExecutionContext } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; + import merge from 'lodash.merge'; + import { PrismaSelect, ModelSelectMap, diff --git a/server/src/decorators/user-ability.decorator.ts b/server/src/decorators/user-ability.decorator.ts index 062484fd3..2a12d6c07 100644 --- a/server/src/decorators/user-ability.decorator.ts +++ b/server/src/decorators/user-ability.decorator.ts @@ -1,4 +1,5 @@ import { createParamDecorator, ExecutionContext } from '@nestjs/common'; + import { getRequest } from 'src/utils/extract-request'; export const UserAbility = createParamDecorator( diff --git a/server/src/filters/exception.filter.ts b/server/src/filters/exception.filter.ts index 71a7e7765..ad65aae27 100644 --- a/server/src/filters/exception.filter.ts +++ b/server/src/filters/exception.filter.ts @@ -1,5 +1,6 @@ import { Catch, HttpException } from '@nestjs/common'; import { GqlExceptionFilter } from '@nestjs/graphql'; + import { Prisma } from '@prisma/client'; import { GraphQLError } from 'graphql'; diff --git a/server/src/guards/ability.guard.ts b/server/src/guards/ability.guard.ts index e0536f171..44b0e26e8 100644 --- a/server/src/guards/ability.guard.ts +++ b/server/src/guards/ability.guard.ts @@ -5,10 +5,12 @@ import { UnauthorizedException, } from '@nestjs/common'; import { ModuleRef, Reflector } from '@nestjs/core'; + +import { AbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; + import { PassportUser } from 'src/core/auth/strategies/jwt.auth.strategy'; import { CHECK_ABILITIES_KEY } from 'src/decorators/check-abilities.decorator'; import { AbilityFactory, AppAbility } from 'src/ability/ability.factory'; -import { AbilityHandler } from 'src/ability/interfaces/ability-handler.interface'; import { assert } from 'src/utils/assert'; import { getRequest } from 'src/utils/extract-request'; diff --git a/server/src/guards/create-one-comment-thread.guard.ts b/server/src/guards/create-one-comment-thread.guard.ts index 081878ee3..1bbcc356e 100644 --- a/server/src/guards/create-one-comment-thread.guard.ts +++ b/server/src/guards/create-one-comment-thread.guard.ts @@ -6,6 +6,7 @@ import { Injectable, } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/guards/create-one-comment.guard.ts b/server/src/guards/create-one-comment.guard.ts index 7a020920c..c6f484b66 100644 --- a/server/src/guards/create-one-comment.guard.ts +++ b/server/src/guards/create-one-comment.guard.ts @@ -6,6 +6,7 @@ import { Injectable, } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/guards/create-one.guard.ts b/server/src/guards/create-one.guard.ts index 5be45e7a9..8acaab070 100644 --- a/server/src/guards/create-one.guard.ts +++ b/server/src/guards/create-one.guard.ts @@ -1,4 +1,5 @@ import { CanActivate, Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/guards/delete-many.guard.ts b/server/src/guards/delete-many.guard.ts index 8beeb3f7a..b0c65d1db 100644 --- a/server/src/guards/delete-many.guard.ts +++ b/server/src/guards/delete-many.guard.ts @@ -1,4 +1,5 @@ import { CanActivate, Injectable } from '@nestjs/common'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/guards/jwt.auth.guard.ts b/server/src/guards/jwt.auth.guard.ts index bb4a37836..66324d7ea 100644 --- a/server/src/guards/jwt.auth.guard.ts +++ b/server/src/guards/jwt.auth.guard.ts @@ -4,7 +4,9 @@ import { UnauthorizedException, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; + import { JsonWebTokenError } from 'jsonwebtoken'; + import { assert } from 'src/utils/assert'; import { getRequest } from 'src/utils/extract-request'; diff --git a/server/src/guards/optional-jwt.auth.guard.ts b/server/src/guards/optional-jwt.auth.guard.ts index 67695bbc2..52df71d81 100644 --- a/server/src/guards/optional-jwt.auth.guard.ts +++ b/server/src/guards/optional-jwt.auth.guard.ts @@ -1,5 +1,6 @@ import { ExecutionContext, Injectable } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; + import { getRequest } from 'src/utils/extract-request'; @Injectable() diff --git a/server/src/guards/update-one.guard.ts b/server/src/guards/update-one.guard.ts index c0e284162..5439f59c5 100644 --- a/server/src/guards/update-one.guard.ts +++ b/server/src/guards/update-one.guard.ts @@ -6,6 +6,7 @@ import { Injectable, } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/health/health.controller.spec.ts b/server/src/health/health.controller.spec.ts index 41960b8f1..b94903842 100644 --- a/server/src/health/health.controller.spec.ts +++ b/server/src/health/health.controller.spec.ts @@ -1,5 +1,6 @@ import { HealthCheckService, HttpHealthIndicator } from '@nestjs/terminus'; import { Test, TestingModule } from '@nestjs/testing'; + import { HealthController } from 'src/health/health.controller'; import { PrismaHealthIndicator } from 'src/health/indicators/prisma-health-indicator'; diff --git a/server/src/health/health.controller.ts b/server/src/health/health.controller.ts index eb58301a3..76f412d49 100644 --- a/server/src/health/health.controller.ts +++ b/server/src/health/health.controller.ts @@ -1,5 +1,6 @@ import { Controller, Get } from '@nestjs/common'; import { HealthCheck, HealthCheckService } from '@nestjs/terminus'; + import { PrismaHealthIndicator } from 'src/health/indicators/prisma-health-indicator'; @Controller('healthz') diff --git a/server/src/health/health.module.ts b/server/src/health/health.module.ts index f9f09b58e..0aa227582 100644 --- a/server/src/health/health.module.ts +++ b/server/src/health/health.module.ts @@ -1,5 +1,6 @@ import { Module } from '@nestjs/common'; import { TerminusModule } from '@nestjs/terminus'; + import { HealthController } from 'src/health/health.controller'; import { PrismaHealthIndicator } from 'src/health/indicators/prisma-health-indicator'; diff --git a/server/src/health/indicators/prisma-health-indicator.ts b/server/src/health/indicators/prisma-health-indicator.ts index 976c479a1..212e11ec1 100644 --- a/server/src/health/indicators/prisma-health-indicator.ts +++ b/server/src/health/indicators/prisma-health-indicator.ts @@ -4,6 +4,7 @@ import { HealthIndicator, HealthIndicatorResult, } from '@nestjs/terminus'; + import { PrismaService } from 'src/database/prisma.service'; @Injectable() diff --git a/server/src/integrations/environment/environment.module.ts b/server/src/integrations/environment/environment.module.ts index 7d901ab1f..b116f17ff 100644 --- a/server/src/integrations/environment/environment.module.ts +++ b/server/src/integrations/environment/environment.module.ts @@ -1,7 +1,8 @@ import { Global, Module } from '@nestjs/common'; +import { ConfigModule } from '@nestjs/config'; + import { EnvironmentService } from './environment.service'; import { ConfigurableModuleClass } from './environment.module-definition'; -import { ConfigModule } from '@nestjs/config'; import { validate } from './environment.validation'; @Global() diff --git a/server/src/integrations/environment/environment.service.spec.ts b/server/src/integrations/environment/environment.service.spec.ts index 7184e5fa4..9b8c73742 100644 --- a/server/src/integrations/environment/environment.service.spec.ts +++ b/server/src/integrations/environment/environment.service.spec.ts @@ -1,7 +1,8 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { EnvironmentService } from './environment.service'; import { ConfigService } from '@nestjs/config'; +import { EnvironmentService } from './environment.service'; + describe('EnvironmentService', () => { let service: EnvironmentService; diff --git a/server/src/integrations/environment/environment.service.ts b/server/src/integrations/environment/environment.service.ts index 84a72e1ba..8f5ab247f 100644 --- a/server/src/integrations/environment/environment.service.ts +++ b/server/src/integrations/environment/environment.service.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; + import { AwsRegion } from './interfaces/aws-region.interface'; import { StorageType } from './interfaces/storage.interface'; diff --git a/server/src/integrations/environment/environment.validation.ts b/server/src/integrations/environment/environment.validation.ts index a461533d6..a2d847d8c 100644 --- a/server/src/integrations/environment/environment.validation.ts +++ b/server/src/integrations/environment/environment.validation.ts @@ -8,7 +8,9 @@ import { validateSync, IsBoolean, } from 'class-validator'; + import { assert } from 'src/utils/assert'; + import { IsDuration } from './decorators/is-duration.decorator'; import { StorageType } from './interfaces/storage.interface'; import { AwsRegion } from './interfaces/aws-region.interface'; diff --git a/server/src/integrations/file-storage/drivers/local.driver.ts b/server/src/integrations/file-storage/drivers/local.driver.ts index f12f5fe11..0f28eadd4 100644 --- a/server/src/integrations/file-storage/drivers/local.driver.ts +++ b/server/src/integrations/file-storage/drivers/local.driver.ts @@ -1,9 +1,10 @@ import * as fs from 'fs/promises'; import { createReadStream, existsSync } from 'fs'; import { join, dirname } from 'path'; -import { StorageDriver } from './interfaces/storage-driver.interface'; import { Readable } from 'stream'; +import { StorageDriver } from './interfaces/storage-driver.interface'; + export interface LocalDriverOptions { storagePath: string; } diff --git a/server/src/integrations/file-storage/drivers/s3.driver.ts b/server/src/integrations/file-storage/drivers/s3.driver.ts index d182aab06..d2eaa929d 100644 --- a/server/src/integrations/file-storage/drivers/s3.driver.ts +++ b/server/src/integrations/file-storage/drivers/s3.driver.ts @@ -1,3 +1,5 @@ +import { Readable } from 'stream'; + import { CreateBucketCommandInput, GetObjectCommand, @@ -7,8 +9,8 @@ import { S3, S3ClientConfig, } from '@aws-sdk/client-s3'; + import { StorageDriver } from './interfaces/storage-driver.interface'; -import { Readable } from 'stream'; export interface S3DriverOptions extends S3ClientConfig { bucketName: string; diff --git a/server/src/integrations/file-storage/file-storage.module-definition.ts b/server/src/integrations/file-storage/file-storage.module-definition.ts index e3b6bc298..2b81d2cdb 100644 --- a/server/src/integrations/file-storage/file-storage.module-definition.ts +++ b/server/src/integrations/file-storage/file-storage.module-definition.ts @@ -1,4 +1,5 @@ import { ConfigurableModuleBuilder } from '@nestjs/common'; + import { FileStorageModuleOptions } from './interfaces'; export const { diff --git a/server/src/integrations/file-storage/file-storage.module.ts b/server/src/integrations/file-storage/file-storage.module.ts index c6e1b75dc..f6ed5c731 100644 --- a/server/src/integrations/file-storage/file-storage.module.ts +++ b/server/src/integrations/file-storage/file-storage.module.ts @@ -1,13 +1,15 @@ import { DynamicModule, Global } from '@nestjs/common'; + import { FileStorageService } from './file-storage.service'; -import { LocalDriver } from './drivers/local.driver'; -import { S3Driver } from './drivers/s3.driver'; import { FileStorageModuleAsyncOptions, FileStorageModuleOptions, } from './interfaces'; import { STORAGE_DRIVER } from './file-storage.constants'; +import { LocalDriver } from './drivers/local.driver'; +import { S3Driver } from './drivers/s3.driver'; + @Global() export class FileStorageModule { static forRoot(options: FileStorageModuleOptions): DynamicModule { diff --git a/server/src/integrations/file-storage/file-storage.service.spec.ts b/server/src/integrations/file-storage/file-storage.service.spec.ts index 26af91020..cc30e564b 100644 --- a/server/src/integrations/file-storage/file-storage.service.spec.ts +++ b/server/src/integrations/file-storage/file-storage.service.spec.ts @@ -1,4 +1,5 @@ import { Test, TestingModule } from '@nestjs/testing'; + import { FileStorageService } from './file-storage.service'; import { STORAGE_DRIVER } from './file-storage.constants'; diff --git a/server/src/integrations/file-storage/file-storage.service.ts b/server/src/integrations/file-storage/file-storage.service.ts index c55d8f5f5..9e4a93e88 100644 --- a/server/src/integrations/file-storage/file-storage.service.ts +++ b/server/src/integrations/file-storage/file-storage.service.ts @@ -1,8 +1,11 @@ import { Inject, Injectable } from '@nestjs/common'; -import { STORAGE_DRIVER } from './file-storage.constants'; -import { StorageDriver } from './drivers/interfaces/storage-driver.interface'; + import { Readable } from 'stream'; +import { STORAGE_DRIVER } from './file-storage.constants'; + +import { StorageDriver } from './drivers/interfaces/storage-driver.interface'; + @Injectable() export class FileStorageService implements StorageDriver { constructor(@Inject(STORAGE_DRIVER) private driver: StorageDriver) {} diff --git a/server/src/integrations/file-storage/interfaces/file-storage.interface.ts b/server/src/integrations/file-storage/interfaces/file-storage.interface.ts index bfc1070c2..d02869db5 100644 --- a/server/src/integrations/file-storage/interfaces/file-storage.interface.ts +++ b/server/src/integrations/file-storage/interfaces/file-storage.interface.ts @@ -1,8 +1,10 @@ -import { StorageType } from 'src/integrations/environment/interfaces/storage.interface'; -import { S3DriverOptions } from '../drivers/s3.driver'; -import { LocalDriverOptions } from '../drivers/local.driver'; import { FactoryProvider, ModuleMetadata } from '@nestjs/common'; +import { StorageType } from 'src/integrations/environment/interfaces/storage.interface'; + +import { S3DriverOptions } from 'src/integrations/file-storage/drivers/s3.driver'; +import { LocalDriverOptions } from 'src/integrations/file-storage/drivers/local.driver'; + export interface S3DriverFactoryOptions { type: StorageType.S3; options: S3DriverOptions; diff --git a/server/src/integrations/integrations.module.ts b/server/src/integrations/integrations.module.ts index d6b260435..4e0750a16 100644 --- a/server/src/integrations/integrations.module.ts +++ b/server/src/integrations/integrations.module.ts @@ -1,5 +1,7 @@ import { Module } from '@nestjs/common'; + import { fromNodeProviderChain } from '@aws-sdk/credential-providers'; + import { EnvironmentModule } from './environment/environment.module'; import { EnvironmentService } from './environment/environment.service'; import { FileStorageModule } from './file-storage/file-storage.module'; diff --git a/server/src/main.ts b/server/src/main.ts index 2d29fc8b4..950726a62 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -1,8 +1,10 @@ import { NestFactory } from '@nestjs/core'; import { ValidationPipe } from '@nestjs/common'; -import { AppModule } from './app.module'; + import { graphqlUploadExpress } from 'graphql-upload'; +import { AppModule } from './app.module'; + async function bootstrap() { const app = await NestFactory.create(AppModule, { cors: true, diff --git a/server/src/utils/prisma-select/index.ts b/server/src/utils/prisma-select/index.ts index abc89638c..525c5168a 100644 --- a/server/src/utils/prisma-select/index.ts +++ b/server/src/utils/prisma-select/index.ts @@ -1,6 +1,7 @@ import { PrismaSelect as PalJSPrismaSelect } from '@paljs/plugins'; import { DMMF } from '@prisma/client/runtime'; import { GraphQLResolveInfo } from 'graphql'; + import { ModelSelectMap } from './model-select-map'; export type DefaultFieldsMap = { diff --git a/server/yarn.lock b/server/yarn.lock index a6c2295f9..dd37afddb 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -2816,6 +2816,11 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + "@types/jsonwebtoken@*": version "9.0.2" resolved "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz" @@ -3614,16 +3619,67 @@ argparse@^2.0.1: resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== +array-includes@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + is-string "^1.0.7" + array-union@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +array.prototype.flat@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" + integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + asap@^2.0.0: version "2.0.6" resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" @@ -3651,6 +3707,11 @@ asynckit@^0.4.0: resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + await-event-emitter@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/await-event-emitter/-/await-event-emitter-2.0.2.tgz" @@ -3912,7 +3973,7 @@ bytes@3.1.2: resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -call-bind@^1.0.0: +call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== @@ -4333,6 +4394,13 @@ debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: dependencies: ms "2.1.2" +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + decompress-response@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" @@ -4367,6 +4435,14 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + del@^6.0.0: version "6.1.1" resolved "https://registry.npmjs.org/del/-/del-6.1.1.tgz" @@ -4448,6 +4524,13 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" @@ -4529,11 +4612,81 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.19.0, es-abstract@^1.20.4: + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.1" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.10" + es-module-lexer@^1.2.1: version "1.3.0" resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz" integrity sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" @@ -4569,6 +4722,43 @@ eslint-config-prettier@^8.3.0: resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz" integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== +eslint-import-resolver-node@^0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7" + integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA== + dependencies: + debug "^3.2.7" + is-core-module "^2.11.0" + resolve "^1.22.1" + +eslint-module-utils@^2.7.4: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" + integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.27.5: + version "2.27.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" + integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== + dependencies: + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.7.4" + has "^1.0.3" + is-core-module "^2.11.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.values "^1.1.6" + resolve "^1.22.1" + semver "^6.3.0" + tsconfig-paths "^3.14.1" + eslint-plugin-prettier@^4.0.0: version "4.2.1" resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz" @@ -4955,6 +5145,13 @@ follow-redirects@^1.15.0: resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + fork-ts-checker-webpack-plugin@8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-8.0.0.tgz" @@ -5083,6 +5280,21 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2, functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + gauge@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" @@ -5108,7 +5320,7 @@ get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== @@ -5140,6 +5352,14 @@ get-stream@^6.0.0: resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + github-from-package@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" @@ -5216,6 +5436,13 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@11.1.0, globby@^11.0.1, globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" @@ -5228,6 +5455,13 @@ globby@11.1.0, globby@^11.0.1, globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" @@ -5288,6 +5522,11 @@ graphql@^16.6.0: resolved "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz" integrity sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw== +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" @@ -5298,16 +5537,30 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + has-proto@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== -has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -5514,6 +5767,15 @@ inquirer@8.2.5: through "^2.3.6" wrap-ansi "^7.0.0" +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== + dependencies: + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" + interpret@^1.0.0: version "1.4.0" resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" @@ -5524,6 +5786,15 @@ ipaddr.js@1.9.1: resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" @@ -5534,6 +5805,13 @@ is-arrayish@^0.3.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" @@ -5541,6 +5819,19 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + is-core-module@^2.11.0: version "2.12.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz" @@ -5548,6 +5839,13 @@ is-core-module@^2.11.0: dependencies: has "^1.0.3" +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + is-docker@^2.0.0: version "2.2.1" resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz" @@ -5580,6 +5878,18 @@ is-interactive@^1.0.0: resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" @@ -5600,16 +5910,59 @@ is-promise@^4.0.0: resolved "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz" integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10, is-typed-array@^1.1.9: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + is-windows@1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" @@ -5622,6 +5975,11 @@ is-wsl@2.2.0, is-wsl@^2.1.1: dependencies: is-docker "^2.0.0" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" @@ -6103,6 +6461,13 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + json5@^2.2.1, json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" @@ -6681,16 +7046,40 @@ object-assign@^4, object-assign@^4.1.1: resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.9.0: +object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + object-path@^0.11.8: version "0.11.8" resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.8.tgz#ed002c02bbdd0070b78a27455e8ae01fc14d4742" integrity sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA== +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.values@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" + integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + on-finished@2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" @@ -7250,6 +7639,15 @@ regenerator-runtime@^0.13.11: resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== +regexp.prototype.flags@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" + integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + functions-have-names "^1.2.3" + replace-string@3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/replace-string/-/replace-string-3.1.0.tgz" @@ -7287,7 +7685,7 @@ resolve.exports@^1.1.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz" integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== -resolve@1.22.2, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0: +resolve@1.22.2, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.1: version "1.22.2" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== @@ -7347,6 +7745,16 @@ rxjs@7.8.1, rxjs@^7.2.0, rxjs@^7.5.5: dependencies: tslib "^2.1.0" +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" @@ -7357,6 +7765,15 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" @@ -7639,6 +8056,33 @@ string-width@4.2.3, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, s is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -8042,6 +8486,16 @@ tsconfig-paths@4.2.0, tsconfig-paths@^4.1.2: minimist "^1.2.6" strip-bom "^3.0.0" +tsconfig-paths@^3.14.1: + version "3.14.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@2.5.2: version "2.5.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz" @@ -8126,6 +8580,45 @@ type-is@^1.6.4, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" @@ -8148,6 +8641,16 @@ uid@2.0.2: dependencies: "@lukeed/csprng" "^1.0.0" +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + unique-string@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz" @@ -8327,6 +8830,28 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz"