fix: standardize GraphQL schema UUID field types (#13550)
Closes [#1264](https://github.com/twentyhq/core-team-issues/issues/1264)
This commit is contained in:
+2
-1
@@ -1,11 +1,12 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AdminPanelWorkerQueueHealth } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto';
|
||||
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
|
||||
|
||||
@ObjectType()
|
||||
export class AdminPanelHealthServiceData {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
|
||||
|
||||
@ObjectType()
|
||||
export class AdminPanelWorkerQueueHealth {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
+7
-5
@@ -1,16 +1,18 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ArgsType()
|
||||
export class ImpersonateInput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
userId: string;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { QueueMetricsDataPoint } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto';
|
||||
|
||||
@ObjectType()
|
||||
export class QueueMetricsSeries {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => [QueueMetricsDataPoint])
|
||||
|
||||
+4
-3
@@ -1,14 +1,15 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsBoolean, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsBoolean, IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
|
||||
@ArgsType()
|
||||
export class UpdateWorkspaceFeatureFlagInput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
workspaceId: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
+3
-2
@@ -1,10 +1,11 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
|
||||
@ObjectType()
|
||||
class UserInfo {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
@@ -19,7 +20,7 @@ class UserInfo {
|
||||
|
||||
@ObjectType()
|
||||
class WorkspaceInfo {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
@@ -36,7 +36,7 @@ export class ApiKey {
|
||||
@Column({ type: 'timestamptz', nullable: true })
|
||||
revokedAt?: Date | null;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@Column('uuid')
|
||||
workspaceId: string;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
Resolver,
|
||||
} from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import {
|
||||
ApiKeyException,
|
||||
ApiKeyExceptionCode,
|
||||
@@ -108,8 +109,8 @@ export class ApiKeyResolver {
|
||||
@Mutation(() => Boolean)
|
||||
async assignRoleToApiKey(
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
@Args('apiKeyId') apiKeyId: string,
|
||||
@Args('roleId') roleId: string,
|
||||
@Args('apiKeyId', { type: () => UUIDScalarType }) apiKeyId: string,
|
||||
@Args('roleId', { type: () => UUIDScalarType }) roleId: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
await this.apiKeyRoleService.assignRoleToApiKey({
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
IsUUID,
|
||||
} from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class CreateApiKeyDTO {
|
||||
@Field()
|
||||
@@ -24,7 +26,7 @@ export class CreateApiKeyDTO {
|
||||
@IsDateString()
|
||||
revokedAt?: string;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsUUID()
|
||||
roleId: string;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class GetApiKeyDTO {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class RevokeApiKeyDTO {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,16 @@ import {
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
} from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class UpdateApiKeyDTO {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
|
||||
+5
-3
@@ -1,10 +1,12 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsString } from 'class-validator';
|
||||
import { IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class DeleteApprovedAccessDomainInput {
|
||||
@Field()
|
||||
@IsString()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsUUID()
|
||||
id: string;
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,6 +1,8 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsString, IsNotEmpty } from 'class-validator';
|
||||
import { IsNotEmpty, IsString, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class ValidateApprovedAccessDomainInput {
|
||||
@@ -9,8 +11,8 @@ export class ValidateApprovedAccessDomainInput {
|
||||
@IsNotEmpty()
|
||||
validationToken: string;
|
||||
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsUUID()
|
||||
@IsNotEmpty()
|
||||
approvedAccessDomainId: string;
|
||||
}
|
||||
|
||||
+12
-5
@@ -1,8 +1,15 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsObject, IsOptional, IsString } from 'class-validator';
|
||||
import {
|
||||
IsNotEmpty,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
} from 'class-validator';
|
||||
import GraphQLJSON from 'graphql-type-json';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { TrackEventName } from 'src/engine/core-modules/audit/types/events.type';
|
||||
|
||||
@ArgsType()
|
||||
@@ -12,14 +19,14 @@ export class CreateObjectEventInput {
|
||||
@IsString()
|
||||
event: TrackEventName;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
recordId: string;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
objectMetadataId: string;
|
||||
|
||||
@Field(() => GraphQLJSON, { nullable: true })
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ArgsType()
|
||||
export class ApiKeyTokenInput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
apiKeyId: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||
import {
|
||||
IdentityProviderType,
|
||||
@@ -14,7 +15,7 @@ class SSOConnection {
|
||||
@Field(() => IdentityProviderType)
|
||||
type: SSOConfiguration['type'];
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
@@ -29,7 +30,7 @@ class SSOConnection {
|
||||
|
||||
@ObjectType()
|
||||
export class AvailableWorkspace {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
|
||||
+5
-3
@@ -1,6 +1,8 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsEmail, IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ArgsType()
|
||||
export class EmailPasswordResetLinkInput {
|
||||
@@ -9,8 +11,8 @@ export class EmailPasswordResetLinkInput {
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
+5
-3
@@ -2,12 +2,14 @@
|
||||
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
import { IsOptional, IsString, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class GetAuthorizationUrlForSSOInput {
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsUUID()
|
||||
identityProviderId: string;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||
|
||||
@ObjectType()
|
||||
@@ -12,6 +13,6 @@ export class GetAuthorizationUrlForSSOOutput {
|
||||
@Field(() => String)
|
||||
type: SSOConfiguration['type'];
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import {
|
||||
IsEmail,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
} from 'class-validator';
|
||||
import { APP_LOCALES } from 'twenty-shared/translations';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ArgsType()
|
||||
export class SignUpInput {
|
||||
@Field(() => String)
|
||||
@@ -15,8 +23,8 @@ export class SignUpInput {
|
||||
@IsString()
|
||||
password: string;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
@IsString()
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
@IsUUID()
|
||||
@IsOptional()
|
||||
workspaceId?: string;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType()
|
||||
export class AuthToken {
|
||||
@Field(() => String)
|
||||
@@ -38,7 +40,7 @@ export class PasswordResetToken {
|
||||
@Field(() => Date)
|
||||
passwordResetTokenExpiresAt: Date;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType()
|
||||
export class ValidatePasswordResetToken {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export class BillingEntitlement {
|
||||
@Column({ nullable: false, type: 'text' })
|
||||
key: BillingEntitlementKey;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@Column({ nullable: false, type: 'uuid' })
|
||||
workspaceId: string;
|
||||
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType()
|
||||
class CustomDomainRecord {
|
||||
@Field(() => String)
|
||||
@@ -20,7 +22,7 @@ class CustomDomainRecord {
|
||||
|
||||
@ObjectType()
|
||||
export class CustomDomainValidRecords {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
@@ -28,7 +28,7 @@ export class FeatureFlag {
|
||||
@Column({ nullable: false, type: 'text' })
|
||||
key: FeatureFlagKey;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@Column({ nullable: false, type: 'uuid' })
|
||||
workspaceId: string;
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('File')
|
||||
export class FileDTO {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field()
|
||||
@@ -17,7 +19,7 @@ export class FileDTO {
|
||||
@Field()
|
||||
type: string;
|
||||
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
messageId?: string;
|
||||
|
||||
@Field()
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Args, Mutation, Resolver } from '@nestjs/graphql';
|
||||
|
||||
import { FileUpload, GraphQLUpload } from 'graphql-upload';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { FileDTO } from 'src/engine/core-modules/file/dtos/file.dto';
|
||||
import { FileMetadataService } from 'src/engine/core-modules/file/services/file-metadata.service';
|
||||
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
|
||||
@@ -39,7 +40,7 @@ export class FileResolver {
|
||||
@Mutation(() => FileDTO)
|
||||
async deleteFile(
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
@Args('fileId') fileId: string,
|
||||
@Args('fileId', { type: () => UUIDScalarType }) fileId: string,
|
||||
): Promise<FileDTO> {
|
||||
const deletedFile = await this.fileMetadataService.deleteFileById(
|
||||
fileId,
|
||||
|
||||
+3
-2
@@ -2,11 +2,12 @@ import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { ConnectedAccountProvider } from 'twenty-shared/types';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { ImapSmtpCaldavConnectionParameters } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto';
|
||||
|
||||
@ObjectType()
|
||||
export class ConnectedImapSmtpCaldavAccount {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
@@ -15,7 +16,7 @@ export class ConnectedImapSmtpCaldavAccount {
|
||||
@Field(() => String)
|
||||
provider: ConnectedAccountProvider;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
accountOwnerId: string;
|
||||
|
||||
@Field(() => ImapSmtpCaldavConnectionParameters, { nullable: true })
|
||||
|
||||
+5
-3
@@ -9,6 +9,7 @@ import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
|
||||
|
||||
import { ConnectedAccountProvider } from 'twenty-shared/types';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AuthGraphqlApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-graphql-api-exception.filter';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
@@ -45,7 +46,7 @@ export class ImapSmtpCaldavResolver {
|
||||
@Query(() => ConnectedImapSmtpCaldavAccount)
|
||||
@UseGuards(WorkspaceAuthGuard)
|
||||
async getConnectedImapSmtpCaldavAccount(
|
||||
@Args('id') id: string,
|
||||
@Args('id', { type: () => UUIDScalarType }) id: string,
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
): Promise<ConnectedImapSmtpCaldavAccount> {
|
||||
const connectedAccountRepository =
|
||||
@@ -76,12 +77,13 @@ export class ImapSmtpCaldavResolver {
|
||||
@Mutation(() => ImapSmtpCaldavConnectionSuccess)
|
||||
@UseGuards(WorkspaceAuthGuard)
|
||||
async saveImapSmtpCaldavAccount(
|
||||
@Args('accountOwnerId') accountOwnerId: string,
|
||||
@Args('accountOwnerId', { type: () => UUIDScalarType })
|
||||
accountOwnerId: string,
|
||||
@Args('handle') handle: string,
|
||||
@Args('connectionParameters')
|
||||
connectionParameters: EmailAccountConnectionParameters,
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
@Args('id', { nullable: true }) id?: string,
|
||||
@Args('id', { type: () => UUIDScalarType, nullable: true }) id?: string,
|
||||
): Promise<ImapSmtpCaldavConnectionSuccess> {
|
||||
const isImapSmtpCaldavFeatureFlagEnabled =
|
||||
await this.featureFlagService.isFeatureEnabled(
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
|
||||
@@ -15,6 +15,6 @@ export class PostgresCredentialsDTO {
|
||||
@Field()
|
||||
password: string;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
workspaceId: string;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsNumber, IsString, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('SearchRecord')
|
||||
export class SearchRecordDTO {
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsUUID()
|
||||
@IsNotEmpty()
|
||||
recordId: string;
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsUUID } from 'class-validator';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class DeleteSsoInput {
|
||||
@Field(() => String)
|
||||
@IsUUID()
|
||||
@Field(() => UUIDScalarType)
|
||||
identityProviderId: string;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType()
|
||||
export class DeleteSsoOutput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
identityProviderId: string;
|
||||
}
|
||||
|
||||
@@ -4,12 +4,13 @@ import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsString, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||
import { SSOIdentityProviderStatus } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
|
||||
@InputType()
|
||||
export class EditSsoInput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsUUID()
|
||||
id: string;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||
import {
|
||||
IdentityProviderType,
|
||||
@@ -10,7 +11,7 @@ import {
|
||||
|
||||
@ObjectType()
|
||||
export class EditSsoOutput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => IdentityProviderType)
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||
import {
|
||||
IdentityProviderType,
|
||||
@@ -13,7 +14,7 @@ class WorkspaceNameAndId {
|
||||
@Field(() => String, { nullable: true })
|
||||
displayName?: string | null;
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ export class FindAvailableSSOIDPOutput {
|
||||
@Field(() => IdentityProviderType)
|
||||
type: SSOConfiguration['type'];
|
||||
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsOptional, IsString, IsUrl, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { IsX509Certificate } from 'src/engine/core-modules/sso/dtos/validators/x509.validator';
|
||||
|
||||
@InputType()
|
||||
@@ -31,7 +32,7 @@ export class SetupOIDCSsoInput extends SetupSsoInputCommon {
|
||||
|
||||
@InputType()
|
||||
export class SetupSAMLSsoInput extends SetupSsoInputCommon {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsUUID()
|
||||
id: string;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||
import {
|
||||
IdentityProviderType,
|
||||
@@ -10,7 +11,7 @@ import {
|
||||
|
||||
@ObjectType()
|
||||
export class SetupSsoOutput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => IdentityProviderType)
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ export class UserWorkspace {
|
||||
@JoinColumn({ name: 'userId' })
|
||||
user: Relation<User>;
|
||||
|
||||
@Field({ nullable: false })
|
||||
@Field(() => UUIDScalarType, { nullable: false })
|
||||
@Column()
|
||||
userId: string;
|
||||
|
||||
@@ -65,7 +65,7 @@ export class UserWorkspace {
|
||||
@JoinColumn({ name: 'workspaceId' })
|
||||
workspace: Relation<Workspace>;
|
||||
|
||||
@Field({ nullable: false })
|
||||
@Field(() => UUIDScalarType, { nullable: false })
|
||||
@Column()
|
||||
workspaceId: string;
|
||||
|
||||
|
||||
+1
-1
@@ -19,6 +19,6 @@ export class DeletedWorkspaceMember {
|
||||
@Field(() => String, { nullable: true })
|
||||
avatarUrl: string | null;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
userWorkspaceId: string | null;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,6 @@ export class WorkspaceMember {
|
||||
@Field(() => [RoleDTO], { nullable: true })
|
||||
roles?: RoleDTO[];
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
userWorkspaceId?: string;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class DeleteWebhookDTO {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class GetWebhookDTO {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class UpdateWebhookDTO {
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@IsUUID()
|
||||
id: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
|
||||
@@ -41,7 +41,7 @@ export class Webhook {
|
||||
@Column()
|
||||
secret: string;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
@Column('uuid')
|
||||
workspaceId: string;
|
||||
|
||||
|
||||
+4
-2
@@ -1,14 +1,16 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class CreateDraftFromWorkflowVersionInput {
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow ID',
|
||||
nullable: false,
|
||||
})
|
||||
workflowId: string;
|
||||
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow version ID',
|
||||
nullable: false,
|
||||
})
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { WorkflowActionType } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
|
||||
|
||||
@InputType()
|
||||
export class CreateWorkflowVersionStepInput {
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow version ID',
|
||||
nullable: false,
|
||||
})
|
||||
@@ -16,13 +17,13 @@ export class CreateWorkflowVersionStepInput {
|
||||
})
|
||||
stepType: WorkflowActionType;
|
||||
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Parent step ID',
|
||||
nullable: true,
|
||||
})
|
||||
parentStepId?: string;
|
||||
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Next step ID',
|
||||
nullable: true,
|
||||
})
|
||||
|
||||
+4
-2
@@ -1,14 +1,16 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class DeleteWorkflowVersionStepInput {
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow version ID',
|
||||
nullable: false,
|
||||
})
|
||||
workflowVersionId: string;
|
||||
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Step to delete ID',
|
||||
nullable: false,
|
||||
})
|
||||
|
||||
+4
-2
@@ -2,15 +2,17 @@ import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import graphqlTypeJson from 'graphql-type-json';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class RunWorkflowVersionInput {
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow version ID',
|
||||
nullable: false,
|
||||
})
|
||||
workflowVersionId: string;
|
||||
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow run ID',
|
||||
nullable: true,
|
||||
})
|
||||
|
||||
+5
-3
@@ -2,15 +2,17 @@ import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import graphqlTypeJson from 'graphql-type-json';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class SubmitFormStepInput {
|
||||
@Field(() => String, {
|
||||
description: 'Workflow version ID',
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow step ID',
|
||||
nullable: false,
|
||||
})
|
||||
stepId: string;
|
||||
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow run ID',
|
||||
nullable: false,
|
||||
})
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import graphqlTypeJson from 'graphql-type-json';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { WorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
|
||||
|
||||
@InputType()
|
||||
export class UpdateWorkflowRunStepInput {
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow run ID',
|
||||
nullable: false,
|
||||
})
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ import { Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
import graphqlTypeJson from 'graphql-type-json';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { WorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
|
||||
|
||||
@InputType()
|
||||
export class UpdateWorkflowVersionStepInput {
|
||||
@Field(() => String, {
|
||||
@Field(() => UUIDScalarType, {
|
||||
description: 'Workflow version ID',
|
||||
nullable: false,
|
||||
})
|
||||
|
||||
+5
-2
@@ -1,6 +1,7 @@
|
||||
import { UseFilters, UseGuards, UsePipes } from '@nestjs/common';
|
||||
import { Args, Mutation, Resolver } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { buildCreatedByFromFullNameMetadata } from 'src/engine/core-modules/actor/utils/build-created-by-from-full-name-metadata.util';
|
||||
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
|
||||
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
|
||||
@@ -40,7 +41,8 @@ export class WorkflowTriggerResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
async activateWorkflowVersion(
|
||||
@Args('workflowVersionId') workflowVersionId: string,
|
||||
@Args('workflowVersionId', { type: () => UUIDScalarType })
|
||||
workflowVersionId: string,
|
||||
) {
|
||||
return await this.workflowTriggerWorkspaceService.activateWorkflowVersion(
|
||||
workflowVersionId,
|
||||
@@ -49,7 +51,8 @@ export class WorkflowTriggerResolver {
|
||||
|
||||
@Mutation(() => Boolean)
|
||||
async deactivateWorkflowVersion(
|
||||
@Args('workflowVersionId') workflowVersionId: string,
|
||||
@Args('workflowVersionId', { type: () => UUIDScalarType })
|
||||
workflowVersionId: string,
|
||||
) {
|
||||
return await this.workflowTriggerWorkspaceService.deactivateWorkflowVersion(
|
||||
workflowVersionId,
|
||||
|
||||
+5
-4
@@ -1,15 +1,16 @@
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import {
|
||||
IdentityProviderType,
|
||||
SSOIdentityProviderStatus,
|
||||
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@ObjectType()
|
||||
export class SSOIdentityProvider {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => String)
|
||||
@@ -45,7 +46,7 @@ export class AuthProviders {
|
||||
|
||||
@ObjectType()
|
||||
export class PublicWorkspaceDataOutput {
|
||||
@Field(() => String)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => AuthProviders)
|
||||
|
||||
+3
-1
@@ -9,6 +9,8 @@ import {
|
||||
Matches,
|
||||
} from 'class-validator';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@InputType()
|
||||
export class UpdateWorkspaceInput {
|
||||
@Field({ nullable: true })
|
||||
@@ -186,7 +188,7 @@ export class UpdateWorkspaceInput {
|
||||
@IsOptional()
|
||||
isPasswordAuthEnabled?: boolean;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
@IsUUID()
|
||||
@IsOptional()
|
||||
defaultRoleId?: string;
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
|
||||
|
||||
@ObjectType()
|
||||
@@ -7,6 +8,6 @@ export class WorkspaceUrlsAndId {
|
||||
@Field(() => WorkspaceUrls)
|
||||
workspaceUrls: WorkspaceUrls;
|
||||
|
||||
@Field()
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user