@qlik/api 1.17.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.
Files changed (80) hide show
  1. package/api-keys.d.ts +2 -2
  2. package/api-keys.js +2 -2
  3. package/apps.d.ts +4 -4
  4. package/apps.js +2 -2
  5. package/audits.d.ts +2 -2
  6. package/audits.js +2 -2
  7. package/{auth-types-BU5EGt_9.d.ts → auth-types-PkN9CAF_.d.ts} +3 -0
  8. package/auth.d.ts +2 -2
  9. package/auth.js +2 -2
  10. package/automations.d.ts +2 -2
  11. package/automations.js +2 -2
  12. package/brands.d.ts +2 -2
  13. package/brands.js +2 -2
  14. package/chunks/{RWQS4ASJ.js → 2B3EPESP.js} +1 -1
  15. package/chunks/{5W53XSXH.js → 2NXPFUPZ.js} +2 -2
  16. package/chunks/{6MPNTVLD.js → 4FZ45I6G.js} +1 -1
  17. package/chunks/{JBH4H34J.js → GKEPTI44.js} +1 -1
  18. package/chunks/{AVML2WPM.js → H7WWFWBM.js} +1 -1
  19. package/chunks/{S5OMX5JT.js → QLFOH4GP.js} +53 -4
  20. package/chunks/{NJFCE5EM.js → URFSYYRS.js} +1 -1
  21. package/chunks/{HFUVFYT4.js → YEHZGXQV.js} +72 -24
  22. package/chunks/{NJRTJEAQ.js → ZLPAS7FC.js} +3 -3
  23. package/collections.d.ts +18 -17
  24. package/collections.js +2 -2
  25. package/csp-origins.d.ts +2 -2
  26. package/csp-origins.js +2 -2
  27. package/data-assets.d.ts +2 -2
  28. package/data-assets.js +2 -2
  29. package/data-connections.d.ts +2 -2
  30. package/data-connections.js +2 -2
  31. package/data-credentials.d.ts +2 -2
  32. package/data-credentials.js +2 -2
  33. package/data-files.d.ts +2 -2
  34. package/data-files.js +2 -2
  35. package/extensions.d.ts +18 -18
  36. package/extensions.js +2 -2
  37. package/{global.types-BU2Yugjm.d.ts → global.types--37uwGji.d.ts} +1 -1
  38. package/glossaries.d.ts +2 -2
  39. package/glossaries.js +2 -2
  40. package/groups.d.ts +2 -2
  41. package/groups.js +2 -2
  42. package/identity-providers.d.ts +2 -2
  43. package/identity-providers.js +2 -2
  44. package/index.d.ts +2 -2
  45. package/index.js +4 -4
  46. package/items.d.ts +11 -11
  47. package/items.js +2 -2
  48. package/licenses.d.ts +2 -2
  49. package/licenses.js +2 -2
  50. package/package.json +2 -2
  51. package/qix.d.ts +7 -4
  52. package/qix.js +2 -2
  53. package/quotas.d.ts +2 -2
  54. package/quotas.js +2 -2
  55. package/reload-tasks.d.ts +2 -2
  56. package/reload-tasks.js +2 -2
  57. package/reloads.d.ts +2 -2
  58. package/reloads.js +2 -2
  59. package/reports.d.ts +2 -2
  60. package/reports.js +2 -2
  61. package/roles.d.ts +2 -2
  62. package/roles.js +2 -2
  63. package/spaces.d.ts +2 -2
  64. package/spaces.js +2 -2
  65. package/temp-contents.d.ts +2 -2
  66. package/temp-contents.js +2 -2
  67. package/tenants.d.ts +2 -2
  68. package/tenants.js +2 -2
  69. package/themes.d.ts +18 -18
  70. package/themes.js +2 -2
  71. package/transports.d.ts +2 -2
  72. package/transports.js +2 -2
  73. package/users.d.ts +2 -2
  74. package/users.js +2 -2
  75. package/web-integrations.d.ts +2 -2
  76. package/web-integrations.js +2 -2
  77. package/web-notifications.d.ts +2 -2
  78. package/web-notifications.js +2 -2
  79. package/webhooks.d.ts +2 -2
  80. package/webhooks.js +2 -2
