@qlik/api 1.19.0 → 1.20.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 (54) hide show
  1. package/api-keys.js +2 -2
  2. package/apps.js +2 -2
  3. package/audits.js +2 -2
  4. package/auth.d.ts +24 -1
  5. package/auth.js +2 -2
  6. package/automations.js +2 -2
  7. package/brands.js +2 -2
  8. package/chunks/{GLS4DAZ4.js → 4VH5O5UL.js} +1 -1
  9. package/chunks/{ILZFMC3L.js → 4XKAFB25.js} +19 -3
  10. package/chunks/{AKBUFQRX.js → DT5F6REC.js} +1 -1
  11. package/chunks/{VISO65GO.js → IMLCMV4X.js} +3 -3
  12. package/chunks/{J6G5ZOKI.js → MP5FOM4F.js} +1 -1
  13. package/chunks/{KKAWWYOT.js → MX5NVZPW.js} +11 -2
  14. package/chunks/{63L3IUY2.js → OQWY73NC.js} +29 -5
  15. package/chunks/{BOJLTXK6.js → T6AQ34ZJ.js} +2 -2
  16. package/chunks/{64RJJHEL.js → TEGSUED7.js} +3 -1
  17. package/chunks/{P5AG7AME.js → Z37XXMYQ.js} +1 -1
  18. package/collections.js +2 -2
  19. package/csp-origins.js +2 -2
  20. package/data-assets.js +2 -2
  21. package/data-connections.js +2 -2
  22. package/data-credentials.js +2 -2
  23. package/data-files.js +2 -2
  24. package/docs/authentication.md +30 -1
  25. package/extensions.js +2 -2
  26. package/glossaries.js +2 -2
  27. package/groups.d.ts +16 -4
  28. package/groups.js +2 -2
  29. package/identity-providers.js +2 -2
  30. package/index.d.ts +47 -40
  31. package/index.js +189 -84
  32. package/items.js +2 -2
  33. package/licenses.d.ts +1 -1
  34. package/licenses.js +2 -2
  35. package/package.json +2 -2
  36. package/qix.d.ts +19 -8
  37. package/qix.js +6 -4
  38. package/quotas.js +2 -2
  39. package/reload-tasks.js +2 -2
  40. package/reloads.d.ts +1 -1
  41. package/reloads.js +2 -2
  42. package/reports.d.ts +2 -0
  43. package/reports.js +2 -2
  44. package/roles.js +2 -2
  45. package/spaces.js +2 -2
  46. package/temp-contents.js +2 -2
  47. package/tenants.js +2 -2
  48. package/themes.js +2 -2
  49. package/transports.js +2 -2
  50. package/users.d.ts +2 -0
  51. package/users.js +2 -2
  52. package/web-integrations.js +2 -2
  53. package/web-notifications.js +2 -2
  54. package/webhooks.js +2 -2
package/api-keys.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/api-keys.ts
package/apps.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/apps.ts
package/audits.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/audits.ts
package/auth.d.ts CHANGED
@@ -18,13 +18,36 @@ declare function logout(): void;
18
18
  * @param hostConfig the default HostConfig to use
19
19
  */
20
20
  declare function setDefaultHostConfig(hostConfig: HostConfig | undefined): void;
21
+ /**
22
+ * Returns an access token using the supplied host config. Typically used on the backend to supply the access token to the frontend
23
+ */
21
24
  declare function getAccessToken({ hostConfig }: {
22
25
  hostConfig?: HostConfig;
23
26
  }): Promise<string>;
