This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsocks = require('qsocks'); | |
var fs = require('fs'); | |
var request = require('request'); | |
// Set our request defaults, ignore unauthorized cert warnings as default QS certs are self-signed. | |
// Export the certificates from your Qlik Sense installation and refer to them | |
var r = request.defaults({ | |
rejectUnauthorized: false, | |
host: 'localhost', | |
pfx: fs.readFileSync(__dirname + '\\client.pfx') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsocks = require('qsocks'); | |
const fs = require('fs'); | |
const Promise = require('bluebird'); | |
var config = { | |
host: 'localhost', | |
port: 4747, | |
headers: { | |
'X-Qlik-User': 'UserDirectory=INTERNAL;UserId=sa_repository' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['d3'], function (d3) { | |
const ANIMATION_DURATION = 300; | |
var viz = { | |
x: d3.scale.ordinal(), | |
y: d3.scale.linear(), | |
xAxis: function () { return d3.svg.axis().scale(viz.x).orient('bottom') }, | |
yAxis: function () { return d3.svg.axis().scale(viz.y).orient('left') } | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qsocks.Connect(config) | |
.then(global => global.getActiveDoc()) // Or open a doc, in this scenario we already had a scoped app. | |
.then(doc => { | |
// bar chart | |
doc.getObject(objectid[0]) | |
.then(model => { | |
var margin = {top: 20, right: 20, bottom: 30, left: 40}, | |
width = 650 - margin.left - margin.right, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var prefix = window.location.pathname.substr( 0, window.location.pathname.toLowerCase().lastIndexOf( "/extensions" ) + 1 ); | |
var config = { | |
host: window.location.hostname, | |
prefix: prefix, | |
port: window.location.port, | |
isSecure: window.location.protocol === "https:" | |
}; | |
require.config( { | |
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources" | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsocks = require('qsocks'); | |
// Get a global reference | |
var global = qsocks.Connect(); | |
global.then(function(global) { | |
return global.createApp('This is my app3'); | |
}) | |
.then(function(reply) { | |
// Establish a new connection so we don't pollute the current engine session. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsocks = require('qsocks'); | |
const fs = require('fs'); | |
// Our Qlik Sense Certificates | |
const client = fs.readFileSync('C:\\ProgramData\\Qlik\\Sense\\Repository\\Exported Certificates\\.Local Certificates\\client.pem'); | |
const client_key = fs.readFileSync('C:\\ProgramData\\Qlik\\Sense\\Repository\\Exported Certificates\\.Local Certificates\\client_key.pem'); | |
const config = { | |
host: 'localhost', | |
port: 4747, // Standard Engine port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsocks = require('qsocks'); | |
// ConnectOpenApp requires a appname property. | |
// Returns an array of [globalhandle, apphandle] | |
var connection = qsocks.ConnectOpenApp({ | |
host: 'localhost', | |
isSecure: true, | |
rejectUnauthorized: false, | |
appname: '7c876a9a-d62d-49ea-b21c-aaccda76c067', | |
debug: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsocks = require('qsocks'); | |
var Promise = require('bluebird'); | |
var fs = require('fs-extra'); | |
var config = { | |
isSecure: true, | |
host: '<HOSTNAME>', | |
port: 4747, | |
headers: { | |
'X-Qlik-User': 'UserDirectory=Internal;UserId=sa_repository' |