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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +4 -1
  3. package/dist/nodes/lime-crm/LimeCrmNode.node.js +3 -0
  4. package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -1
  5. package/dist/nodes/lime-crm/methods/getLimetypeProperties.d.ts +2 -0
  6. package/dist/nodes/lime-crm/methods/getLimetypeProperties.js +43 -0
  7. package/dist/nodes/lime-crm/methods/getLimetypeProperties.js.map +1 -1
  8. package/dist/nodes/lime-crm/methods/index.d.ts +2 -2
  9. package/dist/nodes/lime-crm/methods/index.js +4 -1
  10. package/dist/nodes/lime-crm/methods/index.js.map +1 -1
  11. package/dist/nodes/lime-crm/methods/resourceMapping.d.ts +1 -0
  12. package/dist/nodes/lime-crm/methods/resourceMapping.js +46 -0
  13. package/dist/nodes/lime-crm/methods/resourceMapping.js.map +1 -1
  14. package/dist/nodes/lime-crm/models/limetype.d.ts +1 -0
  15. package/dist/nodes/lime-crm/resources/data/index.d.ts +1 -1
  16. package/dist/nodes/lime-crm/resources/data/index.js +20 -0
  17. package/dist/nodes/lime-crm/resources/data/index.js.map +1 -1
  18. package/dist/nodes/lime-crm/resources/data/operations/bulkImportCommons.d.ts +5 -0
  19. package/dist/nodes/lime-crm/resources/data/operations/bulkImportCommons.js +230 -0
  20. package/dist/nodes/lime-crm/resources/data/operations/bulkImportCommons.js.map +1 -0
  21. package/dist/nodes/lime-crm/resources/data/operations/createManyObjects.operation.d.ts +9 -0
  22. package/dist/nodes/lime-crm/resources/data/operations/createManyObjects.operation.js +16 -0
  23. package/dist/nodes/lime-crm/resources/data/operations/createManyObjects.operation.js.map +1 -0
  24. package/dist/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.d.ts +9 -0
  25. package/dist/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.js +16 -0
  26. package/dist/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.js.map +1 -0
  27. package/dist/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.d.ts +9 -0
  28. package/dist/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.js +241 -0
  29. package/dist/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.js.map +1 -0
  30. package/dist/nodes/lime-crm/resources/data/operations/index.d.ts +4 -0
  31. package/dist/nodes/lime-crm/resources/data/operations/index.js +5 -1
  32. package/dist/nodes/lime-crm/resources/data/operations/index.js.map +1 -1
  33. package/dist/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.d.ts +9 -0
  34. package/dist/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.js +16 -0
  35. package/dist/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.js.map +1 -0
  36. package/dist/nodes/lime-crm/transport/bulkimport.d.ts +41 -0
  37. package/dist/nodes/lime-crm/transport/bulkimport.js +86 -0
  38. package/dist/nodes/lime-crm/transport/bulkimport.js.map +1 -0
  39. package/dist/nodes/lime-crm/transport/index.d.ts +1 -0
  40. package/dist/nodes/lime-crm/transport/index.js +6 -1
  41. package/dist/nodes/lime-crm/transport/index.js.map +1 -1
  42. package/dist/nodes/lime-crm/transport/limetypes.js +15 -4
  43. package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -1
  44. package/dist/tsconfig.tsbuildinfo +1 -1
  45. package/nodes/lime-crm/LimeCrmNode.node.ts +6 -0
  46. package/nodes/lime-crm/methods/getLimetypeProperties.ts +84 -0
  47. package/nodes/lime-crm/methods/index.ts +3 -0
  48. package/nodes/lime-crm/methods/resourceMapping.ts +76 -0
  49. package/nodes/lime-crm/models/limetype.ts +1 -0
  50. package/nodes/lime-crm/resources/data/index.ts +34 -1
  51. package/nodes/lime-crm/resources/data/operations/bulkImportCommons.ts +323 -0
  52. package/nodes/lime-crm/resources/data/operations/createManyObjects.operation.ts +44 -0
  53. package/nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.ts +44 -0
  54. package/nodes/lime-crm/resources/data/operations/deprecated-startBulkImport.operation.ts +364 -0
  55. package/nodes/lime-crm/resources/data/operations/index.ts +17 -0
  56. package/nodes/lime-crm/resources/data/operations/updateManyObjects.operation.ts +44 -0
  57. package/nodes/lime-crm/transport/bulkimport.ts +271 -0
  58. package/nodes/lime-crm/transport/index.ts +8 -0
  59. package/nodes/lime-crm/transport/limetypes.ts +26 -8
  60. package/package.json +1 -1
