From 9b66b309695939c09254ef8b4502506e23f0f671 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 9 May 2023 12:04:16 +0100 Subject: [PATCH] add property to denote if step can be looped --- packages/server/src/automations/steps/bash.ts | 1 + packages/server/src/automations/steps/createRow.ts | 1 + packages/server/src/automations/steps/delay.ts | 1 + packages/server/src/automations/steps/deleteRow.ts | 1 + packages/server/src/automations/steps/discord.ts | 1 + packages/server/src/automations/steps/executeQuery.ts | 1 + packages/server/src/automations/steps/executeScript.ts | 1 + packages/server/src/automations/steps/filter.ts | 1 + packages/server/src/automations/steps/integromat.ts | 1 + packages/server/src/automations/steps/loop.ts | 2 ++ packages/server/src/automations/steps/outgoingWebhook.ts | 1 + packages/server/src/automations/steps/queryRows.ts | 1 + packages/server/src/automations/steps/sendSmtpEmail.ts | 1 + packages/server/src/automations/steps/serverLog.ts | 1 + packages/server/src/automations/steps/slack.ts | 1 + packages/server/src/automations/steps/updateRow.ts | 1 + packages/server/src/automations/steps/zapier.ts | 1 + 17 files changed, 18 insertions(+) diff --git a/packages/server/src/automations/steps/bash.ts b/packages/server/src/automations/steps/bash.ts index 820d0329db..de1f43a907 100644 --- a/packages/server/src/automations/steps/bash.ts +++ b/packages/server/src/automations/steps/bash.ts @@ -18,6 +18,7 @@ export const definition: AutomationStepSchema = { description: "Run a bash script", type: AutomationStepType.ACTION, internal: true, + canLoop: true, stepId: AutomationActionStepId.EXECUTE_BASH, inputs: {}, schema: { diff --git a/packages/server/src/automations/steps/createRow.ts b/packages/server/src/automations/steps/createRow.ts index dac929f1ee..027012338b 100644 --- a/packages/server/src/automations/steps/createRow.ts +++ b/packages/server/src/automations/steps/createRow.ts @@ -17,6 +17,7 @@ export const definition: AutomationStepSchema = { description: "Add a row to your database", type: AutomationStepType.ACTION, internal: true, + canLoop: true, stepId: AutomationActionStepId.CREATE_ROW, inputs: {}, schema: { diff --git a/packages/server/src/automations/steps/delay.ts b/packages/server/src/automations/steps/delay.ts index 9cf578805c..736e392821 100644 --- a/packages/server/src/automations/steps/delay.ts +++ b/packages/server/src/automations/steps/delay.ts @@ -14,6 +14,7 @@ export const definition: AutomationStepSchema = { description: "Delay the automation until an amount of time has passed", stepId: AutomationActionStepId.DELAY, internal: true, + canLoop: false, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/deleteRow.ts b/packages/server/src/automations/steps/deleteRow.ts index 86c7703491..6b830a3eab 100644 --- a/packages/server/src/automations/steps/deleteRow.ts +++ b/packages/server/src/automations/steps/deleteRow.ts @@ -18,6 +18,7 @@ export const definition: AutomationStepSchema = { type: AutomationStepType.ACTION, stepId: AutomationActionStepId.DELETE_ROW, internal: true, + canLoop: true, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/discord.ts b/packages/server/src/automations/steps/discord.ts index c46220c3b2..165f1a6d04 100644 --- a/packages/server/src/automations/steps/discord.ts +++ b/packages/server/src/automations/steps/discord.ts @@ -19,6 +19,7 @@ export const definition: AutomationStepSchema = { stepId: AutomationActionStepId.discord, type: AutomationStepType.ACTION, internal: false, + canLoop: true, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/executeQuery.ts b/packages/server/src/automations/steps/executeQuery.ts index 4969400552..b63d894f5c 100644 --- a/packages/server/src/automations/steps/executeQuery.ts +++ b/packages/server/src/automations/steps/executeQuery.ts @@ -18,6 +18,7 @@ export const definition: AutomationStepSchema = { type: AutomationStepType.ACTION, stepId: AutomationActionStepId.EXECUTE_QUERY, internal: true, + canLoop: true, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/executeScript.ts b/packages/server/src/automations/steps/executeScript.ts index 9bd0eaed18..d0bb500cf1 100644 --- a/packages/server/src/automations/steps/executeScript.ts +++ b/packages/server/src/automations/steps/executeScript.ts @@ -19,6 +19,7 @@ export const definition: AutomationStepSchema = { internal: true, stepId: AutomationActionStepId.EXECUTE_SCRIPT, inputs: {}, + canLoop: true, schema: { inputs: { properties: { diff --git a/packages/server/src/automations/steps/filter.ts b/packages/server/src/automations/steps/filter.ts index c7ab4210ec..f457492fc3 100644 --- a/packages/server/src/automations/steps/filter.ts +++ b/packages/server/src/automations/steps/filter.ts @@ -28,6 +28,7 @@ export const definition: AutomationStepSchema = { "Conditionally halt automations which do not meet certain conditions", type: AutomationStepType.LOGIC, internal: true, + canLoop: false, stepId: AutomationActionStepId.FILTER, inputs: { condition: FilterConditions.EQUAL, diff --git a/packages/server/src/automations/steps/integromat.ts b/packages/server/src/automations/steps/integromat.ts index d7c78a6dd8..45d659d0c7 100644 --- a/packages/server/src/automations/steps/integromat.ts +++ b/packages/server/src/automations/steps/integromat.ts @@ -17,6 +17,7 @@ export const definition: AutomationStepSchema = { stepId: AutomationActionStepId.integromat, type: AutomationStepType.ACTION, internal: false, + canLoop: true, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/loop.ts b/packages/server/src/automations/steps/loop.ts index fdbec83f2e..f646492ee7 100644 --- a/packages/server/src/automations/steps/loop.ts +++ b/packages/server/src/automations/steps/loop.ts @@ -13,6 +13,8 @@ export const definition: AutomationStepSchema = { description: "Loop", stepId: AutomationActionStepId.LOOP, internal: true, + canLoop: false, + inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/outgoingWebhook.ts b/packages/server/src/automations/steps/outgoingWebhook.ts index f174935195..acdf60d869 100644 --- a/packages/server/src/automations/steps/outgoingWebhook.ts +++ b/packages/server/src/automations/steps/outgoingWebhook.ts @@ -32,6 +32,7 @@ export const definition: AutomationStepSchema = { description: "Send a request of specified method to a URL", type: AutomationStepType.ACTION, internal: true, + canLoop: true, stepId: AutomationActionStepId.OUTGOING_WEBHOOK, inputs: { requestMethod: "POST", diff --git a/packages/server/src/automations/steps/queryRows.ts b/packages/server/src/automations/steps/queryRows.ts index 1d7e8a419e..f3ab298e55 100644 --- a/packages/server/src/automations/steps/queryRows.ts +++ b/packages/server/src/automations/steps/queryRows.ts @@ -42,6 +42,7 @@ export const definition: AutomationStepSchema = { type: AutomationStepType.ACTION, stepId: AutomationActionStepId.QUERY_ROWS, internal: true, + canLoop: true, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/sendSmtpEmail.ts b/packages/server/src/automations/steps/sendSmtpEmail.ts index c4af9aeaa9..fc88ee721b 100644 --- a/packages/server/src/automations/steps/sendSmtpEmail.ts +++ b/packages/server/src/automations/steps/sendSmtpEmail.ts @@ -15,6 +15,7 @@ export const definition: AutomationStepSchema = { name: "Send Email (SMTP)", type: AutomationStepType.ACTION, internal: true, + canLoop: true, stepId: AutomationActionStepId.SEND_EMAIL_SMTP, inputs: {}, schema: { diff --git a/packages/server/src/automations/steps/serverLog.ts b/packages/server/src/automations/steps/serverLog.ts index 382f7d4efc..241d71a220 100644 --- a/packages/server/src/automations/steps/serverLog.ts +++ b/packages/server/src/automations/steps/serverLog.ts @@ -19,6 +19,7 @@ export const definition: AutomationStepSchema = { description: "Logs the given text to the server (using console.log)", type: AutomationStepType.ACTION, internal: true, + canLoop: true, stepId: AutomationActionStepId.SERVER_LOG, inputs: { text: "", diff --git a/packages/server/src/automations/steps/slack.ts b/packages/server/src/automations/steps/slack.ts index 21ee6ed742..ec08f60e5a 100644 --- a/packages/server/src/automations/steps/slack.ts +++ b/packages/server/src/automations/steps/slack.ts @@ -16,6 +16,7 @@ export const definition: AutomationStepSchema = { stepId: AutomationActionStepId.slack, type: AutomationStepType.ACTION, internal: false, + canLoop: true, inputs: {}, schema: { inputs: { diff --git a/packages/server/src/automations/steps/updateRow.ts b/packages/server/src/automations/steps/updateRow.ts index 96ab1d1642..4b3457961b 100644 --- a/packages/server/src/automations/steps/updateRow.ts +++ b/packages/server/src/automations/steps/updateRow.ts @@ -17,6 +17,7 @@ export const definition: AutomationStepSchema = { description: "Update a row in your database", type: AutomationStepType.ACTION, internal: true, + canLoop: true, stepId: AutomationActionStepId.UPDATE_ROW, inputs: {}, schema: { diff --git a/packages/server/src/automations/steps/zapier.ts b/packages/server/src/automations/steps/zapier.ts index 75a21deaae..dcb3947f1d 100644 --- a/packages/server/src/automations/steps/zapier.ts +++ b/packages/server/src/automations/steps/zapier.ts @@ -13,6 +13,7 @@ export const definition: AutomationStepSchema = { stepId: AutomationActionStepId.zapier, type: AutomationStepType.ACTION, internal: false, + canLoop: true, description: "Trigger a Zapier Zap via webhooks", tagline: "Trigger a Zapier Zap", icon: "ri-flashlight-line",