add features property to automation defintions

This commit is contained in:
Peter Clement 2023-05-22 15:46:42 +01:00
parent d7ae338bc5
commit 754b30dd5c
20 changed files with 39 additions and 21 deletions

View File

@ -187,7 +187,7 @@
{#if !isTrigger}
<div>
<div class="block-options">
{#if block?.canLoop}
{#if block?.features.includes("LOOPING")}
<ActionButton on:click={() => addLooping()} icon="Reuse">
Add Looping
</ActionButton>

View File

@ -5,6 +5,7 @@ import environment from "../../environment"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -18,7 +19,7 @@ export const definition: AutomationStepSchema = {
description: "Run a bash script",
type: AutomationStepType.ACTION,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
stepId: AutomationActionStepId.EXECUTE_BASH,
inputs: {},
schema: {

View File

@ -4,6 +4,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
@ -14,7 +15,7 @@ export const definition: AutomationStepSchema = {
"Collects specified data so it can be provided to the design section",
type: AutomationStepType.ACTION,
internal: true,
canLoop: false,
features: [],
stepId: AutomationActionStepId.COLLECT,
inputs: {
text: "",

View File

@ -4,6 +4,7 @@ import { buildCtx } from "./utils"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -17,7 +18,7 @@ export const definition: AutomationStepSchema = {
description: "Add a row to your database",
type: AutomationStepType.ACTION,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
stepId: AutomationActionStepId.CREATE_ROW,
inputs: {},
schema: {

View File

@ -14,7 +14,7 @@ export const definition: AutomationStepSchema = {
description: "Delay the automation until an amount of time has passed",
stepId: AutomationActionStepId.DELAY,
internal: true,
canLoop: false,
features: [],
inputs: {},
schema: {
inputs: {

View File

@ -8,6 +8,7 @@ import {
AutomationStepType,
AutomationIOType,
AutomationCustomIOType,
AutomationFeature,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
@ -18,7 +19,7 @@ export const definition: AutomationStepSchema = {
type: AutomationStepType.ACTION,
stepId: AutomationActionStepId.DELETE_ROW,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
inputs: {},
schema: {
inputs: {

View File

@ -6,6 +6,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
const DEFAULT_USERNAME = "Budibase Automate"
@ -19,7 +20,7 @@ export const definition: AutomationStepSchema = {
stepId: AutomationActionStepId.discord,
type: AutomationStepType.ACTION,
internal: false,
canLoop: true,
features: [AutomationFeature.LOOPING],
inputs: {},
schema: {
inputs: {

View File

@ -4,6 +4,7 @@ import * as automationUtils from "../automationUtils"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -18,7 +19,7 @@ export const definition: AutomationStepSchema = {
type: AutomationStepType.ACTION,
stepId: AutomationActionStepId.EXECUTE_QUERY,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
inputs: {},
schema: {
inputs: {

View File

@ -4,6 +4,7 @@ import * as automationUtils from "../automationUtils"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -19,7 +20,7 @@ export const definition: AutomationStepSchema = {
internal: true,
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
inputs: {},
canLoop: true,
features: [AutomationFeature.LOOPING],
schema: {
inputs: {
properties: {

View File

@ -28,7 +28,7 @@ export const definition: AutomationStepSchema = {
"Conditionally halt automations which do not meet certain conditions",
type: AutomationStepType.LOGIC,
internal: true,
canLoop: false,
features: [],
stepId: AutomationActionStepId.FILTER,
inputs: {
condition: FilterConditions.EQUAL,

View File

@ -13,8 +13,7 @@ export const definition: AutomationStepSchema = {
description: "Loop",
stepId: AutomationActionStepId.LOOP,
internal: true,
canLoop: false,
features: [],
inputs: {},
schema: {
inputs: {

View File

@ -6,6 +6,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
@ -18,7 +19,7 @@ export const definition: AutomationStepSchema = {
stepId: AutomationActionStepId.integromat,
type: AutomationStepType.ACTION,
internal: false,
canLoop: true,
features: [AutomationFeature.LOOPING],
inputs: {},
schema: {
inputs: {

View File

@ -4,6 +4,7 @@ import * as automationUtils from "../automationUtils"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -32,7 +33,7 @@ export const definition: AutomationStepSchema = {
description: "Send a request of specified method to a URL",
type: AutomationStepType.ACTION,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
inputs: {
requestMethod: "POST",

View File

@ -6,6 +6,7 @@ import * as automationUtils from "../automationUtils"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -42,7 +43,7 @@ export const definition: AutomationStepSchema = {
type: AutomationStepType.ACTION,
stepId: AutomationActionStepId.QUERY_ROWS,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
inputs: {},
schema: {
inputs: {

View File

@ -6,6 +6,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
@ -15,7 +16,7 @@ export const definition: AutomationStepSchema = {
name: "Send Email (SMTP)",
type: AutomationStepType.ACTION,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
inputs: {},
schema: {

View File

@ -4,6 +4,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
/**
@ -19,7 +20,7 @@ export const definition: AutomationStepSchema = {
description: "Logs the given text to the server (using console.log)",
type: AutomationStepType.ACTION,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
stepId: AutomationActionStepId.SERVER_LOG,
inputs: {
text: "",

View File

@ -6,6 +6,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
@ -16,7 +17,7 @@ export const definition: AutomationStepSchema = {
stepId: AutomationActionStepId.slack,
type: AutomationStepType.ACTION,
internal: false,
canLoop: true,
features: [AutomationFeature.LOOPING],
inputs: {},
schema: {
inputs: {

View File

@ -4,6 +4,7 @@ import { buildCtx } from "./utils"
import {
AutomationActionStepId,
AutomationCustomIOType,
AutomationFeature,
AutomationIOType,
AutomationStepInput,
AutomationStepSchema,
@ -17,7 +18,7 @@ export const definition: AutomationStepSchema = {
description: "Update a row in your database",
type: AutomationStepType.ACTION,
internal: true,
canLoop: true,
features: [AutomationFeature.LOOPING],
stepId: AutomationActionStepId.UPDATE_ROW,
inputs: {},
schema: {

View File

@ -6,6 +6,7 @@ import {
AutomationStepInput,
AutomationStepType,
AutomationIOType,
AutomationFeature,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
@ -13,7 +14,7 @@ export const definition: AutomationStepSchema = {
stepId: AutomationActionStepId.zapier,
type: AutomationStepType.ACTION,
internal: false,
canLoop: true,
features: [AutomationFeature.LOOPING],
description: "Trigger a Zapier Zap via webhooks",
tagline: "Trigger a Zapier Zap",
icon: "ri-flashlight-line",

View File

@ -123,7 +123,11 @@ export interface AutomationStepSchema {
outputs: InputOutputBlock
}
custom?: boolean
canLoop?: boolean
features?: AutomationFeature[]
}
export enum AutomationFeature {
LOOPING = "LOOPING",
}
export interface AutomationStep extends AutomationStepSchema {