@limetech/n8n-nodes-lime 2.7.0-dev.1 → 3.1.0

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 (196) hide show
  1. package/.devcontainer/devcontainer.json +44 -0
  2. package/.devcontainer/docker-compose.yml +27 -0
  3. package/.gitattributes +34 -0
  4. package/.nvmrc +1 -0
  5. package/CHANGELOG.md +17 -5
  6. package/README.md +40 -47
  7. package/credentials/index.ts +0 -1
  8. package/dist/credentials/index.d.ts +0 -1
  9. package/dist/credentials/index.js +0 -1
  10. package/dist/credentials/index.js.map +1 -1
  11. package/dist/nodes/index.d.ts +0 -1
  12. package/dist/nodes/index.js +0 -1
  13. package/dist/nodes/index.js.map +1 -1
  14. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +1 -4
  15. package/dist/nodes/lime-crm/LimeCrmNode.node.js +0 -3
  16. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -1
  17. package/dist/nodes/lime-crm/methods/getLimetypeProperties.d.ts +0 -2
  18. package/dist/nodes/lime-crm/methods/getLimetypeProperties.js +0 -43
  19. package/dist/nodes/lime-crm/methods/getLimetypeProperties.js.map +1 -1
  20. package/dist/nodes/lime-crm/methods/index.d.ts +2 -2
  21. package/dist/nodes/lime-crm/methods/index.js +1 -4
  22. package/dist/nodes/lime-crm/methods/index.js.map +1 -1
  23. package/dist/nodes/lime-crm/methods/resourceMapping.d.ts +0 -1
  24. package/dist/nodes/lime-crm/methods/resourceMapping.js +0 -46
  25. package/dist/nodes/lime-crm/methods/resourceMapping.js.map +1 -1
  26. package/dist/nodes/lime-crm/models/limetype.d.ts +0 -1
  27. package/dist/nodes/lime-crm/resources/data/index.d.ts +1 -1
  28. package/dist/nodes/lime-crm/resources/data/index.js +0 -20
  29. package/dist/nodes/lime-crm/resources/data/index.js.map +1 -1
  30. package/dist/nodes/lime-crm/resources/data/operations/index.d.ts +0 -4
  31. package/dist/nodes/lime-crm/resources/data/operations/index.js +1 -5
  32. package/dist/nodes/lime-crm/resources/data/operations/index.js.map +1 -1
  33. package/dist/nodes/lime-crm/transport/index.d.ts +0 -1
  34. package/dist/nodes/lime-crm/transport/index.js +1 -6
  35. package/dist/nodes/lime-crm/transport/index.js.map +1 -1
  36. package/dist/nodes/lime-crm/transport/limetypes.js +4 -15
  37. package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -1
  38. package/dist/nodes/lime-forms/LimeFormsTrigger.node.js +3 -3
  39. package/dist/nodes/lime-forms/LimeFormsTrigger.node.js.map +1 -1
  40. package/dist/nodes/lime-forms/assets/lime-crm.svg +1 -0
  41. package/dist/package.json +5 -12
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/nodes/index.ts +0 -1
  44. package/nodes/lime-crm/LimeCrmNode.node.ts +0 -6
  45. package/nodes/lime-crm/methods/getLimetypeProperties.ts +0 -84
  46. package/nodes/lime-crm/methods/index.ts +0 -3
  47. package/nodes/lime-crm/methods/resourceMapping.ts +0 -76
  48. package/nodes/lime-crm/models/limetype.ts +0 -1
  49. package/nodes/lime-crm/resources/data/index.ts +1 -34
  50. package/nodes/lime-crm/resources/data/operations/index.ts +0 -17
  51. package/nodes/lime-crm/transport/index.ts +0 -8
  52. package/nodes/lime-crm/transport/limetypes.ts +8 -26
  53. package/nodes/lime-forms/LimeFormsTrigger.node.ts +3 -3
  54. package/nodes/lime-forms/assets/lime-crm.svg +1 -0
  55. package/package.json +6 -13
  56. package/credentials/FortnoxApi.credentials.ts +0 -61
  57. package/dist/credentials/FortnoxApi.credentials.d.ts +0 -9
  58. package/dist/credentials/FortnoxApi.credentials.js +0 -57
  59. package/dist/credentials/FortnoxApi.credentials.js.map +0 -1
  60. package/dist/nodes/fortnox/Fortnox.node.d.ts +0 -5
  61. package/dist/nodes/fortnox/Fortnox.node.js +0 -95
  62. package/dist/nodes/fortnox/Fortnox.node.js.map +0 -1
  63. package/dist/nodes/fortnox/Fortnox.node.json +0 -18
  64. package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +0 -5
  65. package/dist/nodes/fortnox/FortnoxTrigger.node.js +0 -155
  66. package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +0 -1
  67. package/dist/nodes/fortnox/FortnoxTrigger.node.json +0 -18
  68. package/dist/nodes/fortnox/commons.d.ts +0 -25
  69. package/dist/nodes/fortnox/commons.js +0 -44
  70. package/dist/nodes/fortnox/commons.js.map +0 -1
  71. package/dist/nodes/fortnox/fortnoxLogo.svg +0 -15
  72. package/dist/nodes/fortnox/index.d.ts +0 -6
  73. package/dist/nodes/fortnox/index.js +0 -23
  74. package/dist/nodes/fortnox/index.js.map +0 -1
  75. package/dist/nodes/fortnox/model.d.ts +0 -20
  76. package/dist/nodes/fortnox/model.js +0 -3
  77. package/dist/nodes/fortnox/model.js.map +0 -1
  78. package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +0 -2
  79. package/dist/nodes/fortnox/resources/customers/filterParameters.js +0 -31
  80. package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +0 -1
  81. package/dist/nodes/fortnox/resources/customers/index.d.ts +0 -7
  82. package/dist/nodes/fortnox/resources/customers/index.js +0 -85
  83. package/dist/nodes/fortnox/resources/customers/index.js.map +0 -1
  84. package/dist/nodes/fortnox/resources/customers/model.d.ts +0 -99
  85. package/dist/nodes/fortnox/resources/customers/model.js +0 -3
  86. package/dist/nodes/fortnox/resources/customers/model.js.map +0 -1
  87. package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +0 -10
  88. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +0 -281
  89. package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +0 -1
  90. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +0 -9
  91. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +0 -38
  92. package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +0 -1
  93. package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +0 -10
  94. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +0 -38
  95. package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +0 -1
  96. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +0 -10
  97. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +0 -68
  98. package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +0 -1
  99. package/dist/nodes/fortnox/resources/customers/operations/index.d.ts +0 -5
  100. package/dist/nodes/fortnox/resources/customers/operations/index.js +0 -42
  101. package/dist/nodes/fortnox/resources/customers/operations/index.js.map +0 -1
  102. package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +0 -10
  103. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +0 -261
  104. package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +0 -1
  105. package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +0 -2
  106. package/dist/nodes/fortnox/resources/customers/sortParameters.js +0 -30
  107. package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +0 -1
  108. package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +0 -2
  109. package/dist/nodes/fortnox/resources/invoice/filterParameters.js +0 -72
  110. package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +0 -1
  111. package/dist/nodes/fortnox/resources/invoice/index.d.ts +0 -7
  112. package/dist/nodes/fortnox/resources/invoice/index.js +0 -81
  113. package/dist/nodes/fortnox/resources/invoice/index.js.map +0 -1
  114. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +0 -2
  115. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +0 -193
  116. package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +0 -1
  117. package/dist/nodes/fortnox/resources/invoice/model.d.ts +0 -147
  118. package/dist/nodes/fortnox/resources/invoice/model.js +0 -3
  119. package/dist/nodes/fortnox/resources/invoice/model.js.map +0 -1
  120. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +0 -10
  121. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +0 -64
  122. package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +0 -1
  123. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +0 -10
  124. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +0 -37
  125. package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +0 -1
  126. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +0 -10
  127. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +0 -92
  128. package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +0 -1
  129. package/dist/nodes/fortnox/resources/invoice/operations/index.d.ts +0 -4
  130. package/dist/nodes/fortnox/resources/invoice/operations/index.js +0 -41
  131. package/dist/nodes/fortnox/resources/invoice/operations/index.js.map +0 -1
  132. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +0 -10
  133. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +0 -64
  134. package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +0 -1
  135. package/dist/nodes/fortnox/transport/errorCodes.d.ts +0 -1
  136. package/dist/nodes/fortnox/transport/errorCodes.js +0 -50
  137. package/dist/nodes/fortnox/transport/errorCodes.js.map +0 -1
  138. package/dist/nodes/fortnox/transport/index.d.ts +0 -3
  139. package/dist/nodes/fortnox/transport/index.js +0 -76
  140. package/dist/nodes/fortnox/transport/index.js.map +0 -1
  141. package/dist/nodes/lime-crm/resources/data/operations/bulkImportCommons.d.ts +0 -5
  142. package/dist/nodes/lime-crm/resources/data/operations/bulkImportCommons.js +0 -230
  143. package/dist/nodes/lime-crm/resources/data/operations/bulkImportCommons.js.map +0 -1
  144. package/dist/nodes/lime-crm/resources/data/operations/createManyObjects.operation.d.ts +0 -9
  145. package/dist/nodes/lime-crm/resources/data/operations/createManyObjects.operation.js +0 -16
  146. package/dist/nodes/lime-crm/resources/data/operations/createManyObjects.operation.js.map +0 -1
  147. package/dist/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.d.ts +0 -9
  148. package/dist/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.js +0 -16
  149. package/dist/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.js.map +0 -1
  150. package/dist/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.d.ts +0 -9
  151. package/dist/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.js +0 -241
  152. package/dist/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.js.map +0 -1
  153. package/dist/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.d.ts +0 -9
  154. package/dist/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.js +0 -16
  155. package/dist/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.js.map +0 -1
  156. package/dist/nodes/lime-crm/transport/bulkimport.d.ts +0 -41
  157. package/dist/nodes/lime-crm/transport/bulkimport.js +0 -86
  158. package/dist/nodes/lime-crm/transport/bulkimport.js.map +0 -1
  159. package/dist/nodes/lime-forms/lime-forms.svg +0 -6
  160. package/docker-compose.yml +0 -0
  161. package/nodes/fortnox/Fortnox.node.json +0 -18
  162. package/nodes/fortnox/Fortnox.node.ts +0 -102
  163. package/nodes/fortnox/FortnoxTrigger.node.json +0 -18
  164. package/nodes/fortnox/FortnoxTrigger.node.ts +0 -196
  165. package/nodes/fortnox/commons.ts +0 -94
  166. package/nodes/fortnox/fortnoxLogo.svg +0 -15
  167. package/nodes/fortnox/index.ts +0 -6
  168. package/nodes/fortnox/model.ts +0 -25
  169. package/nodes/fortnox/resources/customers/filterParameters.ts +0 -47
  170. package/nodes/fortnox/resources/customers/index.ts +0 -53
  171. package/nodes/fortnox/resources/customers/model.ts +0 -107
  172. package/nodes/fortnox/resources/customers/operations/create.operation.ts +0 -307
  173. package/nodes/fortnox/resources/customers/operations/delete.operation.ts +0 -49
  174. package/nodes/fortnox/resources/customers/operations/get.operation.ts +0 -50
  175. package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +0 -79
  176. package/nodes/fortnox/resources/customers/operations/index.ts +0 -5
  177. package/nodes/fortnox/resources/customers/operations/update.operation.ts +0 -288
  178. package/nodes/fortnox/resources/customers/sortParameters.ts +0 -32
  179. package/nodes/fortnox/resources/invoice/filterParameters.ts +0 -88
  180. package/nodes/fortnox/resources/invoice/index.ts +0 -49
  181. package/nodes/fortnox/resources/invoice/invoiceParameters.ts +0 -214
  182. package/nodes/fortnox/resources/invoice/model.ts +0 -156
  183. package/nodes/fortnox/resources/invoice/operations/create.operation.ts +0 -71
  184. package/nodes/fortnox/resources/invoice/operations/get.operation.ts +0 -50
  185. package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +0 -100
  186. package/nodes/fortnox/resources/invoice/operations/index.ts +0 -4
  187. package/nodes/fortnox/resources/invoice/operations/update.operation.ts +0 -79
  188. package/nodes/fortnox/transport/errorCodes.ts +0 -62
  189. package/nodes/fortnox/transport/index.ts +0 -106
  190. package/nodes/lime-crm/resources/data/operations/bulkImportCommons.ts +0 -323
  191. package/nodes/lime-crm/resources/data/operations/createManyObjects.operation.ts +0 -44
  192. package/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.ts +0 -44
  193. package/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.ts +0 -364
  194. package/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.ts +0 -44
  195. package/nodes/lime-crm/transport/bulkimport.ts +0 -271
  196. package/nodes/lime-forms/lime-forms.svg +0 -6
