UNPKG

liveperson-functions-cli

Version:
56 lines 1.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Function = void 0; const core_1 = require("@oclif/core"); const create_controller_1 = require("../../controller/create.controller"); class Function extends core_1.Command { constructor() { super(...arguments); this.createController = new create_controller_1.CreateController(); } /** * Runs the create command and parses the passed functions * @returns {Promise<void>} - create command * @memberof Function */ async run() { try { const { flags: { name, event, description }, } = await this.parse(Function); await this.createController.createFunction({ name, event, description, }); } catch (error) { this.exit(1); } } } exports.Function = Function; Function.flags = { help: core_1.Flags.help({ char: 'h', description: 'Show help for the create command', }), name: core_1.Flags.string({ char: 'n', description: 'name of function, allowed characters: A-Z, 0-9, _', }), description: core_1.Flags.string({ char: 'd', description: 'description of function, allowed characters: A-Z, 0-9, _', }), event: core_1.Flags.string({ char: 'e', description: 'ID of event, use <lpf get events> for more information', }), }; Function.description = 'Create functions locally'; Function.strict = false; Function.examples = [ '> <%= config.bin %> create:function', '> <%= config.bin %> create:function -n exampleFunction -d "This is an example description"', '> <%= config.bin %> create:function -n exampleFunction -e "bot_connectors_custom_integration"', ]; //# sourceMappingURL=function.js.map