@limetech/n8n-nodes-lime 0.5.0 → 2.5.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/.github/workflows/lint.yml +4 -2
  2. package/.github/workflows/release.yml +8 -41
  3. package/.github/workflows/test-and-build.yml +1 -16
  4. package/.releaserc.json +2 -1
  5. package/CHANGELOG.md +155 -0
  6. package/Dockerfile +0 -21
  7. package/README.md +1 -1
  8. package/credentials/LimeCrmApi.credentials.ts +38 -1
  9. package/credentials/index.ts +2 -0
  10. package/eslint.config.mjs +2 -1
  11. package/knip.json +9 -0
  12. package/nodes/errorHandling.ts +60 -0
  13. package/nodes/fortnox/index.ts +6 -0
  14. package/nodes/fortnox/resources/customers/index.ts +18 -22
  15. package/nodes/fortnox/resources/customers/operations/create.operation.ts +12 -8
  16. package/nodes/fortnox/resources/customers/operations/delete.operation.ts +10 -15
  17. package/nodes/fortnox/resources/customers/operations/get.operation.ts +10 -15
  18. package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +1 -2
  19. package/nodes/fortnox/resources/customers/operations/index.ts +5 -0
  20. package/nodes/fortnox/resources/customers/operations/update.operation.ts +30 -30
  21. package/nodes/fortnox/resources/invoice/index.ts +16 -18
  22. package/nodes/fortnox/resources/invoice/model.ts +0 -4
  23. package/nodes/fortnox/resources/invoice/operations/create.operation.ts +1 -2
  24. package/nodes/fortnox/resources/invoice/operations/get.operation.ts +10 -15
  25. package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +1 -2
  26. package/nodes/fortnox/resources/invoice/operations/index.ts +4 -0
  27. package/nodes/fortnox/resources/invoice/operations/update.operation.ts +11 -16
  28. package/nodes/fortnox/transport/index.ts +14 -11
  29. package/nodes/index.ts +4 -0
  30. package/nodes/lime-crm/LimeCrmNode.node.ts +89 -11
  31. package/nodes/lime-crm/LimeCrmTrigger.node.ts +75 -21
  32. package/nodes/lime-crm/index.ts +9 -0
  33. package/nodes/lime-crm/methods/getLimetypeProperties.ts +53 -8
  34. package/nodes/lime-crm/methods/getLimetypes.ts +15 -9
  35. package/nodes/lime-crm/methods/index.ts +6 -1
  36. package/nodes/lime-crm/methods/resourceMapping.ts +141 -0
  37. package/nodes/lime-crm/models/constants.ts +73 -0
  38. package/nodes/lime-crm/models/index.ts +21 -0
  39. package/nodes/lime-crm/models/limeobject.ts +13 -0
  40. package/nodes/lime-crm/models/limetype.ts +65 -0
  41. package/nodes/lime-crm/models/propertyTypes.ts +13 -0
  42. package/nodes/lime-crm/models/users.ts +46 -0
  43. package/nodes/lime-crm/models/webhook.ts +61 -0
  44. package/nodes/lime-crm/resources/admin/index.ts +94 -0
  45. package/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.ts +174 -0
  46. package/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.ts +112 -0
  47. package/nodes/lime-crm/resources/admin/operations/index.ts +8 -0
  48. package/nodes/lime-crm/resources/data/index.ts +77 -31
  49. package/nodes/lime-crm/resources/data/operations/{createSingleObject.ts → createSingleObject.operation.ts} +64 -54
  50. package/nodes/lime-crm/resources/data/operations/{deleteSingleObject.ts → deleteSingleObject.operation.ts} +39 -6
  51. package/nodes/lime-crm/resources/data/operations/{getManyObjects.ts → getManyObjects.operation.ts} +195 -48
  52. package/nodes/lime-crm/resources/data/operations/{getSingleFile.ts → getSingleFile.operation.ts} +47 -11
  53. package/nodes/lime-crm/resources/data/operations/{getSingleObject.ts → getSingleObject.operation.ts} +50 -8
  54. package/nodes/lime-crm/resources/data/operations/index.ts +24 -0
  55. package/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.ts +83 -61
  56. package/nodes/lime-crm/resources/metadata/index.ts +60 -16
  57. package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +18 -4
  58. package/nodes/lime-crm/resources/metadata/operations/{getSingleFileMetadata.ts → getSingleFileMetadata.operation.ts} +46 -26
  59. package/nodes/lime-crm/resources/metadata/operations/{getSingleLimetype.ts → getSingleLimetype.operation.ts} +30 -3
  60. package/nodes/lime-crm/resources/metadata/operations/index.ts +12 -0
  61. package/nodes/lime-crm/transport/commons.ts +90 -18
  62. package/nodes/lime-crm/transport/files.ts +161 -71
  63. package/nodes/lime-crm/transport/index.ts +35 -17
  64. package/nodes/lime-crm/transport/limeQuery.ts +43 -7
  65. package/nodes/lime-crm/transport/limeobjects.ts +113 -178
  66. package/nodes/lime-crm/transport/limetypes.ts +125 -48
  67. package/nodes/lime-crm/transport/users.ts +300 -0
  68. package/nodes/lime-crm/transport/webhooks.ts +97 -37
  69. package/nodes/lime-crm/{commons → utils}/files.ts +79 -26
  70. package/nodes/lime-crm/utils/hmac.ts +35 -0
  71. package/nodes/lime-crm/utils/index.ts +10 -0
  72. package/nodes/lime-crm/utils/webhook.ts +81 -0
  73. package/nodes/modules.ts +44 -0
  74. package/nodes/response.ts +54 -0
  75. package/package.json +21 -28
  76. package/tests/nodes/lime-crm/methods.spec.ts +91 -0
  77. package/tests/nodes/lime-crm/utils.spec.ts +273 -0
  78. package/typedoc.css +9 -0
  79. package/typedoc.json +19 -0
  80. package/.dockerignore +0 -1
  81. package/dist/credentials/FortnoxApi.credentials.d.ts +0 -9
  82. package/dist/credentials/FortnoxApi.credentials.js +0 -57
  83. package/dist/credentials/FortnoxApi.credentials.js.map +0 -1
  84. package/dist/credentials/LimeCrmApi.credentials.d.ts +0 -9
  85. package/dist/credentials/LimeCrmApi.credentials.js +0 -66
  86. package/dist/credentials/LimeCrmApi.credentials.js.map +0 -1
  87. package/dist/nodes/fortnox/Fortnox.node.d.ts +0 -5
  88. package/dist/nodes/fortnox/Fortnox.node.js +0 -95
  89. package/dist/nodes/fortnox/Fortnox.node.js.map +0 -1
  90. package/dist/nodes/fortnox/Fortnox.node.json +0 -18
  91. package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +0 -5
  92. package/dist/nodes/fortnox/FortnoxTrigger.node.js +0 -155
  93. package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +0 -1
  94. package/dist/nodes/fortnox/FortnoxTrigger.node.json +0 -18
  95. package/dist/nodes/fortnox/commons.d.ts +0 -25
  96. package/dist/nodes/fortnox/commons.js +0 -44
  97. package/dist/nodes/fortnox/commons.js.map +0 -1
  98. package/dist/nodes/fortnox/fortnoxLogo.svg +0 -15
  99. package/dist/nodes/fortnox/model.d.ts +0 -20
  100. package/dist/nodes/fortnox/model.js +0 -3
  101. package/dist/nodes/fortnox/model.js.map +0 -1
  102. package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +0 -2
  103. package/dist/nodes/fortnox/resources/customers/filterParameters.js +0 -31
  104. package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +0 -1
  105. package/dist/nodes/fortnox/resources/customers/index.d.ts +0 -20
  106. package/dist/nodes/fortnox/resources/customers/index.js +0 -87
  107. package/dist/nodes/fortnox/resources/customers/index.js.map +0 -1
  108. package/dist/nodes/fortnox/resources/customers/model.d.ts +0 -99
  109. package/dist/nodes/fortnox/resources/customers/model.js +0 -3
  110. package/dist/nodes/fortnox/resources/customers/model.js.map +0 -1
  111. package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +0 -12
  112. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +0 -283
  113. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +0 -1
  114. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +0 -10
  115. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +0 -45
  116. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +0 -1
  117. package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +0 -11
  118. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +0 -45
  119. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +0 -1
  120. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +0 -11
  121. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +0 -68
  122. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +0 -1
  123. package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +0 -12
  124. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +0 -276
  125. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +0 -1
  126. package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +0 -2
  127. package/dist/nodes/fortnox/resources/customers/sortParameters.js +0 -30
  128. package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +0 -1
  129. package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +0 -2
  130. package/dist/nodes/fortnox/resources/invoice/filterParameters.js +0 -72
  131. package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +0 -1
  132. package/dist/nodes/fortnox/resources/invoice/index.d.ts +0 -20
  133. package/dist/nodes/fortnox/resources/invoice/index.js +0 -81
  134. package/dist/nodes/fortnox/resources/invoice/index.js.map +0 -1
  135. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +0 -2
  136. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +0 -193
  137. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +0 -1
  138. package/dist/nodes/fortnox/resources/invoice/model.d.ts +0 -150
  139. package/dist/nodes/fortnox/resources/invoice/model.js +0 -3
  140. package/dist/nodes/fortnox/resources/invoice/model.js.map +0 -1
  141. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +0 -11
  142. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +0 -64
  143. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +0 -1
  144. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +0 -11
  145. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +0 -44
  146. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +0 -1
  147. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +0 -11
  148. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +0 -92
  149. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +0 -1
  150. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +0 -11
  151. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +0 -71
  152. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +0 -1
  153. package/dist/nodes/fortnox/transport/errorCodes.d.ts +0 -1
  154. package/dist/nodes/fortnox/transport/errorCodes.js +0 -50
  155. package/dist/nodes/fortnox/transport/errorCodes.js.map +0 -1
  156. package/dist/nodes/fortnox/transport/index.d.ts +0 -4
  157. package/dist/nodes/fortnox/transport/index.js +0 -77
  158. package/dist/nodes/fortnox/transport/index.js.map +0 -1
  159. package/dist/nodes/lime-crm/LimeCrm.node.json +0 -18
  160. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +0 -14
  161. package/dist/nodes/lime-crm/LimeCrmNode.node.js +0 -126
  162. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +0 -1
  163. package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +0 -18
  164. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +0 -215
  165. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +0 -1
  166. package/dist/nodes/lime-crm/assets/lime-crm.svg +0 -1
  167. package/dist/nodes/lime-crm/commons/constants.d.ts +0 -5
  168. package/dist/nodes/lime-crm/commons/constants.js +0 -9
  169. package/dist/nodes/lime-crm/commons/constants.js.map +0 -1
  170. package/dist/nodes/lime-crm/commons/hmac.d.ts +0 -1
  171. package/dist/nodes/lime-crm/commons/hmac.js +0 -11
  172. package/dist/nodes/lime-crm/commons/hmac.js.map +0 -1
  173. package/dist/nodes/lime-crm/commons/index.d.ts +0 -3
  174. package/dist/nodes/lime-crm/commons/index.js +0 -12
  175. package/dist/nodes/lime-crm/commons/index.js.map +0 -1
  176. package/dist/nodes/lime-crm/commons/limetype.d.ts +0 -10
  177. package/dist/nodes/lime-crm/commons/limetype.js +0 -3
  178. package/dist/nodes/lime-crm/commons/limetype.js.map +0 -1
  179. package/dist/nodes/lime-crm/commons/task.d.ts +0 -14
  180. package/dist/nodes/lime-crm/commons/task.js +0 -48
  181. package/dist/nodes/lime-crm/commons/task.js.map +0 -1
  182. package/dist/nodes/lime-crm/commons/webhook.d.ts +0 -20
  183. package/dist/nodes/lime-crm/commons/webhook.js +0 -30
  184. package/dist/nodes/lime-crm/commons/webhook.js.map +0 -1
  185. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +0 -5
  186. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +0 -11
  187. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +0 -1
  188. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +0 -2
  189. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +0 -20
  190. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +0 -1
  191. package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +0 -2
  192. package/dist/nodes/lime-crm/methods/getLimeTypes.js +0 -20
  193. package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +0 -1
  194. package/dist/nodes/lime-crm/methods/index.d.ts +0 -3
  195. package/dist/nodes/lime-crm/methods/index.js +0 -10
  196. package/dist/nodes/lime-crm/methods/index.js.map +0 -1
  197. package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +0 -23
  198. package/dist/nodes/lime-crm/resources/erpConnector/index.js +0 -67
  199. package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +0 -1
  200. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +0 -26
  201. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +0 -65
  202. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +0 -1
  203. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +0 -9
  204. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +0 -220
  205. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +0 -1
  206. package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +0 -15
  207. package/dist/nodes/lime-crm/resources/erpConnector/transform.js +0 -11
  208. package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +0 -1
  209. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +0 -4
  210. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +0 -7
  211. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +0 -1
  212. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +0 -37
  213. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +0 -124
  214. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +0 -1
  215. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +0 -1
  216. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +0 -6
  217. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +0 -1
  218. package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +0 -14
  219. package/dist/nodes/lime-crm/resources/limeObject/index.js +0 -88
  220. package/dist/nodes/lime-crm/resources/limeObject/index.js.map +0 -1
  221. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +0 -9
  222. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +0 -139
  223. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +0 -1
  224. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +0 -9
  225. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +0 -51
  226. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +0 -1
  227. package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.d.ts +0 -9
  228. package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.js +0 -103
  229. package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.js.map +0 -1
  230. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +0 -9
  231. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +0 -51
  232. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +0 -1
  233. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +0 -9
  234. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +0 -103
  235. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +0 -1
  236. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +0 -9
  237. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +0 -149
  238. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +0 -1
  239. package/dist/nodes/lime-crm/resources/limeQuery/index.d.ts +0 -6
  240. package/dist/nodes/lime-crm/resources/limeQuery/index.js +0 -66
  241. package/dist/nodes/lime-crm/resources/limeQuery/index.js.map +0 -1
  242. package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.d.ts +0 -9
  243. package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.js +0 -191
  244. package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.js.map +0 -1
  245. package/dist/nodes/lime-crm/resources/limeType/index.d.ts +0 -20
  246. package/dist/nodes/lime-crm/resources/limeType/index.js +0 -81
  247. package/dist/nodes/lime-crm/resources/limeType/index.js.map +0 -1
  248. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +0 -11
  249. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +0 -36
  250. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +0 -1
  251. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +0 -9
  252. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +0 -36
  253. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +0 -1
  254. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +0 -10
  255. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +0 -15
  256. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +0 -1
  257. package/dist/nodes/lime-crm/transport/commons.d.ts +0 -5
  258. package/dist/nodes/lime-crm/transport/commons.js +0 -33
  259. package/dist/nodes/lime-crm/transport/commons.js.map +0 -1
  260. package/dist/nodes/lime-crm/transport/erpConnector.d.ts +0 -9
  261. package/dist/nodes/lime-crm/transport/erpConnector.js +0 -11
  262. package/dist/nodes/lime-crm/transport/erpConnector.js.map +0 -1
  263. package/dist/nodes/lime-crm/transport/index.d.ts +0 -6
  264. package/dist/nodes/lime-crm/transport/index.js +0 -24
  265. package/dist/nodes/lime-crm/transport/index.js.map +0 -1
  266. package/dist/nodes/lime-crm/transport/limeQuery.d.ts +0 -10
  267. package/dist/nodes/lime-crm/transport/limeQuery.js +0 -15
  268. package/dist/nodes/lime-crm/transport/limeQuery.js.map +0 -1
  269. package/dist/nodes/lime-crm/transport/limeobjects.d.ts +0 -7
  270. package/dist/nodes/lime-crm/transport/limeobjects.js +0 -134
  271. package/dist/nodes/lime-crm/transport/limeobjects.js.map +0 -1
  272. package/dist/nodes/lime-crm/transport/limetypes.d.ts +0 -6
  273. package/dist/nodes/lime-crm/transport/limetypes.js +0 -54
  274. package/dist/nodes/lime-crm/transport/limetypes.js.map +0 -1
  275. package/dist/nodes/lime-crm/transport/task.d.ts +0 -13
  276. package/dist/nodes/lime-crm/transport/task.js +0 -13
  277. package/dist/nodes/lime-crm/transport/task.js.map +0 -1
  278. package/dist/nodes/lime-crm/transport/webhooks.d.ts +0 -16
  279. package/dist/nodes/lime-crm/transport/webhooks.js +0 -43
  280. package/dist/nodes/lime-crm/transport/webhooks.js.map +0 -1
  281. package/dist/nodes/nodeResponse.d.ts +0 -12
  282. package/dist/nodes/nodeResponse.js +0 -3
  283. package/dist/nodes/nodeResponse.js.map +0 -1
  284. package/dist/package.json +0 -75
  285. package/dist/tsconfig.tsbuildinfo +0 -1
  286. package/docker-compose.yml +0 -52
  287. package/nodes/lime-crm/commons/constants.ts +0 -9
  288. package/nodes/lime-crm/commons/hmac.ts +0 -13
  289. package/nodes/lime-crm/commons/index.ts +0 -10
  290. package/nodes/lime-crm/commons/task.ts +0 -55
  291. package/nodes/lime-crm/commons/webhook.ts +0 -68
  292. package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +0 -11
  293. package/nodes/lime-crm/model.ts +0 -22
  294. package/nodes/lime-crm/resources/erpConnector/index.ts +0 -43
  295. package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +0 -69
  296. package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +0 -274
  297. package/nodes/lime-crm/resources/erpConnector/transform.ts +0 -49
  298. package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +0 -18
  299. package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +0 -201
  300. package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +0 -1
  301. package/nodes/lime-crm/transport/erpConnector.ts +0 -21
  302. package/nodes/lime-crm/transport/task.ts +0 -32
  303. package/nodes/nodeResponse.ts +0 -13
  304. package/restore_script/README +0 -42
  305. package/restore_script/api_key_download.txt +0 -0
  306. package/restore_script/api_key_upload.txt +0 -0
  307. package/restore_script/cli.py +0 -73
  308. package/restore_script/download.py +0 -73
  309. package/restore_script/main.py +0 -19
  310. package/restore_script/poetry.lock +0 -162
  311. package/restore_script/pyproject.toml +0 -15
  312. package/restore_script/transfer.py +0 -41
  313. package/restore_script/upload.py +0 -66
  314. package/restore_script/utils.py +0 -42
  315. package/tests/fixtures/fortnox.ts +0 -182
  316. package/tests/transform.spec.ts +0 -187
