parse 4.0.0-alpha.6 → 4.0.0-alpha.8

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 (197) hide show
  1. package/LICENSE +167 -25
  2. package/NOTICE +10 -0
  3. package/README.md +1 -3
  4. package/dist/parse.js +3991 -6551
  5. package/dist/parse.min.js +7 -6
  6. package/dist/parse.weapp.js +3152 -6482
  7. package/dist/parse.weapp.min.js +7 -6
  8. package/lib/browser/Analytics.js +4 -11
  9. package/lib/browser/AnonymousUtils.js +2 -9
  10. package/lib/browser/Cloud.js +4 -11
  11. package/lib/browser/CloudCode.js +0 -1
  12. package/lib/browser/CoreManager.js +3 -10
  13. package/lib/browser/EventEmitter.js +0 -7
  14. package/lib/browser/EventuallyQueue.js +282 -668
  15. package/lib/browser/FacebookUtils.js +2 -9
  16. package/lib/browser/InstallationController.js +0 -7
  17. package/lib/browser/LiveQueryClient.js +35 -26
  18. package/lib/browser/LiveQuerySubscription.js +5 -4
  19. package/lib/browser/LocalDatastore.js +472 -864
  20. package/lib/browser/LocalDatastoreController.js +161 -547
  21. package/lib/browser/LocalDatastoreController.react-native.js +156 -537
  22. package/lib/browser/LocalDatastoreUtils.js +2 -9
  23. package/lib/browser/ObjectStateMutations.js +25 -25
  24. package/lib/browser/OfflineQuery.js +31 -33
  25. package/lib/browser/Parse.js +4 -13
  26. package/lib/browser/ParseACL.js +9 -16
  27. package/lib/browser/ParseCLP.js +46 -48
  28. package/lib/browser/ParseConfig.js +6 -13
  29. package/lib/browser/ParseError.js +2 -11
  30. package/lib/browser/ParseFile.js +107 -482
  31. package/lib/browser/ParseGeoPoint.js +4 -11
  32. package/lib/browser/ParseHooks.js +2 -2
  33. package/lib/browser/ParseInstallation.js +2 -2
  34. package/lib/browser/ParseLiveQuery.js +104 -480
  35. package/lib/browser/ParseObject.js +598 -958
  36. package/lib/browser/ParseOp.js +11 -11
  37. package/lib/browser/ParsePolygon.js +5 -12
  38. package/lib/browser/ParseQuery.js +365 -758
  39. package/lib/browser/ParseRelation.js +2 -9
  40. package/lib/browser/ParseRole.js +2 -2
  41. package/lib/browser/ParseSchema.js +2 -9
  42. package/lib/browser/ParseSession.js +2 -2
  43. package/lib/browser/ParseUser.js +221 -607
  44. package/lib/browser/Push.js +2 -9
  45. package/lib/browser/RESTController.js +12 -19
  46. package/lib/browser/SingleInstanceStateController.js +4 -11
  47. package/lib/browser/Storage.js +0 -7
  48. package/lib/browser/StorageController.browser.js +0 -7
  49. package/lib/browser/StorageController.default.js +0 -7
  50. package/lib/browser/StorageController.react-native.js +0 -7
  51. package/lib/browser/StorageController.weapp.js +0 -7
  52. package/lib/browser/TaskQueue.js +0 -7
  53. package/lib/browser/UniqueInstanceStateController.js +8 -15
  54. package/lib/browser/arrayContainsObject.js +2 -9
  55. package/lib/browser/canBeSerialized.js +2 -9
  56. package/lib/browser/decode.js +4 -11
  57. package/lib/browser/encode.js +8 -15
  58. package/lib/browser/equals.js +4 -13
  59. package/lib/browser/escape.js +0 -7
  60. package/lib/browser/isRevocableSession.js +2 -9
  61. package/lib/browser/parseDate.js +2 -9
  62. package/lib/browser/promiseUtils.js +4 -4
  63. package/lib/browser/unique.js +4 -11
  64. package/lib/browser/unsavedChildren.js +6 -13
  65. package/lib/browser/uuid.js +5 -1
  66. package/lib/node/Analytics.js +0 -7
  67. package/lib/node/AnonymousUtils.js +0 -7
  68. package/lib/node/Cloud.js +0 -7
  69. package/lib/node/CloudCode.js +0 -1
  70. package/lib/node/CoreManager.js +1 -8
  71. package/lib/node/EventEmitter.js +0 -7
  72. package/lib/node/FacebookUtils.js +0 -7
  73. package/lib/node/InstallationController.js +0 -7
  74. package/lib/node/LiveQueryClient.js +18 -17
  75. package/lib/node/LiveQuerySubscription.js +2 -11
  76. package/lib/node/LocalDatastore.js +0 -7
  77. package/lib/node/LocalDatastoreController.js +0 -7
  78. package/lib/node/LocalDatastoreController.react-native.js +0 -7
  79. package/lib/node/LocalDatastoreUtils.js +0 -7
  80. package/lib/node/ObjectStateMutations.js +0 -7
  81. package/lib/node/Parse.js +0 -9
  82. package/lib/node/ParseACL.js +0 -7
  83. package/lib/node/ParseCLP.js +0 -7
  84. package/lib/node/ParseConfig.js +0 -7
  85. package/lib/node/ParseError.js +0 -9
  86. package/lib/node/ParseFile.js +7 -12
  87. package/lib/node/ParseGeoPoint.js +0 -7
  88. package/lib/node/ParseInstallation.js +0 -7
  89. package/lib/node/ParseLiveQuery.js +0 -7
  90. package/lib/node/ParseObject.js +45 -34
  91. package/lib/node/ParseOp.js +0 -7
  92. package/lib/node/ParsePolygon.js +0 -7
  93. package/lib/node/ParseQuery.js +3 -18
  94. package/lib/node/ParseRelation.js +0 -7
  95. package/lib/node/ParseRole.js +0 -7
  96. package/lib/node/ParseSchema.js +0 -7
  97. package/lib/node/ParseSession.js +0 -7
  98. package/lib/node/ParseUser.js +0 -7
  99. package/lib/node/Push.js +0 -7
  100. package/lib/node/RESTController.js +0 -7
  101. package/lib/node/SingleInstanceStateController.js +0 -7
  102. package/lib/node/Storage.js +0 -7
  103. package/lib/node/StorageController.browser.js +0 -7
  104. package/lib/node/StorageController.default.js +0 -7
  105. package/lib/node/StorageController.react-native.js +0 -7
  106. package/lib/node/StorageController.weapp.js +0 -7
  107. package/lib/node/TaskQueue.js +0 -7
  108. package/lib/node/UniqueInstanceStateController.js +0 -7
  109. package/lib/node/arrayContainsObject.js +0 -7
  110. package/lib/node/canBeSerialized.js +0 -7
  111. package/lib/node/decode.js +0 -7
  112. package/lib/node/encode.js +0 -7
  113. package/lib/node/equals.js +0 -9
  114. package/lib/node/escape.js +0 -7
  115. package/lib/node/isRevocableSession.js +0 -7
  116. package/lib/node/parseDate.js +0 -7
  117. package/lib/node/unique.js +0 -7
  118. package/lib/node/unsavedChildren.js +0 -7
  119. package/lib/node/uuid.js +7 -1
  120. package/lib/react-native/CoreManager.js +2 -2
  121. package/lib/react-native/EventuallyQueue.js +169 -676
  122. package/lib/react-native/LiveQueryClient.js +16 -50
  123. package/lib/react-native/LiveQuerySubscription.js +3 -2
  124. package/lib/react-native/LocalDatastore.js +303 -863
  125. package/lib/react-native/LocalDatastoreController.js +75 -535
  126. package/lib/react-native/LocalDatastoreController.react-native.js +95 -503
  127. package/lib/react-native/ObjectStateMutations.js +2 -31
  128. package/lib/react-native/OfflineQuery.js +17 -63
  129. package/lib/react-native/ParseCLP.js +55 -129
  130. package/lib/react-native/ParseFile.js +63 -468
  131. package/lib/react-native/ParseLiveQuery.js +60 -455
  132. package/lib/react-native/ParseObject.js +263 -897
  133. package/lib/react-native/ParseQuery.js +207 -643
  134. package/lib/react-native/ParseSchema.js +3 -3
  135. package/lib/react-native/ParseUser.js +118 -573
  136. package/lib/react-native/RESTController.js +1 -29
  137. package/lib/react-native/uuid.js +5 -1
  138. package/lib/weapp/Analytics.js +4 -11
  139. package/lib/weapp/AnonymousUtils.js +2 -9
  140. package/lib/weapp/Cloud.js +4 -11
  141. package/lib/weapp/CloudCode.js +0 -1
  142. package/lib/weapp/CoreManager.js +3 -10
  143. package/lib/weapp/EventEmitter.js +0 -7
  144. package/lib/weapp/EventuallyQueue.js +282 -668
  145. package/lib/weapp/FacebookUtils.js +2 -9
  146. package/lib/weapp/InstallationController.js +0 -7
  147. package/lib/weapp/LiveQueryClient.js +35 -26
  148. package/lib/weapp/LiveQuerySubscription.js +5 -4
  149. package/lib/weapp/LocalDatastore.js +472 -864
  150. package/lib/weapp/LocalDatastoreController.js +161 -547
  151. package/lib/weapp/LocalDatastoreController.react-native.js +156 -537
  152. package/lib/weapp/LocalDatastoreUtils.js +2 -9
  153. package/lib/weapp/ObjectStateMutations.js +25 -25
  154. package/lib/weapp/OfflineQuery.js +31 -33
  155. package/lib/weapp/Parse.js +4 -13
  156. package/lib/weapp/ParseACL.js +9 -16
  157. package/lib/weapp/ParseCLP.js +46 -48
  158. package/lib/weapp/ParseConfig.js +6 -13
  159. package/lib/weapp/ParseError.js +2 -11
  160. package/lib/weapp/ParseFile.js +107 -482
  161. package/lib/weapp/ParseGeoPoint.js +4 -11
  162. package/lib/weapp/ParseHooks.js +2 -2
  163. package/lib/weapp/ParseInstallation.js +2 -2
  164. package/lib/weapp/ParseLiveQuery.js +104 -480
  165. package/lib/weapp/ParseObject.js +598 -958
  166. package/lib/weapp/ParseOp.js +11 -11
  167. package/lib/weapp/ParsePolygon.js +5 -12
  168. package/lib/weapp/ParseQuery.js +365 -758
  169. package/lib/weapp/ParseRelation.js +2 -9
  170. package/lib/weapp/ParseRole.js +2 -2
  171. package/lib/weapp/ParseSchema.js +2 -9
  172. package/lib/weapp/ParseSession.js +2 -2
  173. package/lib/weapp/ParseUser.js +221 -607
  174. package/lib/weapp/Push.js +2 -9
  175. package/lib/weapp/RESTController.js +12 -19
  176. package/lib/weapp/SingleInstanceStateController.js +4 -11
  177. package/lib/weapp/Storage.js +0 -7
  178. package/lib/weapp/StorageController.browser.js +0 -7
  179. package/lib/weapp/StorageController.default.js +0 -7
  180. package/lib/weapp/StorageController.react-native.js +0 -7
  181. package/lib/weapp/StorageController.weapp.js +0 -7
  182. package/lib/weapp/TaskQueue.js +0 -7
  183. package/lib/weapp/UniqueInstanceStateController.js +8 -15
  184. package/lib/weapp/arrayContainsObject.js +2 -9
  185. package/lib/weapp/canBeSerialized.js +2 -9
  186. package/lib/weapp/decode.js +4 -11
  187. package/lib/weapp/encode.js +8 -15
  188. package/lib/weapp/equals.js +4 -13
  189. package/lib/weapp/escape.js +0 -7
  190. package/lib/weapp/isRevocableSession.js +2 -9
  191. package/lib/weapp/parseDate.js +2 -9
  192. package/lib/weapp/promiseUtils.js +4 -4
  193. package/lib/weapp/unique.js +4 -11
  194. package/lib/weapp/unsavedChildren.js +6 -13
  195. package/lib/weapp/uuid.js +2 -0
  196. package/package.json +24 -24
  197. package/PATENTS +0 -37
