@limetech/n8n-nodes-lime 0.2.9 → 0.3.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 (271) hide show
  1. package/.dockerignore +1 -0
  2. package/.github/workflows/lint.yml +21 -0
  3. package/.github/workflows/release.yml +82 -0
  4. package/.github/workflows/test-and-build.yml +47 -0
  5. package/.prettierignore +4 -0
  6. package/.prettierrc.mjs +1 -0
  7. package/.releaserc.json +34 -0
  8. package/CHANGELOG.md +74 -0
  9. package/Dockerfile +21 -0
  10. package/README.md +4 -0
  11. package/credentials/FortnoxApi.credentials.ts +61 -0
  12. package/credentials/LimeCrmApi.credentials.ts +60 -0
  13. package/dist/credentials/FortnoxApi.credentials.d.ts +9 -0
  14. package/dist/credentials/FortnoxApi.credentials.js +57 -0
  15. package/dist/credentials/FortnoxApi.credentials.js.map +1 -0
  16. package/dist/credentials/LimeCrmApi.credentials.js +3 -2
  17. package/dist/credentials/LimeCrmApi.credentials.js.map +1 -1
  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/model.d.ts +20 -0
  30. package/dist/nodes/fortnox/model.js +3 -0
  31. package/dist/nodes/fortnox/model.js.map +1 -0
  32. package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +2 -0
  33. package/dist/nodes/fortnox/resources/customers/filterParameters.js +31 -0
  34. package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +1 -0
  35. package/dist/nodes/fortnox/resources/customers/index.d.ts +20 -0
  36. package/dist/nodes/fortnox/resources/customers/index.js +77 -0
  37. package/dist/nodes/fortnox/resources/customers/index.js.map +1 -0
  38. package/dist/nodes/fortnox/resources/customers/model.d.ts +99 -0
  39. package/dist/nodes/fortnox/resources/customers/model.js +3 -0
  40. package/dist/nodes/fortnox/resources/customers/model.js.map +1 -0
  41. package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +12 -0
  42. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +283 -0
  43. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +1 -0
  44. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +10 -0
  45. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +36 -0
  46. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -0
  47. package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +11 -0
  48. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +36 -0
  49. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -0
  50. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +11 -0
  51. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +68 -0
  52. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -0
  53. package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +12 -0
  54. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +267 -0
  55. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -0
  56. package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +2 -0
  57. package/dist/nodes/fortnox/resources/customers/sortParameters.js +30 -0
  58. package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +1 -0
  59. package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +2 -0
  60. package/dist/nodes/fortnox/resources/invoice/filterParameters.js +72 -0
  61. package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +1 -0
  62. package/dist/nodes/fortnox/resources/invoice/index.d.ts +20 -0
  63. package/dist/nodes/fortnox/resources/invoice/index.js +71 -0
  64. package/dist/nodes/fortnox/resources/invoice/index.js.map +1 -0
  65. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +2 -0
  66. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +193 -0
  67. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +1 -0
  68. package/dist/nodes/fortnox/resources/invoice/model.d.ts +150 -0
  69. package/dist/nodes/fortnox/resources/invoice/model.js +3 -0
  70. package/dist/nodes/fortnox/resources/invoice/model.js.map +1 -0
  71. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +11 -0
  72. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +64 -0
  73. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +1 -0
  74. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +11 -0
  75. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +35 -0
  76. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -0
  77. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +11 -0
  78. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +92 -0
  79. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -0
  80. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +11 -0
  81. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +62 -0
  82. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -0
  83. package/dist/nodes/fortnox/transport/errorCodes.d.ts +1 -0
  84. package/dist/nodes/fortnox/transport/errorCodes.js +51 -0
  85. package/dist/nodes/fortnox/transport/errorCodes.js.map +1 -0
  86. package/dist/nodes/fortnox/transport/index.d.ts +4 -0
  87. package/dist/nodes/fortnox/transport/index.js +72 -0
  88. package/dist/nodes/fortnox/transport/index.js.map +1 -0
  89. package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
  90. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +14 -0
  91. package/dist/nodes/lime-crm/LimeCrmNode.node.js +113 -0
  92. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
  93. package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +18 -0
  94. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +200 -0
  95. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
  96. package/dist/nodes/lime-crm/commons/constants.d.ts +4 -0
  97. package/dist/nodes/lime-crm/commons/constants.js +8 -0
  98. package/dist/nodes/lime-crm/commons/constants.js.map +1 -0
  99. package/dist/nodes/lime-crm/commons/index.d.ts +3 -0
  100. package/dist/nodes/lime-crm/commons/index.js +11 -0
  101. package/dist/nodes/lime-crm/commons/index.js.map +1 -0
  102. package/dist/nodes/lime-crm/commons/limetype.d.ts +10 -0
  103. package/dist/nodes/lime-crm/commons/limetype.js +3 -0
  104. package/dist/nodes/lime-crm/commons/limetype.js.map +1 -0
  105. package/dist/nodes/lime-crm/commons/task.d.ts +14 -0
  106. package/dist/nodes/lime-crm/commons/task.js +49 -0
  107. package/dist/nodes/lime-crm/commons/task.js.map +1 -0
  108. package/dist/nodes/lime-crm/commons/webhook.d.ts +16 -0
  109. package/dist/nodes/lime-crm/commons/webhook.js +30 -0
  110. package/dist/nodes/lime-crm/commons/webhook.js.map +1 -0
  111. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +5 -0
  112. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +12 -0
  113. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +1 -0
  114. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +2 -0
  115. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +21 -0
  116. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +1 -0
  117. package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +2 -0
  118. package/dist/nodes/lime-crm/methods/getLimeTypes.js +21 -0
  119. package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +1 -0
  120. package/dist/nodes/lime-crm/methods/index.d.ts +3 -0
  121. package/dist/nodes/lime-crm/methods/index.js +10 -0
  122. package/dist/nodes/lime-crm/methods/index.js.map +1 -0
  123. package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +23 -0
  124. package/dist/nodes/lime-crm/resources/erpConnector/index.js +57 -0
  125. package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +1 -0
  126. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +26 -0
  127. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +65 -0
  128. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +1 -0
  129. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +9 -0
  130. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +220 -0
  131. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +1 -0
  132. package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +15 -0
  133. package/dist/nodes/lime-crm/resources/erpConnector/transform.js +12 -0
  134. package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +1 -0
  135. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +4 -0
  136. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +7 -0
  137. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +1 -0
  138. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +37 -0
  139. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +124 -0
  140. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +1 -0
  141. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +1 -0
  142. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +6 -0
  143. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +1 -0
  144. package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +14 -0
  145. package/dist/nodes/lime-crm/resources/limeObject/index.js +78 -0
  146. package/dist/nodes/lime-crm/resources/limeObject/index.js.map +1 -0
  147. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +9 -0
  148. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +139 -0
  149. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +1 -0
  150. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +9 -0
  151. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +51 -0
  152. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +1 -0
  153. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +9 -0
  154. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +51 -0
  155. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +1 -0
  156. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +9 -0
  157. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +86 -0
  158. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -0
  159. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +9 -0
  160. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +149 -0
  161. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +1 -0
  162. package/dist/nodes/lime-crm/resources/limeType/index.d.ts +20 -0
  163. package/dist/nodes/lime-crm/resources/limeType/index.js +71 -0
  164. package/dist/nodes/lime-crm/resources/limeType/index.js.map +1 -0
  165. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +11 -0
  166. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +36 -0
  167. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +1 -0
  168. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +9 -0
  169. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +36 -0
  170. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +1 -0
  171. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +10 -0
  172. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +15 -0
  173. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +1 -0
  174. package/dist/nodes/lime-crm/transport/commons.d.ts +5 -0
  175. package/dist/nodes/lime-crm/transport/commons.js +33 -0
  176. package/dist/nodes/lime-crm/transport/commons.js.map +1 -0
  177. package/dist/nodes/lime-crm/transport/erpConnector.d.ts +9 -0
  178. package/dist/nodes/lime-crm/transport/erpConnector.js +12 -0
  179. package/dist/nodes/lime-crm/transport/erpConnector.js.map +1 -0
  180. package/dist/nodes/lime-crm/transport/index.d.ts +5 -0
  181. package/dist/nodes/lime-crm/transport/index.js +22 -0
  182. package/dist/nodes/lime-crm/transport/index.js.map +1 -0
  183. package/dist/nodes/lime-crm/transport/limeobjects.d.ts +7 -0
  184. package/dist/nodes/lime-crm/transport/limeobjects.js +49 -0
  185. package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -0
  186. package/dist/nodes/lime-crm/transport/limetypes.d.ts +6 -0
  187. package/dist/nodes/lime-crm/transport/limetypes.js +40 -0
  188. package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -0
  189. package/dist/nodes/lime-crm/transport/task.d.ts +13 -0
  190. package/dist/nodes/lime-crm/transport/task.js +14 -0
  191. package/dist/nodes/lime-crm/transport/task.js.map +1 -0
  192. package/dist/nodes/lime-crm/transport/webhooks.d.ts +15 -0
  193. package/dist/nodes/lime-crm/transport/webhooks.js +33 -0
  194. package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -0
  195. package/dist/nodes/nodeResponse.d.ts +12 -0
  196. package/dist/nodes/nodeResponse.js +3 -0
  197. package/dist/nodes/nodeResponse.js.map +1 -0
  198. package/dist/package.json +36 -16
  199. package/dist/tsconfig.tsbuildinfo +1 -1
  200. package/docker-compose.yml +46 -0
  201. package/eslint.config.mjs +27 -0
  202. package/jest.config.js +11 -0
  203. package/nodes/fortnox/Fortnox.node.json +18 -0
  204. package/nodes/fortnox/Fortnox.node.ts +102 -0
  205. package/nodes/fortnox/FortnoxTrigger.node.json +18 -0
  206. package/nodes/fortnox/FortnoxTrigger.node.ts +196 -0
  207. package/nodes/fortnox/commons.ts +94 -0
  208. package/nodes/fortnox/fortnoxLogo.svg +15 -0
  209. package/nodes/fortnox/model.ts +25 -0
  210. package/nodes/fortnox/resources/customers/filterParameters.ts +47 -0
  211. package/nodes/fortnox/resources/customers/index.ts +57 -0
  212. package/nodes/fortnox/resources/customers/model.ts +107 -0
  213. package/nodes/fortnox/resources/customers/operations/create.operation.ts +303 -0
  214. package/nodes/fortnox/resources/customers/operations/delete.operation.ts +44 -0
  215. package/nodes/fortnox/resources/customers/operations/get.operation.ts +45 -0
  216. package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +80 -0
  217. package/nodes/fortnox/resources/customers/operations/update.operation.ts +278 -0
  218. package/nodes/fortnox/resources/customers/sortParameters.ts +32 -0
  219. package/nodes/fortnox/resources/invoice/filterParameters.ts +88 -0
  220. package/nodes/fortnox/resources/invoice/index.ts +51 -0
  221. package/nodes/fortnox/resources/invoice/invoiceParameters.ts +214 -0
  222. package/nodes/fortnox/resources/invoice/model.ts +160 -0
  223. package/nodes/fortnox/resources/invoice/operations/create.operation.ts +72 -0
  224. package/nodes/fortnox/resources/invoice/operations/get.operation.ts +45 -0
  225. package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +101 -0
  226. package/nodes/fortnox/resources/invoice/operations/update.operation.ts +74 -0
  227. package/nodes/fortnox/transport/errorCodes.ts +62 -0
  228. package/nodes/fortnox/transport/index.ts +98 -0
  229. package/nodes/lime-crm/LimeCrm.node.json +18 -0
  230. package/nodes/lime-crm/LimeCrmNode.node.ts +135 -0
  231. package/nodes/lime-crm/LimeCrmTrigger.node.ts +263 -0
  232. package/nodes/lime-crm/assets/lime-crm.svg +1 -0
  233. package/nodes/lime-crm/commons/constants.ts +9 -0
  234. package/nodes/lime-crm/commons/index.ts +9 -0
  235. package/nodes/lime-crm/commons/limetype.ts +11 -0
  236. package/nodes/lime-crm/commons/task.ts +55 -0
  237. package/nodes/lime-crm/commons/webhook.ts +50 -0
  238. package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +11 -0
  239. package/nodes/lime-crm/methods/getLimeTypeProperties.ts +27 -0
  240. package/nodes/lime-crm/methods/getLimeTypes.ts +23 -0
  241. package/nodes/lime-crm/methods/index.ts +3 -0
  242. package/nodes/lime-crm/resources/erpConnector/index.ts +43 -0
  243. package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +69 -0
  244. package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +274 -0
  245. package/nodes/lime-crm/resources/erpConnector/transform.ts +49 -0
  246. package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +18 -0
  247. package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +201 -0
  248. package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +1 -0
  249. package/nodes/lime-crm/resources/limeObject/index.ts +64 -0
  250. package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +152 -0
  251. package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +55 -0
  252. package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +54 -0
  253. package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +99 -0
  254. package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +157 -0
  255. package/nodes/lime-crm/resources/limeType/index.ts +58 -0
  256. package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +42 -0
  257. package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +36 -0
  258. package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +18 -0
  259. package/nodes/lime-crm/transport/commons.ts +44 -0
  260. package/nodes/lime-crm/transport/erpConnector.ts +21 -0
  261. package/nodes/lime-crm/transport/index.ts +17 -0
  262. package/nodes/lime-crm/transport/limeobjects.ts +83 -0
  263. package/nodes/lime-crm/transport/limetypes.ts +68 -0
  264. package/nodes/lime-crm/transport/task.ts +32 -0
  265. package/nodes/lime-crm/transport/webhooks.ts +61 -0
  266. package/nodes/nodeResponse.ts +13 -0
  267. package/package.json +36 -16
  268. package/tests/fixtures/fortnox.ts +182 -0
  269. package/tests/transform.spec.ts +187 -0
  270. package/tsconfig.json +30 -0
  271. package/index.js +0 -3
