@qlik/api 1.16.0 → 1.18.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 +32 -28
- package/api-keys.js +2 -2
- package/apps.d.ts +4 -4
- package/apps.js +2 -2
- package/audits.d.ts +2 -2
- package/audits.js +2 -2
- package/{auth-types-BU5EGt_9.d.ts → auth-types-PkN9CAF_.d.ts} +3 -0
- package/auth.d.ts +2 -2
- package/auth.js +2 -2
- package/automations.d.ts +2 -2
- package/automations.js +2 -2
- package/brands.d.ts +2 -2
- package/brands.js +2 -2
- package/chunks/{PESPSFQN.js → 2B3EPESP.js} +1 -1
- package/chunks/{MFNOHOWH.js → 2NXPFUPZ.js} +2 -2
- package/chunks/{O3XVX7VQ.js → 4FZ45I6G.js} +1 -1
- package/chunks/{GXMVBX45.js → GKEPTI44.js} +1 -1
- package/chunks/{TBHMVTOT.js → GLS4DAZ4.js} +1 -1
- package/chunks/{6O3XBOLZ.js → H7WWFWBM.js} +1 -1
- package/chunks/{YHKRUQRS.js → QLFOH4GP.js} +120 -11
- package/chunks/{ECWQX4IH.js → URFSYYRS.js} +1 -1
- package/chunks/{3XRP5N4L.js → YEHZGXQV.js} +141 -73
- package/chunks/{7IMOYFWE.js → ZLPAS7FC.js} +3 -3
- package/collections.d.ts +18 -17
- 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 +2 -2
- package/data-connections.js +2 -2
- package/data-credentials.d.ts +2 -2
- package/data-credentials.js +2 -2
- package/data-files.d.ts +274 -76
- package/data-files.js +2 -2
- package/extensions.d.ts +18 -18
- package/extensions.js +2 -2
- package/{global.types-z1p6A9D-.d.ts → global.types--37uwGji.d.ts} +4 -1
- package/glossaries.d.ts +2 -2
- package/glossaries.js +2 -2
- package/groups.d.ts +2 -2
- package/groups.js +2 -2
- package/identity-providers.d.ts +2 -2
- package/identity-providers.js +2 -2
- package/index.d.ts +2 -2
- package/index.js +4 -4
- package/items.d.ts +11 -11
- package/items.js +2 -2
- package/licenses.d.ts +2 -2
- package/licenses.js +2 -2
- package/package.json +2 -2
- package/qix.d.ts +7 -4
- package/qix.js +2 -2
- package/quotas.d.ts +2 -2
- package/quotas.js +2 -2
- package/reload-tasks.d.ts +12 -12
- package/reload-tasks.js +2 -2
- package/reloads.d.ts +4 -4
- package/reloads.js +2 -2
- package/reports.d.ts +5 -3
- package/reports.js +2 -2
- package/roles.d.ts +2 -2
- package/roles.js +2 -2
- package/spaces.d.ts +2 -2
- 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 +18 -18
- 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
package/api-keys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiCallOptions } from './global.types
|
|
2
|
-
import './auth-types-
|
|
1
|
+
import { A as ApiCallOptions } from './global.types--37uwGji.js';
|
|
2
|
+
import './auth-types-PkN9CAF_.js';
|
|
3
3
|
|
|
4
4
|
type ApiKey = {
|
|
5
5
|
/** When the API key was created. */
|
|
@@ -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,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiCallOptions, D as DownloadableBlob } from './global.types
|
|
2
|
-
import './auth-types-
|
|
1
|
+
import { A as ApiCallOptions, D as DownloadableBlob } from './global.types--37uwGji.js';
|
|
2
|
+
import './auth-types-PkN9CAF_.js';
|
|
3
3
|
|
|
4
4
|
type Analysis = "breakdown" | "changePoint" | "comparison" | "contribution" | "correlation" | "fact" | "mutualInfo" | "rank" | "spike" | "trend" | "values";
|
|
5
5
|
type AnalysisComposition = {
|
|
@@ -696,7 +696,7 @@ type NxAttributes = {
|
|
|
696
696
|
/** The Origin App ID for published apps. */
|
|
697
697
|
originAppId?: string;
|
|
698
698
|
/** @deprecated
|
|
699
|
-
* Deprecated. Use
|
|
699
|
+
* Deprecated. Use the Users API to fetch user metadata. */
|
|
700
700
|
owner?: string;
|
|
701
701
|
/** Identifier of the app owner. */
|
|
702
702
|
ownerId?: string;
|
|
@@ -985,7 +985,7 @@ type UpdateOwner = {
|
|
|
985
985
|
type UpdateSpace = {
|
|
986
986
|
spaceId?: string;
|
|
987
987
|
};
|
|
988
|
-
type UsageEnum = "ANALYTICS" | "DATA_PREPARATION" | "DATAFLOW_PREP";
|
|
988
|
+
type UsageEnum = "ANALYTICS" | "DATA_PREPARATION" | "DATAFLOW_PREP" | "SINGLE_TABLE_PREP";
|
|
989
989
|
type UserPrivileges = "can_create_app" | "can_import_app" | "can_create_session_app";
|
|
990
990
|
type Classification = {
|
|
991
991
|
absoluteDiff?: number;
|
package/apps.js
CHANGED
package/audits.d.ts
CHANGED
package/audits.js
CHANGED
|
@@ -98,6 +98,9 @@ type HostConfigCommon = {
|
|
|
98
98
|
* Optional parameter that can be used to point to a Qlik Cloud tenant domain from which the embed runtime should be loaded. If omitted the host parameter will be used.
|
|
99
99
|
*/
|
|
100
100
|
embedRuntimeUrl?: string;
|
|
101
|
+
onAuthFailed?: (props: {
|
|
102
|
+
message: string;
|
|
103
|
+
}) => unknown;
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
export type { AuthType as A, Credentials as C, GetRestCallAuthParamsProps as G, HostConfig as H, RestCallAuthParams as R, WebSocketAuthParams as W, AuthModule as a, GetWebSocketAuthParamsProps as b, GetWebResourceAuthParamsProps as c, WebResourceAuthParams as d, GetRemoteAuthDataProps as e, HandleAuthenticationErrorProps as f, AuthenticationErrorAction as g };
|
package/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AuthType, a as AuthModule, H as HostConfig } from './auth-types-
|
|
2
|
-
export { g as AuthenticationErrorAction, C as Credentials, e as GetRemoteAuthDataProps, G as GetRestCallAuthParamsProps, c as GetWebResourceAuthParamsProps, b as GetWebSocketAuthParamsProps, f as HandleAuthenticationErrorProps, R as RestCallAuthParams, d as WebResourceAuthParams, W as WebSocketAuthParams } from './auth-types-
|
|
1
|
+
import { A as AuthType, a as AuthModule, H as HostConfig } from './auth-types-PkN9CAF_.js';
|
|
2
|
+
export { g as AuthenticationErrorAction, C as Credentials, e as GetRemoteAuthDataProps, G as GetRestCallAuthParamsProps, c as GetWebResourceAuthParamsProps, b as GetWebSocketAuthParamsProps, f as HandleAuthenticationErrorProps, R as RestCallAuthParams, d as WebResourceAuthParams, W as WebSocketAuthParams } from './auth-types-PkN9CAF_.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Registers an auth module that can handle authentication. An auth module is used by specifying its name as authType in the HostConfig passed in to api calls.
|
package/auth.js
CHANGED
package/automations.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiCallOptions } from './global.types
|
|
2
|
-
import './auth-types-
|
|
1
|
+
import { A as ApiCallOptions } from './global.types--37uwGji.js';
|
|
2
|
+
import './auth-types-PkN9CAF_.js';
|
|
3
3
|
|
|
4
4
|
type AutomationDetailRequestObject = {
|
|
5
5
|
description?: string;
|
package/automations.js
CHANGED
package/brands.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiCallOptions, D as DownloadableBlob } from './global.types
|
|
2
|
-
import './auth-types-
|
|
1
|
+
import { A as ApiCallOptions, D as DownloadableBlob } from './global.types--37uwGji.js';
|
|
2
|
+
import './auth-types-PkN9CAF_.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A brand is a collection of assets for applying custom branding. Only a single brand can be active in a tenant.
|
package/brands.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getInvokeFetchRuntimeModule
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./ZLPAS7FC.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.18.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);
|
|
@@ -4,11 +4,55 @@ import {
|
|
|
4
4
|
invokeFetch,
|
|
5
5
|
isWindows,
|
|
6
6
|
toValidWebsocketLocationUrl
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./YEHZGXQV.js";
|
|
8
8
|
import {
|
|
9
9
|
isBrowser
|
|
10
10
|
} from "./2ZQ3ZX7F.js";
|
|
11
11
|
|
|
12
|
+
// src/qix/session/websocket-errors.ts
|
|
13
|
+
var closeCodeEngineTerminating = 4003;
|
|
14
|
+
var closeCodeEngineAbnormalClosure = 1006;
|
|
15
|
+
var closeCodeEngineProxyGeneric = 4200;
|
|
16
|
+
var closeCodeClientTimeout = 4201;
|
|
17
|
+
var closeCodeBadRequest = 4202;
|
|
18
|
+
var closeCodePermissions = 4203;
|
|
19
|
+
var closeCodeNotFound = 4204;
|
|
20
|
+
var closeCodeTooManyRequests = 4205;
|
|
21
|
+
var closeCodeNetwork = 4206;
|
|
22
|
+
var closeCodeDependencyGeneric = 4210;
|
|
23
|
+
var closeCodeDependencyUnavailable = 4211;
|
|
24
|
+
var closeCodeEngineGeneric = 4220;
|
|
25
|
+
var closeCodeEntitlement = 4230;
|
|
26
|
+
var closeCodeNoEnginesAvailable = 4240;
|
|
27
|
+
var CloseCodeSessionReservationMissing = 4222;
|
|
28
|
+
var closeCodeMessages = {
|
|
29
|
+
[closeCodeEngineTerminating]: "The engine is in terminating state",
|
|
30
|
+
[closeCodeEngineAbnormalClosure]: "The engine is abnormally closed",
|
|
31
|
+
[closeCodeEngineProxyGeneric]: "A problem occurred in engine-proxy",
|
|
32
|
+
[closeCodeClientTimeout]: "The client has closed the connection",
|
|
33
|
+
[closeCodeBadRequest]: "The provided request is invalid and/or malformed",
|
|
34
|
+
[closeCodePermissions]: "No permission to open the app",
|
|
35
|
+
[closeCodeNotFound]: "App not found",
|
|
36
|
+
[closeCodeTooManyRequests]: "Too many requests have been sent in a given amount of time",
|
|
37
|
+
[closeCodeNetwork]: "Networking issues",
|
|
38
|
+
[closeCodeDependencyGeneric]: "A problem occurred in a dependency of engine-proxy",
|
|
39
|
+
[closeCodeDependencyUnavailable]: "A dependency is unavailable and not serving any requests",
|
|
40
|
+
[closeCodeEngineGeneric]: "A problem occurred in an engine",
|
|
41
|
+
[closeCodeEntitlement]: "You are not entitled to perform that operation",
|
|
42
|
+
[closeCodeNoEnginesAvailable]: "There are currently no engines available",
|
|
43
|
+
[CloseCodeSessionReservationMissing]: "The reserved session is missing"
|
|
44
|
+
};
|
|
45
|
+
var uknownCloseErrorMessage = "websocket closed for unknown reason";
|
|
46
|
+
function getHumanReadableSocketClosedErrorMessage(err, { appId, hostConfig }) {
|
|
47
|
+
const closeCode = err?.original?.code;
|
|
48
|
+
const closeMessage = closeCode ? closeCodeMessages[closeCode] || uknownCloseErrorMessage : err.message;
|
|
49
|
+
if (hostConfig?.host) {
|
|
50
|
+
return `Failed to open app ${appId} on ${hostConfig?.host}: ${closeMessage}`;
|
|
51
|
+
} else {
|
|
52
|
+
return `Failed to open app ${appId}: ${closeMessage}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
12
56
|
// src/qix/session/shared-sessions.ts
|
|
13
57
|
var globalEventListeners = /* @__PURE__ */ new Set();
|
|
14
58
|
function globalOnWebSocketEvent(listener) {
|
|
@@ -101,7 +145,7 @@ function listenForWindowsAuthenticationInformation(session) {
|
|
|
101
145
|
return authSuggestedInWebsocket;
|
|
102
146
|
}
|
|
103
147
|
async function createAndSetupEnigmaSession(props, canRetry) {
|
|
104
|
-
const { createEnigmaSession } = await import("./
|
|
148
|
+
const { createEnigmaSession } = await import("./4FZ45I6G.js");
|
|
105
149
|
const session = await createEnigmaSession(props);
|
|
106
150
|
setupSessionListeners(session, props);
|
|
107
151
|
let global;
|
|
@@ -327,7 +371,8 @@ function createSharedSession(props) {
|
|
|
327
371
|
const clients = [];
|
|
328
372
|
function closeEnigmaSession() {
|
|
329
373
|
delete sharedSessions[key];
|
|
330
|
-
return sharedSession.sessionPromise.then((session) => session.close())
|
|
374
|
+
return sharedSession.sessionPromise.then((session) => session.close()).catch(() => {
|
|
375
|
+
});
|
|
331
376
|
}
|
|
332
377
|
const sharedSession = {
|
|
333
378
|
sessionPromise,
|
|
@@ -380,7 +425,11 @@ function createSharedSession(props) {
|
|
|
380
425
|
});
|
|
381
426
|
sharedSession.docPromise = sharedSession.docPromise.catch((err) => {
|
|
382
427
|
closeEnigmaSession();
|
|
383
|
-
|
|
428
|
+
const errorWithReadableMessage = new Error(getHumanReadableSocketClosedErrorMessage(err, props));
|
|
429
|
+
Object.entries(err).forEach(([key2, value]) => {
|
|
430
|
+
errorWithReadableMessage[key2] = value;
|
|
431
|
+
});
|
|
432
|
+
return Promise.reject(errorWithReadableMessage);
|
|
384
433
|
});
|
|
385
434
|
return sharedSession;
|
|
386
435
|
}
|
|
@@ -449,6 +498,72 @@ function getOrCreateSharedSession(props) {
|
|
|
449
498
|
sharedSessions[key] = sharedSessions[key] || createSharedSession(props);
|
|
450
499
|
return sharedSessions[key];
|
|
451
500
|
}
|
|
501
|
+
function getExternalSession(externalApp, appSessionProps) {
|
|
502
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
503
|
+
const appSession = {
|
|
504
|
+
_listeners: listeners,
|
|
505
|
+
getDoc: () => externalApp,
|
|
506
|
+
onWebSocketEvent: (fn) => () => {
|
|
507
|
+
appSession._listeners.add(fn);
|
|
508
|
+
return () => {
|
|
509
|
+
appSession._listeners.delete(fn);
|
|
510
|
+
};
|
|
511
|
+
},
|
|
512
|
+
resume: () => Promise.resolve(),
|
|
513
|
+
close: () => Promise.resolve()
|
|
514
|
+
};
|
|
515
|
+
const triggerEventListeners = (event) => {
|
|
516
|
+
for (const fn of globalEventListeners) {
|
|
517
|
+
fn(event);
|
|
518
|
+
}
|
|
519
|
+
for (const fn of appSession._listeners) {
|
|
520
|
+
fn(event);
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
externalApp.then((app) => {
|
|
524
|
+
app.session.on("opened", (event) => {
|
|
525
|
+
const wsEvent = {
|
|
526
|
+
eventType: "opened",
|
|
527
|
+
...appSessionProps,
|
|
528
|
+
...event
|
|
529
|
+
};
|
|
530
|
+
triggerEventListeners(wsEvent);
|
|
531
|
+
});
|
|
532
|
+
app.session.on("closed", (event) => {
|
|
533
|
+
const wsEvent = {
|
|
534
|
+
eventType: "closed",
|
|
535
|
+
...appSessionProps,
|
|
536
|
+
...event
|
|
537
|
+
};
|
|
538
|
+
triggerEventListeners(wsEvent);
|
|
539
|
+
});
|
|
540
|
+
app.session.on("suspended", (event) => {
|
|
541
|
+
const wsEvent = {
|
|
542
|
+
eventType: "suspended",
|
|
543
|
+
...appSessionProps,
|
|
544
|
+
...event
|
|
545
|
+
};
|
|
546
|
+
triggerEventListeners(wsEvent);
|
|
547
|
+
});
|
|
548
|
+
app.session.on("resuming", (event) => {
|
|
549
|
+
const wsEvent = {
|
|
550
|
+
eventType: "resuming",
|
|
551
|
+
...appSessionProps,
|
|
552
|
+
...event
|
|
553
|
+
};
|
|
554
|
+
triggerEventListeners(wsEvent);
|
|
555
|
+
});
|
|
556
|
+
app.session.on("resumed", (event) => {
|
|
557
|
+
const wsEvent = {
|
|
558
|
+
eventType: "resumed",
|
|
559
|
+
...appSessionProps,
|
|
560
|
+
...event
|
|
561
|
+
};
|
|
562
|
+
triggerEventListeners(wsEvent);
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
return appSession;
|
|
566
|
+
}
|
|
452
567
|
|
|
453
568
|
// src/qix/qix-functions.ts
|
|
454
569
|
async function createSessionApp() {
|
|
@@ -491,13 +606,7 @@ function openAppSession(appIdOrProps) {
|
|
|
491
606
|
const appSessionId = toGlobalAppSessionId(appSessionProps);
|
|
492
607
|
const externalApp = externalApps[appSessionId];
|
|
493
608
|
if (externalApp) {
|
|
494
|
-
return
|
|
495
|
-
getDoc: () => externalApp,
|
|
496
|
-
onWebSocketEvent: (fn) => () => {
|
|
497
|
-
},
|
|
498
|
-
resume: () => Promise.resolve(),
|
|
499
|
-
close: () => Promise.resolve()
|
|
500
|
-
};
|
|
609
|
+
return getExternalSession(externalApp, appSessionProps);
|
|
501
610
|
}
|
|
502
611
|
const sharedSession = getOrCreateSharedSession(appSessionProps);
|
|
503
612
|
const listeners = /* @__PURE__ */ new Set();
|