2021-05-12 02:08:59 +12:00
|
|
|
const sendgridEmail = require("./steps/sendgridEmail")
|
|
|
|
const sendSmtpEmail = require("./steps/sendSmtpEmail")
|
2020-10-10 07:10:28 +13:00
|
|
|
const createRow = require("./steps/createRow")
|
|
|
|
const updateRow = require("./steps/updateRow")
|
|
|
|
const deleteRow = require("./steps/deleteRow")
|
2021-03-27 03:56:34 +13:00
|
|
|
const executeScript = require("./steps/executeScript")
|
2021-05-27 22:11:44 +12:00
|
|
|
const bash = require("./steps/bash")
|
2021-03-27 03:56:34 +13:00
|
|
|
const executeQuery = require("./steps/executeQuery")
|
2020-10-28 01:33:25 +13:00
|
|
|
const outgoingWebhook = require("./steps/outgoingWebhook")
|
2021-06-19 05:07:51 +12:00
|
|
|
const serverLog = require("./steps/serverLog")
|
2021-09-04 04:36:00 +12:00
|
|
|
const discord = require("./steps/discord")
|
|
|
|
// TODO: remove zapier/integromat some time in the future/deprecate them
|
|
|
|
const zapier = require("./steps/zapier")
|
|
|
|
const integromat = require("./steps/integromat")
|
2020-09-11 02:00:21 +12:00
|
|
|
|
2020-09-17 01:00:04 +12:00
|
|
|
const BUILTIN_ACTIONS = {
|
2021-05-12 02:08:59 +12:00
|
|
|
SEND_EMAIL: sendgridEmail.run,
|
|
|
|
SEND_EMAIL_SMTP: sendSmtpEmail.run,
|
2020-10-10 07:10:28 +13:00
|
|
|
CREATE_ROW: createRow.run,
|
|
|
|
UPDATE_ROW: updateRow.run,
|
|
|
|
DELETE_ROW: deleteRow.run,
|
2020-10-28 01:33:25 +13:00
|
|
|
OUTGOING_WEBHOOK: outgoingWebhook.run,
|
2021-03-27 03:56:34 +13:00
|
|
|
EXECUTE_SCRIPT: executeScript.run,
|
2021-05-27 22:11:44 +12:00
|
|
|
EXECUTE_BASH: bash.run,
|
2021-03-27 03:56:34 +13:00
|
|
|
EXECUTE_QUERY: executeQuery.run,
|
2021-06-19 05:07:51 +12:00
|
|
|
SERVER_LOG: serverLog.run,
|
2021-09-04 04:36:00 +12:00
|
|
|
// these used to be lowercase step IDs, maintain for backwards compat
|
|
|
|
discord: discord.run,
|
|
|
|
zapier: zapier.run,
|
|
|
|
integromat: integromat.run,
|
2020-09-17 01:00:04 +12:00
|
|
|
}
|
|
|
|
const BUILTIN_DEFINITIONS = {
|
2021-05-12 02:08:59 +12:00
|
|
|
SEND_EMAIL: sendgridEmail.definition,
|
|
|
|
SEND_EMAIL_SMTP: sendSmtpEmail.definition,
|
2020-10-10 07:10:28 +13:00
|
|
|
CREATE_ROW: createRow.definition,
|
|
|
|
UPDATE_ROW: updateRow.definition,
|
|
|
|
DELETE_ROW: deleteRow.definition,
|
2020-10-28 01:33:25 +13:00
|
|
|
OUTGOING_WEBHOOK: outgoingWebhook.definition,
|
2021-03-27 03:56:34 +13:00
|
|
|
EXECUTE_SCRIPT: executeScript.definition,
|
|
|
|
EXECUTE_QUERY: executeQuery.definition,
|
2021-05-27 22:11:44 +12:00
|
|
|
EXECUTE_BASH: bash.definition,
|
2021-06-19 05:07:51 +12:00
|
|
|
SERVER_LOG: serverLog.definition,
|
2021-09-04 04:36:00 +12:00
|
|
|
// these used to be lowercase step IDs, maintain for backwards compat
|
|
|
|
discord: discord.definition,
|
|
|
|
zapier: zapier.definition,
|
|
|
|
integromat: integromat.definition,
|
2020-09-23 01:07:22 +12:00
|
|
|
}
|
|
|
|
|
2021-03-16 03:11:13 +13:00
|
|
|
/* istanbul ignore next */
|
2021-05-03 19:31:09 +12:00
|
|
|
module.exports.getAction = async function (actionName) {
|
2020-09-11 02:00:21 +12:00
|
|
|
if (BUILTIN_ACTIONS[actionName] != null) {
|
|
|
|
return BUILTIN_ACTIONS[actionName]
|
|
|
|
}
|
|
|
|
}
|
2020-09-17 01:00:04 +12:00
|
|
|
|
2021-03-12 07:29:48 +13:00
|
|
|
// definitions will have downloaded ones added to it, while builtin won't
|
2020-09-19 03:50:52 +12:00
|
|
|
module.exports.DEFINITIONS = BUILTIN_DEFINITIONS
|
2020-09-17 01:00:04 +12:00
|
|
|
module.exports.BUILTIN_DEFINITIONS = BUILTIN_DEFINITIONS
|