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,21 +2,370 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
2
2
 
3
3
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
4
4
 
5
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
-
7
5
  var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
8
6
 
7
+ function _regeneratorRuntime() {
8
+ "use strict";
9
+
10
+ _regeneratorRuntime = function () {
11
+ return exports;
12
+ };
13
+
14
+ var exports = {},
15
+ Op = Object.prototype,
16
+ hasOwn = Op.hasOwnProperty,
17
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
18
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
19
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
20
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
21
+
22
+ function define(obj, key, value) {
23
+ return Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: !0,
26
+ configurable: !0,
27
+ writable: !0
28
+ }), obj[key];
29
+ }
30
+
31
+ try {
32
+ define({}, "");
33
+ } catch (err) {
34
+ define = function (obj, key, value) {
35
+ return obj[key] = value;
36
+ };
37
+ }
38
+
39
+ function wrap(innerFn, outerFn, self, tryLocsList) {
40
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
41
+ generator = Object.create(protoGenerator.prototype),
42
+ context = new Context(tryLocsList || []);
43
+ return generator._invoke = function (innerFn, self, context) {
44
+ var state = "suspendedStart";
45
+ return function (method, arg) {
46
+ if ("executing" === state) throw new Error("Generator is already running");
47
+
48
+ if ("completed" === state) {
49
+ if ("throw" === method) throw arg;
50
+ return doneResult();
51
+ }
52
+
53
+ for (context.method = method, context.arg = arg;;) {
54
+ var delegate = context.delegate;
55
+
56
+ if (delegate) {
57
+ var delegateResult = maybeInvokeDelegate(delegate, context);
58
+
59
+ if (delegateResult) {
60
+ if (delegateResult === ContinueSentinel) continue;
61
+ return delegateResult;
62
+ }
63
+ }
64
+
65
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
66
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
67
+ context.dispatchException(context.arg);
68
+ } else "return" === context.method && context.abrupt("return", context.arg);
69
+ state = "executing";
70
+ var record = tryCatch(innerFn, self, context);
71
+
72
+ if ("normal" === record.type) {
73
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
74
+ return {
75
+ value: record.arg,
76
+ done: context.done
77
+ };
78
+ }
79
+
80
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
81
+ }
82
+ };
83
+ }(innerFn, self, context), generator;
84
+ }
85
+
86
+ function tryCatch(fn, obj, arg) {
87
+ try {
88
+ return {
89
+ type: "normal",
90
+ arg: fn.call(obj, arg)
91
+ };
92
+ } catch (err) {
93
+ return {
94
+ type: "throw",
95
+ arg: err
96
+ };
97
+ }
98
+ }
99
+
100
+ exports.wrap = wrap;
101
+ var ContinueSentinel = {};
102
+
103
+ function Generator() {}
104
+
105
+ function GeneratorFunction() {}
106
+
107
+ function GeneratorFunctionPrototype() {}
108
+
109
+ var IteratorPrototype = {};
110
+ define(IteratorPrototype, iteratorSymbol, function () {
111
+ return this;
112
+ });
113
+ var getProto = Object.getPrototypeOf,
114
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
115
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
116
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
117
+
118
+ function defineIteratorMethods(prototype) {
119
+ ["next", "throw", "return"].forEach(function (method) {
120
+ define(prototype, method, function (arg) {
121
+ return this._invoke(method, arg);
122
+ });
123
+ });
124
+ }
125
+
126
+ function AsyncIterator(generator, PromiseImpl) {
127
+ function invoke(method, arg, resolve, reject) {
128
+ var record = tryCatch(generator[method], generator, arg);
129
+
130
+ if ("throw" !== record.type) {
131
+ var result = record.arg,
132
+ value = result.value;
133
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
134
+ invoke("next", value, resolve, reject);
135
+ }, function (err) {
136
+ invoke("throw", err, resolve, reject);
137
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
138
+ result.value = unwrapped, resolve(result);
139
+ }, function (error) {
140
+ return invoke("throw", error, resolve, reject);
141
+ });
142
+ }
143
+
144
+ reject(record.arg);
145
+ }
146
+
147
+ var previousPromise;
148
+
149
+ this._invoke = function (method, arg) {
150
+ function callInvokeWithMethodAndArg() {
151
+ return new PromiseImpl(function (resolve, reject) {
152
+ invoke(method, arg, resolve, reject);
153
+ });
154
+ }
155
+
156
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
157
+ };
158
+ }
159
+
160
+ function maybeInvokeDelegate(delegate, context) {
161
+ var method = delegate.iterator[context.method];
162
+
163
+ if (undefined === method) {
164
+ if (context.delegate = null, "throw" === context.method) {
165
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
166
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
167
+ }
168
+
169
+ return ContinueSentinel;
170
+ }
171
+
172
+ var record = tryCatch(method, delegate.iterator, context.arg);
173
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
174
+ var info = record.arg;
175
+ 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);
176
+ }
177
+
178
+ function pushTryEntry(locs) {
179
+ var entry = {
180
+ tryLoc: locs[0]
181
+ };
182
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
183
+ }
184
+
185
+ function resetTryEntry(entry) {
186
+ var record = entry.completion || {};
187
+ record.type = "normal", delete record.arg, entry.completion = record;
188
+ }
189
+
190
+ function Context(tryLocsList) {
191
+ this.tryEntries = [{
192
+ tryLoc: "root"
193
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
194
+ }
195
+
196
+ function values(iterable) {
197
+ if (iterable) {
198
+ var iteratorMethod = iterable[iteratorSymbol];
199
+ if (iteratorMethod) return iteratorMethod.call(iterable);
200
+ if ("function" == typeof iterable.next) return iterable;
201
+
202
+ if (!isNaN(iterable.length)) {
203
+ var i = -1,
204
+ next = function next() {
205
+ for (; ++i < iterable.length;) {
206
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
207
+ }
208
+
209
+ return next.value = undefined, next.done = !0, next;
210
+ };
211
+
212
+ return next.next = next;
213
+ }
214
+ }
215
+
216
+ return {
217
+ next: doneResult
218
+ };
219
+ }
220
+
221
+ function doneResult() {
222
+ return {
223
+ value: undefined,
224
+ done: !0
225
+ };
226
+ }
227
+
228
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
229
+ var ctor = "function" == typeof genFun && genFun.constructor;
230
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
231
+ }, exports.mark = function (genFun) {
232
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
233
+ }, exports.awrap = function (arg) {
234
+ return {
235
+ __await: arg
236
+ };
237
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
238
+ return this;
239
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
240
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
241
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
242
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
243
+ return result.done ? result.value : iter.next();
244
+ });
245
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
246
+ return this;
247
+ }), define(Gp, "toString", function () {
248
+ return "[object Generator]";
249
+ }), exports.keys = function (object) {
250
+ var keys = [];
251
+
252
+ for (var key in object) {
253
+ keys.push(key);
254
+ }
255
+
256
+ return keys.reverse(), function next() {
257
+ for (; keys.length;) {
258
+ var key = keys.pop();
259
+ if (key in object) return next.value = key, next.done = !1, next;
260
+ }
261
+
262
+ return next.done = !0, next;
263
+ };
264
+ }, exports.values = values, Context.prototype = {
265
+ constructor: Context,
266
+ reset: function (skipTempReset) {
267
+ 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) {
268
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
269
+ }
270
+ },
271
+ stop: function () {
272
+ this.done = !0;
273
+ var rootRecord = this.tryEntries[0].completion;
274
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
275
+ return this.rval;
276
+ },
277
+ dispatchException: function (exception) {
278
+ if (this.done) throw exception;
279
+ var context = this;
280
+
281
+ function handle(loc, caught) {
282
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
283
+ }
284
+
285
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
286
+ var entry = this.tryEntries[i],
287
+ record = entry.completion;
288
+ if ("root" === entry.tryLoc) return handle("end");
289
+
290
+ if (entry.tryLoc <= this.prev) {
291
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
292
+ hasFinally = hasOwn.call(entry, "finallyLoc");
293
+
294
+ if (hasCatch && hasFinally) {
295
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
296
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
297
+ } else if (hasCatch) {
298
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
299
+ } else {
300
+ if (!hasFinally) throw new Error("try statement without catch or finally");
301
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
302
+ }
303
+ }
304
+ }
305
+ },
306
+ abrupt: function (type, arg) {
307
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
308
+ var entry = this.tryEntries[i];
309
+
310
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
311
+ var finallyEntry = entry;
312
+ break;
313
+ }
314
+ }
315
+
316
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
317
+ var record = finallyEntry ? finallyEntry.completion : {};
318
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
319
+ },
320
+ complete: function (record, afterLoc) {
321
+ if ("throw" === record.type) throw record.arg;
322
+ 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;
323
+ },
324
+ finish: function (finallyLoc) {
325
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
326
+ var entry = this.tryEntries[i];
327
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
328
+ }
329
+ },
330
+ catch: function (tryLoc) {
331
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
332
+ var entry = this.tryEntries[i];
333
+
334
+ if (entry.tryLoc === tryLoc) {
335
+ var record = entry.completion;
336
+
337
+ if ("throw" === record.type) {
338
+ var thrown = record.arg;
339
+ resetTryEntry(entry);
340
+ }
341
+
342
+ return thrown;
343
+ }
344
+ }
345
+
346
+ throw new Error("illegal catch attempt");
347
+ },
348
+ delegateYield: function (iterable, resultName, nextLoc) {
349
+ return this.delegate = {
350
+ iterator: values(iterable),
351
+ resultName: resultName,
352
+ nextLoc: nextLoc
353
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
354
+ }
355
+ }, exports;
356
+ }
357
+
9
358
  var RNStorage = require('./StorageController.react-native');
