UNPKG

@rudderstack/workflow-engine

Version:
29 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchStepExecutor = void 0; const utils_1 = require("../../../common/utils"); const errors_1 = require("../../../errors"); const base_1 = require("../executors/base"); class BatchStepExecutor extends base_1.BaseStepExecutor { async execute(input, bindings) { try { if (!Array.isArray(input)) { throw new errors_1.BatchError('batch step requires array input'); } const batchResults = await this.executor.execute(input, bindings); utils_1.BatchUtils.validateBatchResults(input, batchResults); return { output: batchResults, }; } catch (e) { throw errors_1.ErrorUtils.createStepExecutionError(e, this.getStepName()); } } constructor(step, executor) { super(step); this.executor = executor; } } exports.BatchStepExecutor = BatchStepExecutor; //# sourceMappingURL=step_executor.js.map