n8n-nodes-base 1.95.1 → 1.96.1
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/PerplexityApi.credentials.js +1 -1
- package/dist/credentials/PerplexityApi.credentials.js.map +1 -1
- package/dist/nodes/Adalo/__schema__/v1.0.0/collection/getAll.json +21 -0
- package/dist/nodes/Airtable/test/v2/node/helpers.js +12 -2
- package/dist/nodes/Airtable/test/v2/node/helpers.js.map +1 -1
- package/dist/nodes/Airtop/__schema__/v1.0.0/extraction/query.json +7 -1
- package/dist/nodes/Airtop/__schema__/v1.0.0/session/create.json +9 -0
- package/dist/nodes/Airtop/__schema__/v1.0.0/window/create.json +40 -0
- package/dist/nodes/Airtop/test/node/helpers.js +12 -2
- package/dist/nodes/Airtop/test/node/helpers.js.map +1 -1
- package/dist/nodes/Asana/__schema__/v1.0.0/subtask/getAll.json +4 -1
- package/dist/nodes/Aws/S3/__schema__/v2.0.0/file/getAll.json +7 -1
- package/dist/nodes/Aws/S3/__schema__/v2.0.0/folder/getAll.json +7 -1
- package/dist/nodes/BambooHr/__schema__/v1.0.0/employee/getAll.json +1 -4
- package/dist/nodes/ClickUp/__schema__/v1.0.0/list/customFields.json +23 -1
- package/dist/nodes/Code/Pyodide.js +24 -0
- package/dist/nodes/Code/Pyodide.js.map +1 -1
- package/dist/nodes/CompareDatasets/GenericFunctions.js +5 -5
- package/dist/nodes/CompareDatasets/GenericFunctions.js.map +1 -1
- package/dist/nodes/Discord/__schema__/v2.0.0/message/sendAndWait.json +14 -0
- package/dist/nodes/Discord/v2/helpers/utils.js +2 -2
- package/dist/nodes/Discord/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/Dropbox/__schema__/v1.0.0/file/download.json +31 -1
- package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/enrich.json +15 -1
- package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/fetchRequest.json +50 -0
- package/dist/nodes/EmailReadImap/v2/utils.js +16 -3
- package/dist/nodes/EmailReadImap/v2/utils.js.map +1 -1
- package/dist/nodes/EmailSend/__schema__/v2.1.0/email/send.json +1 -7
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +1 -1
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +2 -2
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
- package/dist/nodes/Form/Form.node.js +3 -3
- package/dist/nodes/Form/Form.node.js.map +1 -1
- package/dist/nodes/Form/utils/formCompletionUtils.js.map +1 -0
- package/dist/nodes/Form/utils/formNodeUtils.js.map +1 -0
- package/dist/nodes/Form/{utils.js → utils/utils.js} +21 -7
- package/dist/nodes/Form/utils/utils.js.map +1 -0
- package/dist/nodes/Form/v1/FormTriggerV1.node.js +1 -1
- package/dist/nodes/Form/v1/FormTriggerV1.node.js.map +1 -1
- package/dist/nodes/Form/v2/FormTriggerV2.node.js +1 -1
- package/dist/nodes/Form/v2/FormTriggerV2.node.js.map +1 -1
- package/dist/nodes/Freshservice/GenericFunctions.js +12 -2
- package/dist/nodes/Freshservice/GenericFunctions.js.map +1 -1
- package/dist/nodes/Google/Ads/__schema__/v1.0.0/campaign/getAll.json +13 -1
- package/dist/nodes/Google/Analytics/__schema__/v2.0.0/report/get.json +1 -4
- package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +1 -4
- package/dist/nodes/Google/Chat/__schema__/v1.0.0/message/create.json +30 -1
- package/dist/nodes/Google/Drive/__schema__/v3.0.0/file/upload.json +4 -1
- package/dist/nodes/Google/Drive/test/v2/node/helpers.js +12 -2
- package/dist/nodes/Google/Drive/test/v2/node/helpers.js.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/query.json +1 -7
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/addLabels.json +13 -1
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +1 -7
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/markAsRead.json +13 -1
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/thread/addLabels.json +16 -1
- package/dist/nodes/Google/Sheet/v2/actions/sheet/update.operation.js +10 -4
- package/dist/nodes/Google/Sheet/v2/actions/sheet/update.operation.js.map +1 -1
- package/dist/nodes/HaloPSA/__schema__/v1.0.0/ticket/getAll.json +1 -268
- package/dist/nodes/HttpRequest/shared/optimizeResponse.js +5 -3
- package/dist/nodes/HttpRequest/shared/optimizeResponse.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/deal/getAll.json +64 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +1 -4
- package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +1 -61
- package/dist/nodes/JinaAI/__schema__/v1.0.0/reader/read.json +26 -0
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +604 -7
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +1 -110
- package/dist/nodes/Lemlist/__schema__/v2.0.0/lead/create.json +1 -4
- package/dist/nodes/Lemlist/__schema__/v2.0.0/lead/get.json +30 -0
- package/dist/nodes/Line/__schema__/v1.0.0/notification/send.json +4 -7
- package/dist/nodes/Linear/__schema__/v1.0.0/issue/getAll.json +12 -1
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +23 -3
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
- package/dist/nodes/Microsoft/Entra/__schema__/v1.0.0/user/getAll.json +1 -7
- package/dist/nodes/Microsoft/Entra/descriptions/GroupDescription.js +12 -2
- package/dist/nodes/Microsoft/Entra/descriptions/GroupDescription.js.map +1 -1
- package/dist/nodes/Microsoft/Entra/descriptions/UserDescription.js +13 -3
- package/dist/nodes/Microsoft/Entra/descriptions/UserDescription.js.map +1 -1
- package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/file/download.json +23 -10
- package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/folder/create.json +1 -15
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/event/getAll.json +1 -4
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +124 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +1 -56
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +12 -2
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
- package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/create.json +39 -0
- package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/get.json +44 -0
- package/dist/nodes/Microsoft/ToDo/__schema__/v1.0.0/task/getAll.json +5 -21
- package/dist/nodes/N8n/WorkflowDescription.js +40 -0
- package/dist/nodes/N8n/WorkflowDescription.js.map +1 -1
- package/dist/nodes/Nasa/__schema__/v1.0.0/donkiSolarFlare/get.json +1 -4
- package/dist/nodes/Notion/__schema__/v2.2.0/database/get.json +2 -149
- package/dist/nodes/Odoo/__schema__/v1.0.0/contact/get.json +1 -4
- package/dist/nodes/Odoo/__schema__/v1.0.0/contact/getAll.json +1 -10
- package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +1 -40
- package/dist/nodes/OpenAi/__schema__/v1.1.0/chat/complete.json +29 -1
- package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +7 -1
- package/dist/nodes/QuickBase/__schema__/v1.0.0/record/getAll.json +9 -0
- package/dist/nodes/QuickBooks/__schema__/v1.0.0/transaction/getReport.json +4 -1
- package/dist/nodes/RssFeedRead/RssFeedRead.node.js +9 -3
- package/dist/nodes/RssFeedRead/RssFeedRead.node.js.map +1 -1
- package/dist/nodes/S3/__schema__/v1.0.0/file/download.json +21 -0
- package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/getAll.json +1 -4
- package/dist/nodes/Salesforce/__schema__/v1.0.0/lead/getAll.json +1 -4
- package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +1 -4
- package/dist/nodes/Salesforce/__schema__/v1.0.0/search/query.json +1 -4
- package/dist/nodes/Shopify/__schema__/v1.0.0/order/getAll.json +250 -3
- package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +1 -50
- package/dist/nodes/Slack/__schema__/v2.3.0/channel/member.json +168 -2
- package/dist/nodes/Slack/__schema__/v2.3.0/message/post.json +1 -4
- package/dist/nodes/Sms77/__schema__/v1.0.0/sms/send.json +1 -10
- package/dist/nodes/Strapi/__schema__/v1.0.0/entry/getAll.json +10 -1
- package/dist/nodes/Telegram/__schema__/v1.2.0/chat/member.json +1 -4
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/editMessageText.json +4 -1
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendAndWait.json +14 -0
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendMessage.json +4 -21
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendPhoto.json +1 -7
- package/dist/nodes/Telegram/tests/Helpers.js +12 -2
- package/dist/nodes/Telegram/tests/Helpers.js.map +1 -1
- package/dist/nodes/Transform/RemoveDuplicates/utils.js +8 -6
- package/dist/nodes/Transform/RemoveDuplicates/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 +1 -4
- package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/search.json +7 -1
- package/dist/nodes/Wait/Wait.node.js +1 -1
- package/dist/nodes/Wait/Wait.node.js.map +1 -1
- package/dist/nodes/Wordpress/__schema__/v1.0.0/post/get.json +1 -7
- package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +1 -4
- package/dist/nodes/Zoho/__schema__/v1.0.0/lead/getAll.json +99 -1
- package/dist/test/nodes/Helpers.js +12 -2
- package/dist/test/nodes/Helpers.js.map +1 -1
- package/dist/types/credentials.json +1 -1
- package/dist/types/nodes.json +13 -13
- package/dist/utils/binary.js +12 -9
- package/dist/utils/binary.js.map +1 -1
- package/dist/utils/sendAndWait/utils.js +21 -6
- package/dist/utils/sendAndWait/utils.js.map +1 -1
- package/dist/utils/utilities.js +31 -16
- package/dist/utils/utilities.js.map +1 -1
- package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +2 -2
- package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
- package/package.json +9 -9
- package/dist/nodes/Form/formCompletionUtils.js.map +0 -1
- package/dist/nodes/Form/formNodeUtils.js.map +0 -1
- package/dist/nodes/Form/utils.js.map +0 -1
- /package/dist/nodes/Form/{formCompletionUtils.js → utils/formCompletionUtils.js} +0 -0
- /package/dist/nodes/Form/{formNodeUtils.js → utils/formNodeUtils.js} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.96.1",
|
|
4
4
|
"description": "Base nodes of n8n",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"LICENSE_EE.md",
|
|
9
|
+
"LICENSE.md"
|
|
10
10
|
],
|
|
11
11
|
"n8n": {
|
|
12
12
|
"credentials": [
|
|
@@ -846,7 +846,7 @@
|
|
|
846
846
|
"@types/html-to-text": "^9.0.1",
|
|
847
847
|
"@types/js-nacl": "^1.3.0",
|
|
848
848
|
"@types/jsonwebtoken": "^9.0.9",
|
|
849
|
-
"@types/lodash": "^4.
|
|
849
|
+
"@types/lodash": "^4.17.17",
|
|
850
850
|
"@types/lossless-json": "^1.0.0",
|
|
851
851
|
"@types/mailparser": "^3.4.4",
|
|
852
852
|
"@types/mime-types": "^2.1.0",
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
"@types/xml2js": "^0.4.14",
|
|
862
862
|
"eslint-plugin-n8n-nodes-base": "^1.16.3",
|
|
863
863
|
"@n8n/typescript-config": "1.2.0",
|
|
864
|
-
"n8n-core": "1.
|
|
864
|
+
"n8n-core": "1.97.2"
|
|
865
865
|
},
|
|
866
866
|
"dependencies": {
|
|
867
867
|
"@aws-sdk/client-sso-oidc": "3.808.0",
|
|
@@ -908,7 +908,7 @@
|
|
|
908
908
|
"node-ssh": "13.2.0",
|
|
909
909
|
"nodemailer": "6.9.9",
|
|
910
910
|
"otpauth": "9.1.1",
|
|
911
|
-
"pdfjs-dist": "
|
|
911
|
+
"pdfjs-dist": "5.3.31",
|
|
912
912
|
"pg": "8.12.0",
|
|
913
913
|
"pg-promise": "11.9.1",
|
|
914
914
|
"promise-ftp": "1.3.5",
|
|
@@ -930,10 +930,10 @@
|
|
|
930
930
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
|
931
931
|
"xml2js": "0.6.2",
|
|
932
932
|
"xmlhttprequest-ssl": "3.1.0",
|
|
933
|
-
"@n8n/config": "1.
|
|
934
|
-
"n8n-workflow": "1.94.0",
|
|
933
|
+
"@n8n/config": "1.42.0",
|
|
935
934
|
"@n8n/imap": "0.10.0",
|
|
936
|
-
"@n8n/di": "0.6.0"
|
|
935
|
+
"@n8n/di": "0.6.0",
|
|
936
|
+
"n8n-workflow": "1.95.1"
|
|
937
937
|
},
|
|
938
938
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
939
939
|
"homepage": "https://n8n.io",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/Form/formCompletionUtils.ts"],"sourcesContent":["import { type Response } from 'express';\nimport {\n\ttype NodeTypeAndVersion,\n\ttype IWebhookFunctions,\n\ttype IWebhookResponseData,\n\ttype IBinaryData,\n\ttype IDataObject,\n\tOperationalError,\n} from 'n8n-workflow';\n\nimport { sanitizeCustomCss, sanitizeHtml } from './utils';\n\nconst getBinaryDataFromNode = (context: IWebhookFunctions, nodeName: string): IDataObject => {\n\treturn context.evaluateExpression(`{{ $('${nodeName}').first().binary }}`) as IDataObject;\n};\n\nexport const binaryResponse = async (\n\tcontext: IWebhookFunctions,\n): Promise<{ data: string | Buffer; fileName: string; type: string }> => {\n\tconst inputDataFieldName = context.getNodeParameter('inputDataFieldName', '') as string;\n\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\tconst binaryNode = parentNodes\n\t\t.reverse()\n\t\t.find((node) => getBinaryDataFromNode(context, node?.name)?.hasOwnProperty(inputDataFieldName));\n\tif (!binaryNode) {\n\t\tthrow new OperationalError(`No binary data with field ${inputDataFieldName} found.`);\n\t}\n\tconst binaryData = getBinaryDataFromNode(context, binaryNode?.name)[\n\t\tinputDataFieldName\n\t] as IBinaryData;\n\n\treturn {\n\t\t// If a binaryData has an id, the following field is set:\n\t\t// N8N_DEFAULT_BINARY_DATA_MODE=filesystem\n\t\tdata: binaryData.id\n\t\t\t? await context.helpers.binaryToBuffer(await context.helpers.getBinaryStream(binaryData.id))\n\t\t\t: atob(binaryData.data),\n\t\tfileName: binaryData.fileName ?? 'file',\n\t\ttype: binaryData.mimeType,\n\t};\n};\n\nexport const renderFormCompletion = async (\n\tcontext: IWebhookFunctions,\n\tres: Response,\n\ttrigger: NodeTypeAndVersion,\n): Promise<IWebhookResponseData> => {\n\tconst completionTitle = context.getNodeParameter('completionTitle', '') as string;\n\tconst completionMessage = context.getNodeParameter('completionMessage', '') as string;\n\tconst redirectUrl = context.getNodeParameter('redirectUrl', '') as string;\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tformTitle: string;\n\t\tcustomCss?: string;\n\t};\n\tconst responseText = context.getNodeParameter('responseText', '') as string;\n\tconst binary =\n\t\tcontext.getNodeParameter('respondWith', '') === 'returnBinary'\n\t\t\t? await binaryResponse(context)\n\t\t\t: '';\n\n\tlet title = options.formTitle;\n\tif (!title) {\n\t\ttitle = context.evaluateExpression(`{{ $('${trigger?.name}').params.formTitle }}`) as string;\n\t}\n\tconst appendAttribution = context.evaluateExpression(\n\t\t`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`,\n\t) as boolean;\n\n\tres.render('form-trigger-completion', {\n\t\ttitle: completionTitle,\n\t\tmessage: completionMessage,\n\t\tformTitle: title,\n\t\tappendAttribution,\n\t\tresponseText: sanitizeHtml(responseText),\n\t\tresponseBinary: encodeURIComponent(JSON.stringify(binary)),\n\t\tdangerousCustomCss: sanitizeCustomCss(options.customCss),\n\t\tredirectUrl,\n\t});\n\n\treturn { noWebhookResponse: true };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAOO;AAEP,mBAAgD;AAEhD,MAAM,wBAAwB,CAAC,SAA4B,aAAkC;AAC5F,SAAO,QAAQ,mBAAmB,SAAS,QAAQ,sBAAsB;AAC1E;AAEO,MAAM,iBAAiB,OAC7B,YACwE;AACxE,QAAM,qBAAqB,QAAQ,iBAAiB,sBAAsB,EAAE;AAC5E,QAAM,cAAc,QAAQ,eAAe,QAAQ,QAAQ,EAAE,IAAI;AACjE,QAAM,aAAa,YACjB,QAAQ,EACR,KAAK,CAAC,SAAS,sBAAsB,SAAS,MAAM,IAAI,GAAG,eAAe,kBAAkB,CAAC;AAC/F,MAAI,CAAC,YAAY;AAChB,UAAM,IAAI,qCAAiB,6BAA6B,kBAAkB,SAAS;AAAA,EACpF;AACA,QAAM,aAAa,sBAAsB,SAAS,YAAY,IAAI,EACjE,kBACD;AAEA,SAAO;AAAA;AAAA;AAAA,IAGN,MAAM,WAAW,KACd,MAAM,QAAQ,QAAQ,eAAe,MAAM,QAAQ,QAAQ,gBAAgB,WAAW,EAAE,CAAC,IACzF,KAAK,WAAW,IAAI;AAAA,IACvB,UAAU,WAAW,YAAY;AAAA,IACjC,MAAM,WAAW;AAAA,EAClB;AACD;AAEO,MAAM,uBAAuB,OACnC,SACA,KACA,YACmC;AACnC,QAAM,kBAAkB,QAAQ,iBAAiB,mBAAmB,EAAE;AACtE,QAAM,oBAAoB,QAAQ,iBAAiB,qBAAqB,EAAE;AAC1E,QAAM,cAAc,QAAQ,iBAAiB,eAAe,EAAE;AAC9D,QAAM,UAAU,QAAQ,iBAAiB,WAAW,CAAC,CAAC;AAItD,QAAM,eAAe,QAAQ,iBAAiB,gBAAgB,EAAE;AAChE,QAAM,SACL,QAAQ,iBAAiB,eAAe,EAAE,MAAM,iBAC7C,MAAM,eAAe,OAAO,IAC5B;AAEJ,MAAI,QAAQ,QAAQ;AACpB,MAAI,CAAC,OAAO;AACX,YAAQ,QAAQ,mBAAmB,SAAS,SAAS,IAAI,wBAAwB;AAAA,EAClF;AACA,QAAM,oBAAoB,QAAQ;AAAA,IACjC,SAAS,SAAS,IAAI;AAAA,EACvB;AAEA,MAAI,OAAO,2BAA2B;AAAA,IACrC,OAAO;AAAA,IACP,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA,kBAAc,2BAAa,YAAY;AAAA,IACvC,gBAAgB,mBAAmB,KAAK,UAAU,MAAM,CAAC;AAAA,IACzD,wBAAoB,gCAAkB,QAAQ,SAAS;AAAA,IACvD;AAAA,EACD,CAAC;AAED,SAAO,EAAE,mBAAmB,KAAK;AAClC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/Form/formNodeUtils.ts"],"sourcesContent":["import { type Response } from 'express';\nimport {\n\ttype NodeTypeAndVersion,\n\ttype IWebhookFunctions,\n\ttype FormFieldsParameter,\n\ttype IWebhookResponseData,\n} from 'n8n-workflow';\n\nimport { renderForm } from './utils';\n\nexport const renderFormNode = async (\n\tcontext: IWebhookFunctions,\n\tres: Response,\n\ttrigger: NodeTypeAndVersion,\n\tfields: FormFieldsParameter,\n\tmode: 'test' | 'production',\n): Promise<IWebhookResponseData> => {\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tformTitle: string;\n\t\tformDescription: string;\n\t\tbuttonLabel: string;\n\t\tcustomCss?: string;\n\t};\n\n\tlet title = options.formTitle;\n\tif (!title) {\n\t\ttitle = context.evaluateExpression(`{{ $('${trigger?.name}').params.formTitle }}`) as string;\n\t}\n\n\tlet buttonLabel = options.buttonLabel;\n\tif (!buttonLabel) {\n\t\tbuttonLabel =\n\t\t\t(context.evaluateExpression(\n\t\t\t\t`{{ $('${trigger?.name}').params.options?.buttonLabel }}`,\n\t\t\t) as string) || 'Submit';\n\t}\n\n\tconst appendAttribution = context.evaluateExpression(\n\t\t`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`,\n\t) as boolean;\n\n\trenderForm({\n\t\tcontext,\n\t\tres,\n\t\tformTitle: title,\n\t\tformDescription: options.formDescription,\n\t\tformFields: fields,\n\t\tresponseMode: 'responseNode',\n\t\tmode,\n\t\tredirectUrl: undefined,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tcustomCss: options.customCss,\n\t});\n\n\treturn {\n\t\tnoWebhookResponse: true,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,mBAA2B;AAEpB,MAAM,iBAAiB,OAC7B,SACA,KACA,SACA,QACA,SACmC;AACnC,QAAM,UAAU,QAAQ,iBAAiB,WAAW,CAAC,CAAC;AAOtD,MAAI,QAAQ,QAAQ;AACpB,MAAI,CAAC,OAAO;AACX,YAAQ,QAAQ,mBAAmB,SAAS,SAAS,IAAI,wBAAwB;AAAA,EAClF;AAEA,MAAI,cAAc,QAAQ;AAC1B,MAAI,CAAC,aAAa;AACjB,kBACE,QAAQ;AAAA,MACR,SAAS,SAAS,IAAI;AAAA,IACvB,KAAgB;AAAA,EAClB;AAEA,QAAM,oBAAoB,QAAQ;AAAA,IACjC,SAAS,SAAS,IAAI;AAAA,EACvB;AAEA,+BAAW;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,iBAAiB,QAAQ;AAAA,IACzB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,WAAW,QAAQ;AAAA,EACpB,CAAC;AAED,SAAO;AAAA,IACN,mBAAmB;AAAA,EACpB;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/Form/utils.ts"],"sourcesContent":["import type { Response } from 'express';\nimport isbot from 'isbot';\nimport { DateTime } from 'luxon';\nimport type {\n\tINodeExecutionData,\n\tMultiPartFormData,\n\tIDataObject,\n\tIWebhookFunctions,\n\tFormFieldsParameter,\n\tNodeTypeAndVersion,\n} from 'n8n-workflow';\nimport {\n\tFORM_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\tNodeOperationError,\n\tWAIT_NODE_TYPE,\n\tjsonParse,\n} from 'n8n-workflow';\nimport sanitize from 'sanitize-html';\n\nimport type { FormTriggerData, FormTriggerInput } from './interfaces';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from './interfaces';\nimport { getResolvables } from '../../utils/utilities';\nimport { WebhookAuthorizationError } from '../Webhook/error';\nimport { validateWebhookAuthentication } from '../Webhook/utils';\n\nexport function sanitizeHtml(text: string) {\n\treturn sanitize(text, {\n\t\tallowedTags: [\n\t\t\t'b',\n\t\t\t'div',\n\t\t\t'i',\n\t\t\t'iframe',\n\t\t\t'img',\n\t\t\t'video',\n\t\t\t'source',\n\t\t\t'em',\n\t\t\t'strong',\n\t\t\t'a',\n\t\t\t'h1',\n\t\t\t'h2',\n\t\t\t'h3',\n\t\t\t'h4',\n\t\t\t'h5',\n\t\t\t'h6',\n\t\t\t'u',\n\t\t\t'sub',\n\t\t\t'sup',\n\t\t\t'code',\n\t\t\t'pre',\n\t\t\t'span',\n\t\t\t'br',\n\t\t\t'ul',\n\t\t\t'ol',\n\t\t\t'li',\n\t\t\t'p',\n\t\t],\n\t\tallowedAttributes: {\n\t\t\ta: ['href', 'target', 'rel'],\n\t\t\timg: ['src', 'alt', 'width', 'height'],\n\t\t\tvideo: ['*'],\n\t\t\tiframe: ['*'],\n\t\t\tsource: ['*'],\n\t\t},\n\t\ttransformTags: {\n\t\t\tiframe: sanitize.simpleTransform('iframe', {\n\t\t\t\tsandbox: '',\n\t\t\t\treferrerpolicy: 'strict-origin-when-cross-origin',\n\t\t\t\tallow: 'fullscreen; autoplay; encrypted-media',\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport const prepareFormFields = (context: IWebhookFunctions, fields: FormFieldsParameter) => {\n\treturn fields.map((field) => {\n\t\tif (field.fieldType === 'html') {\n\t\t\tlet { html } = field;\n\n\t\t\tif (!html) return field;\n\n\t\t\tfor (const resolvable of getResolvables(html)) {\n\t\t\t\thtml = html.replace(resolvable, context.evaluateExpression(resolvable) as string);\n\t\t\t}\n\n\t\t\tfield.html = sanitizeHtml(html);\n\t\t}\n\n\t\tif (field.fieldType === 'hiddenField') {\n\t\t\tfield.fieldLabel = field.fieldName as string;\n\t\t}\n\n\t\treturn field;\n\t});\n};\n\nexport function sanitizeCustomCss(css: string | undefined): string | undefined {\n\tif (!css) return undefined;\n\n\t// Use sanitize-html with custom settings for CSS\n\treturn sanitize(css, {\n\t\tallowedTags: [], // No HTML tags allowed\n\t\tallowedAttributes: {}, // No attributes allowed\n\t\t// This ensures we're only keeping the text content\n\t\t// which should be the CSS, while removing any HTML/script tags\n\t});\n}\n\nexport function createDescriptionMetadata(description: string) {\n\treturn description === ''\n\t\t? 'n8n form'\n\t\t: description.replace(/^\\s*\\n+|<\\/?[^>]+(>|$)/g, '').slice(0, 150);\n}\n\nexport function prepareFormData({\n\tformTitle,\n\tformDescription,\n\tformSubmittedHeader,\n\tformSubmittedText,\n\tredirectUrl,\n\tformFields,\n\ttestRun,\n\tquery,\n\tinstanceId,\n\tuseResponseData,\n\tappendAttribution = true,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tformTitle: string;\n\tformDescription: string;\n\tformSubmittedText: string | undefined;\n\tredirectUrl: string | undefined;\n\tformFields: FormFieldsParameter;\n\ttestRun: boolean;\n\tquery: IDataObject;\n\tinstanceId?: string;\n\tuseResponseData?: boolean;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tformSubmittedHeader?: string;\n\tcustomCss?: string;\n}) {\n\tconst utm_campaign = instanceId ? `&utm_campaign=${instanceId}` : '';\n\tconst n8nWebsiteLink = `https://n8n.io/?utm_source=n8n-internal&utm_medium=form-trigger${utm_campaign}`;\n\n\tif (formSubmittedText === undefined) {\n\t\tformSubmittedText = 'Your response has been recorded';\n\t}\n\n\tconst formData: FormTriggerData = {\n\t\ttestRun,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformDescriptionMetadata: createDescriptionMetadata(formDescription),\n\t\tformSubmittedHeader,\n\t\tformSubmittedText,\n\t\tn8nWebsiteLink,\n\t\tformFields: [],\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tdangerousCustomCss: sanitizeCustomCss(customCss),\n\t};\n\n\tif (redirectUrl) {\n\t\tif (!redirectUrl.includes('://')) {\n\t\t\tredirectUrl = `http://${redirectUrl}`;\n\t\t}\n\t\tformData.redirectUrl = redirectUrl;\n\t}\n\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst { fieldType, requiredField, multiselect, placeholder } = field;\n\n\t\tconst input: IDataObject = {\n\t\t\tid: `field-${index}`,\n\t\t\terrorId: `error-field-${index}`,\n\t\t\tlabel: field.fieldLabel,\n\t\t\tinputRequired: requiredField ? 'form-required' : '',\n\t\t\tdefaultValue: query[field.fieldLabel] ?? '',\n\t\t\tplaceholder,\n\t\t};\n\n\t\tif (multiselect) {\n\t\t\tinput.isMultiSelect = true;\n\t\t\tinput.multiSelectOptions =\n\t\t\t\tfield.fieldOptions?.values.map((e, i) => ({\n\t\t\t\t\tid: `option${i}_${input.id}`,\n\t\t\t\t\tlabel: e.option,\n\t\t\t\t})) ?? [];\n\t\t} else if (fieldType === 'file') {\n\t\t\tinput.isFileInput = true;\n\t\t\tinput.acceptFileTypes = field.acceptFileTypes;\n\t\t\tinput.multipleFiles = field.multipleFiles ? 'multiple' : '';\n\t\t} else if (fieldType === 'dropdown') {\n\t\t\tinput.isSelect = true;\n\t\t\tconst fieldOptions = field.fieldOptions?.values ?? [];\n\t\t\tinput.selectOptions = fieldOptions.map((e) => e.option);\n\t\t} else if (fieldType === 'textarea') {\n\t\t\tinput.isTextarea = true;\n\t\t} else if (fieldType === 'html') {\n\t\t\tinput.isHtml = true;\n\t\t\tinput.html = field.html as string;\n\t\t} else if (fieldType === 'hiddenField') {\n\t\t\tinput.isHidden = true;\n\t\t\tinput.hiddenName = field.fieldName as string;\n\t\t\tinput.hiddenValue =\n\t\t\t\tinput.defaultValue === '' ? (field.fieldValue as string) : input.defaultValue;\n\t\t} else {\n\t\t\tinput.isInput = true;\n\t\t\tinput.type = fieldType as 'text' | 'number' | 'date' | 'email';\n\t\t}\n\n\t\tformData.formFields.push(input as FormTriggerInput);\n\t}\n\n\treturn formData;\n}\n\nexport const validateResponseModeConfiguration = (context: IWebhookFunctions) => {\n\tconst responseMode = context.getNodeParameter('responseMode', 'onReceived') as string;\n\tconst connectedNodes = context.getChildNodes(context.getNode().name);\n\tconst nodeVersion = context.getNode().typeVersion;\n\n\tconst isRespondToWebhookConnected = connectedNodes.some(\n\t\t(node) => node.type === 'n8n-nodes-base.respondToWebhook',\n\t);\n\n\tif (!isRespondToWebhookConnected && responseMode === 'responseNode') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error('No Respond to Webhook node found in the workflow'),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Insert a Respond to Webhook node to your workflow to respond to the form submission or choose another option for the “Respond When” parameter',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && responseMode !== 'responseNode' && nodeVersion <= 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(`${context.getNode().name} node not correctly configured`),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Set the “Respond When” parameter to “Using Respond to Webhook Node” or remove the Respond to Webhook node',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && nodeVersion > 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(\n\t\t\t\t'The \"Respond to Webhook\" node is not supported in workflows initiated by the \"n8n Form Trigger\"',\n\t\t\t),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'To configure your response, add an \"n8n Form\" node and set the \"Page Type\" to \"Form Ending\"',\n\t\t\t},\n\t\t);\n\t}\n};\n\nexport function addFormResponseDataToReturnItem(\n\treturnItem: INodeExecutionData,\n\tformFields: FormFieldsParameter,\n\tbodyData: IDataObject,\n) {\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst key = `field-${index}`;\n\t\tconst name = field.fieldLabel ?? field.fieldName;\n\t\tlet value = bodyData[key] ?? null;\n\n\t\tif (value === null) {\n\t\t\treturnItem.json[name] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'html') {\n\t\t\tif (field.elementName) {\n\t\t\t\treturnItem.json[field.elementName] = value;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'number') {\n\t\t\tvalue = Number(value);\n\t\t}\n\t\tif (field.fieldType === 'text') {\n\t\t\tvalue = String(value).trim();\n\t\t}\n\t\tif (field.multiselect && typeof value === 'string') {\n\t\t\tvalue = jsonParse(value);\n\t\t}\n\t\tif (field.fieldType === 'date' && value && field.formatDate !== '') {\n\t\t\tvalue = DateTime.fromFormat(String(value), 'yyyy-mm-dd').toFormat(field.formatDate as string);\n\t\t}\n\t\tif (field.fieldType === 'file' && field.multipleFiles && !Array.isArray(value)) {\n\t\t\tvalue = [value];\n\t\t}\n\n\t\treturnItem.json[name] = value;\n\t}\n}\n\nexport async function prepareFormReturnItem(\n\tcontext: IWebhookFunctions,\n\tformFields: FormFieldsParameter,\n\tmode: 'test' | 'production',\n\tuseWorkflowTimezone: boolean = false,\n) {\n\tconst bodyData = (context.getBodyData().data as IDataObject) ?? {};\n\tconst files = (context.getBodyData().files as IDataObject) ?? {};\n\n\tconst returnItem: INodeExecutionData = {\n\t\tjson: {},\n\t};\n\tif (files && Object.keys(files).length) {\n\t\treturnItem.binary = {};\n\t}\n\n\tfor (const key of Object.keys(files)) {\n\t\tconst processFiles: MultiPartFormData.File[] = [];\n\t\tlet multiFile = false;\n\t\tconst filesInput = files[key] as MultiPartFormData.File[] | MultiPartFormData.File;\n\n\t\tif (Array.isArray(filesInput)) {\n\t\t\tbodyData[key] = filesInput.map((file) => ({\n\t\t\t\tfilename: file.originalFilename,\n\t\t\t\tmimetype: file.mimetype,\n\t\t\t\tsize: file.size,\n\t\t\t}));\n\t\t\tprocessFiles.push(...filesInput);\n\t\t\tmultiFile = true;\n\t\t} else {\n\t\t\tbodyData[key] = {\n\t\t\t\tfilename: filesInput.originalFilename,\n\t\t\t\tmimetype: filesInput.mimetype,\n\t\t\t\tsize: filesInput.size,\n\t\t\t};\n\t\t\tprocessFiles.push(filesInput);\n\t\t}\n\n\t\tconst entryIndex = Number(key.replace(/field-/g, ''));\n\t\tconst fieldLabel = isNaN(entryIndex) ? key : formFields[entryIndex].fieldLabel;\n\n\t\tlet fileCount = 0;\n\t\tfor (const file of processFiles) {\n\t\t\tlet binaryPropertyName = fieldLabel.replace(/\\W/g, '_');\n\n\t\t\tif (multiFile) {\n\t\t\t\tbinaryPropertyName += `_${fileCount++}`;\n\t\t\t}\n\n\t\t\treturnItem.binary![binaryPropertyName] = await context.nodeHelpers.copyBinaryFile(\n\t\t\t\tfile.filepath,\n\t\t\t\tfile.originalFilename ?? file.newFilename,\n\t\t\t\tfile.mimetype,\n\t\t\t);\n\t\t}\n\t}\n\n\taddFormResponseDataToReturnItem(returnItem, formFields, bodyData);\n\n\tconst timezone = useWorkflowTimezone ? context.getTimezone() : 'UTC';\n\treturnItem.json.submittedAt = DateTime.now().setZone(timezone).toISO();\n\n\treturnItem.json.formMode = mode;\n\n\tif (\n\t\tcontext.getNode().type === FORM_TRIGGER_NODE_TYPE &&\n\t\tObject.keys(context.getRequestObject().query || {}).length\n\t) {\n\t\treturnItem.json.formQueryParameters = context.getRequestObject().query;\n\t}\n\n\treturn returnItem;\n}\n\nexport function renderForm({\n\tcontext,\n\tres,\n\tformTitle,\n\tformDescription,\n\tformFields,\n\tresponseMode,\n\tmode,\n\tformSubmittedText,\n\tredirectUrl,\n\tappendAttribution,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tcontext: IWebhookFunctions;\n\tres: Response;\n\tformTitle: string;\n\tformDescription: string;\n\tformFields: FormFieldsParameter;\n\tresponseMode: string;\n\tmode: 'test' | 'production';\n\tformSubmittedText?: string;\n\tredirectUrl?: string;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tcustomCss?: string;\n}) {\n\tformDescription = (formDescription || '').replace(/\\\\n/g, '\\n').replace(/<br>/g, '\\n');\n\tconst instanceId = context.getInstanceId();\n\n\tconst useResponseData = responseMode === 'responseNode';\n\n\tlet query: IDataObject = {};\n\n\tif (context.getNode().type === FORM_TRIGGER_NODE_TYPE) {\n\t\tquery = context.getRequestObject().query as IDataObject;\n\t} else if (context.getNode().type === FORM_NODE_TYPE) {\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst trigger = parentNodes.find(\n\t\t\t(node) => node.type === FORM_TRIGGER_NODE_TYPE,\n\t\t) as NodeTypeAndVersion;\n\t\ttry {\n\t\t\tconst triggerQueryParameters = context.evaluateExpression(\n\t\t\t\t`{{ $('${trigger?.name}').first().json.formQueryParameters }}`,\n\t\t\t) as IDataObject;\n\n\t\t\tif (triggerQueryParameters) {\n\t\t\t\tquery = triggerQueryParameters;\n\t\t\t}\n\t\t} catch (error) {}\n\t}\n\n\tformFields = prepareFormFields(context, formFields);\n\n\tconst data = prepareFormData({\n\t\tformTitle,\n\t\tformDescription,\n\t\tformSubmittedText,\n\t\tredirectUrl,\n\t\tformFields,\n\t\ttestRun: mode === 'test',\n\t\tquery,\n\t\tinstanceId,\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tcustomCss,\n\t});\n\n\tres.render('form-trigger', data);\n}\n\nexport const isFormConnected = (nodes: NodeTypeAndVersion[]) => {\n\treturn nodes.some(\n\t\t(n) =>\n\t\t\tn.type === FORM_NODE_TYPE || (n.type === WAIT_NODE_TYPE && n.parameters?.resume === 'form'),\n\t);\n};\n\nexport async function formWebhook(\n\tcontext: IWebhookFunctions,\n\tauthProperty = FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n) {\n\tconst node = context.getNode();\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tignoreBots?: boolean;\n\t\trespondWithOptions?: {\n\t\t\tvalues: {\n\t\t\t\trespondWith: 'text' | 'redirect';\n\t\t\t\tformSubmittedText: string;\n\t\t\t\tredirectUrl: string;\n\t\t\t};\n\t\t};\n\t\tformSubmittedText?: string;\n\t\tuseWorkflowTimezone?: boolean;\n\t\tappendAttribution?: boolean;\n\t\tbuttonLabel?: string;\n\t\tcustomCss?: string;\n\t};\n\tconst res = context.getResponseObject();\n\tconst req = context.getRequestObject();\n\n\ttry {\n\t\tif (options.ignoreBots && isbot(req.headers['user-agent'])) {\n\t\t\tthrow new WebhookAuthorizationError(403);\n\t\t}\n\t\tif (node.typeVersion > 1) {\n\t\t\tawait validateWebhookAuthentication(context, authProperty);\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof WebhookAuthorizationError) {\n\t\t\tres.setHeader('WWW-Authenticate', 'Basic realm=\"Enter credentials\"');\n\t\t\tres.status(401).send();\n\t\t\treturn { noWebhookResponse: true };\n\t\t}\n\t\tthrow error;\n\t}\n\n\tconst mode = context.getMode() === 'manual' ? 'test' : 'production';\n\tconst formFields = context.getNodeParameter('formFields.values', []) as FormFieldsParameter;\n\n\tconst method = context.getRequestObject().method;\n\n\tvalidateResponseModeConfiguration(context);\n\n\t//Show the form on GET request\n\tif (method === 'GET') {\n\t\tconst formTitle = context.getNodeParameter('formTitle', '') as string;\n\t\tconst formDescription = sanitizeHtml(context.getNodeParameter('formDescription', '') as string);\n\t\tlet responseMode = context.getNodeParameter('responseMode', '') as string;\n\n\t\tlet formSubmittedText;\n\t\tlet redirectUrl;\n\t\tlet appendAttribution = true;\n\n\t\tif (options.respondWithOptions) {\n\t\t\tconst values = (options.respondWithOptions as IDataObject).values as IDataObject;\n\t\t\tif (values.respondWith === 'text') {\n\t\t\t\tformSubmittedText = values.formSubmittedText as string;\n\t\t\t}\n\t\t\tif (values.respondWith === 'redirect') {\n\t\t\t\tredirectUrl = values.redirectUrl as string;\n\t\t\t}\n\t\t} else {\n\t\t\tformSubmittedText = options.formSubmittedText as string;\n\t\t}\n\n\t\tif (options.appendAttribution === false) {\n\t\t\tappendAttribution = false;\n\t\t}\n\n\t\tlet buttonLabel = 'Submit';\n\n\t\tif (options.buttonLabel) {\n\t\t\tbuttonLabel = options.buttonLabel;\n\t\t}\n\n\t\tconst connectedNodes = context.getChildNodes(context.getNode().name, {\n\t\t\tincludeNodeParameters: true,\n\t\t});\n\t\tconst hasNextPage = isFormConnected(connectedNodes);\n\n\t\tif (hasNextPage) {\n\t\t\tredirectUrl = undefined;\n\t\t\tresponseMode = 'responseNode';\n\t\t}\n\n\t\trenderForm({\n\t\t\tcontext,\n\t\t\tres,\n\t\t\tformTitle,\n\t\t\tformDescription,\n\t\t\tformFields,\n\t\t\tresponseMode,\n\t\t\tmode,\n\t\t\tformSubmittedText,\n\t\t\tredirectUrl,\n\t\t\tappendAttribution,\n\t\t\tbuttonLabel,\n\t\t\tcustomCss: options.customCss,\n\t\t});\n\n\t\treturn {\n\t\t\tnoWebhookResponse: true,\n\t\t};\n\t}\n\n\tlet { useWorkflowTimezone } = options;\n\n\tif (useWorkflowTimezone === undefined && node.typeVersion > 2) {\n\t\tuseWorkflowTimezone = true;\n\t}\n\n\tconst returnItem = await prepareFormReturnItem(context, formFields, mode, useWorkflowTimezone);\n\n\treturn {\n\t\twebhookResponse: { status: 200 },\n\t\tworkflowData: [[returnItem]],\n\t};\n}\n\nexport function resolveRawData(context: IWebhookFunctions, rawData: string) {\n\tconst resolvables = getResolvables(rawData);\n\tlet returnData: string = rawData;\n\n\tif (returnData.startsWith('=')) {\n\t\treturnData = returnData.replace(/^=+/, '');\n\t} else {\n\t\treturn returnData;\n\t}\n\n\tif (resolvables.length) {\n\t\tfor (const resolvable of resolvables) {\n\t\t\tconst resolvedValue = context.evaluateExpression(`${resolvable}`);\n\n\t\t\tif (typeof resolvedValue === 'object' && resolvedValue !== null) {\n\t\t\t\treturnData = returnData.replace(resolvable, JSON.stringify(resolvedValue));\n\t\t\t} else {\n\t\t\t\treturnData = returnData.replace(resolvable, resolvedValue as string);\n\t\t\t}\n\t\t}\n\t}\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAyB;AASzB,0BAMO;AACP,2BAAqB;AAGrB,wBAAqD;AACrD,uBAA+B;AAC/B,mBAA0C;AAC1C,mBAA8C;AAEvC,SAAS,aAAa,MAAc;AAC1C,aAAO,qBAAAA,SAAS,MAAM;AAAA,IACrB,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAC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