package/api-keys.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
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. */
package/api-keys.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/5W53XSXH.js";
5
- import "./chunks/NJRTJEAQ.js";
4
+ } from "./chunks/2NXPFUPZ.js";
5
+ import "./chunks/ZLPAS7FC.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/api-keys.ts
package/apps.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions, D as DownloadableBlob } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
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 user api to fetch user metadata. */
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
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/5W53XSXH.js";
5
- import "./chunks/NJRTJEAQ.js";
4
+ } from "./chunks/2NXPFUPZ.js";
5
+ import "./chunks/ZLPAS7FC.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/apps.ts
package/audits.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
1
+ import { A as ApiCallOptions } from './global.types--37uwGji.js';
2
+ import './auth-types-PkN9CAF_.js';
3
3
 
4
4
  type ErrorResponse = {
5
5
  errors?: {
package/audits.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/5W53XSXH.js";
5
- import "./chunks/NJRTJEAQ.js";
4
+ } from "./chunks/2NXPFUPZ.js";
5
+ import "./chunks/ZLPAS7FC.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/audits.ts
@@ -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-BU5EGt_9.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-BU5EGt_9.js';
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
@@ -4,8 +4,8 @@ import {
4
4
  logout,
5
5
  registerAuthModule,
6
6
  setDefaultHostConfig
7
- } from "./chunks/AVML2WPM.js";
8
- import "./chunks/NJRTJEAQ.js";
7
+ } from "./chunks/H7WWFWBM.js";
8
+ import "./chunks/ZLPAS7FC.js";
9
9
  export {
10
10
  auth_default as default,
11
11
  getAccessToken,
package/automations.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
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
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/5W53XSXH.js";
5
- import "./chunks/NJRTJEAQ.js";
4
+ } from "./chunks/2NXPFUPZ.js";
5
+ import "./chunks/ZLPAS7FC.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/automations.ts
package/brands.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions, D as DownloadableBlob } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
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,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/5W53XSXH.js";
5
- import "./chunks/NJRTJEAQ.js";
4
+ } from "./chunks/2NXPFUPZ.js";
5
+ import "./chunks/ZLPAS7FC.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/brands.ts
@@ -18,7 +18,7 @@ import {
18
18
  toValidEnigmaLocationUrl,
19
19
  toValidLocationUrl,
20
20
  toValidWebsocketLocationUrl
21
- } from "./HFUVFYT4.js";
21
+ } from "./YEHZGXQV.js";
22
22
  import "./2ZQ3ZX7F.js";
23
23
  export {
24
24
  AuthorizationError,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getInvokeFetchRuntimeModule
3
- } from "./NJRTJEAQ.js";
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.17.0";
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;
@@ -4,7 +4,7 @@ import {
4
4
  getRestCallAuthParams,
5
5
  getWebSocketAuthParams,
6
6
  toValidWebsocketLocationUrl
7
- } from "./HFUVFYT4.js";
7
+ } from "./YEHZGXQV.js";
8
8
  import {
9
9
  isBrowser,
10
10
  isNode
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getQixRuntimeModule
3
- } from "./NJRTJEAQ.js";
3
+ } from "./ZLPAS7FC.js";
4
4
 
5
5
  // src/public/qix.ts
6
6
  function openAppSession(appSessionProps) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAuthRuntimeModule
3
- } from "./NJRTJEAQ.js";
3
+ } from "./ZLPAS7FC.js";
4
4
 
5
5
  // src/public/auth.ts
6
6
  function registerAuthModule(name, authModule) {
@@ -4,11 +4,55 @@ import {
4
4
  invokeFetch,
5
5
  isWindows,
6
6
  toValidWebsocketLocationUrl
7
- } from "./HFUVFYT4.js";
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("./6MPNTVLD.js");
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
- return Promise.reject(err);
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
  }