27
+ /**
28
+ * The AuthApi interface provides the public interface for the auth module.
29
+ */
30
+ interface AuthAPI {
31
+ /**
32
+ * 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.
33
+ * @param name the name of the module
34
+ * @param authModule the implementation of the AuthModule interface
35
+ */
36
+ registerAuthModule: typeof registerAuthModule;
37
+ /**
38
+ * Sets the default host config that will be used for all qmfe api calls that do not include a host config
39
+ * @param hostConfig the default HostConfig to use
40
+ */
41
+ setDefaultHostConfig: typeof setDefaultHostConfig;
42
+ /**
43
+ * Returns an access token using the supplied host config. Typically used on the backend to supply the access token to the frontend
44
+ */
45
+ getAccessToken: typeof getAccessToken;
46
+ }
24
47
  declare const _default: {
25
48
  registerAuthModule: typeof registerAuthModule;
26
49
  setDefaultHostConfig: typeof setDefaultHostConfig;
27
50
  getAccessToken: typeof getAccessToken;
28
51
  };
29
52
 
30
- export { AuthModule, AuthType, HostConfig, _default as default, getAccessToken, logout, registerAuthModule, setDefaultHostConfig };
53
+ export { type AuthAPI, AuthModule, AuthType, HostConfig, _default as default, getAccessToken, logout, registerAuthModule, setDefaultHostConfig };
package/auth.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  logout,
5
5
  registerAuthModule,
6
6
  setDefaultHostConfig
7
- } from "./chunks/J6G5ZOKI.js";
8
- import "./chunks/VISO65GO.js";
7
+ } from "./chunks/MP5FOM4F.js";
8
+ import "./chunks/IMLCMV4X.js";
9
9
  export {
10
10
  auth_default as default,
11
11
  getAccessToken,
package/automations.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/automations.ts
package/brands.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/brands.ts
@@ -1,4 +1,4 @@
1
- // node_modules/.pnpm/@qlik+runtime-module-loader@1.0.10/node_modules/@qlik/runtime-module-loader/dist/index.js
1
+ // node_modules/.pnpm/@qlik+runtime-module-loader@1.0.11/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,7 +4,7 @@ import {
4
4
  invokeFetch,
5
5
  isWindows,
6
6
  toValidWebsocketLocationUrl
7
- } from "./63L3IUY2.js";
7
+ } from "./OQWY73NC.js";
8
8
  import {
9
9
  isBrowser
10
10
  } from "./2ZQ3ZX7F.js";
@@ -145,7 +145,7 @@ function listenForWindowsAuthenticationInformation(session) {
145
145
  return authSuggestedInWebsocket;
146
146
  }
