UNPKG

liveperson-functions-cli

Version:
43 lines 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const invoke_controller_1 = require("../controller/invoke.controller"); const utils_1 = require("../shared/utils"); class Invoke extends core_1.Command { constructor() { super(...arguments); this.invokeController = new invoke_controller_1.InvokeController(); } /** * Runs the invoke command and parses the passed function and flag * @returns {Promise<void>} - invoke command * @memberof Invoke */ async run() { try { const { flags: inputFlags } = await this.parse(Invoke); const lambdaFunctions = (0, utils_1.parseInput)(Invoke.flags, this.argv); await this.invokeController.invoke({ lambdaFunctions, inputFlags }); } catch (error) { this.exit(1); } } } exports.default = Invoke; Invoke.description = 'Invokes a function'; Invoke.flags = { help: core_1.Flags.help({ char: 'h' }), local: core_1.Flags.boolean({ char: 'l', description: 'Invokes the function locally with the input from the config.json', }), }; Invoke.strict = false; Invoke.args = [{ name: '...functionNames' }]; Invoke.examples = [ '> <%= config.bin %> invoke exampleFunction', '> <%= config.bin %> invoke exampleFunction --local', '> <%= config.bin %> invoke exampleFunction -l', ]; //# sourceMappingURL=invoke.js.map