UNPKG

585 BJavaScriptView Raw
1const { getAPIKey } = require('./userConf');
2const { invoke } = require('../sdk');
3
4/**
5 * Invokes a previously deployed Binaris function.
6 *
7 * @param {string} funcName - name of the function to invoke
8 * @param {string} funcPath - path of the function to invoke
9 * @param {string} funcData - valid JSON string to send with function invocation
10 *
11 * @returns {object} - response of function invocation
12 */
13const invokeCLI = async function invokeCLI(funcName, funcData) {
14 const apiKey = await getAPIKey();
15 return invoke(funcName, apiKey, funcData);
16};
17
18module.exports = invokeCLI;