npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qlik-rest-api

v1.8.4

Published

Interact with multiple Qlik Sense REST APIs

Downloads

961

Readme

Qlik Sense REST API

Interact with Qlik Sense REST APIs (Repository, Proxy, Engine and SaaS) from a single package (NodeJS/JavaScript)

mocha tests

Not affiliated with Qlik

Please check the Wiki section for details and examples


Motivation

  • communicate with multiple QS REST API services (not limited only to a single service) from single package
  • support multiple authentication mechanisms (certificates, header, JWT etc) The package itself is not performing authentication

Clients

  • Repository (QSoW)
  • Proxy (QSoW)
  • Engine (QSoW)
  • Generic (QSoW)
  • SaaS (QSoK)

Installation

npm install --save qlik-rest-api

Note Node version >= 16.0.0

Return data format

All requests are returning data in the following format:

{
    data:  {} or []    // whatever is returned (including the error(s) details if error)
    status: number     // HTTP status codes: 200, 201, 204, 404, 409 etc.
    statusText: string // HTTP status text: "OK", "Created", "Bad Request" etc.
    message: string    // optional. In case of an error this prop will be the raw message
}

Basic examples


Any "physical" content (like certificates, qvf files, extension files etc.) have to be provided in advance. The package will not read any files from the file system by itself.

Proxy API (list all active sessions)

import https from "https";
import { QlikProxyClient } from "../src/index";

const pfx = fs.readFileSync("path/to/client.pfx");

const httpsAgent = new https.Agent({
  pfx: pfx,
});

const config = {
  host: "my-sense-host",
  port: 4243,
  httpAgent: httpAgent,
  authentication: {
    user_dir: "SOME_DIR",
    user_name: "SOME_USER",
  },
};

const proxyClient = new QlikProxyClient(config);
const result = await proxyClient.Get("session");

Engine API (healthcheck of single Engine)

import https from "https";
import { QlikEngineClient } from "../src/index";

const pfx = fs.readFileSync("path/to/client.pfx");

const config = {
  host: "my-engine-host",
  port: 4747,
  httpAgent: new https.Agent({ pfx: pfx }),
  authentication: {
    user_dir: "SOME_DIR",
    user_name: "SOME_USER",
  },
};

const engineClient = new QlikProxyClient(config);
const result = await engineClient.Get("engine/healthcheck");

Repository API (list app apps with filter)

import fs from "fs";
import https from "https";
import { QlikRepositoryClient } from "qlik-rest-api";

const cert = fs.readFileSync(`path/to/client.pem`);
const key = fs.readFileSync(`path/to/client_key.pem`);

const httpsAgentCert = new https.Agent({
  rejectUnauthorized: false,
  cert: cert,
  key: key,
});

const config = {
  host: "my-sense-host.com",
  port: 4242,
  httpsAgent: httpsAgentCert,
  authentication: {
    user_dir: "SOME_DIR",
    user_name: "SOME_USER",
  },
};

const repoClient = new QlikRepositoryClient(config);

// list all apps with their name starting with "operations"
const qlikApps = await repoClient.Get(`app?filter=(name sw 'operations')`);

Methods


Developer documentation for all methods can be found here