@qlik/api 1.30.0 → 1.31.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 +2 -2
- package/api-keys.js +2 -2
- package/apps.d.ts +4 -2
- package/apps.js +2 -2
- package/audits.d.ts +2 -2
- package/audits.js +2 -2
- package/{auth-types-PkN9CAF_.d.ts → auth-types-DqfMuSRX.d.ts} +1 -0
- package/auth.d.ts +27 -3
- package/auth.js +8 -4
- package/automations.d.ts +2 -2
- package/automations.js +2 -2
- package/brands.d.ts +2 -2
- package/brands.js +2 -2
- package/chunks/{JIX6RMFP.js → 6ZONDHRN.js} +1 -1
- package/chunks/{TXC5XORK.js → DLKLPD7T.js} +3 -3
- package/chunks/ETNHFALU.js +61 -0
- package/chunks/{G6QUM5WQ.js → FKDGGR2O.js} +137 -45
- package/chunks/{QK4TMJ64.js → GUU3KZGK.js} +11 -1
- package/chunks/{IQBP2PKS.js → KBSD75QL.js} +1 -1
- package/chunks/{OTTC4QSX.js → LY7RP2HA.js} +7 -3
- package/chunks/{FKCZFVJL.js → M64RLKVG.js} +2074 -12
- package/chunks/{F5UDCCRD.js → PLVPW5IR.js} +1 -1
- package/chunks/{QWQLGDMI.js → UZTIZ4H5.js} +392 -372
- package/chunks/{PTDXR7AY.js → YKZ2QYHN.js} +2 -2
- package/collections.d.ts +3 -3
- package/collections.js +2 -2
- package/csp-origins.d.ts +2 -2
- package/csp-origins.js +2 -2
- package/data-assets.d.ts +2 -2
- package/data-assets.js +2 -2
- package/data-connections.d.ts +7 -7
- package/data-connections.js +2 -2
- package/data-credentials.d.ts +2 -2
- package/data-credentials.js +2 -2
- package/data-files.d.ts +2 -2
- package/data-files.js +2 -2
- package/docs/authentication.md +47 -0
- package/extensions.d.ts +2 -2
- package/extensions.js +2 -2
- package/glossaries.d.ts +2 -2
- package/glossaries.js +2 -2
- package/groups.d.ts +5 -4
- package/groups.js +2 -2
- package/identity-providers.d.ts +2 -2
- package/identity-providers.js +2 -2
- package/index.d.ts +5 -3
- package/index.js +4 -4
- package/interceptors.d.ts +2 -2
- package/{invoke-fetch-types-BXn-uSF5.d.ts → invoke-fetch-types-Cq7bjkqn.d.ts} +10 -2
- package/items.d.ts +3 -3
- package/items.js +2 -2
- package/licenses.d.ts +5 -2
- package/licenses.js +2 -2
- package/oauth-clients.d.ts +7 -2
- package/oauth-clients.js +2 -2
- package/package.json +3 -2
- package/qix.d.ts +421 -26
- package/qix.js +2 -2
- package/quotas.d.ts +2 -2
- package/quotas.js +2 -2
- package/reload-tasks.d.ts +4 -2
- package/reload-tasks.js +2 -2
- package/reloads.d.ts +4 -2
- package/reloads.js +2 -2
- package/reports.d.ts +2 -2
- package/reports.js +2 -2
- package/roles.d.ts +2 -2
- package/roles.js +2 -2
- package/spaces.d.ts +3 -7
- package/spaces.js +2 -2
- package/temp-contents.d.ts +2 -2
- package/temp-contents.js +2 -2
- package/tenants.d.ts +2 -2
- package/tenants.js +2 -2
- package/themes.d.ts +2 -2
- package/themes.js +2 -2
- package/transports.d.ts +2 -2
- package/transports.js +2 -2
- package/users.d.ts +2 -2
- package/users.js +2 -2
- package/web-integrations.d.ts +2 -2
- package/web-integrations.js +2 -2
- package/web-notifications.d.ts +2 -2
- package/web-notifications.js +2 -2
- package/webhooks.d.ts +2 -2
- package/webhooks.js +2 -2
|
@@ -6,37 +6,79 @@ import {
|
|
|
6
6
|
isNode
|
|
7
7
|
} from "./2ZQ3ZX7F.js";
|
|
8
8
|
|
|
9
|
+
// src/auth/internal/host-config-registry.ts
|
|
10
|
+
var registeredHostConfigs = {};
|
|
11
|
+
function registerHostConfigInternal(name, hostConfig) {
|
|
12
|
+
if (hostConfig?.reference) {
|
|
13
|
+
throw new InvalidHostConfigError("Cannot register a host config with a reference");
|
|
14
|
+
}
|
|
15
|
+
if (registeredHostConfigs[name]) {
|
|
16
|
+
console.warn(`registerHostConfig: Host config with name "${name}" is already registered. Overwriting.`);
|
|
17
|
+
}
|
|
18
|
+
registeredHostConfigs[name] = hostConfig;
|
|
19
|
+
}
|
|
20
|
+
function unregisterHostConfigInternal(name) {
|
|
21
|
+
if (registeredHostConfigs[name]) {
|
|
22
|
+
delete registeredHostConfigs[name];
|
|
23
|
+
} else {
|
|
24
|
+
console.warn(`unregisterHostConfig: Host config with name "${name}" not found.`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getRegisteredHostConfigInternal(name) {
|
|
28
|
+
if (!registeredHostConfigs[name]) {
|
|
29
|
+
throw new Error(`Host config with name "${name}" not found.`);
|
|
30
|
+
}
|
|
31
|
+
return registeredHostConfigs[name];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/auth/internal/default-host-config.ts
|
|
35
|
+
var defaultHostConfig = {};
|
|
36
|
+
function setDefaultHostConfigInternal(hostConfig) {
|
|
37
|
+
defaultHostConfig = hostConfig || {};
|
|
38
|
+
}
|
|
39
|
+
function withResolvedHostConfig(hostConfig) {
|
|
40
|
+
if (hostConfig?.reference) {
|
|
41
|
+
return getRegisteredHostConfigInternal(hostConfig.reference);
|
|
42
|
+
}
|
|
43
|
+
if (hostConfig && Object.keys(hostConfig).length > 0) {
|
|
44
|
+
return hostConfig;
|
|
45
|
+
}
|
|
46
|
+
return defaultHostConfig;
|
|
47
|
+
}
|
|
48
|
+
|
|
9
49
|
// src/platform/platform-functions.ts
|
|
10
50
|
var getPlatform = async (options = {}) => {
|
|
51
|
+
const hc = withResolvedHostConfig(options.hostConfig);
|
|
52
|
+
const isAnonymous = hc?.authType === "anonymous" || !!hc.accessCode;
|
|
11
53
|
const isNodeEnvironment = typeof window === "undefined";
|
|
12
54
|
if (isNodeEnvironment) {
|
|
13
|
-
return result({ isNodeEnv: true });
|
|
55
|
+
return result({ isNodeEnv: true, isAnonymous });
|
|
14
56
|
}
|
|
15
57
|
const { data: productInfo, status } = await getProductInfo(options);
|
|
16
58
|
if (status === 404) {
|
|
17
|
-
return result({ isUnknown: true });
|
|
59
|
+
return result({ isUnknown: true, isAnonymous });
|
|
18
60
|
}
|
|
19
61
|
if (!productInfo || status <= 399 && status >= 300) {
|
|
20
|
-
return result({ isQSE: true, isWindows: true });
|
|
62
|
+
return result({ isQSE: true, isWindows: true, isAnonymous });
|
|
21
63
|
}
|
|
22
64
|
const deploymentType = (productInfo.composition?.deploymentType || "").toLowerCase();
|
|
23
65
|
const isControlCenter = deploymentType === "controlcenter";
|
|
24
66
|
if (deploymentType === "qliksenseserver") {
|
|
25
|
-
return result({ isQSE: true, isWindows: true, meta: extractMeta(productInfo) });
|
|
67
|
+
return result({ isQSE: true, isWindows: true, isAnonymous, meta: extractMeta(productInfo) });
|
|
26
68
|
}
|
|
27
69
|
if (deploymentType === "qliksensedesktop") {
|
|
28
|
-
return result({ isQSD: true, isWindows: true, meta: extractMeta(productInfo) });
|
|
70
|
+
return result({ isQSD: true, isWindows: true, isAnonymous, meta: extractMeta(productInfo) });
|
|
29
71
|
}
|
|
30
72
|
if (deploymentType === "qliksensemobile") {
|
|
31
|
-
return result({ isQSE: true, isWindows: true, meta: extractMeta(productInfo) });
|
|
73
|
+
return result({ isQSE: true, isWindows: true, isAnonymous, meta: extractMeta(productInfo) });
|
|
32
74
|
}
|
|
33
75
|
if (deploymentType === "cloud-console") {
|
|
34
|
-
return result({ isCloud: true, isCloudConsole: true, meta: extractMeta(productInfo) });
|
|
76
|
+
return result({ isCloud: true, isCloudConsole: true, isAnonymous, meta: extractMeta(productInfo) });
|
|
35
77
|
}
|
|
36
78
|
if (productInfo.composition?.provider === "fedramp") {
|
|
37
|
-
return result({ isCloud: true, isQCG: true, isControlCenter, meta: extractMeta(productInfo) });
|
|
79
|
+
return result({ isCloud: true, isQCG: true, isControlCenter, isAnonymous, meta: extractMeta(productInfo) });
|
|
38
80
|
}
|
|
39
|
-
return result({ isCloud: true, isQCS: true, isControlCenter, meta: extractMeta(productInfo) });
|
|
81
|
+
return result({ isCloud: true, isQCS: true, isControlCenter, isAnonymous, meta: extractMeta(productInfo) });
|
|
40
82
|
};
|
|
41
83
|
var productInfoPromises = {};
|
|
42
84
|
function templateUrl(baseUrl) {
|
|
@@ -105,21 +147,10 @@ var result = (data) => ({
|
|
|
105
147
|
isQSE: false,
|
|
106
148
|
isQSD: false,
|
|
107
149
|
isUnknown: false,
|
|
150
|
+
isAnonymous: false,
|
|
108
151
|
...data
|
|
109
152
|
});
|
|
110
153
|
|
|
111
|
-
// src/auth/internal/default-host-config.ts
|
|
112
|
-
var defaultHostConfig = {};
|
|
113
|
-
function setDefaultHostConfig(hostConfig) {
|
|
114
|
-
defaultHostConfig = hostConfig || {};
|
|
115
|
-
}
|
|
116
|
-
function withDefaultHostConfig(hostConfig) {
|
|
117
|
-
if (hostConfig && Object.keys(hostConfig).length > 0) {
|
|
118
|
-
return hostConfig;
|
|
119
|
-
}
|
|
120
|
-
return defaultHostConfig;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
154
|
// src/auth/internal/auth-module-registry.ts
|
|
124
155
|
var authModules = {};
|
|
125
156
|
var ongoingAuthModuleLoading = Promise.resolve();
|
|
@@ -133,7 +164,7 @@ function getRegisteredAuthModule(authType) {
|
|
|
133
164
|
return authModules[authType.toLowerCase()];
|
|
134
165
|
}
|
|
135
166
|
async function getAuthModule(hostConfig) {
|
|
136
|
-
const hostConfigToUse =
|
|
167
|
+
const hostConfigToUse = withResolvedHostConfig(hostConfig);
|
|
137
168
|
const authType = await determineAuthType(hostConfigToUse);
|
|
138
169
|
if (ongoingAuthModuleLoading) {
|
|
139
170
|
await ongoingAuthModuleLoading;
|
|
@@ -193,7 +224,7 @@ var InvalidAuthTypeError = class extends Error {
|
|
|
193
224
|
constructor(authType) {
|
|
194
225
|
const validAuthModules = getRegisteredAuthModules();
|
|
195
226
|
super(
|
|
196
|
-
`Not a valid auth type: ${authType}, valid auth types are; '${validAuthModules.filter((name) => name !== "
|
|
227
|
+
`Not a valid auth type: ${authType}, valid auth types are; '${validAuthModules.filter((name) => name.toLowerCase() !== "qmfeembedframerauthmodule").join("', '")}'`
|
|
197
228
|
);
|
|
198
229
|
this.name = "InvalidAuthTypeError";
|
|
199
230
|
}
|
|
@@ -229,7 +260,7 @@ function isHostCrossOrigin(hostConfig) {
|
|
|
229
260
|
if (!globalThis.location?.origin) {
|
|
230
261
|
return true;
|
|
231
262
|
}
|
|
232
|
-
const hostConfigToUse =
|
|
263
|
+
const hostConfigToUse = withResolvedHostConfig(hostConfig);
|
|
233
264
|
if (Object.keys(hostConfigToUse).length === 0) {
|
|
234
265
|
return false;
|
|
235
266
|
}
|
|
@@ -241,7 +272,10 @@ function isHostCrossOrigin(hostConfig) {
|
|
|
241
272
|
return false;
|
|
242
273
|
}
|
|
243
274
|
async function isWindows(hostConfig) {
|
|
244
|
-
const hostConfigToUse =
|
|
275
|
+
const hostConfigToUse = withResolvedHostConfig(hostConfig);
|
|
276
|
+
if (typeof hostConfigToUse.forceIsWindows === "boolean") {
|
|
277
|
+
return hostConfigToUse.forceIsWindows;
|
|
278
|
+
}
|
|
245
279
|
if (hostConfigToUse.authType === "cookie") {
|
|
246
280
|
return false;
|
|
247
281
|
}
|
|
@@ -251,7 +285,7 @@ async function isWindows(hostConfig) {
|
|
|
251
285
|
return (await getPlatform({ hostConfig })).isWindows;
|
|
252
286
|
}
|
|
253
287
|
function toValidLocationUrl(hostConfig) {
|
|
254
|
-
const url =
|
|
288
|
+
const url = withResolvedHostConfig(hostConfig)?.host;
|
|
255
289
|
let locationUrl;
|
|
256
290
|
if (!url) {
|
|
257
291
|
locationUrl = "";
|
|
@@ -266,7 +300,7 @@ function toValidLocationUrl(hostConfig) {
|
|
|
266
300
|
return locationUrl;
|
|
267
301
|
}
|
|
268
302
|
function toValidWebsocketLocationUrl(hostConfig) {
|
|
269
|
-
const url =
|
|
303
|
+
const url = withResolvedHostConfig(hostConfig)?.host;
|
|
270
304
|
let locationUrl;
|
|
271
305
|
if (!url) {
|
|
272
306
|
locationUrl = globalThis.location.origin;
|
|
@@ -281,7 +315,7 @@ function toValidWebsocketLocationUrl(hostConfig) {
|
|
|
281
315
|
return locationUrl.replace(leadingHttp, "ws");
|
|
282
316
|
}
|
|
283
317
|
async function getWebSocketAuthParams(props) {
|
|
284
|
-
const hostConfigToUse =
|
|
318
|
+
const hostConfigToUse = withResolvedHostConfig(props.hostConfig);
|
|
285
319
|
try {
|
|
286
320
|
const authModule = await getAuthModule(hostConfigToUse);
|
|
287
321
|
return await authModule.getWebSocketAuthParams({
|
|
@@ -294,7 +328,7 @@ async function getWebSocketAuthParams(props) {
|
|
|
294
328
|
}
|
|
295
329
|
}
|
|
296
330
|
async function getWebResourceAuthParams(props) {
|
|
297
|
-
const hostConfigToUse =
|
|
331
|
+
const hostConfigToUse = withResolvedHostConfig(props.hostConfig);
|
|
298
332
|
try {
|
|
299
333
|
const authModule = await getAuthModule(hostConfigToUse);
|
|
300
334
|
return await authModule.getWebResourceAuthParams?.({
|
|
@@ -307,7 +341,7 @@ async function getWebResourceAuthParams(props) {
|
|
|
307
341
|
}
|
|
308
342
|
}
|
|
309
343
|
async function handleAuthenticationError(props) {
|
|
310
|
-
const hostConfigToUse =
|
|
344
|
+
const hostConfigToUse = withResolvedHostConfig(props.hostConfig);
|
|
311
345
|
const authModule = await getAuthModule(hostConfigToUse);
|
|
312
346
|
const result2 = await authModule.handleAuthenticationError({
|
|
313
347
|
...props,
|
|
@@ -322,7 +356,7 @@ async function handleAuthenticationError(props) {
|
|
|
322
356
|
return result2;
|
|
323
357
|
}
|
|
324
358
|
async function getRestCallAuthParams(props) {
|
|
325
|
-
const hostConfigToUse =
|
|
359
|
+
const hostConfigToUse = withResolvedHostConfig(props.hostConfig);
|
|
326
360
|
try {
|
|
327
361
|
const authModule = await getAuthModule(hostConfigToUse);
|
|
328
362
|
return await authModule.getRestCallAuthParams({
|
|
@@ -345,11 +379,17 @@ async function getAccessToken(props) {
|
|
|
345
379
|
function registerAuthModule2(name, authModule) {
|
|
346
380
|
registerAuthModule(name, authModule);
|
|
347
381
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
382
|
+
function setDefaultHostConfig(hostConfig) {
|
|
383
|
+
setDefaultHostConfigInternal(hostConfig);
|
|
384
|
+
}
|
|
385
|
+
function registerHostConfig(name, hostConfig) {
|
|
386
|
+
registerHostConfigInternal(name, hostConfig);
|
|
387
|
+
}
|
|
388
|
+
function unregisterHostConfig(name) {
|
|
389
|
+
unregisterHostConfigInternal(name);
|
|
350
390
|
}
|
|
351
391
|
function serializeHostConfig(hostConfig) {
|
|
352
|
-
const hostConfigToUse =
|
|
392
|
+
const hostConfigToUse = withResolvedHostConfig(hostConfig);
|
|
353
393
|
return JSON.stringify(hostConfigToUse, hostConfigPropertyIgnorer);
|
|
354
394
|
}
|
|
355
395
|
async function determineAuthType(hostConfig) {
|
|
@@ -368,13 +408,16 @@ async function determineAuthType(hostConfig) {
|
|
|
368
408
|
if (hostConfig.webIntegrationId) {
|
|
369
409
|
return "cookie";
|
|
370
410
|
}
|
|
411
|
+
if (hostConfig.reference) {
|
|
412
|
+
return "reference";
|
|
413
|
+
}
|
|
371
414
|
if (await isWindows(hostConfig)) {
|
|
372
415
|
return "windowscookie";
|
|
373
416
|
}
|
|
374
417
|
return "cookie";
|
|
375
418
|
}
|
|
376
419
|
function checkForCrossDomainRequest(hostConfig) {
|
|
377
|
-
const hostConfigToUse =
|
|
420
|
+
const hostConfigToUse = withResolvedHostConfig(hostConfig);
|
|
378
421
|
if (isHostCrossOrigin(hostConfigToUse)) {
|
|
379
422
|
if (Object.keys(hostConfigToUse).length === 0) {
|
|
380
423
|
throw new InvalidHostConfigError("a host config must be provided when making a cross domain request");
|
|
@@ -467,6 +510,17 @@ function internalValidateHostConfig(hostConfig, options) {
|
|
|
467
510
|
return true;
|
|
468
511
|
}
|
|
469
512
|
|
|
513
|
+
// src/utils/expose-internal-test-apis.ts
|
|
514
|
+
var internalApisName = "__QLIK_INTERNAL__DO_NOT_USE_OR_YOU_WILL_BE_FIRED";
|
|
515
|
+
function exposeInternalApiOnWindow(name, fn) {
|
|
516
|
+
if (globalThis.location?.origin.startsWith("https://localhost:") || globalThis.location?.origin?.endsWith("qlik-stage.com")) {
|
|
517
|
+
if (globalThis[internalApisName] === void 0) {
|
|
518
|
+
globalThis[internalApisName] = {};
|
|
519
|
+
}
|
|
520
|
+
globalThis[internalApisName][name] = fn;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
470
524
|
// src/auth/internal/default-auth-modules/oauth/storage-helpers.ts
|
|
471
525
|
var storagePrefix = "qlik-qmfe-api";
|
|
472
526
|
function getTopicFromOauthHostConfig(hostConfig) {
|
|
@@ -483,6 +537,20 @@ function getTopicFromAnonHostConfig(hostConfig) {
|
|
|
483
537
|
return `${hostConfig.accessCode}_${hostConfig.clientId}`;
|
|
484
538
|
}
|
|
485
539
|
var cachedTokens = {};
|
|
540
|
+
function clearAllCachedTokens() {
|
|
541
|
+
for (const key in cachedTokens) {
|
|
542
|
+
delete cachedTokens[key];
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
exposeInternalApiOnWindow("clearAllAccessTokens", () => {
|
|
546
|
+
console.log("Clearing tokens", cachedTokens);
|
|
547
|
+
Object.keys(cachedTokens).forEach((key) => {
|
|
548
|
+
console.log("Clearing access tokens for", key);
|
|
549
|
+
deleteFromLocalStorage(key, ["access-token", "refresh-token"]);
|
|
550
|
+
deleteFromSessionStorage(key, ["access-token", "refresh-token"]);
|
|
551
|
+
});
|
|
552
|
+
clearAllCachedTokens();
|
|
553
|
+
});
|
|
486
554
|
function saveInLocalStorage(topic, name, value) {
|
|
487
555
|
localStorage.setItem(`${storagePrefix}-${topic}-${name}`, value);
|
|
488
556
|
}
|
|
@@ -551,6 +619,7 @@ async function loadOrAcquireAccessToken(topic, acquireTokens, noCache, accessTok
|
|
|
551
619
|
const mayUseStorage = isBrowser();
|
|
552
620
|
const storedOauthTokens = cachedTokens[topic] || (mayUseStorage ? loadOauthTokensFromStorage(topic, accessTokenStorage) : void 0);
|
|
553
621
|
if (storedOauthTokens) {
|
|
622
|
+
cachedTokens[topic] = storedOauthTokens;
|
|
554
623
|
return Promise.resolve(storedOauthTokens);
|
|
555
624
|
}
|
|
556
625
|
const tokensPromise = acquireTokens();
|
|
@@ -1415,6 +1484,23 @@ var oauth_default = {
|
|
|
1415
1484
|
})
|
|
1416
1485
|
};
|
|
1417
1486
|
|
|
1487
|
+
// src/auth/internal/default-auth-modules/reference.ts
|
|
1488
|
+
function getRestCallAuthParams7() {
|
|
1489
|
+
throw new Error("getRestCallAuthParams should never be called for reference auth module");
|
|
1490
|
+
}
|
|
1491
|
+
function getWebSocketAuthParams7() {
|
|
1492
|
+
throw new Error("getWebSocketAuthParams should never be called for reference auth module");
|
|
1493
|
+
}
|
|
1494
|
+
function handleAuthenticationError7() {
|
|
1495
|
+
throw new Error("handleAuthenticationError should never be called for reference auth module");
|
|
1496
|
+
}
|
|
1497
|
+
var reference_default = {
|
|
1498
|
+
getRestCallAuthParams: getRestCallAuthParams7,
|
|
1499
|
+
getWebSocketAuthParams: getWebSocketAuthParams7,
|
|
1500
|
+
handleAuthenticationError: handleAuthenticationError7,
|
|
1501
|
+
validateHostConfig: (hostConfig) => internalValidateHostConfig(hostConfig, { requiredProps: ["reference"], optionalProps: [] })
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1418
1504
|
// src/auth/internal/default-auth-modules/windows-cookie/xrf-keys.ts
|
|
1419
1505
|
var xrfKeys = {};
|
|
1420
1506
|
function createXrfKey() {
|
|
@@ -1438,7 +1524,7 @@ function getXrfKey(hostConfig) {
|
|
|
1438
1524
|
}
|
|
1439
1525
|
|
|
1440
1526
|
// src/auth/internal/default-auth-modules/windows-cookie.ts
|
|
1441
|
-
async function
|
|
1527
|
+
async function getRestCallAuthParams8({
|
|
1442
1528
|
hostConfig
|
|
1443
1529
|
}) {
|
|
1444
1530
|
return {
|
|
@@ -1451,7 +1537,7 @@ async function getRestCallAuthParams7({
|
|
|
1451
1537
|
credentials: getCredentialsForCookieAuth(hostConfig)
|
|
1452
1538
|
};
|
|
1453
1539
|
}
|
|
1454
|
-
async function
|
|
1540
|
+
async function getWebSocketAuthParams8({
|
|
1455
1541
|
hostConfig
|
|
1456
1542
|
}) {
|
|
1457
1543
|
return {
|
|
@@ -1461,7 +1547,7 @@ async function getWebSocketAuthParams7({
|
|
|
1461
1547
|
}
|
|
1462
1548
|
};
|
|
1463
1549
|
}
|
|
1464
|
-
async function
|
|
1550
|
+
async function handleAuthenticationError8({
|
|
1465
1551
|
hostConfig
|
|
1466
1552
|
}) {
|
|
1467
1553
|
if (hostConfig.loginUri) {
|
|
@@ -1480,9 +1566,9 @@ async function handleAuthenticationError7({
|
|
|
1480
1566
|
};
|
|
1481
1567
|
}
|
|
1482
1568
|
var windows_cookie_default = {
|
|
1483
|
-
getRestCallAuthParams:
|
|
1484
|
-
getWebSocketAuthParams:
|
|
1485
|
-
handleAuthenticationError:
|
|
1569
|
+
getRestCallAuthParams: getRestCallAuthParams8,
|
|
1570
|
+
getWebSocketAuthParams: getWebSocketAuthParams8,
|
|
1571
|
+
handleAuthenticationError: handleAuthenticationError8,
|
|
1486
1572
|
validateHostConfig: (hostConfig) => internalValidateHostConfig(hostConfig, {
|
|
1487
1573
|
requiredProps: [],
|
|
1488
1574
|
optionalProps: ["loginUri", "crossSiteCookies"]
|
|
@@ -1500,6 +1586,7 @@ function registerDefaultAuthModules() {
|
|
|
1500
1586
|
registerAuthModule("oauth2", oauth_default);
|
|
1501
1587
|
registerAuthModule("anonymous", anonymous_default);
|
|
1502
1588
|
registerAuthModule("windowscookie", windows_cookie_default);
|
|
1589
|
+
registerAuthModule("reference", reference_default);
|
|
1503
1590
|
authModulesRegistered = true;
|
|
1504
1591
|
}
|
|
1505
1592
|
}
|
|
@@ -1507,7 +1594,9 @@ registerDefaultAuthModules();
|
|
|
1507
1594
|
var auth = {
|
|
1508
1595
|
logout,
|
|
1509
1596
|
registerAuthModule,
|
|
1510
|
-
setDefaultHostConfig
|
|
1597
|
+
setDefaultHostConfig,
|
|
1598
|
+
registerHostConfig,
|
|
1599
|
+
unregisterHostConfig,
|
|
1511
1600
|
getRestCallAuthParams,
|
|
1512
1601
|
getWebSocketAuthParams,
|
|
1513
1602
|
getWebResourceAuthParams,
|
|
@@ -2124,9 +2213,9 @@ function cleanStack(stack) {
|
|
|
2124
2213
|
// src/invoke-fetch/invoke-fetch-functions.ts
|
|
2125
2214
|
var defaultUserAgent = "qmfe-api/latest";
|
|
2126
2215
|
async function invokeFetch(api, props, interceptors) {
|
|
2127
|
-
|
|
2216
|
+
const effectiveInterceptors = interceptors || getInterceptors();
|
|
2128
2217
|
const invokeFetchFinal = (reqeust) => invokeFetchIntercepted(api, reqeust);
|
|
2129
|
-
const withInterceptors = (
|
|
2218
|
+
const withInterceptors = (effectiveInterceptors || []).reduce(
|
|
2130
2219
|
(proceed, interceptor) => (request) => interceptor(request, proceed),
|
|
2131
2220
|
invokeFetchFinal
|
|
2132
2221
|
);
|
|
@@ -2236,12 +2325,15 @@ export {
|
|
|
2236
2325
|
getRestCallAuthParams,
|
|
2237
2326
|
getAccessToken,
|
|
2238
2327
|
registerAuthModule2 as registerAuthModule,
|
|
2239
|
-
|
|
2328
|
+
setDefaultHostConfig,
|
|
2329
|
+
registerHostConfig,
|
|
2330
|
+
unregisterHostConfig,
|
|
2240
2331
|
serializeHostConfig,
|
|
2241
2332
|
determineAuthType,
|
|
2242
2333
|
checkForCrossDomainRequest,
|
|
2243
2334
|
logout,
|
|
2244
2335
|
generateRandomString,
|
|
2336
|
+
exposeInternalApiOnWindow,
|
|
2245
2337
|
InvokeFetchError,
|
|
2246
2338
|
EncodingError,
|
|
2247
2339
|
invokeFetch,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthRuntimeModule
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./DLKLPD7T.js";
|
|
4
4
|
|
|
5
5
|
// src/public/auth.ts
|
|
6
6
|
function registerAuthModule(name, authModule) {
|
|
@@ -12,12 +12,20 @@ function logout() {
|
|
|
12
12
|
function setDefaultHostConfig(hostConfig) {
|
|
13
13
|
void getAuthRuntimeModule(hostConfig).then((impl) => impl.setDefaultHostConfig(hostConfig));
|
|
14
14
|
}
|
|
15
|
+
function registerHostConfig(name, hostConfig) {
|
|
16
|
+
void getAuthRuntimeModule(hostConfig).then((impl) => impl.registerHostConfig(name, hostConfig));
|
|
17
|
+
}
|
|
18
|
+
function unregisterHostConfig(name) {
|
|
19
|
+
void getAuthRuntimeModule().then((impl) => impl.unregisterHostConfig(name));
|
|
20
|
+
}
|
|
15
21
|
async function getAccessToken({ hostConfig }) {
|
|
16
22
|
return getAuthRuntimeModule(hostConfig).then((impl) => impl.getAccessToken({ hostConfig }));
|
|
17
23
|
}
|
|
18
24
|
var auth_default = {
|
|
19
25
|
registerAuthModule,
|
|
20
26
|
setDefaultHostConfig,
|
|
27
|
+
registerHostConfig,
|
|
28
|
+
unregisterHostConfig,
|
|
21
29
|
getAccessToken
|
|
22
30
|
};
|
|
23
31
|
|
|
@@ -25,6 +33,8 @@ export {
|
|
|
25
33
|
registerAuthModule,
|
|
26
34
|
logout,
|
|
27
35
|
setDefaultHostConfig,
|
|
36
|
+
registerHostConfig,
|
|
37
|
+
unregisterHostConfig,
|
|
28
38
|
getAccessToken,
|
|
29
39
|
auth_default
|
|
30
40
|
};
|
|
@@ -15,11 +15,13 @@ import {
|
|
|
15
15
|
isWindows,
|
|
16
16
|
logout,
|
|
17
17
|
registerAuthModule,
|
|
18
|
+
registerHostConfig,
|
|
18
19
|
serializeHostConfig,
|
|
19
20
|
setDefaultHostConfig,
|
|
20
21
|
toValidLocationUrl,
|
|
21
|
-
toValidWebsocketLocationUrl
|
|
22
|
-
|
|
22
|
+
toValidWebsocketLocationUrl,
|
|
23
|
+
unregisterHostConfig
|
|
24
|
+
} from "./FKDGGR2O.js";
|
|
23
25
|
import "./3RGGGGAR.js";
|
|
24
26
|
import "./2ZQ3ZX7F.js";
|
|
25
27
|
export {
|
|
@@ -39,8 +41,10 @@ export {
|
|
|
39
41
|
isWindows,
|
|
40
42
|
logout,
|
|
41
43
|
registerAuthModule,
|
|
44
|
+
registerHostConfig,
|
|
42
45
|
serializeHostConfig,
|
|
43
46
|
setDefaultHostConfig,
|
|
44
47
|
toValidLocationUrl,
|
|
45
|
-
toValidWebsocketLocationUrl
|
|
48
|
+
toValidWebsocketLocationUrl,
|
|
49
|
+
unregisterHostConfig
|
|
46
50
|
};
|