147
147
  async function createAndSetupEnigmaSession(props, canRetry) {
148
- const { createEnigmaSession } = await import("./P5AG7AME.js");
148
+ const { createEnigmaSession } = await import("./Z37XXMYQ.js");
149
149
  const session = await createEnigmaSession(props);
150
150
  setupSessionListeners(session, props);
151
151
  let global;
@@ -684,7 +684,23 @@ var qix = {
684
684
  onWebSocketEvent,
685
685
  onCombinedWebSocketStateChange,
686
686
  resumeSuspendedSessions,
687
- resumeOnlyOnReattach
687
+ resumeOnlyOnReattach,
688
+ withHostConfig: (hostConfig) => ({
689
+ addInitialAppAction: (openAppSessionProps, action) => addInitialAppAction(
690
+ typeof openAppSessionProps === "string" ? { hostConfig, appId: openAppSessionProps } : { hostConfig, ...openAppSessionProps },
691
+ action
692
+ ),
693
+ createSessionApp,
694
+ openAppSession: (openAppSessionProps) => openAppSession(
695
+ typeof openAppSessionProps === "string" ? { hostConfig, appId: openAppSessionProps } : { hostConfig, ...openAppSessionProps }
696
+ ),
697
+ registerExternalAppSession,
698
+ useAppHook,
699
+ onWebSocketEvent,
700
+ onCombinedWebSocketStateChange,
701
+ resumeSuspendedSessions,
702
+ resumeOnlyOnReattach
703
+ })
688
704
  };
689
705
  var qix_default = qix;
690
706
  export {
@@ -5,7 +5,7 @@ import {
5
5
  invokeFetch,
6
6
  invoke_fetch_default,
7
7
  parseFetchResponse
8
- } from "./63L3IUY2.js";
8
+ } from "./OQWY73NC.js";
9
9
  import "./2ZQ3ZX7F.js";
10
10
  export {
11
11
  EncodingError,
@@ -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("./64RJJHEL.js") : import("./GLS4DAZ4.js").then(
4
+ return isNode ? import("./TEGSUED7.js") : import("./4VH5O5UL.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("./ILZFMC3L.js") : import("./GLS4DAZ4.js").then(
11
+ return isNode ? import("./4XKAFB25.js") : import("./4VH5O5UL.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("./AKBUFQRX.js") : import("./GLS4DAZ4.js").then(
18
+ return isNode ? import("./DT5F6REC.js") : import("./4VH5O5UL.js").then(
19
19
  (mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig)
20
20
  );
21
21
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAuthRuntimeModule
3
- } from "./VISO65GO.js";
3
+ } from "./IMLCMV4X.js";
4
4
 
5
5
  // src/public/auth.ts
6
6
  function registerAuthModule(name, authModule) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getQixRuntimeModule
3
- } from "./VISO65GO.js";
3
+ } from "./IMLCMV4X.js";
4
4
 
5
5
  // src/public/qix.ts
6
6
  function openAppSession(appSessionProps) {
@@ -47,12 +47,21 @@ function openAppSession(appSessionProps) {
47
47
  };
48
48
  return appSessionProxy;
49
49
  }
50
+ function withHostConfig(hostConfig) {
51
+ return {
52
+ openAppSession: (openAppSessionProps) => openAppSession(
53
+ typeof openAppSessionProps === "string" ? { hostConfig, appId: openAppSessionProps } : { hostConfig, ...openAppSessionProps }
54
+ )
55
+ };
56
+ }
50
57
  var qix = {
51
- openAppSession
58
+ openAppSession,
59
+ withHostConfig
52
60
  };
53
61
  var qix_default = qix;
54
62
 
55
63
  export {
56
64
  openAppSession,
65
+ withHostConfig,
57
66
  qix_default
58
67
  };
@@ -341,6 +341,10 @@ function registerAuthModule2(name, authModule) {
341
341
  function setDefaultHostConfig2(hostConfig) {
342
342
  setDefaultHostConfig(hostConfig);
343
343
  }
344
+ function serializeHostConfig(hostConfig) {
345
+ const hostConfigToUse = withDefaultHostConfig(hostConfig);
346
+ return JSON.stringify(hostConfigToUse, hostConfigPropertyIgnorer);
347
+ }
344
348
  function checkForCrossDomainRequest(hostConfig) {
345
349
  const hostConfigToUse = withDefaultHostConfig(hostConfig);
346
350
  if (isHostCrossOrigin(hostConfigToUse)) {
@@ -368,6 +372,19 @@ function normalizeInbandAuthError({ errorBody, status }) {
368
372
  function normalizeAuthModuleError(err) {
369
373
  return { message: err.message || "Unknown error" };
370
374
  }
375
+ function hostConfigPropertyIgnorer(key, value) {
376
+ if (key === "") {
377
+ return value;
378
+ }
379
+ if (key === "authType") {
380
+ return void 0;
381
+ }
382
+ const vtype = typeof value;
383
+ if (vtype === "object" || vtype === "function") {
384
+ return void 0;
385
+ }
386
+ return value;
387
+ }
371
388
 
372
389
  // src/random/random.ts
373
390
  import { customAlphabet, nanoid } from "nanoid";
@@ -1398,7 +1415,7 @@ function applyPathVariables(pathTemplate, pathVariables) {
1398
1415
  }
1399
1416
  return result2;
1400
1417
  }
1401
- function toCacheKey(url, query, headers) {
1418
+ function toCacheKey(url, query, serializedHostConfig, headers) {
1402
1419
  let cacheKey = url;
1403
1420
  if (query !== "") {
1404
1421
  cacheKey = cacheKey.concat(`?${query}`);
@@ -1406,6 +1423,9 @@ function toCacheKey(url, query, headers) {
1406
1423
  if (headers) {
1407
1424
  cacheKey = cacheKey.concat(`+headers=${JSON.stringify(headers)}`);
1408
1425
  }
1426
+ if (serializedHostConfig) {
1427
+ cacheKey = cacheKey.concat(`+host-config=${serializedHostConfig}`);
1428
+ }
1409
1429
  return cacheKey;
1410
1430
  }
1411
1431
  function toCompleteUrl(url, query) {
@@ -1675,7 +1695,7 @@ async function getInvokeFetchUrlParams({
1675
1695
  const url = locationUrl + applyPathVariables(pathTemplate, pathVariables);
1676
1696
  const queryString = encodeQueryParams({ ...query, ...authQueryParams });
1677
1697
  const completeUrl = toCompleteUrl(url, queryString);
1678
- const cacheKey = toCacheKey(url, queryString, options?.headers);
1698
+ const cacheKey = toCacheKey(url, queryString, serializeHostConfig(options?.hostConfig), options?.headers);
1679
1699
  return { completeUrl, cacheKey, authHeaders, credentials };
1680
1700
  }
1681
1701
  function invokeFetchWithUrl(api, props, interceptors) {
@@ -1762,6 +1782,7 @@ function invokeFetchWithUrlAndRetry(api, {
1762
1782
  return cloneResultPromise(resultPromiseAfterCacheClearing);
1763
1783
  }
1764
1784
  function addPagingFunctions(api, value, method, body, options, interceptors, authHeaders, credentials) {
1785
+ const serializedHostConfig = serializeHostConfig(options?.hostConfig);
1765
1786
  return value.then((resp) => {
1766
1787
  const dataWithPotentialLinks = resp.data;
1767
1788
  if (!dataWithPotentialLinks) {
@@ -1777,7 +1798,7 @@ function addPagingFunctions(api, value, method, body, options, interceptors, aut
1777
1798
  completeUrl: prevUrl,
1778
1799
  body,
1779
1800
  options: prevOptions || options,
1780
- cacheKey: toCacheKey(prevUrl, "", options?.headers),
1801
+ cacheKey: toCacheKey(prevUrl, "", serializedHostConfig, options?.headers),
1781
1802
  authHeaders,
1782
1803
  credentials
1783
1804
  },
@@ -1792,7 +1813,7 @@ function addPagingFunctions(api, value, method, body, options, interceptors, aut
1792
1813
  completeUrl: nextUrl,
1793
1814
  body,
1794
1815
  options: nextOptions || options,
1795
- cacheKey: toCacheKey(nextUrl, "", options?.headers),
1816
+ cacheKey: toCacheKey(nextUrl, "", serializedHostConfig, options?.headers),
1796
1817
  authHeaders,
1797
1818
  credentials
1798
1819
  },
@@ -1862,7 +1883,9 @@ async function download(blob, filename) {
1862
1883
  window.URL.revokeObjectURL(blobUrl);
1863
1884
  } else {
1864
1885
  const { writeFileSync } = await import("fs");
1865
- writeFileSync(filename, Buffer.from(await blob.arrayBuffer()));
1886
+ const arrayBuffer = await blob.arrayBuffer();
1887
+ const uint8Array = new Uint8Array(arrayBuffer);
1888
+ writeFileSync(filename, uint8Array);
1866
1889
  }
1867
1890
  }
1868
1891
 
@@ -2012,6 +2035,7 @@ export {
2012
2035
  getAccessToken,
2013
2036
  registerAuthModule2 as registerAuthModule,
2014
2037
  setDefaultHostConfig2 as setDefaultHostConfig,
2038
+ serializeHostConfig,
2015
2039
  checkForCrossDomainRequest,
2016
2040
  logout,
2017
2041
  generateRandomString,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getInvokeFetchRuntimeModule
3
- } from "./VISO65GO.js";
3
+ } from "./IMLCMV4X.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.19.0";
9
+ var defaultUserAgent = "qlik-api/1.20.0";
10
10
  async function invokeFetch(api, props) {
11
11
  const hostConfig = props.options?.hostConfig;
12
12
  let userAgent;
@@ -14,11 +14,12 @@ import {
14
14
  isWindows,
15
15
  logout,
16
16
  registerAuthModule,
17
+ serializeHostConfig,
17
18
  setDefaultHostConfig,
18
19
  toValidEnigmaLocationUrl,
19
20
  toValidLocationUrl,
20
21
  toValidWebsocketLocationUrl
21
- } from "./63L3IUY2.js";
22
+ } from "./OQWY73NC.js";
22
23
  import "./2ZQ3ZX7F.js";
23
24
  export {
24
25
  AuthorizationError,
@@ -36,6 +37,7 @@ export {
36
37
  isWindows,
37
38
  logout,
38
39
  registerAuthModule,
40
+ serializeHostConfig,
39
41
  setDefaultHostConfig,
40
42
  toValidEnigmaLocationUrl,
41
43
  toValidLocationUrl,
@@ -4,7 +4,7 @@ import {
4
4
  getRestCallAuthParams,
5
5
  getWebSocketAuthParams,
6
6
  toValidWebsocketLocationUrl
7
- } from "./63L3IUY2.js";
7
+ } from "./OQWY73NC.js";
8
8
  import {
9
9
  isBrowser,
10
10
  isNode
package/collections.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/collections.ts
package/csp-origins.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/csp-origins.ts
package/data-assets.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/data-assets.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/data-connections.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/data-credentials.ts
package/data-files.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/data-files.ts
@@ -27,7 +27,7 @@ const { data: mySpaces } = spaces.getSpaces();
27
27
  console.log(mySpaces);
28
28
  ```
29
29
 
30
- A host config can also be passed in to every single api request which then will override any default host config previously set.
30
+ A host config can also be passed in to every single api request which then will override any default host config previously set. This way multiple host configs can be used if needed.
31
31
 
32
32
  ```ts
33
33
  import spaces from "@qlik/api/spaces";
@@ -45,6 +45,35 @@ const { data: mySpaces } = spaces.getSpaces({}, {
45
45
  console.log(mySpaces);
46
46
  ```
47
47
 
48
+ ### Binding an instance of `@qlik/api` to a specific host config
49
+
50
+ As an alternative to the methods above it is also possible to create an instance of `@qlik/api` bound to a specific host config. This allows users to use several host configs in their solutions and easily separate them by having seperate `@qlik/api` instances.
51
+
52
+ Example:
53
+
54
+ ```ts
55
+ import { createQlikApi } from "@qlik-trial/qmfe-api";
56
+
57
+ const api = createQlikApi({
58
+ authType: "apikey"
59
+ host: "my-org.region.qlikcloud.com", // a qlikcloud tenant
60
+ apiKey: "<api-key>",
61
+ });
62
+
63
+ // "api" now has the full @qlik/api bound to one specific hostconfig
64
+ const { data: mySpaces } = api.spaces.getSpaces();
65
+
66
+ // create another api with a different auth mechanism
67
+ const apiToOtherTenant = createQlikApi({
68
+ authType: "oauth2"
69
+ host: "my-other-tenant.region.qlikcloud.com", // a qlikcloud tenant
70
+ clientId: "<client-id>",
71
+ });
72
+
73
+ // "apiToOtherTenant" is now bound to another hostconfig
74
+ const { data: myOtherSpaces } = apiToOtherTenant.spaces.getSpaces();
75
+ ```
76
+
48
77
  ## The Auth Module
49
78
 
50
79
  An auth module in `@qlik/api` is an object with a few implemented methods. When connecting to Qlik Cloud Services (or Qlik Sense Enterprise for Windows) with `@qlik/api` or with `@qlik/embed` libraries an auth module is used for configuring the communication.
package/extensions.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/extensions.ts
package/glossaries.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/glossaries.ts
package/groups.d.ts CHANGED
@@ -74,6 +74,10 @@ type Group = {
74
74
  assignedRoles?: AssignedRoles;
75
75
  /** The timestamp for when the group record was created. */
76
76
  createdAt: string;
77
+ /** Id of user that created role. */
78
+ readonly createdBy?: string;
79
+ /** A description of a custom group. */
80
+ description?: string;
77
81
  /** The unique identifier for the group */
78
82
  readonly id: string;
79
83
  /** The timestamp for when the group record was last updated. */
@@ -87,10 +91,14 @@ type Group = {
87
91
  };
88
92
  /** The name of the group. */
89
93
  name: string;
94
+ /** The type of provider for the group. */
95
+ providerType?: "idp" | "custom";
90
96
  /** The state of the group. */
91
97
  status: "active" | "disabled";
92
98
  /** The tenant identifier associated with the given group */
93
99
  tenantId: string;
100
+ /** Id of user that last updated this role. */
101
+ readonly updatedBy?: string;
94
102
  };
95
103
  /**
96
104
  * A JSON Patch document.
@@ -98,8 +106,8 @@ type Group = {
98
106
  type GroupPatch = {
99
107
  /** The operation to be performed. Currently "replace" is the only supported operation. */
100
108
  op: "replace";
101
- /** Attribute name of a field of the Groups entity. */
102
- path: "assignedRoles";
109
+ /** Attribute name of a field of the Groups entity. "Name" and "description" is only available for custom groups. */
110
+ path: "assignedRoles" | "name" | "description";
103
111
  /** The roles to assign to the group (limit of 100 roles per group). */
104
112
  value: AssignedRolesRefIDs | AssignedRolesRefNames;
105
113
  };
@@ -110,8 +118,12 @@ type GroupPatchSchema = GroupPatch[];
110
118
  type GroupPostSchema = {
111
119
  /** The roles to assign to the group (limit of 100 roles per group). */
112
120
  assignedRoles?: AssignedRolesRefIDs | AssignedRolesRefNames;
121
+ /** The description of the group. */
122
+ description?: string;
113
123
  /** The name of the group (maximum length of 256 characters). */
114
124
  name: string;
125
+ /** The type of group provider. Must be "idp" or "custom". Defaults to "idp" if not provided. */
126
+ providerType?: "idp" | "custom";
115
127
  /** The status of the created group within the tenant. Defaults to active if empty. */
116
128
  status?: "active";
117
129
  };
@@ -222,7 +234,7 @@ type GetGroupsHttpError = {
222
234
  status: number;
223
235
  };
224
236
  /**
225
- * Creates a group. The maximum number of groups a tenant can have is 10,000.
237
+ * Creates a new group. The maximum number of groups a tenant can have is 10,000. Group names are case-sensitive, and must be unique.
226
238
  *
227
239
  * @param body an object with the body content
228
240
  * @throws CreateGroupHttpError
@@ -365,7 +377,7 @@ interface GroupsAPI {
365
377
  */
366
378
  getGroups: typeof getGroups;
367
379
  /**
368
- * Creates a group. The maximum number of groups a tenant can have is 10,000.
380
+ * Creates a new group. The maximum number of groups a tenant can have is 10,000. Group names are case-sensitive, and must be unique.
369
381
  *
370
382
  * @param body an object with the body content
371
383
  * @throws CreateGroupHttpError
package/groups.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/groups.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  clearApiCache,
3
3
  invokeFetch
4
- } from "./chunks/BOJLTXK6.js";
5
- import "./chunks/VISO65GO.js";
4
+ } from "./chunks/T6AQ34ZJ.js";
5
+ import "./chunks/IMLCMV4X.js";
6
6
  import "./chunks/2ZQ3ZX7F.js";
7
7
 
8
8
  // src/public/rest/identity-providers.ts