parse 4.0.0-beta.1 → 4.0.1-beta.1
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/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +1 -3
- package/dist/parse.js +188 -374
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +188 -374
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +0 -7
- package/lib/browser/AnonymousUtils.js +0 -7
- package/lib/browser/Cloud.js +0 -7
- package/lib/browser/CoreManager.js +1 -8
- package/lib/browser/EventEmitter.js +0 -7
- package/lib/browser/FacebookUtils.js +0 -7
- package/lib/browser/InstallationController.js +0 -7
- package/lib/browser/LocalDatastoreUtils.js +0 -7
- package/lib/browser/OfflineQuery.js +27 -8
- package/lib/browser/Parse.js +0 -9
- package/lib/browser/ParseACL.js +0 -7
- package/lib/browser/ParseConfig.js +0 -7
- package/lib/browser/ParseError.js +0 -9
- package/lib/browser/ParseGeoPoint.js +0 -7
- package/lib/browser/ParseObject.js +158 -126
- package/lib/browser/ParsePolygon.js +0 -7
- package/lib/browser/ParseRelation.js +0 -7
- package/lib/browser/ParseSchema.js +0 -7
- package/lib/browser/Push.js +0 -7
- package/lib/browser/RESTController.js +0 -7
- package/lib/browser/SingleInstanceStateController.js +0 -7
- package/lib/browser/Storage.js +0 -7
- package/lib/browser/StorageController.browser.js +0 -7
- package/lib/browser/StorageController.default.js +0 -7
- package/lib/browser/StorageController.react-native.js +0 -7
- package/lib/browser/StorageController.weapp.js +0 -7
- package/lib/browser/TaskQueue.js +0 -7
- package/lib/browser/UniqueInstanceStateController.js +0 -7
- package/lib/browser/arrayContainsObject.js +0 -7
- package/lib/browser/canBeSerialized.js +0 -7
- package/lib/browser/decode.js +0 -7
- package/lib/browser/encode.js +0 -7
- package/lib/browser/equals.js +0 -9
- package/lib/browser/escape.js +0 -7
- package/lib/browser/isRevocableSession.js +0 -7
- package/lib/browser/parseDate.js +0 -7
- package/lib/browser/unique.js +0 -7
- package/lib/browser/unsavedChildren.js +0 -7
- package/lib/node/Analytics.js +0 -7
- package/lib/node/AnonymousUtils.js +0 -7
- package/lib/node/Cloud.js +0 -7
- package/lib/node/CoreManager.js +1 -8
- package/lib/node/EventEmitter.js +0 -7
- package/lib/node/FacebookUtils.js +0 -7
- package/lib/node/InstallationController.js +0 -7
- package/lib/node/LiveQueryClient.js +0 -10
- package/lib/node/LiveQuerySubscription.js +0 -10
- package/lib/node/LocalDatastore.js +0 -7
- package/lib/node/LocalDatastoreController.js +0 -7
- package/lib/node/LocalDatastoreController.react-native.js +0 -7
- package/lib/node/LocalDatastoreUtils.js +0 -7
- package/lib/node/ObjectStateMutations.js +0 -7
- package/lib/node/OfflineQuery.js +8 -0
- package/lib/node/Parse.js +0 -9
- package/lib/node/ParseACL.js +0 -7
- package/lib/node/ParseCLP.js +0 -7
- package/lib/node/ParseConfig.js +0 -7
- package/lib/node/ParseError.js +0 -9
- package/lib/node/ParseFile.js +0 -7
- package/lib/node/ParseGeoPoint.js +0 -7
- package/lib/node/ParseInstallation.js +0 -7
- package/lib/node/ParseLiveQuery.js +0 -7
- package/lib/node/ParseObject.js +40 -29
- package/lib/node/ParseOp.js +0 -7
- package/lib/node/ParsePolygon.js +0 -7
- package/lib/node/ParseQuery.js +0 -7
- package/lib/node/ParseRelation.js +0 -7
- package/lib/node/ParseRole.js +0 -7
- package/lib/node/ParseSchema.js +0 -7
- package/lib/node/ParseSession.js +0 -7
- package/lib/node/ParseUser.js +0 -7
- package/lib/node/Push.js +0 -7
- package/lib/node/RESTController.js +0 -7
- package/lib/node/SingleInstanceStateController.js +0 -7
- package/lib/node/Storage.js +0 -7
- package/lib/node/StorageController.browser.js +0 -7
- package/lib/node/StorageController.default.js +0 -7
- package/lib/node/StorageController.react-native.js +0 -7
- package/lib/node/StorageController.weapp.js +0 -7
- package/lib/node/TaskQueue.js +0 -7
- package/lib/node/UniqueInstanceStateController.js +0 -7
- package/lib/node/arrayContainsObject.js +0 -7
- package/lib/node/canBeSerialized.js +0 -7
- package/lib/node/decode.js +0 -7
- package/lib/node/encode.js +0 -7
- package/lib/node/equals.js +0 -9
- package/lib/node/escape.js +0 -7
- package/lib/node/isRevocableSession.js +0 -7
- package/lib/node/parseDate.js +0 -7
- package/lib/node/unique.js +0 -7
- package/lib/node/unsavedChildren.js +0 -7
- package/lib/react-native/CoreManager.js +2 -2
- package/lib/react-native/EventuallyQueue.js +169 -676
- package/lib/react-native/LiveQueryClient.js +3 -46
- package/lib/react-native/LocalDatastore.js +303 -863
- package/lib/react-native/LocalDatastoreController.js +75 -535
- package/lib/react-native/LocalDatastoreController.react-native.js +95 -503
- package/lib/react-native/ObjectStateMutations.js +2 -31
- package/lib/react-native/OfflineQuery.js +24 -60
- package/lib/react-native/ParseCLP.js +55 -129
- package/lib/react-native/ParseFile.js +63 -468
- package/lib/react-native/ParseLiveQuery.js +60 -455
- package/lib/react-native/ParseObject.js +263 -897
- package/lib/react-native/ParseQuery.js +207 -643
- package/lib/react-native/ParseSchema.js +3 -3
- package/lib/react-native/ParseUser.js +118 -573
- package/lib/react-native/RESTController.js +1 -29
- package/lib/weapp/Analytics.js +0 -7
- package/lib/weapp/AnonymousUtils.js +0 -7
- package/lib/weapp/Cloud.js +0 -7
- package/lib/weapp/CoreManager.js +1 -8
- package/lib/weapp/EventEmitter.js +0 -7
- package/lib/weapp/FacebookUtils.js +0 -7
- package/lib/weapp/InstallationController.js +0 -7
- package/lib/weapp/LocalDatastoreUtils.js +0 -7
- package/lib/weapp/OfflineQuery.js +27 -8
- package/lib/weapp/Parse.js +0 -9
- package/lib/weapp/ParseACL.js +0 -7
- package/lib/weapp/ParseConfig.js +0 -7
- package/lib/weapp/ParseError.js +0 -9
- package/lib/weapp/ParseGeoPoint.js +0 -7
- package/lib/weapp/ParseObject.js +158 -126
- package/lib/weapp/ParsePolygon.js +0 -7
- package/lib/weapp/ParseRelation.js +0 -7
- package/lib/weapp/ParseSchema.js +0 -7
- package/lib/weapp/Push.js +0 -7
- package/lib/weapp/RESTController.js +0 -7
- package/lib/weapp/SingleInstanceStateController.js +0 -7
- package/lib/weapp/Storage.js +0 -7
- package/lib/weapp/StorageController.browser.js +0 -7
- package/lib/weapp/StorageController.default.js +0 -7
- package/lib/weapp/StorageController.react-native.js +0 -7
- package/lib/weapp/StorageController.weapp.js +0 -7
- package/lib/weapp/TaskQueue.js +0 -7
- package/lib/weapp/UniqueInstanceStateController.js +0 -7
- package/lib/weapp/arrayContainsObject.js +0 -7
- package/lib/weapp/canBeSerialized.js +0 -7
- package/lib/weapp/decode.js +0 -7
- package/lib/weapp/encode.js +0 -7
- package/lib/weapp/equals.js +0 -9
- package/lib/weapp/escape.js +0 -7
- package/lib/weapp/isRevocableSession.js +0 -7
- package/lib/weapp/parseDate.js +0 -7
- package/lib/weapp/unique.js +0 -7
- package/lib/weapp/unsavedChildren.js +0 -7
- package/package.json +9 -9
- 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,
|
|
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 (
|
|
585
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
640
|
-
count = results.length;
|
|
641
|
-
}
|
|
241
|
+
var localDatastore = _CoreManager.default.getLocalDatastore();
|
|
642
242
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
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
|
-
|
|
247
|
+
if (json._localId && !json.objectId) {
|
|
248
|
+
object._localId = json._localId;
|
|
249
|
+
}
|
|
652
250
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
251
|
+
if (!_OfflineQuery.default.matchesQuery(_this2.className, object, arr, _this2)) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
656
254
|
|
|
657
|
-
|
|
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
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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
|
-
|
|
665
|
-
results: results,
|
|
666
|
-
count: count
|
|
667
|
-
});
|
|
282
|
+
var count;
|
|
668
283
|
|
|
669
|
-
|
|
670
|
-
|
|
284
|
+
if (params.count) {
|
|
285
|
+
count = results.length;
|
|
286
|
+
}
|
|
671
287
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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
|
-
|
|
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 (
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
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
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
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 (
|
|
1226
|
-
var
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
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 (
|
|
1256
|
-
var
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
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
|
-
|
|
1286
|
-
|
|
859
|
+
return Promise.resolve(callback(accumulator, object, index)).then(function (result) {
|
|
860
|
+
accumulator = result;
|
|
861
|
+
index += 1;
|
|
862
|
+
});
|
|
863
|
+
}, options);
|
|
1287
864
|
|
|
1288
|
-
|
|
1289
|
-
|
|
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
|
-
|
|
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 (
|
|
1298
|
-
var
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
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 (
|
|
1335
|
-
var
|
|
1336
|
-
k =
|
|
1337
|
-
val =
|
|
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 (
|
|
1358
|
-
var
|
|
1359
|
-
k =
|
|
1360
|
-
val =
|
|
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(
|
|
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 (
|
|
1805
|
-
var
|
|
1806
|
-
|
|
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
|
-
|
|
1821
|
-
|
|
1384
|
+
if (!sessionToken) {
|
|
1385
|
+
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
1386
|
+
}
|
|
1822
1387
|
|
|
1823
|
-
|
|
1824
|
-
liveQueryClient = _context7.sent;
|
|
1388
|
+
var liveQueryClient = yield _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
|
|
1825
1389
|
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1390
|
+
if (liveQueryClient.shouldOpen()) {
|
|
1391
|
+
liveQueryClient.open();
|
|
1392
|
+
}
|
|
1829
1393
|
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1394
|
+
var subscription = liveQueryClient.subscribe(this, sessionToken);
|
|
1395
|
+
return subscription.subscribePromise.then(function () {
|
|
1396
|
+
return subscription;
|
|
1397
|
+
});
|
|
1398
|
+
});
|
|
1834
1399
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
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 () {
|