(block: SerializedBlock)
| 128 | } |
| 129 | |
| 130 | function extractInputFormat(block: SerializedBlock): InputFormatField[] { |
| 131 | const fromMetadata = readMetadataSubBlockValue(block, 'inputFormat') |
| 132 | const fromParams = block.config?.params?.inputFormat |
| 133 | const source = fromMetadata ?? fromParams |
| 134 | |
| 135 | if (!Array.isArray(source)) { |
| 136 | return [] |
| 137 | } |
| 138 | |
| 139 | return source |
| 140 | .filter((field): field is InputFormatField => isRecordLike(field)) |
| 141 | .map((field) => field) |
| 142 | } |
| 143 | |
| 144 | function normalizeLegacyStarterMode(modeValue: unknown): 'manual' | 'api' | 'chat' | null { |
| 145 | if (modeValue === 'chat') return 'chat' |
no test coverage detected