n8n-nodes-base 1.87.0 → 1.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/credentials/Aws.credentials.js +16 -2
- package/dist/credentials/Aws.credentials.js.map +1 -1
- package/dist/credentials/SalesforceJwtApi.credentials.js +60 -0
- package/dist/credentials/SalesforceJwtApi.credentials.js.map +1 -1
- package/dist/nodes/Airtable/v2/actions/record/update.operation.js +15 -3
- package/dist/nodes/Airtable/v2/actions/record/update.operation.js.map +1 -1
- package/dist/nodes/Brevo/__schema__/v1.0.0/contact/getAll.json +1 -9
- package/dist/nodes/Dropbox/__schema__/v1.0.0/file/download.json +2 -5
- package/dist/nodes/Form/utils.js +2 -7
- package/dist/nodes/Form/utils.js.map +1 -1
- package/dist/nodes/Freshdesk/Freshdesk.node.js +3 -6
- package/dist/nodes/Freshdesk/Freshdesk.node.js.map +1 -1
- package/dist/nodes/Google/Analytics/__schema__/v2.0.0/report/get.json +2 -2
- package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +7 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/get.json +1 -13
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +1 -7
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/getAll.json +1 -7
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/thread/get.json +4 -4
- package/dist/nodes/Google/YouTube/__schema__/v1.0.0/video/get.json +1 -35
- package/dist/nodes/Google/YouTube/__schema__/v1.0.0/video/rate.json +9 -0
- package/dist/nodes/HaloPSA/__schema__/v1.0.0/client/getAll.json +147 -1
- package/dist/nodes/HttpRequest/V3/Description.js +8 -0
- package/dist/nodes/HttpRequest/V3/Description.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +23 -5
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/HttpRequest/shared/optimizeResponse.js +387 -0
- package/dist/nodes/HttpRequest/shared/optimizeResponse.js.map +1 -0
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js +10 -2
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js.map +1 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/company/getAll.json +1 -4
- package/dist/nodes/Hubspot/__schema__/v2.1.0/contact/search.json +4 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/getAll.json +1 -52
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +5 -2
- package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +1 -258
- package/dist/nodes/ItemLists/__schema__/v3.0.0/itemList/limit.json +9 -0
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +84 -1
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +4 -565
- package/dist/nodes/Lemlist/__schema__/v2.0.0/campaign/getAll.json +1 -10
- package/dist/nodes/Linear/__schema__/v1.0.0/issue/create.json +12 -1
- package/dist/nodes/LinkedIn/GenericFunctions.js +1 -1
- package/dist/nodes/LinkedIn/GenericFunctions.js.map +1 -1
- package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/file/download.json +92 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +3 -81
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/get.json +28 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +82 -1
- package/dist/nodes/Nasa/__schema__/v1.0.0/donkiSolarFlare/get.json +4 -1
- package/dist/nodes/Notion/__schema__/v2.2.0/databasePage/create.json +1 -4
- package/dist/nodes/Notion/__schema__/v2.2.0/databasePage/getAll.json +1 -4
- package/dist/nodes/Odoo/__schema__/v1.0.0/custom/get.json +1 -4
- package/dist/nodes/Odoo/__schema__/v1.0.0/custom/getAll.json +4 -1
- package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +1 -4
- package/dist/nodes/Phantombuster/__schema__/v1.0.0/agent/getOutput.json +1 -10
- package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +12 -1
- package/dist/nodes/Postgres/v2/helpers/utils.js +3 -1
- package/dist/nodes/Postgres/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +57 -48
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/getAll.json +2 -2
- package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +4 -1
- package/dist/nodes/Salesforce/__schema__/v1.0.0/search/query.json +1 -4
- package/dist/nodes/ServiceNow/__schema__/v1.0.0/tableRecord/getAll.json +1 -4
- package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +4 -44
- package/dist/nodes/Ssh/__schema__/v1.0.0/command/execute.json +1 -4
- package/dist/nodes/Supabase/GenericFunctions.js +13 -4
- package/dist/nodes/Supabase/GenericFunctions.js.map +1 -1
- package/dist/nodes/Supabase/RowDescription.js +1 -0
- package/dist/nodes/Supabase/RowDescription.js.map +1 -1
- package/dist/nodes/Supabase/Supabase.node.js +17 -0
- package/dist/nodes/Supabase/Supabase.node.js.map +1 -1
- package/dist/nodes/Supabase/__schema__/v1.0.0/row/delete.json +7 -1
- package/dist/nodes/Telegram/TelegramTrigger.node.js +4 -60
- package/dist/nodes/Telegram/TelegramTrigger.node.js.map +1 -1
- package/dist/nodes/Telegram/__schema__/v1.2.0/chat/get.json +1 -10
- package/dist/nodes/Telegram/__schema__/v1.2.0/chat/member.json +1 -4
- package/dist/nodes/Telegram/util/triggerUtils.js +88 -0
- package/dist/nodes/Telegram/util/triggerUtils.js.map +1 -0
- package/dist/nodes/Transform/Summarize/utils.js +1 -1
- package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
- package/dist/nodes/Trello/__schema__/v1.0.0/list/getAll.json +1 -4
- package/dist/nodes/Trello/__schema__/v1.0.0/list/getCards.json +4 -7
- package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/search.json +1 -4
- package/dist/nodes/Wait/Wait.node.js +5 -6
- package/dist/nodes/Wait/Wait.node.js.map +1 -1
- package/dist/nodes/Wordpress/__schema__/v1.0.0/post/getAll.json +9 -1
- package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +1 -15
- package/dist/test/nodes/FakeCredentialsMap.js +30 -0
- package/dist/test/nodes/FakeCredentialsMap.js.map +1 -1
- package/dist/test/nodes/Helpers.js +5 -3
- package/dist/test/nodes/Helpers.js.map +1 -1
- package/dist/test/nodes/TriggerHelpers.js +5 -2
- package/dist/test/nodes/TriggerHelpers.js.map +1 -1
- package/dist/types/credentials.json +1 -1
- package/dist/types/nodes.json +5 -5
- package/package.json +11 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/HttpRequest/V3/HttpRequestV3.node.ts"],"sourcesContent":["import set from 'lodash/set';\nimport type {\n\tIBinaryKeyData,\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeBaseDescription,\n\tINodeTypeDescription,\n\tIRequestOptionsSimplified,\n\tPaginationOptions,\n\tJsonObject,\n\tIRequestOptions,\n\tIHttpRequestMethods,\n} from 'n8n-workflow';\nimport {\n\tBINARY_ENCODING,\n\tNodeApiError,\n\tNodeConnectionTypes,\n\tNodeOperationError,\n\tjsonParse,\n\tremoveCircularRefs,\n\tsleep,\n} from 'n8n-workflow';\nimport type { Readable } from 'stream';\n\nimport { keysToLowercase } from '@utils/utilities';\n\nimport { mainProperties } from './Description';\nimport type { BodyParameter, IAuthDataSanitizeKeys } from '../GenericFunctions';\nimport {\n\tbinaryContentTypes,\n\tgetOAuth2AdditionalParameters,\n\tgetSecrets,\n\tprepareRequestBody,\n\treduceAsync,\n\treplaceNullValues,\n\tsanitizeUiMessage,\n\tsetAgentOptions,\n} from '../GenericFunctions';\n\nfunction toText<T>(data: T) {\n\tif (typeof data === 'object' && data !== null) {\n\t\treturn JSON.stringify(data);\n\t}\n\treturn data;\n}\nexport class HttpRequestV3 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tsubtitle: '={{$parameter[\"method\"] + \": \" + $parameter[\"url\"]}}',\n\t\t\tversion: [3, 4, 4.1, 4.2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'HTTP Request',\n\t\t\t\tcolor: '#0004F5',\n\t\t\t},\n\t\t\tinputs: [NodeConnectionTypes.Main],\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tcredentials: [\n\t\t\t\t{\n\t\t\t\t\tname: 'httpSslAuth',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tprovideSslCertificates: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tproperties: mainProperties,\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tconst fullResponseProperties = ['body', 'headers', 'statusCode', 'statusMessage'];\n\n\t\tlet authentication;\n\n\t\ttry {\n\t\t\tauthentication = this.getNodeParameter('authentication', 0) as\n\t\t\t\t| 'predefinedCredentialType'\n\t\t\t\t| 'genericCredentialType'\n\t\t\t\t| 'none';\n\t\t} catch {}\n\n\t\tlet httpBasicAuth;\n\t\tlet httpDigestAuth;\n\t\tlet httpHeaderAuth;\n\t\tlet httpQueryAuth;\n\t\tlet httpCustomAuth;\n\t\tlet oAuth1Api;\n\t\tlet oAuth2Api;\n\t\tlet sslCertificates;\n\t\tlet nodeCredentialType: string | undefined;\n\t\tlet genericCredentialType: string | undefined;\n\n\t\tlet requestOptions: IRequestOptions = {\n\t\t\turi: '',\n\t\t};\n\n\t\tlet returnItems: INodeExecutionData[] = [];\n\t\tconst errorItems: { [key: string]: string } = {};\n\t\tconst requestPromises = [];\n\n\t\tlet fullResponse = false;\n\n\t\tlet autoDetectResponseFormat = false;\n\n\t\t// Can not be defined on a per item level\n\t\tconst pagination = this.getNodeParameter('options.pagination.pagination', 0, null, {\n\t\t\trawExpressions: true,\n\t\t}) as {\n\t\t\tpaginationMode: 'off' | 'updateAParameterInEachRequest' | 'responseContainsNextURL';\n\t\t\tnextURL?: string;\n\t\t\tparameters: {\n\t\t\t\tparameters: Array<{\n\t\t\t\t\ttype: 'body' | 'headers' | 'qs';\n\t\t\t\t\tname: string;\n\t\t\t\t\tvalue: string;\n\t\t\t\t}>;\n\t\t\t};\n\t\t\tpaginationCompleteWhen: 'responseIsEmpty' | 'receiveSpecificStatusCodes' | 'other';\n\t\t\tstatusCodesWhenComplete: string;\n\t\t\tcompleteExpression: string;\n\t\t\tlimitPagesFetched: boolean;\n\t\t\tmaxRequests: number;\n\t\t\trequestInterval: number;\n\t\t};\n\n\t\tconst requests: Array<{\n\t\t\toptions: IRequestOptions;\n\t\t\tauthKeys: IAuthDataSanitizeKeys;\n\t\t\tcredentialType?: string;\n\t\t}> = [];\n\n\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\ttry {\n\t\t\t\tif (authentication === 'genericCredentialType') {\n\t\t\t\t\tgenericCredentialType = this.getNodeParameter('genericAuthType', 0) as string;\n\n\t\t\t\t\tif (genericCredentialType === 'httpBasicAuth') {\n\t\t\t\t\t\thttpBasicAuth = await this.getCredentials('httpBasicAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpDigestAuth') {\n\t\t\t\t\t\thttpDigestAuth = await this.getCredentials('httpDigestAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpHeaderAuth') {\n\t\t\t\t\t\thttpHeaderAuth = await this.getCredentials('httpHeaderAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpQueryAuth') {\n\t\t\t\t\t\thttpQueryAuth = await this.getCredentials('httpQueryAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpCustomAuth') {\n\t\t\t\t\t\thttpCustomAuth = await this.getCredentials('httpCustomAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'oAuth1Api') {\n\t\t\t\t\t\toAuth1Api = await this.getCredentials('oAuth1Api', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'oAuth2Api') {\n\t\t\t\t\t\toAuth2Api = await this.getCredentials('oAuth2Api', itemIndex);\n\t\t\t\t\t}\n\t\t\t\t} else if (authentication === 'predefinedCredentialType') {\n\t\t\t\t\tnodeCredentialType = this.getNodeParameter('nodeCredentialType', itemIndex) as string;\n\t\t\t\t}\n\n\t\t\t\tconst provideSslCertificates = this.getNodeParameter(\n\t\t\t\t\t'provideSslCertificates',\n\t\t\t\t\titemIndex,\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\n\t\t\t\tif (provideSslCertificates) {\n\t\t\t\t\tsslCertificates = await this.getCredentials('httpSslAuth', itemIndex);\n\t\t\t\t}\n\n\t\t\t\tconst requestMethod = this.getNodeParameter('method', itemIndex) as IHttpRequestMethods;\n\n\t\t\t\tconst sendQuery = this.getNodeParameter('sendQuery', itemIndex, false) as boolean;\n\t\t\t\tconst queryParameters = this.getNodeParameter(\n\t\t\t\t\t'queryParameters.parameters',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t) as [{ name: string; value: string }];\n\t\t\t\tconst specifyQuery = this.getNodeParameter('specifyQuery', itemIndex, 'keypair') as string;\n\t\t\t\tconst jsonQueryParameter = this.getNodeParameter('jsonQuery', itemIndex, '') as string;\n\n\t\t\t\tconst sendBody = this.getNodeParameter('sendBody', itemIndex, false) as boolean;\n\t\t\t\tconst bodyContentType = this.getNodeParameter('contentType', itemIndex, '') as string;\n\t\t\t\tconst specifyBody = this.getNodeParameter('specifyBody', itemIndex, '') as string;\n\t\t\t\tconst bodyParameters = this.getNodeParameter(\n\t\t\t\t\t'bodyParameters.parameters',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t) as BodyParameter[];\n\t\t\t\tconst jsonBodyParameter = this.getNodeParameter('jsonBody', itemIndex, '') as string;\n\t\t\t\tconst body = this.getNodeParameter('body', itemIndex, '') as string;\n\n\t\t\t\tconst sendHeaders = this.getNodeParameter('sendHeaders', itemIndex, false) as boolean;\n\n\t\t\t\tconst headerParameters = this.getNodeParameter(\n\t\t\t\t\t'headerParameters.parameters',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t) as [{ name: string; value: string }];\n\n\t\t\t\tconst specifyHeaders = this.getNodeParameter(\n\t\t\t\t\t'specifyHeaders',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t'keypair',\n\t\t\t\t) as string;\n\n\t\t\t\tconst jsonHeadersParameter = this.getNodeParameter('jsonHeaders', itemIndex, '') as string;\n\n\t\t\t\tconst {\n\t\t\t\t\tredirect,\n\t\t\t\t\tbatching,\n\t\t\t\t\tproxy,\n\t\t\t\t\ttimeout,\n\t\t\t\t\tallowUnauthorizedCerts,\n\t\t\t\t\tqueryParameterArrays,\n\t\t\t\t\tresponse,\n\t\t\t\t\tlowercaseHeaders,\n\t\t\t\t} = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\t\t\tbatching: { batch: { batchSize: number; batchInterval: number } };\n\t\t\t\t\tproxy: string;\n\t\t\t\t\ttimeout: number;\n\t\t\t\t\tallowUnauthorizedCerts: boolean;\n\t\t\t\t\tqueryParameterArrays: 'indices' | 'brackets' | 'repeat';\n\t\t\t\t\tresponse: {\n\t\t\t\t\t\tresponse: { neverError: boolean; responseFormat: string; fullResponse: boolean };\n\t\t\t\t\t};\n\t\t\t\t\tredirect: { redirect: { maxRedirects: number; followRedirects: boolean } };\n\t\t\t\t\tlowercaseHeaders: boolean;\n\t\t\t\t};\n\n\t\t\t\tconst url = this.getNodeParameter('url', itemIndex) as string;\n\n\t\t\t\tconst responseFormat = response?.response?.responseFormat || 'autodetect';\n\n\t\t\t\tfullResponse = response?.response?.fullResponse || false;\n\n\t\t\t\tautoDetectResponseFormat = responseFormat === 'autodetect';\n\n\t\t\t\t// defaults batch size to 1 of it's set to 0\n\t\t\t\tconst batchSize = batching?.batch?.batchSize > 0 ? batching?.batch?.batchSize : 1;\n\t\t\t\tconst batchInterval = batching?.batch.batchInterval;\n\n\t\t\t\tif (itemIndex > 0 && batchSize >= 0 && batchInterval > 0) {\n\t\t\t\t\tif (itemIndex % batchSize === 0) {\n\t\t\t\t\t\tawait sleep(batchInterval);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\trequestOptions = {\n\t\t\t\t\theaders: {},\n\t\t\t\t\tmethod: requestMethod,\n\t\t\t\t\turi: url,\n\t\t\t\t\tgzip: true,\n\t\t\t\t\trejectUnauthorized: !allowUnauthorizedCerts || false,\n\t\t\t\t\tfollowRedirect: false,\n\t\t\t\t\tresolveWithFullResponse: true,\n\t\t\t\t};\n\n\t\t\t\tif (requestOptions.method !== 'GET' && nodeVersion >= 4.1) {\n\t\t\t\t\trequestOptions = { ...requestOptions, followAllRedirects: false };\n\t\t\t\t}\n\n\t\t\t\tconst defaultRedirect = nodeVersion >= 4 && redirect === undefined;\n\n\t\t\t\tif (redirect?.redirect?.followRedirects || defaultRedirect) {\n\t\t\t\t\trequestOptions.followRedirect = true;\n\t\t\t\t\trequestOptions.followAllRedirects = true;\n\t\t\t\t}\n\n\t\t\t\tif (redirect?.redirect?.maxRedirects || defaultRedirect) {\n\t\t\t\t\trequestOptions.maxRedirects = redirect?.redirect?.maxRedirects;\n\t\t\t\t}\n\n\t\t\t\tif (response?.response?.neverError) {\n\t\t\t\t\trequestOptions.simple = false;\n\t\t\t\t}\n\n\t\t\t\tif (proxy) {\n\t\t\t\t\trequestOptions.proxy = proxy;\n\t\t\t\t}\n\n\t\t\t\tif (timeout) {\n\t\t\t\t\trequestOptions.timeout = timeout;\n\t\t\t\t} else {\n\t\t\t\t\t// set default timeout to 5 minutes\n\t\t\t\t\trequestOptions.timeout = 300_000;\n\t\t\t\t}\n\t\t\t\tif (sendQuery && queryParameterArrays) {\n\t\t\t\t\tObject.assign(requestOptions, {\n\t\t\t\t\t\tqsStringifyOptions: { arrayFormat: queryParameterArrays },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst parametersToKeyValue = async (\n\t\t\t\t\taccumulator: { [key: string]: any },\n\t\t\t\t\tcur: { name: string; value: string; parameterType?: string; inputDataFieldName?: string },\n\t\t\t\t) => {\n\t\t\t\t\tif (cur.parameterType === 'formBinaryData') {\n\t\t\t\t\t\tif (!cur.inputDataFieldName) return accumulator;\n\t\t\t\t\t\tconst binaryData = this.helpers.assertBinaryData(itemIndex, cur.inputDataFieldName);\n\t\t\t\t\t\tlet uploadData: Buffer | Readable;\n\t\t\t\t\t\tconst itemBinaryData = items[itemIndex].binary![cur.inputDataFieldName];\n\t\t\t\t\t\tif (itemBinaryData.id) {\n\t\t\t\t\t\t\tuploadData = await this.helpers.getBinaryStream(itemBinaryData.id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuploadData = Buffer.from(itemBinaryData.data, BINARY_ENCODING);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taccumulator[cur.name] = {\n\t\t\t\t\t\t\tvalue: uploadData,\n\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\tfilename: binaryData.fileName,\n\t\t\t\t\t\t\t\tcontentType: binaryData.mimeType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn accumulator;\n\t\t\t\t\t}\n\t\t\t\t\taccumulator[cur.name] = cur.value;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t};\n\n\t\t\t\t// Get parameters defined in the UI\n\t\t\t\tif (sendBody && bodyParameters) {\n\t\t\t\t\tif (specifyBody === 'keypair' || bodyContentType === 'multipart-form-data') {\n\t\t\t\t\t\trequestOptions.body = await prepareRequestBody(\n\t\t\t\t\t\t\tbodyParameters,\n\t\t\t\t\t\t\tbodyContentType,\n\t\t\t\t\t\t\tnodeVersion,\n\t\t\t\t\t\t\tparametersToKeyValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (specifyBody === 'json') {\n\t\t\t\t\t\t// body is specified using JSON\n\t\t\t\t\t\tif (typeof jsonBodyParameter !== 'object' && jsonBodyParameter !== null) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tJSON.parse(jsonBodyParameter);\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t'JSON parameter needs to be valid JSON',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\trequestOptions.body = jsonParse(jsonBodyParameter);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trequestOptions.body = jsonBodyParameter;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (specifyBody === 'string') {\n\t\t\t\t\t\t//form urlencoded\n\t\t\t\t\t\trequestOptions.body = Object.fromEntries(new URLSearchParams(body));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Change the way data get send in case a different content-type than JSON got selected\n\t\t\t\tif (sendBody && ['PATCH', 'POST', 'PUT', 'GET'].includes(requestMethod)) {\n\t\t\t\t\tif (bodyContentType === 'multipart-form-data') {\n\t\t\t\t\t\trequestOptions.formData = requestOptions.body as IDataObject;\n\t\t\t\t\t\tdelete requestOptions.body;\n\t\t\t\t\t} else if (bodyContentType === 'form-urlencoded') {\n\t\t\t\t\t\trequestOptions.form = requestOptions.body as IDataObject;\n\t\t\t\t\t\tdelete requestOptions.body;\n\t\t\t\t\t} else if (bodyContentType === 'binaryData') {\n\t\t\t\t\t\tconst inputDataFieldName = this.getNodeParameter(\n\t\t\t\t\t\t\t'inputDataFieldName',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t) as string;\n\n\t\t\t\t\t\tlet uploadData: Buffer | Readable;\n\t\t\t\t\t\tlet contentLength: number;\n\n\t\t\t\t\t\tconst itemBinaryData = this.helpers.assertBinaryData(itemIndex, inputDataFieldName);\n\n\t\t\t\t\t\tif (itemBinaryData.id) {\n\t\t\t\t\t\t\tuploadData = await this.helpers.getBinaryStream(itemBinaryData.id);\n\t\t\t\t\t\t\tconst metadata = await this.helpers.getBinaryMetadata(itemBinaryData.id);\n\t\t\t\t\t\t\tcontentLength = metadata.fileSize;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuploadData = Buffer.from(itemBinaryData.data, BINARY_ENCODING);\n\t\t\t\t\t\t\tcontentLength = uploadData.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequestOptions.body = uploadData;\n\t\t\t\t\t\trequestOptions.headers = {\n\t\t\t\t\t\t\t...requestOptions.headers,\n\t\t\t\t\t\t\t'content-length': contentLength,\n\t\t\t\t\t\t\t'content-type': itemBinaryData.mimeType ?? 'application/octet-stream',\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (bodyContentType === 'raw') {\n\t\t\t\t\t\trequestOptions.body = body;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get parameters defined in the UI\n\t\t\t\tif (sendQuery && queryParameters) {\n\t\t\t\t\tif (specifyQuery === 'keypair') {\n\t\t\t\t\t\trequestOptions.qs = await reduceAsync(queryParameters, parametersToKeyValue);\n\t\t\t\t\t} else if (specifyQuery === 'json') {\n\t\t\t\t\t\t// query is specified using JSON\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSON.parse(jsonQueryParameter);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t'JSON parameter needs to be valid JSON',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trequestOptions.qs = jsonParse(jsonQueryParameter);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get parameters defined in the UI\n\t\t\t\tif (sendHeaders && headerParameters) {\n\t\t\t\t\tlet additionalHeaders: IDataObject = {};\n\t\t\t\t\tif (specifyHeaders === 'keypair') {\n\t\t\t\t\t\tadditionalHeaders = await reduceAsync(\n\t\t\t\t\t\t\theaderParameters.filter((header) => header.name),\n\t\t\t\t\t\t\tparametersToKeyValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (specifyHeaders === 'json') {\n\t\t\t\t\t\t// body is specified using JSON\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSON.parse(jsonHeadersParameter);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t'JSON parameter needs to be valid JSON',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tadditionalHeaders = jsonParse(jsonHeadersParameter);\n\t\t\t\t\t}\n\t\t\t\t\trequestOptions.headers = {\n\t\t\t\t\t\t...requestOptions.headers,\n\t\t\t\t\t\t...(lowercaseHeaders === undefined || lowercaseHeaders\n\t\t\t\t\t\t\t? keysToLowercase(additionalHeaders)\n\t\t\t\t\t\t\t: additionalHeaders),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (autoDetectResponseFormat || responseFormat === 'file') {\n\t\t\t\t\trequestOptions.encoding = null;\n\t\t\t\t\trequestOptions.json = false;\n\t\t\t\t\trequestOptions.useStream = true;\n\t\t\t\t} else if (bodyContentType === 'raw') {\n\t\t\t\t\trequestOptions.json = false;\n\t\t\t\t\trequestOptions.useStream = true;\n\t\t\t\t} else {\n\t\t\t\t\trequestOptions.json = true;\n\t\t\t\t}\n\n\t\t\t\t// Add Content Type if any are set\n\t\t\t\tif (bodyContentType === 'raw') {\n\t\t\t\t\tif (requestOptions.headers === undefined) {\n\t\t\t\t\t\trequestOptions.headers = {};\n\t\t\t\t\t}\n\t\t\t\t\tconst rawContentType = this.getNodeParameter('rawContentType', itemIndex) as string;\n\t\t\t\t\trequestOptions.headers['content-type'] = rawContentType;\n\t\t\t\t}\n\n\t\t\t\tconst authDataKeys: IAuthDataSanitizeKeys = {};\n\n\t\t\t\t// Add SSL certificates if any are set\n\t\t\t\tsetAgentOptions(requestOptions, sslCertificates);\n\t\t\t\tif (requestOptions.agentOptions) {\n\t\t\t\t\tauthDataKeys.agentOptions = Object.keys(requestOptions.agentOptions);\n\t\t\t\t}\n\n\t\t\t\t// Add credentials if any are set\n\t\t\t\tif (httpBasicAuth !== undefined) {\n\t\t\t\t\trequestOptions.auth = {\n\t\t\t\t\t\tuser: httpBasicAuth.user as string,\n\t\t\t\t\t\tpass: httpBasicAuth.password as string,\n\t\t\t\t\t};\n\t\t\t\t\tauthDataKeys.auth = ['pass'];\n\t\t\t\t}\n\t\t\t\tif (httpHeaderAuth !== undefined) {\n\t\t\t\t\trequestOptions.headers![httpHeaderAuth.name as string] = httpHeaderAuth.value;\n\t\t\t\t\tauthDataKeys.headers = [httpHeaderAuth.name as string];\n\t\t\t\t}\n\t\t\t\tif (httpQueryAuth !== undefined) {\n\t\t\t\t\tif (!requestOptions.qs) {\n\t\t\t\t\t\trequestOptions.qs = {};\n\t\t\t\t\t}\n\t\t\t\t\trequestOptions.qs[httpQueryAuth.name as string] = httpQueryAuth.value;\n\t\t\t\t\tauthDataKeys.qs = [httpQueryAuth.name as string];\n\t\t\t\t}\n\n\t\t\t\tif (httpDigestAuth !== undefined) {\n\t\t\t\t\trequestOptions.auth = {\n\t\t\t\t\t\tuser: httpDigestAuth.user as string,\n\t\t\t\t\t\tpass: httpDigestAuth.password as string,\n\t\t\t\t\t\tsendImmediately: false,\n\t\t\t\t\t};\n\t\t\t\t\tauthDataKeys.auth = ['pass'];\n\t\t\t\t}\n\t\t\t\tif (httpCustomAuth !== undefined) {\n\t\t\t\t\tconst customAuth = jsonParse<IRequestOptionsSimplified>(\n\t\t\t\t\t\t(httpCustomAuth.json as string) || '{}',\n\t\t\t\t\t\t{ errorMessage: 'Invalid Custom Auth JSON' },\n\t\t\t\t\t);\n\t\t\t\t\tif (customAuth.headers) {\n\t\t\t\t\t\trequestOptions.headers = { ...requestOptions.headers, ...customAuth.headers };\n\t\t\t\t\t\tauthDataKeys.headers = Object.keys(customAuth.headers);\n\t\t\t\t\t}\n\t\t\t\t\tif (customAuth.body) {\n\t\t\t\t\t\trequestOptions.body = { ...(requestOptions.body as IDataObject), ...customAuth.body };\n\t\t\t\t\t\tauthDataKeys.body = Object.keys(customAuth.body);\n\t\t\t\t\t}\n\t\t\t\t\tif (customAuth.qs) {\n\t\t\t\t\t\trequestOptions.qs = { ...requestOptions.qs, ...customAuth.qs };\n\t\t\t\t\t\tauthDataKeys.qs = Object.keys(customAuth.qs);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (requestOptions.headers!.accept === undefined) {\n\t\t\t\t\tif (responseFormat === 'json') {\n\t\t\t\t\t\trequestOptions.headers!.accept = 'application/json,text/*;q=0.99';\n\t\t\t\t\t} else if (responseFormat === 'text') {\n\t\t\t\t\t\trequestOptions.headers!.accept =\n\t\t\t\t\t\t\t'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, */*;q=0.1';\n\t\t\t\t\t} else {\n\t\t\t\t\t\trequestOptions.headers!.accept =\n\t\t\t\t\t\t\t'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\trequests.push({\n\t\t\t\t\toptions: requestOptions,\n\t\t\t\t\tauthKeys: authDataKeys,\n\t\t\t\t\tcredentialType: nodeCredentialType,\n\t\t\t\t});\n\n\t\t\t\tif (pagination && pagination.paginationMode !== 'off') {\n\t\t\t\t\tlet continueExpression = '={{false}}';\n\t\t\t\t\tif (pagination.paginationCompleteWhen === 'receiveSpecificStatusCodes') {\n\t\t\t\t\t\t// Split out comma separated list of status codes into array\n\t\t\t\t\t\tconst statusCodesWhenCompleted = pagination.statusCodesWhenComplete\n\t\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t\t.map((item) => parseInt(item.trim()));\n\n\t\t\t\t\t\tcontinueExpression = `={{ !${JSON.stringify(\n\t\t\t\t\t\t\tstatusCodesWhenCompleted,\n\t\t\t\t\t\t)}.includes($response.statusCode) }}`;\n\t\t\t\t\t} else if (pagination.paginationCompleteWhen === 'responseIsEmpty') {\n\t\t\t\t\t\tcontinueExpression =\n\t\t\t\t\t\t\t'={{ Array.isArray($response.body) ? $response.body.length : !!$response.body }}';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Other\n\t\t\t\t\t\tif (!pagination.completeExpression.length || pagination.completeExpression[0] !== '=') {\n\t\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Invalid or empty Complete Expression');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinueExpression = `={{ !(${pagination.completeExpression.trim().slice(3, -2)}) }}`;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst paginationData: PaginationOptions = {\n\t\t\t\t\t\tcontinue: continueExpression,\n\t\t\t\t\t\trequest: {},\n\t\t\t\t\t\trequestInterval: pagination.requestInterval,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (pagination.paginationMode === 'updateAParameterInEachRequest') {\n\t\t\t\t\t\t// Iterate over all parameters and add them to the request\n\t\t\t\t\t\tpaginationData.request = {};\n\t\t\t\t\t\tconst { parameters } = pagination.parameters;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tparameters.length === 1 &&\n\t\t\t\t\t\t\tparameters[0].name === '' &&\n\t\t\t\t\t\t\tparameters[0].value === ''\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\"At least one entry with 'Name' and 'Value' filled must be included in 'Parameters' to use 'Update a Parameter in Each Request' mode \",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpagination.parameters.parameters.forEach((parameter, index) => {\n\t\t\t\t\t\t\tif (!paginationData.request[parameter.type]) {\n\t\t\t\t\t\t\t\tpaginationData.request[parameter.type] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst parameterName = parameter.name;\n\t\t\t\t\t\t\tif (parameterName === '') {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t`Parameter name must be set for parameter [${index + 1}] in pagination settings`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst parameterValue = parameter.value;\n\t\t\t\t\t\t\tif (parameterValue === '') {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t`Some value must be provided for parameter [${\n\t\t\t\t\t\t\t\t\t\tindex + 1\n\t\t\t\t\t\t\t\t\t}] in pagination settings, omitting it will result in an infinite loop`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpaginationData.request[parameter.type]![parameterName] = parameterValue;\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (pagination.paginationMode === 'responseContainsNextURL') {\n\t\t\t\t\t\tpaginationData.request.url = pagination.nextURL;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (pagination.limitPagesFetched) {\n\t\t\t\t\t\tpaginationData.maxRequests = pagination.maxRequests;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (responseFormat === 'file') {\n\t\t\t\t\t\tpaginationData.binaryResult = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst requestPromise = this.helpers.requestWithAuthenticationPaginated\n\t\t\t\t\t\t.call(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\tpaginationData,\n\t\t\t\t\t\t\tnodeCredentialType ?? genericCredentialType,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tif (error instanceof NodeOperationError && error.type === 'invalid_url') {\n\t\t\t\t\t\t\t\tconst urlParameterName =\n\t\t\t\t\t\t\t\t\tpagination.paginationMode === 'responseContainsNextURL' ? 'Next URL' : 'URL';\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error.message, {\n\t\t\t\t\t\t\t\t\tdescription: `Make sure the \"${urlParameterName}\" parameter evaluates to a valid URL.`,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t});\n\t\t\t\t\trequestPromises.push(requestPromise);\n\t\t\t\t} else if (authentication === 'genericCredentialType' || authentication === 'none') {\n\t\t\t\t\tif (oAuth1Api) {\n\t\t\t\t\t\tconst requestOAuth1 = this.helpers.requestOAuth1.call(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t'oAuth1Api',\n\t\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\t);\n\t\t\t\t\t\trequestOAuth1.catch(() => {});\n\t\t\t\t\t\trequestPromises.push(requestOAuth1);\n\t\t\t\t\t} else if (oAuth2Api) {\n\t\t\t\t\t\tconst requestOAuth2 = this.helpers.requestOAuth2.call(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t'oAuth2Api',\n\t\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttokenType: 'Bearer',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\trequestOAuth2.catch(() => {});\n\t\t\t\t\t\trequestPromises.push(requestOAuth2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// bearerAuth, queryAuth, headerAuth, digestAuth, none\n\t\t\t\t\t\tconst request = this.helpers.request(requestOptions);\n\t\t\t\t\t\trequest.catch(() => {});\n\t\t\t\t\t\trequestPromises.push(request);\n\t\t\t\t\t}\n\t\t\t\t} else if (authentication === 'predefinedCredentialType' && nodeCredentialType) {\n\t\t\t\t\tconst additionalOAuth2Options = getOAuth2AdditionalParameters(nodeCredentialType);\n\n\t\t\t\t\t// service-specific cred: OAuth1, OAuth2, plain\n\n\t\t\t\t\tconst requestWithAuthentication = this.helpers.requestWithAuthentication.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tnodeCredentialType,\n\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\tadditionalOAuth2Options && { oauth2: additionalOAuth2Options },\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t);\n\t\t\t\t\trequestWithAuthentication.catch(() => {});\n\t\t\t\t\trequestPromises.push(requestWithAuthentication);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (!this.continueOnFail()) throw error;\n\n\t\t\t\trequestPromises.push(Promise.reject(error).catch(() => {}));\n\n\t\t\t\terrorItems[itemIndex] = error.message;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst sanitizedRequests: IDataObject[] = [];\n\t\tconst promisesResponses = await Promise.allSettled(\n\t\t\trequestPromises.map(\n\t\t\t\tasync (requestPromise, itemIndex) =>\n\t\t\t\t\tawait requestPromise\n\t\t\t\t\t\t.then((response) => response)\n\t\t\t\t\t\t.finally(async () => {\n\t\t\t\t\t\t\tif (errorItems[itemIndex]) return;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t// Secrets need to be read after the request because secrets could have changed\n\t\t\t\t\t\t\t\t// For example: OAuth token refresh, preAuthentication\n\t\t\t\t\t\t\t\tconst { options, authKeys, credentialType } = requests[itemIndex];\n\t\t\t\t\t\t\t\tlet secrets: string[] = [];\n\t\t\t\t\t\t\t\tif (credentialType) {\n\t\t\t\t\t\t\t\t\tconst properties = this.getCredentialsProperties(credentialType);\n\t\t\t\t\t\t\t\t\tconst credentials = await this.getCredentials(credentialType, itemIndex);\n\t\t\t\t\t\t\t\t\tsecrets = getSecrets(properties, credentials);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst sanitizedRequestOptions = sanitizeUiMessage(options, authKeys, secrets);\n\t\t\t\t\t\t\t\tsanitizedRequests.push(sanitizedRequestOptions);\n\t\t\t\t\t\t\t\tthis.sendMessageToUI(sanitizedRequestOptions);\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}),\n\t\t\t),\n\t\t);\n\n\t\tlet responseData: any;\n\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\tresponseData = promisesResponses.shift();\n\n\t\t\tif (errorItems[itemIndex]) {\n\t\t\t\treturnItems.push({\n\t\t\t\t\tjson: { error: errorItems[itemIndex] },\n\t\t\t\t\tpairedItem: { item: itemIndex },\n\t\t\t\t});\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (responseData!.status !== 'fulfilled') {\n\t\t\t\tif (responseData.reason.statusCode === 429) {\n\t\t\t\t\tresponseData.reason.message =\n\t\t\t\t\t\t\"Try spacing your requests out using the batching settings under 'Options'\";\n\t\t\t\t}\n\t\t\t\tif (!this.continueOnFail()) {\n\t\t\t\t\tif (autoDetectResponseFormat && responseData.reason.error instanceof Buffer) {\n\t\t\t\t\t\tresponseData.reason.error = Buffer.from(responseData.reason.error as Buffer).toString();\n\t\t\t\t\t}\n\n\t\t\t\t\tlet error;\n\t\t\t\t\tif (responseData?.reason instanceof NodeApiError) {\n\t\t\t\t\t\terror = responseData.reason;\n\t\t\t\t\t\tset(error, 'context.itemIndex', itemIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst errorData = (\n\t\t\t\t\t\t\tresponseData.reason ? responseData.reason : responseData\n\t\t\t\t\t\t) as JsonObject;\n\t\t\t\t\t\terror = new NodeApiError(this.getNode(), errorData, { itemIndex });\n\t\t\t\t\t}\n\n\t\t\t\t\tset(error, 'context.request', sanitizedRequests[itemIndex]);\n\n\t\t\t\t\tthrow error;\n\t\t\t\t} else {\n\t\t\t\t\tremoveCircularRefs(responseData.reason as JsonObject);\n\t\t\t\t\t// Return the actual reason as error\n\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\terror: responseData.reason,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet responses: any[];\n\t\t\tif (Array.isArray(responseData.value)) {\n\t\t\t\tresponses = responseData.value;\n\t\t\t} else {\n\t\t\t\tresponses = [responseData.value];\n\t\t\t}\n\n\t\t\tlet responseFormat = this.getNodeParameter(\n\t\t\t\t'options.response.response.responseFormat',\n\t\t\t\t0,\n\t\t\t\t'autodetect',\n\t\t\t) as string;\n\n\t\t\tfullResponse = this.getNodeParameter(\n\t\t\t\t'options.response.response.fullResponse',\n\t\t\t\t0,\n\t\t\t\tfalse,\n\t\t\t) as boolean;\n\n\t\t\t// eslint-disable-next-line prefer-const\n\t\t\tfor (let [index, response] of Object.entries(responses)) {\n\t\t\t\tif (response?.request?.constructor.name === 'ClientRequest') delete response.request;\n\n\t\t\t\tif (this.getMode() === 'manual' && index === '0') {\n\t\t\t\t\t// For manual executions save the first response in the context\n\t\t\t\t\t// so that we can use it in the frontend and so make it easier for\n\t\t\t\t\t// the users to create the required pagination expressions\n\t\t\t\t\tconst nodeContext = this.getContext('node');\n\t\t\t\t\tif (pagination && pagination.paginationMode !== 'off') {\n\t\t\t\t\t\tnodeContext.response = responseData.value[0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnodeContext.response = responseData.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst responseContentType = response.headers['content-type'] ?? '';\n\t\t\t\tif (autoDetectResponseFormat) {\n\t\t\t\t\tif (responseContentType.includes('application/json')) {\n\t\t\t\t\t\tresponseFormat = 'json';\n\t\t\t\t\t\tif (!response.__bodyResolved) {\n\t\t\t\t\t\t\tconst neverError = this.getNodeParameter(\n\t\t\t\t\t\t\t\t'options.response.response.neverError',\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t) as boolean;\n\n\t\t\t\t\t\t\tconst data = await this.helpers.binaryToString(response.body as Buffer | Readable);\n\t\t\t\t\t\t\tresponse.body = jsonParse(data, {\n\t\t\t\t\t\t\t\t...(neverError\n\t\t\t\t\t\t\t\t\t? { fallbackValue: {} }\n\t\t\t\t\t\t\t\t\t: { errorMessage: 'Invalid JSON in response body' }),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (binaryContentTypes.some((e) => responseContentType.includes(e))) {\n\t\t\t\t\t\tresponseFormat = 'file';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponseFormat = 'text';\n\t\t\t\t\t\tif (!response.__bodyResolved) {\n\t\t\t\t\t\t\tconst data = await this.helpers.binaryToString(response.body as Buffer | Readable);\n\t\t\t\t\t\t\tresponse.body = !data ? undefined : data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (autoDetectResponseFormat && !fullResponse) {\n\t\t\t\t\tdelete response.headers;\n\t\t\t\t\tdelete response.statusCode;\n\t\t\t\t\tdelete response.statusMessage;\n\t\t\t\t}\n\t\t\t\tif (!fullResponse) {\n\t\t\t\t\tresponse = response.body;\n\t\t\t\t}\n\n\t\t\t\tif (responseFormat === 'file') {\n\t\t\t\t\tconst outputPropertyName = this.getNodeParameter(\n\t\t\t\t\t\t'options.response.response.outputPropertyName',\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t'data',\n\t\t\t\t\t) as string;\n\n\t\t\t\t\tconst newItem: INodeExecutionData = {\n\t\t\t\t\t\tjson: {},\n\t\t\t\t\t\tbinary: {},\n\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tif (items[itemIndex].binary !== undefined) {\n\t\t\t\t\t\t// Create a shallow copy of the binary data so that the old\n\t\t\t\t\t\t// data references which do not get changed still stay behind\n\t\t\t\t\t\t// but the incoming data does not get changed.\n\t\t\t\t\t\tObject.assign(newItem.binary as IBinaryKeyData, items[itemIndex].binary);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet binaryData: Buffer | Readable;\n\t\t\t\t\tif (fullResponse) {\n\t\t\t\t\t\tconst returnItem: IDataObject = {};\n\t\t\t\t\t\tfor (const property of fullResponseProperties) {\n\t\t\t\t\t\t\tif (property === 'body') {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturnItem[property] = response[property];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewItem.json = returnItem;\n\t\t\t\t\t\tbinaryData = response?.body;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewItem.json = items[itemIndex].json;\n\t\t\t\t\t\tbinaryData = response;\n\t\t\t\t\t}\n\t\t\t\t\tconst preparedBinaryData = await this.helpers.prepareBinaryData(\n\t\t\t\t\t\tbinaryData,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tresponseContentType || undefined,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!preparedBinaryData.fileName &&\n\t\t\t\t\t\tpreparedBinaryData.fileExtension &&\n\t\t\t\t\t\ttypeof requestOptions.uri === 'string' &&\n\t\t\t\t\t\trequestOptions.uri.endsWith(preparedBinaryData.fileExtension)\n\t\t\t\t\t) {\n\t\t\t\t\t\tpreparedBinaryData.fileName = requestOptions.uri.split('/').pop();\n\t\t\t\t\t}\n\n\t\t\t\t\tnewItem.binary![outputPropertyName] = preparedBinaryData;\n\n\t\t\t\t\treturnItems.push(newItem);\n\t\t\t\t} else if (responseFormat === 'text') {\n\t\t\t\t\tconst outputPropertyName = this.getNodeParameter(\n\t\t\t\t\t\t'options.response.response.outputPropertyName',\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t'data',\n\t\t\t\t\t) as string;\n\t\t\t\t\tif (fullResponse) {\n\t\t\t\t\t\tconst returnItem: IDataObject = {};\n\t\t\t\t\t\tfor (const property of fullResponseProperties) {\n\t\t\t\t\t\t\tif (property === 'body') {\n\t\t\t\t\t\t\t\treturnItem[outputPropertyName] = toText(response[property]);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturnItem[property] = response[property];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\tjson: returnItem,\n\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\t\t[outputPropertyName]: toText(response),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// responseFormat: 'json'\n\t\t\t\t\tif (fullResponse) {\n\t\t\t\t\t\tconst returnItem: IDataObject = {};\n\t\t\t\t\t\tfor (const property of fullResponseProperties) {\n\t\t\t\t\t\t\treturnItem[property] = response[property];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (responseFormat === 'json' && typeof returnItem.body === 'string') {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\treturnItem.body = JSON.parse(returnItem.body);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t'Response body is not valid JSON. Change \"Response Format\" to \"Text\"',\n\t\t\t\t\t\t\t\t\t{ itemIndex },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\tjson: returnItem,\n\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (responseFormat === 'json' && typeof response === 'string') {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tif (typeof response !== 'object') {\n\t\t\t\t\t\t\t\t\tresponse = JSON.parse(response);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t'Response body is not valid JSON. Change \"Response Format\" to \"Text\"',\n\t\t\t\t\t\t\t\t\t{ itemIndex },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (Array.isArray(response)) {\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-loop-func\n\t\t\t\t\t\t\tresponse.forEach((item) =>\n\t\t\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\t\t\tjson: item,\n\t\t\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\t\tjson: response,\n\t\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturnItems = returnItems.map(replaceNullValues);\n\n\t\tif (\n\t\t\treturnItems.length === 1 &&\n\t\t\treturnItems[0].json.data &&\n\t\t\tArray.isArray(returnItems[0].json.data)\n\t\t) {\n\t\t\tthis.addExecutionHints({\n\t\t\t\tmessage:\n\t\t\t\t\t'To split the contents of ‘data’ into separate items for easier processing, add a ‘Split Out’ node after this one',\n\t\t\t\tlocation: 'outputPane',\n\t\t\t});\n\t\t}\n\n\t\treturn [returnItems];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAehB,0BAQO;AAGP,uBAAgC;AAEhC,yBAA+B;AAE/B,8BASO;AAEP,SAAS,OAAU,MAAS;AAC3B,MAAI,OAAO,SAAS,YAAY,SAAS,MAAM;AAC9C,WAAO,KAAK,UAAU,IAAI;AAAA,EAC3B;AACA,SAAO;AACR;AACO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,UAAU;AAAA,MACV,SAAS,CAAC,GAAG,GAAG,KAAK,GAAG;AAAA,MACxB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC,wCAAoB,IAAI;AAAA,MACjC,SAAS,CAAC,wCAAo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../../../../nodes/HttpRequest/V3/HttpRequestV3.node.ts"],"sourcesContent":["import set from 'lodash/set';\nimport type {\n\tIBinaryKeyData,\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeBaseDescription,\n\tINodeTypeDescription,\n\tIRequestOptionsSimplified,\n\tPaginationOptions,\n\tJsonObject,\n\tIRequestOptions,\n\tIHttpRequestMethods,\n} from 'n8n-workflow';\nimport {\n\tBINARY_ENCODING,\n\tNodeApiError,\n\tNodeConnectionTypes,\n\tNodeOperationError,\n\tjsonParse,\n\tremoveCircularRefs,\n\tsleep,\n} from 'n8n-workflow';\nimport type { Readable } from 'stream';\n\nimport { keysToLowercase } from '@utils/utilities';\n\nimport { mainProperties } from './Description';\nimport type { BodyParameter, IAuthDataSanitizeKeys } from '../GenericFunctions';\nimport {\n\tbinaryContentTypes,\n\tgetOAuth2AdditionalParameters,\n\tgetSecrets,\n\tprepareRequestBody,\n\treduceAsync,\n\treplaceNullValues,\n\tsanitizeUiMessage,\n\tsetAgentOptions,\n} from '../GenericFunctions';\nimport { configureResponseOptimizer } from '../shared/optimizeResponse';\n\nfunction toText<T>(data: T) {\n\tif (typeof data === 'object' && data !== null) {\n\t\treturn JSON.stringify(data);\n\t}\n\treturn data;\n}\nexport class HttpRequestV3 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tsubtitle: '={{$parameter[\"method\"] + \": \" + $parameter[\"url\"]}}',\n\t\t\tversion: [3, 4, 4.1, 4.2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'HTTP Request',\n\t\t\t\tcolor: '#0004F5',\n\t\t\t},\n\t\t\tinputs: [NodeConnectionTypes.Main],\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tcredentials: [\n\t\t\t\t{\n\t\t\t\t\tname: 'httpSslAuth',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tprovideSslCertificates: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tusableAsTool: {\n\t\t\t\treplacements: {\n\t\t\t\t\tcodex: {\n\t\t\t\t\t\tsubcategories: {\n\t\t\t\t\t\t\tTools: ['Recommended Tools'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tproperties: mainProperties,\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tconst fullResponseProperties = ['body', 'headers', 'statusCode', 'statusMessage'];\n\n\t\tlet authentication;\n\n\t\ttry {\n\t\t\tauthentication = this.getNodeParameter('authentication', 0) as\n\t\t\t\t| 'predefinedCredentialType'\n\t\t\t\t| 'genericCredentialType'\n\t\t\t\t| 'none';\n\t\t} catch {}\n\n\t\tlet httpBasicAuth;\n\t\tlet httpDigestAuth;\n\t\tlet httpHeaderAuth;\n\t\tlet httpQueryAuth;\n\t\tlet httpCustomAuth;\n\t\tlet oAuth1Api;\n\t\tlet oAuth2Api;\n\t\tlet sslCertificates;\n\t\tlet nodeCredentialType: string | undefined;\n\t\tlet genericCredentialType: string | undefined;\n\n\t\tlet requestOptions: IRequestOptions = {\n\t\t\turi: '',\n\t\t};\n\n\t\tlet returnItems: INodeExecutionData[] = [];\n\t\tconst errorItems: { [key: string]: string } = {};\n\t\tconst requestPromises = [];\n\n\t\tlet fullResponse = false;\n\n\t\tlet autoDetectResponseFormat = false;\n\n\t\t// Can not be defined on a per item level\n\t\tconst pagination = this.getNodeParameter('options.pagination.pagination', 0, null, {\n\t\t\trawExpressions: true,\n\t\t}) as {\n\t\t\tpaginationMode: 'off' | 'updateAParameterInEachRequest' | 'responseContainsNextURL';\n\t\t\tnextURL?: string;\n\t\t\tparameters: {\n\t\t\t\tparameters: Array<{\n\t\t\t\t\ttype: 'body' | 'headers' | 'qs';\n\t\t\t\t\tname: string;\n\t\t\t\t\tvalue: string;\n\t\t\t\t}>;\n\t\t\t};\n\t\t\tpaginationCompleteWhen: 'responseIsEmpty' | 'receiveSpecificStatusCodes' | 'other';\n\t\t\tstatusCodesWhenComplete: string;\n\t\t\tcompleteExpression: string;\n\t\t\tlimitPagesFetched: boolean;\n\t\t\tmaxRequests: number;\n\t\t\trequestInterval: number;\n\t\t};\n\n\t\tconst requests: Array<{\n\t\t\toptions: IRequestOptions;\n\t\t\tauthKeys: IAuthDataSanitizeKeys;\n\t\t\tcredentialType?: string;\n\t\t}> = [];\n\n\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\ttry {\n\t\t\t\tif (authentication === 'genericCredentialType') {\n\t\t\t\t\tgenericCredentialType = this.getNodeParameter('genericAuthType', 0) as string;\n\n\t\t\t\t\tif (genericCredentialType === 'httpBasicAuth') {\n\t\t\t\t\t\thttpBasicAuth = await this.getCredentials('httpBasicAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpDigestAuth') {\n\t\t\t\t\t\thttpDigestAuth = await this.getCredentials('httpDigestAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpHeaderAuth') {\n\t\t\t\t\t\thttpHeaderAuth = await this.getCredentials('httpHeaderAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpQueryAuth') {\n\t\t\t\t\t\thttpQueryAuth = await this.getCredentials('httpQueryAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'httpCustomAuth') {\n\t\t\t\t\t\thttpCustomAuth = await this.getCredentials('httpCustomAuth', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'oAuth1Api') {\n\t\t\t\t\t\toAuth1Api = await this.getCredentials('oAuth1Api', itemIndex);\n\t\t\t\t\t} else if (genericCredentialType === 'oAuth2Api') {\n\t\t\t\t\t\toAuth2Api = await this.getCredentials('oAuth2Api', itemIndex);\n\t\t\t\t\t}\n\t\t\t\t} else if (authentication === 'predefinedCredentialType') {\n\t\t\t\t\tnodeCredentialType = this.getNodeParameter('nodeCredentialType', itemIndex) as string;\n\t\t\t\t}\n\n\t\t\t\tconst provideSslCertificates = this.getNodeParameter(\n\t\t\t\t\t'provideSslCertificates',\n\t\t\t\t\titemIndex,\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\n\t\t\t\tif (provideSslCertificates) {\n\t\t\t\t\tsslCertificates = await this.getCredentials('httpSslAuth', itemIndex);\n\t\t\t\t}\n\n\t\t\t\tconst requestMethod = this.getNodeParameter('method', itemIndex) as IHttpRequestMethods;\n\n\t\t\t\tconst sendQuery = this.getNodeParameter('sendQuery', itemIndex, false) as boolean;\n\t\t\t\tconst queryParameters = this.getNodeParameter(\n\t\t\t\t\t'queryParameters.parameters',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t) as [{ name: string; value: string }];\n\t\t\t\tconst specifyQuery = this.getNodeParameter('specifyQuery', itemIndex, 'keypair') as string;\n\t\t\t\tconst jsonQueryParameter = this.getNodeParameter('jsonQuery', itemIndex, '') as string;\n\n\t\t\t\tconst sendBody = this.getNodeParameter('sendBody', itemIndex, false) as boolean;\n\t\t\t\tconst bodyContentType = this.getNodeParameter('contentType', itemIndex, '') as string;\n\t\t\t\tconst specifyBody = this.getNodeParameter('specifyBody', itemIndex, '') as string;\n\t\t\t\tconst bodyParameters = this.getNodeParameter(\n\t\t\t\t\t'bodyParameters.parameters',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t) as BodyParameter[];\n\t\t\t\tconst jsonBodyParameter = this.getNodeParameter('jsonBody', itemIndex, '') as string;\n\t\t\t\tconst body = this.getNodeParameter('body', itemIndex, '') as string;\n\n\t\t\t\tconst sendHeaders = this.getNodeParameter('sendHeaders', itemIndex, false) as boolean;\n\n\t\t\t\tconst headerParameters = this.getNodeParameter(\n\t\t\t\t\t'headerParameters.parameters',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t) as [{ name: string; value: string }];\n\n\t\t\t\tconst specifyHeaders = this.getNodeParameter(\n\t\t\t\t\t'specifyHeaders',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t'keypair',\n\t\t\t\t) as string;\n\n\t\t\t\tconst jsonHeadersParameter = this.getNodeParameter('jsonHeaders', itemIndex, '') as string;\n\n\t\t\t\tconst {\n\t\t\t\t\tredirect,\n\t\t\t\t\tbatching,\n\t\t\t\t\tproxy,\n\t\t\t\t\ttimeout,\n\t\t\t\t\tallowUnauthorizedCerts,\n\t\t\t\t\tqueryParameterArrays,\n\t\t\t\t\tresponse,\n\t\t\t\t\tlowercaseHeaders,\n\t\t\t\t} = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\t\t\tbatching: { batch: { batchSize: number; batchInterval: number } };\n\t\t\t\t\tproxy: string;\n\t\t\t\t\ttimeout: number;\n\t\t\t\t\tallowUnauthorizedCerts: boolean;\n\t\t\t\t\tqueryParameterArrays: 'indices' | 'brackets' | 'repeat';\n\t\t\t\t\tresponse: {\n\t\t\t\t\t\tresponse: { neverError: boolean; responseFormat: string; fullResponse: boolean };\n\t\t\t\t\t};\n\t\t\t\t\tredirect: { redirect: { maxRedirects: number; followRedirects: boolean } };\n\t\t\t\t\tlowercaseHeaders: boolean;\n\t\t\t\t};\n\n\t\t\t\tconst url = this.getNodeParameter('url', itemIndex) as string;\n\n\t\t\t\tconst responseFormat = response?.response?.responseFormat || 'autodetect';\n\n\t\t\t\tfullResponse = response?.response?.fullResponse || false;\n\n\t\t\t\tautoDetectResponseFormat = responseFormat === 'autodetect';\n\n\t\t\t\t// defaults batch size to 1 of it's set to 0\n\t\t\t\tconst batchSize = batching?.batch?.batchSize > 0 ? batching?.batch?.batchSize : 1;\n\t\t\t\tconst batchInterval = batching?.batch.batchInterval;\n\n\t\t\t\tif (itemIndex > 0 && batchSize >= 0 && batchInterval > 0) {\n\t\t\t\t\tif (itemIndex % batchSize === 0) {\n\t\t\t\t\t\tawait sleep(batchInterval);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\trequestOptions = {\n\t\t\t\t\theaders: {},\n\t\t\t\t\tmethod: requestMethod,\n\t\t\t\t\turi: url,\n\t\t\t\t\tgzip: true,\n\t\t\t\t\trejectUnauthorized: !allowUnauthorizedCerts || false,\n\t\t\t\t\tfollowRedirect: false,\n\t\t\t\t\tresolveWithFullResponse: true,\n\t\t\t\t};\n\n\t\t\t\tif (requestOptions.method !== 'GET' && nodeVersion >= 4.1) {\n\t\t\t\t\trequestOptions = { ...requestOptions, followAllRedirects: false };\n\t\t\t\t}\n\n\t\t\t\tconst defaultRedirect = nodeVersion >= 4 && redirect === undefined;\n\n\t\t\t\tif (redirect?.redirect?.followRedirects || defaultRedirect) {\n\t\t\t\t\trequestOptions.followRedirect = true;\n\t\t\t\t\trequestOptions.followAllRedirects = true;\n\t\t\t\t}\n\n\t\t\t\tif (redirect?.redirect?.maxRedirects || defaultRedirect) {\n\t\t\t\t\trequestOptions.maxRedirects = redirect?.redirect?.maxRedirects;\n\t\t\t\t}\n\n\t\t\t\tif (response?.response?.neverError) {\n\t\t\t\t\trequestOptions.simple = false;\n\t\t\t\t}\n\n\t\t\t\tif (proxy) {\n\t\t\t\t\trequestOptions.proxy = proxy;\n\t\t\t\t}\n\n\t\t\t\tif (timeout) {\n\t\t\t\t\trequestOptions.timeout = timeout;\n\t\t\t\t} else {\n\t\t\t\t\t// set default timeout to 5 minutes\n\t\t\t\t\trequestOptions.timeout = 300_000;\n\t\t\t\t}\n\t\t\t\tif (sendQuery && queryParameterArrays) {\n\t\t\t\t\tObject.assign(requestOptions, {\n\t\t\t\t\t\tqsStringifyOptions: { arrayFormat: queryParameterArrays },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst parametersToKeyValue = async (\n\t\t\t\t\taccumulator: { [key: string]: any },\n\t\t\t\t\tcur: { name: string; value: string; parameterType?: string; inputDataFieldName?: string },\n\t\t\t\t) => {\n\t\t\t\t\tif (cur.parameterType === 'formBinaryData') {\n\t\t\t\t\t\tif (!cur.inputDataFieldName) return accumulator;\n\t\t\t\t\t\tconst binaryData = this.helpers.assertBinaryData(itemIndex, cur.inputDataFieldName);\n\t\t\t\t\t\tlet uploadData: Buffer | Readable;\n\t\t\t\t\t\tconst itemBinaryData = items[itemIndex].binary![cur.inputDataFieldName];\n\t\t\t\t\t\tif (itemBinaryData.id) {\n\t\t\t\t\t\t\tuploadData = await this.helpers.getBinaryStream(itemBinaryData.id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuploadData = Buffer.from(itemBinaryData.data, BINARY_ENCODING);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taccumulator[cur.name] = {\n\t\t\t\t\t\t\tvalue: uploadData,\n\t\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t\tfilename: binaryData.fileName,\n\t\t\t\t\t\t\t\tcontentType: binaryData.mimeType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn accumulator;\n\t\t\t\t\t}\n\t\t\t\t\taccumulator[cur.name] = cur.value;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t};\n\n\t\t\t\t// Get parameters defined in the UI\n\t\t\t\tif (sendBody && bodyParameters) {\n\t\t\t\t\tif (specifyBody === 'keypair' || bodyContentType === 'multipart-form-data') {\n\t\t\t\t\t\trequestOptions.body = await prepareRequestBody(\n\t\t\t\t\t\t\tbodyParameters,\n\t\t\t\t\t\t\tbodyContentType,\n\t\t\t\t\t\t\tnodeVersion,\n\t\t\t\t\t\t\tparametersToKeyValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (specifyBody === 'json') {\n\t\t\t\t\t\t// body is specified using JSON\n\t\t\t\t\t\tif (typeof jsonBodyParameter !== 'object' && jsonBodyParameter !== null) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tJSON.parse(jsonBodyParameter);\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t'JSON parameter needs to be valid JSON',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\trequestOptions.body = jsonParse(jsonBodyParameter);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trequestOptions.body = jsonBodyParameter;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (specifyBody === 'string') {\n\t\t\t\t\t\t//form urlencoded\n\t\t\t\t\t\trequestOptions.body = Object.fromEntries(new URLSearchParams(body));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Change the way data get send in case a different content-type than JSON got selected\n\t\t\t\tif (sendBody && ['PATCH', 'POST', 'PUT', 'GET'].includes(requestMethod)) {\n\t\t\t\t\tif (bodyContentType === 'multipart-form-data') {\n\t\t\t\t\t\trequestOptions.formData = requestOptions.body as IDataObject;\n\t\t\t\t\t\tdelete requestOptions.body;\n\t\t\t\t\t} else if (bodyContentType === 'form-urlencoded') {\n\t\t\t\t\t\trequestOptions.form = requestOptions.body as IDataObject;\n\t\t\t\t\t\tdelete requestOptions.body;\n\t\t\t\t\t} else if (bodyContentType === 'binaryData') {\n\t\t\t\t\t\tconst inputDataFieldName = this.getNodeParameter(\n\t\t\t\t\t\t\t'inputDataFieldName',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t) as string;\n\n\t\t\t\t\t\tlet uploadData: Buffer | Readable;\n\t\t\t\t\t\tlet contentLength: number;\n\n\t\t\t\t\t\tconst itemBinaryData = this.helpers.assertBinaryData(itemIndex, inputDataFieldName);\n\n\t\t\t\t\t\tif (itemBinaryData.id) {\n\t\t\t\t\t\t\tuploadData = await this.helpers.getBinaryStream(itemBinaryData.id);\n\t\t\t\t\t\t\tconst metadata = await this.helpers.getBinaryMetadata(itemBinaryData.id);\n\t\t\t\t\t\t\tcontentLength = metadata.fileSize;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuploadData = Buffer.from(itemBinaryData.data, BINARY_ENCODING);\n\t\t\t\t\t\t\tcontentLength = uploadData.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequestOptions.body = uploadData;\n\t\t\t\t\t\trequestOptions.headers = {\n\t\t\t\t\t\t\t...requestOptions.headers,\n\t\t\t\t\t\t\t'content-length': contentLength,\n\t\t\t\t\t\t\t'content-type': itemBinaryData.mimeType ?? 'application/octet-stream',\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (bodyContentType === 'raw') {\n\t\t\t\t\t\trequestOptions.body = body;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get parameters defined in the UI\n\t\t\t\tif (sendQuery && queryParameters) {\n\t\t\t\t\tif (specifyQuery === 'keypair') {\n\t\t\t\t\t\trequestOptions.qs = await reduceAsync(queryParameters, parametersToKeyValue);\n\t\t\t\t\t} else if (specifyQuery === 'json') {\n\t\t\t\t\t\t// query is specified using JSON\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSON.parse(jsonQueryParameter);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t'JSON parameter needs to be valid JSON',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trequestOptions.qs = jsonParse(jsonQueryParameter);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get parameters defined in the UI\n\t\t\t\tif (sendHeaders && headerParameters) {\n\t\t\t\t\tlet additionalHeaders: IDataObject = {};\n\t\t\t\t\tif (specifyHeaders === 'keypair') {\n\t\t\t\t\t\tadditionalHeaders = await reduceAsync(\n\t\t\t\t\t\t\theaderParameters.filter((header) => header.name),\n\t\t\t\t\t\t\tparametersToKeyValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (specifyHeaders === 'json') {\n\t\t\t\t\t\t// body is specified using JSON\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSON.parse(jsonHeadersParameter);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t'JSON parameter needs to be valid JSON',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tadditionalHeaders = jsonParse(jsonHeadersParameter);\n\t\t\t\t\t}\n\t\t\t\t\trequestOptions.headers = {\n\t\t\t\t\t\t...requestOptions.headers,\n\t\t\t\t\t\t...(lowercaseHeaders === undefined || lowercaseHeaders\n\t\t\t\t\t\t\t? keysToLowercase(additionalHeaders)\n\t\t\t\t\t\t\t: additionalHeaders),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (autoDetectResponseFormat || responseFormat === 'file') {\n\t\t\t\t\trequestOptions.encoding = null;\n\t\t\t\t\trequestOptions.json = false;\n\t\t\t\t\trequestOptions.useStream = true;\n\t\t\t\t} else if (bodyContentType === 'raw') {\n\t\t\t\t\trequestOptions.json = false;\n\t\t\t\t\trequestOptions.useStream = true;\n\t\t\t\t} else {\n\t\t\t\t\trequestOptions.json = true;\n\t\t\t\t}\n\n\t\t\t\t// Add Content Type if any are set\n\t\t\t\tif (bodyContentType === 'raw') {\n\t\t\t\t\tif (requestOptions.headers === undefined) {\n\t\t\t\t\t\trequestOptions.headers = {};\n\t\t\t\t\t}\n\t\t\t\t\tconst rawContentType = this.getNodeParameter('rawContentType', itemIndex) as string;\n\t\t\t\t\trequestOptions.headers['content-type'] = rawContentType;\n\t\t\t\t}\n\n\t\t\t\tconst authDataKeys: IAuthDataSanitizeKeys = {};\n\n\t\t\t\t// Add SSL certificates if any are set\n\t\t\t\tsetAgentOptions(requestOptions, sslCertificates);\n\t\t\t\tif (requestOptions.agentOptions) {\n\t\t\t\t\tauthDataKeys.agentOptions = Object.keys(requestOptions.agentOptions);\n\t\t\t\t}\n\n\t\t\t\t// Add credentials if any are set\n\t\t\t\tif (httpBasicAuth !== undefined) {\n\t\t\t\t\trequestOptions.auth = {\n\t\t\t\t\t\tuser: httpBasicAuth.user as string,\n\t\t\t\t\t\tpass: httpBasicAuth.password as string,\n\t\t\t\t\t};\n\t\t\t\t\tauthDataKeys.auth = ['pass'];\n\t\t\t\t}\n\t\t\t\tif (httpHeaderAuth !== undefined) {\n\t\t\t\t\trequestOptions.headers![httpHeaderAuth.name as string] = httpHeaderAuth.value;\n\t\t\t\t\tauthDataKeys.headers = [httpHeaderAuth.name as string];\n\t\t\t\t}\n\t\t\t\tif (httpQueryAuth !== undefined) {\n\t\t\t\t\tif (!requestOptions.qs) {\n\t\t\t\t\t\trequestOptions.qs = {};\n\t\t\t\t\t}\n\t\t\t\t\trequestOptions.qs[httpQueryAuth.name as string] = httpQueryAuth.value;\n\t\t\t\t\tauthDataKeys.qs = [httpQueryAuth.name as string];\n\t\t\t\t}\n\n\t\t\t\tif (httpDigestAuth !== undefined) {\n\t\t\t\t\trequestOptions.auth = {\n\t\t\t\t\t\tuser: httpDigestAuth.user as string,\n\t\t\t\t\t\tpass: httpDigestAuth.password as string,\n\t\t\t\t\t\tsendImmediately: false,\n\t\t\t\t\t};\n\t\t\t\t\tauthDataKeys.auth = ['pass'];\n\t\t\t\t}\n\t\t\t\tif (httpCustomAuth !== undefined) {\n\t\t\t\t\tconst customAuth = jsonParse<IRequestOptionsSimplified>(\n\t\t\t\t\t\t(httpCustomAuth.json as string) || '{}',\n\t\t\t\t\t\t{ errorMessage: 'Invalid Custom Auth JSON' },\n\t\t\t\t\t);\n\t\t\t\t\tif (customAuth.headers) {\n\t\t\t\t\t\trequestOptions.headers = { ...requestOptions.headers, ...customAuth.headers };\n\t\t\t\t\t\tauthDataKeys.headers = Object.keys(customAuth.headers);\n\t\t\t\t\t}\n\t\t\t\t\tif (customAuth.body) {\n\t\t\t\t\t\trequestOptions.body = { ...(requestOptions.body as IDataObject), ...customAuth.body };\n\t\t\t\t\t\tauthDataKeys.body = Object.keys(customAuth.body);\n\t\t\t\t\t}\n\t\t\t\t\tif (customAuth.qs) {\n\t\t\t\t\t\trequestOptions.qs = { ...requestOptions.qs, ...customAuth.qs };\n\t\t\t\t\t\tauthDataKeys.qs = Object.keys(customAuth.qs);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (requestOptions.headers!.accept === undefined) {\n\t\t\t\t\tif (responseFormat === 'json') {\n\t\t\t\t\t\trequestOptions.headers!.accept = 'application/json,text/*;q=0.99';\n\t\t\t\t\t} else if (responseFormat === 'text') {\n\t\t\t\t\t\trequestOptions.headers!.accept =\n\t\t\t\t\t\t\t'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, */*;q=0.1';\n\t\t\t\t\t} else {\n\t\t\t\t\t\trequestOptions.headers!.accept =\n\t\t\t\t\t\t\t'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\trequests.push({\n\t\t\t\t\toptions: requestOptions,\n\t\t\t\t\tauthKeys: authDataKeys,\n\t\t\t\t\tcredentialType: nodeCredentialType,\n\t\t\t\t});\n\n\t\t\t\tif (pagination && pagination.paginationMode !== 'off') {\n\t\t\t\t\tlet continueExpression = '={{false}}';\n\t\t\t\t\tif (pagination.paginationCompleteWhen === 'receiveSpecificStatusCodes') {\n\t\t\t\t\t\t// Split out comma separated list of status codes into array\n\t\t\t\t\t\tconst statusCodesWhenCompleted = pagination.statusCodesWhenComplete\n\t\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t\t.map((item) => parseInt(item.trim()));\n\n\t\t\t\t\t\tcontinueExpression = `={{ !${JSON.stringify(\n\t\t\t\t\t\t\tstatusCodesWhenCompleted,\n\t\t\t\t\t\t)}.includes($response.statusCode) }}`;\n\t\t\t\t\t} else if (pagination.paginationCompleteWhen === 'responseIsEmpty') {\n\t\t\t\t\t\tcontinueExpression =\n\t\t\t\t\t\t\t'={{ Array.isArray($response.body) ? $response.body.length : !!$response.body }}';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Other\n\t\t\t\t\t\tif (!pagination.completeExpression.length || pagination.completeExpression[0] !== '=') {\n\t\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Invalid or empty Complete Expression');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinueExpression = `={{ !(${pagination.completeExpression.trim().slice(3, -2)}) }}`;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst paginationData: PaginationOptions = {\n\t\t\t\t\t\tcontinue: continueExpression,\n\t\t\t\t\t\trequest: {},\n\t\t\t\t\t\trequestInterval: pagination.requestInterval,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (pagination.paginationMode === 'updateAParameterInEachRequest') {\n\t\t\t\t\t\t// Iterate over all parameters and add them to the request\n\t\t\t\t\t\tpaginationData.request = {};\n\t\t\t\t\t\tconst { parameters } = pagination.parameters;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tparameters.length === 1 &&\n\t\t\t\t\t\t\tparameters[0].name === '' &&\n\t\t\t\t\t\t\tparameters[0].value === ''\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\"At least one entry with 'Name' and 'Value' filled must be included in 'Parameters' to use 'Update a Parameter in Each Request' mode \",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpagination.parameters.parameters.forEach((parameter, index) => {\n\t\t\t\t\t\t\tif (!paginationData.request[parameter.type]) {\n\t\t\t\t\t\t\t\tpaginationData.request[parameter.type] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst parameterName = parameter.name;\n\t\t\t\t\t\t\tif (parameterName === '') {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t`Parameter name must be set for parameter [${index + 1}] in pagination settings`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst parameterValue = parameter.value;\n\t\t\t\t\t\t\tif (parameterValue === '') {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t`Some value must be provided for parameter [${\n\t\t\t\t\t\t\t\t\t\tindex + 1\n\t\t\t\t\t\t\t\t\t}] in pagination settings, omitting it will result in an infinite loop`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpaginationData.request[parameter.type]![parameterName] = parameterValue;\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (pagination.paginationMode === 'responseContainsNextURL') {\n\t\t\t\t\t\tpaginationData.request.url = pagination.nextURL;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (pagination.limitPagesFetched) {\n\t\t\t\t\t\tpaginationData.maxRequests = pagination.maxRequests;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (responseFormat === 'file') {\n\t\t\t\t\t\tpaginationData.binaryResult = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst requestPromise = this.helpers.requestWithAuthenticationPaginated\n\t\t\t\t\t\t.call(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\tpaginationData,\n\t\t\t\t\t\t\tnodeCredentialType ?? genericCredentialType,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tif (error instanceof NodeOperationError && error.type === 'invalid_url') {\n\t\t\t\t\t\t\t\tconst urlParameterName =\n\t\t\t\t\t\t\t\t\tpagination.paginationMode === 'responseContainsNextURL' ? 'Next URL' : 'URL';\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error.message, {\n\t\t\t\t\t\t\t\t\tdescription: `Make sure the \"${urlParameterName}\" parameter evaluates to a valid URL.`,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t});\n\t\t\t\t\trequestPromises.push(requestPromise);\n\t\t\t\t} else if (authentication === 'genericCredentialType' || authentication === 'none') {\n\t\t\t\t\tif (oAuth1Api) {\n\t\t\t\t\t\tconst requestOAuth1 = this.helpers.requestOAuth1.call(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t'oAuth1Api',\n\t\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\t);\n\t\t\t\t\t\trequestOAuth1.catch(() => {});\n\t\t\t\t\t\trequestPromises.push(requestOAuth1);\n\t\t\t\t\t} else if (oAuth2Api) {\n\t\t\t\t\t\tconst requestOAuth2 = this.helpers.requestOAuth2.call(\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t'oAuth2Api',\n\t\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttokenType: 'Bearer',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\trequestOAuth2.catch(() => {});\n\t\t\t\t\t\trequestPromises.push(requestOAuth2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// bearerAuth, queryAuth, headerAuth, digestAuth, none\n\t\t\t\t\t\tconst request = this.helpers.request(requestOptions);\n\t\t\t\t\t\trequest.catch(() => {});\n\t\t\t\t\t\trequestPromises.push(request);\n\t\t\t\t\t}\n\t\t\t\t} else if (authentication === 'predefinedCredentialType' && nodeCredentialType) {\n\t\t\t\t\tconst additionalOAuth2Options = getOAuth2AdditionalParameters(nodeCredentialType);\n\n\t\t\t\t\t// service-specific cred: OAuth1, OAuth2, plain\n\n\t\t\t\t\tconst requestWithAuthentication = this.helpers.requestWithAuthentication.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tnodeCredentialType,\n\t\t\t\t\t\trequestOptions,\n\t\t\t\t\t\tadditionalOAuth2Options && { oauth2: additionalOAuth2Options },\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t);\n\t\t\t\t\trequestWithAuthentication.catch(() => {});\n\t\t\t\t\trequestPromises.push(requestWithAuthentication);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (!this.continueOnFail()) throw error;\n\n\t\t\t\trequestPromises.push(Promise.reject(error).catch(() => {}));\n\n\t\t\t\terrorItems[itemIndex] = error.message;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst sanitizedRequests: IDataObject[] = [];\n\t\tconst promisesResponses = await Promise.allSettled(\n\t\t\trequestPromises.map(\n\t\t\t\tasync (requestPromise, itemIndex) =>\n\t\t\t\t\tawait requestPromise\n\t\t\t\t\t\t.then((response) => response)\n\t\t\t\t\t\t.finally(async () => {\n\t\t\t\t\t\t\tif (errorItems[itemIndex]) return;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t// Secrets need to be read after the request because secrets could have changed\n\t\t\t\t\t\t\t\t// For example: OAuth token refresh, preAuthentication\n\t\t\t\t\t\t\t\tconst { options, authKeys, credentialType } = requests[itemIndex];\n\t\t\t\t\t\t\t\tlet secrets: string[] = [];\n\t\t\t\t\t\t\t\tif (credentialType) {\n\t\t\t\t\t\t\t\t\tconst properties = this.getCredentialsProperties(credentialType);\n\t\t\t\t\t\t\t\t\tconst credentials = await this.getCredentials(credentialType, itemIndex);\n\t\t\t\t\t\t\t\t\tsecrets = getSecrets(properties, credentials);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst sanitizedRequestOptions = sanitizeUiMessage(options, authKeys, secrets);\n\t\t\t\t\t\t\t\tsanitizedRequests.push(sanitizedRequestOptions);\n\t\t\t\t\t\t\t\tthis.sendMessageToUI(sanitizedRequestOptions);\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}),\n\t\t\t),\n\t\t);\n\n\t\tlet responseData: any;\n\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\tresponseData = promisesResponses.shift();\n\n\t\t\tif (errorItems[itemIndex]) {\n\t\t\t\treturnItems.push({\n\t\t\t\t\tjson: { error: errorItems[itemIndex] },\n\t\t\t\t\tpairedItem: { item: itemIndex },\n\t\t\t\t});\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (responseData!.status !== 'fulfilled') {\n\t\t\t\tif (responseData.reason.statusCode === 429) {\n\t\t\t\t\tresponseData.reason.message =\n\t\t\t\t\t\t\"Try spacing your requests out using the batching settings under 'Options'\";\n\t\t\t\t}\n\t\t\t\tif (!this.continueOnFail()) {\n\t\t\t\t\tif (autoDetectResponseFormat && responseData.reason.error instanceof Buffer) {\n\t\t\t\t\t\tresponseData.reason.error = Buffer.from(responseData.reason.error as Buffer).toString();\n\t\t\t\t\t}\n\n\t\t\t\t\tlet error;\n\t\t\t\t\tif (responseData?.reason instanceof NodeApiError) {\n\t\t\t\t\t\terror = responseData.reason;\n\t\t\t\t\t\tset(error, 'context.itemIndex', itemIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst errorData = (\n\t\t\t\t\t\t\tresponseData.reason ? responseData.reason : responseData\n\t\t\t\t\t\t) as JsonObject;\n\t\t\t\t\t\terror = new NodeApiError(this.getNode(), errorData, { itemIndex });\n\t\t\t\t\t}\n\n\t\t\t\t\tset(error, 'context.request', sanitizedRequests[itemIndex]);\n\n\t\t\t\t\tthrow error;\n\t\t\t\t} else {\n\t\t\t\t\tremoveCircularRefs(responseData.reason as JsonObject);\n\t\t\t\t\t// Return the actual reason as error\n\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\terror: responseData.reason,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet responses: any[];\n\t\t\tif (Array.isArray(responseData.value)) {\n\t\t\t\tresponses = responseData.value;\n\t\t\t} else {\n\t\t\t\tresponses = [responseData.value];\n\t\t\t}\n\n\t\t\tlet responseFormat = this.getNodeParameter(\n\t\t\t\t'options.response.response.responseFormat',\n\t\t\t\t0,\n\t\t\t\t'autodetect',\n\t\t\t) as string;\n\n\t\t\tfullResponse = this.getNodeParameter(\n\t\t\t\t'options.response.response.fullResponse',\n\t\t\t\t0,\n\t\t\t\tfalse,\n\t\t\t) as boolean;\n\n\t\t\t// eslint-disable-next-line prefer-const\n\t\t\tfor (let [index, response] of Object.entries(responses)) {\n\t\t\t\tif (response?.request?.constructor.name === 'ClientRequest') delete response.request;\n\n\t\t\t\tif (this.getMode() === 'manual' && index === '0') {\n\t\t\t\t\t// For manual executions save the first response in the context\n\t\t\t\t\t// so that we can use it in the frontend and so make it easier for\n\t\t\t\t\t// the users to create the required pagination expressions\n\t\t\t\t\tconst nodeContext = this.getContext('node');\n\t\t\t\t\tif (pagination && pagination.paginationMode !== 'off') {\n\t\t\t\t\t\tnodeContext.response = responseData.value[0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnodeContext.response = responseData.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst responseContentType = response.headers['content-type'] ?? '';\n\t\t\t\tif (autoDetectResponseFormat) {\n\t\t\t\t\tif (responseContentType.includes('application/json')) {\n\t\t\t\t\t\tresponseFormat = 'json';\n\t\t\t\t\t\tif (!response.__bodyResolved) {\n\t\t\t\t\t\t\tconst neverError = this.getNodeParameter(\n\t\t\t\t\t\t\t\t'options.response.response.neverError',\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t) as boolean;\n\n\t\t\t\t\t\t\tconst data = await this.helpers.binaryToString(response.body as Buffer | Readable);\n\t\t\t\t\t\t\tresponse.body = jsonParse(data, {\n\t\t\t\t\t\t\t\t...(neverError\n\t\t\t\t\t\t\t\t\t? { fallbackValue: {} }\n\t\t\t\t\t\t\t\t\t: { errorMessage: 'Invalid JSON in response body' }),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (binaryContentTypes.some((e) => responseContentType.includes(e))) {\n\t\t\t\t\t\tresponseFormat = 'file';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponseFormat = 'text';\n\t\t\t\t\t\tif (!response.__bodyResolved) {\n\t\t\t\t\t\t\tconst data = await this.helpers.binaryToString(response.body as Buffer | Readable);\n\t\t\t\t\t\t\tresponse.body = !data ? undefined : data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// This is a no-op outside of tool usage\n\t\t\t\tconst optimizeResponse = configureResponseOptimizer(this, itemIndex);\n\n\t\t\t\tif (autoDetectResponseFormat && !fullResponse) {\n\t\t\t\t\tdelete response.headers;\n\t\t\t\t\tdelete response.statusCode;\n\t\t\t\t\tdelete response.statusMessage;\n\t\t\t\t}\n\t\t\t\tif (!fullResponse) {\n\t\t\t\t\tresponse = optimizeResponse(response.body);\n\t\t\t\t} else {\n\t\t\t\t\tresponse.body = optimizeResponse(response.body);\n\t\t\t\t}\n\t\t\t\tif (responseFormat === 'file') {\n\t\t\t\t\tconst outputPropertyName = this.getNodeParameter(\n\t\t\t\t\t\t'options.response.response.outputPropertyName',\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t'data',\n\t\t\t\t\t) as string;\n\n\t\t\t\t\tconst newItem: INodeExecutionData = {\n\t\t\t\t\t\tjson: {},\n\t\t\t\t\t\tbinary: {},\n\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tif (items[itemIndex].binary !== undefined) {\n\t\t\t\t\t\t// Create a shallow copy of the binary data so that the old\n\t\t\t\t\t\t// data references which do not get changed still stay behind\n\t\t\t\t\t\t// but the incoming data does not get changed.\n\t\t\t\t\t\tObject.assign(newItem.binary as IBinaryKeyData, items[itemIndex].binary);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet binaryData: Buffer | Readable;\n\t\t\t\t\tif (fullResponse) {\n\t\t\t\t\t\tconst returnItem: IDataObject = {};\n\t\t\t\t\t\tfor (const property of fullResponseProperties) {\n\t\t\t\t\t\t\tif (property === 'body') {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturnItem[property] = response[property];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewItem.json = returnItem;\n\t\t\t\t\t\tbinaryData = response?.body;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewItem.json = items[itemIndex].json;\n\t\t\t\t\t\tbinaryData = response;\n\t\t\t\t\t}\n\t\t\t\t\tconst preparedBinaryData = await this.helpers.prepareBinaryData(\n\t\t\t\t\t\tbinaryData,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tresponseContentType || undefined,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!preparedBinaryData.fileName &&\n\t\t\t\t\t\tpreparedBinaryData.fileExtension &&\n\t\t\t\t\t\ttypeof requestOptions.uri === 'string' &&\n\t\t\t\t\t\trequestOptions.uri.endsWith(preparedBinaryData.fileExtension)\n\t\t\t\t\t) {\n\t\t\t\t\t\tpreparedBinaryData.fileName = requestOptions.uri.split('/').pop();\n\t\t\t\t\t}\n\n\t\t\t\t\tnewItem.binary![outputPropertyName] = preparedBinaryData;\n\n\t\t\t\t\treturnItems.push(newItem);\n\t\t\t\t} else if (responseFormat === 'text') {\n\t\t\t\t\tconst outputPropertyName = this.getNodeParameter(\n\t\t\t\t\t\t'options.response.response.outputPropertyName',\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t'data',\n\t\t\t\t\t) as string;\n\t\t\t\t\tif (fullResponse) {\n\t\t\t\t\t\tconst returnItem: IDataObject = {};\n\t\t\t\t\t\tfor (const property of fullResponseProperties) {\n\t\t\t\t\t\t\tif (property === 'body') {\n\t\t\t\t\t\t\t\treturnItem[outputPropertyName] = toText(response[property]);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturnItem[property] = response[property];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\tjson: returnItem,\n\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\t\t[outputPropertyName]: toText(response),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// responseFormat: 'json'\n\t\t\t\t\tif (fullResponse) {\n\t\t\t\t\t\tconst returnItem: IDataObject = {};\n\t\t\t\t\t\tfor (const property of fullResponseProperties) {\n\t\t\t\t\t\t\treturnItem[property] = response[property];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (responseFormat === 'json' && typeof returnItem.body === 'string') {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\treturnItem.body = JSON.parse(returnItem.body);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t'Response body is not valid JSON. Change \"Response Format\" to \"Text\"',\n\t\t\t\t\t\t\t\t\t{ itemIndex },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\tjson: returnItem,\n\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (responseFormat === 'json' && typeof response === 'string') {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tif (typeof response !== 'object') {\n\t\t\t\t\t\t\t\t\tresponse = JSON.parse(response);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t\t\t'Response body is not valid JSON. Change \"Response Format\" to \"Text\"',\n\t\t\t\t\t\t\t\t\t{ itemIndex },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (Array.isArray(response)) {\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-loop-func\n\t\t\t\t\t\t\tresponse.forEach((item) =>\n\t\t\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\t\t\tjson: item,\n\t\t\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturnItems.push({\n\t\t\t\t\t\t\t\tjson: response,\n\t\t\t\t\t\t\t\tpairedItem: {\n\t\t\t\t\t\t\t\t\titem: itemIndex,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturnItems = returnItems.map(replaceNullValues);\n\n\t\tif (\n\t\t\treturnItems.length === 1 &&\n\t\t\treturnItems[0].json.data &&\n\t\t\tArray.isArray(returnItems[0].json.data)\n\t\t) {\n\t\t\tconst message =\n\t\t\t\t'To split the contents of ‘data’ into separate items for easier processing, add a ‘Split Out’ node after this one';\n\n\t\t\tif (this.addExecutionHints) {\n\t\t\t\tthis.addExecutionHints({\n\t\t\t\t\tmessage,\n\t\t\t\t\tlocation: 'outputPane',\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.logger.info(message);\n\t\t\t}\n\t\t}\n\n\t\treturn [returnItems];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAehB,0BAQO;AAGP,uBAAgC;AAEhC,yBAA+B;AAE/B,8BASO;AACP,8BAA2C;AAE3C,SAAS,OAAU,MAAS;AAC3B,MAAI,OAAO,SAAS,YAAY,SAAS,MAAM;AAC9C,WAAO,KAAK,UAAU,IAAI;AAAA,EAC3B;AACA,SAAO;AACR;AACO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,UAAU;AAAA,MACV,SAAS,CAAC,GAAG,GAAG,KAAK,GAAG;AAAA,MACxB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC,wCAAoB,IAAI;AAAA,MACjC,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,UACV,gBAAgB;AAA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ACrC;AACD,YAAM,UACL;AAED,UAAI,KAAK,mBAAmB;AAC3B,aAAK,kBAAkB;AAAA,UACtB;AAAA,UACA,UAAU;AAAA,QACX,CAAC;AAAA,MACF,OAAO;AACN,aAAK,OAAO,KAAK,OAAO;AAAA,MACzB;AAAA,IACD;AAEA,WAAO,CAAC,WAAW;AAAA,EACpB;AACD;","names":["set"]}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var optimizeResponse_exports = {};
|
|
30
|
+
__export(optimizeResponse_exports, {
|
|
31
|
+
configureResponseOptimizer: () => configureResponseOptimizer,
|
|
32
|
+
optimizeResponseProperties: () => optimizeResponseProperties
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(optimizeResponse_exports);
|
|
35
|
+
var import_readability = require("@mozilla/readability");
|
|
36
|
+
var cheerio = __toESM(require("cheerio"));
|
|
37
|
+
var import_html_to_text = require("html-to-text");
|
|
38
|
+
var import_jsdom = require("jsdom");
|
|
39
|
+
var import_lodash = require("lodash");
|
|
40
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
41
|
+
function htmlOptimizer(ctx, itemIndex, maxLength) {
|
|
42
|
+
const cssSelector = ctx.getNodeParameter("cssSelector", itemIndex, "");
|
|
43
|
+
const onlyContent = ctx.getNodeParameter("onlyContent", itemIndex, false);
|
|
44
|
+
let elementsToOmit = [];
|
|
45
|
+
if (onlyContent) {
|
|
46
|
+
const elementsToOmitUi = ctx.getNodeParameter("elementsToOmit", itemIndex, "");
|
|
47
|
+
if (typeof elementsToOmitUi === "string") {
|
|
48
|
+
elementsToOmit = elementsToOmitUi.split(",").filter((s) => s).map((s) => s.trim());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return (response) => {
|
|
52
|
+
if (typeof response !== "string") {
|
|
53
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
54
|
+
ctx.getNode(),
|
|
55
|
+
`The response type must be a string. Received: ${typeof response}`,
|
|
56
|
+
{ itemIndex }
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const returnData = [];
|
|
60
|
+
const html = cheerio.load(response);
|
|
61
|
+
const htmlElements = html(cssSelector);
|
|
62
|
+
htmlElements.each((_, el) => {
|
|
63
|
+
let value = html(el).html() || "";
|
|
64
|
+
if (onlyContent) {
|
|
65
|
+
let htmlToTextOptions;
|
|
66
|
+
if (elementsToOmit?.length) {
|
|
67
|
+
htmlToTextOptions = {
|
|
68
|
+
selectors: elementsToOmit.map((selector) => ({
|
|
69
|
+
selector,
|
|
70
|
+
format: "skip"
|
|
71
|
+
}))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
value = (0, import_html_to_text.convert)(value, htmlToTextOptions);
|
|
75
|
+
}
|
|
76
|
+
value = value.trim().replace(/^\s+|\s+$/g, "").replace(/(\r\n|\n|\r)/gm, "").replace(/\s+/g, " ");
|
|
77
|
+
returnData.push(value);
|
|
78
|
+
});
|
|
79
|
+
const text = JSON.stringify(returnData, null, 2);
|
|
80
|
+
if (maxLength > 0 && text.length > maxLength) {
|
|
81
|
+
return text.substring(0, maxLength);
|
|
82
|
+
}
|
|
83
|
+
return text;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const textOptimizer = (ctx, itemIndex, maxLength) => {
|
|
87
|
+
return (response) => {
|
|
88
|
+
if (typeof response === "object") {
|
|
89
|
+
try {
|
|
90
|
+
response = JSON.stringify(response, null, 2);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (typeof response !== "string") {
|
|
95
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
96
|
+
ctx.getNode(),
|
|
97
|
+
`The response type must be a string. Received: ${typeof response}`,
|
|
98
|
+
{ itemIndex }
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const dom = new import_jsdom.JSDOM(response);
|
|
102
|
+
const article = new import_readability.Readability(dom.window.document, {
|
|
103
|
+
keepClasses: true
|
|
104
|
+
}).parse();
|
|
105
|
+
const text = article?.textContent || "";
|
|
106
|
+
if (maxLength > 0 && text.length > maxLength) {
|
|
107
|
+
return text.substring(0, maxLength);
|
|
108
|
+
}
|
|
109
|
+
return text;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const jsonOptimizer = (ctx, itemIndex) => {
|
|
113
|
+
return (response) => {
|
|
114
|
+
let responseData = response;
|
|
115
|
+
if (typeof response === "string") {
|
|
116
|
+
try {
|
|
117
|
+
responseData = (0, import_n8n_workflow.jsonParse)(response, { errorMessage: "Invalid JSON response" });
|
|
118
|
+
} catch (error) {
|
|
119
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
120
|
+
ctx.getNode(),
|
|
121
|
+
`Received invalid JSON from response '${response}'`,
|
|
122
|
+
{ itemIndex }
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (typeof responseData !== "object" || !responseData) {
|
|
127
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
128
|
+
ctx.getNode(),
|
|
129
|
+
"The response type must be an object or an array of objects",
|
|
130
|
+
{ itemIndex }
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const dataField = ctx.getNodeParameter("dataField", itemIndex, "");
|
|
134
|
+
let returnData = [];
|
|
135
|
+
if (!Array.isArray(responseData)) {
|
|
136
|
+
if (dataField) {
|
|
137
|
+
if (!Object.prototype.hasOwnProperty.call(responseData, dataField)) {
|
|
138
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
139
|
+
ctx.getNode(),
|
|
140
|
+
`Target field "${dataField}" not found in response.`,
|
|
141
|
+
{
|
|
142
|
+
itemIndex,
|
|
143
|
+
description: `The response contained these fields: [${Object.keys(responseData).join(", ")}]`
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
const data = responseData[dataField];
|
|
148
|
+
if (Array.isArray(data)) {
|
|
149
|
+
responseData = data;
|
|
150
|
+
} else {
|
|
151
|
+
responseData = [data];
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
responseData = [responseData];
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
if (dataField) {
|
|
158
|
+
responseData = responseData.map((data) => data[dataField]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const fieldsToInclude = ctx.getNodeParameter("fieldsToInclude", itemIndex, "all");
|
|
162
|
+
let fields = [];
|
|
163
|
+
if (fieldsToInclude !== "all") {
|
|
164
|
+
fields = ctx.getNodeParameter("fields", itemIndex, []);
|
|
165
|
+
if (typeof fields === "string") {
|
|
166
|
+
fields = fields.split(",").map((field) => field.trim());
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
returnData = responseData;
|
|
170
|
+
}
|
|
171
|
+
if (fieldsToInclude === "selected") {
|
|
172
|
+
for (const item of responseData) {
|
|
173
|
+
const newItem = {};
|
|
174
|
+
for (const field of fields) {
|
|
175
|
+
(0, import_lodash.set)(newItem, field, (0, import_lodash.get)(item, field));
|
|
176
|
+
}
|
|
177
|
+
returnData.push(newItem);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (fieldsToInclude === "except") {
|
|
181
|
+
for (const item of responseData) {
|
|
182
|
+
for (const field of fields) {
|
|
183
|
+
(0, import_lodash.unset)(item, field);
|
|
184
|
+
}
|
|
185
|
+
returnData.push(item);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return returnData;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
const configureResponseOptimizer = (ctx, itemIndex) => {
|
|
192
|
+
const optimizeResponse = ctx.getNodeParameter("optimizeResponse", itemIndex, false);
|
|
193
|
+
if (optimizeResponse) {
|
|
194
|
+
const responseType = ctx.getNodeParameter("responseType", itemIndex);
|
|
195
|
+
let maxLength = 0;
|
|
196
|
+
const truncateResponse = ctx.getNodeParameter("truncateResponse", itemIndex, false);
|
|
197
|
+
if (truncateResponse) {
|
|
198
|
+
maxLength = ctx.getNodeParameter("maxLength", itemIndex, 0);
|
|
199
|
+
}
|
|
200
|
+
switch (responseType) {
|
|
201
|
+
case "html":
|
|
202
|
+
return htmlOptimizer(ctx, itemIndex, maxLength);
|
|
203
|
+
case "text":
|
|
204
|
+
return textOptimizer(ctx, itemIndex, maxLength);
|
|
205
|
+
case "json":
|
|
206
|
+
return jsonOptimizer(ctx, itemIndex);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return (x) => x;
|
|
210
|
+
};
|
|
211
|
+
const optimizeResponseProperties = [
|
|
212
|
+
{
|
|
213
|
+
displayName: "Optimize Response",
|
|
214
|
+
name: "optimizeResponse",
|
|
215
|
+
type: "boolean",
|
|
216
|
+
default: false,
|
|
217
|
+
noDataExpression: true,
|
|
218
|
+
description: "Whether the optimize the tool response to reduce amount of data passed to the LLM that could lead to better result and reduce cost"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: "Expected Response Type",
|
|
222
|
+
name: "responseType",
|
|
223
|
+
type: "options",
|
|
224
|
+
displayOptions: {
|
|
225
|
+
show: {
|
|
226
|
+
optimizeResponse: [true]
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
options: [
|
|
230
|
+
{
|
|
231
|
+
name: "JSON",
|
|
232
|
+
value: "json"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "HTML",
|
|
236
|
+
value: "html"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "Text",
|
|
240
|
+
value: "text"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
default: "json"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
displayName: "Field Containing Data",
|
|
247
|
+
name: "dataField",
|
|
248
|
+
type: "string",
|
|
249
|
+
default: "",
|
|
250
|
+
placeholder: "e.g. records",
|
|
251
|
+
description: "Specify the name of the field in the response containing the data",
|
|
252
|
+
hint: "leave blank to use whole response",
|
|
253
|
+
requiresDataPath: "single",
|
|
254
|
+
displayOptions: {
|
|
255
|
+
show: {
|
|
256
|
+
optimizeResponse: [true],
|
|
257
|
+
responseType: ["json"]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
displayName: "Include Fields",
|
|
263
|
+
name: "fieldsToInclude",
|
|
264
|
+
type: "options",
|
|
265
|
+
description: "What fields response object should include",
|
|
266
|
+
default: "all",
|
|
267
|
+
displayOptions: {
|
|
268
|
+
show: {
|
|
269
|
+
optimizeResponse: [true],
|
|
270
|
+
responseType: ["json"]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
options: [
|
|
274
|
+
{
|
|
275
|
+
name: "All",
|
|
276
|
+
value: "all",
|
|
277
|
+
description: "Include all fields"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "Selected",
|
|
281
|
+
value: "selected",
|
|
282
|
+
description: "Include only fields specified below"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "Except",
|
|
286
|
+
value: "except",
|
|
287
|
+
description: "Exclude fields specified below"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: "Fields",
|
|
293
|
+
name: "fields",
|
|
294
|
+
type: "string",
|
|
295
|
+
default: "",
|
|
296
|
+
placeholder: "e.g. field1,field2",
|
|
297
|
+
description: "Comma-separated list of the field names. Supports dot notation. You can drag the selected fields from the input panel.",
|
|
298
|
+
requiresDataPath: "multiple",
|
|
299
|
+
displayOptions: {
|
|
300
|
+
show: {
|
|
301
|
+
optimizeResponse: [true],
|
|
302
|
+
responseType: ["json"]
|
|
303
|
+
},
|
|
304
|
+
hide: {
|
|
305
|
+
fieldsToInclude: ["all"]
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
displayName: "Selector (CSS)",
|
|
311
|
+
name: "cssSelector",
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "Select specific element(e.g. body) or multiple elements(e.g. div) of chosen type in the response HTML.",
|
|
314
|
+
placeholder: "e.g. body",
|
|
315
|
+
default: "body",
|
|
316
|
+
displayOptions: {
|
|
317
|
+
show: {
|
|
318
|
+
optimizeResponse: [true],
|
|
319
|
+
responseType: ["html"]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
displayName: "Return Only Content",
|
|
325
|
+
name: "onlyContent",
|
|
326
|
+
type: "boolean",
|
|
327
|
+
default: false,
|
|
328
|
+
description: "Whether to return only content of html elements, stripping html tags and attributes",
|
|
329
|
+
hint: "Uses less tokens and may be easier for model to understand",
|
|
330
|
+
displayOptions: {
|
|
331
|
+
show: {
|
|
332
|
+
optimizeResponse: [true],
|
|
333
|
+
responseType: ["html"]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
displayName: "Elements To Omit",
|
|
339
|
+
name: "elementsToOmit",
|
|
340
|
+
type: "string",
|
|
341
|
+
displayOptions: {
|
|
342
|
+
show: {
|
|
343
|
+
optimizeResponse: [true],
|
|
344
|
+
responseType: ["html"],
|
|
345
|
+
onlyContent: [true]
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
default: "",
|
|
349
|
+
placeholder: "e.g. img, .className, #ItemId",
|
|
350
|
+
description: "Comma-separated list of selectors that would be excluded when extracting content"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
displayName: "Truncate Response",
|
|
354
|
+
name: "truncateResponse",
|
|
355
|
+
type: "boolean",
|
|
356
|
+
default: false,
|
|
357
|
+
hint: "Helps save tokens",
|
|
358
|
+
displayOptions: {
|
|
359
|
+
show: {
|
|
360
|
+
optimizeResponse: [true],
|
|
361
|
+
responseType: ["text", "html"]
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
displayName: "Max Response Characters",
|
|
367
|
+
name: "maxLength",
|
|
368
|
+
type: "number",
|
|
369
|
+
default: 1e3,
|
|
370
|
+
typeOptions: {
|
|
371
|
+
minValue: 1
|
|
372
|
+
},
|
|
373
|
+
displayOptions: {
|
|
374
|
+
show: {
|
|
375
|
+
optimizeResponse: [true],
|
|
376
|
+
responseType: ["text", "html"],
|
|
377
|
+
truncateResponse: [true]
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
];
|
|
382
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
383
|
+
0 && (module.exports = {
|
|
384
|
+
configureResponseOptimizer,
|
|
385
|
+
optimizeResponseProperties
|
|
386
|
+
});
|
|
387
|
+
//# sourceMappingURL=optimizeResponse.js.map
|