n8n-nodes-hudu 1.4.1 → 1.4.3
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.
- package/README.md +9 -3
- package/dist/nodes/Hudu/Hudu.node.js +2 -2
- package/dist/nodes/Hudu/Hudu.node.js.map +1 -1
- package/dist/nodes/Hudu/Hudu.node.ts +410 -413
- package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.ts +450 -450
- package/dist/nodes/Hudu/descriptions/assets.description.ts +587 -587
- package/dist/nodes/Hudu/descriptions/magic_dash.description.js +9 -21
- package/dist/nodes/Hudu/descriptions/magic_dash.description.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/magic_dash.description.ts +270 -282
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.ts +290 -290
- package/dist/nodes/Hudu/optionLoaders/index.ts +4 -4
- package/dist/nodes/Hudu/resources/assets/assets.handler.ts +345 -345
- package/dist/nodes/Hudu/resources/assets/assets.types.ts +43 -43
- package/dist/nodes/Hudu/resources/magic_dash/magic_dash.handler.js +8 -14
- package/dist/nodes/Hudu/resources/magic_dash/magic_dash.handler.js.map +1 -1
- package/dist/nodes/Hudu/resources/magic_dash/magic_dash.handler.ts +85 -85
- package/dist/nodes/Hudu/resources/magic_dash/magic_dash.types.ts +1 -1
- package/dist/nodes/Hudu/resources/public_photos/public_photos.handler.ts +153 -153
- package/dist/nodes/Hudu/utils/debugConfig.js +3 -3
- package/dist/nodes/Hudu/utils/debugConfig.js.map +1 -1
- package/dist/nodes/Hudu/utils/debugConfig.ts +3 -3
- package/dist/nodes/Hudu/utils/index.ts +24 -24
- package/dist/nodes/Hudu/utils/operations/magic_dash.js +4 -13
- package/dist/nodes/Hudu/utils/operations/magic_dash.js.map +1 -1
- package/dist/nodes/Hudu/utils/operations/magic_dash.ts +68 -85
- package/dist/nodes/Hudu/utils/operations/matchers.js +1 -11
- package/dist/nodes/Hudu/utils/operations/matchers.js.map +1 -1
- package/dist/nodes/Hudu/utils/operations/matchers.ts +7 -17
- package/dist/nodes/Hudu/utils/requestUtils.ts +490 -490
- package/package.json +1 -1
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/* eslint-disable n8n-nodes-base/node-class-description-inputs-wrong-regular-node */
|
|
2
|
-
import type {
|
|
3
|
-
IExecuteFunctions,
|
|
4
|
-
INodeExecutionData,
|
|
5
|
-
INodeType,
|
|
6
|
-
INodeTypeDescription,
|
|
7
|
-
IDataObject,
|
|
8
|
-
ILoadOptionsFunctions,
|
|
9
|
-
INodePropertyOptions,
|
|
10
|
-
} from 'n8n-workflow';
|
|
11
2
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
IExecuteFunctions,
|
|
4
|
+
INodeExecutionData,
|
|
5
|
+
INodeType,
|
|
6
|
+
INodeTypeDescription,
|
|
7
|
+
IDataObject,
|
|
8
|
+
ILoadOptionsFunctions,
|
|
9
|
+
INodePropertyOptions,
|
|
10
|
+
NodeOperationError,
|
|
14
11
|
} from 'n8n-workflow';
|
|
15
12
|
import { DEBUG_CONFIG, debugLog } from './utils/debugConfig';
|
|
16
13
|
|
|
@@ -28,419 +25,419 @@ import { getAssetsForCompany } from './optionLoaders/assets/getAssetsForCompany'
|
|
|
28
25
|
import { mapAssetLayoutFieldsForResource } from './optionLoaders/asset_layouts/getAssetLayoutFields';
|
|
29
26
|
|
|
30
27
|
export class Hudu implements INodeType {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
28
|
+
description: INodeTypeDescription = {
|
|
29
|
+
displayName: 'Hudu',
|
|
30
|
+
name: 'hudu',
|
|
31
|
+
icon: 'file:hudu.svg',
|
|
32
|
+
group: ['transform'],
|
|
33
|
+
version: 1,
|
|
34
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
35
|
+
description: 'Interact with Hudu REST API',
|
|
36
|
+
defaults: {
|
|
37
|
+
name: 'Hudu',
|
|
38
|
+
},
|
|
39
|
+
usableAsTool: true,
|
|
40
|
+
inputs: ['main'],
|
|
41
|
+
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
|
|
42
|
+
outputs: ['main'],
|
|
43
|
+
|
|
44
|
+
credentials: [
|
|
45
|
+
{
|
|
46
|
+
name: 'huduApi',
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
codex: {
|
|
51
|
+
categories: ['Communication'],
|
|
52
|
+
subcategories: {
|
|
53
|
+
Communication: ['Documentation']
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
requestDefaults: {
|
|
57
|
+
baseURL: '={{$credentials.baseUrl}}/api/v1',
|
|
58
|
+
headers: {
|
|
59
|
+
'x-api-key': '={{$credentials.apiKey}}',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
properties: [
|
|
63
|
+
resourceProperty,
|
|
64
|
+
// Operations
|
|
65
|
+
...descriptions.activityLogsOperations,
|
|
66
|
+
...descriptions.apiInfoOperations,
|
|
67
|
+
...descriptions.articlesOperations,
|
|
68
|
+
...descriptions.assetLayoutOperations,
|
|
69
|
+
...descriptions.assetLayoutFieldOperations,
|
|
70
|
+
...descriptions.assetPasswordOperations,
|
|
71
|
+
...descriptions.assetsOperations,
|
|
72
|
+
...descriptions.cardsOperations,
|
|
73
|
+
...descriptions.companiesOperations,
|
|
74
|
+
...descriptions.expirationsOperations,
|
|
75
|
+
...descriptions.folderOperations,
|
|
76
|
+
...descriptions.ipAddressOperations,
|
|
77
|
+
...descriptions.listOptionsOperations,
|
|
78
|
+
...descriptions.listsOperations,
|
|
79
|
+
...descriptions.magicDashOperations,
|
|
80
|
+
...descriptions.matchersOperations,
|
|
81
|
+
...descriptions.networksOperations,
|
|
82
|
+
...descriptions.passwordFoldersOperations,
|
|
83
|
+
...descriptions.proceduresOperations,
|
|
84
|
+
...descriptions.procedureTasksOperations,
|
|
85
|
+
...descriptions.publicPhotosOperations,
|
|
86
|
+
...descriptions.rackStorageOperations,
|
|
87
|
+
...descriptions.rackStorageItemOperations,
|
|
88
|
+
...descriptions.relationsOperations,
|
|
89
|
+
...descriptions.uploadsOperations,
|
|
90
|
+
...descriptions.userOperations,
|
|
91
|
+
...descriptions.websitesOperations,
|
|
92
|
+
...descriptions.vlansOperations,
|
|
93
|
+
...descriptions.vlanZonesOperations,
|
|
94
|
+
// Fields
|
|
95
|
+
...descriptions.activityLogsFields,
|
|
96
|
+
...descriptions.apiInfoFields,
|
|
97
|
+
...descriptions.articlesFields,
|
|
98
|
+
...descriptions.assetLayoutFields,
|
|
99
|
+
...descriptions.assetLayoutUpdateFields,
|
|
100
|
+
...descriptions.assetLayoutManageFields,
|
|
101
|
+
...descriptions.assetLayoutFieldFields,
|
|
102
|
+
...descriptions.assetPasswordFields,
|
|
103
|
+
...descriptions.assetsFields,
|
|
104
|
+
...descriptions.cardsFields,
|
|
105
|
+
...descriptions.companiesFields,
|
|
106
|
+
...descriptions.expirationsFields,
|
|
107
|
+
...descriptions.folderFields,
|
|
108
|
+
...descriptions.ipAddressFields,
|
|
109
|
+
...descriptions.listOptionsFields,
|
|
110
|
+
...descriptions.listsFields,
|
|
111
|
+
...descriptions.magicDashFields,
|
|
112
|
+
...descriptions.matchersFields,
|
|
113
|
+
...descriptions.networksFields,
|
|
114
|
+
...descriptions.passwordFoldersFields,
|
|
115
|
+
...descriptions.proceduresFields,
|
|
116
|
+
...descriptions.procedureTasksFields,
|
|
117
|
+
...descriptions.publicPhotosFields,
|
|
118
|
+
...descriptions.rackStorageFields,
|
|
119
|
+
...descriptions.rackStorageItemFields,
|
|
120
|
+
...descriptions.relationsFields,
|
|
121
|
+
...descriptions.uploadsFields,
|
|
122
|
+
...descriptions.userFields,
|
|
123
|
+
...descriptions.websitesFields,
|
|
124
|
+
...descriptions.vlansFields,
|
|
125
|
+
...descriptions.vlanZonesFields,
|
|
126
|
+
],
|
|
127
|
+
};
|
|
131
128
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
129
|
+
methods = {
|
|
130
|
+
loadOptions: {
|
|
131
|
+
getUsers: optionLoaders.getUsers,
|
|
132
|
+
getCompanies: optionLoaders.getCompanies,
|
|
133
|
+
getAssetLayouts: optionLoaders.getAssetLayouts,
|
|
134
|
+
getAssetLayoutFields: optionLoaders.getAssetLayoutFields,
|
|
135
|
+
getAssetLayoutFieldValues: optionLoaders.getAssetLayoutFieldValues,
|
|
136
|
+
getAssets,
|
|
137
|
+
getAssetsForCompany,
|
|
138
|
+
getCustomFieldsLayoutFields: optionLoaders.getCustomFieldsLayoutFields,
|
|
139
|
+
getLists: optionLoaders.getLists,
|
|
140
|
+
async getStandardAssetFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
|
141
|
+
return [
|
|
142
|
+
{ name: 'Name', value: 'name' },
|
|
143
|
+
{ name: 'Archived', value: 'archived' },
|
|
144
|
+
{ name: 'Primary Serial', value: 'primary_serial' },
|
|
145
|
+
{ name: 'Primary Model', value: 'primary_model' },
|
|
146
|
+
{ name: 'Primary Manufacturer', value: 'primary_manufacturer' },
|
|
147
|
+
{ name: 'Primary Mail', value: 'primary_mail' },
|
|
148
|
+
];
|
|
149
|
+
},
|
|
150
|
+
async getBinaryProperties(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
|
151
|
+
const items = (this as any).getInputData?.() || [];
|
|
152
|
+
const item = items[0];
|
|
153
|
+
if (!item || !item.binary) {
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
return Object.keys(item.binary).map((key) => ({
|
|
157
|
+
name: key,
|
|
158
|
+
value: key,
|
|
159
|
+
}));
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
resourceMapping: {
|
|
163
|
+
mapAssetLayoutFieldsForResource,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
169
166
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
167
|
+
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
168
|
+
const items = this.getInputData();
|
|
169
|
+
const returnData: INodeExecutionData[] = [];
|
|
173
170
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
if (DEBUG_CONFIG.NODE_INPUT) {
|
|
172
|
+
debugLog('Node Execution - Input Items', {
|
|
173
|
+
itemCount: items.length,
|
|
174
|
+
items,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
180
177
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
178
|
+
for (let i = 0; i < items.length; i++) {
|
|
179
|
+
try {
|
|
180
|
+
const resource = this.getNodeParameter('resource', i) as string;
|
|
181
|
+
const operation = this.getNodeParameter('operation', i) as string;
|
|
185
182
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
183
|
+
if (DEBUG_CONFIG.NODE_INPUT) {
|
|
184
|
+
debugLog(`Node Execution - Item ${i}`, {
|
|
185
|
+
resource,
|
|
186
|
+
operation,
|
|
187
|
+
itemData: items[i],
|
|
188
|
+
});
|
|
189
|
+
}
|
|
193
190
|
|
|
194
|
-
|
|
191
|
+
let responseData: IDataObject | IDataObject[] = {};
|
|
195
192
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
193
|
+
switch (resource) {
|
|
194
|
+
case 'activity_logs':
|
|
195
|
+
responseData = await resources.handleActivityLogsOperation.call(
|
|
196
|
+
this,
|
|
197
|
+
operation as resources.ActivityLogsOperation,
|
|
198
|
+
i,
|
|
199
|
+
);
|
|
200
|
+
break;
|
|
201
|
+
case 'api_info':
|
|
202
|
+
responseData = await resources.handleApiInfoOperation.call(
|
|
203
|
+
this,
|
|
204
|
+
operation as resources.ApiInfoOperation,
|
|
205
|
+
);
|
|
206
|
+
break;
|
|
207
|
+
case 'articles':
|
|
208
|
+
responseData = await resources.handleArticlesOperation.call(
|
|
209
|
+
this,
|
|
210
|
+
operation as resources.ArticlesOperation,
|
|
211
|
+
i,
|
|
212
|
+
);
|
|
213
|
+
break;
|
|
214
|
+
case 'asset_layouts':
|
|
215
|
+
responseData = await resources.handleAssetLayoutOperation.call(
|
|
216
|
+
this,
|
|
217
|
+
operation as resources.AssetLayoutOperation,
|
|
218
|
+
i,
|
|
219
|
+
);
|
|
220
|
+
break;
|
|
221
|
+
case 'asset_layout_fields':
|
|
222
|
+
responseData = await resources.handleAssetLayoutFieldOperation.call(
|
|
223
|
+
this,
|
|
224
|
+
operation as resources.AssetLayoutFieldOperation,
|
|
225
|
+
i,
|
|
226
|
+
);
|
|
227
|
+
break;
|
|
228
|
+
case 'asset_passwords':
|
|
229
|
+
responseData = await resources.handleAssetPasswordOperation.call(
|
|
230
|
+
this,
|
|
231
|
+
operation as resources.AssetPasswordOperation,
|
|
232
|
+
i,
|
|
233
|
+
);
|
|
234
|
+
break;
|
|
235
|
+
case 'assets':
|
|
236
|
+
responseData = await resources.handleAssetsOperation.call(
|
|
237
|
+
this,
|
|
238
|
+
operation as resources.AssetsOperations,
|
|
239
|
+
i,
|
|
240
|
+
);
|
|
241
|
+
break;
|
|
242
|
+
case 'cards':
|
|
243
|
+
responseData = await resources.handleCardOperation.call(
|
|
244
|
+
this,
|
|
245
|
+
operation as resources.CardsOperation,
|
|
246
|
+
i,
|
|
247
|
+
);
|
|
248
|
+
break;
|
|
249
|
+
case 'companies':
|
|
250
|
+
responseData = await resources.handleCompaniesOperation.call(
|
|
251
|
+
this,
|
|
252
|
+
operation as resources.CompaniesOperations,
|
|
253
|
+
i,
|
|
254
|
+
);
|
|
255
|
+
break;
|
|
256
|
+
case 'expirations':
|
|
257
|
+
responseData = await resources.handleExpirationOperation.call(
|
|
258
|
+
this,
|
|
259
|
+
operation as resources.ExpirationsOperations,
|
|
260
|
+
i,
|
|
261
|
+
);
|
|
262
|
+
break;
|
|
263
|
+
case 'folders':
|
|
264
|
+
responseData = await resources.handleFolderOperation.call(
|
|
265
|
+
this,
|
|
266
|
+
operation as resources.FolderOperation,
|
|
267
|
+
i,
|
|
268
|
+
);
|
|
269
|
+
break;
|
|
270
|
+
case 'ipAddresses':
|
|
271
|
+
responseData = await resources.handleIpAddressesOperation.call(
|
|
272
|
+
this,
|
|
273
|
+
operation as resources.IpAddressOperations,
|
|
274
|
+
i,
|
|
275
|
+
);
|
|
276
|
+
break;
|
|
277
|
+
case 'list_options':
|
|
278
|
+
responseData = await resources.handleListOptionsOperation.call(
|
|
279
|
+
this,
|
|
280
|
+
operation as resources.ListOptionsOperation,
|
|
281
|
+
i,
|
|
282
|
+
);
|
|
283
|
+
break;
|
|
284
|
+
case 'lists':
|
|
285
|
+
responseData = await resources.handleListsOperation.call(
|
|
286
|
+
this,
|
|
287
|
+
operation as resources.ListsOperation,
|
|
288
|
+
i,
|
|
289
|
+
);
|
|
290
|
+
break;
|
|
291
|
+
case 'magic_dash':
|
|
292
|
+
responseData = await resources.handleMagicDashOperation.call(
|
|
293
|
+
this,
|
|
294
|
+
operation as resources.MagicDashOperation,
|
|
295
|
+
i,
|
|
296
|
+
);
|
|
297
|
+
break;
|
|
298
|
+
case 'matchers':
|
|
299
|
+
responseData = await resources.handleMatcherOperation.call(
|
|
300
|
+
this,
|
|
301
|
+
operation as resources.MatcherOperation,
|
|
302
|
+
i,
|
|
303
|
+
);
|
|
304
|
+
break;
|
|
305
|
+
case 'networks':
|
|
306
|
+
responseData = await resources.handleNetworksOperation.call(
|
|
307
|
+
this,
|
|
308
|
+
operation as resources.NetworksOperations,
|
|
309
|
+
i,
|
|
310
|
+
);
|
|
311
|
+
break;
|
|
312
|
+
case 'password_folders':
|
|
313
|
+
responseData = await resources.handlePasswordFoldersOperation.call(
|
|
314
|
+
this,
|
|
315
|
+
operation as resources.PasswordFoldersOperations,
|
|
316
|
+
i,
|
|
317
|
+
);
|
|
318
|
+
break;
|
|
319
|
+
case 'procedures':
|
|
320
|
+
responseData = await resources.handleProceduresOperation.call(
|
|
321
|
+
this,
|
|
322
|
+
operation as resources.ProceduresOperations,
|
|
323
|
+
i,
|
|
324
|
+
);
|
|
325
|
+
break;
|
|
326
|
+
case 'procedure_tasks':
|
|
327
|
+
responseData = await resources.handleProcedureTasksOperation.call(
|
|
328
|
+
this,
|
|
329
|
+
operation as resources.ProcedureTasksOperations,
|
|
330
|
+
i,
|
|
331
|
+
);
|
|
332
|
+
break;
|
|
333
|
+
case 'public_photos':
|
|
334
|
+
responseData = await resources.handlePublicPhotoOperation.call(
|
|
335
|
+
this,
|
|
336
|
+
operation as resources.PublicPhotoOperation,
|
|
337
|
+
i,
|
|
338
|
+
);
|
|
339
|
+
break;
|
|
340
|
+
case 'rack_storages':
|
|
341
|
+
responseData = await resources.handleRackStorageOperation.call(
|
|
342
|
+
this,
|
|
343
|
+
operation as resources.RackStorageOperation,
|
|
344
|
+
i,
|
|
345
|
+
);
|
|
346
|
+
break;
|
|
347
|
+
case 'rack_storage_items':
|
|
348
|
+
responseData = await resources.handleRackStorageItemOperation.call(
|
|
349
|
+
this,
|
|
350
|
+
operation as resources.RackStorageItemOperation,
|
|
351
|
+
i,
|
|
352
|
+
);
|
|
353
|
+
break;
|
|
354
|
+
case 'relations':
|
|
355
|
+
responseData = await resources.handleRelationsOperation.call(
|
|
356
|
+
this,
|
|
357
|
+
operation as resources.RelationOperation,
|
|
358
|
+
i,
|
|
359
|
+
);
|
|
360
|
+
break;
|
|
361
|
+
case 'uploads':
|
|
362
|
+
responseData = await resources.handleUploadOperation.call(
|
|
363
|
+
this,
|
|
364
|
+
operation as resources.UploadOperation,
|
|
365
|
+
i,
|
|
366
|
+
);
|
|
367
|
+
break;
|
|
368
|
+
case 'users':
|
|
369
|
+
responseData = await resources.handleUserOperation.call(
|
|
370
|
+
this,
|
|
371
|
+
operation as resources.UserOperation,
|
|
372
|
+
i,
|
|
373
|
+
);
|
|
374
|
+
break;
|
|
375
|
+
case 'websites':
|
|
376
|
+
responseData = await resources.handleWebsitesOperation.call(
|
|
377
|
+
this,
|
|
378
|
+
operation as resources.WebsiteOperation,
|
|
379
|
+
i,
|
|
380
|
+
);
|
|
381
|
+
break;
|
|
382
|
+
case 'vlans':
|
|
383
|
+
responseData = await resources.handleVlansOperation.call(
|
|
384
|
+
this,
|
|
385
|
+
operation as resources.VlanOperation,
|
|
386
|
+
i,
|
|
387
|
+
);
|
|
388
|
+
break;
|
|
389
|
+
case 'vlan_zones':
|
|
390
|
+
responseData = await resources.handleVlanZonesOperation.call(
|
|
391
|
+
this,
|
|
392
|
+
operation as resources.VlanZoneOperation,
|
|
393
|
+
i,
|
|
394
|
+
);
|
|
395
|
+
break;
|
|
396
|
+
default:
|
|
397
|
+
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`);
|
|
398
|
+
}
|
|
402
399
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
400
|
+
const executionData = this.helpers.returnJsonArray(responseData).map((item) => ({
|
|
401
|
+
...item,
|
|
402
|
+
pairedItem: { item: i },
|
|
403
|
+
}));
|
|
407
404
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
405
|
+
if (DEBUG_CONFIG.NODE_OUTPUT) {
|
|
406
|
+
debugLog(`Node Execution - Item ${i} Output`, {
|
|
407
|
+
executionData,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
413
410
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
411
|
+
returnData.push(...executionData);
|
|
412
|
+
} catch (error) {
|
|
413
|
+
if (DEBUG_CONFIG.NODE_OUTPUT) {
|
|
414
|
+
debugLog(`Node Execution - Item ${i} Error`, {
|
|
415
|
+
error,
|
|
416
|
+
message: error instanceof Error ? error.message : String(error),
|
|
417
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
418
|
+
level: 'error',
|
|
419
|
+
});
|
|
420
|
+
}
|
|
424
421
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
422
|
+
if (this.continueOnFail()) {
|
|
423
|
+
const executionErrorData = this.helpers.returnJsonArray({ error: error.message }).map((item: IDataObject) => ({
|
|
424
|
+
json: item,
|
|
425
|
+
pairedItem: { item: i },
|
|
426
|
+
}));
|
|
427
|
+
returnData.push(...executionErrorData);
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
throw error;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
436
433
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
if (DEBUG_CONFIG.NODE_OUTPUT) {
|
|
435
|
+
debugLog('Node Execution - Final Output', {
|
|
436
|
+
returnDataCount: returnData.length,
|
|
437
|
+
returnData,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
443
440
|
|
|
444
|
-
|
|
445
|
-
|
|
441
|
+
return [returnData];
|
|
442
|
+
}
|
|
446
443
|
}
|