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
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
9
|
|
|
12
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -141,6 +139,357 @@ function _arrayLikeToArray(arr, len) {
|
|
|
141
139
|
return arr2;
|
|
142
140
|
}
|
|
143
141
|
|
|
142
|
+
function _regeneratorRuntime() {
|
|
143
|
+
"use strict";
|
|
144
|
+
|
|
145
|
+
_regeneratorRuntime = function () {
|
|
146
|
+
return exports;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
var exports = {},
|
|
150
|
+
Op = Object.prototype,
|
|
151
|
+
hasOwn = Op.hasOwnProperty,
|
|
152
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
153
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
154
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
155
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
156
|
+
|
|
157
|
+
function define(obj, key, value) {
|
|
158
|
+
return Object.defineProperty(obj, key, {
|
|
159
|
+
value: value,
|
|
160
|
+
enumerable: !0,
|
|
161
|
+
configurable: !0,
|
|
162
|
+
writable: !0
|
|
163
|
+
}), obj[key];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
try {
|
|
167
|
+
define({}, "");
|
|
168
|
+
} catch (err) {
|
|
169
|
+
define = function (obj, key, value) {
|
|
170
|
+
return obj[key] = value;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
175
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
176
|
+
generator = Object.create(protoGenerator.prototype),
|
|
177
|
+
context = new Context(tryLocsList || []);
|
|
178
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
179
|
+
var state = "suspendedStart";
|
|
180
|
+
return function (method, arg) {
|
|
181
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
182
|
+
|
|
183
|
+
if ("completed" === state) {
|
|
184
|
+
if ("throw" === method) throw arg;
|
|
185
|
+
return doneResult();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
for (context.method = method, context.arg = arg;;) {
|
|
189
|
+
var delegate = context.delegate;
|
|
190
|
+
|
|
191
|
+
if (delegate) {
|
|
192
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
193
|
+
|
|
194
|
+
if (delegateResult) {
|
|
195
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
196
|
+
return delegateResult;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
201
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
202
|
+
context.dispatchException(context.arg);
|
|
203
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
204
|
+
state = "executing";
|
|
205
|
+
var record = tryCatch(innerFn, self, context);
|
|
206
|
+
|
|
207
|
+
if ("normal" === record.type) {
|
|
208
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
209
|
+
return {
|
|
210
|
+
value: record.arg,
|
|
211
|
+
done: context.done
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}(innerFn, self, context), generator;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function tryCatch(fn, obj, arg) {
|
|
222
|
+
try {
|
|
223
|
+
return {
|
|
224
|
+
type: "normal",
|
|
225
|
+
arg: fn.call(obj, arg)
|
|
226
|
+
};
|
|
227
|
+
} catch (err) {
|
|
228
|
+
return {
|
|
229
|
+
type: "throw",
|
|
230
|
+
arg: err
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
exports.wrap = wrap;
|
|
236
|
+
var ContinueSentinel = {};
|
|
237
|
+
|
|
238
|
+
function Generator() {}
|
|
239
|
+
|
|
240
|
+
function GeneratorFunction() {}
|
|
241
|
+
|
|
242
|
+
function GeneratorFunctionPrototype() {}
|
|
243
|
+
|
|
244
|
+
var IteratorPrototype = {};
|
|
245
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
246
|
+
return this;
|
|
247
|
+
});
|
|
248
|
+
var getProto = Object.getPrototypeOf,
|
|
249
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
250
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
251
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
252
|
+
|
|
253
|
+
function defineIteratorMethods(prototype) {
|
|
254
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
255
|
+
define(prototype, method, function (arg) {
|
|
256
|
+
return this._invoke(method, arg);
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
262
|
+
function invoke(method, arg, resolve, reject) {
|
|
263
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
264
|
+
|
|
265
|
+
if ("throw" !== record.type) {
|
|
266
|
+
var result = record.arg,
|
|
267
|
+
value = result.value;
|
|
268
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
269
|
+
invoke("next", value, resolve, reject);
|
|
270
|
+
}, function (err) {
|
|
271
|
+
invoke("throw", err, resolve, reject);
|
|
272
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
273
|
+
result.value = unwrapped, resolve(result);
|
|
274
|
+
}, function (error) {
|
|
275
|
+
return invoke("throw", error, resolve, reject);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
reject(record.arg);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
var previousPromise;
|
|
283
|
+
|
|
284
|
+
this._invoke = function (method, arg) {
|
|
285
|
+
function callInvokeWithMethodAndArg() {
|
|
286
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
287
|
+
invoke(method, arg, resolve, reject);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
296
|
+
var method = delegate.iterator[context.method];
|
|
297
|
+
|
|
298
|
+
if (undefined === method) {
|
|
299
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
300
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
301
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return ContinueSentinel;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
308
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
309
|
+
var info = record.arg;
|
|
310
|
+
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);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function pushTryEntry(locs) {
|
|
314
|
+
var entry = {
|
|
315
|
+
tryLoc: locs[0]
|
|
316
|
+
};
|
|
317
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function resetTryEntry(entry) {
|
|
321
|
+
var record = entry.completion || {};
|
|
322
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function Context(tryLocsList) {
|
|
326
|
+
this.tryEntries = [{
|
|
327
|
+
tryLoc: "root"
|
|
328
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function values(iterable) {
|
|
332
|
+
if (iterable) {
|
|
333
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
334
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
335
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
336
|
+
|
|
337
|
+
if (!isNaN(iterable.length)) {
|
|
338
|
+
var i = -1,
|
|
339
|
+
next = function next() {
|
|
340
|
+
for (; ++i < iterable.length;) {
|
|
341
|
+
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return next.value = undefined, next.done = !0, next;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
return next.next = next;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return {
|
|
352
|
+
next: doneResult
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function doneResult() {
|
|
357
|
+
return {
|
|
358
|
+
value: undefined,
|
|
359
|
+
done: !0
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
364
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
365
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
366
|
+
}, exports.mark = function (genFun) {
|
|
367
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
368
|
+
}, exports.awrap = function (arg) {
|
|
369
|
+
return {
|
|
370
|
+
__await: arg
|
|
371
|
+
};
|
|
372
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
373
|
+
return this;
|
|
374
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
375
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
376
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
377
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
378
|
+
return result.done ? result.value : iter.next();
|
|
379
|
+
});
|
|
380
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
381
|
+
return this;
|
|
382
|
+
}), define(Gp, "toString", function () {
|
|
383
|
+
return "[object Generator]";
|
|
384
|
+
}), exports.keys = function (object) {
|
|
385
|
+
var keys = [];
|
|
386
|
+
|
|
387
|
+
for (var key in object) {
|
|
388
|
+
keys.push(key);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return keys.reverse(), function next() {
|
|
392
|
+
for (; keys.length;) {
|
|
393
|
+
var key = keys.pop();
|
|
394
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return next.done = !0, next;
|
|
398
|
+
};
|
|
399
|
+
}, exports.values = values, Context.prototype = {
|
|
400
|
+
constructor: Context,
|
|
401
|
+
reset: function (skipTempReset) {
|
|
402
|
+
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) {
|
|
403
|
+
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
stop: function () {
|
|
407
|
+
this.done = !0;
|
|
408
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
409
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
410
|
+
return this.rval;
|
|
411
|
+
},
|
|
412
|
+
dispatchException: function (exception) {
|
|
413
|
+
if (this.done) throw exception;
|
|
414
|
+
var context = this;
|
|
415
|
+
|
|
416
|
+
function handle(loc, caught) {
|
|
417
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
421
|
+
var entry = this.tryEntries[i],
|
|
422
|
+
record = entry.completion;
|
|
423
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
424
|
+
|
|
425
|
+
if (entry.tryLoc <= this.prev) {
|
|
426
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
427
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
428
|
+
|
|
429
|
+
if (hasCatch && hasFinally) {
|
|
430
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
431
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
432
|
+
} else if (hasCatch) {
|
|
433
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
434
|
+
} else {
|
|
435
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
436
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
abrupt: function (type, arg) {
|
|
442
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
443
|
+
var entry = this.tryEntries[i];
|
|
444
|
+
|
|
445
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
446
|
+
var finallyEntry = entry;
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
452
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
453
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
454
|
+
},
|
|
455
|
+
complete: function (record, afterLoc) {
|
|
456
|
+
if ("throw" === record.type) throw record.arg;
|
|
457
|
+
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;
|
|
458
|
+
},
|
|
459
|
+
finish: function (finallyLoc) {
|
|
460
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
461
|
+
var entry = this.tryEntries[i];
|
|
462
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
catch: function (tryLoc) {
|
|
466
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
467
|
+
var entry = this.tryEntries[i];
|
|
468
|
+
|
|
469
|
+
if (entry.tryLoc === tryLoc) {
|
|
470
|
+
var record = entry.completion;
|
|
471
|
+
|
|
472
|
+
if ("throw" === record.type) {
|
|
473
|
+
var thrown = record.arg;
|
|
474
|
+
resetTryEntry(entry);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
return thrown;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
throw new Error("illegal catch attempt");
|
|
482
|
+
},
|
|
483
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
484
|
+
return this.delegate = {
|
|
485
|
+
iterator: values(iterable),
|
|
486
|
+
resultName: resultName,
|
|
487
|
+
nextLoc: nextLoc
|
|
488
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
489
|
+
}
|
|
490
|
+
}, exports;
|
|
491
|
+
}
|
|
492
|
+
|
|
144
493
|
function ownKeys(object, enumerableOnly) {
|
|
145
494
|
var keys = Object.keys(object);
|
|
146
495
|
|
|
@@ -957,7 +1306,7 @@ var ParseObject = function () {
|
|
|
957
1306
|
key: "exists",
|
|
958
1307
|
value: function (options) {
|
|
959
1308
|
var query;
|
|
960
|
-
return
|
|
1309
|
+
return _regeneratorRuntime().async(function (_context) {
|
|
961
1310
|
while (1) {
|
|
962
1311
|
switch (_context.prev = _context.next) {
|
|
963
1312
|
case 0:
|
|
@@ -972,7 +1321,7 @@ var ParseObject = function () {
|
|
|
972
1321
|
_context.prev = 2;
|
|
973
1322
|
query = new _ParseQuery.default(this.className);
|
|
974
1323
|
_context.next = 6;
|
|
975
|
-
return
|
|
1324
|
+
return _regeneratorRuntime().awrap(query.get(this.id, options));
|
|
976
1325
|
|
|
977
1326
|
case 6:
|
|
978
1327
|
return _context.abrupt("return", true);
|
|
@@ -1128,13 +1477,13 @@ var ParseObject = function () {
|
|
|
1128
1477
|
}, {
|
|
1129
1478
|
key: "saveEventually",
|
|
1130
1479
|
value: function (options) {
|
|
1131
|
-
return
|
|
1480
|
+
return _regeneratorRuntime().async(function (_context2) {
|
|
1132
1481
|
while (1) {
|
|
1133
1482
|
switch (_context2.prev = _context2.next) {
|
|
1134
1483
|
case 0:
|
|
1135
1484
|
_context2.prev = 0;
|
|
1136
1485
|
_context2.next = 3;
|
|
1137
|
-
return
|
|
1486
|
+
return _regeneratorRuntime().awrap(this.save(null, options));
|
|
1138
1487
|
|
|
1139
1488
|
case 3:
|
|
1140
1489
|
_context2.next = 11;
|
|
@@ -1150,7 +1499,7 @@ var ParseObject = function () {
|
|
|
1150
1499
|
}
|
|
1151
1500
|
|
|
1152
1501
|
_context2.next = 10;
|
|
1153
|
-
return
|
|
1502
|
+
return _regeneratorRuntime().awrap(_EventuallyQueue.default.save(this, options));
|
|
1154
1503
|
|
|
1155
1504
|
case 10:
|
|
1156
1505
|
_EventuallyQueue.default.poll();
|
|
@@ -1168,8 +1517,6 @@ var ParseObject = function () {
|
|
|
1168
1517
|
}, {
|
|
1169
1518
|
key: "save",
|
|
1170
1519
|
value: function (arg1, arg2, arg3) {
|
|
1171
|
-
var _this = this;
|
|
1172
|
-
|
|
1173
1520
|
var attrs;
|
|
1174
1521
|
var options;
|
|
1175
1522
|
|
|
@@ -1218,19 +1565,19 @@ var ParseObject = function () {
|
|
|
1218
1565
|
|
|
1219
1566
|
var unsaved = options.cascadeSave !== false ? (0, _unsavedChildren.default)(this) : null;
|
|
1220
1567
|
return controller.save(unsaved, saveOptions).then(function () {
|
|
1221
|
-
return controller.save(
|
|
1568
|
+
return controller.save(this, saveOptions);
|
|
1222
1569
|
});
|
|
1223
1570
|
}
|
|
1224
1571
|
}, {
|
|
1225
1572
|
key: "destroyEventually",
|
|
1226
1573
|
value: function (options) {
|
|
1227
|
-
return
|
|
1574
|
+
return _regeneratorRuntime().async(function (_context3) {
|
|
1228
1575
|
while (1) {
|
|
1229
1576
|
switch (_context3.prev = _context3.next) {
|
|
1230
1577
|
case 0:
|
|
1231
1578
|
_context3.prev = 0;
|
|
1232
1579
|
_context3.next = 3;
|
|
1233
|
-
return
|
|
1580
|
+
return _regeneratorRuntime().awrap(this.destroy(options));
|
|
1234
1581
|
|
|
1235
1582
|
case 3:
|
|
1236
1583
|
_context3.next = 11;
|
|
@@ -1246,7 +1593,7 @@ var ParseObject = function () {
|
|
|
1246
1593
|
}
|
|
1247
1594
|
|
|
1248
1595
|
_context3.next = 10;
|
|
1249
|
-
return
|
|
1596
|
+
return _regeneratorRuntime().awrap(_EventuallyQueue.default.destroy(this, options));
|
|
1250
1597
|
|
|
1251
1598
|
case 10:
|
|
1252
1599
|
_EventuallyQueue.default.poll();
|
|
@@ -1299,7 +1646,7 @@ var ParseObject = function () {
|
|
|
1299
1646
|
key: "isPinned",
|
|
1300
1647
|
value: function () {
|
|
1301
1648
|
var localDatastore, objectKey, pin;
|
|
1302
|
-
return
|
|
1649
|
+
return _regeneratorRuntime().async(function (_context4) {
|
|
1303
1650
|
while (1) {
|
|
1304
1651
|
switch (_context4.prev = _context4.next) {
|
|
1305
1652
|
case 0:
|
|
@@ -1315,7 +1662,7 @@ var ParseObject = function () {
|
|
|
1315
1662
|
case 3:
|
|
1316
1663
|
objectKey = localDatastore.getKeyForObject(this);
|
|
1317
1664
|
_context4.next = 6;
|
|
1318
|
-
return
|
|
1665
|
+
return _regeneratorRuntime().awrap(localDatastore.fromPinWithName(objectKey));
|
|
1319
1666
|
|
|
1320
1667
|
case 6:
|
|
1321
1668
|
pin = _context4.sent;
|
|
@@ -1342,7 +1689,7 @@ var ParseObject = function () {
|
|
|
1342
1689
|
key: "fetchFromLocalDatastore",
|
|
1343
1690
|
value: function () {
|
|
1344
1691
|
var localDatastore, objectKey, pinned, result;
|
|
1345
|
-
return
|
|
1692
|
+
return _regeneratorRuntime().async(function (_context5) {
|
|
1346
1693
|
while (1) {
|
|
1347
1694
|
switch (_context5.prev = _context5.next) {
|
|
1348
1695
|
case 0:
|
|
@@ -1358,7 +1705,7 @@ var ParseObject = function () {
|
|
|
1358
1705
|
case 3:
|
|
1359
1706
|
objectKey = localDatastore.getKeyForObject(this);
|
|
1360
1707
|
_context5.next = 6;
|
|
1361
|
-
return
|
|
1708
|
+
return _regeneratorRuntime().awrap(localDatastore._serializeObject(objectKey));
|
|
1362
1709
|
|
|
1363
1710
|
case 6:
|
|
1364
1711
|
pinned = _context5.sent;
|
|
@@ -1828,7 +2175,7 @@ var DefaultController = {
|
|
|
1828
2175
|
return query.find(options).then(function (objects) {
|
|
1829
2176
|
var idMap, i, obj, _i, _obj, id, _iterator2, _step2, object;
|
|
1830
2177
|
|
|
1831
|
-
return
|
|
2178
|
+
return _regeneratorRuntime().async(function (_context6) {
|
|
1832
2179
|
while (1) {
|
|
1833
2180
|
switch (_context6.prev = _context6.next) {
|
|
1834
2181
|
case 0:
|
|
@@ -1888,7 +2235,7 @@ var DefaultController = {
|
|
|
1888
2235
|
|
|
1889
2236
|
object = _step2.value;
|
|
1890
2237
|
_context6.next = 17;
|
|
1891
|
-
return
|
|
2238
|
+
return _regeneratorRuntime().awrap(localDatastore._updateObjectIfPinned(object));
|
|
1892
2239
|
|
|
1893
2240
|
case 17:
|
|
1894
2241
|
_context6.next = 13;
|
|
@@ -1918,7 +2265,7 @@ var DefaultController = {
|
|
|
1918
2265
|
}
|
|
1919
2266
|
|
|
1920
2267
|
return RESTController.request('GET', 'classes/' + target.className + '/' + target._getId(), params, options).then(function (response) {
|
|
1921
|
-
return
|
|
2268
|
+
return _regeneratorRuntime().async(function (_context7) {
|
|
1922
2269
|
while (1) {
|
|
1923
2270
|
switch (_context7.prev = _context7.next) {
|
|
1924
2271
|
case 0:
|
|
@@ -1929,7 +2276,7 @@ var DefaultController = {
|
|
|
1929
2276
|
target._finishFetch(response);
|
|
1930
2277
|
|
|
1931
2278
|
_context7.next = 5;
|
|
1932
|
-
return
|
|
2279
|
+
return _regeneratorRuntime().awrap(localDatastore._updateObjectIfPinned(target));
|
|
1933
2280
|
|
|
1934
2281
|
case 5:
|
|
1935
2282
|
return _context7.abrupt("return", target);
|
|
@@ -1947,7 +2294,7 @@ var DefaultController = {
|
|
|
1947
2294
|
},
|
|
1948
2295
|
destroy: function (target, options) {
|
|
1949
2296
|
var batchSize, localDatastore, RESTController, batches, deleteCompleted, errors;
|
|
1950
|
-
return
|
|
2297
|
+
return _regeneratorRuntime().async(function (_context10) {
|
|
1951
2298
|
while (1) {
|
|
1952
2299
|
switch (_context10.prev = _context10.next) {
|
|
1953
2300
|
case 0:
|
|
@@ -2011,7 +2358,7 @@ var DefaultController = {
|
|
|
2011
2358
|
return _context10.abrupt("return", deleteCompleted.then(function () {
|
|
2012
2359
|
var aggregate, _iterator3, _step3, object;
|
|
2013
2360
|
|
|
2014
|
-
return
|
|
2361
|
+
return _regeneratorRuntime().async(function (_context8) {
|
|
2015
2362
|
while (1) {
|
|
2016
2363
|
switch (_context8.prev = _context8.next) {
|
|
2017
2364
|
case 0:
|
|
@@ -2035,7 +2382,7 @@ var DefaultController = {
|
|
|
2035
2382
|
|
|
2036
2383
|
object = _step3.value;
|
|
2037
2384
|
_context8.next = 9;
|
|
2038
|
-
return
|
|
2385
|
+
return _regeneratorRuntime().awrap(localDatastore._destroyObjectIfPinned(object));
|
|
2039
2386
|
|
|
2040
2387
|
case 9:
|
|
2041
2388
|
_context8.next = 5;
|
|
@@ -2059,12 +2406,12 @@ var DefaultController = {
|
|
|
2059
2406
|
}
|
|
2060
2407
|
|
|
2061
2408
|
return _context10.abrupt("return", RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then(function () {
|
|
2062
|
-
return
|
|
2409
|
+
return _regeneratorRuntime().async(function (_context9) {
|
|
2063
2410
|
while (1) {
|
|
2064
2411
|
switch (_context9.prev = _context9.next) {
|
|
2065
2412
|
case 0:
|
|
2066
2413
|
_context9.next = 2;
|
|
2067
|
-
return
|
|
2414
|
+
return _regeneratorRuntime().awrap(localDatastore._destroyObjectIfPinned(target));
|
|
2068
2415
|
|
|
2069
2416
|
case 2:
|
|
2070
2417
|
return _context9.abrupt("return", Promise.resolve(target));
|
|
@@ -2123,10 +2470,6 @@ var DefaultController = {
|
|
|
2123
2470
|
if (el instanceof _ParseFile.default) {
|
|
2124
2471
|
filesSaved.push(el.save(options));
|
|
2125
2472
|
} else if (el instanceof ParseObject) {
|
|
2126
|
-
if (allowCustomObjectId && !el.id) {
|
|
2127
|
-
throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty, null or undefined');
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
2473
|
pending.push(el);
|
|
2131
2474
|
}
|
|
2132
2475
|
});
|
|
@@ -2138,6 +2481,10 @@ var DefaultController = {
|
|
|
2138
2481
|
var batch = [];
|
|
2139
2482
|
var nextPending = [];
|
|
2140
2483
|
pending.forEach(function (el) {
|
|
2484
|
+
if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {
|
|
2485
|
+
throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2141
2488
|
if (batch.length < batchSize && (0, _canBeSerialized.default)(el)) {
|
|
2142
2489
|
batch.push(el);
|
|
2143
2490
|
} else {
|
|
@@ -2195,7 +2542,7 @@ var DefaultController = {
|
|
|
2195
2542
|
}).then(function () {
|
|
2196
2543
|
var _iterator4, _step4, object;
|
|
2197
2544
|
|
|
2198
|
-
return
|
|
2545
|
+
return _regeneratorRuntime().async(function (_context11) {
|
|
2199
2546
|
while (1) {
|
|
2200
2547
|
switch (_context11.prev = _context11.next) {
|
|
2201
2548
|
case 0:
|
|
@@ -2217,11 +2564,11 @@ var DefaultController = {
|
|
|
2217
2564
|
|
|
2218
2565
|
object = _step4.value;
|
|
2219
2566
|
_context11.next = 7;
|
|
2220
|
-
return
|
|
2567
|
+
return _regeneratorRuntime().awrap(localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object));
|
|
2221
2568
|
|
|
2222
2569
|
case 7:
|
|
2223
2570
|
_context11.next = 9;
|
|
2224
|
-
return
|
|
2571
|
+
return _regeneratorRuntime().awrap(localDatastore._updateObjectIfPinned(object));
|
|
2225
2572
|
|
|
2226
2573
|
case 9:
|
|
2227
2574
|
_context11.next = 3;
|
|
@@ -2239,8 +2586,8 @@ var DefaultController = {
|
|
|
2239
2586
|
});
|
|
2240
2587
|
});
|
|
2241
2588
|
} else if (target instanceof ParseObject) {
|
|
2242
|
-
if (allowCustomObjectId && !target.id) {
|
|
2243
|
-
throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty
|
|
2589
|
+
if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {
|
|
2590
|
+
throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');
|
|
2244
2591
|
}
|
|
2245
2592
|
|
|
2246
2593
|
target._getId();
|
|
@@ -2265,16 +2612,16 @@ var DefaultController = {
|
|
|
2265
2612
|
|
|
2266
2613
|
stateController.pushPendingState(target._getStateIdentifier());
|
|
2267
2614
|
return stateController.enqueueTask(target._getStateIdentifier(), task).then(function () {
|
|
2268
|
-
return
|
|
2615
|
+
return _regeneratorRuntime().async(function (_context12) {
|
|
2269
2616
|
while (1) {
|
|
2270
2617
|
switch (_context12.prev = _context12.next) {
|
|
2271
2618
|
case 0:
|
|
2272
2619
|
_context12.next = 2;
|
|
2273
|
-
return
|
|
2620
|
+
return _regeneratorRuntime().awrap(localDatastore._updateLocalIdForObject(localId, target));
|
|
2274
2621
|
|
|
2275
2622
|
case 2:
|
|
2276
2623
|
_context12.next = 4;
|
|
2277
|
-
return
|
|
2624
|
+
return _regeneratorRuntime().awrap(localDatastore._updateObjectIfPinned(target));
|
|
2278
2625
|
|
|
2279
2626
|
case 4:
|
|
2280
2627
|
return _context12.abrupt("return", target);
|
|
@@ -648,12 +648,10 @@ var RelationOp = function (_Op7) {
|
|
|
648
648
|
}, {
|
|
649
649
|
key: "toJSON",
|
|
650
650
|
value: function () {
|
|
651
|
-
var _this7 = this;
|
|
652
|
-
|
|
653
651
|
var idToPointer = function (id) {
|
|
654
652
|
return {
|
|
655
653
|
__type: 'Pointer',
|
|
656
|
-
className:
|
|
654
|
+
className: this._targetClassName,
|
|
657
655
|
objectId: id
|
|
658
656
|
};
|
|
659
657
|
};
|