n8n-nodes-hudu 1.4.3 → 1.4.5

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 (306) hide show
  1. package/README.md +18 -53
  2. package/dist/credentials/HuduApi.credentials.js +45 -45
  3. package/dist/index.js +13 -13
  4. package/dist/nodes/Hudu/Hudu.node.js +338 -325
  5. package/dist/nodes/Hudu/Hudu.node.js.map +1 -1
  6. package/dist/nodes/Hudu/Hudu.node.json +1 -1
  7. package/dist/nodes/Hudu/Hudu.node.ts +448 -442
  8. package/dist/nodes/Hudu/descriptions/activity_logs.description.js +170 -170
  9. package/dist/nodes/Hudu/descriptions/api_info.description.js +26 -26
  10. package/dist/nodes/Hudu/descriptions/articles.description.js +701 -675
  11. package/dist/nodes/Hudu/descriptions/articles.description.js.map +1 -1
  12. package/dist/nodes/Hudu/descriptions/articles.description.ts +45 -15
  13. package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.js +442 -442
  14. package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.js.map +1 -1
  15. package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.ts +2 -2
  16. package/dist/nodes/Hudu/descriptions/asset_layouts.description.js +589 -596
  17. package/dist/nodes/Hudu/descriptions/asset_layouts.description.js.map +1 -1
  18. package/dist/nodes/Hudu/descriptions/asset_layouts.description.ts +1 -7
  19. package/dist/nodes/Hudu/descriptions/asset_passwords.description.js +589 -589
  20. package/dist/nodes/Hudu/descriptions/asset_passwords.description.js.map +1 -1
  21. package/dist/nodes/Hudu/descriptions/asset_passwords.description.ts +2 -2
  22. package/dist/nodes/Hudu/descriptions/assets.description.js +565 -565
  23. package/dist/nodes/Hudu/descriptions/cards.description.js +181 -181
  24. package/dist/nodes/Hudu/descriptions/companies.description.js +667 -667
  25. package/dist/nodes/Hudu/descriptions/companies.description.js.map +1 -1
  26. package/dist/nodes/Hudu/descriptions/companies.description.ts +2 -2
  27. package/dist/nodes/Hudu/descriptions/expirations.description.js +137 -137
  28. package/dist/nodes/Hudu/descriptions/folders.description.js +305 -305
  29. package/dist/nodes/Hudu/descriptions/folders.description.js.map +1 -1
  30. package/dist/nodes/Hudu/descriptions/folders.description.ts +2 -2
  31. package/dist/nodes/Hudu/descriptions/groups.description.js +114 -0
  32. package/dist/nodes/Hudu/descriptions/groups.description.js.map +1 -0
  33. package/dist/nodes/Hudu/descriptions/groups.description.ts +115 -0
  34. package/dist/nodes/Hudu/descriptions/index.js +46 -45
  35. package/dist/nodes/Hudu/descriptions/index.js.map +1 -1
  36. package/dist/nodes/Hudu/descriptions/index.ts +1 -0
  37. package/dist/nodes/Hudu/descriptions/ip_addresses.description.js +743 -743
  38. package/dist/nodes/Hudu/descriptions/ip_addresses.description.js.map +1 -1
  39. package/dist/nodes/Hudu/descriptions/ip_addresses.description.ts +20 -19
  40. package/dist/nodes/Hudu/descriptions/list_options.description.js +90 -90
  41. package/dist/nodes/Hudu/descriptions/lists.description.js +156 -156
  42. package/dist/nodes/Hudu/descriptions/magic_dash.description.js +252 -252
  43. package/dist/nodes/Hudu/descriptions/magic_dash.description.js.map +1 -1
  44. package/dist/nodes/Hudu/descriptions/magic_dash.description.ts +270 -270
  45. package/dist/nodes/Hudu/descriptions/matchers.description.js +202 -202
  46. package/dist/nodes/Hudu/descriptions/matchers.description.js.map +1 -1
  47. package/dist/nodes/Hudu/descriptions/matchers.description.ts +2 -2
  48. package/dist/nodes/Hudu/descriptions/networks.description.js +759 -759
  49. package/dist/nodes/Hudu/descriptions/networks.description.js.map +1 -1
  50. package/dist/nodes/Hudu/descriptions/networks.description.ts +17 -17
  51. package/dist/nodes/Hudu/descriptions/passwordFolders.descriptions.js +297 -119
  52. package/dist/nodes/Hudu/descriptions/passwordFolders.descriptions.js.map +1 -1
  53. package/dist/nodes/Hudu/descriptions/passwordFolders.descriptions.ts +183 -2
  54. package/dist/nodes/Hudu/descriptions/procedure_tasks.description.js +378 -378
  55. package/dist/nodes/Hudu/descriptions/procedure_tasks.description.js.map +1 -1
  56. package/dist/nodes/Hudu/descriptions/procedure_tasks.description.ts +2 -2
  57. package/dist/nodes/Hudu/descriptions/procedures.description.js +471 -471
  58. package/dist/nodes/Hudu/descriptions/procedures.description.js.map +1 -1
  59. package/dist/nodes/Hudu/descriptions/procedures.description.ts +2 -2
  60. package/dist/nodes/Hudu/descriptions/public_photos.description.js +214 -214
  61. package/dist/nodes/Hudu/descriptions/rack_storage_items.description.js +334 -334
  62. package/dist/nodes/Hudu/descriptions/rack_storage_items.description.js.map +1 -1
  63. package/dist/nodes/Hudu/descriptions/rack_storage_items.description.ts +2 -2
  64. package/dist/nodes/Hudu/descriptions/rack_storages.description.js +609 -609
  65. package/dist/nodes/Hudu/descriptions/rack_storages.description.js.map +1 -1
  66. package/dist/nodes/Hudu/descriptions/rack_storages.description.ts +2 -2
  67. package/dist/nodes/Hudu/descriptions/relations.description.js +226 -226
  68. package/dist/nodes/Hudu/descriptions/resources.js +133 -129
  69. package/dist/nodes/Hudu/descriptions/resources.js.map +1 -1
  70. package/dist/nodes/Hudu/descriptions/resources.ts +8 -4
  71. package/dist/nodes/Hudu/descriptions/uploads.description.js +84 -84
  72. package/dist/nodes/Hudu/descriptions/users.description.js +179 -179
  73. package/dist/nodes/Hudu/descriptions/vlan_zones.description.js +278 -278
  74. package/dist/nodes/Hudu/descriptions/vlan_zones.description.js.map +1 -1
  75. package/dist/nodes/Hudu/descriptions/vlan_zones.description.ts +2 -2
  76. package/dist/nodes/Hudu/descriptions/vlans.description.js +348 -324
  77. package/dist/nodes/Hudu/descriptions/vlans.description.js.map +1 -1
  78. package/dist/nodes/Hudu/descriptions/vlans.description.ts +50 -26
  79. package/dist/nodes/Hudu/descriptions/websites.description.js +865 -865
  80. package/dist/nodes/Hudu/descriptions/websites.description.js.map +1 -1
  81. package/dist/nodes/Hudu/descriptions/websites.description.ts +10 -10
  82. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFieldValues.js +65 -66
  83. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFieldValues.js.map +1 -1
  84. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFieldValues.ts +1 -1
  85. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.js +229 -227
  86. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.js.map +1 -1
  87. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.ts +3 -0
  88. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayouts.js +40 -41
  89. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayouts.js.map +1 -1
  90. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getCustomFieldsLayoutFields.js +54 -55
  91. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getCustomFieldsLayoutFields.js.map +1 -1
  92. package/dist/nodes/Hudu/optionLoaders/asset_layouts/getCustomFieldsLayoutFields.ts +1 -1
  93. package/dist/nodes/Hudu/optionLoaders/asset_layouts/index.js +20 -20
  94. package/dist/nodes/Hudu/optionLoaders/assets/index.js +1 -18
  95. package/dist/nodes/Hudu/optionLoaders/assets/index.js.map +1 -1
  96. package/dist/nodes/Hudu/optionLoaders/assets/index.ts +1 -2
  97. package/dist/nodes/Hudu/optionLoaders/companies/getCompanies.js +32 -33
  98. package/dist/nodes/Hudu/optionLoaders/companies/getCompanies.js.map +1 -1
  99. package/dist/nodes/Hudu/optionLoaders/companies/index.js +17 -17
  100. package/dist/nodes/Hudu/optionLoaders/groups/index.js +18 -0
  101. package/dist/nodes/Hudu/optionLoaders/groups/index.js.map +1 -0
  102. package/dist/nodes/Hudu/optionLoaders/groups/index.ts +3 -0
  103. package/dist/nodes/Hudu/optionLoaders/groups/loadGroups.js +24 -0
  104. package/dist/nodes/Hudu/optionLoaders/groups/loadGroups.js.map +1 -0
  105. package/dist/nodes/Hudu/optionLoaders/groups/loadGroups.ts +43 -0
  106. package/dist/nodes/Hudu/optionLoaders/index.js +22 -20
  107. package/dist/nodes/Hudu/optionLoaders/index.js.map +1 -1
  108. package/dist/nodes/Hudu/optionLoaders/index.ts +3 -0
  109. package/dist/nodes/Hudu/optionLoaders/lists/getLists.js +29 -30
  110. package/dist/nodes/Hudu/optionLoaders/lists/getLists.js.map +1 -1
  111. package/dist/nodes/Hudu/optionLoaders/lists/index.js +17 -17
  112. package/dist/nodes/Hudu/optionLoaders/users/getUsers.js +38 -39
  113. package/dist/nodes/Hudu/optionLoaders/users/getUsers.js.map +1 -1
  114. package/dist/nodes/Hudu/optionLoaders/users/index.js +17 -17
  115. package/dist/nodes/Hudu/optionLoaders/vlan_zones/index.js +18 -0
  116. package/dist/nodes/Hudu/optionLoaders/vlan_zones/index.js.map +1 -0
  117. package/dist/nodes/Hudu/optionLoaders/vlan_zones/index.ts +3 -0
  118. package/dist/nodes/Hudu/optionLoaders/vlan_zones/loadVlanZones.js +18 -0
  119. package/dist/nodes/Hudu/optionLoaders/vlan_zones/loadVlanZones.js.map +1 -0
  120. package/dist/nodes/Hudu/optionLoaders/vlan_zones/loadVlanZones.ts +30 -0
  121. package/dist/nodes/Hudu/resources/activity_logs/activity_logs.handler.js +17 -18
  122. package/dist/nodes/Hudu/resources/activity_logs/activity_logs.handler.js.map +1 -1
  123. package/dist/nodes/Hudu/resources/activity_logs/activity_logs.types.js +2 -2
  124. package/dist/nodes/Hudu/resources/api_info/api_info.handler.js +14 -15
  125. package/dist/nodes/Hudu/resources/api_info/api_info.handler.js.map +1 -1
  126. package/dist/nodes/Hudu/resources/api_info/api_info.types.js +2 -2
  127. package/dist/nodes/Hudu/resources/articles/articles.handler.js +214 -206
  128. package/dist/nodes/Hudu/resources/articles/articles.handler.js.map +1 -1
  129. package/dist/nodes/Hudu/resources/articles/articles.handler.ts +18 -1
  130. package/dist/nodes/Hudu/resources/articles/articles.types.js +8 -8
  131. package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.handler.js +100 -101
  132. package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.handler.js.map +1 -1
  133. package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.handler.ts +2 -2
  134. package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.types.js +2 -2
  135. package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.handler.js +92 -93
  136. package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.handler.js.map +1 -1
  137. package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.handler.ts +1 -1
  138. package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.types.js +2 -2
  139. package/dist/nodes/Hudu/resources/asset_passwords/asset_passwords.handler.js +106 -107
  140. package/dist/nodes/Hudu/resources/asset_passwords/asset_passwords.handler.js.map +1 -1
  141. package/dist/nodes/Hudu/resources/asset_passwords/asset_passwords.handler.ts +2 -2
  142. package/dist/nodes/Hudu/resources/asset_passwords/asset_passwords.types.js +2 -2
  143. package/dist/nodes/Hudu/resources/assets/assets.handler.js +227 -227
  144. package/dist/nodes/Hudu/resources/assets/assets.handler.js.map +1 -1
  145. package/dist/nodes/Hudu/resources/assets/assets.handler.ts +6 -5
  146. package/dist/nodes/Hudu/resources/assets/assets.types.js +2 -2
  147. package/dist/nodes/Hudu/resources/cards/cards.handler.js +21 -22
  148. package/dist/nodes/Hudu/resources/cards/cards.handler.js.map +1 -1
  149. package/dist/nodes/Hudu/resources/cards/cards.types.js +2 -2
  150. package/dist/nodes/Hudu/resources/companies/companies.handler.js +94 -95
  151. package/dist/nodes/Hudu/resources/companies/companies.handler.js.map +1 -1
  152. package/dist/nodes/Hudu/resources/companies/companies.handler.ts +2 -2
  153. package/dist/nodes/Hudu/resources/companies/companies.types.js +2 -2
  154. package/dist/nodes/Hudu/resources/expirations/expirations.handler.js +19 -20
  155. package/dist/nodes/Hudu/resources/expirations/expirations.handler.js.map +1 -1
  156. package/dist/nodes/Hudu/resources/expirations/expirations.types.js +2 -2
  157. package/dist/nodes/Hudu/resources/folders/folders.handler.js +91 -92
  158. package/dist/nodes/Hudu/resources/folders/folders.handler.js.map +1 -1
  159. package/dist/nodes/Hudu/resources/folders/folders.handler.ts +3 -3
  160. package/dist/nodes/Hudu/resources/folders/folders.types.js +13 -13
  161. package/dist/nodes/Hudu/resources/groups/groups.handler.js +26 -0
  162. package/dist/nodes/Hudu/resources/groups/groups.handler.js.map +1 -0
  163. package/dist/nodes/Hudu/resources/groups/groups.handler.ts +44 -0
  164. package/dist/nodes/Hudu/resources/groups/groups.types.js +3 -0
  165. package/dist/nodes/Hudu/resources/groups/groups.types.js.map +1 -0
  166. package/dist/nodes/Hudu/resources/groups/groups.types.ts +18 -0
  167. package/dist/nodes/Hudu/resources/index.js +76 -74
  168. package/dist/nodes/Hudu/resources/index.js.map +1 -1
  169. package/dist/nodes/Hudu/resources/index.ts +2 -0
  170. package/dist/nodes/Hudu/resources/ip_addresses/ip_addresses.handler.js +131 -100
  171. package/dist/nodes/Hudu/resources/ip_addresses/ip_addresses.handler.js.map +1 -1
  172. package/dist/nodes/Hudu/resources/ip_addresses/ip_addresses.handler.ts +41 -4
  173. package/dist/nodes/Hudu/resources/ip_addresses/ip_addresses.types.js +2 -2
  174. package/dist/nodes/Hudu/resources/list_options/list_options.handler.js +218 -219
  175. package/dist/nodes/Hudu/resources/list_options/list_options.handler.js.map +1 -1
  176. package/dist/nodes/Hudu/resources/list_options/list_options.handler.ts +1 -0
  177. package/dist/nodes/Hudu/resources/list_options/list_options.types.js +2 -2
  178. package/dist/nodes/Hudu/resources/lists/lists.handler.js +65 -66
  179. package/dist/nodes/Hudu/resources/lists/lists.handler.js.map +1 -1
  180. package/dist/nodes/Hudu/resources/lists/lists.handler.ts +1 -0
  181. package/dist/nodes/Hudu/resources/lists/lists.types.js +2 -2
  182. package/dist/nodes/Hudu/resources/magic_dash/magic_dash.handler.js +56 -57
  183. package/dist/nodes/Hudu/resources/magic_dash/magic_dash.handler.js.map +1 -1
  184. package/dist/nodes/Hudu/resources/magic_dash/magic_dash.handler.ts +85 -85
  185. package/dist/nodes/Hudu/resources/magic_dash/magic_dash.types.js +2 -2
  186. package/dist/nodes/Hudu/resources/matchers/matchers.handler.js +45 -46
  187. package/dist/nodes/Hudu/resources/matchers/matchers.handler.js.map +1 -1
  188. package/dist/nodes/Hudu/resources/matchers/matchers.handler.ts +1 -1
  189. package/dist/nodes/Hudu/resources/matchers/matchers.types.js +2 -2
  190. package/dist/nodes/Hudu/resources/networks/networks.handler.js +117 -106
  191. package/dist/nodes/Hudu/resources/networks/networks.handler.js.map +1 -1
  192. package/dist/nodes/Hudu/resources/networks/networks.handler.ts +12 -4
  193. package/dist/nodes/Hudu/resources/networks/networks.types.js +2 -2
  194. package/dist/nodes/Hudu/resources/password_folders/password_folders.handler.js +100 -28
  195. package/dist/nodes/Hudu/resources/password_folders/password_folders.handler.js.map +1 -1
  196. package/dist/nodes/Hudu/resources/password_folders/password_folders.handler.ts +90 -2
  197. package/dist/nodes/Hudu/resources/password_folders/password_folders.types.js +2 -2
  198. package/dist/nodes/Hudu/resources/password_folders/password_folders.types.ts +3 -1
  199. package/dist/nodes/Hudu/resources/procedure_tasks/procedure_tasks.handler.js +52 -53
  200. package/dist/nodes/Hudu/resources/procedure_tasks/procedure_tasks.handler.js.map +1 -1
  201. package/dist/nodes/Hudu/resources/procedure_tasks/procedure_tasks.handler.ts +2 -2
  202. package/dist/nodes/Hudu/resources/procedure_tasks/procedure_tasks.types.js +2 -2
  203. package/dist/nodes/Hudu/resources/procedures/procedures.handler.js +116 -117
  204. package/dist/nodes/Hudu/resources/procedures/procedures.handler.js.map +1 -1
  205. package/dist/nodes/Hudu/resources/procedures/procedures.handler.ts +2 -2
  206. package/dist/nodes/Hudu/resources/procedures/procedures.types.js +2 -2
  207. package/dist/nodes/Hudu/resources/public_photos/public_photos.handler.js +93 -94
  208. package/dist/nodes/Hudu/resources/public_photos/public_photos.handler.js.map +1 -1
  209. package/dist/nodes/Hudu/resources/public_photos/public_photos.types.js +2 -2
  210. package/dist/nodes/Hudu/resources/rack_storage_items/rack_storage_items.handler.js +48 -49
  211. package/dist/nodes/Hudu/resources/rack_storage_items/rack_storage_items.handler.js.map +1 -1
  212. package/dist/nodes/Hudu/resources/rack_storage_items/rack_storage_items.handler.ts +2 -2
  213. package/dist/nodes/Hudu/resources/rack_storage_items/rack_storage_items.types.js +2 -2
  214. package/dist/nodes/Hudu/resources/rack_storages/rack_storages.handler.js +91 -92
  215. package/dist/nodes/Hudu/resources/rack_storages/rack_storages.handler.js.map +1 -1
  216. package/dist/nodes/Hudu/resources/rack_storages/rack_storages.handler.ts +2 -2
  217. package/dist/nodes/Hudu/resources/rack_storages/rack_storages.types.js +2 -2
  218. package/dist/nodes/Hudu/resources/relations/relations.handler.js +35 -36
  219. package/dist/nodes/Hudu/resources/relations/relations.handler.js.map +1 -1
  220. package/dist/nodes/Hudu/resources/relations/relations.types.js +24 -24
  221. package/dist/nodes/Hudu/resources/uploads/uploads.handler.js +31 -32
  222. package/dist/nodes/Hudu/resources/uploads/uploads.handler.js.map +1 -1
  223. package/dist/nodes/Hudu/resources/uploads/uploads.types.js +2 -2
  224. package/dist/nodes/Hudu/resources/users/users.handler.js +21 -22
  225. package/dist/nodes/Hudu/resources/users/users.handler.js.map +1 -1
  226. package/dist/nodes/Hudu/resources/users/users.handler.ts +1 -1
  227. package/dist/nodes/Hudu/resources/users/users.types.js +2 -2
  228. package/dist/nodes/Hudu/resources/vlan_zones/vlan_zones.handler.js +152 -153
  229. package/dist/nodes/Hudu/resources/vlan_zones/vlan_zones.handler.js.map +1 -1
  230. package/dist/nodes/Hudu/resources/vlan_zones/vlan_zones.handler.ts +2 -2
  231. package/dist/nodes/Hudu/resources/vlan_zones/vlan_zones.types.js +2 -2
  232. package/dist/nodes/Hudu/resources/vlans/vlans.handler.js +152 -153
  233. package/dist/nodes/Hudu/resources/vlans/vlans.handler.js.map +1 -1
  234. package/dist/nodes/Hudu/resources/vlans/vlans.handler.ts +2 -2
  235. package/dist/nodes/Hudu/resources/vlans/vlans.types.js +2 -2
  236. package/dist/nodes/Hudu/resources/websites/websites.handler.js +119 -120
  237. package/dist/nodes/Hudu/resources/websites/websites.handler.js.map +1 -1
  238. package/dist/nodes/Hudu/resources/websites/websites.handler.ts +2 -2
  239. package/dist/nodes/Hudu/resources/websites/websites.types.js +2 -2
  240. package/dist/nodes/Hudu/utils/assetFieldUtils.js +328 -272
  241. package/dist/nodes/Hudu/utils/assetFieldUtils.js.map +1 -1
  242. package/dist/nodes/Hudu/utils/assetFieldUtils.ts +94 -30
  243. package/dist/nodes/Hudu/utils/constants.js +186 -185
  244. package/dist/nodes/Hudu/utils/constants.js.map +1 -1
  245. package/dist/nodes/Hudu/utils/constants.ts +1 -0
  246. package/dist/nodes/Hudu/utils/dateUtils.js +137 -138
  247. package/dist/nodes/Hudu/utils/dateUtils.js.map +1 -1
  248. package/dist/nodes/Hudu/utils/debugConfig.js +170 -170
  249. package/dist/nodes/Hudu/utils/debugConfig.js.map +1 -1
  250. package/dist/nodes/Hudu/utils/debugConfig.ts +3 -3
  251. package/dist/nodes/Hudu/utils/errorParser.js +55 -56
  252. package/dist/nodes/Hudu/utils/errorParser.js.map +1 -1
  253. package/dist/nodes/Hudu/utils/fieldErrorUtils.js +15 -16
  254. package/dist/nodes/Hudu/utils/fieldErrorUtils.js.map +1 -1
  255. package/dist/nodes/Hudu/utils/fieldTypeUtils.js +143 -144
  256. package/dist/nodes/Hudu/utils/fieldTypeUtils.js.map +1 -1
  257. package/dist/nodes/Hudu/utils/filterUtils.js +52 -53
  258. package/dist/nodes/Hudu/utils/filterUtils.js.map +1 -1
  259. package/dist/nodes/Hudu/utils/formatters.js +37 -38
  260. package/dist/nodes/Hudu/utils/formatters.js.map +1 -1
  261. package/dist/nodes/Hudu/utils/index.js +24 -24
  262. package/dist/nodes/Hudu/utils/markdownUtils.js +81 -0
  263. package/dist/nodes/Hudu/utils/markdownUtils.js.map +1 -0
  264. package/dist/nodes/Hudu/utils/markdownUtils.ts +119 -0
  265. package/dist/nodes/Hudu/utils/operations/archive.js +23 -24
  266. package/dist/nodes/Hudu/utils/operations/archive.js.map +1 -1
  267. package/dist/nodes/Hudu/utils/operations/cards.js +21 -22
  268. package/dist/nodes/Hudu/utils/operations/cards.js.map +1 -1
  269. package/dist/nodes/Hudu/utils/operations/companies.js +16 -17
  270. package/dist/nodes/Hudu/utils/operations/companies.js.map +1 -1
  271. package/dist/nodes/Hudu/utils/operations/create.js +18 -19
  272. package/dist/nodes/Hudu/utils/operations/create.js.map +1 -1
  273. package/dist/nodes/Hudu/utils/operations/delete.js +22 -23
  274. package/dist/nodes/Hudu/utils/operations/delete.js.map +1 -1
  275. package/dist/nodes/Hudu/utils/operations/get.js +21 -19
  276. package/dist/nodes/Hudu/utils/operations/get.js.map +1 -1
  277. package/dist/nodes/Hudu/utils/operations/get.ts +9 -0
  278. package/dist/nodes/Hudu/utils/operations/getAll.js +26 -27
  279. package/dist/nodes/Hudu/utils/operations/getAll.js.map +1 -1
  280. package/dist/nodes/Hudu/utils/operations/getCompanyIdForAsset.js +21 -22
  281. package/dist/nodes/Hudu/utils/operations/getCompanyIdForAsset.js.map +1 -1
  282. package/dist/nodes/Hudu/utils/operations/index.js +23 -23
  283. package/dist/nodes/Hudu/utils/operations/magic_dash.js +45 -46
  284. package/dist/nodes/Hudu/utils/operations/magic_dash.js.map +1 -1
  285. package/dist/nodes/Hudu/utils/operations/magic_dash.ts +68 -68
  286. package/dist/nodes/Hudu/utils/operations/matchers.js +22 -23
  287. package/dist/nodes/Hudu/utils/operations/matchers.js.map +1 -1
  288. package/dist/nodes/Hudu/utils/operations/procedures.js +26 -27
  289. package/dist/nodes/Hudu/utils/operations/procedures.js.map +1 -1
  290. package/dist/nodes/Hudu/utils/operations/systemInfo.js +7 -8
  291. package/dist/nodes/Hudu/utils/operations/systemInfo.js.map +1 -1
  292. package/dist/nodes/Hudu/utils/operations/update.js +19 -20
  293. package/dist/nodes/Hudu/utils/operations/update.js.map +1 -1
  294. package/dist/nodes/Hudu/utils/requestUtils.js +328 -308
  295. package/dist/nodes/Hudu/utils/requestUtils.js.map +1 -1
  296. package/dist/nodes/Hudu/utils/requestUtils.ts +518 -491
  297. package/dist/nodes/Hudu/utils/types.js +2 -2
  298. package/dist/nodes/Hudu/utils/validation.js +22 -23
  299. package/dist/nodes/Hudu/utils/validation.js.map +1 -1
  300. package/package.json +4 -4
  301. package/dist/nodes/Hudu/optionLoaders/assets/getAssets.js +0 -84
  302. package/dist/nodes/Hudu/optionLoaders/assets/getAssets.js.map +0 -1
  303. package/dist/nodes/Hudu/optionLoaders/assets/getAssets.ts +0 -136
  304. package/dist/nodes/Hudu/optionLoaders/assets/getAssetsForCompany.js +0 -45
  305. package/dist/nodes/Hudu/optionLoaders/assets/getAssetsForCompany.js.map +0 -1
  306. package/dist/nodes/Hudu/optionLoaders/assets/getAssetsForCompany.ts +0 -59
