How to use the @ibm-functions/composer.encode function in @ibm-functions/composer

To help you get started, we’ve selected a few @ibm-functions/composer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-functions / shell / app / plugins / modules / composer / lib / composer.js View on Github external
.then(([currentAction]) => {
            // now we merge together the parameters and annotations
            let encodeElement = openwhiskComposer.encode(openwhiskComposer.composition(fqnAppName, fsm), "0.4.0")
            // multiple actions might be returned, as people can now use composer combinators to deploy new actions
            // currently, the main composition action is always the last action in the array
            const fsmAction = encodeElement.actions[encodeElement.actions.length ? encodeElement.actions.length - 1 : 0].action
            fsmAction.parameters = currentAction.parameters.concat(parameters).concat(fsmAction.parameters || []),
            fsmAction.annotations = mergeAnnotations(currentAction.annotations,
                                                     mergeAnnotations(annotations||[], fsmAction.annotations||[]),
                                                     type, fsm)
            return fsmAction
        })
        .then(fsmAction => wsk.owOpts({ // add common flags to the requewst