Skip to content

Commit

Permalink
feat: qlik api updates (#70)
Browse files Browse the repository at this point in the history
Co-authored-by: qlikossbuild <[email protected]>
  • Loading branch information
qlikossbuild and qlikossbuild authored Jul 3, 2024
1 parent 31bb3b6 commit c40fcd1
Show file tree
Hide file tree
Showing 47 changed files with 169 additions and 172 deletions.
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/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/api-keys.ts
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/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/apps.ts
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/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.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/IOUD76RB.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/RJSXIVZK.js";
import "./chunks/7TFYIWPM.js";
export {
auth_default as default,
getAccessToken,
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/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/automations.ts
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/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/brands.ts
Expand Down
2 changes: 1 addition & 1 deletion chunks/5V4BMSM2.js → chunks/4VOVGPYE.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getInvokeFetchRuntimeModule
} from "./5T2SBCJG.js";
} from "./7TFYIWPM.js";
import {
isBrowser
} from "./2ZQ3ZX7F.js";
Expand Down
2 changes: 1 addition & 1 deletion chunks/NWOESCMR.js → chunks/64ZZ22PG.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getQixRuntimeModule
} from "./5T2SBCJG.js";
} from "./7TFYIWPM.js";

// src/public/qix.ts
function openAppSession(appSessionProps) {
Expand Down
6 changes: 3 additions & 3 deletions chunks/5T2SBCJG.js → chunks/7TFYIWPM.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("./JIAZ5W7Y.js") : import("./ADP23C4M.js").then((mod) => mod.importRuntimeModule("auth@v1", hostConfig));
return isNode ? import("./OJ64BEOX.js") : import("./O25AVKJT.js").then((mod) => mod.importRuntimeModule("auth@v1", hostConfig));
}
async function getQixRuntimeModule(hostConfig) {
await getAuthRuntimeModule(hostConfig);
const isNode = !!globalThis.process?.argv;
return isNode ? import("./HACHQCYI.js") : import("./ADP23C4M.js").then((mod) => mod.importRuntimeModule("qix@v1", hostConfig));
return isNode ? import("./VCS5M2TX.js") : import("./O25AVKJT.js").then((mod) => mod.importRuntimeModule("qix@v1", hostConfig));
}
async function getInvokeFetchRuntimeModule(hostConfig) {
await getAuthRuntimeModule(hostConfig);
const isNode = !!globalThis.process?.argv;
return isNode ? import("./CNQQPV5L.js") : import("./ADP23C4M.js").then((mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig));
return isNode ? import("./ZJKE2OY5.js") : import("./O25AVKJT.js").then((mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig));
}

