n8n-nodes-proiectro 0.1.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 (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/dist/credentials/ProiectroApi.credentials.d.ts +13 -0
  4. package/dist/credentials/ProiectroApi.credentials.js +52 -0
  5. package/dist/credentials/proiectro.svg +44 -0
  6. package/dist/nodes/Proiectro/Proiectro.node.d.ts +17 -0
  7. package/dist/nodes/Proiectro/Proiectro.node.js +1865 -0
  8. package/dist/nodes/Proiectro/ProiectroTrigger.node.d.ts +12 -0
  9. package/dist/nodes/Proiectro/ProiectroTrigger.node.js +214 -0
  10. package/dist/nodes/Proiectro/descriptions/ContactDescription.d.ts +3 -0
  11. package/dist/nodes/Proiectro/descriptions/ContactDescription.js +157 -0
  12. package/dist/nodes/Proiectro/descriptions/CustomerDescription.d.ts +3 -0
  13. package/dist/nodes/Proiectro/descriptions/CustomerDescription.js +152 -0
  14. package/dist/nodes/Proiectro/descriptions/LabelDescription.d.ts +3 -0
  15. package/dist/nodes/Proiectro/descriptions/LabelDescription.js +370 -0
  16. package/dist/nodes/Proiectro/descriptions/OperationalWorkItemDescription.d.ts +3 -0
  17. package/dist/nodes/Proiectro/descriptions/OperationalWorkItemDescription.js +261 -0
  18. package/dist/nodes/Proiectro/descriptions/PaymentDescription.d.ts +3 -0
  19. package/dist/nodes/Proiectro/descriptions/PaymentDescription.js +163 -0
  20. package/dist/nodes/Proiectro/descriptions/ProcessDefinitionDescription.d.ts +3 -0
  21. package/dist/nodes/Proiectro/descriptions/ProcessDefinitionDescription.js +127 -0
  22. package/dist/nodes/Proiectro/descriptions/ProjectDescription.d.ts +3 -0
  23. package/dist/nodes/Proiectro/descriptions/ProjectDescription.js +48 -0
  24. package/dist/nodes/Proiectro/descriptions/ProposalDescription.d.ts +3 -0
  25. package/dist/nodes/Proiectro/descriptions/ProposalDescription.js +460 -0
  26. package/dist/nodes/Proiectro/descriptions/ResourceDescription.d.ts +3 -0
  27. package/dist/nodes/Proiectro/descriptions/ResourceDescription.js +119 -0
  28. package/dist/nodes/Proiectro/descriptions/SupportRequestDescription.d.ts +3 -0
  29. package/dist/nodes/Proiectro/descriptions/SupportRequestDescription.js +237 -0
  30. package/dist/nodes/Proiectro/descriptions/TagDescription.d.ts +3 -0
  31. package/dist/nodes/Proiectro/descriptions/TagDescription.js +235 -0
  32. package/dist/nodes/Proiectro/descriptions/TeamMemberDescription.d.ts +3 -0
  33. package/dist/nodes/Proiectro/descriptions/TeamMemberDescription.js +166 -0
  34. package/dist/nodes/Proiectro/descriptions/WebhookDescription.d.ts +3 -0
  35. package/dist/nodes/Proiectro/descriptions/WebhookDescription.js +118 -0
  36. package/dist/nodes/Proiectro/descriptions/WorkItemDescription.d.ts +3 -0
  37. package/dist/nodes/Proiectro/descriptions/WorkItemDescription.js +288 -0
  38. package/dist/nodes/Proiectro/proiectro.svg +44 -0
  39. package/package.json +45 -0
@@ -0,0 +1,1865 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Proiectro = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const ContactDescription_1 = require("./descriptions/ContactDescription");
6
+ const CustomerDescription_1 = require("./descriptions/CustomerDescription");
7
+ const LabelDescription_1 = require("./descriptions/LabelDescription");
8
+ const OperationalWorkItemDescription_1 = require("./descriptions/OperationalWorkItemDescription");
9
+ const PaymentDescription_1 = require("./descriptions/PaymentDescription");
10
+ const ProcessDefinitionDescription_1 = require("./descriptions/ProcessDefinitionDescription");
11
+ const ProjectDescription_1 = require("./descriptions/ProjectDescription");
12
+ const ProposalDescription_1 = require("./descriptions/ProposalDescription");
13
+ const ResourceDescription_1 = require("./descriptions/ResourceDescription");
14
+ const SupportRequestDescription_1 = require("./descriptions/SupportRequestDescription");
15
+ const TagDescription_1 = require("./descriptions/TagDescription");
16
+ const TeamMemberDescription_1 = require("./descriptions/TeamMemberDescription");
17
+ const WebhookDescription_1 = require("./descriptions/WebhookDescription");
18
+ const WorkItemDescription_1 = require("./descriptions/WorkItemDescription");
19
+ class Proiectro {
20
+ description = {
21
+ displayName: 'Proiect.ro',
22
+ name: 'proiectro',
23
+ icon: 'file:proiectro.svg',
24
+ group: ['transform'],
25
+ version: 1,
26
+ usableAsTool: true,
27
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
28
+ description: 'Automate your business workflows with Proiectro',
29
+ defaults: {
30
+ name: 'Proiect.ro',
31
+ },
32
+ inputs: ['main'],
33
+ outputs: ['main'],
34
+ credentials: [
35
+ {
36
+ name: 'proiectroApi',
37
+ required: true,
38
+ },
39
+ ],
40
+ properties: [
41
+ {
42
+ displayName: 'Resource',
43
+ name: 'resource',
44
+ type: 'options',
45
+ noDataExpression: true,
46
+ options: [
47
+ {
48
+ name: 'Contact',
49
+ value: 'contact',
50
+ description: 'Manage contacts within organizations',
51
+ },
52
+ {
53
+ name: 'Customer',
54
+ value: 'customer',
55
+ description: 'Manage customers (organizations)',
56
+ },
57
+ {
58
+ name: 'Label',
59
+ value: 'label',
60
+ description: 'Manage labels (key-value pairs) and attach them to entities',
61
+ },
62
+ {
63
+ name: 'Operational Work Item',
64
+ value: 'operationalWorkItem',
65
+ description: 'Items that flow through business processes',
66
+ },
67
+ {
68
+ name: 'Payment',
69
+ value: 'payment',
70
+ description: 'Manage payment records',
71
+ },
72
+ {
73
+ name: 'Process Definition',
74
+ value: 'processDefinition',
75
+ description: 'Manage operational process definitions',
76
+ },
77
+ {
78
+ name: 'Project',
79
+ value: 'project',
80
+ description: 'Manage projects',
81
+ },
82
+ {
83
+ name: 'Proposal',
84
+ value: 'proposal',
85
+ description: 'Manage proposals and quotes',
86
+ },
87
+ {
88
+ name: 'Resource',
89
+ value: 'resource',
90
+ description: 'Manage resources (people, equipment, facilities)',
91
+ },
92
+ {
93
+ name: 'Support Request',
94
+ value: 'supportRequest',
95
+ description: 'Manage internal support requests',
96
+ },
97
+ {
98
+ name: 'Tag',
99
+ value: 'tag',
100
+ description: 'Manage tags and attach them to entities',
101
+ },
102
+ {
103
+ name: 'Team Member',
104
+ value: 'teamMember',
105
+ description: 'Manage team members in the workspace',
106
+ },
107
+ {
108
+ name: 'Webhook',
109
+ value: 'webhook',
110
+ description: 'Manage webhook subscriptions',
111
+ },
112
+ {
113
+ name: 'Work Item',
114
+ value: 'workItem',
115
+ description: 'Manage project work items (tasks/deliverables)',
116
+ },
117
+ ],
118
+ default: 'contact',
119
+ },
120
+ ...ContactDescription_1.contactOperations,
121
+ ...ContactDescription_1.contactFields,
122
+ ...CustomerDescription_1.customerOperations,
123
+ ...CustomerDescription_1.customerFields,
124
+ ...LabelDescription_1.labelOperations,
125
+ ...LabelDescription_1.labelFields,
126
+ ...OperationalWorkItemDescription_1.operationalWorkItemOperations,
127
+ ...OperationalWorkItemDescription_1.operationalWorkItemFields,
128
+ ...PaymentDescription_1.paymentOperations,
129
+ ...PaymentDescription_1.paymentFields,
130
+ ...ProcessDefinitionDescription_1.processDefinitionOperations,
131
+ ...ProcessDefinitionDescription_1.processDefinitionFields,
132
+ ...ProjectDescription_1.projectOperations,
133
+ ...ProjectDescription_1.projectFields,
134
+ ...ProposalDescription_1.proposalOperations,
135
+ ...ProposalDescription_1.proposalFields,
136
+ ...ResourceDescription_1.resourceOperations,
137
+ ...ResourceDescription_1.resourceFields,
138
+ ...SupportRequestDescription_1.supportRequestOperations,
139
+ ...SupportRequestDescription_1.supportRequestFields,
140
+ ...TagDescription_1.tagOperations,
141
+ ...TagDescription_1.tagFields,
142
+ ...TeamMemberDescription_1.teamMemberOperations,
143
+ ...TeamMemberDescription_1.teamMemberFields,
144
+ ...WebhookDescription_1.webhookOperations,
145
+ ...WebhookDescription_1.webhookFields,
146
+ ...WorkItemDescription_1.workItemOperations,
147
+ ...WorkItemDescription_1.workItemFields,
148
+ ],
149
+ };
150
+ methods = {
151
+ loadOptions: {
152
+ async getCustomers() {
153
+ const credentials = await this.getCredentials('proiectroApi');
154
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
155
+ method: 'GET',
156
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/tenant_orgs`,
157
+ json: true,
158
+ }));
159
+ return (response.orgs ?? []).map((item) => ({
160
+ name: item.name,
161
+ value: item.id,
162
+ }));
163
+ },
164
+ async getMembers() {
165
+ const credentials = await this.getCredentials('proiectroApi');
166
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
167
+ method: 'GET',
168
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/team`,
169
+ json: true,
170
+ }));
171
+ return (response.members ?? []).map((item) => ({
172
+ name: item.first_name + ' ' + item.last_name,
173
+ value: item.id,
174
+ }));
175
+ },
176
+ async getTags() {
177
+ const credentials = await this.getCredentials('proiectroApi');
178
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
179
+ method: 'GET',
180
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/tags`,
181
+ json: true,
182
+ }));
183
+ return (response.tags ?? []).map((item) => ({
184
+ name: item.name,
185
+ value: item.id,
186
+ }));
187
+ },
188
+ async getProjects() {
189
+ const credentials = await this.getCredentials('proiectroApi');
190
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
191
+ method: 'GET',
192
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/projects`,
193
+ json: true,
194
+ }));
195
+ return (response.projects ?? []).map((item) => ({
196
+ name: item.name,
197
+ value: item.id,
198
+ }));
199
+ },
200
+ async getProposals() {
201
+ const credentials = await this.getCredentials('proiectroApi');
202
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
203
+ method: 'GET',
204
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/active_proposals`,
205
+ json: true,
206
+ }));
207
+ return (response.proposals ?? []).map((item) => ({
208
+ name: item.name,
209
+ value: item.id,
210
+ }));
211
+ },
212
+ async getProcesses() {
213
+ const credentials = await this.getCredentials('proiectroApi');
214
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
215
+ method: 'GET',
216
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/process_definitions`,
217
+ json: true,
218
+ }));
219
+ return (response.processes ?? []).map((item) => ({
220
+ name: item.name,
221
+ value: item.id,
222
+ }));
223
+ },
224
+ async getWorkItemTypes() {
225
+ const credentials = await this.getCredentials('proiectroApi');
226
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
227
+ method: 'GET',
228
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/list_work_item_types`,
229
+ json: true,
230
+ }));
231
+ return (response.work_item_types ?? []).map((item) => ({
232
+ name: item.name,
233
+ value: item.id,
234
+ }));
235
+ },
236
+ async getLabels() {
237
+ const credentials = await this.getCredentials('proiectroApi');
238
+ const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
239
+ method: 'GET',
240
+ url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/labels`,
241
+ json: true,
242
+ }));
243
+ return (response.labels ?? []).map((item) => ({
244
+ name: item.name,
245
+ value: item.id,
246
+ }));
247
+ },
248
+ },
249
+ };
250
+ async execute() {
251
+ const items = this.getInputData();
252
+ const returnData = [];
253
+ const resource = this.getNodeParameter('resource', 0);
254
+ const operation = this.getNodeParameter('operation', 0);
255
+ const credentials = await this.getCredentials('proiectroApi');
256
+ const baseUrl = credentials.baseUrl;
257
+ const workspacePath = credentials.workspacePath;
258
+ for (let i = 0; i < items.length; i++) {
259
+ try {
260
+ let responseData;
261
+ const apiBase = `${baseUrl}/api/v1/${workspacePath}`;
262
+ if (resource === 'operationalWorkItem' && operation === 'list') {
263
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
264
+ method: 'GET',
265
+ url: `${apiBase}/tasks`,
266
+ json: true,
267
+ }));
268
+ }
269
+ else if (resource === 'operationalWorkItem' && operation === 'get') {
270
+ const item_id = this.getNodeParameter('item_id', i);
271
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
272
+ method: 'GET',
273
+ url: `${apiBase}/task/${item_id}`,
274
+ json: true,
275
+ }));
276
+ }
277
+ else if (resource === 'operationalWorkItem' && operation === 'create') {
278
+ const body = {};
279
+ const process = this.getNodeParameter('process', i);
280
+ if (process !== undefined && process !== '')
281
+ body['process'] = process;
282
+ const name = this.getNodeParameter('name', i);
283
+ if (name !== undefined && name !== '')
284
+ body['name'] = name;
285
+ const description = this.getNodeParameter('description', i, undefined);
286
+ if (description !== undefined && description !== '')
287
+ body['description'] = description;
288
+ const customer = this.getNodeParameter('customer', i, undefined);
289
+ if (customer !== undefined && customer !== '')
290
+ body['customer'] = customer;
291
+ const priority = this.getNodeParameter('priority', i, undefined);
292
+ if (priority !== undefined && priority !== '')
293
+ body['priority'] = priority;
294
+ const due_date = this.getNodeParameter('due_date', i, undefined);
295
+ if (due_date !== undefined && due_date !== '')
296
+ body['due_date'] = due_date;
297
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
298
+ method: 'POST',
299
+ url: `${apiBase}/task`,
300
+ body,
301
+ json: true,
302
+ }));
303
+ }
304
+ else if (resource === 'operationalWorkItem' && operation === 'update') {
305
+ const item_id = this.getNodeParameter('item_id', i);
306
+ const body = {};
307
+ const name = this.getNodeParameter('name', i);
308
+ if (name !== undefined && name !== '')
309
+ body['name'] = name;
310
+ const description = this.getNodeParameter('description', i, undefined);
311
+ if (description !== undefined && description !== '')
312
+ body['description'] = description;
313
+ const customer = this.getNodeParameter('customer', i, undefined);
314
+ if (customer !== undefined && customer !== '')
315
+ body['customer'] = customer;
316
+ const priority = this.getNodeParameter('priority', i, undefined);
317
+ if (priority !== undefined && priority !== '')
318
+ body['priority'] = priority;
319
+ const due_date = this.getNodeParameter('due_date', i, undefined);
320
+ if (due_date !== undefined && due_date !== '')
321
+ body['due_date'] = due_date;
322
+ const owner = this.getNodeParameter('owner', i, undefined);
323
+ if (owner !== undefined && owner !== '')
324
+ body['owner'] = owner;
325
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
326
+ method: 'PATCH',
327
+ url: `${apiBase}/task/${item_id}`,
328
+ body,
329
+ json: true,
330
+ }));
331
+ }
332
+ else if (resource === 'operationalWorkItem' && operation === 'delete') {
333
+ const item_id = this.getNodeParameter('item_id', i);
334
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
335
+ method: 'DELETE',
336
+ url: `${apiBase}/task/${item_id}`,
337
+ json: true,
338
+ }));
339
+ }
340
+ else if (resource === 'operationalWorkItem' && operation === 'move') {
341
+ const item_id = this.getNodeParameter('item_id', i);
342
+ const body = {};
343
+ const target_stage = this.getNodeParameter('target_stage', i);
344
+ if (target_stage !== undefined && target_stage !== '')
345
+ body['target_stage'] = target_stage;
346
+ const notes = this.getNodeParameter('notes', i, undefined);
347
+ if (notes !== undefined && notes !== '')
348
+ body['notes'] = notes;
349
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
350
+ method: 'POST',
351
+ url: `${apiBase}/move_task/${item_id}`,
352
+ body,
353
+ json: true,
354
+ }));
355
+ }
356
+ else if (resource === 'operationalWorkItem' && operation === 'approve') {
357
+ const item_id = this.getNodeParameter('item_id', i);
358
+ const body = {};
359
+ const target_stage = this.getNodeParameter('target_stage', i);
360
+ if (target_stage !== undefined && target_stage !== '')
361
+ body['target_stage'] = target_stage;
362
+ const notes = this.getNodeParameter('notes', i, undefined);
363
+ if (notes !== undefined && notes !== '')
364
+ body['notes'] = notes;
365
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
366
+ method: 'POST',
367
+ url: `${apiBase}/approve_task/${item_id}`,
368
+ body,
369
+ json: true,
370
+ }));
371
+ }
372
+ else if (resource === 'operationalWorkItem' && operation === 'reject') {
373
+ const item_id = this.getNodeParameter('item_id', i);
374
+ const body = {};
375
+ const reason = this.getNodeParameter('reason', i);
376
+ if (reason !== undefined && reason !== '')
377
+ body['reason'] = reason;
378
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
379
+ method: 'POST',
380
+ url: `${apiBase}/reject_task/${item_id}`,
381
+ body,
382
+ json: true,
383
+ }));
384
+ }
385
+ else if (resource === 'operationalWorkItem' && operation === 'reassign') {
386
+ const item_id = this.getNodeParameter('item_id', i);
387
+ const body = {};
388
+ const owner = this.getNodeParameter('owner', i, undefined);
389
+ if (owner !== undefined && owner !== '')
390
+ body['owner'] = owner;
391
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
392
+ method: 'PATCH',
393
+ url: `${apiBase}/reassign_task/${item_id}`,
394
+ body,
395
+ json: true,
396
+ }));
397
+ }
398
+ else if (resource === 'operationalWorkItem' && operation === 'my_items') {
399
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
400
+ method: 'GET',
401
+ url: `${apiBase}/my_tasks`,
402
+ json: true,
403
+ }));
404
+ }
405
+ else if (resource === 'operationalWorkItem' && operation === 'my_approvals') {
406
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
407
+ method: 'GET',
408
+ url: `${apiBase}/my_approvals`,
409
+ json: true,
410
+ }));
411
+ }
412
+ else if (resource === 'operationalWorkItem' && operation === 'stage_items') {
413
+ const process_id = this.getNodeParameter('process_id', i);
414
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
415
+ method: 'GET',
416
+ url: `${apiBase}/process_stage_tasks/${process_id}`,
417
+ json: true,
418
+ }));
419
+ }
420
+ else if (resource === 'operationalWorkItem' && operation === 'history') {
421
+ const item_id = this.getNodeParameter('item_id', i);
422
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
423
+ method: 'GET',
424
+ url: `${apiBase}/task_history/${item_id}`,
425
+ json: true,
426
+ }));
427
+ }
428
+ else if (resource === 'customer' && operation === 'list') {
429
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
430
+ method: 'GET',
431
+ url: `${apiBase}/tenant_orgs`,
432
+ json: true,
433
+ }));
434
+ }
435
+ else if (resource === 'customer' && operation === 'get') {
436
+ const subtenant_id = this.getNodeParameter('subtenant_id', i);
437
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
438
+ method: 'GET',
439
+ url: `${apiBase}/org_details/${subtenant_id}`,
440
+ json: true,
441
+ }));
442
+ }
443
+ else if (resource === 'customer' && operation === 'create') {
444
+ const body = {};
445
+ const parent_id = this.getNodeParameter('parent_id', i);
446
+ if (parent_id !== undefined && parent_id !== '')
447
+ body['parent_id'] = parent_id;
448
+ const name = this.getNodeParameter('name', i);
449
+ if (name !== undefined && name !== '')
450
+ body['name'] = name;
451
+ const timezone = this.getNodeParameter('timezone', i);
452
+ if (timezone !== undefined && timezone !== '')
453
+ body['timezone'] = timezone;
454
+ const default_currency = this.getNodeParameter('default_currency', i);
455
+ if (default_currency !== undefined && default_currency !== '')
456
+ body['default_currency'] = default_currency;
457
+ const country = this.getNodeParameter('country', i);
458
+ if (country !== undefined && country !== '')
459
+ body['country'] = country;
460
+ const manager = this.getNodeParameter('manager', i);
461
+ if (manager !== undefined && manager !== '')
462
+ body['manager'] = manager;
463
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
464
+ method: 'POST',
465
+ url: `${apiBase}/add_org`,
466
+ body,
467
+ json: true,
468
+ }));
469
+ }
470
+ else if (resource === 'customer' && operation === 'update') {
471
+ const subtenant_id = this.getNodeParameter('subtenant_id', i);
472
+ const body = {};
473
+ const name = this.getNodeParameter('name', i);
474
+ if (name !== undefined && name !== '')
475
+ body['name'] = name;
476
+ const timezone = this.getNodeParameter('timezone', i);
477
+ if (timezone !== undefined && timezone !== '')
478
+ body['timezone'] = timezone;
479
+ const default_currency = this.getNodeParameter('default_currency', i);
480
+ if (default_currency !== undefined && default_currency !== '')
481
+ body['default_currency'] = default_currency;
482
+ const country = this.getNodeParameter('country', i);
483
+ if (country !== undefined && country !== '')
484
+ body['country'] = country;
485
+ const manager = this.getNodeParameter('manager', i);
486
+ if (manager !== undefined && manager !== '')
487
+ body['manager'] = manager;
488
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
489
+ method: 'PATCH',
490
+ url: `${apiBase}/edit_org/${subtenant_id}`,
491
+ body,
492
+ json: true,
493
+ }));
494
+ }
495
+ else if (resource === 'customer' && operation === 'delete') {
496
+ const subtenant_id = this.getNodeParameter('subtenant_id', i);
497
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
498
+ method: 'DELETE',
499
+ url: `${apiBase}/delete_org/${subtenant_id}`,
500
+ json: true,
501
+ }));
502
+ }
503
+ else if (resource === 'contact' && operation === 'list') {
504
+ const org_id = this.getNodeParameter('org_id', i);
505
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
506
+ method: 'GET',
507
+ url: `${apiBase}/contacts/${org_id}`,
508
+ json: true,
509
+ }));
510
+ }
511
+ else if (resource === 'contact' && operation === 'create') {
512
+ const org_id = this.getNodeParameter('org_id', i);
513
+ const body = {};
514
+ const contact_info_first_name = this.getNodeParameter('contact_info_first_name', i);
515
+ if (contact_info_first_name !== undefined && contact_info_first_name !== '')
516
+ body['contact_info_first_name'] = contact_info_first_name;
517
+ const contact_info_last_name = this.getNodeParameter('contact_info_last_name', i);
518
+ if (contact_info_last_name !== undefined && contact_info_last_name !== '')
519
+ body['contact_info_last_name'] = contact_info_last_name;
520
+ const contact_info_email = this.getNodeParameter('contact_info_email', i);
521
+ if (contact_info_email !== undefined && contact_info_email !== '')
522
+ body['contact_info_email'] = contact_info_email;
523
+ const contact_info_phone = this.getNodeParameter('contact_info_phone', i);
524
+ if (contact_info_phone !== undefined && contact_info_phone !== '')
525
+ body['contact_info_phone'] = contact_info_phone;
526
+ const contact_info_address = this.getNodeParameter('contact_info_address', i);
527
+ if (contact_info_address !== undefined && contact_info_address !== '')
528
+ body['contact_info_address'] = contact_info_address;
529
+ const contact_info_job_title = this.getNodeParameter('contact_info_job_title', i);
530
+ if (contact_info_job_title !== undefined && contact_info_job_title !== '')
531
+ body['contact_info_job_title'] = contact_info_job_title;
532
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
533
+ method: 'POST',
534
+ url: `${apiBase}/add_contact/${org_id}`,
535
+ body,
536
+ json: true,
537
+ }));
538
+ }
539
+ else if (resource === 'contact' && operation === 'update') {
540
+ const org_id = this.getNodeParameter('org_id', i);
541
+ const contact_id = this.getNodeParameter('contact_id', i);
542
+ const body = {};
543
+ const contact_info_first_name = this.getNodeParameter('contact_info_first_name', i, undefined);
544
+ if (contact_info_first_name !== undefined && contact_info_first_name !== '')
545
+ body['contact_info_first_name'] = contact_info_first_name;
546
+ const contact_info_last_name = this.getNodeParameter('contact_info_last_name', i, undefined);
547
+ if (contact_info_last_name !== undefined && contact_info_last_name !== '')
548
+ body['contact_info_last_name'] = contact_info_last_name;
549
+ const contact_info_email = this.getNodeParameter('contact_info_email', i, undefined);
550
+ if (contact_info_email !== undefined && contact_info_email !== '')
551
+ body['contact_info_email'] = contact_info_email;
552
+ const contact_info_phone = this.getNodeParameter('contact_info_phone', i);
553
+ if (contact_info_phone !== undefined && contact_info_phone !== '')
554
+ body['contact_info_phone'] = contact_info_phone;
555
+ const contact_info_address = this.getNodeParameter('contact_info_address', i);
556
+ if (contact_info_address !== undefined && contact_info_address !== '')
557
+ body['contact_info_address'] = contact_info_address;
558
+ const contact_info_job_title = this.getNodeParameter('contact_info_job_title', i);
559
+ if (contact_info_job_title !== undefined && contact_info_job_title !== '')
560
+ body['contact_info_job_title'] = contact_info_job_title;
561
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
562
+ method: 'POST',
563
+ url: `${apiBase}/edit_contact/${org_id}/${contact_id}`,
564
+ body,
565
+ json: true,
566
+ }));
567
+ }
568
+ else if (resource === 'contact' && operation === 'delete') {
569
+ const org_id = this.getNodeParameter('org_id', i);
570
+ const contact_id = this.getNodeParameter('contact_id', i);
571
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
572
+ method: 'DELETE',
573
+ url: `${apiBase}/delete_contact/${org_id}/${contact_id}`,
574
+ json: true,
575
+ }));
576
+ }
577
+ else if (resource === 'contact' && operation === 'invite') {
578
+ const org_id = this.getNodeParameter('org_id', i);
579
+ const contact_id = this.getNodeParameter('contact_id', i);
580
+ const body = {};
581
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
582
+ method: 'POST',
583
+ url: `${apiBase}/invite_contact/${org_id}/${contact_id}`,
584
+ body,
585
+ json: true,
586
+ }));
587
+ }
588
+ else if (resource === 'proposal' && operation === 'list') {
589
+ const org_id = this.getNodeParameter('org_id', i);
590
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
591
+ method: 'GET',
592
+ url: `${apiBase}/org_proposals/${org_id}`,
593
+ json: true,
594
+ }));
595
+ }
596
+ else if (resource === 'proposal' && operation === 'get') {
597
+ const proposal_id = this.getNodeParameter('proposal_id', i);
598
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
599
+ method: 'GET',
600
+ url: `${apiBase}/proposal/${proposal_id}`,
601
+ json: true,
602
+ }));
603
+ }
604
+ else if (resource === 'proposal' && operation === 'create') {
605
+ const body = {};
606
+ const internal_code = this.getNodeParameter('internal_code', i, undefined);
607
+ if (internal_code !== undefined && internal_code !== '')
608
+ body['internal_code'] = internal_code;
609
+ const name = this.getNodeParameter('name', i);
610
+ if (name !== undefined && name !== '')
611
+ body['name'] = name;
612
+ const description = this.getNodeParameter('description', i);
613
+ if (description !== undefined && description !== '')
614
+ body['description'] = description;
615
+ const customer = this.getNodeParameter('customer', i);
616
+ if (customer !== undefined && customer !== '')
617
+ body['customer'] = customer;
618
+ const rfp_publication = this.getNodeParameter('rfp_publication', i, undefined);
619
+ if (rfp_publication !== undefined && rfp_publication !== '')
620
+ body['rfp_publication'] = rfp_publication;
621
+ const owner = this.getNodeParameter('owner', i);
622
+ if (owner !== undefined && owner !== '')
623
+ body['owner'] = owner;
624
+ const manager = this.getNodeParameter('manager', i);
625
+ if (manager !== undefined && manager !== '')
626
+ body['manager'] = manager;
627
+ const sales_stage = this.getNodeParameter('sales_stage', i);
628
+ if (sales_stage !== undefined && sales_stage !== '')
629
+ body['sales_stage'] = sales_stage;
630
+ const proposal_currency = this.getNodeParameter('proposal_currency', i);
631
+ if (proposal_currency !== undefined && proposal_currency !== '')
632
+ body['proposal_currency'] = proposal_currency;
633
+ const pricing_strategy = this.getNodeParameter('pricing_strategy', i, undefined);
634
+ if (pricing_strategy !== undefined && pricing_strategy !== '')
635
+ body['pricing_strategy'] = pricing_strategy;
636
+ const pricing_adjustment_percent = this.getNodeParameter('pricing_adjustment_percent', i, undefined);
637
+ if (pricing_adjustment_percent !== undefined && pricing_adjustment_percent !== '')
638
+ body['pricing_adjustment_percent'] = pricing_adjustment_percent;
639
+ const pricing_adjustment_amount = this.getNodeParameter('pricing_adjustment_amount', i, undefined);
640
+ if (pricing_adjustment_amount !== undefined && pricing_adjustment_amount !== '')
641
+ body['pricing_adjustment_amount'] = pricing_adjustment_amount;
642
+ const target_margin_percent = this.getNodeParameter('target_margin_percent', i, undefined);
643
+ if (target_margin_percent !== undefined && target_margin_percent !== '')
644
+ body['target_margin_percent'] = target_margin_percent;
645
+ const minimum_margin_percent = this.getNodeParameter('minimum_margin_percent', i, undefined);
646
+ if (minimum_margin_percent !== undefined && minimum_margin_percent !== '')
647
+ body['minimum_margin_percent'] = minimum_margin_percent;
648
+ const proposal_valid_since = this.getNodeParameter('proposal_valid_since', i, undefined);
649
+ if (proposal_valid_since !== undefined && proposal_valid_since !== '')
650
+ body['proposal_valid_since'] = proposal_valid_since;
651
+ const proposal_valid_until = this.getNodeParameter('proposal_valid_until', i, undefined);
652
+ if (proposal_valid_until !== undefined && proposal_valid_until !== '')
653
+ body['proposal_valid_until'] = proposal_valid_until;
654
+ const project_start_date = this.getNodeParameter('project_start_date', i, undefined);
655
+ if (project_start_date !== undefined && project_start_date !== '')
656
+ body['project_start_date'] = project_start_date;
657
+ const project_end_date = this.getNodeParameter('project_end_date', i, undefined);
658
+ if (project_end_date !== undefined && project_end_date !== '')
659
+ body['project_end_date'] = project_end_date;
660
+ const project_enable_booking_management = this.getNodeParameter('project_enable_booking_management', i, undefined);
661
+ if (project_enable_booking_management !== undefined && project_enable_booking_management !== '')
662
+ body['project_enable_booking_management'] = project_enable_booking_management;
663
+ const project_enable_resource_management = this.getNodeParameter('project_enable_resource_management', i, undefined);
664
+ if (project_enable_resource_management !== undefined && project_enable_resource_management !== '')
665
+ body['project_enable_resource_management'] = project_enable_resource_management;
666
+ const project_enable_effort_management = this.getNodeParameter('project_enable_effort_management', i, undefined);
667
+ if (project_enable_effort_management !== undefined && project_enable_effort_management !== '')
668
+ body['project_enable_effort_management'] = project_enable_effort_management;
669
+ const project_enable_financial_management = this.getNodeParameter('project_enable_financial_management', i, undefined);
670
+ if (project_enable_financial_management !== undefined && project_enable_financial_management !== '')
671
+ body['project_enable_financial_management'] = project_enable_financial_management;
672
+ const project_enable_schedule_management = this.getNodeParameter('project_enable_schedule_management', i, undefined);
673
+ if (project_enable_schedule_management !== undefined && project_enable_schedule_management !== '')
674
+ body['project_enable_schedule_management'] = project_enable_schedule_management;
675
+ const project_enable_earned_value_management = this.getNodeParameter('project_enable_earned_value_management', i, undefined);
676
+ if (project_enable_earned_value_management !== undefined && project_enable_earned_value_management !== '')
677
+ body['project_enable_earned_value_management'] = project_enable_earned_value_management;
678
+ const wbsconfiguration = this.getNodeParameter('wbsconfiguration', i);
679
+ if (wbsconfiguration !== undefined && wbsconfiguration !== '')
680
+ body['wbsconfiguration'] = wbsconfiguration;
681
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
682
+ method: 'POST',
683
+ url: `${apiBase}/add_proposal`,
684
+ body,
685
+ json: true,
686
+ }));
687
+ }
688
+ else if (resource === 'proposal' && operation === 'update') {
689
+ const proposal_id = this.getNodeParameter('proposal_id', i);
690
+ const body = {};
691
+ const internal_code = this.getNodeParameter('internal_code', i, undefined);
692
+ if (internal_code !== undefined && internal_code !== '')
693
+ body['internal_code'] = internal_code;
694
+ const name = this.getNodeParameter('name', i);
695
+ if (name !== undefined && name !== '')
696
+ body['name'] = name;
697
+ const description = this.getNodeParameter('description', i);
698
+ if (description !== undefined && description !== '')
699
+ body['description'] = description;
700
+ const customer = this.getNodeParameter('customer', i);
701
+ if (customer !== undefined && customer !== '')
702
+ body['customer'] = customer;
703
+ const rfp_publication = this.getNodeParameter('rfp_publication', i, undefined);
704
+ if (rfp_publication !== undefined && rfp_publication !== '')
705
+ body['rfp_publication'] = rfp_publication;
706
+ const owner = this.getNodeParameter('owner', i);
707
+ if (owner !== undefined && owner !== '')
708
+ body['owner'] = owner;
709
+ const proposal_currency = this.getNodeParameter('proposal_currency', i);
710
+ if (proposal_currency !== undefined && proposal_currency !== '')
711
+ body['proposal_currency'] = proposal_currency;
712
+ const pricing_strategy = this.getNodeParameter('pricing_strategy', i, undefined);
713
+ if (pricing_strategy !== undefined && pricing_strategy !== '')
714
+ body['pricing_strategy'] = pricing_strategy;
715
+ const pricing_adjustment_percent = this.getNodeParameter('pricing_adjustment_percent', i, undefined);
716
+ if (pricing_adjustment_percent !== undefined && pricing_adjustment_percent !== '')
717
+ body['pricing_adjustment_percent'] = pricing_adjustment_percent;
718
+ const pricing_adjustment_amount = this.getNodeParameter('pricing_adjustment_amount', i, undefined);
719
+ if (pricing_adjustment_amount !== undefined && pricing_adjustment_amount !== '')
720
+ body['pricing_adjustment_amount'] = pricing_adjustment_amount;
721
+ const target_margin_percent = this.getNodeParameter('target_margin_percent', i, undefined);
722
+ if (target_margin_percent !== undefined && target_margin_percent !== '')
723
+ body['target_margin_percent'] = target_margin_percent;
724
+ const minimum_margin_percent = this.getNodeParameter('minimum_margin_percent', i, undefined);
725
+ if (minimum_margin_percent !== undefined && minimum_margin_percent !== '')
726
+ body['minimum_margin_percent'] = minimum_margin_percent;
727
+ const proposal_valid_since = this.getNodeParameter('proposal_valid_since', i, undefined);
728
+ if (proposal_valid_since !== undefined && proposal_valid_since !== '')
729
+ body['proposal_valid_since'] = proposal_valid_since;
730
+ const proposal_valid_until = this.getNodeParameter('proposal_valid_until', i, undefined);
731
+ if (proposal_valid_until !== undefined && proposal_valid_until !== '')
732
+ body['proposal_valid_until'] = proposal_valid_until;
733
+ const project_start_date = this.getNodeParameter('project_start_date', i, undefined);
734
+ if (project_start_date !== undefined && project_start_date !== '')
735
+ body['project_start_date'] = project_start_date;
736
+ const project_end_date = this.getNodeParameter('project_end_date', i, undefined);
737
+ if (project_end_date !== undefined && project_end_date !== '')
738
+ body['project_end_date'] = project_end_date;
739
+ const project_enable_booking_management = this.getNodeParameter('project_enable_booking_management', i, undefined);
740
+ if (project_enable_booking_management !== undefined && project_enable_booking_management !== '')
741
+ body['project_enable_booking_management'] = project_enable_booking_management;
742
+ const project_enable_resource_management = this.getNodeParameter('project_enable_resource_management', i, undefined);
743
+ if (project_enable_resource_management !== undefined && project_enable_resource_management !== '')
744
+ body['project_enable_resource_management'] = project_enable_resource_management;
745
+ const project_enable_effort_management = this.getNodeParameter('project_enable_effort_management', i, undefined);
746
+ if (project_enable_effort_management !== undefined && project_enable_effort_management !== '')
747
+ body['project_enable_effort_management'] = project_enable_effort_management;
748
+ const project_enable_financial_management = this.getNodeParameter('project_enable_financial_management', i, undefined);
749
+ if (project_enable_financial_management !== undefined && project_enable_financial_management !== '')
750
+ body['project_enable_financial_management'] = project_enable_financial_management;
751
+ const project_enable_schedule_management = this.getNodeParameter('project_enable_schedule_management', i, undefined);
752
+ if (project_enable_schedule_management !== undefined && project_enable_schedule_management !== '')
753
+ body['project_enable_schedule_management'] = project_enable_schedule_management;
754
+ const project_enable_earned_value_management = this.getNodeParameter('project_enable_earned_value_management', i, undefined);
755
+ if (project_enable_earned_value_management !== undefined && project_enable_earned_value_management !== '')
756
+ body['project_enable_earned_value_management'] = project_enable_earned_value_management;
757
+ const wbsconfiguration = this.getNodeParameter('wbsconfiguration', i, undefined);
758
+ if (wbsconfiguration !== undefined && wbsconfiguration !== '')
759
+ body['wbsconfiguration'] = wbsconfiguration;
760
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
761
+ method: 'PATCH',
762
+ url: `${apiBase}/edit_proposal/${proposal_id}`,
763
+ body,
764
+ json: true,
765
+ }));
766
+ }
767
+ else if (resource === 'proposal' && operation === 'change_stage') {
768
+ const proposal_id = this.getNodeParameter('proposal_id', i);
769
+ const stage_id = this.getNodeParameter('stage_id', i);
770
+ const body = {};
771
+ const i_have_followed_the_instructions = this.getNodeParameter('i_have_followed_the_instructions', i, undefined);
772
+ if (i_have_followed_the_instructions !== undefined && i_have_followed_the_instructions !== '')
773
+ body['i_have_followed_the_instructions'] = i_have_followed_the_instructions;
774
+ const contact_id = this.getNodeParameter('contact_id', i, undefined);
775
+ if (contact_id !== undefined && contact_id !== '')
776
+ body['contact_id'] = contact_id;
777
+ const rejection_reason = this.getNodeParameter('rejection_reason', i, undefined);
778
+ if (rejection_reason !== undefined && rejection_reason !== '')
779
+ body['rejection_reason'] = rejection_reason;
780
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
781
+ method: 'PATCH',
782
+ url: `${apiBase}/change_proposal_stage/${proposal_id}/${stage_id}`,
783
+ body,
784
+ json: true,
785
+ }));
786
+ }
787
+ else if (resource === 'proposal' && operation === 'reopen') {
788
+ const proposal_id = this.getNodeParameter('proposal_id', i);
789
+ const body = {};
790
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
791
+ method: 'POST',
792
+ url: `${apiBase}/reopen_proposal/${proposal_id}`,
793
+ body,
794
+ json: true,
795
+ }));
796
+ }
797
+ else if (resource === 'project' && operation === 'list') {
798
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
799
+ method: 'GET',
800
+ url: `${apiBase}/projects`,
801
+ json: true,
802
+ }));
803
+ }
804
+ else if (resource === 'project' && operation === 'get_work_items') {
805
+ const project_id = this.getNodeParameter('project_id', i);
806
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
807
+ method: 'GET',
808
+ url: `${apiBase}/project_work_items/${project_id}`,
809
+ json: true,
810
+ }));
811
+ }
812
+ else if (resource === 'workItem' && operation === 'create') {
813
+ const body = {};
814
+ const name = this.getNodeParameter('name', i);
815
+ if (name !== undefined && name !== '')
816
+ body['name'] = name;
817
+ const description = this.getNodeParameter('description', i, undefined);
818
+ if (description !== undefined && description !== '')
819
+ body['description'] = description;
820
+ const estimated_work_hours = this.getNodeParameter('estimated_work_hours', i, undefined);
821
+ if (estimated_work_hours !== undefined && estimated_work_hours !== '')
822
+ body['estimated_work_hours'] = estimated_work_hours;
823
+ const planned_start_date = this.getNodeParameter('planned_start_date', i, undefined);
824
+ if (planned_start_date !== undefined && planned_start_date !== '')
825
+ body['planned_start_date'] = planned_start_date;
826
+ const planned_finish_date = this.getNodeParameter('planned_finish_date', i, undefined);
827
+ if (planned_finish_date !== undefined && planned_finish_date !== '')
828
+ body['planned_finish_date'] = planned_finish_date;
829
+ const estimated_duration_days = this.getNodeParameter('estimated_duration_days', i, undefined);
830
+ if (estimated_duration_days !== undefined && estimated_duration_days !== '')
831
+ body['estimated_duration_days'] = estimated_duration_days;
832
+ const constraint_type = this.getNodeParameter('constraint_type', i, undefined);
833
+ if (constraint_type !== undefined && constraint_type !== '')
834
+ body['constraint_type'] = constraint_type;
835
+ const constraint_date = this.getNodeParameter('constraint_date', i, undefined);
836
+ if (constraint_date !== undefined && constraint_date !== '')
837
+ body['constraint_date'] = constraint_date;
838
+ const owner = this.getNodeParameter('owner', i, undefined);
839
+ if (owner !== undefined && owner !== '')
840
+ body['owner'] = owner;
841
+ const visible_to_customer = this.getNodeParameter('visible_to_customer', i, undefined);
842
+ if (visible_to_customer !== undefined && visible_to_customer !== '')
843
+ body['visible_to_customer'] = visible_to_customer;
844
+ const product = this.getNodeParameter('product', i, undefined);
845
+ if (product !== undefined && product !== '')
846
+ body['product'] = product;
847
+ const project_id = this.getNodeParameter('project_id', i);
848
+ if (project_id !== undefined && project_id !== '')
849
+ body['project_id'] = project_id;
850
+ const work_item_type_id = this.getNodeParameter('work_item_type_id', i);
851
+ if (work_item_type_id !== undefined && work_item_type_id !== '')
852
+ body['work_item_type_id'] = work_item_type_id;
853
+ const parent_work_item_id = this.getNodeParameter('parent_work_item_id', i, undefined);
854
+ if (parent_work_item_id !== undefined && parent_work_item_id !== '')
855
+ body['parent_work_item_id'] = parent_work_item_id;
856
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
857
+ method: 'POST',
858
+ url: `${apiBase}/add_work_item`,
859
+ body,
860
+ json: true,
861
+ }));
862
+ }
863
+ else if (resource === 'workItem' && operation === 'update') {
864
+ const work_item_id = this.getNodeParameter('work_item_id', i);
865
+ const body = {};
866
+ const name = this.getNodeParameter('name', i);
867
+ if (name !== undefined && name !== '')
868
+ body['name'] = name;
869
+ const description = this.getNodeParameter('description', i, undefined);
870
+ if (description !== undefined && description !== '')
871
+ body['description'] = description;
872
+ const estimated_work_hours = this.getNodeParameter('estimated_work_hours', i, undefined);
873
+ if (estimated_work_hours !== undefined && estimated_work_hours !== '')
874
+ body['estimated_work_hours'] = estimated_work_hours;
875
+ const planned_start_date = this.getNodeParameter('planned_start_date', i, undefined);
876
+ if (planned_start_date !== undefined && planned_start_date !== '')
877
+ body['planned_start_date'] = planned_start_date;
878
+ const planned_finish_date = this.getNodeParameter('planned_finish_date', i, undefined);
879
+ if (planned_finish_date !== undefined && planned_finish_date !== '')
880
+ body['planned_finish_date'] = planned_finish_date;
881
+ const estimated_duration_days = this.getNodeParameter('estimated_duration_days', i, undefined);
882
+ if (estimated_duration_days !== undefined && estimated_duration_days !== '')
883
+ body['estimated_duration_days'] = estimated_duration_days;
884
+ const constraint_type = this.getNodeParameter('constraint_type', i, undefined);
885
+ if (constraint_type !== undefined && constraint_type !== '')
886
+ body['constraint_type'] = constraint_type;
887
+ const constraint_date = this.getNodeParameter('constraint_date', i, undefined);
888
+ if (constraint_date !== undefined && constraint_date !== '')
889
+ body['constraint_date'] = constraint_date;
890
+ const owner = this.getNodeParameter('owner', i, undefined);
891
+ if (owner !== undefined && owner !== '')
892
+ body['owner'] = owner;
893
+ const visible_to_customer = this.getNodeParameter('visible_to_customer', i, undefined);
894
+ if (visible_to_customer !== undefined && visible_to_customer !== '')
895
+ body['visible_to_customer'] = visible_to_customer;
896
+ const parent = this.getNodeParameter('parent', i);
897
+ if (parent !== undefined && parent !== '')
898
+ body['parent'] = parent;
899
+ const product = this.getNodeParameter('product', i, undefined);
900
+ if (product !== undefined && product !== '')
901
+ body['product'] = product;
902
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
903
+ method: 'PATCH',
904
+ url: `${apiBase}/edit_project_work_item/${work_item_id}`,
905
+ body,
906
+ json: true,
907
+ }));
908
+ }
909
+ else if (resource === 'workItem' && operation === 'change_status') {
910
+ const work_item_id = this.getNodeParameter('work_item_id', i);
911
+ const body = {};
912
+ const percent_complete = this.getNodeParameter('percent_complete', i, undefined);
913
+ if (percent_complete !== undefined && percent_complete !== '')
914
+ body['percent_complete'] = percent_complete;
915
+ const is_finished = this.getNodeParameter('is_finished', i, undefined);
916
+ if (is_finished !== undefined && is_finished !== '')
917
+ body['is_finished'] = is_finished;
918
+ const finished_at = this.getNodeParameter('finished_at', i, undefined);
919
+ if (finished_at !== undefined && finished_at !== '')
920
+ body['finished_at'] = finished_at;
921
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
922
+ method: 'PATCH',
923
+ url: `${apiBase}/update_work_item_status/${work_item_id}`,
924
+ body,
925
+ json: true,
926
+ }));
927
+ }
928
+ else if (resource === 'workItem' && operation === 'delete') {
929
+ const work_item_id = this.getNodeParameter('work_item_id', i);
930
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
931
+ method: 'DELETE',
932
+ url: `${apiBase}/delete_work_item/${work_item_id}`,
933
+ json: true,
934
+ }));
935
+ }
936
+ else if (resource === 'payment' && operation === 'create') {
937
+ const body = {};
938
+ const payment_schedule_block_id = this.getNodeParameter('payment_schedule_block_id', i);
939
+ if (payment_schedule_block_id !== undefined && payment_schedule_block_id !== '')
940
+ body['payment_schedule_block_id'] = payment_schedule_block_id;
941
+ const product_id = this.getNodeParameter('product_id', i, undefined);
942
+ if (product_id !== undefined && product_id !== '')
943
+ body['product_id'] = product_id;
944
+ const name = this.getNodeParameter('name', i);
945
+ if (name !== undefined && name !== '')
946
+ body['name'] = name;
947
+ const internal_code = this.getNodeParameter('internal_code', i, undefined);
948
+ if (internal_code !== undefined && internal_code !== '')
949
+ body['internal_code'] = internal_code;
950
+ const due_date = this.getNodeParameter('due_date', i);
951
+ if (due_date !== undefined && due_date !== '')
952
+ body['due_date'] = due_date;
953
+ const amount = this.getNodeParameter('amount', i);
954
+ if (amount !== undefined && amount !== '')
955
+ body['amount'] = amount;
956
+ const payment_integration_id = this.getNodeParameter('payment_integration_id', i, undefined);
957
+ if (payment_integration_id !== undefined && payment_integration_id !== '')
958
+ body['payment_integration_id'] = payment_integration_id;
959
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
960
+ method: 'POST',
961
+ url: `${apiBase}/payment`,
962
+ body,
963
+ json: true,
964
+ }));
965
+ }
966
+ else if (resource === 'payment' && operation === 'update') {
967
+ const payment_id = this.getNodeParameter('payment_id', i);
968
+ const body = {};
969
+ const name = this.getNodeParameter('name', i, undefined);
970
+ if (name !== undefined && name !== '')
971
+ body['name'] = name;
972
+ const internal_code = this.getNodeParameter('internal_code', i, undefined);
973
+ if (internal_code !== undefined && internal_code !== '')
974
+ body['internal_code'] = internal_code;
975
+ const due_date = this.getNodeParameter('due_date', i, undefined);
976
+ if (due_date !== undefined && due_date !== '')
977
+ body['due_date'] = due_date;
978
+ const amount = this.getNodeParameter('amount', i, undefined);
979
+ if (amount !== undefined && amount !== '')
980
+ body['amount'] = amount;
981
+ const product_id = this.getNodeParameter('product_id', i, undefined);
982
+ if (product_id !== undefined && product_id !== '')
983
+ body['product_id'] = product_id;
984
+ const payment_integration_id = this.getNodeParameter('payment_integration_id', i, undefined);
985
+ if (payment_integration_id !== undefined && payment_integration_id !== '')
986
+ body['payment_integration_id'] = payment_integration_id;
987
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
988
+ method: 'PATCH',
989
+ url: `${apiBase}/payment/${payment_id}`,
990
+ body,
991
+ json: true,
992
+ }));
993
+ }
994
+ else if (resource === 'payment' && operation === 'mark_paid') {
995
+ const payment_id = this.getNodeParameter('payment_id', i);
996
+ const body = {};
997
+ const paid_date = this.getNodeParameter('paid_date', i);
998
+ if (paid_date !== undefined && paid_date !== '')
999
+ body['paid_date'] = paid_date;
1000
+ const payment_integration_id = this.getNodeParameter('payment_integration_id', i, undefined);
1001
+ if (payment_integration_id !== undefined && payment_integration_id !== '')
1002
+ body['payment_integration_id'] = payment_integration_id;
1003
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1004
+ method: 'PATCH',
1005
+ url: `${apiBase}/payment/${payment_id}/mark_paid`,
1006
+ body,
1007
+ json: true,
1008
+ }));
1009
+ }
1010
+ else if (resource === 'payment' && operation === 'mark_unpaid') {
1011
+ const payment_id = this.getNodeParameter('payment_id', i);
1012
+ const body = {};
1013
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1014
+ method: 'PATCH',
1015
+ url: `${apiBase}/payment/${payment_id}/mark_unpaid`,
1016
+ body,
1017
+ json: true,
1018
+ }));
1019
+ }
1020
+ else if (resource === 'payment' && operation === 'delete') {
1021
+ const payment_id = this.getNodeParameter('payment_id', i);
1022
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1023
+ method: 'DELETE',
1024
+ url: `${apiBase}/payment/${payment_id}`,
1025
+ json: true,
1026
+ }));
1027
+ }
1028
+ else if (resource === 'supportRequest' && operation === 'list') {
1029
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1030
+ method: 'GET',
1031
+ url: `${apiBase}/internal_support_requests`,
1032
+ json: true,
1033
+ }));
1034
+ }
1035
+ else if (resource === 'supportRequest' && operation === 'get') {
1036
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1037
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1038
+ method: 'GET',
1039
+ url: `${apiBase}/internal_support_request/${support_request_id}`,
1040
+ json: true,
1041
+ }));
1042
+ }
1043
+ else if (resource === 'supportRequest' && operation === 'create') {
1044
+ const body = {};
1045
+ const request_type = this.getNodeParameter('request_type', i);
1046
+ if (request_type !== undefined && request_type !== '')
1047
+ body['request_type'] = request_type;
1048
+ const request_severity = this.getNodeParameter('request_severity', i);
1049
+ if (request_severity !== undefined && request_severity !== '')
1050
+ body['request_severity'] = request_severity;
1051
+ const title = this.getNodeParameter('title', i);
1052
+ if (title !== undefined && title !== '')
1053
+ body['title'] = title;
1054
+ const description = this.getNodeParameter('description', i);
1055
+ if (description !== undefined && description !== '')
1056
+ body['description'] = description;
1057
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1058
+ method: 'POST',
1059
+ url: `${apiBase}/internal_support_request`,
1060
+ body,
1061
+ json: true,
1062
+ }));
1063
+ }
1064
+ else if (resource === 'supportRequest' && operation === 'edit') {
1065
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1066
+ const body = {};
1067
+ const title = this.getNodeParameter('title', i);
1068
+ if (title !== undefined && title !== '')
1069
+ body['title'] = title;
1070
+ const description = this.getNodeParameter('description', i);
1071
+ if (description !== undefined && description !== '')
1072
+ body['description'] = description;
1073
+ const request_type = this.getNodeParameter('request_type', i);
1074
+ if (request_type !== undefined && request_type !== '')
1075
+ body['request_type'] = request_type;
1076
+ const request_severity = this.getNodeParameter('request_severity', i);
1077
+ if (request_severity !== undefined && request_severity !== '')
1078
+ body['request_severity'] = request_severity;
1079
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1080
+ method: 'PATCH',
1081
+ url: `${apiBase}/internal_support_request/${support_request_id}/edit`,
1082
+ body,
1083
+ json: true,
1084
+ }));
1085
+ }
1086
+ else if (resource === 'supportRequest' && operation === 'close') {
1087
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1088
+ const body = {};
1089
+ const status_id = this.getNodeParameter('status_id', i);
1090
+ if (status_id !== undefined && status_id !== '')
1091
+ body['status_id'] = status_id;
1092
+ const resolution = this.getNodeParameter('resolution', i);
1093
+ if (resolution !== undefined && resolution !== '')
1094
+ body['resolution'] = resolution;
1095
+ const reason = this.getNodeParameter('reason', i);
1096
+ if (reason !== undefined && reason !== '')
1097
+ body['reason'] = reason;
1098
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1099
+ method: 'PATCH',
1100
+ url: `${apiBase}/internal_support_request/${support_request_id}/close`,
1101
+ body,
1102
+ json: true,
1103
+ }));
1104
+ }
1105
+ else if (resource === 'supportRequest' && operation === 'reopen') {
1106
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1107
+ const body = {};
1108
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1109
+ method: 'PATCH',
1110
+ url: `${apiBase}/internal_support_request/${support_request_id}/reopen`,
1111
+ body,
1112
+ json: true,
1113
+ }));
1114
+ }
1115
+ else if (resource === 'supportRequest' && operation === 'change_status') {
1116
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1117
+ const body = {};
1118
+ const status_id = this.getNodeParameter('status_id', i);
1119
+ if (status_id !== undefined && status_id !== '')
1120
+ body['status_id'] = status_id;
1121
+ const reason = this.getNodeParameter('reason', i);
1122
+ if (reason !== undefined && reason !== '')
1123
+ body['reason'] = reason;
1124
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1125
+ method: 'PATCH',
1126
+ url: `${apiBase}/internal_support_request/${support_request_id}/change_status`,
1127
+ body,
1128
+ json: true,
1129
+ }));
1130
+ }
1131
+ else if (resource === 'supportRequest' && operation === 'reassign') {
1132
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1133
+ const body = {};
1134
+ const assignee_id = this.getNodeParameter('assignee_id', i);
1135
+ if (assignee_id !== undefined && assignee_id !== '')
1136
+ body['assignee_id'] = assignee_id;
1137
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1138
+ method: 'PATCH',
1139
+ url: `${apiBase}/internal_support_request/${support_request_id}/reassign`,
1140
+ body,
1141
+ json: true,
1142
+ }));
1143
+ }
1144
+ else if (resource === 'supportRequest' && operation === 'add_comment') {
1145
+ const body = {};
1146
+ const support_request_id = this.getNodeParameter('support_request_id', i);
1147
+ if (support_request_id !== undefined && support_request_id !== '')
1148
+ body['support_request_id'] = support_request_id;
1149
+ const content = this.getNodeParameter('content', i);
1150
+ if (content !== undefined && content !== '')
1151
+ body['content'] = content;
1152
+ const parent_id = this.getNodeParameter('parent_id', i, undefined);
1153
+ if (parent_id !== undefined && parent_id !== '')
1154
+ body['parent_id'] = parent_id;
1155
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1156
+ method: 'POST',
1157
+ url: `${apiBase}/add_internal_support_request_comment`,
1158
+ body,
1159
+ json: true,
1160
+ }));
1161
+ }
1162
+ else if (resource === 'supportRequest' && operation === 'my_assigned') {
1163
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1164
+ method: 'GET',
1165
+ url: `${apiBase}/assigned_internal_support_requests`,
1166
+ json: true,
1167
+ }));
1168
+ }
1169
+ else if (resource === 'teamMember' && operation === 'list') {
1170
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1171
+ method: 'GET',
1172
+ url: `${apiBase}/team`,
1173
+ json: true,
1174
+ }));
1175
+ }
1176
+ else if (resource === 'teamMember' && operation === 'invite') {
1177
+ const body = {};
1178
+ const email = this.getNodeParameter('email', i);
1179
+ if (email !== undefined && email !== '')
1180
+ body['email'] = email;
1181
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1182
+ method: 'POST',
1183
+ url: `${apiBase}/invite_to_team`,
1184
+ body,
1185
+ json: true,
1186
+ }));
1187
+ }
1188
+ else if (resource === 'teamMember' && operation === 'edit') {
1189
+ const member_id = this.getNodeParameter('member_id', i);
1190
+ const body = {};
1191
+ const nickname = this.getNodeParameter('nickname', i);
1192
+ if (nickname !== undefined && nickname !== '')
1193
+ body['nickname'] = nickname;
1194
+ const work_email = this.getNodeParameter('work_email', i, undefined);
1195
+ if (work_email !== undefined && work_email !== '')
1196
+ body['work_email'] = work_email;
1197
+ const work_email_alternative = this.getNodeParameter('work_email_alternative', i, undefined);
1198
+ if (work_email_alternative !== undefined && work_email_alternative !== '')
1199
+ body['work_email_alternative'] = work_email_alternative;
1200
+ const work_phone = this.getNodeParameter('work_phone', i, undefined);
1201
+ if (work_phone !== undefined && work_phone !== '')
1202
+ body['work_phone'] = work_phone;
1203
+ const work_phone_alternative = this.getNodeParameter('work_phone_alternative', i, undefined);
1204
+ if (work_phone_alternative !== undefined && work_phone_alternative !== '')
1205
+ body['work_phone_alternative'] = work_phone_alternative;
1206
+ const territory = this.getNodeParameter('territory', i, undefined);
1207
+ if (territory !== undefined && territory !== '')
1208
+ body['territory'] = territory;
1209
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1210
+ method: 'PATCH',
1211
+ url: `${apiBase}/edit_member/${member_id}`,
1212
+ body,
1213
+ json: true,
1214
+ }));
1215
+ }
1216
+ else if (resource === 'teamMember' && operation === 'remove') {
1217
+ const team_id = this.getNodeParameter('team_id', i);
1218
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1219
+ method: 'DELETE',
1220
+ url: `${apiBase}/exclude_from_team/${team_id}`,
1221
+ json: true,
1222
+ }));
1223
+ }
1224
+ else if (resource === 'tag' && operation === 'list') {
1225
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1226
+ method: 'GET',
1227
+ url: `${apiBase}/tags`,
1228
+ json: true,
1229
+ }));
1230
+ }
1231
+ else if (resource === 'tag' && operation === 'create') {
1232
+ const body = {};
1233
+ const name = this.getNodeParameter('name', i);
1234
+ if (name !== undefined && name !== '')
1235
+ body['name'] = name;
1236
+ const color = this.getNodeParameter('color', i);
1237
+ if (color !== undefined && color !== '')
1238
+ body['color'] = color;
1239
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1240
+ method: 'POST',
1241
+ url: `${apiBase}/add_tag`,
1242
+ body,
1243
+ json: true,
1244
+ }));
1245
+ }
1246
+ else if (resource === 'tag' && operation === 'update') {
1247
+ const tag_id = this.getNodeParameter('tag_id', i);
1248
+ const body = {};
1249
+ const name = this.getNodeParameter('name', i);
1250
+ if (name !== undefined && name !== '')
1251
+ body['name'] = name;
1252
+ const color = this.getNodeParameter('color', i);
1253
+ if (color !== undefined && color !== '')
1254
+ body['color'] = color;
1255
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1256
+ method: 'PATCH',
1257
+ url: `${apiBase}/edit_tag/${tag_id}`,
1258
+ body,
1259
+ json: true,
1260
+ }));
1261
+ }
1262
+ else if (resource === 'tag' && operation === 'delete') {
1263
+ const tag_id = this.getNodeParameter('tag_id', i);
1264
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1265
+ method: 'DELETE',
1266
+ url: `${apiBase}/delete_tag/${tag_id}`,
1267
+ json: true,
1268
+ }));
1269
+ }
1270
+ else if (resource === 'tag' && operation === 'tag_customer') {
1271
+ const org_id = this.getNodeParameter('org_id', i);
1272
+ const tag_id = this.getNodeParameter('tag_id', i);
1273
+ const body = {};
1274
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1275
+ method: 'POST',
1276
+ url: `${apiBase}/tag_org/${org_id}/${tag_id}`,
1277
+ body,
1278
+ json: true,
1279
+ }));
1280
+ }
1281
+ else if (resource === 'tag' && operation === 'untag_customer') {
1282
+ const org_id = this.getNodeParameter('org_id', i);
1283
+ const tag_id = this.getNodeParameter('tag_id', i);
1284
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1285
+ method: 'DELETE',
1286
+ url: `${apiBase}/untag_org/${org_id}/${tag_id}`,
1287
+ json: true,
1288
+ }));
1289
+ }
1290
+ else if (resource === 'tag' && operation === 'tag_member') {
1291
+ const member_id = this.getNodeParameter('member_id', i);
1292
+ const tag_id = this.getNodeParameter('tag_id', i);
1293
+ const body = {};
1294
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1295
+ method: 'POST',
1296
+ url: `${apiBase}/tag_member/${member_id}/${tag_id}`,
1297
+ body,
1298
+ json: true,
1299
+ }));
1300
+ }
1301
+ else if (resource === 'tag' && operation === 'untag_member') {
1302
+ const member_id = this.getNodeParameter('member_id', i);
1303
+ const tag_id = this.getNodeParameter('tag_id', i);
1304
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1305
+ method: 'DELETE',
1306
+ url: `${apiBase}/untag_member/${member_id}/${tag_id}`,
1307
+ json: true,
1308
+ }));
1309
+ }
1310
+ else if (resource === 'tag' && operation === 'tag_resource') {
1311
+ const resource_id = this.getNodeParameter('resource_id', i);
1312
+ const tag_id = this.getNodeParameter('tag_id', i);
1313
+ const body = {};
1314
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1315
+ method: 'POST',
1316
+ url: `${apiBase}/tag_resource/${resource_id}/${tag_id}`,
1317
+ body,
1318
+ json: true,
1319
+ }));
1320
+ }
1321
+ else if (resource === 'tag' && operation === 'untag_resource') {
1322
+ const resource_id = this.getNodeParameter('resource_id', i);
1323
+ const tag_id = this.getNodeParameter('tag_id', i);
1324
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1325
+ method: 'DELETE',
1326
+ url: `${apiBase}/untag_resource/${resource_id}/${tag_id}`,
1327
+ json: true,
1328
+ }));
1329
+ }
1330
+ else if (resource === 'tag' && operation === 'tag_proposal') {
1331
+ const proposal_id = this.getNodeParameter('proposal_id', i);
1332
+ const tag_id = this.getNodeParameter('tag_id', i);
1333
+ const body = {};
1334
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1335
+ method: 'POST',
1336
+ url: `${apiBase}/tag_proposal/${proposal_id}/${tag_id}`,
1337
+ body,
1338
+ json: true,
1339
+ }));
1340
+ }
1341
+ else if (resource === 'tag' && operation === 'untag_proposal') {
1342
+ const proposal_id = this.getNodeParameter('proposal_id', i);
1343
+ const tag_id = this.getNodeParameter('tag_id', i);
1344
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1345
+ method: 'DELETE',
1346
+ url: `${apiBase}/untag_proposal/${proposal_id}/${tag_id}`,
1347
+ json: true,
1348
+ }));
1349
+ }
1350
+ else if (resource === 'tag' && operation === 'tag_work_item') {
1351
+ const work_item_id = this.getNodeParameter('work_item_id', i);
1352
+ const tag_id = this.getNodeParameter('tag_id', i);
1353
+ const body = {};
1354
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1355
+ method: 'POST',
1356
+ url: `${apiBase}/tag_project_work_item/${work_item_id}/${tag_id}`,
1357
+ body,
1358
+ json: true,
1359
+ }));
1360
+ }
1361
+ else if (resource === 'tag' && operation === 'untag_work_item') {
1362
+ const work_item_id = this.getNodeParameter('work_item_id', i);
1363
+ const tag_id = this.getNodeParameter('tag_id', i);
1364
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1365
+ method: 'DELETE',
1366
+ url: `${apiBase}/untag_project_work_item/${work_item_id}/${tag_id}`,
1367
+ json: true,
1368
+ }));
1369
+ }
1370
+ else if (resource === 'tag' && operation === 'tag_operational_item') {
1371
+ const work_item_id = this.getNodeParameter('work_item_id', i);
1372
+ const tag_id = this.getNodeParameter('tag_id', i);
1373
+ const body = {};
1374
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1375
+ method: 'POST',
1376
+ url: `${apiBase}/tag_operational_work_item/${work_item_id}/${tag_id}`,
1377
+ body,
1378
+ json: true,
1379
+ }));
1380
+ }
1381
+ else if (resource === 'tag' && operation === 'untag_operational_item') {
1382
+ const work_item_id = this.getNodeParameter('work_item_id', i);
1383
+ const tag_id = this.getNodeParameter('tag_id', i);
1384
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1385
+ method: 'DELETE',
1386
+ url: `${apiBase}/untag_operational_work_item/${work_item_id}/${tag_id}`,
1387
+ json: true,
1388
+ }));
1389
+ }
1390
+ else if (resource === 'label' && operation === 'list') {
1391
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1392
+ method: 'GET',
1393
+ url: `${apiBase}/labels`,
1394
+ json: true,
1395
+ }));
1396
+ }
1397
+ else if (resource === 'label' && operation === 'create') {
1398
+ const body = {};
1399
+ const name = this.getNodeParameter('name', i);
1400
+ if (name !== undefined && name !== '')
1401
+ body['name'] = name;
1402
+ const label_type = this.getNodeParameter('label_type', i, undefined);
1403
+ if (label_type !== undefined && label_type !== '')
1404
+ body['label_type'] = label_type;
1405
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1406
+ method: 'POST',
1407
+ url: `${apiBase}/add_label`,
1408
+ body,
1409
+ json: true,
1410
+ }));
1411
+ }
1412
+ else if (resource === 'label' && operation === 'update') {
1413
+ const label_id = this.getNodeParameter('label_id', i);
1414
+ const body = {};
1415
+ const name = this.getNodeParameter('name', i);
1416
+ if (name !== undefined && name !== '')
1417
+ body['name'] = name;
1418
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1419
+ method: 'PATCH',
1420
+ url: `${apiBase}/edit_label/${label_id}`,
1421
+ body,
1422
+ json: true,
1423
+ }));
1424
+ }
1425
+ else if (resource === 'label' && operation === 'delete') {
1426
+ const label_id = this.getNodeParameter('label_id', i);
1427
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1428
+ method: 'DELETE',
1429
+ url: `${apiBase}/delete_label/${label_id}`,
1430
+ json: true,
1431
+ }));
1432
+ }
1433
+ else if (resource === 'label' && operation === 'label_customer') {
1434
+ const body = {};
1435
+ const org = this.getNodeParameter('org', i);
1436
+ if (org !== undefined && org !== '')
1437
+ body['org'] = org;
1438
+ const label = this.getNodeParameter('label', i);
1439
+ if (label !== undefined && label !== '')
1440
+ body['label'] = label;
1441
+ const value_text = this.getNodeParameter('value_text', i, undefined);
1442
+ if (value_text !== undefined && value_text !== '')
1443
+ body['value_text'] = value_text;
1444
+ const value_integer = this.getNodeParameter('value_integer', i, undefined);
1445
+ if (value_integer !== undefined && value_integer !== '')
1446
+ body['value_integer'] = value_integer;
1447
+ const value_decimal = this.getNodeParameter('value_decimal', i, undefined);
1448
+ if (value_decimal !== undefined && value_decimal !== '')
1449
+ body['value_decimal'] = value_decimal;
1450
+ const value_date = this.getNodeParameter('value_date', i, undefined);
1451
+ if (value_date !== undefined && value_date !== '')
1452
+ body['value_date'] = value_date;
1453
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1454
+ method: 'POST',
1455
+ url: `${apiBase}/label_org`,
1456
+ body,
1457
+ json: true,
1458
+ }));
1459
+ }
1460
+ else if (resource === 'label' && operation === 'unlabel_customer') {
1461
+ const org_id = this.getNodeParameter('org_id', i);
1462
+ const label_id = this.getNodeParameter('label_id', i);
1463
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1464
+ method: 'DELETE',
1465
+ url: `${apiBase}/unlabel_org/${org_id}/${label_id}`,
1466
+ json: true,
1467
+ }));
1468
+ }
1469
+ else if (resource === 'label' && operation === 'label_member') {
1470
+ const body = {};
1471
+ const team = this.getNodeParameter('team', i);
1472
+ if (team !== undefined && team !== '')
1473
+ body['team'] = team;
1474
+ const label = this.getNodeParameter('label', i);
1475
+ if (label !== undefined && label !== '')
1476
+ body['label'] = label;
1477
+ const value_text = this.getNodeParameter('value_text', i, undefined);
1478
+ if (value_text !== undefined && value_text !== '')
1479
+ body['value_text'] = value_text;
1480
+ const value_integer = this.getNodeParameter('value_integer', i, undefined);
1481
+ if (value_integer !== undefined && value_integer !== '')
1482
+ body['value_integer'] = value_integer;
1483
+ const value_decimal = this.getNodeParameter('value_decimal', i, undefined);
1484
+ if (value_decimal !== undefined && value_decimal !== '')
1485
+ body['value_decimal'] = value_decimal;
1486
+ const value_date = this.getNodeParameter('value_date', i, undefined);
1487
+ if (value_date !== undefined && value_date !== '')
1488
+ body['value_date'] = value_date;
1489
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1490
+ method: 'POST',
1491
+ url: `${apiBase}/label_member`,
1492
+ body,
1493
+ json: true,
1494
+ }));
1495
+ }
1496
+ else if (resource === 'label' && operation === 'unlabel_member') {
1497
+ const member_id = this.getNodeParameter('member_id', i);
1498
+ const label_id = this.getNodeParameter('label_id', i);
1499
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1500
+ method: 'DELETE',
1501
+ url: `${apiBase}/unlabel_member/${member_id}/${label_id}`,
1502
+ json: true,
1503
+ }));
1504
+ }
1505
+ else if (resource === 'label' && operation === 'label_resource') {
1506
+ const body = {};
1507
+ const resource = this.getNodeParameter('resource', i);
1508
+ if (resource !== undefined && resource !== '')
1509
+ body['resource'] = resource;
1510
+ const label = this.getNodeParameter('label', i);
1511
+ if (label !== undefined && label !== '')
1512
+ body['label'] = label;
1513
+ const value_text = this.getNodeParameter('value_text', i, undefined);
1514
+ if (value_text !== undefined && value_text !== '')
1515
+ body['value_text'] = value_text;
1516
+ const value_integer = this.getNodeParameter('value_integer', i, undefined);
1517
+ if (value_integer !== undefined && value_integer !== '')
1518
+ body['value_integer'] = value_integer;
1519
+ const value_decimal = this.getNodeParameter('value_decimal', i, undefined);
1520
+ if (value_decimal !== undefined && value_decimal !== '')
1521
+ body['value_decimal'] = value_decimal;
1522
+ const value_date = this.getNodeParameter('value_date', i, undefined);
1523
+ if (value_date !== undefined && value_date !== '')
1524
+ body['value_date'] = value_date;
1525
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1526
+ method: 'POST',
1527
+ url: `${apiBase}/label_resource`,
1528
+ body,
1529
+ json: true,
1530
+ }));
1531
+ }
1532
+ else if (resource === 'label' && operation === 'unlabel_resource') {
1533
+ const resource_id = this.getNodeParameter('resource_id', i);
1534
+ const label_id = this.getNodeParameter('label_id', i);
1535
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1536
+ method: 'DELETE',
1537
+ url: `${apiBase}/unlabel_resource/${resource_id}/${label_id}`,
1538
+ json: true,
1539
+ }));
1540
+ }
1541
+ else if (resource === 'label' && operation === 'label_proposal') {
1542
+ const body = {};
1543
+ const proposal = this.getNodeParameter('proposal', i);
1544
+ if (proposal !== undefined && proposal !== '')
1545
+ body['proposal'] = proposal;
1546
+ const label = this.getNodeParameter('label', i);
1547
+ if (label !== undefined && label !== '')
1548
+ body['label'] = label;
1549
+ const value_text = this.getNodeParameter('value_text', i, undefined);
1550
+ if (value_text !== undefined && value_text !== '')
1551
+ body['value_text'] = value_text;
1552
+ const value_integer = this.getNodeParameter('value_integer', i, undefined);
1553
+ if (value_integer !== undefined && value_integer !== '')
1554
+ body['value_integer'] = value_integer;
1555
+ const value_decimal = this.getNodeParameter('value_decimal', i, undefined);
1556
+ if (value_decimal !== undefined && value_decimal !== '')
1557
+ body['value_decimal'] = value_decimal;
1558
+ const value_date = this.getNodeParameter('value_date', i, undefined);
1559
+ if (value_date !== undefined && value_date !== '')
1560
+ body['value_date'] = value_date;
1561
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1562
+ method: 'POST',
1563
+ url: `${apiBase}/label_proposal`,
1564
+ body,
1565
+ json: true,
1566
+ }));
1567
+ }
1568
+ else if (resource === 'label' && operation === 'unlabel_proposal') {
1569
+ const proposal_id = this.getNodeParameter('proposal_id', i);
1570
+ const label_id = this.getNodeParameter('label_id', i);
1571
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1572
+ method: 'DELETE',
1573
+ url: `${apiBase}/unlabel_proposal/${proposal_id}/${label_id}`,
1574
+ json: true,
1575
+ }));
1576
+ }
1577
+ else if (resource === 'label' && operation === 'label_work_item') {
1578
+ const body = {};
1579
+ const work_item = this.getNodeParameter('work_item', i);
1580
+ if (work_item !== undefined && work_item !== '')
1581
+ body['work_item'] = work_item;
1582
+ const label = this.getNodeParameter('label', i);
1583
+ if (label !== undefined && label !== '')
1584
+ body['label'] = label;
1585
+ const value_text = this.getNodeParameter('value_text', i, undefined);
1586
+ if (value_text !== undefined && value_text !== '')
1587
+ body['value_text'] = value_text;
1588
+ const value_integer = this.getNodeParameter('value_integer', i, undefined);
1589
+ if (value_integer !== undefined && value_integer !== '')
1590
+ body['value_integer'] = value_integer;
1591
+ const value_decimal = this.getNodeParameter('value_decimal', i, undefined);
1592
+ if (value_decimal !== undefined && value_decimal !== '')
1593
+ body['value_decimal'] = value_decimal;
1594
+ const value_date = this.getNodeParameter('value_date', i, undefined);
1595
+ if (value_date !== undefined && value_date !== '')
1596
+ body['value_date'] = value_date;
1597
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1598
+ method: 'POST',
1599
+ url: `${apiBase}/label_project_work_item`,
1600
+ body,
1601
+ json: true,
1602
+ }));
1603
+ }
1604
+ else if (resource === 'label' && operation === 'unlabel_work_item') {
1605
+ const work_item_id = this.getNodeParameter('work_item_id', i);
1606
+ const label_id = this.getNodeParameter('label_id', i);
1607
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1608
+ method: 'DELETE',
1609
+ url: `${apiBase}/unlabel_project_work_item/${work_item_id}/${label_id}`,
1610
+ json: true,
1611
+ }));
1612
+ }
1613
+ else if (resource === 'label' && operation === 'label_operational_item') {
1614
+ const body = {};
1615
+ const work_item = this.getNodeParameter('work_item', i);
1616
+ if (work_item !== undefined && work_item !== '')
1617
+ body['work_item'] = work_item;
1618
+ const label = this.getNodeParameter('label', i);
1619
+ if (label !== undefined && label !== '')
1620
+ body['label'] = label;
1621
+ const value_text = this.getNodeParameter('value_text', i, undefined);
1622
+ if (value_text !== undefined && value_text !== '')
1623
+ body['value_text'] = value_text;
1624
+ const value_integer = this.getNodeParameter('value_integer', i, undefined);
1625
+ if (value_integer !== undefined && value_integer !== '')
1626
+ body['value_integer'] = value_integer;
1627
+ const value_decimal = this.getNodeParameter('value_decimal', i, undefined);
1628
+ if (value_decimal !== undefined && value_decimal !== '')
1629
+ body['value_decimal'] = value_decimal;
1630
+ const value_date = this.getNodeParameter('value_date', i, undefined);
1631
+ if (value_date !== undefined && value_date !== '')
1632
+ body['value_date'] = value_date;
1633
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1634
+ method: 'POST',
1635
+ url: `${apiBase}/label_operational_work_item`,
1636
+ body,
1637
+ json: true,
1638
+ }));
1639
+ }
1640
+ else if (resource === 'label' && operation === 'unlabel_operational_item') {
1641
+ const work_item_id = this.getNodeParameter('work_item_id', i);
1642
+ const label_id = this.getNodeParameter('label_id', i);
1643
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1644
+ method: 'DELETE',
1645
+ url: `${apiBase}/unlabel_operational_work_item/${work_item_id}/${label_id}`,
1646
+ json: true,
1647
+ }));
1648
+ }
1649
+ else if (resource === 'resource' && operation === 'list') {
1650
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1651
+ method: 'GET',
1652
+ url: `${apiBase}/resource_types`,
1653
+ json: true,
1654
+ }));
1655
+ }
1656
+ else if (resource === 'resource' && operation === 'create') {
1657
+ const body = {};
1658
+ const name = this.getNodeParameter('name', i);
1659
+ if (name !== undefined && name !== '')
1660
+ body['name'] = name;
1661
+ const internal_code = this.getNodeParameter('internal_code', i, undefined);
1662
+ if (internal_code !== undefined && internal_code !== '')
1663
+ body['internal_code'] = internal_code;
1664
+ const description = this.getNodeParameter('description', i);
1665
+ if (description !== undefined && description !== '')
1666
+ body['description'] = description;
1667
+ const parent = this.getNodeParameter('parent', i, undefined);
1668
+ if (parent !== undefined && parent !== '')
1669
+ body['parent'] = parent;
1670
+ const timezone = this.getNodeParameter('timezone', i);
1671
+ if (timezone !== undefined && timezone !== '')
1672
+ body['timezone'] = timezone;
1673
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1674
+ method: 'POST',
1675
+ url: `${apiBase}/add_resource`,
1676
+ body,
1677
+ json: true,
1678
+ }));
1679
+ }
1680
+ else if (resource === 'resource' && operation === 'update') {
1681
+ const resource_id = this.getNodeParameter('resource_id', i);
1682
+ const body = {};
1683
+ const name = this.getNodeParameter('name', i);
1684
+ if (name !== undefined && name !== '')
1685
+ body['name'] = name;
1686
+ const internal_code = this.getNodeParameter('internal_code', i, undefined);
1687
+ if (internal_code !== undefined && internal_code !== '')
1688
+ body['internal_code'] = internal_code;
1689
+ const description = this.getNodeParameter('description', i);
1690
+ if (description !== undefined && description !== '')
1691
+ body['description'] = description;
1692
+ const parent = this.getNodeParameter('parent', i, undefined);
1693
+ if (parent !== undefined && parent !== '')
1694
+ body['parent'] = parent;
1695
+ const timezone = this.getNodeParameter('timezone', i);
1696
+ if (timezone !== undefined && timezone !== '')
1697
+ body['timezone'] = timezone;
1698
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1699
+ method: 'PATCH',
1700
+ url: `${apiBase}/edit_resource/${resource_id}`,
1701
+ body,
1702
+ json: true,
1703
+ }));
1704
+ }
1705
+ else if (resource === 'resource' && operation === 'delete') {
1706
+ const resource_id = this.getNodeParameter('resource_id', i);
1707
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1708
+ method: 'DELETE',
1709
+ url: `${apiBase}/delete_resource/${resource_id}`,
1710
+ json: true,
1711
+ }));
1712
+ }
1713
+ else if (resource === 'processDefinition' && operation === 'list') {
1714
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1715
+ method: 'GET',
1716
+ url: `${apiBase}/process_definitions`,
1717
+ json: true,
1718
+ }));
1719
+ }
1720
+ else if (resource === 'processDefinition' && operation === 'get') {
1721
+ const process_id = this.getNodeParameter('process_id', i);
1722
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1723
+ method: 'GET',
1724
+ url: `${apiBase}/process_definition/${process_id}`,
1725
+ json: true,
1726
+ }));
1727
+ }
1728
+ else if (resource === 'processDefinition' && operation === 'create') {
1729
+ const body = {};
1730
+ const name = this.getNodeParameter('name', i);
1731
+ if (name !== undefined && name !== '')
1732
+ body['name'] = name;
1733
+ const description = this.getNodeParameter('description', i, undefined);
1734
+ if (description !== undefined && description !== '')
1735
+ body['description'] = description;
1736
+ const is_active = this.getNodeParameter('is_active', i, undefined);
1737
+ if (is_active !== undefined && is_active !== '')
1738
+ body['is_active'] = is_active;
1739
+ const allow_backward_move = this.getNodeParameter('allow_backward_move', i, undefined);
1740
+ if (allow_backward_move !== undefined && allow_backward_move !== '')
1741
+ body['allow_backward_move'] = allow_backward_move;
1742
+ const allow_skip_move = this.getNodeParameter('allow_skip_move', i, undefined);
1743
+ if (allow_skip_move !== undefined && allow_skip_move !== '')
1744
+ body['allow_skip_move'] = allow_skip_move;
1745
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1746
+ method: 'POST',
1747
+ url: `${apiBase}/process_definition`,
1748
+ body,
1749
+ json: true,
1750
+ }));
1751
+ }
1752
+ else if (resource === 'processDefinition' && operation === 'update') {
1753
+ const process_id = this.getNodeParameter('process_id', i);
1754
+ const body = {};
1755
+ const name = this.getNodeParameter('name', i);
1756
+ if (name !== undefined && name !== '')
1757
+ body['name'] = name;
1758
+ const description = this.getNodeParameter('description', i, undefined);
1759
+ if (description !== undefined && description !== '')
1760
+ body['description'] = description;
1761
+ const is_active = this.getNodeParameter('is_active', i, undefined);
1762
+ if (is_active !== undefined && is_active !== '')
1763
+ body['is_active'] = is_active;
1764
+ const allow_backward_move = this.getNodeParameter('allow_backward_move', i, undefined);
1765
+ if (allow_backward_move !== undefined && allow_backward_move !== '')
1766
+ body['allow_backward_move'] = allow_backward_move;
1767
+ const allow_skip_move = this.getNodeParameter('allow_skip_move', i, undefined);
1768
+ if (allow_skip_move !== undefined && allow_skip_move !== '')
1769
+ body['allow_skip_move'] = allow_skip_move;
1770
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1771
+ method: 'PATCH',
1772
+ url: `${apiBase}/process_definition/${process_id}`,
1773
+ body,
1774
+ json: true,
1775
+ }));
1776
+ }
1777
+ else if (resource === 'processDefinition' && operation === 'delete') {
1778
+ const process_id = this.getNodeParameter('process_id', i);
1779
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1780
+ method: 'DELETE',
1781
+ url: `${apiBase}/process_definition/${process_id}`,
1782
+ json: true,
1783
+ }));
1784
+ }
1785
+ else if (resource === 'webhook' && operation === 'list') {
1786
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1787
+ method: 'GET',
1788
+ url: `${apiBase}/webhooks`,
1789
+ json: true,
1790
+ }));
1791
+ }
1792
+ else if (resource === 'webhook' && operation === 'create') {
1793
+ const body = {};
1794
+ const name = this.getNodeParameter('name', i);
1795
+ if (name !== undefined && name !== '')
1796
+ body['name'] = name;
1797
+ const target_url = this.getNodeParameter('target_url', i);
1798
+ if (target_url !== undefined && target_url !== '')
1799
+ body['target_url'] = target_url;
1800
+ const event_types = this.getNodeParameter('event_types', i, undefined);
1801
+ if (event_types !== undefined && event_types !== '')
1802
+ body['event_types'] = event_types;
1803
+ const is_active = this.getNodeParameter('is_active', i, undefined);
1804
+ if (is_active !== undefined && is_active !== '')
1805
+ body['is_active'] = is_active;
1806
+ const is_secure = this.getNodeParameter('is_secure', i, undefined);
1807
+ if (is_secure !== undefined && is_secure !== '')
1808
+ body['is_secure'] = is_secure;
1809
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1810
+ method: 'POST',
1811
+ url: `${apiBase}/add_webhook`,
1812
+ body,
1813
+ json: true,
1814
+ }));
1815
+ }
1816
+ else if (resource === 'webhook' && operation === 'update') {
1817
+ const webhook_id = this.getNodeParameter('webhook_id', i);
1818
+ const body = {};
1819
+ const name = this.getNodeParameter('name', i, undefined);
1820
+ if (name !== undefined && name !== '')
1821
+ body['name'] = name;
1822
+ const target_url = this.getNodeParameter('target_url', i, undefined);
1823
+ if (target_url !== undefined && target_url !== '')
1824
+ body['target_url'] = target_url;
1825
+ const event_types = this.getNodeParameter('event_types', i, undefined);
1826
+ if (event_types !== undefined && event_types !== '')
1827
+ body['event_types'] = event_types;
1828
+ const is_active = this.getNodeParameter('is_active', i, undefined);
1829
+ if (is_active !== undefined && is_active !== '')
1830
+ body['is_active'] = is_active;
1831
+ const is_secure = this.getNodeParameter('is_secure', i, undefined);
1832
+ if (is_secure !== undefined && is_secure !== '')
1833
+ body['is_secure'] = is_secure;
1834
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1835
+ method: 'PATCH',
1836
+ url: `${apiBase}/edit_webhook/${webhook_id}`,
1837
+ body,
1838
+ json: true,
1839
+ }));
1840
+ }
1841
+ else if (resource === 'webhook' && operation === 'delete') {
1842
+ const webhook_id = this.getNodeParameter('webhook_id', i);
1843
+ responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
1844
+ method: 'DELETE',
1845
+ url: `${apiBase}/delete_webhook/${webhook_id}`,
1846
+ json: true,
1847
+ }));
1848
+ }
1849
+ else {
1850
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource/operation: ${resource}/${operation}`);
1851
+ }
1852
+ returnData.push({ json: responseData });
1853
+ }
1854
+ catch (error) {
1855
+ if (this.continueOnFail()) {
1856
+ returnData.push({ json: { error: error.message } });
1857
+ continue;
1858
+ }
1859
+ throw error;
1860
+ }
1861
+ }
1862
+ return [returnData];
1863
+ }
1864
+ }
1865
+ exports.Proiectro = Proiectro;