@@ -1,107 +1,118 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleNetworksOperation = void 0;
4
- const utils_1 = require("../../utils");
5
- const operations_1 = require("../../utils/operations");
6
- const constants_1 = require("../../utils/constants");
7
- async function handleNetworksOperation(operation, i) {
8
- const resourceEndpoint = '/networks';
9
- let responseData = {};
10
- switch (operation) {
11
- case 'create': {
12
- const body = {
13
- name: this.getNodeParameter('name', i),
14
- address: this.getNodeParameter('address', i),
15
- network_type: this.getNodeParameter('network_type', i),
16
- };
17
- const additionalFields = this.getNodeParameter('additionalFields', i);
18
- for (const [key, value] of Object.entries(additionalFields)) {
19
- if (value !== undefined && value !== null && value !== '') {
20
- if (key === 'company_id') {
21
- body[key] = Number.parseInt(value, 10);
22
- }
23
- else {
24
- body[key] = value;
25
- }
26
- }
27
- }
28
- responseData = await operations_1.handleCreateOperation.call(this, resourceEndpoint, { network: body });
29
- return responseData;
30
- }
31
- case 'delete': {
32
- const networkId = this.getNodeParameter('networkId', i);
33
- return await operations_1.handleDeleteOperation.call(this, resourceEndpoint, networkId);
34
- }
35
- case 'get': {
36
- const networkId = this.getNodeParameter('networkId', i);
37
- return await operations_1.handleGetOperation.call(this, resourceEndpoint, networkId);
38
- }
39
- case 'getAll': {
40
- const filters = this.getNodeParameter('filters', i);
41
- const returnAll = this.getNodeParameter('returnAll', i);
42
- const limit = this.getNodeParameter('limit', i, constants_1.HUDU_API_CONSTANTS.PAGE_SIZE);
43
- const qs = {
44
- ...filters,
45
- };
46
- if (filters.company_id !== undefined && filters.company_id !== null && filters.company_id !== '') {
47
- qs.company_id = (0, utils_1.validateCompanyId)(filters.company_id, this.getNode(), 'Company ID');
48
- }
49
- if (filters.archived !== undefined) {
50
- qs.archived = filters.archived;
51
- }
52
- if (filters.created_at) {
53
- const createdAtFilter = filters.created_at;
54
- if (createdAtFilter.range) {
55
- const rangeObj = createdAtFilter.range;
56
- filters.created_at = (0, utils_1.processDateRange)({
57
- range: {
58
- mode: rangeObj.mode,
59
- exact: rangeObj.exact,
60
- start: rangeObj.start,
61
- end: rangeObj.end,
62
- preset: rangeObj.preset,
63
- },
64
- });
65
- }
66
- }
67
- if (filters.updated_at) {
68
- const updatedAtFilter = filters.updated_at;
69
- if (updatedAtFilter.range) {
70
- const rangeObj = updatedAtFilter.range;
71
- filters.updated_at = (0, utils_1.processDateRange)({
72
- range: {
73
- mode: rangeObj.mode,
74
- exact: rangeObj.exact,
75
- start: rangeObj.start,
76
- end: rangeObj.end,
77
- preset: rangeObj.preset,
78
- },
79
- });
80
- }
81
- }
82
- return await operations_1.handleGetAllOperation.call(this, resourceEndpoint, 'networks', qs, returnAll, limit);
83
- }
84
- case 'update': {
85
- const networkId = this.getNodeParameter('networkId', i);
86
- const updateFields = this.getNodeParameter('updateFields', i);
87
- const networkBody = {};
88
- for (const [key, value] of Object.entries(updateFields)) {
89
- if (value !== undefined && value !== null && value !== '') {
90
- if (key === 'company_id') {
91
- networkBody[key] = (0, utils_1.validateCompanyId)(value, this.getNode(), 'Company ID');
92
- }
93
- else {
94
- networkBody[key] = value;
95
- }
96
- }
97
- }
98
- const body = {
99
- network: networkBody,
100
- };
101
- return await operations_1.handleUpdateOperation.call(this, resourceEndpoint, networkId, body);
102
- }
103
- }
104
- return responseData;
105
- }
106
- exports.handleNetworksOperation = handleNetworksOperation;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleNetworksOperation = handleNetworksOperation;
4
+ const utils_1 = require("../../utils");
5
+ const operations_1 = require("../../utils/operations");
6
+ const constants_1 = require("../../utils/constants");
7
+ async function handleNetworksOperation(operation, i) {
8
+ const resourceEndpoint = '/networks';
9
+ let responseData = {};
10
+ switch (operation) {
11
+ case 'create': {
12
+ const body = {
13
+ name: this.getNodeParameter('name', i),
14
+ address: this.getNodeParameter('address', i),
15
+ network_type: this.getNodeParameter('network_type', i),
16
+ };
17
+ const additionalFields = this.getNodeParameter('additionalFields', i);
18
+ for (const [key, value] of Object.entries(additionalFields)) {
19
+ if (value !== undefined && value !== null && value !== '') {
20
+ if (key === 'company_id') {
21
+ body[key] = Number.parseInt(value, 10);
22
+ }
23
+ else if (key === 'vlan_id') {
24
+ const v = String(value).trim();
25
+ if (v !== '' && !Number.isNaN(Number.parseInt(v, 10))) {
26
+ body[key] = Number.parseInt(v, 10);
27
+ }
28
+ }
29
+ else {
30
+ body[key] = value;
31
+ }
32
+ }
33
+ }
34
+ responseData = await operations_1.handleCreateOperation.call(this, resourceEndpoint, { network: body });
35
+ return responseData;
36
+ }
37
+ case 'delete': {
38
+ const networkId = this.getNodeParameter('networkId', i);
39
+ return await operations_1.handleDeleteOperation.call(this, resourceEndpoint, networkId);
40
+ }
41
+ case 'get': {
42
+ const networkId = this.getNodeParameter('networkId', i);
43
+ return await operations_1.handleGetOperation.call(this, resourceEndpoint, networkId, 'network');
44
+ }
45
+ case 'getAll': {
46
+ const filters = this.getNodeParameter('filters', i);
47
+ const returnAll = this.getNodeParameter('returnAll', i);
48
+ const limit = this.getNodeParameter('limit', i, constants_1.HUDU_API_CONSTANTS.PAGE_SIZE);
49
+ const qs = {
50
+ ...filters,
51
+ };
52
+ if (filters.company_id !== undefined && filters.company_id !== null && filters.company_id !== '') {
53
+ qs.company_id = (0, utils_1.validateCompanyId)(filters.company_id, this.getNode(), 'Company ID');
54
+ }
55
+ if (filters.archived !== undefined) {
56
+ qs.archived = filters.archived;
57
+ }
58
+ if (filters.created_at) {
59
+ const createdAtFilter = filters.created_at;
60
+ if (createdAtFilter.range) {
61
+ const rangeObj = createdAtFilter.range;
62
+ filters.created_at = (0, utils_1.processDateRange)({
63
+ range: {
64
+ mode: rangeObj.mode,
65
+ exact: rangeObj.exact,
66
+ start: rangeObj.start,
67
+ end: rangeObj.end,
68
+ preset: rangeObj.preset,
69
+ },
70
+ });
71
+ }
72
+ }
73
+ if (filters.updated_at) {
74
+ const updatedAtFilter = filters.updated_at;
75
+ if (updatedAtFilter.range) {
76
+ const rangeObj = updatedAtFilter.range;
77
+ filters.updated_at = (0, utils_1.processDateRange)({
78
+ range: {
79
+ mode: rangeObj.mode,
80
+ exact: rangeObj.exact,
81
+ start: rangeObj.start,
82
+ end: rangeObj.end,
83
+ preset: rangeObj.preset,
84
+ },
85
+ });
86
+ }
87
+ }
88
+ return await operations_1.handleGetAllOperation.call(this, resourceEndpoint, 'networks', qs, returnAll, limit);
89
+ }
90
+ case 'update': {
91
+ const networkId = this.getNodeParameter('networkId', i);
92
+ const updateFields = this.getNodeParameter('networkUpdateFields', i);
93
+ const networkBody = {};
94
+ for (const [key, value] of Object.entries(updateFields)) {
95
+ if (value !== undefined && value !== null && value !== '') {
96
+ if (key === 'company_id') {
97
+ networkBody[key] = (0, utils_1.validateCompanyId)(value, this.getNode(), 'Company ID');
98
+ }
99
+ else if (key === 'vlan_id') {
100
+ const v = String(value).trim();
101
+ if (v !== '' && !Number.isNaN(Number.parseInt(v, 10))) {
102
+ networkBody[key] = Number.parseInt(v, 10);
103
+ }
104
+ }
105
+ else {
106
+ networkBody[key] = value;
107
+ }
108
+ }
109
+ }
110
+ const body = {
111
+ network: networkBody,
112
+ };
113
+ return await operations_1.handleUpdateOperation.call(this, resourceEndpoint, networkId, body);
114
+ }
115
+ }
116
+ return responseData;
117
+ }
107
118
  //# sourceMappingURL=networks.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"networks.handler.js","sourceRoot":"","sources":["../../../../../../src/nodes/Hudu/resources/networks/networks.handler.ts"],"names":[],"mappings":";;;AACA,uCAAwF;AACxF,uDAMgC;AAEhC,qDAA2D;AAEpD,KAAK,UAAU,uBAAuB,CAE3C,SAA6B,EAC7B,CAAS;IAET,MAAM,gBAAgB,GAAG,WAAW,CAAC;IACrC,IAAI,YAAY,GAAgC,EAAE,CAAC;IAEnD,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC,CAAC;YACb,MAAM,IAAI,GAAgB;gBACxB,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAW;gBAChD,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW;gBACtD,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW;aACjE,CAAC;YAEF,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,CAAgB,CAAC;YAGrF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBAC3D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;oBAEzD,IAAI,GAAG,KAAK,YAAY,EAAE;wBACxB,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC;qBAClD;yBAAM;wBACL,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;qBACnB;iBACF;aACF;YAED,YAAY,GAAG,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AAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAgB,CAAC;YAG7E,MAAM,WAAW,GAAgB,EAAE,CAAC;YACpC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;gBACvD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;oBAEzD,IAAI,GAAG,KAAK,YAAY,EAAE;wBACxB,WAAW,CAAC,GAAG,CAAC,GAAG,IAAA,yBAAiB,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;qBAC3E;yBAAM;wBACL,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;qBAC1B;iBACF;aACF;YAED,MAAM,IAAI,GAAgB;gBACxB,OAAO,EAAE,WAAW;aACrB,CAAC;YAEF,OAAO,MAAM,kCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;SAClF;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAlID,0DAkIC"}
