Skip to content

Commit

Permalink
feat: qlik api updates (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: qlikossbuild <[email protected]>
  • Loading branch information
qlikossbuild and qlikossbuild authored Mar 26, 2024
1 parent 8ed49c9 commit f0d2773
Show file tree
Hide file tree
Showing 46 changed files with 160 additions and 157 deletions.
5 changes: 2 additions & 3 deletions api-keys.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/api-keys.ts
var getApiKeys = async (query, options) => invokeFetch("api-keys", {
Expand Down
2 changes: 2 additions & 0 deletions apps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,8 @@ type GetAppReloadLogHttpError = {
* @throws GetAppReloadMetadataHttpError
*/
declare const getAppReloadMetadata: (appId: string, reloadId: string, query: {
/** Include metadata for reloads ran with SkipStore flag set to true. Default: false */
includeSkipStoreReloads?: boolean;
/** Maximum number of records to return from this request. Default: 100 */
limit?: string;
}, options?: ApiCallOptions) => Promise<GetAppReloadMetadataHttpResponse>;
Expand Down
5 changes: 2 additions & 3 deletions apps.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/apps.ts
var createApp = async (body, options) => invokeFetch("apps", {
Expand Down
5 changes: 2 additions & 3 deletions audits.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/audits.ts
var getAudits = async (query, options) => invokeFetch("audits", {
Expand Down
5 changes: 2 additions & 3 deletions auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import {
logout,
registerAuthModule,
setDefaultHostConfig
} from "./chunks/W4FHGR6Z.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/UHM3LDRC.js";
import "./chunks/7PI3VAVE.js";
export {
auth_default as default,
getAccessToken,
Expand Down
5 changes: 2 additions & 3 deletions automations.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/automations.ts
var getAutomations = async (query, options) => invokeFetch("automations", {
Expand Down
5 changes: 2 additions & 3 deletions brands.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/brands.ts
var getBrands = async (query, options) => invokeFetch("brands", {
Expand Down
11 changes: 0 additions & 11 deletions chunks/4HB3TAEO.js

This file was deleted.

2 changes: 0 additions & 2 deletions chunks/KXPK2IU2.js → chunks/555I6RED.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "./4HB3TAEO.js";

// node_modules/.pnpm/@[email protected]/node_modules/@qlik/runtime-module-loader/dist/esm/index.js
window.__qlikMainPrivateResolvers = window.__qlikMainPrivateResolvers || {};
window.__qlikMainPrivateResolvers.mainUrlPromise = window.__qlikMainPrivateResolvers.mainUrlPromise || new Promise((resolve) => {
Expand Down
2 changes: 1 addition & 1 deletion chunks/STRQVY4L.js → chunks/5ADY5YDO.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getQixRuntimeModule
} from "./A4LOH2NH.js";
} from "./7PI3VAVE.js";

// src/public/qix.ts
function openAppSession(appSessionProps) {
Expand Down
6 changes: 3 additions & 3 deletions chunks/A4LOH2NH.js → chunks/7PI3VAVE.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// src/public/public-runtime-modules.ts
function getAuthRuntimeModule(hostConfig) {
const isNode = !!globalThis.process?.argv;
return isNode ? import("./H46323PG.js") : import("./KXPK2IU2.js").then((mod) => mod.importRuntimeModule("auth@v1", hostConfig));
return isNode ? import("./LI7EZYL4.js") : import("./555I6RED.js").then((mod) => mod.importRuntimeModule("auth@v1", hostConfig));
}
async function getQixRuntimeModule(hostConfig) {
await getAuthRuntimeModule(hostConfig);
const isNode = !!globalThis.process?.argv;
return isNode ? import("./VVREBIN2.js") : import("./KXPK2IU2.js").then((mod) => mod.importRuntimeModule("qix@v1", hostConfig));
return isNode ? import("./Z5KDIMTS.js") : import("./555I6RED.js").then((mod) => mod.importRuntimeModule("qix@v1", hostConfig));
}
async function getInvokeFetchRuntimeModule(hostConfig) {
await getAuthRuntimeModule(hostConfig);
const isNode = !!globalThis.process?.argv;
return isNode ? import("./ZVNQOWQU.js") : import("./KXPK2IU2.js").then((mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig));
return isNode ? import("./OKMBHX5N.js") : import("./555I6RED.js").then((mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig));
}

export {
Expand Down
2 changes: 1 addition & 1 deletion chunks/OYCPZDC3.js → chunks/AANKGPDX.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getInvokeFetchRuntimeModule
} from "./A4LOH2NH.js";
} from "./7PI3VAVE.js";

// src/public/invoke-fetch.ts
async function invokeFetch(api, props) {
Expand Down
3 changes: 1 addition & 2 deletions chunks/AEXRZSVI.js → chunks/J47F33WT.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import {
getRestCallAuthParams,
getWebSocketAuthParams,
toValidWebsocketLocationUrl
} from "./LJNLYKW3.js";
import "./4HB3TAEO.js";
} from "./SG2HWQOC.js";

// src/qix/session/enigma-session.ts
import enigma from "enigma.js";
Expand Down
3 changes: 1 addition & 2 deletions chunks/H46323PG.js → chunks/LI7EZYL4.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
toValidEnigmaLocationUrl,
toValidLocationUrl,
toValidWebsocketLocationUrl
} from "./LJNLYKW3.js";
import "./4HB3TAEO.js";
} from "./SG2HWQOC.js";
export {
AuthorizationError,
InvalidAuthTypeError,
Expand Down
3 changes: 1 addition & 2 deletions chunks/ZVNQOWQU.js → chunks/OKMBHX5N.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
invokeFetch,
invoke_fetch_default,
parseFetchResponse
} from "./LJNLYKW3.js";
import "./4HB3TAEO.js";
} from "./SG2HWQOC.js";
export {
EncodingError,
InvokeFetchError,
Expand Down
73 changes: 50 additions & 23 deletions chunks/LJNLYKW3.js → chunks/SG2HWQOC.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import {
__require
} from "./4HB3TAEO.js";

// src/platform/platform-functions.ts
var getPlatform = async (options = {}) => {
const isNodeEnvironment = typeof window === "undefined";
Expand Down Expand Up @@ -503,18 +499,32 @@ var none_default = {

// src/utils/utils.ts
import { nanoid } from "nanoid";
var forcedEnvironmentForTest;
function isBrowser() {
if (forcedEnvironmentForTest) {
return forcedEnvironmentForTest === "browser";
function isBrowserInternal() {
if (typeof window !== "undefined" && typeof window.document !== "undefined" && typeof self !== "undefined") {
return true;
}
return typeof window === "object" && typeof window.document === "object";
return false;
}
function isNode() {
if (forcedEnvironmentForTest) {
return forcedEnvironmentForTest === "node";
function isNodeInternal() {
if (typeof process !== "undefined" && process.version && process.versions.node) {
return true;
}
return false;
}
function getEnvironment() {
if (isNodeInternal()) {
return "node";
}
return typeof process === "object" && typeof __require === "function";
if (isBrowserInternal()) {
return "browser";
}
throw new Error("Environment detection failed. Supported environments are either a browser or in a node environment");
}
function isBrowser() {
return getEnvironment() === "browser";
}
function isNode() {
return getEnvironment() === "node";
}
function generateRandomString(targetLength) {
return nanoid(targetLength);
Expand Down Expand Up @@ -895,14 +905,16 @@ async function getOAuthAccessToken(hostConfig) {
}
return "";
}
lastOauthTokensCall = lastOauthTokensCall.then(async () => {
const tokens = await getOAuthTokensForBrowser(hostConfig);
if (tokens) {
handlePossibleErrors(tokens);
return tokens.accessToken || "";
}
return "";
});
if (isBrowser()) {
lastOauthTokensCall = lastOauthTokensCall.then(async () => {
const tokens = await getOAuthTokensForBrowser(hostConfig);
if (tokens) {
handlePossibleErrors(tokens);
return tokens.accessToken || "";
}
return "";
});
}
return lastOauthTokensCall;
}
async function refreshAccessToken(hostConfig) {
Expand Down Expand Up @@ -1317,7 +1329,8 @@ async function performActualHttpFetch(method, completeUrl, unencodedBody, conten
const headers = {
...contentTypeHeader,
...authHeaders,
...options?.headers
...options?.headers,
...getServiceOverrideHeaderFromLocalStorage()
};
const isCrossOrigin = isHostCrossOrigin(options?.hostConfig);
let request = {
Expand Down Expand Up @@ -1608,6 +1621,16 @@ async function interceptAuthenticationErrors(hostConfig, resultPromise, performR
throw error;
}
}
function getServiceOverrideHeaderFromLocalStorage() {
if (!isBrowser()) {
return {};
}
const header = localStorage.getItem("qmfe-api-service-overrides-header");
if (!header) {
return {};
}
return { "X-Qlik-Overrides": header };
}
function toDownloadableBlob(blob) {
const result2 = blob;
result2.download = (filename) => download(blob, filename);
Expand All @@ -1616,9 +1639,11 @@ function toDownloadableBlob(blob) {
async function download(blob, filename) {
if (isBrowser()) {
const a = document.createElement("a");
a.href = window.URL.createObjectURL(blob);
const blobUrl = window.URL.createObjectURL(blob);
a.href = blobUrl;
a.download = filename;
a.click();
window.URL.revokeObjectURL(blobUrl);
} else {
const { writeFileSync } = await import("fs");
writeFileSync(filename, Buffer.from(await blob.arrayBuffer()));
Expand Down Expand Up @@ -1691,6 +1716,7 @@ async function parseFetchResponse(fetchResponse, url) {
case "image/x-icon":
case "application/offset+octet-stream":
case "application/octet-stream":
case "application/zip":
resultData = toDownloadableBlob(await fetchResponse.blob());
break;
default:
Expand Down Expand Up @@ -1745,6 +1771,7 @@ export {
setDefaultHostConfig2 as setDefaultHostConfig,
checkForCrossDomainRequest,
logout,
isBrowser,
generateRandomString,
InvokeFetchError,
EncodingError,
Expand Down
2 changes: 1 addition & 1 deletion chunks/W4FHGR6Z.js → chunks/UHM3LDRC.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getAuthRuntimeModule
} from "./A4LOH2NH.js";
} from "./7PI3VAVE.js";

// src/public/auth.ts
function registerAuthModule(name, authModule) {
Expand Down
8 changes: 4 additions & 4 deletions chunks/VVREBIN2.js → chunks/Z5KDIMTS.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {
getPlatform,
handleAuthenticationError,
invokeFetch,
isBrowser,
isWindows,
toValidWebsocketLocationUrl
} from "./LJNLYKW3.js";
import "./4HB3TAEO.js";
} from "./SG2HWQOC.js";

// src/qix/session/shared-sessions.ts
var globalEventListeners = /* @__PURE__ */ new Set();
Expand Down Expand Up @@ -83,7 +83,7 @@ function listenForWindowsAuthenticationInformation(session) {
return authSuggestedInWebsocket;
}
async function createAndSetupEnigmaSession(props, canRetry) {
const { createEnigmaSession } = await import("./AEXRZSVI.js");
const { createEnigmaSession } = await import("./J47F33WT.js");
const session = await createEnigmaSession(props);
setupSessionListeners(session, props);
let global;
Expand Down Expand Up @@ -545,7 +545,7 @@ function resumeOnlyOnReattach(bool) {
resumeShouldRejectPromiseIfNotReattached(bool);
}
var externalApps = {};
var isBrowserEnvironment = typeof window !== "undefined";
var isBrowserEnvironment = isBrowser();

// src/qix/qix.ts
var qix = {
Expand Down
5 changes: 2 additions & 3 deletions collections.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/collections.ts
var getCollections = async (query, options) => invokeFetch("collections", {
Expand Down
5 changes: 2 additions & 3 deletions csp-origins.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/csp-origins.ts
var getCSPEntries = async (query, options) => invokeFetch("csp-origins", {
Expand Down
5 changes: 2 additions & 3 deletions data-assets.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/data-assets.ts
var deleteDataAssets = async (body, options) => invokeFetch("data-assets", {
Expand Down
5 changes: 2 additions & 3 deletions data-connections.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/data-connections.ts
var getDataConnections = async (query, options) => invokeFetch("data-connections", {
Expand Down
5 changes: 2 additions & 3 deletions data-credentials.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/OYCPZDC3.js";
import "./chunks/A4LOH2NH.js";
import "./chunks/4HB3TAEO.js";
} from "./chunks/AANKGPDX.js";
import "./chunks/7PI3VAVE.js";

// src/public/rest/data-credentials.ts
var deleteDataCredential = async (qID, query, options) => invokeFetch("data-credentials", {
Expand Down
Loading

0 comments on commit f0d2773

Please sign in to comment.