Refactoring automation steps to be better defined in Typescript, which allows writing the validator for automations.
This commit is contained in:
parent
6396548064
commit
400a112a4b
|
@ -1,4 +1,12 @@
|
||||||
import { DatasourceFieldType, QueryType, PluginType } from "@budibase/types"
|
import {
|
||||||
|
DatasourceFieldType,
|
||||||
|
QueryType,
|
||||||
|
PluginType,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationStepIdArray,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationCustomIOType,
|
||||||
|
} from "@budibase/types"
|
||||||
import joi from "joi"
|
import joi from "joi"
|
||||||
|
|
||||||
const DATASOURCE_TYPES = [
|
const DATASOURCE_TYPES = [
|
||||||
|
@ -19,7 +27,7 @@ function runJoi(validator: joi.Schema, schema: any) {
|
||||||
|
|
||||||
function validateComponent(schema: any) {
|
function validateComponent(schema: any) {
|
||||||
const validator = joi.object({
|
const validator = joi.object({
|
||||||
type: joi.string().allow("component").required(),
|
type: joi.string().allow(PluginType.COMPONENT).required(),
|
||||||
metadata: joi.object().unknown(true).required(),
|
metadata: joi.object().unknown(true).required(),
|
||||||
hash: joi.string().optional(),
|
hash: joi.string().optional(),
|
||||||
version: joi.string().optional(),
|
version: joi.string().optional(),
|
||||||
|
@ -53,7 +61,7 @@ function validateDatasource(schema: any) {
|
||||||
.required()
|
.required()
|
||||||
|
|
||||||
const validator = joi.object({
|
const validator = joi.object({
|
||||||
type: joi.string().allow("datasource").required(),
|
type: joi.string().allow(PluginType.DATASOURCE).required(),
|
||||||
metadata: joi.object().unknown(true).required(),
|
metadata: joi.object().unknown(true).required(),
|
||||||
hash: joi.string().optional(),
|
hash: joi.string().optional(),
|
||||||
version: joi.string().optional(),
|
version: joi.string().optional(),
|
||||||
|
@ -82,6 +90,55 @@ function validateDatasource(schema: any) {
|
||||||
runJoi(validator, schema)
|
runJoi(validator, schema)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateAutomation(schema: any) {
|
||||||
|
const basePropsValidator = joi.object({
|
||||||
|
type: joi
|
||||||
|
.string()
|
||||||
|
.allow(...Object.values(AutomationIOType))
|
||||||
|
.required(),
|
||||||
|
customType: joi.string().allow(...Object.values(AutomationCustomIOType)),
|
||||||
|
title: joi.string(),
|
||||||
|
description: joi.string(),
|
||||||
|
enum: joi.array().items(joi.string()),
|
||||||
|
pretty: joi.array().items(joi.string()),
|
||||||
|
})
|
||||||
|
const stepSchemaValidator = joi
|
||||||
|
.object({
|
||||||
|
properties: basePropsValidator,
|
||||||
|
required: joi.array().items(joi.string()),
|
||||||
|
})
|
||||||
|
.concat(basePropsValidator)
|
||||||
|
.required()
|
||||||
|
const validator = joi.object({
|
||||||
|
type: joi.string().allow(PluginType.AUTOMATION).required(),
|
||||||
|
metadata: joi.object().unknown(true).required(),
|
||||||
|
hash: joi.string().optional(),
|
||||||
|
version: joi.string().optional(),
|
||||||
|
schema: joi.object({
|
||||||
|
name: joi.string().required(),
|
||||||
|
tagline: joi.string().required(),
|
||||||
|
icon: joi.string().required(),
|
||||||
|
description: joi.string().required(),
|
||||||
|
type: joi
|
||||||
|
.string()
|
||||||
|
.allow(AutomationStepType.ACTION, AutomationStepType.LOGIC)
|
||||||
|
.required(),
|
||||||
|
stepId: joi
|
||||||
|
.string()
|
||||||
|
.disallow(...AutomationStepIdArray)
|
||||||
|
.required(),
|
||||||
|
inputs: joi.object().optional(),
|
||||||
|
schema: joi
|
||||||
|
.object({
|
||||||
|
inputs: stepSchemaValidator,
|
||||||
|
outputs: stepSchemaValidator,
|
||||||
|
})
|
||||||
|
.required(),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
runJoi(validator, schema)
|
||||||
|
}
|
||||||
|
|
||||||
export function validate(schema: any) {
|
export function validate(schema: any) {
|
||||||
switch (schema?.type) {
|
switch (schema?.type) {
|
||||||
case PluginType.COMPONENT:
|
case PluginType.COMPONENT:
|
||||||
|
@ -90,6 +147,9 @@ export function validate(schema: any) {
|
||||||
case PluginType.DATASOURCE:
|
case PluginType.DATASOURCE:
|
||||||
validateDatasource(schema)
|
validateDatasource(schema)
|
||||||
break
|
break
|
||||||
|
case PluginType.AUTOMATION:
|
||||||
|
validateAutomation(schema)
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown plugin type - check schema.json: ${schema.type}`)
|
throw new Error(`Unknown plugin type - check schema.json: ${schema.type}`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,11 @@ import * as automationUtils from "../automationUtils"
|
||||||
import environment from "../../environment"
|
import environment from "../../environment"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -13,7 +16,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Execute a bash command",
|
tagline: "Execute a bash command",
|
||||||
icon: "JourneyEvent",
|
icon: "JourneyEvent",
|
||||||
description: "Run a bash script",
|
description: "Run a bash script",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.EXECUTE_BASH,
|
stepId: AutomationActionStepId.EXECUTE_BASH,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -21,8 +24,8 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
code: {
|
code: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "code",
|
customType: AutomationCustomIOType.CODE,
|
||||||
title: "Code",
|
title: "Code",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -31,11 +34,11 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
stdout: {
|
stdout: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "Standard output of your bash command or script",
|
description: "Standard output of your bash command or script",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the command was successful",
|
description: "Whether the command was successful",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,8 +3,11 @@ import { cleanUpRow, getError } from "../automationUtils"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Create a {{inputs.enriched.table.name}} row",
|
tagline: "Create a {{inputs.enriched.table.name}} row",
|
||||||
icon: "TableRowAddBottom",
|
icon: "TableRowAddBottom",
|
||||||
description: "Add a row to your database",
|
description: "Add a row to your database",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.CREATE_ROW,
|
stepId: AutomationActionStepId.CREATE_ROW,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -20,14 +23,14 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
properties: {
|
properties: {
|
||||||
tableId: {
|
tableId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "table",
|
customType: AutomationCustomIOType.TABLE,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
required: ["tableId"],
|
required: ["tableId"],
|
||||||
},
|
},
|
||||||
|
@ -37,24 +40,24 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
description: "The new row",
|
description: "The new row",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "The response from the table",
|
description: "The response from the table",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the row creation was successful",
|
description: "Whether the row creation was successful",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The identifier of the new row",
|
description: "The identifier of the new row",
|
||||||
},
|
},
|
||||||
revision: {
|
revision: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The revision of the new row",
|
description: "The revision of the new row",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -33,7 +34,7 @@ export const definition: AutomationStepSchema = {
|
||||||
required: ["success"],
|
required: ["success"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "LOGIC",
|
type: AutomationStepType.LOGIC,
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function run({ inputs }: AutomationStepInput) {
|
export async function run({ inputs }: AutomationStepInput) {
|
||||||
|
|
|
@ -3,8 +3,11 @@ import { buildCtx } from "./utils"
|
||||||
import { getError } from "../automationUtils"
|
import { getError } from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationCustomIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
||||||
icon: "TableRowRemoveCenter",
|
icon: "TableRowRemoveCenter",
|
||||||
name: "Delete Row",
|
name: "Delete Row",
|
||||||
tagline: "Delete a {{inputs.enriched.table.name}} row",
|
tagline: "Delete a {{inputs.enriched.table.name}} row",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
stepId: AutomationActionStepId.DELETE_ROW,
|
stepId: AutomationActionStepId.DELETE_ROW,
|
||||||
internal: true,
|
internal: true,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -20,12 +23,12 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
tableId: {
|
tableId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "table",
|
customType: AutomationCustomIOType.TABLE,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Row ID",
|
title: "Row ID",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -34,16 +37,16 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
description: "The deleted row",
|
description: "The deleted row",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "The response from the table",
|
description: "The response from the table",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the deletion was successful",
|
description: "Whether the deletion was successful",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,6 +4,8 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
const DEFAULT_USERNAME = "Budibase Automate"
|
const DEFAULT_USERNAME = "Budibase Automate"
|
||||||
|
@ -15,26 +17,26 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Send a message to a Discord server",
|
description: "Send a message to a Discord server",
|
||||||
icon: "ri-discord-line",
|
icon: "ri-discord-line",
|
||||||
stepId: AutomationActionStepId.discord,
|
stepId: AutomationActionStepId.discord,
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
url: {
|
url: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Discord Webhook URL",
|
title: "Discord Webhook URL",
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Bot Name",
|
title: "Bot Name",
|
||||||
},
|
},
|
||||||
avatar_url: {
|
avatar_url: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Bot Avatar URL",
|
title: "Bot Avatar URL",
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Message",
|
title: "Message",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -43,15 +45,15 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
httpStatus: {
|
httpStatus: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
description: "The HTTP status code of the request",
|
description: "The HTTP status code of the request",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The response from the Discord Webhook",
|
description: "The response from the Discord Webhook",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the message sent successfully",
|
description: "Whether the message sent successfully",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,8 +3,11 @@ import { buildCtx } from "./utils"
|
||||||
import * as automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Execute Data Connector",
|
tagline: "Execute Data Connector",
|
||||||
icon: "Data",
|
icon: "Data",
|
||||||
description: "Execute a query in an external data connector",
|
description: "Execute a query in an external data connector",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
stepId: AutomationActionStepId.EXECUTE_QUERY,
|
stepId: AutomationActionStepId.EXECUTE_QUERY,
|
||||||
internal: true,
|
internal: true,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -20,14 +23,14 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
query: {
|
query: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
properties: {
|
properties: {
|
||||||
queryId: {
|
queryId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "query",
|
customType: AutomationCustomIOType.QUERY,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
customType: "queryParams",
|
customType: AutomationCustomIOType.QUERY_PARAMS,
|
||||||
title: "Parameters",
|
title: "Parameters",
|
||||||
required: ["queryId"],
|
required: ["queryId"],
|
||||||
},
|
},
|
||||||
|
@ -37,16 +40,16 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "The response from the datasource execution",
|
description: "The response from the datasource execution",
|
||||||
},
|
},
|
||||||
info: {
|
info: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description:
|
description:
|
||||||
"Some query types may return extra data, like headers from a REST query",
|
"Some query types may return extra data, like headers from a REST query",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,8 +3,11 @@ import { buildCtx } from "./utils"
|
||||||
import * as automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Execute JavaScript Code",
|
tagline: "Execute JavaScript Code",
|
||||||
icon: "Code",
|
icon: "Code",
|
||||||
description: "Run a piece of JavaScript code in your automation",
|
description: "Run a piece of JavaScript code in your automation",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
|
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -20,8 +23,8 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
code: {
|
code: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "code",
|
customType: AutomationCustomIOType.CODE,
|
||||||
title: "Code",
|
title: "Code",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -30,11 +33,11 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
value: {
|
value: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The result of the return statement",
|
description: "The result of the return statement",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,8 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const FilterConditions = {
|
export const FilterConditions = {
|
||||||
|
@ -24,7 +26,7 @@ export const definition: AutomationStepSchema = {
|
||||||
icon: "Branch2",
|
icon: "Branch2",
|
||||||
description:
|
description:
|
||||||
"Conditionally halt automations which do not meet certain conditions",
|
"Conditionally halt automations which do not meet certain conditions",
|
||||||
type: "LOGIC",
|
type: AutomationStepType.LOGIC,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.FILTER,
|
stepId: AutomationActionStepId.FILTER,
|
||||||
inputs: {
|
inputs: {
|
||||||
|
@ -34,17 +36,17 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
field: {
|
field: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Reference Value",
|
title: "Reference Value",
|
||||||
},
|
},
|
||||||
condition: {
|
condition: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Condition",
|
title: "Condition",
|
||||||
enum: Object.values(FilterConditions),
|
enum: Object.values(FilterConditions),
|
||||||
pretty: Object.values(PrettyFilterConditions),
|
pretty: Object.values(PrettyFilterConditions),
|
||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Comparison Value",
|
title: "Comparison Value",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -53,11 +55,11 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
result: {
|
result: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the logic block passed",
|
description: "Whether the logic block passed",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,6 +4,8 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -13,34 +15,34 @@ export const definition: AutomationStepSchema = {
|
||||||
"Performs a webhook call to Integromat and gets the response (if configured)",
|
"Performs a webhook call to Integromat and gets the response (if configured)",
|
||||||
icon: "ri-shut-down-line",
|
icon: "ri-shut-down-line",
|
||||||
stepId: AutomationActionStepId.integromat,
|
stepId: AutomationActionStepId.integromat,
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
url: {
|
url: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Webhook URL",
|
title: "Webhook URL",
|
||||||
},
|
},
|
||||||
value1: {
|
value1: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Input Value 1",
|
title: "Input Value 1",
|
||||||
},
|
},
|
||||||
value2: {
|
value2: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Input Value 2",
|
title: "Input Value 2",
|
||||||
},
|
},
|
||||||
value3: {
|
value3: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Input Value 3",
|
title: "Input Value 3",
|
||||||
},
|
},
|
||||||
value4: {
|
value4: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Input Value 4",
|
title: "Input Value 4",
|
||||||
},
|
},
|
||||||
value5: {
|
value5: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Input Value 5",
|
title: "Input Value 5",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -49,15 +51,15 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether call was successful",
|
description: "Whether call was successful",
|
||||||
},
|
},
|
||||||
httpStatus: {
|
httpStatus: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
description: "The HTTP status code returned",
|
description: "The HTTP status code returned",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "The webhook response - this can have properties",
|
description: "The webhook response - this can have properties",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
import { AutomationActionStepId, AutomationStepSchema } from "@budibase/types"
|
import {
|
||||||
|
AutomationActionStepId,
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Looping",
|
name: "Looping",
|
||||||
|
@ -12,19 +18,19 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
option: {
|
option: {
|
||||||
customType: "loopOption",
|
customType: AutomationCustomIOType.LOOP_OPTION,
|
||||||
title: "Input type",
|
title: "Input type",
|
||||||
},
|
},
|
||||||
binding: {
|
binding: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Binding / Value",
|
title: "Binding / Value",
|
||||||
},
|
},
|
||||||
iterations: {
|
iterations: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
title: "Max loop iterations",
|
title: "Max loop iterations",
|
||||||
},
|
},
|
||||||
failure: {
|
failure: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Failure Condition",
|
title: "Failure Condition",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -33,20 +39,20 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
items: {
|
items: {
|
||||||
customType: "item",
|
customType: AutomationCustomIOType.ITEM,
|
||||||
description: "The item currently being executed",
|
description: "The item currently being executed",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the message loop was successfully",
|
description: "Whether the message loop was successfully",
|
||||||
},
|
},
|
||||||
iterations: {
|
iterations: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
descriptions: "The amount of times the block ran",
|
description: "The amount of times the block ran",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["success", "items", "iterations"],
|
required: ["success", "items", "iterations"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "LOGIC",
|
type: AutomationStepType.LOGIC,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,11 @@ import { getFetchResponse } from "./utils"
|
||||||
import * as automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
enum RequestType {
|
enum RequestType {
|
||||||
|
@ -27,7 +30,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Send a {{inputs.requestMethod}} request",
|
tagline: "Send a {{inputs.requestMethod}} request",
|
||||||
icon: "Send",
|
icon: "Send",
|
||||||
description: "Send a request of specified method to a URL",
|
description: "Send a request of specified method to a URL",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
|
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
|
||||||
inputs: {
|
inputs: {
|
||||||
|
@ -40,23 +43,23 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
requestMethod: {
|
requestMethod: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
enum: Object.values(RequestType),
|
enum: Object.values(RequestType),
|
||||||
title: "Request method",
|
title: "Request method",
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "URL",
|
title: "URL",
|
||||||
},
|
},
|
||||||
requestBody: {
|
requestBody: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "JSON Body",
|
title: "JSON Body",
|
||||||
customType: "wide",
|
customType: AutomationCustomIOType.WIDE,
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Headers",
|
title: "Headers",
|
||||||
customType: "wide",
|
customType: AutomationCustomIOType.WIDE,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["requestMethod", "url"],
|
required: ["requestMethod", "url"],
|
||||||
|
@ -64,15 +67,15 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "The response from the webhook",
|
description: "The response from the webhook",
|
||||||
},
|
},
|
||||||
httpStatus: {
|
httpStatus: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
description: "The HTTP status code returned",
|
description: "The HTTP status code returned",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,8 +5,11 @@ import { buildCtx } from "./utils"
|
||||||
import * as automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
SearchFilters,
|
SearchFilters,
|
||||||
Table,
|
Table,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -36,7 +39,7 @@ export const definition: AutomationStepSchema = {
|
||||||
icon: "Search",
|
icon: "Search",
|
||||||
name: "Query rows",
|
name: "Query rows",
|
||||||
tagline: "Query rows from {{inputs.enriched.table.name}} table",
|
tagline: "Query rows from {{inputs.enriched.table.name}} table",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
stepId: AutomationActionStepId.QUERY_ROWS,
|
stepId: AutomationActionStepId.QUERY_ROWS,
|
||||||
internal: true,
|
internal: true,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -44,35 +47,35 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
tableId: {
|
tableId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "table",
|
customType: AutomationCustomIOType.TABLE,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "filters",
|
customType: AutomationCustomIOType.FILTERS,
|
||||||
title: "Filtering",
|
title: "Filtering",
|
||||||
},
|
},
|
||||||
sortColumn: {
|
sortColumn: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Sort Column",
|
title: "Sort Column",
|
||||||
customType: "column",
|
customType: AutomationCustomIOType.COLUMN,
|
||||||
},
|
},
|
||||||
sortOrder: {
|
sortOrder: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Sort Order",
|
title: "Sort Order",
|
||||||
enum: Object.values(SortOrder),
|
enum: Object.values(SortOrder),
|
||||||
pretty: Object.values(SortOrderPretty),
|
pretty: Object.values(SortOrderPretty),
|
||||||
},
|
},
|
||||||
limit: {
|
limit: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
title: "Limit",
|
title: "Limit",
|
||||||
customType: "queryLimit",
|
customType: AutomationCustomIOType.QUERY_LIMIT,
|
||||||
},
|
},
|
||||||
onEmptyFilter: {
|
onEmptyFilter: {
|
||||||
pretty: Object.values(EmptyFilterOptionPretty),
|
pretty: Object.values(EmptyFilterOptionPretty),
|
||||||
enum: Object.values(EmptyFilterOption),
|
enum: Object.values(EmptyFilterOption),
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "When Filter Empty",
|
title: "When Filter Empty",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -81,12 +84,12 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
rows: {
|
rows: {
|
||||||
type: "array",
|
type: AutomationIOType.ARRAY,
|
||||||
customType: "rows",
|
customType: AutomationCustomIOType.ROWS,
|
||||||
description: "The rows that were found",
|
description: "The rows that were found",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the query was successful",
|
description: "Whether the query was successful",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,6 +4,8 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -11,7 +13,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Send SMTP email to {{inputs.to}}",
|
tagline: "Send SMTP email to {{inputs.to}}",
|
||||||
icon: "Email",
|
icon: "Email",
|
||||||
name: "Send Email (SMTP)",
|
name: "Send Email (SMTP)",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
|
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -19,27 +21,27 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
to: {
|
to: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Send To",
|
title: "Send To",
|
||||||
},
|
},
|
||||||
from: {
|
from: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Send From",
|
title: "Send From",
|
||||||
},
|
},
|
||||||
cc: {
|
cc: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "CC",
|
title: "CC",
|
||||||
},
|
},
|
||||||
bcc: {
|
bcc: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "BCC",
|
title: "BCC",
|
||||||
},
|
},
|
||||||
subject: {
|
subject: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Email Subject",
|
title: "Email Subject",
|
||||||
},
|
},
|
||||||
contents: {
|
contents: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "HTML Contents",
|
title: "HTML Contents",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -48,11 +50,11 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the email was sent",
|
description: "Whether the email was sent",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "A response from the email client, this may be an error",
|
description: "A response from the email client, this may be an error",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,8 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +17,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Console log a value in the backend",
|
tagline: "Console log a value in the backend",
|
||||||
icon: "Monitoring",
|
icon: "Monitoring",
|
||||||
description: "Logs the given text to the server (using console.log)",
|
description: "Logs the given text to the server (using console.log)",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.SERVER_LOG,
|
stepId: AutomationActionStepId.SERVER_LOG,
|
||||||
inputs: {
|
inputs: {
|
||||||
|
@ -25,7 +27,7 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
text: {
|
text: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Log",
|
title: "Log",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -34,11 +36,11 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "What was output",
|
description: "What was output",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,6 +4,8 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -12,18 +14,18 @@ export const definition: AutomationStepSchema = {
|
||||||
description: "Send a message to Slack",
|
description: "Send a message to Slack",
|
||||||
icon: "ri-slack-line",
|
icon: "ri-slack-line",
|
||||||
stepId: AutomationActionStepId.slack,
|
stepId: AutomationActionStepId.slack,
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
url: {
|
url: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Incoming Webhook URL",
|
title: "Incoming Webhook URL",
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Message",
|
title: "Message",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -32,15 +34,15 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
httpStatus: {
|
httpStatus: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
description: "The HTTP status code of the request",
|
description: "The HTTP status code of the request",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the message sent successfully",
|
description: "Whether the message sent successfully",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The response from the Slack Webhook",
|
description: "The response from the Slack Webhook",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,8 +3,11 @@ import * as automationUtils from "../automationUtils"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepSchema,
|
||||||
|
AutomationStepType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
|
@ -12,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
||||||
tagline: "Update a {{inputs.enriched.table.name}} row",
|
tagline: "Update a {{inputs.enriched.table.name}} row",
|
||||||
icon: "Refresh",
|
icon: "Refresh",
|
||||||
description: "Update a row in your database",
|
description: "Update a row in your database",
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: true,
|
internal: true,
|
||||||
stepId: AutomationActionStepId.UPDATE_ROW,
|
stepId: AutomationActionStepId.UPDATE_ROW,
|
||||||
inputs: {},
|
inputs: {},
|
||||||
|
@ -20,16 +23,16 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
meta: {
|
meta: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
title: "Field settings",
|
title: "Field settings",
|
||||||
},
|
},
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
},
|
},
|
||||||
rowId: {
|
rowId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Row ID",
|
title: "Row ID",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -38,24 +41,24 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
description: "The updated row",
|
description: "The updated row",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "The response from the table",
|
description: "The response from the table",
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
type: "boolean",
|
type: AutomationIOType.BOOLEAN,
|
||||||
description: "Whether the action was successful",
|
description: "Whether the action was successful",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The identifier of the updated row",
|
description: "The identifier of the updated row",
|
||||||
},
|
},
|
||||||
revision: {
|
revision: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The revision of the updated row",
|
description: "The revision of the updated row",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,12 +4,14 @@ import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStepSchema,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
|
AutomationStepType,
|
||||||
|
AutomationIOType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStepSchema = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Zapier Webhook",
|
name: "Zapier Webhook",
|
||||||
stepId: AutomationActionStepId.zapier,
|
stepId: AutomationActionStepId.zapier,
|
||||||
type: "ACTION",
|
type: AutomationStepType.ACTION,
|
||||||
internal: false,
|
internal: false,
|
||||||
description: "Trigger a Zapier Zap via webhooks",
|
description: "Trigger a Zapier Zap via webhooks",
|
||||||
tagline: "Trigger a Zapier Zap",
|
tagline: "Trigger a Zapier Zap",
|
||||||
|
@ -19,27 +21,27 @@ export const definition: AutomationStepSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
url: {
|
url: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Webhook URL",
|
title: "Webhook URL",
|
||||||
},
|
},
|
||||||
value1: {
|
value1: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Payload Value 1",
|
title: "Payload Value 1",
|
||||||
},
|
},
|
||||||
value2: {
|
value2: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Payload Value 2",
|
title: "Payload Value 2",
|
||||||
},
|
},
|
||||||
value3: {
|
value3: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Payload Value 3",
|
title: "Payload Value 3",
|
||||||
},
|
},
|
||||||
value4: {
|
value4: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Payload Value 4",
|
title: "Payload Value 4",
|
||||||
},
|
},
|
||||||
value5: {
|
value5: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
title: "Payload Value 5",
|
title: "Payload Value 5",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -48,11 +50,11 @@ export const definition: AutomationStepSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
httpStatus: {
|
httpStatus: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
description: "The HTTP status code of the request",
|
description: "The HTTP status code of the request",
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "The response from Zapier",
|
description: "The response from Zapier",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import {
|
import {
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepType,
|
||||||
AutomationTriggerSchema,
|
AutomationTriggerSchema,
|
||||||
AutomationTriggerStepId,
|
AutomationTriggerStepId,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -15,8 +18,8 @@ export const definition: AutomationTriggerSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
fields: {
|
fields: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "triggerSchema",
|
customType: AutomationCustomIOType.TRIGGER_SCHEMA,
|
||||||
title: "Fields",
|
title: "Fields",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -25,13 +28,13 @@ export const definition: AutomationTriggerSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
fields: {
|
fields: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "Fields submitted from the app frontend",
|
description: "Fields submitted from the app frontend",
|
||||||
customType: "triggerSchema",
|
customType: AutomationCustomIOType.TRIGGER_SCHEMA,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["fields"],
|
required: ["fields"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "TRIGGER",
|
type: AutomationStepType.TRIGGER,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import {
|
import {
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepType,
|
||||||
AutomationTriggerSchema,
|
AutomationTriggerSchema,
|
||||||
AutomationTriggerStepId,
|
AutomationTriggerStepId,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -15,8 +18,8 @@ export const definition: AutomationTriggerSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
cron: {
|
cron: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "cron",
|
customType: AutomationCustomIOType.CRON,
|
||||||
title: "Expression",
|
title: "Expression",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -25,12 +28,12 @@ export const definition: AutomationTriggerSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
timestamp: {
|
timestamp: {
|
||||||
type: "number",
|
type: AutomationIOType.NUMBER,
|
||||||
description: "Timestamp the cron was executed",
|
description: "Timestamp the cron was executed",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["timestamp"],
|
required: ["timestamp"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "TRIGGER",
|
type: AutomationStepType.TRIGGER,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import {
|
import {
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepType,
|
||||||
AutomationTriggerSchema,
|
AutomationTriggerSchema,
|
||||||
AutomationTriggerStepId,
|
AutomationTriggerStepId,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -15,8 +18,8 @@ export const definition: AutomationTriggerSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
tableId: {
|
tableId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "table",
|
customType: AutomationCustomIOType.TABLE,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -25,13 +28,13 @@ export const definition: AutomationTriggerSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
description: "The row that was deleted",
|
description: "The row that was deleted",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["row"],
|
required: ["row"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "TRIGGER",
|
type: AutomationStepType.TRIGGER,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import {
|
import {
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepType,
|
||||||
AutomationTriggerSchema,
|
AutomationTriggerSchema,
|
||||||
AutomationTriggerStepId,
|
AutomationTriggerStepId,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -15,8 +18,8 @@ export const definition: AutomationTriggerSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
tableId: {
|
tableId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "table",
|
customType: AutomationCustomIOType.TABLE,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -25,21 +28,21 @@ export const definition: AutomationTriggerSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
description: "The new row that was created",
|
description: "The new row that was created",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "Row ID - can be used for updating",
|
description: "Row ID - can be used for updating",
|
||||||
},
|
},
|
||||||
revision: {
|
revision: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "Revision of row",
|
description: "Revision of row",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["row", "id"],
|
required: ["row", "id"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "TRIGGER",
|
type: AutomationStepType.TRIGGER,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import {
|
import {
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepType,
|
||||||
AutomationTriggerSchema,
|
AutomationTriggerSchema,
|
||||||
AutomationTriggerStepId,
|
AutomationTriggerStepId,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -15,8 +18,8 @@ export const definition: AutomationTriggerSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
tableId: {
|
tableId: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "table",
|
customType: AutomationCustomIOType.TABLE,
|
||||||
title: "Table",
|
title: "Table",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -25,21 +28,21 @@ export const definition: AutomationTriggerSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
row: {
|
row: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
customType: "row",
|
customType: AutomationCustomIOType.ROW,
|
||||||
description: "The row that was updated",
|
description: "The row that was updated",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "Row ID - can be used for updating",
|
description: "Row ID - can be used for updating",
|
||||||
},
|
},
|
||||||
revision: {
|
revision: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
description: "Revision of row",
|
description: "Revision of row",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["row", "id"],
|
required: ["row", "id"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "TRIGGER",
|
type: AutomationStepType.TRIGGER,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import {
|
import {
|
||||||
|
AutomationCustomIOType,
|
||||||
|
AutomationIOType,
|
||||||
|
AutomationStepType,
|
||||||
AutomationTriggerSchema,
|
AutomationTriggerSchema,
|
||||||
AutomationTriggerStepId,
|
AutomationTriggerStepId,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
@ -15,13 +18,13 @@ export const definition: AutomationTriggerSchema = {
|
||||||
inputs: {
|
inputs: {
|
||||||
properties: {
|
properties: {
|
||||||
schemaUrl: {
|
schemaUrl: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "webhookUrl",
|
customType: AutomationCustomIOType.WEBHOOK_URL,
|
||||||
title: "Schema URL",
|
title: "Schema URL",
|
||||||
},
|
},
|
||||||
triggerUrl: {
|
triggerUrl: {
|
||||||
type: "string",
|
type: AutomationIOType.STRING,
|
||||||
customType: "webhookUrl",
|
customType: AutomationCustomIOType.WEBHOOK_URL,
|
||||||
title: "Trigger URL",
|
title: "Trigger URL",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -30,12 +33,12 @@ export const definition: AutomationTriggerSchema = {
|
||||||
outputs: {
|
outputs: {
|
||||||
properties: {
|
properties: {
|
||||||
body: {
|
body: {
|
||||||
type: "object",
|
type: AutomationIOType.OBJECT,
|
||||||
description: "Body of the request which hit the webhook",
|
description: "Body of the request which hit the webhook",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["body"],
|
required: ["body"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "TRIGGER",
|
type: AutomationStepType.TRIGGER,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,32 @@
|
||||||
import { Document } from "../document"
|
import { Document } from "../document"
|
||||||
import { EventEmitter } from "events"
|
import { EventEmitter } from "events"
|
||||||
|
|
||||||
|
export enum AutomationIOType {
|
||||||
|
OBJECT = "object",
|
||||||
|
STRING = "string",
|
||||||
|
BOOLEAN = "boolean",
|
||||||
|
NUMBER = "number",
|
||||||
|
ARRAY = "array",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum AutomationCustomIOType {
|
||||||
|
TABLE = "table",
|
||||||
|
ROW = "row",
|
||||||
|
ROWS = "rows",
|
||||||
|
WIDE = "wide",
|
||||||
|
QUERY = "query",
|
||||||
|
QUERY_PARAMS = "queryParams",
|
||||||
|
QUERY_LIMIT = "queryLimit",
|
||||||
|
LOOP_OPTION = "loopOption",
|
||||||
|
ITEM = "item",
|
||||||
|
CODE = "code",
|
||||||
|
FILTERS = "filters",
|
||||||
|
COLUMN = "column",
|
||||||
|
TRIGGER_SCHEMA = "triggerSchema",
|
||||||
|
CRON = "cron",
|
||||||
|
WEBHOOK_URL = "webhookUrl",
|
||||||
|
}
|
||||||
|
|
||||||
export enum AutomationTriggerStepId {
|
export enum AutomationTriggerStepId {
|
||||||
ROW_SAVED = "ROW_SAVED",
|
ROW_SAVED = "ROW_SAVED",
|
||||||
ROW_UPDATED = "ROW_UPDATED",
|
ROW_UPDATED = "ROW_UPDATED",
|
||||||
|
@ -10,6 +36,12 @@ export enum AutomationTriggerStepId {
|
||||||
CRON = "CRON",
|
CRON = "CRON",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum AutomationStepType {
|
||||||
|
LOGIC = "LOGIC",
|
||||||
|
ACTION = "ACTION",
|
||||||
|
TRIGGER = "TRIGGER",
|
||||||
|
}
|
||||||
|
|
||||||
export enum AutomationActionStepId {
|
export enum AutomationActionStepId {
|
||||||
SEND_EMAIL_SMTP = "SEND_EMAIL_SMTP",
|
SEND_EMAIL_SMTP = "SEND_EMAIL_SMTP",
|
||||||
CREATE_ROW = "CREATE_ROW",
|
CREATE_ROW = "CREATE_ROW",
|
||||||
|
@ -31,6 +63,11 @@ export enum AutomationActionStepId {
|
||||||
integromat = "integromat",
|
integromat = "integromat",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const AutomationStepIdArray = [
|
||||||
|
...Object.values(AutomationActionStepId),
|
||||||
|
...Object.values(AutomationTriggerStepId),
|
||||||
|
]
|
||||||
|
|
||||||
export interface Automation extends Document {
|
export interface Automation extends Document {
|
||||||
definition: {
|
definition: {
|
||||||
steps: AutomationStep[]
|
steps: AutomationStep[]
|
||||||
|
@ -41,12 +78,32 @@ export interface Automation extends Document {
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface BaseIOStructure {
|
||||||
|
type?: AutomationIOType
|
||||||
|
customType?: AutomationCustomIOType
|
||||||
|
title?: string
|
||||||
|
description?: string
|
||||||
|
enum?: string[]
|
||||||
|
pretty?: string[]
|
||||||
|
properties?: {
|
||||||
|
[key: string]: BaseIOStructure
|
||||||
|
}
|
||||||
|
required?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InputOutputBlock {
|
||||||
|
properties: {
|
||||||
|
[key: string]: BaseIOStructure
|
||||||
|
}
|
||||||
|
required?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
export interface AutomationStepSchema {
|
export interface AutomationStepSchema {
|
||||||
name: string
|
name: string
|
||||||
tagline: string
|
tagline: string
|
||||||
icon: string
|
icon: string
|
||||||
description: string
|
description: string
|
||||||
type: string
|
type: AutomationStepType
|
||||||
internal?: boolean
|
internal?: boolean
|
||||||
deprecated?: boolean
|
deprecated?: boolean
|
||||||
stepId: AutomationTriggerStepId | AutomationActionStepId
|
stepId: AutomationTriggerStepId | AutomationActionStepId
|
||||||
|
@ -55,13 +112,8 @@ export interface AutomationStepSchema {
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
}
|
}
|
||||||
schema: {
|
schema: {
|
||||||
inputs: {
|
inputs: InputOutputBlock
|
||||||
[key: string]: any
|
outputs: InputOutputBlock
|
||||||
}
|
|
||||||
outputs: {
|
|
||||||
[key: string]: any
|
|
||||||
}
|
|
||||||
required?: string[]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { Document } from "../document"
|
||||||
export enum PluginType {
|
export enum PluginType {
|
||||||
DATASOURCE = "datasource",
|
DATASOURCE = "datasource",
|
||||||
COMPONENT = "component",
|
COMPONENT = "component",
|
||||||
|
AUTOMATION = "automation",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PluginSource {
|
export enum PluginSource {
|
||||||
|
|
Loading…
Reference in New Issue