@@ -9,6 +9,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
9
9
 
10
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
11
 
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
12
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
15
 
14
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -29,357 +31,6 @@ var _OfflineQuery = _interopRequireDefault(require("./OfflineQuery"));
29
31
 
30
32
  var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
31
33
 
32
- function _regeneratorRuntime() {
33
- "use strict";
34
-
35
- _regeneratorRuntime = function () {
36
- return exports;
37
- };
38
-
39
- var exports = {},
40
- Op = Object.prototype,
41
- hasOwn = Op.hasOwnProperty,
42
- $Symbol = "function" == typeof Symbol ? Symbol : {},
43
- iteratorSymbol = $Symbol.iterator || "@@iterator",
44
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
45
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
46
-
47
- function define(obj, key, value) {
48
- return Object.defineProperty(obj, key, {
49
- value: value,
50
- enumerable: !0,
51
- configurable: !0,
52
- writable: !0
53
- }), obj[key];
54
- }
55
-
56
- try {
57
- define({}, "");
58
- } catch (err) {
59
- define = function (obj, key, value) {
60
- return obj[key] = value;
61
- };
62
- }
63
-
64
- function wrap(innerFn, outerFn, self, tryLocsList) {
65
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
66
- generator = Object.create(protoGenerator.prototype),
67
- context = new Context(tryLocsList || []);
68
- return generator._invoke = function (innerFn, self, context) {
69
- var state = "suspendedStart";
70
- return function (method, arg) {
71
- if ("executing" === state) throw new Error("Generator is already running");
72
-
73
- if ("completed" === state) {
74
- if ("throw" === method) throw arg;
75
- return doneResult();
76
- }
77
-
78
- for (context.method = method, context.arg = arg;;) {
79
- var delegate = context.delegate;
80
-
81
- if (delegate) {
82
- var delegateResult = maybeInvokeDelegate(delegate, context);
83
-
84
- if (delegateResult) {
85
- if (delegateResult === ContinueSentinel) continue;
86
- return delegateResult;
87
- }
88
- }
89
-
90
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
91
- if ("suspendedStart" === state) throw state = "completed", context.arg;
92
- context.dispatchException(context.arg);
93
- } else "return" === context.method && context.abrupt("return", context.arg);
94
- state = "executing";
95
- var record = tryCatch(innerFn, self, context);
96
-
97
- if ("normal" === record.type) {
98
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
99
- return {
100
- value: record.arg,
101
- done: context.done
102
- };
103
- }
104
-
105
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
106
- }
107
- };
108
- }(innerFn, self, context), generator;
109
- }
110
-
111
- function tryCatch(fn, obj, arg) {
112
- try {
113
- return {
114
- type: "normal",
115
- arg: fn.call(obj, arg)
116
- };
117
- } catch (err) {
118
- return {
119
- type: "throw",
120
- arg: err
121
- };
122
- }
123
- }
124
-
125
- exports.wrap = wrap;
126
- var ContinueSentinel = {};
127
-
128
- function Generator() {}
129
-
130
- function GeneratorFunction() {}
131
-
132
- function GeneratorFunctionPrototype() {}
133
-
134
- var IteratorPrototype = {};
135
- define(IteratorPrototype, iteratorSymbol, function () {
136
- return this;
137
- });
138
- var getProto = Object.getPrototypeOf,
139
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
140
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
141
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
142
-
143
- function defineIteratorMethods(prototype) {
144
- ["next", "throw", "return"].forEach(function (method) {
145
- define(prototype, method, function (arg) {
146
- return this._invoke(method, arg);
147
- });
148
- });
149
- }
150
-
151
- function AsyncIterator(generator, PromiseImpl) {
152
- function invoke(method, arg, resolve, reject) {
153
- var record = tryCatch(generator[method], generator, arg);
154
-
155
- if ("throw" !== record.type) {
156
- var result = record.arg,
157
- value = result.value;
158
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
159
- invoke("next", value, resolve, reject);
160
- }, function (err) {
161
- invoke("throw", err, resolve, reject);
162
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
163
- result.value = unwrapped, resolve(result);
164
- }, function (error) {
165
- return invoke("throw", error, resolve, reject);
166
- });
167
- }
168
-
169
- reject(record.arg);
170
- }
171
-
172
- var previousPromise;
173
-
174
- this._invoke = function (method, arg) {
175
- function callInvokeWithMethodAndArg() {
176
- return new PromiseImpl(function (resolve, reject) {
177
- invoke(method, arg, resolve, reject);
178
- });
179
- }
180
-
181
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
182
- };
183
- }
184
-
185
- function maybeInvokeDelegate(delegate, context) {
186
- var method = delegate.iterator[context.method];
187
-
188
- if (undefined === method) {
189
- if (context.delegate = null, "throw" === context.method) {
190
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
191
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
192
- }
193
-
194
- return ContinueSentinel;
195
- }
196
-
197
- var record = tryCatch(method, delegate.iterator, context.arg);
198
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
199
- var info = record.arg;
200
- 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);
201
- }
202
-
203
- function pushTryEntry(locs) {
204
- var entry = {
205
- tryLoc: locs[0]
206
- };
207
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
208
- }
209
-
210
- function resetTryEntry(entry) {
211
- var record = entry.completion || {};
212
- record.type = "normal", delete record.arg, entry.completion = record;
213
- }
214
-
215
- function Context(tryLocsList) {
216
- this.tryEntries = [{
217
- tryLoc: "root"
218
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
219
- }
220
-
221
- function values(iterable) {
222
- if (iterable) {
223
- var iteratorMethod = iterable[iteratorSymbol];
224
- if (iteratorMethod) return iteratorMethod.call(iterable);
225
- if ("function" == typeof iterable.next) return iterable;
226
-
227
- if (!isNaN(iterable.length)) {
228
- var i = -1,
229
- next = function next() {
230
- for (; ++i < iterable.length;) {
231
- if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
232
- }
233
-
234
- return next.value = undefined, next.done = !0, next;
235
- };
236
-
237
- return next.next = next;
238
- }
239
- }
240
-
241
- return {
242
- next: doneResult
243
- };
244
- }
245
-
246
- function doneResult() {
247
- return {
248
- value: undefined,
249
- done: !0
250
- };
251
- }
252
-
253
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
254
- var ctor = "function" == typeof genFun && genFun.constructor;
255
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
256
- }, exports.mark = function (genFun) {
257
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
258
- }, exports.awrap = function (arg) {
259
- return {
260
- __await: arg
261
- };
262
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
263
- return this;
264
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
265
- void 0 === PromiseImpl && (PromiseImpl = Promise);
266
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
267
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
268
- return result.done ? result.value : iter.next();
269
- });
270
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
271
- return this;
272
- }), define(Gp, "toString", function () {
273
- return "[object Generator]";
274
- }), exports.keys = function (object) {
275
- var keys = [];
276
-
277
- for (var key in object) {
278
- keys.push(key);
279
- }
280
-
281
- return keys.reverse(), function next() {
282
- for (; keys.length;) {
283
- var key = keys.pop();
284
- if (key in object) return next.value = key, next.done = !1, next;
285
- }
286
-
287
- return next.done = !0, next;
288
- };
289
- }, exports.values = values, Context.prototype = {
290
- constructor: Context,
291
- reset: function (skipTempReset) {
292
- 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) {
293
- "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
294
- }
295
- },
296
- stop: function () {
297
- this.done = !0;
298
- var rootRecord = this.tryEntries[0].completion;
299
- if ("throw" === rootRecord.type) throw rootRecord.arg;
300
- return this.rval;
301
- },
302
- dispatchException: function (exception) {
303
- if (this.done) throw exception;
304
- var context = this;
305
-
306
- function handle(loc, caught) {
307
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
308
- }
309
-
310
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
311
- var entry = this.tryEntries[i],
312
- record = entry.completion;
313
- if ("root" === entry.tryLoc) return handle("end");
314
-
315
- if (entry.tryLoc <= this.prev) {
316
- var hasCatch = hasOwn.call(entry, "catchLoc"),
317
- hasFinally = hasOwn.call(entry, "finallyLoc");
318
-
319
- if (hasCatch && hasFinally) {
320
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
321
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
322
- } else if (hasCatch) {
323
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
324
- } else {
325
- if (!hasFinally) throw new Error("try statement without catch or finally");
326
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
327
- }
328
- }
329
- }
330
- },
331
- abrupt: function (type, arg) {
332
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
333
- var entry = this.tryEntries[i];
334
-
335
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
336
- var finallyEntry = entry;
337
- break;
338
- }
339
- }
340
-
341
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
342
- var record = finallyEntry ? finallyEntry.completion : {};
343
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
344
- },
345
- complete: function (record, afterLoc) {
346
- if ("throw" === record.type) throw record.arg;
347
- 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;
348
- },
349
- finish: function (finallyLoc) {
350
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
351
- var entry = this.tryEntries[i];
352
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
353
- }
354
- },
355
- catch: function (tryLoc) {
356
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
357
- var entry = this.tryEntries[i];
358
-
359
- if (entry.tryLoc === tryLoc) {
360
- var record = entry.completion;
361
-
362
- if ("throw" === record.type) {
363
- var thrown = record.arg;
364
- resetTryEntry(entry);
365
- }
366
-
367
- return thrown;
368
- }
369
- }
370
-
371
- throw new Error("illegal catch attempt");
372
- },
373
- delegateYield: function (iterable, resultName, nextLoc) {
374
- return this.delegate = {
375
- iterator: values(iterable),
376
- resultName: resultName,
377
- nextLoc: nextLoc
378
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
379
- }
380
- }, exports;
381
- }
382
-
383
34
  function quote(s) {
384
35
  return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
385
36
  }
