From 11e316519124bf5dd995fc0e50f2c1fdb549114a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 17 Apr 2025 00:15:10 +0200 Subject: [PATCH] fix gcp trigger types issue temporarily by disabling them on cli --- cli/trigger.ts | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/cli/trigger.ts b/cli/trigger.ts index f099885615..2edd6b1674 100644 --- a/cli/trigger.ts +++ b/cli/trigger.ts @@ -28,7 +28,7 @@ type Trigger = { postgres: PostgresTrigger; mqtt: MqttTrigger; sqs: SqsTrigger; - gcp: GcpTrigger + gcp: GcpTrigger; }; type TriggerFile = Omit< @@ -62,7 +62,7 @@ async function getTrigger( postgres: wmill.getPostgresTrigger, mqtt: wmill.getMqttTrigger, sqs: wmill.getSqsTrigger, - gcp: wmill.getGcpTrigger + gcp: wmill.getGcpTrigger, }; const triggerFunction = triggerFunctions[triggerType]; @@ -90,7 +90,9 @@ async function updateTrigger( postgres: wmill.updatePostgresTrigger, mqtt: wmill.updateMqttTrigger, sqs: wmill.updateSqsTrigger, - gcp: wmill.updateGcpTrigger + gcp: async (args) => { + throw new Error("GCP triggers are not supported yet"); + }, }; const triggerFunction = triggerFunctions[triggerType]; await triggerFunction({ workspace, path, requestBody: trigger }); @@ -116,7 +118,9 @@ async function createTrigger( postgres: wmill.createPostgresTrigger, mqtt: wmill.createMqttTrigger, sqs: wmill.createSqsTrigger, - gcp: wmill.createGcpTrigger + gcp: async (args) => { + throw new Error("GCP triggers are not supported yet"); + }, }; const triggerFunction = triggerFunctions[triggerType]; await triggerFunction({ workspace, path, requestBody: trigger }); @@ -197,8 +201,8 @@ async function list(opts: GlobalOptions) { workspace: workspace.workspaceId, }); const gcpTriggers = await wmill.listGcpTriggers({ - workspace: workspace.workspaceId - }) + workspace: workspace.workspaceId, + }); const triggers = [ ...httpTriggers.map((x) => ({ path: x.path, kind: "http" })), ...websocketTriggers.map((x) => ({ path: x.path, kind: "websocket" })), @@ -207,7 +211,7 @@ async function list(opts: GlobalOptions) { ...postgresTriggers.map((x) => ({ path: x.path, kind: "postgres" })), ...mqttTriggers.map((x) => ({ path: x.path, kind: "mqtt" })), ...sqsTriggers.map((x) => ({ path: x.path, kind: "sqs" })), - ...gcpTriggers.map((x) => ({ path: x.path, kind: "gcp" })) + ...gcpTriggers.map((x) => ({ path: x.path, kind: "gcp" })), ]; new Table() @@ -221,7 +225,16 @@ async function list(opts: GlobalOptions) { function checkIfValidTrigger(kind: string | undefined): kind is TriggerType { if ( kind && - ["http", "websocket", "kafka", "nats", "postgres", "mqtt", "sqs", "gcp"].includes(kind) + [ + "http", + "websocket", + "kafka", + "nats", + "postgres", + "mqtt", + "sqs", + "gcp", + ].includes(kind) ) { return true; } else {