(configObj: any, configParamWithAcceptVariables: string[])
| 529 | // Helper function to process config parameters with acceptVariable |
| 530 | // Example: Processes agentSelectedToolConfig object, resolving variables in requestsGetHeaders |
| 531 | const processConfigParams = async (configObj: any, configParamWithAcceptVariables: string[]) => { |
| 532 | if (typeof configObj !== 'object' || configObj === null) { |
| 533 | return |
| 534 | } |
| 535 | |
| 536 | // Handle arrays of config objects |
| 537 | if (Array.isArray(configObj)) { |
| 538 | for (const item of configObj) { |
| 539 | await processConfigParams(item, configParamWithAcceptVariables) |
| 540 | } |
| 541 | return |
| 542 | } |
| 543 | |
| 544 | for (const [key, value] of Object.entries(configObj)) { |
| 545 | // Only resolve variables for parameters that accept them |
| 546 | // Example: requestsGetHeaders is in configParamWithAcceptVariables, so resolve "Bearer {{ $vars.TOKEN }}" |
| 547 | if (configParamWithAcceptVariables.includes(key)) { |
| 548 | configObj[key] = await resolveNodeReference(value) |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | // STEP 1: Get all params with loadConfig from inputParams |
| 554 | // Example result: ["agentModel", "agentSelectedTool"] |
no test coverage detected