@limetech/n8n-nodes-lime 0.5.0 → 2.3.1-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 (303) hide show
  1. package/.github/workflows/lint.yml +3 -1
  2. package/.github/workflows/release.yml +2 -49
  3. package/.github/workflows/test-and-build.yml +1 -1
  4. package/.releaserc.json +2 -1
  5. package/CHANGELOG.md +122 -0
  6. package/README.md +1 -1
  7. package/credentials/LimeCrmApi.credentials.ts +38 -1
  8. package/credentials/index.ts +2 -0
  9. package/eslint.config.mjs +2 -1
  10. package/knip.json +9 -0
  11. package/nodes/fortnox/index.ts +6 -0
  12. package/nodes/fortnox/resources/customers/index.ts +18 -22
  13. package/nodes/fortnox/resources/customers/operations/create.operation.ts +12 -8
  14. package/nodes/fortnox/resources/customers/operations/delete.operation.ts +10 -15
  15. package/nodes/fortnox/resources/customers/operations/get.operation.ts +10 -15
  16. package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +1 -2
  17. package/nodes/fortnox/resources/customers/operations/index.ts +5 -0
  18. package/nodes/fortnox/resources/customers/operations/update.operation.ts +30 -30
  19. package/nodes/fortnox/resources/invoice/index.ts +16 -18
  20. package/nodes/fortnox/resources/invoice/model.ts +0 -4
  21. package/nodes/fortnox/resources/invoice/operations/create.operation.ts +1 -2
  22. package/nodes/fortnox/resources/invoice/operations/get.operation.ts +10 -15
  23. package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +1 -2
  24. package/nodes/fortnox/resources/invoice/operations/index.ts +4 -0
  25. package/nodes/fortnox/resources/invoice/operations/update.operation.ts +11 -16
  26. package/nodes/fortnox/transport/index.ts +14 -11
  27. package/nodes/index.ts +4 -0
  28. package/nodes/lime-crm/LimeCrmNode.node.ts +81 -11
  29. package/nodes/lime-crm/LimeCrmTrigger.node.ts +70 -30
  30. package/nodes/lime-crm/index.ts +9 -0
  31. package/nodes/lime-crm/methods/getLimetypeProperties.ts +51 -8
  32. package/nodes/lime-crm/methods/getLimetypes.ts +14 -9
  33. package/nodes/lime-crm/methods/index.ts +1 -1
  34. package/nodes/lime-crm/models/constants.ts +73 -0
  35. package/nodes/lime-crm/models/index.ts +21 -0
  36. package/nodes/lime-crm/models/limeobject.ts +13 -0
  37. package/nodes/lime-crm/models/limetype.ts +47 -0
  38. package/nodes/lime-crm/models/propertyTypes.ts +13 -0
  39. package/nodes/lime-crm/models/users.ts +46 -0
  40. package/nodes/lime-crm/models/webhook.ts +61 -0
  41. package/nodes/lime-crm/resources/admin/index.ts +89 -0
  42. package/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.ts +166 -0
  43. package/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.ts +113 -0
  44. package/nodes/lime-crm/resources/admin/operations/index.ts +8 -0
  45. package/nodes/lime-crm/resources/data/index.ts +68 -31
  46. package/nodes/lime-crm/resources/data/operations/{createSingleObject.ts → createSingleObject.operation.ts} +82 -26
  47. package/nodes/lime-crm/resources/data/operations/{deleteSingleObject.ts → deleteSingleObject.operation.ts} +32 -4
  48. package/nodes/lime-crm/resources/data/operations/{getManyObjects.ts → getManyObjects.operation.ts} +191 -48
  49. package/nodes/lime-crm/resources/data/operations/{getSingleFile.ts → getSingleFile.operation.ts} +36 -12
  50. package/nodes/lime-crm/resources/data/operations/{getSingleObject.ts → getSingleObject.operation.ts} +39 -6
  51. package/nodes/lime-crm/resources/data/operations/index.ts +24 -0
  52. package/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.ts +55 -17
  53. package/nodes/lime-crm/resources/metadata/index.ts +56 -16
  54. package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +15 -5
  55. package/nodes/lime-crm/resources/metadata/operations/{getSingleFileMetadata.ts → getSingleFileMetadata.operation.ts} +31 -14
  56. package/nodes/lime-crm/resources/metadata/operations/{getSingleLimetype.ts → getSingleLimetype.operation.ts} +23 -1
  57. package/nodes/lime-crm/resources/metadata/operations/index.ts +12 -0
  58. package/nodes/lime-crm/transport/commons.ts +86 -28
  59. package/nodes/lime-crm/transport/files.ts +149 -84
  60. package/nodes/lime-crm/transport/index.ts +35 -17
  61. package/nodes/lime-crm/transport/limeQuery.ts +42 -6
  62. package/nodes/lime-crm/transport/limeobjects.ts +102 -179
  63. package/nodes/lime-crm/transport/limetypes.ts +126 -70
  64. package/nodes/lime-crm/transport/users.ts +264 -0
  65. package/nodes/lime-crm/transport/webhooks.ts +96 -37
  66. package/nodes/lime-crm/{commons → utils}/files.ts +75 -39
  67. package/nodes/lime-crm/utils/hmac.ts +35 -0
  68. package/nodes/lime-crm/utils/index.ts +10 -0
  69. package/nodes/lime-crm/utils/propertyAdapters.ts +75 -0
  70. package/nodes/lime-crm/utils/webhook.ts +81 -0
  71. package/nodes/modules.ts +44 -0
  72. package/nodes/response.ts +16 -0
  73. package/package.json +18 -27
  74. package/tests/nodes/lime-crm/utils.spec.ts +238 -0
  75. package/typedoc.css +9 -0
  76. package/typedoc.json +19 -0
  77. package/.dockerignore +0 -1
  78. package/Dockerfile +0 -21
  79. package/dist/credentials/FortnoxApi.credentials.d.ts +0 -9
  80. package/dist/credentials/FortnoxApi.credentials.js +0 -57
  81. package/dist/credentials/FortnoxApi.credentials.js.map +0 -1
  82. package/dist/credentials/LimeCrmApi.credentials.d.ts +0 -9
  83. package/dist/credentials/LimeCrmApi.credentials.js +0 -66
  84. package/dist/credentials/LimeCrmApi.credentials.js.map +0 -1
  85. package/dist/nodes/fortnox/Fortnox.node.d.ts +0 -5
  86. package/dist/nodes/fortnox/Fortnox.node.js +0 -95
  87. package/dist/nodes/fortnox/Fortnox.node.js.map +0 -1
  88. package/dist/nodes/fortnox/Fortnox.node.json +0 -18
  89. package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +0 -5
  90. package/dist/nodes/fortnox/FortnoxTrigger.node.js +0 -155
  91. package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +0 -1
  92. package/dist/nodes/fortnox/FortnoxTrigger.node.json +0 -18
  93. package/dist/nodes/fortnox/commons.d.ts +0 -25
  94. package/dist/nodes/fortnox/commons.js +0 -44
  95. package/dist/nodes/fortnox/commons.js.map +0 -1
  96. package/dist/nodes/fortnox/fortnoxLogo.svg +0 -15
  97. package/dist/nodes/fortnox/model.d.ts +0 -20
  98. package/dist/nodes/fortnox/model.js +0 -3
  99. package/dist/nodes/fortnox/model.js.map +0 -1
  100. package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +0 -2
  101. package/dist/nodes/fortnox/resources/customers/filterParameters.js +0 -31
  102. package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +0 -1
  103. package/dist/nodes/fortnox/resources/customers/index.d.ts +0 -20
  104. package/dist/nodes/fortnox/resources/customers/index.js +0 -87
  105. package/dist/nodes/fortnox/resources/customers/index.js.map +0 -1
  106. package/dist/nodes/fortnox/resources/customers/model.d.ts +0 -99
  107. package/dist/nodes/fortnox/resources/customers/model.js +0 -3
  108. package/dist/nodes/fortnox/resources/customers/model.js.map +0 -1
  109. package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +0 -12
  110. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +0 -283
  111. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +0 -1
  112. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +0 -10
  113. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +0 -45
  114. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +0 -1
  115. package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +0 -11
  116. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +0 -45
  117. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +0 -1
  118. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +0 -11
  119. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +0 -68
  120. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +0 -1
  121. package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +0 -12
  122. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +0 -276
  123. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +0 -1
  124. package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +0 -2
  125. package/dist/nodes/fortnox/resources/customers/sortParameters.js +0 -30
  126. package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +0 -1
  127. package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +0 -2
  128. package/dist/nodes/fortnox/resources/invoice/filterParameters.js +0 -72
  129. package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +0 -1
  130. package/dist/nodes/fortnox/resources/invoice/index.d.ts +0 -20
  131. package/dist/nodes/fortnox/resources/invoice/index.js +0 -81
  132. package/dist/nodes/fortnox/resources/invoice/index.js.map +0 -1
  133. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +0 -2
  134. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +0 -193
  135. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +0 -1
  136. package/dist/nodes/fortnox/resources/invoice/model.d.ts +0 -150
  137. package/dist/nodes/fortnox/resources/invoice/model.js +0 -3
  138. package/dist/nodes/fortnox/resources/invoice/model.js.map +0 -1
  139. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +0 -11
  140. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +0 -64
  141. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +0 -1
  142. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +0 -11
  143. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +0 -44
  144. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +0 -1
  145. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +0 -11
  146. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +0 -92
  147. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +0 -1
  148. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +0 -11
  149. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +0 -71
  150. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +0 -1
  151. package/dist/nodes/fortnox/transport/errorCodes.d.ts +0 -1
  152. package/dist/nodes/fortnox/transport/errorCodes.js +0 -50
  153. package/dist/nodes/fortnox/transport/errorCodes.js.map +0 -1
  154. package/dist/nodes/fortnox/transport/index.d.ts +0 -4
  155. package/dist/nodes/fortnox/transport/index.js +0 -77
  156. package/dist/nodes/fortnox/transport/index.js.map +0 -1
  157. package/dist/nodes/lime-crm/LimeCrm.node.json +0 -18
  158. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +0 -14
  159. package/dist/nodes/lime-crm/LimeCrmNode.node.js +0 -126
  160. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +0 -1
  161. package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +0 -18
  162. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +0 -215
  163. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +0 -1
  164. package/dist/nodes/lime-crm/assets/lime-crm.svg +0 -1
  165. package/dist/nodes/lime-crm/commons/constants.d.ts +0 -5
  166. package/dist/nodes/lime-crm/commons/constants.js +0 -9
  167. package/dist/nodes/lime-crm/commons/constants.js.map +0 -1
  168. package/dist/nodes/lime-crm/commons/hmac.d.ts +0 -1
  169. package/dist/nodes/lime-crm/commons/hmac.js +0 -11
  170. package/dist/nodes/lime-crm/commons/hmac.js.map +0 -1
  171. package/dist/nodes/lime-crm/commons/index.d.ts +0 -3
  172. package/dist/nodes/lime-crm/commons/index.js +0 -12
  173. package/dist/nodes/lime-crm/commons/index.js.map +0 -1
  174. package/dist/nodes/lime-crm/commons/limetype.d.ts +0 -10
  175. package/dist/nodes/lime-crm/commons/limetype.js +0 -3
  176. package/dist/nodes/lime-crm/commons/limetype.js.map +0 -1
  177. package/dist/nodes/lime-crm/commons/task.d.ts +0 -14
  178. package/dist/nodes/lime-crm/commons/task.js +0 -48
  179. package/dist/nodes/lime-crm/commons/task.js.map +0 -1
  180. package/dist/nodes/lime-crm/commons/webhook.d.ts +0 -20
  181. package/dist/nodes/lime-crm/commons/webhook.js +0 -30
  182. package/dist/nodes/lime-crm/commons/webhook.js.map +0 -1
  183. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +0 -5
  184. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +0 -11
  185. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +0 -1
  186. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +0 -2
  187. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +0 -20
  188. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +0 -1
  189. package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +0 -2
  190. package/dist/nodes/lime-crm/methods/getLimeTypes.js +0 -20
  191. package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +0 -1
  192. package/dist/nodes/lime-crm/methods/index.d.ts +0 -3
  193. package/dist/nodes/lime-crm/methods/index.js +0 -10
  194. package/dist/nodes/lime-crm/methods/index.js.map +0 -1
  195. package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +0 -23
  196. package/dist/nodes/lime-crm/resources/erpConnector/index.js +0 -67
  197. package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +0 -1
  198. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +0 -26
  199. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +0 -65
  200. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +0 -1
  201. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +0 -9
  202. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +0 -220
  203. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +0 -1
  204. package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +0 -15
  205. package/dist/nodes/lime-crm/resources/erpConnector/transform.js +0 -11
  206. package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +0 -1
  207. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +0 -4
  208. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +0 -7
  209. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +0 -1
  210. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +0 -37
  211. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +0 -124
  212. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +0 -1
  213. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +0 -1
  214. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +0 -6
  215. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +0 -1
  216. package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +0 -14
  217. package/dist/nodes/lime-crm/resources/limeObject/index.js +0 -88
  218. package/dist/nodes/lime-crm/resources/limeObject/index.js.map +0 -1
  219. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +0 -9
  220. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +0 -139
  221. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +0 -1
  222. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +0 -9
  223. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +0 -51
  224. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +0 -1
  225. package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.d.ts +0 -9
  226. package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.js +0 -103
  227. package/dist/nodes/lime-crm/resources/limeObject/operations/fetchMany.operation.js.map +0 -1
  228. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +0 -9
  229. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +0 -51
  230. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +0 -1
  231. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +0 -9
  232. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +0 -103
  233. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +0 -1
  234. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +0 -9
  235. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +0 -149
  236. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +0 -1
  237. package/dist/nodes/lime-crm/resources/limeQuery/index.d.ts +0 -6
  238. package/dist/nodes/lime-crm/resources/limeQuery/index.js +0 -66
  239. package/dist/nodes/lime-crm/resources/limeQuery/index.js.map +0 -1
  240. package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.d.ts +0 -9
  241. package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.js +0 -191
  242. package/dist/nodes/lime-crm/resources/limeQuery/operations/query.operation.js.map +0 -1
  243. package/dist/nodes/lime-crm/resources/limeType/index.d.ts +0 -20
  244. package/dist/nodes/lime-crm/resources/limeType/index.js +0 -81
  245. package/dist/nodes/lime-crm/resources/limeType/index.js.map +0 -1
  246. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +0 -11
  247. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +0 -36
  248. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +0 -1
  249. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +0 -9
  250. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +0 -36
  251. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +0 -1
  252. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +0 -10
  253. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +0 -15
  254. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +0 -1
  255. package/dist/nodes/lime-crm/transport/commons.d.ts +0 -5
  256. package/dist/nodes/lime-crm/transport/commons.js +0 -33
  257. package/dist/nodes/lime-crm/transport/commons.js.map +0 -1
  258. package/dist/nodes/lime-crm/transport/erpConnector.d.ts +0 -9
  259. package/dist/nodes/lime-crm/transport/erpConnector.js +0 -11
  260. package/dist/nodes/lime-crm/transport/erpConnector.js.map +0 -1
  261. package/dist/nodes/lime-crm/transport/index.d.ts +0 -6
  262. package/dist/nodes/lime-crm/transport/index.js +0 -24
  263. package/dist/nodes/lime-crm/transport/index.js.map +0 -1
  264. package/dist/nodes/lime-crm/transport/limeQuery.d.ts +0 -10
  265. package/dist/nodes/lime-crm/transport/limeQuery.js +0 -15
  266. package/dist/nodes/lime-crm/transport/limeQuery.js.map +0 -1
  267. package/dist/nodes/lime-crm/transport/limeobjects.d.ts +0 -7
  268. package/dist/nodes/lime-crm/transport/limeobjects.js +0 -134
  269. package/dist/nodes/lime-crm/transport/limeobjects.js.map +0 -1
  270. package/dist/nodes/lime-crm/transport/limetypes.d.ts +0 -6
  271. package/dist/nodes/lime-crm/transport/limetypes.js +0 -54
  272. package/dist/nodes/lime-crm/transport/limetypes.js.map +0 -1
  273. package/dist/nodes/lime-crm/transport/task.d.ts +0 -13
  274. package/dist/nodes/lime-crm/transport/task.js +0 -13
  275. package/dist/nodes/lime-crm/transport/task.js.map +0 -1
  276. package/dist/nodes/lime-crm/transport/webhooks.d.ts +0 -16
  277. package/dist/nodes/lime-crm/transport/webhooks.js +0 -43
  278. package/dist/nodes/lime-crm/transport/webhooks.js.map +0 -1
  279. package/dist/nodes/nodeResponse.d.ts +0 -12
  280. package/dist/nodes/nodeResponse.js +0 -3
  281. package/dist/nodes/nodeResponse.js.map +0 -1
  282. package/dist/package.json +0 -75
  283. package/dist/tsconfig.tsbuildinfo +0 -1
  284. package/docker-compose.yml +0 -52
  285. package/nodes/lime-crm/commons/constants.ts +0 -9
  286. package/nodes/lime-crm/commons/hmac.ts +0 -13
  287. package/nodes/lime-crm/commons/index.ts +0 -10
  288. package/nodes/lime-crm/commons/task.ts +0 -55
  289. package/nodes/lime-crm/commons/webhook.ts +0 -68
  290. package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +0 -11
  291. package/nodes/lime-crm/model.ts +0 -22
  292. package/nodes/lime-crm/resources/erpConnector/index.ts +0 -43
  293. package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +0 -69
  294. package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +0 -274
  295. package/nodes/lime-crm/resources/erpConnector/transform.ts +0 -49
  296. package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +0 -18
  297. package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +0 -201
  298. package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +0 -1
  299. package/nodes/lime-crm/transport/erpConnector.ts +0 -21
  300. package/nodes/lime-crm/transport/task.ts +0 -32
  301. package/nodes/nodeResponse.ts +0 -13
  302. package/tests/fixtures/fortnox.ts +0 -182
  303. package/tests/transform.spec.ts +0 -187
