From 4f0efd04be2a562e8468c042a2eca294e1ee1618 Mon Sep 17 00:00:00 2001 From: scottinet Date: Wed, 27 Jan 2016 14:59:54 +0100 Subject: [PATCH] removed the dataCollection.putMapping method --- dist/kuzzle.js | 23 -------- dist/kuzzle.min.js | 4 +- dist/kuzzle.min.map | 2 +- package.json | 2 +- src/kuzzleDataCollection.js | 23 -------- test/kuzzleDataCollection/methods.test.js | 67 ----------------------- 6 files changed, 4 insertions(+), 117 deletions(-) diff --git a/dist/kuzzle.js b/dist/kuzzle.js index 116d83aa5..ae48edefc 100644 --- a/dist/kuzzle.js +++ b/dist/kuzzle.js @@ -1760,29 +1760,6 @@ KuzzleDataCollection.prototype.publishMessage = function (document, options) { return this; }; -/** - * Applies a new mapping to the data collection. - * Note that you cannot delete an existing mapping, you can only add or update one. - * - * @param {object} mapping - mapping to apply - * @param {object} [options] - optional arguments - * @param {responseCallback} [cb] - Returns an instantiated KuzzleDataMapping object - * @returns {*} this - */ -KuzzleDataCollection.prototype.putMapping = function (mapping, options, cb) { - var dataMapping; - - if (!cb && typeof options === 'function') { - cb = options; - options = null; - } - - dataMapping = new KuzzleDataMapping(this, mapping); - dataMapping.apply(options, cb); - - return this; -}; - /** * Replace an existing document with a new one. * diff --git a/dist/kuzzle.min.js b/dist/kuzzle.min.js index 475c55105..67bf843c7 100644 --- a/dist/kuzzle.min.js +++ b/dist/kuzzle.min.js @@ -1,3 +1,3 @@ -// Official Javascript SDK for Kuzzle v1.3.7 - 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&&-1!==["number","string"].indexOf(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","login","logout","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={strategy:a};return d||"function"!=typeof c||(d=c,c=null),Object.keys(b).forEach(function(a){f[a]=b[a]}),-1!==["number","string"].indexOf(typeof c)&&(f.expiresIn=c),this.query({controller:"auth",action:"login"},{body: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,f=this;return c||"function"!=typeof b||(c=b,b=null),f.kuzzle.callbackRequired("KuzzleDataCollection.advancedSearch",c),d=f.kuzzle.addHeaders({body:a},this.headers),f.kuzzle.query(this.buildQueryArgs("read","search"),d,b,function(a,b){var d=[];return a?c(a):(b.result.hits.forEach(function(a){var b=new e(f,a._id,a._source);b.version=a._version,d.push(b)}),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){var c;return a?d(a):(c=new e(f,b.result._id,b.result._source),c.version=b.result._version,void d(null,c))}):f.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},f=this;return c||"function"!=typeof b||(c=b,b=null),f.kuzzle.callbackRequired("KuzzleDataCollection.fetch",c),d=f.kuzzle.addHeaders(d,this.headers),f.kuzzle.query(this.buildQueryArgs("read","get"),d,b,function(a,b){var d;return a?c(a):(d=new e(f,b.result._id,b.result._source),d.version=b.result._version,void c(null,d))}),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 f=this,g={_id:a,body:b};return d||"function"!=typeof c||(d=c,c=null),g=f.kuzzle.addHeaders(g,this.headers),d?f.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),g,c,function(a,b){var c;return a?d(a):(c=new e(f,b.result._id,b.result._source),c.version=b.result._version,void d(null,c))}):f.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),g,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){return new e(this,a,b)},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),a&&(this.filters=a),"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,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.8 - 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&&-1!==["number","string"].indexOf(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","login","logout","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={strategy:a};return d||"function"!=typeof c||(d=c,c=null),Object.keys(b).forEach(function(a){f[a]=b[a]}),-1!==["number","string"].indexOf(typeof c)&&(f.expiresIn=c),this.query({controller:"auth",action:"login"},{body: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,f=this;return c||"function"!=typeof b||(c=b,b=null),f.kuzzle.callbackRequired("KuzzleDataCollection.advancedSearch",c),d=f.kuzzle.addHeaders({body:a},this.headers),f.kuzzle.query(this.buildQueryArgs("read","search"),d,b,function(a,b){var d=[];return a?c(a):(b.result.hits.forEach(function(a){var b=new e(f,a._id,a._source);b.version=a._version,d.push(b)}),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){var c;return a?d(a):(c=new e(f,b.result._id,b.result._source),c.version=b.result._version,void d(null,c))}):f.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},f=this;return c||"function"!=typeof b||(c=b,b=null),f.kuzzle.callbackRequired("KuzzleDataCollection.fetch",c),d=f.kuzzle.addHeaders(d,this.headers),f.kuzzle.query(this.buildQueryArgs("read","get"),d,b,function(a,b){var d;return a?c(a):(d=new e(f,b.result._id,b.result._source),d.version=b.result._version,void c(null,d))}),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.replaceDocument=function(a,b,c,d){var f=this,g={_id:a,body:b};return d||"function"!=typeof c||(d=c,c=null),g=f.kuzzle.addHeaders(g,this.headers),d?f.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),g,c,function(a,b){var c;return a?d(a):(c=new e(f,b.result._id,b.result._source),c.version=b.result._version,void d(null,c))}):f.kuzzle.query(this.buildQueryArgs("write","createOrUpdate"),g,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){return new e(this,a,b)},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),a&&(this.filters=a),"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,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 ff9a0f3e8..630da917b 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","indexOf","opt","hasOwnProperty","getOwnPropertyDescriptor","offlineMode","defineProperty","header","errorMessagePrefix","callback","connect","bluebird","promisifyAll","suffix","filter","name","func","target","passes","whitelist","prototype","reconnection","forceNew","roomId","subscriptionId","subscription","renew","login","on","disconnect","strategy","credentials","expiresIn","controller","action","body","jwt","logout","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","newDocument","_id","_source","version","_version","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","documentFactory","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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\ 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","indexOf","opt","hasOwnProperty","getOwnPropertyDescriptor","offlineMode","defineProperty","header","errorMessagePrefix","callback","connect","bluebird","promisifyAll","suffix","filter","name","func","target","passes","whitelist","prototype","reconnection","forceNew","roomId","subscriptionId","subscription","renew","login","on","disconnect","strategy","credentials","expiresIn","controller","action","body","jwt","logout","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","newDocument","_id","_source","version","_version","total","count","create","data","createDocument","document","toJSON","updateIfExist","persist","deleteDocument","ids","fetchDocument","documentId","fetchAllDocuments","getMapping","kuzzleMapping","refresh","publishMessage","replaceDocument","subscribe","room","truncate","updateDocument","documentFactory","roomFactory","dataMappingFactory","mapping","./kuzzleDataMapping","./kuzzleDocument","./kuzzleRoom",4,"kuzzleDataCollection","eunmerable","apply","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,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,OAAO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cAAcC,SAASvH,SAC5CmE,EAAK6J,OAAO1G,cAAc+I,IAC7BlM,EAAK6J,OAAOtJ,MAAMP,EAAK2H,WAAW2C,eAAe,YAAa,QAASlE,MAAOZ,OAAQ0G,KAExFyC,cAAcH,KAEf,YAGExO,GAAK6J,OAAO1G,cAAc+I,GAAMlM,EAAK8G,IAG9C9G,EAAKwF,OAAS,MAGTxF,IAYTmK,EAAW9E,UAAU+D,WAAa,SAAUC,EAAS3L,GAEnD,MADAuC,MAAK4J,OAAOT,WAAWxN,KAAKqE,KAAMoJ,EAAS3L,GACpCuC,MAuCTlE,EAAOJ,QAAUwO,IAEdT,YAAY,SAAS","file":"kuzzle.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index 948dd2f10..de893bd36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-sdk", - "version": "1.3.7", + "version": "1.3.8", "description": "Official Javascript SDK for Kuzzle", "author": "The Kuzzle Team ", "repository": { diff --git a/src/kuzzleDataCollection.js b/src/kuzzleDataCollection.js index 43595b2af..d274f48c7 100644 --- a/src/kuzzleDataCollection.js +++ b/src/kuzzleDataCollection.js @@ -430,29 +430,6 @@ KuzzleDataCollection.prototype.publishMessage = function (document, options) { return this; }; -/** - * Applies a new mapping to the data collection. - * Note that you cannot delete an existing mapping, you can only add or update one. - * - * @param {object} mapping - mapping to apply - * @param {object} [options] - optional arguments - * @param {responseCallback} [cb] - Returns an instantiated KuzzleDataMapping object - * @returns {*} this - */ -KuzzleDataCollection.prototype.putMapping = function (mapping, options, cb) { - var dataMapping; - - if (!cb && typeof options === 'function') { - cb = options; - options = null; - } - - dataMapping = new KuzzleDataMapping(this, mapping); - dataMapping.apply(options, cb); - - return this; -}; - /** * Replace an existing document with a new one. * diff --git a/test/kuzzleDataCollection/methods.test.js b/test/kuzzleDataCollection/methods.test.js index 19a73f60b..46620bbd7 100644 --- a/test/kuzzleDataCollection/methods.test.js +++ b/test/kuzzleDataCollection/methods.test.js @@ -696,73 +696,6 @@ describe('KuzzleDataCollection methods', function () { }); }); - describe('#putMapping', function () { - var - KuzzleDataCollectionProxyquired, - collection; - - beforeEach(function () { - expectedQuery = { - index: 'bar', - collection: 'foo', - action: 'putMapping', - controller: 'admin', - body: {} - }; - - KuzzleDataCollectionProxyquired = proxyquire('../../src/kuzzleDataCollection', { - './kuzzleDataMapping': function (c, m) { - var dm = new KuzzleDataMapping(c, m); - - dm.refresh = function (options, cb) { - cb(null, result); - }; - return dm; - } - }); - - kuzzle = new Kuzzle('foo', {defaultIndex: 'bar'}); - collection = new KuzzleDataCollectionProxyquired(kuzzle, expectedQuery.index, expectedQuery.collection); - kuzzle.query = queryStub; - emitted = false; - result = { result: {_source: { properties: {}}}}; - error = null; - }); - - it('should instantiate a new KuzzleDataMapping object', function (done) { - var - options = { queuable: false }; - - expectedQuery.options = options; - - should(collection.putMapping(result.result, options, function (err, res) { - should(err).be.null(); - done(); - })).be.exactly(collection); - should(emitted).be.true(); - }); - - it('should handle the callback argument correctly', function () { - collection.putMapping(result.result, function () {}); - should(emitted).be.true(); - - emitted = false; - collection.putMapping(result.result, {}, function () {}); - should(emitted).be.true(); - }); - - it('should call the callback with an error if one occurs', function (done) { - error = 'foobar'; - this.timeout(50); - - collection.putMapping({}, function (err, res) { - should(err).be.exactly('foobar'); - should(res).be.undefined(); - done(); - }); - }); - }); - describe('#replaceDocument', function () { beforeEach(function () { kuzzle = new Kuzzle('foo', {defaultIndex: 'bar'});