From 0970db32959e631892a564111b89c55b29f9c971 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Wed, 14 Dec 2022 20:00:08 +0100 Subject: [PATCH] feat: add remoteWebhookId in Flow --- .../20221214184855_add_remote_webhook_id_in_flow.ts | 13 +++++++++++++ packages/backend/src/models/flow.ts | 2 ++ packages/types/index.d.ts | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 packages/backend/src/db/migrations/20221214184855_add_remote_webhook_id_in_flow.ts diff --git a/packages/backend/src/db/migrations/20221214184855_add_remote_webhook_id_in_flow.ts b/packages/backend/src/db/migrations/20221214184855_add_remote_webhook_id_in_flow.ts new file mode 100644 index 00000000..67a086a9 --- /dev/null +++ b/packages/backend/src/db/migrations/20221214184855_add_remote_webhook_id_in_flow.ts @@ -0,0 +1,13 @@ +import { Knex } from 'knex'; + +export async function up(knex: Knex): Promise { + return knex.schema.table('flows', (table) => { + table.string('remote_webhook_id'); + }); +} + +export async function down(knex: Knex): Promise { + return knex.schema.table('flows', (table) => { + table.dropColumn('remote_webhook_id'); + }); +} diff --git a/packages/backend/src/models/flow.ts b/packages/backend/src/models/flow.ts index bb4015e0..5577dd35 100644 --- a/packages/backend/src/models/flow.ts +++ b/packages/backend/src/models/flow.ts @@ -13,6 +13,7 @@ class Flow extends Base { active: boolean; steps: Step[]; published_at: string; + remoteWebhookId: string; executions?: Execution[]; static tableName = 'flows'; @@ -25,6 +26,7 @@ class Flow extends Base { id: { type: 'string', format: 'uuid' }, name: { type: 'string', minLength: 1 }, userId: { type: 'string', format: 'uuid' }, + remoteWebhookId: { type: 'string' }, active: { type: 'boolean' }, }, }; diff --git a/packages/types/index.d.ts b/packages/types/index.d.ts index 1386f962..7f56d0e7 100644 --- a/packages/types/index.d.ts +++ b/packages/types/index.d.ts @@ -76,6 +76,7 @@ export interface IFlow { steps: IStep[]; createdAt: string; updatedAt: string; + remoteWebhookId: string; lastInternalId: () => Promise; } @@ -279,6 +280,8 @@ export type IGlobalVariable = { id: string; lastInternalId: string; isAlreadyProcessed?: (internalId: string) => boolean; + remoteWebhookId?: string; + setRemoteWebhookId?: (remoteWebhookId: string) => Promise; }; step?: { id: string;