n8n-nodes-base 1.92.0 → 1.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/credentials/AirtopApi.credentials.js +2 -1
  2. package/dist/credentials/AirtopApi.credentials.js.map +1 -1
  3. package/dist/credentials/JinaAiApi.credentials.js +1 -1
  4. package/dist/credentials/JinaAiApi.credentials.js.map +1 -1
  5. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +0 -9
  6. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
  7. package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js +13 -0
  8. package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js.map +1 -1
  9. package/dist/credentials/Snowflake.credentials.js +46 -2
  10. package/dist/credentials/Snowflake.credentials.js.map +1 -1
  11. package/dist/known/credentials.json +10 -1
  12. package/dist/known/nodes.json +20 -4
  13. package/dist/methods/defined.json +6 -0
  14. package/dist/methods/referenced.json +3 -0
  15. package/dist/nodes/Airtop/Airtop.node.js +14 -8
  16. package/dist/nodes/Airtop/Airtop.node.js.map +1 -1
  17. package/dist/nodes/Airtop/GenericFunctions.js +87 -15
  18. package/dist/nodes/Airtop/GenericFunctions.js.map +1 -1
  19. package/dist/nodes/Airtop/actions/common/fields.js +9 -0
  20. package/dist/nodes/Airtop/actions/common/fields.js.map +1 -1
  21. package/dist/nodes/Airtop/actions/common/output.utils.js +79 -0
  22. package/dist/nodes/Airtop/actions/common/output.utils.js.map +1 -0
  23. package/dist/nodes/Airtop/actions/common/session.utils.js +2 -2
  24. package/dist/nodes/Airtop/actions/common/session.utils.js.map +1 -1
  25. package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js +13 -4
  26. package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js.map +1 -1
  27. package/dist/nodes/Airtop/actions/extraction/query.operation.js +21 -3
  28. package/dist/nodes/Airtop/actions/extraction/query.operation.js.map +1 -1
  29. package/dist/nodes/Airtop/actions/extraction/scrape.operation.js +2 -1
  30. package/dist/nodes/Airtop/actions/extraction/scrape.operation.js.map +1 -1
  31. package/dist/nodes/Airtop/actions/file/File.resource.js +104 -0
  32. package/dist/nodes/Airtop/actions/file/File.resource.js.map +1 -0
  33. package/dist/nodes/Airtop/actions/file/delete.operation.js +60 -0
  34. package/dist/nodes/Airtop/actions/file/delete.operation.js.map +1 -0
  35. package/dist/nodes/Airtop/actions/file/get.operation.js +91 -0
  36. package/dist/nodes/Airtop/actions/file/get.operation.js.map +1 -0
  37. package/dist/nodes/Airtop/actions/file/getMany.operation.js +100 -0
  38. package/dist/nodes/Airtop/actions/file/getMany.operation.js.map +1 -0
  39. package/dist/nodes/Airtop/actions/file/helpers.js +199 -0
  40. package/dist/nodes/Airtop/actions/file/helpers.js.map +1 -0
  41. package/dist/nodes/Airtop/actions/file/load.operation.js +85 -0
  42. package/dist/nodes/Airtop/actions/file/load.operation.js.map +1 -0
  43. package/dist/nodes/Airtop/actions/file/upload.operation.js +186 -0
  44. package/dist/nodes/Airtop/actions/file/upload.operation.js.map +1 -0
  45. package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js +22 -1
  46. package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js.map +1 -1
  47. package/dist/nodes/Airtop/actions/interaction/fill.operation.js +89 -0
  48. package/dist/nodes/Airtop/actions/interaction/fill.operation.js.map +1 -0
  49. package/dist/nodes/Airtop/actions/interaction/scroll.operation.js +219 -0
  50. package/dist/nodes/Airtop/actions/interaction/scroll.operation.js.map +1 -0
  51. package/dist/nodes/Airtop/actions/node.type.js.map +1 -1
  52. package/dist/nodes/Airtop/actions/router.js +13 -4
  53. package/dist/nodes/Airtop/actions/router.js.map +1 -1
  54. package/dist/nodes/Airtop/actions/session/create.operation.js +85 -32
  55. package/dist/nodes/Airtop/actions/session/create.operation.js.map +1 -1
  56. package/dist/nodes/Airtop/actions/window/Window.resource.js +2 -1
  57. package/dist/nodes/Airtop/actions/window/Window.resource.js.map +1 -1
  58. package/dist/nodes/Airtop/actions/window/create.operation.js +1 -1
  59. package/dist/nodes/Airtop/actions/window/create.operation.js.map +1 -1
  60. package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js +26 -3
  61. package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js.map +1 -1
  62. package/dist/nodes/Airtop/constants.js +38 -5
  63. package/dist/nodes/Airtop/constants.js.map +1 -1
  64. package/dist/nodes/Airtop/countries.js +1026 -0
  65. package/dist/nodes/Airtop/countries.js.map +1 -0
  66. package/dist/nodes/Airtop/transport/index.js +6 -3
  67. package/dist/nodes/Airtop/transport/index.js.map +1 -1
  68. package/dist/nodes/Airtop/transport/types.js.map +1 -1
  69. package/dist/nodes/Aws/IAM/AwsIam.node.js +95 -0
  70. package/dist/nodes/Aws/IAM/AwsIam.node.js.map +1 -0
  71. package/dist/nodes/Aws/IAM/AwsIam.node.json +18 -0
  72. package/dist/nodes/Aws/IAM/AwsIam.svg +18 -0
  73. package/dist/nodes/Aws/IAM/descriptions/common.js +188 -0
  74. package/dist/nodes/Aws/IAM/descriptions/common.js.map +1 -0
  75. package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js +175 -0
  76. package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js.map +1 -0
  77. package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js +66 -0
  78. package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js.map +1 -0
  79. package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js +43 -0
  80. package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js.map +1 -0
  81. package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js +50 -0
  82. package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js.map +1 -0
  83. package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js +47 -0
  84. package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js.map +1 -0
  85. package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js +70 -0
  86. package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js.map +1 -0
  87. package/dist/nodes/Aws/IAM/descriptions/index.js +42 -0
  88. package/dist/nodes/Aws/IAM/descriptions/index.js.map +1 -0
  89. package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js +231 -0
  90. package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js.map +1 -0
  91. package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js +47 -0
  92. package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js.map +1 -0
  93. package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js +118 -0
  94. package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js.map +1 -0
  95. package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js +43 -0
  96. package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js.map +1 -0
  97. package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js +43 -0
  98. package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js.map +1 -0
  99. package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js +66 -0
  100. package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js.map +1 -0
  101. package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js +74 -0
  102. package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js.map +1 -0
  103. package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js +68 -0
  104. package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js.map +1 -0
  105. package/dist/nodes/Aws/IAM/helpers/constants.js +47 -0
  106. package/dist/nodes/Aws/IAM/helpers/constants.js.map +1 -0
  107. package/dist/nodes/Aws/IAM/helpers/errorHandler.js +90 -0
  108. package/dist/nodes/Aws/IAM/helpers/errorHandler.js.map +1 -0
  109. package/dist/nodes/Aws/IAM/helpers/types.js +17 -0
  110. package/dist/nodes/Aws/IAM/helpers/types.js.map +1 -0
  111. package/dist/nodes/Aws/IAM/helpers/utils.js +279 -0
  112. package/dist/nodes/Aws/IAM/helpers/utils.js.map +1 -0
  113. package/dist/nodes/Aws/IAM/methods/index.js +39 -0
  114. package/dist/nodes/Aws/IAM/methods/index.js.map +1 -0
  115. package/dist/nodes/Aws/IAM/methods/listSearch.js +132 -0
  116. package/dist/nodes/Aws/IAM/methods/listSearch.js.map +1 -0
  117. package/dist/nodes/Aws/IAM/transport/index.js +64 -0
  118. package/dist/nodes/Aws/IAM/transport/index.js.map +1 -0
  119. package/dist/nodes/Cron/Cron.node.js +1 -1
  120. package/dist/nodes/Cron/Cron.node.js.map +1 -1
  121. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +2 -2
  122. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
  123. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +2 -2
  124. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
  125. package/dist/nodes/Evaluation/Evaluation/Description.node.js +146 -0
  126. package/dist/nodes/Evaluation/Evaluation/Description.node.js.map +1 -0
  127. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js +117 -0
  128. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js.map +1 -0
  129. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +187 -0
  130. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -0
  131. package/dist/nodes/Evaluation/methods/index.js +42 -0
  132. package/dist/nodes/Evaluation/methods/index.js.map +1 -0
  133. package/dist/nodes/Evaluation/methods/loadOptions.js +40 -0
  134. package/dist/nodes/Evaluation/methods/loadOptions.js.map +1 -0
  135. package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js +119 -0
  136. package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js.map +1 -0
  137. package/dist/nodes/Evaluation/utils/evaluationUtils.js +171 -0
  138. package/dist/nodes/Evaluation/utils/evaluationUtils.js.map +1 -0
  139. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +4 -3
  140. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
  141. package/dist/nodes/Form/common.descriptions.js +2 -2
  142. package/dist/nodes/Form/common.descriptions.js.map +1 -1
  143. package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js +4 -1
  144. package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js.map +1 -1
  145. package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js +1 -2
  146. package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js.map +1 -1
  147. package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +113 -107
  148. package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -1
  149. package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js +52 -106
  150. package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js.map +1 -1
  151. package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js +97 -0
  152. package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js.map +1 -0
  153. package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js +20 -17
  154. package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js.map +1 -1
  155. package/dist/nodes/Google/YouTube/YouTube.node.js +4 -2
  156. package/dist/nodes/Google/YouTube/YouTube.node.js.map +1 -1
  157. package/dist/nodes/HttpRequest/GenericFunctions.js +1 -1
  158. package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
  159. package/dist/nodes/Interval/Interval.node.js +1 -1
  160. package/dist/nodes/Interval/Interval.node.js.map +1 -1
  161. package/dist/nodes/Jira/Jira.node.js +34 -15
  162. package/dist/nodes/Jira/Jira.node.js.map +1 -1
  163. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +2 -2
  164. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
  165. package/dist/nodes/MQTT/MqttTrigger.node.js +2 -2
  166. package/dist/nodes/MQTT/MqttTrigger.node.js.map +1 -1
  167. package/dist/nodes/ManualTrigger/ManualTrigger.node.js +1 -1
  168. package/dist/nodes/ManualTrigger/ManualTrigger.node.js.map +1 -1
  169. package/dist/nodes/Merge/Merge.node.js +3 -2
  170. package/dist/nodes/Merge/Merge.node.js.map +1 -1
  171. package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +42 -4
  172. package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
  173. package/dist/nodes/Merge/v3/actions/versionDescription.js +1 -1
  174. package/dist/nodes/Merge/v3/actions/versionDescription.js.map +1 -1
  175. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js +93 -0
  176. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js.map +1 -0
  177. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json +18 -0
  178. package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js +190 -0
  179. package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js.map +1 -0
  180. package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js +108 -0
  181. package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js.map +1 -0
  182. package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js +62 -0
  183. package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js.map +1 -0
  184. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js +129 -0
  185. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js.map +1 -0
  186. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js +77 -0
  187. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js.map +1 -0
  188. package/dist/nodes/Microsoft/SharePoint/descriptions/index.js +45 -0
  189. package/dist/nodes/Microsoft/SharePoint/descriptions/index.js.map +1 -0
  190. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js +175 -0
  191. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js.map +1 -0
  192. package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js +100 -0
  193. package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js.map +1 -0
  194. package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js +62 -0
  195. package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js.map +1 -0
  196. package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js +83 -0
  197. package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js.map +1 -0
  198. package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js +203 -0
  199. package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js.map +1 -0
  200. package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js +100 -0
  201. package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js.map +1 -0
  202. package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js +100 -0
  203. package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js.map +1 -0
  204. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js +99 -0
  205. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js.map +1 -0
  206. package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js +65 -0
  207. package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js.map +1 -0
  208. package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js +105 -0
  209. package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js.map +1 -0
  210. package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js +17 -0
  211. package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js.map +1 -0
  212. package/dist/nodes/Microsoft/SharePoint/helpers/utils.js +252 -0
  213. package/dist/nodes/Microsoft/SharePoint/helpers/utils.js.map +1 -0
  214. package/dist/nodes/Microsoft/SharePoint/methods/index.js +42 -0
  215. package/dist/nodes/Microsoft/SharePoint/methods/index.js.map +1 -0
  216. package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js +222 -0
  217. package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js.map +1 -0
  218. package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js +104 -0
  219. package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js.map +1 -0
  220. package/dist/nodes/Microsoft/SharePoint/test/credentials.js +54 -0
  221. package/dist/nodes/Microsoft/SharePoint/test/credentials.js.map +1 -0
  222. package/dist/nodes/Microsoft/SharePoint/transport/index.js +46 -0
  223. package/dist/nodes/Microsoft/SharePoint/transport/index.js.map +1 -0
  224. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js +387 -0
  225. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js.map +1 -0
  226. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.json +18 -0
  227. package/dist/nodes/Microsoft/Teams/v2/helpers/types.js +17 -0
  228. package/dist/nodes/Microsoft/Teams/v2/helpers/types.js.map +1 -0
  229. package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js +147 -0
  230. package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js.map +1 -0
  231. package/dist/nodes/Microsoft/Teams/v2/transport/index.js.map +1 -1
  232. package/dist/nodes/MongoDb/GenericFunctions.js +9 -2
  233. package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
  234. package/dist/nodes/MongoDb/MongoDb.node.js +25 -5
  235. package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
  236. package/dist/nodes/PostBin/BinDescription.js +1 -1
  237. package/dist/nodes/PostBin/BinDescription.js.map +1 -1
  238. package/dist/nodes/PostBin/GenericFunctions.js +5 -5
  239. package/dist/nodes/PostBin/GenericFunctions.js.map +1 -1
  240. package/dist/nodes/PostBin/PostBin.node.js +1 -1
  241. package/dist/nodes/PostBin/PostBin.node.js.map +1 -1
  242. package/dist/nodes/PostBin/RequestDescription.js +2 -2
  243. package/dist/nodes/PostBin/RequestDescription.js.map +1 -1
  244. package/dist/nodes/Postgres/PostgresTrigger.node.js +2 -2
  245. package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
  246. package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js +2 -2
  247. package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js.map +1 -1
  248. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +8 -3
  249. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
  250. package/dist/nodes/RespondToWebhook/utils.js +43 -0
  251. package/dist/nodes/RespondToWebhook/utils.js.map +1 -0
  252. package/dist/nodes/Schedule/ScheduleTrigger.node.js +1 -1
  253. package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
  254. package/dist/nodes/Snowflake/GenericFunctions.js +34 -2
  255. package/dist/nodes/Snowflake/GenericFunctions.js.map +1 -1
  256. package/dist/nodes/Snowflake/Snowflake.node.js +5 -7
  257. package/dist/nodes/Snowflake/Snowflake.node.js.map +1 -1
  258. package/dist/nodes/SseTrigger/SseTrigger.node.js +2 -2
  259. package/dist/nodes/SseTrigger/SseTrigger.node.js.map +1 -1
  260. package/dist/nodes/Telegram/Telegram.node.js +5 -1
  261. package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
  262. package/dist/nodes/Transform/Summarize/utils.js +2 -1
  263. package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
  264. package/dist/test/setup.js +1 -0
  265. package/dist/test/setup.js.map +1 -1
  266. package/dist/types/credentials.json +7 -7
  267. package/dist/types/nodes.json +27 -23
  268. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +12 -2
  269. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
  270. package/package.json +15 -12
  271. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js +0 -119
  272. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js.map +0 -1
  273. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.json +0 -14
  274. /package/dist/{credentials/icons/SharePoint.svg → nodes/Microsoft/SharePoint/microsoftSharePoint.svg} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.ts"],"sourcesContent":["import _ from 'lodash';\nimport {\n\ttype INodeExecutionData,\n\tNodeConnectionTypes,\n\ttype IExecuteFunctions,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n} from 'n8n-workflow';\n\nimport {\n\tINPUT_SOURCE,\n\tWORKFLOW_INPUTS,\n\tJSON_EXAMPLE,\n\tVALUES,\n\tTYPE_OPTIONS,\n\tPASSTHROUGH,\n\tFALLBACK_DEFAULT_VALUE,\n} from '../../../utils/workflowInputsResourceMapping/constants';\nimport { getFieldEntries } from '../../../utils/workflowInputsResourceMapping/GenericFunctions';\n\nexport class ExecuteWorkflowTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Execute Workflow Trigger',\n\t\tname: 'executeWorkflowTrigger',\n\t\ticon: 'fa:sign-out-alt',\n\t\tgroup: ['trigger'],\n\t\tversion: [1, 1.1],\n\t\tdescription:\n\t\t\t'Helpers for calling other n8n workflows. Used for designing modular, microservice-like workflows.',\n\t\teventTriggerDescription: '',\n\t\tmaxNodes: 1,\n\t\tdefaults: {\n\t\t\tname: 'When Executed by Another Workflow',\n\t\t\tcolor: '#ff6d5a',\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\thints: [\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"This workflow isn't set to accept any input data. Fill out the workflow input schema or change the workflow to accept any data passed to it.\",\n\t\t\t\t// This condition checks if we have no input fields, which gets a bit awkward:\n\t\t\t\t// For WORKFLOW_INPUTS: keys() only contains `VALUES` if at least one value is provided\n\t\t\t\t// For JSON_EXAMPLE: We remove all whitespace and check if we're left with an empty object. Note that we already error if the example is not valid JSON\n\t\t\t\tdisplayCondition:\n\t\t\t\t\t`={{$parameter['${INPUT_SOURCE}'] === '${WORKFLOW_INPUTS}' && !$parameter['${WORKFLOW_INPUTS}'].keys().length ` +\n\t\t\t\t\t`|| $parameter['${INPUT_SOURCE}'] === '${JSON_EXAMPLE}' && $parameter['${JSON_EXAMPLE}'].toString().replaceAll(' ', '').replaceAll('\\\\n', '') === '{}' }}`,\n\t\t\t\twhenToDisplay: 'always',\n\t\t\t\tlocation: 'ndv',\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Events',\n\t\t\t\tname: 'events',\n\t\t\t\ttype: 'hidden',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Workflow Call',\n\t\t\t\t\t\tvalue: 'worklfow_call',\n\t\t\t\t\t\tdescription: 'When executed by another workflow using Execute Workflow Trigger',\n\t\t\t\t\t\taction: 'When executed by Another Workflow',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'worklfow_call',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t\"When an ‘execute workflow’ node calls this workflow, the execution starts here. Any data passed into the 'execute workflow' node will be output by this node.\",\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { eq: 1 } }] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'This node is out of date. Please upgrade by removing it and adding a new one',\n\t\t\t\tname: 'outdatedVersionWarning',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { eq: 1 } }] } },\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\tdisplayName: 'Input data mode',\n\t\t\t\tname: INPUT_SOURCE,\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\t\tname: 'Define using fields below',\n\t\t\t\t\t\tvalue: WORKFLOW_INPUTS,\n\t\t\t\t\t\tdescription: 'Provide input fields via UI',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\t\tname: 'Define using JSON example',\n\t\t\t\t\t\tvalue: JSON_EXAMPLE,\n\t\t\t\t\t\tdescription: 'Generate a schema from an example JSON object',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\t\tname: 'Accept all data',\n\t\t\t\t\t\tvalue: PASSTHROUGH,\n\t\t\t\t\t\tdescription: 'Use all incoming data from the parent workflow',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: WORKFLOW_INPUTS,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Provide an example object to infer fields and their types.<br>To allow any type for a given field, set the value to null.',\n\t\t\t\tname: `${JSON_EXAMPLE}_notice`,\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: [JSON_EXAMPLE] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'JSON Example',\n\t\t\t\tname: JSON_EXAMPLE,\n\t\t\t\ttype: 'json',\n\t\t\t\tdefault: JSON.stringify(\n\t\t\t\t\t{\n\t\t\t\t\t\taField: 'a string',\n\t\t\t\t\t\taNumber: 123,\n\t\t\t\t\t\tthisFieldAcceptsAnyType: null,\n\t\t\t\t\t\tanArray: [],\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t),\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: [JSON_EXAMPLE] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow Input Schema',\n\t\t\t\tname: WORKFLOW_INPUTS,\n\t\t\t\tplaceholder: 'Add field',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdescription:\n\t\t\t\t\t'Define expected input fields. If no inputs are provided, all data from the calling workflow will be passed through.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t\tminRequiredFields: 1,\n\t\t\t\t},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: [WORKFLOW_INPUTS] },\n\t\t\t\t},\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: VALUES,\n\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. fieldName',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'A unique name for this workflow input, used to reference it from another workflows',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Expected data type for this input value. Determines how this field's values are stored, validated, and displayed.\",\n\t\t\t\t\t\t\t\toptions: TYPE_OPTIONS,\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdefault: 'string',\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions) {\n\t\tconst inputData = this.getInputData();\n\t\tconst inputSource = this.getNodeParameter(INPUT_SOURCE, 0, PASSTHROUGH) as string;\n\n\t\t// Note on the data we receive from ExecuteWorkflow caller:\n\t\t//\n\t\t// The ExecuteWorkflow node typechecks all fields explicitly provided by the user here via the resourceMapper\n\t\t// and removes all fields that are in the schema, but `removed` in the resourceMapper.\n\t\t//\n\t\t// In passthrough and legacy node versions, inputData will line up since the resourceMapper is empty,\n\t\t// in which case all input is passed through.\n\t\t// In other cases we will already have matching types and fields provided by the resource mapper,\n\t\t// so we just need to be permissive on this end,\n\t\t// while ensuring we provide default values for fields in our schema, which are removed in the resourceMapper.\n\n\t\tif (inputSource === PASSTHROUGH) {\n\t\t\treturn [inputData];\n\t\t} else {\n\t\t\tconst newParams = getFieldEntries(this);\n\t\t\tconst newKeys = new Set(newParams.fields.map((x) => x.name));\n\t\t\tconst itemsInSchema: INodeExecutionData[] = inputData.map((row, index) => ({\n\t\t\t\tjson: {\n\t\t\t\t\t...Object.fromEntries(newParams.fields.map((x) => [x.name, FALLBACK_DEFAULT_VALUE])),\n\t\t\t\t\t// Need to trim to the expected schema to support legacy Execute Workflow callers passing through all their data\n\t\t\t\t\t// which we do not want to expose past this node.\n\t\t\t\t\t..._.pickBy(row.json, (_value, key) => newKeys.has(key)),\n\t\t\t\t},\n\t\t\t\tindex,\n\t\t\t}));\n\n\t\t\treturn [itemsInSchema];\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAc;AACd,0BAMO;AAEP,uBAQO;AACP,8BAAgC;AAEzB,MAAM,uBAA4C;AAAA,EAAlD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS,CAAC,GAAG,GAAG;AAAA,MAChB,aACC;AAAA,MACD,yBAAyB;AAAA,MACzB,UAAU;AAAA,MACV,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,OAAO;AAAA,QACN;AAAA,UACC,SACC;AAAA;AAAA;AAAA;AAAA,UAID,kBACC,kBAAkB,6BAAY,WAAW,gCAAe,qBAAqB,gCAAe,mCAC1E,6BAAY,WAAW,6BAAY,oBAAoB,6BAAY;AAAA,UACtF,eAAe;AAAA,UACf,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,kBAAkB;AAAA,UAClB,SAAS;AAAA,YACR;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,cACP,aAAa;AAAA,cACb,QAAQ;AAAA,YACT;AAAA,UACD;AAAA,UACA,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,U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AC,SAAS;AAAA,IAClB,OAAO;AACN,YAAM,gBAAY,yCAAgB,IAAI;AACtC,YAAM,UAAU,IAAI,IAAI,UAAU,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;AAC3D,YAAM,gBAAsC,UAAU,IAAI,CAAC,KAAK,WAAW;AAAA,QAC1E,MAAM;AAAA,UACL,GAAG,OAAO,YAAY,UAAU,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,uCAAsB,CAAC,CAAC;AAAA;AAAA;AAAA,UAGnF,GAAG,cAAAA,QAAE,OAAO,IAAI,MAAM,CAAC,QAAQ,QAAQ,QAAQ,IAAI,GAAG,CAAC;AAAA,QACxD;AAAA,QACA;AAAA,MACD,EAAE;AAEF,aAAO,CAAC,aAAa;AAAA,IACtB;AAAA,EACD;AACD;","names":["_"]}
