Skip to content
Browse files

Updated JS lib to 0.9.9.

  • Loading branch information...
1 parent 1db9822 commit b81066b11f1ff068f4d82ff0a8ebb77a05125e03 @vseventer vseventer committed Aug 21, 2012
Showing with 27 additions and 15 deletions.
  1. +1 −1 README.md
  2. +25 −13 kinvey.js
  3. +1 −1 package.json
View
2 README.md
@@ -58,7 +58,7 @@ At a later stage, you might want to retrieve all books written by a certain auth
```js
// First, build a query to match the author.
var query = new Kinvey.Query();
-query.on('author').equals('Robert Kennedy');
+query.on('author').equal('Robert Kennedy');
// Create a collection, and pass in the query.
var bookCollection = new Kinvey.Collection('book', { query: query });
View
38 kinvey.js
@@ -349,7 +349,7 @@
*
* @constant
*/
- Kinvey.SDK_VERSION = '0.9.8';
+ Kinvey.SDK_VERSION = '0.9.9';
/**
* Returns current user, or null if not set.
@@ -485,6 +485,9 @@
USER_ALREADY_EXISTS: 'UserAlreadyExists',
/** @constant */
+ USER_UNAVAILABLE: 'UserUnavailable',
+
+ /** @constant */
DUPLICATE_END_USERS: 'DuplicateEndUsers',
/** @constant */
@@ -536,7 +539,13 @@
API_VERSION_NOT_IMPLEMENTED: 'APIVersionNotImplemented',
/** @constant */
- API_VERSION_NOT_AVAILABLE: 'APIVersionNotAvailable'
+ API_VERSION_NOT_AVAILABLE: 'APIVersionNotAvailable',
+
+ /** @constant */
+ INPUT_VALIDATION_FAILED: 'InputValidationFailed',
+
+ /** @constant */
+ BLruntimeError: 'BLruntimeError'
};
// Define the Kinvey Entity class.
@@ -841,6 +850,7 @@
aggregation.setReduce(function(doc, out) {
out.count += 1;
});
+ aggregation.setQuery(this.query);// Apply query.
this.store.aggregate(aggregation.toJSON(), merge(options, {
success: function(response, info) {
@@ -997,11 +1007,12 @@
}, merge(options, {
success: bind(this, function(response, info) {
// Extract token.
- this._login(response._kmd.authtoken);
+ var token = response._kmd.authtoken;
delete response._kmd.authtoken;
// Update attributes. This does not include the users password.
this.attr = response;
+ this._login(token);
options.success && options.success(this, info);
})
@@ -1144,13 +1155,13 @@
// Create a new user.
var user = new Kinvey.User(attr);
Kinvey.Entity.prototype.save.call(user, merge(options, {
- success: bind(user, function() {
- // Unset the password, we don't need it any more.
- var password = this.get(this.ATTR_PASSWORD);
- this.unset(this.ATTR_PASSWORD);
+ success: bind(user, function(_, info) {
+ // Extract token.
+ var token = this.attr._kmd.authtoken;
+ delete this.attr._kmd.authtoken;
+ this._login(token);
- // Login the created user.
- this.login(this.getUsername(), password, options);
+ options.success && options.success(this, info);
})
}));
return user;// return the instance
@@ -1215,16 +1226,17 @@
* @name Kinvey.UserCollection
* @constructor
* @extends Kinvey.Collection
- * @param {Kinvey.Query} [query] Query.
+ * @param {Object} options Options.
*/
- constructor: function(query) {
- Kinvey.Collection.prototype.constructor.call(this, 'user', query);
+ constructor: function(options) {
+ Kinvey.Collection.prototype.constructor.call(this, 'user', options);
},
/** @lends Kinvey.UserCollection# */
/**
- * Clears collection. This action is not allowed.
+ * Clears collection. This action is not allowed, not even by the master
+ * secret.
*
* @override
*/
View
2 package.json
@@ -2,7 +2,7 @@
"author": "Kinvey, Inc <support@kinvey.com> (http://www.kinvey.com)",
"name": "kinvey",
"description": "Kinvey JavaScript Library for Node.js.",
- "version": "0.9.8",
+ "version": "0.9.9",
"homepage": "http://www.kinvey.com",
"bugs": {
"email": "support@kinvey.com"

0 comments on commit b81066b

Please sign in to comment.
Something went wrong with that request. Please try again.