@limetech/n8n-nodes-lime 0.3.0 → 0.3.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 (190) hide show
  1. package/dist/credentials/FortnoxApi.credentials.d.ts +9 -0
  2. package/dist/credentials/FortnoxApi.credentials.js +57 -0
  3. package/dist/credentials/FortnoxApi.credentials.js.map +1 -0
  4. package/dist/credentials/LimeCrmApi.credentials.js +3 -2
  5. package/dist/credentials/LimeCrmApi.credentials.js.map +1 -1
  6. package/dist/nodes/fortnox/Fortnox.node.d.ts +5 -0
  7. package/dist/nodes/fortnox/Fortnox.node.js +95 -0
  8. package/dist/nodes/fortnox/Fortnox.node.js.map +1 -0
  9. package/dist/nodes/fortnox/Fortnox.node.json +18 -0
  10. package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +5 -0
  11. package/dist/nodes/fortnox/FortnoxTrigger.node.js +155 -0
  12. package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +1 -0
  13. package/dist/nodes/fortnox/FortnoxTrigger.node.json +18 -0
  14. package/dist/nodes/fortnox/commons.d.ts +25 -0
  15. package/dist/nodes/fortnox/commons.js +44 -0
  16. package/dist/nodes/fortnox/commons.js.map +1 -0
  17. package/dist/nodes/fortnox/fortnoxLogo.svg +15 -0
  18. package/dist/nodes/fortnox/model.d.ts +20 -0
  19. package/dist/nodes/fortnox/model.js +3 -0
  20. package/dist/nodes/fortnox/model.js.map +1 -0
  21. package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +2 -0
  22. package/dist/nodes/fortnox/resources/customers/filterParameters.js +31 -0
  23. package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +1 -0
  24. package/dist/nodes/fortnox/resources/customers/index.d.ts +20 -0
  25. package/dist/nodes/fortnox/resources/customers/index.js +87 -0
  26. package/dist/nodes/fortnox/resources/customers/index.js.map +1 -0
  27. package/dist/nodes/fortnox/resources/customers/model.d.ts +99 -0
  28. package/dist/nodes/fortnox/resources/customers/model.js +3 -0
  29. package/dist/nodes/fortnox/resources/customers/model.js.map +1 -0
  30. package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +12 -0
  31. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +283 -0
  32. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +1 -0
  33. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +10 -0
  34. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +36 -0
  35. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -0
  36. package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +11 -0
  37. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +36 -0
  38. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -0
  39. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +11 -0
  40. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +68 -0
  41. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -0
  42. package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +12 -0
  43. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +267 -0
  44. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -0
  45. package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +2 -0
  46. package/dist/nodes/fortnox/resources/customers/sortParameters.js +30 -0
  47. package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +1 -0
  48. package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +2 -0
  49. package/dist/nodes/fortnox/resources/invoice/filterParameters.js +72 -0
  50. package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +1 -0
  51. package/dist/nodes/fortnox/resources/invoice/index.d.ts +20 -0
  52. package/dist/nodes/fortnox/resources/invoice/index.js +81 -0
  53. package/dist/nodes/fortnox/resources/invoice/index.js.map +1 -0
  54. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +2 -0
  55. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +193 -0
  56. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +1 -0
  57. package/dist/nodes/fortnox/resources/invoice/model.d.ts +150 -0
  58. package/dist/nodes/fortnox/resources/invoice/model.js +3 -0
  59. package/dist/nodes/fortnox/resources/invoice/model.js.map +1 -0
  60. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +11 -0
  61. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +64 -0
  62. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +1 -0
  63. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +11 -0
  64. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +35 -0
  65. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -0
  66. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +11 -0
  67. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +92 -0
  68. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -0
  69. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +11 -0
  70. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +62 -0
  71. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -0
  72. package/dist/nodes/fortnox/transport/errorCodes.d.ts +1 -0
  73. package/dist/nodes/fortnox/transport/errorCodes.js +50 -0
  74. package/dist/nodes/fortnox/transport/errorCodes.js.map +1 -0
  75. package/dist/nodes/fortnox/transport/index.d.ts +4 -0
  76. package/dist/nodes/fortnox/transport/index.js +72 -0
  77. package/dist/nodes/fortnox/transport/index.js.map +1 -0
  78. package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
  79. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +14 -0
  80. package/dist/nodes/lime-crm/LimeCrmNode.node.js +113 -0
  81. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
  82. package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +18 -0
  83. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +200 -0
  84. package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
  85. package/dist/nodes/lime-crm/assets/lime-crm.svg +1 -0
  86. package/dist/nodes/lime-crm/commons/constants.d.ts +4 -0
  87. package/dist/nodes/lime-crm/commons/constants.js +8 -0
  88. package/dist/nodes/lime-crm/commons/constants.js.map +1 -0
  89. package/dist/nodes/lime-crm/commons/index.d.ts +3 -0
  90. package/dist/nodes/lime-crm/commons/index.js +11 -0
  91. package/dist/nodes/lime-crm/commons/index.js.map +1 -0
  92. package/dist/nodes/lime-crm/commons/limetype.d.ts +10 -0
  93. package/dist/nodes/lime-crm/commons/limetype.js +3 -0
  94. package/dist/nodes/lime-crm/commons/limetype.js.map +1 -0
  95. package/dist/nodes/lime-crm/commons/task.d.ts +14 -0
  96. package/dist/nodes/lime-crm/commons/task.js +48 -0
  97. package/dist/nodes/lime-crm/commons/task.js.map +1 -0
  98. package/dist/nodes/lime-crm/commons/webhook.d.ts +16 -0
  99. package/dist/nodes/lime-crm/commons/webhook.js +29 -0
  100. package/dist/nodes/lime-crm/commons/webhook.js.map +1 -0
  101. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.d.ts +5 -0
  102. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js +11 -0
  103. package/dist/nodes/lime-crm/methods/getEntitiesForErpSystem.js.map +1 -0
  104. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.d.ts +2 -0
  105. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js +20 -0
  106. package/dist/nodes/lime-crm/methods/getLimeTypeProperties.js.map +1 -0
  107. package/dist/nodes/lime-crm/methods/getLimeTypes.d.ts +2 -0
  108. package/dist/nodes/lime-crm/methods/getLimeTypes.js +20 -0
  109. package/dist/nodes/lime-crm/methods/getLimeTypes.js.map +1 -0
  110. package/dist/nodes/lime-crm/methods/index.d.ts +3 -0
  111. package/dist/nodes/lime-crm/methods/index.js +10 -0
  112. package/dist/nodes/lime-crm/methods/index.js.map +1 -0
  113. package/dist/nodes/lime-crm/resources/erpConnector/index.d.ts +23 -0
  114. package/dist/nodes/lime-crm/resources/erpConnector/index.js +67 -0
  115. package/dist/nodes/lime-crm/resources/erpConnector/index.js.map +1 -0
  116. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.d.ts +26 -0
  117. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js +65 -0
  118. package/dist/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.js.map +1 -0
  119. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.d.ts +9 -0
  120. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js +220 -0
  121. package/dist/nodes/lime-crm/resources/erpConnector/operations/transform.operation.js.map +1 -0
  122. package/dist/nodes/lime-crm/resources/erpConnector/transform.d.ts +15 -0
  123. package/dist/nodes/lime-crm/resources/erpConnector/transform.js +11 -0
  124. package/dist/nodes/lime-crm/resources/erpConnector/transform.js.map +1 -0
  125. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.d.ts +4 -0
  126. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js +7 -0
  127. package/dist/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.js.map +1 -0
  128. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.d.ts +37 -0
  129. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js +124 -0
  130. package/dist/nodes/lime-crm/resources/erpConnector/transformers/fortnox.js.map +1 -0
  131. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.d.ts +1 -0
  132. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js +6 -0
  133. package/dist/nodes/lime-crm/resources/erpConnector/transformers/index.js.map +1 -0
  134. package/dist/nodes/lime-crm/resources/limeObject/index.d.ts +14 -0
  135. package/dist/nodes/lime-crm/resources/limeObject/index.js +88 -0
  136. package/dist/nodes/lime-crm/resources/limeObject/index.js.map +1 -0
  137. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.d.ts +9 -0
  138. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js +139 -0
  139. package/dist/nodes/lime-crm/resources/limeObject/operations/create.operation.js.map +1 -0
  140. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.d.ts +9 -0
  141. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js +51 -0
  142. package/dist/nodes/lime-crm/resources/limeObject/operations/delete.operation.js.map +1 -0
  143. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.d.ts +9 -0
  144. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js +51 -0
  145. package/dist/nodes/lime-crm/resources/limeObject/operations/get.operation.js.map +1 -0
  146. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.d.ts +9 -0
  147. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +86 -0
  148. package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -0
  149. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.d.ts +9 -0
  150. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js +149 -0
  151. package/dist/nodes/lime-crm/resources/limeObject/operations/update.operation.js.map +1 -0
  152. package/dist/nodes/lime-crm/resources/limeType/index.d.ts +20 -0
  153. package/dist/nodes/lime-crm/resources/limeType/index.js +81 -0
  154. package/dist/nodes/lime-crm/resources/limeType/index.js.map +1 -0
  155. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.d.ts +11 -0
  156. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js +36 -0
  157. package/dist/nodes/lime-crm/resources/limeType/operations/getProperties.operation.js.map +1 -0
  158. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.d.ts +9 -0
  159. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js +36 -0
  160. package/dist/nodes/lime-crm/resources/limeType/operations/getType.operation.js.map +1 -0
  161. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.d.ts +10 -0
  162. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js +15 -0
  163. package/dist/nodes/lime-crm/resources/limeType/operations/listTypes.operation.js.map +1 -0
  164. package/dist/nodes/lime-crm/transport/commons.d.ts +5 -0
  165. package/dist/nodes/lime-crm/transport/commons.js +32 -0
  166. package/dist/nodes/lime-crm/transport/commons.js.map +1 -0
  167. package/dist/nodes/lime-crm/transport/erpConnector.d.ts +9 -0
  168. package/dist/nodes/lime-crm/transport/erpConnector.js +11 -0
  169. package/dist/nodes/lime-crm/transport/erpConnector.js.map +1 -0
  170. package/dist/nodes/lime-crm/transport/index.d.ts +5 -0
  171. package/dist/nodes/lime-crm/transport/index.js +22 -0
  172. package/dist/nodes/lime-crm/transport/index.js.map +1 -0
  173. package/dist/nodes/lime-crm/transport/limeobjects.d.ts +7 -0
  174. package/dist/nodes/lime-crm/transport/limeobjects.js +48 -0
  175. package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -0
  176. package/dist/nodes/lime-crm/transport/limetypes.d.ts +6 -0
  177. package/dist/nodes/lime-crm/transport/limetypes.js +39 -0
  178. package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -0
  179. package/dist/nodes/lime-crm/transport/task.d.ts +13 -0
  180. package/dist/nodes/lime-crm/transport/task.js +13 -0
  181. package/dist/nodes/lime-crm/transport/task.js.map +1 -0
  182. package/dist/nodes/lime-crm/transport/webhooks.d.ts +15 -0
  183. package/dist/nodes/lime-crm/transport/webhooks.js +32 -0
  184. package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -0
  185. package/dist/nodes/nodeResponse.d.ts +12 -0
  186. package/dist/nodes/nodeResponse.js +3 -0
  187. package/dist/nodes/nodeResponse.js.map +1 -0
  188. package/dist/package.json +36 -16
  189. package/dist/tsconfig.tsbuildinfo +1 -1
  190. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.properties = exports.description = void 0;
