From f05d5c0e3f5e37fc0bc48675630a589401a175bf Mon Sep 17 00:00:00 2001 From: qlikossbuild Date: Thu, 24 Oct 2024 08:38:37 +0000 Subject: [PATCH] feat: qlik api updates --- api-keys.d.ts | 2 +- api-keys.js | 4 +- apps.d.ts | 2 +- apps.js | 4 +- audits.d.ts | 2 +- audits.js | 4 +- auth.js | 4 +- automations.d.ts | 2 +- automations.js | 4 +- brands.d.ts | 2 +- brands.js | 4 +- chunks/{SMQGR3VM.js => 74U42PVO.js} | 2 +- chunks/{VXEOAWM6.js => 7MLP3MPP.js} | 2 +- chunks/7RHSSS4W.js | 0 chunks/{UJV2QU2J.js => ANSUDXLV.js} | 6 +- chunks/{E5TLRYTH.js => CXVDSJOD.js} | 4 +- chunks/{3KD5W26Z.js => DZO6ZOEA.js} | 6 +- chunks/{3REGOC54.js => MGUYVMAA.js} | 4 +- chunks/{OCV75U5H.js => OLOELRZ4.js} | 116 ++++++------- chunks/TJWN2R6D.js | 116 +++++++++++++ chunks/{CUC5USM5.js => UF2IPOJY.js} | 4 +- chunks/{EUWNVVK5.js => VX3MQBE7.js} | 2 +- chunks/{3W4PFUMC.js => WHOTOW4Z.js} | 2 +- collections.d.ts | 2 +- collections.js | 4 +- csp-origins.d.ts | 2 +- csp-origins.js | 4 +- data-assets.d.ts | 2 +- data-assets.js | 4 +- data-connections.d.ts | 2 +- data-connections.js | 4 +- data-credentials.d.ts | 2 +- data-credentials.js | 4 +- data-files.d.ts | 2 +- data-files.js | 4 +- docs/rest.md | 47 +++++ extensions.d.ts | 2 +- extensions.js | 4 +- glossaries.d.ts | 2 +- glossaries.js | 4 +- groups.d.ts | 2 +- groups.js | 4 +- identity-providers.d.ts | 2 +- identity-providers.js | 4 +- index.d.ts | 15 +- index.js | 160 +++++++++--------- interceptors.d.ts | 51 ++++++ interceptors.js | 17 ++ ...J.d.ts => invoke-fetch-types-BmgCFrhK.d.ts | 124 ++++++++------ items.d.ts | 2 +- items.js | 4 +- licenses.d.ts | 2 +- licenses.js | 4 +- qix.d.ts | 2 +- qix.js | 4 +- quotas.d.ts | 2 +- quotas.js | 4 +- reload-tasks.d.ts | 2 +- reload-tasks.js | 4 +- reloads.d.ts | 2 +- reloads.js | 4 +- reports.d.ts | 2 +- reports.js | 4 +- roles.d.ts | 2 +- roles.js | 4 +- spaces.d.ts | 2 +- spaces.js | 4 +- temp-contents.d.ts | 2 +- temp-contents.js | 4 +- tenants.d.ts | 2 +- tenants.js | 4 +- themes.d.ts | 2 +- themes.js | 4 +- transports.d.ts | 2 +- transports.js | 4 +- users.d.ts | 2 +- users.js | 4 +- web-integrations.d.ts | 2 +- web-integrations.js | 4 +- web-notifications.d.ts | 2 +- web-notifications.js | 4 +- webhooks.d.ts | 2 +- webhooks.js | 4 +- 83 files changed, 571 insertions(+), 303 deletions(-) rename chunks/{SMQGR3VM.js => 74U42PVO.js} (96%) rename chunks/{VXEOAWM6.js => 7MLP3MPP.js} (98%) delete mode 100644 chunks/7RHSSS4W.js rename chunks/{UJV2QU2J.js => ANSUDXLV.js} (99%) rename chunks/{E5TLRYTH.js => CXVDSJOD.js} (85%) rename chunks/{3KD5W26Z.js => DZO6ZOEA.js} (79%) rename chunks/{3REGOC54.js => MGUYVMAA.js} (99%) rename chunks/{OCV75U5H.js => OLOELRZ4.js} (96%) create mode 100644 chunks/TJWN2R6D.js rename chunks/{CUC5USM5.js => UF2IPOJY.js} (95%) rename chunks/{EUWNVVK5.js => VX3MQBE7.js} (97%) rename chunks/{3W4PFUMC.js => WHOTOW4Z.js} (96%) create mode 100644 interceptors.d.ts create mode 100644 interceptors.js rename global.types-qsBNouXJ.d.ts => invoke-fetch-types-BmgCFrhK.d.ts (85%) diff --git a/api-keys.d.ts b/api-keys.d.ts index f54a98a..9f640fe 100644 --- a/api-keys.d.ts +++ b/api-keys.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type ApiKey = { diff --git a/api-keys.js b/api-keys.js index 1532de6..51a6b89 100644 --- a/api-keys.js +++ b/api-keys.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/api-keys.ts diff --git a/apps.d.ts b/apps.d.ts index 77e6e26..a330375 100644 --- a/apps.d.ts +++ b/apps.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions, D as DownloadableBlob } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions, D as DownloadableBlob } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type Analysis = "breakdown" | "changePoint" | "comparison" | "contribution" | "correlation" | "fact" | "mutualInfo" | "rank" | "spike" | "trend" | "values"; diff --git a/apps.js b/apps.js index 35df9e9..6de720c 100644 --- a/apps.js +++ b/apps.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/apps.ts diff --git a/audits.d.ts b/audits.d.ts index 7b5493a..26a2afb 100644 --- a/audits.d.ts +++ b/audits.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type ErrorResponse = { diff --git a/audits.js b/audits.js index 352f3e8..c0ce319 100644 --- a/audits.js +++ b/audits.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/audits.ts diff --git a/auth.js b/auth.js index 4f3a4d1..94c280c 100644 --- a/auth.js +++ b/auth.js @@ -4,8 +4,8 @@ import { logout, registerAuthModule, setDefaultHostConfig -} from "./chunks/3W4PFUMC.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/WHOTOW4Z.js"; +import "./chunks/DZO6ZOEA.js"; export { auth_default as default, getAccessToken, diff --git a/automations.d.ts b/automations.d.ts index e809086..0ce16a1 100644 --- a/automations.d.ts +++ b/automations.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type AutomationDetailRequestObject = { diff --git a/automations.js b/automations.js index bbfb443..8681fb1 100644 --- a/automations.js +++ b/automations.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/automations.ts diff --git a/brands.d.ts b/brands.d.ts index f282b2d..b722196 100644 --- a/brands.d.ts +++ b/brands.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions, D as DownloadableBlob } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions, D as DownloadableBlob } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/brands.js b/brands.js index 940745b..ba77180 100644 --- a/brands.js +++ b/brands.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/brands.ts diff --git a/chunks/SMQGR3VM.js b/chunks/74U42PVO.js similarity index 96% rename from chunks/SMQGR3VM.js rename to chunks/74U42PVO.js index 737a23a..f1430a4 100644 --- a/chunks/SMQGR3VM.js +++ b/chunks/74U42PVO.js @@ -1,6 +1,6 @@ import { getInvokeFetchRuntimeModule -} from "./3KD5W26Z.js"; +} from "./DZO6ZOEA.js"; import { isBrowser } from "./2ZQ3ZX7F.js"; diff --git a/chunks/VXEOAWM6.js b/chunks/7MLP3MPP.js similarity index 98% rename from chunks/VXEOAWM6.js rename to chunks/7MLP3MPP.js index 6c610dd..6795a38 100644 --- a/chunks/VXEOAWM6.js +++ b/chunks/7MLP3MPP.js @@ -1,6 +1,6 @@ import { getQixRuntimeModule -} from "./3KD5W26Z.js"; +} from "./DZO6ZOEA.js"; // src/public/qix.ts function openAppSession(appSessionProps) { diff --git a/chunks/7RHSSS4W.js b/chunks/7RHSSS4W.js deleted file mode 100644 index e69de29..0000000 diff --git a/chunks/UJV2QU2J.js b/chunks/ANSUDXLV.js similarity index 99% rename from chunks/UJV2QU2J.js rename to chunks/ANSUDXLV.js index a7e9eef..5ca3ab7 100644 --- a/chunks/UJV2QU2J.js +++ b/chunks/ANSUDXLV.js @@ -4,8 +4,8 @@ import { invokeFetch, isWindows, toValidWebsocketLocationUrl -} from "./OCV75U5H.js"; -import "./7RHSSS4W.js"; +} from "./OLOELRZ4.js"; +import "./TJWN2R6D.js"; import { isBrowser } from "./2ZQ3ZX7F.js"; @@ -161,7 +161,7 @@ function listenForWindowsAuthenticationInformation(session) { return authSuggestedInWebsocket; } async function createAndSetupEnigmaSession(props, canRetry) { - const { createEnigmaSession } = await import("./3REGOC54.js"); + const { createEnigmaSession } = await import("./MGUYVMAA.js"); const session = await createEnigmaSession(props); setupSessionListeners(session, props); let global; diff --git a/chunks/E5TLRYTH.js b/chunks/CXVDSJOD.js similarity index 85% rename from chunks/E5TLRYTH.js rename to chunks/CXVDSJOD.js index c02a350..b389031 100644 --- a/chunks/E5TLRYTH.js +++ b/chunks/CXVDSJOD.js @@ -5,8 +5,8 @@ import { invokeFetch, invoke_fetch_default, parseFetchResponse -} from "./OCV75U5H.js"; -import "./7RHSSS4W.js"; +} from "./OLOELRZ4.js"; +import "./TJWN2R6D.js"; import "./2ZQ3ZX7F.js"; export { EncodingError, diff --git a/chunks/3KD5W26Z.js b/chunks/DZO6ZOEA.js similarity index 79% rename from chunks/3KD5W26Z.js rename to chunks/DZO6ZOEA.js index ac0f99f..1eedcb1 100644 --- a/chunks/3KD5W26Z.js +++ b/chunks/DZO6ZOEA.js @@ -1,21 +1,21 @@ // src/public/public-runtime-modules.ts function getAuthRuntimeModule(hostConfig) { const isNode = !!globalThis.process?.argv; - return isNode ? import("./CUC5USM5.js") : import("./EUWNVVK5.js").then( + return isNode ? import("./UF2IPOJY.js") : import("./VX3MQBE7.js").then( (mod) => mod.importRuntimeModule("auth@v1", hostConfig) ); } async function getQixRuntimeModule(hostConfig) { await getAuthRuntimeModule(hostConfig); const isNode = !!globalThis.process?.argv; - return isNode ? import("./UJV2QU2J.js") : import("./EUWNVVK5.js").then( + return isNode ? import("./ANSUDXLV.js") : import("./VX3MQBE7.js").then( (mod) => mod.importRuntimeModule("qix@v1", hostConfig) ); } async function getInvokeFetchRuntimeModule(hostConfig) { await getAuthRuntimeModule(hostConfig); const isNode = !!globalThis.process?.argv; - return isNode ? import("./E5TLRYTH.js") : import("./EUWNVVK5.js").then( + return isNode ? import("./CXVDSJOD.js") : import("./VX3MQBE7.js").then( (mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig) ); } diff --git a/chunks/3REGOC54.js b/chunks/MGUYVMAA.js similarity index 99% rename from chunks/3REGOC54.js rename to chunks/MGUYVMAA.js index d0b1048..859167e 100644 --- a/chunks/3REGOC54.js +++ b/chunks/MGUYVMAA.js @@ -3,8 +3,8 @@ import { getRestCallAuthParams, getWebSocketAuthParams, toValidWebsocketLocationUrl -} from "./OCV75U5H.js"; -import "./7RHSSS4W.js"; +} from "./OLOELRZ4.js"; +import "./TJWN2R6D.js"; import { isNode } from "./2ZQ3ZX7F.js"; diff --git a/chunks/OCV75U5H.js b/chunks/OLOELRZ4.js similarity index 96% rename from chunks/OCV75U5H.js rename to chunks/OLOELRZ4.js index 3e0ae96..56f76bd 100644 --- a/chunks/OCV75U5H.js +++ b/chunks/OLOELRZ4.js @@ -1,3 +1,6 @@ +import { + getInterceptors +} from "./TJWN2R6D.js"; import { isBrowser, isNode @@ -1639,7 +1642,7 @@ async function fetchAndTransformExceptions(input, init) { return Promise.reject(new InvokeFetchError(getErrorMessage(e), 0, new Headers(), {})); } } -async function performActualHttpFetch(method, completeUrl, unencodedBody, contentType, options, interceptors, authHeaders, credentials, userAgent) { +async function performActualHttpFetch(method, completeUrl, unencodedBody, contentType, options, authHeaders, credentials, userAgent) { const { body, contentTypeHeader, requestOptions } = encodeBody(unencodedBody, contentType ?? ""); const headers = { ...contentTypeHeader, @@ -1651,7 +1654,7 @@ async function performActualHttpFetch(method, completeUrl, unencodedBody, conten headers["User-Agent"] = userAgent; } const isCrossOrigin = isHostCrossOrigin(options?.hostConfig); - let request = { + const request = { method, credentials, mode: isCrossOrigin ? "cors" : "same-origin", @@ -1672,17 +1675,11 @@ async function performActualHttpFetch(method, completeUrl, unencodedBody, conten }, options.timeoutMs); request.signal = controller.signal; } - if (interceptors?.request.hasInterceptors()) { - request = await interceptors.request.apply(completeUrl, request); - } const fetchResponse = await fetchAndTransformExceptions(completeUrl, request); if (fetchTimeoutId) { clearTimeout(fetchTimeoutId); } - let invokeFetchResponse = await parseFetchResponse(fetchResponse, completeUrl); - if (interceptors?.response.hasInterceptors()) { - invokeFetchResponse = await interceptors.response.apply(invokeFetchResponse); - } + const invokeFetchResponse = await parseFetchResponse(fetchResponse, completeUrl); return invokeFetchResponse; } function encodeBody(unencodedBody, contentType) { @@ -1799,23 +1796,17 @@ async function getInvokeFetchUrlParams({ const cacheKey = toCacheKey(url, queryString, serializeHostConfig(options?.hostConfig), options?.headers); return { completeUrl, cacheKey, authHeaders, credentials }; } -function invokeFetchWithUrl(api, props, interceptors) { - return invokeFetchWithUrlAndRetry( - api, - props, - async () => { - const { cacheKey, authHeaders, credentials } = await getInvokeFetchUrlParams(props); - return invokeFetchWithUrlAndRetry( - api, - { ...props, cacheKey, authHeaders, credentials, options: { ...props.options, noCache: true } }, - // don't cache the retry - void 0, - // only retry once - interceptors - ); - }, - interceptors - ); +function invokeFetchWithUrl(api, props) { + return invokeFetchWithUrlAndRetry(api, props, async () => { + const { cacheKey, authHeaders, credentials } = await getInvokeFetchUrlParams(props); + return invokeFetchWithUrlAndRetry( + api, + { ...props, cacheKey, authHeaders, credentials, options: { ...props.options, noCache: true } }, + // don't cache the retry + void 0 + // only retry once + ); + }); } function invokeFetchWithUrlAndRetry(api, { method, @@ -1827,7 +1818,7 @@ function invokeFetchWithUrlAndRetry(api, { credentials, contentType, userAgent -}, performRetry, interceptors) { +}, performRetry) { if (!cache[api]) { cache[api] = {}; } @@ -1847,7 +1838,6 @@ function invokeFetchWithUrlAndRetry(api, { body, contentType, options, - interceptors, authHeaders, credentials, userAgent @@ -1863,7 +1853,6 @@ function invokeFetchWithUrlAndRetry(api, { method, body, options, - interceptors, authHeaders, credentials ); @@ -1882,7 +1871,7 @@ function invokeFetchWithUrlAndRetry(api, { } return cloneResultPromise(resultPromiseAfterCacheClearing); } -function addPagingFunctions(api, value, method, body, options, interceptors, authHeaders, credentials) { +function addPagingFunctions(api, value, method, body, options, authHeaders, credentials) { const serializedHostConfig = serializeHostConfig(options?.hostConfig); return value.then((resp) => { const dataWithPotentialLinks = resp.data; @@ -1892,34 +1881,26 @@ function addPagingFunctions(api, value, method, body, options, interceptors, aut const prevUrl = dataWithPotentialLinks.links?.prev?.href; const nextUrl = dataWithPotentialLinks.links?.next?.href; if (prevUrl) { - resp.prev = (prevOptions) => invokeFetchWithUrl( - api, - { - method, - completeUrl: prevUrl, - body, - options: prevOptions || options, - cacheKey: toCacheKey(prevUrl, "", serializedHostConfig, options?.headers), - authHeaders, - credentials - }, - interceptors - ); + resp.prev = (prevOptions) => invokeFetchWithUrl(api, { + method, + completeUrl: prevUrl, + body, + options: prevOptions || options, + cacheKey: toCacheKey(prevUrl, "", serializedHostConfig, options?.headers), + authHeaders, + credentials + }); } if (nextUrl) { - resp.next = (nextOptions) => invokeFetchWithUrl( - api, - { - method, - completeUrl: nextUrl, - body, - options: nextOptions || options, - cacheKey: toCacheKey(nextUrl, "", serializedHostConfig, options?.headers), - authHeaders, - credentials - }, - interceptors - ); + resp.next = (nextOptions) => invokeFetchWithUrl(api, { + method, + completeUrl: nextUrl, + body, + options: nextOptions || options, + cacheKey: toCacheKey(nextUrl, "", serializedHostConfig, options?.headers), + authHeaders, + credentials + }); } return resp; }); @@ -2037,6 +2018,15 @@ function cleanStack(stack) { // src/invoke-fetch/invoke-fetch-functions.ts var defaultUserAgent = "qmfe-api/latest"; async function invokeFetch(api, props, interceptors) { + interceptors = interceptors || getInterceptors(); + const invokeFetchFinal = (reqeust) => invokeFetchIntercepted(api, reqeust); + const withInterceptors = (interceptors || []).reduce( + (proceed, interceptor) => (request) => interceptor(request, proceed), + invokeFetchFinal + ); + return withInterceptors(props); +} +async function invokeFetchIntercepted(api, props) { checkForCrossDomainRequest(props.options?.hostConfig); let userAgent; if (props?.userAgent) { @@ -2047,11 +2037,15 @@ async function invokeFetch(api, props, interceptors) { userAgent = defaultUserAgent; } const { completeUrl, cacheKey, authHeaders, credentials } = await getInvokeFetchUrlParams(props); - return invokeFetchWithUrl( - api, - { ...props, method: props.method.toUpperCase(), completeUrl, cacheKey, authHeaders, credentials, userAgent }, - interceptors - ); + return invokeFetchWithUrl(api, { + ...props, + method: props.method.toUpperCase(), + completeUrl, + cacheKey, + authHeaders, + credentials, + userAgent + }); } function clearApiCache(api) { clearApiCacheInternal(api); diff --git a/chunks/TJWN2R6D.js b/chunks/TJWN2R6D.js new file mode 100644 index 0000000..fefaa14 --- /dev/null +++ b/chunks/TJWN2R6D.js @@ -0,0 +1,116 @@ +import { + isBrowser +} from "./2ZQ3ZX7F.js"; + +// src/interceptors/interceptors.ts +var GLOBAL_INTERCEPTORS; +function createInterceptors() { + const startingInterceptors = GLOBAL_INTERCEPTORS?.getInterceptors() || []; + const interceptors2 = [...startingInterceptors]; + return { + /** + * Adds an interceptor to the global interceptor stack + * Returns the newly added interceptor + * @param interceptor the interceptor to add + * @returns the newly added interceptor + */ + addInterceptor: (interceptor) => { + interceptors2.push(interceptor); + return interceptor; + }, + /** + * Removes an interceptor from the global interceptor stack + * Returns null if the interceptor was not found + * @param interceptor the interceptor remove + * @returns the removed interceptor or null if not found + */ + removeInterceptor: (interceptor) => { + const index = interceptors2.indexOf(interceptor); + let removed; + if (index !== -1) { + removed = interceptors2.splice(index, 1)[0]; + } + return removed || null; + }, + /** + * Gets all registered interceptors + */ + getInterceptors: () => interceptors2 + }; +} +var addDefaultInterceptorsRun = false; +function addDefaultInterceptors() { + if (addDefaultInterceptorsRun) { + return; + } + if (isBrowser()) { + const readFlagsFromUrlQuery = () => { + const params = new URLSearchParams(window.location.search); + const featuresParam = params.get("features"); + if (!featuresParam) { + return {}; + } + const features = featuresParam.split(",").map((item) => item.trim()); + const urlFeatures = features.reduce( + (map, obj) => { + const value = !obj.startsWith("!"); + const key = value ? obj : obj.substring(1); + map[key] = value; + return map; + }, + {} + ); + return urlFeatures; + }; + const readFlagsFromLocalStorage = () => { + try { + const featuresParam = localStorage.getItem("qcs-features"); + if (featuresParam) { + return JSON.parse(featuresParam); + } + return {}; + } catch { + return {}; + } + }; + const flagsFromUrl = readFlagsFromUrlQuery(); + const flagsFromLocalStorage = readFlagsFromLocalStorage(); + const interceptor = async (request, proceed) => { + let resultPromise; + if (request.pathTemplate === "/api/v1/features") { + resultPromise = proceed(request); + const result = await resultPromise; + return { ...result, data: { ...result.data || {}, ...flagsFromUrl, ...flagsFromLocalStorage } }; + } + return proceed(request); + }; + GLOBAL_INTERCEPTORS.addInterceptor(interceptor); + } + addDefaultInterceptorsRun = true; +} +GLOBAL_INTERCEPTORS = createInterceptors(); +function addInterceptor(interceptor) { + return GLOBAL_INTERCEPTORS.addInterceptor(interceptor); +} +function removeInterceptor(interceptor) { + return GLOBAL_INTERCEPTORS.removeInterceptor(interceptor); +} +function getInterceptors() { + return GLOBAL_INTERCEPTORS.getInterceptors(); +} +var interceptors = { + addInterceptor, + removeInterceptor, + getInterceptors, + createInterceptors +}; +var interceptors_default = interceptors; + +export { + createInterceptors, + addDefaultInterceptors, + addInterceptor, + removeInterceptor, + getInterceptors, + interceptors_default +}; diff --git a/chunks/CUC5USM5.js b/chunks/UF2IPOJY.js similarity index 95% rename from chunks/CUC5USM5.js rename to chunks/UF2IPOJY.js index bcc8256..c626a05 100644 --- a/chunks/CUC5USM5.js +++ b/chunks/UF2IPOJY.js @@ -19,8 +19,8 @@ import { toValidEnigmaLocationUrl, toValidLocationUrl, toValidWebsocketLocationUrl -} from "./OCV75U5H.js"; -import "./7RHSSS4W.js"; +} from "./OLOELRZ4.js"; +import "./TJWN2R6D.js"; import "./2ZQ3ZX7F.js"; export { AuthorizationError, diff --git a/chunks/EUWNVVK5.js b/chunks/VX3MQBE7.js similarity index 97% rename from chunks/EUWNVVK5.js rename to chunks/VX3MQBE7.js index 98ec841..3d8918c 100644 --- a/chunks/EUWNVVK5.js +++ b/chunks/VX3MQBE7.js @@ -1,4 +1,4 @@ -// node_modules/.pnpm/@qlik+runtime-module-loader@1.0.13/node_modules/@qlik/runtime-module-loader/dist/index.js +// node_modules/.pnpm/@qlik+runtime-module-loader@1.0.14/node_modules/@qlik/runtime-module-loader/dist/index.js window.__qlikMainPrivateResolvers = window.__qlikMainPrivateResolvers || {}; window.__qlikMainPrivateResolvers.mainUrlPromise = window.__qlikMainPrivateResolvers.mainUrlPromise || new Promise((resolve) => { window.__qlikMainPrivateResolvers.resolveMainJsUrl = (value) => resolve(value); diff --git a/chunks/3W4PFUMC.js b/chunks/WHOTOW4Z.js similarity index 96% rename from chunks/3W4PFUMC.js rename to chunks/WHOTOW4Z.js index 0443c4e..98037f0 100644 --- a/chunks/3W4PFUMC.js +++ b/chunks/WHOTOW4Z.js @@ -1,6 +1,6 @@ import { getAuthRuntimeModule -} from "./3KD5W26Z.js"; +} from "./DZO6ZOEA.js"; // src/public/auth.ts function registerAuthModule(name, authModule) { diff --git a/collections.d.ts b/collections.d.ts index 1b46eb8..418083f 100644 --- a/collections.d.ts +++ b/collections.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type CollectionByIdPatch = { diff --git a/collections.js b/collections.js index 2d09f60..a7fd1bc 100644 --- a/collections.js +++ b/collections.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/collections.ts diff --git a/csp-origins.d.ts b/csp-origins.d.ts index 9c561fd..51720e9 100644 --- a/csp-origins.d.ts +++ b/csp-origins.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type CSPEntry = { diff --git a/csp-origins.js b/csp-origins.js index 7afd9a1..50d1b5e 100644 --- a/csp-origins.js +++ b/csp-origins.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/csp-origins.ts diff --git a/data-assets.d.ts b/data-assets.d.ts index 28fed1e..9b5792b 100644 --- a/data-assets.d.ts +++ b/data-assets.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type BatchIdDto = { diff --git a/data-assets.js b/data-assets.js index ee293a5..6a8c3aa 100644 --- a/data-assets.js +++ b/data-assets.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/data-assets.ts diff --git a/data-connections.d.ts b/data-connections.d.ts index 829bc0d..7cf93bd 100644 --- a/data-connections.d.ts +++ b/data-connections.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type ActionDeleteRequest = { diff --git a/data-connections.js b/data-connections.js index 8d48c0d..5fe37c2 100644 --- a/data-connections.js +++ b/data-connections.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/data-connections.ts diff --git a/data-credentials.d.ts b/data-credentials.d.ts index 9a32117..76ba9de 100644 --- a/data-credentials.d.ts +++ b/data-credentials.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type ActionFilterOrphanRequest = { diff --git a/data-credentials.js b/data-credentials.js index e6faa2b..2de918f 100644 --- a/data-credentials.js +++ b/data-credentials.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/data-credentials.ts diff --git a/data-files.d.ts b/data-files.d.ts index 4e26bb9..73a7e8a 100644 --- a/data-files.d.ts +++ b/data-files.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type BatchChangeSpaceItem = { diff --git a/data-files.js b/data-files.js index ce6cd74..f8fa20e 100644 --- a/data-files.js +++ b/data-files.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/data-files.ts diff --git a/docs/rest.md b/docs/rest.md index ac3c37f..cb129e1 100644 --- a/docs/rest.md +++ b/docs/rest.md @@ -62,3 +62,50 @@ try { ## Caching Every GET request is cached so that subsequent calls to the same api will resolve immediately from the cache. Read more about caching [here](features.md#caching). + +### Rest Interceptors + +Interceptors can be added to allow custom functionality to happen before or after an api call. They run globally always on every request. The format is: + +```ts +// the interceptor format +const interceptor = async (request, proceed) => { + // do things before the request + const result = await proceed(request); + // do things after the request + return result; +}; +``` + +> [!WARNING] +> Use Interceptors with caution. They affect every request made by the library and can introduce strange side effects that are hard to discover and debug. + +#### Examples + +```ts +import { addInterceptor, removeInterceptor } from "@qlik/api/interceptors"; + +// add a logging interceptor, which logs all requests, responses and errors +addInterceptor(async (request, proceed) => { + try { + console.log("-->", request.method, request.pathTemplate, request.pathVariables, request.query, request.body); + const result = await proceed(request); + console.log("<--", result.data); + return result; + } catch (err) { + console.log("<-*", err); + throw err; + } +}); + +// add additional header to a request +const headerInterceptor = addInterceptor(async (request, proceed) => { + // make sure headers object exists + (request.options = request.options || {}).headers = request.options.headers || {}; + request.options.headers["x-another-header"] = "foobarvalue"; + return proceed(request); +}); + +// remove an interceptor +removeInterceptor(headerInterceptor); +``` diff --git a/extensions.d.ts b/extensions.d.ts index 5cdda6e..137146d 100644 --- a/extensions.d.ts +++ b/extensions.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/extensions.js b/extensions.js index e612adc..bfbdff5 100644 --- a/extensions.js +++ b/extensions.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/extensions.ts diff --git a/glossaries.d.ts b/glossaries.d.ts index bb7da55..f635a93 100644 --- a/glossaries.d.ts +++ b/glossaries.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/glossaries.js b/glossaries.js index a3ba2b8..381b9be 100644 --- a/glossaries.js +++ b/glossaries.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/glossaries.ts diff --git a/groups.d.ts b/groups.d.ts index 9a00de1..5da1f4a 100644 --- a/groups.d.ts +++ b/groups.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/groups.js b/groups.js index 881a9a5..670c1dc 100644 --- a/groups.js +++ b/groups.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/groups.ts diff --git a/identity-providers.d.ts b/identity-providers.d.ts index d1b6454..e33becd 100644 --- a/identity-providers.d.ts +++ b/identity-providers.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type BaseIDP = { diff --git a/identity-providers.js b/identity-providers.js index efa0996..6383186 100644 --- a/identity-providers.js +++ b/identity-providers.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/identity-providers.ts diff --git a/index.d.ts b/index.d.ts index 8a409ce..0aa1063 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,3 +1,4 @@ +import { InterceptorsAPI, createInterceptors } from './interceptors.js'; import { registerAuthModule, setDefaultHostConfig, getAccessToken, AuthAPI } from './auth.js'; import { QixAPI } from './qix.js'; import { ApiKeysAPI } from './api-keys.js'; @@ -32,7 +33,7 @@ import { WebIntegrationsAPI } from './web-integrations.js'; import { WebNotificationsAPI } from './web-notifications.js'; import { WebhooksAPI } from './webhooks.js'; import { H as HostConfig } from './auth-types-PkN9CAF_.js'; -import './global.types-qsBNouXJ.js'; +import './invoke-fetch-types-BmgCFrhK.js'; declare const apiKeys: ApiKeysAPI; declare const apps: AppsAPI; @@ -54,6 +55,9 @@ declare const extensions: ExtensionsAPI; declare const glossaries: GlossariesAPI; declare const groups: GroupsAPI; declare const identityProviders: IdentityProvidersAPI; +declare const interceptors: InterceptorsAPI & { + createInterceptors: typeof createInterceptors; +}; declare const items: ItemsAPI; declare const licenses: LicensesAPI; declare const qix: QixAPI & { @@ -106,6 +110,8 @@ interface QlikAPI { groups: GroupsAPI; /** Functions for the identityProviders api */ identityProviders: IdentityProvidersAPI; + /** Functions for the interceptors api */ + interceptors: InterceptorsAPI; /** Functions for the items api */ items: ItemsAPI; /** Functions for the licenses api */ @@ -141,9 +147,10 @@ interface QlikAPI { /** Functions for the webhooks api */ webhooks: WebhooksAPI; } -declare const createQlikApi: (props?: { +type CreateQlikApiProps = { hostConfig?: HostConfig; -}) => QlikAPI; +}; +declare const createQlikApi: (props?: CreateQlikApiProps) => QlikAPI; /** Javascript/Typescript bindings to Qlik's platform API's */ declare const api: QlikAPI & { createQlikApi: (props?: { @@ -151,4 +158,4 @@ declare const api: QlikAPI & { }) => QlikAPI; }; -export { type QlikAPI, apiKeys, apps, audits, auth, automations, brands, collections, createQlikApi, cspOrigins, dataAssets, dataConnections, dataCredentials, dataFiles, api as default, extensions, glossaries, groups, identityProviders, items, licenses, qix, quotas, reloadTasks, reloads, reports, roles, spaces, tempContents, tenants, themes, transports, users, webIntegrations, webNotifications, webhooks }; +export { type CreateQlikApiProps, type QlikAPI, apiKeys, apps, audits, auth, automations, brands, collections, createQlikApi, cspOrigins, dataAssets, dataConnections, dataCredentials, dataFiles, api as default, extensions, glossaries, groups, identityProviders, interceptors, items, licenses, qix, quotas, reloadTasks, reloads, reports, roles, spaces, tempContents, tenants, themes, transports, users, webIntegrations, webNotifications, webhooks }; diff --git a/index.js b/index.js index 8b51afe..1ca2bfe 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,17 @@ import { qix_default -} from "./chunks/VXEOAWM6.js"; +} from "./chunks/7MLP3MPP.js"; import { auth_default -} from "./chunks/3W4PFUMC.js"; -import "./chunks/7RHSSS4W.js"; +} from "./chunks/WHOTOW4Z.js"; +import { + interceptors_default +} from "./chunks/TJWN2R6D.js"; import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/runtime-api-generator/runtime-api-generator-common.ts @@ -81,7 +83,6 @@ function createLazyApiProxy(api2, initFunc) { } function parseMiniApi(namespace, def) { const api2 = { - interceptors: {}, operations: {} }; traverse(namespace, "", def, api2.operations); @@ -133,7 +134,7 @@ function createClassicApiFn({ hasBody, contentType, useInstead -}, operationInterceptors, hostConfig, enableConsoleWarnings, invokeFetchFnGetter) { +}, hostConfig, interceptors2, enableConsoleWarnings, invokeFetchFnGetter) { return (...args) => { const pathVariables = {}; argNames.forEach((argName, index) => { @@ -175,7 +176,7 @@ function createClassicApiFn({ ...contentType ? { contentType } : {}, options: optionsIncludingDefaultHostConfig }, - operationInterceptors + interceptors2?.getInterceptors() ); }; } @@ -185,13 +186,13 @@ var parsedMiniApis = {}; function apiDefToApiPublic(namespace, def) { parsedMiniApis[namespace] = parsedMiniApis[namespace] || parseMiniApi(namespace, def); const parsedMiniApi = parsedMiniApis[namespace]; - return (hostConfig) => { + return (hostConfig, interceptors2) => { const lazyApi = { clearCache: () => clearApiCache(namespace) }; const initFunc = () => { Object.entries(parsedMiniApi.operations).forEach(([operationName, operation]) => { - lazyApi[operationName] = createClassicApiFn(operation, void 0, hostConfig, true, () => invokeFetch); + lazyApi[operationName] = createClassicApiFn(operation, hostConfig, interceptors2, true, () => invokeFetch); operation.oldOperationNames.forEach((oldOperationName) => { lazyApi[oldOperationName] = lazyApi[operationName]; }); @@ -683,74 +684,79 @@ var webhooksMiniModule = apiDefToApiPublic("webhooks", { } } }); -var apiKeys = apiKeysMiniModule(); -var apps = appsMiniModule(); -var audits = auditsMiniModule(); +var apiKeys = apiKeysMiniModule(void 0, interceptors_default); +var apps = appsMiniModule(void 0, interceptors_default); +var audits = auditsMiniModule(void 0, interceptors_default); var auth = auth_default; -var automations = automationsMiniModule(); -var brands = brandsMiniModule(); -var collections = collectionsMiniModule(); -var cspOrigins = cspOriginsMiniModule(); -var dataAssets = dataAssetsMiniModule(); -var dataConnections = dataConnectionsMiniModule(); -var dataCredentials = dataCredentialsMiniModule(); -var dataFiles = dataFilesMiniModule(); -var extensions = extensionsMiniModule(); -var glossaries = glossariesMiniModule(); -var groups = groupsMiniModule(); -var identityProviders = identityProvidersMiniModule(); -var items = itemsMiniModule(); -var licenses = licensesMiniModule(); +var automations = automationsMiniModule(void 0, interceptors_default); +var brands = brandsMiniModule(void 0, interceptors_default); +var collections = collectionsMiniModule(void 0, interceptors_default); +var cspOrigins = cspOriginsMiniModule(void 0, interceptors_default); +var dataAssets = dataAssetsMiniModule(void 0, interceptors_default); +var dataConnections = dataConnectionsMiniModule(void 0, interceptors_default); +var dataCredentials = dataCredentialsMiniModule(void 0, interceptors_default); +var dataFiles = dataFilesMiniModule(void 0, interceptors_default); +var extensions = extensionsMiniModule(void 0, interceptors_default); +var glossaries = glossariesMiniModule(void 0, interceptors_default); +var groups = groupsMiniModule(void 0, interceptors_default); +var identityProviders = identityProvidersMiniModule(void 0, interceptors_default); +var interceptors = interceptors_default; +var items = itemsMiniModule(void 0, interceptors_default); +var licenses = licensesMiniModule(void 0, interceptors_default); var qix = qix_default; -var quotas = quotasMiniModule(); -var reloadTasks = reloadTasksMiniModule(); -var reloads = reloadsMiniModule(); -var reports = reportsMiniModule(); -var roles = rolesMiniModule(); -var spaces = spacesMiniModule(); -var tempContents = tempContentsMiniModule(); -var tenants = tenantsMiniModule(); -var themes = themesMiniModule(); -var transports = transportsMiniModule(); -var users = usersMiniModule(); -var webIntegrations = webIntegrationsMiniModule(); -var webNotifications = webNotificationsMiniModule(); -var webhooks = webhooksMiniModule(); -var createQlikApi = (props) => ({ - apiKeys: apiKeysMiniModule(props?.hostConfig), - apps: appsMiniModule(props?.hostConfig), - audits: auditsMiniModule(props?.hostConfig), - auth: auth_default, - automations: automationsMiniModule(props?.hostConfig), - brands: brandsMiniModule(props?.hostConfig), - collections: collectionsMiniModule(props?.hostConfig), - cspOrigins: cspOriginsMiniModule(props?.hostConfig), - dataAssets: dataAssetsMiniModule(props?.hostConfig), - dataConnections: dataConnectionsMiniModule(props?.hostConfig), - dataCredentials: dataCredentialsMiniModule(props?.hostConfig), - dataFiles: dataFilesMiniModule(props?.hostConfig), - extensions: extensionsMiniModule(props?.hostConfig), - glossaries: glossariesMiniModule(props?.hostConfig), - groups: groupsMiniModule(props?.hostConfig), - identityProviders: identityProvidersMiniModule(props?.hostConfig), - items: itemsMiniModule(props?.hostConfig), - licenses: licensesMiniModule(props?.hostConfig), - qix: qix_default.withHostConfig(props?.hostConfig), - quotas: quotasMiniModule(props?.hostConfig), - reloadTasks: reloadTasksMiniModule(props?.hostConfig), - reloads: reloadsMiniModule(props?.hostConfig), - reports: reportsMiniModule(props?.hostConfig), - roles: rolesMiniModule(props?.hostConfig), - spaces: spacesMiniModule(props?.hostConfig), - tempContents: tempContentsMiniModule(props?.hostConfig), - tenants: tenantsMiniModule(props?.hostConfig), - themes: themesMiniModule(props?.hostConfig), - transports: transportsMiniModule(props?.hostConfig), - users: usersMiniModule(props?.hostConfig), - webIntegrations: webIntegrationsMiniModule(props?.hostConfig), - webNotifications: webNotificationsMiniModule(props?.hostConfig), - webhooks: webhooksMiniModule(props?.hostConfig) -}); +var quotas = quotasMiniModule(void 0, interceptors_default); +var reloadTasks = reloadTasksMiniModule(void 0, interceptors_default); +var reloads = reloadsMiniModule(void 0, interceptors_default); +var reports = reportsMiniModule(void 0, interceptors_default); +var roles = rolesMiniModule(void 0, interceptors_default); +var spaces = spacesMiniModule(void 0, interceptors_default); +var tempContents = tempContentsMiniModule(void 0, interceptors_default); +var tenants = tenantsMiniModule(void 0, interceptors_default); +var themes = themesMiniModule(void 0, interceptors_default); +var transports = transportsMiniModule(void 0, interceptors_default); +var users = usersMiniModule(void 0, interceptors_default); +var webIntegrations = webIntegrationsMiniModule(void 0, interceptors_default); +var webNotifications = webNotificationsMiniModule(void 0, interceptors_default); +var webhooks = webhooksMiniModule(void 0, interceptors_default); +var createQlikApi = (props) => { + const scopedInterceptors = interceptors_default.createInterceptors(); + return { + apiKeys: apiKeysMiniModule(props?.hostConfig, scopedInterceptors), + apps: appsMiniModule(props?.hostConfig, scopedInterceptors), + audits: auditsMiniModule(props?.hostConfig, scopedInterceptors), + auth: auth_default, + automations: automationsMiniModule(props?.hostConfig, scopedInterceptors), + brands: brandsMiniModule(props?.hostConfig, scopedInterceptors), + collections: collectionsMiniModule(props?.hostConfig, scopedInterceptors), + cspOrigins: cspOriginsMiniModule(props?.hostConfig, scopedInterceptors), + dataAssets: dataAssetsMiniModule(props?.hostConfig, scopedInterceptors), + dataConnections: dataConnectionsMiniModule(props?.hostConfig, scopedInterceptors), + dataCredentials: dataCredentialsMiniModule(props?.hostConfig, scopedInterceptors), + dataFiles: dataFilesMiniModule(props?.hostConfig, scopedInterceptors), + extensions: extensionsMiniModule(props?.hostConfig, scopedInterceptors), + glossaries: glossariesMiniModule(props?.hostConfig, scopedInterceptors), + groups: groupsMiniModule(props?.hostConfig, scopedInterceptors), + identityProviders: identityProvidersMiniModule(props?.hostConfig, scopedInterceptors), + interceptors: scopedInterceptors, + items: itemsMiniModule(props?.hostConfig, scopedInterceptors), + licenses: licensesMiniModule(props?.hostConfig, scopedInterceptors), + qix: qix_default.withHostConfig(props?.hostConfig), + quotas: quotasMiniModule(props?.hostConfig, scopedInterceptors), + reloadTasks: reloadTasksMiniModule(props?.hostConfig, scopedInterceptors), + reloads: reloadsMiniModule(props?.hostConfig, scopedInterceptors), + reports: reportsMiniModule(props?.hostConfig, scopedInterceptors), + roles: rolesMiniModule(props?.hostConfig, scopedInterceptors), + spaces: spacesMiniModule(props?.hostConfig, scopedInterceptors), + tempContents: tempContentsMiniModule(props?.hostConfig, scopedInterceptors), + tenants: tenantsMiniModule(props?.hostConfig, scopedInterceptors), + themes: themesMiniModule(props?.hostConfig, scopedInterceptors), + transports: transportsMiniModule(props?.hostConfig, scopedInterceptors), + users: usersMiniModule(props?.hostConfig, scopedInterceptors), + webIntegrations: webIntegrationsMiniModule(props?.hostConfig, scopedInterceptors), + webNotifications: webNotificationsMiniModule(props?.hostConfig, scopedInterceptors), + webhooks: webhooksMiniModule(props?.hostConfig, scopedInterceptors) + }; +}; var api = { apiKeys, apps, @@ -768,6 +774,7 @@ var api = { glossaries, groups, identityProviders, + interceptors, items, licenses, qix, @@ -807,6 +814,7 @@ export { glossaries, groups, identityProviders, + interceptors, items, licenses, qix, diff --git a/interceptors.d.ts b/interceptors.d.ts new file mode 100644 index 0000000..4c7feba --- /dev/null +++ b/interceptors.d.ts @@ -0,0 +1,51 @@ +import { I as InvokeFetchResponse, a as InvokeFetchProperties } from './invoke-fetch-types-BmgCFrhK.js'; +import './auth-types-PkN9CAF_.js'; + +/** + * The RestInterceptor type is a function that can be used to intercept requests and responses + */ +type RestInterceptor = (request: InvokeFetchProperties, proceed: (props: InvokeFetchProperties) => Promise, id?: string) => Promise; +declare function createInterceptors(): InterceptorsAPI; +declare function addDefaultInterceptors(): void; +/** + * Adds an interceptor to the global interceptor stack + * Returns the newly added interceptor + * @param interceptor the interceptor to add + * @returns the newly added interceptor + */ +declare function addInterceptor(interceptor: RestInterceptor): RestInterceptor; +/** + * Removes an interceptor from the global interceptor stack + * @param interceptor the interceptor remove + */ +declare function removeInterceptor(interceptor: RestInterceptor): RestInterceptor | null; +/** + * Gets all registered interceptors + */ +declare function getInterceptors(): RestInterceptor[]; +interface InterceptorsAPI { + /** + * Adds an interceptor to the global interceptor stack + * Returns the newly added interceptor + * @param interceptor the interceptor to add + * @returns the newly added interceptor + */ + addInterceptor: typeof addInterceptor; + /** + * Removes an interceptor from the global interceptor stack + * @param interceptor the interceptor remove + */ + removeInterceptor: typeof removeInterceptor; + /** + * Gets all registered interceptors + */ + getInterceptors: typeof getInterceptors; +} +/** + * The interceptors API + */ +declare const interceptors: InterceptorsAPI & { + createInterceptors: typeof createInterceptors; +}; + +export { type InterceptorsAPI, type RestInterceptor, addDefaultInterceptors, addInterceptor, createInterceptors, interceptors as default, getInterceptors, removeInterceptor }; diff --git a/interceptors.js b/interceptors.js new file mode 100644 index 0000000..f3a2abb --- /dev/null +++ b/interceptors.js @@ -0,0 +1,17 @@ +import { + addDefaultInterceptors, + addInterceptor, + createInterceptors, + getInterceptors, + interceptors_default, + removeInterceptor +} from "./chunks/TJWN2R6D.js"; +import "./chunks/2ZQ3ZX7F.js"; +export { + addDefaultInterceptors, + addInterceptor, + createInterceptors, + interceptors_default as default, + getInterceptors, + removeInterceptor +}; diff --git a/global.types-qsBNouXJ.d.ts b/invoke-fetch-types-BmgCFrhK.d.ts similarity index 85% rename from global.types-qsBNouXJ.d.ts rename to invoke-fetch-types-BmgCFrhK.d.ts index 92e28e6..2f7ca8b 100644 --- a/global.types-qsBNouXJ.d.ts +++ b/invoke-fetch-types-BmgCFrhK.d.ts @@ -1,52 +1,5 @@ import { H as HostConfig } from './auth-types-PkN9CAF_.js'; -/** An entry in the cache for one specific cacheKey */ -type CacheEntry = { - lastPulled: number; - /** last time the cache was accessed and prevented an api call */ - lastHit: Date | null; - /** number of times the cache has been hit by a client */ - hitCount: number; - /** the url path of the cache hit. Useful to determine how many different qmfes are accessing the cache key */ - accessedPaths: Set; - value: Promise; -}; -/** Additional options for an api call done with invoke-fetch */ -type ApiCallOptions = { - /** Additional headers to pass on to the request. */ - headers?: Record; - /** if set to true the call will not use a cached result */ - noCache?: boolean; - /** - * Only used cached results whose age in milliseconds are less than that or equal to `maxCacheAge`. - */ - maxCacheAge?: number | undefined; - /** - * Only results cached on or after the `ifCachedSince` timestamp are used. - */ - useCacheIfAfter?: Date; - /** - * Specify if another host than `globalThis.location` is to be used. Typically used in embedding and mashups - */ - hostConfig?: HostConfig; - /** - * Set the amount of time to wait for a response. - * If the timeout is exceeded the request is aborted. - * If both timeoutMs and signal is present, timeoutMs will have no effect, as - * there is already an abort-signal specified. - */ - timeoutMs?: number; - /** - * An abort-signal lets you abort an ongoing fetch request. The abort-signal is created - * by taking the .signal property of an AbortController. - */ - signal?: AbortSignal; -}; -type DownloadableBlob = Blob & { - /** download the blob in a using the specified filename */ - download: (filename: string) => Promise; -}; - /** ApiKey Auth Configuration for a HostConfig */ type ApiKeyAuthConfig = { /** api key created by a developer role on a tenant */ @@ -173,4 +126,79 @@ declare global { } | undefined; } -export type { ApiCallOptions as A, DownloadableBlob as D }; +/** The typical base return type of a fetch call */ +type InvokeFetchResponse = { + status: number; + headers: Headers; + data: unknown; + prev?: () => Promise; + next?: () => Promise; +}; +/** An entry in the cache for one specific cacheKey */ +type CacheEntry = { + lastPulled: number; + /** last time the cache was accessed and prevented an api call */ + lastHit: Date | null; + /** number of times the cache has been hit by a client */ + hitCount: number; + /** the url path of the cache hit. Useful to determine how many different qmfes are accessing the cache key */ + accessedPaths: Set; + value: Promise; +}; +/** Additional options for an api call done with invoke-fetch */ +type ApiCallOptions = { + /** Additional headers to pass on to the request. */ + headers?: Record; + /** if set to true the call will not use a cached result */ + noCache?: boolean; + /** + * Only used cached results whose age in milliseconds are less than that or equal to `maxCacheAge`. + */ + maxCacheAge?: number | undefined; + /** + * Only results cached on or after the `ifCachedSince` timestamp are used. + */ + useCacheIfAfter?: Date; + /** + * Specify if another host than `globalThis.location` is to be used. Typically used in embedding and mashups + */ + hostConfig?: HostConfig; + /** + * Set the amount of time to wait for a response. + * If the timeout is exceeded the request is aborted. + * If both timeoutMs and signal is present, timeoutMs will have no effect, as + * there is already an abort-signal specified. + */ + timeoutMs?: number; + /** + * An abort-signal lets you abort an ongoing fetch request. The abort-signal is created + * by taking the .signal property of an AbortController. + */ + signal?: AbortSignal; +}; +type InvokeFetchProperties = { + /** http method */ + method: string; + /** data passed to api call */ + body?: unknown; + /** additional api call options */ + options?: ApiCallOptions; + /** override default RequestInit options */ + requestInitOverrides?: RequestInit; + /** path to api endpoint, can be in a template format e.g. /api/v1/space/{spaceId} */ + pathTemplate: string; + /** path variables to be used in the path template */ + pathVariables?: Record; + /** additional query to url */ + query?: Record; + /** specify what content-type to send, if omitted "application/json" is assumed */ + contentType?: string; + /** override the default user-agent with this value. This will also override any browser's UA. */ + userAgent?: string; +}; +type DownloadableBlob = Blob & { + /** download the blob in a using the specified filename */ + download: (filename: string) => Promise; +}; + +export type { ApiCallOptions as A, DownloadableBlob as D, InvokeFetchResponse as I, InvokeFetchProperties as a }; diff --git a/items.d.ts b/items.d.ts index 20107a1..60d6b35 100644 --- a/items.d.ts +++ b/items.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type CollectionTypes = "private" | "public" | "publicgoverned"; diff --git a/items.js b/items.js index f96f10f..65d45a1 100644 --- a/items.js +++ b/items.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/items.ts diff --git a/licenses.d.ts b/licenses.d.ts index c922820..9af6623 100644 --- a/licenses.d.ts +++ b/licenses.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type AssignmentsActionsAddRequest = { diff --git a/licenses.js b/licenses.js index d619871..28790cb 100644 --- a/licenses.js +++ b/licenses.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/licenses.ts diff --git a/qix.d.ts b/qix.d.ts index 74a60c7..eaeeb71 100644 --- a/qix.d.ts +++ b/qix.d.ts @@ -1,5 +1,5 @@ import { H as HostConfig } from './auth-types-PkN9CAF_.js'; -import './global.types-qsBNouXJ.js'; +import './invoke-fetch-types-BmgCFrhK.js'; declare const QIX_SCHEMA_VERSION = "12.2224.0"; type AlfaNumString = { diff --git a/qix.js b/qix.js index 0c1c624..32656bd 100644 --- a/qix.js +++ b/qix.js @@ -2,8 +2,8 @@ import { openAppSession, qix_default, withHostConfig -} from "./chunks/VXEOAWM6.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/7MLP3MPP.js"; +import "./chunks/DZO6ZOEA.js"; export { qix_default as default, openAppSession, diff --git a/quotas.d.ts b/quotas.d.ts index d3c8bc8..3d52568 100644 --- a/quotas.d.ts +++ b/quotas.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/quotas.js b/quotas.js index 6063b36..010cd99 100644 --- a/quotas.js +++ b/quotas.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/quotas.ts diff --git a/reload-tasks.d.ts b/reload-tasks.d.ts index fed632f..1d57eff 100644 --- a/reload-tasks.d.ts +++ b/reload-tasks.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type Error = { diff --git a/reload-tasks.js b/reload-tasks.js index 1c5f3d4..1f1883a 100644 --- a/reload-tasks.js +++ b/reload-tasks.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/reload-tasks.ts diff --git a/reloads.d.ts b/reloads.d.ts index eeefd81..e727c7c 100644 --- a/reloads.d.ts +++ b/reloads.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type Error = { diff --git a/reloads.js b/reloads.js index c0ed2f0..afcfc70 100644 --- a/reloads.js +++ b/reloads.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/reloads.ts diff --git a/reports.d.ts b/reports.d.ts index b97000b..26a32ed 100644 --- a/reports.d.ts +++ b/reports.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/reports.js b/reports.js index 54eccd9..f37f6d9 100644 --- a/reports.js +++ b/reports.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/reports.ts diff --git a/roles.d.ts b/roles.d.ts index 9ea70f1..5ca0518 100644 --- a/roles.d.ts +++ b/roles.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/roles.js b/roles.js index 2b98837..b92b104 100644 --- a/roles.js +++ b/roles.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/roles.ts diff --git a/spaces.d.ts b/spaces.d.ts index b2404a7..c319211 100644 --- a/spaces.d.ts +++ b/spaces.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/spaces.js b/spaces.js index e7d65a3..c6a7412 100644 --- a/spaces.js +++ b/spaces.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/spaces.ts diff --git a/temp-contents.d.ts b/temp-contents.d.ts index 54b3514..34784ff 100644 --- a/temp-contents.d.ts +++ b/temp-contents.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/temp-contents.js b/temp-contents.js index b603f26..1966bdf 100644 --- a/temp-contents.js +++ b/temp-contents.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/temp-contents.ts diff --git a/tenants.d.ts b/tenants.d.ts index c7bb263..c50a52e 100644 --- a/tenants.d.ts +++ b/tenants.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/tenants.js b/tenants.js index 02ce419..6aabc8e 100644 --- a/tenants.js +++ b/tenants.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/tenants.ts diff --git a/themes.d.ts b/themes.d.ts index 1d6400b..979cd08 100644 --- a/themes.d.ts +++ b/themes.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/themes.js b/themes.js index c92b675..b011aa8 100644 --- a/themes.js +++ b/themes.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/themes.ts diff --git a/transports.d.ts b/transports.d.ts index ebff09a..4c7c86f 100644 --- a/transports.d.ts +++ b/transports.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type DeleteConfigNotFoundError = { diff --git a/transports.js b/transports.js index e210ad6..20182fe 100644 --- a/transports.js +++ b/transports.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/transports.ts diff --git a/users.d.ts b/users.d.ts index c5b037f..07808ae 100644 --- a/users.d.ts +++ b/users.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/users.js b/users.js index d77a44e..d8c77f0 100644 --- a/users.js +++ b/users.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/users.ts diff --git a/web-integrations.d.ts b/web-integrations.d.ts index 20e5de3..b7376c1 100644 --- a/web-integrations.d.ts +++ b/web-integrations.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/web-integrations.js b/web-integrations.js index 84b9374..87cc5a7 100644 --- a/web-integrations.js +++ b/web-integrations.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/web-integrations.ts diff --git a/web-notifications.d.ts b/web-notifications.d.ts index 0ae93a7..5ccc425 100644 --- a/web-notifications.d.ts +++ b/web-notifications.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; /** diff --git a/web-notifications.js b/web-notifications.js index e35ccf2..ee5d16a 100644 --- a/web-notifications.js +++ b/web-notifications.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/web-notifications.ts diff --git a/webhooks.d.ts b/webhooks.d.ts index f1fba97..a174da9 100644 --- a/webhooks.d.ts +++ b/webhooks.d.ts @@ -1,4 +1,4 @@ -import { A as ApiCallOptions } from './global.types-qsBNouXJ.js'; +import { A as ApiCallOptions } from './invoke-fetch-types-BmgCFrhK.js'; import './auth-types-PkN9CAF_.js'; type Delivery = { diff --git a/webhooks.js b/webhooks.js index 5e412ac..f4f91b4 100644 --- a/webhooks.js +++ b/webhooks.js @@ -1,8 +1,8 @@ import { clearApiCache, invokeFetch -} from "./chunks/SMQGR3VM.js"; -import "./chunks/3KD5W26Z.js"; +} from "./chunks/74U42PVO.js"; +import "./chunks/DZO6ZOEA.js"; import "./chunks/2ZQ3ZX7F.js"; // src/public/rest/webhooks.ts