n8n-nodes-base 1.92.0 → 1.93.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 (189) hide show
  1. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +0 -9
  2. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
  3. package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js +13 -0
  4. package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js.map +1 -1
  5. package/dist/credentials/Snowflake.credentials.js +46 -2
  6. package/dist/credentials/Snowflake.credentials.js.map +1 -1
  7. package/dist/known/credentials.json +10 -1
  8. package/dist/known/nodes.json +20 -0
  9. package/dist/methods/defined.json +6 -0
  10. package/dist/methods/referenced.json +3 -0
  11. package/dist/nodes/Aws/IAM/AwsIam.node.js +95 -0
  12. package/dist/nodes/Aws/IAM/AwsIam.node.js.map +1 -0
  13. package/dist/nodes/Aws/IAM/AwsIam.node.json +18 -0
  14. package/dist/nodes/Aws/IAM/AwsIam.svg +18 -0
  15. package/dist/nodes/Aws/IAM/descriptions/common.js +188 -0
  16. package/dist/nodes/Aws/IAM/descriptions/common.js.map +1 -0
  17. package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js +175 -0
  18. package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js.map +1 -0
  19. package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js +66 -0
  20. package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js.map +1 -0
  21. package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js +43 -0
  22. package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js.map +1 -0
  23. package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js +50 -0
  24. package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js.map +1 -0
  25. package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js +47 -0
  26. package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js.map +1 -0
  27. package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js +70 -0
  28. package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js.map +1 -0
  29. package/dist/nodes/Aws/IAM/descriptions/index.js +42 -0
  30. package/dist/nodes/Aws/IAM/descriptions/index.js.map +1 -0
  31. package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js +231 -0
  32. package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js.map +1 -0
  33. package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js +47 -0
  34. package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js.map +1 -0
  35. package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js +118 -0
  36. package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js.map +1 -0
  37. package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js +43 -0
  38. package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js.map +1 -0
  39. package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js +43 -0
  40. package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js.map +1 -0
  41. package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js +66 -0
  42. package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js.map +1 -0
  43. package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js +74 -0
  44. package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js.map +1 -0
  45. package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js +68 -0
  46. package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js.map +1 -0
  47. package/dist/nodes/Aws/IAM/helpers/constants.js +47 -0
  48. package/dist/nodes/Aws/IAM/helpers/constants.js.map +1 -0
  49. package/dist/nodes/Aws/IAM/helpers/errorHandler.js +90 -0
  50. package/dist/nodes/Aws/IAM/helpers/errorHandler.js.map +1 -0
  51. package/dist/nodes/Aws/IAM/helpers/types.js +17 -0
  52. package/dist/nodes/Aws/IAM/helpers/types.js.map +1 -0
  53. package/dist/nodes/Aws/IAM/helpers/utils.js +279 -0
  54. package/dist/nodes/Aws/IAM/helpers/utils.js.map +1 -0
  55. package/dist/nodes/Aws/IAM/methods/index.js +39 -0
  56. package/dist/nodes/Aws/IAM/methods/index.js.map +1 -0
  57. package/dist/nodes/Aws/IAM/methods/listSearch.js +132 -0
  58. package/dist/nodes/Aws/IAM/methods/listSearch.js.map +1 -0
  59. package/dist/nodes/Aws/IAM/transport/index.js +64 -0
  60. package/dist/nodes/Aws/IAM/transport/index.js.map +1 -0
  61. package/dist/nodes/Cron/Cron.node.js +1 -1
  62. package/dist/nodes/Cron/Cron.node.js.map +1 -1
  63. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +2 -2
  64. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
  65. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +2 -2
  66. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
  67. package/dist/nodes/Evaluation/Evaluation/Description.node.js +146 -0
  68. package/dist/nodes/Evaluation/Evaluation/Description.node.js.map +1 -0
  69. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js +117 -0
  70. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js.map +1 -0
  71. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +187 -0
  72. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -0
  73. package/dist/nodes/Evaluation/methods/index.js +42 -0
  74. package/dist/nodes/Evaluation/methods/index.js.map +1 -0
  75. package/dist/nodes/Evaluation/methods/loadOptions.js +40 -0
  76. package/dist/nodes/Evaluation/methods/loadOptions.js.map +1 -0
  77. package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js +119 -0
  78. package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js.map +1 -0
  79. package/dist/nodes/Evaluation/utils/evaluationUtils.js +171 -0
  80. package/dist/nodes/Evaluation/utils/evaluationUtils.js.map +1 -0
  81. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +4 -3
  82. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
  83. package/dist/nodes/Form/common.descriptions.js +2 -2
  84. package/dist/nodes/Form/common.descriptions.js.map +1 -1
  85. package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +113 -107
  86. package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -1
  87. package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js +52 -106
  88. package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js.map +1 -1
  89. package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js +97 -0
  90. package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js.map +1 -0
  91. package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js +20 -17
  92. package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js.map +1 -1
  93. package/dist/nodes/Google/YouTube/YouTube.node.js +4 -2
  94. package/dist/nodes/Google/YouTube/YouTube.node.js.map +1 -1
  95. package/dist/nodes/Interval/Interval.node.js +1 -1
  96. package/dist/nodes/Interval/Interval.node.js.map +1 -1
  97. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +2 -2
  98. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
  99. package/dist/nodes/MQTT/MqttTrigger.node.js +2 -2
  100. package/dist/nodes/MQTT/MqttTrigger.node.js.map +1 -1
  101. package/dist/nodes/ManualTrigger/ManualTrigger.node.js +1 -1
  102. package/dist/nodes/ManualTrigger/ManualTrigger.node.js.map +1 -1
  103. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js +93 -0
  104. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js.map +1 -0
  105. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json +18 -0
  106. package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js +190 -0
  107. package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js.map +1 -0
  108. package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js +108 -0
  109. package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js.map +1 -0
  110. package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js +62 -0
  111. package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js.map +1 -0
  112. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js +129 -0
  113. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js.map +1 -0
  114. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js +77 -0
  115. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js.map +1 -0
  116. package/dist/nodes/Microsoft/SharePoint/descriptions/index.js +45 -0
  117. package/dist/nodes/Microsoft/SharePoint/descriptions/index.js.map +1 -0
  118. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js +175 -0
  119. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js.map +1 -0
  120. package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js +100 -0
  121. package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js.map +1 -0
  122. package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js +62 -0
  123. package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js.map +1 -0
  124. package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js +83 -0
  125. package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js.map +1 -0
  126. package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js +203 -0
  127. package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js.map +1 -0
  128. package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js +100 -0
  129. package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js.map +1 -0
  130. package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js +100 -0
  131. package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js.map +1 -0
  132. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js +99 -0
  133. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js.map +1 -0
  134. package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js +65 -0
  135. package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js.map +1 -0
  136. package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js +105 -0
  137. package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js.map +1 -0
  138. package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js +17 -0
  139. package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js.map +1 -0
  140. package/dist/nodes/Microsoft/SharePoint/helpers/utils.js +252 -0
  141. package/dist/nodes/Microsoft/SharePoint/helpers/utils.js.map +1 -0
  142. package/dist/nodes/Microsoft/SharePoint/methods/index.js +42 -0
  143. package/dist/nodes/Microsoft/SharePoint/methods/index.js.map +1 -0
  144. package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js +222 -0
  145. package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js.map +1 -0
  146. package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js +104 -0
  147. package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js.map +1 -0
  148. package/dist/nodes/Microsoft/SharePoint/test/credentials.js +54 -0
  149. package/dist/nodes/Microsoft/SharePoint/test/credentials.js.map +1 -0
  150. package/dist/nodes/Microsoft/SharePoint/transport/index.js +46 -0
  151. package/dist/nodes/Microsoft/SharePoint/transport/index.js.map +1 -0
  152. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js +387 -0
  153. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js.map +1 -0
  154. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.json +18 -0
  155. package/dist/nodes/Microsoft/Teams/v2/helpers/types.js +17 -0
  156. package/dist/nodes/Microsoft/Teams/v2/helpers/types.js.map +1 -0
  157. package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js +147 -0
  158. package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js.map +1 -0
  159. package/dist/nodes/Microsoft/Teams/v2/transport/index.js.map +1 -1
  160. package/dist/nodes/PostBin/BinDescription.js +1 -1
  161. package/dist/nodes/PostBin/BinDescription.js.map +1 -1
  162. package/dist/nodes/PostBin/GenericFunctions.js +5 -5
  163. package/dist/nodes/PostBin/GenericFunctions.js.map +1 -1
  164. package/dist/nodes/PostBin/PostBin.node.js +1 -1
  165. package/dist/nodes/PostBin/PostBin.node.js.map +1 -1
  166. package/dist/nodes/PostBin/RequestDescription.js +2 -2
  167. package/dist/nodes/PostBin/RequestDescription.js.map +1 -1
  168. package/dist/nodes/Postgres/PostgresTrigger.node.js +2 -2
  169. package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
  170. package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js +2 -2
  171. package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js.map +1 -1
  172. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +8 -3
  173. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
  174. package/dist/nodes/RespondToWebhook/utils.js +43 -0
  175. package/dist/nodes/RespondToWebhook/utils.js.map +1 -0
  176. package/dist/nodes/Schedule/ScheduleTrigger.node.js +1 -1
  177. package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
  178. package/dist/nodes/Snowflake/GenericFunctions.js +34 -2
  179. package/dist/nodes/Snowflake/GenericFunctions.js.map +1 -1
  180. package/dist/nodes/Snowflake/Snowflake.node.js +5 -7
  181. package/dist/nodes/Snowflake/Snowflake.node.js.map +1 -1
  182. package/dist/nodes/SseTrigger/SseTrigger.node.js +2 -2
  183. package/dist/nodes/SseTrigger/SseTrigger.node.js.map +1 -1
  184. package/dist/types/credentials.json +6 -6
  185. package/dist/types/nodes.json +22 -17
  186. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +12 -2
  187. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
  188. package/package.json +13 -9
  189. /package/dist/{credentials/icons/SharePoint.svg → nodes/Microsoft/SharePoint/microsoftSharePoint.svg} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/LocalFileTrigger/LocalFileTrigger.node.ts"],"sourcesContent":["import { watch } from 'chokidar';\nimport {\n\ttype ITriggerFunctions,\n\ttype IDataObject,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ITriggerResponse,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\n\nexport class LocalFileTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Local File Trigger',\n\t\tname: 'localFileTrigger',\n\t\ticon: 'fa:folder-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['trigger'],\n\t\tversion: 1,\n\t\tsubtitle: '=Path: {{$parameter[\"path\"]}}',\n\t\tdescription: 'Triggers a workflow on file system changes',\n\t\teventTriggerDescription: '',\n\t\tdefaults: {\n\t\t\tname: 'Local File Trigger',\n\t\t\tcolor: '#404040',\n\t\t},\n\t\ttriggerPanel: {\n\t\t\theader: '',\n\t\t\texecutionsHelp: {\n\t\t\t\tinactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'test step' button, then make a change to your watched file or folder. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t\tactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'test step' button, then make a change to your watched file or folder. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t},\n\t\t\tactivationHint:\n\t\t\t\t\"Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).\",\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Trigger On',\n\t\t\t\tname: 'triggerOn',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Changes to a Specific File',\n\t\t\t\t\t\tvalue: 'file',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Changes Involving a Specific Folder',\n\t\t\t\t\t\tvalue: 'folder',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trequired: true,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'File to Watch',\n\t\t\t\tname: 'path',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttriggerOn: ['file'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: '/data/invoices/1.pdf',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Folder to Watch',\n\t\t\t\tname: 'path',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttriggerOn: ['folder'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: '/data/invoices',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Watch for',\n\t\t\t\tname: 'events',\n\t\t\t\ttype: 'multiOptions',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttriggerOn: ['folder'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Added',\n\t\t\t\t\t\tvalue: 'add',\n\t\t\t\t\t\tdescription: 'Triggers whenever a new file was added',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Changed',\n\t\t\t\t\t\tvalue: 'change',\n\t\t\t\t\t\tdescription: 'Triggers whenever a file was changed',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Deleted',\n\t\t\t\t\t\tvalue: 'unlink',\n\t\t\t\t\t\tdescription: 'Triggers whenever a file was deleted',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Folder Added',\n\t\t\t\t\t\tvalue: 'addDir',\n\t\t\t\t\t\tdescription: 'Triggers whenever a new folder was added',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Folder Deleted',\n\t\t\t\t\t\tvalue: 'unlinkDir',\n\t\t\t\t\t\tdescription: 'Triggers whenever a folder was deleted',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trequired: true,\n\t\t\t\tdefault: [],\n\t\t\t\tdescription: 'The events to listen to',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Await Write Finish',\n\t\t\t\t\t\tname: 'awaitWriteFinish',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription: 'Whether to wait until files finished writing to avoid partially read',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Include Linked Files/Folders',\n\t\t\t\t\t\tname: 'followSymlinks',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether linked files/folders will also be watched (this includes symlinks, aliases on MacOS and shortcuts on Windows). Otherwise only the links themselves will be monitored).',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Ignore',\n\t\t\t\t\t\tname: 'ignored',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: '**/*.txt',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Files or paths to ignore. The whole path is tested, not just the filename. Supports <a href=\"https://github.com/micromatch/anymatch\">Anymatch</a>- syntax.',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Ignore Existing Files/Folders',\n\t\t\t\t\t\tname: 'ignoreInitial',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription: 'Whether to ignore existing files/folders to not trigger an event',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Max Folder Depth',\n\t\t\t\t\t\tname: 'depth',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '1 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '2 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 2,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '3 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '4 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 4,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '5 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 5,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Top Folder Only',\n\t\t\t\t\t\t\t\tvalue: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Unlimited',\n\t\t\t\t\t\t\t\tvalue: -1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription: 'How deep into the folder structure to watch for changes',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Use Polling',\n\t\t\t\t\t\tname: 'usePolling',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to use polling for watching. Typically necessary to successfully watch files over a network.',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst triggerOn = this.getNodeParameter('triggerOn') as string;\n\t\tconst path = this.getNodeParameter('path') as string;\n\t\tconst options = this.getNodeParameter('options', {}) as IDataObject;\n\n\t\tlet events: string[];\n\t\tif (triggerOn === 'file') {\n\t\t\tevents = ['change'];\n\t\t} else {\n\t\t\tevents = this.getNodeParameter('events', []) as string[];\n\t\t}\n\n\t\tconst watcher = watch(path, {\n\t\t\tignored: options.ignored === '' ? undefined : (options.ignored as string),\n\t\t\tpersistent: true,\n\t\t\tignoreInitial:\n\t\t\t\toptions.ignoreInitial === undefined ? true : (options.ignoreInitial as boolean),\n\t\t\tfollowSymlinks:\n\t\t\t\toptions.followSymlinks === undefined ? true : (options.followSymlinks as boolean),\n\t\t\tdepth: [-1, undefined].includes(options.depth as number)\n\t\t\t\t? undefined\n\t\t\t\t: (options.depth as number),\n\t\t\tusePolling: options.usePolling as boolean,\n\t\t\tawaitWriteFinish: options.awaitWriteFinish as boolean,\n\t\t});\n\n\t\tconst executeTrigger = (event: string, pathString: string) => {\n\t\t\tthis.emit([this.helpers.returnJsonArray([{ event, path: pathString }])]);\n\t\t};\n\n\t\tfor (const eventName of events) {\n\t\t\twatcher.on(eventName, (pathString) => executeTrigger(eventName, pathString as string));\n\t\t}\n\n\t\tasync function closeFunction() {\n\t\t\treturn await watcher.close();\n\t\t}\n\n\t\treturn {\n\t\t\tcloseFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,0BAOO;AAEA,MAAM,iBAAsC;AAAA,EAA5C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS;AAAA,MACT,UAAU;AAAA,MACV,aAAa;AAAA,MACb,yBAAyB;AAAA,MACzB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,cAAc;AAAA,QACb,QAAQ;AAAA,QACR,gBAAgB;AAAA,UACf,UACC;AAAA,UACD,QACC;AAAA,QACF;AAAA,QACA,gBACC;AAAA,MACF;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,YACR;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,UACD;AAAA,UACA,U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,QAAI,cAAc,QAAQ;AACzB,eAAS,CAAC,QAAQ;AAAA,IACnB,OAAO;AACN,eAAS,KAAK,iBAAiB,UAAU,CAAC,CAAC;AAAA,IAC5C;AAEA,UAAM,cAAU,uBAAM,MAAM;AAAA,MAC3B,SAAS,QAAQ,YAAY,KAAK,SAAa,QAAQ;AAAA,MACvD,YAAY;AAAA,MACZ,eACC,QAAQ,kBAAkB,SAAY,OAAQ,QAAQ;AAAA,MACvD,gBACC,QAAQ,mBAAmB,SAAY,OAAQ,QAAQ;AAAA,MACxD,OAAO,CAAC,IAAI,MAAS,EAAE,SAAS,QAAQ,KAAe,IACpD,SACC,QAAQ;AAAA,MACZ,YAAY,QAAQ;AAAA,MACpB,kBAAkB,QAAQ;AAAA,IAC3B,CAAC;AAED,UAAM,iBAAiB,CAAC,OAAe,eAAuB;AAC7D,WAAK,KAAK,CAAC,KAAK,QAAQ,gBAAgB,CAAC,EAAE,OAAO,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC;AAAA,IACxE;AAEA,eAAW,aAAa,QAAQ;AAC/B,cAAQ,GAAG,WAAW,CAAC,eAAe,eAAe,WAAW,UAAoB,CAAC;AAAA,IACtF;AAEA,mBAAe,gBAAgB;AAC9B,aAAO,MAAM,QAAQ,MAAM;AAAA,IAC5B;AAEA,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/LocalFileTrigger/LocalFileTrigger.node.ts"],"sourcesContent":["import { watch } from 'chokidar';\nimport {\n\ttype ITriggerFunctions,\n\ttype IDataObject,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ITriggerResponse,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\n\nexport class LocalFileTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Local File Trigger',\n\t\tname: 'localFileTrigger',\n\t\ticon: 'fa:folder-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['trigger'],\n\t\tversion: 1,\n\t\tsubtitle: '=Path: {{$parameter[\"path\"]}}',\n\t\tdescription: 'Triggers a workflow on file system changes',\n\t\teventTriggerDescription: '',\n\t\tdefaults: {\n\t\t\tname: 'Local File Trigger',\n\t\t\tcolor: '#404040',\n\t\t},\n\t\ttriggerPanel: {\n\t\t\theader: '',\n\t\t\texecutionsHelp: {\n\t\t\t\tinactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'execute step' button, then make a change to your watched file or folder. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t\tactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'execute step' button, then make a change to your watched file or folder. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t},\n\t\t\tactivationHint:\n\t\t\t\t\"Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).\",\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Trigger On',\n\t\t\t\tname: 'triggerOn',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Changes to a Specific File',\n\t\t\t\t\t\tvalue: 'file',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Changes Involving a Specific Folder',\n\t\t\t\t\t\tvalue: 'folder',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trequired: true,\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'File to Watch',\n\t\t\t\tname: 'path',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttriggerOn: ['file'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: '/data/invoices/1.pdf',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Folder to Watch',\n\t\t\t\tname: 'path',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttriggerOn: ['folder'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: '/data/invoices',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Watch for',\n\t\t\t\tname: 'events',\n\t\t\t\ttype: 'multiOptions',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\ttriggerOn: ['folder'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Added',\n\t\t\t\t\t\tvalue: 'add',\n\t\t\t\t\t\tdescription: 'Triggers whenever a new file was added',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Changed',\n\t\t\t\t\t\tvalue: 'change',\n\t\t\t\t\t\tdescription: 'Triggers whenever a file was changed',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Deleted',\n\t\t\t\t\t\tvalue: 'unlink',\n\t\t\t\t\t\tdescription: 'Triggers whenever a file was deleted',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Folder Added',\n\t\t\t\t\t\tvalue: 'addDir',\n\t\t\t\t\t\tdescription: 'Triggers whenever a new folder was added',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Folder Deleted',\n\t\t\t\t\t\tvalue: 'unlinkDir',\n\t\t\t\t\t\tdescription: 'Triggers whenever a folder was deleted',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trequired: true,\n\t\t\t\tdefault: [],\n\t\t\t\tdescription: 'The events to listen to',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Await Write Finish',\n\t\t\t\t\t\tname: 'awaitWriteFinish',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription: 'Whether to wait until files finished writing to avoid partially read',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Include Linked Files/Folders',\n\t\t\t\t\t\tname: 'followSymlinks',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether linked files/folders will also be watched (this includes symlinks, aliases on MacOS and shortcuts on Windows). Otherwise only the links themselves will be monitored).',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Ignore',\n\t\t\t\t\t\tname: 'ignored',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: '**/*.txt',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Files or paths to ignore. The whole path is tested, not just the filename. Supports <a href=\"https://github.com/micromatch/anymatch\">Anymatch</a>- syntax.',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Ignore Existing Files/Folders',\n\t\t\t\t\t\tname: 'ignoreInitial',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription: 'Whether to ignore existing files/folders to not trigger an event',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Max Folder Depth',\n\t\t\t\t\t\tname: 'depth',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '1 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '2 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 2,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '3 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '4 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 4,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '5 Levels Down',\n\t\t\t\t\t\t\t\tvalue: 5,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Top Folder Only',\n\t\t\t\t\t\t\t\tvalue: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Unlimited',\n\t\t\t\t\t\t\t\tvalue: -1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription: 'How deep into the folder structure to watch for changes',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Use Polling',\n\t\t\t\t\t\tname: 'usePolling',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to use polling for watching. Typically necessary to successfully watch files over a network.',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst triggerOn = this.getNodeParameter('triggerOn') as string;\n\t\tconst path = this.getNodeParameter('path') as string;\n\t\tconst options = this.getNodeParameter('options', {}) as IDataObject;\n\n\t\tlet events: string[];\n\t\tif (triggerOn === 'file') {\n\t\t\tevents = ['change'];\n\t\t} else {\n\t\t\tevents = this.getNodeParameter('events', []) as string[];\n\t\t}\n\n\t\tconst watcher = watch(path, {\n\t\t\tignored: options.ignored === '' ? undefined : (options.ignored as string),\n\t\t\tpersistent: true,\n\t\t\tignoreInitial:\n\t\t\t\toptions.ignoreInitial === undefined ? true : (options.ignoreInitial as boolean),\n\t\t\tfollowSymlinks:\n\t\t\t\toptions.followSymlinks === undefined ? true : (options.followSymlinks as boolean),\n\t\t\tdepth: [-1, undefined].includes(options.depth as number)\n\t\t\t\t? undefined\n\t\t\t\t: (options.depth as number),\n\t\t\tusePolling: options.usePolling as boolean,\n\t\t\tawaitWriteFinish: options.awaitWriteFinish as boolean,\n\t\t});\n\n\t\tconst executeTrigger = (event: string, pathString: string) => {\n\t\t\tthis.emit([this.helpers.returnJsonArray([{ event, path: pathString }])]);\n\t\t};\n\n\t\tfor (const eventName of events) {\n\t\t\twatcher.on(eventName, (pathString) => executeTrigger(eventName, pathString as string));\n\t\t}\n\n\t\tasync function closeFunction() {\n\t\t\treturn await watcher.close();\n\t\t}\n\n\t\treturn {\n\t\t\tcloseFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,0BAOO;AAEA,MAAM,iBAAsC;AAAA,EAA5C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS;AAAA,MACT,UAAU;AAAA,MACV,aAAa;AAAA,MACb,yBAAyB;AAAA,MACz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AO,MAAM,QAAQ,MAAM;AAAA,IAC5B;AAEA,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -39,8 +39,8 @@ class MqttTrigger {
39
39
  triggerPanel: {
40
40
  header: "",
41
41
  executionsHelp: {
42
- inactive: "<b>While building your workflow</b>, click the 'test step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
43
- active: "<b>While building your workflow</b>, click the 'test step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor."
42
+ inactive: "<b>While building your workflow</b>, click the 'execute step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
43
+ active: "<b>While building your workflow</b>, click the 'execute step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor."
44
44
  },
45
45
  activationHint: "Once you\u2019ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won\u2019t see those executions here)."
46
46
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/MQTT/MqttTrigger.node.ts"],"sourcesContent":["import type { ISubscriptionMap } from 'mqtt';\nimport type { QoS } from 'mqtt-packet';\nimport type {\n\tITriggerFunctions,\n\tIDataObject,\n\tINodeType,\n\tINodeTypeDescription,\n\tITriggerResponse,\n\tIRun,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\n\nimport { createClient, type MqttCredential } from './GenericFunctions';\n\ninterface Options {\n\tjsonParseBody: boolean;\n\tonlyMessage: boolean;\n\tparallelProcessing: boolean;\n}\n\nexport class MqttTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'MQTT Trigger',\n\t\tname: 'mqttTrigger',\n\t\ticon: 'file:mqtt.svg',\n\t\tgroup: ['trigger'],\n\t\tversion: 1,\n\t\tdescription: 'Listens to MQTT events',\n\t\teventTriggerDescription: '',\n\t\tdefaults: {\n\t\t\tname: 'MQTT Trigger',\n\t\t},\n\t\ttriggerPanel: {\n\t\t\theader: '',\n\t\t\texecutionsHelp: {\n\t\t\t\tinactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'test step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t\tactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'test step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t},\n\t\t\tactivationHint:\n\t\t\t\t\"Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).\",\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'mqtt',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Topics',\n\t\t\t\tname: 'topics',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Topics to subscribe to, multiple can be defined with comma. Wildcard characters are supported (+ - for single level and # - for multi level). By default all subscription used QoS=0. To set a different QoS, write the QoS desired after the topic preceded by a colom. For Example: topicA:1,topicB:2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'JSON Parse Body',\n\t\t\t\t\t\tname: 'jsonParseBody',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription: 'Whether to try parse the message to an object',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Only Message',\n\t\t\t\t\t\tname: 'onlyMessage',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription: 'Whether to return only the message property',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Parallel Processing',\n\t\t\t\t\t\tname: 'parallelProcessing',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to process messages in parallel or by keeping the message in order',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst topics = (this.getNodeParameter('topics') as string).split(',');\n\t\tif (!topics?.length) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'Topics are mandatory!');\n\t\t}\n\n\t\tconst topicsQoS: ISubscriptionMap = {};\n\t\tfor (const data of topics) {\n\t\t\tconst [topic, qosString] = data.split(':');\n\t\t\tlet qos = qosString ? parseInt(qosString, 10) : 0;\n\t\t\tif (qos < 0 || qos > 2) qos = 0;\n\t\t\ttopicsQoS[topic] = { qos: qos as QoS };\n\t\t}\n\n\t\tconst options = this.getNodeParameter('options') as Options;\n\t\tconst credentials = await this.getCredentials<MqttCredential>('mqtt');\n\t\tconst client = await createClient(credentials);\n\n\t\tconst parsePayload = (topic: string, payload: Buffer) => {\n\t\t\tlet message = payload.toString();\n\n\t\t\tif (options.jsonParseBody) {\n\t\t\t\ttry {\n\t\t\t\t\tmessage = JSON.parse(message);\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\tlet result: IDataObject = { message, topic };\n\n\t\t\tif (options.onlyMessage) {\n\t\t\t\t//@ts-ignore\n\t\t\t\tresult = [message];\n\t\t\t}\n\n\t\t\treturn [this.helpers.returnJsonArray([result])];\n\t\t};\n\n\t\tconst manualTriggerFunction = async () =>\n\t\t\tawait new Promise<void>(async (resolve) => {\n\t\t\t\tclient.once('message', (topic, payload) => {\n\t\t\t\t\tthis.emit(parsePayload(topic, payload));\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t\tawait client.subscribeAsync(topicsQoS);\n\t\t\t});\n\n\t\tif (this.getMode() === 'trigger') {\n\t\t\tconst donePromise = !options.parallelProcessing\n\t\t\t\t? this.helpers.createDeferredPromise<IRun>()\n\t\t\t\t: undefined;\n\t\t\tclient.on('message', async (topic, payload) => {\n\t\t\t\tthis.emit(parsePayload(topic, payload), undefined, donePromise);\n\t\t\t\tawait donePromise?.promise;\n\t\t\t});\n\t\t\tawait client.subscribeAsync(topicsQoS);\n\t\t}\n\n\t\tasync function closeFunction() {\n\t\t\tawait client.endAsync();\n\t\t}\n\n\t\treturn {\n\t\t\tcloseFunction,\n\t\t\tmanualTriggerFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,0BAAwD;AAExD,8BAAkD;AAQ3C,MAAM,YAAiC;AAAA,EAAvC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;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SAAS;AAAA,IACvB;AAEA,WAAO;AAAA,MACN;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/MQTT/MqttTrigger.node.ts"],"sourcesContent":["import type { ISubscriptionMap } from 'mqtt';\nimport type { QoS } from 'mqtt-packet';\nimport type {\n\tITriggerFunctions,\n\tIDataObject,\n\tINodeType,\n\tINodeTypeDescription,\n\tITriggerResponse,\n\tIRun,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\n\nimport { createClient, type MqttCredential } from './GenericFunctions';\n\ninterface Options {\n\tjsonParseBody: boolean;\n\tonlyMessage: boolean;\n\tparallelProcessing: boolean;\n}\n\nexport class MqttTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'MQTT Trigger',\n\t\tname: 'mqttTrigger',\n\t\ticon: 'file:mqtt.svg',\n\t\tgroup: ['trigger'],\n\t\tversion: 1,\n\t\tdescription: 'Listens to MQTT events',\n\t\teventTriggerDescription: '',\n\t\tdefaults: {\n\t\t\tname: 'MQTT Trigger',\n\t\t},\n\t\ttriggerPanel: {\n\t\t\theader: '',\n\t\t\texecutionsHelp: {\n\t\t\t\tinactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'execute step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t\tactive:\n\t\t\t\t\t\"<b>While building your workflow</b>, click the 'execute step' button, then trigger an MQTT event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\t},\n\t\t\tactivationHint:\n\t\t\t\t\"Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).\",\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'mqtt',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Topics',\n\t\t\t\tname: 'topics',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Topics to subscribe to, multiple can be defined with comma. Wildcard characters are supported (+ - for single level and # - for multi level). By default all subscription used QoS=0. To set a different QoS, write the QoS desired after the topic preceded by a colom. For Example: topicA:1,topicB:2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'JSON Parse Body',\n\t\t\t\t\t\tname: 'jsonParseBody',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription: 'Whether to try parse the message to an object',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Only Message',\n\t\t\t\t\t\tname: 'onlyMessage',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription: 'Whether to return only the message property',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Parallel Processing',\n\t\t\t\t\t\tname: 'parallelProcessing',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to process messages in parallel or by keeping the message in order',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst topics = (this.getNodeParameter('topics') as string).split(',');\n\t\tif (!topics?.length) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'Topics are mandatory!');\n\t\t}\n\n\t\tconst topicsQoS: ISubscriptionMap = {};\n\t\tfor (const data of topics) {\n\t\t\tconst [topic, qosString] = data.split(':');\n\t\t\tlet qos = qosString ? parseInt(qosString, 10) : 0;\n\t\t\tif (qos < 0 || qos > 2) qos = 0;\n\t\t\ttopicsQoS[topic] = { qos: qos as QoS };\n\t\t}\n\n\t\tconst options = this.getNodeParameter('options') as Options;\n\t\tconst credentials = await this.getCredentials<MqttCredential>('mqtt');\n\t\tconst client = await createClient(credentials);\n\n\t\tconst parsePayload = (topic: string, payload: Buffer) => {\n\t\t\tlet message = payload.toString();\n\n\t\t\tif (options.jsonParseBody) {\n\t\t\t\ttry {\n\t\t\t\t\tmessage = JSON.parse(message);\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\tlet result: IDataObject = { message, topic };\n\n\t\t\tif (options.onlyMessage) {\n\t\t\t\t//@ts-ignore\n\t\t\t\tresult = [message];\n\t\t\t}\n\n\t\t\treturn [this.helpers.returnJsonArray([result])];\n\t\t};\n\n\t\tconst manualTriggerFunction = async () =>\n\t\t\tawait new Promise<void>(async (resolve) => {\n\t\t\t\tclient.once('message', (topic, payload) => {\n\t\t\t\t\tthis.emit(parsePayload(topic, payload));\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t\tawait client.subscribeAsync(topicsQoS);\n\t\t\t});\n\n\t\tif (this.getMode() === 'trigger') {\n\t\t\tconst donePromise = !options.parallelProcessing\n\t\t\t\t? this.helpers.createDeferredPromise<IRun>()\n\t\t\t\t: undefined;\n\t\t\tclient.on('message', async (topic, payload) => {\n\t\t\t\tthis.emit(parsePayload(topic, payload), undefined, donePromise);\n\t\t\t\tawait donePromise?.promise;\n\t\t\t});\n\t\t\tawait client.subscribeAsync(topicsQoS);\n\t\t}\n\n\t\tasync function closeFunction() {\n\t\t\tawait client.endAsync();\n\t\t}\n\n\t\treturn {\n\t\t\tcloseFunction,\n\t\t\tmanualTriggerFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,0BAAwD;AAExD,8BAAkD;AAQ3C,MAAM,YAAiC;AAAA,EAAvC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,yBAAyB;AAAA,MACzB,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,cAAc;AAAA,QACb,QAAQ;AAAA,QACR,gBAAgB;AAAA,UACf,UACC;AAAA,UACD,QACC;AAAA,QACF;AAAA,QACA,gBACC;AAAA,MACF;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aACC;AAAA,QACF;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa;AAAA,YACd;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa;AAAA,YACd;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MA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AC;AAEF,QAAI,KAAK,QAAQ,MAAM,WAAW;AACjC,YAAM,cAAc,CAAC,QAAQ,qBAC1B,KAAK,QAAQ,sBAA4B,IACzC;AACH,aAAO,GAAG,WAAW,OAAO,OAAO,YAAY;AAC9C,aAAK,KAAK,aAAa,OAAO,OAAO,GAAG,QAAW,WAAW;AAC9D,cAAM,aAAa;AAAA,MACpB,CAAC;AACD,YAAM,OAAO,eAAe,SAAS;AAAA,IACtC;AAEA,mBAAe,gBAAgB;AAC9B,YAAM,OAAO,SAAS;AAAA,IACvB;AAEA,WAAO;AAAA,MACN;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -34,7 +34,7 @@ class ManualTrigger {
34
34
  eventTriggerDescription: "",
35
35
  maxNodes: 1,
36
36
  defaults: {
37
- name: "When clicking \u2018Test workflow\u2019",
37
+ name: "When clicking \u2018Execute workflow\u2019",
38
38
  color: "#909298"
39
39
  },
40
40
  inputs: [],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/ManualTrigger/ManualTrigger.node.ts"],"sourcesContent":["import type {\n\tITriggerFunctions,\n\tINodeType,\n\tINodeTypeDescription,\n\tITriggerResponse,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nexport class ManualTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Manual Trigger',\n\t\tname: 'manualTrigger',\n\t\ticon: 'fa:mouse-pointer',\n\t\tgroup: ['trigger'],\n\t\tversion: 1,\n\t\tdescription: 'Runs the flow on clicking a button in n8n',\n\t\teventTriggerDescription: '',\n\t\tmaxNodes: 1,\n\t\tdefaults: {\n\t\t\tname: 'When clicking ‘Test workflow’',\n\t\t\tcolor: '#909298',\n\t\t},\n\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'This node is where the workflow execution starts (when you click the ‘test’ button on the canvas).<br><br> <a data-action=\"showNodeCreator\">Explore other ways to trigger your workflow</a> (e.g on a schedule, or a webhook)',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst manualTriggerFunction = async () => {\n\t\t\tthis.emit([this.helpers.returnJsonArray([{}])]);\n\t\t};\n\n\t\treturn {\n\t\t\tmanualTriggerFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAAoC;AAE7B,MAAM,cAAmC;AAAA,EAAzC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,yBAAyB;AAAA,MACzB,UAAU;AAAA,MACV,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MAEA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,UAA4D;AACjE,UAAM,wBAAwB,YAAY;AACzC,WAAK,KAAK,CAAC,KAAK,QAAQ,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAAA,IAC/C;AAEA,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/ManualTrigger/ManualTrigger.node.ts"],"sourcesContent":["import type {\n\tITriggerFunctions,\n\tINodeType,\n\tINodeTypeDescription,\n\tITriggerResponse,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nexport class ManualTrigger implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Manual Trigger',\n\t\tname: 'manualTrigger',\n\t\ticon: 'fa:mouse-pointer',\n\t\tgroup: ['trigger'],\n\t\tversion: 1,\n\t\tdescription: 'Runs the flow on clicking a button in n8n',\n\t\teventTriggerDescription: '',\n\t\tmaxNodes: 1,\n\t\tdefaults: {\n\t\t\tname: 'When clicking ‘Execute workflow’',\n\t\t\tcolor: '#909298',\n\t\t},\n\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'This node is where the workflow execution starts (when you click the ‘test’ button on the canvas).<br><br> <a data-action=\"showNodeCreator\">Explore other ways to trigger your workflow</a> (e.g on a schedule, or a webhook)',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst manualTriggerFunction = async () => {\n\t\t\tthis.emit([this.helpers.returnJsonArray([{}])]);\n\t\t};\n\n\t\treturn {\n\t\t\tmanualTriggerFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAAoC;AAE7B,MAAM,cAAmC;AAAA,EAAzC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,SAAS;AAAA,MACjB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,yBAAyB;AAAA,MACzB,UAAU;AAAA,MACV,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MAEA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,UAA4D;AACjE,UAAM,wBAAwB,YAAY;AACzC,WAAK,KAAK,CAAC,KAAK,QAAQ,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAAA,IAC/C;AAEA,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var MicrosoftSharePoint_node_exports = {};
20
+ __export(MicrosoftSharePoint_node_exports, {
21
+ MicrosoftSharePoint: () => MicrosoftSharePoint
22
+ });
23
+ module.exports = __toCommonJS(MicrosoftSharePoint_node_exports);
24
+ var import_n8n_workflow = require("n8n-workflow");
25
+ var import_descriptions = require("./descriptions");
26
+ var import_methods = require("./methods");
27
+ class MicrosoftSharePoint {
28
+ constructor() {
29
+ this.description = {
30
+ displayName: "Microsoft SharePoint",
31
+ name: "microsoftSharePoint",
32
+ icon: {
33
+ light: "file:microsoftSharePoint.svg",
34
+ dark: "file:microsoftSharePoint.svg"
35
+ },
36
+ group: ["transform"],
37
+ version: 1,
38
+ subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
39
+ description: "Interact with Microsoft SharePoint API",
40
+ defaults: {
41
+ name: "Microsoft SharePoint"
42
+ },
43
+ usableAsTool: true,
44
+ inputs: [import_n8n_workflow.NodeConnectionTypes.Main],
45
+ outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
46
+ credentials: [
47
+ {
48
+ name: "microsoftSharePointOAuth2Api",
49
+ required: true
50
+ }
51
+ ],
52
+ requestDefaults: {
53
+ baseURL: "=https://{{ $credentials.subdomain }}.sharepoint.com/_api/v2.0/",
54
+ ignoreHttpStatusErrors: true
55
+ },
56
+ properties: [
57
+ {
58
+ displayName: "Resource",
59
+ name: "resource",
60
+ type: "options",
61
+ noDataExpression: true,
62
+ options: [
63
+ {
64
+ name: "File",
65
+ value: "file"
66
+ },
67
+ {
68
+ name: "Item",
69
+ value: "item"
70
+ },
71
+ {
72
+ name: "List",
73
+ value: "list"
74
+ }
75
+ ],
76
+ default: "file"
77
+ },
78
+ ...import_descriptions.file.description,
79
+ ...import_descriptions.item.description,
80
+ ...import_descriptions.list.description
81
+ ]
82
+ };
83
+ this.methods = {
84
+ listSearch: import_methods.listSearch,
85
+ resourceMapping: import_methods.resourceMapping
86
+ };
87
+ }
88
+ }
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ MicrosoftSharePoint
92
+ });
93
+ //# sourceMappingURL=MicrosoftSharePoint.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.ts"],"sourcesContent":["import type { INodeType, INodeTypeDescription } from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport { file, item, list } from './descriptions';\nimport { listSearch, resourceMapping } from './methods';\n\nexport class MicrosoftSharePoint implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Microsoft SharePoint',\n\t\tname: 'microsoftSharePoint',\n\t\ticon: {\n\t\t\tlight: 'file:microsoftSharePoint.svg',\n\t\t\tdark: 'file:microsoftSharePoint.svg',\n\t\t},\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tsubtitle: '={{ $parameter[\"operation\"] + \": \" + $parameter[\"resource\"] }}',\n\t\tdescription: 'Interact with Microsoft SharePoint API',\n\t\tdefaults: {\n\t\t\tname: 'Microsoft SharePoint',\n\t\t},\n\t\tusableAsTool: true,\n\t\tinputs: [NodeConnectionTypes.Main],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'microsoftSharePointOAuth2Api',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tbaseURL: '=https://{{ $credentials.subdomain }}.sharepoint.com/_api/v2.0/',\n\t\t\tignoreHttpStatusErrors: true,\n\t\t},\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Resource',\n\t\t\t\tname: 'resource',\n\t\t\t\ttype: 'options',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File',\n\t\t\t\t\t\tvalue: 'file',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Item',\n\t\t\t\t\t\tvalue: 'item',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'List',\n\t\t\t\t\t\tvalue: 'list',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'file',\n\t\t\t},\n\n\t\t\t...file.description,\n\t\t\t...item.description,\n\t\t\t...list.description,\n\t\t],\n\t};\n\n\tmethods = {\n\t\tlistSearch,\n\t\tresourceMapping,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAoC;AAEpC,0BAAiC;AACjC,qBAA4C;AAErC,MAAM,oBAAyC;AAAA,EAA/C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACP;AAAA,MACA,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,UAAU;AAAA,MACV,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,cAAc;AAAA,MACd,QAAQ,CAAC,wCAAoB,IAAI;AAAA,MACjC,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,iBAAiB;AAAA,QAChB,SAAS;AAAA,QACT,wBAAwB;AAAA,MACzB;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,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,UACD;AAAA,UACA,SAAS;AAAA,QACV;AAAA,QAEA,GAAG,yBAAK;AAAA,QACR,GAAG,yBAAK;AAAA,QACR,GAAG,yBAAK;AAAA,MACT;AAAA,IACD;AAEA,mBAAU;AAAA,MACT;AAAA,MACA;AAAA,IACD;AAAA;AACD;","names":[]}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-base.microsoftSharePoint",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["ECM"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://docs.n8n.io/integrations/builtin/credentials/microsoft/"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftsharepoint/"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var common_descriptions_exports = {};
20
+ __export(common_descriptions_exports, {
21
+ fileRLC: () => fileRLC,
22
+ folderRLC: () => folderRLC,
23
+ itemRLC: () => itemRLC,
24
+ listRLC: () => listRLC,
25
+ siteRLC: () => siteRLC,
26
+ untilFolderSelected: () => untilFolderSelected,
27
+ untilItemSelected: () => untilItemSelected,
28
+ untilListSelected: () => untilListSelected,
29
+ untilSiteSelected: () => untilSiteSelected
30
+ });
31
+ module.exports = __toCommonJS(common_descriptions_exports);
32
+ const untilFolderSelected = { folder: [""] };
33
+ const untilItemSelected = { item: [""] };
34
+ const untilListSelected = { list: [""] };
35
+ const untilSiteSelected = { site: [""] };
36
+ const fileRLC = {
37
+ displayName: "File",
38
+ name: "file",
39
+ default: {
40
+ mode: "list",
41
+ value: ""
42
+ },
43
+ description: "Select the file to download",
44
+ modes: [
45
+ {
46
+ displayName: "From List",
47
+ name: "list",
48
+ type: "list",
49
+ typeOptions: {
50
+ searchListMethod: "getFiles",
51
+ searchable: true
52
+ }
53
+ },
54
+ {
55
+ displayName: "By ID",
56
+ name: "id",
57
+ placeholder: "e.g. mysite",
58
+ type: "string"
59
+ }
60
+ ],
61
+ placeholder: "eg. my-file.pdf",
62
+ required: true,
63
+ type: "resourceLocator"
64
+ };
65
+ const folderRLC = {
66
+ displayName: "Parent Folder",
67
+ name: "folder",
68
+ default: {
69
+ mode: "list",
70
+ value: ""
71
+ },
72
+ description: "Select the folder to update the file in",
73
+ modes: [
74
+ {
75
+ displayName: "From List",
76
+ name: "list",
77
+ type: "list",
78
+ typeOptions: {
79
+ searchListMethod: "getFolders",
80
+ searchable: true
81
+ }
82
+ },
83
+ {
84
+ displayName: "By ID",
85
+ name: "id",
86
+ placeholder: "e.g. myfolder",
87
+ type: "string"
88
+ }
89
+ ],
90
+ placeholder: "/ (Library root)",
91
+ required: true,
92
+ type: "resourceLocator"
93
+ };
94
+ const itemRLC = {
95
+ displayName: "Item",
96
+ name: "item",
97
+ default: {
98
+ mode: "list",
99
+ value: ""
100
+ },
101
+ description: "Select the item you want to delete",
102
+ modes: [
103
+ {
104
+ displayName: "From List",
105
+ name: "list",
106
+ type: "list",
107
+ typeOptions: {
108
+ searchListMethod: "getItems",
109
+ searchable: true
110
+ }
111
+ },
112
+ {
113
+ displayName: "By ID",
114
+ name: "id",
115
+ placeholder: "e.g. 1",
116
+ type: "string"
117
+ }
118
+ ],
119
+ required: true,
120
+ type: "resourceLocator"
121
+ };
122
+ const listRLC = {
123
+ displayName: "List",
124
+ name: "list",
125
+ default: {
126
+ mode: "list",
127
+ value: ""
128
+ },
129
+ description: "Select the list you want to retrieve",
130
+ modes: [
131
+ {
132
+ displayName: "From List",
133
+ name: "list",
134
+ type: "list",
135
+ typeOptions: {
136
+ searchListMethod: "getLists",
137
+ searchable: true
138
+ }
139
+ },
140
+ {
141
+ displayName: "By ID",
142
+ name: "id",
143
+ placeholder: "e.g. mylist",
144
+ type: "string"
145
+ }
146
+ ],
147
+ required: true,
148
+ type: "resourceLocator"
149
+ };
150
+ const siteRLC = {
151
+ displayName: "Site",
152
+ name: "site",
153
+ default: {
154
+ mode: "list",
155
+ value: ""
156
+ },
157
+ description: "Select the site to retrieve folders from",
158
+ modes: [
159
+ {
160
+ displayName: "From List",
161
+ name: "list",
162
+ type: "list",
163
+ typeOptions: {
164
+ searchListMethod: "getSites",
165
+ searchable: true
166
+ }
167
+ },
168
+ {
169
+ displayName: "By ID",
170
+ name: "id",
171
+ placeholder: "e.g. mysite",
172
+ type: "string"
173
+ }
174
+ ],
175
+ required: true,
176
+ type: "resourceLocator"
177
+ };
178
+ // Annotate the CommonJS export names for ESM import in node:
179
+ 0 && (module.exports = {
180
+ fileRLC,
181
+ folderRLC,
182
+ itemRLC,
183
+ listRLC,
184
+ siteRLC,
185
+ untilFolderSelected,
186
+ untilItemSelected,
187
+ untilListSelected,
188
+ untilSiteSelected
189
+ });
190
+ //# sourceMappingURL=common.descriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/Microsoft/SharePoint/descriptions/common.descriptions.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nexport const untilFolderSelected = { folder: [''] };\n\nexport const untilItemSelected = { item: [''] };\n\nexport const untilListSelected = { list: [''] };\n\nexport const untilSiteSelected = { site: [''] };\n\nexport const fileRLC: INodeProperties = {\n\tdisplayName: 'File',\n\tname: 'file',\n\tdefault: {\n\t\tmode: 'list',\n\t\tvalue: '',\n\t},\n\tdescription: 'Select the file to download',\n\tmodes: [\n\t\t{\n\t\t\tdisplayName: 'From List',\n\t\t\tname: 'list',\n\t\t\ttype: 'list',\n\t\t\ttypeOptions: {\n\t\t\t\tsearchListMethod: 'getFiles',\n\t\t\t\tsearchable: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'By ID',\n\t\t\tname: 'id',\n\t\t\tplaceholder: 'e.g. mysite',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n\tplaceholder: 'eg. my-file.pdf',\n\trequired: true,\n\ttype: 'resourceLocator',\n};\n\nexport const folderRLC: INodeProperties = {\n\tdisplayName: 'Parent Folder',\n\tname: 'folder',\n\tdefault: {\n\t\tmode: 'list',\n\t\tvalue: '',\n\t},\n\tdescription: 'Select the folder to update the file in',\n\tmodes: [\n\t\t{\n\t\t\tdisplayName: 'From List',\n\t\t\tname: 'list',\n\t\t\ttype: 'list',\n\t\t\ttypeOptions: {\n\t\t\t\tsearchListMethod: 'getFolders',\n\t\t\t\tsearchable: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'By ID',\n\t\t\tname: 'id',\n\t\t\tplaceholder: 'e.g. myfolder',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n\tplaceholder: '/ (Library root)',\n\trequired: true,\n\ttype: 'resourceLocator',\n};\n\nexport const itemRLC: INodeProperties = {\n\tdisplayName: 'Item',\n\tname: 'item',\n\tdefault: {\n\t\tmode: 'list',\n\t\tvalue: '',\n\t},\n\tdescription: 'Select the item you want to delete',\n\tmodes: [\n\t\t{\n\t\t\tdisplayName: 'From List',\n\t\t\tname: 'list',\n\t\t\ttype: 'list',\n\t\t\ttypeOptions: {\n\t\t\t\tsearchListMethod: 'getItems',\n\t\t\t\tsearchable: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'By ID',\n\t\t\tname: 'id',\n\t\t\tplaceholder: 'e.g. 1',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n\trequired: true,\n\ttype: 'resourceLocator',\n};\n\nexport const listRLC: INodeProperties = {\n\tdisplayName: 'List',\n\tname: 'list',\n\tdefault: {\n\t\tmode: 'list',\n\t\tvalue: '',\n\t},\n\tdescription: 'Select the list you want to retrieve',\n\tmodes: [\n\t\t{\n\t\t\tdisplayName: 'From List',\n\t\t\tname: 'list',\n\t\t\ttype: 'list',\n\t\t\ttypeOptions: {\n\t\t\t\tsearchListMethod: 'getLists',\n\t\t\t\tsearchable: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'By ID',\n\t\t\tname: 'id',\n\t\t\tplaceholder: 'e.g. mylist',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n\trequired: true,\n\ttype: 'resourceLocator',\n};\n\nexport const siteRLC: INodeProperties = {\n\tdisplayName: 'Site',\n\tname: 'site',\n\tdefault: {\n\t\tmode: 'list',\n\t\tvalue: '',\n\t},\n\tdescription: 'Select the site to retrieve folders from',\n\tmodes: [\n\t\t{\n\t\t\tdisplayName: 'From List',\n\t\t\tname: 'list',\n\t\t\ttype: 'list',\n\t\t\ttypeOptions: {\n\t\t\t\tsearchListMethod: 'getSites',\n\t\t\t\tsearchable: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'By ID',\n\t\t\tname: 'id',\n\t\t\tplaceholder: 'e.g. mysite',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n\trequired: true,\n\ttype: 'resourceLocator',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,EAAE,EAAE;AAE3C,MAAM,oBAAoB,EAAE,MAAM,CAAC,EAAE,EAAE;AAEvC,MAAM,oBAAoB,EAAE,MAAM,CAAC,EAAE,EAAE;AAEvC,MAAM,oBAAoB,EAAE,MAAM,CAAC,EAAE,EAAE;AAEvC,MAAM,UAA2B;AAAA,EACvC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EACR;AAAA,EACA,aAAa;AAAA,EACb,OAAO;AAAA,IACN;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,QACZ,kBAAkB;AAAA,QAClB,YAAY;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA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A,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,UAAU;AAAA,EACV,MAAM;AACP;AAEO,MAAM,UAA2B;AAAA,EACvC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EACR;AAAA,EACA,aAAa;AAAA,EACb,OAAO;AAAA,IACN;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,QACZ,kBAAkB;AAAA,QAClB,YAAY;AAAA,MACb;AAAA,IACD;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,UAAU;AAAA,EACV,MAAM;AACP;","names":[]}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var File_resource_exports = {};
30
+ __export(File_resource_exports, {
31
+ description: () => description
32
+ });
33
+ module.exports = __toCommonJS(File_resource_exports);
34
+ var download = __toESM(require("./download.operation"));
35
+ var update = __toESM(require("./update.operation"));
36
+ var upload = __toESM(require("./upload.operation"));
37
+ var import_utils = require("../../helpers/utils");
38
+ const description = [
39
+ {
40
+ displayName: "Operation",
41
+ name: "operation",
42
+ type: "options",
43
+ noDataExpression: true,
44
+ displayOptions: {
45
+ show: {
46
+ resource: ["file"]
47
+ }
48
+ },
49
+ options: [
50
+ {
51
+ name: "Download",
52
+ value: "download",
53
+ description: "Download a file",
54
+ routing: {
55
+ request: {
56
+ method: "GET",
57
+ url: '=/sites/{{ $parameter["site"] }}/drive/items/{{ $parameter["file"] }}/content',
58
+ json: false,
59
+ encoding: "arraybuffer"
60
+ },
61
+ output: {
62
+ postReceive: [import_utils.handleErrorPostReceive, import_utils.downloadFilePostReceive]
63
+ }
64
+ },
65
+ action: "Download file"
66
+ },
67
+ {
68
+ name: "Update",
69
+ value: "update",
70
+ description: "Update a file",
71
+ routing: {
72
+ request: {
73
+ method: "PATCH",
74
+ url: '=/sites/{{ $parameter["site"] }}/drive/items/{{ $parameter["file"] }}'
75
+ },
76
+ output: {
77
+ postReceive: [import_utils.handleErrorPostReceive]
78
+ }
79
+ },
80
+ action: "Update file"
81
+ },
82
+ {
83
+ name: "Upload",
84
+ value: "upload",
85
+ description: "Upload an existing file",
86
+ routing: {
87
+ request: {
88
+ method: "PUT",
89
+ url: '=/sites/{{ $parameter["site"] }}/drive/items/{{ $parameter["folder"] }}:/{{ $parameter["fileName"] }}:/content'
90
+ },
91
+ output: {
92
+ postReceive: [import_utils.handleErrorPostReceive]
93
+ }
94
+ },
95
+ action: "Upload file"
96
+ }
97
+ ],
98
+ default: "download"
99
+ },
100
+ ...download.description,
101
+ ...update.description,
102
+ ...upload.description
103
+ ];
104
+ // Annotate the CommonJS export names for ESM import in node:
105
+ 0 && (module.exports = {
106
+ description
107
+ });
108
+ //# sourceMappingURL=File.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../nodes/Microsoft/SharePoint/descriptions/file/File.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as download from './download.operation';\nimport * as update from './update.operation';\nimport * as upload from './upload.operation';\nimport { downloadFilePostReceive, handleErrorPostReceive } from '../../helpers/utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['file'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Download',\n\t\t\t\tvalue: 'download',\n\t\t\t\tdescription: 'Download a file',\n\t\t\t\trouting: {\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\turl: '=/sites/{{ $parameter[\"site\"] }}/drive/items/{{ $parameter[\"file\"] }}/content',\n\t\t\t\t\t\tjson: false,\n\t\t\t\t\t\tencoding: 'arraybuffer',\n\t\t\t\t\t},\n\t\t\t\t\toutput: {\n\t\t\t\t\t\tpostReceive: [handleErrorPostReceive, downloadFilePostReceive],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\taction: 'Download file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Update',\n\t\t\t\tvalue: 'update',\n\t\t\t\tdescription: 'Update a file',\n\t\t\t\trouting: {\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tmethod: 'PATCH',\n\t\t\t\t\t\turl: '=/sites/{{ $parameter[\"site\"] }}/drive/items/{{ $parameter[\"file\"] }}',\n\t\t\t\t\t},\n\t\t\t\t\toutput: {\n\t\t\t\t\t\tpostReceive: [handleErrorPostReceive],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\taction: 'Update file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Upload',\n\t\t\t\tvalue: 'upload',\n\t\t\t\tdescription: 'Upload an existing file',\n\t\t\t\trouting: {\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\turl: '=/sites/{{ $parameter[\"site\"] }}/drive/items/{{ $parameter[\"folder\"] }}:/{{ $parameter[\"fileName\"] }}:/content',\n\t\t\t\t\t},\n\t\t\t\t\toutput: {\n\t\t\t\t\t\tpostReceive: [handleErrorPostReceive],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\taction: 'Upload file',\n\t\t\t},\n\t\t],\n\t\tdefault: 'download',\n\t},\n\n\t...download.description,\n\t...update.description,\n\t...upload.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAA0B;AAC1B,aAAwB;AACxB,aAAwB;AACxB,mBAAgE;AAEzD,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,SAAS;AAAA,UACR,SAAS;AAAA,YACR,QAAQ;AAAA,YACR,KAAK;AAAA,YACL,MAAM;AAAA,YACN,UAAU;AAAA,UACX;AAAA,UACA,QAAQ;AAAA,YACP,aAAa,CAAC,qCAAwB,oCAAuB;AAAA,UAC9D;AAAA,QACD;AAAA,QACA,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,SAAS;AAAA,UACR,SAAS;AAAA,YACR,QAAQ;AAAA,YACR,KAAK;AAAA,UACN;AAAA,UACA,QAAQ;AAAA,YACP,aAAa,CAAC,mCAAsB;AAAA,UACrC;AAAA,QACD;AAAA,QACA,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,SAAS;AAAA,UACR,SAAS;AAAA,YACR,QAAQ;AAAA,YACR,KAAK;AAAA,UACN;AAAA,UACA,QAAQ;AAAA,YACP,aAAa,CAAC,mCAAsB;AAAA,UACrC;AAAA,QACD;AAAA,QACA,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EAEA,GAAG,SAAS;AAAA,EACZ,GAAG,OAAO;AAAA,EACV,GAAG,OAAO;AACX;","names":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var download_operation_exports = {};
20
+ __export(download_operation_exports, {
21
+ description: () => description
22
+ });
23
+ module.exports = __toCommonJS(download_operation_exports);
24
+ var import_n8n_workflow = require("n8n-workflow");
25
+ var import_common = require("../common.descriptions");
26
+ const properties = [
27
+ {
28
+ ...import_common.siteRLC,
29
+ description: "Select the site to retrieve folders from"
30
+ },
31
+ {
32
+ ...import_common.folderRLC,
33
+ description: "Select the folder to download the file from",
34
+ displayOptions: {
35
+ hide: {
36
+ ...import_common.untilSiteSelected
37
+ }
38
+ }
39
+ },
40
+ {
41
+ ...import_common.fileRLC,
42
+ description: "Select the file to download",
43
+ displayOptions: {
44
+ hide: {
45
+ ...import_common.untilSiteSelected,
46
+ ...import_common.untilFolderSelected
47
+ }
48
+ }
49
+ }
50
+ ];
51
+ const displayOptions = {
52
+ show: {
53
+ resource: ["file"],
54
+ operation: ["download"]
55
+ }
56
+ };
57
+ const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ description
61
+ });
62
+ //# sourceMappingURL=download.operation.js.map