mirror of
https://github.com/lingble/twenty.git
synced 2025-10-29 20:02:29 +00:00
feat: server lint import & order (#750)
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -37,5 +37,6 @@
|
||||
],
|
||||
"cSpell.words": [
|
||||
"twentyhq"
|
||||
]
|
||||
],
|
||||
"typescript.preferences.importModuleSpecifier": "project-relative"
|
||||
}
|
||||
@@ -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/**'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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<{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FileFolder } from 'src/core/file/interfaces/file-folder.interface';
|
||||
|
||||
import { ShortCropSize } from 'src/utils/image';
|
||||
|
||||
type ValueOfFileFolder = `${FileFolder}`;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { AnalyticsService } from './analytics.service';
|
||||
import { AnalyticsResolver } from './analytics.resolver';
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import GraphQLJSON from 'graphql-type-json';
|
||||
import { IsNotEmpty, IsString, IsObject } from 'class-validator';
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { AttachmentType } from '@prisma/client';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
@ArgsType()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { AuthToken } from './token.entity';
|
||||
|
||||
@ObjectType()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
@ArgsType()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
@ArgsType()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
@ArgsType()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
@ArgsType()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString, MinLength } from 'class-validator';
|
||||
|
||||
@ArgsType()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 & {
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { ClientConfigResolver } from './client-config.resolver';
|
||||
|
||||
@Module({
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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<keyof typeof FileFolder>;
|
||||
|
||||
export function checkFilePath(filePath: string): string {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { FileStorageService } from 'src/integrations/file-storage/file-storage.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user