diff --git a/packages/backend/src/graphql/mutations/create-connection.ts b/packages/backend/src/graphql/mutations/create-connection.ts index fcaf093d..4a454865 100644 --- a/packages/backend/src/graphql/mutations/create-connection.ts +++ b/packages/backend/src/graphql/mutations/create-connection.ts @@ -18,6 +18,7 @@ const createConnection = async ( return await context.currentUser.$relatedQuery('connections').insert({ key: params.input.key, formattedData: params.input.formattedData, + verified: false, }); }; diff --git a/packages/backend/src/models/connection.ts b/packages/backend/src/models/connection.ts index 34968a19..4b215ca4 100644 --- a/packages/backend/src/models/connection.ts +++ b/packages/backend/src/models/connection.ts @@ -4,7 +4,6 @@ import { AES, enc } from 'crypto-js'; import Base from './base'; import User from './user'; import Step from './step'; -import App from './app'; import appConfig from '../config/app'; import { IJSONObject } from '@automatisch/types'; import Telemetry from '../helpers/telemetry'; @@ -15,7 +14,7 @@ class Connection extends Base { data: string; formattedData?: IJSONObject; userId!: string; - verified = false; + verified: boolean; draft: boolean; count?: number; flowCount?: number; @@ -32,7 +31,7 @@ class Connection extends Base { data: { type: 'string' }, formattedData: { type: 'object' }, userId: { type: 'string', format: 'uuid' }, - verified: { type: 'boolean' }, + verified: { type: 'boolean', default: false }, draft: { type: 'boolean' }, }, }; diff --git a/packages/backend/src/models/execution-step.ts b/packages/backend/src/models/execution-step.ts index e063d344..2e4d2a8f 100644 --- a/packages/backend/src/models/execution-step.ts +++ b/packages/backend/src/models/execution-step.ts @@ -12,7 +12,7 @@ class ExecutionStep extends Base { dataIn!: IJSONObject; dataOut!: IJSONObject; errorDetails: IJSONObject; - status = 'failure'; + status: 'success' | 'failure'; step: Step; static tableName = 'execution_steps'; diff --git a/packages/backend/src/models/execution.ts b/packages/backend/src/models/execution.ts index 73552bf7..c4847b17 100644 --- a/packages/backend/src/models/execution.ts +++ b/packages/backend/src/models/execution.ts @@ -7,9 +7,9 @@ import Telemetry from '../helpers/telemetry'; class Execution extends Base { id!: string; flowId!: string; - testRun = false; + testRun: boolean; internalId: string; - executionSteps: ExecutionStep[] = []; + executionSteps: ExecutionStep[]; static tableName = 'executions'; @@ -19,7 +19,7 @@ class Execution extends Base { properties: { id: { type: 'string', format: 'uuid' }, flowId: { type: 'string', format: 'uuid' }, - testRun: { type: 'boolean' }, + testRun: { type: 'boolean', default: false }, internalId: { type: 'string' }, }, }; diff --git a/packages/backend/src/models/step.ts b/packages/backend/src/models/step.ts index 1885c7ad..719fbbf3 100644 --- a/packages/backend/src/models/step.ts +++ b/packages/backend/src/models/step.ts @@ -15,7 +15,7 @@ class Step extends Base { appKey?: string; type!: IStep['type']; connectionId?: string; - status = 'incomplete'; + status: 'incomplete' | 'completed'; position!: number; parameters: IJSONObject; connection?: Connection; @@ -35,7 +35,11 @@ class Step extends Base { appKey: { type: ['string', 'null'], minLength: 1, maxLength: 255 }, type: { type: 'string', enum: ['action', 'trigger'] }, connectionId: { type: ['string', 'null'], format: 'uuid' }, - status: { type: 'string', enum: ['incomplete', 'completed'] }, + status: { + type: 'string', + enum: ['incomplete', 'completed'], + default: 'incomplete', + }, position: { type: 'integer' }, parameters: { type: 'object' }, },