@qlik/api 1.21.0 → 1.22.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/api-keys.d.ts +1 -1
- package/api-keys.js +2 -2
- package/apps.d.ts +1 -1
- package/apps.js +2 -2
- package/audits.d.ts +1 -1
- package/audits.js +2 -2
- package/auth.js +2 -2
- package/automations.d.ts +1 -1
- package/automations.js +2 -2
- package/brands.d.ts +1 -1
- package/brands.js +2 -2
- package/chunks/7RHSSS4W.js +0 -0
- package/chunks/{GVE5ABSG.js → GZRY5VHW.js} +2 -1
- package/chunks/{4M3Q6QY3.js → KBR7JBWC.js} +12 -6
- package/chunks/{BUSRKHDX.js → OEVNZ5IQ.js} +98 -2
- package/chunks/{3FHEUGST.js → PR52AAWU.js} +6 -3
- package/chunks/{LVRC5AWE.js → SEBN4KFZ.js} +2 -1
- package/chunks/{2OQLWLWE.js → SNQHDUYY.js} +3 -3
- package/chunks/{JCJIPO2A.js → TGDZVKG2.js} +1 -1
- package/chunks/{DTGUILK5.js → TUPLQG25.js} +2 -2
- package/chunks/{YQLW56LG.js → VHPC6L7L.js} +1 -1
- package/collections.d.ts +1 -1
- package/collections.js +2 -2
- package/csp-origins.d.ts +1 -1
- package/csp-origins.js +2 -2
- package/data-assets.d.ts +1 -1
- package/data-assets.js +2 -2
- package/data-connections.d.ts +1 -1
- package/data-connections.js +2 -2
- package/data-credentials.d.ts +1 -1
- package/data-credentials.js +2 -2
- package/data-files.d.ts +1 -1
- package/data-files.js +2 -2
- package/extensions.d.ts +1 -1
- package/extensions.js +2 -2
- package/{global.types--37uwGji.d.ts → global.types-qsBNouXJ.d.ts} +18 -0
- package/glossaries.d.ts +1 -1
- package/glossaries.js +2 -2
- package/groups.d.ts +1 -1
- package/groups.js +2 -2
- package/identity-providers.d.ts +1 -1
- package/identity-providers.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +5 -5
- package/items.d.ts +1 -1
- package/items.js +2 -2
- package/licenses.d.ts +1 -1
- package/licenses.js +2 -2
- package/package.json +1 -1
- package/qix.d.ts +3 -1
- package/qix.js +2 -2
- package/quotas.d.ts +1 -1
- package/quotas.js +2 -2
- package/reload-tasks.d.ts +1 -1
- package/reload-tasks.js +2 -2
- package/reloads.d.ts +4 -4
- package/reloads.js +2 -2
- package/reports.d.ts +2 -2
- package/reports.js +2 -2
- package/roles.d.ts +1 -1
- package/roles.js +2 -2
- package/spaces.d.ts +1 -1
- package/spaces.js +2 -2
- package/temp-contents.d.ts +1 -1
- package/temp-contents.js +2 -2
- package/tenants.d.ts +1 -1
- package/tenants.js +2 -2
- package/themes.d.ts +1 -1
- package/themes.js +2 -2
- package/transports.d.ts +1 -1
- package/transports.js +2 -2
- package/users.d.ts +1 -1
- package/users.js +2 -2
- package/web-integrations.d.ts +1 -1
- package/web-integrations.js +2 -2
- package/web-notifications.d.ts +1 -1
- package/web-notifications.js +2 -2
- package/webhooks.d.ts +22 -22
- package/webhooks.js +2 -2
package/api-keys.d.ts
CHANGED
package/api-keys.js
CHANGED
package/apps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApiCallOptions, D as DownloadableBlob } from './global.types
|
|
1
|
+
import { A as ApiCallOptions, D as DownloadableBlob } from './global.types-qsBNouXJ.js';
|
|
2
2
|
import './auth-types-PkN9CAF_.js';
|
|
3
3
|
|
|
4
4
|
type Analysis = "breakdown" | "changePoint" | "comparison" | "contribution" | "correlation" | "fact" | "mutualInfo" | "rank" | "spike" | "trend" | "values";
|
package/apps.js
CHANGED
package/audits.d.ts
CHANGED
package/audits.js
CHANGED
package/auth.js
CHANGED
package/automations.d.ts
CHANGED
package/automations.js
CHANGED
package/brands.d.ts
CHANGED
package/brands.js
CHANGED
|
File without changes
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
invokeFetch,
|
|
5
5
|
isWindows,
|
|
6
6
|
toValidWebsocketLocationUrl
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./OEVNZ5IQ.js";
|
|
8
|
+
import "./7RHSSS4W.js";
|
|
8
9
|
import {
|
|
9
10
|
isBrowser
|
|
10
11
|
} from "./2ZQ3ZX7F.js";
|
|
@@ -86,13 +87,17 @@ function toGlobalAppSessionId({
|
|
|
86
87
|
identity,
|
|
87
88
|
hostConfig,
|
|
88
89
|
withoutData,
|
|
89
|
-
useReloadEngine
|
|
90
|
+
useReloadEngine,
|
|
91
|
+
ttlSeconds
|
|
90
92
|
}) {
|
|
91
93
|
const locationUrl = toValidWebsocketLocationUrl(hostConfig);
|
|
92
94
|
let url = `${locationUrl}/${appId}`;
|
|
93
95
|
if (identity) {
|
|
94
96
|
url += `/${identity}`;
|
|
95
97
|
}
|
|
98
|
+
if (ttlSeconds !== void 0 && ttlSeconds >= 0) {
|
|
99
|
+
url += `/ttl/${ttlSeconds}`;
|
|
100
|
+
}
|
|
96
101
|
if (useReloadEngine) {
|
|
97
102
|
url += "/useReloadEngine";
|
|
98
103
|
}
|
|
@@ -145,7 +150,7 @@ function listenForWindowsAuthenticationInformation(session) {
|
|
|
145
150
|
return authSuggestedInWebsocket;
|
|
146
151
|
}
|
|
147
152
|
async function createAndSetupEnigmaSession(props, canRetry) {
|
|
148
|
-
const { createEnigmaSession } = await import("./
|
|
153
|
+
const { createEnigmaSession } = await import("./PR52AAWU.js");
|
|
149
154
|
const session = await createEnigmaSession(props);
|
|
150
155
|
setupSessionListeners(session, props);
|
|
151
156
|
let global;
|
|
@@ -566,14 +571,15 @@ function getExternalSession(externalApp, appSessionProps) {
|
|
|
566
571
|
}
|
|
567
572
|
|
|
568
573
|
// src/qix/qix-functions.ts
|
|
569
|
-
async function createSessionApp() {
|
|
574
|
+
async function createSessionApp(ttlSeconds) {
|
|
570
575
|
let sharedSession;
|
|
571
576
|
if ((await getPlatform()).isCloud) {
|
|
572
|
-
sharedSession = await getOrCreateSharedSession({ appId: `SessionApp_${Date.now()}
|
|
577
|
+
sharedSession = await getOrCreateSharedSession({ appId: `SessionApp_${Date.now()}`, ttlSeconds });
|
|
573
578
|
} else {
|
|
574
579
|
sharedSession = await getOrCreateSharedSession({
|
|
575
580
|
appId: `%3Ftransient%3D/identity/${Date.now()}`,
|
|
576
|
-
useSessionApp: true
|
|
581
|
+
useSessionApp: true,
|
|
582
|
+
ttlSeconds
|
|
577
583
|
});
|
|
578
584
|
}
|
|
579
585
|
let alreadyClosed = false;
|
|
@@ -565,9 +565,22 @@ function clearStoredAnonymousTokens(hostConfig) {
|
|
|
565
565
|
}
|
|
566
566
|
|
|
567
567
|
// src/auth/internal/default-auth-modules/oauth/oauth-utils.ts
|
|
568
|
+
function toPerformInteractiveLoginFunction(performInteractiveLogin) {
|
|
569
|
+
if (typeof performInteractiveLogin === "string") {
|
|
570
|
+
const fn = lookupInteractiveLoginFn(performInteractiveLogin);
|
|
571
|
+
if (!fn) {
|
|
572
|
+
throw new Error(`No such function: ${performInteractiveLogin}`);
|
|
573
|
+
}
|
|
574
|
+
return fn;
|
|
575
|
+
}
|
|
576
|
+
return performInteractiveLogin;
|
|
577
|
+
}
|
|
568
578
|
function lookupGetAccessFn(getAccessToken2) {
|
|
569
579
|
return globalThis[getAccessToken2];
|
|
570
580
|
}
|
|
581
|
+
function lookupInteractiveLoginFn(name) {
|
|
582
|
+
return globalThis[name];
|
|
583
|
+
}
|
|
571
584
|
function handlePossibleErrors(data) {
|
|
572
585
|
if (data.errors) {
|
|
573
586
|
throw new AuthorizationError(data.errors);
|
|
@@ -598,6 +611,21 @@ async function sha256(message) {
|
|
|
598
611
|
const hashBase64 = byteArrayToBase64(hashArray);
|
|
599
612
|
return hashBase64.replaceAll(/\+/g, "-").replaceAll(/\//g, "_").replace(/=+$/, "");
|
|
600
613
|
}
|
|
614
|
+
async function createInteractiveLoginUrl(hostConfig, redirectUri, state, verifier) {
|
|
615
|
+
const clientId = hostConfig.clientId || "";
|
|
616
|
+
const locationUrl = toValidLocationUrl(hostConfig);
|
|
617
|
+
const codeChallenge = await sha256(verifier);
|
|
618
|
+
const queryParams = {
|
|
619
|
+
response_type: "code",
|
|
620
|
+
client_id: clientId,
|
|
621
|
+
redirect_uri: redirectUri,
|
|
622
|
+
scope: hostConfig.scope || "user_default",
|
|
623
|
+
state,
|
|
624
|
+
code_challenge: codeChallenge,
|
|
625
|
+
code_challenge_method: "S256"
|
|
626
|
+
};
|
|
627
|
+
return `${locationUrl}/oauth/authorize?${toQueryString(queryParams)}`;
|
|
628
|
+
}
|
|
601
629
|
async function startFullPageLoginFlow(hostConfig) {
|
|
602
630
|
const clientId = hostConfig.clientId || "";
|
|
603
631
|
const locationUrl = toValidLocationUrl(hostConfig);
|
|
@@ -773,6 +801,39 @@ async function getOAuthTokensForBrowser(hostConfig) {
|
|
|
773
801
|
refreshToken: void 0,
|
|
774
802
|
errors: void 0
|
|
775
803
|
};
|
|
804
|
+
} catch (error) {
|
|
805
|
+
return errorMessageToAuthData("Could not fetch access token using custom function");
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
if (hostConfig.performInteractiveLogin) {
|
|
809
|
+
let usedRedirectUri;
|
|
810
|
+
try {
|
|
811
|
+
const verifier2 = generateRandomString(128);
|
|
812
|
+
const originalState = generateRandomString(43);
|
|
813
|
+
const { code: code2, state } = extractCodeAndState(
|
|
814
|
+
await toPerformInteractiveLoginFunction(hostConfig.performInteractiveLogin)({
|
|
815
|
+
getLoginUrl: async ({ redirectUri }) => {
|
|
816
|
+
usedRedirectUri = redirectUri;
|
|
817
|
+
return createInteractiveLoginUrl(hostConfig, redirectUri, originalState, verifier2);
|
|
818
|
+
}
|
|
819
|
+
})
|
|
820
|
+
);
|
|
821
|
+
if (!usedRedirectUri) {
|
|
822
|
+
return errorMessageToAuthData("No redirect uri provided");
|
|
823
|
+
}
|
|
824
|
+
if (originalState !== state) {
|
|
825
|
+
return errorMessageToAuthData("State returned by custom interactive login function does not match original");
|
|
826
|
+
}
|
|
827
|
+
if (!code2) {
|
|
828
|
+
return errorMessageToAuthData("No code found in response from custom interactive login function");
|
|
829
|
+
}
|
|
830
|
+
const tokenResponse = await exchangeCodeAndVerifierForAccessTokenData(
|
|
831
|
+
hostConfig,
|
|
832
|
+
code2,
|
|
833
|
+
verifier2,
|
|
834
|
+
usedRedirectUri
|
|
835
|
+
);
|
|
836
|
+
return tokenResponse;
|
|
776
837
|
} catch (error) {
|
|
777
838
|
return {
|
|
778
839
|
accessToken: void 0,
|
|
@@ -781,7 +842,7 @@ async function getOAuthTokensForBrowser(hostConfig) {
|
|
|
781
842
|
{
|
|
782
843
|
code: "",
|
|
783
844
|
status: 401,
|
|
784
|
-
title: "Could not
|
|
845
|
+
title: "Could not perform custom interactive login",
|
|
785
846
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
786
847
|
detail: `${error}`
|
|
787
848
|
}
|
|
@@ -808,6 +869,10 @@ async function getOAuthTokensForBrowser(hostConfig) {
|
|
|
808
869
|
if (oauthTokens) {
|
|
809
870
|
return oauthTokens;
|
|
810
871
|
}
|
|
872
|
+
if (hostConfig.performInteractiveLogin) {
|
|
873
|
+
return new Promise(() => {
|
|
874
|
+
});
|
|
875
|
+
}
|
|
811
876
|
if (hostConfig.authRedirectUserConfirmation) {
|
|
812
877
|
await hostConfig.authRedirectUserConfirmation();
|
|
813
878
|
}
|
|
@@ -856,6 +921,30 @@ async function refreshAccessToken(hostConfig) {
|
|
|
856
921
|
}
|
|
857
922
|
}
|
|
858
923
|
}
|
|
924
|
+
function extractCodeAndState(input) {
|
|
925
|
+
if (typeof input === "string") {
|
|
926
|
+
const queryParams = new URLSearchParams(new URL(input).search);
|
|
927
|
+
return {
|
|
928
|
+
code: queryParams.get("code") || "",
|
|
929
|
+
state: queryParams.get("state") || ""
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
return input;
|
|
933
|
+
}
|
|
934
|
+
function errorMessageToAuthData(message) {
|
|
935
|
+
return {
|
|
936
|
+
accessToken: void 0,
|
|
937
|
+
refreshToken: void 0,
|
|
938
|
+
errors: [
|
|
939
|
+
{
|
|
940
|
+
code: "",
|
|
941
|
+
status: 401,
|
|
942
|
+
title: message,
|
|
943
|
+
detail: ""
|
|
944
|
+
}
|
|
945
|
+
]
|
|
946
|
+
};
|
|
947
|
+
}
|
|
859
948
|
|
|
860
949
|
// src/auth/internal/default-auth-modules/oauth/temporary-token.ts
|
|
861
950
|
async function exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, purpose) {
|
|
@@ -1250,6 +1339,12 @@ async function handleAuthenticationError6({
|
|
|
1250
1339
|
};
|
|
1251
1340
|
}
|
|
1252
1341
|
if (isBrowser()) {
|
|
1342
|
+
if (hostConfig.performInteractiveLogin) {
|
|
1343
|
+
clearStoredOauthTokens(hostConfig);
|
|
1344
|
+
return {
|
|
1345
|
+
retry: true
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1253
1348
|
if (hostConfig.authRedirectUserConfirmation) {
|
|
1254
1349
|
await hostConfig.authRedirectUserConfirmation();
|
|
1255
1350
|
}
|
|
@@ -1279,7 +1374,8 @@ var oauth_default = {
|
|
|
1279
1374
|
"subject",
|
|
1280
1375
|
"userId",
|
|
1281
1376
|
"noCache",
|
|
1282
|
-
"getAccessToken"
|
|
1377
|
+
"getAccessToken",
|
|
1378
|
+
"performInteractiveLogin"
|
|
1283
1379
|
]
|
|
1284
1380
|
})
|
|
1285
1381
|
};
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
getRestCallAuthParams,
|
|
5
5
|
getWebSocketAuthParams,
|
|
6
6
|
toValidWebsocketLocationUrl
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./OEVNZ5IQ.js";
|
|
8
|
+
import "./7RHSSS4W.js";
|
|
8
9
|
import {
|
|
9
10
|
isBrowser,
|
|
10
11
|
isNode
|
|
@@ -10366,10 +10367,12 @@ async function createEnigmaSession({
|
|
|
10366
10367
|
appId,
|
|
10367
10368
|
identity,
|
|
10368
10369
|
hostConfig,
|
|
10369
|
-
useReloadEngine = false
|
|
10370
|
+
useReloadEngine = false,
|
|
10371
|
+
ttlSeconds
|
|
10370
10372
|
}) {
|
|
10371
10373
|
const locationUrl = toValidWebsocketLocationUrl(hostConfig);
|
|
10372
10374
|
const reloadUri = encodeURIComponent(`${locationUrl}/sense/app/${appId}`);
|
|
10375
|
+
const ttlPart = ttlSeconds !== void 0 && ttlSeconds >= 0 ? `/ttl/${ttlSeconds}` : "";
|
|
10373
10376
|
const identityPart = identity ? `/identity/${identity}` : "";
|
|
10374
10377
|
const reloadEnginePart = useReloadEngine ? "&workloadType=interactive-reload" : "";
|
|
10375
10378
|
let csrfToken = "";
|
|
@@ -10380,7 +10383,7 @@ async function createEnigmaSession({
|
|
|
10380
10383
|
}
|
|
10381
10384
|
}
|
|
10382
10385
|
const csrfPart = csrfToken ? `&qlik-csrf-token=${csrfToken}` : "";
|
|
10383
|
-
let url = `${locationUrl}/app/${appId}${identityPart}?reloadUri=${reloadUri}${reloadEnginePart}${csrfPart}`.replace(
|
|
10386
|
+
let url = `${locationUrl}/app/${appId}${identityPart}${ttlPart}?reloadUri=${reloadUri}${reloadEnginePart}${csrfPart}`.replace(
|
|
10384
10387
|
/^http/,
|
|
10385
10388
|
"ws"
|
|
10386
10389
|
);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// src/public/public-runtime-modules.ts
|
|
2
2
|
function getAuthRuntimeModule(hostConfig) {
|
|
3
3
|
const isNode = !!globalThis.process?.argv;
|
|
4
|
-
return isNode ? import("./
|
|
4
|
+
return isNode ? import("./SEBN4KFZ.js") : import("./EUWNVVK5.js").then(
|
|
5
5
|
(mod) => mod.importRuntimeModule("auth@v1", hostConfig)
|
|
6
6
|
);
|
|
7
7
|
}
|
|
8
8
|
async function getQixRuntimeModule(hostConfig) {
|
|
9
9
|
await getAuthRuntimeModule(hostConfig);
|
|
10
10
|
const isNode = !!globalThis.process?.argv;
|
|
11
|
-
return isNode ? import("./
|
|
11
|
+
return isNode ? import("./KBR7JBWC.js") : import("./EUWNVVK5.js").then(
|
|
12
12
|
(mod) => mod.importRuntimeModule("qix@v1", hostConfig)
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
async function getInvokeFetchRuntimeModule(hostConfig) {
|
|
16
16
|
await getAuthRuntimeModule(hostConfig);
|
|
17
17
|
const isNode = !!globalThis.process?.argv;
|
|
18
|
-
return isNode ? import("./
|
|
18
|
+
return isNode ? import("./GZRY5VHW.js") : import("./EUWNVVK5.js").then(
|
|
19
19
|
(mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig)
|
|
20
20
|
);
|
|
21
21
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getInvokeFetchRuntimeModule
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./SNQHDUYY.js";
|
|
4
4
|
import {
|
|
5
5
|
isBrowser
|
|
6
6
|
} from "./2ZQ3ZX7F.js";
|
|
7
7
|
|
|
8
8
|
// src/public/invoke-fetch.ts
|
|
9
|
-
var defaultUserAgent = "qlik-api/1.
|
|
9
|
+
var defaultUserAgent = "qlik-api/1.22.0";
|
|
10
10
|
async function invokeFetch(api, props) {
|
|
11
11
|
const hostConfig = props.options?.hostConfig;
|
|
12
12
|
let userAgent;
|
package/collections.d.ts
CHANGED
package/collections.js
CHANGED
package/csp-origins.d.ts
CHANGED
package/csp-origins.js
CHANGED
package/data-assets.d.ts
CHANGED
package/data-assets.js
CHANGED
package/data-connections.d.ts
CHANGED
package/data-connections.js
CHANGED
package/data-credentials.d.ts
CHANGED
package/data-credentials.js
CHANGED
package/data-files.d.ts
CHANGED
package/data-files.js
CHANGED
package/extensions.d.ts
CHANGED
package/extensions.js
CHANGED
|
@@ -68,6 +68,18 @@ type WindowsCookieAuthConfig = {
|
|
|
68
68
|
/** If set to false the `credentials` property will be set to same-origin */
|
|
69
69
|
crossSiteCookies?: boolean;
|
|
70
70
|
};
|
|
71
|
+
type PerformInteractiveLoginFn = (props: {
|
|
72
|
+
/**
|
|
73
|
+
* Returns the url to the login page. The redirectUri parameter property is used to tell the login page where to redirect the browser after the login has succeeded.
|
|
74
|
+
* Note that the redirectUri needs to be registered in the oauth configuration.
|
|
75
|
+
*/
|
|
76
|
+
getLoginUrl: (props: {
|
|
77
|
+
redirectUri: string;
|
|
78
|
+
}) => Promise<string>;
|
|
79
|
+
}) => Promise<{
|
|
80
|
+
code: string;
|
|
81
|
+
state: string;
|
|
82
|
+
} | string>;
|
|
71
83
|
/** OAuth2 Auth Configuration for a HostConfig */
|
|
72
84
|
type Oauth2AuthConfig = {
|
|
73
85
|
/** client id of oauth client created by tenant admin */
|
|
@@ -101,6 +113,12 @@ type Oauth2AuthConfig = {
|
|
|
101
113
|
* Typically used together with the `noCache` since caching is done on the browser side.
|
|
102
114
|
*/
|
|
103
115
|
userId?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Can be used to customize the login flow, for instance if the login page should be shown in another browser tab/window.
|
|
118
|
+
* The function is asynchronous and when the loging flow is finished it should return the code and state provided in the
|
|
119
|
+
* query of the oauth redirect callback. The code and state can either be provided as an object or as the entire callback url.
|
|
120
|
+
*/
|
|
121
|
+
performInteractiveLogin?: PerformInteractiveLoginFn;
|
|
104
122
|
};
|
|
105
123
|
/** Anonymous Auth Configuration for a HostConfig - used when embedding UI's linked to an anonymous tenant/app */
|
|
106
124
|
type AnonymousAuthConfig = {
|
package/glossaries.d.ts
CHANGED
package/glossaries.js
CHANGED
package/groups.d.ts
CHANGED
package/groups.js
CHANGED
package/identity-providers.d.ts
CHANGED