@@ -4,7 +4,7 @@ on:
4
4
  pull_request:
5
5
  push:
6
6
  branches:
7
- - master
7
+ - main
8
8
 
9
9
  jobs:
10
10
  lint:
@@ -13,9 +13,11 @@ jobs:
13
13
  - uses: actions/checkout@v4
14
14
  - uses: actions/setup-node@v4
15
15
  with:
16
- node-version: 21
16
+ node-version: 24
17
17
  - run: npm ci
18
18
  - name: Run eslint
19
19
  run: npm run lint
20
20
  - name: Run prettier
21
21
  run: npm run format
22
+ - name: Run knip
23
+ run: npm run knip
@@ -1,4 +1,4 @@
1
- name: Release and Push to ECR
1
+ name: Release and Push to NPM Registry
2
2
 
3
3
  on:
4
4
  push:
@@ -19,7 +19,7 @@ jobs:
19
19
 
20
20
  - uses: actions/setup-node@v3
21
21
  with:
22
- node-version: 21
22
+ node-version: 24
23
23
 
24
24
  - run: npm ci
25
25
 
@@ -32,9 +32,10 @@ jobs:
32
32
  echo "version=$VERSION" >> $GITHUB_OUTPUT
33
33
  env:
34
34
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35
36
 
36
- push-to-ecr:
37
- name: Push images to ECR
37
+ push-to-npm:
38
+ name: Push package to NPM
38
39
  runs-on: ubuntu-latest
