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