From 92e904779a311fca5257225af2a05b6dbf245d74 Mon Sep 17 00:00:00 2001 From: scottinet Date: Fri, 15 Jan 2016 13:55:06 +0100 Subject: [PATCH 1/2] added listIndexes and getServerInfo routes --- package.json | 2 +- src/kuzzle.js | 90 +++++++++++++++++++-- test/kuzzle/constructor.test.js | 2 + test/kuzzle/methods.test.js | 139 ++++++++++++++++++++++++++++++-- 4 files changed, 217 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index f8e1fe3f7..8c9038c1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-sdk", - "version": "1.3.1", + "version": "1.3.2", "description": "Official Javascript SDK for Kuzzle", "author": "The Kuzzle Team ", "repository": { diff --git a/src/kuzzle.js b/src/kuzzle.js index 084f4ecbe..e3e44529d 100644 --- a/src/kuzzle.js +++ b/src/kuzzle.js @@ -254,7 +254,7 @@ module.exports = Kuzzle = function (url, options, cb) { return this.bluebird.promisifyAll(this, { suffix: 'Promise', filter: function (name, func, target, passes) { - var whitelist = ['getAllStatistics', 'getStatistics', 'listCollections', 'now', 'query']; + var whitelist = ['getAllStatistics', 'getServerInfo', 'getStatistics', 'listCollections', 'listIndexes', 'now', 'query']; return passes && whitelist.indexOf(name) !== -1; } @@ -686,16 +686,39 @@ Kuzzle.prototype.flushQueue = function () { /** * Returns the list of known persisted data collections. * + * @param {string} [index] - Index containing collections to be listed * @param {object} [options] - Optional parameters * @param {responseCallback} cb - Handles the query response * @returns {object} this */ -Kuzzle.prototype.listCollections = function (options, cb) { - var collectionType = 'all'; +Kuzzle.prototype.listCollections = function () { + var + collectionType = 'all', + index, + options, + cb, + args = Array.prototype.slice.call(arguments); + + args.forEach(function(arg) { + switch (typeof arg) { + case 'string': + index = arg; + break; + case 'object': + options = arg; + break; + case 'function': + cb = arg; + break; + } + }); - if (!cb && typeof options === 'function') { - cb = options; - options = null; + if (!index) { + if (!this.defaultIndex) { + throw new Error('Kuzzle.listCollections: index required'); + } + + index = this.defaultIndex; } this.callbackRequired('Kuzzle.listCollections', cb); @@ -704,7 +727,7 @@ Kuzzle.prototype.listCollections = function (options, cb) { collectionType = options.type; } - this.query({controller: 'read', action: 'listCollections'}, {body: {type: collectionType}}, options, function (err, res) { + this.query({index: index, controller: 'read', action: 'listCollections'}, {body: {type: collectionType}}, options, function (err, res) { if (err) { return cb(err); } @@ -715,6 +738,32 @@ Kuzzle.prototype.listCollections = function (options, cb) { return this; }; +/** + * Returns the list of existing indexes in Kuzzle + * + * @param {object} [options] - Optional arguments + * @param {responseCallback} cb - Handles the query response + * @returns {object} this + */ +Kuzzle.prototype.listIndexes = function (options, cb) { + if (!cb && typeof options === 'function') { + cb = options; + options = null; + } + + this.callbackRequired('Kuzzle.listIndexes', cb); + + this.query({controller: 'read', action: 'listIndexes'}, {}, options, function (err, res) { + if (err) { + return cb(err); + } + + return cb(null, res.result.indexes); + }); + + return this; +}; + /** * Disconnects from Kuzzle and invalidate this instance. */ @@ -734,6 +783,32 @@ Kuzzle.prototype.disconnect = function () { } }; +/** + * Returns the server informations + * + * @param {object} [options] - Optional arguments + * @param {responseCallback} cb - Handles the query response + * @returns {object} this + */ +Kuzzle.prototype.getServerInfo = function (options, cb) { + if (!cb && typeof options === 'function') { + cb = options; + options = null; + } + + this.callbackRequired('Kuzzle.getServerInfo', cb); + + this.query({controller: 'read', action: 'serverInfo'}, {}, options, function (err, res) { + if (err) { + return cb(err); + } + + cb(null, res.result.serverInfo); + }); + + return this; +}; + /** * Return the current Kuzzle's UTC Epoch time, in milliseconds * @param {object} [options] - Optional parameters @@ -907,7 +982,6 @@ Kuzzle.prototype.replayQueue = function () { return this; }; - /** * Sets the default Kuzzle index * diff --git a/test/kuzzle/constructor.test.js b/test/kuzzle/constructor.test.js index 530f2af47..2564d1754 100644 --- a/test/kuzzle/constructor.test.js +++ b/test/kuzzle/constructor.test.js @@ -176,8 +176,10 @@ describe('Kuzzle constructor', () => { should.not.exist(kuzzle.dataCollectionFactoryPromise); should.not.exist(kuzzle.flushQueuePromise); should.exist(kuzzle.getAllStatisticsPromise); + should.exist(kuzzle.getServerInfoPromise); should.exist(kuzzle.getStatisticsPromise); should.exist(kuzzle.listCollectionsPromise); + should.exist(kuzzle.listIndexesPromise); should.not.exist(kuzzle.logoutPromise); should.exist(kuzzle.nowPromise); should.exist(kuzzle.queryPromise); diff --git a/test/kuzzle/methods.test.js b/test/kuzzle/methods.test.js index d2140d7ff..6dc16d3af 100644 --- a/test/kuzzle/methods.test.js +++ b/test/kuzzle/methods.test.js @@ -13,7 +13,7 @@ describe('Kuzzle methods', function () { queryStub = function (args, query, options, cb) { emitted = true; should(args.collection).be.undefined(); - should(args.index).be.undefined(); + should(args.index).be.eql(expectedQuery.index); should(args.controller).be.exactly(expectedQuery.controller); should(args.action).be.exactly(expectedQuery.action); @@ -207,6 +207,70 @@ describe('Kuzzle methods', function () { }); }); + describe('#getServerInfo', function () { + beforeEach(function () { + kuzzle = new Kuzzle('foo'); + kuzzle.query = queryStub; + emitted = false; + passedOptions = null; + error = null; + result = {result: {serverInfo: { + kuzzle: + { version: '0.9.2', + api: { version: '1.0', routes: {} }, + nodeVersion: 'v4.2.1', + memoryUsed: 100020224, + uptime: '161089.628s', + plugins: + { 'kuzzle-plugin-logger': {}, + 'kuzzle-plugin-socketio': {}, + 'kuzzle-plugin-auth-passport-local': {} }, + system: { memory: {}, cpus: {} } }, + services: { + writeEngine: { + type: 'elasticsearch', + api: '1.7', + version: '1.5.2', + lucene: '4.10.4', + status: 'red', + nodes: {}, + spaceUsed: '14.5kb' + } + } + }}}; + expectedQuery = { + controller: 'read', + action: 'serverInfo' + }; + }); + + it('should behave correctly when invoked', function () { + should(kuzzle.getServerInfo(function (err, res) { + should(err).be.null(); + should(res).be.eql(result.result.serverInfo); + })).be.eql(kuzzle); + }); + + it('should throw an error if no callback is provided', function () { + should(function () {kuzzle.getServerInfo()}).throw(Error); + should(emitted).be.false(); + + should(function () {kuzzle.getServerInfo({some: 'options'})}).throw(Error); + should(emitted).be.false(); + }); + + it('should execute the callback with an error if one occurs', function (done) { + this.timeout(50); + error = 'foobar'; + + kuzzle.getServerInfo('foo', function (err, res) { + should(err).be.exactly('foobar'); + should(res).be.undefined(); + done(); + }); + }); + }); + describe('#listCollections', function () { beforeEach(function () { kuzzle = new Kuzzle('foo'); @@ -216,6 +280,7 @@ describe('Kuzzle methods', function () { error = null; result = {result: {collections: {stored: [], realtime: []}}}; expectedQuery = { + index: 'foo', controller: 'read', action: 'listCollections', body: {type: 'all'} @@ -223,13 +288,20 @@ describe('Kuzzle methods', function () { }); it('should return the kuzzle instance when called', function () { - should(kuzzle.listCollections(function () {})).be.exactly(kuzzle); + should(kuzzle.listCollections('foo', function () {})).be.exactly(kuzzle); }); it('should throw an error if no callback has been provided', function () { - should(function () { kuzzle.listCollections(); }).throw(Error); + should(function () { kuzzle.listCollections('foo'); }).throw(Error); should(emitted).be.false(); - should(function () { kuzzle.listCollections({}); }).throw(Error); + should(function () { kuzzle.listCollections('foo', {}); }).throw(Error); + should(emitted).be.false(); + }); + + it('should throw an error if no index has been provided', function () { + should(function () {kuzzle.listCollections(function () {})}).throw(Error); + should(emitted).be.false(); + should(function () {kuzzle.listCollections({}, function () {})}).throw(Error); should(emitted).be.false(); }); @@ -237,7 +309,7 @@ describe('Kuzzle methods', function () { this.timeout(50); result = { result: {collections: {stored: ['foo', 'bar', 'baz'], realtime: ['qux'] } } }; - kuzzle.listCollections(function (err, res) { + kuzzle.listCollections('foo', function (err, res) { should(err).be.null(); should(res).be.an.Object().and.match(result.result.collections); done(); @@ -248,7 +320,7 @@ describe('Kuzzle methods', function () { this.timeout(50); error = 'foobar'; - kuzzle.listCollections(function (err, res) { + kuzzle.listCollections('foo', function (err, res) { should(err).be.exactly('foobar'); should(res).be.undefined(); done(); @@ -257,8 +329,61 @@ describe('Kuzzle methods', function () { it('should handle options correctly', function (done) { expectedQuery.body.type = 'foobar'; - kuzzle.listCollections({type: 'foobar'}, () => done()); + kuzzle.listCollections('foo', {type: 'foobar'}, () => done()); + }); + + it('should use the default index if none is provided', function () { + kuzzle.setDefaultIndex('foo'); + should(kuzzle.listCollections(function () {})).be.exactly(kuzzle); + should(emitted).be.true(); + + emitted = false; + should(kuzzle.listCollections({some: 'options'}, function () {})).be.exactly(kuzzle); + should(emitted).be.true(); + }); + }); + + describe('#listIndexes', function () { + beforeEach(function () { + kuzzle = new Kuzzle('foo'); + kuzzle.query = queryStub; + emitted = false; + passedOptions = null; + error = null; + result = {result: {indexes: ['foo', 'bar']}}; + expectedQuery = { + controller: 'read', + action: 'listIndexes' + }; }); + + it('should return the kuzzle instance when called', function () { + should(kuzzle.listIndexes(function (err, res) { + should(err).be.null(); + should(res).be.eql(result.result.indexes); + })).be.eql(kuzzle); + }); + + it('should throw an error if no callback is provided', function () { + should(function () { kuzzle.listIndexes(); }).throw(Error); + should(emitted).be.false(); + + should(function () {kuzzle.listIndexes({some: 'options'})}).throw(Error); + should(emitted).be.false(); + }); + + it('should execute the callback with an error if one occurs', function (done) { + this.timeout(50); + error = 'foobar'; + + kuzzle.listIndexes(function (err, res) { + should(err).be.exactly('foobar'); + should(res).be.undefined(); + done(); + }); + }); + + }); describe('#disconnect', function () { From 1a79928d36b808f49cd0deb5fbd77c4dcf43840d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 15 Jan 2016 12:58:46 +0000 Subject: [PATCH 2/2] Travis CI - [ci skip] - automatic dist folder --- dist/kuzzle.js | 90 +++++++++++++++++++++++++++++++++++++++++---- dist/kuzzle.min.js | 4 +- dist/kuzzle.min.map | 2 +- 3 files changed, 85 insertions(+), 11 deletions(-) diff --git a/dist/kuzzle.js b/dist/kuzzle.js index f0b240235..087fa186f 100644 --- a/dist/kuzzle.js +++ b/dist/kuzzle.js @@ -529,7 +529,7 @@ module.exports = Kuzzle = function (url, options, cb) { return this.bluebird.promisifyAll(this, { suffix: 'Promise', filter: function (name, func, target, passes) { - var whitelist = ['getAllStatistics', 'getStatistics', 'listCollections', 'now', 'query']; + var whitelist = ['getAllStatistics', 'getServerInfo', 'getStatistics', 'listCollections', 'listIndexes', 'now', 'query']; return passes && whitelist.indexOf(name) !== -1; } @@ -961,16 +961,39 @@ Kuzzle.prototype.flushQueue = function () { /** * Returns the list of known persisted data collections. * + * @param {string} [index] - Index containing collections to be listed * @param {object} [options] - Optional parameters * @param {responseCallback} cb - Handles the query response * @returns {object} this */ -Kuzzle.prototype.listCollections = function (options, cb) { - var collectionType = 'all'; +Kuzzle.prototype.listCollections = function () { + var + collectionType = 'all', + index, + options, + cb, + args = Array.prototype.slice.call(arguments); + + args.forEach(function(arg) { + switch (typeof arg) { + case 'string': + index = arg; + break; + case 'object': + options = arg; + break; + case 'function': + cb = arg; + break; + } + }); - if (!cb && typeof options === 'function') { - cb = options; - options = null; + if (!index) { + if (!this.defaultIndex) { + throw new Error('Kuzzle.listCollections: index required'); + } + + index = this.defaultIndex; } this.callbackRequired('Kuzzle.listCollections', cb); @@ -979,7 +1002,7 @@ Kuzzle.prototype.listCollections = function (options, cb) { collectionType = options.type; } - this.query({controller: 'read', action: 'listCollections'}, {body: {type: collectionType}}, options, function (err, res) { + this.query({index: index, controller: 'read', action: 'listCollections'}, {body: {type: collectionType}}, options, function (err, res) { if (err) { return cb(err); } @@ -990,6 +1013,32 @@ Kuzzle.prototype.listCollections = function (options, cb) { return this; }; +/** + * Returns the list of existing indexes in Kuzzle + * + * @param {object} [options] - Optional arguments + * @param {responseCallback} cb - Handles the query response + * @returns {object} this + */ +Kuzzle.prototype.listIndexes = function (options, cb) { + if (!cb && typeof options === 'function') { + cb = options; + options = null; + } + + this.callbackRequired('Kuzzle.listIndexes', cb); + + this.query({controller: 'read', action: 'listIndexes'}, {}, options, function (err, res) { + if (err) { + return cb(err); + } + + return cb(null, res.result.indexes); + }); + + return this; +}; + /** * Disconnects from Kuzzle and invalidate this instance. */ @@ -1009,6 +1058,32 @@ Kuzzle.prototype.disconnect = function () { } }; +/** + * Returns the server informations + * + * @param {object} [options] - Optional arguments + * @param {responseCallback} cb - Handles the query response + * @returns {object} this + */ +Kuzzle.prototype.getServerInfo = function (options, cb) { + if (!cb && typeof options === 'function') { + cb = options; + options = null; + } + + this.callbackRequired('Kuzzle.getServerInfo', cb); + + this.query({controller: 'read', action: 'serverInfo'}, {}, options, function (err, res) { + if (err) { + return cb(err); + } + + cb(null, res.result.serverInfo); + }); + + return this; +}; + /** * Return the current Kuzzle's UTC Epoch time, in milliseconds * @param {object} [options] - Optional parameters @@ -1182,7 +1257,6 @@ Kuzzle.prototype.replayQueue = function () { return this; }; - /** * Sets the default Kuzzle index * diff --git a/dist/kuzzle.min.js b/dist/kuzzle.min.js index de4c16387..b6632003a 100644 --- a/dist/kuzzle.min.js +++ b/dist/kuzzle.min.js @@ -1,3 +1,3 @@ -// Official Javascript SDK for Kuzzle v1.3.1 - License: Apache-2.0 -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}function e(){if("function"==typeof a)try{var b=a("crypto").randomBytes;l=j=b&&function(){return b(16)},j()}catch(c){}}function f(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){16>e&&(b[d+e++]=q[a])});16>e;)b[d+e++]=0;return b}function g(a,b){var c=b||0,d=p;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function h(a,b,c){var d=b&&c||0,e=b||[];a=a||{};var f=null!=a.clockseq?a.clockseq:u,h=null!=a.msecs?a.msecs:(new Date).getTime(),i=null!=a.nsecs?a.nsecs:w+1,j=h-v+(i-w)/1e4;if(0>j&&null==a.clockseq&&(f=f+1&16383),(0>j||h>v)&&null==a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=h,w=i,u=f,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;e[d++]=k>>>24&255,e[d++]=k>>>16&255,e[d++]=k>>>8&255,e[d++]=255&k;var l=h/4294967296*1e4&268435455;e[d++]=l>>>8&255,e[d++]=255&l,e[d++]=l>>>24&15|16,e[d++]=l>>>16&255,e[d++]=f>>>8|128,e[d++]=255&f;for(var m=a.node||t,n=0;6>n;n++)e[d+n]=m[n];return b?b:g(e)}function i(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"===a?new o(16):null,a=null),a=a||{};var e=a.random||(a.rng||j)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,b)for(var f=0;16>f;f++)b[d+f]=e[f];return b||g(e)}var j,k,l,m,n;c?d():e();for(var o="function"==typeof Buffer?Buffer:Array,p=[],q={},r=0;256>r;r++)p[r]=(r+256).toString(16).substr(1),q[p[r]]=r;var s=j(),t=[1|s[0],s[1],s[2],s[3],s[4],s[5]],u=16383&(s[6]<<8|s[7]),v=0,w=0,x=i;x.v1=h,x.v4=i,x.parse=f,x.unparse=g,x.BufferClass=o,x._rng=j,x._mathRNG=k,x._nodeRNG=l,x._whatwgRNG=m,"undefined"!=typeof b&&b.exports?b.exports=x:"function"==typeof define&&define.amd?define(function(){return x}):(n=c.uuid,x.noConflict=function(){return c.uuid=n,x},c.uuid=x)}("undefined"!=typeof window?window:null)},{}],2:[function(a,b,c){function d(){var a=this,b=Date.now(),c=-1;a.queueTTL>0&&(a.offlineQueue.forEach(function(d,e){d.ts0&&a.offlineQueue.length>a.queueMaxSize&&a.offlineQueue.splice(0,a.offlineQueue.length-a.queueMaxSize)}function e(a,b){var c=Date.now(),d=this;(void 0!==d.jwtToken||b)&&d.socket.once(a.requestId,function(c){c.error&&"Token expired"===c.error.message&&d.eventListeners.jwtTokenExpired.forEach(function(c){c.fn(a,b)}),b&&b(c.error,c)}),d.socket.emit("kuzzle",a),d.requestHistory[a.requestId]=c,Object.keys(d.requestHistory).forEach(function(a){d.requestHistory[a]0?(e.call(a,a.offlineQueue[0].query,a.offlineQueue[0].cb),a.offlineQueue.shift(),setTimeout(function(){f.call(a)},Math.max(0,a.replayInterval))):a.queuing=!1}var g=a("node-uuid"),h=a("./kuzzleDataCollection");b.exports=Kuzzle=function(b,c,d){var e=this;if(!(this instanceof Kuzzle))return new Kuzzle(b,c,d);if(d||"function"!=typeof c||(d=c,c=null),!b||""===b)throw new Error("URL argument missing");return Object.defineProperties(this,{collections:{value:{},writable:!0},connectCB:{value:d},eventListeners:{value:{connected:[],error:[],disconnected:[],reconnected:[],jwtTokenExpired:[]}},io:{value:null,writable:!0},queuing:{value:!1,writable:!0},requestHistory:{value:{},writable:!0},socket:{value:null,writable:!0},state:{value:"initializing",writable:!0},subscriptions:{value:{pending:{}},writable:!0},autoReconnect:{value:c&&"boolean"==typeof c.autoReconnect?c.autoReconnect:!0,enumerable:!0},defaultIndex:{value:c&&"string"==typeof c.defaultIndex?c.defaultIndex:void 0,writable:!0,enumerable:!0},reconnectionDelay:{value:c&&"number"==typeof c.reconnectionDelay?c.reconnectionDelay:1e3,enumerable:!0},url:{value:b,enumerable:!0},autoQueue:{value:!1,enumerable:!0,writable:!0},autoReplay:{value:!1,enumerable:!0,writable:!0},autoResubscribe:{value:!0,enumerable:!0,writable:!0},headers:{value:{},enumerable:!0,writable:!0},metadata:{value:{},enumerable:!0,writable:!0},offlineQueue:{value:[],enumerable:!0,writable:!0},queueFilter:{value:null,enumerable:!0,writable:!0},queueMaxSize:{value:500,enumerable:!0,writable:!0},queueTTL:{value:12e4,enumerable:!0,writable:!0},replayInterval:{value:10,enumerable:!0,writable:!0},loginStrategy:{value:c&&"string"==typeof c.loginStrategy?c.loginStrategy:void 0,enumerable:!0,writable:!1},loginCredentials:{value:c&&"object"==typeof c.loginCredentials?c.loginCredentials:void 0,enumerable:!0,writable:!1},loginExpiresIn:{value:c&&"number"==typeof c.loginExpiresIn?c.loginExpiresIn:void 0,enumerable:!0,writable:!1},jwtToken:{value:void 0,enumerable:!0,writable:!0}}),"undefined"!=typeof window&&window.io?this.io=window.io:this.io=a("socket.io-client"),c&&(Object.keys(c).forEach(function(a){e.hasOwnProperty(a)&&Object.getOwnPropertyDescriptor(e,a).writable&&(e[a]=c[a])}),"auto"===c.offlineMode&&this.autoReconnect&&(this.autoQueue=this.autoReplay=this.autoResubscribe=!0)),Object.defineProperty(this,"isValid",{value:function(){if("disconnected"===e.state)throw new Error("This Kuzzle object has been invalidated. Did you try to access it after a disconnect call?")}}),Object.defineProperty(this,"addHeaders",{value:function(a,b){return Object.keys(b).forEach(function(c){a[c]||(a[c]=b[c])}),a}}),Object.defineProperty(this,"callbackRequired",{value:function(a,b){if(!b||"function"!=typeof b)throw new Error(a+": a callback argument is required for read queries")}}),c&&c.connect&&"auto"!==c.connect?this.state="ready":this.connect(),this.bluebird?this.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["getAllStatistics","getStatistics","listCollections","now","query"];return d&&-1!==e.indexOf(a)}}):this},Kuzzle.prototype.connect=function(){var a=this;return-1===["initializing","ready","disconnected","error","offline"].indexOf(this.state)?(a.connectCB&&a.connectCB(null,a),a):(a.state="connecting",a.socket=a.io(a.url,{reconnection:a.autoReconnect,reconnectionDelay:a.reconnectionDelay,forceNew:!0}),a.socket.once("connect",function(){a.state="connected",Object.keys(a.subscriptions).forEach(function(b){Object.keys(a.subscriptions[b]).forEach(function(c){var d=a.subscriptions[b][c];d.renew(d.callback)})}),f.call(a),a.loginStrategy?a.login(a.loginStrategy,a.loginCredentials,a.loginExpiresIn,function(b){a.eventListeners.connected.forEach(function(a){a.fn(b)}),a.connectCB&&a.connectCB(b,a)}):(a.eventListeners.connected.forEach(function(a){a.fn()}),a.connectCB&&a.connectCB(null,a))}),a.socket.on("connect_error",function(b){a.state="error",a.eventListeners.error.forEach(function(a){a.fn()}),a.connectCB&&a.connectCB(b)}),a.socket.on("disconnect",function(){a.state="offline",a.autoReconnect||a.disconnect(),a.autoQueue&&(a.queuing=!0),a.eventListeners.disconnected.forEach(function(a){a.fn()})}),a.socket.on("reconnect",function(){a.state="connected",a.autoResubscribe&&Object.keys(a.subscriptions).forEach(function(b){Object.keys(a.subscriptions[b]).forEach(function(c){var d=a.subscriptions[b][c];d.renew(d.callback)})}),a.autoReplay&&(d.call(a),f.call(a)),a.eventListeners.reconnected.forEach(function(a){a.fn()})}),this)},Kuzzle.prototype.login=function(a,b,c,d){var e=this,f={};return Object.keys(b).forEach(function(a){b.hasOwnProperty(a)&&(f[a]=b[a])}),("number"==typeof c||"string"==typeof c)&&(f.expiresIn=c),f.strategy=a,this.query({controller:"auth",action:"login"},f,{},function(a,b){if(null===a)e.jwtToken=b.jwt,"function"==typeof d&&d(null,e);else{if("function"!=typeof d)throw new Error(a.message);d(a)}}),e},Kuzzle.prototype.logout=function(a){var b=this,c={action:"logout",controller:"auth",requestId:g.v4(),body:{}};return this.query({controller:"auth",action:"logout"},c,{},function(c){null===c?(b.jwtToken=void 0,"function"==typeof a&&a(null,b)):"function"==typeof a&&a(c)}),b},Kuzzle.prototype.addListener=function(a,b){var c,d=Object.keys(this.eventListeners),e=typeof b;if(this.isValid(),-1===d.indexOf(a))throw new Error("["+a+"] is not a known event. Known events: "+d.toString());if("function"!==e)throw new Error("Invalid listener type: expected a function, got a "+e);return c=g.v1(),this.eventListeners[a].push({id:c,fn:b}),c},Kuzzle.prototype.getAllStatistics=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.getAllStatistics",b),this.query({controller:"admin",action:"getAllStats"},{},a,function(a,c){return a?b(a):void b(null,c.result.hits)}),this},Kuzzle.prototype.getStatistics=function(a,b,c){var d;return c||(1===arguments.length?(c=arguments[0],b=null,a=null):(c=arguments[1],"object"==typeof arguments[0]?(b=arguments[0],a=null):(a=arguments[0],b=null))),d=function(b,d){return b?c(b):void(a?c(null,d.result.hits):c(null,[d.result]))},this.callbackRequired("Kuzzle.getStatistics",c),a?this.query({controller:"admin",action:"getStats"},{body:{startTime:a}},b,d):this.query({controller:"admin",action:"getLastStats"},{},b,d),this},Kuzzle.prototype.dataCollectionFactory=function(a,b,c){if(this.isValid(),1===arguments.length?(b=arguments[0],a=this.defaultIndex):2===arguments.length&&"object"==typeof b&&(c=b,b=a,a=this.defaultIndex),!a)throw new Error("Unable to create a new data collection object: no index specified");return this.collections[a]||(this.collections[a]={}),this.collections[a][b]||(this.collections[a][b]=new h(this,a,b,c)),this.collections[a][b]},Kuzzle.prototype.flushQueue=function(){return this.offlineQueue=[],this},Kuzzle.prototype.listCollections=function(a,b){var c="all";return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.listCollections",b),a&&a.type&&(c=a.type),this.query({controller:"read",action:"listCollections"},{body:{type:c}},a,function(a,c){return a?b(a):b(null,c.result.collections)}),this},Kuzzle.prototype.disconnect=function(){var a;this.logout(),this.state="disconnected",this.socket.close(),this.socket=null;for(a in this.collections)this.collections.hasOwnProperty(a)&&delete this.collections[a]},Kuzzle.prototype.now=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.now",b),this.query({controller:"read",action:"now"},{},a,function(a,c){return a?b(a):void b(null,c.result.now)}),this},Kuzzle.prototype.query=function(a,b,c,f){var h,i={action:a.action,controller:a.controller,metadata:this.metadata},j=this;if(this.isValid(),f||"function"!=typeof c||(f=c,c=null),c&&(c.metadata&&Object.keys(c.metadata).forEach(function(a){i.metadata[a]=c.metadata[a]}),c.queuable===!1&&"offline"===j.state))return j;b.metadata&&Object.keys(b.metadata).forEach(function(a){i.metadata[a]=b.metadata[a]});for(h in b)"metadata"!==h&&b.hasOwnProperty(h)&&(i[h]=b[h]);return i=j.addHeaders(i,this.headers),void 0!==j.jwtToken&&(i.headers=i.headers||{},i.headers.authorization="Bearer "+j.jwtToken),a.collection&&(i.collection=a.collection),a.index&&(i.index=a.index),i.requestId||(i.requestId=g.v4()),"connected"===j.state||c&&c.queuable===!1?e.call(this,i,f):(j.queuing||-1!==["initializing","connecting"].indexOf(j.state))&&(d.call(this,i,f),j.queueFilter?j.queueFilter(i)&&j.offlineQueue.push({ts:Date.now(),query:i,cb:f}):j.offlineQueue.push({ts:Date.now(),query:i,cb:f})),j},Kuzzle.prototype.removeAllListeners=function(a){var b=Object.keys(this.eventListeners),c=this;if(a){if(-1===b.indexOf(a))throw new Error("["+a+"] is not a known event. Known events: "+b.toString());this.eventListeners[a]=[]}else b.forEach(function(a){c.eventListeners[a]=[]})},Kuzzle.prototype.removeListener=function(a,b){var c=Object.keys(this.eventListeners),d=this;if(-1===c.indexOf(a))throw new Error("["+a+"] is not a known event. Known events: "+c.toString());this.eventListeners[a].forEach(function(c,e){c.id===b&&d.eventListeners[a].splice(e,1)})},Kuzzle.prototype.replayQueue=function(){return"offline"===this.state||this.autoReplay||(d.call(this),f.call(this)),this},Kuzzle.prototype.setDefaultIndex=function(a){if("string"!=typeof a)throw new Error("Invalid default index: ["+a+"] (an index name is expected)");if(0===a.length)throw new Error("Cannot set an empty index as the default index");return this.defaultIndex=a,this},Kuzzle.prototype.setHeaders=function(a,b){var c=this;if("object"!=typeof a||Array.isArray(a))throw new Error("Expected a content object, received a "+typeof a);return b?c.headers=a:Object.keys(a).forEach(function(b){c.headers[b]=a[b]}),c},Kuzzle.prototype.startQueuing=function(){return"offline"!==this.state||this.autoQueue||(this.queuing=!0),this},Kuzzle.prototype.stopQueuing=function(){return"offline"!==this.state||this.autoQueue||(this.queuing=!1),this}},{"./kuzzleDataCollection":3,"node-uuid":1,"socket.io-client":void 0}],3:[function(a,b,c){function d(a,b,c){if(!b||!c)throw new Error("The KuzzleDataCollection object constructor needs an index and a collection arguments");return Object.defineProperties(this,{collection:{value:c,enumerable:!0},index:{value:b,enumerable:!0},kuzzle:{value:a,enumerable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0}}),Object.defineProperty(this,"buildQueryArgs",{value:function(a,b){return{controller:a,action:b,collection:this.collection,index:this.index}}}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["publishMessage","setHeaders","subscribe"];return d&&-1===e.indexOf(a)}}):this}var e=a("./kuzzleDocument"),f=a("./kuzzleDataMapping"),g=a("./kuzzleRoom");d.prototype.advancedSearch=function(a,b,c){var d,e=this;return c||"function"!=typeof b||(c=b,b=null),e.kuzzle.callbackRequired("KuzzleDataCollection.advancedSearch",c),d=e.kuzzle.addHeaders({body:a},this.headers),e.kuzzle.query(this.buildQueryArgs("read","search"),d,b,function(a,b){var d=[];return a?c(a):(b.result.hits.forEach(function(a){d.push(e.documentFactory(a._id,a))}),void c(null,{total:b.result.total,documents:d}))}),this},d.prototype.count=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),this.kuzzle.callbackRequired("KuzzleDataCollection.count",c),d=this.kuzzle.addHeaders({body:a},this.headers),this.kuzzle.query(this.buildQueryArgs("read","count"),d,b,function(a,b){return a?c(a):void c(null,b.result.count)}),this},d.prototype.create=function(a,b){var c={};return b||"function"!=typeof a||(b=a,a=null),c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("write","createCollection"),c,a,b),this},d.prototype.createDocument=function(a,b,c,d){var f=this,g={},h="create";return a&&"string"!=typeof a&&(d=c,c=b,b=a,a=null),d||"function"!=typeof c||(d=c,c=null),b instanceof e?g=b.toJSON():g.body=b,c&&(h=c.updateIfExist?"createOrUpdate":"create"),a&&(g._id=a),g.persist=!0,g=f.kuzzle.addHeaders(g,f.headers),d?f.kuzzle.query(this.buildQueryArgs("write",h),g,c,function(a,b){return a?d(a):void d(null,f.documentFactory(b.result._id,b.result))}):this.kuzzle.query(this.buildQueryArgs("write",h),g,c),this},d.prototype["delete"]=function(a,b){var c={};return b||"function"!=typeof a||(b=a,a=null),c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("admin","deleteCollection"),c,a,b),this},d.prototype.deleteDocument=function(a,b,c){var d,e={};return"string"==typeof a?(e._id=a,d="delete"):(e.body=a,d="deleteByQuery"),c||"function"!=typeof b||(c=b,b=null),e=this.kuzzle.addHeaders(e,this.headers),c?this.kuzzle.query(this.buildQueryArgs("write",d),e,b,function(a,b){return a?c(a):void("delete"===d?c(null,[b.result._id]):c(null,b.result.ids))}):this.kuzzle.query(this.buildQueryArgs("write",d),e,b),this},d.prototype.fetchDocument=function(a,b,c){var d={_id:a},e=this;return c||"function"!=typeof b||(c=b,b=null),e.kuzzle.callbackRequired("KuzzleDataCollection.fetch",c),d=e.kuzzle.addHeaders(d,this.headers),e.kuzzle.query(this.buildQueryArgs("read","get"),d,b,function(a,b){return a?c(a):void c(null,e.documentFactory(b.result._id,b.result))}),this},d.prototype.fetchAllDocuments=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.kuzzle.callbackRequired("KuzzleDataCollection.fetchAll",b),this.advancedSearch({},a,b),this},d.prototype.getMapping=function(a,b){var c;return b||"function"!=typeof a||(b=a,a=null),this.kuzzle.callbackRequired("KuzzleDataCollection.getMapping",b),c=new f(this),c.refresh(a,b),this},d.prototype.publishMessage=function(a,b){var c={};return a instanceof e?c=a.toJSON():c.body=a,c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("write","publish"),c,b),this},d.prototype.putMapping=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),d=new f(this,a),d.apply(b,c),this},d.prototype.replaceDocument=function(a,b,c,d){var e=this,f={_id:a,body:b};return d||"function"!=typeof c||(d=c,c=null),f=e.kuzzle.addHeaders(f,this.headers),d?e.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),f,c,function(a,b){return a?d(a):void d(null,e.documentFactory(b.result._id,b.result))}):e.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),f,c),this},d.prototype.subscribe=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),this.kuzzle.callbackRequired("KuzzleDataCollection.subscribe",c),d=new g(this,b),d.renew(a,c)},d.prototype.truncate=function(a,b){var c={};return b||"function"!=typeof a||(b=a,a=null),c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("admin","truncateCollection"),c,a,b),this},d.prototype.updateDocument=function(a,b,c,d){var f={_id:a,body:b},g=this;return d||"function"!=typeof c||(d=c,c=null),f=g.kuzzle.addHeaders(f,this.headers),d?g.kuzzle.query(this.buildQueryArgs("write","update"),f,c,function(a,b){var c;return a?d(a):(c=new e(g,b.result._id),void c.refresh(d))}):g.kuzzle.query(this.buildQueryArgs("write","update"),f,c),g},d.prototype.documentFactory=function(a,b){var c=b._source?new e(this,a,b._source):new e(this,a,b);return b._version&&b._source&&(c.version=b._version),c},d.prototype.roomFactory=function(a){return new g(this,a)},d.prototype.dataMappingFactory=function(a){return new f(this,a)},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{"./kuzzleDataMapping":4,"./kuzzleDocument":5,"./kuzzleRoom":6}],4:[function(a,b,c){function d(a,b){return Object.defineProperties(this,{collection:{value:a,eunmerable:!0},kuzzle:{value:a.kuzzle,enumerable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0},mapping:{value:b||{},enumerable:!0,writable:!0}}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["set","setHeaders"];return d&&-1===e.indexOf(a)}}):this}d.prototype.apply=function(a,b){var c=this,d=this.kuzzle.addHeaders({body:{properties:this.mapping}},this.headers);return b||"function"!=typeof a||(b=a,a=null),c.kuzzle.query(this.collection.buildQueryArgs("admin","putMapping"),d,a,function(d){return d?b?b(d):!1:void c.refresh(a,b)}),this},d.prototype.refresh=function(a,b){var c=this,d=this.kuzzle.addHeaders({},this.headers);return b||"function"!=typeof a||(b=a,a=null),this.kuzzle.query(this.collection.buildQueryArgs("admin","getMapping"),d,a,function(a,d){return a?b?b(a):!1:d.result[c.collection.index]?d.result[c.collection.index].mappings[c.collection.collection]?(c.mapping=d.result[c.collection.index].mappings[c.collection.collection].properties,void(b&&b(null,c))):b?b(new Error("No mapping found for collection "+c.collection.collection)):!1:b?b(new Error("No mapping found for index "+c.collection.index)):!1}),this},d.prototype.set=function(a,b){return this.mapping[a]=b,this},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{}],5:[function(a,b,c){function d(a,b,c){return Object.defineProperties(this,{queue:{value:[],writable:!0},refreshing:{value:!1,writable:!0},collection:{value:a.collection,enumerable:!0},dataCollection:{value:a,enumerable:!0},kuzzle:{value:a.kuzzle,enumerable:!0},id:{value:void 0,enumerable:!0,writable:!0},content:{value:{},writable:!0,enumerable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0},version:{value:void 0,enumerable:!0,writable:!0}}),!c&&b&&"object"==typeof b&&(c=b,b=null),c&&(c._version&&(this.version=c._version,delete c._version),this.setContent(c,!0)),b&&Object.defineProperty(this,"id",{value:b,enumerable:!0}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["delete","refresh","save"];return d&&-1!==e.indexOf(a)}}):this}function e(){for(var a;this.queue.length>0;)a=this.queue.shift(),this[a.action].apply(this,a.args)}d.prototype.toJSON=function(){var a={};return this.id&&(a._id=this.id),a.body=this.content,a._version=this.version,a=this.kuzzle.addHeaders(a,this.headers)},d.prototype.toString=function(){return JSON.stringify(this.toJSON())},d.prototype["delete"]=function(a,b){var c=this;if(b||"function"!=typeof a||(b=a,a=null),this.refreshing)return this.queue.push({action:"delete",args:[a,b]}),this;if(!this.id)throw new Error("KuzzleDocument.delete: cannot delete a document without a document ID");return b?this.kuzzle.query(this.dataCollection.buildQueryArgs("write","delete"),this.toJSON(),a,function(a){return a?b(a):void b(null,c)}):this.kuzzle.query(this.dataCollection.buildQueryArgs("write","delete"),this.toJSON(),a),this},d.prototype.refresh=function(a,b){var c=this;if(b||"function"!=typeof a||(b=a,a=null),this.refreshing)return this.queue.push({action:"refresh",args:[a,b]}),this;if(!c.id)throw new Error("KuzzleDocument.refresh: cannot retrieve a document if no ID has been provided");return c.refreshing=!0,c.kuzzle.query(c.dataCollection.buildQueryArgs("read","get"),{_id:c.id},a,function(a,d){return a?(c.refreshing=!1,c.queue=[],b?b(a):!1):(c.version=d.result._version,c.content=d.result._source,b&&b(null,c),c.refreshing=!1,void e.call(c))}),this},d.prototype.save=function(a,b){var c=this.toJSON(),d=this;return a&&void 0===b&&"function"==typeof a&&(b=a,a=null),d.refreshing?(d.queue.push({action:"save",args:[a,b]}),d):(c.persist=!0,d.kuzzle.query(this.dataCollection.buildQueryArgs("write","createOrUpdate"),c,a,function(a,c){return a?b?b(a):!1:(d.id=c.result._id,d.version=c.result._version,void(b&&b(null,d)))}),d)},d.prototype.publish=function(a){var b=this.toJSON();return this.refreshing?(this.queue.push({action:"publish",args:[a]}),this):(this.kuzzle.query(this.dataCollection.buildQueryArgs("write","publish"),b,a),this)},d.prototype.setContent=function(a,b){var c=this;return this.refreshing?(this.queue.push({action:"setContent",args:[a,b]}),this):(b?this.content=a:Object.keys(a).forEach(function(b){c.content[b]=a[b]}),this)},d.prototype.subscribe=function(a,b){var c;if(a&&!b&&"function"==typeof a&&(b=a,a=null),this.kuzzle.callbackRequired("KuzzleDocument.subscribe",b),!this.id)throw new Error("KuzzleDocument.subscribe: cannot subscribe to a document if no ID has been provided");return c={ids:{values:[this.id]}},this.dataCollection.subscribe(c,a,b)},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{}],6:[function(a,b,c){function d(a,b){return Object.defineProperties(this,{callback:{value:null,writable:!0},channel:{value:null,writable:!0},id:{value:g.v4()},notifier:{value:null,writable:!0},queue:{value:[],writable:!0},scope:{value:b&&b.scope?b.scope:"all"},state:{value:b&&b.state?b.state:"done"},subscribing:{value:!1,writable:!0},users:{value:b&&b.users?b.users:"none"},collection:{value:a,enumerable:!0},kuzzle:{value:a.kuzzle,enumerable:!0},filters:{value:null,enumerable:!0,writable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0},metadata:{value:b&&b.metadata?b.metadata:{},enumerable:!0,writable:!0},roomId:{value:null,enumerable:!0,writable:!0},subscribeToSelf:{value:b&&"boolean"==typeof b.subscribeToSelf?b.subscribeToSelf:!0,enumerable:!0,writable:!0}}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["count"];return d&&-1!==e.indexOf(a)}}):this}function e(a){return a.error?this.callback(a.error):void(this.kuzzle.requestHistory[a.requestId]?(this.subscribeToSelf&&this.callback(null,a),delete this.kuzzle.requestHistory[a.requestId]):this.callback(null,a))}function f(){for(var a;this.queue.length>0;)a=this.queue.shift(),this[a.action].apply(this,a.args)}var g=a("node-uuid");d.prototype.count=function(a){var b;return this.kuzzle.callbackRequired("KuzzleRoom.count",a),b=this.kuzzle.addHeaders({body:{roomId:this.roomId}},this.headers),this.subscribing?(this.queue.push({action:"count",args:[a]}),this):(this.kuzzle.query(this.collection.buildQueryArgs("subscribe","count"),b,function(b,c){return b?a(b):void a(null,c.result.count)}),this)},d.prototype.renew=function(a,b){var c={scope:this.scope,state:this.state,users:this.users},d=this;return!b&&a&&"function"==typeof a&&(b=a,a=null),"connected"!==this.kuzzle.state?(this.callback=b,this.kuzzle.subscriptions.pending[d.id]=d,this):this.subscribing?(this.queue.push({action:"renew",args:[a,b]}),this):(this.kuzzle.callbackRequired("KuzzleRoom.renew",b),this.unsubscribe(),this.roomId=null,this.subscribing=!0,this.callback=b,this.kuzzle.subscriptions.pending[d.id]=d,a&&(this.filters=a),c.body=this.filters,c=this.kuzzle.addHeaders(c,this.headers),d.kuzzle.query(this.collection.buildQueryArgs("subscribe","on"),c,{metadata:this.metadata},function(a,b){if(delete d.kuzzle.subscriptions.pending[d.id],d.subscribing=!1,a)throw d.queue=[],new Error("Error during Kuzzle subscription: "+a.message);d.roomId=b.result.roomId,d.channel=b.result.channel,d.kuzzle.subscriptions[d.roomId]||(d.kuzzle.subscriptions[d.roomId]={}),d.kuzzle.subscriptions[d.roomId][d.id]=d,d.notifier=e.bind(d),d.kuzzle.socket.on(d.channel,d.notifier),f.call(d)}),this)},d.prototype.unsubscribe=function(){var a,b=this,c=b.roomId;return b.subscribing?(b.queue.push({action:"unsubscribe",args:[]}),b):(c&&(b.kuzzle.socket.off(b.channel,this.notifier),1===Object.keys(b.kuzzle.subscriptions[c]).length?(delete b.kuzzle.subscriptions[c],0===Object.keys(b.kuzzle.subscriptions.pending).length?b.kuzzle.query(b.collection.buildQueryArgs("subscribe","off"),{body:{roomId:c}}):a=setInterval(function(){0===Object.keys(b.kuzzle.subscriptions.pending).length&&(b.kuzzle.subscriptions[c]||b.kuzzle.query(b.collection.buildQueryArgs("subscribe","off"),{body:{roomId:c}}),clearInterval(a))},100)):delete b.kuzzle.subscriptions[c][b.id],b.roomId=null),b)},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{"node-uuid":1}]},{},[2]); +// Official Javascript SDK for Kuzzle v1.3.2 - License: Apache-2.0 +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}function e(){if("function"==typeof a)try{var b=a("crypto").randomBytes;l=j=b&&function(){return b(16)},j()}catch(c){}}function f(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){16>e&&(b[d+e++]=q[a])});16>e;)b[d+e++]=0;return b}function g(a,b){var c=b||0,d=p;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function h(a,b,c){var d=b&&c||0,e=b||[];a=a||{};var f=null!=a.clockseq?a.clockseq:u,h=null!=a.msecs?a.msecs:(new Date).getTime(),i=null!=a.nsecs?a.nsecs:w+1,j=h-v+(i-w)/1e4;if(0>j&&null==a.clockseq&&(f=f+1&16383),(0>j||h>v)&&null==a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=h,w=i,u=f,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;e[d++]=k>>>24&255,e[d++]=k>>>16&255,e[d++]=k>>>8&255,e[d++]=255&k;var l=h/4294967296*1e4&268435455;e[d++]=l>>>8&255,e[d++]=255&l,e[d++]=l>>>24&15|16,e[d++]=l>>>16&255,e[d++]=f>>>8|128,e[d++]=255&f;for(var m=a.node||t,n=0;6>n;n++)e[d+n]=m[n];return b?b:g(e)}function i(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"===a?new o(16):null,a=null),a=a||{};var e=a.random||(a.rng||j)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,b)for(var f=0;16>f;f++)b[d+f]=e[f];return b||g(e)}var j,k,l,m,n;c?d():e();for(var o="function"==typeof Buffer?Buffer:Array,p=[],q={},r=0;256>r;r++)p[r]=(r+256).toString(16).substr(1),q[p[r]]=r;var s=j(),t=[1|s[0],s[1],s[2],s[3],s[4],s[5]],u=16383&(s[6]<<8|s[7]),v=0,w=0,x=i;x.v1=h,x.v4=i,x.parse=f,x.unparse=g,x.BufferClass=o,x._rng=j,x._mathRNG=k,x._nodeRNG=l,x._whatwgRNG=m,"undefined"!=typeof b&&b.exports?b.exports=x:"function"==typeof define&&define.amd?define(function(){return x}):(n=c.uuid,x.noConflict=function(){return c.uuid=n,x},c.uuid=x)}("undefined"!=typeof window?window:null)},{}],2:[function(a,b,c){function d(){var a=this,b=Date.now(),c=-1;a.queueTTL>0&&(a.offlineQueue.forEach(function(d,e){d.ts0&&a.offlineQueue.length>a.queueMaxSize&&a.offlineQueue.splice(0,a.offlineQueue.length-a.queueMaxSize)}function e(a,b){var c=Date.now(),d=this;(void 0!==d.jwtToken||b)&&d.socket.once(a.requestId,function(c){c.error&&"Token expired"===c.error.message&&d.eventListeners.jwtTokenExpired.forEach(function(c){c.fn(a,b)}),b&&b(c.error,c)}),d.socket.emit("kuzzle",a),d.requestHistory[a.requestId]=c,Object.keys(d.requestHistory).forEach(function(a){d.requestHistory[a]0?(e.call(a,a.offlineQueue[0].query,a.offlineQueue[0].cb),a.offlineQueue.shift(),setTimeout(function(){f.call(a)},Math.max(0,a.replayInterval))):a.queuing=!1}var g=a("node-uuid"),h=a("./kuzzleDataCollection");b.exports=Kuzzle=function(b,c,d){var e=this;if(!(this instanceof Kuzzle))return new Kuzzle(b,c,d);if(d||"function"!=typeof c||(d=c,c=null),!b||""===b)throw new Error("URL argument missing");return Object.defineProperties(this,{collections:{value:{},writable:!0},connectCB:{value:d},eventListeners:{value:{connected:[],error:[],disconnected:[],reconnected:[],jwtTokenExpired:[]}},io:{value:null,writable:!0},queuing:{value:!1,writable:!0},requestHistory:{value:{},writable:!0},socket:{value:null,writable:!0},state:{value:"initializing",writable:!0},subscriptions:{value:{pending:{}},writable:!0},autoReconnect:{value:c&&"boolean"==typeof c.autoReconnect?c.autoReconnect:!0,enumerable:!0},defaultIndex:{value:c&&"string"==typeof c.defaultIndex?c.defaultIndex:void 0,writable:!0,enumerable:!0},reconnectionDelay:{value:c&&"number"==typeof c.reconnectionDelay?c.reconnectionDelay:1e3,enumerable:!0},url:{value:b,enumerable:!0},autoQueue:{value:!1,enumerable:!0,writable:!0},autoReplay:{value:!1,enumerable:!0,writable:!0},autoResubscribe:{value:!0,enumerable:!0,writable:!0},headers:{value:{},enumerable:!0,writable:!0},metadata:{value:{},enumerable:!0,writable:!0},offlineQueue:{value:[],enumerable:!0,writable:!0},queueFilter:{value:null,enumerable:!0,writable:!0},queueMaxSize:{value:500,enumerable:!0,writable:!0},queueTTL:{value:12e4,enumerable:!0,writable:!0},replayInterval:{value:10,enumerable:!0,writable:!0},loginStrategy:{value:c&&"string"==typeof c.loginStrategy?c.loginStrategy:void 0,enumerable:!0,writable:!1},loginCredentials:{value:c&&"object"==typeof c.loginCredentials?c.loginCredentials:void 0,enumerable:!0,writable:!1},loginExpiresIn:{value:c&&"number"==typeof c.loginExpiresIn?c.loginExpiresIn:void 0,enumerable:!0,writable:!1},jwtToken:{value:void 0,enumerable:!0,writable:!0}}),"undefined"!=typeof window&&window.io?this.io=window.io:this.io=a("socket.io-client"),c&&(Object.keys(c).forEach(function(a){e.hasOwnProperty(a)&&Object.getOwnPropertyDescriptor(e,a).writable&&(e[a]=c[a])}),"auto"===c.offlineMode&&this.autoReconnect&&(this.autoQueue=this.autoReplay=this.autoResubscribe=!0)),Object.defineProperty(this,"isValid",{value:function(){if("disconnected"===e.state)throw new Error("This Kuzzle object has been invalidated. Did you try to access it after a disconnect call?")}}),Object.defineProperty(this,"addHeaders",{value:function(a,b){return Object.keys(b).forEach(function(c){a[c]||(a[c]=b[c])}),a}}),Object.defineProperty(this,"callbackRequired",{value:function(a,b){if(!b||"function"!=typeof b)throw new Error(a+": a callback argument is required for read queries")}}),c&&c.connect&&"auto"!==c.connect?this.state="ready":this.connect(),this.bluebird?this.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["getAllStatistics","getServerInfo","getStatistics","listCollections","listIndexes","now","query"];return d&&-1!==e.indexOf(a)}}):this},Kuzzle.prototype.connect=function(){var a=this;return-1===["initializing","ready","disconnected","error","offline"].indexOf(this.state)?(a.connectCB&&a.connectCB(null,a),a):(a.state="connecting",a.socket=a.io(a.url,{reconnection:a.autoReconnect,reconnectionDelay:a.reconnectionDelay,forceNew:!0}),a.socket.once("connect",function(){a.state="connected",Object.keys(a.subscriptions).forEach(function(b){Object.keys(a.subscriptions[b]).forEach(function(c){var d=a.subscriptions[b][c];d.renew(d.callback)})}),f.call(a),a.loginStrategy?a.login(a.loginStrategy,a.loginCredentials,a.loginExpiresIn,function(b){a.eventListeners.connected.forEach(function(a){a.fn(b)}),a.connectCB&&a.connectCB(b,a)}):(a.eventListeners.connected.forEach(function(a){a.fn()}),a.connectCB&&a.connectCB(null,a))}),a.socket.on("connect_error",function(b){a.state="error",a.eventListeners.error.forEach(function(a){a.fn()}),a.connectCB&&a.connectCB(b)}),a.socket.on("disconnect",function(){a.state="offline",a.autoReconnect||a.disconnect(),a.autoQueue&&(a.queuing=!0),a.eventListeners.disconnected.forEach(function(a){a.fn()})}),a.socket.on("reconnect",function(){a.state="connected",a.autoResubscribe&&Object.keys(a.subscriptions).forEach(function(b){Object.keys(a.subscriptions[b]).forEach(function(c){var d=a.subscriptions[b][c];d.renew(d.callback)})}),a.autoReplay&&(d.call(a),f.call(a)),a.eventListeners.reconnected.forEach(function(a){a.fn()})}),this)},Kuzzle.prototype.login=function(a,b,c,d){var e=this,f={};return Object.keys(b).forEach(function(a){b.hasOwnProperty(a)&&(f[a]=b[a])}),("number"==typeof c||"string"==typeof c)&&(f.expiresIn=c),f.strategy=a,this.query({controller:"auth",action:"login"},f,{},function(a,b){if(null===a)e.jwtToken=b.jwt,"function"==typeof d&&d(null,e);else{if("function"!=typeof d)throw new Error(a.message);d(a)}}),e},Kuzzle.prototype.logout=function(a){var b=this,c={action:"logout",controller:"auth",requestId:g.v4(),body:{}};return this.query({controller:"auth",action:"logout"},c,{},function(c){null===c?(b.jwtToken=void 0,"function"==typeof a&&a(null,b)):"function"==typeof a&&a(c)}),b},Kuzzle.prototype.addListener=function(a,b){var c,d=Object.keys(this.eventListeners),e=typeof b;if(this.isValid(),-1===d.indexOf(a))throw new Error("["+a+"] is not a known event. Known events: "+d.toString());if("function"!==e)throw new Error("Invalid listener type: expected a function, got a "+e);return c=g.v1(),this.eventListeners[a].push({id:c,fn:b}),c},Kuzzle.prototype.getAllStatistics=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.getAllStatistics",b),this.query({controller:"admin",action:"getAllStats"},{},a,function(a,c){return a?b(a):void b(null,c.result.hits)}),this},Kuzzle.prototype.getStatistics=function(a,b,c){var d;return c||(1===arguments.length?(c=arguments[0],b=null,a=null):(c=arguments[1],"object"==typeof arguments[0]?(b=arguments[0],a=null):(a=arguments[0],b=null))),d=function(b,d){return b?c(b):void(a?c(null,d.result.hits):c(null,[d.result]))},this.callbackRequired("Kuzzle.getStatistics",c),a?this.query({controller:"admin",action:"getStats"},{body:{startTime:a}},b,d):this.query({controller:"admin",action:"getLastStats"},{},b,d),this},Kuzzle.prototype.dataCollectionFactory=function(a,b,c){if(this.isValid(),1===arguments.length?(b=arguments[0],a=this.defaultIndex):2===arguments.length&&"object"==typeof b&&(c=b,b=a,a=this.defaultIndex),!a)throw new Error("Unable to create a new data collection object: no index specified");return this.collections[a]||(this.collections[a]={}),this.collections[a][b]||(this.collections[a][b]=new h(this,a,b,c)),this.collections[a][b]},Kuzzle.prototype.flushQueue=function(){return this.offlineQueue=[],this},Kuzzle.prototype.listCollections=function(){var a,b,c,d="all",e=Array.prototype.slice.call(arguments);if(e.forEach(function(d){switch(typeof d){case"string":a=d;break;case"object":b=d;break;case"function":c=d}}),!a){if(!this.defaultIndex)throw new Error("Kuzzle.listCollections: index required");a=this.defaultIndex}return this.callbackRequired("Kuzzle.listCollections",c),b&&b.type&&(d=b.type),this.query({index:a,controller:"read",action:"listCollections"},{body:{type:d}},b,function(a,b){return a?c(a):c(null,b.result.collections)}),this},Kuzzle.prototype.listIndexes=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.listIndexes",b),this.query({controller:"read",action:"listIndexes"},{},a,function(a,c){return a?b(a):b(null,c.result.indexes)}),this},Kuzzle.prototype.disconnect=function(){var a;this.logout(),this.state="disconnected",this.socket.close(),this.socket=null;for(a in this.collections)this.collections.hasOwnProperty(a)&&delete this.collections[a]},Kuzzle.prototype.getServerInfo=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.getServerInfo",b),this.query({controller:"read",action:"serverInfo"},{},a,function(a,c){return a?b(a):void b(null,c.result.serverInfo)}),this},Kuzzle.prototype.now=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.callbackRequired("Kuzzle.now",b),this.query({controller:"read",action:"now"},{},a,function(a,c){return a?b(a):void b(null,c.result.now)}),this},Kuzzle.prototype.query=function(a,b,c,f){var h,i={action:a.action,controller:a.controller,metadata:this.metadata},j=this;if(this.isValid(),f||"function"!=typeof c||(f=c,c=null),c&&(c.metadata&&Object.keys(c.metadata).forEach(function(a){i.metadata[a]=c.metadata[a]}),c.queuable===!1&&"offline"===j.state))return j;b.metadata&&Object.keys(b.metadata).forEach(function(a){i.metadata[a]=b.metadata[a]});for(h in b)"metadata"!==h&&b.hasOwnProperty(h)&&(i[h]=b[h]);return i=j.addHeaders(i,this.headers),void 0!==j.jwtToken&&(i.headers=i.headers||{},i.headers.authorization="Bearer "+j.jwtToken),a.collection&&(i.collection=a.collection),a.index&&(i.index=a.index),i.requestId||(i.requestId=g.v4()),"connected"===j.state||c&&c.queuable===!1?e.call(this,i,f):(j.queuing||-1!==["initializing","connecting"].indexOf(j.state))&&(d.call(this,i,f),j.queueFilter?j.queueFilter(i)&&j.offlineQueue.push({ts:Date.now(),query:i,cb:f}):j.offlineQueue.push({ts:Date.now(),query:i,cb:f})),j},Kuzzle.prototype.removeAllListeners=function(a){var b=Object.keys(this.eventListeners),c=this;if(a){if(-1===b.indexOf(a))throw new Error("["+a+"] is not a known event. Known events: "+b.toString());this.eventListeners[a]=[]}else b.forEach(function(a){c.eventListeners[a]=[]})},Kuzzle.prototype.removeListener=function(a,b){var c=Object.keys(this.eventListeners),d=this;if(-1===c.indexOf(a))throw new Error("["+a+"] is not a known event. Known events: "+c.toString());this.eventListeners[a].forEach(function(c,e){c.id===b&&d.eventListeners[a].splice(e,1)})},Kuzzle.prototype.replayQueue=function(){return"offline"===this.state||this.autoReplay||(d.call(this),f.call(this)),this},Kuzzle.prototype.setDefaultIndex=function(a){if("string"!=typeof a)throw new Error("Invalid default index: ["+a+"] (an index name is expected)");if(0===a.length)throw new Error("Cannot set an empty index as the default index");return this.defaultIndex=a,this},Kuzzle.prototype.setHeaders=function(a,b){var c=this;if("object"!=typeof a||Array.isArray(a))throw new Error("Expected a content object, received a "+typeof a);return b?c.headers=a:Object.keys(a).forEach(function(b){c.headers[b]=a[b]}),c},Kuzzle.prototype.startQueuing=function(){return"offline"!==this.state||this.autoQueue||(this.queuing=!0),this},Kuzzle.prototype.stopQueuing=function(){return"offline"!==this.state||this.autoQueue||(this.queuing=!1),this}},{"./kuzzleDataCollection":3,"node-uuid":1,"socket.io-client":void 0}],3:[function(a,b,c){function d(a,b,c){if(!b||!c)throw new Error("The KuzzleDataCollection object constructor needs an index and a collection arguments");return Object.defineProperties(this,{collection:{value:c,enumerable:!0},index:{value:b,enumerable:!0},kuzzle:{value:a,enumerable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0}}),Object.defineProperty(this,"buildQueryArgs",{value:function(a,b){return{controller:a,action:b,collection:this.collection,index:this.index}}}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["publishMessage","setHeaders","subscribe"];return d&&-1===e.indexOf(a)}}):this}var e=a("./kuzzleDocument"),f=a("./kuzzleDataMapping"),g=a("./kuzzleRoom");d.prototype.advancedSearch=function(a,b,c){var d,e=this;return c||"function"!=typeof b||(c=b,b=null),e.kuzzle.callbackRequired("KuzzleDataCollection.advancedSearch",c),d=e.kuzzle.addHeaders({body:a},this.headers),e.kuzzle.query(this.buildQueryArgs("read","search"),d,b,function(a,b){var d=[];return a?c(a):(b.result.hits.forEach(function(a){d.push(e.documentFactory(a._id,a))}),void c(null,{total:b.result.total,documents:d}))}),this},d.prototype.count=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),this.kuzzle.callbackRequired("KuzzleDataCollection.count",c),d=this.kuzzle.addHeaders({body:a},this.headers),this.kuzzle.query(this.buildQueryArgs("read","count"),d,b,function(a,b){return a?c(a):void c(null,b.result.count)}),this},d.prototype.create=function(a,b){var c={};return b||"function"!=typeof a||(b=a,a=null),c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("write","createCollection"),c,a,b),this},d.prototype.createDocument=function(a,b,c,d){var f=this,g={},h="create";return a&&"string"!=typeof a&&(d=c,c=b,b=a,a=null),d||"function"!=typeof c||(d=c,c=null),b instanceof e?g=b.toJSON():g.body=b,c&&(h=c.updateIfExist?"createOrUpdate":"create"),a&&(g._id=a),g.persist=!0,g=f.kuzzle.addHeaders(g,f.headers),d?f.kuzzle.query(this.buildQueryArgs("write",h),g,c,function(a,b){return a?d(a):void d(null,f.documentFactory(b.result._id,b.result))}):this.kuzzle.query(this.buildQueryArgs("write",h),g,c),this},d.prototype["delete"]=function(a,b){var c={};return b||"function"!=typeof a||(b=a,a=null),c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("admin","deleteCollection"),c,a,b),this},d.prototype.deleteDocument=function(a,b,c){var d,e={};return"string"==typeof a?(e._id=a,d="delete"):(e.body=a,d="deleteByQuery"),c||"function"!=typeof b||(c=b,b=null),e=this.kuzzle.addHeaders(e,this.headers),c?this.kuzzle.query(this.buildQueryArgs("write",d),e,b,function(a,b){return a?c(a):void("delete"===d?c(null,[b.result._id]):c(null,b.result.ids))}):this.kuzzle.query(this.buildQueryArgs("write",d),e,b),this},d.prototype.fetchDocument=function(a,b,c){var d={_id:a},e=this;return c||"function"!=typeof b||(c=b,b=null),e.kuzzle.callbackRequired("KuzzleDataCollection.fetch",c),d=e.kuzzle.addHeaders(d,this.headers),e.kuzzle.query(this.buildQueryArgs("read","get"),d,b,function(a,b){return a?c(a):void c(null,e.documentFactory(b.result._id,b.result))}),this},d.prototype.fetchAllDocuments=function(a,b){return b||"function"!=typeof a||(b=a,a=null),this.kuzzle.callbackRequired("KuzzleDataCollection.fetchAll",b),this.advancedSearch({},a,b),this},d.prototype.getMapping=function(a,b){var c;return b||"function"!=typeof a||(b=a,a=null),this.kuzzle.callbackRequired("KuzzleDataCollection.getMapping",b),c=new f(this),c.refresh(a,b),this},d.prototype.publishMessage=function(a,b){var c={};return a instanceof e?c=a.toJSON():c.body=a,c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("write","publish"),c,b),this},d.prototype.putMapping=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),d=new f(this,a),d.apply(b,c),this},d.prototype.replaceDocument=function(a,b,c,d){var e=this,f={_id:a,body:b};return d||"function"!=typeof c||(d=c,c=null),f=e.kuzzle.addHeaders(f,this.headers),d?e.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),f,c,function(a,b){return a?d(a):void d(null,e.documentFactory(b.result._id,b.result))}):e.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),f,c),this},d.prototype.subscribe=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),this.kuzzle.callbackRequired("KuzzleDataCollection.subscribe",c),d=new g(this,b),d.renew(a,c)},d.prototype.truncate=function(a,b){var c={};return b||"function"!=typeof a||(b=a,a=null),c=this.kuzzle.addHeaders(c,this.headers),this.kuzzle.query(this.buildQueryArgs("admin","truncateCollection"),c,a,b),this},d.prototype.updateDocument=function(a,b,c,d){var f={_id:a,body:b},g=this;return d||"function"!=typeof c||(d=c,c=null),f=g.kuzzle.addHeaders(f,this.headers),d?g.kuzzle.query(this.buildQueryArgs("write","update"),f,c,function(a,b){var c;return a?d(a):(c=new e(g,b.result._id),void c.refresh(d))}):g.kuzzle.query(this.buildQueryArgs("write","update"),f,c),g},d.prototype.documentFactory=function(a,b){var c=b._source?new e(this,a,b._source):new e(this,a,b);return b._version&&b._source&&(c.version=b._version),c},d.prototype.roomFactory=function(a){return new g(this,a)},d.prototype.dataMappingFactory=function(a){return new f(this,a)},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{"./kuzzleDataMapping":4,"./kuzzleDocument":5,"./kuzzleRoom":6}],4:[function(a,b,c){function d(a,b){return Object.defineProperties(this,{collection:{value:a,eunmerable:!0},kuzzle:{value:a.kuzzle,enumerable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0},mapping:{value:b||{},enumerable:!0,writable:!0}}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["set","setHeaders"];return d&&-1===e.indexOf(a)}}):this}d.prototype.apply=function(a,b){var c=this,d=this.kuzzle.addHeaders({body:{properties:this.mapping}},this.headers);return b||"function"!=typeof a||(b=a,a=null),c.kuzzle.query(this.collection.buildQueryArgs("admin","putMapping"),d,a,function(d){return d?b?b(d):!1:void c.refresh(a,b)}),this},d.prototype.refresh=function(a,b){var c=this,d=this.kuzzle.addHeaders({},this.headers);return b||"function"!=typeof a||(b=a,a=null),this.kuzzle.query(this.collection.buildQueryArgs("admin","getMapping"),d,a,function(a,d){return a?b?b(a):!1:d.result[c.collection.index]?d.result[c.collection.index].mappings[c.collection.collection]?(c.mapping=d.result[c.collection.index].mappings[c.collection.collection].properties,void(b&&b(null,c))):b?b(new Error("No mapping found for collection "+c.collection.collection)):!1:b?b(new Error("No mapping found for index "+c.collection.index)):!1}),this},d.prototype.set=function(a,b){return this.mapping[a]=b,this},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{}],5:[function(a,b,c){function d(a,b,c){return Object.defineProperties(this,{queue:{value:[],writable:!0},refreshing:{value:!1,writable:!0},collection:{value:a.collection,enumerable:!0},dataCollection:{value:a,enumerable:!0},kuzzle:{value:a.kuzzle,enumerable:!0},id:{value:void 0,enumerable:!0,writable:!0},content:{value:{},writable:!0,enumerable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0},version:{value:void 0,enumerable:!0,writable:!0}}),!c&&b&&"object"==typeof b&&(c=b,b=null),c&&(c._version&&(this.version=c._version,delete c._version),this.setContent(c,!0)),b&&Object.defineProperty(this,"id",{value:b,enumerable:!0}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["delete","refresh","save"];return d&&-1!==e.indexOf(a)}}):this}function e(){for(var a;this.queue.length>0;)a=this.queue.shift(),this[a.action].apply(this,a.args)}d.prototype.toJSON=function(){var a={};return this.id&&(a._id=this.id),a.body=this.content,a._version=this.version,a=this.kuzzle.addHeaders(a,this.headers)},d.prototype.toString=function(){return JSON.stringify(this.toJSON())},d.prototype["delete"]=function(a,b){var c=this;if(b||"function"!=typeof a||(b=a,a=null),this.refreshing)return this.queue.push({action:"delete",args:[a,b]}),this;if(!this.id)throw new Error("KuzzleDocument.delete: cannot delete a document without a document ID");return b?this.kuzzle.query(this.dataCollection.buildQueryArgs("write","delete"),this.toJSON(),a,function(a){return a?b(a):void b(null,c)}):this.kuzzle.query(this.dataCollection.buildQueryArgs("write","delete"),this.toJSON(),a),this},d.prototype.refresh=function(a,b){var c=this;if(b||"function"!=typeof a||(b=a,a=null),this.refreshing)return this.queue.push({action:"refresh",args:[a,b]}),this;if(!c.id)throw new Error("KuzzleDocument.refresh: cannot retrieve a document if no ID has been provided");return c.refreshing=!0,c.kuzzle.query(c.dataCollection.buildQueryArgs("read","get"),{_id:c.id},a,function(a,d){return a?(c.refreshing=!1,c.queue=[],b?b(a):!1):(c.version=d.result._version,c.content=d.result._source,b&&b(null,c),c.refreshing=!1,void e.call(c))}),this},d.prototype.save=function(a,b){var c=this.toJSON(),d=this;return a&&void 0===b&&"function"==typeof a&&(b=a,a=null),d.refreshing?(d.queue.push({action:"save",args:[a,b]}),d):(c.persist=!0,d.kuzzle.query(this.dataCollection.buildQueryArgs("write","createOrUpdate"),c,a,function(a,c){return a?b?b(a):!1:(d.id=c.result._id,d.version=c.result._version,void(b&&b(null,d)))}),d)},d.prototype.publish=function(a){var b=this.toJSON();return this.refreshing?(this.queue.push({action:"publish",args:[a]}),this):(this.kuzzle.query(this.dataCollection.buildQueryArgs("write","publish"),b,a),this)},d.prototype.setContent=function(a,b){var c=this;return this.refreshing?(this.queue.push({action:"setContent",args:[a,b]}),this):(b?this.content=a:Object.keys(a).forEach(function(b){c.content[b]=a[b]}),this)},d.prototype.subscribe=function(a,b){var c;if(a&&!b&&"function"==typeof a&&(b=a,a=null),this.kuzzle.callbackRequired("KuzzleDocument.subscribe",b),!this.id)throw new Error("KuzzleDocument.subscribe: cannot subscribe to a document if no ID has been provided");return c={ids:{values:[this.id]}},this.dataCollection.subscribe(c,a,b)},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{}],6:[function(a,b,c){function d(a,b){return Object.defineProperties(this,{callback:{value:null,writable:!0},channel:{value:null,writable:!0},id:{value:g.v4()},notifier:{value:null,writable:!0},queue:{value:[],writable:!0},scope:{value:b&&b.scope?b.scope:"all"},state:{value:b&&b.state?b.state:"done"},subscribing:{value:!1,writable:!0},users:{value:b&&b.users?b.users:"none"},collection:{value:a,enumerable:!0},kuzzle:{value:a.kuzzle,enumerable:!0},filters:{value:null,enumerable:!0,writable:!0},headers:{value:JSON.parse(JSON.stringify(a.headers)),enumerable:!0,writable:!0},metadata:{value:b&&b.metadata?b.metadata:{},enumerable:!0,writable:!0},roomId:{value:null,enumerable:!0,writable:!0},subscribeToSelf:{value:b&&"boolean"==typeof b.subscribeToSelf?b.subscribeToSelf:!0,enumerable:!0,writable:!0}}),this.kuzzle.bluebird?this.kuzzle.bluebird.promisifyAll(this,{suffix:"Promise",filter:function(a,b,c,d){var e=["count"];return d&&-1!==e.indexOf(a)}}):this}function e(a){return a.error?this.callback(a.error):void(this.kuzzle.requestHistory[a.requestId]?(this.subscribeToSelf&&this.callback(null,a),delete this.kuzzle.requestHistory[a.requestId]):this.callback(null,a))}function f(){for(var a;this.queue.length>0;)a=this.queue.shift(),this[a.action].apply(this,a.args)}var g=a("node-uuid");d.prototype.count=function(a){var b;return this.kuzzle.callbackRequired("KuzzleRoom.count",a),b=this.kuzzle.addHeaders({body:{roomId:this.roomId}},this.headers),this.subscribing?(this.queue.push({action:"count",args:[a]}),this):(this.kuzzle.query(this.collection.buildQueryArgs("subscribe","count"),b,function(b,c){return b?a(b):void a(null,c.result.count)}),this)},d.prototype.renew=function(a,b){var c={scope:this.scope,state:this.state,users:this.users},d=this;return!b&&a&&"function"==typeof a&&(b=a,a=null),"connected"!==this.kuzzle.state?(this.callback=b,this.kuzzle.subscriptions.pending[d.id]=d,this):this.subscribing?(this.queue.push({action:"renew",args:[a,b]}),this):(this.kuzzle.callbackRequired("KuzzleRoom.renew",b),this.unsubscribe(),this.roomId=null,this.subscribing=!0,this.callback=b,this.kuzzle.subscriptions.pending[d.id]=d,a&&(this.filters=a),c.body=this.filters,c=this.kuzzle.addHeaders(c,this.headers),d.kuzzle.query(this.collection.buildQueryArgs("subscribe","on"),c,{metadata:this.metadata},function(a,b){if(delete d.kuzzle.subscriptions.pending[d.id],d.subscribing=!1,a)throw d.queue=[],new Error("Error during Kuzzle subscription: "+a.message);d.roomId=b.result.roomId,d.channel=b.result.channel,d.kuzzle.subscriptions[d.roomId]||(d.kuzzle.subscriptions[d.roomId]={}),d.kuzzle.subscriptions[d.roomId][d.id]=d,d.notifier=e.bind(d),d.kuzzle.socket.on(d.channel,d.notifier),f.call(d)}),this)},d.prototype.unsubscribe=function(){var a,b=this,c=b.roomId;return b.subscribing?(b.queue.push({action:"unsubscribe",args:[]}),b):(c&&(b.kuzzle.socket.off(b.channel,this.notifier),1===Object.keys(b.kuzzle.subscriptions[c]).length?(delete b.kuzzle.subscriptions[c],0===Object.keys(b.kuzzle.subscriptions.pending).length?b.kuzzle.query(b.collection.buildQueryArgs("subscribe","off"),{body:{roomId:c}}):a=setInterval(function(){0===Object.keys(b.kuzzle.subscriptions.pending).length&&(b.kuzzle.subscriptions[c]||b.kuzzle.query(b.collection.buildQueryArgs("subscribe","off"),{body:{roomId:c}}),clearInterval(a))},100)):delete b.kuzzle.subscriptions[c][b.id],b.roomId=null),b)},d.prototype.setHeaders=function(a,b){return this.kuzzle.setHeaders.call(this,a,b),this},b.exports=d},{"node-uuid":1}]},{},[2]); //# sourceMappingURL=kuzzle.min.map \ No newline at end of file diff --git a/dist/kuzzle.min.map b/dist/kuzzle.min.map index 050c74bd5..3fed6a716 100644 --- a/dist/kuzzle.min.map +++ b/dist/kuzzle.min.map @@ -1 +1 @@ -{"version":3,"sources":["kuzzle.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length",1,"module","_window","setupBrowser","_crypto","crypto","msCrypto","_rng","getRandomValues","_rnds8","Uint8Array","_whatwgRNG","_rnds","Array","_mathRNG","Math","random","console","warn","setupNode","_rb","randomBytes","_nodeRNG","parse","buf","offset","ii","toLowerCase","replace","oct","_hexToByte","unparse","bth","_byteToHex","v1","options","b","clockseq","_clockseq","msecs","Date","getTime","nsecs","_lastNSecs","dt","_lastMSecs","tl","tmh","node","_nodeId","v4","BufferClass","rnds","rng","_previousRoot","Buffer","toString","substr","_seedBytes","uuid","define","amd","noConflict","window",2,"cleanQueue","self","this","now","lastDocumentIndex","queueTTL","offlineQueue","forEach","query","index","ts","splice","queueMaxSize","emitRequest","request","cb","undefined","jwtToken","socket","once","requestId","response","error","message","eventListeners","jwtTokenExpired","listener","fn","emit","requestHistory","Object","keys","key","dequeue","shift","setTimeout","max","replayInterval","queuing","KuzzleDataCollection","Kuzzle","url","defineProperties","collections","value","writable","connectCB","connected","disconnected","reconnected","io","state","subscriptions","pending","autoReconnect","enumerable","defaultIndex","reconnectionDelay","autoQueue","autoReplay","autoResubscribe","headers","metadata","queueFilter","loginStrategy","loginCredentials","loginExpiresIn","opt","hasOwnProperty","getOwnPropertyDescriptor","offlineMode","defineProperty","header","errorMessagePrefix","callback","connect","bluebird","promisifyAll","suffix","filter","name","func","target","passes","whitelist","indexOf","prototype","reconnection","forceNew","roomId","subscriptionId","subscription","renew","login","on","disconnect","strategy","credentials","expiresIn","controller","action","jwt","logout","body","addListener","event","listenerId","knownEvents","listenerType","isValid","push","id","getAllStatistics","callbackRequired","err","res","result","hits","getStatistics","timestamp","queryCB","arguments","startTime","dataCollectionFactory","collection","flushQueue","listCollections","collectionType","type","close","queryArgs","attr","object","meta","queuable","addHeaders","authorization","removeAllListeners","eventName","removeListener","replayQueue","setDefaultIndex","setHeaders","content","isArray","startQueuing","stopQueuing","./kuzzleDataCollection","node-uuid","socket.io-client",3,"kuzzle","JSON","stringify","blacklist","KuzzleDocument","KuzzleDataMapping","KuzzleRoom","advancedSearch","filters","buildQueryArgs","documents","doc","documentFactory","_id","total","count","create","data","createDocument","document","toJSON","updateIfExist","persist","deleteDocument","arg","ids","fetchDocument","documentId","fetchAllDocuments","getMapping","kuzzleMapping","refresh","publishMessage","putMapping","mapping","dataMapping","apply","replaceDocument","subscribe","room","truncate","updateDocument","_source","_version","version","roomFactory","dataMappingFactory","./kuzzleDataMapping","./kuzzleDocument","./kuzzleRoom",4,"kuzzleDataCollection","eunmerable","properties","mappings","set","field",5,"queue","refreshing","dataCollection","setContent","element","args","save","publish","values",6,"channel","notifier","scope","subscribing","users","subscribeToSelf","notificationCallback","subscribeQuery","unsubscribe","bind","interval","off","setInterval","clearInterval"],"mappings":";CAAA,QAAUA,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGI,EAAE,MAAOA,GAAEJ,GAAE,EAAI,IAAIK,GAAE,GAAIC,OAAM,uBAAuBN,EAAE,IAAK,MAAMK,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEX,EAAEG,IAAIS,WAAYb,GAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGS,QAAkD,IAAI,GAA1CL,GAAkB,kBAATD,UAAqBA,QAAgBH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAAED,EAAEE,GAAI,OAAOD,KAAKa,GAAG,SAAST,EAAQU,EAAOJ,IAOvd,SAAUK,GACR,YAOA,SAASC,KAEP,GAAIC,GAAUF,EAAQG,QAAUH,EAAQI,QAExC,KAAKC,GAAQH,GAAWA,EAAQI,gBAI9B,IACE,GAAIC,GAAS,GAAIC,YAAW,GAC5BC,GAAaJ,EAAO,WAElB,MADAH,GAAQI,gBAAgBC,GACjBA,GAETF,IACA,MAAMxB,IAGV,IAAKwB,EAAM,CAKT,GAAKK,GAAQ,GAAIC,OAAM,GACvBC,GAAWP,EAAO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Od,OAAQqG,KAEtFuC,EAAWE,YAAY,WACyC,IAA1DzM,OAAOC,KAAK9B,EAAKsJ,OAAOnG,cAAcC,SAASvH,SAC5CmE,EAAKsJ,OAAOnG,cAAc0I,IAC7B7L,EAAKsJ,OAAO/I,MAAMP,EAAK2H,WAAWoC,eAAe,YAAa,QAASzD,MAAOd,OAAQqG,KAExF0C,cAAcH,KAEf,YAGEpO,GAAKsJ,OAAOnG,cAAc0I,GAAM7L,EAAK8G,IAG9C9G,EAAKwF,OAAS,MAGTxF,IAYT4J,EAAWvE,UAAUwD,WAAa,SAAUC,EAASpL,GAEnD,MADAuC,MAAKqJ,OAAOT,WAAWjN,KAAKqE,KAAM6I,EAASpL,GACpCuC,MAuCTlE,EAAOJ,QAAUiO,IAEdT,YAAY,SAAS","file":"kuzzle.min.js"} \ No newline at end of file +{"version":3,"sources":["kuzzle.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length",1,"module","_window","setupBrowser","_crypto","crypto","msCrypto","_rng","getRandomValues","_rnds8","Uint8Array","_whatwgRNG","_rnds","Array","_mathRNG","Math","random","console","warn","setupNode","_rb","randomBytes","_nodeRNG","parse","buf","offset","ii","toLowerCase","replace","oct","_hexToByte","unparse","bth","_byteToHex","v1","options","b","clockseq","_clockseq","msecs","Date","getTime","nsecs","_lastNSecs","dt","_lastMSecs","tl","tmh","node","_nodeId","v4","BufferClass","rnds","rng","_previousRoot","Buffer","toString","substr","_seedBytes","uuid","define","amd","noConflict","window",2,"cleanQueue","self","this","now","lastDocumentIndex","queueTTL","offlineQueue","forEach","query","index","ts","splice","queueMaxSize","emitRequest","request","cb","undefined","jwtToken","socket","once","requestId","response","error","message","eventListeners","jwtTokenExpired","listener","fn","emit","requestHistory","Object","keys","key","dequeue","shift","setTimeout","max","replayInterval","queuing","KuzzleDataCollection","Kuzzle","url","defineProperties","collections","value","writable","connectCB","connected","disconnected","reconnected","io","state","subscriptions","pending","autoReconnect","enumerable","defaultIndex","reconnectionDelay","autoQueue","autoReplay","autoResubscribe","headers","metadata","queueFilter","loginStrategy","loginCredentials","loginExpiresIn","opt","hasOwnProperty","getOwnPropertyDescriptor","offlineMode","defineProperty","header","errorMessagePrefix","callback","connect","bluebird","promisifyAll","suffix","filter","name","func","target","passes","whitelist","indexOf","prototype","reconnection","forceNew","roomId","subscriptionId","subscription","renew","login","on","disconnect","strategy","credentials","expiresIn","controller","action","jwt","logout","body","addListener","event","listenerId","knownEvents","listenerType","isValid","push","id","getAllStatistics","callbackRequired","err","res","result","hits","getStatistics","timestamp","queryCB","arguments","startTime","dataCollectionFactory","collection","flushQueue","listCollections","collectionType","args","slice","arg","type","listIndexes","indexes","close","getServerInfo","serverInfo","queryArgs","attr","object","meta","queuable","addHeaders","authorization","removeAllListeners","eventName","removeListener","replayQueue","setDefaultIndex","setHeaders","content","isArray","startQueuing","stopQueuing","./kuzzleDataCollection","node-uuid","socket.io-client",3,"kuzzle","JSON","stringify","blacklist","KuzzleDocument","KuzzleDataMapping","KuzzleRoom","advancedSearch","filters","buildQueryArgs","documents","doc","documentFactory","_id","total","count","create","data","createDocument","document","toJSON","updateIfExist","persist","deleteDocument","ids","fetchDocument","documentId","fetchAllDocuments","getMapping","kuzzleMapping","refresh","publishMessage","putMapping","mapping","dataMapping","apply","replaceDocument","subscribe","room","truncate","updateDocument","_source","_version","version","roomFactory","dataMappingFactory","./kuzzleDataMapping","./kuzzleDocument","./kuzzleRoom",4,"kuzzleDataCollection","eunmerable","properties","mappings","set","field",5,"queue","refreshing","dataCollection","setContent","element","save","publish","values",6,"channel","notifier","scope","subscribing","users","subscribeToSelf","notificationCallback","subscribeQuery","unsubscribe","bind","interval","off","setInterval","clearInterval"],"mappings":";CAAA,QAAUA,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAG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