@@ -473,7 +124,7 @@ function handleOfflineSort(a, b, sorts) {
473
124
  }
474
125
 
475
126
  if (!/^[A-Za-z][0-9A-Za-z_]*$/.test(order) || order === 'password') {
476
- throw new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, "Invalid Key: " + order);
127
+ throw new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid Key: ${order}`);
477
128
  }
478
129
 
479
130
  var field1 = a.get(order);
@@ -581,101 +232,91 @@ var ParseQuery = function () {
581
232
  }
582
233
  }, {
583
234
  key: "_handleOfflineQuery",
584
- value: function (params) {
585
- var _this2 = this;
586
-
587
- var localDatastore, objects, results, keys, alwaysSelectedKeys, sorts, count, limit;
588
- return _regeneratorRuntime().async(function (_context) {
589
- while (1) {
590
- switch (_context.prev = _context.next) {
591
- case 0:
592
- _OfflineQuery.default.validateQuery(this);
593
-
594
- localDatastore = _CoreManager.default.getLocalDatastore();
595
- _context.next = 4;
596
- return _regeneratorRuntime().awrap(localDatastore._serializeObjectsFromPinName(this._localDatastorePinName));
597
-
598
- case 4:
599
- objects = _context.sent;
600
- results = objects.map(function (json, index, arr) {
601
- var object = _ParseObject.default.fromJSON(json, false);
602
-
603
- if (json._localId && !json.objectId) {
604
- object._localId = json._localId;
605
- }
606
-
607
- if (!_OfflineQuery.default.matchesQuery(_this2.className, object, arr, _this2)) {
608
- return null;
609
- }
610
-
611
- return object;
612
- }).filter(function (object) {
613
- return object !== null;
614
- });
615
-
616
- if (params.keys) {
617
- keys = params.keys.split(',');
618
- alwaysSelectedKeys = ['className', 'objectId', 'createdAt', 'updatedAt', 'ACL'];
619
- keys = keys.concat(alwaysSelectedKeys);
620
- results = results.map(function (object) {
621
- var json = object._toFullJSON();
622
-
623
- Object.keys(json).forEach(function (key) {
624
- if (!keys.includes(key)) {
625
- delete json[key];
626
- }
627
- });
628
- return _ParseObject.default.fromJSON(json, false);
629
- });
630
- }
235
+ value: function () {
236
+ var _handleOfflineQuery2 = (0, _asyncToGenerator2.default)(function* (params) {
237
+ var _this2 = this;
631
238
 
632
- if (params.order) {
633
- sorts = params.order.split(',');
634
- results.sort(function (a, b) {
635
- return handleOfflineSort(a, b, sorts);
636
- });
637
- }
239
+ _OfflineQuery.default.validateQuery(this);
638
240
 
639
- if (params.count) {
640
- count = results.length;
641
- }
241
+ var localDatastore = _CoreManager.default.getLocalDatastore();
642
242
 
643
- if (params.skip) {
644
- if (params.skip >= results.length) {
645
- results = [];
646
- } else {
647
- results = results.splice(params.skip, results.length);
648
- }
649
- }
243
+ var objects = yield localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
244
+ var results = objects.map(function (json, index, arr) {
245
+ var object = _ParseObject.default.fromJSON(json, false);
650
246
 
651
- limit = results.length;
247
+ if (json._localId && !json.objectId) {
248
+ object._localId = json._localId;
249
+ }
652
250
 
653
- if (params.limit !== 0 && params.limit < results.length) {
654
- limit = params.limit;
655
- }
251
+ if (!_OfflineQuery.default.matchesQuery(_this2.className, object, arr, _this2)) {
252
+ return null;
253
+ }
656
254
 
657
- results = results.splice(0, limit);
255
+ return object;
256
+ }).filter(function (object) {
257
+ return object !== null;
258
+ });
259
+
260
+ if (params.keys) {
261
+ var keys = params.keys.split(',');
262
+ keys = keys.concat(['className', 'objectId', 'createdAt', 'updatedAt', 'ACL']);
263
+ results = results.map(function (object) {
264
+ var json = object._toFullJSON();
658
265
 
659
- if (!(typeof count === 'number')) {
660
- _context.next = 15;
661
- break;
266
+ Object.keys(json).forEach(function (key) {
267
+ if (!keys.includes(key)) {
268
+ delete json[key];
662
269
  }
270
+ });
271
+ return _ParseObject.default.fromJSON(json, false);
272
+ });
273
+ }
274
+
275
+ if (params.order) {
276
+ var sorts = params.order.split(',');
277
+ results.sort(function (a, b) {
278
+ return handleOfflineSort(a, b, sorts);
279
+ });
280
+ }
663
281
 
664
- return _context.abrupt("return", {
665
- results: results,
666
- count: count
667
- });
282
+ var count;
668
283
 
669
- case 15:
670
- return _context.abrupt("return", results);
284
+ if (params.count) {
285
+ count = results.length;
286
+ }
671
287
 
672
- case 16:
673
- case "end":
674
- return _context.stop();
288
+ if (params.skip) {
289
+ if (params.skip >= results.length) {
290
+ results = [];
291
+ } else {
292
+ results = results.splice(params.skip, results.length);
675
293
  }
676
294
  }
677
- }, null, this, null, Promise);
678
- }
295
+
296
+ var limit = results.length;
297
+
298
+ if (params.limit !== 0 && params.limit < results.length) {
299
+ limit = params.limit;
300
+ }
301
+
302
+ results = results.splice(0, limit);
303
+
304
+ if (typeof count === 'number') {
305
+ return {
306
+ results: results,
307
+ count: count
308
+ };
309
+ }
310
+
311
+ return results;
312
+ });
313
+
314
+ function _handleOfflineQuery() {
315
+ return _handleOfflineQuery2.apply(this, arguments);
316
+ }
317
+
318
+ return _handleOfflineQuery;
319
+ }()
679
320
  }, {
680
321
  key: "toJSON",
681
322
  value: function () {
@@ -899,28 +540,21 @@ var ParseQuery = function () {
899
540
  }
900
541
  }, {
901
542
  key: "findAll",
902
- value: function (options) {
903
- var result;
904
- return _regeneratorRuntime().async(function (_context2) {
905
- while (1) {
906
- switch (_context2.prev = _context2.next) {
907
- case 0:
908
- result = [];
909
- _context2.next = 3;
910
- return _regeneratorRuntime().awrap(this.eachBatch(function (objects) {
911
- result = [].concat((0, _toConsumableArray2.default)(result), (0, _toConsumableArray2.default)(objects));
912
- }, options));
913
-
914
- case 3:
915
- return _context2.abrupt("return", result);
916
-
917
- case 4:
918
- case "end":
919
- return _context2.stop();
920
- }
921
- }
922
- }, null, this, null, Promise);
923
- }
543
+ value: function () {
544
+ var _findAll = (0, _asyncToGenerator2.default)(function* (options) {
545
+ var result = [];
546
+ yield this.eachBatch(function (objects) {
547
+ result = [].concat((0, _toConsumableArray2.default)(result), (0, _toConsumableArray2.default)(objects));
548
+ }, options);
549
+ return result;
550
+ });
551
+
552
+ function findAll() {
553
+ return _findAll.apply(this, arguments);
554
+ }
555
+
556
+ return findAll;
557
+ }()
924
558
  }, {
925
559
  key: "count",
926
560
  value: function (options) {
@@ -1135,55 +769,21 @@ var ParseQuery = function () {
1135
769
  var previousResults = [];
1136
770
  return (0, _promiseUtils.continueWhile)(function () {
1137
771
  return !finished;
1138
- }, function () {
1139
- var _await$Promise$all, _await$Promise$all2, results;
1140
-
1141
- return _regeneratorRuntime().async(function (_context3) {
1142
- while (1) {
1143
- switch (_context3.prev = _context3.next) {
1144
- case 0:
1145
- _context3.next = 2;
1146
- return _regeneratorRuntime().awrap(Promise.all([query.find(findOptions), Promise.resolve(previousResults.length > 0 && callback(previousResults))]));
1147
-
1148
- case 2:
1149
- _await$Promise$all = _context3.sent;
1150
- _await$Promise$all2 = (0, _slicedToArray2.default)(_await$Promise$all, 1);
1151
- results = _await$Promise$all2[0];
1152
-
1153
- if (!(results.length >= query._limit)) {
1154
- _context3.next = 10;
1155
- break;
1156
- }
1157
-
1158
- query.greaterThan('objectId', results[results.length - 1].id);
1159
- previousResults = results;
1160
- _context3.next = 17;
1161
- break;
1162
-
1163
- case 10:
1164
- if (!(results.length > 0)) {
1165
- _context3.next = 16;
1166
- break;
1167
- }
1168
-
1169
- _context3.next = 13;
1170
- return _regeneratorRuntime().awrap(Promise.resolve(callback(results)));
1171
-
1172
- case 13:
1173
- finished = true;
1174
- _context3.next = 17;
1175
- break;
1176
-
1177
- case 16:
1178
- finished = true;
1179
-
1180
- case 17:
1181
- case "end":
1182
- return _context3.stop();
1183
- }
1184
- }
1185
- }, null, null, null, Promise);
1186
- });
772
+ }, (0, _asyncToGenerator2.default)(function* () {
773
+ var _yield$Promise$all = yield Promise.all([query.find(findOptions), Promise.resolve(previousResults.length > 0 && callback(previousResults))]),
774
+ _yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 1),
775
+ results = _yield$Promise$all2[0];
776
+
777
+ if (results.length >= query._limit) {
778
+ query.greaterThan('objectId', results[results.length - 1].id);
779
+ previousResults = results;
780
+ } else if (results.length > 0) {
781
+ yield Promise.resolve(callback(results));
782
+ finished = true;
783
+ } else {
784
+ finished = true;
785
+ }
786
+ }));
1187
787
  }
1188
788
  }, {
1189
789
  key: "each",
@@ -1222,119 +822,95 @@ var ParseQuery = function () {
1222
822
  }
1223
823
  }, {
1224
824
  key: "map",
1225
- value: function (callback, options) {
1226
- var _this5 = this;
1227
-
1228
- var array, index;
1229
- return _regeneratorRuntime().async(function (_context4) {
1230
- while (1) {
1231
- switch (_context4.prev = _context4.next) {
1232
- case 0:
1233
- array = [];
1234
- index = 0;
1235
- _context4.next = 4;
1236
- return _regeneratorRuntime().awrap(this.each(function (object) {
1237
- return Promise.resolve(callback(object, index, _this5)).then(function (result) {
1238
- array.push(result);
1239
- index += 1;
1240
- });
1241
- }, options));
1242
-
1243
- case 4:
1244
- return _context4.abrupt("return", array);
1245
-
1246
- case 5:
1247
- case "end":
1248
- return _context4.stop();
1249
- }
1250
- }
1251
- }, null, this, null, Promise);
1252
- }
825
+ value: function () {
826
+ var _map = (0, _asyncToGenerator2.default)(function* (callback, options) {
827
+ var _this5 = this;
828
+
829
+ var array = [];
830
+ var index = 0;
831
+ yield this.each(function (object) {
832
+ return Promise.resolve(callback(object, index, _this5)).then(function (result) {
833
+ array.push(result);
834
+ index += 1;
835
+ });
836
+ }, options);
837
+ return array;
838
+ });
839
+
840
+ function map() {
841
+ return _map.apply(this, arguments);
842
+ }
843
+
844
+ return map;
845
+ }()
1253
846
  }, {
1254
847
  key: "reduce",
1255
- value: function (callback, initialValue, options) {
1256
- var accumulator, index;
1257
- return _regeneratorRuntime().async(function (_context5) {
1258
- while (1) {
1259
- switch (_context5.prev = _context5.next) {
1260
- case 0:
1261
- accumulator = initialValue;
1262
- index = 0;
1263
- _context5.next = 4;
1264
- return _regeneratorRuntime().awrap(this.each(function (object) {
1265
- if (index === 0 && initialValue === undefined) {
1266
- accumulator = object;
1267
- index += 1;
1268
- return;
1269
- }
1270
-
1271
- return Promise.resolve(callback(accumulator, object, index)).then(function (result) {
1272
- accumulator = result;
1273
- index += 1;
1274
- });
1275
- }, options));
1276
-
1277
- case 4:
1278
- if (!(index === 0 && initialValue === undefined)) {
1279
- _context5.next = 6;
1280
- break;
1281
- }
1282
-
1283
- throw new TypeError('Reducing empty query result set with no initial value');
848
+ value: function () {
849
+ var _reduce = (0, _asyncToGenerator2.default)(function* (callback, initialValue, options) {
850
+ var accumulator = initialValue;
851
+ var index = 0;
852
+ yield this.each(function (object) {
853
+ if (index === 0 && initialValue === undefined) {
854
+ accumulator = object;
855
+ index += 1;
856
+ return;
857
+ }
1284
858
 
1285
- case 6:
1286
- return _context5.abrupt("return", accumulator);
859
+ return Promise.resolve(callback(accumulator, object, index)).then(function (result) {
860
+ accumulator = result;
861
+ index += 1;
862
+ });
863
+ }, options);
1287
864
 
1288
- case 7:
1289
- case "end":
1290
- return _context5.stop();
1291
- }
865
+ if (index === 0 && initialValue === undefined) {
866
+ throw new TypeError('Reducing empty query result set with no initial value');
1292
867
  }
1293
- }, null, this, null, Promise);
1294
- }
868
+
869
+ return accumulator;
870
+ });
871
+
872
+ function reduce() {
873
+ return _reduce.apply(this, arguments);
874
+ }
875
+
876
+ return reduce;
877
+ }()
1295
878
  }, {
1296
879
  key: "filter",
1297
- value: function (callback, options) {
1298
- var _this6 = this;
1299
-
1300
- var array, index;
1301
- return _regeneratorRuntime().async(function (_context6) {
1302
- while (1) {
1303
- switch (_context6.prev = _context6.next) {
1304
- case 0:
1305
- array = [];
1306
- index = 0;
1307
- _context6.next = 4;
1308
- return _regeneratorRuntime().awrap(this.each(function (object) {
1309
- return Promise.resolve(callback(object, index, _this6)).then(function (flag) {
1310
- if (flag) {
1311
- array.push(object);
1312
- }
1313
-
1314
- index += 1;
1315
- });
1316
- }, options));
1317
-
1318
- case 4:
1319
- return _context6.abrupt("return", array);
1320
-
1321
- case 5:
1322
- case "end":
1323
- return _context6.stop();
1324
- }
1325
- }
1326
- }, null, this, null, Promise);
1327
- }
880
+ value: function () {
881
+ var _filter = (0, _asyncToGenerator2.default)(function* (callback, options) {
882
+ var _this6 = this;
883
+
884
+ var array = [];
885
+ var index = 0;
886
+ yield this.each(function (object) {
887
+ return Promise.resolve(callback(object, index, _this6)).then(function (flag) {
888
+ if (flag) {
889
+ array.push(object);
890
+ }
891
+
892
+ index += 1;
893
+ });
894
+ }, options);
895
+ return array;
896
+ });
897
+
898
+ function filter() {
899
+ return _filter.apply(this, arguments);
900
+ }
901
+
902
+ return filter;
903
+ }()
1328
904
  }, {
1329
905
  key: "equalTo",
1330
906
  value: function (key, value) {
1331
907
  var _this7 = this;
1332
908
 
1333
909
  if (key && typeof key === 'object') {
1334
- Object.entries(key).forEach(function (_ref) {
1335
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1336
- k = _ref2[0],
1337
- val = _ref2[1];
910
+ Object.entries(key).forEach(function (_ref2) {
911
+ var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
912
+ k = _ref3[0],
913
+ val = _ref3[1];
1338
914
 
1339
915
  return _this7.equalTo(k, val);
1340
916
  });
@@ -1354,10 +930,10 @@ var ParseQuery = function () {
1354
930
  var _this8 = this;
1355
931
 
1356
932
  if (key && typeof key === 'object') {
1357
- Object.entries(key).forEach(function (_ref3) {
1358
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
1359
- k = _ref4[0],
1360
- val = _ref4[1];
933
+ Object.entries(key).forEach(function (_ref4) {
934
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
935
+ k = _ref5[0],
936
+ val = _ref5[1];
1361
937
 
1362
938
  return _this8.notEqualTo(k, val);
1363
939
  });
@@ -1533,7 +1109,7 @@ var ParseQuery = function () {
1533
1109
  break;
1534
1110
 
1535
1111
  default:
1536
- throw new Error("Unknown option: " + option);
1112
+ throw new Error(`Unknown option: ${option}`);
1537
1113
  }
1538
1114
  }
1539
1115
 
@@ -1801,44 +1377,32 @@ var ParseQuery = function () {
1801
1377
  }
1802
1378
  }, {
1803
1379
  key: "subscribe",
1804
- value: function (sessionToken) {
1805
- var currentUser, liveQueryClient, subscription;
1806
- return _regeneratorRuntime().async(function (_context7) {
1807
- while (1) {
1808
- switch (_context7.prev = _context7.next) {
1809
- case 0:
1810
- _context7.next = 2;
1811
- return _regeneratorRuntime().awrap(_CoreManager.default.getUserController().currentUserAsync());
1812
-
1813
- case 2:
1814
- currentUser = _context7.sent;
1815
-
1816
- if (!sessionToken) {
1817
- sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
1818
- }
1380
+ value: function () {
1381
+ var _subscribe = (0, _asyncToGenerator2.default)(function* (sessionToken) {
1382
+ var currentUser = yield _CoreManager.default.getUserController().currentUserAsync();
1819
1383
 
1820
- _context7.next = 6;
1821
- return _regeneratorRuntime().awrap(_CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient());
1384
+ if (!sessionToken) {
1385
+ sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
1386
+ }
1822
1387
 
1823
- case 6:
1824
- liveQueryClient = _context7.sent;
1388
+ var liveQueryClient = yield _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
1825
1389
 
1826
- if (liveQueryClient.shouldOpen()) {
1827
- liveQueryClient.open();
1828
- }
1390
+ if (liveQueryClient.shouldOpen()) {
1391
+ liveQueryClient.open();
1392
+ }
1829
1393
 
1830
- subscription = liveQueryClient.subscribe(this, sessionToken);
1831
- return _context7.abrupt("return", subscription.subscribePromise.then(function () {
1832
- return subscription;
1833
- }));
1394
+ var subscription = liveQueryClient.subscribe(this, sessionToken);
1395
+ return subscription.subscribePromise.then(function () {
1396
+ return subscription;
1397
+ });
1398
+ });
1834
1399
 
1835
- case 10:
1836
- case "end":
1837
- return _context7.stop();
1838
- }
1839
- }
1840
- }, null, this, null, Promise);
1841
- }
1400
+ function subscribe() {
1401
+ return _subscribe.apply(this, arguments);
1402
+ }
1403
+
1404
+ return subscribe;
1405
+ }()
1842
1406
  }, {
1843
1407
  key: "fromNetwork",
1844
1408
  value: function () {