2021-05-12 02:08:59 +12:00
|
|
|
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")
|
2021-09-08 00:58:53 +12:00
|
|
|
const slack = require("./steps/slack")
|
2021-09-04 04:36:00 +12:00
|
|
|
const zapier = require("./steps/zapier")
|
|
|
|
const integromat = require("./steps/integromat")
|
2020-09-11 02:00:21 +12:00
|
|
|
|
2021-09-07 04:53:02 +12:00
|
|
|
const ACTION_IMPLS = {
|
2021-05-12 02:08:59 +12:00
|
|
|
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,
|
2021-09-08 00:58:53 +12:00
|
|
|
slack: slack.run,
|
2021-09-04 04:36:00 +12:00
|
|
|
zapier: zapier.run,
|
|
|
|
integromat: integromat.run,
|
2020-09-17 01:00:04 +12:00
|
|
|
}
|
2021-09-07 04:53:02 +12:00
|
|
|
const ACTION_DEFINITIONS = {
|
2021-05-12 02:08:59 +12:00
|
|
|
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,
|
2021-09-08 00:58:53 +12:00
|
|
|
slack: slack.definition,
|
2021-09-04 04:36:00 +12:00
|
|
|
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-09-07 04:53:02 +12:00
|
|
|
exports.getAction = async function (actionName) {
|
|
|
|
if (ACTION_IMPLS[actionName] != null) {
|
|
|
|
return ACTION_IMPLS[actionName]
|
2020-09-11 02:00:21 +12:00
|
|
|
}
|
|
|
|
}
|
2020-09-17 01:00:04 +12:00
|
|
|
|
2021-09-07 04:53:02 +12:00
|
|
|
exports.ACTION_DEFINITIONS = ACTION_DEFINITIONS
|