n8n-nodes-base 1.94.0 → 1.95.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/GithubOAuth2Api.credentials.js +2 -2
- package/dist/credentials/GithubOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +9 -0
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/PerplexityApi.credentials.js +70 -0
- package/dist/credentials/PerplexityApi.credentials.js.map +1 -0
- package/dist/credentials/icons/microsoftSharePoint.svg +59 -0
- package/dist/known/credentials.json +7 -0
- package/dist/known/nodes.json +4 -0
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +12 -22
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
- package/dist/nodes/JinaAI/JinaAi.node.js +1 -1
- package/dist/nodes/JinaAI/JinaAi.node.js.map +1 -1
- package/dist/nodes/Perplexity/GenericFunctions.js +49 -0
- package/dist/nodes/Perplexity/GenericFunctions.js.map +1 -0
- package/dist/nodes/Perplexity/Perplexity.node.js +78 -0
- package/dist/nodes/Perplexity/Perplexity.node.js.map +1 -0
- package/dist/nodes/Perplexity/Perplexity.node.json +18 -0
- package/dist/nodes/Perplexity/descriptions/chat/Chat.resource.js +72 -0
- package/dist/nodes/Perplexity/descriptions/chat/Chat.resource.js.map +1 -0
- package/dist/nodes/Perplexity/descriptions/chat/complete.operation.js +328 -0
- package/dist/nodes/Perplexity/descriptions/chat/complete.operation.js.map +1 -0
- package/dist/nodes/Perplexity/descriptions/index.js +39 -0
- package/dist/nodes/Perplexity/descriptions/index.js.map +1 -0
- package/dist/nodes/Perplexity/perplexity.svg +35 -0
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +14 -3
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/RespondToWebhook/utils.js +3 -2
- package/dist/nodes/RespondToWebhook/utils.js.map +1 -1
- package/dist/nodes/Telegram/Telegram.node.js +1 -1
- package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
- package/dist/nodes/Transform/Sort/Sort.node.js +2 -2
- package/dist/nodes/Transform/Sort/Sort.node.js.map +1 -1
- package/dist/types/credentials.json +3 -2
- package/dist/types/nodes.json +7 -6
- package/package.json +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/RespondToWebhook/RespondToWebhook.node.ts"],"sourcesContent":["import jwt from 'jsonwebtoken';\nimport set from 'lodash/set';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tIN8nHttpFullResponse,\n\tIN8nHttpResponse,\n\tINodeExecutionData,\n\tINodeProperties,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport {\n\tjsonParse,\n\tBINARY_ENCODING,\n\tNodeOperationError,\n\tNodeConnectionTypes,\n\tWEBHOOK_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\tCHAT_TRIGGER_NODE_TYPE,\n\tWAIT_NODE_TYPE,\n} from 'n8n-workflow';\nimport type { Readable } from 'stream';\n\nimport { configuredOutputs } from './utils';\nimport { formatPrivateKey, generatePairedItemData } from '../../utils/utilities';\n\nconst respondWithProperty: INodeProperties = {\n\tdisplayName: 'Respond With',\n\tname: 'respondWith',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'All Incoming Items',\n\t\t\tvalue: 'allIncomingItems',\n\t\t\tdescription: 'Respond with all input JSON items',\n\t\t},\n\t\t{\n\t\t\tname: 'Binary File',\n\t\t\tvalue: 'binary',\n\t\t\tdescription: 'Respond with incoming file binary data',\n\t\t},\n\t\t{\n\t\t\tname: 'First Incoming Item',\n\t\t\tvalue: 'firstIncomingItem',\n\t\t\tdescription: 'Respond with the first input JSON item',\n\t\t},\n\t\t{\n\t\t\tname: 'JSON',\n\t\t\tvalue: 'json',\n\t\t\tdescription: 'Respond with a custom JSON body',\n\t\t},\n\t\t{\n\t\t\tname: 'JWT Token',\n\t\t\tvalue: 'jwt',\n\t\t\tdescription: 'Respond with a JWT token',\n\t\t},\n\t\t{\n\t\t\tname: 'No Data',\n\t\t\tvalue: 'noData',\n\t\t\tdescription: 'Respond with an empty body',\n\t\t},\n\t\t{\n\t\t\tname: 'Redirect',\n\t\t\tvalue: 'redirect',\n\t\t\tdescription: 'Respond with a redirect to a given URL',\n\t\t},\n\t\t{\n\t\t\tname: 'Text',\n\t\t\tvalue: 'text',\n\t\t\tdescription: 'Respond with a simple text message body',\n\t\t},\n\t],\n\tdefault: 'firstIncomingItem',\n\tdescription: 'The data that should be returned',\n};\n\nexport class RespondToWebhook implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Respond to Webhook',\n\t\ticon: { light: 'file:webhook.svg', dark: 'file:webhook.dark.svg' },\n\t\tname: 'respondToWebhook',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdescription: 'Returns data for Webhook',\n\t\tdefaults: {\n\t\t\tname: 'Respond to Webhook',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: `={{(${configuredOutputs})($nodeVersion)}}`,\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'jwtAuth',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Verify that the \"Webhook\" node\\'s \"Respond\" parameter is set to \"Using Respond to Webhook Node\". <a href=\"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/\" target=\"_blank\">More details',\n\t\t\t\tname: 'generalNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\t...respondWithProperty,\n\t\t\t\tdisplayOptions: { show: { '@version': [1, 1.1] } },\n\t\t\t},\n\t\t\t{\n\t\t\t\t...respondWithProperty,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 1.2 } }] } },\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Credentials',\n\t\t\t\tname: 'credentials',\n\t\t\t\ttype: 'credentials',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'When using expressions, note that this node will only run for the first item in the input data',\n\t\t\t\tname: 'webhookNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['json', 'text', 'jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Redirect URL',\n\t\t\t\tname: 'redirectURL',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['redirect'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. http://www.n8n.io',\n\t\t\t\tdescription: 'The URL to redirect to',\n\t\t\t\tvalidateType: 'url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Response Body',\n\t\t\t\tname: 'responseBody',\n\t\t\t\ttype: 'json',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['json'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '{\\n \"myField\": \"value\"\\n}',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 4,\n\t\t\t\t},\n\t\t\t\tdescription: 'The HTTP response JSON data',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Payload',\n\t\t\t\tname: 'payload',\n\t\t\t\ttype: 'json',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '{\\n \"myField\": \"value\"\\n}',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 4,\n\t\t\t\t},\n\t\t\t\tvalidateType: 'object',\n\t\t\t\tdescription: 'The payload to include in the JWT token',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Response Body',\n\t\t\t\tname: 'responseBody',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['text'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. Workflow completed',\n\t\t\t\tdescription: 'The HTTP response text data',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Response Data Source',\n\t\t\t\tname: 'responseDataSource',\n\t\t\t\ttype: 'options',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['binary'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Choose Automatically From Input',\n\t\t\t\t\t\tvalue: 'automatically',\n\t\t\t\t\t\tdescription: 'Use if input data will contain a single piece of binary data',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Specify Myself',\n\t\t\t\t\t\tvalue: 'set',\n\t\t\t\t\t\tdescription: 'Enter the name of the input field the binary data will be in',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'automatically',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Input Field Name',\n\t\t\t\tname: 'inputFieldName',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: 'data',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['binary'],\n\t\t\t\t\t\tresponseDataSource: ['set'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdescription: 'The name of the node input field with the binary data',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Response Code',\n\t\t\t\t\t\tname: 'responseCode',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tminValue: 100,\n\t\t\t\t\t\t\tmaxValue: 599,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: 200,\n\t\t\t\t\t\tdescription: 'The HTTP response code to return. Defaults to 200.',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Response Headers',\n\t\t\t\t\t\tname: 'responseHeaders',\n\t\t\t\t\t\tplaceholder: 'Add Response Header',\n\t\t\t\t\t\tdescription: 'Add headers to the webhook response',\n\t\t\t\t\t\ttype: 'fixedCollection',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: {},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'entries',\n\t\t\t\t\t\t\t\tdisplayName: 'Entries',\n\t\t\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\t\t\tdescription: 'Name of the header',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\t\t\tname: 'value',\n\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\t\t\tdescription: 'Value of the header',\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],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Put Response in Field',\n\t\t\t\t\t\tname: 'responseKey',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t['/respondWith']: ['allIncomingItems', 'firstIncomingItem'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'The name of the response field to put all items in',\n\t\t\t\t\t\tplaceholder: 'e.g. data',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\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 WEBHOOK_NODE_TYPES = [\n\t\t\tWEBHOOK_NODE_TYPE,\n\t\t\tFORM_TRIGGER_NODE_TYPE,\n\t\t\tCHAT_TRIGGER_NODE_TYPE,\n\t\t\tWAIT_NODE_TYPE,\n\t\t];\n\n\t\tlet response: IN8nHttpFullResponse;\n\n\t\ttry {\n\t\t\tif (nodeVersion >= 1.1) {\n\t\t\t\tconst connectedNodes = this.getParentNodes(this.getNode().name);\n\t\t\t\tif (!connectedNodes.some(({ type }) => WEBHOOK_NODE_TYPES.includes(type))) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\tnew Error('No Webhook node found in the workflow'),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t'Insert a Webhook node to your workflow and set the “Respond” parameter to “Using Respond to Webhook Node” ',\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst respondWith = this.getNodeParameter('respondWith', 0) as string;\n\t\t\tconst options = this.getNodeParameter('options', 0, {});\n\n\t\t\tconst headers = {} as IDataObject;\n\t\t\tif (options.responseHeaders) {\n\t\t\t\tfor (const header of (options.responseHeaders as IDataObject).entries as IDataObject[]) {\n\t\t\t\t\tif (typeof header.name !== 'string') {\n\t\t\t\t\t\theader.name = header.name?.toString();\n\t\t\t\t\t}\n\t\t\t\t\theaders[header.name?.toLowerCase() as string] = header.value?.toString();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet statusCode = (options.responseCode as number) || 200;\n\t\t\tlet responseBody: IN8nHttpResponse | Readable;\n\t\t\tif (respondWith === 'json') {\n\t\t\t\tconst responseBodyParameter = this.getNodeParameter('responseBody', 0) as string;\n\t\t\t\tif (responseBodyParameter) {\n\t\t\t\t\tif (typeof responseBodyParameter === 'object') {\n\t\t\t\t\t\tresponseBody = responseBodyParameter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponseBody = jsonParse(responseBodyParameter);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error as Error, {\n\t\t\t\t\t\t\t\tmessage: \"Invalid JSON in 'Response Body' field\",\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Check that the syntax of the JSON in the 'Response Body' parameter is valid\",\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} else if (respondWith === 'jwt') {\n\t\t\t\ttry {\n\t\t\t\t\tconst { keyType, secret, algorithm, privateKey } = await this.getCredentials<{\n\t\t\t\t\t\tkeyType: 'passphrase' | 'pemKey';\n\t\t\t\t\t\tprivateKey: string;\n\t\t\t\t\t\tsecret: string;\n\t\t\t\t\t\talgorithm: jwt.Algorithm;\n\t\t\t\t\t}>('jwtAuth');\n\n\t\t\t\t\tlet secretOrPrivateKey;\n\n\t\t\t\t\tif (keyType === 'passphrase') {\n\t\t\t\t\t\tsecretOrPrivateKey = secret;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsecretOrPrivateKey = formatPrivateKey(privateKey);\n\t\t\t\t\t}\n\t\t\t\t\tconst payload = this.getNodeParameter('payload', 0, {}) as IDataObject;\n\t\t\t\t\tconst token = jwt.sign(payload, secretOrPrivateKey, { algorithm });\n\t\t\t\t\tresponseBody = { token };\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error as Error, {\n\t\t\t\t\t\tmessage: 'Error signing JWT token',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (respondWith === 'allIncomingItems') {\n\t\t\t\tconst respondItems = items.map((item) => item.json);\n\t\t\t\tresponseBody = options.responseKey\n\t\t\t\t\t? set({}, options.responseKey as string, respondItems)\n\t\t\t\t\t: respondItems;\n\t\t\t} else if (respondWith === 'firstIncomingItem') {\n\t\t\t\tresponseBody = options.responseKey\n\t\t\t\t\t? set({}, options.responseKey as string, items[0].json)\n\t\t\t\t\t: items[0].json;\n\t\t\t} else if (respondWith === 'text') {\n\t\t\t\tresponseBody = this.getNodeParameter('responseBody', 0) as string;\n\t\t\t} else if (respondWith === 'binary') {\n\t\t\t\tconst item = items[0];\n\n\t\t\t\tif (item.binary === undefined) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No binary data exists on the first item!');\n\t\t\t\t}\n\n\t\t\t\tlet responseBinaryPropertyName: string;\n\n\t\t\t\tconst responseDataSource = this.getNodeParameter('responseDataSource', 0) as string;\n\n\t\t\t\tif (responseDataSource === 'set') {\n\t\t\t\t\tresponseBinaryPropertyName = this.getNodeParameter('inputFieldName', 0) as string;\n\t\t\t\t} else {\n\t\t\t\t\tconst binaryKeys = Object.keys(item.binary);\n\t\t\t\t\tif (binaryKeys.length === 0) {\n\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t'No binary data exists on the first item!',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tresponseBinaryPropertyName = binaryKeys[0];\n\t\t\t\t}\n\n\t\t\t\tconst binaryData = this.helpers.assertBinaryData(0, responseBinaryPropertyName);\n\t\t\t\tif (binaryData.id) {\n\t\t\t\t\tresponseBody = { binaryData };\n\t\t\t\t} else {\n\t\t\t\t\tresponseBody = Buffer.from(binaryData.data, BINARY_ENCODING);\n\t\t\t\t\theaders['content-length'] = (responseBody as Buffer).length;\n\t\t\t\t}\n\n\t\t\t\tif (!headers['content-type']) {\n\t\t\t\t\theaders['content-type'] = binaryData.mimeType;\n\t\t\t\t}\n\t\t\t} else if (respondWith === 'redirect') {\n\t\t\t\theaders.location = this.getNodeParameter('redirectURL', 0) as string;\n\t\t\t\tstatusCode = (options.responseCode as number) ?? 307;\n\t\t\t} else if (respondWith !== 'noData') {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t`The Response Data option \"${respondWith}\" is not supported!`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tresponse = {\n\t\t\t\tbody: responseBody,\n\t\t\t\theaders,\n\t\t\t\tstatusCode,\n\t\t\t};\n\n\t\t\tthis.sendResponse(response);\n\t\t} catch (error) {\n\t\t\tif (this.continueOnFail()) {\n\t\t\t\tconst itemData = generatePairedItemData(items.length);\n\t\t\t\tconst returnData = this.helpers.constructExecutionMetaData(\n\t\t\t\t\t[{ json: { error: error.message } }],\n\t\t\t\t\t{ itemData },\n\t\t\t\t);\n\t\t\t\treturn [returnData];\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (nodeVersion >= 1.3) {\n\t\t\treturn [items, [{ json: { response } }]];\n\t\t}\n\n\t\treturn [items];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgB;AAChB,iBAAgB;AAWhB,0BASO;AAGP,mBAAkC;AAClC,uBAAyD;AAEzD,MAAM,sBAAuC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACd;AAEO,MAAM,iBAAsC;AAAA,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B,CAAC,EAAE,MAAM,EAAE,OAAO,MAAM,QAAQ,EAAE,CAAC;AAAA,UACnC,EAAE,SAAS;AAAA,QACZ;AACA,eAAO,CAAC,UAAU;AAAA,MACnB;AAEA,YAAM;AAAA,IACP;AAEA,QAAI,eAAe,KAAK;AACvB,aAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,IACxC;AAEA,WAAO,CAAC,KAAK;AAAA,EACd;AACD;","names":["jwt","set"]}
|
|
1
|
+
{"version":3,"sources":["../../../nodes/RespondToWebhook/RespondToWebhook.node.ts"],"sourcesContent":["import jwt from 'jsonwebtoken';\nimport set from 'lodash/set';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tIN8nHttpFullResponse,\n\tIN8nHttpResponse,\n\tINodeExecutionData,\n\tINodeProperties,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport {\n\tjsonParse,\n\tBINARY_ENCODING,\n\tNodeOperationError,\n\tNodeConnectionTypes,\n\tWEBHOOK_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\tCHAT_TRIGGER_NODE_TYPE,\n\tWAIT_NODE_TYPE,\n} from 'n8n-workflow';\nimport type { Readable } from 'stream';\n\nimport { configuredOutputs } from './utils';\nimport { formatPrivateKey, generatePairedItemData } from '../../utils/utilities';\n\nconst respondWithProperty: INodeProperties = {\n\tdisplayName: 'Respond With',\n\tname: 'respondWith',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'All Incoming Items',\n\t\t\tvalue: 'allIncomingItems',\n\t\t\tdescription: 'Respond with all input JSON items',\n\t\t},\n\t\t{\n\t\t\tname: 'Binary File',\n\t\t\tvalue: 'binary',\n\t\t\tdescription: 'Respond with incoming file binary data',\n\t\t},\n\t\t{\n\t\t\tname: 'First Incoming Item',\n\t\t\tvalue: 'firstIncomingItem',\n\t\t\tdescription: 'Respond with the first input JSON item',\n\t\t},\n\t\t{\n\t\t\tname: 'JSON',\n\t\t\tvalue: 'json',\n\t\t\tdescription: 'Respond with a custom JSON body',\n\t\t},\n\t\t{\n\t\t\tname: 'JWT Token',\n\t\t\tvalue: 'jwt',\n\t\t\tdescription: 'Respond with a JWT token',\n\t\t},\n\t\t{\n\t\t\tname: 'No Data',\n\t\t\tvalue: 'noData',\n\t\t\tdescription: 'Respond with an empty body',\n\t\t},\n\t\t{\n\t\t\tname: 'Redirect',\n\t\t\tvalue: 'redirect',\n\t\t\tdescription: 'Respond with a redirect to a given URL',\n\t\t},\n\t\t{\n\t\t\tname: 'Text',\n\t\t\tvalue: 'text',\n\t\t\tdescription: 'Respond with a simple text message body',\n\t\t},\n\t],\n\tdefault: 'firstIncomingItem',\n\tdescription: 'The data that should be returned',\n};\n\nexport class RespondToWebhook implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Respond to Webhook',\n\t\ticon: { light: 'file:webhook.svg', dark: 'file:webhook.dark.svg' },\n\t\tname: 'respondToWebhook',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3, 1.4],\n\t\tdescription: 'Returns data for Webhook',\n\t\tdefaults: {\n\t\t\tname: 'Respond to Webhook',\n\t\t},\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: `={{(${configuredOutputs})($nodeVersion, $parameter)}}`,\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'jwtAuth',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Enable Response Output Branch',\n\t\t\t\tname: 'enableResponseOutput',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to provide an additional output branch with the response sent to the webhook',\n\t\t\t\tisNodeSetting: true,\n\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 1.4 } }] } },\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Verify that the \"Webhook\" node\\'s \"Respond\" parameter is set to \"Using Respond to Webhook Node\". <a href=\"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/\" target=\"_blank\">More details',\n\t\t\t\tname: 'generalNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\t...respondWithProperty,\n\t\t\t\tdisplayOptions: { show: { '@version': [1, 1.1] } },\n\t\t\t},\n\t\t\t{\n\t\t\t\t...respondWithProperty,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 1.2 } }] } },\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Credentials',\n\t\t\t\tname: 'credentials',\n\t\t\t\ttype: 'credentials',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'When using expressions, note that this node will only run for the first item in the input data',\n\t\t\t\tname: 'webhookNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['json', 'text', 'jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Redirect URL',\n\t\t\t\tname: 'redirectURL',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['redirect'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. http://www.n8n.io',\n\t\t\t\tdescription: 'The URL to redirect to',\n\t\t\t\tvalidateType: 'url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Response Body',\n\t\t\t\tname: 'responseBody',\n\t\t\t\ttype: 'json',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['json'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '{\\n \"myField\": \"value\"\\n}',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 4,\n\t\t\t\t},\n\t\t\t\tdescription: 'The HTTP response JSON data',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Payload',\n\t\t\t\tname: 'payload',\n\t\t\t\ttype: 'json',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['jwt'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '{\\n \"myField\": \"value\"\\n}',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 4,\n\t\t\t\t},\n\t\t\t\tvalidateType: 'object',\n\t\t\t\tdescription: 'The payload to include in the JWT token',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Response Body',\n\t\t\t\tname: 'responseBody',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['text'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. Workflow completed',\n\t\t\t\tdescription: 'The HTTP response text data',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Response Data Source',\n\t\t\t\tname: 'responseDataSource',\n\t\t\t\ttype: 'options',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['binary'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Choose Automatically From Input',\n\t\t\t\t\t\tvalue: 'automatically',\n\t\t\t\t\t\tdescription: 'Use if input data will contain a single piece of binary data',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Specify Myself',\n\t\t\t\t\t\tvalue: 'set',\n\t\t\t\t\t\tdescription: 'Enter the name of the input field the binary data will be in',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'automatically',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Input Field Name',\n\t\t\t\tname: 'inputFieldName',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: 'data',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\trespondWith: ['binary'],\n\t\t\t\t\t\tresponseDataSource: ['set'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdescription: 'The name of the node input field with the binary data',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Response Code',\n\t\t\t\t\t\tname: 'responseCode',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tminValue: 100,\n\t\t\t\t\t\t\tmaxValue: 599,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: 200,\n\t\t\t\t\t\tdescription: 'The HTTP response code to return. Defaults to 200.',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Response Headers',\n\t\t\t\t\t\tname: 'responseHeaders',\n\t\t\t\t\t\tplaceholder: 'Add Response Header',\n\t\t\t\t\t\tdescription: 'Add headers to the webhook response',\n\t\t\t\t\t\ttype: 'fixedCollection',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: {},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'entries',\n\t\t\t\t\t\t\t\tdisplayName: 'Entries',\n\t\t\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\t\t\tdescription: 'Name of the header',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\t\t\tname: 'value',\n\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\t\t\tdescription: 'Value of the header',\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],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Put Response in Field',\n\t\t\t\t\t\tname: 'responseKey',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t['/respondWith']: ['allIncomingItems', 'firstIncomingItem'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'The name of the response field to put all items in',\n\t\t\t\t\t\tplaceholder: 'e.g. data',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\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 WEBHOOK_NODE_TYPES = [\n\t\t\tWEBHOOK_NODE_TYPE,\n\t\t\tFORM_TRIGGER_NODE_TYPE,\n\t\t\tCHAT_TRIGGER_NODE_TYPE,\n\t\t\tWAIT_NODE_TYPE,\n\t\t];\n\n\t\tlet response: IN8nHttpFullResponse;\n\n\t\ttry {\n\t\t\tif (nodeVersion >= 1.1) {\n\t\t\t\tconst connectedNodes = this.getParentNodes(this.getNode().name);\n\t\t\t\tif (!connectedNodes.some(({ type }) => WEBHOOK_NODE_TYPES.includes(type))) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\tnew Error('No Webhook node found in the workflow'),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t'Insert a Webhook node to your workflow and set the “Respond” parameter to “Using Respond to Webhook Node” ',\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst respondWith = this.getNodeParameter('respondWith', 0) as string;\n\t\t\tconst options = this.getNodeParameter('options', 0, {});\n\n\t\t\tconst headers = {} as IDataObject;\n\t\t\tif (options.responseHeaders) {\n\t\t\t\tfor (const header of (options.responseHeaders as IDataObject).entries as IDataObject[]) {\n\t\t\t\t\tif (typeof header.name !== 'string') {\n\t\t\t\t\t\theader.name = header.name?.toString();\n\t\t\t\t\t}\n\t\t\t\t\theaders[header.name?.toLowerCase() as string] = header.value?.toString();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet statusCode = (options.responseCode as number) || 200;\n\t\t\tlet responseBody: IN8nHttpResponse | Readable;\n\t\t\tif (respondWith === 'json') {\n\t\t\t\tconst responseBodyParameter = this.getNodeParameter('responseBody', 0) as string;\n\t\t\t\tif (responseBodyParameter) {\n\t\t\t\t\tif (typeof responseBodyParameter === 'object') {\n\t\t\t\t\t\tresponseBody = responseBodyParameter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponseBody = jsonParse(responseBodyParameter);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error as Error, {\n\t\t\t\t\t\t\t\tmessage: \"Invalid JSON in 'Response Body' field\",\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Check that the syntax of the JSON in the 'Response Body' parameter is valid\",\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} else if (respondWith === 'jwt') {\n\t\t\t\ttry {\n\t\t\t\t\tconst { keyType, secret, algorithm, privateKey } = await this.getCredentials<{\n\t\t\t\t\t\tkeyType: 'passphrase' | 'pemKey';\n\t\t\t\t\t\tprivateKey: string;\n\t\t\t\t\t\tsecret: string;\n\t\t\t\t\t\talgorithm: jwt.Algorithm;\n\t\t\t\t\t}>('jwtAuth');\n\n\t\t\t\t\tlet secretOrPrivateKey;\n\n\t\t\t\t\tif (keyType === 'passphrase') {\n\t\t\t\t\t\tsecretOrPrivateKey = secret;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsecretOrPrivateKey = formatPrivateKey(privateKey);\n\t\t\t\t\t}\n\t\t\t\t\tconst payload = this.getNodeParameter('payload', 0, {}) as IDataObject;\n\t\t\t\t\tconst token = jwt.sign(payload, secretOrPrivateKey, { algorithm });\n\t\t\t\t\tresponseBody = { token };\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error as Error, {\n\t\t\t\t\t\tmessage: 'Error signing JWT token',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (respondWith === 'allIncomingItems') {\n\t\t\t\tconst respondItems = items.map((item) => item.json);\n\t\t\t\tresponseBody = options.responseKey\n\t\t\t\t\t? set({}, options.responseKey as string, respondItems)\n\t\t\t\t\t: respondItems;\n\t\t\t} else if (respondWith === 'firstIncomingItem') {\n\t\t\t\tresponseBody = options.responseKey\n\t\t\t\t\t? set({}, options.responseKey as string, items[0].json)\n\t\t\t\t\t: items[0].json;\n\t\t\t} else if (respondWith === 'text') {\n\t\t\t\tresponseBody = this.getNodeParameter('responseBody', 0) as string;\n\t\t\t} else if (respondWith === 'binary') {\n\t\t\t\tconst item = items[0];\n\n\t\t\t\tif (item.binary === undefined) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No binary data exists on the first item!');\n\t\t\t\t}\n\n\t\t\t\tlet responseBinaryPropertyName: string;\n\n\t\t\t\tconst responseDataSource = this.getNodeParameter('responseDataSource', 0) as string;\n\n\t\t\t\tif (responseDataSource === 'set') {\n\t\t\t\t\tresponseBinaryPropertyName = this.getNodeParameter('inputFieldName', 0) as string;\n\t\t\t\t} else {\n\t\t\t\t\tconst binaryKeys = Object.keys(item.binary);\n\t\t\t\t\tif (binaryKeys.length === 0) {\n\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t\t'No binary data exists on the first item!',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tresponseBinaryPropertyName = binaryKeys[0];\n\t\t\t\t}\n\n\t\t\t\tconst binaryData = this.helpers.assertBinaryData(0, responseBinaryPropertyName);\n\t\t\t\tif (binaryData.id) {\n\t\t\t\t\tresponseBody = { binaryData };\n\t\t\t\t} else {\n\t\t\t\t\tresponseBody = Buffer.from(binaryData.data, BINARY_ENCODING);\n\t\t\t\t\theaders['content-length'] = (responseBody as Buffer).length;\n\t\t\t\t}\n\n\t\t\t\tif (!headers['content-type']) {\n\t\t\t\t\theaders['content-type'] = binaryData.mimeType;\n\t\t\t\t}\n\t\t\t} else if (respondWith === 'redirect') {\n\t\t\t\theaders.location = this.getNodeParameter('redirectURL', 0) as string;\n\t\t\t\tstatusCode = (options.responseCode as number) ?? 307;\n\t\t\t} else if (respondWith !== 'noData') {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t`The Response Data option \"${respondWith}\" is not supported!`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tresponse = {\n\t\t\t\tbody: responseBody,\n\t\t\t\theaders,\n\t\t\t\tstatusCode,\n\t\t\t};\n\n\t\t\tthis.sendResponse(response);\n\t\t} catch (error) {\n\t\t\tif (this.continueOnFail()) {\n\t\t\t\tconst itemData = generatePairedItemData(items.length);\n\t\t\t\tconst returnData = this.helpers.constructExecutionMetaData(\n\t\t\t\t\t[{ json: { error: error.message } }],\n\t\t\t\t\t{ itemData },\n\t\t\t\t);\n\t\t\t\treturn [returnData];\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (nodeVersion === 1.3) {\n\t\t\treturn [items, [{ json: { response } }]];\n\t\t} else if (nodeVersion >= 1.4 && this.getNodeParameter('enableResponseOutput', 0, false)) {\n\t\t\treturn [items, [{ json: { response } }]];\n\t\t}\n\n\t\treturn [items];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgB;AAChB,iBAAgB;AAWhB,0BASO;AAGP,mBAAkC;AAClC,uBAAyD;AAEzD,MAAM,sBAAuC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN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O;AACN,yBAAe,OAAO,KAAK,WAAW,MAAM,mCAAe;AAC3D,kBAAQ,gBAAgB,IAAK,aAAwB;AAAA,QACtD;AAEA,YAAI,CAAC,QAAQ,cAAc,GAAG;AAC7B,kBAAQ,cAAc,IAAI,WAAW;AAAA,QACtC;AAAA,MACD,WAAW,gBAAgB,YAAY;AACtC,gBAAQ,WAAW,KAAK,iBAAiB,eAAe,CAAC;AACzD,qBAAc,QAAQ,gBAA2B;AAAA,MAClD,WAAW,gBAAgB,UAAU;AACpC,cAAM,IAAI;AAAA,UACT,KAAK,QAAQ;AAAA,UACb,6BAA6B,WAAW;AAAA,QACzC;AAAA,MACD;AAEA,iBAAW;AAAA,QACV,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAEA,WAAK,aAAa,QAAQ;AAAA,IAC3B,SAAS,OAAO;AACf,UAAI,KAAK,eAAe,GAAG;AAC1B,cAAM,eAAW,yCAAuB,MAAM,MAAM;AACpD,cAAM,aAAa,KAAK,QAAQ;AAAA,UAC/B,CAAC,EAAE,MAAM,EAAE,OAAO,MAAM,QAAQ,EAAE,CAAC;AAAA,UACnC,EAAE,SAAS;AAAA,QACZ;AACA,eAAO,CAAC,UAAU;AAAA,MACnB;AAEA,YAAM;AAAA,IACP;AAEA,QAAI,gBAAgB,KAAK;AACxB,aAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,IACxC,WAAW,eAAe,OAAO,KAAK,iBAAiB,wBAAwB,GAAG,KAAK,GAAG;AACzF,aAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,IACxC;AAEA,WAAO,CAAC,KAAK;AAAA,EACd;AACD;","names":["jwt","set"]}
|
|
@@ -21,8 +21,9 @@ __export(utils_exports, {
|
|
|
21
21
|
configuredOutputs: () => configuredOutputs
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(utils_exports);
|
|
24
|
-
const configuredOutputs = (version) => {
|
|
25
|
-
|
|
24
|
+
const configuredOutputs = (version, parameters) => {
|
|
25
|
+
const multipleOutputs = version === 1.3 || version >= 1.4 && parameters.enableResponseOutput;
|
|
26
|
+
if (multipleOutputs) {
|
|
26
27
|
return [
|
|
27
28
|
{
|
|
28
29
|
type: "main",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/RespondToWebhook/utils.ts"],"sourcesContent":["export const configuredOutputs = (
|
|
1
|
+
{"version":3,"sources":["../../../nodes/RespondToWebhook/utils.ts"],"sourcesContent":["export const configuredOutputs = (\n\tversion: number,\n\tparameters: { enableResponseOutput?: boolean },\n) => {\n\tconst multipleOutputs = version === 1.3 || (version >= 1.4 && parameters.enableResponseOutput);\n\tif (multipleOutputs) {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: 'main',\n\t\t\t\tdisplayName: 'Input Data',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'main',\n\t\t\t\tdisplayName: 'Response',\n\t\t\t},\n\t\t];\n\t}\n\n\treturn ['main'];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,oBAAoB,CAChC,SACA,eACI;AACJ,QAAM,kBAAkB,YAAY,OAAQ,WAAW,OAAO,WAAW;AACzE,MAAI,iBAAiB;AACpB,WAAO;AAAA,MACN;AAAA,QACC,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AAEA,SAAO,CAAC,MAAM;AACf;","names":[]}
|