@@ -0,0 +1,16 @@
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: 'Create or Update Many Objects (Alpha)',
8
+ value: 'createOrUpdateManyObjects',
9
+ description: 'Create or update multiple objects via bulk import. Skips business logic.',
10
+ action: 'Create or update many objects (alpha)',
11
+ };
12
+ exports.properties = (0, bulkImportCommons_1.getBulkImportProperties)('createOrUpdateManyObjects', true);
13
+ async function execute(i) {
14
+ return (0, bulkImportCommons_1.executeBulkImport)(this, i, 'create_or_update');
15
+ }
16
+ //# sourceMappingURL=createOrUpdateManyObjects.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOrUpdateManyObjects.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/createOrUpdateManyObjects.operation.ts"],"names":[],"mappings":";;;AAsCA,0BAKC;AA1CD,2DAG6B;AAOhB,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,uCAAuC;IAC7C,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACP,0EAA0E;IAC9E,MAAM,EAAE,uCAAuC;CAClD,CAAC;AAOW,QAAA,UAAU,GAAsB,IAAA,2CAAuB,EAChE,2BAA2B,EAC3B,IAAI,CACP,CAAC;AAWK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,OAAO,IAAA,qCAAiB,EAAC,IAAI,EAAE,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,9 @@
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>;
@@ -0,0 +1,241 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated-startBulkImport.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime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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"}
@@ -4,3 +4,7 @@ export * as updateSingleObject from './updateSingleObject.operation';
4
4
  export * as deleteSingleObject from './deleteSingleObject.operation';
5
5
  export * as getManyObjects from './getManyObjects.operation';
6
6
  export * as getSingleFile from './getSingleFile.operation';
7
+ export * as createManyObjects from './createManyObjects.operation';
8
+ export * as updateManyObjects from './updateManyObjects.operation';
9
+ export * as createOrUpdateManyObjects from './createOrUpdateManyObjects.operation';
10
+ export * as startBulkImport from './deprecated-startBulkImport.operation';
@@ -33,11 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.getSingleFile = exports.getManyObjects = exports.deleteSingleObject = exports.updateSingleObject = exports.getSingleObject = exports.createSingleObject = void 0;
36
+ exports.startBulkImport = exports.createOrUpdateManyObjects = exports.updateManyObjects = exports.createManyObjects = exports.getSingleFile = exports.getManyObjects = exports.deleteSingleObject = exports.updateSingleObject = exports.getSingleObject = exports.createSingleObject = void 0;
37
37
  exports.createSingleObject = __importStar(require("./createSingleObject.operation"));
38
38
  exports.getSingleObject = __importStar(require("./getSingleObject.operation"));
39
39
  exports.updateSingleObject = __importStar(require("./updateSingleObject.operation"));
40
40
  exports.deleteSingleObject = __importStar(require("./deleteSingleObject.operation"));
41
41
  exports.getManyObjects = __importStar(require("./getManyObjects.operation"));
42
42
  exports.getSingleFile = __importStar(require("./getSingleFile.operation"));
43
+ exports.createManyObjects = __importStar(require("./createManyObjects.operation"));
44
+ exports.updateManyObjects = __importStar(require("./updateManyObjects.operation"));
45
+ exports.createOrUpdateManyObjects = __importStar(require("./createOrUpdateManyObjects.operation"));
46
+ exports.startBulkImport = __importStar(require("./deprecated-startBulkImport.operation"));
43
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,qFAAqE;AAIrE,+EAA+D;AAI/D,qFAAqE;AAIrE,qFAAqE;AAIrE,6EAA6D;AAI7D,2EAA2D"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,qFAAqE;AAIrE,+EAA+D;AAI/D,qFAAqE;AAIrE,qFAAqE;AAIrE,6EAA6D;AAI7D,2EAA2D;AAI3D,mFAAmE;AAInE,mFAAmE;AAInE,mGAAmF;AAKnF,0FAA0E"}
@@ -0,0 +1,9 @@
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>;
@@ -0,0 +1,16 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,41 @@
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>;
@@ -0,0 +1,86 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulkimport.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/transport/bulkimport.ts"],"names":[],"mappings":";;AAwHA,kDAgCC;AAcD,oDAyCC;AAaD,wDAkBC;AAcD,oDAkBC;AA9QD,+CAIsB;AACtB,uCAAwC;AACxC,sCAAwD;AAQxD,MAAM,eAAe,GAAG,yCAAyC,CAAC;AA0G3D,KAAK,UAAU,mBAAmB,CACrC,OAA0B,EAC1B,OAA6B;IAE7B,0BAAM,CAAC,IAAI,CACP,+BAA+B,eAAe,kBAAkB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAC5F,CAAC;IACF,IAAI,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAW,EAAwB,OAAO,EAAE;YAC/D,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,eAAe;YACpB,cAAc,EAAE;gBACZ,IAAI,EAAE,OAAO;aAChB;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,2BAAY,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;gBACtC,OAAO,EAAE,iDAAiD;gBAC1D,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;aAClD,CAAC,CAAC;QACP,CAAC;QACD,0BAAM,CAAC,IAAI,CACP,8BAA8B,eAAe,kBAAkB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAC3F,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,0BAAM,CAAC,KAAK,CACR,uCAAuC,eAAe,kBAAkB,IAAI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M,CAAC,IAAI,CAAC,2CAA2C,KAAK,EAAE,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAW,EAAwB,OAAO,EAAE;QAC/D,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,GAAG,eAAe,GAAG,KAAK,EAAE;KACpC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,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"}
@@ -5,3 +5,4 @@ export { IncludedProperties, QueryResponse, queryLimeobjects, } from './limeQuer
5
5
  export { LimetypeCrmApiResponse, LimetypePropertiesApiResponse, LimetypePropertyApiResponse, LimetypesCrmApiResponse, getLimetypesFromApi, getProperties, } from './limetypes';
