@qlik/sdk
Advanced tools
Comparing version 0.21.1 to 0.22.0
@@ -80,3 +80,3 @@ var __create = Object.create; | ||
this.rpcClient = new import_rpcClient.default(this.config); | ||
this.rpc = (appId) => this.rpcClient.rpc(appId); | ||
this.rpc = (appId, rpcConfig = { delta: true }) => this.rpcClient.rpc(appId, rpcConfig); | ||
Object.assign(this.rpc, { interceptors: this.rpcClient.interceptors }); | ||
@@ -83,0 +83,0 @@ this.rest = restClient.restClientInstance; |
@@ -94,3 +94,3 @@ var __defProp = Object.defineProperty; | ||
} | ||
const version = "0.21.1"; | ||
const version = "0.22.0"; | ||
const anyBody = init?.body; | ||
@@ -97,0 +97,0 @@ const hasFormDataBody = anyBody?.append !== void 0; |
@@ -70,3 +70,3 @@ var __create = Object.create; | ||
} | ||
async rpc(appId) { | ||
async rpc(appId, rpcConfig = { delta: true }) { | ||
const apiResponseInterceptor = { | ||
@@ -105,6 +105,8 @@ onFulfilled: (session, req, res) => { | ||
createSocket, | ||
protocol: { delta: false } | ||
protocol: { delta: rpcConfig.delta } | ||
}); | ||
this.interceptors.response.use(session.intercept.response[1]); | ||
this.interceptors.response.use(apiResponseInterceptor); | ||
session.intercept.response = this.interceptors.response.handlers; | ||
this.interceptors.request.use(session.intercept.request[0]); | ||
session.intercept.request = this.interceptors.request.handlers; | ||
@@ -111,0 +113,0 @@ session.on("closed", (data) => { |
@@ -19,2 +19,3 @@ var __create = Object.create; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
@@ -49,3 +50,2 @@ // If the importer is in node compatibility mode or this is not an ESM | ||
OauthTokens: () => import_Oauth_Tokens2.OauthTokens, | ||
Qix: () => Qix, | ||
Questions: () => import_Questions2.Questions, | ||
@@ -88,3 +88,3 @@ Quotas: () => import_Quotas2.Quotas, | ||
var import_Audits = require("./apis/Audits.js"); | ||
var Qix = __toESM(require("./apis/Qix.js")); | ||
__reExport(qlik_exports, require("./apis/Qix.js"), module.exports); | ||
var import_types2 = require("./types/types.js"); | ||
@@ -165,3 +165,2 @@ var import_errors = require("./errors.js"); | ||
OauthTokens, | ||
Qix, | ||
Questions, | ||
@@ -176,3 +175,4 @@ Quotas, | ||
WebIntegrations, | ||
Webhooks | ||
Webhooks, | ||
...require("./apis/Qix.js") | ||
}); |
@@ -35,2 +35,9 @@ import { Config } from '../types/types.js'; | ||
rest: RestClientInstance; | ||
/** | ||
* | ||
* @param appId - Id of the app | ||
* @param rpcConfig.delta - Set to false to disable the use of the | ||
* bandwidth-reducing delta protocol. | ||
* | ||
*/ | ||
rpc: RpcClientInstance; | ||
@@ -37,0 +44,0 @@ /** generates the websocket url |
@@ -57,3 +57,3 @@ import { | ||
this.rpcClient = new RpcClient(this.config); | ||
this.rpc = (appId) => this.rpcClient.rpc(appId); | ||
this.rpc = (appId, rpcConfig = { delta: true }) => this.rpcClient.rpc(appId, rpcConfig); | ||
Object.assign(this.rpc, { interceptors: this.rpcClient.interceptors }); | ||
@@ -60,0 +60,0 @@ this.rest = restClient.restClientInstance; |
@@ -115,3 +115,3 @@ // src/errors.ts | ||
} | ||
const version = "0.21.1"; | ||
const version = "0.22.0"; | ||
const anyBody = init?.body; | ||
@@ -118,0 +118,0 @@ const hasFormDataBody = anyBody?.append !== void 0; |
import { Config, RpcSession, Interceptors } from '../types/types.js'; | ||
import { RestClientInstance } from './restClient.js'; | ||
type EnigmaRpc = (appId: string) => Promise<RpcSession>; | ||
type EnigmaRpc = (appId: string, rpcConfig?: { | ||
delta?: boolean; | ||
}) => Promise<RpcSession>; | ||
export interface RpcClientInstance extends EnigmaRpc { | ||
@@ -24,3 +26,5 @@ interceptors?: Interceptors; | ||
constructor(config: Config, rest?: RestClientInstance); | ||
rpc(appId: string): Promise<RpcSession>; | ||
rpc(appId: string, rpcConfig?: { | ||
delta?: boolean; | ||
}): Promise<RpcSession>; | ||
/** | ||
@@ -27,0 +31,0 @@ * @param appId - the application Id |
@@ -27,3 +27,3 @@ import Auth from './auth/auth.js'; | ||
import { Audits } from './apis/Audits.js'; | ||
export * as Qix from './apis/Qix.js'; | ||
export * from './apis/Qix.js'; | ||
export { AuthType } from './types/types.js'; | ||
@@ -30,0 +30,0 @@ export type { Config, ClaimsAndOptions, EventListener, EventTypes, } from './types/types.js'; |
@@ -25,3 +25,3 @@ import Auth from "./auth/auth.js"; | ||
import { Audits } from "./apis/Audits.js"; | ||
import * as Qix from "./apis/Qix.js"; | ||
export * from "./apis/Qix.js"; | ||
import { AuthType } from "./types/types.js"; | ||
@@ -105,3 +105,2 @@ import { | ||
OauthTokens2 as OauthTokens, | ||
Qix, | ||
Questions2 as Questions, | ||
@@ -108,0 +107,0 @@ Quotas2 as Quotas, |
@@ -57,3 +57,3 @@ import { | ||
this.rpcClient = new RpcClient(this.config); | ||
this.rpc = (appId) => this.rpcClient.rpc(appId); | ||
this.rpc = (appId, rpcConfig = { delta: true }) => this.rpcClient.rpc(appId, rpcConfig); | ||
Object.assign(this.rpc, { interceptors: this.rpcClient.interceptors }); | ||
@@ -60,0 +60,0 @@ this.rest = restClient.restClientInstance; |
@@ -87,3 +87,3 @@ | ||
} | ||
const version = "0.21.1"; | ||
const version = "0.22.0"; | ||
const anyBody = init?.body; | ||
@@ -90,0 +90,0 @@ const hasFormDataBody = anyBody?.append !== void 0; |
@@ -43,3 +43,3 @@ | ||
} | ||
async rpc(appId) { | ||
async rpc(appId, rpcConfig = { delta: true }) { | ||
const apiResponseInterceptor = { | ||
@@ -78,6 +78,8 @@ onFulfilled: (session, req, res) => { | ||
createSocket, | ||
protocol: { delta: false } | ||
protocol: { delta: rpcConfig.delta } | ||
}); | ||
this.interceptors.response.use(session.intercept.response[1]); | ||
this.interceptors.response.use(apiResponseInterceptor); | ||
session.intercept.response = this.interceptors.response.handlers; | ||
this.interceptors.request.use(session.intercept.request[0]); | ||
session.intercept.request = this.interceptors.request.handlers; | ||
@@ -84,0 +86,0 @@ session.on("closed", (data) => { |
@@ -25,3 +25,3 @@ import Auth from "./auth/auth.js"; | ||
import { Audits } from "./apis/Audits.js"; | ||
import * as Qix from "./apis/Qix.js"; | ||
export * from "./apis/Qix.js"; | ||
import { AuthType } from "./types/types.js"; | ||
@@ -105,3 +105,2 @@ import { | ||
OauthTokens2 as OauthTokens, | ||
Qix, | ||
Questions2 as Questions, | ||
@@ -108,0 +107,0 @@ Quotas2 as Quotas, |
{ | ||
"name": "@qlik/sdk", | ||
"version": "0.21.1", | ||
"version": "0.22.0", | ||
"description": "The Qlik Platform SDKs are a suite of tools, libraries, and documentation that simplifies building high-quality and performant applications on top of the Qlik Sense Platform.", | ||
@@ -205,3 +205,3 @@ "types": "dist/esm/qlik.d.ts", | ||
"build:types": "tsc -p tsconfig.build.esm.json --emitDeclarationOnly --outDir ./dist/esm", | ||
"docs": "typedoc", | ||
"docs": "typedoc --excludePrivate", | ||
"cy:open": "cypress open --project ./test/browser", | ||
@@ -230,3 +230,3 @@ "cy:run:web-integration": "cypress run --project ./test/browser --spec ./test/browser/web.e2e.js", | ||
"gen-build": "yarn generate-code && yarn build", | ||
"prepare": "git config core.hooksPath hooks " | ||
"prepare": "git config core.hooksPath hooks" | ||
}, | ||
@@ -254,6 +254,6 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "7.21.3", | ||
"@babel/core": "7.21.8", | ||
"@babel/preset-env": "7.21.5", | ||
"@babel/preset-typescript": "7.21.4", | ||
"@qlik-trial/spectacular": "0.21.3", | ||
"@qlik-trial/spectacular": "0.21.11", | ||
"@types/jest": "29.5.1", | ||
@@ -265,5 +265,5 @@ "@types/node": "18.15.11", | ||
"cross-env": "7.0.3", | ||
"cypress": "12.11.0", | ||
"cypress": "12.12.0", | ||
"dotenv": "16.0.3", | ||
"esbuild": "0.17.17", | ||
"esbuild": "0.17.19", | ||
"eslint": "8.40.0", | ||
@@ -283,3 +283,3 @@ "eslint-config-airbnb-base": "15.0.0", | ||
"ts-node": "10.9.1", | ||
"typedoc": "0.24.6", | ||
"typedoc": "0.24.7", | ||
"typedoc-plugin-markdown": "3.15.3", | ||
@@ -286,0 +286,0 @@ "typedoc-plugin-rename-defaults": "0.6.5", |
@@ -15,2 +15,3 @@ # qlik-sdk-typescript | ||
- [OAuth2](#oauth2) | ||
- [Fetching Delta values with Engine RPC](#fetching-delta-values-with-engine-rpc) | ||
- [Fetch](#fetch) | ||
@@ -154,2 +155,16 @@ - [ES6-Modules](#es6-modules) | ||
## Fetching Delta values with Engine RPC | ||
Delta member in app open config or rpc function can be used to change behaviour of engine response. By default this is set to true for bandwidth reducing, so engine only sends changes in object and default delta interceptors evaluate the object. On setting this property false while opening an app or while setting up the session, engine will respond with entire object on each request. | ||
Example to set delta false: | ||
``` | ||
const session = await app.open({ delta: false }); | ||
``` | ||
OR | ||
``` | ||
const session = await auth.rpc(appId, { delta: false }); | ||
``` | ||
## Fetch | ||
@@ -156,0 +171,0 @@ |
{ | ||
"name": "@qlik/sdk", | ||
"version": "0.21.1", | ||
"version": "0.22.0", | ||
"description": "The Qlik Platform SDKs are a suite of tools, libraries, and documentation that simplifies building high-quality and performant applications on top of the Qlik Sense Platform.", | ||
@@ -205,3 +205,3 @@ "types": "dist/esm/qlik.d.ts", | ||
"build:types": "tsc -p tsconfig.build.esm.json --emitDeclarationOnly --outDir ./dist/esm", | ||
"docs": "typedoc", | ||
"docs": "typedoc --excludePrivate", | ||
"cy:open": "cypress open --project ./test/browser", | ||
@@ -230,3 +230,3 @@ "cy:run:web-integration": "cypress run --project ./test/browser --spec ./test/browser/web.e2e.js", | ||
"gen-build": "yarn generate-code && yarn build", | ||
"prepare": "git config core.hooksPath hooks " | ||
"prepare": "git config core.hooksPath hooks" | ||
}, | ||
@@ -254,6 +254,6 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "7.21.3", | ||
"@babel/core": "7.21.8", | ||
"@babel/preset-env": "7.21.5", | ||
"@babel/preset-typescript": "7.21.4", | ||
"@qlik-trial/spectacular": "0.21.3", | ||
"@qlik-trial/spectacular": "0.21.11", | ||
"@types/jest": "29.5.1", | ||
@@ -265,5 +265,5 @@ "@types/node": "18.15.11", | ||
"cross-env": "7.0.3", | ||
"cypress": "12.11.0", | ||
"cypress": "12.12.0", | ||
"dotenv": "16.0.3", | ||
"esbuild": "0.17.17", | ||
"esbuild": "0.17.19", | ||
"eslint": "8.40.0", | ||
@@ -283,3 +283,3 @@ "eslint-config-airbnb-base": "15.0.0", | ||
"ts-node": "10.9.1", | ||
"typedoc": "0.24.6", | ||
"typedoc": "0.24.7", | ||
"typedoc-plugin-markdown": "3.15.3", | ||
@@ -292,2 +292,2 @@ "typedoc-plugin-rename-defaults": "0.6.5", | ||
} | ||
} | ||
} |
@@ -15,2 +15,3 @@ # qlik-sdk-typescript | ||
- [OAuth2](#oauth2) | ||
- [Fetching Delta values with Engine RPC](#fetching-delta-values-with-engine-rpc) | ||
- [Fetch](#fetch) | ||
@@ -154,2 +155,16 @@ - [ES6-Modules](#es6-modules) | ||
## Fetching Delta values with Engine RPC | ||
Delta member in app open config or rpc function can be used to change behaviour of engine response. By default this is set to true for bandwidth reducing, so engine only sends changes in object and default delta interceptors evaluate the object. On setting this property false while opening an app or while setting up the session, engine will respond with entire object on each request. | ||
Example to set delta false: | ||
``` | ||
const session = await app.open({ delta: false }); | ||
``` | ||
OR | ||
``` | ||
const session = await auth.rpc(appId, { delta: false }); | ||
``` | ||
## Fetch | ||
@@ -156,0 +171,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
3845166
119858
947
7