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
@@ -1,7 +1,5 @@
1
1
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
2
2
 
3
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
4
-
5
3
  var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
6
4
 
7
5
  var _Storage = _interopRequireDefault(require("./Storage"));
@@ -46,15 +44,366 @@ function _arrayLikeToArray(arr, len) {
46
44
  return arr2;
47
45
  }
48
46
 
47
+ function _regeneratorRuntime() {
48
+ "use strict";
49
+
50
+ _regeneratorRuntime = function () {
51
+ return exports;
52
+ };
53
+
54
+ var exports = {},
55
+ Op = Object.prototype,
56
+ hasOwn = Op.hasOwnProperty,
57
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
58
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
59
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
60
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
61
+
62
+ function define(obj, key, value) {
63
+ return Object.defineProperty(obj, key, {
64
+ value: value,
65
+ enumerable: !0,
66
+ configurable: !0,
67
+ writable: !0
68
+ }), obj[key];
69
+ }
70
+
71
+ try {
72
+ define({}, "");
73
+ } catch (err) {
74
+ define = function (obj, key, value) {
75
+ return obj[key] = value;
76
+ };
77
+ }
78
+
79
+ function wrap(innerFn, outerFn, self, tryLocsList) {
80
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
81
+ generator = Object.create(protoGenerator.prototype),
82
+ context = new Context(tryLocsList || []);
83
+ return generator._invoke = function (innerFn, self, context) {
84
+ var state = "suspendedStart";
85
+ return function (method, arg) {
86
+ if ("executing" === state) throw new Error("Generator is already running");
87
+
88
+ if ("completed" === state) {
89
+ if ("throw" === method) throw arg;
90
+ return doneResult();
91
+ }
92
+
93
+ for (context.method = method, context.arg = arg;;) {
94
+ var delegate = context.delegate;
95
+
96
+ if (delegate) {
97
+ var delegateResult = maybeInvokeDelegate(delegate, context);
98
+
99
+ if (delegateResult) {
100
+ if (delegateResult === ContinueSentinel) continue;
101
+ return delegateResult;
102
+ }
103
+ }
104
+
105
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
106
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
107
+ context.dispatchException(context.arg);
108
+ } else "return" === context.method && context.abrupt("return", context.arg);
109
+ state = "executing";
110
+ var record = tryCatch(innerFn, self, context);
111
+
112
+ if ("normal" === record.type) {
113
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
114
+ return {
115
+ value: record.arg,
116
+ done: context.done
117
+ };
118
+ }
119
+
120
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
121
+ }
122
+ };
123
+ }(innerFn, self, context), generator;
124
+ }
125
+
126
+ function tryCatch(fn, obj, arg) {
127
+ try {
128
+ return {
129
+ type: "normal",
130
+ arg: fn.call(obj, arg)
131
+ };
132
+ } catch (err) {
133
+ return {
134
+ type: "throw",
135
+ arg: err
136
+ };
137
+ }
138
+ }
139
+
140
+ exports.wrap = wrap;
141
+ var ContinueSentinel = {};
142
+
143
+ function Generator() {}
144
+
145
+ function GeneratorFunction() {}
146
+
147
+ function GeneratorFunctionPrototype() {}
148
+
149
+ var IteratorPrototype = {};
150
+ define(IteratorPrototype, iteratorSymbol, function () {
151
+ return this;
152
+ });
153
+ var getProto = Object.getPrototypeOf,
154
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
155
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
156
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
157
+
158
+ function defineIteratorMethods(prototype) {
159
+ ["next", "throw", "return"].forEach(function (method) {
160
+ define(prototype, method, function (arg) {
161
+ return this._invoke(method, arg);
162
+ });
163
+ });
164
+ }
165
+
166
+ function AsyncIterator(generator, PromiseImpl) {
167
+ function invoke(method, arg, resolve, reject) {
168
+ var record = tryCatch(generator[method], generator, arg);
169
+
170
+ if ("throw" !== record.type) {
171
+ var result = record.arg,
172
+ value = result.value;
173
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
174
+ invoke("next", value, resolve, reject);
175
+ }, function (err) {
176
+ invoke("throw", err, resolve, reject);
177
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
178
+ result.value = unwrapped, resolve(result);
179
+ }, function (error) {
180
+ return invoke("throw", error, resolve, reject);
181
+ });
182
+ }
183
+
184
+ reject(record.arg);
185
+ }
186
+
187
+ var previousPromise;
188
+
189
+ this._invoke = function (method, arg) {
190
+ function callInvokeWithMethodAndArg() {
191
+ return new PromiseImpl(function (resolve, reject) {
192
+ invoke(method, arg, resolve, reject);
193
+ });
194
+ }
195
+
196
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
197
+ };
198
+ }
199
+
200
+ function maybeInvokeDelegate(delegate, context) {
201
+ var method = delegate.iterator[context.method];
202
+
203
+ if (undefined === method) {
204
+ if (context.delegate = null, "throw" === context.method) {
205
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
206
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
207
+ }
208
+
209
+ return ContinueSentinel;
210
+ }
211
+
212
+ var record = tryCatch(method, delegate.iterator, context.arg);
213
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
214
+ var info = record.arg;
215
+ 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);
216
+ }
217
+
218
+ function pushTryEntry(locs) {
219
+ var entry = {
220
+ tryLoc: locs[0]
221
+ };
222
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
223
+ }
224
+
225
+ function resetTryEntry(entry) {
226
+ var record = entry.completion || {};
227
+ record.type = "normal", delete record.arg, entry.completion = record;
228
+ }
229
+
230
+ function Context(tryLocsList) {
231
+ this.tryEntries = [{
232
+ tryLoc: "root"
233
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
234
+ }
235
+
236
+ function values(iterable) {
237
+ if (iterable) {
238
+ var iteratorMethod = iterable[iteratorSymbol];
239
+ if (iteratorMethod) return iteratorMethod.call(iterable);
240
+ if ("function" == typeof iterable.next) return iterable;
241
+
242
+ if (!isNaN(iterable.length)) {
243
+ var i = -1,
244
+ next = function next() {
245
+ for (; ++i < iterable.length;) {
246
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
247
+ }
248
+
249
+ return next.value = undefined, next.done = !0, next;
250
+ };
251
+
252
+ return next.next = next;
253
+ }
254
+ }
255
+
256
+ return {
257
+ next: doneResult
258
+ };
259
+ }
260
+
261
+ function doneResult() {
262
+ return {
263
+ value: undefined,
264
+ done: !0
265
+ };
266
+ }
267
+
268
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
269
+ var ctor = "function" == typeof genFun && genFun.constructor;
270
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
271
+ }, exports.mark = function (genFun) {
272
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
273
+ }, exports.awrap = function (arg) {
274
+ return {
275
+ __await: arg
276
+ };
277
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
278
+ return this;
279
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
280
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
281
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
282
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
283
+ return result.done ? result.value : iter.next();
284
+ });
285
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
286
+ return this;
287
+ }), define(Gp, "toString", function () {
288
+ return "[object Generator]";
289
+ }), exports.keys = function (object) {
290
+ var keys = [];
291
+
292
+ for (var key in object) {
293
+ keys.push(key);
294
+ }
295
+
296
+ return keys.reverse(), function next() {
297
+ for (; keys.length;) {
298
+ var key = keys.pop();
299
+ if (key in object) return next.value = key, next.done = !1, next;
300
+ }
301
+
302
+ return next.done = !0, next;
303
+ };
304
+ }, exports.values = values, Context.prototype = {
305
+ constructor: Context,
306
+ reset: function (skipTempReset) {
307
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
308
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
309
+ }
310
+ },
311
+ stop: function () {
312
+ this.done = !0;
313
+ var rootRecord = this.tryEntries[0].completion;
314
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
315
+ return this.rval;
316
+ },
317
+ dispatchException: function (exception) {
318
+ if (this.done) throw exception;
319
+ var context = this;
320
+
321
+ function handle(loc, caught) {
322
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
323
+ }
324
+
325
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
326
+ var entry = this.tryEntries[i],
327
+ record = entry.completion;
328
+ if ("root" === entry.tryLoc) return handle("end");
329
+
330
+ if (entry.tryLoc <= this.prev) {
331
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
332
+ hasFinally = hasOwn.call(entry, "finallyLoc");
333
+
334
+ if (hasCatch && hasFinally) {
335
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
336
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
337
+ } else if (hasCatch) {
338
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
339
+ } else {
340
+ if (!hasFinally) throw new Error("try statement without catch or finally");
341
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
342
+ }
343
+ }
344
+ }
345
+ },
346
+ abrupt: function (type, arg) {
347
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
348
+ var entry = this.tryEntries[i];
349
+
350
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
351
+ var finallyEntry = entry;
352
+ break;
353
+ }
354
+ }
355
+
356
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
357
+ var record = finallyEntry ? finallyEntry.completion : {};
358
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
359
+ },
360
+ complete: function (record, afterLoc) {
361
+ if ("throw" === record.type) throw record.arg;
362
+ 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;
363
+ },
364
+ finish: function (finallyLoc) {
365
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
366
+ var entry = this.tryEntries[i];
367
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
368
+ }
369
+ },
370
+ catch: function (tryLoc) {
371
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
372
+ var entry = this.tryEntries[i];
373
+
374
+ if (entry.tryLoc === tryLoc) {
375
+ var record = entry.completion;
376
+
377
+ if ("throw" === record.type) {
378
+ var thrown = record.arg;
379
+ resetTryEntry(entry);
380
+ }
381
+
382
+ return thrown;
383
+ }
384
+ }
385
+
386
+ throw new Error("illegal catch attempt");
387
+ },
388
+ delegateYield: function (iterable, resultName, nextLoc) {
389
+ return this.delegate = {
390
+ iterator: values(iterable),
391
+ resultName: resultName,
392
+ nextLoc: nextLoc
393
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
394
+ }
395
+ }, exports;
396
+ }
397
+
49
398
  var LocalDatastoreController = {
50
399
  fromPinWithName: function (name) {
51
400
  var values, objects;
52
- return _regenerator.default.async(function (_context) {
401
+ return _regeneratorRuntime().async(function (_context) {
53
402
  while (1) {
54
403
  switch (_context.prev = _context.next) {
55
404
  case 0:
56
405
  _context.next = 2;
57
- return _regenerator.default.awrap(_Storage.default.getItemAsync(name));
406
+ return _regeneratorRuntime().awrap(_Storage.default.getItemAsync(name));
58
407
 
59
408
  case 2:
60
409
  values = _context.sent;
@@ -86,23 +435,23 @@ var LocalDatastoreController = {
86
435
  },
87
436
  getAllContents: function () {
88
437
  var keys;
89
- return _regenerator.default.async(function (_context3) {
438
+ return _regeneratorRuntime().async(function (_context3) {
90
439
  while (1) {
91
440
  switch (_context3.prev = _context3.next) {
92
441
  case 0:
93
442
  _context3.next = 2;
94
- return _regenerator.default.awrap(_Storage.default.getAllKeysAsync());
443
+ return _regeneratorRuntime().awrap(_Storage.default.getAllKeysAsync());
95
444
 
96
445
  case 2:
97
446
  keys = _context3.sent;
98
447
  return _context3.abrupt("return", keys.reduce(function (previousPromise, key) {
99
448
  var LDS, value;
100
- return _regenerator.default.async(function (_context2) {
449
+ return _regeneratorRuntime().async(function (_context2) {
101
450
  while (1) {
102
451
  switch (_context2.prev = _context2.next) {
103
452
  case 0:
104
453
  _context2.next = 2;
105
- return _regenerator.default.awrap(previousPromise);
454
+ return _regeneratorRuntime().awrap(previousPromise);
106
455
 
107
456
  case 2:
108
457
  LDS = _context2.sent;
@@ -113,7 +462,7 @@ var LocalDatastoreController = {
113
462
  }
114
463
 
115
464
  _context2.next = 6;
116
- return _regenerator.default.awrap(_Storage.default.getItemAsync(key));
465
+ return _regeneratorRuntime().awrap(_Storage.default.getItemAsync(key));
117
466
 
118
467
  case 6:
119
468
  value = _context2.sent;
@@ -144,28 +493,28 @@ var LocalDatastoreController = {
144
493
  },
145
494
  getRawStorage: function () {
146
495
  var keys;
147
- return _regenerator.default.async(function (_context5) {
496
+ return _regeneratorRuntime().async(function (_context5) {
148
497
  while (1) {
149
498
  switch (_context5.prev = _context5.next) {
150
499
  case 0:
151
500
  _context5.next = 2;
152
- return _regenerator.default.awrap(_Storage.default.getAllKeysAsync());
501
+ return _regeneratorRuntime().awrap(_Storage.default.getAllKeysAsync());
153
502
 
154
503
  case 2:
155
504
  keys = _context5.sent;
156
505
  return _context5.abrupt("return", keys.reduce(function (previousPromise, key) {
157
506
  var LDS, value;
158
- return _regenerator.default.async(function (_context4) {
507
+ return _regeneratorRuntime().async(function (_context4) {
159
508
  while (1) {
160
509
  switch (_context4.prev = _context4.next) {
161
510
  case 0:
162
511
  _context4.next = 2;
163
- return _regenerator.default.awrap(previousPromise);
512
+ return _regeneratorRuntime().awrap(previousPromise);
164
513
 
165
514
  case 2:
166
515
  LDS = _context4.sent;
167
516
  _context4.next = 5;
168
- return _regenerator.default.awrap(_Storage.default.getItemAsync(key));
517
+ return _regeneratorRuntime().awrap(_Storage.default.getItemAsync(key));
169
518
 
170
519
  case 5:
171
520
  value = _context4.sent;
@@ -190,12 +539,12 @@ var LocalDatastoreController = {
190
539
  clear: function () {
191
540
  var keys, toRemove, _iterator, _step, key, promises;
192
541
 
193
- return _regenerator.default.async(function (_context6) {
542
+ return _regeneratorRuntime().async(function (_context6) {
194
543
  while (1) {
195
544
  switch (_context6.prev = _context6.next) {
196
545
  case 0:
197
546
  _context6.next = 2;
198
- return _regenerator.default.awrap(_Storage.default.getAllKeysAsync());
547
+ return _regeneratorRuntime().awrap(_Storage.default.getAllKeysAsync());
199
548
 
200
549
  case 2:
201
550
  keys = _context6.sent;