From 08de8f8b9eb884eef3be558386ff7e1fe5f99276 Mon Sep 17 00:00:00 2001 From: Devessier Date: Tue, 3 Sep 2024 16:09:02 +0200 Subject: [PATCH] refactor: try to generate types for WorkflowStatus and WorkflowVersionStatus --- .../twenty-front/src/generated/graphql.tsx | 29 ++++++++++--------- .../workflow-version.workspace-entity.ts | 4 +++ .../workflow.workspace-entity.ts | 4 +++ 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/packages/twenty-front/src/generated/graphql.tsx b/packages/twenty-front/src/generated/graphql.tsx index 4fd5f53ec6aeb..1209de9720279 100644 --- a/packages/twenty-front/src/generated/graphql.tsx +++ b/packages/twenty-front/src/generated/graphql.tsx @@ -219,7 +219,7 @@ export type ExecuteServerlessFunctionInput = { /** Id of the serverless function to execute */ id: Scalars['UUID']; /** Payload in JSON format */ - payload?: InputMaybe; + payload: Scalars['JSON']; /** Version of the serverless function to execute */ version?: Scalars['String']; }; @@ -337,6 +337,7 @@ export enum MessageChannelVisibility { export type Mutation = { __typename?: 'Mutation'; + activateWorkflowVersion: Scalars['Boolean']; activateWorkspace: Workspace; addUserToWorkspace: User; authorizeApp: AuthorizeApp; @@ -346,15 +347,14 @@ export type Mutation = { createOneObject: Object; createOneServerlessFunction: ServerlessFunction; createOneServerlessFunctionFromFile: ServerlessFunction; + deactivateWorkflowVersion: Scalars['Boolean']; deleteCurrentWorkspace: Workspace; deleteOneObject: Object; deleteOneServerlessFunction: ServerlessFunction; deleteUser: User; disablePostgresProxy: PostgresCredentials; - disableWorkflowTrigger: Scalars['Boolean']; emailPasswordResetLink: EmailPasswordResetLink; enablePostgresProxy: PostgresCredentials; - enableWorkflowTrigger: Scalars['Boolean']; exchangeAuthorizationCode: ExchangeAuthCode; executeOneServerlessFunction: ServerlessFunctionExecutionResult; generateApiKeyToken: ApiKeyToken; @@ -381,6 +381,11 @@ export type Mutation = { }; +export type MutationActivateWorkflowVersionArgs = { + workflowVersionId: Scalars['String']; +}; + + export type MutationActivateWorkspaceArgs = { data: ActivateWorkspaceInput; }; @@ -422,6 +427,11 @@ export type MutationCreateOneServerlessFunctionFromFileArgs = { }; +export type MutationDeactivateWorkflowVersionArgs = { + workflowVersionId: Scalars['String']; +}; + + export type MutationDeleteOneObjectArgs = { input: DeleteOneObjectInput; }; @@ -432,21 +442,11 @@ export type MutationDeleteOneServerlessFunctionArgs = { }; -export type MutationDisableWorkflowTriggerArgs = { - workflowVersionId: Scalars['String']; -}; - - export type MutationEmailPasswordResetLinkArgs = { email: Scalars['String']; }; -export type MutationEnableWorkflowTriggerArgs = { - workflowVersionId: Scalars['String']; -}; - - export type MutationExchangeAuthorizationCodeArgs = { authorizationCode: Scalars['String']; clientSecret?: InputMaybe; @@ -637,9 +637,10 @@ export type Query = { currentWorkspace: Workspace; findWorkspaceFromInviteHash: Workspace; getAISQLQuery: AisqlQueryResult; + getAvailablePackages: Scalars['JSON']; getPostgresCredentials?: Maybe; getProductPrices: ProductPricesEntity; - getServerlessFunctionSourceCode: Scalars['String']; + getServerlessFunctionSourceCode?: Maybe; getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal; getTimelineCalendarEventsFromPersonId: TimelineCalendarEventsWithTotal; getTimelineThreadsFromCompanyId: TimelineThreadsWithTotal; diff --git a/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-version.workspace-entity.ts b/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-version.workspace-entity.ts index 8149cfcc39f44..6f986c4974840 100644 --- a/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-version.workspace-entity.ts +++ b/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-version.workspace-entity.ts @@ -1,3 +1,5 @@ +import { registerEnumType } from '@nestjs/graphql'; + import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum'; @@ -31,6 +33,8 @@ export enum WorkflowVersionStatus { ARCHIVED = 'ARCHIVED', } +registerEnumType(WorkflowVersionStatus, { name: 'WorkflowVersionStatus' }); + const WorkflowVersionStatusOptions = [ { value: WorkflowVersionStatus.DRAFT, diff --git a/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow.workspace-entity.ts b/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow.workspace-entity.ts index 98dd40417e356..3151562b25f98 100644 --- a/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow.workspace-entity.ts +++ b/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow.workspace-entity.ts @@ -1,3 +1,5 @@ +import { registerEnumType } from '@nestjs/graphql'; + import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum'; @@ -26,6 +28,8 @@ export enum WorkflowStatus { DEACTIVATED = 'DEACTIVATED', } +registerEnumType(WorkflowStatus, { name: 'WorkflowStatus' }); + const WorkflowStatusOptions = [ { value: WorkflowStatus.DRAFT,