update feature array to be an object
This commit is contained in:
parent
70dfd9e8e5
commit
5a73b02827
22 changed files with 58 additions and 21 deletions
|
@ -17,7 +17,11 @@
|
||||||
import ActionModal from "./ActionModal.svelte"
|
import ActionModal from "./ActionModal.svelte"
|
||||||
import FlowItemHeader from "./FlowItemHeader.svelte"
|
import FlowItemHeader from "./FlowItemHeader.svelte"
|
||||||
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
|
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
|
||||||
import { ActionStepID, TriggerStepID } from "constants/backend/automations"
|
import {
|
||||||
|
ActionStepID,
|
||||||
|
TriggerStepID,
|
||||||
|
Features,
|
||||||
|
} from "constants/backend/automations"
|
||||||
import { permissions } from "stores/backend"
|
import { permissions } from "stores/backend"
|
||||||
|
|
||||||
export let block
|
export let block
|
||||||
|
@ -187,7 +191,7 @@
|
||||||
{#if !isTrigger}
|
{#if !isTrigger}
|
||||||
<div>
|
<div>
|
||||||
<div class="block-options">
|
<div class="block-options">
|
||||||
{#if block?.features?.includes("LOOPING")}
|
{#if block?.features?.[Features.LOOPING] || !block.features}
|
||||||
<ActionButton on:click={() => addLooping()} icon="Reuse">
|
<ActionButton on:click={() => addLooping()} icon="Reuse">
|
||||||
Add Looping
|
Add Looping
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
|
|
@ -27,3 +27,7 @@ export const ActionStepID = {
|
||||||
zapier: "zapier",
|
zapier: "zapier",
|
||||||
integromat: "integromat",
|
integromat: "integromat",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const Features = {
|
||||||
|
LOOPING: "LOOPING",
|
||||||
|
}
|
||||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Run a bash script",
|
description: "Run a bash script",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
stepId: AutomationActionStepId.EXECUTE_BASH,
|
stepId: AutomationActionStepId.EXECUTE_BASH,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
||||||
"Collects specified data so it can be provided to the design section",
|
"Collects specified data so it can be provided to the design section",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [],
|
features: {},
|
||||||
stepId: AutomationActionStepId.COLLECT,
|
stepId: AutomationActionStepId.COLLECT,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
|
|
|
@ -18,7 +18,9 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Add a row to your database",
|
description: "Add a row to your database",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
stepId: AutomationActionStepId.CREATE_ROW,
|
stepId: AutomationActionStepId.CREATE_ROW,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Delay the automation until an amount of time has passed",
|
description: "Delay the automation until an amount of time has passed",
|
||||||
stepId: AutomationActionStepId.DELAY,
|
stepId: AutomationActionStepId.DELAY,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [],
|
features: {},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
stepId: AutomationActionStepId.DELETE_ROW,
|
stepId: AutomationActionStepId.DELETE_ROW,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -20,7 +20,9 @@ export const definition: AutomationStepSchema = {
|
||||||
stepId: AutomationActionStepId.discord,
|
stepId: AutomationActionStepId.discord,
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
stepId: AutomationActionStepId.EXECUTE_QUERY,
|
stepId: AutomationActionStepId.EXECUTE_QUERY,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -20,7 +20,9 @@ export const definition: AutomationStepSchema = {
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
|
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
|
|
|
@ -28,7 +28,7 @@ export const definition: AutomationStepSchema = {
|
||||||
"Conditionally halt automations which do not meet certain conditions",
|
"Conditionally halt automations which do not meet certain conditions",
|
||||||
type: AutomationStepType.LOGIC,
|
type: AutomationStepType.LOGIC,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [],
|
features: {},
|
||||||
stepId: AutomationActionStepId.FILTER,
|
stepId: AutomationActionStepId.FILTER,
|
||||||
inputs: {
|
inputs: {
|
||||||
condition: FilterConditions.EQUAL,
|
condition: FilterConditions.EQUAL,
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Loop",
|
description: "Loop",
|
||||||
stepId: AutomationActionStepId.LOOP,
|
stepId: AutomationActionStepId.LOOP,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [],
|
features: {},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
||||||
stepId: AutomationActionStepId.integromat,
|
stepId: AutomationActionStepId.integromat,
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -22,6 +22,7 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Interact with the OpenAI ChatGPT API.",
|
description: "Interact with the OpenAI ChatGPT API.",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
|
features: {},
|
||||||
stepId: AutomationActionStepId.OPENAI,
|
stepId: AutomationActionStepId.OPENAI,
|
||||||
inputs: {
|
inputs: {
|
||||||
prompt: "",
|
prompt: "",
|
||||||
|
|
|
@ -33,7 +33,9 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Send a request of specified method to a URL",
|
description: "Send a request of specified method to a URL",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
|
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
|
||||||
inputs: {
|
inputs: {
|
||||||
requestMethod: "POST",
|
requestMethod: "POST",
|
||||||
|
|
|
@ -43,7 +43,9 @@ export const definition: AutomationStepSchema = {
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
stepId: AutomationActionStepId.QUERY_ROWS,
|
stepId: AutomationActionStepId.QUERY_ROWS,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -16,7 +16,9 @@ export const definition: AutomationStepSchema = {
|
||||||
name: "Send Email (SMTP)",
|
name: "Send Email (SMTP)",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
|
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
|
|
|
@ -20,7 +20,9 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Logs the given text to the server (using console.log)",
|
description: "Logs the given text to the server (using console.log)",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
stepId: AutomationActionStepId.SERVER_LOG,
|
stepId: AutomationActionStepId.SERVER_LOG,
|
||||||
inputs: {
|
inputs: {
|
||||||
text: "",
|
text: "",
|
||||||
|
|
|
@ -17,7 +17,9 @@ export const definition: AutomationStepSchema = {
|
||||||
stepId: AutomationActionStepId.slack,
|
stepId: AutomationActionStepId.slack,
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
|
|
|
@ -18,7 +18,9 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Update a row in your database",
|
description: "Update a row in your database",
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
stepId: AutomationActionStepId.UPDATE_ROW,
|
stepId: AutomationActionStepId.UPDATE_ROW,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
|
|
|
@ -14,7 +14,9 @@ export const definition: AutomationStepSchema = {
|
||||||
stepId: AutomationActionStepId.zapier,
|
stepId: AutomationActionStepId.zapier,
|
||||||
type: AutomationStepType.ACTION,
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
features: [AutomationFeature.LOOPING],
|
features: {
|
||||||
|
[AutomationFeature.LOOPING]: true,
|
||||||
|
},
|
||||||
description: "Trigger a Zapier Zap via webhooks",
|
description: "Trigger a Zapier Zap via webhooks",
|
||||||
tagline: "Trigger a Zapier Zap",
|
tagline: "Trigger a Zapier Zap",
|
||||||
icon: "ri-flashlight-line",
|
icon: "ri-flashlight-line",
|
||||||
|
|
|
@ -124,7 +124,7 @@ export interface AutomationStepSchema {
|
||||||
outputs: InputOutputBlock
|
outputs: InputOutputBlock
|
||||||
}
|
}
|
||||||
custom?: boolean
|
custom?: boolean
|
||||||
features?: AutomationFeature[]
|
features?: Partial<Record<AutomationFeature, boolean>>
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AutomationFeature {
|
export enum AutomationFeature {
|
||||||
|
|
Loading…
Reference in a new issue