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

qsocks

v3.2.1

Published

A wrapper around the QIX Engine API for node

Downloads

469

Readme

qsocks

A lightweight promise wrapper around the Qlik Sense Engine API

qsocks was born to provide a lightweight promise layer around the Engine API. Shortening the time to implemention without limiting the developer in what she or he can accomplish.

The aim of qsocks is to mimic the functionality in the Engine API bringing the capabilities to node and the browser.
qsocks currently uses browserify to package up qsocks and promises to bring consistency to the browser landscape.

Deprecation Notice - 2016-12-19

With the release of enigma.js qsocks will be deprecated.
Support for new QIX methods will be provided for 12 months (2017-12-19) and after that support will end.

Getting Started

Installing

npm install qsocks --save

Or just grab qsocks.bundle.js and drop it into your page and you are good to go.

Need help?

Then join our Slack channel http://qlikbranch-slack-invite.herokuapp.com/ and ping Alex Karlsson or open a issue on GitHub.
Be sure to check out the examples!

Connecting to a Qlik Sense Server in node

const qsocks = require('qsocks');

var config = {
    host: 'sense-demo.qlik.com',
    isSecure: true,
    origin: 'localhost'
};
    
qsocks.Connect(config).then(global => {
    console.log(global);
})

Connecting to a Qlik Sense Server in the browser

<script src="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js"></script>
<script>

  var config = {
    host: 'sense-demo.qlik.com',
    isSecure: true
  };

  qsocks.Connect(config).then(global => {
    console.log(global)
  });

</script>
<body></body>

Connecting to Qlik Sense Desktop in the browser

<script src="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js"></script>
<script>
  
  // Calling Connect() without a config object automatically 
  // assumes a desktop connection, i.e localhost:4848

  qsocks.Connect().then(global => {
    console.log(global)
  });

</script>
<body></body>

###Documentation

####Config

  • host - (String) Hostname of server
  • appname - (String) Scoped connection to app.
  • isSecure - (Boolean) If true uses wss and port 443, otherwise ws and port 80
  • port - (Integer) Port of connection, defaults 443/80
  • prefix - (String) Virtual Proxy, defaults to '/'
  • origin - (String) Origin of requests, node only.
  • rejectUnauthorized - (Boolean) False will ignore unauthorized self-signed certs.
  • headers - (Object) HTTP headers
  • ticket - (String) Qlik Sense ticket, consumes ticket on Connect()
  • key - (String) Client Certificate key for QIX connections
  • cert - (String) Client certificate for QIX connections
  • ca - (Array of String) CA root certificates for QIX connections
  • identity - (String) Session identity
  • debug - (Boolean || Function) Will pipe socket messages to console.log or pipe to supplied function
  • disconnect - (Function) Called if socket is closed

For more documentation on available methods refer to the Engine API documentation
Or see the examples in the examples directory

Events

All models will emit events for change and close. Change events will notify you that the model has been invalidated on the server and needs to validate with a GetLayout or GetProperties call.
Close events will notify you that the model has been closed by the server.

Example of Change event

qsocks.Connect().then(global => {
    return global.openDoc('TestApp.qvf')
})
.then(app => {
    app.createSessionObject({
        qInfo: {
            qId: 'mysessionobject',
            qType: 'list'
        },
        qListObjectDef: {
            qDef: {
                qFieldDefs: ['[Case Owner]']
            },
            qInitialDataFetch: [{
                qWidth: 1,
                qHeight: 1000,
                qLeft: 0,
                qTop: 0
            }]
        },
        myproperty: 'Hello World'
    })
    .then(model => {  
        model.getLayout().then(layout => {
            console.log(layout)
        })     
        model.on('change', () => {
            model.getLayout().then(layout => {
                console.log(layout)
            })
        }) 
        model.on('close', () => {
            app.destroySessionObject('mysessionobject')
        })
    })
})

###Projects built with qsocks SenseIt - Extension for Google Chrome to easily load web data
Service Charges - Interactive Web App by Axis Group & https://github.com/skokenes
Generate Qlik Sense apps from ElasticSearch
Chrome Extension - lets you create calculations on the fly
Architeqt - Inheritance Engine for Apps
Chartcacher - Render Qlik charts disconnected from QIX
Qlik-utils - Abstraction layer for Qlik APIs
SerializeApp - Serializes a Qlik app into JSON
Diplomatic Pulse - A custom web UI for QIX
Sense Search Components - Drop in search components