@@ -0,0 +1,283 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = exports.properties = exports.createProperties = exports.description = void 0;
4
+ const transport_1 = require("../../../transport");
5
+ const currency_codes_1 = require("currency-codes");
6
+ exports.description = {
7
+ name: 'Create Customer',
8
+ value: 'create',
9
+ description: 'Create a new customer',
10
+ action: 'Create a customer',
11
+ };
12
+ exports.createProperties = [
13
+ {
14
+ displayName: 'Address 1',
15
+ name: 'Address1',
16
+ type: 'string',
17
+ default: '',
18
+ description: "Customer's primary address",
19
+ },
20
+ {
21
+ displayName: 'Address 2',
22
+ name: 'Address2',
23
+ type: 'string',
24
+ default: '',
25
+ description: "Customer's secondary address",
26
+ },
27
+ {
28
+ displayName: 'City',
29
+ name: 'City',
30
+ type: 'string',
31
+ default: '',
32
+ description: "Customer's city",
33
+ },
34
+ {
35
+ displayName: 'Comments',
36
+ name: 'Comments',
37
+ type: 'string',
38
+ default: '',
39
+ description: 'Comments about the customer',
40
+ },
41
+ {
42
+ displayName: 'Cost Center',
43
+ name: 'CostCenter',
44
+ type: 'string',
45
+ default: '',
46
+ description: "Customer's cost center",
47
+ },
48
+ {
49
+ displayName: 'Country',
50
+ name: 'Country',
51
+ type: 'string',
52
+ default: '',
53
+ description: "Customer's country",
54
+ },
55
+ {
56
+ displayName: 'Country Code',
57
+ name: 'CountryCode',
58
+ type: 'string',
59
+ default: '',
60
+ description: "Customer's country code",
61
+ },
62
+ {
63
+ displayName: 'Email',
64
+ name: 'Email',
65
+ type: 'string',
66
+ default: '',
67
+ description: "Customer's email address",
68
+ },
69
+ {
70
+ displayName: 'External Reference',
71
+ name: 'ExternalReference',
72
+ type: 'string',
73
+ default: '',
74
+ description: 'External reference for the customer',
75
+ },
76
+ {
77
+ displayName: 'Fax',
78
+ name: 'Fax',
79
+ type: 'string',
80
+ default: '',
81
+ description: "Customer's fax number",
82
+ },
83
+ {
84
+ displayName: 'GLN',
85
+ name: 'GLN',
86
+ type: 'string',
87
+ default: '',
88
+ description: 'Global Location Number',
89
+ },
90
+ {
91
+ displayName: 'Organisation Number',
92
+ name: 'OrganisationNumber',
93
+ type: 'string',
94
+ default: '',
95
+ description: "Customer's organisation number",
96
+ },
97
+ {
98
+ displayName: 'Phone 1',
99
+ name: 'Phone1',
100
+ type: 'string',
101
+ default: '',
102
+ description: "Customer's primary phone number",
103
+ },
104
+ {
105
+ displayName: 'Phone 2',
106
+ name: 'Phone2',
107
+ type: 'string',
108
+ default: '',
109
+ description: "Customer's secondary phone number",
110
+ },
111
+ {
112
+ displayName: 'VAT Number',
113
+ name: 'VATNumber',
114
+ type: 'string',
115
+ default: '',
116
+ description: "Customer's VAT number",
117
+ },
118
+ {
119
+ displayName: 'Website',
120
+ name: 'WWW',
121
+ type: 'string',
122
+ default: '',
123
+ description: "Customer's website URL",
124
+ },
125
+ {
126
+ displayName: 'ZIP Code',
127
+ name: 'ZipCode',
128
+ type: 'string',
129
+ default: '',
130
+ description: "Customer's ZIP/postal code",
131
+ },
132
+ ];
133
+ exports.properties = [
134
+ {
135
+ displayName: 'Name',
136
+ name: 'Name',
137
+ type: 'string',
138
+ required: true,
139
+ default: '',
140
+ description: 'Customer name',
141
+ displayOptions: {
142
+ show: {
143
+ resource: ['customer'],
144
+ operation: ['create'],
145
+ },
146
+ },
147
+ },
148
+ {
149
+ displayName: 'Active',
150
+ name: 'Active',
151
+ type: 'boolean',
152
+ required: true,
153
+ default: true,
154
+ description: 'Whether the customer is active',
155
+ displayOptions: {
156
+ show: {
157
+ resource: ['customer'],
158
+ operation: ['create'],
159
+ },
160
+ },
161
+ },
162
+ {
163
+ displayName: 'Currency',
164
+ name: 'Currency',
165
+ type: 'string',
166
+ required: true,
167
+ default: 'SEK',
168
+ description: 'Currency',
169
+ displayOptions: {
170
+ show: {
171
+ resource: ['customer'],
172
+ operation: ['create'],
173
+ },
174
+ },
175
+ },
176
+ {
177
+ displayName: 'Type',
178
+ name: 'Type',
179
+ type: 'options',
180
+ required: true,
181
+ options: [
182
+ {
183
+ name: 'Private',
184
+ value: 'PRIVATE',
185
+ },
186
+ {
187
+ name: 'Company',
188
+ value: 'COMPANY',
189
+ },
190
+ ],
191
+ default: 'COMPANY',
192
+ description: 'Type of customer',
193
+ displayOptions: {
194
+ show: {
195
+ resource: ['customer'],
196
+ operation: ['create'],
197
+ },
198
+ },
199
+ },
200
+ {
201
+ displayName: 'VAT Type',
202
+ name: 'VATType',
203
+ type: 'options',
204
+ required: true,
205
+ options: [
206
+ {
207
+ name: 'SE VAT',
208
+ value: 'SEVAT',
209
+ },
210
+ {
211
+ name: 'SE Reversed VAT',
212
+ value: 'SEREVERSEDVAT',
213
+ },
214
+ {
215
+ name: 'EU Reversed VAT',
216
+ value: 'EUREVERSEDVAT',
217
+ },
218
+ {
219
+ name: 'EU VAT',
220
+ value: 'EUVAT',
221
+ },
222
+ {
223
+ name: 'Export',
224
+ value: 'EXPORT',
225
+ },
226
+ ],
227
+ default: 'SEVAT',
228
+ description: 'Type of VAT applied',
229
+ displayOptions: {
230
+ show: {
231
+ resource: ['customer'],
232
+ operation: ['create'],
233
+ },
234
+ },
235
+ },
236
+ {
237
+ displayName: 'Additional Fields',
238
+ name: 'additionalFields',
239
+ type: 'collection',
240
+ placeholder: 'Add Field',
241
+ default: {},
242
+ displayOptions: {
243
+ show: {
244
+ resource: ['customer'],
245
+ operation: ['create'],
246
+ },
247
+ },
248
+ options: [...exports.createProperties],
249
+ },
250
+ ];
251
+ async function execute(i) {
252
+ const name = this.getNodeParameter('Name', i);
253
+ let currency = this.getNodeParameter('Currency', i);
254
+ currency = currency.toUpperCase();
255
+ const active = this.getNodeParameter('Active', i);
256
+ const type = this.getNodeParameter('Type', i);
257
+ const vatType = this.getNodeParameter('VATType', i);
258
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
259
+ if ((0, currency_codes_1.code)(currency) === undefined) {
260
+ return {
261
+ success: false,
262
+ error: `Invalid currency code: ${currency}. Use ISO 4217 currency code.`,
263
+ };
264
+ }
265
+ const body = {
266
+ Customer: {
267
+ Name: name,
268
+ Currency: currency,
269
+ Active: active,
270
+ Type: type,
271
+ VATType: vatType,
272
+ ...additionalFields,
273
+ },
274
+ };
275
+ const endpoint = `/customers`;
276
+ return await (0, transport_1.apiRequest)(this, {
277
+ method: 'POST',
278
+ endpoint: endpoint,
279
+ body: body,
280
+ });
281
+ }
282
+ exports.execute = execute;
283
+ //# sourceMappingURL=create.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/customers/operations/create.operation.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAChD,mDAAsD;AAIzC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,uBAAuB;IACpC,MAAM,EAAE,mBAAmB;CAC9B,CAAC;AAEW,QAAA,gBAAgB,GAAsB;IAC/C;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,I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AAC,gBAAgB,CAC1C,kBAAkB,EAClB,CAAC,EACD,EAAE,CACU,CAAC;IAEjB,IAAI,IAAA,qBAAY,EAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO;YACH,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,0BAA0B,QAAQ,+BAA+B;SAC3E,CAAC;IACN,CAAC;IAED,MAAM,IAAI,GAAG;QACT,QAAQ,EAAE;YACN,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,OAAO;YAChB,GAAG,gBAAgB;SACtB;KACJ,CAAC;IAEF,MAAM,QAAQ,GAAG,YAAY,CAAC;IAE9B,OAAO,MAAM,IAAA,sBAAU,EAAmB,IAAI,EAAE;QAC5C,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;KACb,CAAC,CAAC;AACP,CAAC;AA9CD,0BA8CC"}
@@ -0,0 +1,10 @@
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
+ import { NodeResponse } from '../../../../nodeResponse';
3
+ export declare const description: {
4
+ name: string;
5
+ value: string;
6
+ description: string;
7
+ action: string;
8
+ };
9
+ export declare const properties: INodeProperties[];
10
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<NodeResponse<null>>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = exports.properties = exports.description = void 0;
4
+ const transport_1 = require("../../../transport");
5
+ exports.description = {
6
+ name: 'Delete Customer',
7
+ value: 'delete',
8
+ description: 'Delete a single company by customer number',
9
+ action: 'Delete a customer',
10
+ };
11
+ exports.properties = [
12
+ {
13
+ displayName: 'Customer Number',
14
+ name: 'customerNumber',
15
+ type: 'string',
16
+ required: true,
17
+ default: '',
18
+ description: 'Unique identifier for customer',
19
+ displayOptions: {
20
+ show: {
21
+ resource: ['customer'],
22
+ operation: ['delete'],
23
+ },
24
+ },
25
+ },
26
+ ];
27
+ async function execute(i) {
28
+ const customerNumber = this.getNodeParameter('customerNumber', i, '');
29
+ const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
30
+ return await (0, transport_1.apiRequest)(this, {
31
+ method: 'DELETE',
32
+ endpoint,
33
+ });
34
+ }
35
+ exports.execute = execute;
36
+ //# sourceMappingURL=delete.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/customers/operations/delete.operation.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAGnC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,4CAA4C;IACzD,MAAM,EAAE,mBAAmB;CAC9B,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,gCAAgC;QAC7C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACxB;SACJ;KACJ;CACJ,CAAC;AAEK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CACxC,gBAAgB,EAChB,CAAC,EACD,EAAE,CACK,CAAC;IAEZ,MAAM,QAAQ,GAAG,cAAc,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC;IACpE,OAAO,MAAM,IAAA,sBAAU,EAAO,IAAI,EAAE;QAChC,MAAM,EAAE,QAAQ;QAChB,QAAQ;KACX,CAAC,CAAC;AACP,CAAC;AAfD,0BAeC"}
@@ -0,0 +1,11 @@
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
+ import { CustomerResponse } from '../model';
3
+ import { NodeResponse } from '../../../../nodeResponse';
4
+ export declare const description: {
5
+ name: string;
6
+ value: string;
7
+ description: string;
8
+ action: string;
9
+ };
10
+ export declare const properties: INodeProperties[];
11
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<NodeResponse<CustomerResponse>>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = exports.properties = exports.description = void 0;
4
+ const transport_1 = require("../../../transport");
5
+ exports.description = {
6
+ name: 'Get Customer',
7
+ value: 'get',
8
+ description: 'Get a single company by customer number',
9
+ action: 'Get a customer',
10
+ };
11
+ exports.properties = [
12
+ {
13
+ displayName: 'Customer Number',
14
+ name: 'customerNumber',
15
+ type: 'string',
16
+ required: true,
17
+ default: '',
18
+ description: 'Unique identifier for customer',
19
+ displayOptions: {
20
+ show: {
21
+ resource: ['customer'],
22
+ operation: ['get'],
23
+ },
24
+ },
25
+ },
26
+ ];
27
+ async function execute(i) {
28
+ const customerNumber = this.getNodeParameter('customerNumber', i, '');
29
+ const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
30
+ return await (0, transport_1.apiRequest)(this, {
31
+ method: 'GET',
32
+ endpoint,
33
+ });
34
+ }
35
+ exports.execute = execute;
36
+ //# sourceMappingURL=get.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/customers/operations/get.operation.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAInC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAE,gBAAgB;CAC3B,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,gCAAgC;QAC7C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,SAAS,EAAE,CAAC,KAAK,CAAC;aACrB;SACJ;KACJ;CACJ,CAAC;AAEK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CACxC,gBAAgB,EAChB,CAAC,EACD,EAAE,CACK,CAAC;IAEZ,MAAM,QAAQ,GAAG,cAAc,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC;IACpE,OAAO,MAAM,IAAA,sBAAU,EAAmB,IAAI,EAAE;QAC5C,MAAM,EAAE,KAAK;QACb,QAAQ;KACX,CAAC,CAAC;AACP,CAAC;AAfD,0BAeC"}
@@ -0,0 +1,11 @@
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
+ import { CustomersResponse } from '../model';
3
+ import { NodeResponse } from '../../../../nodeResponse';
4
+ export declare const description: {
5
+ name: string;
6
+ value: string;
7
+ description: string;
8
+ action: string;
9
+ };
10
+ export declare const properties: INodeProperties[];
11
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<NodeResponse<CustomersResponse>>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = exports.properties = exports.description = void 0;
4
+ const transport_1 = require("../../../transport");
5
+ const filterParameters_1 = require("../filterParameters");
6
+ const sortParameters_1 = require("../sortParameters");
7
+ exports.description = {
8
+ name: 'Get All Customers',
9
+ value: 'getAll',
10
+ description: 'Get all customers',
11
+ action: 'Get all customers',
12
+ };
13
+ exports.properties = [
14
+ {
15
+ displayName: 'Filter by',
16
+ name: 'filterParameters',
17
+ type: 'collection',
18
+ placeholder: 'Add Parameter',
19
+ default: {},
20
+ displayOptions: {
21
+ show: {
22
+ resource: ['customer'],
23
+ operation: ['getAll'],
24
+ },
25
+ },
26
+ options: filterParameters_1.filterParameters,
27
+ },
28
+ {
29
+ displayName: 'Sort by',
30
+ name: 'sortParameters',
31
+ type: 'collection',
32
+ placeholder: 'Add Parameter',
33
+ default: {},
34
+ displayOptions: {
35
+ show: {
36
+ resource: ['customer'],
37
+ operation: ['getAll'],
38
+ },
39
+ },
40
+ options: sortParameters_1.sortParameters,
41
+ },
42
+ ];
43
+ async function execute(i) {
44
+ const filterParameters = this.getNodeParameter('filterParameters', i, {});
45
+ const sortParameters = this.getNodeParameter('sortParameters', i, {});
46
+ const qs = {};
47
+ if (filterParameters) {
48
+ for (const [key, value] of Object.entries(filterParameters)) {
49
+ if (value !== '' && value !== undefined && value !== null) {
50
+ qs[key] = value;
51
+ }
52
+ }
53
+ }
54
+ if (sortParameters && Object.keys(sortParameters).length > 0) {
55
+ qs['sortby'] = Object.entries(sortParameters)
56
+ .filter(([, value]) => value)
57
+ .map(([, value]) => `${value}`)
58
+ .join('');
59
+ }
60
+ const endpoint = `/customers`;
61
+ return await (0, transport_1.apiRequest)(this, {
62
+ method: 'GET',
63
+ endpoint: endpoint,
64
+ qs,
65
+ });
66
+ }
67
+ exports.execute = execute;
68
+ //# sourceMappingURL=getAll.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAll.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/customers/operations/getAll.operation.ts"],"names":[],"mappings":";;;AACA,kDAAgD;AAChD,0DAAuD;AACvD,sDAAmD;AAItC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,mBAAmB;IAChC,MAAM,EAAE,mBAAmB;CAC9B,CAAC;AAEW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,eAAe;QAC5B,O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CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;aAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC;aAC9B,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC;IAE9B,OAAO,MAAM,IAAA,sBAAU,EAAoB,IAAI,EAAE;QAC7C,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,QAAQ;QAClB,EAAE;KACL,CAAC,CAAC;AACP,CAAC;AAlCD,0BAkCC"}
@@ -0,0 +1,12 @@
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
+ import { CustomerResponse } from '../model';
3
+ import { NodeResponse } from '../../../../nodeResponse';
4
+ export declare const description: {
5
+ name: string;
6
+ value: string;
7
+ description: string;
8
+ action: string;
9
+ };
10
+ export declare const updateProperties: INodeProperties[];
11
+ export declare const properties: INodeProperties[];
12
+ export declare function execute(this: IExecuteFunctions, i: number): Promise<NodeResponse<CustomerResponse>>;