Fixes based on server build so far.
This commit is contained in:
parent
ea66f7ac38
commit
4868083208
|
@ -19,7 +19,7 @@ export async function created(
|
||||||
const properties: AutomationCreatedEvent = {
|
const properties: AutomationCreatedEvent = {
|
||||||
appId: automation.appId,
|
appId: automation.appId,
|
||||||
automationId: automation._id as string,
|
automationId: automation._id as string,
|
||||||
triggerId: automation.definition?.trigger?.id!,
|
triggerId: automation.definition?.trigger?.id,
|
||||||
triggerType: automation.definition?.trigger?.stepId,
|
triggerType: automation.definition?.trigger?.stepId,
|
||||||
}
|
}
|
||||||
await publishEvent(Event.AUTOMATION_CREATED, properties, timestamp)
|
await publishEvent(Event.AUTOMATION_CREATED, properties, timestamp)
|
||||||
|
@ -29,7 +29,7 @@ export async function triggerUpdated(automation: Automation) {
|
||||||
const properties: AutomationTriggerUpdatedEvent = {
|
const properties: AutomationTriggerUpdatedEvent = {
|
||||||
appId: automation.appId,
|
appId: automation.appId,
|
||||||
automationId: automation._id as string,
|
automationId: automation._id as string,
|
||||||
triggerId: automation.definition?.trigger?.id!,
|
triggerId: automation.definition?.trigger?.id,
|
||||||
triggerType: automation.definition?.trigger?.stepId,
|
triggerType: automation.definition?.trigger?.stepId,
|
||||||
}
|
}
|
||||||
await publishEvent(Event.AUTOMATION_TRIGGER_UPDATED, properties)
|
await publishEvent(Event.AUTOMATION_TRIGGER_UPDATED, properties)
|
||||||
|
@ -39,7 +39,7 @@ export async function deleted(automation: Automation) {
|
||||||
const properties: AutomationDeletedEvent = {
|
const properties: AutomationDeletedEvent = {
|
||||||
appId: automation.appId,
|
appId: automation.appId,
|
||||||
automationId: automation._id as string,
|
automationId: automation._id as string,
|
||||||
triggerId: automation.definition?.trigger?.id!,
|
triggerId: automation.definition?.trigger?.id,
|
||||||
triggerType: automation.definition?.trigger?.stepId,
|
triggerType: automation.definition?.trigger?.stepId,
|
||||||
}
|
}
|
||||||
await publishEvent(Event.AUTOMATION_DELETED, properties)
|
await publishEvent(Event.AUTOMATION_DELETED, properties)
|
||||||
|
@ -49,7 +49,7 @@ export async function tested(automation: Automation) {
|
||||||
const properties: AutomationTestedEvent = {
|
const properties: AutomationTestedEvent = {
|
||||||
appId: automation.appId,
|
appId: automation.appId,
|
||||||
automationId: automation._id as string,
|
automationId: automation._id as string,
|
||||||
triggerId: automation.definition?.trigger?.id!,
|
triggerId: automation.definition?.trigger?.id,
|
||||||
triggerType: automation.definition?.trigger?.stepId,
|
triggerType: automation.definition?.trigger?.stepId,
|
||||||
}
|
}
|
||||||
await publishEvent(Event.AUTOMATION_TESTED, properties)
|
await publishEvent(Event.AUTOMATION_TESTED, properties)
|
||||||
|
@ -70,7 +70,7 @@ export async function stepCreated(
|
||||||
const properties: AutomationStepCreatedEvent = {
|
const properties: AutomationStepCreatedEvent = {
|
||||||
appId: automation.appId,
|
appId: automation.appId,
|
||||||
automationId: automation._id as string,
|
automationId: automation._id as string,
|
||||||
triggerId: automation.definition?.trigger?.id!,
|
triggerId: automation.definition?.trigger?.id,
|
||||||
triggerType: automation.definition?.trigger?.stepId,
|
triggerType: automation.definition?.trigger?.stepId,
|
||||||
stepId: step.id!,
|
stepId: step.id!,
|
||||||
stepType: step.stepId,
|
stepType: step.stepId,
|
||||||
|
@ -85,7 +85,7 @@ export async function stepDeleted(
|
||||||
const properties: AutomationStepDeletedEvent = {
|
const properties: AutomationStepDeletedEvent = {
|
||||||
appId: automation.appId,
|
appId: automation.appId,
|
||||||
automationId: automation._id as string,
|
automationId: automation._id as string,
|
||||||
triggerId: automation.definition?.trigger?.id!,
|
triggerId: automation.definition?.trigger?.id,
|
||||||
triggerType: automation.definition?.trigger?.stepId,
|
triggerType: automation.definition?.trigger?.stepId,
|
||||||
stepId: step.id!,
|
stepId: step.id!,
|
||||||
stepType: step.stepId,
|
stepType: step.stepId,
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
const { getDefinitions } = require("../../integrations")
|
|
||||||
|
|
||||||
exports.fetch = async function (ctx) {
|
|
||||||
ctx.status = 200
|
|
||||||
const defs = await getDefinitions()
|
|
||||||
|
|
||||||
ctx.body = defs
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.find = async function (ctx) {
|
|
||||||
const defs = await getDefinitions()
|
|
||||||
ctx.status = 200
|
|
||||||
ctx.body = defs[ctx.params.type]
|
|
||||||
}
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { getDefinitions } from "../../integrations"
|
||||||
|
import { BBContext } from "@budibase/types"
|
||||||
|
|
||||||
|
export async function fetch(ctx: BBContext) {
|
||||||
|
ctx.status = 200
|
||||||
|
ctx.body = await getDefinitions()
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function find(ctx: BBContext) {
|
||||||
|
const defs = await getDefinitions()
|
||||||
|
ctx.status = 200
|
||||||
|
ctx.body = defs[ctx.params.type]
|
||||||
|
}
|
|
@ -1,13 +0,0 @@
|
||||||
const { migrate, MIGRATIONS } = require("../../migrations")
|
|
||||||
|
|
||||||
exports.migrate = async ctx => {
|
|
||||||
const options = ctx.request.body
|
|
||||||
// don't await as can take a while, just return
|
|
||||||
migrate(options)
|
|
||||||
ctx.status = 200
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.fetchDefinitions = async ctx => {
|
|
||||||
ctx.body = MIGRATIONS
|
|
||||||
ctx.status = 200
|
|
||||||
}
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { migrate as migrationImpl, MIGRATIONS } from "../../migrations"
|
||||||
|
import { BBContext } from "@budibase/types"
|
||||||
|
|
||||||
|
export async function migrate(ctx: BBContext) {
|
||||||
|
const options = ctx.request.body
|
||||||
|
// don't await as can take a while, just return
|
||||||
|
migrationImpl(options)
|
||||||
|
ctx.status = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function fetchDefinitions(ctx: BBContext) {
|
||||||
|
ctx.body = MIGRATIONS
|
||||||
|
ctx.status = 200
|
||||||
|
}
|
|
@ -209,12 +209,16 @@ module External {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExternalRequest {
|
class ExternalRequest {
|
||||||
private operation: Operation
|
private operation: DataSourceOperation
|
||||||
private tableId: string
|
private tableId: string
|
||||||
private datasource: Datasource
|
private datasource: Datasource
|
||||||
private tables: { [key: string]: Table } = {}
|
private tables: { [key: string]: Table } = {}
|
||||||
|
|
||||||
constructor(operation: Operation, tableId: string, datasource: Datasource) {
|
constructor(
|
||||||
|
operation: DataSourceOperation,
|
||||||
|
tableId: string,
|
||||||
|
datasource: Datasource
|
||||||
|
) {
|
||||||
this.operation = operation
|
this.operation = operation
|
||||||
this.tableId = tableId
|
this.tableId = tableId
|
||||||
this.datasource = datasource
|
this.datasource = datasource
|
||||||
|
|
|
@ -122,9 +122,9 @@ export async function finaliseRow(
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
row.type = "row"
|
row.type = "row"
|
||||||
// process the row before return, to include relationships
|
// process the row before return, to include relationships
|
||||||
let enrichedRow = await outputProcessing(table, cloneDeep(row), {
|
let enrichedRow = (await outputProcessing(table, cloneDeep(row), {
|
||||||
squash: false,
|
squash: false,
|
||||||
})
|
})) as Row
|
||||||
// use enriched row to generate formulas for saving, specifically only use as context
|
// use enriched row to generate formulas for saving, specifically only use as context
|
||||||
row = processFormulas(table, row, {
|
row = processFormulas(table, row, {
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
RelationshipTypes,
|
RelationshipTypes,
|
||||||
} from "../../../constants"
|
} from "../../../constants"
|
||||||
import { makeExternalQuery } from "../../../integrations/base/query"
|
import { makeExternalQuery } from "../../../integrations/base/query"
|
||||||
import csvParser from "../../../utilities/csvParser"
|
import * as csvParser from "../../../utilities/csvParser"
|
||||||
import { handleRequest } from "../row/external"
|
import { handleRequest } from "../row/external"
|
||||||
import { events, context } from "@budibase/backend-core"
|
import { events, context } from "@budibase/backend-core"
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as internal from "./internal"
|
import * as internal from "./internal"
|
||||||
import * as external from "./external"
|
import * as external from "./external"
|
||||||
import csvParser from "../../../utilities/csvParser"
|
import * as csvParser from "../../../utilities/csvParser"
|
||||||
import { isExternalTable, isSQL } from "../../../integrations/utils"
|
import { isExternalTable, isSQL } from "../../../integrations/utils"
|
||||||
import { getDatasourceParams } from "../../../db/utils"
|
import { getDatasourceParams } from "../../../db/utils"
|
||||||
import { context, events } from "@budibase/backend-core"
|
import { context, events } from "@budibase/backend-core"
|
||||||
|
@ -103,7 +103,10 @@ export async function validateCSVSchema(ctx: BBContext) {
|
||||||
if (tableId) {
|
if (tableId) {
|
||||||
existingTable = await sdk.tables.getTable(tableId)
|
existingTable = await sdk.tables.getTable(tableId)
|
||||||
}
|
}
|
||||||
let result = await csvParser.parse(csvString, schema)
|
let result: Record<string, any> | undefined = await csvParser.parse(
|
||||||
|
csvString,
|
||||||
|
schema
|
||||||
|
)
|
||||||
if (existingTable) {
|
if (existingTable) {
|
||||||
result = csvParser.updateSchema({ schema: result, existingTable })
|
result = csvParser.updateSchema({ schema: result, existingTable })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getWebhookParams } from "../../db/utils"
|
import { getWebhookParams } from "../../db/utils"
|
||||||
import triggers from "../../automations/triggers"
|
import * as triggers from "../../automations/triggers"
|
||||||
import { db as dbCore, context } from "@budibase/backend-core"
|
import { db as dbCore, context } from "@budibase/backend-core"
|
||||||
import {
|
import {
|
||||||
Webhook,
|
Webhook,
|
||||||
|
|
|
@ -37,7 +37,7 @@ router
|
||||||
// re-direct before any middlewares occur
|
// re-direct before any middlewares occur
|
||||||
.redirect("/", "/builder")
|
.redirect("/", "/builder")
|
||||||
.use(
|
.use(
|
||||||
auth.buildAuthMiddleware(null, {
|
auth.buildAuthMiddleware([], {
|
||||||
publicAllowed: true,
|
publicAllowed: true,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -45,7 +45,7 @@ router
|
||||||
// the server can be public anywhere, so nowhere should throw errors
|
// the server can be public anywhere, so nowhere should throw errors
|
||||||
// if the tenancy has not been set, it'll have to be discovered at application layer
|
// if the tenancy has not been set, it'll have to be discovered at application layer
|
||||||
.use(
|
.use(
|
||||||
auth.buildTenancyMiddleware(null, null, {
|
auth.buildTenancyMiddleware([], [], {
|
||||||
noTenancyRequired: true,
|
noTenancyRequired: true,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Router from "@koa/router"
|
import Router from "@koa/router"
|
||||||
import controller from "../controllers/integration"
|
import * as controller from "../controllers/integration"
|
||||||
import authorized from "../../middleware/authorized"
|
import authorized from "../../middleware/authorized"
|
||||||
import { permissions } from "@budibase/backend-core"
|
import { permissions } from "@budibase/backend-core"
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ if (process.env.ELASTIC_APM_ENABLED) {
|
||||||
}
|
}
|
||||||
|
|
||||||
import { ExtendableContext } from "koa"
|
import { ExtendableContext } from "koa"
|
||||||
import db from "./db"
|
import * as db from "./db"
|
||||||
db.init()
|
db.init()
|
||||||
const Koa = require("koa")
|
const Koa = require("koa")
|
||||||
const destroyable = require("server-destroy")
|
const destroyable = require("server-destroy")
|
||||||
|
|
|
@ -15,7 +15,7 @@ import * as delay from "./steps/delay"
|
||||||
import * as queryRow from "./steps/queryRows"
|
import * as queryRow from "./steps/queryRows"
|
||||||
import * as loop from "./steps/loop"
|
import * as loop from "./steps/loop"
|
||||||
import env from "../environment"
|
import env from "../environment"
|
||||||
import { AutomationStep, AutomationStepInput } from "@budibase/types"
|
import { AutomationStepSchema, AutomationStepInput } from "@budibase/types"
|
||||||
|
|
||||||
const ACTION_IMPLS: Record<
|
const ACTION_IMPLS: Record<
|
||||||
string,
|
string,
|
||||||
|
@ -38,7 +38,7 @@ const ACTION_IMPLS: Record<
|
||||||
zapier: zapier.run,
|
zapier: zapier.run,
|
||||||
integromat: integromat.run,
|
integromat: integromat.run,
|
||||||
}
|
}
|
||||||
export const ACTION_DEFINITIONS: Record<string, AutomationStep> = {
|
export const ACTION_DEFINITIONS: Record<string, AutomationStepSchema> = {
|
||||||
SEND_EMAIL_SMTP: sendSmtpEmail.definition,
|
SEND_EMAIL_SMTP: sendSmtpEmail.definition,
|
||||||
CREATE_ROW: createRow.definition,
|
CREATE_ROW: createRow.definition,
|
||||||
UPDATE_ROW: updateRow.definition,
|
UPDATE_ROW: updateRow.definition,
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { execSync } from "child_process"
|
import { execSync } from "child_process"
|
||||||
import { processStringSync } from "@budibase/string-templates"
|
import { processStringSync } from "@budibase/string-templates"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import environment from "../../environment"
|
import environment from "../../environment"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Bash Scripting",
|
name: "Bash Scripting",
|
||||||
tagline: "Execute a bash command",
|
tagline: "Execute a bash command",
|
||||||
icon: "JourneyEvent",
|
icon: "JourneyEvent",
|
||||||
|
|
|
@ -3,11 +3,11 @@ import { cleanUpRow, getError } from "../automationUtils"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Create Row",
|
name: "Create Row",
|
||||||
tagline: "Create a {{inputs.enriched.table.name}} row",
|
tagline: "Create a {{inputs.enriched.table.name}} row",
|
||||||
icon: "TableRowAddBottom",
|
icon: "TableRowAddBottom",
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { wait } from "../../utilities"
|
import { wait } from "../../utilities"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Delay",
|
name: "Delay",
|
||||||
icon: "Clock",
|
icon: "Clock",
|
||||||
tagline: "Delay for {{inputs.time}} milliseconds",
|
tagline: "Delay for {{inputs.time}} milliseconds",
|
||||||
|
|
|
@ -3,11 +3,11 @@ import { buildCtx } from "./utils"
|
||||||
import { getError } from "../automationUtils"
|
import { getError } from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
description: "Delete a row from your database",
|
description: "Delete a row from your database",
|
||||||
icon: "TableRowRemoveCenter",
|
icon: "TableRowRemoveCenter",
|
||||||
name: "Delete Row",
|
name: "Delete Row",
|
||||||
|
|
|
@ -2,14 +2,14 @@ import fetch from "node-fetch"
|
||||||
import { getFetchResponse } from "./utils"
|
import { getFetchResponse } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
const DEFAULT_USERNAME = "Budibase Automate"
|
const DEFAULT_USERNAME = "Budibase Automate"
|
||||||
const DEFAULT_AVATAR_URL = "https://i.imgur.com/a1cmTKM.png"
|
const DEFAULT_AVATAR_URL = "https://i.imgur.com/a1cmTKM.png"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Discord Message",
|
name: "Discord Message",
|
||||||
tagline: "Send a message to a Discord server",
|
tagline: "Send a message to a Discord server",
|
||||||
description: "Send a message to a Discord server",
|
description: "Send a message to a Discord server",
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import * as queryController from "../../api/controllers/query"
|
import * as queryController from "../../api/controllers/query"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "External Data Connector",
|
name: "External Data Connector",
|
||||||
tagline: "Execute Data Connector",
|
tagline: "Execute Data Connector",
|
||||||
icon: "Data",
|
icon: "Data",
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import * as scriptController from "../../api/controllers/script"
|
import * as scriptController from "../../api/controllers/script"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "JS Scripting",
|
name: "JS Scripting",
|
||||||
tagline: "Execute JavaScript Code",
|
tagline: "Execute JavaScript Code",
|
||||||
icon: "Code",
|
icon: "Code",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export const PrettyFilterConditions = {
|
||||||
[FilterConditions.LESS_THAN]: "Less than",
|
[FilterConditions.LESS_THAN]: "Less than",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Condition",
|
name: "Condition",
|
||||||
tagline: "{{inputs.field}} {{inputs.condition}} {{inputs.value}}",
|
tagline: "{{inputs.field}} {{inputs.condition}} {{inputs.value}}",
|
||||||
icon: "Branch2",
|
icon: "Branch2",
|
||||||
|
|
|
@ -2,11 +2,11 @@ import fetch from "node-fetch"
|
||||||
import { getFetchResponse } from "./utils"
|
import { getFetchResponse } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Integromat Integration",
|
name: "Integromat Integration",
|
||||||
tagline: "Trigger an Integromat scenario",
|
tagline: "Trigger an Integromat scenario",
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AutomationActionStepId, AutomationStep } from "@budibase/types"
|
import { AutomationActionStepId, AutomationStepSchema } from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Looping",
|
name: "Looping",
|
||||||
icon: "Reuse",
|
icon: "Reuse",
|
||||||
tagline: "Loop the block",
|
tagline: "Loop the block",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import fetch from "node-fetch"
|
import fetch from "node-fetch"
|
||||||
import { getFetchResponse } from "./utils"
|
import { getFetchResponse } from "./utils"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ const BODY_REQUESTS = [RequestType.POST, RequestType.PUT, RequestType.PATCH]
|
||||||
* NOTE: this functionality is deprecated - it no longer should be used.
|
* NOTE: this functionality is deprecated - it no longer should be used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
deprecated: true,
|
deprecated: true,
|
||||||
name: "Outgoing webhook",
|
name: "Outgoing webhook",
|
||||||
tagline: "Send a {{inputs.requestMethod}} request",
|
tagline: "Send a {{inputs.requestMethod}} request",
|
||||||
|
|
|
@ -2,10 +2,10 @@ import * as rowController from "../../api/controllers/row"
|
||||||
import * as tableController from "../../api/controllers/table"
|
import * as tableController from "../../api/controllers/table"
|
||||||
import { FieldTypes } from "../../constants"
|
import { FieldTypes } from "../../constants"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
SearchFilters,
|
SearchFilters,
|
||||||
Table,
|
Table,
|
||||||
|
@ -31,7 +31,7 @@ const EmptyFilterOptionPretty = {
|
||||||
[EmptyFilterOption.RETURN_NONE]: "Return no rows",
|
[EmptyFilterOption.RETURN_NONE]: "Return no rows",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
description: "Query rows from the database",
|
description: "Query rows from the database",
|
||||||
icon: "Search",
|
icon: "Search",
|
||||||
name: "Query rows",
|
name: "Query rows",
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { sendSmtpEmail } from "../../utilities/workerRequests"
|
import { sendSmtpEmail } from "../../utilities/workerRequests"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
description: "Send an email using SMTP",
|
description: "Send an email using SMTP",
|
||||||
tagline: "Send SMTP email to {{inputs.to}}",
|
tagline: "Send SMTP email to {{inputs.to}}",
|
||||||
icon: "Email",
|
icon: "Email",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import {
|
||||||
* GET/DELETE requests cannot handle body elements so they will not be sent if configured.
|
* GET/DELETE requests cannot handle body elements so they will not be sent if configured.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Backend log",
|
name: "Backend log",
|
||||||
tagline: "Console log a value in the backend",
|
tagline: "Console log a value in the backend",
|
||||||
icon: "Monitoring",
|
icon: "Monitoring",
|
||||||
|
|
|
@ -2,11 +2,11 @@ import fetch from "node-fetch"
|
||||||
import { getFetchResponse } from "./utils"
|
import { getFetchResponse } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Slack Message",
|
name: "Slack Message",
|
||||||
tagline: "Send a message to Slack",
|
tagline: "Send a message to Slack",
|
||||||
description: "Send a message to Slack",
|
description: "Send a message to Slack",
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import * as rowController from "../../api/controllers/row"
|
import * as rowController from "../../api/controllers/row"
|
||||||
import automationUtils from "../automationUtils"
|
import * as automationUtils from "../automationUtils"
|
||||||
import { buildCtx } from "./utils"
|
import { buildCtx } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Update Row",
|
name: "Update Row",
|
||||||
tagline: "Update a {{inputs.enriched.table.name}} row",
|
tagline: "Update a {{inputs.enriched.table.name}} row",
|
||||||
icon: "Refresh",
|
icon: "Refresh",
|
||||||
|
|
|
@ -2,11 +2,11 @@ import fetch from "node-fetch"
|
||||||
import { getFetchResponse } from "./utils"
|
import { getFetchResponse } from "./utils"
|
||||||
import {
|
import {
|
||||||
AutomationActionStepId,
|
AutomationActionStepId,
|
||||||
AutomationStep,
|
AutomationStepSchema,
|
||||||
AutomationStepInput,
|
AutomationStepInput,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationStep = {
|
export const definition: AutomationStepSchema = {
|
||||||
name: "Zapier Webhook",
|
name: "Zapier Webhook",
|
||||||
stepId: AutomationActionStepId.zapier,
|
stepId: AutomationActionStepId.zapier,
|
||||||
type: "ACTION",
|
type: "ACTION",
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { AutomationTrigger, AutomationTriggerStepId } from "@budibase/types"
|
import {
|
||||||
|
AutomationTriggerSchema,
|
||||||
|
AutomationTriggerStepId,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationTrigger = {
|
export const definition: AutomationTriggerSchema = {
|
||||||
name: "App Action",
|
name: "App Action",
|
||||||
event: "app:trigger",
|
event: "app:trigger",
|
||||||
icon: "Apps",
|
icon: "Apps",
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { AutomationTrigger, AutomationTriggerStepId } from "@budibase/types"
|
import {
|
||||||
|
AutomationTriggerSchema,
|
||||||
|
AutomationTriggerStepId,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationTrigger = {
|
export const definition: AutomationTriggerSchema = {
|
||||||
name: "Cron Trigger",
|
name: "Cron Trigger",
|
||||||
event: "cron:trigger",
|
event: "cron:trigger",
|
||||||
icon: "Clock",
|
icon: "Clock",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import app from "./app"
|
import * as app from "./app"
|
||||||
import cron from "./cron"
|
import * as cron from "./cron"
|
||||||
import rowDeleted from "./rowDeleted"
|
import * as rowDeleted from "./rowDeleted"
|
||||||
import rowSaved from "./rowSaved"
|
import * as rowSaved from "./rowSaved"
|
||||||
import rowUpdated from "./rowUpdated"
|
import * as rowUpdated from "./rowUpdated"
|
||||||
import webhook from "./webhook"
|
import * as webhook from "./webhook"
|
||||||
|
|
||||||
export const definitions = {
|
export const definitions = {
|
||||||
ROW_SAVED: rowSaved.definition,
|
ROW_SAVED: rowSaved.definition,
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { AutomationTrigger, AutomationTriggerStepId } from "@budibase/types"
|
import {
|
||||||
|
AutomationTriggerSchema,
|
||||||
|
AutomationTriggerStepId,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationTrigger = {
|
export const definition: AutomationTriggerSchema = {
|
||||||
name: "Row Deleted",
|
name: "Row Deleted",
|
||||||
event: "row:delete",
|
event: "row:delete",
|
||||||
icon: "TableRowRemoveCenter",
|
icon: "TableRowRemoveCenter",
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { AutomationTrigger, AutomationTriggerStepId } from "@budibase/types"
|
import {
|
||||||
|
AutomationTriggerSchema,
|
||||||
|
AutomationTriggerStepId,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationTrigger = {
|
export const definition: AutomationTriggerSchema = {
|
||||||
name: "Row Created",
|
name: "Row Created",
|
||||||
event: "row:save",
|
event: "row:save",
|
||||||
icon: "TableRowAddBottom",
|
icon: "TableRowAddBottom",
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { AutomationTrigger, AutomationTriggerStepId } from "@budibase/types"
|
import {
|
||||||
|
AutomationTriggerSchema,
|
||||||
|
AutomationTriggerStepId,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationTrigger = {
|
export const definition: AutomationTriggerSchema = {
|
||||||
name: "Row Updated",
|
name: "Row Updated",
|
||||||
event: "row:update",
|
event: "row:update",
|
||||||
icon: "Refresh",
|
icon: "Refresh",
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { AutomationTrigger, AutomationTriggerStepId } from "@budibase/types"
|
import {
|
||||||
|
AutomationTriggerSchema,
|
||||||
|
AutomationTriggerStepId,
|
||||||
|
} from "@budibase/types"
|
||||||
|
|
||||||
export const definition: AutomationTrigger = {
|
export const definition: AutomationTriggerSchema = {
|
||||||
name: "Webhook",
|
name: "Webhook",
|
||||||
event: "web:trigger",
|
event: "web:trigger",
|
||||||
icon: "Send",
|
icon: "Send",
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
type LinkControllerOpts = {
|
type LinkControllerOpts = {
|
||||||
tableId: string
|
tableId?: string
|
||||||
row?: Row
|
row?: Row
|
||||||
table?: Table
|
table?: Table
|
||||||
oldTable?: Table
|
oldTable?: Table
|
||||||
|
@ -21,7 +21,7 @@ type LinkControllerOpts = {
|
||||||
|
|
||||||
class LinkController {
|
class LinkController {
|
||||||
_db: Database
|
_db: Database
|
||||||
_tableId: string
|
_tableId?: string
|
||||||
_row?: Row
|
_row?: Row
|
||||||
_table?: Table
|
_table?: Table
|
||||||
_oldTable?: Table
|
_oldTable?: Table
|
||||||
|
|
|
@ -100,7 +100,7 @@ async function getFullLinkedDocs(links: LinkDocumentValue[]) {
|
||||||
* row operations and the table for table operations.
|
* row operations and the table for table operations.
|
||||||
*/
|
*/
|
||||||
export async function updateLinks(args: {
|
export async function updateLinks(args: {
|
||||||
tableId: string
|
tableId?: string
|
||||||
eventType: string
|
eventType: string
|
||||||
row?: Row
|
row?: Row
|
||||||
table?: Table
|
table?: Table
|
||||||
|
|
|
@ -21,7 +21,7 @@ class BudibaseEmitter extends EventEmitter {
|
||||||
tableEmission({ emitter: this, eventName, appId, table })
|
tableEmission({ emitter: this, eventName, appId, table })
|
||||||
}
|
}
|
||||||
|
|
||||||
emitPort(portNumber: number) {
|
emitPort(portNumber?: number | string) {
|
||||||
this.emit("internal:port", portNumber)
|
this.emit("internal:port", portNumber)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,6 +266,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
||||||
this.deleteTable(json?.table?.name),
|
this.deleteTable(json?.table?.name),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
const internalQueryMethod = handlers[json.endpoint.operation]
|
const internalQueryMethod = handlers[json.endpoint.operation]
|
||||||
|
|
||||||
return await internalQueryMethod()
|
return await internalQueryMethod()
|
||||||
|
|
|
@ -230,7 +230,7 @@ function shouldCopySpecialColumn(
|
||||||
const fetchedIsNumber =
|
const fetchedIsNumber =
|
||||||
!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER
|
!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER
|
||||||
return (
|
return (
|
||||||
specialTypes.indexOf(column.type) !== -1 ||
|
specialTypes.indexOf(column.type as FieldTypes) !== -1 ||
|
||||||
(fetchedIsNumber && column.type === FieldTypes.BOOLEAN)
|
(fetchedIsNumber && column.type === FieldTypes.BOOLEAN)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,11 @@ export function finaliseExternalTables(
|
||||||
if (table.primary == null || table.primary.length === 0) {
|
if (table.primary == null || table.primary.length === 0) {
|
||||||
errors[name] = BuildSchemaErrors.NO_KEY
|
errors[name] = BuildSchemaErrors.NO_KEY
|
||||||
continue
|
continue
|
||||||
} else if (schemaFields.find(field => invalidColumns.includes(field))) {
|
} else if (
|
||||||
|
schemaFields.find(field =>
|
||||||
|
invalidColumns.includes(field as InvalidColumns)
|
||||||
|
)
|
||||||
|
) {
|
||||||
errors[name] = BuildSchemaErrors.INVALID_COLUMN
|
errors[name] = BuildSchemaErrors.INVALID_COLUMN
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,11 @@ import {
|
||||||
} from "@budibase/backend-core"
|
} from "@budibase/backend-core"
|
||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import { watch } from "./watch"
|
import { watch } from "./watch"
|
||||||
import automations from "./automations"
|
import * as automations from "./automations"
|
||||||
import fileSystem from "./utilities/fileSystem"
|
import * as fileSystem from "./utilities/fileSystem"
|
||||||
import eventEmitter from "./events"
|
import eventEmitter from "./events"
|
||||||
import * as migrations from "./migrations"
|
import * as migrations from "./migrations"
|
||||||
import bullboard from "./automations/bullboard"
|
import * as bullboard from "./automations/bullboard"
|
||||||
import * as pro from "@budibase/pro"
|
import * as pro from "@budibase/pro"
|
||||||
import * as api from "./api"
|
import * as api from "./api"
|
||||||
import sdk from "./sdk"
|
import sdk from "./sdk"
|
||||||
|
|
|
@ -6,8 +6,8 @@ import {
|
||||||
disableCronById,
|
disableCronById,
|
||||||
isErrorInOutput,
|
isErrorInOutput,
|
||||||
} from "../automations/utils"
|
} from "../automations/utils"
|
||||||
import { default as actions } from "../automations/actions"
|
import * as actions from "../automations/actions"
|
||||||
import { default as automationUtils } from "../automations/automationUtils"
|
import * as automationUtils from "../automations/automationUtils"
|
||||||
import { default as AutomationEmitter } from "../events/AutomationEmitter"
|
import { default as AutomationEmitter } from "../events/AutomationEmitter"
|
||||||
import { generateAutomationMetadataID, isProdAppID } from "../db/utils"
|
import { generateAutomationMetadataID, isProdAppID } from "../db/utils"
|
||||||
import { definitions as triggerDefs } from "../automations/triggerInfo"
|
import { definitions as triggerDefs } from "../automations/triggerInfo"
|
||||||
|
@ -335,7 +335,7 @@ class Orchestrator {
|
||||||
)) {
|
)) {
|
||||||
originalStepInput[key][innerKey][innerObject] =
|
originalStepInput[key][innerKey][innerObject] =
|
||||||
automationUtils.substituteLoopStep(
|
automationUtils.substituteLoopStep(
|
||||||
innerValue,
|
innerValue as string,
|
||||||
`steps.${loopStepNumber}`
|
`steps.${loopStepNumber}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { QueryVariable } from "./definitions"
|
import { QueryVariable } from "./definitions"
|
||||||
import env from "../environment"
|
import env from "../environment"
|
||||||
import db from "../db"
|
import * as db from "../db"
|
||||||
import { redis, db as dbCore } from "@budibase/backend-core"
|
import { redis, db as dbCore } from "@budibase/backend-core"
|
||||||
|
|
||||||
const VARIABLE_TTL_SECONDS = 3600
|
const VARIABLE_TTL_SECONDS = 3600
|
||||||
|
|
|
@ -8,7 +8,7 @@ type CsvParseOpts = {
|
||||||
csvString?: string
|
csvString?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const VALIDATORS = {
|
const VALIDATORS: any = {
|
||||||
[FieldTypes.STRING]: () => true,
|
[FieldTypes.STRING]: () => true,
|
||||||
[FieldTypes.OPTIONS]: () => true,
|
[FieldTypes.OPTIONS]: () => true,
|
||||||
[FieldTypes.BARCODEQR]: () => true,
|
[FieldTypes.BARCODEQR]: () => true,
|
||||||
|
@ -28,7 +28,7 @@ const VALIDATORS = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const PARSERS = {
|
const PARSERS: any = {
|
||||||
[FieldTypes.NUMBER]: (attribute?: string) => {
|
[FieldTypes.NUMBER]: (attribute?: string) => {
|
||||||
if (!attribute) {
|
if (!attribute) {
|
||||||
return attribute
|
return attribute
|
||||||
|
@ -43,7 +43,7 @@ const PARSERS = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parse(csvString: string, parsers: any) {
|
export function parse(csvString: string, parsers: any): Record<string, any> {
|
||||||
const result = csv().fromString(csvString)
|
const result = csv().fromString(csvString)
|
||||||
|
|
||||||
const schema: Record<string, any> = {}
|
const schema: Record<string, any> = {}
|
||||||
|
@ -89,7 +89,7 @@ export function updateSchema({
|
||||||
existingTable,
|
existingTable,
|
||||||
}: {
|
}: {
|
||||||
schema?: Record<string, any>
|
schema?: Record<string, any>
|
||||||
existingTable: Table
|
existingTable?: Table
|
||||||
}) {
|
}) {
|
||||||
if (!schema) {
|
if (!schema) {
|
||||||
return schema
|
return schema
|
||||||
|
@ -97,7 +97,7 @@ export function updateSchema({
|
||||||
const finalSchema: Record<string, FieldSchema> = {}
|
const finalSchema: Record<string, FieldSchema> = {}
|
||||||
const schemaKeyMap: Record<string, any> = {}
|
const schemaKeyMap: Record<string, any> = {}
|
||||||
Object.keys(schema).forEach(key => (schemaKeyMap[key.toLowerCase()] = key))
|
Object.keys(schema).forEach(key => (schemaKeyMap[key.toLowerCase()] = key))
|
||||||
for (let [key, field] of Object.entries(existingTable.schema)) {
|
for (let [key, field] of Object.entries(existingTable?.schema || {})) {
|
||||||
const lcKey = key.toLowerCase()
|
const lcKey = key.toLowerCase()
|
||||||
const foundKey: string = schemaKeyMap[lcKey]
|
const foundKey: string = schemaKeyMap[lcKey]
|
||||||
if (foundKey) {
|
if (foundKey) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import linkRows from "../../db/linkedRows"
|
import * as linkRows from "../../db/linkedRows"
|
||||||
import { FieldTypes, AutoFieldSubTypes } from "../../constants"
|
import { FieldTypes, AutoFieldSubTypes } from "../../constants"
|
||||||
import { attachmentsRelativeURL } from "../index"
|
import { attachmentsRelativeURL } from "../index"
|
||||||
import { processFormulas, fixAutoColumnSubType } from "./utils"
|
import { processFormulas, fixAutoColumnSubType } from "./utils"
|
||||||
|
@ -189,10 +189,10 @@ export async function outputProcessing(
|
||||||
wasArray = false
|
wasArray = false
|
||||||
}
|
}
|
||||||
// attach any linked row information
|
// attach any linked row information
|
||||||
let enriched = await linkRows.attachFullLinkedDocs(table, rows)
|
let enriched = await linkRows.attachFullLinkedDocs(table, rows as Row[])
|
||||||
|
|
||||||
// process formulas
|
// process formulas
|
||||||
enriched = processFormulas(table, enriched, { dynamic: true })
|
enriched = processFormulas(table, enriched, { dynamic: true }) as Row[]
|
||||||
|
|
||||||
// update the attachments URL depending on hosting
|
// update the attachments URL depending on hosting
|
||||||
for (let [property, column] of Object.entries(table.schema)) {
|
for (let [property, column] of Object.entries(table.schema)) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { FieldTypes } from "../../constants"
|
||||||
/**
|
/**
|
||||||
* A map of how we convert various properties in rows to each other based on the row type.
|
* A map of how we convert various properties in rows to each other based on the row type.
|
||||||
*/
|
*/
|
||||||
exports.TYPE_TRANSFORM_MAP = {
|
export const TYPE_TRANSFORM_MAP: any = {
|
||||||
[FieldTypes.LINK]: {
|
[FieldTypes.LINK]: {
|
||||||
"": [],
|
"": [],
|
||||||
[null]: [],
|
[null]: [],
|
||||||
|
|
|
@ -41,8 +41,7 @@ export interface Automation extends Document {
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutomationStep {
|
export interface AutomationStepSchema {
|
||||||
id?: string
|
|
||||||
name: string
|
name: string
|
||||||
tagline: string
|
tagline: string
|
||||||
icon: string
|
icon: string
|
||||||
|
@ -65,11 +64,19 @@ export interface AutomationStep {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutomationTrigger extends AutomationStep {
|
export interface AutomationStep extends AutomationStepSchema {
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AutomationTriggerSchema extends AutomationStepSchema {
|
||||||
event?: string
|
event?: string
|
||||||
cronJobId?: string
|
cronJobId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AutomationTrigger extends AutomationTriggerSchema {
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
export enum AutomationStatus {
|
export enum AutomationStatus {
|
||||||
SUCCESS = "success",
|
SUCCESS = "success",
|
||||||
ERROR = "error",
|
ERROR = "error",
|
||||||
|
|
Loading…
Reference in New Issue