({ signal }: { signal: AbortSignal | null })
| 416 | } |
| 417 | |
| 418 | private async executeFnAsync({ signal }: { signal: AbortSignal | null }): Promise<void> { |
| 419 | assert(this.fn, 'Function (fn) must be defined'); |
| 420 | |
| 421 | await this.fn(this.ctx, { |
| 422 | inputs: Object.fromEntries( |
| 423 | Object.entries(this.inputById).map(([key, input]) => [ |
| 424 | key, |
| 425 | { value: input.getValue({ interpolationContext: this.getInterpolationContext() }) }, |
| 426 | ]) |
| 427 | ), |
| 428 | outputs: this.outputById, |
| 429 | env: this.getScriptEnv(), |
| 430 | signal: signal ?? undefined, |
| 431 | }); |
| 432 | |
| 433 | this.ctx.logger.debug(`Script completed successfully`); |
| 434 | } |
| 435 | |
| 436 | private interpolateInputsOutputsAndGlobalContextInTemplate( |
| 437 | template: string, |
no test coverage detected