Skip to content

Commit

Permalink
feat: qlik api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
qlikossbuild authored and github-actions[bot] committed Oct 24, 2024
1 parent 89cbf7e commit f05d5c0
Show file tree
Hide file tree
Showing 83 changed files with 571 additions and 303 deletions.
2 changes: 1 addition & 1 deletion api-keys.d.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions api-keys.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps.d.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions apps.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion audits.d.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions audits.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion automations.d.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions automations.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion brands.d.ts
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
4 changes: 2 additions & 2 deletions brands.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion chunks/SMQGR3VM.js → chunks/74U42PVO.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getInvokeFetchRuntimeModule
} from "./3KD5W26Z.js";
} from "./DZO6ZOEA.js";
import {
isBrowser
} from "./2ZQ3ZX7F.js";
Expand Down
2 changes: 1 addition & 1 deletion chunks/VXEOAWM6.js → chunks/7MLP3MPP.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getQixRuntimeModule
} from "./3KD5W26Z.js";
} from "./DZO6ZOEA.js";

// src/public/qix.ts
function openAppSession(appSessionProps) {
Expand Down
Empty file removed chunks/7RHSSS4W.js
Empty file.
6 changes: 3 additions & 3 deletions chunks/UJV2QU2J.js → chunks/ANSUDXLV.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions chunks/E5TLRYTH.js → chunks/CXVDSJOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions chunks/3KD5W26Z.js → chunks/DZO6ZOEA.js
Original file line number Diff line number Diff line change
@@ -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)
);
}
Expand Down
4 changes: 2 additions & 2 deletions chunks/3REGOC54.js → chunks/MGUYVMAA.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
116 changes: 55 additions & 61 deletions chunks/OCV75U5H.js → chunks/OLOELRZ4.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import {
getInterceptors
} from "./TJWN2R6D.js";
import {
isBrowser,
isNode
Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand All @@ -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) {
Expand Down Expand Up @@ -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,
Expand All @@ -1827,7 +1818,7 @@ function invokeFetchWithUrlAndRetry(api, {
credentials,
contentType,
userAgent
}, performRetry, interceptors) {
}, performRetry) {
if (!cache[api]) {
cache[api] = {};
}
Expand All @@ -1847,7 +1838,6 @@ function invokeFetchWithUrlAndRetry(api, {
body,
contentType,
options,
interceptors,
authHeaders,
credentials,
userAgent
Expand All @@ -1863,7 +1853,6 @@ function invokeFetchWithUrlAndRetry(api, {
method,
body,
options,
interceptors,
authHeaders,
credentials
);
Expand All @@ -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;
Expand All @@ -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;
});
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Loading

0 comments on commit f05d5c0

Please sign in to comment.