n8n-nodes-qlik-cloud 1.0.17 → 1.1.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/README.md +11 -6
- package/dist/credentials/QlikCloudOAuth2Api.credentials.js +21 -21
- package/dist/nodes/QlikCloud/QlikCloud.node.js +405 -133
- package/dist/nodes/QlikCloud/resources/apps/index.d.ts +36 -0
- package/dist/nodes/QlikCloud/resources/apps/index.js +1115 -111
- package/dist/nodes/QlikCloud/resources/assistants/index.js +27 -7
- package/dist/nodes/QlikCloud/shared/transport.d.ts +2 -2
- package/dist/nodes/QlikCloud/shared/transport.js +16 -9
- package/package.json +2 -3
- package/src/credentials/QlikCloudOAuth2Api.credentials.ts +25 -28
- package/src/nodes/QlikCloud/QlikCloud.node.ts +530 -136
- package/src/nodes/QlikCloud/resources/apps/index.ts +1151 -110
- package/src/nodes/QlikCloud/resources/assistants/index.ts +27 -7
- package/src/nodes/QlikCloud/shared/transport.ts +21 -11
|
@@ -2,6 +2,33 @@ import type { INodeProperties } from 'n8n-workflow';
|
|
|
2
2
|
|
|
3
3
|
// Get All Assistants
|
|
4
4
|
export const assistantsGetAllDescription: INodeProperties[] = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Return All',
|
|
7
|
+
name: 'returnAll',
|
|
8
|
+
type: 'boolean',
|
|
9
|
+
default: false,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['assistants'],
|
|
13
|
+
operation: ['getAll'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
description: 'Whether to return all assistants',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Limit',
|
|
20
|
+
name: 'limit',
|
|
21
|
+
type: 'number',
|
|
22
|
+
default: 50,
|
|
23
|
+
displayOptions: {
|
|
24
|
+
show: {
|
|
25
|
+
resource: ['assistants'],
|
|
26
|
+
operation: ['getAll'],
|
|
27
|
+
returnAll: [false],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
description: 'The number of assistants to get',
|
|
31
|
+
},
|
|
5
32
|
{
|
|
6
33
|
displayName: 'Options',
|
|
7
34
|
name: 'options',
|
|
@@ -15,13 +42,6 @@ export const assistantsGetAllDescription: INodeProperties[] = [
|
|
|
15
42
|
},
|
|
16
43
|
},
|
|
17
44
|
options: [
|
|
18
|
-
{
|
|
19
|
-
displayName: 'Limit',
|
|
20
|
-
name: 'limit',
|
|
21
|
-
type: 'number',
|
|
22
|
-
default: 50,
|
|
23
|
-
description: 'The number of assistants to get',
|
|
24
|
-
},
|
|
25
45
|
{
|
|
26
46
|
displayName: 'Next Page',
|
|
27
47
|
name: 'next',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
IExecuteFunctions,
|
|
3
|
-
IHttpRequestOptions,
|
|
4
3
|
IHttpRequestMethods,
|
|
4
|
+
IHttpRequestOptions,
|
|
5
5
|
} from 'n8n-workflow';
|
|
6
6
|
import { NodeApiError } from 'n8n-workflow';
|
|
7
7
|
|
|
@@ -9,9 +9,11 @@ export async function qlikApiRequest(
|
|
|
9
9
|
this: IExecuteFunctions,
|
|
10
10
|
method: IHttpRequestMethods,
|
|
11
11
|
endpoint: string,
|
|
12
|
-
body?:
|
|
12
|
+
body?: any,
|
|
13
13
|
qs?: Record<string, any>,
|
|
14
|
-
|
|
14
|
+
returnFullResponse: boolean = false,
|
|
15
|
+
extraOptions: Partial<IHttpRequestOptions> = {},
|
|
16
|
+
): Promise<any> {
|
|
15
17
|
const credentials = await this.getCredentials('qlikCloudApi');
|
|
16
18
|
|
|
17
19
|
if (!credentials) {
|
|
@@ -20,17 +22,24 @@ export async function qlikApiRequest(
|
|
|
20
22
|
} as any);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
const baseUrl = credentials.baseUrl as string;
|
|
25
|
+
const baseUrl = (credentials.baseUrl as string).replace(/\/+$/, '');
|
|
24
26
|
const accessToken = credentials.accessToken as string;
|
|
27
|
+
const url = `${baseUrl}${endpoint.startsWith('/') ? endpoint : `/${endpoint}`}`;
|
|
28
|
+
|
|
29
|
+
const headers = {
|
|
30
|
+
Authorization: `Bearer ${accessToken}`,
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
...(extraOptions.headers || {}),
|
|
33
|
+
};
|
|
25
34
|
|
|
26
35
|
const options: IHttpRequestOptions = {
|
|
27
|
-
headers: {
|
|
28
|
-
Authorization: `Bearer ${accessToken}`,
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
36
|
method,
|
|
32
|
-
url
|
|
37
|
+
url,
|
|
33
38
|
qs,
|
|
39
|
+
json: extraOptions.json ?? true,
|
|
40
|
+
returnFullResponse,
|
|
41
|
+
...extraOptions,
|
|
42
|
+
headers,
|
|
34
43
|
};
|
|
35
44
|
|
|
36
45
|
if (body !== undefined) {
|
|
@@ -40,8 +49,9 @@ export async function qlikApiRequest(
|
|
|
40
49
|
try {
|
|
41
50
|
return await this.helpers.httpRequest(options);
|
|
42
51
|
} catch (error) {
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
const errMessage = error instanceof Error ? error.message : typeof error === 'string' ? error : JSON.stringify(error);
|
|
53
|
+
throw new NodeApiError(this.getNode(), { message: errMessage }, {
|
|
54
|
+
message: 'Qlik Cloud API request failed',
|
|
45
55
|
} as any);
|
|
46
56
|
}
|
|
47
57
|
}
|