parse 5.1.0-alpha.1 → 5.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v5.1.0-alpha.1
2
+ * Parse JavaScript SDK v5.1.0-alpha.2
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -557,7 +557,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
557
557
  SERVER_AUTH_TOKEN: null,
558
558
  LIVEQUERY_SERVER_URL: null,
559
559
  ENCRYPTED_KEY: null,
560
- VERSION: 'js' + "5.1.0-alpha.1",
560
+ VERSION: 'js' + "5.1.0-alpha.2",
561
561
  APPLICATION_ID: null,
562
562
  JAVASCRIPT_KEY: null,
563
563
  MASTER_KEY: null,
@@ -3995,12 +3995,13 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
3995
3995
  }
3996
3996
  // More complex cases
3997
3997
  for (var condition in constraints) {
3998
+ var _compareTo, _compareTo2;
3998
3999
  compareTo = constraints[condition];
3999
- if (compareTo.__type) {
4000
+ if ((_compareTo = compareTo) !== null && _compareTo !== void 0 && _compareTo.__type) {
4000
4001
  compareTo = decode(compareTo);
4001
4002
  }
4002
4003
  // is it a $relativeTime? convert to date
4003
- if (compareTo['$relativeTime']) {
4004
+ if ((_compareTo2 = compareTo) !== null && _compareTo2 !== void 0 && _compareTo2['$relativeTime']) {
4004
4005
  var parserResult = relativeTimeToDate(compareTo['$relativeTime']);
4005
4006
  if (parserResult.status !== 'success') {
4006
4007
  var _context2;
@@ -15052,6 +15053,13 @@ exports.default = _default;
15052
15053
  "use strict";
15053
15054
 
15054
15055
  var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
15056
+ var _Object$keys = _dereq_("@babel/runtime-corejs3/core-js-stable/object/keys");
15057
+ var _Object$getOwnPropertySymbols = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
15058
+ var _filterInstanceProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/filter");
15059
+ var _Object$getOwnPropertyDescriptor = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
15060
+ var _forEachInstanceProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each");
15061
+ var _Object$getOwnPropertyDescriptors = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
15062
+ var _Object$defineProperties = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-properties");
15055
15063
  var _Object$defineProperty2 = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
15056
15064
  var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
15057
15065
  _Object$defineProperty2(exports, "__esModule", {
@@ -15060,8 +15068,9 @@ _Object$defineProperty2(exports, "__esModule", {
15060
15068
  exports.default = void 0;
15061
15069
  var _regenerator = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/regenerator"));
15062
15070
  var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
15063
- var _defineProperty = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property"));
15071
+ var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property"));
15064
15072
  var _stringify = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/json/stringify"));
15073
+ var _defineProperty3 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
15065
15074
  var _asyncToGenerator2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/asyncToGenerator"));
15066
15075
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
15067
15076
  var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
@@ -15076,6 +15085,28 @@ var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
15076
15085
  var _ParseObject2 = _interopRequireDefault(_dereq_("./ParseObject"));
15077
15086
  var _ParseSession = _interopRequireDefault(_dereq_("./ParseSession"));
15078
15087
  var _Storage = _interopRequireDefault(_dereq_("./Storage"));
15088
+ function ownKeys(object, enumerableOnly) {
15089
+ var keys = _Object$keys(object);
15090
+ if (_Object$getOwnPropertySymbols) {
15091
+ var symbols = _Object$getOwnPropertySymbols(object);
15092
+ enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
15093
+ return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
15094
+ })), keys.push.apply(keys, symbols);
15095
+ }
15096
+ return keys;
15097
+ }
15098
+ function _objectSpread(target) {
15099
+ for (var i = 1; i < arguments.length; i++) {
15100
+ var _context7, _context8;
15101
+ var source = null != arguments[i] ? arguments[i] : {};
15102
+ i % 2 ? _forEachInstanceProperty(_context7 = ownKeys(Object(source), !0)).call(_context7, function (key) {
15103
+ (0, _defineProperty3.default)(target, key, source[key]);
15104
+ }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys(Object(source))).call(_context8, function (key) {
15105
+ _Object$defineProperty2(target, key, _Object$getOwnPropertyDescriptor(source, key));
15106
+ });
15107
+ }
15108
+ return target;
15109
+ }
15079
15110
  function _createSuper(Derived) {
15080
15111
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
15081
15112
  return function () {
@@ -15812,10 +15843,11 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
15812
15843
  /**
15813
15844
  * Verify whether a given password is the password of the current user.
15814
15845
  *
15815
- * @param {string} password A password to be verified
15816
- * @param {object} options
15817
- * @returns {Promise} A promise that is fulfilled with a user
15818
- * when the password is correct.
15846
+ * @param {string} password The password to be verified.
15847
+ * @param {object} options The options.
15848
+ * @param {boolean} [options.ignoreEmailVerification=false] Set to `true` to bypass email verification and verify
15849
+ * the password regardless of whether the email has been verified. This requires the master key.
15850
+ * @returns {Promise} A promise that is fulfilled with a user when the password is correct.
15819
15851
  */
15820
15852
  }, {
15821
15853
  key: "verifyPassword",
@@ -15843,7 +15875,7 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
15843
15875
  if (protoProps) {
15844
15876
  for (var _prop in protoProps) {
15845
15877
  if (_prop !== 'className') {
15846
- (0, _defineProperty.default)(ParseUser.prototype, _prop, {
15878
+ (0, _defineProperty2.default)(ParseUser.prototype, _prop, {
15847
15879
  value: protoProps[_prop],
15848
15880
  enumerable: false,
15849
15881
  writable: true,
@@ -15855,7 +15887,7 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
15855
15887
  if (classProps) {
15856
15888
  for (var _prop2 in classProps) {
15857
15889
  if (_prop2 !== 'className') {
15858
- (0, _defineProperty.default)(ParseUser, _prop2, {
15890
+ (0, _defineProperty2.default)(ParseUser, _prop2, {
15859
15891
  value: classProps[_prop2],
15860
15892
  enumerable: false,
15861
15893
  writable: true,
@@ -16158,13 +16190,14 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
16158
16190
 
16159
16191
  /**
16160
16192
  * Verify whether a given password is the password of the current user.
16161
- *
16162
- * @param {string} username A username to be used for identificaiton
16163
- * @param {string} password A password to be verified
16164
- * @param {object} options
16165
16193
  * @static
16166
- * @returns {Promise} A promise that is fulfilled with a user
16167
- * when the password is correct.
16194
+ *
16195
+ * @param {string} username The username of the user whose password should be verified.
16196
+ * @param {string} password The password to be verified.
16197
+ * @param {object} options The options.
16198
+ * @param {boolean} [options.ignoreEmailVerification=false] Set to `true` to bypass email verification and verify
16199
+ * the password regardless of whether the email has been verified. This requires the master key.
16200
+ * @returns {Promise} A promise that is fulfilled with a user when the password is correct.
16168
16201
  */
16169
16202
  }, {
16170
16203
  key: "verifyPassword",
@@ -16575,10 +16608,13 @@ var DefaultController = {
16575
16608
  },
16576
16609
  verifyPassword: function (username /*: string*/, password /*: string*/, options /*: RequestOptions*/) {
16577
16610
  var RESTController = _CoreManager.default.getRESTController();
16578
- return RESTController.request('GET', 'verifyPassword', {
16611
+ var data = _objectSpread({
16579
16612
  username: username,
16580
16613
  password: password
16581
- }, options);
16614
+ }, options.ignoreEmailVerification !== undefined && {
16615
+ ignoreEmailVerification: options.ignoreEmailVerification
16616
+ });
16617
+ return RESTController.request('GET', 'verifyPassword', data, options);
16582
16618
  },
16583
16619
  requestEmailVerification: function (email /*: string*/, options /*: RequestOptions*/) {
16584
16620
  var RESTController = _CoreManager.default.getRESTController();
@@ -16590,7 +16626,7 @@ var DefaultController = {
16590
16626
  _CoreManager.default.setUserController(DefaultController);
16591
16627
  var _default = ParseUser;
16592
16628
  exports.default = _default;
16593
- },{"./CoreManager":4,"./ParseError":22,"./ParseObject":27,"./ParseSession":34,"./Storage":40,"./isRevocableSession":51,"@babel/runtime-corejs3/core-js-stable/json/stringify":77,"@babel/runtime-corejs3/core-js-stable/object/define-property":83,"@babel/runtime-corejs3/core-js-stable/promise":92,"@babel/runtime-corejs3/core-js-stable/reflect/construct":93,"@babel/runtime-corejs3/helpers/asyncToGenerator":104,"@babel/runtime-corejs3/helpers/classCallCheck":105,"@babel/runtime-corejs3/helpers/createClass":107,"@babel/runtime-corejs3/helpers/get":109,"@babel/runtime-corejs3/helpers/getPrototypeOf":110,"@babel/runtime-corejs3/helpers/inherits":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":112,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":119,"@babel/runtime-corejs3/helpers/typeof":127,"@babel/runtime-corejs3/regenerator":130}],36:[function(_dereq_,module,exports){
16629
+ },{"./CoreManager":4,"./ParseError":22,"./ParseObject":27,"./ParseSession":34,"./Storage":40,"./isRevocableSession":51,"@babel/runtime-corejs3/core-js-stable/instance/filter":63,"@babel/runtime-corejs3/core-js-stable/instance/for-each":66,"@babel/runtime-corejs3/core-js-stable/json/stringify":77,"@babel/runtime-corejs3/core-js-stable/object/define-properties":82,"@babel/runtime-corejs3/core-js-stable/object/define-property":83,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":86,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":87,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":88,"@babel/runtime-corejs3/core-js-stable/object/keys":90,"@babel/runtime-corejs3/core-js-stable/promise":92,"@babel/runtime-corejs3/core-js-stable/reflect/construct":93,"@babel/runtime-corejs3/helpers/asyncToGenerator":104,"@babel/runtime-corejs3/helpers/classCallCheck":105,"@babel/runtime-corejs3/helpers/createClass":107,"@babel/runtime-corejs3/helpers/defineProperty":108,"@babel/runtime-corejs3/helpers/get":109,"@babel/runtime-corejs3/helpers/getPrototypeOf":110,"@babel/runtime-corejs3/helpers/inherits":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":112,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":119,"@babel/runtime-corejs3/helpers/typeof":127,"@babel/runtime-corejs3/regenerator":130}],36:[function(_dereq_,module,exports){
16594
16630
  "use strict";
16595
16631
 
16596
16632
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -16998,9 +17034,6 @@ var RESTController = {
16998
17034
  throw new Error('Cannot use the Master Key, it has not been provided.');
16999
17035
  }
17000
17036
  }
17001
- if (options.ignoreEmailVerification !== undefined) {
17002
- payload.ignoreEmailVerification = options.ignoreEmailVerification;
17003
- }
17004
17037
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
17005
17038
  payload._RevocableSession = '1';
17006
17039
  }