6
6
  export { ApiResponseWebhook, createSubscription, deleteSubscription, getSubscription, listSubscriptionsWithExistingData, } from './webhooks';
7
7
  export { fetchManyUsers, fetchSingleUserById, fetchSingleUserByLimeobjectId, } from './users';
8
+ export { BulkImportJobResponse, BulkImportJobPayload, createBulkImportJob, uploadBulkImportData, getBulkImportJobStatus, waitForBulkImportJob, } from './bulkimport';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchSingleUserByLimeobjectId = exports.fetchSingleUserById = exports.fetchManyUsers = exports.listSubscriptionsWithExistingData = exports.getSubscription = exports.deleteSubscription = exports.createSubscription = exports.getProperties = exports.getLimetypesFromApi = exports.queryLimeobjects = exports.getLimeobject = exports.updateLimeobject = exports.deleteLimeobject = exports.createLimeobject = exports.getFileMetadataByLimeobject = exports.getFileMetadata = exports.getFileContentByLimetype = exports.getFileContent = exports.createFile = exports.removeKeys = exports.callLimeApi = void 0;
3
+ exports.waitForBulkImportJob = exports.getBulkImportJobStatus = exports.uploadBulkImportData = exports.createBulkImportJob = exports.fetchSingleUserByLimeobjectId = exports.fetchSingleUserById = exports.fetchManyUsers = exports.listSubscriptionsWithExistingData = exports.getSubscription = exports.deleteSubscription = exports.createSubscription = exports.getProperties = exports.getLimetypesFromApi = exports.queryLimeobjects = exports.getLimeobject = exports.updateLimeobject = exports.deleteLimeobject = exports.createLimeobject = exports.getFileMetadataByLimeobject = exports.getFileMetadata = exports.getFileContentByLimetype = exports.getFileContent = exports.createFile = exports.removeKeys = exports.callLimeApi = void 0;
4
4
  var commons_1 = require("./commons");
5
5
  Object.defineProperty(exports, "callLimeApi", { enumerable: true, get: function () { return commons_1.callLimeApi; } });
6
6
  Object.defineProperty(exports, "removeKeys", { enumerable: true, get: function () { return commons_1.removeKeys; } });
@@ -29,4 +29,9 @@ var users_1 = require("./users");
29
29
  Object.defineProperty(exports, "fetchManyUsers", { enumerable: true, get: function () { return users_1.fetchManyUsers; } });
30
30
  Object.defineProperty(exports, "fetchSingleUserById", { enumerable: true, get: function () { return users_1.fetchSingleUserById; } });
31
31
  Object.defineProperty(exports, "fetchSingleUserByLimeobjectId", { enumerable: true, get: function () { return users_1.fetchSingleUserByLimeobjectId; } });
