n8n-nodes-qlik-cloud 1.0.3 → 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.
- package/README.md +14 -3
- package/dist/nodes/QlikCloud/QlikCloud.node.js +16 -1
- package/dist/nodes/QlikCloud/resources/assistants/index.d.ts +1 -0
- package/dist/nodes/QlikCloud/resources/assistants/index.js +75 -1
- package/package.json +2 -2
- package/src/nodes/QlikCloud/QlikCloud.node.ts +24 -1
- package/src/nodes/QlikCloud/qlik.svg +1 -0
- package/src/nodes/QlikCloud/resources/assistants/index.ts +75 -0
- package/dist/shared/transport.d.ts +0 -2
- package/dist/shared/transport.js +0 -32
- /package/dist/{icons/icons/qlik.svg → icons} +0 -0
package/README.md
CHANGED
|
@@ -18,11 +18,18 @@ Complete integration with Qlik Cloud REST APIs covering:
|
|
|
18
18
|
- **Get Privileges** - Retrieve app access privileges
|
|
19
19
|
|
|
20
20
|
### Assistants
|
|
21
|
-
- **Get All Assistants** - List all available assistants
|
|
21
|
+
- **Get All Assistants** - List all available assistants with pagination and sorting
|
|
22
22
|
- **Get Assistant** - Retrieve a specific assistant by ID
|
|
23
|
-
- **Create Assistant** - Create a new assistant
|
|
23
|
+
- **Create Assistant** - Create a new assistant with name, title, description, and space
|
|
24
|
+
- **Update Assistant** - Update assistant properties using JSON Patch operations
|
|
24
25
|
- **Search** - Perform semantic search in assistant sources
|
|
25
|
-
- **
|
|
26
|
+
- **Get Feedback** - Retrieve feedback summary for an assistant
|
|
27
|
+
- **Bulk Search Sources** - Perform bulk search for source chunks by chunk IDs
|
|
28
|
+
- **List Starters** - List all starter questions for an assistant
|
|
29
|
+
- **Create Starter** - Create a new starter question with optional followups
|
|
30
|
+
- **List Threads** - List conversation threads for an assistant with filtering
|
|
31
|
+
- **Create Thread** - Create a new conversation thread
|
|
32
|
+
- **Delete Assistant** - Delete an assistant and all its resources
|
|
26
33
|
|
|
27
34
|
### Audits
|
|
28
35
|
- **Get All Audits** - List recent audit events with filtering
|
|
@@ -108,6 +115,10 @@ For issues or feature requests:
|
|
|
108
115
|
- GitHub Issues: [n8n-nodes-qlik-cloud](https://github.com/yourusername/n8n-nodes-qlik-cloud/issues)
|
|
109
116
|
- n8n Community: [n8n Community Forum](https://community.n8n.io)
|
|
110
117
|
|
|
118
|
+
## Development
|
|
119
|
+
|
|
120
|
+
This node follows the n8n community node development guidelines. For more information on implementing custom nodes, refer to the [n8n nodes starter repository](https://github.com/n8n-io/n8n-nodes-starter), which is the recommended way to implement nodes provided by n8n.
|
|
121
|
+
|
|
111
122
|
## License
|
|
112
123
|
|
|
113
124
|
MIT
|
|
@@ -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}`);
|
|
@@ -333,7 +348,7 @@ class QlikCloud {
|
|
|
333
348
|
this.description = {
|
|
334
349
|
displayName: 'Qlik Cloud',
|
|
335
350
|
name: 'qlikCloud',
|
|
336
|
-
icon: 'file
|
|
351
|
+
icon: 'file:../../icons/qlik.svg',
|
|
337
352
|
group: ['transform'],
|
|
338
353
|
version: 1,
|
|
339
354
|
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
|
@@ -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,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-qlik-cloud",
|
|
3
|
-
"version": "1.0.
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc && npm run copy-assets",
|
|
9
|
-
"copy-assets": "cp -r src/icons dist/icons || true",
|
|
9
|
+
"copy-assets": "cp -r src/icons/* dist/icons || true",
|
|
10
10
|
"dev": "tsc --watch",
|
|
11
11
|
"lint": "eslint src/",
|
|
12
12
|
"test": "jest"
|
|
@@ -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}`);
|
|
@@ -447,7 +470,7 @@ export class QlikCloud implements INodeType {
|
|
|
447
470
|
description: INodeTypeDescription = {
|
|
448
471
|
displayName: 'Qlik Cloud',
|
|
449
472
|
name: 'qlikCloud',
|
|
450
|
-
icon: 'file
|
|
473
|
+
icon: 'file:../../icons/qlik.svg',
|
|
451
474
|
group: ['transform'],
|
|
452
475
|
version: 1,
|
|
453
476
|
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
|
@@ -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
|
];
|
package/dist/shared/transport.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.qlikApiRequest = qlikApiRequest;
|
|
4
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
async function qlikApiRequest(method, endpoint, body, qs) {
|
|
6
|
-
const credentials = await this.getCredentials('qlikCloudApi');
|
|
7
|
-
if (!credentials) {
|
|
8
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
9
|
-
message: 'No credentials found for Qlik Cloud API',
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
const baseUrl = credentials.baseUrl;
|
|
13
|
-
const accessToken = credentials.accessToken;
|
|
14
|
-
const options = {
|
|
15
|
-
headers: {
|
|
16
|
-
Authorization: `Bearer ${accessToken}`,
|
|
17
|
-
'Content-Type': 'application/json',
|
|
18
|
-
},
|
|
19
|
-
method,
|
|
20
|
-
url: `${baseUrl}${endpoint}`,
|
|
21
|
-
qs,
|
|
22
|
-
};
|
|
23
|
-
if (body !== undefined) {
|
|
24
|
-
options.body = body;
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
return await this.helpers.httpRequest(options);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
File without changes
|