@@ -1,8 +1,13 @@
1
1
  import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
2
 
3
- import { queryLimeobjects } from '../../../transport';
4
- import { DATA_RESOURCE } from '../../../commons';
3
+ import { IncludedProperties, queryLimeobjects } from '../../../transport';
4
+ import { DATA_RESOURCE, DEFAULT_API_OBJECT_LIMIT } from '../../../models';
5
5
 
6
+ /**
7
+ * Description and metadata for the "Get Many Objects" operation in Lime CRM.
8
+ *
9
+ * @public
10
+ */
6
11
  export const description = {
7
12
  name: 'Get Many Objects',
8
13
  value: 'getManyObjects',
@@ -10,14 +15,54 @@ export const description = {
10
15
  action: 'Get many objects',
11
16
  };
12
17
 
13
- const BATCHSIZE = 50;
18
+ /**
19
+ * Maximum number of objects to fetch in a single API request.
20
+ * @internal
21
+ */
22
+ const BATCHSIZE = 200;
14
23
 
24
+ /**
25
+ * Structure of the response format when querying Lime CRM objects.
26
+ *
27
+ * @remarks
28
+ * This is used to define which properties are included in the API response.
29
+ * The keys of the `object` correspond to property names of the entity,
30
+ * and the values are initialized as empty strings.
31
+ *
32
+ * @example
33
+ * {
34
+ * object: {
35
+ * _id: '',
36
+ * name: '',
37
+ * phone: ''
38
+ * }
39
+ * }
40
+ *
41
+ * @internal
42
+ */
15
43
  interface ResponseFormat {
16
44
  object: {
17
45
  [key: string]: string;
18
46
  };
19
47
  }
20
48
 
49
+ /**
50
+ * Defines a collection of properties to order query results by.
51
+ *
52
+ * @remarks
53
+ * Each entry specifies a property name and the direction in which the results
54
+ * should be sorted. Multiple fields can be provided to perform multi-level sorting.
55
+ *
56
+ * @example
57
+ * {
58
+ * orderByFields: [
59
+ * { propertyName: 'name', sortDirection: 'ASC' },
60
+ * { propertyName: 'createdAt', sortDirection: 'DESC' }
61
+ * ]
62
+ * }
63
+ *
64
+ * @internal
65
+ */
21
66
  interface OrderByCollection {
22
67
  orderByFields: {
23
68
  propertyName: string;
@@ -25,6 +70,21 @@ interface OrderByCollection {
25
70
  }[];
26
71
  }
27
72
 
73
+ /**
74
+ * Node properties for the "Get Many Objects" operation.
75
+ *
76
+ * @param {string} limetype - The type of entity to query. Loaded from available Limetypes
77
+ * @param {'fields' | 'json'} responseFormatInputMethod - How to format the response
78
+ * @param {Array<{ name: string }>} responseFormatProperties - The properties to include if using 'fields'
79
+ * @param {string} responseFormatJson - JSON defining the response structure if using 'json'
80
+ * @param {string} filter - JSON defining filtering conditions
81
+ * @param {number} limit - Maximum number of objects to return
82
+ * @param {'fields' | 'json'} orderByInputMethod - How to specify ordering
83
+ * @param {OrderByCollection} orderByProperties - Order by fields if using 'fields'
84
+ * @param {string} orderByJson - JSON defining ordering if using 'json'
85
+ *
86
+ * @public
87
+ */
28
88
  export const properties: INodeProperties[] = [
29
89
  {
30
90
  displayName: 'Limetype',
@@ -137,7 +197,7 @@ export const properties: INodeProperties[] = [
137
197
  displayName: 'Limit',
138
198
  name: 'limit',
139
199
  type: 'number',
140
- default: 50,
200
+ default: DEFAULT_API_OBJECT_LIMIT,
141
201
  description: 'The maximum number of records to return',
142
202
  displayOptions: {
143
203
  show: {
@@ -238,7 +298,30 @@ export const properties: INodeProperties[] = [
238
298
  },
239
299
  ];
240
300
 
241
- function _createResponseFormatObject(
301
+ /**
302
+ * Create the response format object when using 'fields' mode.
303
+ *
304
+ * @remarks
305
+ * This function takes an array of property descriptors (each with a `name` field)
306
+ * and constructs a response object suitable for Lime CRM queries. It initializes
307
+ * each property with an empty string, ensuring that all requested fields are
308
+ * included in the response, even if the values are not yet set.
309
+ *
310
+ * Additionally, it always includes a default `_id` field in the response object,
311
+ * which is typically required by Lime CRM for object identification.
312
+ *
313
+ * Example:
314
+ * ```ts
315
+ * createResponseFormatObject([{ name: 'name' }, { name: 'email' }]);
316
+ * // Returns: { object: { _id: '', name: '', email: '' } }
317
+ * ```
318
+ *
319
+ * @param properties - Array of property descriptors.
320
+ * @returns The ResponseFormat object.
321
+ *
322
+ * @internal
323
+ */
324
+ function createResponseFormatObject(
242
325
  properties: { name: string }[] = []
243
326
  ): ResponseFormat {
244
327
  const object: Record<string, string> = { _id: '' };
@@ -248,7 +331,34 @@ function _createResponseFormatObject(
248
331
  return { object };
249
332
  }
250
333
 
251
- function _getOrderBy(orderByCollection: OrderByCollection) {
334
+ /**
335
+ * Generate the ordering array for Lime CRM queries.
336
+ *
337
+ * @remarks
338
+ * This function transforms a user-provided `OrderByCollection` object into the
339
+ * format required by the Lime CRM API. Each property in `orderByFields` is
340
+ * converted into a key-value pair where the key is the property name and the
341
+ * value is the sort direction ('ASC' or 'DESC').
342
+ *
343
+ * If no `orderByFields` are provided, it defaults to ordering by `_id` ascending.
344
+ *
345
+ * Example:
346
+ * ```ts
347
+ * getOrderBy({
348
+ * orderByFields: [
349
+ * { propertyName: 'name', sortDirection: 'ASC' },
350
+ * { propertyName: 'createdAt', sortDirection: 'DESC' },
351
+ * ]
352
+ * });
353
+ * // Returns: [{ name: 'ASC' }, { createdAt: 'DESC' }]
354
+ * ```
355
+ *
356
+ * @param orderByCollection - Collection of order-by fields provided by the user.
357
+ * @returns An array of objects representing the order-by configuration for Lime CRM.
358
+ *
359
+ * @internal
360
+ */
361
+ function getOrderBy(orderByCollection: OrderByCollection) {
252
362
  const orderBy =
253
363
  orderByCollection.orderByFields &&
254
364
  orderByCollection.orderByFields.map((field) => ({
@@ -257,57 +367,86 @@ function _getOrderBy(orderByCollection: OrderByCollection) {
257
367
  return orderBy || [{ _id: 'ASC' }];
258
368
  }
259
369
 
260
- async function _fetchLimeObjectsInBatches(
370
+ /**
371
+ * Fetch Lime CRM objects in batches to handle large result sets or unlimited queries.
372
+ *
373
+ * @remarks
374
+ * This function retrieves objects from Lime CRM for a given limetype by performing
375
+ * multiple sequential API calls, each fetching up to BATCHSIZE records.
376
+ *
377
+ * @param limetype - The type of Lime CRM entity to fetch
378
+ * @param responseFormat - The format in which objects should be returned, defining which properties are included
379
+ * @param filter - JSON string representing the filter conditions for the query
380
+ * @param limit - Maximum number of objects to fetch in this request
381
+ * @param orderBy - Array of objects defining the sorting of the results
382
+ *
383
+ * @returns Array of fetched objects or an error response as an array.
384
+ */
385
+ async function fetchLimeObjects(
261
386
  this: IExecuteFunctions,
262
387
  limetype: string,
263
388
  responseFormat: ResponseFormat,
264
389
  filter: string,
265
- limit: number,
266
- orderBy: Array<{ [key: string]: 'ASC' | 'DESC' }>
267
- ) {
268
- if (limit <= BATCHSIZE) {
390
+ limit: number | null,
391
+ orderBy: Record<string, 'ASC' | 'DESC'>[]
392
+ ): Promise<IncludedProperties[]> {
393
+ const allResults: IncludedProperties[] = [];
394
+ const parsedFilter = JSON.parse(filter);
395
+ const unlimited = limit === null || limit === 0;
396
+ const targetLimit = unlimited ? Infinity : limit;
397
+
398
+ let fetched = 0;
399
+ let currentOffset = 0;
400
+
401
+ while (fetched < targetLimit) {
402
+ const currentLimit =
403
+ targetLimit === Infinity
404
+ ? BATCHSIZE
405
+ : Math.min(BATCHSIZE, targetLimit - fetched);
406
+
269
407
  const q = JSON.stringify({
270
408
  limetype,
271
409
  responseFormat: responseFormat,
272
- filter: JSON.parse(filter),
273
- limit: limit,
274
- offset: 0,
410
+ filter: parsedFilter,
411
+ limit: currentLimit,
412
+ offset: currentOffset,
275
413
  orderBy: orderBy,
276
414
  });
277
- return queryLimeobjects(this, q);
278
- } else {
279
- let allResults: unknown[] = [];
280
- let fetched = 0;
281
- let currentOffset = 0;
282
- while (fetched < limit) {
283
- const currentLimit = Math.min(BATCHSIZE, limit - fetched);
284
- const q = JSON.stringify({
285
- limetype,
286
- responseFormat: responseFormat,
287
- filter: JSON.parse(filter),
288
- limit: currentLimit,
289
- offset: currentOffset,
290
- orderBy,
291
- });
292
- const batch = await queryLimeobjects(this, q);
293
- if (!batch.success) {
294
- return batch;
295
- }
296
- const collected = batch.data.objects.length;
297
- if (!batch || collected === 0) break;
298
- allResults = [...allResults, ...batch.data.objects];
299
- fetched += collected;
300
- currentOffset += collected;
301
415
 
302
- if (collected < currentLimit) break;
303
- }
304
- return {
305
- success: true,
306
- data: allResults,
307
- };
416
+ const batch = await queryLimeobjects(this, q);
417
+
418
+ const collected = batch.objects.length;
419
+ if (collected === 0) break;
420
+
421
+ allResults.push(...batch.objects);
422
+
423
+ fetched += collected;
424
+ currentOffset += collected;
425
+
426
+ if (collected < currentLimit) break;
308
427
  }
428
+
429
+ return allResults;
309
430
  }
310
431
 
432
+ /**
433
+ * Execute the "Get Many Objects" operation for Lime CRM.
434
+ *
435
+ * @remarks
436
+ * Retrieves multiple Lime CRM objects of the selected limetype with optional filtering, ordering, and response formatting.
437
+ * The method supports batch fetching if the requested limit exceeds 50 records.
438
+ *
439
+ * Steps performed by the method:
440
+ * 1. Determine the limetype and response format (fields or JSON) from {@link properties}.
441
+ * 2. Determine ordering (fields or JSON) from {@link properties}.
442
+ * 3. Fetch data from Lime CRM, handling batching if necessary.
443
+ *
444
+ * @param i - The index of the current item in the workflow execution
445
+ *
446
+ * @returns The fetched Lime objects as per the requested response format.
447
+ *
448
+ * @public
449
+ */
311
450
  export async function execute(this: IExecuteFunctions, i: number) {
312
451
  const limetype = this.getNodeParameter('limetype', i) as string;
313
452
  const responseFormatInputMethod = this.getNodeParameter(
@@ -319,7 +458,11 @@ export async function execute(this: IExecuteFunctions, i: number) {
319
458
  i
320
459
  ) as string;
321
460
  const filter = this.getNodeParameter('filter', i) as string;
322
- const limit = this.getNodeParameter('limit', i, 50) as number;
461
+ const limit = this.getNodeParameter(
462
+ 'limit',
463
+ i,
464
+ DEFAULT_API_OBJECT_LIMIT
465
+ ) as number;
323
466
 
324
467
  let response;
325
468
  if (responseFormatInputMethod === 'fields') {
@@ -327,7 +470,7 @@ export async function execute(this: IExecuteFunctions, i: number) {
327
470
  'responseFormatProperties',
328
471
  i
329
472
  ) as { property: [{ name: string }] };
330
- response = _createResponseFormatObject(properties.property);
473
+ response = createResponseFormatObject(properties.property);
331
474
  } else if (responseFormatInputMethod === 'json') {
332
475
  response = this.getNodeParameter('responseFormatJson', i) as string;
333
476
  response = JSON.parse(response);
@@ -339,13 +482,13 @@ export async function execute(this: IExecuteFunctions, i: number) {
339
482
  'orderByProperties',
340
483
  i
341
484
  ) as OrderByCollection;
342
- orderBy = _getOrderBy(orderByCollection);
485
+ orderBy = getOrderBy(orderByCollection);
343
486
  } else if (orderByInputMethod === 'json') {
344
487
  orderBy = this.getNodeParameter('orderByJson', i) as string;
345
488
  orderBy = JSON.parse(orderBy);
346
489
  }
347
490
 
348
- return await _fetchLimeObjectsInBatches.call(
491
+ return await fetchLimeObjects.call(
349
492
  this,
350
493
  limetype,
351
494
  response,
@@ -4,8 +4,13 @@ import {
4
4
  NodeOperationError,
5
5
  } from 'n8n-workflow';
6
6
  import { getFileContent, getFileContentByLimetype } from '../../../transport';
7
- import { DATA_RESOURCE } from '../../../commons';
7
+ import { DATA_RESOURCE } from '../../../models';
8
8
 
9
+ /**
10
+ * Description and metadata for the "Get Single File" operation in Lime CRM.
11
+ *
12
+ * @public
13
+ */
9
14
  export const description = {
10
15
  name: 'Get Single File',
11
16
  value: 'getSingleFile',
@@ -13,6 +18,16 @@ export const description = {
13
18
  action: 'Get single file',
14
19
  };
15
20
 
21
+ /**
22
+ * Node properties for the "Get Single File" operation.
23
+ *
24
+ * @param {('byFile' | 'byLimeobject')} source - Determines if the file should be fetched by its file ID or by its associated Limeobject ID
25
+ * @param {string} limetype - Required if fetching by Limeobject. Specifies the type of Lime CRM entity associated with the file
26
+ * @param {string} identifier - The ID of the file or the associated Limeobject to retrieve
27
+ * @param {string} property - Required if fetching by Limeobject. Specifies the file type property to fetch
28
+ *
29
+ * @public
30
+ */
16
31
  export const properties: INodeProperties[] = [
17
32
  {
18
33
  displayName: 'Get by',
@@ -94,19 +109,31 @@ export const properties: INodeProperties[] = [
94
109
  },
95
110
  ];
96
111
 
112
+ /**
113
+ * Execute the "Get Single File" operation for Lime CRM.
114
+ *
115
+ * @remarks
116
+ * This method retrieves file data from Lime CRM based on the selected source:
117
+ * - 'byFile': Fetches the file using its unique file ID.
118
+ * - 'byLimeobject': Fetches the file using an associated Limeobject ID and the specified file type property.
119
+ *
120
+ * The method returns an object containing the JSON response and the file's binary data.
121
+ *
122
+ * @param i - The index of the current item in the workflow execution
123
+ *
124
+ * @returns An object containing `json` and `binary` fields with the file data.
125
+ *
126
+ * @public
127
+ */
97
128
  export async function execute(this: IExecuteFunctions, i: number) {
98
129
  const source = this.getNodeParameter('source', i) as string;
99
130
  const id = this.getNodeParameter('identifier', i) as string;
100
131
 
101
132
  if (source == 'byFile') {
102
133
  const fileResponse = await getFileContent(this, id);
103
- if (!fileResponse.success) {
104
- return { json: fileResponse };
105
- }
106
-
107
134
  return {
108
- json: { success: fileResponse.success },
109
- binary: { data: fileResponse.data },
135
+ json: {},
136
+ binary: { data: fileResponse },
110
137
  };
111
138
  }
112
139
  if (source == 'byLimeobject') {
@@ -119,14 +146,11 @@ export async function execute(this: IExecuteFunctions, i: number) {
119
146
  id,
120
147
  property
121
148
  );
122
- if (!fileResponse.success) {
123
- return { json: fileResponse };
124
- }
125
149
 
126
150
  return {
127
- json: { success: fileResponse.success },
151
+ json: {},
128
152
  binary: {
129
- data: fileResponse.data,
153
+ data: fileResponse,
130
154
  },
131
155
  };
132
156
  }
@@ -1,9 +1,14 @@
1
1
  import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
2
 
3
- import { getLimeobject } from '../../../transport';
4
- import { DATA_RESOURCE } from '../../../commons';
5
- import { getFileProperties, processFileResponse } from '../../../commons/files';
3
+ import { getLimeobject, getProperties } from '../../../transport';
4
+ import { DATA_RESOURCE } from '../../../models';
5
+ import { getFilePropertiesNames, processFileResponse } from '../../../utils';
6
6
 
7
+ /**
8
+ * Description and metadata for the "Get Single Object" operation in Lime CRM.
9
+ *
10
+ * @public
11
+ */
7
12
  export const description = {
8
13
  name: 'Get Single Object',
9
14
  value: 'getSingleObject',
@@ -11,6 +16,15 @@ export const description = {
11
16
  action: 'Get single object',
12
17
  };
13
18
 
19
+ /**
20
+ * Node properties for the "Get Single Object" operation.
21
+ *
22
+ * @param {string} limetype - The type of entity to retrieve. Loaded from available Limetypes
23
+ * @param {string} objectId - The ID of the object to retrieve
24
+ * @param {boolean} includeFileContent - Whether to include file binary data for Limetypes that have file properties. Ignored for Limetypes without file properties
25
+ *
26
+ * @public
27
+ */
14
28
  export const properties: INodeProperties[] = [
15
29
  {
16
30
  displayName: 'Limetype',
@@ -62,6 +76,24 @@ export const properties: INodeProperties[] = [
62
76
  },
63
77
  ];
64
78
 
79
+ /**
80
+ * Execute the "Get Single Object" operation for Lime CRM.
81
+ *
82
+ * @remarks
83
+ * This method retrieves a single Lime CRM object identified by its object ID and Limetype.
84
+ * If `includeFileContent` is true, it also retrieves binary data for any file properties of the object.
85
+ *
86
+ * The method performs the following steps:
87
+ * 1. Retrieves the `limetype`, `objectId`, and `includeFileContent` from {@link properties}.
88
+ * 2. Calls {@link getLimeobject} to fetch the object from Lime CRM.
89
+ * 3. If the object has file properties and `includeFileContent` is true, it retrieves file data using {@link getFilePropertiesNames} and {@link processFileResponse}.
90
+ *
91
+ * @param i - The index of the current item in the workflow execution
92
+ *
93
+ * @returns The Lime object data, optionally including file binary content.
94
+ *
95
+ * @public
96
+ */
65
97
  export async function execute(this: IExecuteFunctions, i: number) {
66
98
  const limetype = this.getNodeParameter('limetype', i) as string;
67
99
  const objectId = this.getNodeParameter('objectId', i) as string;
@@ -71,13 +103,14 @@ export async function execute(this: IExecuteFunctions, i: number) {
71
103
  ) as boolean;
72
104
 
73
105
  const limeObjectResponse = await getLimeobject(this, limetype, objectId);
74
- if (!limeObjectResponse.success) return { json: limeObjectResponse };
75
106
 
76
- const fileProperties = await getFileProperties(this, limetype);
107
+ const propertiesResponse = await getProperties(this, limetype);
108
+
109
+ const fileProperties = getFilePropertiesNames(propertiesResponse);
77
110
  return processFileResponse(
78
111
  this,
79
112
  fileProperties,
80
- limeObjectResponse.data,
113
+ limeObjectResponse,
81
114
  includeFileContent
82
115
  );
83
116
  }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @group Resources
3
+ */
4
+ export * as createSingleObject from './createSingleObject.operation';
5
+ /**
6
+ * @group Resources
7
+ */
8
+ export * as getSingleObject from './getSingleObject.operation';
9
+ /**
10
+ * @group Resources
11
+ */
12
+ export * as updateSingleObject from './updateSingleObject.operation';
13
+ /**
14
+ * @group Resources
15
+ */
16
+ export * as deleteSingleObject from './deleteSingleObject.operation';
17
+ /**
18
+ * @group Resources
19
+ */
20
+ export * as getManyObjects from './getManyObjects.operation';
21
+ /**
22
+ * @group Resources
23
+ */
24
+ export * as getSingleFile from './getSingleFile.operation';
@@ -1,13 +1,19 @@
1
1
  import { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
- import { updateLimeobject } from '../../../transport';
3
- import { DATA_RESOURCE } from '../../../commons';
2
+ import { getProperties, updateLimeobject } from '../../../transport';
3
+ import { DATA_RESOURCE } from '../../../models';
4
4
  import {
5
- getFileProperties,
5
+ adaptProperty,
6
+ getFilePropertiesNames,
7
+ getPropertyType,
6
8
  processFileResponse,
7
9
  setFileProperties,
8
- } from '../../../commons/files';
10
+ } from '../../../utils';
9
11
 
10
- // Input fields for update operation
12
+ /**
13
+ * Description and metadata for the "Update Single Object" operation in Lime CRM.
14
+ *
15
+ * @public
16
+ */
11
17
  export const description = {
12
18
  name: 'Update Single Object',
13
19
  value: 'updateSingleObject',
@@ -15,6 +21,17 @@ export const description = {
15
21
  action: 'Update single object',
16
22
  };
17
23
 
24
+ /**
25
+ * Node properties for the "Update Single Object" operation.
26
+ *
27
+ * @param {string} limetype - The type of entity to update. Loaded from available Limetypes
28
+ * @param {string} id - The ID of the object to update
29
+ * @param {'simple' | 'json'} inputType - How the object data is provided: 'simple' for form inputs, 'json' for raw JSON
30
+ * @param {IDataObject} simpleFields - Used if `inputType` is 'simple'. List of field name/value pairs to update
31
+ * @param {string} jsonData - Used if `inputType` is 'json'. Full object data in JSON format
32
+ *
33
+ * @public
34
+ */
18
35
  export const properties: INodeProperties[] = [
19
36
  {
20
37
  displayName: 'Limetype',
@@ -118,7 +135,7 @@ export const properties: INodeProperties[] = [
118
135
  name: 'fieldName',
119
136
  type: 'options',
120
137
  typeOptions: {
121
- loadOptionsMethod: 'getLimetypeProperties',
138
+ loadOptionsMethod: 'getNoHasManyProperties',
122
139
  loadOptionsDependsOn: ['limetype'],
123
140
  },
124
141
  default: '',
@@ -137,6 +154,27 @@ export const properties: INodeProperties[] = [
137
154
  },
138
155
  ];
139
156
 
157
+ /**
158
+ * Execute the "Update Single Object" operation for Lime CRM.
159
+ *
160
+ * @remarks
161
+ * This method updates a single Lime CRM object identified by its ID and Limetype.
162
+ * It supports two input methods:
163
+ * - 'simple': key-value pairs provided via the UI
164
+ * - 'json': full object data in JSON format
165
+ *
166
+ * The method performs the following steps:
167
+ * 1. Retrieves the `limetype`, `id`, and input data from {@link properties}.
168
+ * 2. Collects and prepares any file properties using {@link getFilePropertiesNames} and {@link setFileProperties}.
169
+ * 3. Calls {@link updateLimeobject} to update the object in Lime CRM.
170
+ * 4. Processes the response, including file properties, using {@link processFileResponse}.
171
+ *
172
+ * @param i - The index of the current item in the workflow execution
173
+ *
174
+ * @returns The updated Lime object data, optionally including file binary content.
175
+ *
176
+ * @public
177
+ */
140
178
  export async function execute(this: IExecuteFunctions, i: number) {
141
179
  const limetype = this.getNodeParameter('limetype', i) as string;
142
180
  const id = this.getNodeParameter('id', i) as string;
@@ -144,6 +182,8 @@ export async function execute(this: IExecuteFunctions, i: number) {
144
182
 
145
183
  let body: IDataObject = {};
146
184
 
185
+ const properties = await getProperties(this, limetype);
186
+
147
187
  if (inputType === 'json') {
148
188
  const jsonData = this.getNodeParameter('jsonData', i) as string;
149
189
  body = JSON.parse(jsonData);
@@ -154,19 +194,18 @@ export async function execute(this: IExecuteFunctions, i: number) {
154
194
  []
155
195
  ) as IDataObject[];
156
196
  for (const field of simpleFields) {
157
- body[field.fieldName as string] = field.fieldValue;
197
+ const fieldName = field.fieldName as string;
198
+ const fieldValue = field.fieldValue as string;
199
+ body[fieldName] = adaptProperty(
200
+ fieldValue,
201
+ getPropertyType(fieldName, properties)
202
+ );
158
203
  }
159
204
  }
160
205
 
161
- const fileProperties = await getFileProperties(this, limetype);
206
+ const fileProperties = getFilePropertiesNames(properties);
162
207
 
163
- const setFilePropertiesResponse = await setFileProperties(
164
- this,
165
- i,
166
- fileProperties,
167
- body
168
- );
169
- if (!setFilePropertiesResponse.success) return setFilePropertiesResponse;
208
+ await setFileProperties(this, i, fileProperties, body);
170
209
 
171
210
  const updateLimeobjectResponse = await updateLimeobject(
172
211
  this,
@@ -174,12 +213,11 @@ export async function execute(this: IExecuteFunctions, i: number) {
174
213
  id,
175
214
  body
176
215
  );
177
- if (!updateLimeobjectResponse.success) return updateLimeobjectResponse;
178
216
 
179
217
  const response = await processFileResponse(
180
218
  this,
181
219
  fileProperties,
182
- updateLimeobjectResponse.data
220
+ updateLimeobjectResponse
183
221
  );
184
222
  return response.json;
185
223
  }