39
40
  needs: release
40
41
  permissions:
@@ -43,40 +44,6 @@ jobs:
43
44
  steps:
44
45
  - name: Checkout repository
45
46
  uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
46
-
47
- - name: Set up Docker Buildx
48
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
49
-
50
- - name: Configure AWS credentials
51
- uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a #v4.3.1
52
- with:
53
- role-to-assume: ${{ secrets.AWS_ECR_PUSH_ROLE_SHARED_ACCOUNT_ARN }}
54
- role-session-name: GitHubActions-ECR-Push
55
- aws-region: ${{ secrets.AWS_REGION_SHARED }}
56
-
57
- - name: Login to Amazon ECR
58
- id: login-ecr
59
- uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 #v2.0.1
60
-
61
- - name: Create ECR repository if it does not exist
62
- shell: bash
63
- run: |
64
- if [ -z "$(aws ecr describe-repositories --repository-names lime-cloud-n8n)" ]; then
65
- aws ecr create-repository --repository-name lime-cloud-n8n
66
- fi
67
-
68
- - name: Set environment variables
69
- id: vars
70
- run: |
71
- echo "ECR_REPO=lime-cloud-n8n" >> $GITHUB_ENV
72
- echo "ECR_URI=${{ steps.login-ecr.outputs.registry }}/lime-cloud-n8n" >> $GITHUB_ENV
73
- echo "IMAGE_TAG=${{ needs.release.outputs.version }}" >> $GITHUB_ENV
74
-
75
- - name: Build Docker image
76
- run: |
77
- docker build -t $ECR_URI:$IMAGE_TAG .
78
-
79
- - name: Push Docker image to ECR
80
- run: |
81
- echo "Pushing image to: $ECR_URI:$IMAGE_TAG"
82
- docker push $ECR_URI:$IMAGE_TAG
47
+ - run: npm ci
48
+ - name: Publish
49
+ run: npm publish
@@ -20,7 +20,7 @@ jobs:
20
20
  - name: Set up Node.js
