zapier.actions.mustache Maven / Gradle / Ivy
The newest version!
{{#apiInfo}}
{{#apis}}
const {{classname}} = require('../{{apiPackage}}/{{classname}}');
{{/apis}}
{{/apiInfo}}
const { triggerMiddleware, isTrigger, searchMiddleware, hasSearchRequisites, isSearchAction, isCreateAction, createMiddleware } = require('../utils/utils');
const actions = {
{{#apiInfo}}
{{#apis}}
{{#operations}}
{{#operation}}
[{{classname}}.{{operationId}}.key]: {{classname}}.{{operationId}},
{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
}
module.exports = {
searchActions: () => Object.entries(actions).reduce((actions, [key, value]) => isSearchAction(key) && hasSearchRequisites(value) ? {...actions, [key]: searchMiddleware(value)} : actions, {}),
createActions: () => Object.entries(actions).reduce((actions, [key, value]) => isCreateAction(key) ? {...actions, [key]: createMiddleware(value)} : actions, {}),
triggers: () => Object.entries(actions).reduce((actions, [key, value]) => isTrigger(key) ? {...actions, [key]: triggerMiddleware(value)} : actions, {}),
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy