n8n-nodes-cention 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 +21 -0
- package/README.md +165 -0
- package/dist/credentials/CentionApi.credentials.d.ts +11 -0
- package/dist/credentials/CentionApi.credentials.d.ts.map +1 -0
- package/dist/credentials/CentionApi.credentials.js +63 -0
- package/dist/credentials/CentionApi.credentials.js.map +1 -0
- package/dist/nodes/Cention/AgentPresenceDescription.d.ts +4 -0
- package/dist/nodes/Cention/AgentPresenceDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/AgentPresenceDescription.js +90 -0
- package/dist/nodes/Cention/AgentPresenceDescription.js.map +1 -0
- package/dist/nodes/Cention/Cention.node.d.ts +7 -0
- package/dist/nodes/Cention/Cention.node.d.ts.map +1 -0
- package/dist/nodes/Cention/Cention.node.js +676 -0
- package/dist/nodes/Cention/Cention.node.js.map +1 -0
- package/dist/nodes/Cention/CentionTrigger.node.d.ts +7 -0
- package/dist/nodes/Cention/CentionTrigger.node.d.ts.map +1 -0
- package/dist/nodes/Cention/CentionTrigger.node.js +165 -0
- package/dist/nodes/Cention/CentionTrigger.node.js.map +1 -0
- package/dist/nodes/Cention/ChannelDescription.d.ts +4 -0
- package/dist/nodes/Cention/ChannelDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/ChannelDescription.js +144 -0
- package/dist/nodes/Cention/ChannelDescription.js.map +1 -0
- package/dist/nodes/Cention/ChatMessageDescription.d.ts +4 -0
- package/dist/nodes/Cention/ChatMessageDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/ChatMessageDescription.js +86 -0
- package/dist/nodes/Cention/ChatMessageDescription.js.map +1 -0
- package/dist/nodes/Cention/ContactCardDescription.d.ts +4 -0
- package/dist/nodes/Cention/ContactCardDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/ContactCardDescription.js +446 -0
- package/dist/nodes/Cention/ContactCardDescription.js.map +1 -0
- package/dist/nodes/Cention/ErrandDescription.d.ts +4 -0
- package/dist/nodes/Cention/ErrandDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/ErrandDescription.js +409 -0
- package/dist/nodes/Cention/ErrandDescription.js.map +1 -0
- package/dist/nodes/Cention/GenericFunctions.d.ts +5 -0
- package/dist/nodes/Cention/GenericFunctions.d.ts.map +1 -0
- package/dist/nodes/Cention/GenericFunctions.js +60 -0
- package/dist/nodes/Cention/GenericFunctions.js.map +1 -0
- package/dist/nodes/Cention/LibraryQuestionDescription.d.ts +4 -0
- package/dist/nodes/Cention/LibraryQuestionDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/LibraryQuestionDescription.js +216 -0
- package/dist/nodes/Cention/LibraryQuestionDescription.js.map +1 -0
- package/dist/nodes/Cention/StatisticsDescription.d.ts +4 -0
- package/dist/nodes/Cention/StatisticsDescription.d.ts.map +1 -0
- package/dist/nodes/Cention/StatisticsDescription.js +169 -0
- package/dist/nodes/Cention/StatisticsDescription.js.map +1 -0
- package/dist/nodes/Cention/cention.svg +7 -0
- package/dist/nodes/Cention/logo.png +0 -0
- package/package.json +60 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errandFields = exports.errandOperations = void 0;
|
|
4
|
+
exports.errandOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['errand'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Create',
|
|
18
|
+
value: 'create',
|
|
19
|
+
description: 'Create a new errand',
|
|
20
|
+
action: 'Create an errand',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Get',
|
|
24
|
+
value: 'get',
|
|
25
|
+
description: 'Get an errand by ID',
|
|
26
|
+
action: 'Get an errand',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Get Many',
|
|
30
|
+
value: 'getAll',
|
|
31
|
+
description: 'Get many errands',
|
|
32
|
+
action: 'Get many errands',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Update',
|
|
36
|
+
value: 'update',
|
|
37
|
+
description: 'Update an errand',
|
|
38
|
+
action: 'Update an errand',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Close',
|
|
42
|
+
value: 'close',
|
|
43
|
+
description: 'Close an errand',
|
|
44
|
+
action: 'Close an errand',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Delete',
|
|
48
|
+
value: 'delete',
|
|
49
|
+
description: 'Delete an errand',
|
|
50
|
+
action: 'Delete an errand',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Send Message',
|
|
54
|
+
value: 'sendMessage',
|
|
55
|
+
description: 'Send a message/reply to an errand',
|
|
56
|
+
action: 'Send a message to an errand',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
default: 'create',
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
exports.errandFields = [
|
|
63
|
+
/* -------------------------------------------------------------------------- */
|
|
64
|
+
/* errand:create */
|
|
65
|
+
/* -------------------------------------------------------------------------- */
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Subject',
|
|
68
|
+
name: 'subject',
|
|
69
|
+
type: 'string',
|
|
70
|
+
required: true,
|
|
71
|
+
displayOptions: {
|
|
72
|
+
show: {
|
|
73
|
+
resource: ['errand'],
|
|
74
|
+
operation: ['create'],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
default: '',
|
|
78
|
+
description: 'The subject/title of the errand',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Message',
|
|
82
|
+
name: 'message',
|
|
83
|
+
type: 'string',
|
|
84
|
+
required: true,
|
|
85
|
+
typeOptions: {
|
|
86
|
+
rows: 5,
|
|
87
|
+
},
|
|
88
|
+
displayOptions: {
|
|
89
|
+
show: {
|
|
90
|
+
resource: ['errand'],
|
|
91
|
+
operation: ['create'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
default: '',
|
|
95
|
+
description: 'The message body of the errand',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'From Email',
|
|
99
|
+
name: 'fromEmail',
|
|
100
|
+
type: 'string',
|
|
101
|
+
required: true,
|
|
102
|
+
displayOptions: {
|
|
103
|
+
show: {
|
|
104
|
+
resource: ['errand'],
|
|
105
|
+
operation: ['create'],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
default: '',
|
|
109
|
+
description: 'The email address or ID of the sender',
|
|
110
|
+
placeholder: 'customer@example.com',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
displayName: 'From Name',
|
|
114
|
+
name: 'fromName',
|
|
115
|
+
type: 'string',
|
|
116
|
+
required: true,
|
|
117
|
+
displayOptions: {
|
|
118
|
+
show: {
|
|
119
|
+
resource: ['errand'],
|
|
120
|
+
operation: ['create'],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
default: '',
|
|
124
|
+
description: 'The name of the sender',
|
|
125
|
+
placeholder: 'John Doe',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
displayName: 'Additional Fields',
|
|
129
|
+
name: 'additionalFields',
|
|
130
|
+
type: 'collection',
|
|
131
|
+
placeholder: 'Add Field',
|
|
132
|
+
default: {},
|
|
133
|
+
displayOptions: {
|
|
134
|
+
show: {
|
|
135
|
+
resource: ['errand'],
|
|
136
|
+
operation: ['create'],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
options: [
|
|
140
|
+
{
|
|
141
|
+
displayName: 'Message ID',
|
|
142
|
+
name: 'messageId',
|
|
143
|
+
type: 'string',
|
|
144
|
+
default: '',
|
|
145
|
+
description: 'Unique message identifier. Auto-generated if not provided.',
|
|
146
|
+
placeholder: 'msg_123456',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
displayName: 'HTML Body',
|
|
150
|
+
name: 'htmlBody',
|
|
151
|
+
type: 'string',
|
|
152
|
+
default: '',
|
|
153
|
+
description: 'Rich HTML body content (optional, for email channels)',
|
|
154
|
+
typeOptions: {
|
|
155
|
+
rows: 5,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
displayName: 'Extra Data (JSON)',
|
|
160
|
+
name: 'extraData',
|
|
161
|
+
type: 'string',
|
|
162
|
+
default: '',
|
|
163
|
+
description: 'Additional JSON data to attach to the errand',
|
|
164
|
+
placeholder: '{"customField": "value"}',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
displayName: 'Priority',
|
|
168
|
+
name: 'priority',
|
|
169
|
+
type: 'options',
|
|
170
|
+
options: [
|
|
171
|
+
{
|
|
172
|
+
name: 'Low',
|
|
173
|
+
value: 'low',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'Normal',
|
|
177
|
+
value: 'normal',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'High',
|
|
181
|
+
value: 'high',
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
default: 'normal',
|
|
185
|
+
description: 'The priority of the errand',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
/* -------------------------------------------------------------------------- */
|
|
190
|
+
/* errand:get */
|
|
191
|
+
/* -------------------------------------------------------------------------- */
|
|
192
|
+
{
|
|
193
|
+
displayName: 'Errand ID',
|
|
194
|
+
name: 'errandId',
|
|
195
|
+
type: 'number',
|
|
196
|
+
required: true,
|
|
197
|
+
displayOptions: {
|
|
198
|
+
show: {
|
|
199
|
+
resource: ['errand'],
|
|
200
|
+
operation: ['get', 'update', 'close'],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
default: 0,
|
|
204
|
+
description: 'The ID of the errand',
|
|
205
|
+
},
|
|
206
|
+
/* -------------------------------------------------------------------------- */
|
|
207
|
+
/* errand:getAll */
|
|
208
|
+
/* -------------------------------------------------------------------------- */
|
|
209
|
+
{
|
|
210
|
+
displayName: 'Return All',
|
|
211
|
+
name: 'returnAll',
|
|
212
|
+
type: 'boolean',
|
|
213
|
+
displayOptions: {
|
|
214
|
+
show: {
|
|
215
|
+
resource: ['errand'],
|
|
216
|
+
operation: ['getAll'],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
default: false,
|
|
220
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Limit',
|
|
224
|
+
name: 'limit',
|
|
225
|
+
type: 'number',
|
|
226
|
+
displayOptions: {
|
|
227
|
+
show: {
|
|
228
|
+
resource: ['errand'],
|
|
229
|
+
operation: ['getAll'],
|
|
230
|
+
returnAll: [false],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
typeOptions: {
|
|
234
|
+
minValue: 1,
|
|
235
|
+
maxValue: 500,
|
|
236
|
+
},
|
|
237
|
+
default: 50,
|
|
238
|
+
description: 'Max number of results to return',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
displayName: 'Filters',
|
|
242
|
+
name: 'filters',
|
|
243
|
+
type: 'collection',
|
|
244
|
+
placeholder: 'Add Filter',
|
|
245
|
+
default: {},
|
|
246
|
+
displayOptions: {
|
|
247
|
+
show: {
|
|
248
|
+
resource: ['errand'],
|
|
249
|
+
operation: ['getAll'],
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
options: [
|
|
253
|
+
{
|
|
254
|
+
displayName: 'Area ID',
|
|
255
|
+
name: 'areaId',
|
|
256
|
+
type: 'number',
|
|
257
|
+
default: 0,
|
|
258
|
+
description: 'Filter by area ID',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
displayName: 'Status',
|
|
262
|
+
name: 'status',
|
|
263
|
+
type: 'options',
|
|
264
|
+
options: [
|
|
265
|
+
{
|
|
266
|
+
name: 'Open',
|
|
267
|
+
value: 'open',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: 'Closed',
|
|
271
|
+
value: 'closed',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: 'Pending',
|
|
275
|
+
value: 'pending',
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
default: 'open',
|
|
279
|
+
description: 'Filter by status',
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
/* -------------------------------------------------------------------------- */
|
|
284
|
+
/* errand:update */
|
|
285
|
+
/* -------------------------------------------------------------------------- */
|
|
286
|
+
{
|
|
287
|
+
displayName: 'Update Fields',
|
|
288
|
+
name: 'updateFields',
|
|
289
|
+
type: 'collection',
|
|
290
|
+
placeholder: 'Add Field',
|
|
291
|
+
default: {},
|
|
292
|
+
displayOptions: {
|
|
293
|
+
show: {
|
|
294
|
+
resource: ['errand'],
|
|
295
|
+
operation: ['update'],
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
options: [
|
|
299
|
+
{
|
|
300
|
+
displayName: 'Subject',
|
|
301
|
+
name: 'subject',
|
|
302
|
+
type: 'string',
|
|
303
|
+
default: '',
|
|
304
|
+
description: 'The subject/title of the errand',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
displayName: 'Area ID',
|
|
308
|
+
name: 'areaId',
|
|
309
|
+
type: 'number',
|
|
310
|
+
default: 0,
|
|
311
|
+
description: 'The area ID to assign the errand to',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
displayName: 'Priority',
|
|
315
|
+
name: 'priority',
|
|
316
|
+
type: 'options',
|
|
317
|
+
options: [
|
|
318
|
+
{
|
|
319
|
+
name: 'Low',
|
|
320
|
+
value: 'low',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: 'Normal',
|
|
324
|
+
value: 'normal',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: 'High',
|
|
328
|
+
value: 'high',
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
default: 'normal',
|
|
332
|
+
description: 'The priority of the errand',
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
},
|
|
336
|
+
/* -------------------------------------------------------------------------- */
|
|
337
|
+
/* errand:delete */
|
|
338
|
+
/* -------------------------------------------------------------------------- */
|
|
339
|
+
{
|
|
340
|
+
displayName: 'Errand ID',
|
|
341
|
+
name: 'errandId',
|
|
342
|
+
type: 'number',
|
|
343
|
+
required: true,
|
|
344
|
+
displayOptions: {
|
|
345
|
+
show: {
|
|
346
|
+
resource: ['errand'],
|
|
347
|
+
operation: ['delete'],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
default: 0,
|
|
351
|
+
description: 'The ID of the errand to delete',
|
|
352
|
+
},
|
|
353
|
+
/* errand:sendMessage */
|
|
354
|
+
/* -------------------------------------------------------------------------- */
|
|
355
|
+
{
|
|
356
|
+
displayName: 'Errand ID',
|
|
357
|
+
name: 'errandId',
|
|
358
|
+
type: 'number',
|
|
359
|
+
required: true,
|
|
360
|
+
displayOptions: {
|
|
361
|
+
show: {
|
|
362
|
+
resource: ['errand'],
|
|
363
|
+
operation: ['sendMessage'],
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
default: 0,
|
|
367
|
+
description: 'The ID of the errand to send the message to',
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
displayName: 'Message',
|
|
371
|
+
name: 'message',
|
|
372
|
+
type: 'string',
|
|
373
|
+
required: true,
|
|
374
|
+
typeOptions: {
|
|
375
|
+
rows: 5,
|
|
376
|
+
},
|
|
377
|
+
displayOptions: {
|
|
378
|
+
show: {
|
|
379
|
+
resource: ['errand'],
|
|
380
|
+
operation: ['sendMessage'],
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
default: '',
|
|
384
|
+
description: 'The message to send',
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
displayName: 'Message Options',
|
|
388
|
+
name: 'messageOptions',
|
|
389
|
+
type: 'collection',
|
|
390
|
+
placeholder: 'Add Option',
|
|
391
|
+
default: {},
|
|
392
|
+
displayOptions: {
|
|
393
|
+
show: {
|
|
394
|
+
resource: ['errand'],
|
|
395
|
+
operation: ['sendMessage'],
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
options: [
|
|
399
|
+
{
|
|
400
|
+
displayName: 'Is Internal',
|
|
401
|
+
name: 'isInternal',
|
|
402
|
+
type: 'boolean',
|
|
403
|
+
default: false,
|
|
404
|
+
description: 'Whether this is an internal note (not sent to customer)',
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
},
|
|
408
|
+
];
|
|
409
|
+
//# sourceMappingURL=ErrandDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrandDescription.js","sourceRoot":"","sources":["../../../nodes/Cention/ErrandDescription.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAsB;IAClD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACpB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,qBAAqB;gBAClC,MAAM,EAAE,kBAAkB;aAC1B;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,qBAAqB;gBAClC,MAAM,EAAE,eAAe;aACvB;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,kBAAkB;gBAC/B,MAAM,E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AAC;gBACpB,SAAS,EAAE,CAAC,aAAa,CAAC;aAC1B;SACD;QACD,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,6CAA6C;KAC1D;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;QACD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,SAAS,EAAE,CAAC,aAAa,CAAC;aAC1B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,qBAAqB;KAClC;IACD;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,SAAS,EAAE,CAAC,aAAa,CAAC;aAC1B;SACD;QACD,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,yDAAyD;aACtE;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, ILoadOptionsFunctions, IPollFunctions, IHttpRequestMethods } from 'n8n-workflow';
|
|
2
|
+
export declare function centionApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, method: IHttpRequestMethods, resource: string, body?: any, qs?: IDataObject, uri?: string, option?: IDataObject): Promise<any>;
|
|
3
|
+
export declare function centionApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, propertyName: string, method: IHttpRequestMethods, resource: string, body?: any, query?: IDataObject): Promise<any>;
|
|
4
|
+
export declare function validateJSON(json: string | undefined): any;
|
|
5
|
+
//# sourceMappingURL=GenericFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.d.ts","sourceRoot":"","sources":["../../../nodes/Cention/GenericFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EAEnB,MAAM,cAAc,CAAC;AAEtB,wBAAsB,iBAAiB,CACtC,IAAI,EAAE,iBAAiB,GAAG,qBAAqB,GAAG,cAAc,EAChE,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,GAAQ,EACd,EAAE,GAAE,WAAgB,EACpB,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,GAAE,WAAgB,gBA8BxB;AAED,wBAAsB,yBAAyB,CAC9C,IAAI,EAAE,iBAAiB,GAAG,qBAAqB,GAAG,cAAc,EAChE,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,GAAQ,EACd,KAAK,GAAE,WAAgB,GACrB,OAAO,CAAC,GAAG,CAAC,CA6Bd;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,CAQ1D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.centionApiRequest = centionApiRequest;
|
|
4
|
+
exports.centionApiRequestAllItems = centionApiRequestAllItems;
|
|
5
|
+
exports.validateJSON = validateJSON;
|
|
6
|
+
async function centionApiRequest(method, resource, body = {}, qs = {}, uri, option = {}) {
|
|
7
|
+
const credentials = await this.getCredentials('centionApi');
|
|
8
|
+
// Remove trailing slash from instanceUrl if present
|
|
9
|
+
const baseUrl = credentials.instanceUrl.replace(/\/$/, '');
|
|
10
|
+
let options = {
|
|
11
|
+
method,
|
|
12
|
+
qs,
|
|
13
|
+
body,
|
|
14
|
+
uri: uri || `${baseUrl}/s/${credentials.workspace}/capi/json${resource}`,
|
|
15
|
+
json: true,
|
|
16
|
+
headers: {
|
|
17
|
+
'Content-Type': 'application/vnd.api+json',
|
|
18
|
+
'Accept': 'application/vnd.api+json',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
options = Object.assign({}, options, option);
|
|
22
|
+
if (Object.keys(options.body).length === 0) {
|
|
23
|
+
delete options.body;
|
|
24
|
+
}
|
|
25
|
+
return await this.helpers.requestWithAuthentication.call(this, 'centionApi', options);
|
|
26
|
+
}
|
|
27
|
+
async function centionApiRequestAllItems(propertyName, method, resource, body = {}, query = {}) {
|
|
28
|
+
const returnData = [];
|
|
29
|
+
let responseData;
|
|
30
|
+
query.page = 1;
|
|
31
|
+
query.perPage = query.perPage || 100;
|
|
32
|
+
do {
|
|
33
|
+
responseData = await centionApiRequest.call(this, method, resource, body, query);
|
|
34
|
+
const items = responseData[propertyName];
|
|
35
|
+
if (items && items.length > 0) {
|
|
36
|
+
returnData.push.apply(returnData, items);
|
|
37
|
+
}
|
|
38
|
+
const limit = query.limit;
|
|
39
|
+
if (limit && limit <= returnData.length) {
|
|
40
|
+
return returnData.slice(0, limit);
|
|
41
|
+
}
|
|
42
|
+
// If we got fewer items than requested, we've reached the end
|
|
43
|
+
if (!items || items.length < query.perPage) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
query.page = query.page + 1;
|
|
47
|
+
} while (true);
|
|
48
|
+
return returnData;
|
|
49
|
+
}
|
|
50
|
+
function validateJSON(json) {
|
|
51
|
+
let result;
|
|
52
|
+
try {
|
|
53
|
+
result = JSON.parse(json);
|
|
54
|
+
}
|
|
55
|
+
catch (exception) {
|
|
56
|
+
result = undefined;
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Cention/GenericFunctions.ts"],"names":[],"mappings":";;AASA,8CAqCC;AAED,8DAoCC;AAED,oCAQC;AArFM,KAAK,UAAU,iBAAiB,CAEtC,MAA2B,EAC3B,QAAgB,EAChB,OAAY,EAAE,EACd,KAAkB,EAAE,EACpB,GAAY,EACZ,SAAsB,EAAE;IAExB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAI1C,YAAY,CAAC,CAAC;IAEjB,oDAAoD;IACpD,MAAM,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE3D,IAAI,OAAO,GAAoB;QAC9B,MAAM;QACN,EAAE;QACF,IAAI;QACJ,GAAG,EAAE,GAAG,IAAI,GAAG,OAAO,MAAM,WAAW,CAAC,SAAS,aAAa,QAAQ,EAAE;QACxE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;YACR,cAAc,EAAE,0BAA0B;YAC1C,QAAQ,EAAE,0BAA0B;SACpC;KACD,CAAC;IAEF,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE7C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAmB,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,OAAO,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AACvF,CAAC;AAEM,KAAK,UAAU,yBAAyB,CAE9C,YAAoB,EACpB,MAA2B,EAC3B,QAAgB,EAChB,OAAY,EAAE,EACd,QAAqB,EAAE;IAEvB,MAAM,UAAU,GAAkB,EAAE,CAA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