Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace sdk #1607

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions commands/create/templates/mashup/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"dependencies": {
"@nebula.js/stardust": "<%= nebulaVersion %>",
"@nebula.js/sn-bar-chart": "^1.x",
"@qlik/sdk": "^0.12.0",
"enigma.js": "^2.6.3",
"parcel": "2.8.0"
"@qlik/api": "^1.17.0",
"parcel": "2.12.0"
}
}
86 changes: 0 additions & 86 deletions commands/create/templates/mashup/src/Authenticator.js

This file was deleted.

18 changes: 0 additions & 18 deletions commands/create/templates/mashup/src/configure.js

This file was deleted.

26 changes: 0 additions & 26 deletions commands/create/templates/mashup/src/connect.js

This file was deleted.

45 changes: 30 additions & 15 deletions commands/create/templates/mashup/src/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
/* eslint-disable */
import { AuthType } from '@qlik/sdk';
import embed from './configure';
import connect from './connect';
import qlikApi from '@qlik/api';
import { embed } from '@nebula.js/stardust';
import barchart from '@nebula.js/sn-bar-chart';

async function run() {
const app = await connect({
connectionType: '<AuthType.SOME_CONNECTION_TYPE>',
url: '<URL>',
appId: '<App id>',
const appId = '<App id>';
// https://github.com/qlik-oss/qlik-api-ts/blob/main/docs/authentication.md
const hostConfig = {
authType: '<AuthenticationType: ex "oauth2" or "cookie"',
host: '<URL>',
// connection config based on authType
webIntegrationId: '<Qlik web integration id>', // cookie
clientId: '<Qlik OAuth client id>', // oauth2
accessTokenStorage: 'session', // for oauth2
};

// you should use only one of below keys
// based on your `connectionType`
clientId: '<Qlik OAuth client id>',
webIntegrationId: '<Qlik web integration id>',
});
qlikApi.auth.setDefaultHostConfig(hostConfig);
const appSession = qlikApi.qix.openAppSession(appId);
const app = await appSession.getDoc();

const n = embed(app);
const nebula = embed(app, {
context: {
theme: 'light',
language: 'en-US',
},
types: [
{
name: 'barchart',
load: () => Promise.resolve(barchart),
},
],
});

(await n.selections()).mount(document.querySelector('.toolbar'));
(await nebula.selections()).mount(document.querySelector('.toolbar'));

// n.render({});
// nebula.render({ element: document.querySelector('.object'), id: "" });
}

run();
Loading