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.
Files changed (148) hide show
  1. package/dist/credentials/PerplexityApi.credentials.js +1 -1
  2. package/dist/credentials/PerplexityApi.credentials.js.map +1 -1
  3. package/dist/nodes/Adalo/__schema__/v1.0.0/collection/getAll.json +21 -0
  4. package/dist/nodes/Airtable/test/v2/node/helpers.js +12 -2
  5. package/dist/nodes/Airtable/test/v2/node/helpers.js.map +1 -1
  6. package/dist/nodes/Airtop/__schema__/v1.0.0/extraction/query.json +7 -1
  7. package/dist/nodes/Airtop/__schema__/v1.0.0/session/create.json +9 -0
  8. package/dist/nodes/Airtop/__schema__/v1.0.0/window/create.json +40 -0
  9. package/dist/nodes/Airtop/test/node/helpers.js +12 -2
  10. package/dist/nodes/Airtop/test/node/helpers.js.map +1 -1
  11. package/dist/nodes/Asana/__schema__/v1.0.0/subtask/getAll.json +4 -1
  12. package/dist/nodes/Aws/S3/__schema__/v2.0.0/file/getAll.json +7 -1
  13. package/dist/nodes/Aws/S3/__schema__/v2.0.0/folder/getAll.json +7 -1
  14. package/dist/nodes/BambooHr/__schema__/v1.0.0/employee/getAll.json +1 -4
  15. package/dist/nodes/ClickUp/__schema__/v1.0.0/list/customFields.json +23 -1
  16. package/dist/nodes/Code/Pyodide.js +24 -0
  17. package/dist/nodes/Code/Pyodide.js.map +1 -1
  18. package/dist/nodes/CompareDatasets/GenericFunctions.js +5 -5
  19. package/dist/nodes/CompareDatasets/GenericFunctions.js.map +1 -1
  20. package/dist/nodes/Discord/__schema__/v2.0.0/message/sendAndWait.json +14 -0
  21. package/dist/nodes/Discord/v2/helpers/utils.js +2 -2
  22. package/dist/nodes/Discord/v2/helpers/utils.js.map +1 -1
  23. package/dist/nodes/Dropbox/__schema__/v1.0.0/file/download.json +31 -1
  24. package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/enrich.json +15 -1
  25. package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/fetchRequest.json +50 -0
  26. package/dist/nodes/EmailReadImap/v2/utils.js +16 -3
  27. package/dist/nodes/EmailReadImap/v2/utils.js.map +1 -1
  28. package/dist/nodes/EmailSend/__schema__/v2.1.0/email/send.json +1 -7
  29. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +1 -1
  30. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
  31. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +2 -2
  32. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
  33. package/dist/nodes/Form/Form.node.js +3 -3
  34. package/dist/nodes/Form/Form.node.js.map +1 -1
  35. package/dist/nodes/Form/utils/formCompletionUtils.js.map +1 -0
  36. package/dist/nodes/Form/utils/formNodeUtils.js.map +1 -0
  37. package/dist/nodes/Form/{utils.js → utils/utils.js} +21 -7
  38. package/dist/nodes/Form/utils/utils.js.map +1 -0
  39. package/dist/nodes/Form/v1/FormTriggerV1.node.js +1 -1
  40. package/dist/nodes/Form/v1/FormTriggerV1.node.js.map +1 -1
  41. package/dist/nodes/Form/v2/FormTriggerV2.node.js +1 -1
  42. package/dist/nodes/Form/v2/FormTriggerV2.node.js.map +1 -1
  43. package/dist/nodes/Freshservice/GenericFunctions.js +12 -2
  44. package/dist/nodes/Freshservice/GenericFunctions.js.map +1 -1
  45. package/dist/nodes/Google/Ads/__schema__/v1.0.0/campaign/getAll.json +13 -1
  46. package/dist/nodes/Google/Analytics/__schema__/v2.0.0/report/get.json +1 -4
  47. package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +1 -4
  48. package/dist/nodes/Google/Chat/__schema__/v1.0.0/message/create.json +30 -1
  49. package/dist/nodes/Google/Drive/__schema__/v3.0.0/file/upload.json +4 -1
  50. package/dist/nodes/Google/Drive/test/v2/node/helpers.js +12 -2
  51. package/dist/nodes/Google/Drive/test/v2/node/helpers.js.map +1 -1
  52. package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/query.json +1 -7
  53. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/addLabels.json +13 -1
  54. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +1 -7
  55. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/markAsRead.json +13 -1
  56. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/thread/addLabels.json +16 -1
  57. package/dist/nodes/Google/Sheet/v2/actions/sheet/update.operation.js +10 -4
  58. package/dist/nodes/Google/Sheet/v2/actions/sheet/update.operation.js.map +1 -1
  59. package/dist/nodes/HaloPSA/__schema__/v1.0.0/ticket/getAll.json +1 -268
  60. package/dist/nodes/HttpRequest/shared/optimizeResponse.js +5 -3
  61. package/dist/nodes/HttpRequest/shared/optimizeResponse.js.map +1 -1
  62. package/dist/nodes/Hubspot/__schema__/v2.1.0/company/getAll.json +1 -4
  63. package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/getAll.json +64 -1
  64. package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +1 -4
  65. package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +1 -61
  66. package/dist/nodes/JinaAI/__schema__/v1.0.0/reader/read.json +26 -0
  67. package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +604 -7
  68. package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +1 -110
  69. package/dist/nodes/Lemlist/__schema__/v2.0.0/lead/create.json +1 -4
  70. package/dist/nodes/Lemlist/__schema__/v2.0.0/lead/get.json +30 -0
  71. package/dist/nodes/Line/__schema__/v1.0.0/notification/send.json +4 -7
  72. package/dist/nodes/Linear/__schema__/v1.0.0/issue/getAll.json +12 -1
  73. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +23 -3
  74. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
  75. package/dist/nodes/Microsoft/Entra/__schema__/v1.0.0/user/getAll.json +1 -7
  76. package/dist/nodes/Microsoft/Entra/descriptions/GroupDescription.js +12 -2
  77. package/dist/nodes/Microsoft/Entra/descriptions/GroupDescription.js.map +1 -1
  78. package/dist/nodes/Microsoft/Entra/descriptions/UserDescription.js +13 -3
  79. package/dist/nodes/Microsoft/Entra/descriptions/UserDescription.js.map +1 -1
  80. package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/file/download.json +23 -10
  81. package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/folder/create.json +1 -15
  82. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/event/getAll.json +1 -4
  83. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +124 -1
  84. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +1 -56
  85. package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +12 -2
  86. package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
  87. package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/create.json +39 -0
  88. package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/get.json +44 -0
  89. package/dist/nodes/Microsoft/ToDo/__schema__/v1.0.0/task/getAll.json +5 -21
  90. package/dist/nodes/N8n/WorkflowDescription.js +40 -0
  91. package/dist/nodes/N8n/WorkflowDescription.js.map +1 -1
  92. package/dist/nodes/Nasa/__schema__/v1.0.0/donkiSolarFlare/get.json +1 -4
  93. package/dist/nodes/Notion/__schema__/v2.2.0/database/get.json +2 -149
  94. package/dist/nodes/Odoo/__schema__/v1.0.0/contact/get.json +1 -4
  95. package/dist/nodes/Odoo/__schema__/v1.0.0/contact/getAll.json +1 -10
  96. package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +1 -40
  97. package/dist/nodes/OpenAi/__schema__/v1.1.0/chat/complete.json +29 -1
  98. package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +7 -1
  99. package/dist/nodes/QuickBase/__schema__/v1.0.0/record/getAll.json +9 -0
  100. package/dist/nodes/QuickBooks/__schema__/v1.0.0/transaction/getReport.json +4 -1
  101. package/dist/nodes/RssFeedRead/RssFeedRead.node.js +9 -3
  102. package/dist/nodes/RssFeedRead/RssFeedRead.node.js.map +1 -1
  103. package/dist/nodes/S3/__schema__/v1.0.0/file/download.json +21 -0
  104. package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/getAll.json +1 -4
  105. package/dist/nodes/Salesforce/__schema__/v1.0.0/lead/getAll.json +1 -4
  106. package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +1 -4
  107. package/dist/nodes/Salesforce/__schema__/v1.0.0/search/query.json +1 -4
  108. package/dist/nodes/Shopify/__schema__/v1.0.0/order/getAll.json +250 -3
  109. package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +1 -50
  110. package/dist/nodes/Slack/__schema__/v2.3.0/channel/member.json +168 -2
  111. package/dist/nodes/Slack/__schema__/v2.3.0/message/post.json +1 -4
  112. package/dist/nodes/Sms77/__schema__/v1.0.0/sms/send.json +1 -10
  113. package/dist/nodes/Strapi/__schema__/v1.0.0/entry/getAll.json +10 -1
  114. package/dist/nodes/Telegram/__schema__/v1.2.0/chat/member.json +1 -4
  115. package/dist/nodes/Telegram/__schema__/v1.2.0/message/editMessageText.json +4 -1
  116. package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendAndWait.json +14 -0
  117. package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendMessage.json +4 -21
  118. package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendPhoto.json +1 -7
  119. package/dist/nodes/Telegram/tests/Helpers.js +12 -2
  120. package/dist/nodes/Telegram/tests/Helpers.js.map +1 -1
  121. package/dist/nodes/Transform/RemoveDuplicates/utils.js +8 -6
  122. package/dist/nodes/Transform/RemoveDuplicates/utils.js.map +1 -1
  123. package/dist/nodes/Trello/__schema__/v1.0.0/list/getAll.json +1 -4
  124. package/dist/nodes/Trello/__schema__/v1.0.0/list/getCards.json +1 -4
  125. package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/search.json +7 -1
  126. package/dist/nodes/Wait/Wait.node.js +1 -1
  127. package/dist/nodes/Wait/Wait.node.js.map +1 -1
  128. package/dist/nodes/Wordpress/__schema__/v1.0.0/post/get.json +1 -7
  129. package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +1 -4
  130. package/dist/nodes/Zoho/__schema__/v1.0.0/lead/getAll.json +99 -1
  131. package/dist/test/nodes/Helpers.js +12 -2
  132. package/dist/test/nodes/Helpers.js.map +1 -1
  133. package/dist/types/credentials.json +1 -1
  134. package/dist/types/nodes.json +13 -13
  135. package/dist/utils/binary.js +12 -9
  136. package/dist/utils/binary.js.map +1 -1
  137. package/dist/utils/sendAndWait/utils.js +21 -6
  138. package/dist/utils/sendAndWait/utils.js.map +1 -1
  139. package/dist/utils/utilities.js +31 -16
  140. package/dist/utils/utilities.js.map +1 -1
  141. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +2 -2
  142. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
  143. package/package.json +9 -9
  144. package/dist/nodes/Form/formCompletionUtils.js.map +0 -1
  145. package/dist/nodes/Form/formNodeUtils.js.map +0 -1
  146. package/dist/nodes/Form/utils.js.map +0 -1
  147. /package/dist/nodes/Form/{formCompletionUtils.js → utils/formCompletionUtils.js} +0 -0
  148. /package/dist/nodes/Form/{formNodeUtils.js → utils/formNodeUtils.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/Form/utils/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":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/Form/utils/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":[]}
