parse 3.5.0-alpha.3 → 3.5.0-alpha.5

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 (51) hide show
  1. package/dist/parse.js +5732 -2377
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +5730 -2375
  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/OfflineQuery.js +29 -8
  12. package/lib/browser/ParseFile.js +388 -22
  13. package/lib/browser/ParseLiveQuery.js +381 -18
  14. package/lib/browser/ParseObject.js +405 -41
  15. package/lib/browser/ParseOp.js +1 -3
  16. package/lib/browser/ParseQuery.js +396 -47
  17. package/lib/browser/ParseUser.js +388 -14
  18. package/lib/browser/StorageController.react-native.js +6 -18
  19. package/lib/node/CoreManager.js +1 -1
  20. package/lib/node/OfflineQuery.js +18 -3
  21. package/lib/node/ParseObject.js +6 -6
  22. package/lib/node/ParseQuery.js +1 -3
  23. package/lib/react-native/CoreManager.js +1 -1
  24. package/lib/react-native/EventuallyQueue.js +376 -27
  25. package/lib/react-native/LiveQueryClient.js +2 -6
  26. package/lib/react-native/LocalDatastore.js +374 -26
  27. package/lib/react-native/LocalDatastoreController.js +365 -16
  28. package/lib/react-native/LocalDatastoreController.react-native.js +363 -14
  29. package/lib/react-native/OfflineQuery.js +28 -7
  30. package/lib/react-native/ParseFile.js +359 -16
  31. package/lib/react-native/ParseLiveQuery.js +357 -8
  32. package/lib/react-native/ParseObject.js +385 -38
  33. package/lib/react-native/ParseOp.js +1 -3
  34. package/lib/react-native/ParseQuery.js +374 -39
  35. package/lib/react-native/ParseUser.js +368 -19
  36. package/lib/react-native/StorageController.react-native.js +6 -18
  37. package/lib/weapp/CoreManager.js +1 -1
  38. package/lib/weapp/EventuallyQueue.js +395 -29
  39. package/lib/weapp/LiveQueryClient.js +2 -6
  40. package/lib/weapp/LocalDatastore.js +392 -18
  41. package/lib/weapp/LocalDatastoreController.js +391 -21
  42. package/lib/weapp/LocalDatastoreController.react-native.js +387 -23
  43. package/lib/weapp/OfflineQuery.js +29 -8
  44. package/lib/weapp/ParseFile.js +388 -22
  45. package/lib/weapp/ParseLiveQuery.js +381 -18
  46. package/lib/weapp/ParseObject.js +405 -41
  47. package/lib/weapp/ParseOp.js +1 -3
  48. package/lib/weapp/ParseQuery.js +396 -47
  49. package/lib/weapp/ParseUser.js +388 -14
  50. package/lib/weapp/StorageController.react-native.js +6 -18
  51. package/package.json +1 -1
@@ -2,8 +2,26 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
+ var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
6
+
7
+ var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
8
+
9
+ var _Promise2 = require("@babel/runtime-corejs3/core-js-stable/promise");
10
+
11
+ var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
12
+
13
+ var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
14
+
15
+ var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
16
+
17
+ var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
18
+
19
+ var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
20
+
5
21
  var _Object$defineProperty2 = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
22
 
23
+ var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
24
+
7
25
  var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
8
26
 
9
27
  _Object$defineProperty2(exports, "__esModule", {
@@ -16,8 +34,6 @@ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-
16
34
 
17
35
  var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
18
36
 
19
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
20
-
21
37
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
22
38
 
23
39
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
@@ -48,6 +64,364 @@ var _ParseSession = _interopRequireDefault(require("./ParseSession"));
48
64
 
49
65
  var _Storage = _interopRequireDefault(require("./Storage"));
50
66
 
67
+ function _regeneratorRuntime() {
68
+ "use strict";
69
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
70
+
71
+ _regeneratorRuntime = function () {
72
+ return exports;
73
+ };
74
+
75
+ var exports = {},
76
+ Op = Object.prototype,
77
+ hasOwn = Op.hasOwnProperty,
78
+ $Symbol = "function" == typeof _Symbol ? _Symbol : {},
79
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
80
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
81
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
82
+
83
+ function define(obj, key, value) {
84
+ return _Object$defineProperty2(obj, key, {
85
+ value: value,
86
+ enumerable: !0,
87
+ configurable: !0,
88
+ writable: !0
89
+ }), obj[key];
90
+ }
91
+
92
+ try {
93
+ define({}, "");
94
+ } catch (err) {
95
+ define = function (obj, key, value) {
96
+ return obj[key] = value;
97
+ };
98
+ }
99
+
100
+ function wrap(innerFn, outerFn, self, tryLocsList) {
101
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
102
+ generator = _Object$create(protoGenerator.prototype),
103
+ context = new Context(tryLocsList || []);
104
+
105
+ return generator._invoke = function (innerFn, self, context) {
106
+ var state = "suspendedStart";
107
+ return function (method, arg) {
108
+ if ("executing" === state) throw new Error("Generator is already running");
109
+
110
+ if ("completed" === state) {
111
+ if ("throw" === method) throw arg;
112
+ return doneResult();
113
+ }
114
+
115
+ for (context.method = method, context.arg = arg;;) {
116
+ var delegate = context.delegate;
117
+
118
+ if (delegate) {
119
+ var delegateResult = maybeInvokeDelegate(delegate, context);
120
+
121
+ if (delegateResult) {
122
+ if (delegateResult === ContinueSentinel) continue;
123
+ return delegateResult;
124
+ }
125
+ }
126
+
127
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
128
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
129
+ context.dispatchException(context.arg);
130
+ } else "return" === context.method && context.abrupt("return", context.arg);
131
+ state = "executing";
132
+ var record = tryCatch(innerFn, self, context);
133
+
134
+ if ("normal" === record.type) {
135
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
136
+ return {
137
+ value: record.arg,
138
+ done: context.done
139
+ };
140
+ }
141
+
142
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
143
+ }
144
+ };
145
+ }(innerFn, self, context), generator;
146
+ }
147
+
148
+ function tryCatch(fn, obj, arg) {
149
+ try {
150
+ return {
151
+ type: "normal",
152
+ arg: fn.call(obj, arg)
153
+ };
154
+ } catch (err) {
155
+ return {
156
+ type: "throw",
157
+ arg: err
158
+ };
159
+ }
160
+ }
161
+
162
+ exports.wrap = wrap;
163
+ var ContinueSentinel = {};
164
+
165
+ function Generator() {}
166
+
167
+ function GeneratorFunction() {}
168
+
169
+ function GeneratorFunctionPrototype() {}
170
+
171
+ var IteratorPrototype = {};
172
+ define(IteratorPrototype, iteratorSymbol, function () {
173
+ return this;
174
+ });
175
+ var getProto = _Object$getPrototypeOf,
176
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
177
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
178
+
179
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
180
+
181
+ function defineIteratorMethods(prototype) {
182
+ var _context7;
183
+
184
+ _forEachInstanceProperty(_context7 = ["next", "throw", "return"]).call(_context7, function (method) {
185
+ define(prototype, method, function (arg) {
186
+ return this._invoke(method, arg);
187
+ });
188
+ });
189
+ }
190
+
191
+ function AsyncIterator(generator, PromiseImpl) {
192
+ function invoke(method, arg, resolve, reject) {
193
+ var record = tryCatch(generator[method], generator, arg);
194
+
195
+ if ("throw" !== record.type) {
196
+ var result = record.arg,
197
+ value = result.value;
198
+ return value && "object" == _typeof3(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
199
+ invoke("next", value, resolve, reject);
200
+ }, function (err) {
201
+ invoke("throw", err, resolve, reject);
202
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
203
+ result.value = unwrapped, resolve(result);
204
+ }, function (error) {
205
+ return invoke("throw", error, resolve, reject);
206
+ });
207
+ }
208
+
209
+ reject(record.arg);
210
+ }
211
+
212
+ var previousPromise;
213
+
214
+ this._invoke = function (method, arg) {
215
+ function callInvokeWithMethodAndArg() {
216
+ return new PromiseImpl(function (resolve, reject) {
217
+ invoke(method, arg, resolve, reject);
218
+ });
219
+ }
220
+
221
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
222
+ };
223
+ }
224
+
225
+ function maybeInvokeDelegate(delegate, context) {
226
+ var method = delegate.iterator[context.method];
227
+
228
+ if (undefined === method) {
229
+ if (context.delegate = null, "throw" === context.method) {
230
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
231
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
232
+ }
233
+
234
+ return ContinueSentinel;
235
+ }
236
+
237
+ var record = tryCatch(method, delegate.iterator, context.arg);
238
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
239
+ var info = record.arg;
240
+ 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);
241
+ }
242
+
243
+ function pushTryEntry(locs) {
244
+ var entry = {
245
+ tryLoc: locs[0]
246
+ };
247
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
248
+ }
249
+
250
+ function resetTryEntry(entry) {
251
+ var record = entry.completion || {};
252
+ record.type = "normal", delete record.arg, entry.completion = record;
253
+ }
254
+
255
+ function Context(tryLocsList) {
256
+ this.tryEntries = [{
257
+ tryLoc: "root"
258
+ }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
259
+ }
260
+
261
+ function values(iterable) {
262
+ if (iterable) {
263
+ var iteratorMethod = iterable[iteratorSymbol];
264
+ if (iteratorMethod) return iteratorMethod.call(iterable);
265
+ if ("function" == typeof iterable.next) return iterable;
266
+
267
+ if (!isNaN(iterable.length)) {
268
+ var i = -1,
269
+ next = function next() {
270
+ for (; ++i < iterable.length;) {
271
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
272
+ }
273
+
274
+ return next.value = undefined, next.done = !0, next;
275
+ };
276
+
277
+ return next.next = next;
278
+ }
279
+ }
280
+
281
+ return {
282
+ next: doneResult
283
+ };
284
+ }
285
+
286
+ function doneResult() {
287
+ return {
288
+ value: undefined,
289
+ done: !0
290
+ };
291
+ }
292
+
293
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
294
+ var ctor = "function" == typeof genFun && genFun.constructor;
295
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
296
+ }, exports.mark = function (genFun) {
297
+ return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
298
+ }, exports.awrap = function (arg) {
299
+ return {
300
+ __await: arg
301
+ };
302
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
303
+ return this;
304
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
305
+ void 0 === PromiseImpl && (PromiseImpl = _Promise2);
306
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
307
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
308
+ return result.done ? result.value : iter.next();
309
+ });
310
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
311
+ return this;
312
+ }), define(Gp, "toString", function () {
313
+ return "[object Generator]";
314
+ }), exports.keys = function (object) {
315
+ var keys = [];
316
+
317
+ for (var key in object) {
318
+ keys.push(key);
319
+ }
320
+
321
+ return _reverseInstanceProperty(keys).call(keys), function next() {
322
+ for (; keys.length;) {
323
+ var key = keys.pop();
324
+ if (key in object) return next.value = key, next.done = !1, next;
325
+ }
326
+
327
+ return next.done = !0, next;
328
+ };
329
+ }, exports.values = values, Context.prototype = {
330
+ constructor: Context,
331
+ reset: function (skipTempReset) {
332
+ var _context8;
333
+
334
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context8 = this.tryEntries).call(_context8, resetTryEntry), !skipTempReset) for (var name in this) {
335
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
336
+ }
337
+ },
338
+ stop: function () {
339
+ this.done = !0;
340
+ var rootRecord = this.tryEntries[0].completion;
341
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
342
+ return this.rval;
343
+ },
344
+ dispatchException: function (exception) {
345
+ if (this.done) throw exception;
346
+ var context = this;
347
+
348
+ function handle(loc, caught) {
349
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
350
+ }
351
+
352
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
353
+ var entry = this.tryEntries[i],
354
+ record = entry.completion;
355
+ if ("root" === entry.tryLoc) return handle("end");
356
+
357
+ if (entry.tryLoc <= this.prev) {
358
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
359
+ hasFinally = hasOwn.call(entry, "finallyLoc");
360
+
361
+ if (hasCatch && hasFinally) {
362
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
363
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
364
+ } else if (hasCatch) {
365
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
366
+ } else {
367
+ if (!hasFinally) throw new Error("try statement without catch or finally");
368
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
369
+ }
370
+ }
371
+ }
372
+ },
373
+ abrupt: function (type, arg) {
374
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
375
+ var entry = this.tryEntries[i];
376
+
377
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
378
+ var finallyEntry = entry;
379
+ break;
380
+ }
381
+ }
382
+
383
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
384
+ var record = finallyEntry ? finallyEntry.completion : {};
385
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
386
+ },
387
+ complete: function (record, afterLoc) {
388
+ if ("throw" === record.type) throw record.arg;
389
+ 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;
390
+ },
391
+ finish: function (finallyLoc) {
392
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
393
+ var entry = this.tryEntries[i];
394
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
395
+ }
396
+ },
397
+ catch: function (tryLoc) {
398
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
399
+ var entry = this.tryEntries[i];
400
+
401
+ if (entry.tryLoc === tryLoc) {
402
+ var record = entry.completion;
403
+
404
+ if ("throw" === record.type) {
405
+ var thrown = record.arg;
406
+ resetTryEntry(entry);
407
+ }
408
+
409
+ return thrown;
410
+ }
411
+ }
412
+
413
+ throw new Error("illegal catch attempt");
414
+ },
415
+ delegateYield: function (iterable, resultName, nextLoc) {
416
+ return this.delegate = {
417
+ iterator: values(iterable),
418
+ resultName: resultName,
419
+ nextLoc: nextLoc
420
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
421
+ }
422
+ }, exports;
423
+ }
424
+
51
425
  function _createSuper(Derived) {
52
426
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
53
427
 
@@ -470,9 +844,9 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
470
844
  }, {
471
845
  key: "isCurrentAsync",
472
846
  value: function () {
473
- var _isCurrentAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
847
+ var _isCurrentAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
474
848
  var current;
475
- return _regenerator.default.wrap(function (_context) {
849
+ return _regeneratorRuntime().wrap(function (_context) {
476
850
  while (1) {
477
851
  switch (_context.prev = _context.next) {
478
852
  case 0:
@@ -709,14 +1083,14 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
709
1083
  }, {
710
1084
  key: "save",
711
1085
  value: function () {
712
- var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
1086
+ var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
713
1087
  var _len,
714
1088
  args,
715
1089
  _key4,
716
1090
  current,
717
1091
  _args2 = arguments;
718
1092
 
719
- return _regenerator.default.wrap(function (_context2) {
1093
+ return _regeneratorRuntime().wrap(function (_context2) {
720
1094
  while (1) {
721
1095
  switch (_context2.prev = _context2.next) {
722
1096
  case 0:
@@ -767,14 +1141,14 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
767
1141
  }, {
768
1142
  key: "destroy",
769
1143
  value: function () {
770
- var _destroy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
1144
+ var _destroy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
771
1145
  var _len2,
772
1146
  args,
773
1147
  _key5,
774
1148
  current,
775
1149
  _args3 = arguments;
776
1150
 
777
- return _regenerator.default.wrap(function (_context3) {
1151
+ return _regeneratorRuntime().wrap(function (_context3) {
778
1152
  while (1) {
779
1153
  switch (_context3.prev = _context3.next) {
780
1154
  case 0:
@@ -825,14 +1199,14 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
825
1199
  }, {
826
1200
  key: "fetch",
827
1201
  value: function () {
828
- var _fetch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
1202
+ var _fetch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
829
1203
  var _len3,
830
1204
  args,
831
1205
  _key6,
832
1206
  current,
833
1207
  _args4 = arguments;
834
1208
 
835
- return _regenerator.default.wrap(function (_context4) {
1209
+ return _regeneratorRuntime().wrap(function (_context4) {
836
1210
  while (1) {
837
1211
  switch (_context4.prev = _context4.next) {
838
1212
  case 0:
@@ -883,14 +1257,14 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
883
1257
  }, {
884
1258
  key: "fetchWithInclude",
885
1259
  value: function () {
886
- var _fetchWithInclude = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
1260
+ var _fetchWithInclude = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
887
1261
  var _len4,
888
1262
  args,
889
1263
  _key7,
890
1264
  current,
891
1265
  _args5 = arguments;
892
1266
 
893
- return _regenerator.default.wrap(function (_context5) {
1267
+ return _regeneratorRuntime().wrap(function (_context5) {
894
1268
  while (1) {
895
1269
  switch (_context5.prev = _context5.next) {
896
1270
  case 0:
@@ -1812,9 +2186,9 @@ var DefaultController = {
1812
2186
  , options
1813
2187
  /*: RequestOptions*/
1814
2188
  ) {
1815
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
2189
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
1816
2190
  var token, RESTController, result, session, current;
1817
- return _regenerator.default.wrap(function (_context6) {
2191
+ return _regeneratorRuntime().wrap(function (_context6) {
1818
2192
  while (1) {
1819
2193
  switch (_context6.prev = _context6.next) {
1820
2194
  case 0:
@@ -30,10 +30,8 @@ var StorageController = {
30
30
  )
31
31
  /*: Promise*/
32
32
  {
33
- var _this = this;
34
-
35
33
  return new _promise.default(function (resolve, reject) {
36
- _this.getAsyncStorage().getItem(path, function (err, value) {
34
+ this.getAsyncStorage().getItem(path, function (err, value) {
37
35
  if (err) {
38
36
  reject(err);
39
37
  } else {
@@ -49,10 +47,8 @@ var StorageController = {
49
47
  )
50
48
  /*: Promise*/
51
49
  {
52
- var _this2 = this;
53
-
54
50
  return new _promise.default(function (resolve, reject) {
55
- _this2.getAsyncStorage().setItem(path, value, function (err, value) {
51
+ this.getAsyncStorage().setItem(path, value, function (err, value) {
56
52
  if (err) {
57
53
  reject(err);
58
54
  } else {
@@ -66,10 +62,8 @@ var StorageController = {
66
62
  )
67
63
  /*: Promise*/
68
64
  {
69
- var _this3 = this;
70
-
71
65
  return new _promise.default(function (resolve, reject) {
72
- _this3.getAsyncStorage().removeItem(path, function (err) {
66
+ this.getAsyncStorage().removeItem(path, function (err) {
73
67
  if (err) {
74
68
  reject(err);
75
69
  } else {
@@ -81,10 +75,8 @@ var StorageController = {
81
75
  getAllKeysAsync: function ()
82
76
  /*: Promise*/
83
77
  {
84
- var _this4 = this;
85
-
86
78
  return new _promise.default(function (resolve, reject) {
87
- _this4.getAsyncStorage().getAllKeys(function (err, keys) {
79
+ this.getAsyncStorage().getAllKeys(function (err, keys) {
88
80
  if (err) {
89
81
  reject(err);
90
82
  } else {
@@ -98,10 +90,8 @@ var StorageController = {
98
90
  )
99
91
  /*: Promise<Array<Array<string>>>*/
100
92
  {
101
- var _this5 = this;
102
-
103
93
  return new _promise.default(function (resolve, reject) {
104
- _this5.getAsyncStorage().multiGet(keys, function (err, result) {
94
+ this.getAsyncStorage().multiGet(keys, function (err, result) {
105
95
  if (err) {
106
96
  reject(err);
107
97
  } else {
@@ -115,10 +105,8 @@ var StorageController = {
115
105
  )
116
106
  /*: Promise*/
117
107
  {
118
- var _this6 = this;
119
-
120
108
  return new _promise.default(function (resolve, reject) {
121
- _this6.getAsyncStorage().multiRemove(keys, function (err) {
109
+ this.getAsyncStorage().multiRemove(keys, function (err) {
122
110
  if (err) {
123
111
  reject(err);
124
112
  } else {
@@ -217,7 +217,7 @@ const config
217
217
  SERVER_AUTH_TOKEN: null,
218
218
  LIVEQUERY_SERVER_URL: null,
219
219
  ENCRYPTED_KEY: null,
220
- VERSION: 'js' + "3.5.0-alpha.3",
220
+ VERSION: 'js' + "3.5.0-alpha.5",
221
221
  APPLICATION_ID: null,
222
222
  JAVASCRIPT_KEY: null,
223
223
  MASTER_KEY: null,
@@ -590,9 +590,24 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
590
590
 
591
591
  case '$geoWithin':
592
592
  {
593
- const points = compareTo.$polygon.map(geoPoint => [geoPoint.latitude, geoPoint.longitude]);
594
- const polygon = new ParsePolygon(points);
595
- return polygon.containsPoint(object[key]);
593
+ if (compareTo.$polygon) {
594
+ const points = compareTo.$polygon.map(geoPoint => [geoPoint.latitude, geoPoint.longitude]);
595
+ const polygon = new ParsePolygon(points);
596
+ return polygon.containsPoint(object[key]);
597
+ }
598
+
599
+ if (compareTo.$centerSphere) {
600
+ const [WGS84Point, maxDistance] = compareTo.$centerSphere;
601
+ const centerPoint = new ParseGeoPoint({
602
+ latitude: WGS84Point[1],
603
+ longitude: WGS84Point[0]
604
+ });
605
+ const point = new ParseGeoPoint(object[key]);
606
+ const distance = point.radiansTo(centerPoint);
607
+ return distance <= maxDistance;
608
+ }
609
+
610
+ break;
596
611
  }
597
612
 
598
613
  case '$geoIntersects':
@@ -3075,10 +3075,6 @@ const DefaultController = {
3075
3075
  if (el instanceof _ParseFile.default) {
3076
3076
  filesSaved.push(el.save(options));
3077
3077
  } else if (el instanceof ParseObject) {
3078
- if (allowCustomObjectId && !el.id) {
3079
- throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty, null or undefined');
3080
- }
3081
-
3082
3078
  pending.push(el);
3083
3079
  }
3084
3080
  });
@@ -3090,6 +3086,10 @@ const DefaultController = {
3090
3086
  const batch = [];
3091
3087
  const nextPending = [];
3092
3088
  pending.forEach(el => {
3089
+ if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {
3090
+ throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
3091
+ }
3092
+
3093
3093
  if (batch.length < batchSize && (0, _canBeSerialized.default)(el)) {
3094
3094
  batch.push(el);
3095
3095
  } else {
@@ -3162,8 +3162,8 @@ const DefaultController = {
3162
3162
  });
3163
3163
  });
3164
3164
  } else if (target instanceof ParseObject) {
3165
- if (allowCustomObjectId && !target.id) {
3166
- throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty, null or undefined');
3165
+ if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {
3166
+ throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
3167
3167
  } // generate _localId in case if cascadeSave=false
3168
3168
 
3169
3169
 
@@ -1636,15 +1636,13 @@ class ParseQuery {
1636
1636
  )
1637
1637
  /*: ParseQuery*/
1638
1638
  {
1639
- const _this = this;
1640
-
1641
1639
  if (!Array.isArray(values)) {
1642
1640
  values = [values];
1643
1641
  }
1644
1642
 
1645
1643
  const regexObject = values.map(value => {
1646
1644
  return {
1647
- $regex: _this._regexStartWith(value)
1645
+ $regex: this._regexStartWith(value)
1648
1646
  };
1649
1647
  });
1650
1648
  return this.containsAll(key, regexObject);
@@ -8,7 +8,7 @@ var config = {
8
8
  SERVER_AUTH_TOKEN: null,
9
9
  LIVEQUERY_SERVER_URL: null,
10
10
  ENCRYPTED_KEY: null,
11
- VERSION: 'js' + "3.5.0-alpha.3",
11
+ VERSION: 'js' + "3.5.0-alpha.5",
12
12
  APPLICATION_ID: null,
13
13
  JAVASCRIPT_KEY: null,
14
14
  MASTER_KEY: null,