( workflowInput: unknown, structuredInput: Record<string, unknown>, hasStructured: boolean )
| 532 | } |
| 533 | |
| 534 | function buildIntegrationTriggerOutput( |
| 535 | workflowInput: unknown, |
| 536 | structuredInput: Record<string, unknown>, |
| 537 | hasStructured: boolean |
| 538 | ): NormalizedBlockOutput { |
| 539 | const output: NormalizedBlockOutput = {} |
| 540 | const structuredKeys = hasStructured ? new Set(Object.keys(structuredInput)) : null |
| 541 | |
| 542 | if (hasStructured) { |
| 543 | for (const [key, value] of Object.entries(structuredInput)) { |
| 544 | output[key] = value |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | if (isRecordLike(workflowInput)) { |
| 549 | for (const [key, value] of Object.entries(workflowInput)) { |
| 550 | if (structuredKeys?.has(key)) continue |
| 551 | if (value !== undefined && value !== null) { |
| 552 | output[key] = value |
| 553 | } else if (!Object.hasOwn(output, key)) { |
| 554 | output[key] = value |
| 555 | } |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | return mergeFilesIntoOutput(output, workflowInput) |
| 560 | } |
| 561 | |
| 562 | function extractSubBlocks(block: SerializedBlock): Record<string, unknown> | undefined { |
| 563 | const metadata = block.metadata |
no test coverage detected