n8n-nodes-nedzo 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +66 -0
- package/dist/credentials/NedzoApi.credentials.d.ts +8 -0
- package/dist/credentials/NedzoApi.credentials.d.ts.map +1 -0
- package/dist/credentials/NedzoApi.credentials.js +19 -0
- package/dist/credentials/NedzoApi.credentials.js.map +1 -0
- package/dist/nodes/Nedzo/GenericFunctions.d.ts +3 -0
- package/dist/nodes/Nedzo/GenericFunctions.d.ts.map +1 -0
- package/dist/nodes/Nedzo/GenericFunctions.js +28 -0
- package/dist/nodes/Nedzo/GenericFunctions.js.map +1 -0
- package/dist/nodes/Nedzo/Nedzo.node.d.ts +15 -0
- package/dist/nodes/Nedzo/Nedzo.node.d.ts.map +1 -0
- package/dist/nodes/Nedzo/Nedzo.node.js +1593 -0
- package/dist/nodes/Nedzo/Nedzo.node.js.map +1 -0
- package/dist/nodes/Nedzo/nedzo.svg +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,1593 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Nedzo = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
class Nedzo {
|
|
7
|
+
description = {
|
|
8
|
+
displayName: 'Nedzo',
|
|
9
|
+
name: 'nedzo',
|
|
10
|
+
icon: 'file:nedzo.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
14
|
+
description: 'Consume Nedzo API',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Nedzo',
|
|
17
|
+
},
|
|
18
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
19
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'nedzoApi',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: [
|
|
27
|
+
// Resource
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Resource',
|
|
30
|
+
name: 'resource',
|
|
31
|
+
type: 'options',
|
|
32
|
+
noDataExpression: true,
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
name: 'Agent',
|
|
36
|
+
value: 'agent',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Call',
|
|
40
|
+
value: 'call',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Contact',
|
|
44
|
+
value: 'contact',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Workspace',
|
|
48
|
+
value: 'workspace',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
default: 'call',
|
|
52
|
+
},
|
|
53
|
+
// Agent operations
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Operation',
|
|
56
|
+
name: 'operation',
|
|
57
|
+
type: 'options',
|
|
58
|
+
noDataExpression: true,
|
|
59
|
+
displayOptions: {
|
|
60
|
+
show: {
|
|
61
|
+
resource: ['agent'],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
options: [
|
|
65
|
+
{
|
|
66
|
+
name: 'Create',
|
|
67
|
+
value: 'create',
|
|
68
|
+
description: 'Create a new agent',
|
|
69
|
+
action: 'Create an agent',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Delete',
|
|
73
|
+
value: 'delete',
|
|
74
|
+
description: 'Delete an agent',
|
|
75
|
+
action: 'Delete an agent',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Get',
|
|
79
|
+
value: 'get',
|
|
80
|
+
description: 'Get an agent by ID',
|
|
81
|
+
action: 'Get an agent',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'Get Many',
|
|
85
|
+
value: 'getAll',
|
|
86
|
+
description: 'Get many agents',
|
|
87
|
+
action: 'Get many agents',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Update',
|
|
91
|
+
value: 'update',
|
|
92
|
+
description: 'Update an agent',
|
|
93
|
+
action: 'Update an agent',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
default: 'create',
|
|
97
|
+
},
|
|
98
|
+
// Call operations
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Operation',
|
|
101
|
+
name: 'operation',
|
|
102
|
+
type: 'options',
|
|
103
|
+
noDataExpression: true,
|
|
104
|
+
displayOptions: {
|
|
105
|
+
show: {
|
|
106
|
+
resource: ['call'],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
options: [
|
|
110
|
+
{
|
|
111
|
+
name: 'Create',
|
|
112
|
+
value: 'create',
|
|
113
|
+
description: 'Initiate an outbound call',
|
|
114
|
+
action: 'Initiate an outbound call',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
default: 'create',
|
|
118
|
+
},
|
|
119
|
+
// Contact operations
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Operation',
|
|
122
|
+
name: 'operation',
|
|
123
|
+
type: 'options',
|
|
124
|
+
noDataExpression: true,
|
|
125
|
+
displayOptions: {
|
|
126
|
+
show: {
|
|
127
|
+
resource: ['contact'],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
options: [
|
|
131
|
+
{
|
|
132
|
+
name: 'Create',
|
|
133
|
+
value: 'create',
|
|
134
|
+
description: 'Create a new contact',
|
|
135
|
+
action: 'Create a contact',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'Delete',
|
|
139
|
+
value: 'delete',
|
|
140
|
+
description: 'Delete a contact',
|
|
141
|
+
action: 'Delete a contact',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'Get',
|
|
145
|
+
value: 'get',
|
|
146
|
+
description: 'Get a contact by ID',
|
|
147
|
+
action: 'Get a contact',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'Get Many',
|
|
151
|
+
value: 'getAll',
|
|
152
|
+
description: 'Get many contacts',
|
|
153
|
+
action: 'Get many contacts',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'Update',
|
|
157
|
+
value: 'update',
|
|
158
|
+
description: 'Update a contact',
|
|
159
|
+
action: 'Update a contact',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
default: 'create',
|
|
163
|
+
},
|
|
164
|
+
// Workspace Operations
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Operation',
|
|
167
|
+
name: 'operation',
|
|
168
|
+
type: 'options',
|
|
169
|
+
noDataExpression: true,
|
|
170
|
+
displayOptions: {
|
|
171
|
+
show: {
|
|
172
|
+
resource: ['workspace'],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
options: [
|
|
176
|
+
{
|
|
177
|
+
name: 'Create',
|
|
178
|
+
value: 'create',
|
|
179
|
+
description: 'Create a new workspace',
|
|
180
|
+
action: 'Create a workspace',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'Delete',
|
|
184
|
+
value: 'delete',
|
|
185
|
+
description: 'Delete a workspace',
|
|
186
|
+
action: 'Delete a workspace',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'Get',
|
|
190
|
+
value: 'get',
|
|
191
|
+
description: 'Get a workspace by ID',
|
|
192
|
+
action: 'Get a workspace',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'Get Many',
|
|
196
|
+
value: 'getAll',
|
|
197
|
+
description: 'Get many workspaces',
|
|
198
|
+
action: 'Get many workspaces',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'Update',
|
|
202
|
+
value: 'update',
|
|
203
|
+
description: 'Update a workspace',
|
|
204
|
+
action: 'Update a workspace',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
default: 'create',
|
|
208
|
+
},
|
|
209
|
+
// ==================
|
|
210
|
+
// Agent Parameters
|
|
211
|
+
// ==================
|
|
212
|
+
// Agent: Create
|
|
213
|
+
{
|
|
214
|
+
displayName: 'Workspace',
|
|
215
|
+
name: 'workspaceId',
|
|
216
|
+
type: 'options',
|
|
217
|
+
required: true,
|
|
218
|
+
typeOptions: {
|
|
219
|
+
loadOptionsMethod: 'getWorkspaces',
|
|
220
|
+
},
|
|
221
|
+
displayOptions: {
|
|
222
|
+
show: {
|
|
223
|
+
resource: ['agent'],
|
|
224
|
+
operation: ['create'],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
default: '',
|
|
228
|
+
description: 'The workspace to create the agent in',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
displayName: 'Name',
|
|
232
|
+
name: 'name',
|
|
233
|
+
type: 'string',
|
|
234
|
+
required: true,
|
|
235
|
+
displayOptions: {
|
|
236
|
+
show: {
|
|
237
|
+
resource: ['agent'],
|
|
238
|
+
operation: ['create'],
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
default: '',
|
|
242
|
+
description: 'The name of the agent',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
displayName: 'Agent Type',
|
|
246
|
+
name: 'agentType',
|
|
247
|
+
type: 'options',
|
|
248
|
+
required: true,
|
|
249
|
+
displayOptions: {
|
|
250
|
+
show: {
|
|
251
|
+
resource: ['agent'],
|
|
252
|
+
operation: ['create'],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
options: [
|
|
256
|
+
{
|
|
257
|
+
name: 'Inbound Voice',
|
|
258
|
+
value: 'Inbound Voice',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'Outbound Voice',
|
|
262
|
+
value: 'Outbound Voice',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: 'Chat',
|
|
266
|
+
value: 'Chat',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'Widget',
|
|
270
|
+
value: 'Widget',
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
default: 'Inbound Voice',
|
|
274
|
+
description: 'The type of agent to create',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
displayName: 'Additional Fields',
|
|
278
|
+
name: 'additionalFields',
|
|
279
|
+
type: 'collection',
|
|
280
|
+
placeholder: 'Add Field',
|
|
281
|
+
default: {},
|
|
282
|
+
displayOptions: {
|
|
283
|
+
show: {
|
|
284
|
+
resource: ['agent'],
|
|
285
|
+
operation: ['create'],
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
options: [
|
|
289
|
+
{
|
|
290
|
+
displayName: 'Background Sound',
|
|
291
|
+
name: 'backgroundSound',
|
|
292
|
+
type: 'boolean',
|
|
293
|
+
default: true,
|
|
294
|
+
description: 'Whether to enable background sound (defaults to true)',
|
|
295
|
+
displayOptions: {
|
|
296
|
+
show: {
|
|
297
|
+
'/agentType': ['Inbound Voice', 'Outbound Voice'],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
displayName: 'Call Duration',
|
|
303
|
+
name: 'callDuration',
|
|
304
|
+
type: 'number',
|
|
305
|
+
typeOptions: {
|
|
306
|
+
minValue: 1,
|
|
307
|
+
maxValue: 60,
|
|
308
|
+
},
|
|
309
|
+
default: 30,
|
|
310
|
+
description: 'Maximum call duration in minutes (1-60, defaults to 30)',
|
|
311
|
+
displayOptions: {
|
|
312
|
+
show: {
|
|
313
|
+
'/agentType': ['Inbound Voice', 'Outbound Voice'],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
displayName: 'HIPAA Compliance',
|
|
319
|
+
name: 'hipaaCompliance',
|
|
320
|
+
type: 'boolean',
|
|
321
|
+
default: false,
|
|
322
|
+
description: 'Whether to enable HIPAA compliance mode (defaults to false). When enabled, no logs, recordings, or transcriptions will be stored.',
|
|
323
|
+
displayOptions: {
|
|
324
|
+
show: {
|
|
325
|
+
'/agentType': ['Inbound Voice', 'Outbound Voice'],
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
displayName: 'Language',
|
|
331
|
+
name: 'language',
|
|
332
|
+
type: 'options',
|
|
333
|
+
options: [
|
|
334
|
+
{ name: 'English', value: 'english' },
|
|
335
|
+
{ name: 'Spanish', value: 'spanish' },
|
|
336
|
+
{ name: 'French', value: 'french' },
|
|
337
|
+
{ name: 'German', value: 'german' },
|
|
338
|
+
{ name: 'Portuguese', value: 'portuguese' },
|
|
339
|
+
{ name: 'Dutch', value: 'dutch' },
|
|
340
|
+
{ name: 'Chinese', value: 'chinese' },
|
|
341
|
+
{ name: 'Japanese', value: 'japanese' },
|
|
342
|
+
],
|
|
343
|
+
default: 'english',
|
|
344
|
+
description: 'Agent language',
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
displayName: 'Opening Line',
|
|
348
|
+
name: 'openingLine',
|
|
349
|
+
type: 'string',
|
|
350
|
+
default: '',
|
|
351
|
+
description: 'Opening line the agent says when starting a conversation',
|
|
352
|
+
displayOptions: {
|
|
353
|
+
show: {
|
|
354
|
+
'/agentType': ['Inbound Voice', 'Outbound Voice'],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
displayName: 'Prompt',
|
|
360
|
+
name: 'prompt',
|
|
361
|
+
type: 'string',
|
|
362
|
+
typeOptions: {
|
|
363
|
+
rows: 4,
|
|
364
|
+
},
|
|
365
|
+
default: '',
|
|
366
|
+
description: 'System prompt for the agent',
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
displayName: 'Voice ID',
|
|
370
|
+
name: 'voiceId',
|
|
371
|
+
type: 'string',
|
|
372
|
+
default: '',
|
|
373
|
+
description: 'Voice ID for text-to-speech',
|
|
374
|
+
displayOptions: {
|
|
375
|
+
show: {
|
|
376
|
+
'/agentType': ['Inbound Voice', 'Outbound Voice'],
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
displayName: 'Voicemail',
|
|
382
|
+
name: 'voicemail',
|
|
383
|
+
type: 'boolean',
|
|
384
|
+
default: false,
|
|
385
|
+
description: 'Whether to enable voicemail detection (defaults to false)',
|
|
386
|
+
displayOptions: {
|
|
387
|
+
show: {
|
|
388
|
+
'/agentType': ['Outbound Voice'],
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
displayName: 'Voicemail Message',
|
|
394
|
+
name: 'voicemailMessage',
|
|
395
|
+
type: 'string',
|
|
396
|
+
default: '',
|
|
397
|
+
description: 'Message to leave on voicemail',
|
|
398
|
+
displayOptions: {
|
|
399
|
+
show: {
|
|
400
|
+
'/agentType': ['Outbound Voice'],
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
],
|
|
405
|
+
},
|
|
406
|
+
// Agent: Get, Delete
|
|
407
|
+
{
|
|
408
|
+
displayName: 'Agent ID',
|
|
409
|
+
name: 'agentId',
|
|
410
|
+
type: 'string',
|
|
411
|
+
required: true,
|
|
412
|
+
displayOptions: {
|
|
413
|
+
show: {
|
|
414
|
+
resource: ['agent'],
|
|
415
|
+
operation: ['get', 'delete'],
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
default: '',
|
|
419
|
+
description: 'The ID of the agent to retrieve or delete',
|
|
420
|
+
},
|
|
421
|
+
// Agent: Get Many
|
|
422
|
+
{
|
|
423
|
+
displayName: 'Workspace',
|
|
424
|
+
name: 'workspaceId',
|
|
425
|
+
type: 'options',
|
|
426
|
+
required: true,
|
|
427
|
+
typeOptions: {
|
|
428
|
+
loadOptionsMethod: 'getWorkspaces',
|
|
429
|
+
},
|
|
430
|
+
displayOptions: {
|
|
431
|
+
show: {
|
|
432
|
+
resource: ['agent'],
|
|
433
|
+
operation: ['getAll'],
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
default: '',
|
|
437
|
+
description: 'The workspace to list agents from',
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
displayName: 'Additional Fields',
|
|
441
|
+
name: 'additionalFields',
|
|
442
|
+
type: 'collection',
|
|
443
|
+
placeholder: 'Add Field',
|
|
444
|
+
default: {},
|
|
445
|
+
displayOptions: {
|
|
446
|
+
show: {
|
|
447
|
+
resource: ['agent'],
|
|
448
|
+
operation: ['getAll'],
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
options: [
|
|
452
|
+
{
|
|
453
|
+
displayName: 'Include Deleted',
|
|
454
|
+
name: 'includeDeleted',
|
|
455
|
+
type: 'boolean',
|
|
456
|
+
default: false,
|
|
457
|
+
description: 'Whether to include soft-deleted agents',
|
|
458
|
+
},
|
|
459
|
+
],
|
|
460
|
+
},
|
|
461
|
+
// Agent: Update
|
|
462
|
+
{
|
|
463
|
+
displayName: 'Agent ID',
|
|
464
|
+
name: 'agentId',
|
|
465
|
+
type: 'string',
|
|
466
|
+
required: true,
|
|
467
|
+
displayOptions: {
|
|
468
|
+
show: {
|
|
469
|
+
resource: ['agent'],
|
|
470
|
+
operation: ['update'],
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
default: '',
|
|
474
|
+
description: 'The ID of the agent to update',
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
displayName: 'Update Fields',
|
|
478
|
+
name: 'updateFields',
|
|
479
|
+
type: 'collection',
|
|
480
|
+
placeholder: 'Add Field',
|
|
481
|
+
default: {},
|
|
482
|
+
displayOptions: {
|
|
483
|
+
show: {
|
|
484
|
+
resource: ['agent'],
|
|
485
|
+
operation: ['update'],
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
options: [
|
|
489
|
+
{
|
|
490
|
+
displayName: 'Call Duration',
|
|
491
|
+
name: 'callDuration',
|
|
492
|
+
type: 'number',
|
|
493
|
+
typeOptions: {
|
|
494
|
+
minValue: 1,
|
|
495
|
+
maxValue: 60,
|
|
496
|
+
},
|
|
497
|
+
default: 30,
|
|
498
|
+
description: 'Maximum call duration in minutes (1-60)',
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
displayName: 'HIPAA Compliance',
|
|
502
|
+
name: 'hipaaCompliance',
|
|
503
|
+
type: 'boolean',
|
|
504
|
+
default: false,
|
|
505
|
+
description: 'Whether to enable HIPAA compliance mode',
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
displayName: 'Language',
|
|
509
|
+
name: 'language',
|
|
510
|
+
type: 'options',
|
|
511
|
+
options: [
|
|
512
|
+
{ name: 'English', value: 'english' },
|
|
513
|
+
{ name: 'Spanish', value: 'spanish' },
|
|
514
|
+
{ name: 'French', value: 'french' },
|
|
515
|
+
{ name: 'German', value: 'german' },
|
|
516
|
+
{ name: 'Portuguese', value: 'portuguese' },
|
|
517
|
+
{ name: 'Dutch', value: 'dutch' },
|
|
518
|
+
{ name: 'Chinese', value: 'chinese' },
|
|
519
|
+
{ name: 'Japanese', value: 'japanese' },
|
|
520
|
+
],
|
|
521
|
+
default: 'english',
|
|
522
|
+
description: 'Agent language',
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
displayName: 'Name',
|
|
526
|
+
name: 'name',
|
|
527
|
+
type: 'string',
|
|
528
|
+
default: '',
|
|
529
|
+
description: 'The name of the agent',
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
displayName: 'Prompt',
|
|
533
|
+
name: 'prompt',
|
|
534
|
+
type: 'string',
|
|
535
|
+
typeOptions: {
|
|
536
|
+
rows: 4,
|
|
537
|
+
},
|
|
538
|
+
default: '',
|
|
539
|
+
description: 'System prompt for the agent',
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
displayName: 'Voice Config (JSON)',
|
|
543
|
+
name: 'voiceConfig',
|
|
544
|
+
type: 'json',
|
|
545
|
+
default: '{}',
|
|
546
|
+
description: 'Voice configuration settings as JSON',
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
},
|
|
550
|
+
// ==================
|
|
551
|
+
// Call Parameters
|
|
552
|
+
// ==================
|
|
553
|
+
// Call: Create
|
|
554
|
+
{
|
|
555
|
+
displayName: 'Agent ID',
|
|
556
|
+
name: 'agentId',
|
|
557
|
+
type: 'string',
|
|
558
|
+
required: true,
|
|
559
|
+
displayOptions: {
|
|
560
|
+
show: {
|
|
561
|
+
resource: ['call'],
|
|
562
|
+
operation: ['create'],
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
default: '',
|
|
566
|
+
placeholder: 'e.g. eecbbbaf-d2c6-4b49-b36f-9d0bb503dd75',
|
|
567
|
+
description: 'UUID of the agent to use for the call',
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
displayName: 'Call Type',
|
|
571
|
+
name: 'callType',
|
|
572
|
+
type: 'options',
|
|
573
|
+
required: true,
|
|
574
|
+
displayOptions: {
|
|
575
|
+
show: {
|
|
576
|
+
resource: ['call'],
|
|
577
|
+
operation: ['create'],
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
options: [
|
|
581
|
+
{
|
|
582
|
+
name: 'Phone Number',
|
|
583
|
+
value: 'phoneNumber',
|
|
584
|
+
description: 'Call a phone number directly',
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
name: 'Contact',
|
|
588
|
+
value: 'contact',
|
|
589
|
+
description: 'Call a contact by ID',
|
|
590
|
+
},
|
|
591
|
+
],
|
|
592
|
+
default: 'phoneNumber',
|
|
593
|
+
description: 'Whether to call a phone number directly or a contact',
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
displayName: 'Phone Number',
|
|
597
|
+
name: 'phoneNumber',
|
|
598
|
+
type: 'string',
|
|
599
|
+
required: true,
|
|
600
|
+
displayOptions: {
|
|
601
|
+
show: {
|
|
602
|
+
resource: ['call'],
|
|
603
|
+
operation: ['create'],
|
|
604
|
+
callType: ['phoneNumber'],
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
default: '',
|
|
608
|
+
placeholder: '+14155551234',
|
|
609
|
+
description: 'Phone number to call in E.164 format (e.g., +14155551234)',
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
displayName: 'Contact ID',
|
|
613
|
+
name: 'contactId',
|
|
614
|
+
type: 'string',
|
|
615
|
+
required: true,
|
|
616
|
+
displayOptions: {
|
|
617
|
+
show: {
|
|
618
|
+
resource: ['call'],
|
|
619
|
+
operation: ['create'],
|
|
620
|
+
callType: ['contact'],
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
default: '',
|
|
624
|
+
description: 'The ID of the contact to call',
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
displayName: 'Additional Fields',
|
|
628
|
+
name: 'additionalFields',
|
|
629
|
+
type: 'collection',
|
|
630
|
+
placeholder: 'Add Field',
|
|
631
|
+
default: {},
|
|
632
|
+
displayOptions: {
|
|
633
|
+
show: {
|
|
634
|
+
resource: ['call'],
|
|
635
|
+
operation: ['create'],
|
|
636
|
+
callType: ['phoneNumber'],
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
options: [
|
|
640
|
+
{
|
|
641
|
+
displayName: 'Business Name',
|
|
642
|
+
name: 'businessName',
|
|
643
|
+
type: 'string',
|
|
644
|
+
default: '',
|
|
645
|
+
description: 'Business or company name',
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
displayName: 'Custom Fields (JSON)',
|
|
649
|
+
name: 'customFields',
|
|
650
|
+
type: 'json',
|
|
651
|
+
default: '{}',
|
|
652
|
+
description: 'Custom field values by field name. Field names must match existing custom field definitions.',
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
displayName: 'Email',
|
|
656
|
+
name: 'email',
|
|
657
|
+
type: 'string',
|
|
658
|
+
placeholder: 'name@email.com',
|
|
659
|
+
default: '',
|
|
660
|
+
description: 'Email address',
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
displayName: 'First Name',
|
|
664
|
+
name: 'firstName',
|
|
665
|
+
type: 'string',
|
|
666
|
+
default: '',
|
|
667
|
+
description: 'First name',
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
displayName: 'Last Name',
|
|
671
|
+
name: 'lastName',
|
|
672
|
+
type: 'string',
|
|
673
|
+
default: '',
|
|
674
|
+
description: 'Last name',
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
displayName: 'Variables (JSON)',
|
|
678
|
+
name: 'variables',
|
|
679
|
+
type: 'json',
|
|
680
|
+
default: '{}',
|
|
681
|
+
description: 'Custom variables to pass to the assistant. These override contact field values.',
|
|
682
|
+
},
|
|
683
|
+
],
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
displayName: 'Additional Fields',
|
|
687
|
+
name: 'additionalFields',
|
|
688
|
+
type: 'collection',
|
|
689
|
+
placeholder: 'Add Field',
|
|
690
|
+
default: {},
|
|
691
|
+
displayOptions: {
|
|
692
|
+
show: {
|
|
693
|
+
resource: ['call'],
|
|
694
|
+
operation: ['create'],
|
|
695
|
+
callType: ['contact'],
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
options: [
|
|
699
|
+
{
|
|
700
|
+
displayName: 'Variables (JSON)',
|
|
701
|
+
name: 'variables',
|
|
702
|
+
type: 'json',
|
|
703
|
+
default: '{}',
|
|
704
|
+
description: 'Custom variables to pass to the assistant. These override contact field values.',
|
|
705
|
+
},
|
|
706
|
+
],
|
|
707
|
+
},
|
|
708
|
+
// ==================
|
|
709
|
+
// Contact Parameters
|
|
710
|
+
// ==================
|
|
711
|
+
// Contact: Create
|
|
712
|
+
{
|
|
713
|
+
displayName: 'Workspace',
|
|
714
|
+
name: 'workspaceId',
|
|
715
|
+
type: 'options',
|
|
716
|
+
required: true,
|
|
717
|
+
typeOptions: {
|
|
718
|
+
loadOptionsMethod: 'getWorkspaces',
|
|
719
|
+
},
|
|
720
|
+
displayOptions: {
|
|
721
|
+
show: {
|
|
722
|
+
resource: ['contact'],
|
|
723
|
+
operation: ['create'],
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
default: '',
|
|
727
|
+
description: 'The workspace to create the contact in',
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
displayName: 'Additional Fields',
|
|
731
|
+
name: 'additionalFields',
|
|
732
|
+
type: 'collection',
|
|
733
|
+
placeholder: 'Add Field',
|
|
734
|
+
default: {},
|
|
735
|
+
displayOptions: {
|
|
736
|
+
show: {
|
|
737
|
+
resource: ['contact'],
|
|
738
|
+
operation: ['create'],
|
|
739
|
+
},
|
|
740
|
+
},
|
|
741
|
+
options: [
|
|
742
|
+
{
|
|
743
|
+
displayName: 'Email',
|
|
744
|
+
name: 'email',
|
|
745
|
+
type: 'string',
|
|
746
|
+
placeholder: 'name@email.com',
|
|
747
|
+
default: '',
|
|
748
|
+
description: 'Contact email address',
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
displayName: 'First Name',
|
|
752
|
+
name: 'firstName',
|
|
753
|
+
type: 'string',
|
|
754
|
+
default: '',
|
|
755
|
+
description: 'Contact first name',
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
displayName: 'Last Name',
|
|
759
|
+
name: 'lastName',
|
|
760
|
+
type: 'string',
|
|
761
|
+
default: '',
|
|
762
|
+
description: 'Contact last name',
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
displayName: 'Phone',
|
|
766
|
+
name: 'phone',
|
|
767
|
+
type: 'string',
|
|
768
|
+
default: '',
|
|
769
|
+
description: 'Contact phone number',
|
|
770
|
+
},
|
|
771
|
+
],
|
|
772
|
+
},
|
|
773
|
+
// Contact: Get, Delete
|
|
774
|
+
{
|
|
775
|
+
displayName: 'Contact ID',
|
|
776
|
+
name: 'contactId',
|
|
777
|
+
type: 'string',
|
|
778
|
+
required: true,
|
|
779
|
+
displayOptions: {
|
|
780
|
+
show: {
|
|
781
|
+
resource: ['contact'],
|
|
782
|
+
operation: ['get', 'delete'],
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
default: '',
|
|
786
|
+
description: 'The ID of the contact to retrieve or delete',
|
|
787
|
+
},
|
|
788
|
+
// Contact: Get Many
|
|
789
|
+
{
|
|
790
|
+
displayName: 'Workspace',
|
|
791
|
+
name: 'workspaceId',
|
|
792
|
+
type: 'options',
|
|
793
|
+
required: true,
|
|
794
|
+
typeOptions: {
|
|
795
|
+
loadOptionsMethod: 'getWorkspaces',
|
|
796
|
+
},
|
|
797
|
+
displayOptions: {
|
|
798
|
+
show: {
|
|
799
|
+
resource: ['contact'],
|
|
800
|
+
operation: ['getAll'],
|
|
801
|
+
},
|
|
802
|
+
},
|
|
803
|
+
default: '',
|
|
804
|
+
description: 'The workspace to list contacts from',
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
displayName: 'Additional Fields',
|
|
808
|
+
name: 'additionalFields',
|
|
809
|
+
type: 'collection',
|
|
810
|
+
placeholder: 'Add Field',
|
|
811
|
+
default: {},
|
|
812
|
+
displayOptions: {
|
|
813
|
+
show: {
|
|
814
|
+
resource: ['contact'],
|
|
815
|
+
operation: ['getAll'],
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
options: [
|
|
819
|
+
{
|
|
820
|
+
displayName: 'Include Deleted',
|
|
821
|
+
name: 'includeDeleted',
|
|
822
|
+
type: 'boolean',
|
|
823
|
+
default: false,
|
|
824
|
+
description: 'Whether to include soft-deleted contacts',
|
|
825
|
+
},
|
|
826
|
+
],
|
|
827
|
+
},
|
|
828
|
+
// Contact: Update
|
|
829
|
+
{
|
|
830
|
+
displayName: 'Contact ID',
|
|
831
|
+
name: 'contactId',
|
|
832
|
+
type: 'string',
|
|
833
|
+
required: true,
|
|
834
|
+
displayOptions: {
|
|
835
|
+
show: {
|
|
836
|
+
resource: ['contact'],
|
|
837
|
+
operation: ['update'],
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
default: '',
|
|
841
|
+
description: 'The contact to update',
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
displayName: 'Update Fields',
|
|
845
|
+
name: 'updateFields',
|
|
846
|
+
type: 'collection',
|
|
847
|
+
placeholder: 'Add Field',
|
|
848
|
+
default: {},
|
|
849
|
+
displayOptions: {
|
|
850
|
+
show: {
|
|
851
|
+
resource: ['contact'],
|
|
852
|
+
operation: ['update'],
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
options: [
|
|
856
|
+
{
|
|
857
|
+
displayName: 'Email',
|
|
858
|
+
name: 'email',
|
|
859
|
+
type: 'string',
|
|
860
|
+
placeholder: 'name@email.com',
|
|
861
|
+
default: '',
|
|
862
|
+
description: 'Contact email address',
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
displayName: 'First Name',
|
|
866
|
+
name: 'firstName',
|
|
867
|
+
type: 'string',
|
|
868
|
+
default: '',
|
|
869
|
+
description: 'Contact first name',
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
displayName: 'Last Name',
|
|
873
|
+
name: 'lastName',
|
|
874
|
+
type: 'string',
|
|
875
|
+
default: '',
|
|
876
|
+
description: 'Contact last name',
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
displayName: 'Phone',
|
|
880
|
+
name: 'phone',
|
|
881
|
+
type: 'string',
|
|
882
|
+
default: '',
|
|
883
|
+
description: 'Contact phone number',
|
|
884
|
+
},
|
|
885
|
+
],
|
|
886
|
+
},
|
|
887
|
+
// ==================
|
|
888
|
+
// Workspace Parameters
|
|
889
|
+
// ==================
|
|
890
|
+
// Workspace: Create
|
|
891
|
+
{
|
|
892
|
+
displayName: 'Name',
|
|
893
|
+
name: 'name',
|
|
894
|
+
type: 'string',
|
|
895
|
+
required: true,
|
|
896
|
+
displayOptions: {
|
|
897
|
+
show: {
|
|
898
|
+
resource: ['workspace'],
|
|
899
|
+
operation: ['create'],
|
|
900
|
+
},
|
|
901
|
+
},
|
|
902
|
+
default: '',
|
|
903
|
+
description: 'The name of the workspace',
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
displayName: 'Additional Fields',
|
|
907
|
+
name: 'additionalFields',
|
|
908
|
+
type: 'collection',
|
|
909
|
+
placeholder: 'Add Field',
|
|
910
|
+
default: {},
|
|
911
|
+
displayOptions: {
|
|
912
|
+
show: {
|
|
913
|
+
resource: ['workspace'],
|
|
914
|
+
operation: ['create'],
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
options: [
|
|
918
|
+
{
|
|
919
|
+
displayName: 'Business Registration Number',
|
|
920
|
+
name: 'businessRegistrationNumber',
|
|
921
|
+
type: 'string',
|
|
922
|
+
default: '',
|
|
923
|
+
description: 'Business registration number (EIN, VAT, etc.)',
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
displayName: 'Contact Email',
|
|
927
|
+
name: 'contactEmail',
|
|
928
|
+
type: 'string',
|
|
929
|
+
placeholder: 'name@email.com',
|
|
930
|
+
default: '',
|
|
931
|
+
description: 'Contact email for the workspace',
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
displayName: 'Contact Name',
|
|
935
|
+
name: 'contactName',
|
|
936
|
+
type: 'string',
|
|
937
|
+
default: '',
|
|
938
|
+
description: 'Contact name for the workspace',
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
displayName: 'Contact Phone',
|
|
942
|
+
name: 'contactPhone',
|
|
943
|
+
type: 'string',
|
|
944
|
+
default: '',
|
|
945
|
+
description: 'Contact phone for the workspace',
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
displayName: 'Country',
|
|
949
|
+
name: 'country',
|
|
950
|
+
type: 'string',
|
|
951
|
+
default: '',
|
|
952
|
+
placeholder: 'US',
|
|
953
|
+
description: 'Country for the workspace',
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
displayName: 'Description',
|
|
957
|
+
name: 'description',
|
|
958
|
+
type: 'string',
|
|
959
|
+
typeOptions: {
|
|
960
|
+
rows: 2,
|
|
961
|
+
},
|
|
962
|
+
default: '',
|
|
963
|
+
description: 'Workspace description',
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
displayName: 'Icon',
|
|
967
|
+
name: 'icon',
|
|
968
|
+
type: 'string',
|
|
969
|
+
default: '',
|
|
970
|
+
description: 'Workspace icon URL or identifier',
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
displayName: 'State',
|
|
974
|
+
name: 'state',
|
|
975
|
+
type: 'string',
|
|
976
|
+
default: '',
|
|
977
|
+
placeholder: 'NY',
|
|
978
|
+
description: 'State/province for the workspace',
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
displayName: 'Street Address',
|
|
982
|
+
name: 'streetAddress',
|
|
983
|
+
type: 'string',
|
|
984
|
+
default: '',
|
|
985
|
+
placeholder: '123 Main St',
|
|
986
|
+
description: 'Street address for the workspace',
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
displayName: 'Timezone',
|
|
990
|
+
name: 'timezone',
|
|
991
|
+
type: 'string',
|
|
992
|
+
default: '',
|
|
993
|
+
placeholder: 'America/New_York',
|
|
994
|
+
description: 'Workspace timezone in IANA format',
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
displayName: 'ZIP',
|
|
998
|
+
name: 'zip',
|
|
999
|
+
type: 'string',
|
|
1000
|
+
default: '',
|
|
1001
|
+
placeholder: '10001',
|
|
1002
|
+
description: 'ZIP/postal code for the workspace',
|
|
1003
|
+
},
|
|
1004
|
+
],
|
|
1005
|
+
},
|
|
1006
|
+
// Workspace: Get, Delete
|
|
1007
|
+
{
|
|
1008
|
+
displayName: 'Workspace ID',
|
|
1009
|
+
name: 'workspaceId',
|
|
1010
|
+
type: 'string',
|
|
1011
|
+
required: true,
|
|
1012
|
+
displayOptions: {
|
|
1013
|
+
show: {
|
|
1014
|
+
resource: ['workspace'],
|
|
1015
|
+
operation: ['get', 'delete'],
|
|
1016
|
+
},
|
|
1017
|
+
},
|
|
1018
|
+
default: '',
|
|
1019
|
+
description: 'The ID of the workspace to retrieve or delete',
|
|
1020
|
+
},
|
|
1021
|
+
// Workspace: Update
|
|
1022
|
+
{
|
|
1023
|
+
displayName: 'Workspace ID',
|
|
1024
|
+
name: 'workspaceId',
|
|
1025
|
+
type: 'string',
|
|
1026
|
+
required: true,
|
|
1027
|
+
displayOptions: {
|
|
1028
|
+
show: {
|
|
1029
|
+
resource: ['workspace'],
|
|
1030
|
+
operation: ['update'],
|
|
1031
|
+
},
|
|
1032
|
+
},
|
|
1033
|
+
default: '',
|
|
1034
|
+
description: 'The ID of the workspace to update',
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
displayName: 'Update Fields',
|
|
1038
|
+
name: 'updateFields',
|
|
1039
|
+
type: 'collection',
|
|
1040
|
+
placeholder: 'Add Field',
|
|
1041
|
+
default: {},
|
|
1042
|
+
displayOptions: {
|
|
1043
|
+
show: {
|
|
1044
|
+
resource: ['workspace'],
|
|
1045
|
+
operation: ['update'],
|
|
1046
|
+
},
|
|
1047
|
+
},
|
|
1048
|
+
options: [
|
|
1049
|
+
{
|
|
1050
|
+
displayName: 'Business Registration Number',
|
|
1051
|
+
name: 'businessRegistrationNumber',
|
|
1052
|
+
type: 'string',
|
|
1053
|
+
default: '',
|
|
1054
|
+
description: 'Business registration number (EIN, VAT, etc.)',
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
displayName: 'Contact Email',
|
|
1058
|
+
name: 'contactEmail',
|
|
1059
|
+
type: 'string',
|
|
1060
|
+
placeholder: 'name@email.com',
|
|
1061
|
+
default: '',
|
|
1062
|
+
description: 'Contact email for the workspace',
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
displayName: 'Contact Name',
|
|
1066
|
+
name: 'contactName',
|
|
1067
|
+
type: 'string',
|
|
1068
|
+
default: '',
|
|
1069
|
+
description: 'Contact name for the workspace',
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
displayName: 'Contact Phone',
|
|
1073
|
+
name: 'contactPhone',
|
|
1074
|
+
type: 'string',
|
|
1075
|
+
default: '',
|
|
1076
|
+
description: 'Contact phone for the workspace',
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
displayName: 'Country',
|
|
1080
|
+
name: 'country',
|
|
1081
|
+
type: 'string',
|
|
1082
|
+
default: '',
|
|
1083
|
+
placeholder: 'US',
|
|
1084
|
+
description: 'Country for the workspace',
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
displayName: 'Description',
|
|
1088
|
+
name: 'description',
|
|
1089
|
+
type: 'string',
|
|
1090
|
+
typeOptions: {
|
|
1091
|
+
rows: 2,
|
|
1092
|
+
},
|
|
1093
|
+
default: '',
|
|
1094
|
+
description: 'Workspace description',
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
displayName: 'Icon',
|
|
1098
|
+
name: 'icon',
|
|
1099
|
+
type: 'string',
|
|
1100
|
+
default: '',
|
|
1101
|
+
description: 'Workspace icon URL or identifier',
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
displayName: 'Name',
|
|
1105
|
+
name: 'name',
|
|
1106
|
+
type: 'string',
|
|
1107
|
+
default: '',
|
|
1108
|
+
description: 'The name of the workspace',
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
displayName: 'State',
|
|
1112
|
+
name: 'state',
|
|
1113
|
+
type: 'string',
|
|
1114
|
+
default: '',
|
|
1115
|
+
placeholder: 'NY',
|
|
1116
|
+
description: 'State/province for the workspace',
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
displayName: 'Street Address',
|
|
1120
|
+
name: 'streetAddress',
|
|
1121
|
+
type: 'string',
|
|
1122
|
+
default: '',
|
|
1123
|
+
placeholder: '123 Main St',
|
|
1124
|
+
description: 'Street address for the workspace',
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
displayName: 'Timezone',
|
|
1128
|
+
name: 'timezone',
|
|
1129
|
+
type: 'string',
|
|
1130
|
+
default: '',
|
|
1131
|
+
placeholder: 'America/New_York',
|
|
1132
|
+
description: 'Workspace timezone in IANA format',
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
displayName: 'ZIP',
|
|
1136
|
+
name: 'zip',
|
|
1137
|
+
type: 'string',
|
|
1138
|
+
default: '',
|
|
1139
|
+
placeholder: '10001',
|
|
1140
|
+
description: 'ZIP/postal code for the workspace',
|
|
1141
|
+
},
|
|
1142
|
+
],
|
|
1143
|
+
},
|
|
1144
|
+
],
|
|
1145
|
+
};
|
|
1146
|
+
methods = {
|
|
1147
|
+
loadOptions: {
|
|
1148
|
+
async getWorkspaces() {
|
|
1149
|
+
const returnData = [];
|
|
1150
|
+
const workspaces = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/workspaces');
|
|
1151
|
+
if (Array.isArray(workspaces)) {
|
|
1152
|
+
for (const workspace of workspaces) {
|
|
1153
|
+
returnData.push({
|
|
1154
|
+
name: workspace.name,
|
|
1155
|
+
value: workspace.id,
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
return returnData;
|
|
1160
|
+
},
|
|
1161
|
+
async getAgents() {
|
|
1162
|
+
const returnData = [];
|
|
1163
|
+
const workspaceId = this.getCurrentNodeParameter('workspaceId');
|
|
1164
|
+
if (!workspaceId) {
|
|
1165
|
+
return returnData;
|
|
1166
|
+
}
|
|
1167
|
+
const agents = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/agents', {}, { workspaceId });
|
|
1168
|
+
if (Array.isArray(agents)) {
|
|
1169
|
+
for (const agent of agents) {
|
|
1170
|
+
returnData.push({
|
|
1171
|
+
name: agent.name,
|
|
1172
|
+
value: agent.id,
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return returnData;
|
|
1177
|
+
},
|
|
1178
|
+
async getAllAgents() {
|
|
1179
|
+
const returnData = [];
|
|
1180
|
+
// First get all workspaces
|
|
1181
|
+
const workspaces = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/workspaces');
|
|
1182
|
+
if (Array.isArray(workspaces)) {
|
|
1183
|
+
// Then fetch agents for each workspace
|
|
1184
|
+
for (const workspace of workspaces) {
|
|
1185
|
+
const workspaceId = workspace.id;
|
|
1186
|
+
const workspaceName = workspace.name;
|
|
1187
|
+
// Fetch agents for this workspace
|
|
1188
|
+
const agents = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/agents', {}, { workspaceId });
|
|
1189
|
+
if (Array.isArray(agents)) {
|
|
1190
|
+
for (const agent of agents) {
|
|
1191
|
+
// Include workspace name if multiple workspaces
|
|
1192
|
+
const agentName = workspaces.length > 1 ? `${agent.name} (${workspaceName})` : agent.name;
|
|
1193
|
+
returnData.push({
|
|
1194
|
+
name: agentName,
|
|
1195
|
+
value: agent.id,
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
return returnData;
|
|
1202
|
+
},
|
|
1203
|
+
async getContacts() {
|
|
1204
|
+
const returnData = [];
|
|
1205
|
+
const workspaceId = this.getCurrentNodeParameter('workspaceId');
|
|
1206
|
+
if (!workspaceId) {
|
|
1207
|
+
return returnData;
|
|
1208
|
+
}
|
|
1209
|
+
const contacts = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/contacts', {}, { workspaceId });
|
|
1210
|
+
if (Array.isArray(contacts)) {
|
|
1211
|
+
for (const contact of contacts) {
|
|
1212
|
+
// Build a display name from available fields
|
|
1213
|
+
let contactName = '';
|
|
1214
|
+
if (contact.firstName || contact.lastName) {
|
|
1215
|
+
contactName = [contact.firstName, contact.lastName].filter(Boolean).join(' ');
|
|
1216
|
+
}
|
|
1217
|
+
else if (contact.email) {
|
|
1218
|
+
contactName = contact.email;
|
|
1219
|
+
}
|
|
1220
|
+
else if (contact.phone) {
|
|
1221
|
+
contactName = contact.phone;
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
contactName = contact.id;
|
|
1225
|
+
}
|
|
1226
|
+
returnData.push({
|
|
1227
|
+
name: contactName,
|
|
1228
|
+
value: contact.id,
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return returnData;
|
|
1233
|
+
},
|
|
1234
|
+
async getAllContacts() {
|
|
1235
|
+
const returnData = [];
|
|
1236
|
+
// Get workspaces accessible to the API key
|
|
1237
|
+
const workspaces = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/workspaces');
|
|
1238
|
+
if (Array.isArray(workspaces)) {
|
|
1239
|
+
// Get contacts from each workspace
|
|
1240
|
+
for (const workspace of workspaces) {
|
|
1241
|
+
const contacts = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/contacts', {}, { workspaceId: workspace.id });
|
|
1242
|
+
if (Array.isArray(contacts)) {
|
|
1243
|
+
for (const contact of contacts) {
|
|
1244
|
+
// Build a display name from available fields
|
|
1245
|
+
let contactName = '';
|
|
1246
|
+
if (contact.firstName || contact.lastName) {
|
|
1247
|
+
contactName = [contact.firstName, contact.lastName].filter(Boolean).join(' ');
|
|
1248
|
+
}
|
|
1249
|
+
else if (contact.email) {
|
|
1250
|
+
contactName = contact.email;
|
|
1251
|
+
}
|
|
1252
|
+
else if (contact.phone) {
|
|
1253
|
+
contactName = contact.phone;
|
|
1254
|
+
}
|
|
1255
|
+
else {
|
|
1256
|
+
contactName = contact.id;
|
|
1257
|
+
}
|
|
1258
|
+
// Include workspace name if multiple workspaces
|
|
1259
|
+
const displayName = workspaces.length > 1 ? `${contactName} (${workspace.name})` : contactName;
|
|
1260
|
+
returnData.push({
|
|
1261
|
+
name: displayName,
|
|
1262
|
+
value: contact.id,
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
return returnData;
|
|
1269
|
+
},
|
|
1270
|
+
},
|
|
1271
|
+
};
|
|
1272
|
+
async execute() {
|
|
1273
|
+
const items = this.getInputData();
|
|
1274
|
+
const returnData = [];
|
|
1275
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
1276
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
1277
|
+
for (let i = 0; i < items.length; i++) {
|
|
1278
|
+
try {
|
|
1279
|
+
let responseData;
|
|
1280
|
+
// Agent
|
|
1281
|
+
if (resource === 'agent') {
|
|
1282
|
+
if (operation === 'create') {
|
|
1283
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1284
|
+
const name = this.getNodeParameter('name', i);
|
|
1285
|
+
const agentType = this.getNodeParameter('agentType', i);
|
|
1286
|
+
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
1287
|
+
const body = {
|
|
1288
|
+
workspaceId,
|
|
1289
|
+
name,
|
|
1290
|
+
agentType,
|
|
1291
|
+
};
|
|
1292
|
+
if (additionalFields.prompt) {
|
|
1293
|
+
body.prompt = additionalFields.prompt;
|
|
1294
|
+
}
|
|
1295
|
+
if (additionalFields.language) {
|
|
1296
|
+
body.language = additionalFields.language;
|
|
1297
|
+
}
|
|
1298
|
+
if (additionalFields.hipaaCompliance !== undefined) {
|
|
1299
|
+
body.hipaaCompliance = additionalFields.hipaaCompliance;
|
|
1300
|
+
}
|
|
1301
|
+
if (additionalFields.callDuration !== undefined) {
|
|
1302
|
+
body.callDuration = additionalFields.callDuration;
|
|
1303
|
+
}
|
|
1304
|
+
if (additionalFields.openingLine) {
|
|
1305
|
+
body.openingLine = additionalFields.openingLine;
|
|
1306
|
+
}
|
|
1307
|
+
if (additionalFields.voiceId) {
|
|
1308
|
+
body.voiceId = additionalFields.voiceId;
|
|
1309
|
+
}
|
|
1310
|
+
if (additionalFields.backgroundSound !== undefined) {
|
|
1311
|
+
body.backgroundSound = additionalFields.backgroundSound;
|
|
1312
|
+
}
|
|
1313
|
+
if (additionalFields.voicemail !== undefined) {
|
|
1314
|
+
body.voicemail = additionalFields.voicemail;
|
|
1315
|
+
}
|
|
1316
|
+
if (additionalFields.voicemailMessage) {
|
|
1317
|
+
body.voicemailMessage = additionalFields.voicemailMessage;
|
|
1318
|
+
}
|
|
1319
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'POST', '/v1/agents', body);
|
|
1320
|
+
}
|
|
1321
|
+
if (operation === 'get') {
|
|
1322
|
+
const agentId = this.getNodeParameter('agentId', i);
|
|
1323
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', `/v1/agents/${agentId}`);
|
|
1324
|
+
}
|
|
1325
|
+
if (operation === 'getAll') {
|
|
1326
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1327
|
+
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
1328
|
+
const qs = {
|
|
1329
|
+
workspaceId,
|
|
1330
|
+
};
|
|
1331
|
+
if (additionalFields.includeDeleted) {
|
|
1332
|
+
qs.includeDeleted = 'true';
|
|
1333
|
+
}
|
|
1334
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/agents', {}, qs);
|
|
1335
|
+
}
|
|
1336
|
+
if (operation === 'update') {
|
|
1337
|
+
const agentId = this.getNodeParameter('agentId', i);
|
|
1338
|
+
const updateFields = this.getNodeParameter('updateFields', i);
|
|
1339
|
+
const body = {};
|
|
1340
|
+
if (updateFields.name) {
|
|
1341
|
+
body.name = updateFields.name;
|
|
1342
|
+
}
|
|
1343
|
+
if (updateFields.prompt !== undefined) {
|
|
1344
|
+
body.prompt = updateFields.prompt;
|
|
1345
|
+
}
|
|
1346
|
+
if (updateFields.language !== undefined) {
|
|
1347
|
+
body.language = updateFields.language;
|
|
1348
|
+
}
|
|
1349
|
+
if (updateFields.voiceConfig) {
|
|
1350
|
+
body.voiceConfig =
|
|
1351
|
+
typeof updateFields.voiceConfig === 'string'
|
|
1352
|
+
? JSON.parse(updateFields.voiceConfig)
|
|
1353
|
+
: updateFields.voiceConfig;
|
|
1354
|
+
}
|
|
1355
|
+
if (updateFields.hipaaCompliance !== undefined) {
|
|
1356
|
+
body.hipaaCompliance = updateFields.hipaaCompliance;
|
|
1357
|
+
}
|
|
1358
|
+
if (updateFields.callDuration !== undefined) {
|
|
1359
|
+
body.callDuration = updateFields.callDuration;
|
|
1360
|
+
}
|
|
1361
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'PATCH', `/v1/agents/${agentId}`, body);
|
|
1362
|
+
}
|
|
1363
|
+
if (operation === 'delete') {
|
|
1364
|
+
const agentId = this.getNodeParameter('agentId', i);
|
|
1365
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'DELETE', `/v1/agents/${agentId}`);
|
|
1366
|
+
if (!responseData) {
|
|
1367
|
+
responseData = { success: true, deleted: true, agentId };
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
// Call
|
|
1372
|
+
if (resource === 'call') {
|
|
1373
|
+
if (operation === 'create') {
|
|
1374
|
+
const agentId = this.getNodeParameter('agentId', i);
|
|
1375
|
+
const callType = this.getNodeParameter('callType', i);
|
|
1376
|
+
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
1377
|
+
const body = {
|
|
1378
|
+
agentId,
|
|
1379
|
+
type: callType,
|
|
1380
|
+
};
|
|
1381
|
+
if (callType === 'phoneNumber') {
|
|
1382
|
+
const phoneNumber = this.getNodeParameter('phoneNumber', i);
|
|
1383
|
+
body.phoneNumber = phoneNumber;
|
|
1384
|
+
// Phone number specific fields
|
|
1385
|
+
if (additionalFields.firstName) {
|
|
1386
|
+
body.firstName = additionalFields.firstName;
|
|
1387
|
+
}
|
|
1388
|
+
if (additionalFields.lastName) {
|
|
1389
|
+
body.lastName = additionalFields.lastName;
|
|
1390
|
+
}
|
|
1391
|
+
if (additionalFields.email) {
|
|
1392
|
+
body.email = additionalFields.email;
|
|
1393
|
+
}
|
|
1394
|
+
if (additionalFields.businessName) {
|
|
1395
|
+
body.businessName = additionalFields.businessName;
|
|
1396
|
+
}
|
|
1397
|
+
if (additionalFields.customFields) {
|
|
1398
|
+
const customFields = additionalFields.customFields;
|
|
1399
|
+
body.customFields =
|
|
1400
|
+
typeof customFields === 'string' ? JSON.parse(customFields) : customFields;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
else if (callType === 'contact') {
|
|
1404
|
+
const contactId = this.getNodeParameter('contactId', i);
|
|
1405
|
+
body.contactId = contactId;
|
|
1406
|
+
}
|
|
1407
|
+
if (additionalFields.variables) {
|
|
1408
|
+
const variables = additionalFields.variables;
|
|
1409
|
+
body.variables = typeof variables === 'string' ? JSON.parse(variables) : variables;
|
|
1410
|
+
}
|
|
1411
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'POST', '/v1/call', body);
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
// Contact
|
|
1415
|
+
if (resource === 'contact') {
|
|
1416
|
+
if (operation === 'create') {
|
|
1417
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1418
|
+
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
1419
|
+
const body = {
|
|
1420
|
+
workspaceId,
|
|
1421
|
+
};
|
|
1422
|
+
if (additionalFields.firstName) {
|
|
1423
|
+
body.firstName = additionalFields.firstName;
|
|
1424
|
+
}
|
|
1425
|
+
if (additionalFields.lastName) {
|
|
1426
|
+
body.lastName = additionalFields.lastName;
|
|
1427
|
+
}
|
|
1428
|
+
if (additionalFields.email) {
|
|
1429
|
+
body.email = additionalFields.email;
|
|
1430
|
+
}
|
|
1431
|
+
if (additionalFields.phone) {
|
|
1432
|
+
body.phone = additionalFields.phone;
|
|
1433
|
+
}
|
|
1434
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'POST', '/v1/contacts', body);
|
|
1435
|
+
}
|
|
1436
|
+
if (operation === 'get') {
|
|
1437
|
+
const contactId = this.getNodeParameter('contactId', i);
|
|
1438
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', `/v1/contacts/${contactId}`);
|
|
1439
|
+
}
|
|
1440
|
+
if (operation === 'getAll') {
|
|
1441
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1442
|
+
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
1443
|
+
const qs = {
|
|
1444
|
+
workspaceId,
|
|
1445
|
+
};
|
|
1446
|
+
if (additionalFields.includeDeleted) {
|
|
1447
|
+
qs.includeDeleted = 'true';
|
|
1448
|
+
}
|
|
1449
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/contacts', {}, qs);
|
|
1450
|
+
}
|
|
1451
|
+
if (operation === 'update') {
|
|
1452
|
+
const contactId = this.getNodeParameter('contactId', i);
|
|
1453
|
+
const updateFields = this.getNodeParameter('updateFields', i);
|
|
1454
|
+
const body = {};
|
|
1455
|
+
if (updateFields.firstName !== undefined) {
|
|
1456
|
+
body.firstName = updateFields.firstName;
|
|
1457
|
+
}
|
|
1458
|
+
if (updateFields.lastName !== undefined) {
|
|
1459
|
+
body.lastName = updateFields.lastName;
|
|
1460
|
+
}
|
|
1461
|
+
if (updateFields.email !== undefined) {
|
|
1462
|
+
body.email = updateFields.email;
|
|
1463
|
+
}
|
|
1464
|
+
if (updateFields.phone !== undefined) {
|
|
1465
|
+
body.phone = updateFields.phone;
|
|
1466
|
+
}
|
|
1467
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'PATCH', `/v1/contacts/${contactId}`, body);
|
|
1468
|
+
}
|
|
1469
|
+
if (operation === 'delete') {
|
|
1470
|
+
const contactId = this.getNodeParameter('contactId', i);
|
|
1471
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'DELETE', `/v1/contacts/${contactId}`);
|
|
1472
|
+
if (!responseData) {
|
|
1473
|
+
responseData = { success: true, deleted: true, contactId };
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
// Workspace
|
|
1478
|
+
if (resource === 'workspace') {
|
|
1479
|
+
if (operation === 'create') {
|
|
1480
|
+
const name = this.getNodeParameter('name', i);
|
|
1481
|
+
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
1482
|
+
const body = {
|
|
1483
|
+
name,
|
|
1484
|
+
};
|
|
1485
|
+
if (additionalFields.description) {
|
|
1486
|
+
body.description = additionalFields.description;
|
|
1487
|
+
}
|
|
1488
|
+
if (additionalFields.timezone) {
|
|
1489
|
+
body.timezone = additionalFields.timezone;
|
|
1490
|
+
}
|
|
1491
|
+
if (additionalFields.icon) {
|
|
1492
|
+
body.icon = additionalFields.icon;
|
|
1493
|
+
}
|
|
1494
|
+
if (additionalFields.contactName) {
|
|
1495
|
+
body.contactName = additionalFields.contactName;
|
|
1496
|
+
}
|
|
1497
|
+
if (additionalFields.contactEmail) {
|
|
1498
|
+
body.contactEmail = additionalFields.contactEmail;
|
|
1499
|
+
}
|
|
1500
|
+
if (additionalFields.contactPhone) {
|
|
1501
|
+
body.contactPhone = additionalFields.contactPhone;
|
|
1502
|
+
}
|
|
1503
|
+
if (additionalFields.streetAddress) {
|
|
1504
|
+
body.streetAddress = additionalFields.streetAddress;
|
|
1505
|
+
}
|
|
1506
|
+
if (additionalFields.state) {
|
|
1507
|
+
body.state = additionalFields.state;
|
|
1508
|
+
}
|
|
1509
|
+
if (additionalFields.zip) {
|
|
1510
|
+
body.zip = additionalFields.zip;
|
|
1511
|
+
}
|
|
1512
|
+
if (additionalFields.country) {
|
|
1513
|
+
body.country = additionalFields.country;
|
|
1514
|
+
}
|
|
1515
|
+
if (additionalFields.businessRegistrationNumber) {
|
|
1516
|
+
body.businessRegistrationNumber = additionalFields.businessRegistrationNumber;
|
|
1517
|
+
}
|
|
1518
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'POST', '/v1/workspaces', body);
|
|
1519
|
+
}
|
|
1520
|
+
if (operation === 'get') {
|
|
1521
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1522
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', `/v1/workspaces/${workspaceId}`);
|
|
1523
|
+
}
|
|
1524
|
+
if (operation === 'getAll') {
|
|
1525
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'GET', '/v1/workspaces');
|
|
1526
|
+
}
|
|
1527
|
+
if (operation === 'update') {
|
|
1528
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1529
|
+
const updateFields = this.getNodeParameter('updateFields', i);
|
|
1530
|
+
const body = {};
|
|
1531
|
+
if (updateFields.name) {
|
|
1532
|
+
body.name = updateFields.name;
|
|
1533
|
+
}
|
|
1534
|
+
if (updateFields.description !== undefined) {
|
|
1535
|
+
body.description = updateFields.description;
|
|
1536
|
+
}
|
|
1537
|
+
if (updateFields.timezone) {
|
|
1538
|
+
body.timezone = updateFields.timezone;
|
|
1539
|
+
}
|
|
1540
|
+
if (updateFields.icon !== undefined) {
|
|
1541
|
+
body.icon = updateFields.icon;
|
|
1542
|
+
}
|
|
1543
|
+
if (updateFields.contactName !== undefined) {
|
|
1544
|
+
body.contactName = updateFields.contactName;
|
|
1545
|
+
}
|
|
1546
|
+
if (updateFields.contactEmail !== undefined) {
|
|
1547
|
+
body.contactEmail = updateFields.contactEmail;
|
|
1548
|
+
}
|
|
1549
|
+
if (updateFields.contactPhone !== undefined) {
|
|
1550
|
+
body.contactPhone = updateFields.contactPhone;
|
|
1551
|
+
}
|
|
1552
|
+
if (updateFields.streetAddress !== undefined) {
|
|
1553
|
+
body.streetAddress = updateFields.streetAddress;
|
|
1554
|
+
}
|
|
1555
|
+
if (updateFields.state !== undefined) {
|
|
1556
|
+
body.state = updateFields.state;
|
|
1557
|
+
}
|
|
1558
|
+
if (updateFields.zip !== undefined) {
|
|
1559
|
+
body.zip = updateFields.zip;
|
|
1560
|
+
}
|
|
1561
|
+
if (updateFields.country !== undefined) {
|
|
1562
|
+
body.country = updateFields.country;
|
|
1563
|
+
}
|
|
1564
|
+
if (updateFields.businessRegistrationNumber !== undefined) {
|
|
1565
|
+
body.businessRegistrationNumber = updateFields.businessRegistrationNumber;
|
|
1566
|
+
}
|
|
1567
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'PATCH', `/v1/workspaces/${workspaceId}`, body);
|
|
1568
|
+
}
|
|
1569
|
+
if (operation === 'delete') {
|
|
1570
|
+
const workspaceId = this.getNodeParameter('workspaceId', i);
|
|
1571
|
+
responseData = await GenericFunctions_1.nedzoApiRequest.call(this, 'DELETE', `/v1/workspaces/${workspaceId}`);
|
|
1572
|
+
if (!responseData) {
|
|
1573
|
+
responseData = { success: true, deleted: true, workspaceId };
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
1578
|
+
returnData.push(...executionData);
|
|
1579
|
+
}
|
|
1580
|
+
catch (error) {
|
|
1581
|
+
if (this.continueOnFail()) {
|
|
1582
|
+
const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
|
|
1583
|
+
returnData.push(...executionErrorData);
|
|
1584
|
+
continue;
|
|
1585
|
+
}
|
|
1586
|
+
throw error;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
return [returnData];
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
exports.Nedzo = Nedzo;
|
|
1593
|
+
//# sourceMappingURL=Nedzo.node.js.map
|