UNPKG

intentful

Version:

Create Custom Skills with less headache

26 lines (25 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SequentialCommand = void 0; const command_1 = require("./command"); const helpers_1 = require("../interfaces/helpers"); class SequentialCommand extends command_1.Command { constructor(props) { super('Sequential', props); } commandSpecificModel() { return { catch: this.props.catch, commands: this.props.commands, finally: this.props.finally, repeatCount: this.props.repeatCount }; } commandSpecificRequestHandlers() { const commandHandlers = (0, helpers_1.convertCommandListToRequestHandlers)(this.props.commands); const catchHandlers = (0, helpers_1.convertCommandListToRequestHandlers)(this.props.catch); const finallyHandlers = (0, helpers_1.convertCommandListToRequestHandlers)(this.props.finally); return [...commandHandlers, ...catchHandlers, ...finallyHandlers]; } } exports.SequentialCommand = SequentialCommand;