All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zapier.actions.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{#apiInfo}}
{{#apis}}
const {{classname}} = require('../{{apiPackage}}/{{classname}}');
{{/apis}}
{{/apiInfo}}
const { searchMiddleware, hasSearchRequisites, isSearchAction } = 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]) => !isSearchAction(key) ? {...actions, [key]: value} : actions, {}),
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy