parse 3.5.0-alpha.3 → 3.5.0-alpha.4

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.
Files changed (47) hide show
  1. package/dist/parse.js +5703 -2369
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +5701 -2367
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/CoreManager.js +1 -1
  6. package/lib/browser/EventuallyQueue.js +395 -29
  7. package/lib/browser/LiveQueryClient.js +2 -6
  8. package/lib/browser/LocalDatastore.js +392 -18
  9. package/lib/browser/LocalDatastoreController.js +391 -21
  10. package/lib/browser/LocalDatastoreController.react-native.js +387 -23
  11. package/lib/browser/ParseFile.js +388 -22
  12. package/lib/browser/ParseLiveQuery.js +381 -18
  13. package/lib/browser/ParseObject.js +405 -41
  14. package/lib/browser/ParseOp.js +1 -3
  15. package/lib/browser/ParseQuery.js +396 -47
  16. package/lib/browser/ParseUser.js +388 -14
  17. package/lib/browser/StorageController.react-native.js +6 -18
  18. package/lib/node/CoreManager.js +1 -1
  19. package/lib/node/ParseObject.js +6 -6
  20. package/lib/node/ParseQuery.js +1 -3
  21. package/lib/react-native/CoreManager.js +1 -1
  22. package/lib/react-native/EventuallyQueue.js +376 -27
  23. package/lib/react-native/LiveQueryClient.js +2 -6
  24. package/lib/react-native/LocalDatastore.js +374 -26
  25. package/lib/react-native/LocalDatastoreController.js +365 -16
  26. package/lib/react-native/LocalDatastoreController.react-native.js +363 -14
  27. package/lib/react-native/ParseFile.js +359 -16
  28. package/lib/react-native/ParseLiveQuery.js +357 -8
  29. package/lib/react-native/ParseObject.js +385 -38
  30. package/lib/react-native/ParseOp.js +1 -3
  31. package/lib/react-native/ParseQuery.js +374 -39
  32. package/lib/react-native/ParseUser.js +368 -19
  33. package/lib/react-native/StorageController.react-native.js +6 -18
  34. package/lib/weapp/CoreManager.js +1 -1
  35. package/lib/weapp/EventuallyQueue.js +395 -29
  36. package/lib/weapp/LiveQueryClient.js +2 -6
  37. package/lib/weapp/LocalDatastore.js +392 -18
  38. package/lib/weapp/LocalDatastoreController.js +391 -21
  39. package/lib/weapp/LocalDatastoreController.react-native.js +387 -23
  40. package/lib/weapp/ParseFile.js +388 -22
  41. package/lib/weapp/ParseLiveQuery.js +381 -18
  42. package/lib/weapp/ParseObject.js +405 -41
  43. package/lib/weapp/ParseOp.js +1 -3
  44. package/lib/weapp/ParseQuery.js +396 -47
  45. package/lib/weapp/ParseUser.js +388 -14
  46. package/lib/weapp/StorageController.react-native.js +6 -18
  47. package/package.json +1 -1
@@ -2,20 +2,30 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
- var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
6
-
7
5
  var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
8
6
 
9
7
  var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
10
8
 
11
9
  var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
12
10
 
13
- var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
14
-
15
11
  var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
16
12
 
17
13
  var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
18
14
 
15
+ var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
16
+
17
+ var _Promise2 = require("@babel/runtime-corejs3/core-js-stable/promise");
18
+
19
+ var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
20
+
21
+ var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
22
+
23
+ var _Object$getPrototypeOf2 = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
24
+
25
+ var _Object$create2 = require("@babel/runtime-corejs3/core-js-stable/object/create");
26
+
27
+ var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
28
+
19
29
  var _Object$defineProperty2 = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
20
30
 
21
31
  var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
@@ -50,8 +60,6 @@ var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
50
60
 
51
61
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
52
62
 
53
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
54
-
55
63
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
56
64
 
57
65
  var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
@@ -223,12 +231,12 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
223
231
  }
224
232
 
225
233
  function _unsupportedIterableToArray(o, minLen) {
226
- var _context18;
234
+ var _context20;
227
235
 
228
236
  if (!o) return;
229
237
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
230
238
 
231
- var n = _sliceInstanceProperty(_context18 = Object.prototype.toString.call(o)).call(_context18, 8, -1);
239
+ var n = _sliceInstanceProperty(_context20 = Object.prototype.toString.call(o)).call(_context20, 8, -1);
232
240
 
233
241
  if (n === "Object" && o.constructor) n = o.constructor.name;
234
242
  if (n === "Map" || n === "Set") return _Array$from(o);
@@ -245,6 +253,364 @@ function _arrayLikeToArray(arr, len) {
245
253
  return arr2;
246
254
  }
247
255
 
256
+ function _regeneratorRuntime() {
257
+ "use strict";
258
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
259
+
260
+ _regeneratorRuntime = function () {
261
+ return exports;
262
+ };
263
+
264
+ var exports = {},
265
+ Op = Object.prototype,
266
+ hasOwn = Op.hasOwnProperty,
267
+ $Symbol = "function" == typeof _Symbol ? _Symbol : {},
268
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
269
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
270
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
271
+
272
+ function define(obj, key, value) {
273
+ return _Object$defineProperty2(obj, key, {
274
+ value: value,
275
+ enumerable: !0,
276
+ configurable: !0,
277
+ writable: !0
278
+ }), obj[key];
279
+ }
280
+
281
+ try {
282
+ define({}, "");
283
+ } catch (err) {
284
+ define = function (obj, key, value) {
285
+ return obj[key] = value;
286
+ };
287
+ }
288
+
289
+ function wrap(innerFn, outerFn, self, tryLocsList) {
290
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
291
+ generator = _Object$create2(protoGenerator.prototype),
292
+ context = new Context(tryLocsList || []);
293
+
294
+ return generator._invoke = function (innerFn, self, context) {
295
+ var state = "suspendedStart";
296
+ return function (method, arg) {
297
+ if ("executing" === state) throw new Error("Generator is already running");
298
+
299
+ if ("completed" === state) {
300
+ if ("throw" === method) throw arg;
301
+ return doneResult();
302
+ }
303
+
304
+ for (context.method = method, context.arg = arg;;) {
305
+ var delegate = context.delegate;
306
+
307
+ if (delegate) {
308
+ var delegateResult = maybeInvokeDelegate(delegate, context);
309
+
310
+ if (delegateResult) {
311
+ if (delegateResult === ContinueSentinel) continue;
312
+ return delegateResult;
313
+ }
314
+ }
315
+
316
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
317
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
318
+ context.dispatchException(context.arg);
319
+ } else "return" === context.method && context.abrupt("return", context.arg);
320
+ state = "executing";
321
+ var record = tryCatch(innerFn, self, context);
322
+
323
+ if ("normal" === record.type) {
324
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
325
+ return {
326
+ value: record.arg,
327
+ done: context.done
328
+ };
329
+ }
330
+
331
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
332
+ }
333
+ };
334
+ }(innerFn, self, context), generator;
335
+ }
336
+
337
+ function tryCatch(fn, obj, arg) {
338
+ try {
339
+ return {
340
+ type: "normal",
341
+ arg: fn.call(obj, arg)
342
+ };
343
+ } catch (err) {
344
+ return {
345
+ type: "throw",
346
+ arg: err
347
+ };
348
+ }
349
+ }
350
+
351
+ exports.wrap = wrap;
352
+ var ContinueSentinel = {};
353
+
354
+ function Generator() {}
355
+
356
+ function GeneratorFunction() {}
357
+
358
+ function GeneratorFunctionPrototype() {}
359
+
360
+ var IteratorPrototype = {};
361
+ define(IteratorPrototype, iteratorSymbol, function () {
362
+ return this;
363
+ });
364
+ var getProto = _Object$getPrototypeOf2,
365
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
366
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
367
+
368
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create2(IteratorPrototype);
369
+
370
+ function defineIteratorMethods(prototype) {
371
+ var _context18;
372
+
373
+ _forEachInstanceProperty2(_context18 = ["next", "throw", "return"]).call(_context18, function (method) {
374
+ define(prototype, method, function (arg) {
375
+ return this._invoke(method, arg);
376
+ });
377
+ });
378
+ }
379
+
380
+ function AsyncIterator(generator, PromiseImpl) {
381
+ function invoke(method, arg, resolve, reject) {
382
+ var record = tryCatch(generator[method], generator, arg);
383
+
384
+ if ("throw" !== record.type) {
385
+ var result = record.arg,
386
+ value = result.value;
387
+ return value && "object" == _typeof3(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
388
+ invoke("next", value, resolve, reject);
389
+ }, function (err) {
390
+ invoke("throw", err, resolve, reject);
391
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
392
+ result.value = unwrapped, resolve(result);
393
+ }, function (error) {
394
+ return invoke("throw", error, resolve, reject);
395
+ });
396
+ }
397
+
398
+ reject(record.arg);
399
+ }
400
+
401
+ var previousPromise;
402
+
403
+ this._invoke = function (method, arg) {
404
+ function callInvokeWithMethodAndArg() {
405
+ return new PromiseImpl(function (resolve, reject) {
406
+ invoke(method, arg, resolve, reject);
407
+ });
408
+ }
409
+
410
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
411
+ };
412
+ }
413
+
414
+ function maybeInvokeDelegate(delegate, context) {
415
+ var method = delegate.iterator[context.method];
416
+
417
+ if (undefined === method) {
418
+ if (context.delegate = null, "throw" === context.method) {
419
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
420
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
421
+ }
422
+
423
+ return ContinueSentinel;
424
+ }
425
+
426
+ var record = tryCatch(method, delegate.iterator, context.arg);
427
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
428
+ var info = record.arg;
429
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
430
+ }
431
+
432
+ function pushTryEntry(locs) {
433
+ var entry = {
434
+ tryLoc: locs[0]
435
+ };
436
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
437
+ }
438
+
439
+ function resetTryEntry(entry) {
440
+ var record = entry.completion || {};
441
+ record.type = "normal", delete record.arg, entry.completion = record;
442
+ }
443
+
444
+ function Context(tryLocsList) {
445
+ this.tryEntries = [{
446
+ tryLoc: "root"
447
+ }], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
448
+ }
449
+
450
+ function values(iterable) {
451
+ if (iterable) {
452
+ var iteratorMethod = iterable[iteratorSymbol];
453
+ if (iteratorMethod) return iteratorMethod.call(iterable);
454
+ if ("function" == typeof iterable.next) return iterable;
455
+
456
+ if (!isNaN(iterable.length)) {
457
+ var i = -1,
458
+ next = function next() {
459
+ for (; ++i < iterable.length;) {
460
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
461
+ }
462
+
463
+ return next.value = undefined, next.done = !0, next;
464
+ };
465
+
466
+ return next.next = next;
467
+ }
468
+ }
469
+
470
+ return {
471
+ next: doneResult
472
+ };
473
+ }
474
+
475
+ function doneResult() {
476
+ return {
477
+ value: undefined,
478
+ done: !0
479
+ };
480
+ }
481
+
482
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
483
+ var ctor = "function" == typeof genFun && genFun.constructor;
484
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
485
+ }, exports.mark = function (genFun) {
486
+ return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create2(Gp), genFun;
487
+ }, exports.awrap = function (arg) {
488
+ return {
489
+ __await: arg
490
+ };
491
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
492
+ return this;
493
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
494
+ void 0 === PromiseImpl && (PromiseImpl = _Promise2);
495
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
496
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
497
+ return result.done ? result.value : iter.next();
498
+ });
499
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
500
+ return this;
501
+ }), define(Gp, "toString", function () {
502
+ return "[object Generator]";
503
+ }), exports.keys = function (object) {
504
+ var keys = [];
505
+
506
+ for (var key in object) {
507
+ keys.push(key);
508
+ }
509
+
510
+ return _reverseInstanceProperty(keys).call(keys), function next() {
511
+ for (; keys.length;) {
512
+ var key = keys.pop();
513
+ if (key in object) return next.value = key, next.done = !1, next;
514
+ }
515
+
516
+ return next.done = !0, next;
517
+ };
518
+ }, exports.values = values, Context.prototype = {
519
+ constructor: Context,
520
+ reset: function (skipTempReset) {
521
+ var _context19;
522
+
523
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context19 = this.tryEntries).call(_context19, resetTryEntry), !skipTempReset) for (var name in this) {
524
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
525
+ }
526
+ },
527
+ stop: function () {
528
+ this.done = !0;
529
+ var rootRecord = this.tryEntries[0].completion;
530
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
531
+ return this.rval;
532
+ },
533
+ dispatchException: function (exception) {
534
+ if (this.done) throw exception;
535
+ var context = this;
536
+
537
+ function handle(loc, caught) {
538
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
539
+ }
540
+
541
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
542
+ var entry = this.tryEntries[i],
543
+ record = entry.completion;
544
+ if ("root" === entry.tryLoc) return handle("end");
545
+
546
+ if (entry.tryLoc <= this.prev) {
547
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
548
+ hasFinally = hasOwn.call(entry, "finallyLoc");
549
+
550
+ if (hasCatch && hasFinally) {
551
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
552
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
553
+ } else if (hasCatch) {
554
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
555
+ } else {
556
+ if (!hasFinally) throw new Error("try statement without catch or finally");
557
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
558
+ }
559
+ }
560
+ }
561
+ },
562
+ abrupt: function (type, arg) {
563
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
564
+ var entry = this.tryEntries[i];
565
+
566
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
567
+ var finallyEntry = entry;
568
+ break;
569
+ }
570
+ }
571
+
572
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
573
+ var record = finallyEntry ? finallyEntry.completion : {};
574
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
575
+ },
576
+ complete: function (record, afterLoc) {
577
+ if ("throw" === record.type) throw record.arg;
578
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
579
+ },
580
+ finish: function (finallyLoc) {
581
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
582
+ var entry = this.tryEntries[i];
583
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
584
+ }
585
+ },
586
+ catch: function (tryLoc) {
587
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
588
+ var entry = this.tryEntries[i];
589
+
590
+ if (entry.tryLoc === tryLoc) {
591
+ var record = entry.completion;
592
+
593
+ if ("throw" === record.type) {
594
+ var thrown = record.arg;
595
+ resetTryEntry(entry);
596
+ }
597
+
598
+ return thrown;
599
+ }
600
+ }
601
+
602
+ throw new Error("illegal catch attempt");
603
+ },
604
+ delegateYield: function (iterable, resultName, nextLoc) {
605
+ return this.delegate = {
606
+ iterator: values(iterable),
607
+ resultName: resultName,
608
+ nextLoc: nextLoc
609
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
610
+ }
611
+ }, exports;
612
+ }
613
+
248
614
  function ownKeys(object, enumerableOnly) {
249
615
  var keys = _Object$keys2(object);
250
616
 
@@ -1570,11 +1936,11 @@ var ParseObject = /*#__PURE__*/function () {
1570
1936
  }, {
1571
1937
  key: "exists",
1572
1938
  value: function () {
1573
- var _exists = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options
1939
+ var _exists = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options
1574
1940
  /*:: ?: RequestOptions*/
1575
1941
  ) {
1576
1942
  var query;
1577
- return _regenerator.default.wrap(function (_context) {
1943
+ return _regeneratorRuntime().wrap(function (_context) {
1578
1944
  while (1) {
1579
1945
  switch (_context.prev = _context.next) {
1580
1946
  case 0:
@@ -1898,10 +2264,10 @@ var ParseObject = /*#__PURE__*/function () {
1898
2264
  }, {
1899
2265
  key: "saveEventually",
1900
2266
  value: function () {
1901
- var _saveEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options
2267
+ var _saveEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options
1902
2268
  /*: SaveOptions*/
1903
2269
  ) {
1904
- return _regenerator.default.wrap(function (_context4) {
2270
+ return _regeneratorRuntime().wrap(function (_context4) {
1905
2271
  while (1) {
1906
2272
  switch (_context4.prev = _context4.next) {
1907
2273
  case 0:
@@ -2018,8 +2384,6 @@ var ParseObject = /*#__PURE__*/function () {
2018
2384
  )
2019
2385
  /*: Promise*/
2020
2386
  {
2021
- var _this = this;
2022
-
2023
2387
  var attrs;
2024
2388
  var options;
2025
2389
 
@@ -2068,7 +2432,7 @@ var ParseObject = /*#__PURE__*/function () {
2068
2432
 
2069
2433
  var unsaved = options.cascadeSave !== false ? (0, _unsavedChildren.default)(this) : null;
2070
2434
  return controller.save(unsaved, saveOptions).then(function () {
2071
- return controller.save(_this, saveOptions);
2435
+ return controller.save(this, saveOptions);
2072
2436
  });
2073
2437
  }
2074
2438
  /**
@@ -2097,10 +2461,10 @@ var ParseObject = /*#__PURE__*/function () {
2097
2461
  }, {
2098
2462
  key: "destroyEventually",
2099
2463
  value: function () {
2100
- var _destroyEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(options
2464
+ var _destroyEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(options
2101
2465
  /*: RequestOptions*/
2102
2466
  ) {
2103
- return _regenerator.default.wrap(function (_context5) {
2467
+ return _regeneratorRuntime().wrap(function (_context5) {
2104
2468
  while (1) {
2105
2469
  switch (_context5.prev = _context5.next) {
2106
2470
  case 0:
@@ -2240,9 +2604,9 @@ var ParseObject = /*#__PURE__*/function () {
2240
2604
  }, {
2241
2605
  key: "isPinned",
2242
2606
  value: function () {
2243
- var _isPinned = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
2607
+ var _isPinned = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
2244
2608
  var localDatastore, objectKey, pin;
2245
- return _regenerator.default.wrap(function (_context6) {
2609
+ return _regeneratorRuntime().wrap(function (_context6) {
2246
2610
  while (1) {
2247
2611
  switch (_context6.prev = _context6.next) {
2248
2612
  case 0:
@@ -2338,9 +2702,9 @@ var ParseObject = /*#__PURE__*/function () {
2338
2702
  }, {
2339
2703
  key: "fetchFromLocalDatastore",
2340
2704
  value: function () {
2341
- var _fetchFromLocalDatastore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
2705
+ var _fetchFromLocalDatastore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2342
2706
  var localDatastore, objectKey, pinned, result;
2343
- return _regenerator.default.wrap(function (_context7) {
2707
+ return _regeneratorRuntime().wrap(function (_context7) {
2344
2708
  while (1) {
2345
2709
  switch (_context7.prev = _context7.next) {
2346
2710
  case 0:
@@ -3271,10 +3635,10 @@ var DefaultController = {
3271
3635
 
3272
3636
  query._limit = ids.length;
3273
3637
  return (0, _find.default)(query).call(query, options).then( /*#__PURE__*/function () {
3274
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(objects) {
3638
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(objects) {
3275
3639
  var idMap, i, obj, _i, _obj, id, _iterator2, _step2, object;
3276
3640
 
3277
- return _regenerator.default.wrap(function (_context9) {
3641
+ return _regeneratorRuntime().wrap(function (_context9) {
3278
3642
  while (1) {
3279
3643
  switch (_context9.prev = _context9.next) {
3280
3644
  case 0:
@@ -3390,8 +3754,8 @@ var DefaultController = {
3390
3754
  }
3391
3755
 
3392
3756
  return RESTController.request('GET', 'classes/' + target.className + '/' + target._getId(), params, options).then( /*#__PURE__*/function () {
3393
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(response) {
3394
- return _regenerator.default.wrap(function (_context10) {
3757
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(response) {
3758
+ return _regeneratorRuntime().wrap(function (_context10) {
3395
3759
  while (1) {
3396
3760
  switch (_context10.prev = _context10.next) {
3397
3761
  case 0:
@@ -3430,9 +3794,9 @@ var DefaultController = {
3430
3794
  )
3431
3795
  /*: Promise<Array<void> | ParseObject>*/
3432
3796
  {
3433
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
3797
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
3434
3798
  var batchSize, localDatastore, RESTController, batches, deleteCompleted, errors;
3435
- return _regenerator.default.wrap(function (_context13) {
3799
+ return _regeneratorRuntime().wrap(function (_context13) {
3436
3800
  while (1) {
3437
3801
  switch (_context13.prev = _context13.next) {
3438
3802
  case 0:
@@ -3494,10 +3858,10 @@ var DefaultController = {
3494
3858
  });
3495
3859
  });
3496
3860
  });
3497
- return _context13.abrupt("return", deleteCompleted.then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
3861
+ return _context13.abrupt("return", deleteCompleted.then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
3498
3862
  var aggregate, _iterator3, _step3, object;
3499
3863
 
3500
- return _regenerator.default.wrap(function (_context11) {
3864
+ return _regeneratorRuntime().wrap(function (_context11) {
3501
3865
  while (1) {
3502
3866
  switch (_context11.prev = _context11.next) {
3503
3867
  case 0:
@@ -3564,8 +3928,8 @@ var DefaultController = {
3564
3928
  break;
3565
3929
  }
3566
3930
 
3567
- return _context13.abrupt("return", RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
3568
- return _regenerator.default.wrap(function (_context12) {
3931
+ return _context13.abrupt("return", RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
3932
+ return _regeneratorRuntime().wrap(function (_context12) {
3569
3933
  while (1) {
3570
3934
  switch (_context12.prev = _context12.next) {
3571
3935
  case 0:
@@ -3638,10 +4002,6 @@ var DefaultController = {
3638
4002
  if (el instanceof _ParseFile.default) {
3639
4003
  filesSaved.push(el.save(options));
3640
4004
  } else if (el instanceof ParseObject) {
3641
- if (allowCustomObjectId && !el.id) {
3642
- throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty, null or undefined');
3643
- }
3644
-
3645
4005
  pending.push(el);
3646
4006
  }
3647
4007
  });
@@ -3653,6 +4013,10 @@ var DefaultController = {
3653
4013
  var batch = [];
3654
4014
  var nextPending = [];
3655
4015
  (0, _forEach.default)(pending).call(pending, function (el) {
4016
+ if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {
4017
+ throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
4018
+ }
4019
+
3656
4020
  if (batch.length < batchSize && (0, _canBeSerialized.default)(el)) {
3657
4021
  batch.push(el);
3658
4022
  } else {
@@ -3711,10 +4075,10 @@ var DefaultController = {
3711
4075
  batchReturned.reject(new _ParseError.default(_ParseError.default.INCORRECT_TYPE, error.message));
3712
4076
  });
3713
4077
  return (0, _promiseUtils.when)(batchTasks);
3714
- }).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
4078
+ }).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
3715
4079
  var _iterator4, _step4, object;
3716
4080
 
3717
- return _regenerator.default.wrap(function (_context14) {
4081
+ return _regeneratorRuntime().wrap(function (_context14) {
3718
4082
  while (1) {
3719
4083
  switch (_context14.prev = _context14.next) {
3720
4084
  case 0:
@@ -3778,8 +4142,8 @@ var DefaultController = {
3778
4142
  })));
3779
4143
  });
3780
4144
  } else if (target instanceof ParseObject) {
3781
- if (allowCustomObjectId && !target.id) {
3782
- throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty, null or undefined');
4145
+ if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {
4146
+ throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
3783
4147
  } // generate _localId in case if cascadeSave=false
3784
4148
 
3785
4149
 
@@ -3805,8 +4169,8 @@ var DefaultController = {
3805
4169
  };
3806
4170
 
3807
4171
  stateController.pushPendingState(target._getStateIdentifier());
3808
- return stateController.enqueueTask(target._getStateIdentifier(), task).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
3809
- return _regenerator.default.wrap(function (_context15) {
4172
+ return stateController.enqueueTask(target._getStateIdentifier(), task).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
4173
+ return _regeneratorRuntime().wrap(function (_context15) {
3810
4174
  while (1) {
3811
4175
  switch (_context15.prev = _context15.next) {
3812
4176
  case 0:
@@ -781,12 +781,10 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
781
781
  value: function ()
782
782
  /*: { __op?: string, objects?: mixed, ops?: mixed }*/
783
783
  {
784
- var _this7 = this;
785
-
786
784
  var idToPointer = function (id) {
787
785
  return {
788
786
  __type: 'Pointer',
789
- className: _this7._targetClassName,
787
+ className: this._targetClassName,
790
788
  objectId: id
791
789
  };
792
790
  };