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 22, 2024
1 parent 840a2fb commit 6a35b62
Show file tree
Hide file tree
Showing 48 changed files with 194 additions and 121 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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/APL5KJXS.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/3W4PFUMC.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/brands.ts
Expand Down
6 changes: 3 additions & 3 deletions chunks/ACBHOLKM.js → chunks/3KD5W26Z.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("./LDIN4JFA.js") : import("./EUWNVVK5.js").then(
return isNode ? import("./CUC5USM5.js") : import("./EUWNVVK5.js").then(
(mod) => mod.importRuntimeModule("auth@v1", hostConfig)
);
}
async function getQixRuntimeModule(hostConfig) {
await getAuthRuntimeModule(hostConfig);
const isNode = !!globalThis.process?.argv;
return isNode ? import("./IR7AJR5W.js") : import("./EUWNVVK5.js").then(
return isNode ? import("./UJV2QU2J.js") : import("./EUWNVVK5.js").then(
(mod) => mod.importRuntimeModule("qix@v1", hostConfig)
);
}
async function getInvokeFetchRuntimeModule(hostConfig) {
await getAuthRuntimeModule(hostConfig);
const isNode = !!globalThis.process?.argv;
return isNode ? import("./TVT6R5GS.js") : import("./EUWNVVK5.js").then(
return isNode ? import("./E5TLRYTH.js") : import("./EUWNVVK5.js").then(
(mod) => mod.importRuntimeModule("invoke-fetch@v1", hostConfig)
);
}
Expand Down
61 changes: 32 additions & 29 deletions chunks/LFLIIDGI.js → chunks/3REGOC54.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
generateRandomString,
getCsrfToken,
getRestCallAuthParams,
getWebSocketAuthParams,
toValidWebsocketLocationUrl
} from "./27XOYFEK.js";
} from "./OCV75U5H.js";
import "./7RHSSS4W.js";
import {
isBrowser,
isNode
} from "./2ZQ3ZX7F.js";