1
+ {"version":3,"file":"networks.handler.js","sourceRoot":"","sources":["../../../../../../src/nodes/Hudu/resources/networks/networks.handler.ts"],"names":[],"mappings":";;AAYA,0DA0IC;AArJD,uCAAwF;AACxF,uDAMgC;AAEhC,qDAA2D;AAEpD,KAAK,UAAU,uBAAuB,CAE3C,SAA6B,EAC7B,CAAS;IAET,MAAM,gBAAgB,GAAG,WAAW,CAAC;IACrC,IAAI,YAAY,GAAgC,EAAE,CAAC;IAEnD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,IAAI,GAAgB;gBACxB,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAW;gBAChD,OAAO,EAAE,IAAI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B,EAAE,CAAC,CAAgB,CAAC;YAGpF,MAAM,WAAW,GAAgB,EAAE,CAAC;YACpC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;gBACxD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;oBAC1D,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;wBACzB,WAAW,CAAC,GAAG,CAAC,GAAG,IAAA,yBAAiB,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;oBAC5E,CAAC;yBAAM,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;wBAC/B,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;4BACtD,WAAW,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;wBAC5C,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;oBAC3B,CAAC;gBACH,CAAC;YACH,CAAC;YAED,MAAM,IAAI,GAAgB;gBACxB,OAAO,EAAE,WAAW;aACrB,CAAC;YAEF,OAAO,MAAM,kCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -31,9 +31,13 @@ export async function handleNetworksOperation(
31
31
  // Only add non-empty additional fields
32
32
  for (const [key, value] of Object.entries(additionalFields)) {
33
33
  if (value !== undefined && value !== null && value !== '') {
34
- // Convert company_id to number if present
35
34
  if (key === 'company_id') {
36
35
  body[key] = Number.parseInt(value as string, 10);
36
+ } else if (key === 'vlan_id') {
37
+ const v = String(value).trim();
38
+ if (v !== '' && !Number.isNaN(Number.parseInt(v, 10))) {
39
+ body[key] = Number.parseInt(v, 10);
40
+ }
37
41
  } else {
38
42
  body[key] = value;
39
43
  }
@@ -51,7 +55,7 @@ export async function handleNetworksOperation(
51
55
 
52
56
  case 'get': {
53
57
  const networkId = this.getNodeParameter('networkId', i) as string;
54
- return await handleGetOperation.call(this, resourceEndpoint, networkId);
58
+ return await handleGetOperation.call(this, resourceEndpoint, networkId, 'network');
55
59
  }
56
60
 
57
61
  case 'getAll': {
@@ -116,15 +120,19 @@ export async function handleNetworksOperation(
116
120
 
117
121
  case 'update': {
118
122
  const networkId = this.getNodeParameter('networkId', i) as string;
119
- const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
123
+ const updateFields = this.getNodeParameter('networkUpdateFields', i) as IDataObject;
120
124
 
121
125
  // Only include non-empty update fields
122
126
  const networkBody: IDataObject = {};
123
127
  for (const [key, value] of Object.entries(updateFields)) {
124
128
  if (value !== undefined && value !== null && value !== '') {
125
- // Validate company_id if present
126
129
  if (key === 'company_id') {
127
130
  networkBody[key] = validateCompanyId(value, this.getNode(), 'Company ID');
131
+ } else if (key === 'vlan_id') {
132
+ const v = String(value).trim();
133
+ if (v !== '' && !Number.isNaN(Number.parseInt(v, 10))) {
134
+ networkBody[key] = Number.parseInt(v, 10);
135
+ }
128
136
  } else {
129
137
  networkBody[key] = value;
130
138
  }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=networks.types.js.map
@@ -1,29 +1,101 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handlePasswordFoldersOperation = void 0;
4
- const operations_1 = require("../../utils/operations");
5
- const constants_1 = require("../../utils/constants");
6
- async function handlePasswordFoldersOperation(operation, i) {
7
- const resourceEndpoint = '/password_folders';
8
- let responseData = {};
9
- switch (operation) {
10
- case 'get': {
11
- const folderId = this.getNodeParameter('id', i);
12
- responseData = await operations_1.handleGetOperation.call(this, resourceEndpoint, folderId);
13
- break;
14
- }
15
- case 'getAll': {
16
- const returnAll = this.getNodeParameter('returnAll', i);
17
- const filters = this.getNodeParameter('filters', i);
18
- const limit = this.getNodeParameter('limit', i, constants_1.HUDU_API_CONSTANTS.PAGE_SIZE);
19
- const qs = {
20
- ...filters,
21
- };
22
- responseData = await operations_1.handleGetAllOperation.call(this, resourceEndpoint, 'password_folders', qs, returnAll, limit);
23
- break;
24
- }
25
- }
26
- return responseData;
27
- }
28
- exports.handlePasswordFoldersOperation = handlePasswordFoldersOperation;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handlePasswordFoldersOperation = handlePasswordFoldersOperation;
4
+ const operations_1 = require("../../utils/operations");
5
+ const constants_1 = require("../../utils/constants");
6
+ const n8n_workflow_1 = require("n8n-workflow");
7
+ async function handlePasswordFoldersOperation(operation, i) {
8
+ const resourceEndpoint = '/password_folders';
9
+ let responseData = {};
10
+ switch (operation) {
11
+ case 'get': {
12
+ const folderId = this.getNodeParameter('id', i);
13
+ responseData = await operations_1.handleGetOperation.call(this, resourceEndpoint, folderId, 'password_folder');
14
+ break;
15
+ }
16
+ case 'getAll': {
17
+ const returnAll = this.getNodeParameter('returnAll', i);
18
+ const filters = this.getNodeParameter('filters', i);
19
+ const limit = this.getNodeParameter('limit', i, constants_1.HUDU_API_CONSTANTS.PAGE_SIZE);
20
+ const qs = {
21
+ ...filters,
22
+ };
23
+ responseData = await operations_1.handleGetAllOperation.call(this, resourceEndpoint, 'password_folders', qs, returnAll, limit);
24
+ break;
25
+ }
26
+ case 'create': {
27
+ const name = this.getNodeParameter('name', i);
28
+ const security = this.getNodeParameter('security', i);
29
+ const companyId = this.getNodeParameter('company_id', i);
30
+ const description = this.getNodeParameter('description', i);
31
+ const allowedGroupsParam = this.getNodeParameter('allowed_groups', i, []);
32
+ const body = {};
33
+ body.name = name;
34
+ body.security = security;
35
+ if (companyId !== undefined && companyId !== null && companyId !== '') {
36
+ body.company_id = Number.parseInt(companyId, 10);
37
+ }
38
+ if (description) {
39
+ body.description = description;
40
+ }
41
+ const allowedGroups = Array.isArray(allowedGroupsParam)
42
+ ? allowedGroupsParam
43
+ .map((v) => (typeof v === 'string' ? v.trim() : v))
44
+ .filter((v) => v !== '' && v !== null && v !== undefined)
45
+ .map((v) => (typeof v === 'string' ? Number.parseInt(v, 10) : v))
46
+ .filter((v) => Number.isFinite(v))
47
+ : [];
48
+ if (security === 'specific') {
49
+ if (!Array.isArray(allowedGroups) || allowedGroups.length === 0) {
50
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'allowed_groups is required when security is "specific"', { itemIndex: i });
51
+ }
52
+ body.allowed_groups = allowedGroups;
53
+ }
54
+ responseData = await operations_1.handleCreateOperation.call(this, resourceEndpoint, { password_folder: body });
55
+ break;
56
+ }
57
+ case 'update': {
58
+ const id = this.getNodeParameter('id', i);
59
+ const updateFields = this.getNodeParameter('passwordFolderUpdateFields', i);
60
+ if (updateFields.company_id === '') {
61
+ delete updateFields.company_id;
62
+ }
63
+ else if (updateFields.company_id !== undefined && updateFields.company_id !== null) {
64
+ updateFields.company_id = Number.parseInt(updateFields.company_id, 10);
65
+ }
66
+ if (updateFields.description === '') {
67
+ delete updateFields.description;
68
+ }
69
+ if (Array.isArray(updateFields.allowed_groups)) {
70
+ updateFields.allowed_groups = updateFields.allowed_groups
71
+ .map((v) => (typeof v === 'string' ? v.trim() : v))
72
+ .filter((v) => v !== '' && v !== null && v !== undefined)
73
+ .map((v) => (typeof v === 'string' ? Number.parseInt(v, 10) : v))
74
+ .filter((v) => Number.isFinite(v));
75
+ }
76
+ if (updateFields.security === 'specific') {
77
+ const groups = updateFields.allowed_groups;
78
+ if (!Array.isArray(groups) || groups.length === 0) {
79
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'passwordFolderUpdateFields.allowed_groups is required when security is "specific"', { itemIndex: i });
80
+ }
81
+ }
82
+ else if (updateFields.security === 'all_users') {
83
+ delete updateFields.allowed_groups;
84
+ }
85
+ else if (!updateFields.security) {
86
+ if (Array.isArray(updateFields.allowed_groups) && updateFields.allowed_groups.length === 0) {
87
+ delete updateFields.allowed_groups;
88
+ }
89
+ }
90
+ responseData = await operations_1.handleUpdateOperation.call(this, resourceEndpoint, id, { password_folder: updateFields });
91
+ break;
92
+ }
93
+ case 'delete': {
94
+ const id = this.getNodeParameter('id', i);
95
+ responseData = await operations_1.handleDeleteOperation.call(this, resourceEndpoint, id);
96
+ break;
97
+ }
98
+ }
99
+ return responseData;
100
+ }
29
101
  //# sourceMappingURL=password_folders.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password_folders.handler.js","sourceRoot":"","sources":["../../../../../../src/nodes/Hudu/resources/password_folders/password_folders.handler.ts"],"names":[],"mappings":";;;AACA,uDAAmF;AAEnF,qDAA2D;AAEpD,KAAK,UAAU,8BAA8B,CAElD,SAAoC,EACpC,CAAS;IAET,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;IAC7C,IAAI,YAAY,GAAgC,EAAE,CAAC;IAEnD,QAAQ,SAAS,EAAE;QACjB,KAAK,KAAK,CAAC,CAAC;YACV,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAW,CAAC;YAC1D,YAAY,GAAG,MAAM,+BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;YAC/E,MAAM;SACP;QAED,KAAK,QAAQ,CAAC,CAAC;YACb,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAY,CAAC;YACnE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAgB,CAAC;YACnE,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,8BAAkB,CAAC,SAAS,CAAW,CAAC;YAExF,MAAM,EAAE,GAAgB;gBACtB,GAAG,OAAO;aACX,CAAC;YAEF,YAAY,GAAG,MAAM,kCAAqB,CAAC,IAAI,CAC7C,IAAI,EACJ,gBAAgB,EAChB,kBAAkB,EAClB,EAAE,EACF,SAAS,EACT,KAAK,CACN,CAAC;YACF,MAAM;SACP;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AArCD,wEAqCC"}
1
+ {"version":3,"file":"password_folders.handler.js","sourceRoot":"","sources":["../../../../../../src/nodes/Hudu/resources/password_folders/password_folders.handler.ts"],"names":[],"mappings":";;AAOA,wEA2HC;AAjID,uDAAwJ;AAExJ,qDAA2D;AAE3D,+CAAkD;AAE3C,KAAK,UAAU,8BAA8B,CAElD,SAAoC,EACpC,CAAS;IAET,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;IAC7C,IAAI,YAAY,GAAgC,EAAE,CAAC;IAEnD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAW,CAAC;YAC1D,YAAY,GAAG,MAAM,+BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;YAClG,MAAM;QACR,CAAC;QAED,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAY,CAAC;YACnE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAgB,CAAC;YACnE,MAAM,KAAK,GAAG,IAAI,CA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AC,cAAsC,CAAC;gBACnE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAClD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAsB,EAAE,mFAAmF,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC1K,CAAC;YACH,CAAC;iBAAM,IAAI,YAAY,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;gBAEjD,OAAO,YAAY,CAAC,cAAc,CAAC;YACrC,CAAC;iBAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;gBAElC,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,YAAY,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC3F,OAAO,YAAY,CAAC,cAAc,CAAC;gBACrC,CAAC;YACH,CAAC;YAED,YAAY,GAAG,MAAM,kCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,CAAC;YAC/G,MAAM;QACR,CAAC;QAED,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAW,CAAC;YACpD,YAAY,GAAG,MAAM,kCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;YAC5E,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import type { IExecuteFunctions, IDataObject } from 'n8n-workflow';
2
- import { handleGetOperation, handleGetAllOperation } from '../../utils/operations';
2
+ import { handleGetOperation, handleGetAllOperation, handleCreateOperation, handleUpdateOperation, handleDeleteOperation } from '../../utils/operations';
3
3
  import type { PasswordFoldersOperations } from './password_folders.types';
4
4
  import { HUDU_API_CONSTANTS } from '../../utils/constants';
5
+ import type { INode } from 'n8n-workflow';
6
+ import { NodeOperationError } from 'n8n-workflow';
5
7
 
6
8
  export async function handlePasswordFoldersOperation(
7
9
  this: IExecuteFunctions,
@@ -14,7 +16,7 @@ export async function handlePasswordFoldersOperation(
14
16
  switch (operation) {
15
17
  case 'get': {
16
18
  const folderId = this.getNodeParameter('id', i) as string;
17
- responseData = await handleGetOperation.call(this, resourceEndpoint, folderId);
19
+ responseData = await handleGetOperation.call(this, resourceEndpoint, folderId, 'password_folder');
18
20
  break;
19
21
  }
20
22
 
@@ -37,6 +39,92 @@ export async function handlePasswordFoldersOperation(
37
39
  );
38
40
  break;
39
41
  }
42
+
43
+ case 'create': {
44
+ const name = this.getNodeParameter('name', i) as string;
45
+ const security = this.getNodeParameter('security', i) as string;
46
+ const companyId = this.getNodeParameter('company_id', i) as string;
47
+ const description = this.getNodeParameter('description', i) as string;
48
+ const allowedGroupsParam = this.getNodeParameter('allowed_groups', i, []) as unknown;
49
+
50
+ const body: IDataObject = {};
51
+ body.name = name;
52
+ body.security = security;
53
+ if (companyId !== undefined && companyId !== null && companyId !== '') {
54
+ body.company_id = Number.parseInt(companyId as string, 10);
55
+ }
56
+ if (description) {
57
+ body.description = description;
58
+ }
59
+
60
+ // normalise allowed groups to number[] and drop blanks
61
+ const allowedGroups = Array.isArray(allowedGroupsParam)
62
+ ? (allowedGroupsParam
63
+ .map((v) => (typeof v === 'string' ? v.trim() : v))
64
+ .filter((v) => v !== '' && v !== null && v !== undefined)
65
+ .map((v) => (typeof v === 'string' ? Number.parseInt(v, 10) : (v as number)))
66
+ .filter((v) => Number.isFinite(v)) as number[])
67
+ : [];
68
+
69
+ if (security === 'specific') {
70
+ if (!Array.isArray(allowedGroups) || allowedGroups.length === 0) {
71
+ throw new NodeOperationError(this.getNode() as unknown as INode, 'allowed_groups is required when security is "specific"', { itemIndex: i });
72
+ }
73
+ body.allowed_groups = allowedGroups;
74
+ }
75
+
76
+ responseData = await handleCreateOperation.call(this, resourceEndpoint, { password_folder: body });
77
+ break;
78
+ }
79
+
80
+ case 'update': {
81
+ const id = this.getNodeParameter('id', i) as string;
82
+ const updateFields = this.getNodeParameter('passwordFolderUpdateFields', i) as IDataObject;
83
+
84
+ // Coerce and clean optional fields
85
+ if (updateFields.company_id === '') {
86
+ delete updateFields.company_id;
87
+ } else if (updateFields.company_id !== undefined && updateFields.company_id !== null) {
88
+ updateFields.company_id = Number.parseInt(updateFields.company_id as string, 10);
89
+ }
90
+
91
+ if (updateFields.description === '') {
92
+ delete updateFields.description;
93
+ }
94
+
95
+ // normalise allowed_groups to number[] and drop blanks if provided
96
+ if (Array.isArray(updateFields.allowed_groups)) {
97
+ updateFields.allowed_groups = (updateFields.allowed_groups as unknown[])
98
+ .map((v) => (typeof v === 'string' ? v.trim() : v))
99
+ .filter((v) => v !== '' && v !== null && v !== undefined)
100
+ .map((v) => (typeof v === 'string' ? Number.parseInt(v, 10) : (v as number)))
101
+ .filter((v) => Number.isFinite(v));
102
+ }
103
+
104
+ if (updateFields.security === 'specific') {
105
+ const groups = updateFields.allowed_groups as number[] | undefined;
106
+ if (!Array.isArray(groups) || groups.length === 0) {
107
+ throw new NodeOperationError(this.getNode() as unknown as INode, 'passwordFolderUpdateFields.allowed_groups is required when security is "specific"', { itemIndex: i });
108
+ }
109
+ } else if (updateFields.security === 'all_users') {
110
+ // ensure we don't send empty groups when security is all_users
111
+ delete updateFields.allowed_groups;
112
+ } else if (!updateFields.security) {
113
+ // If security not being changed, but empty groups provided, drop them
114
+ if (Array.isArray(updateFields.allowed_groups) && updateFields.allowed_groups.length === 0) {
115
+ delete updateFields.allowed_groups;
116
+ }
117
+ }
118
+
119
+ responseData = await handleUpdateOperation.call(this, resourceEndpoint, id, { password_folder: updateFields });
120
+ break;
121
+ }
122
+
123
+ case 'delete': {
124
+ const id = this.getNodeParameter('id', i) as string;
125
+ responseData = await handleDeleteOperation.call(this, resourceEndpoint, id);
126
+ break;
127
+ }
40
128
  }
41
129
 
42
130
  return responseData;
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=password_folders.types.js.map
@@ -6,6 +6,8 @@ export interface IPasswordFolder extends IDataObject {
6
6
  description: string; // A brief description of the password folder
7
7
  name: string; // The name of the password folder
8
8
  slug: string; // A slug representing the password folder
9
+ security?: 'all_users' | 'specific';
10
+ allowed_groups?: number[];
9
11
  created_at: string; // The timestamp of password folder creation
10
12
  updated_at: string; // The timestamp of the last password folder update
11
13
  }
@@ -14,4 +16,4 @@ export interface IPasswordFolderResponse extends IDataObject {
14
16
  password_folders: IPasswordFolder[];
15
17
  }
16
18
 
17
- export type PasswordFoldersOperations = 'get' | 'getAll';
19
+ export type PasswordFoldersOperations = 'get' | 'getAll' | 'create' | 'update' | 'delete';