@@ -46,10 +46,10 @@ var import_isbot = __toESM(require("isbot"));
46
46
  var import_luxon = require("luxon");
47
47
  var import_n8n_workflow = require("n8n-workflow");
48
48
  var import_sanitize_html = __toESM(require("sanitize-html"));
49
- var import_interfaces = require("./interfaces");
50
- var import_utilities = require("../../utils/utilities");
51
- var import_error = require("../Webhook/error");
52
- var import_utils = require("../Webhook/utils");
49
+ var import_utilities = require("../../../utils/utilities");
50
+ var import_error = require("../../Webhook/error");
51
+ var import_utils = require("../../Webhook/utils");
52
+ var import_interfaces = require("../interfaces");
53
53
  function sanitizeHtml(text) {
54
54
  return (0, import_sanitize_html.default)(text, {
55
55
  allowedTags: [
@@ -84,10 +84,24 @@ function sanitizeHtml(text) {
84
84
  allowedAttributes: {
85
85
  a: ["href", "target", "rel"],
86
86
  img: ["src", "alt", "width", "height"],
87
- video: ["*"],
88
- iframe: ["*"],
89
- source: ["*"]
87
+ video: ["controls", "autoplay", "loop", "muted", "poster", "width", "height"],
88
+ iframe: [
89
+ "src",
90
+ "width",
91
+ "height",
92
+ "frameborder",
93
+ "allow",
94
+ "allowfullscreen",
95
+ "referrerpolicy"
96
+ ],
97
+ source: ["src", "type"]
90
98
  },
99
+ allowedSchemes: ["https", "http"],
100
+ allowedSchemesByTag: {
101
+ source: ["https", "http"],
102
+ iframe: ["https", "http"]
103
+ },
104
+ allowProtocolRelative: false,
91
105
  transformTags: {
92
106
  iframe: import_sanitize_html.default.simpleTransform("iframe", {
93
107
  sandbox: "",
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/Form/utils/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 { getResolvables } from '../../../utils/utilities';\nimport { WebhookAuthorizationError } from '../../Webhook/error';\nimport { validateWebhookAuthentication } from '../../Webhook/utils';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from '../interfaces';\nimport type { FormTriggerData, FormTriggerInput } from '../interfaces';\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: ['controls', 'autoplay', 'loop', 'muted', 'poster', 'width', 'height'],\n\t\t\tiframe: [\n\t\t\t\t'src',\n\t\t\t\t'width',\n\t\t\t\t'height',\n\t\t\t\t'frameborder',\n\t\t\t\t'allow',\n\t\t\t\t'allowfullscreen',\n\t\t\t\t'referrerpolicy',\n\t\t\t],\n\t\t\tsource: ['src', 'type'],\n\t\t},\n\t\tallowedSchemes: ['https', 'http'],\n\t\tallowedSchemesByTag: {\n\t\t\tsource: ['https', 'http'],\n\t\t\tiframe: ['https', 'http'],\n\t\t},\n\t\tallowProtocolRelative: false,\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;AAErB,uBAA+B;AAC/B,mBAA0C;AAC1C,mBAA8C;AAC9C,wBAAqD;AAG9C,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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAC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,WAAW,WAAW,GAAG,GAAG;AAC/B,iBAAa,WAAW,QAAQ,OAAO,EAAE;AAAA,EAC1C,OAAO;AACN,WAAO;AAAA,EACR;AAEA,MAAI,YAAY,QAAQ;AACvB,eAAW,cAAc,aAAa;AACrC,YAAM,gBAAgB,QAAQ,mBAAmB,GAAG,UAAU,EAAE;AAEhE,UAAI,OAAO,kBAAkB,YAAY,kBAAkB,MAAM;AAChE,qBAAa,WAAW,QAAQ,YAAY,KAAK,UAAU,aAAa,CAAC;AAAA,MAC1E,OAAO;AACN,qBAAa,WAAW,QAAQ,YAAY,aAAuB;AAAA,MACpE;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;","names":["sanitize","isbot"]}
@@ -23,7 +23,7 @@ __export(FormTriggerV1_node_exports, {
23
23
  module.exports = __toCommonJS(FormTriggerV1_node_exports);
24
24
  var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_common = require("../common.descriptions");
26
- var import_utils = require("../utils");
26
+ var import_utils = require("../utils/utils");
27
27
  const descriptionV1 = {
28
28
  displayName: "n8n Form Trigger",
29
29
  name: "formTrigger",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Form/v1/FormTriggerV1.node.ts"],"sourcesContent":["import {\n\tFORM_TRIGGER_PATH_IDENTIFIER,\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\twebhookPath,\n} from '../common.descriptions';\nimport { formWebhook } from '../utils';\n\nconst descriptionV1: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: 1,\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'n8n Form Trigger',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideUrl: true,\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideMethod: true,\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tproperties: [\n\t\twebhookPath,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\tformRespondMode,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\tdisplayOptions: {\n\t\t\t\thide: {\n\t\t\t\t\tresponseMode: ['responseNode'],\n\t\t\t\t},\n\t\t\t},\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Form Submitted Text',\n\t\t\t\t\tname: 'formSubmittedText',\n\t\t\t\t\tdescription: 'The text displayed to users after they filled the form',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Your response has been recorded',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV1,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAOO;AAEP,oBAOO;AACP,mBAA4B;AAE5B,MAAM,gBAAsC;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EAEA,QAAQ,CAAC;AAAA,EACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,EAClC,UAAU;AAAA,IACT;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,MAAM,2BAA2B,gDAA4B;AAAA,MAC7D,YAAY;AAAA,IACb;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,MAAM,2BAA2B,gDAA4B;AAAA,MAC7D,eAAe;AAAA,IAChB;AAAA,EACD;AAAA,EACA,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,YAAY;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,CAAC;AAAA,MACV,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,cAAc,CAAC,cAAc;AAAA,QAC9B;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/Form/v1/FormTriggerV1.node.ts"],"sourcesContent":["import {\n\tFORM_TRIGGER_PATH_IDENTIFIER,\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\twebhookPath,\n} from '../common.descriptions';\nimport { formWebhook } from '../utils/utils';\n\nconst descriptionV1: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: 1,\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'n8n Form Trigger',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideUrl: true,\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: `={{$parameter[\"path\"]}}/${FORM_TRIGGER_PATH_IDENTIFIER}`,\n\t\t\tndvHideMethod: true,\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tproperties: [\n\t\twebhookPath,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\tformRespondMode,\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\tdisplayOptions: {\n\t\t\t\thide: {\n\t\t\t\t\tresponseMode: ['responseNode'],\n\t\t\t\t},\n\t\t\t},\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Form Submitted Text',\n\t\t\t\t\tname: 'formSubmittedText',\n\t\t\t\t\tdescription: 'The text displayed to users after they filled the form',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Your response has been recorded',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV1,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAOO;AAEP,oBAOO;AACP,mBAA4B;AAE5B,MAAM,gBAAsC;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EAEA,QAAQ,CAAC;AAAA,EACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,EAClC,UAAU;AAAA,IACT;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,MAAM,2BAA2B,gDAA4B;AAAA,MAC7D,YAAY;AAAA,IACb;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,MAAM,2BAA2B,gDAA4B;AAAA,MAC7D,eAAe;AAAA,IAChB;AAAA,EACD;AAAA,EACA,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,YAAY;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,CAAC;AAAA,MACV,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,cAAc,CAAC,cAAc;AAAA,QAC9B;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
@@ -25,7 +25,7 @@ var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_common = require("../common.descriptions");
26
26
  var import_cssVariables = require("../cssVariables");
27
27
  var import_interfaces = require("../interfaces");
28
- var import_utils = require("../utils");
28
+ var import_utils = require("../utils/utils");
29
29
  const useWorkflowTimezone = {
30
30
  displayName: "Use Workflow Timezone",
31
31
  name: "useWorkflowTimezone",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/Form/v2/FormTriggerV2.node.ts"],"sourcesContent":["import {\n\tADD_FORM_NOTICE,\n\ttype INodePropertyOptions,\n\tNodeConnectionTypes,\n\ttype INodeProperties,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tappendAttributionToForm,\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\trespondWithOptions,\n\twebhookPath,\n} from '../common.descriptions';\nimport { cssVariables } from '../cssVariables';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from '../interfaces';\nimport { formWebhook } from '../utils';\n\nconst useWorkflowTimezone: INodeProperties = {\n\tdisplayName: 'Use Workflow Timezone',\n\tname: 'useWorkflowTimezone',\n\ttype: 'boolean',\n\tdefault: false,\n\tdescription: \"Whether to use the workflow timezone set in node's settings rather than UTC\",\n};\n\nconst descriptionV2: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: [2, 2.1, 2.2],\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'On form submission',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideUrl: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideMethod: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tcredentials: [\n\t\t{\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed\n\t\t\tname: 'httpBasicAuth',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\t[FORM_TRIGGER_AUTHENTICATION_PROPERTY]: ['basicAuth'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Basic Auth',\n\t\t\t\t\tvalue: 'basicAuth',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'None',\n\t\t\t\t\tvalue: 'none',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'none',\n\t\t},\n\t\t{ ...webhookPath, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\t{ ...formRespondMode, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\t{\n\t\t\t...formRespondMode,\n\t\t\toptions: (formRespondMode.options as INodePropertyOptions[])?.filter(\n\t\t\t\t(option) => option.value !== 'responseNode',\n\t\t\t),\n\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t},\n\t\t{\n\t\t\tdisplayName:\n\t\t\t\t\"In the 'Respond to Webhook' node, select 'Respond With JSON' and set the <strong>formSubmittedText</strong> key to display a custom response in the form, or the <strong>redirectURL</strong> key to redirect users to a URL\",\n\t\t\tname: 'formNotice',\n\t\t\ttype: 'notice',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: { responseMode: ['responseNode'] },\n\t\t\t},\n\t\t\tdefault: '',\n\t\t},\n\t\t// notice would be shown if no Form node was connected to trigger\n\t\t{\n\t\t\tdisplayName: 'Build multi-step forms by adding a form page later in your workflow',\n\t\t\tname: ADD_FORM_NOTICE,\n\t\t\ttype: 'notice',\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\tappendAttributionToForm,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Button Label',\n\t\t\t\t\tdescription: 'The label of the submit button in the form',\n\t\t\t\t\tname: 'buttonLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Submit',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...webhookPath,\n\t\t\t\t\trequired: false,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...respondWithOptions,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'/responseMode': ['responseNode'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Ignore Bots',\n\t\t\t\t\tname: 'ignoreBots',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether to ignore requests from bots like link previewers and web crawlers',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [2],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV2,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BASO;AAEP,oBASO;AACP,0BAA6B;AAC7B,wBAAqD;AACrD,mBAA4B;AAE5B,MAAM,sBAAuC;AAAA,EAC5C,aAAa;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AAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,SAAS;AAAA,UACT,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,CAAC;AAAA,YACf;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,SAAS;AAAA,UACT,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,MAAM;AAAA,YACN,QAAQ;AAAA,UACT;AAAA,UACA,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,UACA,SAAS,iCAAa,KAAK;AAAA,UAC3B,aAAa;AAAA,QACd;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/Form/v2/FormTriggerV2.node.ts"],"sourcesContent":["import {\n\tADD_FORM_NOTICE,\n\ttype INodePropertyOptions,\n\tNodeConnectionTypes,\n\ttype INodeProperties,\n\ttype INodeType,\n\ttype INodeTypeBaseDescription,\n\ttype INodeTypeDescription,\n\ttype IWebhookFunctions,\n} from 'n8n-workflow';\n\nimport {\n\tappendAttributionToForm,\n\tformDescription,\n\tformFields,\n\tformRespondMode,\n\tformTitle,\n\tformTriggerPanel,\n\trespondWithOptions,\n\twebhookPath,\n} from '../common.descriptions';\nimport { cssVariables } from '../cssVariables';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from '../interfaces';\nimport { formWebhook } from '../utils/utils';\n\nconst useWorkflowTimezone: INodeProperties = {\n\tdisplayName: 'Use Workflow Timezone',\n\tname: 'useWorkflowTimezone',\n\ttype: 'boolean',\n\tdefault: false,\n\tdescription: \"Whether to use the workflow timezone set in node's settings rather than UTC\",\n};\n\nconst descriptionV2: INodeTypeDescription = {\n\tdisplayName: 'n8n Form Trigger',\n\tname: 'formTrigger',\n\ticon: 'file:form.svg',\n\tgroup: ['trigger'],\n\tversion: [2, 2.1, 2.2],\n\tdescription: 'Generate webforms in n8n and pass their responses to the workflow',\n\tdefaults: {\n\t\tname: 'On form submission',\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\twebhooks: [\n\t\t{\n\t\t\tname: 'setup',\n\t\t\thttpMethod: 'GET',\n\t\t\tresponseMode: 'onReceived',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideUrl: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t\t{\n\t\t\tname: 'default',\n\t\t\thttpMethod: 'POST',\n\t\t\tresponseMode: '={{$parameter[\"responseMode\"]}}',\n\t\t\tresponseData: '={{$parameter[\"responseMode\"] === \"lastNode\" ? \"noData\" : undefined}}',\n\t\t\tisFullPath: true,\n\t\t\tpath: '={{ $parameter[\"path\"] || $parameter[\"options\"]?.path || $webhookId }}',\n\t\t\tndvHideMethod: true,\n\t\t\tnodeType: 'form',\n\t\t},\n\t],\n\teventTriggerDescription: 'Waiting for you to submit the form',\n\tactivationMessage: 'You can now make calls to your production Form URL.',\n\ttriggerPanel: formTriggerPanel,\n\tcredentials: [\n\t\t{\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed\n\t\t\tname: 'httpBasicAuth',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\t[FORM_TRIGGER_AUTHENTICATION_PROPERTY]: ['basicAuth'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Basic Auth',\n\t\t\t\t\tvalue: 'basicAuth',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'None',\n\t\t\t\t\tvalue: 'none',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'none',\n\t\t},\n\t\t{ ...webhookPath, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\tformTitle,\n\t\tformDescription,\n\t\tformFields,\n\t\t{ ...formRespondMode, displayOptions: { show: { '@version': [{ _cnd: { lte: 2.1 } }] } } },\n\t\t{\n\t\t\t...formRespondMode,\n\t\t\toptions: (formRespondMode.options as INodePropertyOptions[])?.filter(\n\t\t\t\t(option) => option.value !== 'responseNode',\n\t\t\t),\n\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t},\n\t\t{\n\t\t\tdisplayName:\n\t\t\t\t\"In the 'Respond to Webhook' node, select 'Respond With JSON' and set the <strong>formSubmittedText</strong> key to display a custom response in the form, or the <strong>redirectURL</strong> key to redirect users to a URL\",\n\t\t\tname: 'formNotice',\n\t\t\ttype: 'notice',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: { responseMode: ['responseNode'] },\n\t\t\t},\n\t\t\tdefault: '',\n\t\t},\n\t\t// notice would be shown if no Form node was connected to trigger\n\t\t{\n\t\t\tdisplayName: 'Build multi-step forms by adding a form page later in your workflow',\n\t\t\tname: ADD_FORM_NOTICE,\n\t\t\ttype: 'notice',\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\tappendAttributionToForm,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Button Label',\n\t\t\t\t\tdescription: 'The label of the submit button in the form',\n\t\t\t\t\tname: 'buttonLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Submit',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...webhookPath,\n\t\t\t\t\trequired: false,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 2.2 } }] } },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...respondWithOptions,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'/responseMode': ['responseNode'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Ignore Bots',\n\t\t\t\t\tname: 'ignoreBots',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether to ignore requests from bots like link previewers and web crawlers',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [2],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...useWorkflowTimezone,\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: \"Whether to use the workflow timezone in 'submittedAt' field or UTC\",\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Form Styling',\n\t\t\t\t\tname: 'customCss',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\trows: 10,\n\t\t\t\t\t\teditor: 'cssEditor',\n\t\t\t\t\t},\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gt: 2 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: cssVariables.trim(),\n\t\t\t\t\tdescription: 'Override default styling of the public form interface with CSS',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class FormTriggerV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...descriptionV2,\n\t\t};\n\t}\n\n\tasync webhook(this: IWebhookFunctions) {\n\t\treturn await formWebhook(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BASO;AAEP,oBASO;AACP,0BAA6B;AAC7B,wBAAqD;AACrD,mBAA4B;AAE5B,MAAM,sBAAuC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AACd;AAEA,MAAM,gBAAsC;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS,CAAC,GAAG,KAAK,GAAG;AAAA,EACr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AY,CAAC,CAAC;AAAA,YACf;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,SAAS;AAAA,UACT,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,MAAM;AAAA,YACN,QAAQ;AAAA,UACT;AAAA,UACA,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;AAAA,YACjC;AAAA,UACD;AAAA,UACA,SAAS,iCAAa,KAAK;AAAA,UAC3B,aAAa;AAAA,QACd;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,cAAmC;AAAA,EAG/C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AAAA,EAEA,MAAM,UAAiC;AACtC,WAAO,UAAM,0BAAY,IAAI;AAAA,EAC9B;AACD;","names":[]}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
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
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var GenericFunctions_exports = {};
20
30
  __export(GenericFunctions_exports, {
@@ -32,7 +42,7 @@ __export(GenericFunctions_exports, {
32
42
  validateUpdateFields: () => validateUpdateFields
33
43
  });
34
44
  module.exports = __toCommonJS(GenericFunctions_exports);
35
- var import_lodash = require("lodash");
45
+ var import_omit = __toESM(require("lodash/omit"));
36
46
  var import_n8n_workflow = require("n8n-workflow");
37
47
  async function freshserviceApiRequest(method, endpoint, body = {}, qs = {}) {
38
48
  const { apiKey, domain } = await this.getCredentials("freshserviceApi");
@@ -170,7 +180,7 @@ function validateUpdateFields(updateFields, resource) {
170
180
  const toArray = (str) => str.split(",").map((e) => e.trim());
171
181
  function adjustAddress(fixedCollection) {
172
182
  if (!fixedCollection.address) return fixedCollection;
173
- const adjusted = (0, import_lodash.omit)(fixedCollection, ["address"]);
183
+ const adjusted = (0, import_omit.default)(fixedCollection, ["address"]);
174
184
  adjusted.address = fixedCollection.address.addressFields;
175
185
  return adjusted;
176
186
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/Freshservice/GenericFunctions.ts"],"sourcesContent":["import { omit } from 'lodash';\nimport type {\n\tIExecuteFunctions,\n\tIHookFunctions,\n\tIDataObject,\n\tILoadOptionsFunctions,\n\tJsonObject,\n\tIHttpRequestMethods,\n\tIRequestOptions,\n} from 'n8n-workflow';\nimport { NodeApiError, NodeOperationError } from 'n8n-workflow';\n\nimport type {\n\tAddressFixedCollection,\n\tFreshserviceCredentials,\n\tLoadedUser,\n\tRolesParameter,\n} from './types';\n\nexport async function freshserviceApiRequest(\n\tthis: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tbody: IDataObject = {},\n\tqs: IDataObject = {},\n) {\n\tconst { apiKey, domain } = await this.getCredentials<FreshserviceCredentials>('freshserviceApi');\n\tconst encodedApiKey = Buffer.from(`${apiKey}:X`).toString('base64');\n\n\tconst options: IRequestOptions = {\n\t\theaders: {\n\t\t\tAuthorization: `Basic ${encodedApiKey}`,\n\t\t},\n\t\tmethod,\n\t\tbody,\n\t\tqs,\n\t\turi: `https://${domain}.freshservice.com/api/v2${endpoint}`,\n\t\tjson: true,\n\t};\n\n\tif (!Object.keys(body).length) {\n\t\tdelete options.body;\n\t}\n\n\tif (!Object.keys(qs).length) {\n\t\tdelete options.qs;\n\t}\n\n\ttry {\n\t\treturn await this.helpers.request(options);\n\t} catch (error) {\n\t\tif (error.error.description === 'Validation failed') {\n\t\t\tconst numberOfErrors = error.error.errors.length;\n\t\t\tconst message = 'Please check your parameters';\n\n\t\t\tif (numberOfErrors === 1) {\n\t\t\t\tconst [validationError] = error.error.errors;\n\t\t\t\tthrow new NodeApiError(this.getNode(), error as JsonObject, {\n\t\t\t\t\tmessage,\n\t\t\t\t\tdescription: `For ${validationError.field}: ${validationError.message}`,\n\t\t\t\t});\n\t\t\t} else if (numberOfErrors > 1) {\n\t\t\t\tthrow new NodeApiError(this.getNode(), error as JsonObject, {\n\t\t\t\t\tmessage,\n\t\t\t\t\tdescription: \"For more information, expand 'details' below and look at 'cause' section\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tthrow new NodeApiError(this.getNode(), error as JsonObject);\n\t}\n}\n\nexport async function freshserviceApiRequestAllItems(\n\tthis: IExecuteFunctions | IHookFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tbody: IDataObject = {},\n\tqs: IDataObject = {},\n) {\n\tconst returnData: IDataObject[] = [];\n\tqs.page = 1;\n\tlet items;\n\n\tdo {\n\t\tconst responseData = await freshserviceApiRequest.call(this, method, endpoint, body, qs);\n\t\tconst key = Object.keys(responseData as IDataObject)[0];\n\t\titems = responseData[key];\n\t\tif (!items.length) return returnData;\n\t\treturnData.push(...(items as IDataObject[]));\n\t\tqs.page++;\n\t} while (items.length >= 30);\n\n\treturn returnData;\n}\n\nexport async function handleListing(\n\tthis: IExecuteFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tbody: IDataObject = {},\n\tqs: IDataObject = {},\n) {\n\tconst returnAll = this.getNodeParameter('returnAll', 0);\n\n\tif (returnAll) {\n\t\treturn await freshserviceApiRequestAllItems.call(this, method, endpoint, body, qs);\n\t}\n\n\tconst responseData = await freshserviceApiRequestAllItems.call(this, method, endpoint, body, qs);\n\tconst limit = this.getNodeParameter('limit', 0);\n\n\treturn responseData.slice(0, limit);\n}\n\nexport const toOptions = (loadedResources: LoadedResource[]) => {\n\treturn loadedResources\n\t\t.map(({ id, name }) => ({ value: id, name }))\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n};\n\nexport const toUserOptions = (loadedUsers: LoadedUser[]) => {\n\treturn loadedUsers\n\t\t.map(({ id, last_name, first_name }) => {\n\t\t\treturn {\n\t\t\t\tvalue: id,\n\t\t\t\tname: last_name ? `${last_name}, ${first_name}` : `${first_name}`,\n\t\t\t};\n\t\t})\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n};\n\n/**\n * Ensure at least one role has been specified.\n */\nexport function validateAssignmentScopeGroup(this: IExecuteFunctions, roles: RolesParameter) {\n\tif (!roles.roleProperties?.length) {\n\t\tthrow new NodeOperationError(this.getNode(), 'Please specify a role for the agent to create.');\n\t}\n}\n\nexport function sanitizeAssignmentScopeGroup(this: IExecuteFunctions, roles: RolesParameter) {\n\troles.roleProperties.forEach((roleProperty) => {\n\t\tif (roleProperty.assignment_scope === 'specified_groups' && !roleProperty?.groups?.length) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Please specify a group for every role of the agent to create.',\n\t\t\t);\n\t\t}\n\n\t\t// remove the `groups` param, only needed for scopes other than `specified_groups`\n\t\tif (roleProperty.assignment_scope !== 'specified_groups' && roleProperty.groups) {\n\t\t\tdelete roleProperty.groups;\n\t\t}\n\t});\n}\n\n/**\n * Adjust a roles fixed collection into the format expected by Freshservice API.\n */\nexport function adjustAgentRoles(roles: RolesParameter) {\n\treturn {\n\t\troles: roles.roleProperties.map(({ role, assignment_scope, groups }) => {\n\t\t\treturn {\n\t\t\t\trole_id: role,\n\t\t\t\tassignment_scope,\n\t\t\t\tgroups,\n\t\t\t};\n\t\t}),\n\t};\n}\n\nexport function formatFilters(filters: IDataObject) {\n\tconst query = Object.keys(filters)\n\t\t.map((key) => {\n\t\t\tconst value = filters[key];\n\n\t\t\tif (!isNaN(Number(value))) {\n\t\t\t\treturn `${key}:${filters[key]}`; // number\n\t\t\t}\n\n\t\t\tif (typeof value === 'string' && value.endsWith('Z')) {\n\t\t\t\treturn `${key}:'${value.split('T')[0]}'`; // date\n\t\t\t}\n\n\t\t\treturn `${key}:'${filters[key]}'`; // string\n\t\t})\n\t\t.join(' AND ');\n\n\treturn {\n\t\tquery: `\"${query}\"`,\n\t};\n}\n\nexport function validateUpdateFields(\n\tthis: IExecuteFunctions,\n\tupdateFields: IDataObject,\n\tresource: string,\n) {\n\tif (!Object.keys(updateFields).length) {\n\t\tconst twoWordResources: { [key: string]: string } = {\n\t\t\tagentGroup: 'agent group',\n\t\t\tagentRole: 'agent role',\n\t\t\tassetType: 'asset type',\n\t\t\trequesterGroup: 'requester group',\n\t\t};\n\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t`Please enter at least one field to update for the ${\n\t\t\t\ttwoWordResources[resource] ?? resource\n\t\t\t}.`,\n\t\t);\n\t}\n}\n\nexport const toArray = (str: string) => str.split(',').map((e) => e.trim());\n\nexport function adjustAddress(fixedCollection: IDataObject & AddressFixedCollection) {\n\tif (!fixedCollection.address) return fixedCollection;\n\n\tconst adjusted = omit(fixedColl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G,CAAC;AAAA,EAC/B,CAAC,EACA,KAAK,OAAO;AAEd,SAAO;AAAA,IACN,OAAO,IAAI,KAAK;AAAA,EACjB;AACD;AAEO,SAAS,qBAEf,cACA,UACC;AACD,MAAI,CAAC,OAAO,KAAK,YAAY,EAAE,QAAQ;AACtC,UAAM,mBAA8C;AAAA,MACnD,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,gBAAgB;AAAA,IACjB;AAEA,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,qDACC,iBAAiB,QAAQ,KAAK,QAC/B;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,UAAU,CAAC,QAAgB,IAAI,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAEnE,SAAS,cAAc,iBAAuD;AACpF,MAAI,CAAC,gBAAgB,QAAS,QAAO;AAErC,QAAM,eAAW,oBAAK,iBAAiB,CAAC,SAAS,CAAC;AAClD,WAAS,UAAU,gBAAgB,QAAQ;AAE3C,SAAO;AACR;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/Freshservice/GenericFunctions.ts"],"sourcesContent":["import omit from 'lodash/omit';\nimport type {\n\tIExecuteFunctions,\n\tIHookFunctions,\n\tIDataObject,\n\tILoadOptionsFunctions,\n\tJsonObject,\n\tIHttpRequestMethods,\n\tIRequestOptions,\n} from 'n8n-workflow';\nimport { NodeApiError, NodeOperationError } from 'n8n-workflow';\n\nimport type {\n\tAddressFixedCollection,\n\tFreshserviceCredentials,\n\tLoadedUser,\n\tRolesParameter,\n} from './types';\n\nexport async function freshserviceApiRequest(\n\tthis: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tbody: IDataObject = {},\n\tqs: IDataObject = {},\n) {\n\tconst { apiKey, domain } = await this.getCredentials<FreshserviceCredentials>('freshserviceApi');\n\tconst encodedApiKey = Buffer.from(`${apiKey}:X`).toString('base64');\n\n\tconst options: IRequestOptions = {\n\t\theaders: {\n\t\t\tAuthorization: `Basic ${encodedApiKey}`,\n\t\t},\n\t\tmethod,\n\t\tbody,\n\t\tqs,\n\t\turi: `https://${domain}.freshservice.com/api/v2${endpoint}`,\n\t\tjson: true,\n\t};\n\n\tif (!Object.keys(body).length) {\n\t\tdelete options.body;\n\t}\n\n\tif (!Object.keys(qs).length) {\n\t\tdelete options.qs;\n\t}\n\n\ttry {\n\t\treturn await this.helpers.request(options);\n\t} catch (error) {\n\t\tif (error.error.description === 'Validation failed') {\n\t\t\tconst numberOfErrors = error.error.errors.length;\n\t\t\tconst message = 'Please check your parameters';\n\n\t\t\tif (numberOfErrors === 1) {\n\t\t\t\tconst [validationError] = error.error.errors;\n\t\t\t\tthrow new NodeApiError(this.getNode(), error as JsonObject, {\n\t\t\t\t\tmessage,\n\t\t\t\t\tdescription: `For ${validationError.field}: ${validationError.message}`,\n\t\t\t\t});\n\t\t\t} else if (numberOfErrors > 1) {\n\t\t\t\tthrow new NodeApiError(this.getNode(), error as JsonObject, {\n\t\t\t\t\tmessage,\n\t\t\t\t\tdescription: \"For more information, expand 'details' below and look at 'cause' section\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tthrow new NodeApiError(this.getNode(), error as JsonObject);\n\t}\n}\n\nexport async function freshserviceApiRequestAllItems(\n\tthis: IExecuteFunctions | IHookFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tbody: IDataObject = {},\n\tqs: IDataObject = {},\n) {\n\tconst returnData: IDataObject[] = [];\n\tqs.page = 1;\n\tlet items;\n\n\tdo {\n\t\tconst responseData = await freshserviceApiRequest.call(this, method, endpoint, body, qs);\n\t\tconst key = Object.keys(responseData as IDataObject)[0];\n\t\titems = responseData[key];\n\t\tif (!items.length) return returnData;\n\t\treturnData.push(...(items as IDataObject[]));\n\t\tqs.page++;\n\t} while (items.length >= 30);\n\n\treturn returnData;\n}\n\nexport async function handleListing(\n\tthis: IExecuteFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tbody: IDataObject = {},\n\tqs: IDataObject = {},\n) {\n\tconst returnAll = this.getNodeParameter('returnAll', 0);\n\n\tif (returnAll) {\n\t\treturn await freshserviceApiRequestAllItems.call(this, method, endpoint, body, qs);\n\t}\n\n\tconst responseData = await freshserviceApiRequestAllItems.call(this, method, endpoint, body, qs);\n\tconst limit = this.getNodeParameter('limit', 0);\n\n\treturn responseData.slice(0, limit);\n}\n\nexport const toOptions = (loadedResources: LoadedResource[]) => {\n\treturn loadedResources\n\t\t.map(({ id, name }) => ({ value: id, name }))\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n};\n\nexport const toUserOptions = (loadedUsers: LoadedUser[]) => {\n\treturn loadedUsers\n\t\t.map(({ id, last_name, first_name }) => {\n\t\t\treturn {\n\t\t\t\tvalue: id,\n\t\t\t\tname: last_name ? `${last_name}, ${first_name}` : `${first_name}`,\n\t\t\t};\n\t\t})\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n};\n\n/**\n * Ensure at least one role has been specified.\n */\nexport function validateAssignmentScopeGroup(this: IExecuteFunctions, roles: RolesParameter) {\n\tif (!roles.roleProperties?.length) {\n\t\tthrow new NodeOperationError(this.getNode(), 'Please specify a role for the agent to create.');\n\t}\n}\n\nexport function sanitizeAssignmentScopeGroup(this: IExecuteFunctions, roles: RolesParameter) {\n\troles.roleProperties.forEach((roleProperty) => {\n\t\tif (roleProperty.assignment_scope === 'specified_groups' && !roleProperty?.groups?.length) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Please specify a group for every role of the agent to create.',\n\t\t\t);\n\t\t}\n\n\t\t// remove the `groups` param, only needed for scopes other than `specified_groups`\n\t\tif (roleProperty.assignment_scope !== 'specified_groups' && roleProperty.groups) {\n\t\t\tdelete roleProperty.groups;\n\t\t}\n\t});\n}\n\n/**\n * Adjust a roles fixed collection into the format expected by Freshservice API.\n */\nexport function adjustAgentRoles(roles: RolesParameter) {\n\treturn {\n\t\troles: roles.roleProperties.map(({ role, assignment_scope, groups }) => {\n\t\t\treturn {\n\t\t\t\trole_id: role,\n\t\t\t\tassignment_scope,\n\t\t\t\tgroups,\n\t\t\t};\n\t\t}),\n\t};\n}\n\nexport function formatFilters(filters: IDataObject) {\n\tconst query = Object.keys(filters)\n\t\t.map((key) => {\n\t\t\tconst value = filters[key];\n\n\t\t\tif (!isNaN(Number(value))) {\n\t\t\t\treturn `${key}:${filters[key]}`; // number\n\t\t\t}\n\n\t\t\tif (typeof value === 'string' && value.endsWith('Z')) {\n\t\t\t\treturn `${key}:'${value.split('T')[0]}'`; // date\n\t\t\t}\n\n\t\t\treturn `${key}:'${filters[key]}'`; // string\n\t\t})\n\t\t.join(' AND ');\n\n\treturn {\n\t\tquery: `\"${query}\"`,\n\t};\n}\n\nexport function validateUpdateFields(\n\tthis: IExecuteFunctions,\n\tupdateFields: IDataObject,\n\tresource: string,\n) {\n\tif (!Object.keys(updateFields).length) {\n\t\tconst twoWordResources: { [key: string]: string } = {\n\t\t\tagentGroup: 'agent group',\n\t\t\tagentRole: 'agent role',\n\t\t\tassetType: 'asset type',\n\t\t\trequesterGroup: 'requester group',\n\t\t};\n\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t`Please enter at least one field to update for the ${\n\t\t\t\ttwoWordResources[resource] ?? resource\n\t\t\t}.`,\n\t\t);\n\t}\n}\n\nexport const toArray = (str: string) => str.split(',').map((e) => e.trim());\n\nexport function adjustAddress(fixedCollection: IDataObject & AddressFixedCollection) {\n\tif (!fixedCollection.address) return fixedCollection;\n\n\tconst adjusted = omit(fixedCollection, ['address']);\n\tadjusted.address = fixedCollection.address.addressFields;\n\n\treturn adjusted;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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C,UAAM,mBAA8C;AAAA,MACnD,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,gBAAgB;AAAA,IACjB;AAEA,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,qDACC,iBAAiB,QAAQ,KAAK,QAC/B;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,UAAU,CAAC,QAAgB,IAAI,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAEnE,SAAS,cAAc,iBAAuD;AACpF,MAAI,CAAC,gBAAgB,QAAS,QAAO;AAErC,QAAM,eAAW,YAAAA,SAAK,iBAAiB,CAAC,SAAS,CAAC;AAClD,WAAS,UAAU,gBAAgB,QAAQ;AAE3C,SAAO;AACR;","names":["omit"]}
@@ -7,21 +7,33 @@
7
7
  "amountMicros": {
8
8
  "type": "string"
9
9
  },
10
+ "averageCpm": {
11
+ "type": "number"
12
+ },
10
13
  "costMicros": {
11
14
  "type": "string"
12
15
  },
16
+ "ctr": {
17
+ "type": "number"
18
+ },
13
19
  "id": {
14
20
  "type": "string"
15
21
  },
16
22
  "impressions": {
17
23
  "type": "string"
18
24
  },
25
+ "interactionRate": {
26
+ "type": "number"
27
+ },
19
28
  "interactions": {
20
29
  "type": "string"
21
30
  },
22
31
  "name": {
23
32
  "type": "string"
24
33
  },
34
+ "optimizationScore": {
35
+ "type": "number"
36
+ },
25
37
  "period": {
26
38
  "type": "string"
27
39
  },
@@ -35,5 +47,5 @@
35
47
  "type": "string"
36
48
  }
37
49
  },
38
- "version": 1
50
+ "version": 2
39
51
  }
@@ -3,10 +3,7 @@
3
3
  "properties": {
4
4
  "date": {
5
5
  "type": "string"
6
- },
7
- "sessions": {
8
- "type": "string"
9
6
  }
10
7
  },
11
- "version": 2
8
+ "version": 3
12
9
  }
@@ -47,9 +47,6 @@
47
47
  "organizer": {
48
48
  "type": "object",
49
49
  "properties": {
50
- "displayName": {
51
- "type": "string"
52
- },
53
50
  "email": {
54
51
  "type": "string"
55
52
  },
@@ -90,5 +87,5 @@
90
87
  "type": "string"
91
88
  }
92
89
  },
93
- "version": 3
90
+ "version": 4
94
91
  }
@@ -16,6 +16,9 @@
16
16
  "sender": {
17
17
  "type": "object",
18
18
  "properties": {
19
+ "displayName": {
20
+ "type": "string"
21
+ },
19
22
  "name": {
20
23
  "type": "string"
21
24
  },
@@ -27,8 +30,34 @@
27
30
  "space": {
28
31
  "type": "object",
29
32
  "properties": {
33
+ "lastActiveTime": {
34
+ "type": "string"
35
+ },
36
+ "membershipCount": {
37
+ "type": "object",
38
+ "properties": {
39
+ "joinedDirectHumanUserCount": {
40
+ "type": "integer"
41
+ }
42
+ }
43
+ },
30
44
  "name": {
31
45
  "type": "string"
46
+ },
47
+ "spaceHistoryState": {
48
+ "type": "string"
49
+ },
50
+ "spaceThreadingState": {
51
+ "type": "string"
52
+ },
53
+ "spaceType": {
54
+ "type": "string"
55
+ },
56
+ "spaceUri": {
57
+ "type": "string"
58
+ },
59
+ "type": {
60
+ "type": "string"
32
61
  }
33
62
  }
34
63
  },
@@ -44,5 +73,5 @@
44
73
  }
45
74
  }
46
75
  },
47
- "version": 1
76
+ "version": 2
48
77
  }
@@ -290,6 +290,9 @@
290
290
  "starred": {
291
291
  "type": "boolean"
292
292
  },
293
+ "thumbnailLink": {
294
+ "type": "string"
295
+ },
293
296
  "thumbnailVersion": {
294
297
  "type": "string"
295
298
  },
@@ -315,5 +318,5 @@
315
318
  "type": "boolean"
316
319
  }
317
320
  },
318
- "version": 1
321
+ "version": 2
319
322
  }
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
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
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var helpers_exports = {};
20
30
  __export(helpers_exports, {
@@ -23,7 +33,7 @@ __export(helpers_exports, {
23
33
  driveNode: () => driveNode
24
34
  });
25
35
  module.exports = __toCommonJS(helpers_exports);
26
- var import_lodash = require("lodash");
36
+ var import_get = __toESM(require("lodash/get"));
27
37
  var import_n8n_core = require("n8n-core");
28
38
  var import_stream = require("stream");
29
39
  const driveNode = {
@@ -38,7 +48,7 @@ const createMockExecuteFunction = (nodeParameters, node, continueOnFail = false)
38
48
  const fakeExecuteFunction = {
39
49
  getNodeParameter(parameterName, _itemIndex, fallbackValue, options) {
40
50
  const parameter = options?.extractValue ? `${parameterName}.value` : parameterName;
41
- return (0, import_lodash.get)(nodeParameters, parameter, fallbackValue);
51
+ return (0, import_get.default)(nodeParameters, parameter, fallbackValue);
42
52
  },
43
53
  getNode() {
44
54
  return node;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../nodes/Google/Drive/test/v2/node/helpers.ts"],"sourcesContent":["import { get } from 'lodash';\nimport { constructExecutionMetaData } from 'n8n-core';\nimport type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';\nimport { Readable } from 'stream';\n\nexport const driveNode: INode = {\n\tid: '11',\n\tname: 'Google Drive node',\n\ttypeVersion: 3,\n\ttype: 'n8n-nodes-base.googleDrive',\n\tposition: [42, 42],\n\tparameters: {},\n};\n\nexport const createMockExecuteFunction = (\n\tnodeParameters: IDataObject,\n\tnode: INode,\n\tcontinueOnFail = false,\n) => {\n\tconst fakeExecuteFunction = {\n\t\tgetNodeParameter(\n\t\t\tparameterName: string,\n\t\t\t_itemIndex: number,\n\t\t\tfallbackValue?: IDataObject | undefined,\n\t\t\toptions?: IGetNodeParameterOptions | undefined,\n\t\t) {\n\t\t\tconst parameter = options?.extractValue ? `${parameterName}.value` : parameterName;\n\t\t\treturn get(nodeParameters, parameter, fallbackValue);\n\t\t},\n\t\tgetNode() {\n\t\t\treturn node;\n\t\t},\n\t\thelpers: {\n\t\t\tconstructExecutionMetaData,\n\t\t\treturnJsonArray: () => [],\n\t\t\tprepareBinaryData: () => {},\n\t\t\thttpRequest: () => {},\n\t\t},\n\t\tcontinueOnFail: () => continueOnFail,\n\t} as unknown as IExecuteFunctions;\n\treturn fakeExecuteFunction;\n};\n\nexport function createTestStream(byteSize: number) {\n\tlet bytesSent = 0;\n\tconst CHUNK_SIZE = 64 * 1024; // 64kB chunks (default NodeJS highWaterMark)\n\n\treturn new Readable({\n\t\tread() {\n\t\t\tconst remainingBytes = byteSize - bytesSent;\n\n\t\t\tif (remainingBytes <= 0) {\n\t\t\t\tthis.push(null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst chunkSize = Math.min(CHUNK_SIZE, remainingBytes);\n\t\t\tconst chunk = Buffer.alloc(chunkSize, 'A'); // Test data just a string of \"A\"\n\n\t\t\tbytesSent += chunkSize;\n\t\t\tthis.push(chunk);\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoB;AACpB,sBAA2C;AAE3C,oBAAyB;AAElB,MAAM,YAAmB;AAAA,EAC/B,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU,CAAC,IAAI,EAAE;AAAA,EACjB,YAAY,CAAC;AACd;AAEO,MAAM,4BAA4B,CACxC,gBACA,MACA,iBAAiB,UACb;AACJ,QAAM,sBAAsB;AAAA,IAC3B,iBACC,eACA,YACA,eACA,SACC;AACD,YAAM,YAAY,SAAS,eAAe,GAAG,aAAa,WAAW;AACrE,iBAAO,mBAAI,gBAAgB,WAAW,aAAa;AAAA,IACpD;AAAA,IACA,UAAU;AACT,aAAO;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACR;AAAA,MACA,iBAAiB,MAAM,CAAC;AAAA,MACxB,mBAAmB,MAAM;AAAA,MAAC;AAAA,MAC1B,aAAa,MAAM;AAAA,MAAC;AAAA,IACrB;AAAA,IACA,gBAAgB,MAAM;AAAA,EACvB;AACA,SAAO;AACR;AAEO,SAAS,iBAAiB,UAAkB;AAClD,MAAI,YAAY;AAChB,QAAM,aAAa,KAAK;AAExB,SAAO,IAAI,uBAAS;AAAA,IACnB,OAAO;AACN,YAAM,iBAAiB,WAAW;AAElC,UAAI,kBAAkB,GAAG;AACxB,aAAK,KAAK,IAAI;AACd;AAAA,MACD;AAEA,YAAM,YAAY,KAAK,IAAI,YAAY,cAAc;AACrD,YAAM,QAAQ,OAAO,MAAM,WAAW,GAAG;AAEzC,mBAAa;AACb,WAAK,KAAK,KAAK;AAAA,IAChB;AAAA,EACD,CAAC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../../../../nodes/Google/Drive/test/v2/node/helpers.ts"],"sourcesContent":["import get from 'lodash/get';\nimport { constructExecutionMetaData } from 'n8n-core';\nimport type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';\nimport { Readable } from 'stream';\n\nexport const driveNode: INode = {\n\tid: '11',\n\tname: 'Google Drive node',\n\ttypeVersion: 3,\n\ttype: 'n8n-nodes-base.googleDrive',\n\tposition: [42, 42],\n\tparameters: {},\n};\n\nexport const createMockExecuteFunction = (\n\tnodeParameters: IDataObject,\n\tnode: INode,\n\tcontinueOnFail = false,\n) => {\n\tconst fakeExecuteFunction = {\n\t\tgetNodeParameter(\n\t\t\tparameterName: string,\n\t\t\t_itemIndex: number,\n\t\t\tfallbackValue?: IDataObject | undefined,\n\t\t\toptions?: IGetNodeParameterOptions | undefined,\n\t\t) {\n\t\t\tconst parameter = options?.extractValue ? `${parameterName}.value` : parameterName;\n\t\t\treturn get(nodeParameters, parameter, fallbackValue);\n\t\t},\n\t\tgetNode() {\n\t\t\treturn node;\n\t\t},\n\t\thelpers: {\n\t\t\tconstructExecutionMetaData,\n\t\t\treturnJsonArray: () => [],\n\t\t\tprepareBinaryData: () => {},\n\t\t\thttpRequest: () => {},\n\t\t},\n\t\tcontinueOnFail: () => continueOnFail,\n\t} as unknown as IExecuteFunctions;\n\treturn fakeExecuteFunction;\n};\n\nexport function createTestStream(byteSize: number) {\n\tlet bytesSent = 0;\n\tconst CHUNK_SIZE = 64 * 1024; // 64kB chunks (default NodeJS highWaterMark)\n\n\treturn new Readable({\n\t\tread() {\n\t\t\tconst remainingBytes = byteSize - bytesSent;\n\n\t\t\tif (remainingBytes <= 0) {\n\t\t\t\tthis.push(null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst chunkSize = Math.min(CHUNK_SIZE, remainingBytes);\n\t\t\tconst chunk = Buffer.alloc(chunkSize, 'A'); // Test data just a string of \"A\"\n\n\t\t\tbytesSent += chunkSize;\n\t\t\tthis.push(chunk);\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAChB,sBAA2C;AAE3C,oBAAyB;AAElB,MAAM,YAAmB;AAAA,EAC/B,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU,CAAC,IAAI,EAAE;AAAA,EACjB,YAAY,CAAC;AACd;AAEO,MAAM,4BAA4B,CACxC,gBACA,MACA,iBAAiB,UACb;AACJ,QAAM,sBAAsB;AAAA,IAC3B,iBACC,eACA,YACA,eACA,SACC;AACD,YAAM,YAAY,SAAS,eAAe,GAAG,aAAa,WAAW;AACrE,iBAAO,WAAAA,SAAI,gBAAgB,WAAW,aAAa;AAAA,IACpD;AAAA,IACA,UAAU;AACT,aAAO;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACR;AAAA,MACA,iBAAiB,MAAM,CAAC;AAAA,MACxB,mBAAmB,MAAM;AAAA,MAAC;AAAA,MAC1B,aAAa,MAAM;AAAA,MAAC;AAAA,IACrB;AAAA,IACA,gBAAgB,MAAM;AAAA,EACvB;AACA,SAAO;AACR;AAEO,SAAS,iBAAiB,UAAkB;AAClD,MAAI,YAAY;AAChB,QAAM,aAAa,KAAK;AAExB,SAAO,IAAI,uBAAS;AAAA,IACnB,OAAO;AACN,YAAM,iBAAiB,WAAW;AAElC,UAAI,kBAAkB,GAAG;AACxB,aAAK,KAAK,IAAI;AACd;AAAA,MACD;AAEA,YAAM,YAAY,KAAK,IAAI,YAAY,cAAc;AACrD,YAAM,QAAQ,OAAO,MAAM,WAAW,GAAG;AAEzC,mBAAa;AACb,WAAK,KAAK,KAAK;AAAA,IAChB;AAAA,EACD,CAAC;AACF;","names":["get"]}
@@ -12,13 +12,7 @@
12
12
  },
13
13
  "_updateTime": {
14
14
  "type": "string"
15
- },
16
- "chat_id": {
17
- "type": "string"
18
- },
19
- "lastInteraction": {
20
- "type": "string"
21
15
  }
22
16
  },
23
- "version": 2
17
+ "version": 3
24
18
  }
@@ -1,18 +1,30 @@
1
1
  {
2
2
  "type": "object",
3
3
  "properties": {
4
+ "historyId": {
5
+ "type": "string"
6
+ },
4
7
  "id": {
5
8
  "type": "string"
6
9
  },
10
+ "internalDate": {
11
+ "type": "string"
12
+ },
7
13
  "labelIds": {
8
14
  "type": "array",
9
15
  "items": {
10
16
  "type": "string"
11
17
  }
12
18
  },
19
+ "sizeEstimate": {
20
+ "type": "integer"
21
+ },
22
+ "snippet": {
23
+ "type": "string"
24
+ },
13
25
  "threadId": {
14
26
  "type": "string"
15
27
  }
16
28
  },
17
- "version": 2
29
+ "version": 3
18
30
  }
@@ -80,12 +80,6 @@
80
80
  "to": {
81
81
  "type": "string"
82
82
  },
83
- "x-gm-message-state": {
84
- "type": "string"
85
- },
86
- "x-google-dkim-signature": {
87
- "type": "string"
88
- },
89
83
  "x-google-smtp-source": {
90
84
  "type": "string"
91
85
  },
@@ -147,5 +141,5 @@
147
141
  }
148
142
  }
149
143
  },
150
- "version": 3
144
+ "version": 4
151
145
  }
@@ -1,18 +1,30 @@
1
1
  {
2
2
  "type": "object",
3
3
  "properties": {
4
+ "historyId": {
5
+ "type": "string"
6
+ },
4
7
  "id": {
5
8
  "type": "string"
6
9
  },
10
+ "internalDate": {
11
+ "type": "string"
12
+ },
7
13
  "labelIds": {
8
14
  "type": "array",
9
15
  "items": {
10
16
  "type": "string"
11
17
  }
12
18
  },
19
+ "sizeEstimate": {
20
+ "type": "integer"
21
+ },
22
+ "snippet": {
23
+ "type": "string"
24
+ },
13
25
  "threadId": {
14
26
  "type": "string"
15
27
  }
16
28
  },
17
- "version": 1
29
+ "version": 2
18
30
  }