n8n-nodes-qlik-cloud 1.0.18 → 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 CHANGED
@@ -9,12 +9,17 @@ Complete integration with Qlik Cloud REST APIs covering:
9
9
  ### Apps Management
10
10
  - **Get All Apps** - Retrieve all apps with filtering and pagination
11
11
  - **Get App** - Retrieve a specific app by ID
12
- - **Create App** - Create a new app
13
- - **Update App** - Update app properties
14
- - **Delete App** - Delete an app
15
- - **Copy App** - Create a copy of an app
16
- - **Export App** - Export app data
17
- - **Publish App** - Publish app to a space
12
+ - **Create / Update / Delete / Copy** - Full CRUD on apps plus copy
13
+ - **Export / Import** - Export apps and import QVF files
14
+ - **Publish / Republish / Move / Remove** - Publish or republish to a space, move between spaces, or remove from a space
15
+ - **Ownership** - Change object owner or update app owner
16
+ - **Data Insights** - Get data lineage, data metadata, list insight analyses, recommend insights, and fetch the insight model
17
+ - **Media** - Upload, download, delete, and list media files; fetch app thumbnail
18
+ - **Reloads** - List reload logs, fetch a specific reload log, and retrieve reload metadata
19
+ - **Report Filters** - List, create, get, update, delete, and count report filters
20
+ - **Scripts** - List, create, get, update, delete scripts
21
+ - **Evaluations** - List/create evaluations, compare evaluations, and download results
22
+ - **Validate Script** - Validate a script payload
18
23
  - **Get Privileges** - Retrieve app access privileges
19
24
 
20
25
  ### Assistants
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QlikCloudOAuth2Api = void 0;
4
- const scopes = [
5
- 'https://analysis.windows.net/powerbi/api/.default',
6
- ];
4
+ const DEFAULT_SCOPES = ['openid', 'profile', 'email', 'offline_access'];
7
5
  class QlikCloudOAuth2Api {
8
6
  constructor() {
9
7
  this.name = 'qlikCloudOAuth2Api';
@@ -25,21 +23,19 @@ class QlikCloudOAuth2Api {
25
23
  name: 'authUrl',
26
24
  type: 'hidden',
27
25
  default: '',
28
- required: true,
29
26
  },
30
27
  {
31
28
  displayName: 'Access Token URL',
32
29
  name: 'accessTokenUrl',
33
30
  type: 'hidden',
34
31
  default: '',
35
- required: true,
36
32
  },
37
33
  {
38
34
  displayName: 'Scope',
39
35
  name: 'scope',
40
- type: 'hidden',
41
- default: scopes.join(' '),
42
- description: 'OAuth2 scopes required for Qlik Cloud API access',
36
+ type: 'string',
37
+ default: DEFAULT_SCOPES.join(' '),
38
+ description: 'OAuth2 scopes requested from Qlik Cloud (space-separated)',
43
39
  },
44
40
  {
45
41
  displayName: 'Authentication',
@@ -51,21 +47,25 @@ class QlikCloudOAuth2Api {
51
47
  }
52
48
  async preAuthentication(credentials) {
53
49
  const baseUrl = credentials.baseUrl;
54
- // Extract tenant and region from base URL
55
- // Expected format: https://tenant.region.qlikcloud.com
56
- const urlParts = new URL(baseUrl);
57
- const hostname = urlParts.hostname;
58
- const parts = hostname.split('.');
59
- if (parts.length < 3) {
50
+ let parsed;
51
+ try {
52
+ parsed = new URL(baseUrl);
53
+ }
54
+ catch (error) {
60
55
  throw new Error('Invalid Qlik Cloud tenant URL format');
61
56
  }
62
- const tenant = parts[0];
63
- const region = parts[1];
64
- // Construct OAuth endpoints
65
- const authEndpoint = `https://auth.${region}.qlikcloud.com/oauth/authorize`;
66
- const tokenEndpoint = `https://auth.${region}.qlikcloud.com/oauth/token`;
67
- credentials.authUrl = authEndpoint;
68
- credentials.accessTokenUrl = tokenEndpoint;
57
+ if (parsed.protocol !== 'https:') {
58
+ throw new Error('Qlik Cloud tenant URL must use HTTPS');
59
+ }
60
+ if (!parsed.hostname.endsWith('.qlikcloud.com')) {
61
+ throw new Error('Tenant URL must end with .qlikcloud.com');
62
+ }
63
+ const oauthBase = `${parsed.origin}/oauth`;
64
+ credentials.authUrl = `${oauthBase}/authorize`;
65
+ credentials.accessTokenUrl = `${oauthBase}/token`;
66
+ if (!credentials.scope) {
67
+ credentials.scope = DEFAULT_SCOPES.join(' ');
68
+ }
69
69
  return credentials;
70
70
  }
71
71
  }