2020-09-16 15:00:04 +02:00
|
|
|
const sendEmail = require("./steps/sendEmail")
|
|
|
|
const saveRecord = require("./steps/saveRecord")
|
|
|
|
const deleteRecord = require("./steps/deleteRecord")
|
|
|
|
const createUser = require("./steps/createUser")
|
2020-09-10 16:00:21 +02:00
|
|
|
|
2020-09-16 15:00:04 +02:00
|
|
|
const BUILTIN_ACTIONS = {
|
|
|
|
SEND_EMAIL: sendEmail.run,
|
|
|
|
SAVE_RECORD: saveRecord.run,
|
|
|
|
DELETE_RECORD: deleteRecord.run,
|
|
|
|
CREATE_USER: createUser.run,
|
|
|
|
}
|
2020-09-14 12:47:52 +02:00
|
|
|
|
2020-09-16 15:00:04 +02:00
|
|
|
const BUILTIN_DEFINITIONS = {
|
|
|
|
SEND_EMAIL: sendEmail.definition,
|
|
|
|
SAVE_RECORD: saveRecord.definition,
|
|
|
|
DELETE_RECORD: deleteRecord.definition,
|
|
|
|
CREATE_USER: createUser.definition,
|
2020-09-10 16:00:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports.getAction = async function(actionName) {
|
|
|
|
if (BUILTIN_ACTIONS[actionName] != null) {
|
|
|
|
return BUILTIN_ACTIONS[actionName]
|
|
|
|
}
|
|
|
|
// TODO: load async actions here
|
|
|
|
}
|
2020-09-16 15:00:04 +02:00
|
|
|
|
|
|
|
module.exports.BUILTIN_DEFINITIONS = BUILTIN_DEFINITIONS
|