n8n-nodes-qlik-cloud 1.0.4 → 1.0.5

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.
@@ -201,6 +201,21 @@ async function handleAssistantsResource(operation, context) {
201
201
  const body = { name };
202
202
  return await transport_1.qlikApiRequest.call(context, 'POST', `/api/v1/assistants/${assistantId}/threads`, body);
203
203
  }
204
+ if (operation === 'streamThread') {
205
+ const assistantId = context.getNodeParameter('assistantId', 0);
206
+ const threadId = context.getNodeParameter('threadId', 0);
207
+ const messages = context.getNodeParameter('messages', 0);
208
+ const options = context.getNodeParameter('options', 0);
209
+ const body = {
210
+ messages: typeof messages === 'string' ? JSON.parse(messages) : messages,
211
+ };
212
+ if (options.followUpContext) {
213
+ body.followUpContext = typeof options.followUpContext === 'string'
214
+ ? JSON.parse(options.followUpContext)
215
+ : options.followUpContext;
216
+ }
217
+ return await transport_1.qlikApiRequest.call(context, 'POST', `/api/v1/assistants/${assistantId}/threads/${threadId}/actions/stream`, body);
218
+ }
204
219
  if (operation === 'delete') {
205
220
  const assistantId = context.getNodeParameter('assistantId', 0);
206
221
  await transport_1.qlikApiRequest.call(context, 'DELETE', `/api/v1/assistants/${assistantId}`);
@@ -11,4 +11,5 @@ export declare const assistantsListStartersDescription: INodeProperties[];
11
11
  export declare const assistantsCreateStarterDescription: INodeProperties[];
12
12
  export declare const assistantsListThreadsDescription: INodeProperties[];
13
13
  export declare const assistantsCreateThreadDescription: INodeProperties[];
14
+ export declare const assistantsStreamThreadDescription: INodeProperties[];
14
15
  export declare const assistantDescription: INodeProperties[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assistantDescription = exports.assistantsCreateThreadDescription = exports.assistantsListThreadsDescription = exports.assistantsCreateStarterDescription = exports.assistantsListStartersDescription = exports.assistantsDeleteDescription = exports.assistantsBulkSearchSourcesDescription = exports.assistantsGetFeedbackDescription = exports.assistantsSearchDescription = exports.assistantsUpdateDescription = exports.assistantsCreateDescription = exports.assistantsGetDescription = exports.assistantsGetAllDescription = void 0;
3
+ exports.assistantDescription = exports.assistantsStreamThreadDescription = exports.assistantsCreateThreadDescription = exports.assistantsListThreadsDescription = exports.assistantsCreateStarterDescription = exports.assistantsListStartersDescription = exports.assistantsDeleteDescription = exports.assistantsBulkSearchSourcesDescription = exports.assistantsGetFeedbackDescription = exports.assistantsSearchDescription = exports.assistantsUpdateDescription = exports.assistantsCreateDescription = exports.assistantsGetDescription = exports.assistantsGetAllDescription = void 0;
4
4
  // Get All Assistants
5
5
  exports.assistantsGetAllDescription = [
6
6
  {
@@ -510,6 +510,73 @@ exports.assistantsCreateThreadDescription = [
510
510
  description: 'The name of the thread',
511
511
  },
512
512
  ];
513
+ // Stream Thread
514
+ exports.assistantsStreamThreadDescription = [
515
+ {
516
+ displayName: 'Assistant ID',
517
+ name: 'assistantId',
518
+ type: 'string',
519
+ default: '',
520
+ required: true,
521
+ displayOptions: {
522
+ show: {
523
+ resource: ['assistants'],
524
+ operation: ['streamThread'],
525
+ },
526
+ },
527
+ description: 'The ID of the assistant',
528
+ },
529
+ {
530
+ displayName: 'Thread ID',
531
+ name: 'threadId',
532
+ type: 'string',
533
+ default: '',
534
+ required: true,
535
+ displayOptions: {
536
+ show: {
537
+ resource: ['assistants'],
538
+ operation: ['streamThread'],
539
+ },
540
+ },
541
+ description: 'The ID of the thread to stream',
542
+ },
543
+ {
544
+ displayName: 'Messages',
545
+ name: 'messages',
546
+ type: 'json',
547
+ default: '[]',
548
+ required: true,
549
+ displayOptions: {
550
+ show: {
551
+ resource: ['assistants'],
552
+ operation: ['streamThread'],
553
+ },
554
+ },
555
+ description: 'Array of message objects to send to the stream',
556
+ },
557
+ {
558
+ displayName: 'Options',
559
+ name: 'options',
560
+ type: 'collection',
561
+ placeholder: 'Add Option',
562
+ default: {},
563
+ displayOptions: {
564
+ show: {
565
+ resource: ['assistants'],
566
+ operation: ['streamThread'],
567
+ },
568
+ },
569
+ options: [
570
+ {
571
+ displayName: 'Follow Up Context (JSON)',
572
+ name: 'followUpContext',
573
+ type: 'json',
574
+ default: '{}',
575
+ description: 'Optional context for follow-up interactions',
576
+ },
577
+ ],
578
+ },
579
+ ];
513
580
  exports.assistantDescription = [
514
581
  {
515
582
  displayName: 'Operation',
@@ -588,6 +655,12 @@ exports.assistantDescription = [
588
655
  action: 'Create an assistant thread',
589
656
  description: 'Create a new thread for the assistant',
590
657
  },
658
+ {
659
+ name: 'Stream Thread',
660
+ value: 'streamThread',
661
+ action: 'Stream thread conversation',
662
+ description: 'Stream messages to a thread with real-time responses',
663
+ },
591
664
  {
592
665
  name: 'Delete',
593
666
  value: 'delete',
@@ -608,5 +681,6 @@ exports.assistantDescription = [
608
681
  ...exports.assistantsCreateStarterDescription,
609
682
  ...exports.assistantsListThreadsDescription,
610
683
  ...exports.assistantsCreateThreadDescription,
684
+ ...exports.assistantsStreamThreadDescription,
611
685
  ...exports.assistantsDeleteDescription,
612
686
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-qlik-cloud",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "n8n node for Qlik Cloud REST APIs integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -278,6 +278,29 @@ async function handleAssistantsResource(operation: string, context: IExecuteFunc
278
278
  );
279
279
  }
280
280
 
281
+ if (operation === 'streamThread') {
282
+ const assistantId = context.getNodeParameter('assistantId', 0) as string;
283
+ const threadId = context.getNodeParameter('threadId', 0) as string;
284
+ const messages = context.getNodeParameter('messages', 0) as any;
285
+ const options = context.getNodeParameter('options', 0) as any;
286
+
287
+ const body: any = {
288
+ messages: typeof messages === 'string' ? JSON.parse(messages) : messages,
289
+ };
290
+ if (options.followUpContext) {
291
+ body.followUpContext = typeof options.followUpContext === 'string'
292
+ ? JSON.parse(options.followUpContext)
293
+ : options.followUpContext;
294
+ }
295
+
296
+ return await qlikApiRequest.call(
297
+ context,
298
+ 'POST',
299
+ `/api/v1/assistants/${assistantId}/threads/${threadId}/actions/stream`,
300
+ body,
301
+ );
302
+ }
303
+
281
304
  if (operation === 'delete') {
282
305
  const assistantId = context.getNodeParameter('assistantId', 0) as string;
283
306
  await qlikApiRequest.call(context, 'DELETE', `/api/v1/assistants/${assistantId}`);
@@ -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>
@@ -521,6 +521,74 @@ export const assistantsCreateThreadDescription: INodeProperties[] = [
521
521
  },
522
522
  ];
523
523
 
524
+ // Stream Thread
525
+ export const assistantsStreamThreadDescription: INodeProperties[] = [
526
+ {
527
+ displayName: 'Assistant ID',
528
+ name: 'assistantId',
529
+ type: 'string',
530
+ default: '',
531
+ required: true,
532
+ displayOptions: {
533
+ show: {
534
+ resource: ['assistants'],
535
+ operation: ['streamThread'],
536
+ },
537
+ },
538
+ description: 'The ID of the assistant',
539
+ },
540
+ {
541
+ displayName: 'Thread ID',
542
+ name: 'threadId',
543
+ type: 'string',
544
+ default: '',
545
+ required: true,
546
+ displayOptions: {
547
+ show: {
548
+ resource: ['assistants'],
549
+ operation: ['streamThread'],
550
+ },
551
+ },
552
+ description: 'The ID of the thread to stream',
553
+ },
554
+ {
555
+ displayName: 'Messages',
556
+ name: 'messages',
557
+ type: 'json',
558
+ default: '[]',
559
+ required: true,
560
+ displayOptions: {
561
+ show: {
562
+ resource: ['assistants'],
563
+ operation: ['streamThread'],
564
+ },
565
+ },
566
+ description: 'Array of message objects to send to the stream',
567
+ },
568
+ {
569
+ displayName: 'Options',
570
+ name: 'options',
571
+ type: 'collection',
572
+ placeholder: 'Add Option',
573
+ default: {},
574
+ displayOptions: {
575
+ show: {
576
+ resource: ['assistants'],
577
+ operation: ['streamThread'],
578
+ },
579
+ },
580
+ options: [
581
+ {
582
+ displayName: 'Follow Up Context (JSON)',
583
+ name: 'followUpContext',
584
+ type: 'json',
585
+ default: '{}',
586
+ description: 'Optional context for follow-up interactions',
587
+ },
588
+ ],
589
+ },
590
+ ];
591
+
524
592
  export const assistantDescription: INodeProperties[] = [
525
593
  {
526
594
  displayName: 'Operation',
@@ -599,6 +667,12 @@ export const assistantDescription: INodeProperties[] = [
599
667
  action: 'Create an assistant thread',
600
668
  description: 'Create a new thread for the assistant',
601
669
  },
670
+ {
671
+ name: 'Stream Thread',
672
+ value: 'streamThread',
673
+ action: 'Stream thread conversation',
674
+ description: 'Stream messages to a thread with real-time responses',
675
+ },
602
676
  {
603
677
  name: 'Delete',
604
678
  value: 'delete',
@@ -619,5 +693,6 @@ export const assistantDescription: INodeProperties[] = [
619
693
  ...assistantsCreateStarterDescription,
620
694
  ...assistantsListThreadsDescription,
621
695
  ...assistantsCreateThreadDescription,
696
+ ...assistantsStreamThreadDescription,
622
697
  ...assistantsDeleteDescription,
623
698
  ];