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

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 (287) hide show
  1. package/.github/workflows/lint.yml +1 -1
  2. package/.github/workflows/release.yml +16 -2
  3. package/.github/workflows/test-and-build.yml +0 -15
  4. package/.releaserc.json +1 -0
  5. package/CHANGELOG.md +42 -2
  6. package/dist/credentials/FortnoxApi.credentials.d.ts +9 -0
  7. package/dist/credentials/FortnoxApi.credentials.js +57 -0
  8. package/dist/credentials/FortnoxApi.credentials.js.map +1 -0
  9. package/dist/credentials/LimeCrmApi.credentials.d.ts +9 -0
  10. package/dist/credentials/LimeCrmApi.credentials.js +70 -0
  11. package/dist/credentials/LimeCrmApi.credentials.js.map +1 -0
  12. package/dist/credentials/index.d.ts +2 -0
  13. package/dist/credentials/index.js +19 -0
  14. package/dist/credentials/index.js.map +1 -0
  15. package/dist/nodes/errorHandling.d.ts +11 -0
  16. package/dist/nodes/errorHandling.js +20 -0
  17. package/dist/nodes/errorHandling.js.map +1 -0
  18. package/dist/nodes/fortnox/Fortnox.node.d.ts +5 -0
  19. package/dist/nodes/fortnox/Fortnox.node.js +95 -0
  20. package/dist/nodes/fortnox/Fortnox.node.js.map +1 -0
  21. package/dist/nodes/fortnox/Fortnox.node.json +18 -0
  22. package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +5 -0
  23. package/dist/nodes/fortnox/FortnoxTrigger.node.js +155 -0
  24. package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +1 -0
  25. package/dist/nodes/fortnox/FortnoxTrigger.node.json +18 -0
  26. package/dist/nodes/fortnox/commons.d.ts +25 -0
  27. package/dist/nodes/fortnox/commons.js +44 -0
  28. package/dist/nodes/fortnox/commons.js.map +1 -0
  29. package/dist/nodes/fortnox/fortnoxLogo.svg +15 -0
  30. package/dist/nodes/fortnox/index.d.ts +6 -0
  31. package/dist/nodes/fortnox/index.js +23 -0
  32. package/dist/nodes/fortnox/index.js.map +1 -0
  33. package/dist/nodes/fortnox/model.d.ts +20 -0
  34. package/dist/nodes/fortnox/model.js +3 -0
  35. package/dist/nodes/fortnox/model.js.map +1 -0
  36. package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +2 -0
  37. package/dist/nodes/fortnox/resources/customers/filterParameters.js +31 -0
  38. package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +1 -0
  39. package/dist/nodes/fortnox/resources/customers/index.d.ts +7 -0
  40. package/dist/nodes/fortnox/resources/customers/index.js +85 -0
  41. package/dist/nodes/fortnox/resources/customers/index.js.map +1 -0
  42. package/dist/nodes/fortnox/resources/customers/model.d.ts +99 -0
  43. package/dist/nodes/fortnox/resources/customers/model.js +3 -0
  44. package/dist/nodes/fortnox/resources/customers/model.js.map +1 -0
  45. package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +10 -0
  46. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +281 -0
  47. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +1 -0
  48. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +9 -0
  49. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +38 -0
  50. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -0
  51. package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +10 -0
  52. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +38 -0
  53. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -0
  54. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +10 -0
  55. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +68 -0
  56. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -0
  57. package/dist/nodes/fortnox/resources/customers/operations/index.d.ts +5 -0
  58. package/dist/nodes/fortnox/resources/customers/operations/index.js +42 -0
  59. package/dist/nodes/fortnox/resources/customers/operations/index.js.map +1 -0
  60. package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +10 -0
  61. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +261 -0
  62. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -0
  63. package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +2 -0
  64. package/dist/nodes/fortnox/resources/customers/sortParameters.js +30 -0
  65. package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +1 -0
  66. package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +2 -0
  67. package/dist/nodes/fortnox/resources/invoice/filterParameters.js +72 -0
  68. package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +1 -0
  69. package/dist/nodes/fortnox/resources/invoice/index.d.ts +7 -0
  70. package/dist/nodes/fortnox/resources/invoice/index.js +81 -0
  71. package/dist/nodes/fortnox/resources/invoice/index.js.map +1 -0
  72. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +2 -0
  73. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +193 -0
  74. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +1 -0
  75. package/dist/nodes/fortnox/resources/invoice/model.d.ts +147 -0
  76. package/dist/nodes/fortnox/resources/invoice/model.js +3 -0
  77. package/dist/nodes/fortnox/resources/invoice/model.js.map +1 -0
  78. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +10 -0
  79. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +64 -0
  80. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +1 -0
  81. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +10 -0
  82. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +37 -0
  83. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -0
  84. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +10 -0
  85. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +92 -0
  86. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -0
  87. package/dist/nodes/fortnox/resources/invoice/operations/index.d.ts +4 -0
  88. package/dist/nodes/fortnox/resources/invoice/operations/index.js +41 -0
  89. package/dist/nodes/fortnox/resources/invoice/operations/index.js.map +1 -0
  90. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +10 -0
  91. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +64 -0
  92. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -0
  93. package/dist/nodes/fortnox/transport/errorCodes.d.ts +1 -0
  94. package/dist/nodes/fortnox/transport/errorCodes.js +50 -0
  95. package/dist/nodes/fortnox/transport/errorCodes.js.map +1 -0
  96. package/dist/nodes/fortnox/transport/index.d.ts +3 -0
  97. package/dist/nodes/fortnox/transport/index.js +76 -0
  98. package/dist/nodes/fortnox/transport/index.js.map +1 -0
  99. package/dist/nodes/index.d.ts +4 -0
  100. package/dist/nodes/index.js +21 -0
  101. package/dist/nodes/index.js.map +1 -0
  102. package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
  103. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +19 -0
  104. package/dist/nodes/lime-crm/LimeCrmNode.node.js +122 -0
  105. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
  106. package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +18 -0
  107. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +215 -0
  108. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
  109. package/dist/nodes/lime-crm/assets/lime-crm.svg +1 -0
  110. package/dist/nodes/lime-crm/index.d.ts +9 -0
  111. package/dist/nodes/lime-crm/index.js +26 -0
  112. package/dist/nodes/lime-crm/index.js.map +1 -0
  113. package/dist/nodes/lime-crm/methods/getLimetypeProperties.d.ts +5 -0
  114. package/dist/nodes/lime-crm/methods/getLimetypeProperties.js +47 -0
  115. package/dist/nodes/lime-crm/methods/getLimetypeProperties.js.map +1 -0
  116. package/dist/nodes/lime-crm/methods/getLimetypes.d.ts +2 -0
  117. package/dist/nodes/lime-crm/methods/getLimetypes.js +20 -0
  118. package/dist/nodes/lime-crm/methods/getLimetypes.js.map +1 -0
  119. package/dist/nodes/lime-crm/methods/index.d.ts +3 -0
  120. package/dist/nodes/lime-crm/methods/index.js +15 -0
  121. package/dist/nodes/lime-crm/methods/index.js.map +1 -0
  122. package/dist/nodes/lime-crm/methods/resourceMapping.d.ts +4 -0
  123. package/dist/nodes/lime-crm/methods/resourceMapping.js +71 -0
  124. package/dist/nodes/lime-crm/methods/resourceMapping.js.map +1 -0
  125. package/dist/nodes/lime-crm/models/constants.d.ts +9 -0
  126. package/dist/nodes/lime-crm/models/constants.js +10 -0
  127. package/dist/nodes/lime-crm/models/constants.js.map +1 -0
  128. package/dist/nodes/lime-crm/models/index.d.ts +6 -0
  129. package/dist/nodes/lime-crm/models/index.js +13 -0
  130. package/dist/nodes/lime-crm/models/index.js.map +1 -0
  131. package/dist/nodes/lime-crm/models/limeobject.d.ts +4 -0
  132. package/dist/nodes/lime-crm/models/limeobject.js +3 -0
  133. package/dist/nodes/lime-crm/models/limeobject.js.map +1 -0
  134. package/dist/nodes/lime-crm/models/limetype.d.ts +24 -0
  135. package/dist/nodes/lime-crm/models/limetype.js +3 -0
  136. package/dist/nodes/lime-crm/models/limetype.js.map +1 -0
  137. package/dist/nodes/lime-crm/models/propertyTypes.d.ts +4 -0
  138. package/dist/nodes/lime-crm/models/propertyTypes.js +5 -0
  139. package/dist/nodes/lime-crm/models/propertyTypes.js.map +1 -0
  140. package/dist/nodes/lime-crm/models/users.d.ts +13 -0
  141. package/dist/nodes/lime-crm/models/users.js +3 -0
  142. package/dist/nodes/lime-crm/models/users.js.map +1 -0
  143. package/dist/nodes/lime-crm/models/webhook.d.ts +18 -0
  144. package/dist/nodes/lime-crm/models/webhook.js +3 -0
  145. package/dist/nodes/lime-crm/models/webhook.js.map +1 -0
  146. package/dist/nodes/lime-crm/resources/admin/index.d.ts +7 -0
  147. package/dist/nodes/lime-crm/resources/admin/index.js +89 -0
  148. package/dist/nodes/lime-crm/resources/admin/index.js.map +1 -0
  149. package/dist/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.d.ts +11 -0
  150. package/dist/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.js +123 -0
  151. package/dist/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.js.map +1 -0
  152. package/dist/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.d.ts +11 -0
  153. package/dist/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.js +87 -0
  154. package/dist/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.js.map +1 -0
  155. package/dist/nodes/lime-crm/resources/admin/operations/index.d.ts +2 -0
  156. package/dist/nodes/lime-crm/resources/admin/operations/index.js +39 -0
  157. package/dist/nodes/lime-crm/resources/admin/operations/index.js.map +1 -0
  158. package/dist/nodes/lime-crm/resources/data/index.d.ts +7 -0
  159. package/dist/nodes/lime-crm/resources/data/index.js +108 -0
  160. package/dist/nodes/lime-crm/resources/data/index.js.map +1 -0
  161. package/dist/nodes/lime-crm/resources/data/operations/createSingleObject.operation.d.ts +11 -0
  162. package/dist/nodes/lime-crm/resources/data/operations/createSingleObject.operation.js +124 -0
  163. package/dist/nodes/lime-crm/resources/data/operations/createSingleObject.operation.js.map +1 -0
  164. package/dist/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.d.ts +10 -0
  165. package/dist/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.js +52 -0
  166. package/dist/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.js.map +1 -0
  167. package/dist/nodes/lime-crm/resources/data/operations/getManyObjects.operation.d.ts +11 -0
  168. package/dist/nodes/lime-crm/resources/data/operations/getManyObjects.operation.js +299 -0
  169. package/dist/nodes/lime-crm/resources/data/operations/getManyObjects.operation.js.map +1 -0
  170. package/dist/nodes/lime-crm/resources/data/operations/getSingleFile.operation.d.ts +9 -0
  171. package/dist/nodes/lime-crm/resources/data/operations/getSingleFile.operation.js +125 -0
  172. package/dist/nodes/lime-crm/resources/data/operations/getSingleFile.operation.js.map +1 -0
  173. package/dist/nodes/lime-crm/resources/data/operations/getSingleObject.operation.d.ts +11 -0
  174. package/dist/nodes/lime-crm/resources/data/operations/getSingleObject.operation.js +79 -0
  175. package/dist/nodes/lime-crm/resources/data/operations/getSingleObject.operation.js.map +1 -0
  176. package/dist/nodes/lime-crm/resources/data/operations/index.d.ts +6 -0
  177. package/dist/nodes/lime-crm/resources/data/operations/index.js +43 -0
  178. package/dist/nodes/lime-crm/resources/data/operations/index.js.map +1 -0
  179. package/dist/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.d.ts +11 -0
  180. package/dist/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.js +146 -0
  181. package/dist/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.js.map +1 -0
  182. package/dist/nodes/lime-crm/resources/metadata/index.d.ts +7 -0
  183. package/dist/nodes/lime-crm/resources/metadata/index.js +93 -0
  184. package/dist/nodes/lime-crm/resources/metadata/index.js.map +1 -0
  185. package/dist/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.d.ts +10 -0
  186. package/dist/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.js +16 -0
  187. package/dist/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.js.map +1 -0
  188. package/dist/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.d.ts +11 -0
  189. package/dist/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.js +113 -0
  190. package/dist/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.js.map +1 -0
  191. package/dist/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.d.ts +11 -0
  192. package/dist/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.js +37 -0
  193. package/dist/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.js.map +1 -0
  194. package/dist/nodes/lime-crm/resources/metadata/operations/index.d.ts +3 -0
  195. package/dist/nodes/lime-crm/resources/metadata/operations/index.js +40 -0
  196. package/dist/nodes/lime-crm/resources/metadata/operations/index.js.map +1 -0
  197. package/dist/nodes/lime-crm/transport/commons.d.ts +14 -0
  198. package/dist/nodes/lime-crm/transport/commons.js +52 -0
  199. package/dist/nodes/lime-crm/transport/commons.js.map +1 -0
  200. package/dist/nodes/lime-crm/transport/files.d.ts +26 -0
  201. package/dist/nodes/lime-crm/transport/files.js +96 -0
  202. package/dist/nodes/lime-crm/transport/files.js.map +1 -0
  203. package/dist/nodes/lime-crm/transport/index.d.ts +7 -0
  204. package/dist/nodes/lime-crm/transport/index.js +32 -0
  205. package/dist/nodes/lime-crm/transport/index.js.map +1 -0
  206. package/dist/nodes/lime-crm/transport/limeQuery.d.ts +10 -0
  207. package/dist/nodes/lime-crm/transport/limeQuery.js +18 -0
  208. package/dist/nodes/lime-crm/transport/limeQuery.js.map +1 -0
  209. package/dist/nodes/lime-crm/transport/limeobjects.d.ts +16 -0
  210. package/dist/nodes/lime-crm/transport/limeobjects.js +76 -0
  211. package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -0
  212. package/dist/nodes/lime-crm/transport/limetypes.d.ts +33 -0
  213. package/dist/nodes/lime-crm/transport/limetypes.js +85 -0
  214. package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -0
  215. package/dist/nodes/lime-crm/transport/users.d.ts +6 -0
  216. package/dist/nodes/lime-crm/transport/users.js +159 -0
  217. package/dist/nodes/lime-crm/transport/users.js.map +1 -0
  218. package/dist/nodes/lime-crm/transport/webhooks.d.ts +14 -0
  219. package/dist/nodes/lime-crm/transport/webhooks.js +51 -0
  220. package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -0
  221. package/dist/nodes/lime-crm/utils/files.d.ts +8 -0
  222. package/dist/nodes/lime-crm/utils/files.js +103 -0
  223. package/dist/nodes/lime-crm/utils/files.js.map +1 -0
  224. package/dist/nodes/lime-crm/utils/hmac.d.ts +1 -0
  225. package/dist/nodes/lime-crm/utils/hmac.js +11 -0
  226. package/dist/nodes/lime-crm/utils/hmac.js.map +1 -0
  227. package/dist/nodes/lime-crm/utils/index.d.ts +4 -0
  228. package/dist/nodes/lime-crm/utils/index.js +16 -0
  229. package/dist/nodes/lime-crm/utils/index.js.map +1 -0
  230. package/dist/nodes/lime-crm/utils/webhook.d.ts +2 -0
  231. package/dist/nodes/lime-crm/utils/webhook.js +34 -0
  232. package/dist/nodes/lime-crm/utils/webhook.js.map +1 -0
  233. package/dist/nodes/modules.d.ts +12 -0
  234. package/dist/nodes/modules.js +16 -0
  235. package/dist/nodes/modules.js.map +1 -0
  236. package/dist/nodes/response.d.ts +18 -0
  237. package/dist/nodes/response.js +3 -0
  238. package/dist/nodes/response.js.map +1 -0
  239. package/dist/package.json +69 -0
  240. package/dist/tsconfig.tsbuildinfo +1 -0
  241. package/nodes/errorHandling.ts +60 -0
  242. package/nodes/lime-crm/LimeCrmNode.node.ts +8 -0
  243. package/nodes/lime-crm/LimeCrmTrigger.node.ts +19 -5
  244. package/nodes/lime-crm/methods/getLimetypeProperties.ts +3 -1
  245. package/nodes/lime-crm/methods/getLimetypes.ts +2 -1
  246. package/nodes/lime-crm/methods/index.ts +5 -0
  247. package/nodes/lime-crm/methods/resourceMapping.ts +141 -0
  248. package/nodes/lime-crm/models/limetype.ts +18 -0
  249. package/nodes/lime-crm/resources/admin/index.ts +9 -4
  250. package/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.ts +10 -2
  251. package/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.ts +14 -15
  252. package/nodes/lime-crm/resources/data/index.ts +15 -6
  253. package/nodes/lime-crm/resources/data/operations/createSingleObject.operation.ts +25 -71
  254. package/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.ts +7 -2
  255. package/nodes/lime-crm/resources/data/operations/getManyObjects.operation.ts +6 -2
  256. package/nodes/lime-crm/resources/data/operations/getSingleFile.operation.ts +15 -3
  257. package/nodes/lime-crm/resources/data/operations/getSingleObject.operation.ts +15 -6
  258. package/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.ts +41 -57
  259. package/nodes/lime-crm/resources/metadata/index.ts +7 -3
  260. package/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.ts +6 -2
  261. package/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.ts +18 -15
  262. package/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.ts +8 -3
  263. package/nodes/lime-crm/transport/commons.ts +34 -20
  264. package/nodes/lime-crm/transport/files.ts +72 -47
  265. package/nodes/lime-crm/transport/limeQuery.ts +2 -2
  266. package/nodes/lime-crm/transport/limeobjects.ts +22 -10
  267. package/nodes/lime-crm/transport/limetypes.ts +37 -16
  268. package/nodes/lime-crm/transport/users.ts +74 -38
  269. package/nodes/lime-crm/transport/webhooks.ts +5 -4
  270. package/nodes/lime-crm/utils/files.ts +27 -10
  271. package/nodes/lime-crm/utils/index.ts +1 -1
  272. package/nodes/response.ts +41 -3
  273. package/package.json +4 -2
  274. package/tests/nodes/lime-crm/methods.spec.ts +91 -0
  275. package/tests/nodes/lime-crm/utils.spec.ts +60 -25
  276. package/nodes/lime-crm/utils/propertyAdapters.ts +0 -75
  277. package/restore_script/README +0 -42
  278. package/restore_script/api_key_upload.txt +0 -0
  279. package/restore_script/cli.py +0 -73
  280. package/restore_script/download.py +0 -73
  281. package/restore_script/main.py +0 -19
  282. package/restore_script/poetry.lock +0 -162
  283. package/restore_script/pyproject.toml +0 -15
  284. package/restore_script/transfer.py +0 -41
  285. package/restore_script/upload.py +0 -66
  286. package/restore_script/utils.py +0 -42
  287. /package/{restore_script/api_key_download.txt → Dockerfile} +0 -0