32
+ var bulkimport_1 = require("./bulkimport");
33
+ Object.defineProperty(exports, "createBulkImportJob", { enumerable: true, get: function () { return bulkimport_1.createBulkImportJob; } });
34
+ Object.defineProperty(exports, "uploadBulkImportData", { enumerable: true, get: function () { return bulkimport_1.uploadBulkImportData; } });
35
+ Object.defineProperty(exports, "getBulkImportJobStatus", { enumerable: true, get: function () { return bulkimport_1.getBulkImportJobStatus; } });
36
+ Object.defineProperty(exports, "waitForBulkImportJob", { enumerable: true, get: function () { return bulkimport_1.waitForBulkImportJob; } });
32
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/transport/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgE;AAA3C,sGAAA,WAAW,OAAA;AAAE,qGAAA,UAAU,OAAA;AAC5C,iCAQiB;AALb,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,iHAAA,wBAAwB,OAAA;AACxB,wGAAA,eAAe,OAAA;AACf,oHAAA,2BAA2B,OAAA;AAE/B,6CAOuB;AAJnB,+GAAA,gBAAgB,OAAA;AAChB,+GAAA,gBAAgB,OAAA;AAChB,+GAAA,gBAAgB,OAAA;AAChB,4GAAA,aAAa,OAAA;AAEjB,yCAIqB;AADjB,6GAAA,gBAAgB,OAAA;AAEpB,yCAOqB;AAFjB,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AAEjB,uCAMoB;AAJhB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6HAAA,iCAAiC,OAAA;AAErC,iCAIiB;AAHb,uGAAA,cAAc,OAAA;AACd,4GAAA,mBAAmB,OAAA;AACnB,sHAAA,6BAA6B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/transport/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgE;AAA3C,sGAAA,WAAW,OAAA;AAAE,qGAAA,UAAU,OAAA;AAC5C,iCAQiB;AALb,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,iHAAA,wBAAwB,OAAA;AACxB,wGAAA,eAAe,OAAA;AACf,oHAAA,2BAA2B,OAAA;AAE/B,6CAOuB;AAJnB,+GAAA,gBAAgB,OAAA;AAChB,+GAAA,gBAAgB,OAAA;AAChB,+GAAA,gBAAgB,OAAA;AAChB,4GAAA,aAAa,OAAA;AAEjB,yCAIqB;AADjB,6GAAA,gBAAgB,OAAA;AAEpB,yCAOqB;AAFjB,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AAEjB,uCAMoB;AAJhB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6HAAA,iCAAiC,OAAA;AAErC,iCAIiB;AAHb,uGAAA,cAAc,OAAA;AACd,4GAAA,mBAAmB,OAAA;AACnB,sHAAA,6BAA6B,OAAA;AAEjC,2CAOsB;AAJlB,iHAAA,mBAAmB,OAAA;AACnB,kHAAA,oBAAoB,OAAA;AACpB,oHAAA,sBAAsB,OAAA;AACtB,kHAAA,oBAAoB,OAAA"}
@@ -12,6 +12,18 @@ function deserializeLimetype(limetype) {
12
12
  properties: limetype._embedded.properties.map((property) => (0, commons_1.removeKeys)(property, ['_links'])),
13
13
  };
14
14
  }
15
+ function getRelatedLimetypeName(property) {
16
+ var _a;
17
+ const links = property._links;
18
+ return (_a = links === null || links === void 0 ? void 0 : links.related_type) === null || _a === void 0 ? void 0 : _a.name;
19
+ }
20
+ function deserializeLimetypeProperty(property) {
21
+ const relatedLimetype = getRelatedLimetypeName(property);
22
+ return {
23
+ ...(0, commons_1.removeKeys)(property, ['_links', '_embedded']),
24
+ ...(relatedLimetype ? { relatedLimetype } : {}),
25
+ };
26
+ }
15
27
  async function getLimetypesFromApi(nodeContext) {
16
28
  var _a;
17
29
  const response = await (0, _1.callLimeApi)(nodeContext, {
@@ -56,6 +68,7 @@ async function getLimetype(nodeContext, limetype) {
56
68
  }
57
69
  }
58
70
  async function getProperties(nodeContext, limetype) {
71
+ var _a, _b;
59
72
  const url = `${LIMETYPE_URL}${limetype}/`;
60
73
  const response = await (0, _1.callLimeApi)(nodeContext, {
61
74
  method: 'GET',
@@ -70,12 +83,10 @@ async function getProperties(nodeContext, limetype) {
70
83
  },
71
84
  });
72
85
  if (response.success) {
86
+ const properties = (_b = (_a = response.data._embedded) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : [];
73
87
  return {
74
88
  success: true,
75
- data: response.data._embedded.properties.map((property) => (0, commons_1.removeKeys)(property, [
76
- '_links',
77
- '_embedded',
78
- ])) || [],
89
+ data: properties.map(deserializeLimetypeProperty),
79
90
  };
80
91
  }
81
92
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"limetypes.js","sourceRoot":"","sources":["../../../../nodes/lime-crm/transport/limetypes.ts"],"names":[],"mappings":";;AAkHA,kDAsBC;AAYD,kCAsBC;AAYD,sCAmCC;AAzND,wBAAgC;AAEhC,uCAAuC;AAUvC,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAoFzC,SAAS,mBAAmB,CAAC,QAAgC;IACzD,OAAO;QACH,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAChD,UAAU,EAAE,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACvD,IAAA,oBAAU,EAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CACnC;KACQ,CAAC;AAClB,CAAC;AAWM,KAAK,UAAU,mBAAmB,CAC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