@@ -1,241 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.properties = exports.description = void 0;
4
- exports.execute = execute;
5
- const n8n_workflow_1 = require("n8n-workflow");
6
- const models_1 = require("../../../models");
7
- const transport_1 = require("../../../transport");
8
- const bulkimport_1 = require("../../../transport/bulkimport");
9
- exports.description = {
10
- name: 'Create or update many objects (deprecated)',
11
- value: 'startBulkImport',
12
- description: 'Create or update multiple objects via a bulk import. Skipping business logic.',
13
- action: 'Create or update many objects (deprecated)',
14
- };
15
- exports.properties = [
16
- {
17
- displayName: '<h1>Deprecated</h1>' +
18
- 'This action is deprecated and will be removed very soon. ' +
19
- 'Please use the new "Create or Update Many Objects (Alpha)" operation instead.',
20
- name: 'deprecatedNotice',
21
- type: 'callout',
22
- displayOptions: {
23
- show: {
24
- resource: [models_1.DATA_RESOURCE],
25
- operation: ['startBulkImport'],
26
- },
27
- },
28
- default: undefined,
29
- },
30
- {
31
- displayName: 'Limetype',
32
- name: 'limetype',
33
- type: 'options',
34
- typeOptions: {
35
- loadOptionsMethod: 'getLimetypes',
36
- },
37
- required: true,
38
- default: '',
39
- description: 'The type of object to update',
40
- displayOptions: {
41
- show: {
42
- resource: [models_1.DATA_RESOURCE],
43
- operation: ['startBulkImport'],
44
- },
45
- },
46
- },
47
- {
48
- displayName: 'Matching Property',
49
- name: 'matchingProperty',
50
- type: 'options',
51
- typeOptions: {
52
- loadOptionsMethod: 'getNoHasManyProperties',
53
- loadOptionsDependsOn: ['limetype'],
54
- },
55
- required: true,
56
- default: '',
57
- description: 'The property to use to match existing objects. Must be a unique property.',
58
- displayOptions: {
59
- show: {
60
- resource: [models_1.DATA_RESOURCE],
61
- operation: ['startBulkImport'],
62
- },
63
- },
64
- },
65
- {
66
- displayName: 'Input Type',
67
- name: 'inputType',
68
- type: 'options',
69
- options: [
70
- {
71
- name: 'Simple Fields',
72
- value: 'simple',
73
- description: 'Define fields using the UI',
74
- },
75
- {
76
- name: 'JSON Object',
77
- value: 'json',
78
- description: 'Define fields using JSON',
79
- },
80
- ],
81
- default: 'simple',
82
- description: 'How to input the data',
83
- displayOptions: {
84
- show: {
85
- resource: [models_1.DATA_RESOURCE],
86
- operation: ['startBulkImport'],
87
- },
88
- },
89
- },
90
- {
91
- displayName: 'Data',
92
- name: 'jsonData',
93
- type: 'json',
94
- default: '{\n "name": "Updated Company Name",\n "phone": "+987654321"\n}',
95
- description: 'Key-value pairs for fields to update. Property names must match the Lime CRM field names.',
96
- typeOptions: {
97
- alwaysOpenEditWindow: true,
98
- },
99
- displayOptions: {
100
- show: {
101
- resource: [models_1.DATA_RESOURCE],
102
- operation: ['startBulkImport'],
103
- inputType: ['json'],
104
- },
105
- },
106
- },
107
- {
108
- displayName: 'Fields',
109
- name: 'simpleFields',
110
- placeholder: 'Add Field',
111
- type: 'fixedCollection',
112
- typeOptions: {
113
- multipleValues: true,
114
- sortable: true,
115
- },
116
- default: {},
117
- displayOptions: {
118
- show: {
119
- resource: [models_1.DATA_RESOURCE],
120
- operation: ['startBulkImport'],
121
- inputType: ['simple'],
122
- },
123
- },
124
- options: [
125
- {
126
- name: 'field',
127
- displayName: 'Field',
128
- values: [
129
- {
130
- displayName: 'Field Name',
131
- name: 'fieldName',
132
- type: 'options',
133
- typeOptions: {
134
- loadOptionsMethod: 'getNoHasManyProperties',
135
- loadOptionsDependsOn: ['limetype'],
136
- },
137
- default: '',
138
- description: 'The name of the field',
139
- },
140
- {
141
- displayName: 'Field Value',
142
- name: 'fieldValue',
143
- type: 'string',
144
- default: '',
145
- description: 'The value of the field',
146
- },
147
- {
148
- displayName: 'Relation Lookup',
149
- name: 'fieldNameDotLookup',
150
- type: 'options',
151
- typeOptions: {
152
- loadOptionsMethod: 'getRelationPropertiesWithLookupField',
153
- loadOptionsDependsOn: ['limetype'],
154
- },
155
- default: '',
156
- description: 'For relation fields: select which property on the related object to use for matching. Leave empty for non-relation fields.',
157
- },
158
- ],
159
- },
160
- ],
161
- },
162
- ];
163
- function getPropertiesFromJson(jsonData) {
164
- const parsed = JSON.parse(jsonData);
165
- return Object.keys(parsed);
166
- }
167
- function getPropertiesFromSimpleFields(simpleFields, getNode) {
168
- const propertiesToImport = [];
169
- for (const field of simpleFields) {
170
- const fieldName = field.fieldName;
171
- const fieldNameDotLookup = field.fieldNameDotLookup;
172
- if (fieldNameDotLookup) {
173
- const [relationField] = fieldNameDotLookup.split('.');
174
- if (relationField !== fieldName) {
175
- throw new n8n_workflow_1.NodeOperationError(getNode(), `Relation lookup "${fieldNameDotLookup}" does not match field name "${fieldName}".`);
176
- }
177
- propertiesToImport.push(fieldNameDotLookup);
178
- }
179
- else {
180
- propertiesToImport.push(fieldName);
181
- }
182
- }
183
- return propertiesToImport;
184
- }
185
- function buildPayloadFromSimpleFields(simpleFields) {
186
- const obj = { values: {} };
187
- for (const field of simpleFields) {
188
- const fieldName = field.fieldName;
189
- const fieldValue = field.fieldValue;
190
- obj.values[fieldName] = fieldValue;
191
- }
192
- return obj;
193
- }
194
- async function execute(i) {
195
- if (i > 0) {
196
- return undefined;
197
- }
198
- const limetype = this.getNodeParameter('limetype', i);
199
- const matchingProperty = this.getNodeParameter('matchingProperty', i);
200
- const inputType = this.getNodeParameter('inputType', i);
201
- const items = this.getInputData();
202
- n8n_workflow_1.LoggerProxy.info(`Preparing bulk import of ${items.length} objects for limetype: ${limetype}`);
203
- const propertiesToImport = inputType === 'json'
204
- ? getPropertiesFromJson(this.getNodeParameter('jsonData', 0))
205
- : getPropertiesFromSimpleFields(this.getNodeParameter('simpleFields.field', 0, []), this.getNode.bind(this));
206
- n8n_workflow_1.LoggerProxy.info(`Properties to import: ${propertiesToImport.join(', ')}`);
207
- const body = items.map((_, idx) => {
208
- if (inputType === 'json') {
209
- return JSON.parse(this.getNodeParameter('jsonData', idx));
210
- }
211
- return buildPayloadFromSimpleFields(this.getNodeParameter('simpleFields.field', idx, []));
212
- });
213
- const jobPayload = {
214
- mode: 'create_or_update',
215
- limetype,
216
- matchingProperty,
217
- properties: propertiesToImport,
218
- };
219
- const jobResponse = await (0, transport_1.createBulkImportJob)(this, jobPayload);
220
- const jobId = jobResponse.id;
221
- await (0, transport_1.uploadBulkImportData)(this, jobId, body);
222
- const finalStatus = await (0, bulkimport_1.waitForBulkImportJob)(this, jobId, 2500);
223
- if (finalStatus.status === 'failed') {
224
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The bulk import job failed', {
225
- message: 'The bulk import job failed due to a server error.',
226
- description: `Bulk import job with ID ${jobId} has failed. Check the Lime CRM server for more details.`,
227
- });
228
- }
229
- return {
230
- jobId,
231
- status: finalStatus.status,
232
- summary: finalStatus.result || {
233
- total: 0,
234
- created: 0,
235
- updated: 0,
236
- skipped: 0,
237
- failed: 0,
238
- },
239
- };
240
- }
241
- //# sourceMappingURL=deprecated-startBulkImport.operation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deprecated-startBulkImport.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.ts"],"names":[],"mappings":";;;AAgRA,0BA2FC;AA3WD,+CAOsB;AACtB,4CAAgD;AAChD,kDAI4B;AAC5B,8DAGuC;AAO1B,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,4CAA4C;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACP,+EAA+E;IACnF,MAAM,EAAE,4CAA4C;CACvD,CAAC;AAaW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EACP,qBAAqB;YACrB,2DAA2D;YAC3D,+EAA+E;QACnF,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,sBAAa,CAAC;gBACzB,SAAS,EAAE,CAAC,iBAAiB,CAAC;aACjC;SACJ;QACD,OAAO,EAAE,SAAS;KACrB;IACD;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACT,iBAAiB,EAAE,cAAc;SACpC;QACD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,sBAAa,CAAC;gBACzB,SAAS,EAAE,CAAC,iBAAiB,CAAC;aACjC;SACJ;KACJ;I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AAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChE,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,CAAC;IAG7B,MAAM,IAAA,gCAAoB,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAG9C,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAoB,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAElE,IAAI,WAAW,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,4BAA4B,EAC5B;YACI,OAAO,EAAE,mDAAmD;YAC5D,WAAW,EAAE,2BAA2B,KAAK,0DAA0D;SAC1G,CACJ,CAAC;IACN,CAAC;IAGD,OAAO;QACH,KAAK;QACL,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,OAAO,EAAE,WAAW,CAAC,MAAM,IAAI;YAC3B,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,CAAC;SACZ;KACJ,CAAC;AACN,CAAC"}
@@ -1,9 +0,0 @@
1
- import { IDataObject, IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
- export declare const description: {
3
- name: string;
4
- value: string;
5
- description: string;
6
- action: string;
7
- };
8
- export declare const properties: INodeProperties[];
9
- export declare function execute(this: IExecuteFunctions, i: number): Promise<IDataObject | undefined>;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.properties = exports.description = void 0;
4
- exports.execute = execute;
5
- const bulkImportCommons_1 = require("./bulkImportCommons");
6
- exports.description = {
7
- name: 'Update Many Objects (Alpha)',
8
- value: 'updateManyObjects',
9
- description: 'Update multiple existing objects via bulk import. Skips business logic.',
10
- action: 'Update many objects (alpha)',
11
- };
12
- exports.properties = (0, bulkImportCommons_1.getBulkImportProperties)('updateManyObjects', true);
13
- async function execute(i) {
14
- return (0, bulkImportCommons_1.executeBulkImport)(this, i, 'update');
15
- }
16
- //# sourceMappingURL=updateManyObjects.operation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateManyObjects.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/updateManyObjects.operation.ts"],"names":[],"mappings":";;;AAsCA,0BAKC;AA1CD,2DAG6B;AAOhB,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,6BAA6B;IACnC,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACP,yEAAyE;IAC7E,MAAM,EAAE,6BAA6B;CACxC,CAAC;AAOW,QAAA,UAAU,GAAsB,IAAA,2CAAuB,EAChE,mBAAmB,EACnB,IAAI,CACP,CAAC;AAWK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,OAAO,IAAA,qCAAiB,EAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC"}
@@ -1,41 +0,0 @@
1
- import { IExecuteFunctions } from 'n8n-workflow';
2
- export interface BulkImportJobResponse {
3
- id: string;
4
- createdBy: number;
5
- fileId: number | null;
6
- status: 'waiting_for_data' | 'ready' | 'failed' | 'succeeded';
7
- startedAt: string | null;
8
- endedAt: string | null;
9
- metadata: {
10
- limetype: string;
11
- properties: string[];
12
- mode: BulkImportMode;
13
- matchingProperty: string;
14
- };
15
- result: null | {
16
- total: number;
17
- created: number;
18
- updated: number;
19
- skipped: number;
20
- failed: number;
21
- };
22
- extras: null | {
23
- task_id?: string;
24
- taskId?: string;
25
- };
26
- }
27
- export type BulkImportMode = 'create' | 'update' | 'create_or_update';
28
- export interface BulkImportJobPayload {
29
- limetype: string;
30
- properties: string[];
31
- mode: BulkImportMode;
32
- matchingProperty?: string;
33
- }
34
- export interface BulkImportPayloadObject {
35
- values: Record<string, unknown>;
36
- extras?: Record<string, unknown>;
37
- }
38
- export declare function createBulkImportJob(context: IExecuteFunctions, payload: BulkImportJobPayload): Promise<BulkImportJobResponse>;
39
- export declare function uploadBulkImportData(context: IExecuteFunctions, jobId: string, data: unknown): Promise<void>;
40
- export declare function getBulkImportJobStatus(context: IExecuteFunctions, jobId: string): Promise<BulkImportJobResponse>;
41
- export declare function waitForBulkImportJob(context: IExecuteFunctions, jobId: string, pollIntervalMs?: number): Promise<BulkImportJobResponse>;
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createBulkImportJob = createBulkImportJob;
4
- exports.uploadBulkImportData = uploadBulkImportData;
5
- exports.getBulkImportJobStatus = getBulkImportJobStatus;
6
- exports.waitForBulkImportJob = waitForBulkImportJob;
7
- const n8n_workflow_1 = require("n8n-workflow");
8
- const commons_1 = require("./commons");
9
- const models_1 = require("../models");
10
- const BULK_IMPORT_URL = 'limepkg-mbeku-bulk-import/bulk-imports/';
11
- async function createBulkImportJob(context, payload) {
12
- n8n_workflow_1.LoggerProxy.info(`Creating bulk import job at ${BULK_IMPORT_URL} with payload: ${JSON.stringify(payload)}`);
13
- try {
14
- const response = await (0, commons_1.callLimeApi)(context, {
15
- method: 'POST',
16
- url: BULK_IMPORT_URL,
17
- requestOptions: {
18
- body: payload,
19
- },
20
- });
21
- if (!response.success) {
22
- throw new n8n_workflow_1.NodeApiError(context.getNode(), {
23
- message: 'The bulk import job was rejected by the server.',
24
- description: `${JSON.stringify(response.data)}`,
25
- });
26
- }
27
- n8n_workflow_1.LoggerProxy.info(`Created bulk import job at ${BULK_IMPORT_URL} with payload: ${JSON.stringify(payload)}`);
28
- return response.data;
29
- }
30
- catch (error) {
31
- n8n_workflow_1.LoggerProxy.error(`Failed to create bulk import job at ${BULK_IMPORT_URL} with payload: ${JSON.stringify(payload)}`);
32
- throw error;
33
- }
34
- }
35
- async function uploadBulkImportData(context, jobId, data) {
36
- const credentials = await context.getCredentials(models_1.LIME_CRM_API_CREDENTIAL_KEY);
37
- const baseUrl = credentials.url;
38
- const fullUrl = `${baseUrl}/${BULK_IMPORT_URL}${jobId}`;
39
- const message = `Uploading data to: ${fullUrl} for job ID: ${jobId}`;
40
- n8n_workflow_1.LoggerProxy.info(message);
41
- const jsonData = JSON.stringify(data);
42
- const messageData = `First element of uploaded data: ${jsonData[0]}`;
43
- n8n_workflow_1.LoggerProxy.info(messageData);
44
- const formData = {
45
- file: {
46
- value: Buffer.from(jsonData, 'utf8'),
47
- options: {
48
- filename: 'import-data.json',
49
- contentType: 'application/json',
50
- },
51
- },
52
- };
53
- n8n_workflow_1.LoggerProxy.info(`Uploading bulk import data to ${fullUrl}`);
54
- await context.helpers.requestWithAuthentication.call(context, models_1.LIME_CRM_API_CREDENTIAL_KEY, {
55
- method: 'POST',
56
- url: fullUrl,
57
- formData,
58
- });
59
- n8n_workflow_1.LoggerProxy.info(`Successfully uploaded data for job ID: ${jobId}`);
60
- }
61
- async function getBulkImportJobStatus(context, jobId) {
62
- n8n_workflow_1.LoggerProxy.info(`Fetching status for bulk import job ID: ${jobId}`);
63
- const response = await (0, commons_1.callLimeApi)(context, {
64
- method: 'GET',
65
- url: `${BULK_IMPORT_URL}${jobId}`,
66
- });
67
- if (!response.success) {
68
- throw new n8n_workflow_1.NodeApiError(context.getNode(), {
69
- message: 'The bulk import job status could not be retrieved.',
70
- description: `${JSON.stringify(response)}`,
71
- });
72
- }
73
- return response.data;
74
- }
75
- async function waitForBulkImportJob(context, jobId, pollIntervalMs = 2500) {
76
- let status = 'running';
77
- let response;
78
- while (['waiting_for_data', 'ready', 'running'].includes(status)) {
79
- await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
80
- n8n_workflow_1.LoggerProxy.info(`Polling bulk import job ID: ${jobId}`);
81
- response = await getBulkImportJobStatus(context, jobId);
82
- status = response.status;
83
- }
84
- return response;
85
- }
86
- //# sourceMappingURL=bulkimport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulkimport.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/transport/bulkimport.ts"],"names":[],"mapp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CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,2BAAY,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;YACtC,OAAO,EAAE,oDAAoD;YAC7D,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;SAC7C,CAAC,CAAC;IACP,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC;AAcM,KAAK,UAAU,oBAAoB,CACtC,OAA0B,EAC1B,KAAa,EACb,iBAAyB,IAAI;IAE7B,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,IAAI,QAA+B,CAAC;IAEpC,OAAO,CAAC,kBAAkB,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAE/D,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;QAEpE,0BAAM,CAAC,IAAI,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC;QACpD,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACxD,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,OAAO,QAAS,CAAC;AACrB,CAAC"}
@@ -1,6 +0,0 @@
1
- <svg viewBox="0 0 1025 1025" xmlns="http://www.w3.org/2000/svg" xml:space="preserve"><clipPath id="a"><path d="M.067.03h1024v1024H.067z"/></clipPath>
2
- <g clip-path="url(#a)"><path d="M92.466 480.888c0-257.059 208.718-465.779 465.78-465.779 257.101 0 465.821 208.72 465.821 465.779 0 133.713-55.806 271.139-193.404 385.355-166.779 138.45-390.389 157.35-736.149 134.525-102.653-6.785-117.502-24.319-64.469-63.444C196.74 814.277 92.466 720.157 92.466 480.888Z" style="fill:#a6efff"/>
3
- <clipPath id="b"><path d="M92.466 480.888c0-257.059 208.718-465.779 465.78-465.779 257.101 0 465.821 208.72 465.821 465.779 0 133.713-55.806 271.139-193.404 385.355-166.779 138.45-390.389 157.35-736.149 134.525-102.653-6.785-117.502-24.319-64.469-63.444C196.74 814.277 92.466 720.157 92.466 480.888Z"/></clipPath>
4
- <g clip-path="url(#b)"><path d="M-810.991 1517.47c-520.197-174.655 602.109-1999.19 1122.31-1824.54 520.198 174.652 347.26 364.038 243.982 791.188-103.277 427.149-846.091 1208-1366.29 1033.35Z" style="fill:#ffa6ea;filter:blur(200px)"/></g>
5
- <path d="M415.273 301.267c-40.49 0-73.342 32.894-73.342 73.385 0 40.489 32.852 73.342 73.342 73.342 40.489 0 73.384-32.853 73.384-73.342 0-40.491-32.895-73.385-73.384-73.385Zm168.017 96.552h175.653c12.8 0 23.168-10.368 23.168-23.167 0-12.801-10.368-23.168-23.168-23.168H583.29c-12.8 0-23.168 10.367-23.168 23.168 0 12.799 10.368 23.167 23.168 23.167Zm0 212.345h175.653c12.8 0 23.168-10.367 23.168-23.167 0-12.756-10.368-23.166-23.168-23.166H583.29c-12.8 0-23.168 10.41-23.168 23.166 0 12.8 10.368 23.167 23.168 23.167Zm-168.017-96.509c-40.49 0-73.342 32.853-73.342 73.342 0 40.49 32.852 73.385 73.342 73.385 40.489 0 73.384-32.895 73.384-73.385 0-40.489-32.895-73.342-73.384-73.342Z"
6
- style="fill:#fff"/></g></svg>
File without changes
@@ -1,18 +0,0 @@
1
- {
2
- "node": "n8n-nodes-base.fortnox",
3
- "nodeVersion": "1.0",
4
- "codexVersion": "1.0",
5
- "categories": ["Finance & Accounting"],
6
- "resources": {
7
- "credentialDocumentation": [
8
- {
9
- "url": "https://api.fortnox.se/developer/authorization"
10
- }
11
- ],
12
- "primaryDocumentation": [
13
- {
14
- "url": "https://api.fortnox.se/apidocs"
15
- }
16
- ]
17
- }
18
- }
@@ -1,102 +0,0 @@
1
- import {
2
- IDataObject,
3
- IExecuteFunctions,
4
- INodeExecutionData,
5
- INodeProperties,
6
- INodeType,
7
- INodeTypeDescription,
8
- NodeConnectionTypes,
9
- NodeOperationError,
10
- NodePropertyTypes,
11
- } from 'n8n-workflow';
12
-
13
- import { invoiceProperties, invoiceOperations } from './resources/invoice';
14
- import { FORTNOX_API_CREDENTIAL_KEY } from './commons';
15
- import { customerProperties, customerOperations } from './resources/customers';
16
-
17
- export class Fortnox implements INodeType {
18
- description: INodeTypeDescription = {
19
- displayName: 'Fortnox',
20
- name: 'fortnox',
21
- icon: 'file:fortnoxLogo.svg',
22
- group: ['transform'],
23
- version: 1,
24
- subtitle:
25
- '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
26
- description: 'Consume the Fortnox API',
27
- defaults: {
28
- name: 'Fortnox',
29
- },
30
- inputs: [NodeConnectionTypes.Main],
31
- outputs: [NodeConnectionTypes.Main],
32
- credentials: [
33
- {
34
- name: FORTNOX_API_CREDENTIAL_KEY,
35
- required: true,
36
- },
37
- ],
38
- properties: [
39
- {
40
- displayName: 'Resource',
41
- name: 'resource',
42
- type: 'options' as NodePropertyTypes,
43
- noDataExpression: true,
44
- options: [
45
- {
46
- name: 'Customer',
47
- value: 'customer',
48
- description: 'Work with customers',
49
- },
50
- {
51
- name: 'Invoice',
52
- value: 'invoice',
53
- description: 'Work with invoices',
54
- },
55
- ],
56
- default: 'customer',
57
- },
58
- ...(customerProperties as INodeProperties[]),
59
- ...(invoiceProperties as INodeProperties[]),
60
- ],
61
- };
62
-
63
- async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
64
- const items = this.getInputData();
65
- const returnData = [];
66
- let responseData;
67
-
68
- const resource = this.getNodeParameter('resource', 0) as string;
69
- const operation = this.getNodeParameter('operation', 0) as string;
70
-
71
- for (let i = 0; i < items.length; i++) {
72
- if (resource === 'customer') {
73
- responseData = await customerOperations.call(this, {
74
- operation,
75
- i,
76
- });
77
- } else if (resource === 'invoice') {
78
- responseData = await invoiceOperations.call(this, {
79
- operation,
80
- i,
81
- });
82
- } else {
83
- const errorLog = `The resource "${resource}" is not supported!`;
84
- if (this.continueOnFail()) {
85
- returnData.push({
86
- error: errorLog,
87
- json: { error: errorLog },
88
- });
89
- continue;
90
- }
91
- throw new NodeOperationError(this.getNode(), errorLog);
92
- }
93
-
94
- if (Array.isArray(responseData)) {
95
- returnData.push(...responseData);
96
- } else if (responseData !== undefined && responseData !== null) {
97
- returnData.push(responseData);
98
- }
99
- }
100
- return [this.helpers.returnJsonArray(returnData as IDataObject[])];
101
- }
102
- }
@@ -1,18 +0,0 @@
1
- {
2
- "node": "n8n-nodes-base.fortnoxTrigger",
3
- "nodeVersion": "1.0",
4
- "codexVersion": "1.0",
5
- "categories": ["Finance & Accounting"],
6
- "resources": {
7
- "credentialDocumentation": [
8
- {
9
- "url": "https://api.fortnox.se/developer/authorization"
10
- }
11
- ],
12
- "primaryDocumentation": [
13
- {
14
- "url": "https://www.fortnox.se/developer/guides-and-good-to-know/websockets"
15
- }
16
- ]
17
- }
18
- }