export {
Expand Down
64 changes: 41 additions & 23 deletions chunks/RN5AUIPP.js → chunks/D7TSCA65.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ async function handlePotentialAuthenticationErrorAndRetry(hostConfig, fn) {
canRetry: true
});
if (retry) {
return await fn();
return fn();
}
throw err;
}
Expand Down Expand Up @@ -1605,7 +1605,7 @@ async function interceptAuthenticationErrors(hostConfig, resultPromise, performR
const err = error;
if (err.status === 401 || err.status === 403 || (err.status === 301 || err.status === 302) && await isWindows(hostConfig)) {
if (globalThis.loggingOut) {
return await neverResolvingPromise();
return neverResolvingPromise();
}
const { retry, preventDefault } = await handleAuthenticationError({
hostConfig,
Expand All @@ -1615,7 +1615,7 @@ async function interceptAuthenticationErrors(hostConfig, resultPromise, performR
canRetry: !!performRetry
});
if (retry && performRetry) {
return await performRetry();
return performRetry();
}
if (preventDefault) {
return neverResolvingPromise();
Expand All @@ -1634,9 +1634,13 @@ function getServiceOverrideHeaderFromLocalStorage() {
}
return { "X-Qlik-Overrides": header };
}
function toDownloadableBlob(blob) {
function toDownloadableBlob(blob, name) {
const result2 = blob;
result2.download = (filename) => download(blob, filename);
if (name) {
result2.download = (filename = name) => download(blob, filename);
} else {
result2.download = (filename) => download(blob, filename);
}
return result2;
}
async function download(blob, filename) {
Expand Down Expand Up @@ -1722,25 +1726,39 @@ function clearApiCache(api) {
async function parseFetchResponse(fetchResponse, url) {
let resultData;
const contentType = fetchResponse.headers.get("content-type")?.split(";")[0];
switch (contentType) {
case "image/png":
case "image/jpeg":
case "image/x-icon":
case "application/offset+octet-stream":
case "application/octet-stream":
case "application/zip":
resultData = toDownloadableBlob(await fetchResponse.blob());
break;
case "text/event-stream":
resultData = fetchResponse.body;
break;
default:
try {
resultData = await fetchResponse.text();
resultData = JSON.parse(resultData);
} catch {
const contentDisposition = fetchResponse.headers.get("content-disposition")?.split(";");
if (contentDisposition && contentDisposition[0] === "attachment") {
let filename = "";
for (let i = 1; i < contentDisposition.length; i++) {
const attr = contentDisposition[i].trim();
if (attr.indexOf("filename") === 0) {
const start = attr.indexOf('"');
const end = attr.lastIndexOf('"');
filename = attr.slice(start + 1, end);
}
break;
}
resultData = toDownloadableBlob(await fetchResponse.blob(), filename);
} else {
switch (contentType) {
case "image/png":
case "image/jpeg":
case "image/x-icon":
case "application/offset+octet-stream":
case "application/octet-stream":
case "application/zip":
resultData = toDownloadableBlob(await fetchResponse.blob());
break;
case "text/event-stream":
resultData = fetchResponse.body;
break;
default:
try {
resultData = await fetchResponse.text();
resultData = JSON.parse(resultData);
} catch {
}
break;
}
}
const { status, statusText, headers } = fetchResponse;
const errorMsg = `request to '${url}' failed with status ${status} ${statusText}.`;
Expand Down
4 changes: 1 addition & 3 deletions chunks/LIPAU4N5.js → chunks/FFOAWSDK.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getRestCallAuthParams,
getWebSocketAuthParams,
toValidWebsocketLocationUrl
} from "./RN5AUIPP.js";
} from "./D7TSCA65.js";
import {
isBrowser,
isNode
Expand Down Expand Up @@ -9748,7 +9748,6 @@ var mixin6 = {
createBookmark(_createBookmark, props) {
return _createBookmark(
merge2(
{},
{
qInfo: {
qType: "bookmark"
Expand All @@ -9766,7 +9765,6 @@ var mixin6 = {
createBookmarkEx(_createBookmarkEx, props, patchObjs) {
return _createBookmarkEx(
merge2(
true,
{
qInfo: {
qType: "bookmark"
Expand Down
2 changes: 1 addition & 1 deletion chunks/ADP23C4M.js → chunks/O25AVKJT.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// node_modules/.pnpm/@[email protected].6/node_modules/@qlik/runtime-module-loader/dist/index.js
// node_modules/.pnpm/@[email protected].7/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);
Expand Down
2 changes: 1 addition & 1 deletion chunks/JIAZ5W7Y.js → chunks/OJ64BEOX.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
toValidEnigmaLocationUrl,
toValidLocationUrl,
toValidWebsocketLocationUrl
} from "./RN5AUIPP.js";
} from "./D7TSCA65.js";
import "./2ZQ3ZX7F.js";
export {
AuthorizationError,
Expand Down
2 changes: 1 addition & 1 deletion chunks/IOUD76RB.js → chunks/RJSXIVZK.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getAuthRuntimeModule
} from "./5T2SBCJG.js";
} from "./7TFYIWPM.js";

// src/public/auth.ts
function registerAuthModule(name, authModule) {
Expand Down
4 changes: 2 additions & 2 deletions chunks/HACHQCYI.js → chunks/VCS5M2TX.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
invokeFetch,
isWindows,
toValidWebsocketLocationUrl
} from "./RN5AUIPP.js";
} from "./D7TSCA65.js";
import {
isBrowser
} from "./2ZQ3ZX7F.js";
Expand Down Expand Up @@ -101,7 +101,7 @@ function listenForWindowsAuthenticationInformation(session) {
return authSuggestedInWebsocket;
}
async function createAndSetupEnigmaSession(props, canRetry) {
const { createEnigmaSession } = await import("./LIPAU4N5.js");
const { createEnigmaSession } = await import("./FFOAWSDK.js");
const session = await createEnigmaSession(props);
setupSessionListeners(session, props);
let global;
Expand Down
2 changes: 1 addition & 1 deletion chunks/CNQQPV5L.js → chunks/ZJKE2OY5.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
invokeFetch,
invoke_fetch_default,
parseFetchResponse
} from "./RN5AUIPP.js";
} from "./D7TSCA65.js";
import "./2ZQ3ZX7F.js";
export {
EncodingError,
Expand Down
4 changes: 2 additions & 2 deletions collections.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/collections.ts
Expand Down
4 changes: 2 additions & 2 deletions csp-origins.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/csp-origins.ts
Expand Down
4 changes: 2 additions & 2 deletions data-assets.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/data-assets.ts
Expand Down
4 changes: 2 additions & 2 deletions data-connections.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/data-connections.ts
Expand Down
4 changes: 2 additions & 2 deletions data-credentials.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/data-credentials.ts
Expand Down
4 changes: 2 additions & 2 deletions data-files.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/data-files.ts
Expand Down
4 changes: 2 additions & 2 deletions extensions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/extensions.ts
Expand Down
2 changes: 2 additions & 0 deletions glossaries.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ type TermLinksTo = {
status?: number;
/** Different formats based on subresource type. Could be e.g. OID or UUID. */
subResourceId?: string;
/** Populated and true if no matching subresource is found on parent resource. E.g. if a dataset field no longer exist but a link to that field exists. */
subResourceInvalid?: boolean;
subResourceName?: string;
subResourceType?: "master_dimension" | "master_measure" | "field";
/** Describes reason for item status during batch operation. E.g. why an error occurs during creation. */
Expand Down
4 changes: 2 additions & 2 deletions glossaries.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/glossaries.ts
Expand Down
4 changes: 2 additions & 2 deletions groups.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/groups.ts
Expand Down
4 changes: 2 additions & 2 deletions identity-providers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
clearApiCache,
invokeFetch
} from "./chunks/5V4BMSM2.js";
import "./chunks/5T2SBCJG.js";
} from "./chunks/4VOVGPYE.js";
import "./chunks/7TFYIWPM.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/identity-providers.ts
Expand Down
Loading

0 comments on commit c40fcd1

Please sign in to comment.