Comparing version 1.6.3 to 1.6.4
@@ -19,3 +19,3 @@ /** | ||
SERVER_URL: 'https://api.parse.com', | ||
VERSION: {"version":"1.6.3"}.version, | ||
VERSION: '1.6.4', | ||
APPLICATION_ID: null, | ||
@@ -22,0 +22,0 @@ JAVASCRIPT_KEY: null, |
@@ -81,3 +81,3 @@ /** | ||
if (options.success) { | ||
options.success(self, { | ||
options.success(_this, { | ||
id: response.authResponse.userID, | ||
@@ -84,0 +84,0 @@ access_token: response.authResponse.accessToken, |
@@ -218,3 +218,3 @@ /** | ||
state.serverData[attr] = val; | ||
if (val && typeof val == 'object' && !(val instanceof _ParseObject2['default']) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) { | ||
if (val && typeof val === 'object' && !(val instanceof _ParseObject2['default']) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) { | ||
var json = (0, _encode2['default'])(val, false, true); | ||
@@ -221,0 +221,0 @@ state.objectCache[attr] = JSON.stringify(json); |
@@ -406,3 +406,3 @@ /** | ||
} else { | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, false); | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, true); | ||
} | ||
@@ -787,3 +787,5 @@ } | ||
var clone = new this.constructor(); | ||
clone.set(this.attributes); | ||
if (clone.set) { | ||
clone.set(this.attributes); | ||
} | ||
if (!clone.className) { | ||
@@ -916,4 +918,3 @@ clone.className = this.className; | ||
* Fetch the model from the server. If the server's representation of the | ||
* model differs from its current attributes, they will be overriden, | ||
* triggering a <code>"change"</code> event. | ||
* model differs from its current attributes, they will be overriden. | ||
* | ||
@@ -1053,3 +1054,2 @@ * @method fetch | ||
* Destroy this model on the server if it was already persisted. | ||
* Optimistically removes the model from its collection, if it has one. | ||
* If `wait: true` is passed, waits for the server to respond | ||
@@ -1203,3 +1203,2 @@ * before removal. | ||
* Destroy the given list of models on the server if it was already persisted. | ||
* Optimistically removes each model from its collection, if it has one. | ||
* | ||
@@ -1233,3 +1232,3 @@ * <p>Unlike saveAll, if an error occurs while deleting an individual model, | ||
* // object was not deleted. | ||
* if (error.code == Parse.Error.AGGREGATE_ERROR) { | ||
* if (error.code === Parse.Error.AGGREGATE_ERROR) { | ||
* for (var i = 0; i < error.errors.length; i++) { | ||
@@ -1236,0 +1235,0 @@ * console.log("Couldn't delete " + error.errors[i].object.id + |
@@ -222,2 +222,5 @@ /** | ||
* </ul> | ||
* | ||
* @return {Parse.Promise} A promise that is resolved with the result when | ||
* the query completes. | ||
*/ | ||
@@ -224,0 +227,0 @@ }, { |
@@ -101,3 +101,3 @@ /** | ||
this.targetClassName = change._targetClassName; | ||
return parent; | ||
return this.parent; | ||
} | ||
@@ -104,0 +104,0 @@ |
@@ -456,6 +456,2 @@ /** | ||
value: function logIn(options) { | ||
if (!canUseCurrentUser) { | ||
throw new Error('It is not possible to log in on a server environment.'); | ||
} | ||
options = options || {}; | ||
@@ -469,3 +465,3 @@ | ||
var controller = _CoreManager2['default'].getUserController(); | ||
return controller.logIn(this, loginOptions)._thenRunCallbacks(options); | ||
return controller.logIn(this, loginOptions)._thenRunCallbacks(options, this); | ||
} | ||
@@ -732,3 +728,3 @@ }], [{ | ||
/** | ||
* Enables the use of logIn, become, and a current user in a server | ||
* Enables the use of become or the current user in a server | ||
* environment. These features are disabled by default, since they depend on | ||
@@ -744,3 +740,16 @@ * global objects that are not memory-safe for most servers. | ||
} | ||
/** | ||
* Disables the use of become or the current user in any environment. | ||
* These features are disabled on servers by default, since they depend on | ||
* global objects that are not memory-safe for most servers. | ||
* @method disableUnsafeCurrentUser | ||
* @static | ||
*/ | ||
}, { | ||
key: 'disableUnsafeCurrentUser', | ||
value: function disableUnsafeCurrentUser() { | ||
canUseCurrentUser = false; | ||
} | ||
}, { | ||
key: '_registerAuthenticationProvider', | ||
@@ -901,2 +910,6 @@ value: function _registerAuthenticationProvider(provider) { | ||
user._finishFetch(response); | ||
if (!canUseCurrentUser) { | ||
// We can't set the current user, so just return the one we logged in | ||
return _ParsePromise2['default'].as(user); | ||
} | ||
return DefaultController.setCurrentUser(user); | ||
@@ -903,0 +916,0 @@ }); |
@@ -12,2 +12,19 @@ /** | ||
'use strict'; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.send = send; | ||
var _CoreManager = require('./CoreManager'); | ||
var _CoreManager2 = _interopRequireDefault(_CoreManager); | ||
var _ParseQuery = require('./ParseQuery'); | ||
var _ParseQuery2 = _interopRequireDefault(_ParseQuery); | ||
/** | ||
@@ -41,29 +58,15 @@ * Contains functions to deal with Push in Parse. | ||
*/ | ||
'use strict'; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.send = send; | ||
var _CoreManager = require('./CoreManager'); | ||
var _CoreManager2 = _interopRequireDefault(_CoreManager); | ||
function send(data, options) { | ||
options = options || {}; | ||
if (data.where) { | ||
if (data.where && data.where instanceof _ParseQuery2['default']) { | ||
data.where = data.where.toJSON().where; | ||
} | ||
if (data.push_time) { | ||
if (typeof data.push_time === 'object') { | ||
data.push_time = data.push_time.toJSON(); | ||
} | ||
if (data.push_time && typeof data.push_time === 'object') { | ||
data.push_time = data.push_time.toJSON(); | ||
} | ||
if (data.expiration_time) { | ||
if (data.expiration_time && typeof data.expiration_time === 'object') { | ||
data.expiration_time = data.expiration_time.toJSON(); | ||
@@ -70,0 +73,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
SERVER_URL: 'https://api.parse.com', | ||
VERSION: {"version":"1.6.3"}.version, | ||
VERSION: '1.6.4', | ||
APPLICATION_ID: null, | ||
@@ -22,0 +22,0 @@ JAVASCRIPT_KEY: null, |
@@ -81,3 +81,3 @@ /** | ||
if (options.success) { | ||
options.success(self, { | ||
options.success(_this, { | ||
id: response.authResponse.userID, | ||
@@ -84,0 +84,0 @@ access_token: response.authResponse.accessToken, |
@@ -218,3 +218,3 @@ /** | ||
state.serverData[attr] = val; | ||
if (val && typeof val == 'object' && !(val instanceof _ParseObject2['default']) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) { | ||
if (val && typeof val === 'object' && !(val instanceof _ParseObject2['default']) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) { | ||
var json = (0, _encode2['default'])(val, false, true); | ||
@@ -221,0 +221,0 @@ state.objectCache[attr] = JSON.stringify(json); |
@@ -406,3 +406,3 @@ /** | ||
} else { | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, false); | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, true); | ||
} | ||
@@ -787,3 +787,5 @@ } | ||
var clone = new this.constructor(); | ||
clone.set(this.attributes); | ||
if (clone.set) { | ||
clone.set(this.attributes); | ||
} | ||
if (!clone.className) { | ||
@@ -916,4 +918,3 @@ clone.className = this.className; | ||
* Fetch the model from the server. If the server's representation of the | ||
* model differs from its current attributes, they will be overriden, | ||
* triggering a <code>"change"</code> event. | ||
* model differs from its current attributes, they will be overriden. | ||
* | ||
@@ -1053,3 +1054,2 @@ * @method fetch | ||
* Destroy this model on the server if it was already persisted. | ||
* Optimistically removes the model from its collection, if it has one. | ||
* If `wait: true` is passed, waits for the server to respond | ||
@@ -1203,3 +1203,2 @@ * before removal. | ||
* Destroy the given list of models on the server if it was already persisted. | ||
* Optimistically removes each model from its collection, if it has one. | ||
* | ||
@@ -1233,3 +1232,3 @@ * <p>Unlike saveAll, if an error occurs while deleting an individual model, | ||
* // object was not deleted. | ||
* if (error.code == Parse.Error.AGGREGATE_ERROR) { | ||
* if (error.code === Parse.Error.AGGREGATE_ERROR) { | ||
* for (var i = 0; i < error.errors.length; i++) { | ||
@@ -1236,0 +1235,0 @@ * console.log("Couldn't delete " + error.errors[i].object.id + |
@@ -222,2 +222,5 @@ /** | ||
* </ul> | ||
* | ||
* @return {Parse.Promise} A promise that is resolved with the result when | ||
* the query completes. | ||
*/ | ||
@@ -224,0 +227,0 @@ }, { |
@@ -101,3 +101,3 @@ /** | ||
this.targetClassName = change._targetClassName; | ||
return parent; | ||
return this.parent; | ||
} | ||
@@ -104,0 +104,0 @@ |
@@ -456,6 +456,2 @@ /** | ||
value: function logIn(options) { | ||
if (!canUseCurrentUser) { | ||
throw new Error('It is not possible to log in on a server environment.'); | ||
} | ||
options = options || {}; | ||
@@ -469,3 +465,3 @@ | ||
var controller = _CoreManager2['default'].getUserController(); | ||
return controller.logIn(this, loginOptions)._thenRunCallbacks(options); | ||
return controller.logIn(this, loginOptions)._thenRunCallbacks(options, this); | ||
} | ||
@@ -732,3 +728,3 @@ }], [{ | ||
/** | ||
* Enables the use of logIn, become, and a current user in a server | ||
* Enables the use of become or the current user in a server | ||
* environment. These features are disabled by default, since they depend on | ||
@@ -744,3 +740,16 @@ * global objects that are not memory-safe for most servers. | ||
} | ||
/** | ||
* Disables the use of become or the current user in any environment. | ||
* These features are disabled on servers by default, since they depend on | ||
* global objects that are not memory-safe for most servers. | ||
* @method disableUnsafeCurrentUser | ||
* @static | ||
*/ | ||
}, { | ||
key: 'disableUnsafeCurrentUser', | ||
value: function disableUnsafeCurrentUser() { | ||
canUseCurrentUser = false; | ||
} | ||
}, { | ||
key: '_registerAuthenticationProvider', | ||
@@ -901,2 +910,6 @@ value: function _registerAuthenticationProvider(provider) { | ||
user._finishFetch(response); | ||
if (!canUseCurrentUser) { | ||
// We can't set the current user, so just return the one we logged in | ||
return _ParsePromise2['default'].as(user); | ||
} | ||
return DefaultController.setCurrentUser(user); | ||
@@ -903,0 +916,0 @@ }); |
@@ -12,2 +12,19 @@ /** | ||
'use strict'; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.send = send; | ||
var _CoreManager = require('./CoreManager'); | ||
var _CoreManager2 = _interopRequireDefault(_CoreManager); | ||
var _ParseQuery = require('./ParseQuery'); | ||
var _ParseQuery2 = _interopRequireDefault(_ParseQuery); | ||
/** | ||
@@ -41,29 +58,15 @@ * Contains functions to deal with Push in Parse. | ||
*/ | ||
'use strict'; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.send = send; | ||
var _CoreManager = require('./CoreManager'); | ||
var _CoreManager2 = _interopRequireDefault(_CoreManager); | ||
function send(data, options) { | ||
options = options || {}; | ||
if (data.where) { | ||
if (data.where && data.where instanceof _ParseQuery2['default']) { | ||
data.where = data.where.toJSON().where; | ||
} | ||
if (data.push_time) { | ||
if (typeof data.push_time === 'object') { | ||
data.push_time = data.push_time.toJSON(); | ||
} | ||
if (data.push_time && typeof data.push_time === 'object') { | ||
data.push_time = data.push_time.toJSON(); | ||
} | ||
if (data.expiration_time) { | ||
if (data.expiration_time && typeof data.expiration_time === 'object') { | ||
data.expiration_time = data.expiration_time.toJSON(); | ||
@@ -70,0 +73,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
SERVER_URL: 'https://api.parse.com', | ||
VERSION: {"version":"1.6.3"}.version, | ||
VERSION: '1.6.4', | ||
APPLICATION_ID: null, | ||
@@ -22,0 +22,0 @@ JAVASCRIPT_KEY: null, |
@@ -81,3 +81,3 @@ /** | ||
if (options.success) { | ||
options.success(self, { | ||
options.success(_this, { | ||
id: response.authResponse.userID, | ||
@@ -84,0 +84,0 @@ access_token: response.authResponse.accessToken, |
@@ -218,3 +218,3 @@ /** | ||
state.serverData[attr] = val; | ||
if (val && typeof val == 'object' && !(val instanceof _ParseObject2['default']) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) { | ||
if (val && typeof val === 'object' && !(val instanceof _ParseObject2['default']) && !(val instanceof _ParseFile2['default']) && !(val instanceof _ParseRelation2['default'])) { | ||
var json = (0, _encode2['default'])(val, false, true); | ||
@@ -221,0 +221,0 @@ state.objectCache[attr] = JSON.stringify(json); |
@@ -406,3 +406,3 @@ /** | ||
} else { | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, false); | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, true); | ||
} | ||
@@ -787,3 +787,5 @@ } | ||
var clone = new this.constructor(); | ||
clone.set(this.attributes); | ||
if (clone.set) { | ||
clone.set(this.attributes); | ||
} | ||
if (!clone.className) { | ||
@@ -916,4 +918,3 @@ clone.className = this.className; | ||
* Fetch the model from the server. If the server's representation of the | ||
* model differs from its current attributes, they will be overriden, | ||
* triggering a <code>"change"</code> event. | ||
* model differs from its current attributes, they will be overriden. | ||
* | ||
@@ -1053,3 +1054,2 @@ * @method fetch | ||
* Destroy this model on the server if it was already persisted. | ||
* Optimistically removes the model from its collection, if it has one. | ||
* If `wait: true` is passed, waits for the server to respond | ||
@@ -1203,3 +1203,2 @@ * before removal. | ||
* Destroy the given list of models on the server if it was already persisted. | ||
* Optimistically removes each model from its collection, if it has one. | ||
* | ||
@@ -1233,3 +1232,3 @@ * <p>Unlike saveAll, if an error occurs while deleting an individual model, | ||
* // object was not deleted. | ||
* if (error.code == Parse.Error.AGGREGATE_ERROR) { | ||
* if (error.code === Parse.Error.AGGREGATE_ERROR) { | ||
* for (var i = 0; i < error.errors.length; i++) { | ||
@@ -1236,0 +1235,0 @@ * console.log("Couldn't delete " + error.errors[i].object.id + |
@@ -222,2 +222,5 @@ /** | ||
* </ul> | ||
* | ||
* @return {Parse.Promise} A promise that is resolved with the result when | ||
* the query completes. | ||
*/ | ||
@@ -224,0 +227,0 @@ }, { |
@@ -101,3 +101,3 @@ /** | ||
this.targetClassName = change._targetClassName; | ||
return parent; | ||
return this.parent; | ||
} | ||
@@ -104,0 +104,0 @@ |
@@ -456,6 +456,2 @@ /** | ||
value: function logIn(options) { | ||
if (!canUseCurrentUser) { | ||
throw new Error('It is not possible to log in on a server environment.'); | ||
} | ||
options = options || {}; | ||
@@ -469,3 +465,3 @@ | ||
var controller = _CoreManager2['default'].getUserController(); | ||
return controller.logIn(this, loginOptions)._thenRunCallbacks(options); | ||
return controller.logIn(this, loginOptions)._thenRunCallbacks(options, this); | ||
} | ||
@@ -732,3 +728,3 @@ }], [{ | ||
/** | ||
* Enables the use of logIn, become, and a current user in a server | ||
* Enables the use of become or the current user in a server | ||
* environment. These features are disabled by default, since they depend on | ||
@@ -744,3 +740,16 @@ * global objects that are not memory-safe for most servers. | ||
} | ||
/** | ||
* Disables the use of become or the current user in any environment. | ||
* These features are disabled on servers by default, since they depend on | ||
* global objects that are not memory-safe for most servers. | ||
* @method disableUnsafeCurrentUser | ||
* @static | ||
*/ | ||
}, { | ||
key: 'disableUnsafeCurrentUser', | ||
value: function disableUnsafeCurrentUser() { | ||
canUseCurrentUser = false; | ||
} | ||
}, { | ||
key: '_registerAuthenticationProvider', | ||
@@ -901,2 +910,6 @@ value: function _registerAuthenticationProvider(provider) { | ||
user._finishFetch(response); | ||
if (!canUseCurrentUser) { | ||
// We can't set the current user, so just return the one we logged in | ||
return _ParsePromise2['default'].as(user); | ||
} | ||
return DefaultController.setCurrentUser(user); | ||
@@ -903,0 +916,0 @@ }); |
@@ -12,2 +12,19 @@ /** | ||
'use strict'; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.send = send; | ||
var _CoreManager = require('./CoreManager'); | ||
var _CoreManager2 = _interopRequireDefault(_CoreManager); | ||
var _ParseQuery = require('./ParseQuery'); | ||
var _ParseQuery2 = _interopRequireDefault(_ParseQuery); | ||
/** | ||
@@ -41,29 +58,15 @@ * Contains functions to deal with Push in Parse. | ||
*/ | ||
'use strict'; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.send = send; | ||
var _CoreManager = require('./CoreManager'); | ||
var _CoreManager2 = _interopRequireDefault(_CoreManager); | ||
function send(data, options) { | ||
options = options || {}; | ||
if (data.where) { | ||
if (data.where && data.where instanceof _ParseQuery2['default']) { | ||
data.where = data.where.toJSON().where; | ||
} | ||
if (data.push_time) { | ||
if (typeof data.push_time === 'object') { | ||
data.push_time = data.push_time.toJSON(); | ||
} | ||
if (data.push_time && typeof data.push_time === 'object') { | ||
data.push_time = data.push_time.toJSON(); | ||
} | ||
if (data.expiration_time) { | ||
if (data.expiration_time && typeof data.expiration_time === 'object') { | ||
data.expiration_time = data.expiration_time.toJSON(); | ||
@@ -70,0 +73,0 @@ } |
{ | ||
"name": "parse", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "The Parse JavaScript SDK", | ||
@@ -11,2 +11,3 @@ "homepage": "https://www.parse.com", | ||
], | ||
"license": "BSD-3-Clause", | ||
"repository": { | ||
@@ -21,4 +22,6 @@ "type": "git", | ||
"react-native.js", | ||
"dist/", | ||
"lib/", | ||
"LICENSE", | ||
"PATENTS", | ||
"README.md" | ||
@@ -36,2 +39,3 @@ ], | ||
"babel-plugin-flow-comments": "^1.0.9", | ||
"babel-plugin-inline-package-json": "~1.0.1", | ||
"browserify": "^11.0.1", | ||
@@ -51,2 +55,4 @@ "coveralls": "^2.11.3", | ||
"scripts": { | ||
"build": "./build_releases.sh", | ||
"release": "./build_releases.sh && npm publish", | ||
"test": "PARSE_BUILD=node jest" | ||
@@ -53,0 +59,0 @@ }, |
# Parse SDK for JavaScript | ||
[![Build Status][build-status-svg]][build-status-link] | ||
[![Test Coverage][coverage-status-svg]][coverage-status-link] | ||
[![Npm Version][npm-svg]][npm-link] | ||
[![License][license-svg]][license-link] | ||
@@ -42,1 +46,10 @@ A library that gives you access to the powerful Parse cloud platform from your JavaScript app. For more information on Parse and its features, see [the website](https://parse.com) or [the JavaScript guide](https://parse.com/docs/js/guide). | ||
``` | ||
[build-status-svg]: https://travis-ci.org/ParsePlatform/Parse-SDK-JS.svg?branch=master | ||
[build-status-link]: https://travis-ci.org/ParsePlatform/Parse-SDK-JS | ||
[coverage-status-svg]: https://coveralls.io/repos/ParsePlatform/Parse-SDK-JS/badge.svg?branch=master&service=github | ||
[coverage-status-link]: https://coveralls.io/github/ParsePlatform/Parse-SDK-JS?branch=master | ||
[npm-svg]: https://badge.fury.io/js/parse.svg | ||
[npm-link]: https://npmjs.org/parse | ||
[license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg | ||
[license-link]: https://github.com/ParsePlatform/Parse-SDK-JS/blob/master/LICENSE |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1290404
123
33820
55
15
1
4
2