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.
- package/dist/parse.js +5732 -2377
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +5730 -2375
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +395 -29
- package/lib/browser/LiveQueryClient.js +2 -6
- package/lib/browser/LocalDatastore.js +392 -18
- package/lib/browser/LocalDatastoreController.js +391 -21
- package/lib/browser/LocalDatastoreController.react-native.js +387 -23
- package/lib/browser/OfflineQuery.js +29 -8
- package/lib/browser/ParseFile.js +388 -22
- package/lib/browser/ParseLiveQuery.js +381 -18
- package/lib/browser/ParseObject.js +405 -41
- package/lib/browser/ParseOp.js +1 -3
- package/lib/browser/ParseQuery.js +396 -47
- package/lib/browser/ParseUser.js +388 -14
- package/lib/browser/StorageController.react-native.js +6 -18
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/OfflineQuery.js +18 -3
- package/lib/node/ParseObject.js +6 -6
- package/lib/node/ParseQuery.js +1 -3
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/EventuallyQueue.js +376 -27
- package/lib/react-native/LiveQueryClient.js +2 -6
- package/lib/react-native/LocalDatastore.js +374 -26
- package/lib/react-native/LocalDatastoreController.js +365 -16
- package/lib/react-native/LocalDatastoreController.react-native.js +363 -14
- package/lib/react-native/OfflineQuery.js +28 -7
- package/lib/react-native/ParseFile.js +359 -16
- package/lib/react-native/ParseLiveQuery.js +357 -8
- package/lib/react-native/ParseObject.js +385 -38
- package/lib/react-native/ParseOp.js +1 -3
- package/lib/react-native/ParseQuery.js +374 -39
- package/lib/react-native/ParseUser.js +368 -19
- package/lib/react-native/StorageController.react-native.js +6 -18
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +395 -29
- package/lib/weapp/LiveQueryClient.js +2 -6
- package/lib/weapp/LocalDatastore.js +392 -18
- package/lib/weapp/LocalDatastoreController.js +391 -21
- package/lib/weapp/LocalDatastoreController.react-native.js +387 -23
- package/lib/weapp/OfflineQuery.js +29 -8
- package/lib/weapp/ParseFile.js +388 -22
- package/lib/weapp/ParseLiveQuery.js +381 -18
- package/lib/weapp/ParseObject.js +405 -41
- package/lib/weapp/ParseOp.js +1 -3
- package/lib/weapp/ParseQuery.js +396 -47
- package/lib/weapp/ParseUser.js +388 -14
- package/lib/weapp/StorageController.react-native.js +6 -18
- package/package.json +1 -1
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
6
|
+
|
|
7
|
+
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
8
|
+
|
|
9
|
+
var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
10
|
+
|
|
11
|
+
var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
|
|
12
|
+
|
|
13
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
14
|
+
|
|
15
|
+
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16
|
+
|
|
17
|
+
var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
|
|
18
|
+
|
|
19
|
+
var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
|
|
20
|
+
|
|
21
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
22
|
+
|
|
23
|
+
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
|
24
|
+
|
|
5
25
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
6
26
|
|
|
7
27
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
@@ -10,23 +30,367 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
10
30
|
|
|
11
31
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
12
32
|
|
|
13
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
14
|
-
|
|
15
33
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
16
34
|
|
|
17
35
|
var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) 2015-present, Parse, LLC.
|
|
20
|
-
* All rights reserved.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the BSD-style license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
24
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
25
|
-
*
|
|
26
|
-
* @flow
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
36
|
|
|
37
|
+
function _regeneratorRuntime() {
|
|
38
|
+
"use strict";
|
|
39
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
40
|
+
|
|
41
|
+
_regeneratorRuntime = function () {
|
|
42
|
+
return exports;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var exports = {},
|
|
46
|
+
Op = Object.prototype,
|
|
47
|
+
hasOwn = Op.hasOwnProperty,
|
|
48
|
+
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
49
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
50
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
51
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
52
|
+
|
|
53
|
+
function define(obj, key, value) {
|
|
54
|
+
return _Object$defineProperty(obj, key, {
|
|
55
|
+
value: value,
|
|
56
|
+
enumerable: !0,
|
|
57
|
+
configurable: !0,
|
|
58
|
+
writable: !0
|
|
59
|
+
}), obj[key];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
define({}, "");
|
|
64
|
+
} catch (err) {
|
|
65
|
+
define = function (obj, key, value) {
|
|
66
|
+
return obj[key] = value;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
71
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
72
|
+
generator = _Object$create(protoGenerator.prototype),
|
|
73
|
+
context = new Context(tryLocsList || []);
|
|
74
|
+
|
|
75
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
76
|
+
var state = "suspendedStart";
|
|
77
|
+
return function (method, arg) {
|
|
78
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
79
|
+
|
|
80
|
+
if ("completed" === state) {
|
|
81
|
+
if ("throw" === method) throw arg;
|
|
82
|
+
return doneResult();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
for (context.method = method, context.arg = arg;;) {
|
|
86
|
+
var delegate = context.delegate;
|
|
87
|
+
|
|
88
|
+
if (delegate) {
|
|
89
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
90
|
+
|
|
91
|
+
if (delegateResult) {
|
|
92
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
93
|
+
return delegateResult;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
98
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
99
|
+
context.dispatchException(context.arg);
|
|
100
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
101
|
+
state = "executing";
|
|
102
|
+
var record = tryCatch(innerFn, self, context);
|
|
103
|
+
|
|
104
|
+
if ("normal" === record.type) {
|
|
105
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
106
|
+
return {
|
|
107
|
+
value: record.arg,
|
|
108
|
+
done: context.done
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}(innerFn, self, context), generator;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function tryCatch(fn, obj, arg) {
|
|
119
|
+
try {
|
|
120
|
+
return {
|
|
121
|
+
type: "normal",
|
|
122
|
+
arg: fn.call(obj, arg)
|
|
123
|
+
};
|
|
124
|
+
} catch (err) {
|
|
125
|
+
return {
|
|
126
|
+
type: "throw",
|
|
127
|
+
arg: err
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
exports.wrap = wrap;
|
|
133
|
+
var ContinueSentinel = {};
|
|
134
|
+
|
|
135
|
+
function Generator() {}
|
|
136
|
+
|
|
137
|
+
function GeneratorFunction() {}
|
|
138
|
+
|
|
139
|
+
function GeneratorFunctionPrototype() {}
|
|
140
|
+
|
|
141
|
+
var IteratorPrototype = {};
|
|
142
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
143
|
+
return this;
|
|
144
|
+
});
|
|
145
|
+
var getProto = _Object$getPrototypeOf,
|
|
146
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
147
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
148
|
+
|
|
149
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
150
|
+
|
|
151
|
+
function defineIteratorMethods(prototype) {
|
|
152
|
+
var _context6;
|
|
153
|
+
|
|
154
|
+
_forEachInstanceProperty2(_context6 = ["next", "throw", "return"]).call(_context6, function (method) {
|
|
155
|
+
define(prototype, method, function (arg) {
|
|
156
|
+
return this._invoke(method, arg);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
162
|
+
function invoke(method, arg, resolve, reject) {
|
|
163
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
164
|
+
|
|
165
|
+
if ("throw" !== record.type) {
|
|
166
|
+
var result = record.arg,
|
|
167
|
+
value = result.value;
|
|
168
|
+
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
169
|
+
invoke("next", value, resolve, reject);
|
|
170
|
+
}, function (err) {
|
|
171
|
+
invoke("throw", err, resolve, reject);
|
|
172
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
173
|
+
result.value = unwrapped, resolve(result);
|
|
174
|
+
}, function (error) {
|
|
175
|
+
return invoke("throw", error, resolve, reject);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
reject(record.arg);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var previousPromise;
|
|
183
|
+
|
|
184
|
+
this._invoke = function (method, arg) {
|
|
185
|
+
function callInvokeWithMethodAndArg() {
|
|
186
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
187
|
+
invoke(method, arg, resolve, reject);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
196
|
+
var method = delegate.iterator[context.method];
|
|
197
|
+
|
|
198
|
+
if (undefined === method) {
|
|
199
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
200
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
201
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return ContinueSentinel;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
208
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
209
|
+
var info = record.arg;
|
|
210
|
+
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);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function pushTryEntry(locs) {
|
|
214
|
+
var entry = {
|
|
215
|
+
tryLoc: locs[0]
|
|
216
|
+
};
|
|
217
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function resetTryEntry(entry) {
|
|
221
|
+
var record = entry.completion || {};
|
|
222
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function Context(tryLocsList) {
|
|
226
|
+
this.tryEntries = [{
|
|
227
|
+
tryLoc: "root"
|
|
228
|
+
}], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function values(iterable) {
|
|
232
|
+
if (iterable) {
|
|
233
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
234
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
235
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
236
|
+
|
|
237
|
+
if (!isNaN(iterable.length)) {
|
|
238
|
+
var i = -1,
|
|
239
|
+
next = function next() {
|
|
240
|
+
for (; ++i < iterable.length;) {
|
|
241
|
+
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return next.value = undefined, next.done = !0, next;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
return next.next = next;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return {
|
|
252
|
+
next: doneResult
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function doneResult() {
|
|
257
|
+
return {
|
|
258
|
+
value: undefined,
|
|
259
|
+
done: !0
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
264
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
265
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
266
|
+
}, exports.mark = function (genFun) {
|
|
267
|
+
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
268
|
+
}, exports.awrap = function (arg) {
|
|
269
|
+
return {
|
|
270
|
+
__await: arg
|
|
271
|
+
};
|
|
272
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
273
|
+
return this;
|
|
274
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
275
|
+
void 0 === PromiseImpl && (PromiseImpl = _Promise);
|
|
276
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
277
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
278
|
+
return result.done ? result.value : iter.next();
|
|
279
|
+
});
|
|
280
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
281
|
+
return this;
|
|
282
|
+
}), define(Gp, "toString", function () {
|
|
283
|
+
return "[object Generator]";
|
|
284
|
+
}), exports.keys = function (object) {
|
|
285
|
+
var keys = [];
|
|
286
|
+
|
|
287
|
+
for (var key in object) {
|
|
288
|
+
keys.push(key);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
292
|
+
for (; keys.length;) {
|
|
293
|
+
var key = keys.pop();
|
|
294
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return next.done = !0, next;
|
|
298
|
+
};
|
|
299
|
+
}, exports.values = values, Context.prototype = {
|
|
300
|
+
constructor: Context,
|
|
301
|
+
reset: function (skipTempReset) {
|
|
302
|
+
var _context7;
|
|
303
|
+
|
|
304
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context7 = this.tryEntries).call(_context7, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
305
|
+
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
stop: function () {
|
|
309
|
+
this.done = !0;
|
|
310
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
311
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
312
|
+
return this.rval;
|
|
313
|
+
},
|
|
314
|
+
dispatchException: function (exception) {
|
|
315
|
+
if (this.done) throw exception;
|
|
316
|
+
var context = this;
|
|
317
|
+
|
|
318
|
+
function handle(loc, caught) {
|
|
319
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
323
|
+
var entry = this.tryEntries[i],
|
|
324
|
+
record = entry.completion;
|
|
325
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
326
|
+
|
|
327
|
+
if (entry.tryLoc <= this.prev) {
|
|
328
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
329
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
330
|
+
|
|
331
|
+
if (hasCatch && hasFinally) {
|
|
332
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
333
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
334
|
+
} else if (hasCatch) {
|
|
335
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
336
|
+
} else {
|
|
337
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
338
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
abrupt: function (type, arg) {
|
|
344
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
345
|
+
var entry = this.tryEntries[i];
|
|
346
|
+
|
|
347
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
348
|
+
var finallyEntry = entry;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
354
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
355
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
356
|
+
},
|
|
357
|
+
complete: function (record, afterLoc) {
|
|
358
|
+
if ("throw" === record.type) throw record.arg;
|
|
359
|
+
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;
|
|
360
|
+
},
|
|
361
|
+
finish: function (finallyLoc) {
|
|
362
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
363
|
+
var entry = this.tryEntries[i];
|
|
364
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
catch: function (tryLoc) {
|
|
368
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
369
|
+
var entry = this.tryEntries[i];
|
|
370
|
+
|
|
371
|
+
if (entry.tryLoc === tryLoc) {
|
|
372
|
+
var record = entry.completion;
|
|
373
|
+
|
|
374
|
+
if ("throw" === record.type) {
|
|
375
|
+
var thrown = record.arg;
|
|
376
|
+
resetTryEntry(entry);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return thrown;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
throw new Error("illegal catch attempt");
|
|
384
|
+
},
|
|
385
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
386
|
+
return this.delegate = {
|
|
387
|
+
iterator: values(iterable),
|
|
388
|
+
resultName: resultName,
|
|
389
|
+
nextLoc: nextLoc
|
|
390
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
391
|
+
}
|
|
392
|
+
}, exports;
|
|
393
|
+
}
|
|
30
394
|
|
|
31
395
|
var RNStorage = require('./StorageController.react-native');
|
|
32
396
|
|
|
@@ -36,9 +400,9 @@ var LocalDatastoreController = {
|
|
|
36
400
|
)
|
|
37
401
|
/*: Promise<Array<Object>>*/
|
|
38
402
|
{
|
|
39
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
403
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
40
404
|
var values, objects;
|
|
41
|
-
return
|
|
405
|
+
return _regeneratorRuntime().wrap(function (_context) {
|
|
42
406
|
while (1) {
|
|
43
407
|
switch (_context.prev = _context.next) {
|
|
44
408
|
case 0:
|
|
@@ -74,9 +438,9 @@ var LocalDatastoreController = {
|
|
|
74
438
|
)
|
|
75
439
|
/*: Promise<void>*/
|
|
76
440
|
{
|
|
77
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
441
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
78
442
|
var values;
|
|
79
|
-
return
|
|
443
|
+
return _regeneratorRuntime().wrap(function (_context2) {
|
|
80
444
|
while (1) {
|
|
81
445
|
switch (_context2.prev = _context2.next) {
|
|
82
446
|
case 0:
|
|
@@ -113,9 +477,9 @@ var LocalDatastoreController = {
|
|
|
113
477
|
getAllContents: function ()
|
|
114
478
|
/*: Promise<Object>*/
|
|
115
479
|
{
|
|
116
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
480
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
117
481
|
var keys, batch, i, key, LDS, results;
|
|
118
|
-
return
|
|
482
|
+
return _regeneratorRuntime().wrap(function (_context3) {
|
|
119
483
|
while (1) {
|
|
120
484
|
switch (_context3.prev = _context3.next) {
|
|
121
485
|
case 0:
|
|
@@ -177,9 +541,9 @@ var LocalDatastoreController = {
|
|
|
177
541
|
getRawStorage: function ()
|
|
178
542
|
/*: Promise<Object>*/
|
|
179
543
|
{
|
|
180
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
544
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
181
545
|
var keys, storage, results;
|
|
182
|
-
return
|
|
546
|
+
return _regeneratorRuntime().wrap(function (_context4) {
|
|
183
547
|
while (1) {
|
|
184
548
|
switch (_context4.prev = _context4.next) {
|
|
185
549
|
case 0:
|
|
@@ -214,9 +578,9 @@ var LocalDatastoreController = {
|
|
|
214
578
|
clear: function ()
|
|
215
579
|
/*: Promise<void>*/
|
|
216
580
|
{
|
|
217
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
581
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
218
582
|
var keys, batch, i, key;
|
|
219
|
-
return
|
|
583
|
+
return _regeneratorRuntime().wrap(function (_context5) {
|
|
220
584
|
while (1) {
|
|
221
585
|
switch (_context5.prev = _context5.next) {
|
|
222
586
|
case 0:
|
|
@@ -729,21 +729,42 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
729
729
|
|
|
730
730
|
case '$geoWithin':
|
|
731
731
|
{
|
|
732
|
-
|
|
732
|
+
if (compareTo.$polygon) {
|
|
733
|
+
var _context4;
|
|
734
|
+
|
|
735
|
+
var points = (0, _map.default)(_context4 = compareTo.$polygon).call(_context4, function (geoPoint) {
|
|
736
|
+
return [geoPoint.latitude, geoPoint.longitude];
|
|
737
|
+
});
|
|
738
|
+
var polygon = new ParsePolygon(points);
|
|
739
|
+
return polygon.containsPoint(object[key]);
|
|
740
|
+
}
|
|
733
741
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
742
|
+
if (compareTo.$centerSphere) {
|
|
743
|
+
var _compareTo$$centerSph = (0, _slicedToArray2.default)(compareTo.$centerSphere, 2),
|
|
744
|
+
WGS84Point = _compareTo$$centerSph[0],
|
|
745
|
+
maxDistance = _compareTo$$centerSph[1];
|
|
746
|
+
|
|
747
|
+
var centerPoint = new ParseGeoPoint({
|
|
748
|
+
latitude: WGS84Point[1],
|
|
749
|
+
longitude: WGS84Point[0]
|
|
750
|
+
});
|
|
751
|
+
var point = new ParseGeoPoint(object[key]);
|
|
752
|
+
|
|
753
|
+
var _distance = point.radiansTo(centerPoint);
|
|
754
|
+
|
|
755
|
+
return _distance <= maxDistance;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
break;
|
|
739
759
|
}
|
|
740
760
|
|
|
741
761
|
case '$geoIntersects':
|
|
742
762
|
{
|
|
743
763
|
var _polygon = new ParsePolygon(object[key].coordinates);
|
|
744
764
|
|
|
745
|
-
var
|
|
746
|
-
|
|
765
|
+
var _point = new ParseGeoPoint(compareTo.$point);
|
|
766
|
+
|
|
767
|
+
return _polygon.containsPoint(_point);
|
|
747
768
|
}
|
|
748
769
|
|
|
749
770
|
default:
|