10
359
 
11
360
  var LocalDatastoreController = {
12
361
  fromPinWithName: function (name) {
13
362
  var values, objects;
14
- return _regenerator.default.async(function (_context) {
363
+ return _regeneratorRuntime().async(function (_context) {
15
364
  while (1) {
16
365
  switch (_context.prev = _context.next) {
17
366
  case 0:
18
367
  _context.next = 2;
19
- return _regenerator.default.awrap(RNStorage.getItemAsync(name));
368
+ return _regeneratorRuntime().awrap(RNStorage.getItemAsync(name));
20
369
 
21
370
  case 2:
22
371
  values = _context.sent;
@@ -41,14 +390,14 @@ var LocalDatastoreController = {
41
390
  },
42
391
  pinWithName: function (name, value) {
43
392
  var values;
44
- return _regenerator.default.async(function (_context2) {
393
+ return _regeneratorRuntime().async(function (_context2) {
45
394
  while (1) {
46
395
  switch (_context2.prev = _context2.next) {
47
396
  case 0:
48
397
  _context2.prev = 0;
49
398
  values = JSON.stringify(value);
50
399
  _context2.next = 4;
51
- return _regenerator.default.awrap(RNStorage.setItemAsync(name, values));
400
+ return _regeneratorRuntime().awrap(RNStorage.setItemAsync(name, values));
52
401
 
53
402
  case 4:
54
403
  _context2.next = 9;
@@ -71,12 +420,12 @@ var LocalDatastoreController = {
71
420
  },
72
421
  getAllContents: function () {
73
422
  var keys, batch, i, key, LDS, results;
74
- return _regenerator.default.async(function (_context3) {
423
+ return _regeneratorRuntime().async(function (_context3) {
75
424
  while (1) {
76
425
  switch (_context3.prev = _context3.next) {
77
426
  case 0:
78
427
  _context3.next = 2;
79
- return _regenerator.default.awrap(RNStorage.getAllKeysAsync());
428
+ return _regeneratorRuntime().awrap(RNStorage.getAllKeysAsync());
80
429
 
81
430
  case 2:
82
431
  keys = _context3.sent;
@@ -94,7 +443,7 @@ var LocalDatastoreController = {
94
443
  results = [];
95
444
  _context3.prev = 7;
96
445
  _context3.next = 10;
97
- return _regenerator.default.awrap(RNStorage.multiGet(batch));
446
+ return _regeneratorRuntime().awrap(RNStorage.multiGet(batch));
98
447
 
99
448
  case 10:
100
449
  results = _context3.sent;
@@ -130,18 +479,18 @@ var LocalDatastoreController = {
130
479
  },
131
480
  getRawStorage: function () {
132
481
  var keys, storage, results;
133
- return _regenerator.default.async(function (_context4) {
482
+ return _regeneratorRuntime().async(function (_context4) {
134
483
  while (1) {
135
484
  switch (_context4.prev = _context4.next) {
136
485
  case 0:
137
486
  _context4.next = 2;
138
- return _regenerator.default.awrap(RNStorage.getAllKeysAsync());
487
+ return _regeneratorRuntime().awrap(RNStorage.getAllKeysAsync());
139
488
 
140
489
  case 2:
141
490
  keys = _context4.sent;
142
491
  storage = {};
143
492
  _context4.next = 6;
144
- return _regenerator.default.awrap(RNStorage.multiGet(keys));
493
+ return _regeneratorRuntime().awrap(RNStorage.multiGet(keys));
145
494
 
146
495
  case 6:
147
496
  results = _context4.sent;
@@ -163,12 +512,12 @@ var LocalDatastoreController = {
163
512
  },
164
513
  clear: function () {
165
514
  var keys, batch, i, key;
166
- return _regenerator.default.async(function (_context5) {
515
+ return _regeneratorRuntime().async(function (_context5) {
167
516
  while (1) {
168
517
  switch (_context5.prev = _context5.next) {
169
518
  case 0:
170
519
  _context5.next = 2;
171
- return _regenerator.default.awrap(RNStorage.getAllKeysAsync());
520
+ return _regeneratorRuntime().awrap(RNStorage.getAllKeysAsync());
172
521
 
173
522
  case 2:
174
523
  keys = _context5.sent;