1
+ {"version":3,"sources":["../../../../nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.ts"],"sourcesContent":["import _ from 'lodash';\nimport {\n\ttype INodeExecutionData,\n\tNodeConnectionTypes,\n\ttype IExecuteFunctions,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n} from 'n8n-workflow';\n\nimport {\n\tINPUT_SOURCE,\n\tWORKFLOW_INPUTS,\n\tJSON_EXAMPLE,\n\tVALUES,\n\tTYPE_OPTIONS,\n\tPASSTHROUGH,\n\tFALLBACK_DEFAULT_VALUE,\n} from '../../../utils/workflowInputsResourceMapping/constants';\nimport { getFieldEntries } from '../../../utils/workflowInputsResourceMapping/GenericFunctions';\n\nexport class ExecuteWorkflowTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Execute Workflow Trigger',\n\t\tname: 'executeWorkflowTrigger',\n\t\ticon: 'fa:sign-out-alt',\n\t\tgroup: ['trigger'],\n\t\tversion: [1, 1.1],\n\t\tdescription:\n\t\t\t'Helpers for calling other n8n workflows. Used for designing modular, microservice-like workflows.',\n\t\teventTriggerDescription: '',\n\t\tmaxNodes: 1,\n\t\tdefaults: {\n\t\t\tname: 'When Executed by Another Workflow',\n\t\t\tcolor: '#ff6d5a',\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\thints: [\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"This workflow isn't set to accept any input data. Fill out the workflow input schema or change the workflow to accept any data passed to it.\",\n\t\t\t\t// This condition checks if we have no input fields, which gets a bit awkward:\n\t\t\t\t// For WORKFLOW_INPUTS: keys() only contains `VALUES` if at least one value is provided\n\t\t\t\t// For JSON_EXAMPLE: We remove all whitespace and check if we're left with an empty object. Note that we already error if the example is not valid JSON\n\t\t\t\tdisplayCondition:\n\t\t\t\t\t`={{$parameter['${INPUT_SOURCE}'] === '${WORKFLOW_INPUTS}' && !$parameter['${WORKFLOW_INPUTS}'].keys().length ` +\n\t\t\t\t\t`|| $parameter['${INPUT_SOURCE}'] === '${JSON_EXAMPLE}' && $parameter['${JSON_EXAMPLE}'].toString().replaceAll(' ', '').replaceAll('\\\\n', '') === '{}' }}`,\n\t\t\t\twhenToDisplay: 'always',\n\t\t\t\tlocation: 'ndv',\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Events',\n\t\t\t\tname: 'events',\n\t\t\t\ttype: 'hidden',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Workflow Call',\n\t\t\t\t\t\tvalue: 'worklfow_call',\n\t\t\t\t\t\tdescription: 'When executed by another workflow using Execute Workflow Trigger',\n\t\t\t\t\t\taction: 'When executed by Another Workflow',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'worklfow_call',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t\"When an ‘execute workflow’ node calls this workflow, the execution starts here. Any data passed into the 'execute workflow' node will be output by this node.\",\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { eq: 1 } }] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'This node is out of date. Please upgrade by removing it and adding a new one',\n\t\t\t\tname: 'outdatedVersionWarning',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { eq: 1 } }] } },\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\tdisplayName: 'Input data mode',\n\t\t\t\tname: INPUT_SOURCE,\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\t\tname: 'Define using fields below',\n\t\t\t\t\t\tvalue: WORKFLOW_INPUTS,\n\t\t\t\t\t\tdescription: 'Provide input fields via UI',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\t\tname: 'Define using JSON example',\n\t\t\t\t\t\tvalue: JSON_EXAMPLE,\n\t\t\t\t\t\tdescription: 'Generate a schema from an example JSON object',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\t\tname: 'Accept all data',\n\t\t\t\t\t\tvalue: PASSTHROUGH,\n\t\t\t\t\t\tdescription: 'Use all incoming data from the parent workflow',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: WORKFLOW_INPUTS,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Provide an example object to infer fields and their types.<br>To allow any type for a given field, set the value to null.',\n\t\t\t\tname: `${JSON_EXAMPLE}_notice`,\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: [JSON_EXAMPLE] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'JSON Example',\n\t\t\t\tname: JSON_EXAMPLE,\n\t\t\t\ttype: 'json',\n\t\t\t\tdefault: JSON.stringify(\n\t\t\t\t\t{\n\t\t\t\t\t\taField: 'a string',\n\t\t\t\t\t\taNumber: 123,\n\t\t\t\t\t\tthisFieldAcceptsAnyType: null,\n\t\t\t\t\t\tanArray: [],\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2,\n\t\t\t\t),\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: [JSON_EXAMPLE] },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow Input Schema',\n\t\t\t\tname: WORKFLOW_INPUTS,\n\t\t\t\tplaceholder: 'Add field',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdescription:\n\t\t\t\t\t'Define expected input fields. If no inputs are provided, all data from the calling workflow will be passed through.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t\tminRequiredFields: 1,\n\t\t\t\t},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: [WORKFLOW_INPUTS] },\n\t\t\t\t},\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: VALUES,\n\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. fieldName',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'A unique name for this workflow input, used to reference it from another workflows',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Expected data type for this input value. Determines how this field's values are stored, validated, and displayed.\",\n\t\t\t\t\t\t\t\toptions: TYPE_OPTIONS,\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdefault: 'string',\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions) {\n\t\tconst inputData = this.getInputData();\n\t\tconst inputSource = this.getNodeParameter(INPUT_SOURCE, 0, PASSTHROUGH) as string;\n\n\t\t// Note on the data we receive from ExecuteWorkflow caller:\n\t\t//\n\t\t// The ExecuteWorkflow node typechecks all fields explicitly provided by the user here via the resourceMapper\n\t\t// and removes all fields that are in the schema, but `removed` in the resourceMapper.\n\t\t//\n\t\t// In passthrough and legacy node versions, inputData will line up since the resourceMapper is empty,\n\t\t// in which case all input is passed through.\n\t\t// In other cases we will already have matching types and fields provided by the resource mapper,\n\t\t// so we just need to be permissive on this end,\n\t\t// while ensuring we provide default values for fields in our schema, which are removed in the resourceMapper.\n\n\t\tif (inputSource === PASSTHROUGH) {\n\t\t\treturn [inputData];\n\t\t} else {\n\t\t\tconst newParams = getFieldEntries(this);\n\t\t\tconst newKeys = new Set(newParams.fields.map((x) => x.name));\n\t\t\tconst itemsInSchema: INodeExecutionData[] = inputData.map(({ json, binary }, index) => ({\n\t\t\t\tjson: {\n\t\t\t\t\t...Object.fromEntries(newParams.fields.map((x) => [x.name, FALLBACK_DEFAULT_VALUE])),\n\t\t\t\t\t// Need to trim to the expected schema to support legacy Execute Workflow callers passing through all their data\n\t\t\t\t\t// which we do not want to expose past this node.\n\t\t\t\t\t..._.pickBy(json, (_value, key) => newKeys.has(key)),\n\t\t\t\t},\n\t\t\t\tindex,\n\t\t\t\tbinary,\n\t\t\t}));\n\n\t\t\treturn [itemsInSchema];\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAc;AACd,0BAMO;AAEP,uBAQO;AACP,8BAAgC;AAEzB,MAAM,uBAA4C;AAAA,EAAlD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS,CAAC,GAAG,GAAG;AAAA,MAChB,aACC;AAAA,MACD,yBAAyB;AAAA,MACzB,UAAU;AAAA,MACV,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,OAAO;AAAA,QACN;AAAA,UACC,SACC;AAAA;AAAA;AAAA;AAAA,UAID,kBACC,kBAAkB,6BAAY,WAAW,gCAAe,qBAAqB,gCAAe,mCAC1E,6BAAY,WAAW,6BAAY,oBAAoB,6BAAY;AAAA,UACtF,eAAe;AAAA,UACf,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,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BACT,UAAU;AAAA,kBACV,SAAS;AAAA,kBACT,kBAAkB;AAAA,gBACnB;AAAA,cACD;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,UAAiC;AACtC,UAAM,YAAY,KAAK,aAAa;AACpC,UAAM,cAAc,KAAK,iBAAiB,+BAAc,GAAG,4BAAW;AAatE,QAAI,gBAAgB,8BAAa;AAChC,aAAO,CAAC,SAAS;AAAA,IAClB,OAAO;AACN,YAAM,gBAAY,yCAAgB,IAAI;AACtC,YAAM,UAAU,IAAI,IAAI,UAAU,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;AAC3D,YAAM,gBAAsC,UAAU,IAAI,CAAC,EAAE,MAAM,OAAO,GAAG,WAAW;AAAA,QACvF,MAAM;AAAA,UACL,GAAG,OAAO,YAAY,UAAU,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,uCAAsB,CAAC,CAAC;AAAA;AAAA;AAAA,UAGnF,GAAG,cAAAA,QAAE,OAAO,MAAM,CAAC,QAAQ,QAAQ,QAAQ,IAAI,GAAG,CAAC;AAAA,QACpD;AAAA,QACA;AAAA,QACA;AAAA,MACD,EAAE;AAEF,aAAO,CAAC,aAAa;AAAA,IACtB;AAAA,EACD;AACD;","names":["_"]}
@@ -333,8 +333,8 @@ const formRespondMode = {
333
333
  const formTriggerPanel = {
334
334
  header: "Pull in a test form submission",
335
335
  executionsHelp: {
336
- inactive: `Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Test step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key="activate">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.`,
337
- active: `Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Test step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key="activate">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.`
336
+ inactive: `Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Execute step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key="activate">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.`,
337
+ active: `Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Execute step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key="activate">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.`
338
338
  },
339
339
  activationHint: {
340
340
  active: "This node will also trigger automatically on new form submissions (but those executions won't show up here).",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/Form/common.descriptions.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport { appendAttributionOption } from '../../utils/descriptions';\n\nexport const placeholder: string = `\n<!-- Your custom HTML here --->\n\n\n`.trimStart();\n\nexport const webhookPath: INodeProperties = {\n\tdisplayName: 'Form Path',\n\tname: 'path',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'webhook',\n\trequired: true,\n\tdescription: \"The final segment of the form's URL, both for test and production\",\n};\n\nexport const formTitle: INodeProperties = {\n\tdisplayName: 'Form Title',\n\tname: 'formTitle',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'e.g. Contact us',\n\trequired: true,\n\tdescription: 'Shown at the top of the form',\n};\n\nexport const formDescription: INodeProperties = {\n\tdisplayName: 'Form Description',\n\tname: 'formDescription',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: \"e.g. We'll get back to you soon\",\n\tdescription:\n\t\t'Shown underneath the Form Title. Can be used to prompt the user on how to complete the form. Accepts HTML.',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n};\n\nexport const formFields: INodeProperties = {\n\tdisplayName: 'Form Elements',\n\tname: 'formFields',\n\tplaceholder: 'Add Form Element',\n\ttype: 'fixedCollection',\n\tdefault: {},\n\ttypeOptions: {\n\t\tmultipleValues: true,\n\t\tsortable: true,\n\t},\n\toptions: [\n\t\t{\n\t\t\tdisplayName: 'Values',\n\t\t\tname: 'values',\n\t\t\tvalues: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Field Name',\n\t\t\t\t\tname: 'fieldLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tplaceholder: 'e.g. What is your name?',\n\t\t\t\t\tdescription: 'Label that appears above the input field',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tfieldType: ['hiddenField', 'html'],\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: 'Element Type',\n\t\t\t\t\tname: 'fieldType',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tdefault: 'text',\n\t\t\t\t\tdescription: 'The type of field to add to the form',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Custom HTML',\n\t\t\t\t\t\t\tvalue: 'html',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Date',\n\t\t\t\t\t\t\tvalue: 'date',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Dropdown List',\n\t\t\t\t\t\t\tvalue: 'dropdown',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Email',\n\t\t\t\t\t\t\tvalue: 'email',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'File',\n\t\t\t\t\t\t\tvalue: 'file',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Hidden Field',\n\t\t\t\t\t\t\tvalue: 'hiddenField',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Number',\n\t\t\t\t\t\t\tvalue: 'number',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Password',\n\t\t\t\t\t\t\tvalue: 'password',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Textarea',\n\t\t\t\t\t\t\tvalue: 'textarea',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Element Name',\n\t\t\t\t\tname: 'elementName',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tplaceholder: 'e.g. content-section',\n\t\t\t\t\tdescription: 'Optional field. It can be used to include the html in the output.',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['html'],\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: 'Placeholder',\n\t\t\t\t\tname: 'placeholder',\n\t\t\t\t\tdescription: 'Sample text to display inside the field',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tfieldType: ['dropdown', 'date', 'file', 'html', 'hiddenField'],\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: 'Field Name',\n\t\t\t\t\tname: 'fieldName',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The name of the field, used in input attributes and referenced by the workflow',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['hiddenField'],\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: 'Field Value',\n\t\t\t\t\tname: 'fieldValue',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Input value can be set here or will be passed as a query parameter via Field Name if no value is set',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['hiddenField'],\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: 'Field Options',\n\t\t\t\t\tname: 'fieldOptions',\n\t\t\t\t\tplaceholder: 'Add Field Option',\n\t\t\t\t\tdescription: 'List of options that can be selected from the dropdown',\n\t\t\t\t\ttype: 'fixedCollection',\n\t\t\t\t\tdefault: { values: [{ option: '' }] },\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['dropdown'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\t\tsortable: true,\n\t\t\t\t\t},\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tdisplayName: 'Option',\n\t\t\t\t\t\t\t\t\tname: 'option',\n\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Multiple Choice',\n\t\t\t\t\tname: 'multiselect',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Whether to allow the user to select multiple options from the dropdown list',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['dropdown'],\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: 'HTML',\n\t\t\t\t\tname: 'html',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\teditor: 'htmlEditor',\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdefault: placeholder,\n\t\t\t\t\tdescription: 'HTML elements to display on the form page',\n\t\t\t\t\thint: 'Does not accept <code>&lt;script&gt;</code>, <code>&lt;style&gt;</code> or <code>&lt;input&gt;</code> tags',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['html'],\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: 'Multiple Files',\n\t\t\t\t\tname: 'multipleFiles',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Whether to allow the user to select multiple files from the file input or just one',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['file'],\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: 'Accepted File Types',\n\t\t\t\t\tname: 'acceptFileTypes',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdescription: 'Comma-separated list of allowed file extensions',\n\t\t\t\t\thint: 'Leave empty to allow all file types',\n\t\t\t\t\tplaceholder: 'e.g. .jpg, .png',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['file'],\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: \"The displayed date is formatted based on the locale of the user's browser\",\n\t\t\t\t\tname: 'formatDate',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['date'],\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: 'Required Field',\n\t\t\t\t\tname: 'requiredField',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Whether to require the user to enter a value for this field before submitting the form',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tfieldType: ['html', 'hiddenField'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport const formRespondMode: INodeProperties = {\n\tdisplayName: 'Respond When',\n\tname: 'responseMode',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Form Is Submitted',\n\t\t\tvalue: 'onReceived',\n\t\t\tdescription: 'As soon as this node receives the form submission',\n\t\t},\n\t\t{\n\t\t\tname: 'Workflow Finishes',\n\t\t\tvalue: 'lastNode',\n\t\t\tdescription: 'When the last node of the workflow is executed',\n\t\t},\n\t\t{\n\t\t\tname: \"Using 'Respond to Webhook' Node\",\n\t\t\tvalue: 'responseNode',\n\t\t\tdescription: \"When the 'Respond to Webhook' node is executed\",\n\t\t},\n\t],\n\tdefault: 'onReceived',\n\tdescription: 'When to respond to the form submission',\n};\n\nexport const formTriggerPanel = {\n\theader: 'Pull in a test form submission',\n\texecutionsHelp: {\n\t\tinactive:\n\t\t\t\"Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Test step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key=\\\"activate\\\">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.\",\n\t\tactive:\n\t\t\t\"Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Test step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key=\\\"activate\\\">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.\",\n\t},\n\tactivationHint: {\n\t\tactive:\n\t\t\t\"This node will also trigger automatically on new form submissions (but those executions won't show up here).\",\n\t\tinactive:\n\t\t\t'<a data-key=\"activate\">Activate</a> this workflow to have it also run automatically for new form submissions created via the Production URL.',\n\t},\n};\n\nexport const respondWithOptions: INodeProperties = {\n\tdisplayName: 'Form Response',\n\tname: 'respondWithOptions',\n\ttype: 'fixedCollection',\n\tplaceholder: 'Add option',\n\tdefault: { values: { respondWith: 'text' } },\n\toptions: [\n\t\t{\n\t\t\tdisplayName: 'Values',\n\t\t\tname: 'values',\n\t\t\tvalues: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Respond With',\n\t\t\t\t\tname: 'respondWith',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tdefault: 'text',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Form Submitted Text',\n\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\tdescription: 'Show a response text to the user',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Redirect URL',\n\t\t\t\t\t\t\tvalue: 'redirect',\n\t\t\t\t\t\t\tdescription: 'Redirect the user to a URL',\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: 'Text to Show',\n\t\t\t\t\tname: 'formSubmittedText',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The text displayed to users after they fill the form. Leave it empty if don't want to show any additional text.\",\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Your response has been recorded',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\trespondWith: ['text'],\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// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\tdisplayName: 'URL to Redirect to',\n\t\t\t\t\tname: 'redirectUrl',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The URL to redirect users to after they fill the form. Must be a valid URL.',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tvalidateType: 'url',\n\t\t\t\t\tplaceholder: 'e.g. http://www.n8n.io',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\trespondWith: ['redirect'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport const appendAttributionToForm: INodeProperties = {\n\t...appendAttributionOption,\n\tdescription: 'Whether to include the link “Form automated with n8n” at the bottom of the form',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAwC;AAEjC,MAAM,cAAsB;AAAA;AAAA;AAAA;AAAA,EAIjC,UAAU;AAEL,MAAM,cAA+B;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AACd;AAEO,MAAM,YAA6B;AAAA,EACzC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AACd;AAEO,MAAM,kBAAmC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aACC;AAAA,EACD,aAAa;AAAA,IACZ,MAAM;AAAA,EACP;AACD;AAEO,MAAM,aAA8B;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS,CAAC;AAAA,EACV,aAAa;AAAA,IACZ,gBAAgB;AAAA,IAChB,UAAU;AAAA,EACX;AAAA,EACA,SAAS;AAAA,IACR;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,UACb,aAAa;AAAA,UACb,UAAU;AAAA,UACV,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,WAAW,CAAC,eAAe,MAAM;AAAA,YAClC;AAAA,UACD;AAAA,QACD;AAAA,QACA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sources":["../../../nodes/Form/common.descriptions.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport { appendAttributionOption } from '../../utils/descriptions';\n\nexport const placeholder: string = `\n<!-- Your custom HTML here --->\n\n\n`.trimStart();\n\nexport const webhookPath: INodeProperties = {\n\tdisplayName: 'Form Path',\n\tname: 'path',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'webhook',\n\trequired: true,\n\tdescription: \"The final segment of the form's URL, both for test and production\",\n};\n\nexport const formTitle: INodeProperties = {\n\tdisplayName: 'Form Title',\n\tname: 'formTitle',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'e.g. Contact us',\n\trequired: true,\n\tdescription: 'Shown at the top of the form',\n};\n\nexport const formDescription: INodeProperties = {\n\tdisplayName: 'Form Description',\n\tname: 'formDescription',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: \"e.g. We'll get back to you soon\",\n\tdescription:\n\t\t'Shown underneath the Form Title. Can be used to prompt the user on how to complete the form. Accepts HTML.',\n\ttypeOptions: {\n\t\trows: 2,\n\t},\n};\n\nexport const formFields: INodeProperties = {\n\tdisplayName: 'Form Elements',\n\tname: 'formFields',\n\tplaceholder: 'Add Form Element',\n\ttype: 'fixedCollection',\n\tdefault: {},\n\ttypeOptions: {\n\t\tmultipleValues: true,\n\t\tsortable: true,\n\t},\n\toptions: [\n\t\t{\n\t\t\tdisplayName: 'Values',\n\t\t\tname: 'values',\n\t\t\tvalues: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Field Name',\n\t\t\t\t\tname: 'fieldLabel',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tplaceholder: 'e.g. What is your name?',\n\t\t\t\t\tdescription: 'Label that appears above the input field',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tfieldType: ['hiddenField', 'html'],\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: 'Element Type',\n\t\t\t\t\tname: 'fieldType',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tdefault: 'text',\n\t\t\t\t\tdescription: 'The type of field to add to the form',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Custom HTML',\n\t\t\t\t\t\t\tvalue: 'html',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Date',\n\t\t\t\t\t\t\tvalue: 'date',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Dropdown List',\n\t\t\t\t\t\t\tvalue: 'dropdown',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Email',\n\t\t\t\t\t\t\tvalue: 'email',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'File',\n\t\t\t\t\t\t\tvalue: 'file',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Hidden Field',\n\t\t\t\t\t\t\tvalue: 'hiddenField',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Number',\n\t\t\t\t\t\t\tvalue: 'number',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Password',\n\t\t\t\t\t\t\tvalue: 'password',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Textarea',\n\t\t\t\t\t\t\tvalue: 'textarea',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Element Name',\n\t\t\t\t\tname: 'elementName',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tplaceholder: 'e.g. content-section',\n\t\t\t\t\tdescription: 'Optional field. It can be used to include the html in the output.',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['html'],\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: 'Placeholder',\n\t\t\t\t\tname: 'placeholder',\n\t\t\t\t\tdescription: 'Sample text to display inside the field',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tfieldType: ['dropdown', 'date', 'file', 'html', 'hiddenField'],\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: 'Field Name',\n\t\t\t\t\tname: 'fieldName',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The name of the field, used in input attributes and referenced by the workflow',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['hiddenField'],\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: 'Field Value',\n\t\t\t\t\tname: 'fieldValue',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Input value can be set here or will be passed as a query parameter via Field Name if no value is set',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['hiddenField'],\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: 'Field Options',\n\t\t\t\t\tname: 'fieldOptions',\n\t\t\t\t\tplaceholder: 'Add Field Option',\n\t\t\t\t\tdescription: 'List of options that can be selected from the dropdown',\n\t\t\t\t\ttype: 'fixedCollection',\n\t\t\t\t\tdefault: { values: [{ option: '' }] },\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['dropdown'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\t\tsortable: true,\n\t\t\t\t\t},\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tdisplayName: 'Option',\n\t\t\t\t\t\t\t\t\tname: 'option',\n\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Multiple Choice',\n\t\t\t\t\tname: 'multiselect',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Whether to allow the user to select multiple options from the dropdown list',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['dropdown'],\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: 'HTML',\n\t\t\t\t\tname: 'html',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\teditor: 'htmlEditor',\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdefault: placeholder,\n\t\t\t\t\tdescription: 'HTML elements to display on the form page',\n\t\t\t\t\thint: 'Does not accept <code>&lt;script&gt;</code>, <code>&lt;style&gt;</code> or <code>&lt;input&gt;</code> tags',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['html'],\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: 'Multiple Files',\n\t\t\t\t\tname: 'multipleFiles',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Whether to allow the user to select multiple files from the file input or just one',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['file'],\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: 'Accepted File Types',\n\t\t\t\t\tname: 'acceptFileTypes',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdescription: 'Comma-separated list of allowed file extensions',\n\t\t\t\t\thint: 'Leave empty to allow all file types',\n\t\t\t\t\tplaceholder: 'e.g. .jpg, .png',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['file'],\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: \"The displayed date is formatted based on the locale of the user's browser\",\n\t\t\t\t\tname: 'formatDate',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tfieldType: ['date'],\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: 'Required Field',\n\t\t\t\t\tname: 'requiredField',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Whether to require the user to enter a value for this field before submitting the form',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tfieldType: ['html', 'hiddenField'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport const formRespondMode: INodeProperties = {\n\tdisplayName: 'Respond When',\n\tname: 'responseMode',\n\ttype: 'options',\n\toptions: [\n\t\t{\n\t\t\tname: 'Form Is Submitted',\n\t\t\tvalue: 'onReceived',\n\t\t\tdescription: 'As soon as this node receives the form submission',\n\t\t},\n\t\t{\n\t\t\tname: 'Workflow Finishes',\n\t\t\tvalue: 'lastNode',\n\t\t\tdescription: 'When the last node of the workflow is executed',\n\t\t},\n\t\t{\n\t\t\tname: \"Using 'Respond to Webhook' Node\",\n\t\t\tvalue: 'responseNode',\n\t\t\tdescription: \"When the 'Respond to Webhook' node is executed\",\n\t\t},\n\t],\n\tdefault: 'onReceived',\n\tdescription: 'When to respond to the form submission',\n};\n\nexport const formTriggerPanel = {\n\theader: 'Pull in a test form submission',\n\texecutionsHelp: {\n\t\tinactive:\n\t\t\t\"Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Execute step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key=\\\"activate\\\">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.\",\n\t\tactive:\n\t\t\t\"Form Trigger has two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the 'Execute step' button, then fill out the test form that opens in a popup tab. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key=\\\"activate\\\">Activate</a> the workflow, then make requests to the production URL. Then every time there's a form submission via the Production Form URL, the workflow will execute. These executions will show up in the executions list, but not in the editor.\",\n\t},\n\tactivationHint: {\n\t\tactive:\n\t\t\t\"This node will also trigger automatically on new form submissions (but those executions won't show up here).\",\n\t\tinactive:\n\t\t\t'<a data-key=\"activate\">Activate</a> this workflow to have it also run automatically for new form submissions created via the Production URL.',\n\t},\n};\n\nexport const respondWithOptions: INodeProperties = {\n\tdisplayName: 'Form Response',\n\tname: 'respondWithOptions',\n\ttype: 'fixedCollection',\n\tplaceholder: 'Add option',\n\tdefault: { values: { respondWith: 'text' } },\n\toptions: [\n\t\t{\n\t\t\tdisplayName: 'Values',\n\t\t\tname: 'values',\n\t\t\tvalues: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Respond With',\n\t\t\t\t\tname: 'respondWith',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tdefault: 'text',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Form Submitted Text',\n\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\tdescription: 'Show a response text to the user',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Redirect URL',\n\t\t\t\t\t\t\tvalue: 'redirect',\n\t\t\t\t\t\t\tdescription: 'Redirect the user to a URL',\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: 'Text to Show',\n\t\t\t\t\tname: 'formSubmittedText',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The text displayed to users after they fill the form. Leave it empty if don't want to show any additional text.\",\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'Your response has been recorded',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\trespondWith: ['text'],\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// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\tdisplayName: 'URL to Redirect to',\n\t\t\t\t\tname: 'redirectUrl',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The URL to redirect users to after they fill the form. Must be a valid URL.',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tvalidateType: 'url',\n\t\t\t\t\tplaceholder: 'e.g. http://www.n8n.io',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\trespondWith: ['redirect'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport const appendAttributionToForm: INodeProperties = {\n\t...appendAttributionOption,\n\tdescription: 'Whether to include the link “Form automated with n8n” at the bottom of the form',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAwC;AAEjC,MAAM,cAAsB;AAAA;AAAA;AAAA;AAAA,EAIjC,UAAU;AAEL,MAAM,cAA+B;AAAA,EAC3C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AACd;AAEO,MAAM,YAA6B;AAAA,EACzC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AACd;AAEO,MAAM,kBAAmC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aACC;AAAA,EACD,aAAa;AAAA,IACZ,MAAM;AAA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,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,aAAa,CAAC,MAAM;AAAA,YACrB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA;AAAA,UAEC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,MAAM;AAAA,UACN,SAAS;AAAA,UACT,cAAc;AAAA,UACd,aAAa;AAAA,UACb,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,aAAa,CAAC,UAAU;AAAA,YACzB;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,0BAA2C;AAAA,EACvD,GAAG;AAAA,EACH,aAAa;AACd;","names":[]}
@@ -123,7 +123,10 @@ async function execute(i) {
123
123
  { uploadType: "resumable" },
124
124
  void 0,
125
125
  {
126
- returnFullResponse: true
126
+ returnFullResponse: true,
127
+ headers: {
128
+ "X-Upload-Content-Type": mimeType
129
+ }
127
130
  }
128
131
  );
129
132
  const uploadUrl = resumableUpload.headers.location;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../nodes/Google/Drive/v2/actions/file/upload.operation.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport { updateDisplayOptions } from '@utils/utilities';\n\nimport {\n\tgetItemBinaryData,\n\tsetFileProperties,\n\tsetUpdateCommonParams,\n\tsetParentFolder,\n\tprocessInChunks,\n} from '../../helpers/utils';\nimport { googleApiRequest } from '../../transport';\nimport { driveRLC, folderRLC, updateCommonOptions } from '../common.descriptions';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Input Data Field Name',\n\t\tname: 'inputDataFieldName',\n\t\ttype: 'string',\n\t\tplaceholder: '“e.g. data',\n\t\tdefault: 'data',\n\t\trequired: true,\n\t\thint: 'The name of the input field containing the binary file data to update the file',\n\t\tdescription:\n\t\t\t'Find the name of input field containing the binary data to update the file in the Input panel on the left, in the Binary tab',\n\t},\n\t{\n\t\tdisplayName: 'File Name',\n\t\tname: 'name',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. My New File',\n\t\tdescription: 'If not specified, the original file name will be used',\n\t},\n\t{\n\t\t...driveRLC,\n\t\tdisplayName: 'Parent Drive',\n\t\tdescription: 'The drive where to upload the file',\n\t},\n\t{\n\t\t...folderRLC,\n\t\tdisplayName: 'Parent Folder',\n\t\tdescription: 'The folder where to upload the file',\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t...updateCommonOptions,\n\t\t\t{\n\t\t\t\tdisplayName: 'Simplify Output',\n\t\t\t\tname: 'simplifyOutput',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription: 'Whether to return a simplified version of the response instead of all fields',\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['upload'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst returnData: INodeExecutionData[] = [];\n\n\tconst inputDataFieldName = this.getNodeParameter('inputDataFieldName', i) as string;\n\n\tconst { contentLength, fileContent, originalFilename, mimeType } = await getItemBinaryData.call(\n\t\tthis,\n\t\tinputDataFieldName,\n\t\ti,\n\t);\n\n\tconst name = (this.getNodeParameter('name', i) as string) || originalFilename;\n\n\tconst driveId = this.getNodeParameter('driveId', i, undefined, {\n\t\textractValue: true,\n\t}) as string;\n\n\tconst folderId = this.getNodeParameter('folderId', i, undefined, {\n\t\textractValue: true,\n\t}) as string;\n\n\tlet uploadId;\n\tif (Buffer.isBuffer(fileContent)) {\n\t\tconst response = await googleApiRequest.call(\n\t\t\tthis,\n\t\t\t'POST',\n\t\t\t'/upload/drive/v3/files',\n\t\t\tfileContent,\n\t\t\t{\n\t\t\t\tuploadType: 'media',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': mimeType,\n\t\t\t\t\t'Content-Length': contentLength,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\n\t\tuploadId = response.id;\n\t} else {\n\t\tconst resumableUpload = await googleApiRequest.call(\n\t\t\tthis,\n\t\t\t'POST',\n\t\t\t'/upload/drive/v3/files',\n\t\t\tundefined,\n\t\t\t{ uploadType: 'resumable' },\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\treturnFullResponse: true,\n\t\t\t},\n\t\t);\n\n\t\tconst uploadUrl = resumableUpload.headers.location;\n\n\t\t// 2MB chunks, needs to be a multiple of 256kB for Google Drive API\n\t\tconst chunkSizeBytes = 2048 * 1024;\n\n\t\tawait processInChunks(fileContent, chunkSizeBytes, async (chunk, offset) => {\n\t\t\ttry {\n\t\t\t\tconst response = await this.helpers.httpRequest({\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl: uploadUrl,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Length': chunk.length,\n\t\t\t\t\t\t'Content-Range': `bytes ${offset}-${offset + chunk.byteLength - 1}/${contentLength}`,\n\t\t\t\t\t},\n\t\t\t\t\tbody: chunk,\n\t\t\t\t});\n\t\t\t\tuploadId = response?.id;\n\t\t\t} catch (error) {\n\t\t\t\tif (error.response?.status !== 308) throw error;\n\t\t\t}\n\t\t});\n\t}\n\n\tconst options = this.getNodeParameter('options', i, {});\n\n\tconst qs = setUpdateCommonParams(\n\t\t{\n\t\t\taddParents: setParentFolder(folderId, driveId),\n\t\t\tincludeItemsFromAllDrives: true,\n\t\t\tsupportsAllDrives: true,\n\t\t\tspaces: 'appDataFolder, drive',\n\t\t\tcorpora: 'allDrives',\n\t\t},\n\t\toptions,\n\t);\n\n\tif (!options.simplifyOutput) {\n\t\tqs.fields = '*';\n\t}\n\n\tconst body = setFileProperties(\n\t\t{\n\t\t\tmimeType,\n\t\t\tname,\n\t\t\toriginalFilename,\n\t\t},\n\t\toptions,\n\t);\n\n\tconst response = await googleApiRequest.call(\n\t\tthis,\n\t\t'PATCH',\n\t\t`/drive/v3/files/${uploadId}`,\n\t\tbody,\n\t\tqs,\n\t);\n\n\tconst executionData = this.helpers.constructExecutionMetaData(\n\t\tthis.helpers.returnJsonArray(response as IDataObject[]),\n\t\t{ itemData: { item: i } },\n\t);\n\treturnData.push(...executionData);\n\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,uBAAqC;AAErC,mBAMO;AACP,uBAAiC;AACjC,oBAAyD;AAEzD,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,aACC;AAAA,EACF;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC;AAAA,IACV,SAAS;AAAA,MACR,GAAG;AAAA,MACH;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,I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I;AACH,cAAMA,YAAW,MAAM,KAAK,QAAQ,YAAY;AAAA,UAC/C,QAAQ;AAAA,UACR,KAAK;AAAA,UACL,SAAS;AAAA,YACR,kBAAkB,MAAM;AAAA,YACxB,iBAAiB,SAAS,MAAM,IAAI,SAAS,MAAM,aAAa,CAAC,IAAI,aAAa;AAAA,UACnF;AAAA,UACA,MAAM;AAAA,QACP,CAAC;AACD,mBAAWA,WAAU;AAAA,MACtB,SAAS,OAAO;AACf,YAAI,MAAM,UAAU,WAAW,IAAK,OAAM;AAAA,MAC3C;AAAA,IACD,CAAC;AAAA,EACF;AAEA,QAAM,UAAU,KAAK,iBAAiB,WAAW,GAAG,CAAC,CAAC;AAEtD,QAAM,SAAK;AAAA,IACV;AAAA,MACC,gBAAY,8BAAgB,UAAU,OAAO;AAAA,MAC7C,2BAA2B;AAAA,MAC3B,mBAAmB;AAAA,MACnB,QAAQ;AAAA,MACR,SAAS;AAAA,IACV;AAAA,IACA;AAAA,EACD;AAEA,MAAI,CAAC,QAAQ,gBAAgB;AAC5B,OAAG,SAAS;AAAA,EACb;AAEA,QAAM,WAAO;AAAA,IACZ;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,EACD;AAEA,QAAM,WAAW,MAAM,kCAAiB;AAAA,IACvC;AAAA,IACA;AAAA,IACA,mBAAmB,QAAQ;AAAA,IAC3B;AAAA,IACA;AAAA,EACD;AAEA,QAAM,gBAAgB,KAAK,QAAQ;AAAA,IAClC,KAAK,QAAQ,gBAAgB,QAAyB;AAAA,IACtD,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE;AAAA,EACzB;AACA,aAAW,KAAK,GAAG,aAAa;AAEhC,SAAO;AACR;","names":["response"]}
1
+ {"version":3,"sources":["../../../../../../../nodes/Google/Drive/v2/actions/file/upload.operation.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport { updateDisplayOptions } from '@utils/utilities';\n\nimport {\n\tgetItemBinaryData,\n\tsetFileProperties,\n\tsetUpdateCommonParams,\n\tsetParentFolder,\n\tprocessInChunks,\n} from '../../helpers/utils';\nimport { googleApiRequest } from '../../transport';\nimport { driveRLC, folderRLC, updateCommonOptions } from '../common.descriptions';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Input Data Field Name',\n\t\tname: 'inputDataFieldName',\n\t\ttype: 'string',\n\t\tplaceholder: '“e.g. data',\n\t\tdefault: 'data',\n\t\trequired: true,\n\t\thint: 'The name of the input field containing the binary file data to update the file',\n\t\tdescription:\n\t\t\t'Find the name of input field containing the binary data to update the file in the Input panel on the left, in the Binary tab',\n\t},\n\t{\n\t\tdisplayName: 'File Name',\n\t\tname: 'name',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. My New File',\n\t\tdescription: 'If not specified, the original file name will be used',\n\t},\n\t{\n\t\t...driveRLC,\n\t\tdisplayName: 'Parent Drive',\n\t\tdescription: 'The drive where to upload the file',\n\t},\n\t{\n\t\t...folderRLC,\n\t\tdisplayName: 'Parent Folder',\n\t\tdescription: 'The folder where to upload the file',\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t...updateCommonOptions,\n\t\t\t{\n\t\t\t\tdisplayName: 'Simplify Output',\n\t\t\t\tname: 'simplifyOutput',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription: 'Whether to return a simplified version of the response instead of all fields',\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['upload'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst returnData: INodeExecutionData[] = [];\n\n\tconst inputDataFieldName = this.getNodeParameter('inputDataFieldName', i) as string;\n\n\tconst { contentLength, fileContent, originalFilename, mimeType } = await getItemBinaryData.call(\n\t\tthis,\n\t\tinputDataFieldName,\n\t\ti,\n\t);\n\n\tconst name = (this.getNodeParameter('name', i) as string) || originalFilename;\n\n\tconst driveId = this.getNodeParameter('driveId', i, undefined, {\n\t\textractValue: true,\n\t}) as string;\n\n\tconst folderId = this.getNodeParameter('folderId', i, undefined, {\n\t\textractValue: true,\n\t}) as string;\n\n\tlet uploadId;\n\tif (Buffer.isBuffer(fileContent)) {\n\t\tconst response = await googleApiRequest.call(\n\t\t\tthis,\n\t\t\t'POST',\n\t\t\t'/upload/drive/v3/files',\n\t\t\tfileContent,\n\t\t\t{\n\t\t\t\tuploadType: 'media',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': mimeType,\n\t\t\t\t\t'Content-Length': contentLength,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\n\t\tuploadId = response.id;\n\t} else {\n\t\tconst resumableUpload = await googleApiRequest.call(\n\t\t\tthis,\n\t\t\t'POST',\n\t\t\t'/upload/drive/v3/files',\n\t\t\tundefined,\n\t\t\t{ uploadType: 'resumable' },\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\treturnFullResponse: true,\n\t\t\t\theaders: {\n\t\t\t\t\t'X-Upload-Content-Type': mimeType,\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\n\t\tconst uploadUrl = resumableUpload.headers.location;\n\n\t\t// 2MB chunks, needs to be a multiple of 256kB for Google Drive API\n\t\tconst chunkSizeBytes = 2048 * 1024;\n\n\t\tawait processInChunks(fileContent, chunkSizeBytes, async (chunk, offset) => {\n\t\t\ttry {\n\t\t\t\tconst response = await this.helpers.httpRequest({\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl: uploadUrl,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Length': chunk.length,\n\t\t\t\t\t\t'Content-Range': `bytes ${offset}-${offset + chunk.byteLength - 1}/${contentLength}`,\n\t\t\t\t\t},\n\t\t\t\t\tbody: chunk,\n\t\t\t\t});\n\t\t\t\tuploadId = response?.id;\n\t\t\t} catch (error) {\n\t\t\t\tif (error.response?.status !== 308) throw error;\n\t\t\t}\n\t\t});\n\t}\n\n\tconst options = this.getNodeParameter('options', i, {});\n\n\tconst qs = setUpdateCommonParams(\n\t\t{\n\t\t\taddParents: setParentFolder(folderId, driveId),\n\t\t\tincludeItemsFromAllDrives: true,\n\t\t\tsupportsAllDrives: true,\n\t\t\tspaces: 'appDataFolder, drive',\n\t\t\tcorpora: 'allDrives',\n\t\t},\n\t\toptions,\n\t);\n\n\tif (!options.simplifyOutput) {\n\t\tqs.fields = '*';\n\t}\n\n\tconst body = setFileProperties(\n\t\t{\n\t\t\tmimeType,\n\t\t\tname,\n\t\t\toriginalFilename,\n\t\t},\n\t\toptions,\n\t);\n\n\tconst response = await googleApiRequest.call(\n\t\tthis,\n\t\t'PATCH',\n\t\t`/drive/v3/files/${uploadId}`,\n\t\tbody,\n\t\tqs,\n\t);\n\n\tconst executionData = this.helpers.constructExecutionMetaData(\n\t\tthis.helpers.returnJsonArray(response as IDataObject[]),\n\t\t{ itemData: { item: i } },\n\t);\n\treturnData.push(...executionData);\n\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,uBAAqC;AAErC,mBAMO;AACP,uBAAiC;AACjC,oBAAyD;AAEzD,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,aACC;AAAA,EACF;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,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ACA;AAAA,EACD;AAEA,QAAM,WAAW,MAAM,kCAAiB;AAAA,IACvC;AAAA,IACA;AAAA,IACA,mBAAmB,QAAQ;AAAA,IAC3B;AAAA,IACA;AAAA,EACD;AAEA,QAAM,gBAAgB,KAAK,QAAQ;AAAA,IAClC,KAAK,QAAQ,gBAAgB,QAAyB;AAAA,IACtD,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE;AAAA,EACzB;AACA,aAAW,KAAK,GAAG,aAAa;AAEhC,SAAO;AACR;","names":["response"]}
@@ -81,7 +81,6 @@ async function googleApiRequestAllItems(propertyName, method, endpoint, body = {
81
81
  return returnData;
82
82
  }
83
83
  const isValidDate = (str) => (0, import_moment_timezone.default)(str, ["YYYY-MM-DD HH:mm:ss Z", import_moment_timezone.default.ISO_8601], true).isValid();
84
- const protoKeys = ["__proto__", "prototype", "constructor"];
85
84
  function jsonToDocument(value) {
86
85
  if (value === "true" || value === "false" || typeof value === "boolean") {
87
86
  return { booleanValue: value };
@@ -103,7 +102,7 @@ function jsonToDocument(value) {
103
102
  } else if (typeof value === "object") {
104
103
  const obj = {};
105
104
  for (const key of Object.keys(value)) {
106
- if (value.hasOwnProperty(key) && !protoKeys.includes(key)) {
105
+ if (value.hasOwnProperty(key) && (0, import_n8n_workflow.isSafeObjectProperty)(key)) {
107
106
  obj[key] = jsonToDocument(value[key]);
108
107
  }
109
108
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts"],"sourcesContent":["import moment from 'moment-timezone';\nimport type {\n\tIExecuteFunctions,\n\tILoadOptionsFunctions,\n\tIDataObject,\n\tJsonObject,\n\tIHttpRequestMethods,\n\tIRequestOptions,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport { getGoogleAccessToken } from '../../GenericFunctions';\n\nexport async function googleApiRequest(\n\tthis: IExecuteFunctions | ILoadOptionsFunctions,\n\tmethod: IHttpRequestMethods,\n\tresource: string,\n\tbody: any = {},\n\tqs: IDataObject = {},\n\turi: string | null = null,\n): Promise<any> {\n\tconst options: IRequestOptions = {\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tmethod,\n\t\tbody,\n\t\tqs,\n\t\tqsStringifyOptions: {\n\t\t\tarrayFormat: 'repeat',\n\t\t},\n\t\turi: uri || `https://firestore.googleapis.com/v1/projects${resource}`,\n\t\tjson: true,\n\t};\n\ttry {\n\t\tif (Object.keys(body as IDataObject).length === 0) {\n\t\t\tdelete options.body;\n\t\t}\n\n\t\tlet credentialType = 'googleFirebaseCloudFirestoreOAuth2Api';\n\t\tconst authentication = this.getNodeParameter('authentication', 0) as string;\n\n\t\tif (authentication === 'serviceAccount') {\n\t\t\tconst credentials = await this.getCredentials('googleApi');\n\t\t\tcredentialType = 'googleApi';\n\n\t\t\tconst { access_token } = await getGoogleAccessToken.call(this, credentials, 'firestore');\n\n\t\t\t(options.headers as IDataObject).Authorization = `Bearer ${access_token}`;\n\t\t}\n\n\t\treturn await this.helpers.requestWithAuthentication.call(this, credentialType, options);\n\t} catch (error) {\n\t\tthrow new NodeApiError(this.getNode(), error as JsonObject);\n\t}\n}\n\nexport async function googleApiRequestAllItems(\n\tthis: IExecuteFunctions | ILoadOptionsFunctions,\n\tpropertyName: string,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\n\tbody: any = {},\n\tquery: IDataObject = {},\n\turi: string | null = null,\n): Promise<any> {\n\tconst returnData: IDataObject[] = [];\n\n\tlet responseData;\n\tquery.pageSize = 100;\n\n\tdo {\n\t\tresponseData = await googleApiRequest.call(this, method, endpoint, body, query, uri);\n\t\tquery.pageToken = responseData.nextPageToken;\n\t\treturnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);\n\t} while (responseData.nextPageToken !== undefined && responseData.nextPageToken !== '');\n\n\treturn returnData;\n}\n\nconst isValidDate = (str: string) =>\n\tmoment(str, ['YYYY-MM-DD HH:mm:ss Z', moment.ISO_8601], true).isValid();\n\nconst protoKeys = ['__proto__', 'prototype', 'constructor'];\n\n// Both functions below were taken from Stack Overflow jsonToDocument was fixed as it was unable to handle null values correctly\n// https://stackoverflow.com/questions/62246410/how-to-convert-a-firestore-document-to-plain-json-and-vice-versa\n// Great thanks to https://stackoverflow.com/users/3915246/mahindar\nexport function jsonToDocument(value: string | number | IDataObject | IDataObject[]): IDataObject {\n\tif (value === 'true' || value === 'false' || typeof value === 'boolean') {\n\t\treturn { booleanValue: value };\n\t} else if (value === null) {\n\t\treturn { nullValue: null };\n\t} else if (value !== '' && !isNaN(value as number)) {\n\t\tif (value.toString().indexOf('.') !== -1) {\n\t\t\treturn { doubleValue: value };\n\t\t} else {\n\t\t\treturn { integerValue: value };\n\t\t}\n\t} else if (isValidDate(value as string)) {\n\t\tconst date = new Date(Date.parse(value as string));\n\t\treturn { timestampValue: date.toISOString() };\n\t} else if (typeof value === 'string') {\n\t\treturn { stringValue: value };\n\t} else if (value && value.constructor === Array) {\n\t\treturn { arrayValue: { values: value.map((v) => jsonToDocument(v)) } };\n\t} else if (typeof value === 'object') {\n\t\tconst obj: IDataObject = {};\n\t\tfor (const key of Object.keys(value)) {\n\t\t\tif (value.hasOwnProperty(key) && !protoKeys.includes(key)) {\n\t\t\t\tobj[key] = jsonToDocument((value as IDataObject)[key] as IDataObject);\n\t\t\t}\n\t\t}\n\t\treturn { mapValue: { fields: obj } };\n\t}\n\n\treturn {};\n}\n\nexport function documentToJson(fields: IDataObject): IDataObject {\n\tif (fields === undefined) return {};\n\tconst result = {};\n\tfor (const f of Object.keys(fields)) {\n\t\tconst key = f,\n\t\t\tvalue = fields[f],\n\t\t\tisDocumentType = [\n\t\t\t\t'stringValue',\n\t\t\t\t'booleanValue',\n\t\t\t\t'doubleValue',\n\t\t\t\t'integerValue',\n\t\t\t\t'timestampValue',\n\t\t\t\t'mapValue',\n\t\t\t\t'arrayValue',\n\t\t\t\t'nullValue',\n\t\t\t\t'geoPointValue',\n\t\t\t].find((t) => t === key);\n\t\tif (isDocumentType) {\n\t\t\tconst item = [\n\t\t\t\t'stringValue',\n\t\t\t\t'booleanValue',\n\t\t\t\t'doubleValue',\n\t\t\t\t'integerValue',\n\t\t\t\t'timestampValue',\n\t\t\t\t'nullValue',\n\t\t\t\t'geoPointValue',\n\t\t\t].find((t) => t === key);\n\t\t\tif (item) {\n\t\t\t\treturn value as IDataObject;\n\t\t\t} else if ('mapValue' === key) {\n\t\t\t\t//@ts-ignore\n\t\t\t\treturn documentToJson((value!.fields as IDataObject) || {});\n\t\t\t} else if ('arrayValue' === key) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tconst list = value.values as IDataObject[];\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn !!list ? list.map((l) => documentToJson(l)) : [];\n\t\t\t}\n\t\t} else {\n\t\t\t// @ts-ignore\n\t\t\tresult[key] = documentToJson(value);\n\t\t}\n\t}\n\treturn result;\n}\n\nexport function fullDocumentToJson(data: IDataObject): IDataObject {\n\tif (data === undefined) {\n\t\treturn data;\n\t}\n\n\treturn {\n\t\t_name: data.name,\n\t\t_id: data.id,\n\t\t_createTime: data.createTime,\n\t\t_updateTime: data.updateTime,\n\t\t...documentToJson(data.fields as IDataObject),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAmB;AASnB,0BAA6B;AAE7B,8BAAqC;AAErC,eAAsB,iBAErB,QACA,UACA,OAAY,CAAC,GACb,KAAkB,CAAC,GACnB,MAAqB,MACN;AACf,QAAM,UAA2B;AAAA,IAChC,SAAS;AAAA,MACR,gBAAgB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,MACnB,aAAa;AAAA,IACd;AAAA,IACA,KAAK,OAAO,+CAA+C,QAAQ;AAAA,IACnE,MAAM;AAAA,EACP;AACA,MAAI;AACH,QAAI,OAAO,KAAK,IAAm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A;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,EAAE,KAAK,CAAC,MAAM,MAAM,GAAG;AACvB,UAAI,MAAM;AACT,eAAO;AAAA,MACR,WAAW,eAAe,KAAK;AAE9B,eAAO,eAAgB,MAAO,UAA0B,CAAC,CAAC;AAAA,MAC3D,WAAW,iBAAiB,KAAK;AAEhC,cAAM,OAAO,MAAM;AAEnB,eAAO,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC;AAAA,MACvD;AAAA,IACD,OAAO;AAEN,aAAO,GAAG,IAAI,eAAe,KAAK;AAAA,IACnC;AAAA,EACD;AACA,SAAO;AACR;AAEO,SAAS,mBAAmB,MAAgC;AAClE,MAAI,SAAS,QAAW;AACvB,WAAO;AAAA,EACR;AAEA,SAAO;AAAA,IACN,OAAO,KAAK;AAAA,IACZ,KAAK,KAAK;AAAA,IACV,aAAa,KAAK;AAAA,IAClB,aAAa,KAAK;AAAA,IAClB,GAAG,eAAe,KAAK,MAAqB;AAAA,EAC7C;AACD;","names":["moment"]}
1
+ {"version":3,"sources":["../../../../../nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts"],"sourcesContent":["import moment from 'moment-timezone';\nimport type {\n\tIExecuteFunctions,\n\tILoadOptionsFunctions,\n\tIDataObject,\n\tJsonObject,\n\tIHttpRequestMethods,\n\tIRequestOptions,\n} from 'n8n-workflow';\nimport { isSafeObjectProperty, NodeApiError } from 'n8n-workflow';\n\nimport { getGoogleAccessToken } from '../../GenericFunctions';\n\nexport async function googleApiRequest(\n\tthis: IExecuteFunctions | ILoadOptionsFunctions,\n\tmethod: IHttpRequestMethods,\n\tresource: string,\n\tbody: any = {},\n\tqs: IDataObject = {},\n\turi: string | null = null,\n): Promise<any> {\n\tconst options: IRequestOptions = {\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tmethod,\n\t\tbody,\n\t\tqs,\n\t\tqsStringifyOptions: {\n\t\t\tarrayFormat: 'repeat',\n\t\t},\n\t\turi: uri || `https://firestore.googleapis.com/v1/projects${resource}`,\n\t\tjson: true,\n\t};\n\ttry {\n\t\tif (Object.keys(body as IDataObject).length === 0) {\n\t\t\tdelete options.body;\n\t\t}\n\n\t\tlet credentialType = 'googleFirebaseCloudFirestoreOAuth2Api';\n\t\tconst authentication = this.getNodeParameter('authentication', 0) as string;\n\n\t\tif (authentication === 'serviceAccount') {\n\t\t\tconst credentials = await this.getCredentials('googleApi');\n\t\t\tcredentialType = 'googleApi';\n\n\t\t\tconst { access_token } = await getGoogleAccessToken.call(this, credentials, 'firestore');\n\n\t\t\t(options.headers as IDataObject).Authorization = `Bearer ${access_token}`;\n\t\t}\n\n\t\treturn await this.helpers.requestWithAuthentication.call(this, credentialType, options);\n\t} catch (error) {\n\t\tthrow new NodeApiError(this.getNode(), error as JsonObject);\n\t}\n}\n\nexport async function googleApiRequestAllItems(\n\tthis: IExecuteFunctions | ILoadOptionsFunctions,\n\tpropertyName: string,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\n\tbody: any = {},\n\tquery: IDataObject = {},\n\turi: string | null = null,\n): Promise<any> {\n\tconst returnData: IDataObject[] = [];\n\n\tlet responseData;\n\tquery.pageSize = 100;\n\n\tdo {\n\t\tresponseData = await googleApiRequest.call(this, method, endpoint, body, query, uri);\n\t\tquery.pageToken = responseData.nextPageToken;\n\t\treturnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);\n\t} while (responseData.nextPageToken !== undefined && responseData.nextPageToken !== '');\n\n\treturn returnData;\n}\n\nconst isValidDate = (str: string) =>\n\tmoment(str, ['YYYY-MM-DD HH:mm:ss Z', moment.ISO_8601], true).isValid();\n\n// Both functions below were taken from Stack Overflow jsonToDocument was fixed as it was unable to handle null values correctly\n// https://stackoverflow.com/questions/62246410/how-to-convert-a-firestore-document-to-plain-json-and-vice-versa\n// Great thanks to https://stackoverflow.com/users/3915246/mahindar\nexport function jsonToDocument(value: string | number | IDataObject | IDataObject[]): IDataObject {\n\tif (value === 'true' || value === 'false' || typeof value === 'boolean') {\n\t\treturn { booleanValue: value };\n\t} else if (value === null) {\n\t\treturn { nullValue: null };\n\t} else if (value !== '' && !isNaN(value as number)) {\n\t\tif (value.toString().indexOf('.') !== -1) {\n\t\t\treturn { doubleValue: value };\n\t\t} else {\n\t\t\treturn { integerValue: value };\n\t\t}\n\t} else if (isValidDate(value as string)) {\n\t\tconst date = new Date(Date.parse(value as string));\n\t\treturn { timestampValue: date.toISOString() };\n\t} else if (typeof value === 'string') {\n\t\treturn { stringValue: value };\n\t} else if (value && value.constructor === Array) {\n\t\treturn { arrayValue: { values: value.map((v) => jsonToDocument(v)) } };\n\t} else if (typeof value === 'object') {\n\t\tconst obj: IDataObject = {};\n\t\tfor (const key of Object.keys(value)) {\n\t\t\tif (value.hasOwnProperty(key) && isSafeObjectProperty(key)) {\n\t\t\t\tobj[key] = jsonToDocument((value as IDataObject)[key] as IDataObject);\n\t\t\t}\n\t\t}\n\t\treturn { mapValue: { fields: obj } };\n\t}\n\n\treturn {};\n}\n\nexport function documentToJson(fields: IDataObject): IDataObject {\n\tif (fields === undefined) return {};\n\tconst result = {};\n\tfor (const f of Object.keys(fields)) {\n\t\tconst key = f,\n\t\t\tvalue = fields[f],\n\t\t\tisDocumentType = [\n\t\t\t\t'stringValue',\n\t\t\t\t'booleanValue',\n\t\t\t\t'doubleValue',\n\t\t\t\t'integerValue',\n\t\t\t\t'timestampValue',\n\t\t\t\t'mapValue',\n\t\t\t\t'arrayValue',\n\t\t\t\t'nullValue',\n\t\t\t\t'geoPointValue',\n\t\t\t].find((t) => t === key);\n\t\tif (isDocumentType) {\n\t\t\tconst item = [\n\t\t\t\t'stringValue',\n\t\t\t\t'booleanValue',\n\t\t\t\t'doubleValue',\n\t\t\t\t'integerValue',\n\t\t\t\t'timestampValue',\n\t\t\t\t'nullValue',\n\t\t\t\t'geoPointValue',\n\t\t\t].find((t) => t === key);\n\t\t\tif (item) {\n\t\t\t\treturn value as IDataObject;\n\t\t\t} else if ('mapValue' === key) {\n\t\t\t\t//@ts-ignore\n\t\t\t\treturn documentToJson((value!.fields as IDataObject) || {});\n\t\t\t} else if ('arrayValue' === key) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tconst list = value.values as IDataObject[];\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn !!list ? list.map((l) => documentToJson(l)) : [];\n\t\t\t}\n\t\t} else {\n\t\t\t// @ts-ignore\n\t\t\tresult[key] = documentToJson(value);\n\t\t}\n\t}\n\treturn result;\n}\n\nexport function fullDocumentToJson(data: IDataObject): IDataObject {\n\tif (data === undefined) {\n\t\treturn data;\n\t}\n\n\treturn {\n\t\t_name: data.name,\n\t\t_id: data.id,\n\t\t_createTime: data.createTime,\n\t\t_updateTime: data.updateTime,\n\t\t...documentToJson(data.fields as IDataObject),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAmB;AASnB,0BAAmD;AAEnD,8BAAqC;AAErC,eAAsB,iBAErB,QACA,UACA,OAAY,CAAC,GACb,KAAkB,CAAC,GACnB,MAAqB,MACN;AACf,QAAM,UAA2B;AAAA,IAChC,SAAS;AAAA,MACR,gBAAgB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,MACnB,aAAa;AAAA,IACd;AAAA,IACA,KAAK,OAAO,+CAA+C,QAAQ;AAAA,IACnE,MAAM;AAAA,EACP;AACA,MAAI;AACH,QAAI,OAAO,KAAK,IAAmB,EAAE,WAAW,GAAG;AAClD,aAAO,QAAQ;AAAA,IAChB;AAEA,QAAI,iBAAiB;AACrB,UAAM,iBAAiB,KAAK,iBAAiB,kBAAkB,CAAC;AAEhE,QAAI,mBAAmB,kBAAkB;AACxC,YAAM,cAAc,MAAM,KAAK,eAAe,WAAW;AACzD,uB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AAEnB,eAAO,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC;AAAA,MACvD;AAAA,IACD,OAAO;AAEN,aAAO,GAAG,IAAI,eAAe,KAAK;AAAA,IACnC;AAAA,EACD;AACA,SAAO;AACR;AAEO,SAAS,mBAAmB,MAAgC;AAClE,MAAI,SAAS,QAAW;AACvB,WAAO;AAAA,EACR;AAEA,SAAO;AAAA,IACN,OAAO,KAAK;AAAA,IACZ,KAAK,KAAK;AAAA,IACV,aAAa,KAAK;AAAA,IAClB,aAAa,KAAK;AAAA,IAClB,GAAG,eAAe,KAAK,MAAqB;AAAA,EAC7C;AACD;","names":["moment"]}
@@ -18,7 +18,9 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var GoogleSheetsTrigger_node_exports = {};
20
20
  __export(GoogleSheetsTrigger_node_exports, {
21
- GoogleSheetsTrigger: () => GoogleSheetsTrigger
21
+ GoogleSheetsTrigger: () => GoogleSheetsTrigger,
22
+ document: () => document,
23
+ sheet: () => sheet
22
24
  });
23
25
  module.exports = __toCommonJS(GoogleSheetsTrigger_node_exports);
24
26
  var import_n8n_workflow = require("n8n-workflow");
@@ -28,6 +30,111 @@ var import_listSearch = require("./v2/methods/listSearch");
28
30
  var import_loadOptions = require("./v2/methods/loadOptions");
29
31
  var import_transport = require("./v2/transport");
30
32
  var import_constants = require("../constants");
33
+ const document = {
34
+ displayName: "Document",
35
+ name: "documentId",
36
+ type: "resourceLocator",
37
+ default: { mode: "list", value: "" },
38
+ required: true,
39
+ modes: [
40
+ {
41
+ displayName: "From List",
42
+ name: "list",
43
+ type: "list",
44
+ typeOptions: {
45
+ searchListMethod: "spreadSheetsSearch",
46
+ searchable: true
47
+ }
48
+ },
49
+ {
50
+ displayName: "By URL",
51
+ name: "url",
52
+ type: "string",
53
+ extractValue: {
54
+ type: "regex",
55
+ regex: import_constants.GOOGLE_DRIVE_FILE_URL_REGEX
56
+ },
57
+ validation: [
58
+ {
59
+ type: "regex",
60
+ properties: {
61
+ regex: import_constants.GOOGLE_DRIVE_FILE_URL_REGEX,
62
+ errorMessage: "Not a valid Google Drive File URL"
63
+ }
64
+ }
65
+ ]
66
+ },
67
+ {
68
+ displayName: "By ID",
69
+ name: "id",
70
+ type: "string",
71
+ validation: [
72
+ {
73
+ type: "regex",
74
+ properties: {
75
+ regex: "[a-zA-Z0-9\\-_]{2,}",
76
+ errorMessage: "Not a valid Google Drive File ID"
77
+ }
78
+ }
79
+ ],
80
+ url: "=https://docs.google.com/spreadsheets/d/{{$value}}/edit"
81
+ }
82
+ ]
83
+ };
84
+ const sheet = {
85
+ displayName: "Sheet",
86
+ name: "sheetName",
87
+ type: "resourceLocator",
88
+ default: { mode: "list", value: "" },
89
+ // default: '', //empty string set to progresivly reveal fields
90
+ required: true,
91
+ typeOptions: {
92
+ loadOptionsDependsOn: ["documentId.value"]
93
+ },
94
+ modes: [
95
+ {
96
+ displayName: "From List",
97
+ name: "list",
98
+ type: "list",
99
+ typeOptions: {
100
+ searchListMethod: "sheetsSearch",
101
+ searchable: false
102
+ }
103
+ },
104
+ {
105
+ displayName: "By URL",
106
+ name: "url",
107
+ type: "string",
108
+ extractValue: {
109
+ type: "regex",
110
+ regex: import_constants.GOOGLE_SHEETS_SHEET_URL_REGEX
111
+ },
112
+ validation: [
113
+ {
114
+ type: "regex",
115
+ properties: {
116
+ regex: import_constants.GOOGLE_SHEETS_SHEET_URL_REGEX,
117
+ errorMessage: "Not a valid Sheet URL"
118
+ }
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ displayName: "By ID",
124
+ name: "id",
125
+ type: "string",
126
+ validation: [
127
+ {
128
+ type: "regex",
129
+ properties: {
130
+ regex: "((gid=)?[0-9]{1,})",
131
+ errorMessage: "Not a valid Sheet ID"
132
+ }
133
+ }
134
+ ]
135
+ }
136
+ ]
137
+ };
31
138
  class GoogleSheetsTrigger {
32
139
  constructor() {
33
140
  this.description = {
@@ -70,111 +177,8 @@ class GoogleSheetsTrigger {
70
177
  ],
71
178
  default: "triggerOAuth2"
72
179
  },
73
- {
74
- displayName: "Document",
75
- name: "documentId",
76
- type: "resourceLocator",
77
- default: { mode: "list", value: "" },
78
- required: true,
79
- modes: [
80
- {
81
- displayName: "From List",
82
- name: "list",
83
- type: "list",
84
- typeOptions: {
85
- searchListMethod: "spreadSheetsSearch",
86
- searchable: true
87
- }
88
- },
89
- {
90
- displayName: "By URL",
91
- name: "url",
92
- type: "string",
93
- extractValue: {
94
- type: "regex",
95
- regex: import_constants.GOOGLE_DRIVE_FILE_URL_REGEX
96
- },
97
- validation: [
98
- {
99
- type: "regex",
100
- properties: {
101
- regex: import_constants.GOOGLE_DRIVE_FILE_URL_REGEX,
102
- errorMessage: "Not a valid Google Drive File URL"
103
- }
104
- }
105
- ]
106
- },
107
- {
108
- displayName: "By ID",
109
- name: "id",
110
- type: "string",
111
- validation: [
112
- {
113
- type: "regex",
114
- properties: {
115
- regex: "[a-zA-Z0-9\\-_]{2,}",
116
- errorMessage: "Not a valid Google Drive File ID"
117
- }
118
- }
119
- ],
120
- url: "=https://docs.google.com/spreadsheets/d/{{$value}}/edit"
121
- }
122
- ]
123
- },
124
- {
125
- displayName: "Sheet",
126
- name: "sheetName",
127
- type: "resourceLocator",
128
- default: { mode: "list", value: "" },
129
- // default: '', //empty string set to progresivly reveal fields
130
- required: true,
131
- typeOptions: {
132
- loadOptionsDependsOn: ["documentId.value"]
133
- },
134
- modes: [
135
- {
136
- displayName: "From List",
137
- name: "list",
138
- type: "list",
139
- typeOptions: {
140
- searchListMethod: "sheetsSearch",
141
- searchable: false
142
- }
143
- },
144
- {
145
- displayName: "By URL",
146
- name: "url",
147
- type: "string",
148
- extractValue: {
149
- type: "regex",
150
- regex: import_constants.GOOGLE_SHEETS_SHEET_URL_REGEX
151
- },
152
- validation: [
153
- {
154
- type: "regex",
155
- properties: {
156
- regex: import_constants.GOOGLE_SHEETS_SHEET_URL_REGEX,
157
- errorMessage: "Not a valid Sheet URL"
158
- }
159
- }
160
- ]
161
- },
162
- {
163
- displayName: "By ID",
164
- name: "id",
165
- type: "string",
166
- validation: [
167
- {
168
- type: "regex",
169
- properties: {
170
- regex: "((gid=)?[0-9]{1,})",
171
- errorMessage: "Not a valid Sheet ID"
172
- }
173
- }
174
- ]
175
- }
176
- ]
177
- },
180
+ document,
181
+ sheet,
178
182
  {
179
183
  displayName: "Trigger On",
180
184
  name: "event",
@@ -623,6 +627,8 @@ class GoogleSheetsTrigger {
623
627
  }
624
628
  // Annotate the CommonJS export names for ESM import in node:
625
629
  0 && (module.exports = {
626
- GoogleSheetsTrigger
630
+ GoogleSheetsTrigger,
631
+ document,
632
+ sheet
627
633
  });
628
634
  //# sourceMappingURL=GoogleSheetsTrigger.node.js.map