@@ -5,7 +5,7 @@ import {
5
5
  invokeFetch,
6
6
  invoke_fetch_default,
7
7
  parseFetchResponse
8
- } from "./HFUVFYT4.js";
8
+ } from "./YEHZGXQV.js";
9
9
  import "./2ZQ3ZX7F.js";
10
10
  export {
11
11
  EncodingError,
@@ -188,23 +188,33 @@ var InvalidAuthTypeError = class extends Error {
188
188
  this.name = "InvalidAuthTypeError";
189
189
  }
190
190
  };
191
+ function errorToString({ title, detail, code, status }) {
192
+ if (detail) {
193
+ return `${title} - ${detail} (Status: ${status}, Code: ${code})`;
194
+ }
195
+ return `${title} (Status: ${status}, Code: ${code})`;
196
+ }
191
197
  var AuthorizationError = class extends Error {
198
+ errors;
192
199
  constructor(errors) {
200
+ if (typeof errors !== "object") {
201
+ super("Unknown error");
202
+ return;
203
+ }
193
204
  const errorArray = Array.isArray(errors) ? errors : [errors];
194
- super(
195
- errorArray.map(
196
- (error) => `
197
- Code: ${error.code}
198
- Status: ${error.status}
199
- ${error.title}:
200
- ${error.detail}
201
- `
202
- ).join(",\n")
203
- );
205
+ super(errorArray.map(errorToString).join(", "));
206
+ this.errors = errorArray;
204
207
  }
205
208
  };
206
209
 
207
210
  // src/auth/auth-functions.ts
