@qlik/api 1.15.0 → 1.17.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 +31 -27
- 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/{V2I3BC7K.js → 5W53XSXH.js} +2 -2
- package/chunks/{OQWVV26L.js → 6MPNTVLD.js} +1 -1
- package/chunks/{J76NVE2J.js → AVML2WPM.js} +1 -1
- package/chunks/{TBHMVTOT.js → GLS4DAZ4.js} +1 -1
- package/chunks/{N6IB3ZM5.js → HFUVFYT4.js} +70 -49
- package/chunks/{W5IUOFYL.js → JBH4H34J.js} +1 -1
- package/chunks/{ZWPUDPMY.js → NJFCE5EM.js} +1 -1
- package/chunks/{BOSBVTSJ.js → NJRTJEAQ.js} +3 -3
- package/chunks/{LEILCZC6.js → RWQS4ASJ.js} +1 -1
- package/chunks/{DVK2JJ2J.js → S5OMX5JT.js} +69 -9
- 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 +273 -75
- package/data-files.js +2 -2
- package/extensions.d.ts +1 -1
- package/extensions.js +2 -2
- package/{global.types-z1p6A9D-.d.ts → global.types-BU2Yugjm.d.ts} +3 -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 +4 -2
- package/identity-providers.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +4 -4
- 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 +2 -1
- package/qix.d.ts +10 -2
- package/qix.js +2 -2
- package/quotas.d.ts +1 -1
- package/quotas.js +2 -2
- package/reload-tasks.d.ts +11 -11
- package/reload-tasks.js +2 -2
- package/reloads.d.ts +3 -3
- package/reloads.js +2 -2
- package/reports.d.ts +4 -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 +1 -1
- package/webhooks.js +2 -2
package/api-keys.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApiCallOptions } from './global.types-
|
|
1
|
+
import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
|
|
2
2
|
import './auth-types-BU5EGt_9.js';
|
|
3
3
|
|
|
4
4
|
type ApiKey = {
|
|
@@ -16,7 +16,7 @@ type ApiKey = {
|
|
|
16
16
|
readonly lastUpdated?: string;
|
|
17
17
|
/** The status of the API key. */
|
|
18
18
|
status: "active" | "expired" | "revoked";
|
|
19
|
-
/** The ID of the subject for the API key. For SCIM the format is `SCIM\\{{IDP-ID}}`, where `{{IDP-ID}}` is the ID of the IDP in Qlik. */
|
|
19
|
+
/** The ID of the subject for the API key. For SCIM the format is `SCIM\\{{IDP-ID}}`, where `{{IDP-ID}}` is the ID of the IDP in Qlik. For users, use their user ID, e.g. `64ef645a3b7009d55dee5a2b`. */
|
|
20
20
|
sub: string;
|
|
21
21
|
/** Type of the subject. For SCIM, it should be `externalClient`. */
|
|
22
22
|
subType: "user" | "externalClient";
|
|
@@ -26,11 +26,11 @@ type ApiKey = {
|
|
|
26
26
|
type ApiKeyBody = {
|
|
27
27
|
/** Text that describes the API key. */
|
|
28
28
|
description: string;
|
|
29
|
-
/** The expiry of the API key, in ISO8601 duration format. */
|
|
29
|
+
/** The expiry of the API key, in ISO8601 duration format. For example, `P7D` sets expiry after 7 days. If not provided, defaults to the maximum API key or SCIM key expiry configured in the tenant. */
|
|
30
30
|
expiry?: string;
|
|
31
|
-
/** The ID of the subject for the API key. For SCIM the format is `SCIM\\{{IDP-ID}}`, where `{{IDP-ID}}` is the ID of the IDP in Qlik. */
|
|
31
|
+
/** The ID of the subject for the API key. For SCIM the format is `SCIM\\{{IDP-ID}}`, where `{{IDP-ID}}` is the ID of the IDP in Qlik. When creating an API key for a user, this is their user ID, e.g. `64ef645a3b7009d55dee5a2b`, and will default to the requesting user if not provided. User must be assigned the `Developer` role. */
|
|
32
32
|
sub?: string;
|
|
33
|
-
/** Type of the subject. For SCIM, it should be `externalClient`. */
|
|
33
|
+
/** Type of the subject. For SCIM, it should be `externalClient`. If not specified, defaults to `user`. */
|
|
34
34
|
subType?: "user" | "externalClient";
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
@@ -40,7 +40,7 @@ type ApiKeyConfigPatch = {
|
|
|
40
40
|
/** The operation to be performed. */
|
|
41
41
|
op: "replace";
|
|
42
42
|
/** The path for the given resource field to patch. */
|
|
43
|
-
path: "/api_keys_enabled" | "/max_api_key_expiry" | "/max_keys_per_user";
|
|
43
|
+
path: "/api_keys_enabled" | "/max_api_key_expiry" | "/max_keys_per_user" | "/scim_externalClient_expiry";
|
|
44
44
|
/** The value to be used for this operation. */
|
|
45
45
|
value: unknown;
|
|
46
46
|
};
|
|
@@ -80,12 +80,14 @@ type ApiKeyWithToken = {
|
|
|
80
80
|
token: string;
|
|
81
81
|
};
|
|
82
82
|
type ApiKeysConfig = {
|
|
83
|
-
/** Enables or disables API key functionality for the specified tenant. */
|
|
83
|
+
/** Enables or disables user API key functionality for the specified tenant. */
|
|
84
84
|
api_keys_enabled?: boolean;
|
|
85
|
-
/** The maximum lifetime, in ISO8601 duration format, for which an API key can be issued for the specified tenant. */
|
|
85
|
+
/** The maximum lifetime, in ISO8601 duration format, for which an API key can be issued for the specified tenant, e.g. `P7D` for 7 days. */
|
|
86
86
|
max_api_key_expiry?: string;
|
|
87
87
|
/** The maximum number of active API keys that any user can create for the specified tenant. */
|
|
88
88
|
max_keys_per_user?: number;
|
|
89
|
+
/** The expiry of the scim `externalClient` token in ISO8601 duration format, e.g. `P365D` for 365 days. Used during the creation of an `externalClient` API key for configuring a SCIM compatible Identity Provider. */
|
|
90
|
+
scim_externalClient_expiry?: string;
|
|
89
91
|
};
|
|
90
92
|
type ApiKeysConfigPatchSchema = ApiKeyConfigPatch[];
|
|
91
93
|
type ApiKeysPatchSchema = ApiKeyPatch[];
|
|
@@ -130,7 +132,7 @@ type ApiKeyPage = {
|
|
|
130
132
|
};
|
|
131
133
|
};
|
|
132
134
|
/**
|
|
133
|
-
* Lists API keys for
|
|
135
|
+
* Lists API keys for the tenant. To list API keys owned by other users, requesting user must be assigned the `TenantAdmin` role.
|
|
134
136
|
*
|
|
135
137
|
* @param query an object with query parameters
|
|
136
138
|
* @throws GetApiKeysHttpError
|
|
@@ -148,7 +150,7 @@ declare const getApiKeys: (query: {
|
|
|
148
150
|
startingAfter?: string;
|
|
149
151
|
/** The status of the API key. */
|
|
150
152
|
status?: "active" | "expired" | "revoked";
|
|
151
|
-
/** The ID of the subject. */
|
|
153
|
+
/** The ID of the subject. For SCIM the format is `SCIM\\{{IDP-ID}}`, where `{{IDP-ID}}` is the ID of the IDP in Qlik. For users, use their user ID, e.g. `64ef645a3b7009d55dee5a2b`. */
|
|
152
154
|
sub?: string;
|
|
153
155
|
}, options?: ApiCallOptions) => Promise<GetApiKeysHttpResponse>;
|
|
154
156
|
type GetApiKeysHttpResponse = {
|
|
@@ -164,7 +166,8 @@ type GetApiKeysHttpError = {
|
|
|
164
166
|
status: number;
|
|
165
167
|
};
|
|
166
168
|
/**
|
|
167
|
-
* Creates an API key
|
|
169
|
+
* Creates an API key, either for a user, or for configuring SCIM for a compatible Identity Provider.
|
|
170
|
+
* Sending `sub` and `subType` is required only for creating SCIM keys.
|
|
168
171
|
*
|
|
169
172
|
* @param body an object with the body content
|
|
170
173
|
* @throws CreateApiKeyHttpError
|
|
@@ -181,9 +184,9 @@ type CreateApiKeyHttpError = {
|
|
|
181
184
|
status: number;
|
|
182
185
|
};
|
|
183
186
|
/**
|
|
184
|
-
*
|
|
187
|
+
* Retrieves the API key configuration for a tenant.
|
|
185
188
|
*
|
|
186
|
-
* @param tenantId The tenant ID
|
|
189
|
+
* @param tenantId The tenant ID from which you wish to retrieve the API key configuration.
|
|
187
190
|
* @throws GetApiKeysConfigHttpError
|
|
188
191
|
*/
|
|
189
192
|
declare const getApiKeysConfig: (tenantId: string, options?: ApiCallOptions) => Promise<GetApiKeysConfigHttpResponse>;
|
|
@@ -216,9 +219,9 @@ type PatchApiKeysConfigHttpError = {
|
|
|
216
219
|
status: number;
|
|
217
220
|
};
|
|
218
221
|
/**
|
|
219
|
-
* When the owner of the API key sends the request, the key will be removed. When a TenantAdmin sends the request, the key will be revoked.
|
|
222
|
+
* Deletes or revokes an API key for a given API key ID. When the owner of the API key sends the request, the key will be deleted and removed from the tenant. When a user assigned the `TenantAdmin` role sends the request, the key will be disabled and marked as revoked.
|
|
220
223
|
*
|
|
221
|
-
* @param id The ID of the API key
|
|
224
|
+
* @param id The ID of the API key to be retrieved.
|
|
222
225
|
* @throws DeleteApiKeyHttpError
|
|
223
226
|
*/
|
|
224
227
|
declare const deleteApiKey: (id: string, options?: ApiCallOptions) => Promise<DeleteApiKeyHttpResponse>;
|
|
@@ -233,9 +236,9 @@ type DeleteApiKeyHttpError = {
|
|
|
233
236
|
status: number;
|
|
234
237
|
};
|
|
235
238
|
/**
|
|
236
|
-
*
|
|
239
|
+
* Returns the API key for a given API key ID.
|
|
237
240
|
*
|
|
238
|
-
* @param id The ID of the API key
|
|
241
|
+
* @param id The ID of the API key to be retrieved.
|
|
239
242
|
* @throws GetApiKeyHttpError
|
|
240
243
|
*/
|
|
241
244
|
declare const getApiKey: (id: string, options?: ApiCallOptions) => Promise<GetApiKeyHttpResponse>;
|
|
@@ -250,7 +253,7 @@ type GetApiKeyHttpError = {
|
|
|
250
253
|
status: number;
|
|
251
254
|
};
|
|
252
255
|
/**
|
|
253
|
-
* Updates an API key for a given ID.
|
|
256
|
+
* Updates an API key description for a given API key ID.
|
|
254
257
|
*
|
|
255
258
|
* @param id The ID of the API key resource to be updated.
|
|
256
259
|
* @param body an object with the body content
|
|
@@ -273,23 +276,24 @@ type PatchApiKeyHttpError = {
|
|
|
273
276
|
declare function clearCache(): void;
|
|
274
277
|
interface ApiKeysAPI {
|
|
275
278
|
/**
|
|
276
|
-
* Lists API keys for
|
|
279
|
+
* Lists API keys for the tenant. To list API keys owned by other users, requesting user must be assigned the `TenantAdmin` role.
|
|
277
280
|
*
|
|
278
281
|
* @param query an object with query parameters
|
|
279
282
|
* @throws GetApiKeysHttpError
|
|
280
283
|
*/
|
|
281
284
|
getApiKeys: typeof getApiKeys;
|
|
282
285
|
/**
|
|
283
|
-
* Creates an API key
|
|
286
|
+
* Creates an API key, either for a user, or for configuring SCIM for a compatible Identity Provider.
|
|
287
|
+
* Sending `sub` and `subType` is required only for creating SCIM keys.
|
|
284
288
|
*
|
|
285
289
|
* @param body an object with the body content
|
|
286
290
|
* @throws CreateApiKeyHttpError
|
|
287
291
|
*/
|
|
288
292
|
createApiKey: typeof createApiKey;
|
|
289
293
|
/**
|
|
290
|
-
*
|
|
294
|
+
* Retrieves the API key configuration for a tenant.
|
|
291
295
|
*
|
|
292
|
-
* @param tenantId The tenant ID
|
|
296
|
+
* @param tenantId The tenant ID from which you wish to retrieve the API key configuration.
|
|
293
297
|
* @throws GetApiKeysConfigHttpError
|
|
294
298
|
*/
|
|
295
299
|
getApiKeysConfig: typeof getApiKeysConfig;
|
|
@@ -302,21 +306,21 @@ interface ApiKeysAPI {
|
|
|
302
306
|
*/
|
|
303
307
|
patchApiKeysConfig: typeof patchApiKeysConfig;
|
|
304
308
|
/**
|
|
305
|
-
* When the owner of the API key sends the request, the key will be removed. When a TenantAdmin sends the request, the key will be revoked.
|
|
309
|
+
* Deletes or revokes an API key for a given API key ID. When the owner of the API key sends the request, the key will be deleted and removed from the tenant. When a user assigned the `TenantAdmin` role sends the request, the key will be disabled and marked as revoked.
|
|
306
310
|
*
|
|
307
|
-
* @param id The ID of the API key
|
|
311
|
+
* @param id The ID of the API key to be retrieved.
|
|
308
312
|
* @throws DeleteApiKeyHttpError
|
|
309
313
|
*/
|
|
310
314
|
deleteApiKey: typeof deleteApiKey;
|
|
311
315
|
/**
|
|
312
|
-
*
|
|
316
|
+
* Returns the API key for a given API key ID.
|
|
313
317
|
*
|
|
314
|
-
* @param id The ID of the API key
|
|
318
|
+
* @param id The ID of the API key to be retrieved.
|
|
315
319
|
* @throws GetApiKeyHttpError
|
|
316
320
|
*/
|
|
317
321
|
getApiKey: typeof getApiKey;
|
|
318
322
|
/**
|
|
319
|
-
* Updates an API key for a given ID.
|
|
323
|
+
* Updates an API key description for a given API key ID.
|
|
320
324
|
*
|
|
321
325
|
* @param id The ID of the API key resource to be updated.
|
|
322
326
|
* @param body an object with the body content
|
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-BU2Yugjm.js';
|
|
2
2
|
import './auth-types-BU5EGt_9.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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getInvokeFetchRuntimeModule
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./NJRTJEAQ.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.17.0";
|
|
10
10
|
async function invokeFetch(api, props) {
|
|
11
11
|
const hostConfig = props.options?.hostConfig;
|
|
12
12
|
let userAgent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/.pnpm/@qlik+runtime-module-loader@1.0.
|
|
1
|
+
// node_modules/.pnpm/@qlik+runtime-module-loader@1.0.10/node_modules/@qlik/runtime-module-loader/dist/index.js
|
|
2
2
|
window.__qlikMainPrivateResolvers = window.__qlikMainPrivateResolvers || {};
|
|
3
3
|
window.__qlikMainPrivateResolvers.mainUrlPromise = window.__qlikMainPrivateResolvers.mainUrlPromise || new Promise((resolve) => {
|
|
4
4
|
window.__qlikMainPrivateResolvers.resolveMainJsUrl = (value) => resolve(value);
|
|
@@ -792,7 +792,61 @@ async function refreshAccessToken(hostConfig) {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
+
// src/auth/internal/default-auth-modules/oauth/temporary-token.ts
|
|
796
|
+
async function exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, purpose) {
|
|
797
|
+
const response = await fetch(`${toValidLocationUrl(hostConfig)}/oauth/token`, {
|
|
798
|
+
method: "POST",
|
|
799
|
+
credentials: "include",
|
|
800
|
+
mode: "cors",
|
|
801
|
+
headers: { "content-type": "application/json" },
|
|
802
|
+
redirect: "follow",
|
|
803
|
+
body: JSON.stringify({
|
|
804
|
+
subject_token: accessToken,
|
|
805
|
+
subject_token_type: "urn:ietf:params:oauth:token-type:access_token",
|
|
806
|
+
grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
|
|
807
|
+
purpose,
|
|
808
|
+
redirect_uri: globalThis.location?.href,
|
|
809
|
+
client_id: hostConfig.clientId
|
|
810
|
+
})
|
|
811
|
+
});
|
|
812
|
+
if (response.status !== 200) {
|
|
813
|
+
throw await toError(response);
|
|
814
|
+
}
|
|
815
|
+
const data = await response.json();
|
|
816
|
+
return data.access_token;
|
|
817
|
+
}
|
|
818
|
+
async function toError(response) {
|
|
819
|
+
const body = await response.text();
|
|
820
|
+
try {
|
|
821
|
+
const data = JSON.parse(body);
|
|
822
|
+
return new AuthorizationError(data.errors);
|
|
823
|
+
} catch (err) {
|
|
824
|
+
return new AuthorizationError([
|
|
825
|
+
{
|
|
826
|
+
code: "unknown",
|
|
827
|
+
status: response.status,
|
|
828
|
+
detail: body,
|
|
829
|
+
title: "Unknown authentication error"
|
|
830
|
+
}
|
|
831
|
+
]);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
795
835
|
// src/auth/internal/default-auth-modules/anonymous.ts
|
|
836
|
+
async function handlePotentialAuthenticationErrorAndRetry(hostConfig, fn) {
|
|
837
|
+
try {
|
|
838
|
+
return await fn();
|
|
839
|
+
} catch (err) {
|
|
840
|
+
const { retry } = await handleAuthenticationError2({
|
|
841
|
+
hostConfig,
|
|
842
|
+
canRetry: true
|
|
843
|
+
});
|
|
844
|
+
if (retry) {
|
|
845
|
+
return fn();
|
|
846
|
+
}
|
|
847
|
+
throw err;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
796
850
|
async function getOrCreateTrackingCode(hostConfig) {
|
|
797
851
|
let trackingCode;
|
|
798
852
|
if (isBrowser()) {
|
|
@@ -809,7 +863,7 @@ async function getOrCreateTrackingCode(hostConfig) {
|
|
|
809
863
|
}
|
|
810
864
|
function createTrackingCode() {
|
|
811
865
|
const timeStamp = Math.floor(Date.now() / 1e3).toString(16);
|
|
812
|
-
const randomString = generateRandomHexString(
|
|
866
|
+
const randomString = generateRandomHexString(40 - timeStamp.length);
|
|
813
867
|
return `${timeStamp}${randomString}`;
|
|
814
868
|
}
|
|
815
869
|
async function getAnonymousAccessToken(hostConfig) {
|
|
@@ -849,20 +903,26 @@ async function getRestCallAuthParams2({
|
|
|
849
903
|
async function getWebSocketAuthParams2({
|
|
850
904
|
hostConfig
|
|
851
905
|
}) {
|
|
852
|
-
const
|
|
906
|
+
const websocketAccessToken = await handlePotentialAuthenticationErrorAndRetry(hostConfig, async () => {
|
|
907
|
+
const accessToken = await getAnonymousAccessToken(hostConfig);
|
|
908
|
+
return exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, "websocket");
|
|
909
|
+
});
|
|
853
910
|
return {
|
|
854
911
|
queryParams: {
|
|
855
|
-
accessToken
|
|
912
|
+
accessToken: websocketAccessToken
|
|
856
913
|
}
|
|
857
914
|
};
|
|
858
915
|
}
|
|
859
916
|
async function getWebResourceAuthParams2({
|
|
860
917
|
hostConfig
|
|
861
918
|
}) {
|
|
862
|
-
const
|
|
919
|
+
const websocketResourceAccessToken = await handlePotentialAuthenticationErrorAndRetry(hostConfig, async () => {
|
|
920
|
+
const accessToken = await getAnonymousAccessToken(hostConfig);
|
|
921
|
+
return exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, "websocket");
|
|
922
|
+
});
|
|
863
923
|
return {
|
|
864
924
|
queryParams: {
|
|
865
|
-
accessToken
|
|
925
|
+
accessToken: websocketResourceAccessToken
|
|
866
926
|
}
|
|
867
927
|
};
|
|
868
928
|
}
|
|
@@ -1009,7 +1069,7 @@ var cookie_default = {
|
|
|
1009
1069
|
handleAuthenticationError: handleAuthenticationError4,
|
|
1010
1070
|
validateHostConfig: (hostConfig) => internalValidateHostConfig(hostConfig, {
|
|
1011
1071
|
requiredProps: [],
|
|
1012
|
-
optionalProps: ["webIntegrationId", "crossSiteCookies"]
|
|
1072
|
+
optionalProps: ["webIntegrationId", "crossSiteCookies", "anonymousMode"]
|
|
1013
1073
|
})
|
|
1014
1074
|
};
|
|
1015
1075
|
|
|
@@ -1059,51 +1119,11 @@ function handleOAuthCallback() {
|
|
|
1059
1119
|
}
|
|
1060
1120
|
}
|
|
1061
1121
|
|
|
1062
|
-
// src/auth/internal/default-auth-modules/oauth/temporary-token.ts
|
|
1063
|
-
async function exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, purpose) {
|
|
1064
|
-
const response = await fetch(`${toValidLocationUrl(hostConfig)}/oauth/token`, {
|
|
1065
|
-
method: "POST",
|
|
1066
|
-
credentials: "include",
|
|
1067
|
-
mode: "cors",
|
|
1068
|
-
headers: { "content-type": "application/json" },
|
|
1069
|
-
redirect: "follow",
|
|
1070
|
-
body: JSON.stringify({
|
|
1071
|
-
subject_token: accessToken,
|
|
1072
|
-
subject_token_type: "urn:ietf:params:oauth:token-type:access_token",
|
|
1073
|
-
grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
|
|
1074
|
-
purpose,
|
|
1075
|
-
redirect_uri: globalThis.location?.href,
|
|
1076
|
-
client_id: hostConfig.clientId
|
|
1077
|
-
})
|
|
1078
|
-
});
|
|
1079
|
-
if (response.status !== 200) {
|
|
1080
|
-
throw await toError(response);
|
|
1081
|
-
}
|
|
1082
|
-
const data = await response.json();
|
|
1083
|
-
return data.access_token;
|
|
1084
|
-
}
|
|
1085
|
-
async function toError(response) {
|
|
1086
|
-
const body = await response.text();
|
|
1087
|
-
try {
|
|
1088
|
-
const data = JSON.parse(body);
|
|
1089
|
-
return new AuthorizationError(data.errors);
|
|
1090
|
-
} catch (err) {
|
|
1091
|
-
return new AuthorizationError([
|
|
1092
|
-
{
|
|
1093
|
-
code: "unknown",
|
|
1094
|
-
status: response.status,
|
|
1095
|
-
detail: body,
|
|
1096
|
-
title: "Unknown authentication error"
|
|
1097
|
-
}
|
|
1098
|
-
]);
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
1122
|
// src/auth/internal/default-auth-modules/oauth.ts
|
|
1103
1123
|
if (isBrowser()) {
|
|
1104
1124
|
handleOAuthCallback();
|
|
1105
1125
|
}
|
|
1106
|
-
async function
|
|
1126
|
+
async function handlePotentialAuthenticationErrorAndRetry2(hostConfig, fn) {
|
|
1107
1127
|
try {
|
|
1108
1128
|
return await fn();
|
|
1109
1129
|
} catch (err) {
|
|
@@ -1131,7 +1151,7 @@ async function getRestCallAuthParams6({
|
|
|
1131
1151
|
async function getWebSocketAuthParams6({
|
|
1132
1152
|
hostConfig
|
|
1133
1153
|
}) {
|
|
1134
|
-
const websocketAccessToken = await
|
|
1154
|
+
const websocketAccessToken = await handlePotentialAuthenticationErrorAndRetry2(hostConfig, async () => {
|
|
1135
1155
|
const accessToken = await getOAuthAccessToken(hostConfig);
|
|
1136
1156
|
return exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, "websocket");
|
|
1137
1157
|
});
|
|
@@ -1144,7 +1164,7 @@ async function getWebSocketAuthParams6({
|
|
|
1144
1164
|
async function getWebResourceAuthParams3({
|
|
1145
1165
|
hostConfig
|
|
1146
1166
|
}) {
|
|
1147
|
-
const webResourceAccessToken = await
|
|
1167
|
+
const webResourceAccessToken = await handlePotentialAuthenticationErrorAndRetry2(hostConfig, async () => {
|
|
1148
1168
|
const accessToken = await getOAuthAccessToken(hostConfig);
|
|
1149
1169
|
return exchangeAccessTokenForTemporaryToken(hostConfig, accessToken, "webresource");
|
|
1150
1170
|
});
|
|
@@ -1886,6 +1906,7 @@ async function parseFetchResponse(fetchResponse, url) {
|
|
|
1886
1906
|
case "application/offset+octet-stream":
|
|
1887
1907
|
case "application/octet-stream":
|
|
1888
1908
|
case "application/zip":
|
|
1909
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
|
1889
1910
|
resultData = toDownloadableBlob(await fetchResponse.blob());
|
|
1890
1911
|
break;
|
|
1891
1912
|
case "text/event-stream":
|
|
@@ -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("./RWQS4ASJ.js") : import("./GLS4DAZ4.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("./S5OMX5JT.js") : import("./GLS4DAZ4.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("./NJFCE5EM.js") : import("./GLS4DAZ4.js").then(
|
|
19
19
|
(mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig)
|
|
20
20
|
);
|
|
21
21
|
}
|