4
+ exports.execute = execute;
5
+ const transport_1 = require("../../../transport");
6
+ const filterParameters_1 = require("../filterParameters");
7
+ const sortParameters_1 = require("../sortParameters");
8
+ exports.description = {
9
+ name: 'Get All Customers',
10
+ value: 'getAll',
11
+ description: 'Get all customers',
12
+ action: 'Get all customers',
13
+ };
14
+ exports.properties = [
15
+ {
16
+ displayName: 'Filter by',
17
+ name: 'filterParameters',
18
+ type: 'collection',
19
+ placeholder: 'Add Parameter',
20
+ default: {},
21
+ displayOptions: {
22
+ show: {
23
+ resource: ['customer'],
24
+ operation: ['getAll'],
25
+ },
26
+ },
27
+ options: filterParameters_1.filterParameters,
28
+ },
29
+ {
30
+ displayName: 'Sort by',
31
+ name: 'sortParameters',
32
+ type: 'collection',
33
+ placeholder: 'Add Parameter',
34
+ default: {},
35
+ displayOptions: {
36
+ show: {
37
+ resource: ['customer'],
38
+ operation: ['getAll'],
39
+ },
40
+ },
41
+ options: sortParameters_1.sortParameters,
42
+ },
43
+ ];
44
+ async function execute(i) {
45
+ const filterParameters = this.getNodeParameter('filterParameters', i, {});
46
+ const sortParameters = this.getNodeParameter('sortParameters', i, {});
47
+ const qs = {};
48
+ if (filterParameters) {
49
+ for (const [key, value] of Object.entries(filterParameters)) {
50
+ if (value !== '' && value !== undefined && value !== null) {
51
+ qs[key] = value;
52
+ }
53
+ }
54
+ }
55
+ if (sortParameters && Object.keys(sortParameters).length > 0) {
56
+ qs['sortby'] = Object.entries(sortParameters)
57
+ .filter(([, value]) => value)
58
+ .map(([, value]) => `${value}`)
59
+ .join('');
60
+ }
61
+ const endpoint = `/customers`;
62
+ return await (0, transport_1.apiRequest)(this, {
63
+ method: 'GET',
64
+ endpoint: endpoint,
65
+ qs,
66
+ });
67
+ }
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":";;;AA6CA,0BAkCC;AA9ED,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,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACxB;SACJ;QACD,OAAO,EAAE,mCAAgB;KAC5B;IACD;QACI,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACxB;SACJ;QACD,OAAO,EAAE,+BAAc;KAC1B;CACJ,CAAC;AAEK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CACxC,gBAAgB,EAChB,CAAC,EACD,EAAE,CACU,CAAC;IAEjB,MAAM,EAAE,GAAgB,EAAE,CAAC;IAC3B,IAAI,gBAAgB,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1D,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACxD,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACpB,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3D,EAAE,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;aACxC,MAAM,CAAC,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"}
@@ -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>>;
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.properties = exports.updateProperties = exports.description = void 0;
4
+ exports.execute = execute;
5
+ const transport_1 = require("../../../transport");
6
+ const currency_codes_1 = require("currency-codes");
7
+ exports.description = {
8
+ name: 'Update Customer',
9
+ value: 'update',
10
+ description: 'Update an existing customer',
11
+ action: 'Update a customer',
12
+ };
13
+ exports.updateProperties = [
14
+ {
15
+ displayName: 'Name',
16
+ name: 'Name',
17
+ type: 'string',
18
+ default: '',
19
+ description: 'Customer name',
20
+ },
21
+ {
22
+ displayName: 'Active',
23
+ name: 'Active',
24
+ type: 'boolean',
25
+ default: true,
26
+ description: 'Whether the customer is active',
27
+ },
28
+ {
29
+ displayName: 'Address 1',
30
+ name: 'Address1',
31
+ type: 'string',
32
+ default: '',
33
+ description: "Customer's primary address",
34
+ },
35
+ {
36
+ displayName: 'Address 2',
37
+ name: 'Address2',
38
+ type: 'string',
39
+ default: '',
40
+ description: "Customer's secondary address",
41
+ },
42
+ {
43
+ displayName: 'City',
44
+ name: 'City',
45
+ type: 'string',
46
+ default: '',
47
+ description: "Customer's city",
48
+ },
49
+ {
50
+ displayName: 'Comments',
51
+ name: 'Comments',
52
+ type: 'string',
53
+ default: '',
54
+ description: 'Comments about the customer',
55
+ },
56
+ {
57
+ displayName: 'Currency',
58
+ name: 'Currency',
59
+ type: 'string',
60
+ default: '',
61
+ description: "Customer's currency code, e.g., SEK, EUR",
62
+ },
63
+ {
64
+ displayName: 'Cost Center',
65
+ name: 'CostCenter',
66
+ type: 'string',
67
+ default: '',
68
+ description: "Customer's cost center",
69
+ },
70
+ {
71
+ displayName: 'Country',
72
+ name: 'Country',
73
+ type: 'string',
74
+ default: '',
75
+ description: "Customer's country",
76
+ },
77
+ {
78
+ displayName: 'Country Code',
79
+ name: 'CountryCode',
80
+ type: 'string',
81
+ default: '',
82
+ description: "Customer's country code",
83
+ },
84
+ {
85
+ displayName: 'Email',
86
+ name: 'Email',
87
+ type: 'string',
88
+ default: '',
89
+ description: "Customer's email address",
90
+ },
91
+ {
92
+ displayName: 'External Reference',
93
+ name: 'ExternalReference',
94
+ type: 'string',
95
+ default: '',
96
+ description: 'External reference for the customer',
97
+ },
98
+ {
99
+ displayName: 'Fax',
100
+ name: 'Fax',
101
+ type: 'string',
102
+ default: '',
103
+ description: "Customer's fax number",
104
+ },
105
+ {
106
+ displayName: 'GLN',
107
+ name: 'GLN',
108
+ type: 'string',
109
+ default: '',
110
+ description: 'Global Location Number',
111
+ },
112
+ {
113
+ displayName: 'Organisation Number',
114
+ name: 'OrganisationNumber',
115
+ type: 'string',
116
+ default: '',
117
+ description: "Customer's organisation number",
118
+ },
119
+ {
120
+ displayName: 'Phone 1',
121
+ name: 'Phone1',
122
+ type: 'string',
123
+ default: '',
124
+ description: "Customer's primary phone number",
125
+ },
126
+ {
127
+ displayName: 'Phone 2',
128
+ name: 'Phone2',
129
+ type: 'string',
130
+ default: '',
131
+ description: "Customer's secondary phone number",
132
+ },
133
+ {
134
+ displayName: 'Type',
135
+ name: 'Type',
136
+ type: 'options',
137
+ options: [
138
+ {
139
+ name: 'Private',
140
+ value: 'PRIVATE',
141
+ },
142
+ {
143
+ name: 'Company',
144
+ value: 'COMPANY',
145
+ },
146
+ ],
147
+ default: 'COMPANY',
148
+ description: 'Type of customer',
149
+ },
150
+ {
151
+ displayName: 'VAT Number',
152
+ name: 'VATNumber',
153
+ type: 'string',
154
+ default: '',
155
+ description: "Customer's VAT number",
156
+ },
157
+ {
158
+ displayName: 'VAT Type',
159
+ name: 'VATType',
160
+ type: 'options',
161
+ options: [
162
+ {
163
+ name: 'SE VAT',
164
+ value: 'SEVAT',
165
+ },
166
+ {
167
+ name: 'SE Reversed VAT',
168
+ value: 'SEREVERSEDVAT',
169
+ },
170
+ {
171
+ name: 'EU Reversed VAT',
172
+ value: 'EUREVERSEDVAT',
173
+ },
174
+ {
175
+ name: 'EU VAT',
176
+ value: 'EUVAT',
177
+ },
178
+ {
179
+ name: 'Export',
180
+ value: 'EXPORT',
181
+ },
182
+ ],
183
+ default: 'SEVAT',
184
+ description: 'Type of VAT applied',
185
+ },
186
+ {
187
+ displayName: 'Website',
188
+ name: 'WWW',
189
+ type: 'string',
190
+ default: '',
191
+ description: "Customer's website URL",
192
+ },
193
+ {
194
+ displayName: 'ZIP Code',
195
+ name: 'ZipCode',
196
+ type: 'string',
197
+ default: '',
198
+ description: "Customer's ZIP/postal code",
199
+ },
200
+ ];
201
+ exports.properties = [
202
+ {
203
+ displayName: 'Customer Number',
204
+ name: 'customerNumber',
205
+ type: 'string',
206
+ required: true,
207
+ default: '',
208
+ description: 'Unique identifier for customer',
209
+ displayOptions: {
210
+ show: {
211
+ resource: ['customer'],
212
+ operation: ['update'],
213
+ },
214
+ },
215
+ },
216
+ {
217
+ displayName: 'Fields',
218
+ name: 'fields',
219
+ type: 'collection',
220
+ placeholder: 'Add Field',
221
+ default: {},
222
+ displayOptions: {
223
+ show: {
224
+ resource: ['customer'],
225
+ operation: ['update'],
226
+ },
227
+ },
228
+ options: [...exports.updateProperties],
229
+ },
230
+ ];
231
+ async function execute(i) {
232
+ const customerNumber = this.getNodeParameter('customerNumber', i);
233
+ const fields = this.getNodeParameter('fields', i, {});
234
+ if (Object.keys(fields).length === 0) {
235
+ return {
236
+ success: false,
237
+ error: 'At least one field must be provided for update',
238
+ };
239
+ }
240
+ if (fields.name && fields.name === '') {
241
+ return {
242
+ success: false,
243
+ error: 'Customer name cannot be empty',
244
+ };
245
+ }
246
+ if (fields.Currency) {
247
+ fields.Currency = String(fields.Currency).toUpperCase();
248
+ if ((0, currency_codes_1.code)(fields.Currency) === undefined) {
249
+ return {
250
+ success: false,
251
+ error: `Invalid currency code: ${fields.Currency}. Use ISO 4217 currency code.`,
252
+ };
253
+ }
254
+ }
255
+ const body = {
256
+ Customer: {
257
+ ...fields,
258
+ },
259
+ };
260
+ const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
261
+ return await (0, transport_1.apiRequest)(this, {
262
+ method: 'PUT',
263
+ endpoint: endpoint,
264
+ body: body,
265
+ });
266
+ }
267
+ //# sourceMappingURL=update.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/fortnox/resources/customers/operations/update.operation.ts"],"names":[],"mappings":";;;AAyOA,0BA4CC;AApRD,kDAAgD;AAEhD,mDAAsD;AAGzC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,6BAA6B;IAC1C,MAAM,EAAE,mBAAmB;CAC9B,CAAC;AAEW,QAAA,gBAAgB,GAAsB;IAC/C;QACI,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,eAAe;KAC/B;IACD;QACI,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,gCAAgC;KAChD;IACD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4BAA4B;KAC5C;IACD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;KAC9C;IACD;QACI,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,iBAAiB;KACjC;IACD;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,6BAA6B;KAC7C;IACD;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;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;QAClB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;QACxD,IAAI,IAAA,qBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9C,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,0BAA0B,MAAM,CAAC,QAAQ,+BAA+B;aAClF,CAAC;QACN,CAAC;IACL,CAAC;IAED,MAAM,IAAI,GAAG;QACT,QAAQ,EAAE;YACN,GAAG,MAAM;SACZ;KACJ,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC;IAEpE,OAAO,MAAM,IAAA,sBAAU,EAAmB,IAAI,EAAE;QAC5C,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;KACb,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const sortParameters: INodeProperties[];
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortParameters = void 0;
4
+ const sortByDefinitions = [
5
+ ['Customer Number', 'customernumber'],
6
+ ['Name', 'name'],
7
+ ];
8
+ function createSortProperties(parameters) {
9
+ const options = parameters.map(([displayName, fieldName]) => {
10
+ return {
11
+ name: displayName,
12
+ value: fieldName,
13
+ description: `Sort by ${displayName.toLowerCase()}`,
14
+ };
15
+ });
16
+ return [
17
+ {
18
+ displayName: 'Sort by',
19
+ name: 'sortby',
20
+ type: 'options',
21
+ noDataExpression: true,
22
+ options: options,
23
+ default: options[0].value,
24
+ placeholder: 'Select a field to sort by',
25
+ description: 'Select a field to sort by',
26
+ },
27
+ ];
28
+ }
29
+ exports.sortParameters = createSortProperties(sortByDefinitions);
30
+ //# sourceMappingURL=sortParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortParameters.js","sourceRoot":"","sources":["../../../../../nodes/fortnox/resources/customers/sortParameters.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAG;IACtB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;IACrC,CAAC,MAAM,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,SAAS,oBAAoB,CAAC,UAAsB;IAChD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE;QACxD,OAAO;YACH,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,WAAW,WAAW,CAAC,WAAW,EAAE,EAAE;SACtD,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO;QACH;YACI,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,SAA8B;YACpC,gBAAgB,EAAE,IAAI;YACtB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK;YACzB,WAAW,EAAE,2BAA2B;YACxC,WAAW,EAAE,2BAA2B;SAC3C;KACJ,CAAC;AACN,CAAC;AAEY,QAAA,cAAc,GACvB,oBAAoB,CAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const filterParameters: INodeProperties[];
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterParameters = void 0;
4
+ const commons_1 = require("../../commons");
5
+ const optionParametersDefinitions = [
6
+ {
7
+ displayName: 'Invoice Status',
8
+ name: 'filter',
9
+ parameters: [
10
+ ['Cancelled', 'cancelled'],
11
+ ['Fully Paid', 'fullypaid'],
12
+ ['Unbooked', 'unbooked'],
13
+ ['Unpaid', 'unpaid'],
14
+ ['Unpaid And Overdue', 'unpaidoverdue'],
15
+ ],
16
+ },
17
+ {
18
+ displayName: 'Invoice Type',
19
+ name: 'InvoiceType',
20
+ parameters: [
21
+ ['Invoice', 'invoice'],
22
+ ['Agreement Invoice', 'agreementinvoice'],
23
+ ['Intrest Invoice', 'intrestinvoice'],
24
+ ['Summery Invoice', 'summaryinvoice'],
25
+ ['Cash Invoice', 'cashinvoice'],
26
+ ],
27
+ },
28
+ ];
29
+ const parametersDefinitions = [
30
+ ['Account Number From', 'accountnumberfrom', 'string', '', {}],
31
+ ['Account Number To', 'accountnumberto', 'string', '', {}],
32
+ ['Article Description', 'articledescription', 'string', '', {}],
33
+ ['Article Number', 'articlenumber', 'string', '', {}],
34
+ ['Cost Center', 'costcenter', 'string', '', {}],
35
+ ['Credit', 'credit', 'string', '', {}],
36
+ ['Currency', 'currency', 'string', '', {}],
37
+ ['Customer Name', 'customername', 'string', '', {}],
38
+ ['Customer Number', 'customernumber', 'string', '', {}],
39
+ ['Document Number', 'documentnumber', 'string', '', {}],
40
+ [
41
+ 'External Invoice Reference 1',
42
+ 'externalinvoicereference1',
43
+ 'string',
44
+ '',
45
+ {},
46
+ ],
47
+ [
48
+ 'External Invoice Reference 2',
49
+ 'externalinvoicereference2',
50
+ 'string',
51
+ '',
52
+ {},
53
+ ],
54
+ ['From Date', 'fromdate', 'string', '', {}],
55
+ ['From Final Pay Date', 'fromfinalpaydate', 'string', '', {}],
56
+ ['Label', 'label', 'string', '', {}],
57
+ ['Last Modified', 'lastmodified', 'string', '', {}],
58
+ ['Not Completed', 'notcomplete', 'string', '', {}],
59
+ ['OCR', 'ocr', 'string', '', {}],
60
+ ['Our Reference', 'ourreference', 'string', '', {}],
61
+ ['Project', 'project', 'string', '', {}],
62
+ ['Sent', 'sent', 'boolean', false, {}],
63
+ ['To Date', 'todate', 'string', '', {}],
64
+ ['To Final Pay Date', 'tofinalpaydate', 'string', '', {}],
65
+ ['Your Order Number', 'yourordernumber', 'string', '', {}],
66
+ ['Your Reference', 'yourreference', 'string', '', {}],
67
+ ];
68
+ exports.filterParameters = [
69
+ ...optionParametersDefinitions.map((option) => (0, commons_1.createOptionParameter)(option)),
70
+ ...parametersDefinitions.map(([displayName, name, filterType, defaultValue, typeOptions]) => (0, commons_1.createParameter)(displayName, name, filterType, defaultValue, typeOptions)),
71
+ ];
72
+ //# sourceMappingURL=filterParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterParameters.js","sourceRoot":"","sources":["../../../../../nodes/fortnox/resources/invoice/filterParameters.ts"],"names":[],"mappings":";;;AACA,2CAKuB;AAEvB,MAAM,2BAA2B,GAAgC;IAC7D;QACI,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,CAAC,WAAW,EAAE,WAAW,CAAC;YAC1B,CAAC,YAAY,EAAE,WAAW,CAAC;YAC3B,CAAC,UAAU,EAAE,UAAU,CAAC;YACxB,CAAC,QAAQ,EAAE,QAAQ,CAAC;YACpB,CAAC,oBAAoB,EAAE,eAAe,CAAC;SAC1C;KACJ;IACD;QACI,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE;YACR,CAAC,SAAS,EAAE,SAAS,CAAC;YACtB,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;YACzC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;YACrC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;YACrC,CAAC,cAAc,EAAE,aAAa,CAAC;SAClC;KACJ;CACJ,CAAC;AAEF,MAAM,qBAAqB,GAA0B;IACjD,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC9D,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC1D,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC/D,CAAC,gBAAgB,EAAE,eAAe,EAA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CAAC;IACxC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;IACtC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACvC,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IACzD,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;IAC1D,CAAC,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;CACxD,CAAC;AAEW,QAAA,gBAAgB,GAAsB;IAC/C,GAAG,2BAA2B,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1C,IAAA,+BAAqB,EAAC,MAAM,CAAC,CAChC;IACD,GAAG,qBAAqB,CAAC,GAAG,CACxB,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,EAAE,CAC3D,IAAA,yBAAe,EACX,WAAW,EACX,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,WAAW,CACd,CACR;CACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
+ export declare const invoiceProperties: INodeProperties[];
3
+ export declare function invoiceOperations(this: IExecuteFunctions, { operation, i }: {
4
+ operation: string;
5
+ i: number;
6
+ }): Promise<{
7
+ success: false;
8
+ error: string;
9
+ status?: number;
10
+ metadata?: Record<string, unknown>;
11
+ } | {
12
+ success: true;
13
+ data: import("./model").CreateInvoiceResponse;
14
+ } | {
15
+ success: true;
16
+ data: import("./model").GetInvoiceResponse;
17
+ } | {
18
+ success: true;
19
+ data: import("./model").GetAllInvoicesResponse;
20
+ } | null>;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.invoiceProperties = void 0;
37
+ exports.invoiceOperations = invoiceOperations;
38
+ const create = __importStar(require("./operations/create.operation"));
39
+ const get = __importStar(require("./operations/get.operation"));
40
+ const getAll = __importStar(require("./operations/getAll.operation"));
41
+ const update = __importStar(require("./operations/update.operation"));
42
+ exports.invoiceProperties = [
43
+ {
44
+ displayName: 'Operation',
45
+ name: 'operation',
46
+ type: 'options',
47
+ noDataExpression: true,
48
+ displayOptions: {
49
+ show: {
50
+ resource: ['invoice'],
51
+ },
52
+ },
53
+ options: [
54
+ create.description,
55
+ get.description,
56
+ getAll.description,
57
+ update.description,
58
+ ],
59
+ default: 'getAll',
60
+ },
61
+ ...create.properties,
62
+ ...get.properties,
63
+ ...getAll.properties,
64
+ ...update.properties,
65
+ ];
66
+ async function invoiceOperations({ operation, i }) {
67
+ if (operation === 'create') {
68
+ return await create.execute.call(this, i);
69
+ }
70
+ else if (operation === 'get') {
71
+ return await get.execute.call(this, i);
72
+ }
73
+ else if (operation === 'getAll') {
74
+ return await getAll.execute.call(this, i);
75
+ }
76
+ else if (operation === 'update') {
77
+ return await update.execute.call(this, i);
78
+ }
79
+ return null;
80
+ }
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/fortnox/resources/invoice/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,8CAcC;AA5CD,sEAAwD;AACxD,gEAAkD;AAClD,sEAAwD;AACxD,sEAAwD;AAE3C,QAAA,iBAAiB,GAAsB;IAChD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAA8B;QACpC,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,SAAS,CAAC;aACxB;SACJ;QACD,OAAO,EAAE;YACL,MAAM,CAAC,WAAW;YAClB,GAAG,CAAC,WAAW;YACf,MAAM,CAAC,WAAW;YAClB,MAAM,CAAC,WAAW;SACrB;QACD,OAAO,EAAE,QAAQ;KACpB;IACD,GAAG,MAAM,CAAC,UAAU;IACpB,GAAG,GAAG,CAAC,UAAU;IACjB,GAAG,MAAM,CAAC,UAAU;IACpB,GAAG,MAAM,CAAC,UAAU;CACvB,CAAC;AAEK,KAAK,UAAU,iBAAiB,CAEnC,EAAE,SAAS,EAAE,CAAC,EAAoC;IAElD,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9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