Skip to content

Commit 8188bd5

Browse files
committed
updated dependencies
1 parent 6ffdb2e commit 8188bd5

File tree

4 files changed

+34
-17
lines changed

4 files changed

+34
-17
lines changed

dist/kuzzle.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ function KuzzleDataMapping(kuzzleDataCollection, mapping) {
20772077
//read-only properties
20782078
collection: {
20792079
value: kuzzleDataCollection,
2080-
eunmerable: true
2080+
enumerable: true
20812081
},
20822082
kuzzle: {
20832083
value: kuzzleDataCollection.kuzzle,
@@ -3037,7 +3037,7 @@ KuzzleProfile.prototype.hydrate = function (options, cb) {
30373037
return cb(error);
30383038
}
30393039

3040-
cb(null, new KuzzleProfile(self, response.result._id, response.result._source));
3040+
cb(null, new KuzzleProfile(self, self.id, {roles: response.result.hits}));
30413041
});
30423042
};
30433043

@@ -3764,7 +3764,7 @@ function KuzzleSecurityDocument(kuzzleSecurity, id, content) {
37643764
});
37653765

37663766
if (content) {
3767-
this.setContent(content);
3767+
this.setContent(content, true);
37683768
}
37693769

37703770
// promisifying
@@ -3781,13 +3781,25 @@ function KuzzleSecurityDocument(kuzzleSecurity, id, content) {
37813781
}
37823782

37833783
/**
3784+
* Replaces the current content with new data.
3785+
* Changes made by this function won’t be applied until the save method is called.
37843786
*
37853787
* @param {Object} data - New securityDocument content
3788+
* @param {boolean} replace - if true: replace this document content with the provided data.
37863789
*
37873790
* @return {Object} this
37883791
*/
3789-
KuzzleSecurityDocument.prototype.setContent = function (data) {
3790-
this.content = data;
3792+
KuzzleSecurityDocument.prototype.setContent = function (data, replace) {
3793+
var self = this;
3794+
3795+
if (replace) {
3796+
this.content = data;
3797+
}
3798+
else {
3799+
Object.keys(data).forEach(function (key) {
3800+
self.content[key] = data[key];
3801+
});
3802+
}
37913803

37923804
return this;
37933805
};
@@ -3901,11 +3913,16 @@ KuzzleUser.prototype.hydrate = function (options, cb) {
39013913
}
39023914

39033915
self.kuzzle.query(this.kuzzleSecurity.buildQueryArgs('getProfile'), {_id: this.content.profile}, options, function (error, response) {
3916+
var hydratedUser;
3917+
39043918
if (error) {
39053919
return cb(error);
39063920
}
39073921

3908-
cb(null, new KuzzleUser(self, response.result._id, response.result._source));
3922+
hydratedUser = new KuzzleUser(self.kuzzleSecurity, self.id, self.content);
3923+
hydratedUser.setProfile(new KuzzleProfile(self.kuzzleSecurity, response.result._id, response.result._source));
3924+
3925+
cb(null, hydratedUser);
39093926
});
39103927
};
39113928

dist/kuzzle.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/kuzzle.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424
"main": "index.js",
2525
"license": "Apache-2.0",
2626
"dependencies": {
27-
"bluebird": "3.1.1",
27+
"bluebird": "3.3.1",
2828
"node-uuid": "1.4.7",
29-
"socket.io-client": "1.4.4"
29+
"socket.io-client": "1.4.5"
3030
},
3131
"devDependencies": {
3232
"browserify": "13.0.0",
3333
"codecov": "^1.0.1",
3434
"grunt": "0.4.5",
3535
"grunt-browserify": "^4.0.1",
36-
"grunt-contrib-jshint": "^0.11.3",
37-
"grunt-contrib-uglify": "0.11.0",
38-
"gruntify-eslint": "^1.0.1",
36+
"grunt-contrib-jshint": "^1.0.0",
37+
"grunt-contrib-uglify": "0.11.1",
38+
"gruntify-eslint": "^2.0.0",
3939
"istanbul": "0.4.2",
4040
"istanbul-middleware": "0.2.2",
41-
"mocha": "2.3.4",
41+
"mocha": "2.4.5",
4242
"proxyquire": "^1.7.3",
4343
"rewire": "^2.5.0",
44-
"should": "8.1.1"
44+
"should": "8.2.2"
4545
}
4646
}

0 commit comments

Comments
 (0)