Skip to content

Commit

Permalink
Travis CI - [ci skip] - automatic dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed May 4, 2016
1 parent 6fd522d commit ab135fa
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 29 deletions.
103 changes: 78 additions & 25 deletions dist/kuzzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,40 @@ Kuzzle.prototype.whoAmI = function (callback) {
return self;
};


/**
* Update current user in Kuzzle.
*
* @param {object} content - a plain javascript object representing the user's modification
* @param {object} [options] - (optional) arguments
* @param {responseCallback} [cb] - (optional) Handles the query response
*/
Kuzzle.prototype.updateSelf = function (content, options, cb) {
var
self = this,
data = {},
queryArgs = {controller: 'auth', action: 'updateSelf'};

if (!cb && typeof options === 'function') {
cb = options;
options = null;
}

data.body = content;

if (cb) {
self.query(queryArgs, data, options, function (err, res) {
if (err) {
return cb(err);
}

cb(null, res.result);
});
} else {
self.query(queryArgs, data, options);
}
};

/**
* Clean up the queue, ensuring the queryTTL and queryMaxSize properties are respected
*/
Expand Down Expand Up @@ -1873,27 +1907,6 @@ KuzzleDataCollection.prototype.createDocument = function (id, document, options,
return this;
};

/**
* Delete this data collection and all documents in it.
*
* @param {object} [options] - Optional parameters
* @param {responseCallback} [cb] - returns Kuzzle's response
* @returns {*} this
*/
KuzzleDataCollection.prototype.delete = function (options, cb) {
var data = {};

if (!cb && typeof options === 'function') {
cb = options;
options = null;
}

data = this.kuzzle.addHeaders(data, this.headers);
this.kuzzle.query(this.buildQueryArgs('admin', 'deleteCollection'), data, options, cb);

return this;
};

/**
* Delete persistent documents.
*
Expand Down Expand Up @@ -2730,6 +2743,36 @@ KuzzleDocument.prototype.setHeaders = function (content, replace) {
module.exports = KuzzleDocument;

},{}],7:[function(require,module,exports){
/**
* This is a global callback pattern, called by all asynchronous functions of the Kuzzle object.
*
* @callback responseCallback
* @param {Object} err - Error object, NULL if the query is successful
* @param {Object} data - The content of the query response
*/


/**
* Kuzzle's memory storage is a separate data store from the database layer.
* It is internaly based on Redis. You can access most of Redis functions (all
* lowercased), excepting:
* * all cluster based functions
* * all script based functions
* * all cursors functions
*
* For instance:
* kuzzle.memoryStorage
* .set('myKey', 'myValue')
* .get('myKey', function (err, response) {
* console.log(response.result);
*
* // { _id: 'foo', body: { value: 'myValue' }}
* });
*
*
* @param {object} kuzzle - Kuzzle instance to inherit from
* @constructor
*/
function KuzzleMemoryStorage(kuzzle) {
Object.defineProperties(this, {
// read-only properties
Expand Down Expand Up @@ -2762,6 +2805,9 @@ function KuzzleMemoryStorage(kuzzle) {
}


/**
* constructs the memoryStorage functions.
*/
(function() {

var
Expand Down Expand Up @@ -3064,7 +3110,7 @@ KuzzleRoom.prototype.count = function (cb) {

data = this.kuzzle.addHeaders({body: {roomId: this.roomId}}, this.headers);

if (this.subscribing) {
if (!isReady.call(this)) {
this.queue.push({action: 'count', args: [cb]});
return this;
}
Expand Down Expand Up @@ -3185,7 +3231,7 @@ KuzzleRoom.prototype.unsubscribe = function () {
room = self.roomId,
interval;

if (self.subscribing) {
if (!isReady.call(this)) {
self.queue.push({action: 'unsubscribe', args: []});
return self;
}
Expand Down Expand Up @@ -3273,6 +3319,13 @@ function dequeue () {
}
}

function isReady() {
if (this.kuzzle.state !== 'connected' || this.subscribing) {
return false;
}
return true;
}

module.exports = KuzzleRoom;

},{"node-uuid":2}],9:[function(require,module,exports){
Expand Down Expand Up @@ -4218,10 +4271,10 @@ KuzzleSecurity.prototype.updateUser = function (id, content, options, cb) {
return cb(err);
}

cb(null, res.result._id);
cb(null, new KuzzleUser(self, res.result._id, res.result._source));
});
} else {
self.kuzzle.query(this.buildQueryArgs(action), data);
self.kuzzle.query(this.buildQueryArgs(action), data, options);
}
};

Expand Down
Loading

0 comments on commit ab135fa

Please sign in to comment.