Skip to content

Commit

Permalink
feat: qlik api updates (#97)
Browse files Browse the repository at this point in the history
Co-authored-by: qlikossbuild <[email protected]>
  • Loading branch information
qlikossbuild and qlikossbuild authored Oct 23, 2024
1 parent 840a2fb commit 89cbf7e
Show file tree
Hide file tree
Showing 49 changed files with 199 additions and 122 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
2 changes: 1 addition & 1 deletion data-connections.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ declare const getDataConnections: (query: {
dataName?: string;
/** Returns extended list of properties (e.g. encrypted credential string) when set to true. */
extended?: boolean;
/** Filtering resources by properties (filterable properties only) using SCIM filter string. Note the filter string only applies to connections managed by data-connections service, i.e. filtering doesn't apply to DataFile connections. */
/** Filtering resources by properties (filterable properties only) using SCIM filter string. Note the filter string only applies to connections managed by data-connections service, i.e. filtering doesn't apply to DataFile connections. When filtering on datetime property (e.g. created, updated), datetime should be in RFC3339 format. */
filter?: string;
/** Base Qri (encrypted) will be returned when the query is set to true, default is false */
includeQris?: boolean;
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 89cbf7e

Please sign in to comment.