@@ -1,13 +1,13 @@
1
1
  import { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
2
  import { getProperties, updateLimeobject } from '../../../transport';
3
- import { DATA_RESOURCE } from '../../../models';
3
+ import { DATA_RESOURCE, Limeobject } from '../../../models';
4
4
  import {
5
- adaptProperty,
6
5
  getFilePropertiesNames,
7
- getPropertyType,
8
6
  processFileResponse,
9
7
  setFileProperties,
10
8
  } from '../../../utils';
9
+ import { WorkflowFileResponse } from '../../../../response';
10
+ import { parseResourceMapperFields } from '../../../methods';
11
11
 
12
12
  /**
13
13
  * Description and metadata for the "Update Single Object" operation in Lime CRM.
@@ -71,7 +71,7 @@ export const properties: INodeProperties[] = [
71
71
  options: [
72
72
  {
73
73
  name: 'Simple Fields',
74
- value: 'simple',
74
+ value: 'fields',
75
75
  description: 'Define fields using the UI',
76
76
  },
77
77
  {
@@ -80,7 +80,7 @@ export const properties: INodeProperties[] = [
80
80
  description: 'Define fields using JSON',
81
81
  },
82
82
  ],
83
- default: 'simple',
83
+ default: 'fields',
84
84
  description: 'How to input the data',
85
85
  displayOptions: {
86
86
  show: {
@@ -109,48 +109,29 @@ export const properties: INodeProperties[] = [
109
109
  },
110
110
  },
111
111
  {
112
- displayName: 'Fields',
113
- name: 'simpleFields',
114
- placeholder: 'Add Field',
115
- type: 'fixedCollection',
112
+ displayName: 'Properties',
113
+ name: 'properties',
114
+ type: 'resourceMapper',
115
+ placeholder: 'Add Property',
116
116
  typeOptions: {
117
- multipleValues: true,
118
- sortable: true,
117
+ resourceMapper: {
118
+ resourceMapperMethod: 'getUpdateMappingColumns',
119
+ mode: 'add',
120
+ addAllFields: false,
121
+ supportAutoMap: false,
122
+ },
123
+ loadOptionsDependsOn: ['limetype'],
124
+ },
125
+ default: {
126
+ value: null,
119
127
  },
120
- default: {},
121
128
  displayOptions: {
122
129
  show: {
123
130
  resource: [DATA_RESOURCE],
124
131
  operation: ['updateSingleObject'],
125
- inputType: ['simple'],
132
+ inputType: ['fields'],
126
133
  },
127
134
  },
128
- options: [
129
- {
130
- name: 'field',
131
- displayName: 'Field',
132
- values: [
133
- {
134
- displayName: 'Field Name',
135
- name: 'fieldName',
136
- type: 'options',
137
- typeOptions: {
138
- loadOptionsMethod: 'getNoHasManyProperties',
139
- loadOptionsDependsOn: ['limetype'],
140
- },
141
- default: '',
142
- description: 'The name of the field',
143
- },
144
- {
145
- displayName: 'Field Value',
146
- name: 'fieldValue',
147
- type: 'string',
148
- default: '',
149
- description: 'The value of the field',
150
- },
151
- ],
152
- },
153
- ],
154
135
  },
155
136
  ];
156
137
 
@@ -175,32 +156,28 @@ export const properties: INodeProperties[] = [
175
156
  *
176
157
  * @public
177
158
  */
178
- export async function execute(this: IExecuteFunctions, i: number) {
159
+ export async function execute(
160
+ this: IExecuteFunctions,
161
+ i: number
162
+ ): Promise<WorkflowFileResponse<Limeobject>> {
179
163
  const limetype = this.getNodeParameter('limetype', i) as string;
180
164
  const id = this.getNodeParameter('id', i) as string;
181
165
  const inputType = this.getNodeParameter('inputType', i) as string;
182
166
 
183
167
  let body: IDataObject = {};
184
168
 
185
- const properties = await getProperties(this, limetype);
169
+ const propertiesResponse = await getProperties(this, limetype);
170
+ if (!propertiesResponse.success)
171
+ return {
172
+ json: propertiesResponse.data,
173
+ };
174
+ const properties = propertiesResponse.data;
186
175
 
187
176
  if (inputType === 'json') {
188
177
  const jsonData = this.getNodeParameter('jsonData', i) as string;
189
178
  body = JSON.parse(jsonData);
190
179
  } else {
191
- const simpleFields = this.getNodeParameter(
192
- 'simpleFields.field',
193
- i,
194
- []
195
- ) as IDataObject[];
196
- for (const field of simpleFields) {
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
- );
203
- }
180
+ body = parseResourceMapperFields(this, i, 'properties');
204
181
  }
205
182
 
206
183
  const fileProperties = getFilePropertiesNames(properties);
@@ -213,11 +190,18 @@ export async function execute(this: IExecuteFunctions, i: number) {
213
190
  id,
214
191
  body
215
192
  );
193
+ if (!updateLimeobjectResponse.success)
194
+ return {
195
+ json: updateLimeobjectResponse.data,
196
+ };
216
197
 
217
- const response = await processFileResponse(
198
+ const response = await processFileResponse<Limeobject>(
218
199
  this,
219
200
  fileProperties,
220
- updateLimeobjectResponse
201
+ updateLimeobjectResponse.data
221
202
  );
222
- return response.json;
203
+ return {
204
+ json: response.json.data,
205
+ binary: response.binary,
206
+ };
223
207
  }
@@ -69,9 +69,13 @@ export async function metadataOperations(
69
69
  switch (operation) {
70
70
  case 'getAllLimetypes': {
71
71
  const results = await operations.getAllLimetypes.execute.call(this);
72
- return results.map((limetype) => ({
73
- json: limetype,
74
- }));
72
+ if (Array.isArray(results)) {
73
+ return results.map((limetype) => ({
74
+ json: limetype,
75
+ }));
76
+ } else {
77
+ return { json: results };
78
+ }
75
79
  }
76
80
  case 'getSingleLimetype': {
77
81
  return {
@@ -2,6 +2,7 @@ import { IExecuteFunctions } from 'n8n-workflow';
2
2
 
3
3
  import { getLimetypesFromApi } from '../../../transport';
4
4
  import { Limetype } from '../../../models';
5
+ import { WorkflowResponse } from '../../../../response';
5
6
 
6
7
  /**
7
8
  * Description and metadata for the "Get All Limetypes" operation in Lime CRM.
@@ -23,6 +24,9 @@ export const description = {
23
24
  *
24
25
  * @public
25
26
  */
26
- export async function execute(this: IExecuteFunctions): Promise<Limetype[]> {
27
- return await getLimetypesFromApi(this);
27
+ export async function execute(
28
+ this: IExecuteFunctions
29
+ ): Promise<WorkflowResponse<Limetype[]>> {
30
+ const response = await getLimetypesFromApi(this);
31
+ return response.data;
28
32
  }
@@ -1,14 +1,12 @@
1
- import {
2
- IExecuteFunctions,
3
- INodeProperties,
4
- NodeOperationError,
5
- } from 'n8n-workflow';
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
6
2
  import {
7
3
  FileMetadata,
8
4
  getFileMetadata,
9
5
  getFileMetadataByLimeobject,
10
6
  } from '../../../transport';
11
7
  import { METADATA_RESOURCE } from '../../../models';
8
+ import { APIResponse, WorkflowResponse } from '../../../../response';
9
+ import { handleWorkflowError } from '../../../../errorHandling';
12
10
 
13
11
  /**
14
12
  * Description and metadata for the "Get Single File Metadata" operation in Lime CRM.
@@ -127,21 +125,26 @@ export const properties: INodeProperties[] = [
127
125
  export async function execute(
128
126
  this: IExecuteFunctions,
129
127
  i: number
130
- ): Promise<FileMetadata> {
128
+ ): Promise<WorkflowResponse<FileMetadata>> {
131
129
  const source = this.getNodeParameter('source', i) as string;
132
130
  const id = this.getNodeParameter('identifier', i) as string;
131
+ let response: APIResponse<FileMetadata>;
133
132
 
134
133
  if (source == 'byFile') {
135
- return await getFileMetadata(this, id);
136
- }
137
- if (source == 'byLimeobject') {
134
+ response = await getFileMetadata(this, id);
135
+ } else if (source == 'byLimeobject') {
138
136
  const limetype = this.getNodeParameter('limetype', i) as string;
139
137
  const property = this.getNodeParameter('property', i) as string;
140
- return await getFileMetadataByLimeobject(this, limetype, id, property);
138
+ response = await getFileMetadataByLimeobject(
139
+ this,
140
+ limetype,
141
+ id,
142
+ property
143
+ );
144
+ } else {
145
+ response = handleWorkflowError(this, {
146
+ message: `The source "${source} is not supported`,
147
+ });
141
148
  }
142
-
143
- throw new NodeOperationError(
144
- this.getNode(),
145
- `The source "${source}" is not supported!`
146
- );
149
+ return response.data;
147
150
  }
@@ -1,6 +1,7 @@
1
1
  import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
2
  import { getLimetype } from '../../../transport/limetypes';
3
- import { METADATA_RESOURCE } from '../../../models';
3
+ import { Limetype, METADATA_RESOURCE } from '../../../models';
4
+ import { WorkflowResponse } from '../../../../response';
4
5
 
5
6
  /**
6
7
  * Description and metadata for the "Get Single Limetype" operation in Lime CRM.
@@ -51,8 +52,12 @@ export const properties: INodeProperties[] = [
51
52
  *
52
53
  * @public
53
54
  */
54
- export async function execute(this: IExecuteFunctions, i: number) {
55
+ export async function execute(
56
+ this: IExecuteFunctions,
57
+ i: number
58
+ ): Promise<WorkflowResponse<Limetype>> {
55
59
  const limetype = this.getNodeParameter('limetype', i) as string;
56
60
 
57
- return getLimetype(this, limetype);
61
+ const response = await getLimetype(this, limetype);
62
+ return response.data;
58
63
  }
@@ -1,5 +1,7 @@
1
1
  import { LIME_CRM_API_CREDENTIAL_KEY } from '../models';
2
- import { IAllExecuteFunctions, NodeOperationError } from 'n8n-workflow';
2
+ import { IAllExecuteFunctions, JsonObject } from 'n8n-workflow';
3
+ import { WorkflowErrorContext, handleWorkflowError } from '../utils';
4
+ import { APIResponse, SuccessResponse } from '../../response';
3
5
 
4
6
  /**
5
7
  * HTTP methods supported by the Lime CRM API.
@@ -31,6 +33,16 @@ export function removeKeys<T extends object, K extends keyof T>(
31
33
  return obj;
32
34
  }
33
35
 
36
+ export function prepareResponseWithoutKeys<T extends object, K extends keyof T>(
37
+ response: SuccessResponse<T>,
38
+ keys: K[]
39
+ ): SuccessResponse<Omit<T, K>> {
40
+ return {
41
+ success: true,
42
+ data: removeKeys(response.data, keys),
43
+ };
44
+ }
45
+
34
46
  /**
35
47
  * Retrieve the base URL for the Lime CRM API from stored credentials.
36
48
  *
@@ -85,31 +97,33 @@ interface LimeAPIArguments {
85
97
  export async function callLimeApi<T>(
86
98
  nodeContext: IAllExecuteFunctions,
87
99
  options: LimeAPIArguments
88
- ): Promise<T> {
100
+ ): Promise<APIResponse<T>> {
89
101
  try {
90
- return await nodeContext.helpers.requestWithAuthentication.call(
91
- nodeContext,
92
- LIME_CRM_API_CREDENTIAL_KEY,
93
- {
94
- method: options.method,
95
- url: options.url,
96
- json: options.json || true,
97
- baseURL: await getLimeUrl(nodeContext),
98
- ...options.requestOptions,
99
- }
100
- );
102
+ const response =
103
+ await nodeContext.helpers.requestWithAuthentication.call(
104
+ nodeContext,
105
+ LIME_CRM_API_CREDENTIAL_KEY,
106
+ {
107
+ method: options.method,
108
+ url: options.url,
109
+ json: options.json || true,
110
+ baseURL: await getLimeUrl(nodeContext),
111
+ ...options.requestOptions,
112
+ }
113
+ );
114
+ return {
115
+ success: true,
116
+ data: response,
117
+ };
101
118
  } catch (error) {
102
- const errorContext = {
103
- error: error instanceof Error ? error.message : String(error),
119
+ const errorContext: WorkflowErrorContext = {
120
+ message: error instanceof Error ? error.message : String(error),
104
121
  status: error?.cause?.status,
105
122
  metadata: {
106
123
  ...options.requestOptions,
107
124
  ...options.errorMetadata,
108
- },
125
+ } as JsonObject,
109
126
  };
110
- throw new NodeOperationError(
111
- nodeContext.getNode(),
112
- JSON.stringify(errorContext)
113
- );
127
+ return handleWorkflowError(nodeContext, errorContext, true);
114
128
  }
115
129
  }
@@ -1,13 +1,12 @@
1
1
  import { callLimeApi, getLimeobject } from '.';
2
+ import { IExecuteFunctions, IBinaryData, BINARY_ENCODING } from 'n8n-workflow';
3
+ import { prepareResponseWithoutKeys } from './commons';
2
4
  import {
3
- IExecuteFunctions,
4
- IBinaryData,
5
- BINARY_ENCODING,
6
- NodeOperationError,
7
- } from 'n8n-workflow';
8
- import { removeKeys } from './commons';
9
- import { getFilenameFromHeader, setFilename } from '../utils';
10
-
5
+ getFilenameFromHeader,
6
+ handleWorkflowError,
7
+ setFilename,
8
+ } from '../utils';
9
+ import { APIResponse } from '../../response';
11
10
  /**
12
11
  * Endpoint path for Lime CRM file API.
13
12
  *
@@ -71,13 +70,16 @@ export type FileMetadata = {
71
70
  export async function getFileMetadata(
72
71
  nodeContext: IExecuteFunctions,
73
72
  id: string | number
74
- ): Promise<FileMetadata> {
73
+ ): Promise<APIResponse<FileMetadata>> {
75
74
  const url = `${LIME_FILE_URL}${id}/`;
76
- const fileMetadata = await callLimeApi<FileMetadata>(nodeContext, {
75
+ const fileMetadataResponse = await callLimeApi<FileMetadata>(nodeContext, {
77
76
  method: 'GET',
78
77
  url: url,
79
78
  });
80
- return removeKeys(fileMetadata, ['_links']);
79
+
80
+ if (!fileMetadataResponse.success) return fileMetadataResponse;
81
+
82
+ return prepareResponseWithoutKeys(fileMetadataResponse, ['_links']);
81
83
  }
82
84
 
83
85
  /**
@@ -97,19 +99,27 @@ export async function getFileMetadataByLimeobject(
97
99
  limetype: string,
98
100
  id: string,
99
101
  fileTypeProperty: string
100
- ): Promise<FileMetadata> {
102
+ ): Promise<APIResponse<FileMetadata>> {
101
103
  const objectResponse = await getLimeobject(nodeContext, limetype, id);
102
- const fileId = objectResponse[fileTypeProperty] as string | undefined;
104
+ if (!objectResponse.success) return objectResponse;
105
+
106
+ const fileId = objectResponse.data[fileTypeProperty] as string | undefined;
103
107
 
104
108
  if (!fileId) {
105
- throw new NodeOperationError(
106
- nodeContext.getNode(),
107
- 'The specified Limeobject does not have an associated file.'
109
+ return handleWorkflowError(
110
+ nodeContext,
111
+ {
112
+ message:
113
+ 'The specified Limeobject does not have an associated file',
114
+ },
115
+ true
108
116
  );
109
117
  }
110
118
 
111
- const fileMetadata = await getFileMetadata(nodeContext, fileId);
112
- return removeKeys(fileMetadata, ['_links']);
119
+ const fileMetadataResponse = await getFileMetadata(nodeContext, fileId);
120
+ if (!fileMetadataResponse.success) return fileMetadataResponse;
121
+
122
+ return prepareResponseWithoutKeys(fileMetadataResponse, ['_links']);
113
123
  }
114
124
 
115
125
  /**
@@ -125,7 +135,7 @@ export async function getFileMetadataByLimeobject(
125
135
  export async function getFileContent(
126
136
  nodeContext: IExecuteFunctions,
127
137
  id: string | number
128
- ): Promise<IBinaryData> {
138
+ ): Promise<APIResponse<IBinaryData>> {
129
139
  const url = `${LIME_FILE_URL}${id}/contents/`;
130
140
 
131
141
  const response = await callLimeApi<FileApiResponse>(nodeContext, {
@@ -139,13 +149,19 @@ export async function getFileContent(
139
149
  json: false,
140
150
  });
141
151
 
142
- const fileName = getFilenameFromHeader(response.headers) || `file_${id}`;
152
+ if (!response.success) return response;
153
+
154
+ const fileName =
155
+ getFilenameFromHeader(response.data.headers) || `file_${id}`;
143
156
  const binaryData = await nodeContext.helpers.prepareBinaryData(
144
- response.body
157
+ response.data.body
145
158
  );
146
159
  binaryData.fileName = setFilename(binaryData, fileName);
147
160
 
148
- return binaryData;
161
+ return {
162
+ success: true,
163
+ data: binaryData,
164
+ };
149
165
  }
150
166
 
151
167
  /**
@@ -165,14 +181,22 @@ export async function getFileContentByLimetype(
165
181
  limetype: string,
166
182
  id: string,
167
183
  fileTypeProperty: string
168
- ): Promise<IBinaryData> {
184
+ ): Promise<APIResponse<IBinaryData>> {
169
185
  const limeObjectResponse = await getLimeobject(nodeContext, limetype, id);
170
- const fileId = limeObjectResponse[fileTypeProperty] as string | undefined;
186
+ if (!limeObjectResponse.success) return limeObjectResponse;
187
+
188
+ const fileId = limeObjectResponse.data[fileTypeProperty] as
189
+ | string
190
+ | undefined;
171
191
 
172
192
  if (!fileId) {
173
- throw new NodeOperationError(
174
- nodeContext.getNode(),
175
- 'The specified Limeobject does not have an associated file.'
193
+ return handleWorkflowError(
194
+ nodeContext,
195
+ {
196
+ message:
197
+ 'The specified Limeobject does not have an associated file.',
198
+ },
199
+ true
176
200
  );
177
201
  }
178
202
 
@@ -194,27 +218,28 @@ export async function createFile(
194
218
  nodeContext: IExecuteFunctions,
195
219
  binary: IBinaryData,
196
220
  fallbackFileName: string
197
- ): Promise<FileMetadata> {
198
- let response: FileMetadata;
199
- try {
200
- response = await callLimeApi<FileMetadata>(nodeContext, {
201
- method: 'POST',
202
- url: LIME_FILE_URL,
203
- requestOptions: {
204
- body: Buffer.from(binary.data, BINARY_ENCODING),
205
- headers: {
206
- 'Content-Disposition': `;filename*="UTF-8''${encodeURIComponent(binary.fileName || fallbackFileName)}"`,
207
- 'Content-Type': binary.mimeType,
221
+ ): Promise<APIResponse<FileMetadata>> {
222
+ const response = await callLimeApi<FileMetadata>(nodeContext, {
223
+ method: 'POST',
224
+ url: LIME_FILE_URL,
225
+ requestOptions: {
226
+ body: Buffer.from(binary.data, BINARY_ENCODING),
227
+ headers: {
228
+ 'Content-Disposition': `;filename*="UTF-8''${encodeURIComponent(binary.fileName || fallbackFileName)}"`,
229
+ 'Content-Type': binary.mimeType,
230
+ },
231
+ },
232
+ });
233
+ if (!response.success)
234
+ return {
235
+ success: false,
236
+ data: {
237
+ error: {
238
+ message: response.data.error.message,
239
+ status: response.data.error.status,
208
240
  },
209
241
  },
210
- });
211
- } catch (error) {
212
- // Remove metadata from the response to reduce its overall size
213
- throw new NodeOperationError(
214
- nodeContext.getNode(),
215
- JSON.parse(error).error
216
- );
217
- }
242
+ };
218
243
 
219
- return removeKeys(response, ['_links']);
244
+ return prepareResponseWithoutKeys(response, ['_links']);
220
245
  }
@@ -1,7 +1,7 @@
1
1
  import { IAllExecuteFunctions } from 'n8n-workflow';
2
2
  import { callLimeApi } from './commons';
3
3
  import { APIResponsePrimitiveValue } from '../models';
4
-
4
+ import { APIResponse } from '../../response';
5
5
  /**
6
6
  * Endpoint path for Lime CRM Lime Query API.
7
7
  *
@@ -47,7 +47,7 @@ export interface QueryResponse {
47
47
  export async function queryLimeobjects(
48
48
  nodeContext: IAllExecuteFunctions,
49
49
  q: string
50
- ): Promise<QueryResponse> {
50
+ ): Promise<APIResponse<QueryResponse>> {
51
51
  const queryParameters = {
52
52
  q: q,
53
53
  };
@@ -1,7 +1,7 @@
1
- import { callLimeApi, removeKeys } from './commons';
1
+ import { callLimeApi, prepareResponseWithoutKeys } from './commons';
2
2
  import { IAllExecuteFunctions } from 'n8n-workflow';
3
3
  import { Limeobject } from '../models';
4
-
4
+ import { APIResponse } from '../../response';
5
5
  /**
6
6
  * Endpoint path for Lime CRM Limeobject API.
7
7
  *
@@ -51,7 +51,7 @@ export async function createLimeobject(
51
51
  nodeContext: IAllExecuteFunctions,
52
52
  limetype: string,
53
53
  data: object
54
- ): Promise<Limeobject> {
54
+ ): Promise<APIResponse<Limeobject>> {
55
55
  const url = `${LIMEOBJECT_URL}${limetype}/`;
56
56
  const response = await callLimeApi<LimeobjectCrmApiResponse>(nodeContext, {
57
57
  method: 'POST',
@@ -63,7 +63,11 @@ export async function createLimeobject(
63
63
  limetype: limetype,
64
64
  },
65
65
  });
66
- return removeKeys(response, ['_links']);
66
+ if (response.success) {
67
+ return prepareResponseWithoutKeys(response, ['_links']);
68
+ } else {
69
+ return response;
70
+ }
67
71
  }
68
72
 
69
73
  /**
@@ -81,9 +85,9 @@ export async function deleteLimeobject(
81
85
  nodeContext: IAllExecuteFunctions,
82
86
  limetype: string,
83
87
  id: string
84
- ): Promise<void> {
88
+ ): Promise<APIResponse<Record<string, never>>> {
85
89
  const url = `${LIMEOBJECT_URL}${limetype}/${id}/`;
86
- return await callLimeApi(nodeContext, {
90
+ return await callLimeApi<Record<string, never>>(nodeContext, {
87
91
  method: 'DELETE',
88
92
  url: url,
89
93
  errorMetadata: {
@@ -108,7 +112,7 @@ export async function getLimeobject(
108
112
  nodeContext: IAllExecuteFunctions,
109
113
  limetype: string,
110
114
  id: string
111
- ): Promise<Limeobject> {
115
+ ): Promise<APIResponse<Limeobject>> {
112
116
  const url = `${LIMEOBJECT_URL}${limetype}/${id}/`;
113
117
  const response = await callLimeApi<LimeobjectCrmApiResponse>(nodeContext, {
114
118
  method: 'GET',
@@ -118,7 +122,11 @@ export async function getLimeobject(
118
122
  id: id,
119
123
  },
120
124
  });
121
- return removeKeys(response, ['_links']);
125
+ if (response.success) {
126
+ return prepareResponseWithoutKeys(response, ['_links']);
127
+ } else {
128
+ return response;
129
+ }
122
130
  }
123
131
 
124
132
  /**
@@ -138,7 +146,7 @@ export async function updateLimeobject(
138
146
  limetype: string,
139
147
  id: string,
140
148
  data: object
141
- ): Promise<Limeobject> {
149
+ ): Promise<APIResponse<Limeobject>> {
142
150
  const url = `${LIMEOBJECT_URL}${limetype}/${id}/`;
143
151
  const response = await callLimeApi<LimeobjectCrmApiResponse>(nodeContext, {
144
152
  method: 'PUT',
@@ -151,5 +159,9 @@ export async function updateLimeobject(
151
159
  id: id,
152
160
  },
153
161
  });
154
- return removeKeys(response, ['_links']);
162
+ if (response.success) {
163
+ return prepareResponseWithoutKeys(response, ['_links']);
164
+ } else {
165
+ return response;
166
+ }
155
167
  }