21
21
  uses: actions/setup-node@v3
22
22
  with:
23
- node-version: 21
23
+ node-version: 24
24
24
 
25
25
  - name: Install dependencies
26
26
  run: npm install
@@ -30,18 +30,3 @@ jobs:
30
30
 
31
31
  - name: Run tests
32
32
  run: npm run test
33
-
34
- docker-build:
35
- name: Build docker image
36
- runs-on: ubuntu-latest
37
-
38
- steps:
39
- - name: Checkout code
40
- uses: actions/checkout@v4
41
-
42
- - name: Set up Docker Buildx
43
- uses: docker/setup-buildx-action@v3
44
-
45
- - name: Test Docker build
46
- run: |
47
- docker build .
package/.releaserc.json CHANGED
@@ -29,6 +29,7 @@
29
29
  "__note": "DO NOT CHANGE - this command is used in Release action"
30
30
  }
31
31
  ],
32
- "@semantic-release/github"
32
+ "@semantic-release/github",
33
+ "@semantic-release/npm"
33
34
  ]
34
35
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,158 @@
1
+ # [2.5.0-dev.1](https://github.com/Lundalogik/lime-n8n/compare/v2.4.0...v2.5.0-dev.1) (2026-01-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix npm release ([ebcba3f](https://github.com/Lundalogik/lime-n8n/commit/ebcba3fdc73b0126715af746ade844b2bb1ab1d5))
7
+
8
+
9
+ ### Features
10
+
11
+ * create an npm package out of repo ([e65a950](https://github.com/Lundalogik/lime-n8n/commit/e65a950ff42711a6c6fb624cb903d979a6ef8d4f))
12
+
13
+ # [2.4.0](https://github.com/Lundalogik/lime-n8n/compare/v2.3.3...v2.4.0) (2025-12-12)
14
+
15
+
16
+ ### Features
17
+
18
+ * add resourceMapper to create single object ([ba1a537](https://github.com/Lundalogik/lime-n8n/commit/ba1a53774cd05691d9bdd3b70eec768e1cbd4cc6))
19
+
20
+ ## [2.3.3](https://github.com/Lundalogik/lime-n8n/compare/v2.3.2...v2.3.3) (2025-12-09)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * fix error handling in n8n ([1e6b878](https://github.com/Lundalogik/lime-n8n/commit/1e6b8782629a16117c7cac3f62b043cf897a2a96))
26
+
27
+ ## [2.3.2](https://github.com/Lundalogik/lime-n8n/compare/v2.3.1...v2.3.2) (2025-12-08)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * change timezone to utc ([4ab309f](https://github.com/Lundalogik/lime-n8n/commit/4ab309fc0b9a37743ea398ec8cf594507be7f1be))
33
+
34
+ ## [2.3.1](https://github.com/Lundalogik/lime-n8n/compare/v2.3.0...v2.3.1) (2025-12-02)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * fix master reference in lint.yml ([0a91f70](https://github.com/Lundalogik/lime-n8n/commit/0a91f7092de81139294328f6cb114593c963bc69))
40
+
41
+ # [2.3.0](https://github.com/Lundalogik/lime-n8n/compare/v2.2.0...v2.3.0) (2025-11-21)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * remove dangerous triggers ([6116763](https://github.com/Lundalogik/lime-n8n/commit/611676364fa1b4e25b97add808f7e7a6d292c9ab))
47
+
48
+
49
+ ### Features
50
+
51
+ * add module handler to simplify module operations in main resource files ([1c7e54b](https://github.com/Lundalogik/lime-n8n/commit/1c7e54b1c1603039d2c16c58b445def98560bd21))
52
+
53
+ # [2.2.0](https://github.com/Lundalogik/lime-n8n/compare/v2.1.0...v2.2.0) (2025-11-21)
54
+
55
+
56
+ ### Features
57
+
58
+ * **LimeCRM data:** Return limetype properties with database names ([d7f6d38](https://github.com/Lundalogik/lime-n8n/commit/d7f6d380f94a7b1c6e82d6410a0028da1b389064))
59
+ * **LimeCRM data:** Return limetypes with database names ([57c6e01](https://github.com/Lundalogik/lime-n8n/commit/57c6e01ec18096fed23077392cb5ec9ba3c8b4d5))
60
+
61
+ # [2.1.0](https://github.com/Lundalogik/lime-n8n/compare/v2.0.0...v2.1.0) (2025-11-21)
62
+
63
+
64
+ ### Features
65
+
66
+ * **UserNode:** Get user by related limeobject id ([a0726de](https://github.com/Lundalogik/lime-n8n/commit/a0726de32eb3833fcb88afe8817fcf77e59dbcd0))
67
+ * **UserNode:** Return multiple items with a single user ([a5cb2f2](https://github.com/Lundalogik/lime-n8n/commit/a5cb2f2646a313042cb534bac50a2f55e0daf5a7))
68
+ * **UserNode:** Return multiple users with or without related coworker ([c2ccbe2](https://github.com/Lundalogik/lime-n8n/commit/c2ccbe2c95bd3e872e35a93dc236e88d3c8cdd73))
69
+ * **UserNode:** Return single user with or without related coworker ([d88227a](https://github.com/Lundalogik/lime-n8n/commit/d88227abca12bd70c192a173e633da73e41489a1))
70
+ * **UserNodes:** Move user nodes under Admin resource ([971ff7c](https://github.com/Lundalogik/lime-n8n/commit/971ff7c7fe2359568a4ce0828381d170e91dc418))
71
+
72
+ # [2.0.0](https://github.com/Lundalogik/lime-n8n/compare/v1.19.0...v2.0.0) (2025-11-20)
73
+
74
+
75
+ ### Features
76
+
77
+ * remove NodeResponse ([3a4293a](https://github.com/Lundalogik/lime-n8n/commit/3a4293afae5a5197e80d2b04c9432c6ab43d3f9e))
78
+
79
+
80
+ ### BREAKING CHANGES
81
+
82
+ * success flag is removed
83
+
84
+ # [1.19.0](https://github.com/Lundalogik/lime-n8n/compare/v1.18.2...v1.19.0) (2025-11-14)
85
+
86
+
87
+ ### Features
88
+
89
+ * **QueryNode:** Return multiple items with a single object ([b080e0e](https://github.com/Lundalogik/lime-n8n/commit/b080e0e2598c250cf3a53e35633913dfd3605de3))
90
+
91
+ ## [1.18.2](https://github.com/Lundalogik/lime-n8n/compare/v1.18.1...v1.18.2) (2025-11-13)
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * fix package.lock main file ([5942075](https://github.com/Lundalogik/lime-n8n/commit/5942075cb876265e2ff862ac76cd3e12679f5336))
97
+
98
+ ## [1.18.1](https://github.com/Lundalogik/lime-n8n/compare/v1.18.0...v1.18.1) (2025-11-13)
99
+
100
+
101
+ ### Bug Fixes
102
+
103
+ * **lime-crm:** exclude hasmany proeprties from create and update nodes ([0e9f171](https://github.com/Lundalogik/lime-n8n/commit/0e9f171ee4b39059aad714f9505267ef6e3a9be2))
104
+
105
+ # [1.18.0](https://github.com/Lundalogik/lime-n8n/compare/v1.17.1...v1.18.0) (2025-11-13)
106
+
107
+
108
+ ### Features
109
+
110
+ * add knip ([10f4541](https://github.com/Lundalogik/lime-n8n/commit/10f4541b8e42e6454faecdeee54c8f05c2a5b6fd))
111
+ * add knip to CI ([9579d1f](https://github.com/Lundalogik/lime-n8n/commit/9579d1f9b99c0daa68c1709e312cc7c82b8fff08))
112
+
113
+ ## [1.17.1](https://github.com/Lundalogik/lime-n8n/compare/v1.17.0...v1.17.1) (2025-11-12)
114
+
115
+
116
+ ### Bug Fixes
117
+
118
+ * **lime-crm:** remove unused arguments and async from getFilePropertiesNames ([5f74ac3](https://github.com/Lundalogik/lime-n8n/commit/5f74ac3e86340df7facd4c8c1996fdb043da52e0))
119
+
120
+ # [1.17.0](https://github.com/Lundalogik/lime-n8n/compare/v1.16.1...v1.17.0) (2025-11-12)
121
+
122
+
123
+ ### Features
124
+
125
+ * update n8n ([d147c31](https://github.com/Lundalogik/lime-n8n/commit/d147c31dc85162061398834dfd13cf7908ed2fb4))
126
+
127
+ ## [1.16.1](https://github.com/Lundalogik/lime-n8n/compare/v1.16.0...v1.16.1) (2025-11-12)
128
+
129
+
130
+ ### Bug Fixes
131
+
132
+ * add property adapters and logic for boolean fields ([c6c6d93](https://github.com/Lundalogik/lime-n8n/commit/c6c6d93dae035877a3defbdda0782155fa8a7e8a))
133
+
134
+ # [1.16.0](https://github.com/Lundalogik/lime-n8n/compare/v1.15.0...v1.16.0) (2025-11-07)
135
+
136
+
137
+ ### Features
138
+
139
+ * **lime-crm:** make `LimeCrmNode` AI Agent tool compatible ([1bd4df7](https://github.com/Lundalogik/lime-n8n/commit/1bd4df70b5399a7e35525eae8b8028f667ce1990))
140
+
141
+ # [1.15.0](https://github.com/Lundalogik/lime-n8n/compare/v1.14.1...v1.15.0) (2025-11-07)
142
+
143
+
144
+ ### Features
145
+
146
+ * add get many users node ([f9978e6](https://github.com/Lundalogik/lime-n8n/commit/f9978e62f8db3d9236ae6b0cfab16c314ab29f7d))
147
+ * get single user node ([af91b02](https://github.com/Lundalogik/lime-n8n/commit/af91b02b7977333973dc0624219c7539724f4103))
148
+
149
+ ## [1.14.1](https://github.com/Lundalogik/lime-n8n/compare/v1.14.0...v1.14.1) (2025-11-06)
150
+
151
+
152
+ ### Bug Fixes
153
+
154
+ * **lime-crm:** return `NodeResponse` from the `Get Single File Metadata` node ([b1158df](https://github.com/Lundalogik/lime-n8n/commit/b1158df9742c12d14c38f6fdb07afac59cfc0537))
155
+
1
156
  # [1.14.0](https://github.com/Lundalogik/lime-n8n/compare/v1.13.0...v1.14.0) (2025-10-29)
2
157
 
3
158
 
package/Dockerfile CHANGED
@@ -1,21 +0,0 @@
1
- # ----------- Stage 1: Build -----------
2
- FROM node:18 AS builder
3
-
4
- RUN mkdir /source
5
- WORKDIR /source
6
- COPY . .
7
- RUN npm install -g typescript@5.3.2
8
- RUN npm install --include=dev
9
- RUN npm run build
10
-
11
-
12
- # ----------- Stage 2: Production -----------
13
- FROM n8nio/n8n:1.113.2
14
-
15
- ENV N8N_CUSTOM_EXTENSIONS=/home/node/.n8n/custom
16
-
17
- USER root
18
- COPY --from=builder /source/dist /home/node/.n8n/custom
19
-
20
- USER node
21
- WORKDIR /home/node
package/README.md CHANGED
@@ -68,7 +68,7 @@ docker-compose restart n8n
68
68
 
69
69
  ### Creating a New Custom Node
70
70
 
71
- 1. Create a new directory in the `custom-nodes` directory
71
+ 1. Create a new directory in the `nodes` directory
72
72
  2. Add your node's TypeScript files and package.json
73
73
  3. Build the nodes using the build script
74
74
  4. Restart n8n
@@ -7,8 +7,45 @@ import {
7
7
  } from 'n8n-workflow';
8
8
  import crypto from 'node:crypto';
9
9
 
10
- import { LIME_CRM_API_CREDENTIAL_KEY } from '../nodes/lime-crm/commons';
10
+ import { LIME_CRM_API_CREDENTIAL_KEY } from '../nodes';
11
11
 
12
+ /**
13
+ * LimeCrmApi Credential
14
+ * ---------------------
15
+ * This credential type allows n8n nodes to authenticate and interact with the Lime CRM API.
16
+ *
17
+ * ## Authentication
18
+ * The Lime CRM API uses a custom header (`X-API-Key`) for authentication. Once configured,
19
+ * n8n automatically injects the API key into all HTTP requests made using this credential.
20
+ *
21
+ * **Header used:**
22
+ * ```
23
+ * X-API-Key: <your-api-key>
24
+ * ```
25
+ *
26
+ * ## Required Fields
27
+ * - **Server URL:** The base URL of your Lime CRM instance.
28
+ * - Example: `https://instance.lime-crm.com/instance-name`
29
+ *
30
+ * - **API Key:** The API key generated in Lime CRM.
31
+ * - You can obtain it from Lime Admin.
32
+ *
33
+ * ## Additional Fields
34
+ * - **Webhook Secret:** A hidden, automatically generated secret (32-byte hex string) used to
35
+ * authenticate incoming webhook requests between Lime CRM and n8n. This ensures secure event
36
+ * communication.
37
+ *
38
+ * ## Testing Connection
39
+ * The `test` property verifies credentials by sending a `GET` request to the `/api/v1/` endpoint
40
+ * of the provided Lime CRM instance. If the response is successful (HTTP 200), the credentials
41
+ * are valid.
42
+ *
43
+ * ## Related Documentation
44
+ * - Lime CRM API Docs: https://lime-crm.com/api-docs/
45
+ * - n8n Credentials Guide: https://docs.n8n.io/integrations/credentials/
46
+ *
47
+ * @public
48
+ */
12
49
  export class LimeCrmApi implements ICredentialType {
13
50
  name = LIME_CRM_API_CREDENTIAL_KEY;
14
51
  displayName = 'Lime CRM API';
@@ -0,0 +1,2 @@
1
+ export * from './LimeCrmApi.credentials';
2
+ export * from './FortnoxApi.credentials';
package/eslint.config.mjs CHANGED
@@ -10,6 +10,7 @@ export default [
10
10
  'jsdoc/require-jsdoc': 'off',
11
11
  // N8N prefers the upper camel case for file names
12
12
  'unicorn/filename-case': 'off',
13
+ 'unicorn/prefer-spread': 'off',
13
14
  'no-unused-vars': 'off',
14
15
  '@typescript-eslint/no-unused-vars': [
15
16
  'warn',
@@ -22,6 +23,6 @@ export default [
22
23
  },
23
24
  },
24
25
  {
25
- ignores: ['jest.config.js'],
26
+ ignores: ['jest.config.js', 'docs'],
26
27
  },
27
28
  ];
package/knip.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://unpkg.com/knip@5/schema.json",
3
+ "ignoreExportsUsedInFile": {
4
+ "interface": true,
5
+ "type": true
6
+ },
7
+ "tags": ["-lintignore"],
8
+ "entry": ["credentials/index.{js,ts}", "nodes/index.{js,ts}"]
9
+ }
@@ -0,0 +1,60 @@
1
+ import {
2
+ IExecuteFunctions,
3
+ IAllExecuteFunctions,
4
+ NodeApiError,
5
+ NodeOperationError,
6
+ JsonObject,
7
+ } from 'n8n-workflow';
8
+
9
+ /**
10
+ * Type guard checking if the class conforms to {@link IExecuteFunctions}
11
+ * interface
12
+ * @param nodeContext - a subclass of n8n's FunctionsBase interface
13
+ */
14
+ function isIExecuteFunctions(
15
+ nodeContext: IAllExecuteFunctions
16
+ ): nodeContext is IExecuteFunctions {
17
+ return (nodeContext as IExecuteFunctions).continueOnFail !== undefined;
18
+ }
19
+
20
+ /**
21
+ * Wrapper for the error data used in Lime workflows
22
+ */
23
+ export type WorkflowErrorContext = {
24
+ message: string;
25
+ } & JsonObject;
26
+
27
+ /**
28
+ * Structure for unsuccessful response used in communication layer.
29
+ */
30
+ export type ErrorResponse = {
31
+ success: false;
32
+ data: { error: WorkflowErrorContext };
33
+ };
34
+
35
+ /**
36
+ * Function which handles how are the errors handled in n8n workflows. It
37
+ * either throws an error or returns the error data, depending on the
38
+ * `continue on Error` flag.
39
+ * @param nodeContext - the context of a Node - we need to check if it's a
40
+ * subclass of {@link IExecuteFunctions}
41
+ * @param errorContext - the data of the error we want to return to the user
42
+ * @param isApiError - flag checking if the error is connected to the external
43
+ * API or internal N8N's logic - based on it we either throw {@link NodeApiError}
44
+ * or {@link NodeOperationError}
45
+ */
46
+ export function handleWorkflowError(
47
+ nodeContext: IAllExecuteFunctions,
48
+ errorContext: WorkflowErrorContext,
49
+ isApiError: boolean = false
50
+ ): ErrorResponse {
51
+ if (isIExecuteFunctions(nodeContext) && nodeContext.continueOnFail()) {
52
+ return {
53
+ success: false,
54
+ data: { error: errorContext },
55
+ };
56
+ } else if (isApiError) {
57
+ throw new NodeApiError(nodeContext.getNode(), errorContext);
58
+ }
59
+ throw new NodeOperationError(nodeContext.getNode(), errorContext.message);
60
+ }
@@ -0,0 +1,6 @@
1
+ export * from './commons';
2
+ export * from './Fortnox.node';
3
+ export * from './FortnoxTrigger.node';
4
+ export * from './model';
5
+ export * from './resources/invoice';
6
+ export * from './resources/customers';
@@ -4,11 +4,16 @@ import {
4
4
  NodePropertyTypes,
5
5
  } from 'n8n-workflow';
6
6
 
7
- import * as get from './operations/get.operation';
8
- import * as getAll from './operations/getAll.operation';
9
- import * as create from './operations/create.operation';
10
- import * as update from './operations/update.operation';
11
- import * as delete_ from './operations/delete.operation';
7
+ import * as operations from './operations';
8
+ import { N8NOperationModuleHandler } from '../../../modules';
9
+
10
+ const moduleHandler = new N8NOperationModuleHandler([
11
+ operations.getManyCustomers,
12
+ operations.getSingleCustomer,
13
+ operations.createSingleCustomer,
14
+ operations.updateSingleCustomer,
15
+ operations.deleteSingleCustomer,
16
+ ]);
12
17
 
13
18
  export const customerProperties: INodeProperties[] = [
14
19
  {
@@ -21,20 +26,10 @@ export const customerProperties: INodeProperties[] = [
21
26
  resource: ['customer'],
22
27
  },
23
28
  },
24
- options: [
25
- get.description,
26
- getAll.description,
27
- create.description,
28
- update.description,
29
- delete_.description,
30
- ],
29
+ options: moduleHandler.getDescriptions(),
31
30
  default: 'getAll',
32
31
  },
33
- ...get.properties,
34
- ...getAll.properties,
35
- ...create.properties,
36
- ...update.properties,
37
- ...delete_.properties,
32
+ ...moduleHandler.getProperties(),
38
33
  ];
39
34
 
40
35
  export async function customerOperations(
@@ -42,16 +37,17 @@ export async function customerOperations(
42
37
  { operation, i }: { operation: string; i: number }
43
38
  ) {
44
39
  if (operation === 'get') {
45
- return await get.execute.call(this, i);
40
+ return await operations.getSingleCustomer.execute.call(this, i);
46
41
  } else if (operation === 'getAll') {
47
- return await getAll.execute.call(this, i);
42
+ return await operations.getManyCustomers.execute.call(this, i);
48
43
  } else if (operation === 'create') {
49
- return await create.execute.call(this, i);
44
+ return await operations.createSingleCustomer.execute.call(this, i);
50
45
  } else if (operation === 'update') {
51
- return await update.execute.call(this, i);
46
+ return await operations.updateSingleCustomer.execute.call(this, i);
52
47
  } else if (operation === 'delete') {
53
- return await delete_.execute.call(this, i);
48
+ return await operations.deleteSingleCustomer.execute.call(this, i);
54
49
  }
55
50
 
56
51
  return null;
57
52
  }
53
+ export * from './operations';
@@ -1,8 +1,12 @@
1
- import { IExecuteFunctions, INodeProperties, IDataObject } from 'n8n-workflow';
1
+ import {
2
+ IExecuteFunctions,
3
+ INodeProperties,
4
+ IDataObject,
5
+ NodeOperationError,
6
+ } from 'n8n-workflow';
2
7
  import { apiRequest } from '../../../transport';
3
8
  import { code as currencyCode } from 'currency-codes';
4
9
  import { CustomerResponse } from '../model';
5
- import { NodeResponse } from '../../../../nodeResponse';
6
10
 
7
11
  export const description = {
8
12
  name: 'Create Customer',
@@ -11,7 +15,7 @@ export const description = {
11
15
  action: 'Create a customer',
12
16
  };
13
17
 
14
- export const createProperties: INodeProperties[] = [
18
+ const createProperties: INodeProperties[] = [
15
19
  {
16
20
  displayName: 'Address 1',
17
21
  name: 'Address1',
@@ -257,7 +261,7 @@ export const properties: INodeProperties[] = [
257
261
  export async function execute(
258
262
  this: IExecuteFunctions,
259
263
  i: number
260
- ): Promise<NodeResponse<CustomerResponse>> {
264
+ ): Promise<CustomerResponse> {
261
265
  const name = this.getNodeParameter('Name', i) as string;
262
266
  let currency = this.getNodeParameter('Currency', i) as string;
263
267
  currency = currency.toUpperCase();
@@ -276,10 +280,10 @@ export async function execute(
276
280
  ) as IDataObject;
277
281
 
278
282
  if (currencyCode(currency) === undefined) {
279
- return {
280
- success: false,
281
- error: `Invalid currency code: ${currency}. Use ISO 4217 currency code.`,
282
- };
283
+ throw new NodeOperationError(
284
+ this.getNode(),
285
+ `Invalid currency code: ${currency}. Use ISO 4217 currency code.`
286
+ );
283
287
  }
284
288
 
285
289
  const body = {
@@ -1,6 +1,5 @@
1
1
  import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
2
  import { apiRequest } from '../../../transport';
3
- import { NodeResponse } from '../../../../nodeResponse';
4
3
 
5
4
  export const description = {
6
5
  name: 'Delete Customer',
@@ -29,7 +28,7 @@ export const properties: INodeProperties[] = [
29
28
  export async function execute(
30
29
  this: IExecuteFunctions,
31
30
  i: number
32
- ): Promise<NodeResponse<null>> {
31
+ ): Promise<null> {
33
32
  const customerNumber = this.getNodeParameter(
34
33
  'customerNumber',
35
34
  i,
@@ -37,18 +36,14 @@ export async function execute(
37
36
  ) as string;
38
37
 
39
38
  const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
40
- const response = await apiRequest<null>(this, {
41
- method: 'DELETE',
42
- endpoint,
43
- });
44
-
45
- if (response.success) return response;
46
-
47
- return {
48
- ...response,
49
- metadata: {
50
- ...response.metadata,
51
- id: customerNumber,
39
+ return await apiRequest<null>(
40
+ this,
41
+ {
42
+ method: 'DELETE',
43
+ endpoint,
52
44
  },
53
- };
45
+ {
46
+ id: customerNumber,
47
+ }
48
+ );
54
49
  }
@@ -1,7 +1,6 @@
1
1
  import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
2
  import { apiRequest } from '../../../transport';
3
3
  import { CustomerResponse } from '../model';
4
- import { NodeResponse } from '../../../../nodeResponse';
5
4
 
6
5
  export const description = {
7
6
  name: 'Get Customer',
@@ -30,7 +29,7 @@ export const properties: INodeProperties[] = [
30
29
  export async function execute(
31
30
  this: IExecuteFunctions,
32
31
  i: number
33
- ): Promise<NodeResponse<CustomerResponse>> {
32
+ ): Promise<CustomerResponse> {
34
33
  const customerNumber = this.getNodeParameter(
35
34
  'customerNumber',
36
35
  i,
@@ -38,18 +37,14 @@ export async function execute(
38
37
  ) as string;
39
38
 
40
39
  const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
41
- const response = await apiRequest<CustomerResponse>(this, {
42
- method: 'GET',
43
- endpoint,
44
- });
45
-
46
- if (response.success) return response;
47
-
48
- return {
49
- ...response,
50
- metadata: {
51
- ...response.metadata,
52
- id: customerNumber,
40
+ return await apiRequest<CustomerResponse>(
41
+ this,
42
+ {
43
+ method: 'GET',
44
+ endpoint,
53
45
  },
54
- };
46
+ {
47
+ id: customerNumber,
48
+ }
49
+ );
55
50
  }