Expand Down Expand Up @@ -10371,54 +10369,59 @@ async function createEnigmaSession({
ttlSeconds,
workloadType
}) {
const isNodeEnvironment = isNode();
const locationUrl = toValidWebsocketLocationUrl(hostConfig);
const reloadUri = encodeURIComponent(`${locationUrl}/sense/app/${appId}`);
const ttlPart = ttlSeconds !== void 0 && ttlSeconds >= 0 ? `/ttl/${ttlSeconds}` : "";
const identityPart = identity ? `/identity/${identity}` : "";
const workloadTypePart = useReloadEngine ? "&workloadType=interactive-reload" : workloadType ? `&workloadType=${workloadType}` : "";
let csrfToken = "";
if (isBrowser() && (!hostConfig || hostConfig.authType === "cookie" || hostConfig.authType === "windowscookie")) {
try {
csrfToken = await getCsrfToken(hostConfig);
} catch {
}
}
const csrfPart = csrfToken ? `&qlik-csrf-token=${csrfToken}` : "";
let url = `${locationUrl}/app/${appId}${identityPart}${ttlPart}?reloadUri=${reloadUri}${workloadTypePart}${csrfPart}`.replace(
const baseUrl = `${locationUrl}/app/${appId}${identityPart}${ttlPart}?reloadUri=${reloadUri}${workloadTypePart}`.replace(
/^http/,
"ws"
);
const isNodeEnvironment = isNode();
let createSocketMethod;
let createSocketBuilder;
if (isNodeEnvironment) {
const { headers, queryParams } = await getRestCallAuthParams({ hostConfig, method: "POST" });
const WS = (await import("ws")).default;
Object.entries(queryParams).forEach(([key, value]) => {
url = `${url}&${key}=${value}`;
});
createSocketMethod = (socketUrl) => new WS(socketUrl, void 0, {
headers
});
createSocketBuilder = async () => {
let url = baseUrl;
const { headers, queryParams } = await getRestCallAuthParams({ hostConfig, method: "POST" });
Object.entries(queryParams).forEach(([key, value]) => {
url = `${url}&${key}=${value}`;
});
return (socketUrl) => new WS(url, void 0, {
headers
});
};
} else {
const { queryParams } = await getWebSocketAuthParams({ hostConfig });
Object.entries(queryParams).forEach(([key, value]) => {
url = `${url}&${key}=${value}`;
});
createSocketMethod = (socketUrl) => new WebSocket(socketUrl);
createSocketBuilder = async () => {
let url = baseUrl;
const { queryParams } = await getWebSocketAuthParams({ hostConfig });
Object.entries(queryParams).forEach(([key, value]) => {
url = `${url}&${key}=${value}`;
});
return (socketUrl) => new WebSocket(url);
};
}
return enigma.create({
const session = enigma.create({
schema: engine_api_default,
mixins: mixins5,
url,
url: baseUrl,
suspendOnClose: !useReloadEngine,
createSocket: createSocketMethod,
createSocket: await createSocketBuilder(),
requestInterceptors: [somethingWithEmptyMethodsRequestInterceptor],
responseInterceptors: [
retryAbortedErrorResponseInterceptor,
retryModalObjectError,
somethingWithErrorPopupsResponnseInterceptor
]
});
const originalResume = session.resume.bind(session);
const resume = async (onlyIfAttached) => {
session.rpc.createSocket = await createSocketBuilder();
await originalResume(onlyIfAttached);
};
session.resume = resume;
return session;
}
export {
createEnigmaSession
Expand Down
2 changes: 1 addition & 1 deletion chunks/APL5KJXS.js → chunks/3W4PFUMC.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getAuthRuntimeModule
} from "./ACBHOLKM.js";
} from "./3KD5W26Z.js";

// src/public/auth.ts
function registerAuthModule(name, authModule) {
Expand Down
2 changes: 1 addition & 1 deletion chunks/LDIN4JFA.js → chunks/CUC5USM5.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
toValidEnigmaLocationUrl,
toValidLocationUrl,
toValidWebsocketLocationUrl
} from "./27XOYFEK.js";
} from "./OCV75U5H.js";
import "./7RHSSS4W.js";
import "./2ZQ3ZX7F.js";
export {
Expand Down
2 changes: 1 addition & 1 deletion chunks/TVT6R5GS.js → chunks/E5TLRYTH.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
invokeFetch,
invoke_fetch_default,
parseFetchResponse
} from "./27XOYFEK.js";
} from "./OCV75U5H.js";
import "./7RHSSS4W.js";
import "./2ZQ3ZX7F.js";
export {
Expand Down
16 changes: 8 additions & 8 deletions chunks/27XOYFEK.js → chunks/OCV75U5H.js
Original file line number Diff line number Diff line change
Expand Up @@ -1403,27 +1403,28 @@ function getXrfKey(hostConfig) {
}

// src/auth/internal/default-auth-modules/windows-cookie.ts
function getRestCallAuthParams7({
async function getRestCallAuthParams7({
hostConfig
}) {
return Promise.resolve({
return {
headers: {
"X-Qlik-XrfKey": getXrfKey(hostConfig)
},
queryParams: {
xrfkey: getXrfKey(hostConfig)
},
credentials: getCredentialsForCookieAuth(hostConfig)
});
};
}
function getWebSocketAuthParams7({
async function getWebSocketAuthParams7({
hostConfig
}) {
return Promise.resolve({
return {
queryParams: {
xrfkey: getXrfKey(hostConfig)
xrfkey: getXrfKey(hostConfig),
"qlik-csrf-token": await getCsrfToken(hostConfig, true)
}
});
};
}
async function handleAuthenticationError7({
hostConfig
Expand Down Expand Up @@ -2146,6 +2147,5 @@ export {
clearApiCache,
parseFetchResponse,
invoke_fetch_default,
getCsrfToken,
auth_default
};
2 changes: 1 addition & 1 deletion chunks/TL5KLSB6.js → chunks/SMQGR3VM.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getInvokeFetchRuntimeModule
} from "./ACBHOLKM.js";
} from "./3KD5W26Z.js";
import {
isBrowser
} from "./2ZQ3ZX7F.js";
Expand Down
4 changes: 2 additions & 2 deletions chunks/IR7AJR5W.js → chunks/UJV2QU2J.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
invokeFetch,
isWindows,
toValidWebsocketLocationUrl
} from "./27XOYFEK.js";
} from "./OCV75U5H.js";
import "./7RHSSS4W.js";
import {
isBrowser
Expand Down Expand Up @@ -161,7 +161,7 @@ function listenForWindowsAuthenticationInformation(session) {
return authSuggestedInWebsocket;
}
async function createAndSetupEnigmaSession(props, canRetry) {
const { createEnigmaSession } = await import("./LFLIIDGI.js");
const { createEnigmaSession } = await import("./3REGOC54.js");
const session = await createEnigmaSession(props);
setupSessionListeners(session, props);
let global;
Expand Down
2 changes: 1 addition & 1 deletion chunks/HPX2VBF4.js → chunks/VXEOAWM6.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
getQixRuntimeModule
} from "./ACBHOLKM.js";
} from "./3KD5W26Z.js";

// src/public/qix.ts
function openAppSession(appSessionProps) {
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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.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/TL5KLSB6.js";
import "./chunks/ACBHOLKM.js";
} from "./chunks/SMQGR3VM.js";
import "./chunks/3KD5W26Z.js";
import "./chunks/2ZQ3ZX7F.js";

// src/public/rest/data-connections.ts
Expand Down
Loading

0 comments on commit 6a35b62

Please sign in to comment.