n8n-nodes-qlik-cloud 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="0 0 71.39 29.74"><defs><style>.cls-2{stroke-width:0;fill:#54565a}</style></defs><path d="M70.47 27.52c.05-.07.07-.15.07-.24s-.02-.17-.07-.24-.1-.11-.16-.14a.38.38 0 0 0-.17-.04h-.66v1.31h.29v-.44h.29l.23.44h.32l-.27-.51a.47.47 0 0 0 .15-.13Zm-.71-.45h.27s.07.01.12.04c.04.03.07.08.07.16s-.02.14-.07.18c-.05.04-.09.06-.13.06h-.27v-.44Z" class="cls-2"/><path d="M71.28 26.97c-.07-.17-.17-.32-.31-.45-.13-.13-.28-.23-.45-.31s-.36-.11-.55-.11-.38.04-.55.11-.32.18-.45.31-.23.28-.3.45c-.07.17-.11.36-.11.55s.04.38.11.55c.07.17.17.32.3.45.13.13.28.23.45.31s.36.11.55.11.38-.04.55-.11.32-.18.45-.31.23-.28.31-.45c.07-.17.11-.36.11-.55s-.04-.38-.11-.55Zm-.37 1.1c-.1.16-.23.29-.39.39-.16.1-.34.15-.54.15s-.38-.05-.54-.15c-.16-.1-.29-.23-.39-.39-.1-.16-.15-.34-.15-.54s.05-.38.15-.54c.1-.16.23-.29.39-.39.16-.1.34-.15.54-.15s.38.05.54.15c.16.1.29.23.39.39.1.16.15.34.15.54s-.05.38-.15.54ZM34.9.65h2.96v28.32H34.9zM42.95 9.19h2.95v19.78h-2.95z" class="cls-2"/><circle cx="44.45" cy="2.67" r="2.02" class="cls-2"/><path d="M66.62 9.19h-4.11l-8.52 7.46-.02-16h-2.94v28.32h2.94v-9.14l8.75 9.14h4.1L56.39 18.39l10.23-9.2zM14.87 26.69c-6.53 0-11.82-5.29-11.82-11.82 0-2.77.96-5.32 2.55-7.34L3.44 5.34A14.922 14.922 0 0 0 0 14.87c0 8.21 6.66 14.87 14.87 14.87 3.56 0 6.83-1.25 9.39-3.34l-2.16-2.19c-2 1.55-4.5 2.47-7.23 2.47Z" class="cls-2"/><path fill="#009445" stroke-width="0" d="m26.31 24.34.17-.17a14.83 14.83 0 0 0 3.26-9.3C29.74 6.66 23.08 0 14.87 0c-3.54 0-6.79 1.24-9.34 3.3-.74.6-1.41 1.26-2.03 1.98-.02.02-.03.04-.05.06l2.16 2.19s.04-.05.06-.07c.59-.74 1.27-1.4 2.02-1.97a11.74 11.74 0 0 1 7.18-2.44c6.53 0 11.82 5.29 11.82 11.82 0 2.75-.94 5.29-2.52 7.3-.57.73-1.23 1.39-1.95 1.96l-.12.09 2.16 2.19 2.54 2.57h4.1l-4.59-4.64Z"/></svg>
@@ -116,6 +116,15 @@ async function handleAssistantsResource(operation: string, context: IExecuteFunc
116
116
  if (options.limit) {
117
117
  qs.limit = options.limit;
118
118
  }
119
+ if (options.next) {
120
+ qs.next = options.next;
121
+ }
122
+ if (options.prev) {
123
+ qs.prev = options.prev;
124
+ }
125
+ if (options.sort) {
126
+ qs.sort = options.sort;
127
+ }
119
128
 
120
129
  return await qlikApiRequest.call(context, 'GET', '/api/v1/assistants', undefined, qs);
121
130
  }
@@ -127,16 +136,44 @@ async function handleAssistantsResource(operation: string, context: IExecuteFunc
127
136
 
128
137
  if (operation === 'create') {
129
138
  const name = context.getNodeParameter('name', 0) as string;
139
+ const title = context.getNodeParameter('title', 0) as string;
140
+ const description = context.getNodeParameter('description', 0) as string;
141
+ const spaceId = context.getNodeParameter('spaceId', 0) as string;
130
142
  const options = context.getNodeParameter('options', 0) as any;
131
143
 
132
- const body: any = { name };
133
- if (options.description) {
134
- body.description = options.description;
144
+ const body: any = { name, title, description, spaceId };
145
+ if (options.tags) {
146
+ body.tags = options.tags.split(',').map((tag: string) => tag.trim());
147
+ }
148
+ if (options.knowledgeBases) {
149
+ body.knowledgeBases = options.knowledgeBases.split(',').map((kb: string) => kb.trim());
150
+ }
151
+ if (options.welcomeMessage) {
152
+ body.welcomeMessage = options.welcomeMessage;
153
+ }
154
+ if (options.customProperties) {
155
+ body.customProperties = typeof options.customProperties === 'string'
156
+ ? JSON.parse(options.customProperties)
157
+ : options.customProperties;
135
158
  }
136
159
 
137
160
  return await qlikApiRequest.call(context, 'POST', '/api/v1/assistants', body);
138
161
  }
139
162
 
163
+ if (operation === 'update') {
164
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
165
+ const body = context.getNodeParameter('body', 0) as any;
166
+
167
+ const patchOps = typeof body === 'string' ? JSON.parse(body) : body;
168
+
169
+ return await qlikApiRequest.call(
170
+ context,
171
+ 'PATCH',
172
+ `/api/v1/assistants/${assistantId}`,
173
+ patchOps,
174
+ );
175
+ }
176
+
140
177
  if (operation === 'search') {
141
178
  const assistantId = context.getNodeParameter('assistantId', 0) as string;
142
179
  const query = context.getNodeParameter('query', 0) as string;
@@ -158,6 +195,89 @@ async function handleAssistantsResource(operation: string, context: IExecuteFunc
158
195
  );
159
196
  }
160
197
 
198
+ if (operation === 'getFeedback') {
199
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
200
+ return await qlikApiRequest.call(context, 'GET', `/api/v1/assistants/${assistantId}/feedback`);
201
+ }
202
+
203
+ if (operation === 'bulkSearchSources') {
204
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
205
+ const chunkIds = context.getNodeParameter('chunkIds', 0) as any;
206
+
207
+ const body = typeof chunkIds === 'string' ? JSON.parse(chunkIds) : chunkIds;
208
+
209
+ return await qlikApiRequest.call(
210
+ context,
211
+ 'POST',
212
+ `/api/v1/assistants/${assistantId}/sources/plaintexts`,
213
+ { chunkIds: body },
214
+ );
215
+ }
216
+
217
+ if (operation === 'listStarters') {
218
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
219
+ const options = context.getNodeParameter('options', 0) as any;
220
+
221
+ const qs: any = {};
222
+ if (options.limit) {
223
+ qs.limit = options.limit;
224
+ }
225
+
226
+ return await qlikApiRequest.call(context, 'GET', `/api/v1/assistants/${assistantId}/starters`, undefined, qs);
227
+ }
228
+
229
+ if (operation === 'createStarter') {
230
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
231
+ const question = context.getNodeParameter('question', 0) as string;
232
+ const options = context.getNodeParameter('options', 0) as any;
233
+
234
+ const body: any = { question };
235
+ if (options.followups) {
236
+ body.followups = typeof options.followups === 'string'
237
+ ? JSON.parse(options.followups)
238
+ : options.followups;
239
+ }
240
+ if (options.additionalContext) {
241
+ body.additionalContext = options.additionalContext;
242
+ }
243
+
244
+ return await qlikApiRequest.call(
245
+ context,
246
+ 'POST',
247
+ `/api/v1/assistants/${assistantId}/starters`,
248
+ body,
249
+ );
250
+ }
251
+
252
+ if (operation === 'listThreads') {
253
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
254
+ const options = context.getNodeParameter('options', 0) as any;
255
+
256
+ const qs: any = {};
257
+ if (options.limit) {
258
+ qs.limit = options.limit;
259
+ }
260
+ if (options.filter) {
261
+ qs.filter = options.filter;
262
+ }
263
+
264
+ return await qlikApiRequest.call(context, 'GET', `/api/v1/assistants/${assistantId}/threads`, undefined, qs);
265
+ }
266
+
267
+ if (operation === 'createThread') {
268
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
269
+ const name = context.getNodeParameter('name', 0) as string;
270
+
271
+ const body: any = { name };
272
+
273
+ return await qlikApiRequest.call(
274
+ context,
275
+ 'POST',
276
+ `/api/v1/assistants/${assistantId}/threads`,
277
+ body,
278
+ );
279
+ }
280
+
161
281
  if (operation === 'delete') {
162
282
  const assistantId = context.getNodeParameter('assistantId', 0) as string;
163
283
  await qlikApiRequest.call(context, 'DELETE', `/api/v1/assistants/${assistantId}`);
@@ -1,5 +1,6 @@
1
1
  import type { INodeProperties } from 'n8n-workflow';
2
2
 
3
+ // Get All Assistants
3
4
  export const assistantsGetAllDescription: INodeProperties[] = [
4
5
  {
5
6
  displayName: 'Options',
@@ -19,12 +20,34 @@ export const assistantsGetAllDescription: INodeProperties[] = [
19
20
  name: 'limit',
20
21
  type: 'number',
21
22
  default: 50,
22
- description: 'Max number of assistants to return',
23
+ description: 'The number of assistants to get',
24
+ },
25
+ {
26
+ displayName: 'Next Page',
27
+ name: 'next',
28
+ type: 'string',
29
+ default: '',
30
+ description: 'Optional parameter to request the next page',
31
+ },
32
+ {
33
+ displayName: 'Previous Page',
34
+ name: 'prev',
35
+ type: 'string',
36
+ default: '',
37
+ description: 'Optional parameter to request the previous page',
38
+ },
39
+ {
40
+ displayName: 'Sort By',
41
+ name: 'sort',
42
+ type: 'string',
43
+ default: '',
44
+ description: 'Optional resource field name to sort on (e.g., name). Prefix with `-` for descending order',
23
45
  },
24
46
  ],
25
47
  },
26
48
  ];
27
49
 
50
+ // Get Single Assistant
28
51
  export const assistantsGetDescription: INodeProperties[] = [
29
52
  {
30
53
  displayName: 'Assistant ID',
@@ -42,9 +65,10 @@ export const assistantsGetDescription: INodeProperties[] = [
42
65
  },
43
66
  ];
44
67
 
68
+ // Create Assistant
45
69
  export const assistantsCreateDescription: INodeProperties[] = [
46
70
  {
47
- displayName: 'Assistant Name',
71
+ displayName: 'Name',
48
72
  name: 'name',
49
73
  type: 'string',
50
74
  default: '',
@@ -55,7 +79,49 @@ export const assistantsCreateDescription: INodeProperties[] = [
55
79
  operation: ['create'],
56
80
  },
57
81
  },
58
- description: 'Name of the new assistant',
82
+ description: 'The name of the assistant',
83
+ },
84
+ {
85
+ displayName: 'Title',
86
+ name: 'title',
87
+ type: 'string',
88
+ default: '',
89
+ required: true,
90
+ displayOptions: {
91
+ show: {
92
+ resource: ['assistants'],
93
+ operation: ['create'],
94
+ },
95
+ },
96
+ description: 'The title of the assistant',
97
+ },
98
+ {
99
+ displayName: 'Description',
100
+ name: 'description',
101
+ type: 'string',
102
+ default: '',
103
+ required: true,
104
+ displayOptions: {
105
+ show: {
106
+ resource: ['assistants'],
107
+ operation: ['create'],
108
+ },
109
+ },
110
+ description: 'The description of the assistant',
111
+ },
112
+ {
113
+ displayName: 'Space ID',
114
+ name: 'spaceId',
115
+ type: 'string',
116
+ default: '',
117
+ required: true,
118
+ displayOptions: {
119
+ show: {
120
+ resource: ['assistants'],
121
+ operation: ['create'],
122
+ },
123
+ },
124
+ description: 'Unique identifier of the space to contain the assistant',
59
125
  },
60
126
  {
61
127
  displayName: 'Options',
@@ -71,16 +137,70 @@ export const assistantsCreateDescription: INodeProperties[] = [
71
137
  },
72
138
  options: [
73
139
  {
74
- displayName: 'Description',
75
- name: 'description',
140
+ displayName: 'Tags',
141
+ name: 'tags',
142
+ type: 'string',
143
+ default: '',
144
+ description: 'Comma-separated list of tags for the assistant',
145
+ },
146
+ {
147
+ displayName: 'Knowledge Bases',
148
+ name: 'knowledgeBases',
76
149
  type: 'string',
77
150
  default: '',
78
- description: 'Description of the assistant',
151
+ description: 'Comma-separated list of knowledge base IDs',
152
+ },
153
+ {
154
+ displayName: 'Welcome Message',
155
+ name: 'welcomeMessage',
156
+ type: 'string',
157
+ default: '',
158
+ description: 'Initial message in the chat conversation',
159
+ },
160
+ {
161
+ displayName: 'Custom Properties (JSON)',
162
+ name: 'customProperties',
163
+ type: 'json',
164
+ default: '{}',
165
+ description: 'Freeform JSON to allow custom customization options',
79
166
  },
80
167
  ],
81
168
  },
82
169
  ];
83
170
 
171
+ // Update Assistant
172
+ export const assistantsUpdateDescription: INodeProperties[] = [
173
+ {
174
+ displayName: 'Assistant ID',
175
+ name: 'assistantId',
176
+ type: 'string',
177
+ default: '',
178
+ required: true,
179
+ displayOptions: {
180
+ show: {
181
+ resource: ['assistants'],
182
+ operation: ['update'],
183
+ },
184
+ },
185
+ description: 'The ID of the assistant to update',
186
+ },
187
+ {
188
+ displayName: 'JSON Patch Operations',
189
+ name: 'body',
190
+ type: 'json',
191
+ default: '[]',
192
+ required: true,
193
+ displayOptions: {
194
+ show: {
195
+ resource: ['assistants'],
196
+ operation: ['update'],
197
+ },
198
+ },
199
+ description: 'Array of JSON Patch operations to apply to the assistant',
200
+ },
201
+ ];
202
+
203
+ // Search Assistant
84
204
  export const assistantsSearchDescription: INodeProperties[] = [
85
205
  {
86
206
  displayName: 'Assistant ID',
@@ -153,6 +273,57 @@ export const assistantsSearchDescription: INodeProperties[] = [
153
273
  },
154
274
  ];
155
275
 
276
+ // Get Feedback
277
+ export const assistantsGetFeedbackDescription: INodeProperties[] = [
278
+ {
279
+ displayName: 'Assistant ID',
280
+ name: 'assistantId',
281
+ type: 'string',
282
+ default: '',
283
+ required: true,
284
+ displayOptions: {
285
+ show: {
286
+ resource: ['assistants'],
287
+ operation: ['getFeedback'],
288
+ },
289
+ },
290
+ description: 'The ID of the assistant to get feedback for',
291
+ },
292
+ ];
293
+
294
+ // Bulk Search Source Chunks
295
+ export const assistantsBulkSearchSourcesDescription: INodeProperties[] = [
296
+ {
297
+ displayName: 'Assistant ID',
298
+ name: 'assistantId',
299
+ type: 'string',
300
+ default: '',
301
+ required: true,
302
+ displayOptions: {
303
+ show: {
304
+ resource: ['assistants'],
305
+ operation: ['bulkSearchSources'],
306
+ },
307
+ },
308
+ description: 'The ID of the assistant to search sources for',
309
+ },
310
+ {
311
+ displayName: 'Chunk IDs',
312
+ name: 'chunkIds',
313
+ type: 'json',
314
+ default: '[]',
315
+ required: true,
316
+ displayOptions: {
317
+ show: {
318
+ resource: ['assistants'],
319
+ operation: ['bulkSearchSources'],
320
+ },
321
+ },
322
+ description: 'Array of chunk IDs to search for',
323
+ },
324
+ ];
325
+
326
+ // Delete Assistant
156
327
  export const assistantsDeleteDescription: INodeProperties[] = [
157
328
  {
158
329
  displayName: 'Assistant ID',
@@ -170,6 +341,186 @@ export const assistantsDeleteDescription: INodeProperties[] = [
170
341
  },
171
342
  ];
172
343
 
344
+ // List Starters
345
+ export const assistantsListStartersDescription: INodeProperties[] = [
346
+ {
347
+ displayName: 'Assistant ID',
348
+ name: 'assistantId',
349
+ type: 'string',
350
+ default: '',
351
+ required: true,
352
+ displayOptions: {
353
+ show: {
354
+ resource: ['assistants'],
355
+ operation: ['listStarters'],
356
+ },
357
+ },
358
+ description: 'The ID of the assistant',
359
+ },
360
+ {
361
+ displayName: 'Options',
362
+ name: 'options',
363
+ type: 'collection',
364
+ placeholder: 'Add Option',
365
+ default: {},
366
+ displayOptions: {
367
+ show: {
368
+ resource: ['assistants'],
369
+ operation: ['listStarters'],
370
+ },
371
+ },
372
+ options: [
373
+ {
374
+ displayName: 'Limit',
375
+ name: 'limit',
376
+ type: 'number',
377
+ default: 50,
378
+ description: 'The number of starters to get',
379
+ },
380
+ ],
381
+ },
382
+ ];
383
+
384
+ // Create Starter
385
+ export const assistantsCreateStarterDescription: INodeProperties[] = [
386
+ {
387
+ displayName: 'Assistant ID',
388
+ name: 'assistantId',
389
+ type: 'string',
390
+ default: '',
391
+ required: true,
392
+ displayOptions: {
393
+ show: {
394
+ resource: ['assistants'],
395
+ operation: ['createStarter'],
396
+ },
397
+ },
398
+ description: 'The ID of the assistant',
399
+ },
400
+ {
401
+ displayName: 'Question',
402
+ name: 'question',
403
+ type: 'string',
404
+ default: '',
405
+ required: true,
406
+ displayOptions: {
407
+ show: {
408
+ resource: ['assistants'],
409
+ operation: ['createStarter'],
410
+ },
411
+ },
412
+ description: 'Starter sample question',
413
+ },
414
+ {
415
+ displayName: 'Options',
416
+ name: 'options',
417
+ type: 'collection',
418
+ placeholder: 'Add Option',
419
+ default: {},
420
+ displayOptions: {
421
+ show: {
422
+ resource: ['assistants'],
423
+ operation: ['createStarter'],
424
+ },
425
+ },
426
+ options: [
427
+ {
428
+ displayName: 'Followups (JSON)',
429
+ name: 'followups',
430
+ type: 'json',
431
+ default: '[]',
432
+ description: 'List of followup questions',
433
+ },
434
+ {
435
+ displayName: 'Additional Context',
436
+ name: 'additionalContext',
437
+ type: 'string',
438
+ default: '',
439
+ description: 'Optional context for the question',
440
+ },
441
+ ],
442
+ },
443
+ ];
444
+
445
+ // List Threads
446
+ export const assistantsListThreadsDescription: INodeProperties[] = [
447
+ {
448
+ displayName: 'Assistant ID',
449
+ name: 'assistantId',
450
+ type: 'string',
451
+ default: '',
452
+ required: true,
453
+ displayOptions: {
454
+ show: {
455
+ resource: ['assistants'],
456
+ operation: ['listThreads'],
457
+ },
458
+ },
459
+ description: 'The ID of the assistant',
460
+ },
461
+ {
462
+ displayName: 'Options',
463
+ name: 'options',
464
+ type: 'collection',
465
+ placeholder: 'Add Option',
466
+ default: {},
467
+ displayOptions: {
468
+ show: {
469
+ resource: ['assistants'],
470
+ operation: ['listThreads'],
471
+ },
472
+ },
473
+ options: [
474
+ {
475
+ displayName: 'Limit',
476
+ name: 'limit',
477
+ type: 'number',
478
+ default: 50,
479
+ description: 'The number of threads to get',
480
+ },
481
+ {
482
+ displayName: 'Filter',
483
+ name: 'filter',
484
+ type: 'string',
485
+ default: '',
486
+ description: 'Optional parameter to filter threads',
487
+ },
488
+ ],
489
+ },
490
+ ];
491
+
492
+ // Create Thread
493
+ export const assistantsCreateThreadDescription: INodeProperties[] = [
494
+ {
495
+ displayName: 'Assistant ID',
496
+ name: 'assistantId',
497
+ type: 'string',
498
+ default: '',
499
+ required: true,
500
+ displayOptions: {
501
+ show: {
502
+ resource: ['assistants'],
503
+ operation: ['createThread'],
504
+ },
505
+ },
506
+ description: 'The ID of the assistant',
507
+ },
508
+ {
509
+ displayName: 'Thread Name',
510
+ name: 'name',
511
+ type: 'string',
512
+ default: '',
513
+ required: true,
514
+ displayOptions: {
515
+ show: {
516
+ resource: ['assistants'],
517
+ operation: ['createThread'],
518
+ },
519
+ },
520
+ description: 'The name of the thread',
521
+ },
522
+ ];
523
+
173
524
  export const assistantDescription: INodeProperties[] = [
174
525
  {
175
526
  displayName: 'Operation',
@@ -200,17 +551,59 @@ export const assistantDescription: INodeProperties[] = [
200
551
  action: 'Create an assistant',
201
552
  description: 'Create a new assistant',
202
553
  },
554
+ {
555
+ name: 'Update',
556
+ value: 'update',
557
+ action: 'Update an assistant',
558
+ description: 'Update assistant properties',
559
+ },
203
560
  {
204
561
  name: 'Search',
205
562
  value: 'search',
206
563
  action: 'Search assistant sources',
207
564
  description: 'Perform search in assistant sources',
208
565
  },
566
+ {
567
+ name: 'Get Feedback',
568
+ value: 'getFeedback',
569
+ action: 'Get assistant feedback',
570
+ description: 'Retrieve feedback summary for the assistant',
571
+ },
572
+ {
573
+ name: 'Bulk Search Sources',
574
+ value: 'bulkSearchSources',
575
+ action: 'Bulk search source chunks',
576
+ description: 'Perform a bulk search for source chunks',
577
+ },
578
+ {
579
+ name: 'List Starters',
580
+ value: 'listStarters',
581
+ action: 'List assistant starters',
582
+ description: 'Retrieve list of starters for the assistant',
583
+ },
584
+ {
585
+ name: 'Create Starter',
586
+ value: 'createStarter',
587
+ action: 'Create an assistant starter',
588
+ description: 'Create a new starter for the assistant',
589
+ },
590
+ {
591
+ name: 'List Threads',
592
+ value: 'listThreads',
593
+ action: 'List assistant threads',
594
+ description: 'Retrieve list of threads for the assistant',
595
+ },
596
+ {
597
+ name: 'Create Thread',
598
+ value: 'createThread',
599
+ action: 'Create an assistant thread',
600
+ description: 'Create a new thread for the assistant',
601
+ },
209
602
  {
210
603
  name: 'Delete',
211
604
  value: 'delete',
212
605
  action: 'Delete an assistant',
213
- description: 'Delete an assistant',
606
+ description: 'Delete an assistant and all its resources',
214
607
  },
215
608
  ],
216
609
  default: 'getAll',
@@ -218,6 +611,13 @@ export const assistantDescription: INodeProperties[] = [
218
611
  ...assistantsGetAllDescription,
219
612
  ...assistantsGetDescription,
220
613
  ...assistantsCreateDescription,
614
+ ...assistantsUpdateDescription,
221
615
  ...assistantsSearchDescription,
616
+ ...assistantsGetFeedbackDescription,
617
+ ...assistantsBulkSearchSourcesDescription,
618
+ ...assistantsListStartersDescription,
619
+ ...assistantsCreateStarterDescription,
620
+ ...assistantsListThreadsDescription,
621
+ ...assistantsCreateThreadDescription,
222
622
  ...assistantsDeleteDescription,
223
623
  ];