211
+ var lastErrorMessage = "";
212
+ function logToConsole({ message }) {
213
+ if (message !== lastErrorMessage) {
214
+ lastErrorMessage = message;
215
+ console.error(message);
216
+ }
217
+ }
208
218
  function isHostCrossOrigin(hostConfig) {
209
219
  if (!globalThis.location?.origin) {
210
220
  return true;
@@ -265,31 +275,57 @@ function toValidWebsocketLocationUrl(hostConfig) {
265
275
  }
266
276
  async function getWebSocketAuthParams(props) {
267
277
  const hostConfigToUse = withDefaultHostConfig(props.hostConfig);
268
- return (await getAuthModule(hostConfigToUse)).getWebSocketAuthParams({
269
- ...props,
270
- hostConfig: hostConfigToUse
271
- });
278
+ try {
279
+ const authModule = await getAuthModule(hostConfigToUse);
280
+ return await authModule.getWebSocketAuthParams({
281
+ ...props,
282
+ hostConfig: hostConfigToUse
283
+ });
284
+ } catch (err) {
285
+ (hostConfigToUse.onAuthFailed || logToConsole)(normalizeAuthModuleError(err));
286
+ throw err;
287
+ }
272
288
  }
273
289
  async function getWebResourceAuthParams(props) {
274
290
  const hostConfigToUse = withDefaultHostConfig(props.hostConfig);
275
- return (await getAuthModule(hostConfigToUse)).getWebResourceAuthParams?.({
276
- ...props,
277
- hostConfig: hostConfigToUse
278
- }) || { queryParams: {} };
291
+ try {
292
+ const authModule = await getAuthModule(hostConfigToUse);
293
+ return await authModule.getWebResourceAuthParams?.({
294
+ ...props,
295
+ hostConfig: hostConfigToUse
296
+ }) || { queryParams: {} };
297
+ } catch (err) {
298
+ (hostConfigToUse.onAuthFailed || logToConsole)(normalizeAuthModuleError(err));
299
+ throw err;
300
+ }
279
301
  }
280
302
  async function handleAuthenticationError(props) {
281
303
  const hostConfigToUse = withDefaultHostConfig(props.hostConfig);
282
- return (await getAuthModule(hostConfigToUse)).handleAuthenticationError({
304
+ const authModule = await getAuthModule(hostConfigToUse);
305
+ const result2 = await authModule.handleAuthenticationError({
283
306
  ...props,
284
307
  hostConfig: hostConfigToUse
285
308
  });
309
+ const willRetry = props.canRetry && result2.retry;
310
+ const willHangUntilANewPageIsLoaded = result2.preventDefault;
311
+ if (!willRetry && !willHangUntilANewPageIsLoaded) {
312
+ const { status, errorBody } = props;
313
+ (hostConfigToUse.onAuthFailed || logToConsole)(normalizeInbandAuthError({ status, errorBody }));
314
+ }
315
+ return result2;
286
316
  }
287
317
  async function getRestCallAuthParams(props) {
288
318
  const hostConfigToUse = withDefaultHostConfig(props.hostConfig);
289
- return (await getAuthModule(hostConfigToUse)).getRestCallAuthParams({
290
- ...props,
291
- hostConfig: hostConfigToUse
292
- });
319
+ try {
320
+ const authModule = await getAuthModule(hostConfigToUse);
321
+ return await authModule.getRestCallAuthParams({
322
+ ...props,
323
+ hostConfig: hostConfigToUse
324
+ });
325
+ } catch (err) {
326
+ (hostConfigToUse.onAuthFailed || logToConsole)(normalizeAuthModuleError(err));
327
+ throw err;
328
+ }
293
329
  }
294
330
  async function getAccessToken(props) {
295
331
  const res = await getRestCallAuthParams({ method: "GET", ...props });
@@ -321,6 +357,17 @@ var logout = () => {
321
357
  globalThis.location.href = "/logout";
322
358
  };
323
359
  var leadingHttp = /^http/;
360
+ function normalizeInbandAuthError({ errorBody, status }) {
361
+ const authError = errorBody;
362
+ if (typeof authError?.errors === "object") {
363
+ const err = new AuthorizationError(authError?.errors);
364
+ return { message: err.message };
365
+ }
366
+ return { message: `HTTP ${status}` };
367
+ }
368
+ function normalizeAuthModuleError(err) {
369
+ return { message: err.message || "Unknown error" };
370
+ }
324
371
 
325
372
  // src/random/random.ts
326
373
  import { customAlphabet, nanoid } from "nanoid";
@@ -359,6 +406,7 @@ function internalValidateHostConfig(hostConfig, options) {
359
406
  "authRedirectUserConfirmation",
360
407
  "embedRuntimeUrl",
361
408
  "host",
409
+ "onAuthFailed",
362
410
  ...options.requiredProps,
363
411
  ...options.optionalProps
364
412
  ];
@@ -652,7 +700,7 @@ async function getOauthTokensWithRefreshToken(baseUrl, refreshToken, clientSecre
652
700
  };
653
701
  }
654
702
  async function getAnonymousOauthAccessToken(baseUrl, accessCode, clientId, trackingCode) {
655
- const result2 = await fetch(`${baseUrl}/oauth/token`, {
703
+ const result2 = await fetch(`${baseUrl}/oauth/token/anonymous-embed`, {
656
704
  method: "POST",
657
705
  mode: "cors",
658
706
  headers: { "content-type": "application/json" },
@@ -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("./RWQS4ASJ.js") : import("./GLS4DAZ4.js").then(
4
+ return isNode ? import("./2B3EPESP.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("./S5OMX5JT.js") : import("./GLS4DAZ4.js").then(
11
+ return isNode ? import("./QLFOH4GP.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("./NJFCE5EM.js") : import("./GLS4DAZ4.js").then(
18
+ return isNode ? import("./URFSYYRS.js") : import("./GLS4DAZ4.js").then(
19
19
  (mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig)
20
20
  );
21
21
  }
package/collections.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
1
+ import { A as ApiCallOptions } from './global.types--37uwGji.js';
2
+ import './auth-types-PkN9CAF_.js';
3
3
 
4
4
  type CollectionByIdPatch = {
5
5
  /** The operation to be performed. */
@@ -19,6 +19,7 @@ type CollectionsAddCollectionItemRequestBody = {
19
19
  };
20
20
  type CollectionsCreateCollectionRequestBody = {
21
21
  description?: string;
22
+ /** For `public` collections (tags), if name already exists in the tenant as a `public` collection, this call will fail with a `409` response. */
22
23
  name: string;
23
24
  type: CollectionTypes;
24
25
  };
@@ -233,7 +234,7 @@ type Meta = {
233
234
  timeout?: boolean;
234
235
  };
235
236
  /**
236
- * Finds and returns the collections that the user can access. This endpoint does not return the user's favorites collection.
237
+ * Retrieves the collections that the user has access to. This endpoint does not return the user's favorites collection, which can be retrieved with `/v1/collections/favorites`.
237
238
  *
238
239
  * @param query an object with query parameters
239
240
  * @throws GetCollectionsHttpError
@@ -261,7 +262,7 @@ declare const getCollections: (query: {
261
262
  * must be prefixed by + or - to indicate ascending or descending sort order
262
263
  * respectively. */
263
264
  sort?: "+createdAt" | "-createdAt" | "+name" | "-name" | "+updatedAt" | "-updatedAt";
264
- /** The case-sensitive string used to filter for a collection by type. */
265
+ /** The case-sensitive string used to filter for a collection by type. Retrieve private collections with `private`, public collections with `publicgoverned`, and tags with `public`. */
265
266
  type?: CollectionTypes;
266
267
  /** A commaseparated case-sensitive string used to filter by multiple types. */
267
268
  types?: CollectionTypes[];
@@ -279,7 +280,7 @@ type GetCollectionsHttpError = {
279
280
  status: number;
280
281
  };
281
282
  /**
282
- * Creates and returns a new collection. Collections can have the same name.
283
+ * Creates and returns a new collection. Collections of type `public` (shown as tags in the user interface) must have unique names. Other collection types can reuse names.
283
284
  *
284
285
  * @param body an object with the body content
285
286
  * @throws CreateCollectionHttpError
@@ -296,7 +297,7 @@ type CreateCollectionHttpError = {
296
297
  status: number;
297
298
  };
298
299
  /**
299
- * Finds and returns the user's favorites collection.
300
+ * Lists the user's favorites collection.
300
301
  *
301
302
  * @throws GetFavoritesCollectionHttpError
302
303
  */
@@ -346,7 +347,7 @@ type GetCollectionHttpError = {
346
347
  status: number;
347
348
  };
348
349
  /**
349
- * Updates the collection fields provided in the patch body.
350
+ * Updates the name, description, or type fields provided in the patch body. Can be used to publish a `private` collection as a `publicgoverned` collection by patching `/type` with `publicgoverned` once the collection contains at least 1 item. Can also be used to return a `publicgoverned` collection to `private`. Cannot be used to change between `public` (tag) and `private / publicgoverned` (collection).
350
351
  *
351
352
  * @param collectionId The collection's unique identifier.
352
353
  * @param body an object with the body content
@@ -364,7 +365,7 @@ type PatchCollectionHttpError = {
364
365
  status: number;
365
366
  };
366
367
  /**
367
- * Updates a collection and returns the new collection. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value.
368
+ * Updates a collection's name and description and returns the updated collection. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value.
368
369
  *
369
370
  * @param collectionId The collection's unique identifier.
370
371
  * @param body an object with the body content
@@ -382,7 +383,7 @@ type UpdateCollectionHttpError = {
382
383
  status: number;
383
384
  };
384
385
  /**
385
- * Finds and returns items from a collection that the user has access to.
386
+ * Retrieves items from a collection that the user has access to.
386
387
  *
387
388
  * @param collectionId The collection's unique identifier. (This query also supports 'favorites' as the collectionID).
388
389
 
@@ -463,7 +464,7 @@ type DeleteCollectionItemHttpError = {
463
464
  status: number;
464
465
  };
465
466
  /**
466
- * Finds and returns an item. See GET /items/{id}
467
+ * Finds and returns an item in a specific collection. See GET `/items/{id}`.
467
468
  *
468
469
  * @param collectionId The collection's unique identifier.
469
470
  * @param itemId The item's unique identifier.
@@ -486,21 +487,21 @@ type GetCollectionItemHttpError = {
486
487
  declare function clearCache(): void;
487
488
  interface CollectionsAPI {
488
489
  /**
489
- * Finds and returns the collections that the user can access. This endpoint does not return the user's favorites collection.
490
+ * Retrieves the collections that the user has access to. This endpoint does not return the user's favorites collection, which can be retrieved with `/v1/collections/favorites`.
490
491
  *
491
492
  * @param query an object with query parameters
492
493
  * @throws GetCollectionsHttpError
493
494
  */
494
495
  getCollections: typeof getCollections;
495
496
  /**
496
- * Creates and returns a new collection. Collections can have the same name.
497
+ * Creates and returns a new collection. Collections of type `public` (shown as tags in the user interface) must have unique names. Other collection types can reuse names.
497
498
  *
498
499
  * @param body an object with the body content
499
500
  * @throws CreateCollectionHttpError
500
501
  */
501
502
  createCollection: typeof createCollection;
502
503
  /**
503
- * Finds and returns the user's favorites collection.
504
+ * Lists the user's favorites collection.
504
505
  *
505
506
  * @throws GetFavoritesCollectionHttpError
506
507
  */
@@ -520,7 +521,7 @@ interface CollectionsAPI {
520
521
  */
521
522
  getCollection: typeof getCollection;
522
523
  /**
523
- * Updates the collection fields provided in the patch body.
524
+ * Updates the name, description, or type fields provided in the patch body. Can be used to publish a `private` collection as a `publicgoverned` collection by patching `/type` with `publicgoverned` once the collection contains at least 1 item. Can also be used to return a `publicgoverned` collection to `private`. Cannot be used to change between `public` (tag) and `private / publicgoverned` (collection).
524
525
  *
525
526
  * @param collectionId The collection's unique identifier.
526
527
  * @param body an object with the body content
@@ -528,7 +529,7 @@ interface CollectionsAPI {
528
529
  */
529
530
  patchCollection: typeof patchCollection;
530
531
  /**
531
- * Updates a collection and returns the new collection. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value.
532
+ * Updates a collection's name and description and returns the updated collection. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value.
532
533
  *
533
534
  * @param collectionId The collection's unique identifier.
534
535
  * @param body an object with the body content
@@ -536,7 +537,7 @@ interface CollectionsAPI {
536
537
  */
537
538
  updateCollection: typeof updateCollection;
538
539
  /**
539
- * Finds and returns items from a collection that the user has access to.
540
+ * Retrieves items from a collection that the user has access to.
540
541
  *
541
542
  * @param collectionId The collection's unique identifier. (This query also supports 'favorites' as the collectionID).
542
543
 
@@ -561,7 +562,7 @@ interface CollectionsAPI {
561
562
  */
562
563
  deleteCollectionItem: typeof deleteCollectionItem;
563
564
  /**
564
- * Finds and returns an item. See GET /items/{id}
565
+ * Finds and returns an item in a specific collection. See GET `/items/{id}`.
565
566
  *
566
567
  * @param collectionId The collection's unique identifier.
567
568
  * @param itemId The item's unique identifier.
package/collections.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/5W53XSXH.js";
5
- import "./chunks/NJRTJEAQ.js";
4
+ } from "./chunks/2NXPFUPZ.js";
5
+ import "./chunks/ZLPAS7FC.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/collections.ts
package/csp-origins.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiCallOptions } from './global.types-BU2Yugjm.js';
2
- import './auth-types-BU5EGt_9.js';
1
+ import { A as ApiCallOptions } from './global.types--37uwGji.js';
2
+ import './auth-types-PkN9CAF_.js';
3
3
 
4
4
  type CSPEntry = {
5
5
  /** The CSP entry's unique identifier. */