parse 4.0.0-alpha.6 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +1 -3
- package/dist/parse.js +3991 -6551
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3152 -6482
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +4 -11
- package/lib/browser/AnonymousUtils.js +2 -9
- package/lib/browser/Cloud.js +4 -11
- package/lib/browser/CloudCode.js +0 -1
- package/lib/browser/CoreManager.js +3 -10
- package/lib/browser/EventEmitter.js +0 -7
- package/lib/browser/EventuallyQueue.js +282 -668
- package/lib/browser/FacebookUtils.js +2 -9
- package/lib/browser/InstallationController.js +0 -7
- package/lib/browser/LiveQueryClient.js +35 -26
- package/lib/browser/LiveQuerySubscription.js +5 -4
- package/lib/browser/LocalDatastore.js +472 -864
- package/lib/browser/LocalDatastoreController.js +161 -547
- package/lib/browser/LocalDatastoreController.react-native.js +156 -537
- package/lib/browser/LocalDatastoreUtils.js +2 -9
- package/lib/browser/ObjectStateMutations.js +25 -25
- package/lib/browser/OfflineQuery.js +31 -33
- package/lib/browser/Parse.js +4 -13
- package/lib/browser/ParseACL.js +9 -16
- package/lib/browser/ParseCLP.js +46 -48
- package/lib/browser/ParseConfig.js +6 -13
- package/lib/browser/ParseError.js +2 -11
- package/lib/browser/ParseFile.js +107 -482
- package/lib/browser/ParseGeoPoint.js +4 -11
- package/lib/browser/ParseHooks.js +2 -2
- package/lib/browser/ParseInstallation.js +2 -2
- package/lib/browser/ParseLiveQuery.js +104 -480
- package/lib/browser/ParseObject.js +598 -958
- package/lib/browser/ParseOp.js +11 -11
- package/lib/browser/ParsePolygon.js +5 -12
- package/lib/browser/ParseQuery.js +365 -758
- package/lib/browser/ParseRelation.js +2 -9
- package/lib/browser/ParseRole.js +2 -2
- package/lib/browser/ParseSchema.js +2 -9
- package/lib/browser/ParseSession.js +2 -2
- package/lib/browser/ParseUser.js +221 -607
- package/lib/browser/Push.js +2 -9
- package/lib/browser/RESTController.js +12 -19
- package/lib/browser/SingleInstanceStateController.js +4 -11
- 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 +8 -15
- package/lib/browser/arrayContainsObject.js +2 -9
- package/lib/browser/canBeSerialized.js +2 -9
- package/lib/browser/decode.js +4 -11
- package/lib/browser/encode.js +8 -15
- package/lib/browser/equals.js +4 -13
- package/lib/browser/escape.js +0 -7
- package/lib/browser/isRevocableSession.js +2 -9
- package/lib/browser/parseDate.js +2 -9
- package/lib/browser/promiseUtils.js +4 -4
- package/lib/browser/unique.js +4 -11
- package/lib/browser/unsavedChildren.js +6 -13
- package/lib/browser/uuid.js +5 -1
- package/lib/node/Analytics.js +0 -7
- package/lib/node/AnonymousUtils.js +0 -7
- package/lib/node/Cloud.js +0 -7
- package/lib/node/CloudCode.js +0 -1
- 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 +18 -17
- package/lib/node/LiveQuerySubscription.js +2 -11
- 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/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 +7 -12
- 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 +45 -34
- package/lib/node/ParseOp.js +0 -7
- package/lib/node/ParsePolygon.js +0 -7
- package/lib/node/ParseQuery.js +3 -18
- 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/node/uuid.js +7 -1
- package/lib/react-native/CoreManager.js +2 -2
- package/lib/react-native/EventuallyQueue.js +169 -676
- package/lib/react-native/LiveQueryClient.js +16 -50
- package/lib/react-native/LiveQuerySubscription.js +3 -2
- 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 +17 -63
- 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/react-native/uuid.js +5 -1
- package/lib/weapp/Analytics.js +4 -11
- package/lib/weapp/AnonymousUtils.js +2 -9
- package/lib/weapp/Cloud.js +4 -11
- package/lib/weapp/CloudCode.js +0 -1
- package/lib/weapp/CoreManager.js +3 -10
- package/lib/weapp/EventEmitter.js +0 -7
- package/lib/weapp/EventuallyQueue.js +282 -668
- package/lib/weapp/FacebookUtils.js +2 -9
- package/lib/weapp/InstallationController.js +0 -7
- package/lib/weapp/LiveQueryClient.js +35 -26
- package/lib/weapp/LiveQuerySubscription.js +5 -4
- package/lib/weapp/LocalDatastore.js +472 -864
- package/lib/weapp/LocalDatastoreController.js +161 -547
- package/lib/weapp/LocalDatastoreController.react-native.js +156 -537
- package/lib/weapp/LocalDatastoreUtils.js +2 -9
- package/lib/weapp/ObjectStateMutations.js +25 -25
- package/lib/weapp/OfflineQuery.js +31 -33
- package/lib/weapp/Parse.js +4 -13
- package/lib/weapp/ParseACL.js +9 -16
- package/lib/weapp/ParseCLP.js +46 -48
- package/lib/weapp/ParseConfig.js +6 -13
- package/lib/weapp/ParseError.js +2 -11
- package/lib/weapp/ParseFile.js +107 -482
- package/lib/weapp/ParseGeoPoint.js +4 -11
- package/lib/weapp/ParseHooks.js +2 -2
- package/lib/weapp/ParseInstallation.js +2 -2
- package/lib/weapp/ParseLiveQuery.js +104 -480
- package/lib/weapp/ParseObject.js +598 -958
- package/lib/weapp/ParseOp.js +11 -11
- package/lib/weapp/ParsePolygon.js +5 -12
- package/lib/weapp/ParseQuery.js +365 -758
- package/lib/weapp/ParseRelation.js +2 -9
- package/lib/weapp/ParseRole.js +2 -2
- package/lib/weapp/ParseSchema.js +2 -9
- package/lib/weapp/ParseSession.js +2 -2
- package/lib/weapp/ParseUser.js +221 -607
- package/lib/weapp/Push.js +2 -9
- package/lib/weapp/RESTController.js +12 -19
- package/lib/weapp/SingleInstanceStateController.js +4 -11
- 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 +8 -15
- package/lib/weapp/arrayContainsObject.js +2 -9
- package/lib/weapp/canBeSerialized.js +2 -9
- package/lib/weapp/decode.js +4 -11
- package/lib/weapp/encode.js +8 -15
- package/lib/weapp/equals.js +4 -13
- package/lib/weapp/escape.js +0 -7
- package/lib/weapp/isRevocableSession.js +2 -9
- package/lib/weapp/parseDate.js +2 -9
- package/lib/weapp/promiseUtils.js +4 -4
- package/lib/weapp/unique.js +4 -11
- package/lib/weapp/unsavedChildren.js +6 -13
- package/lib/weapp/uuid.js +2 -0
- package/package.json +24 -24
- package/PATENTS +0 -37
package/lib/weapp/ParseObject.js
CHANGED
|
@@ -1,46 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
6
|
-
|
|
7
|
-
var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
8
|
-
|
|
9
|
-
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
10
|
-
|
|
11
|
-
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
12
|
-
|
|
13
|
-
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
3
|
+
var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
|
|
14
4
|
|
|
15
|
-
var
|
|
5
|
+
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
16
6
|
|
|
17
|
-
var
|
|
7
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
18
8
|
|
|
19
|
-
var
|
|
9
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
20
10
|
|
|
21
|
-
var
|
|
11
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
22
12
|
|
|
23
|
-
var
|
|
13
|
+
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
24
14
|
|
|
25
|
-
var _Object$
|
|
15
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
26
16
|
|
|
27
|
-
var
|
|
17
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
28
18
|
|
|
29
19
|
var _Object$defineProperty2 = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
30
20
|
|
|
31
|
-
var
|
|
21
|
+
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
32
22
|
|
|
33
|
-
var
|
|
23
|
+
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
34
24
|
|
|
35
|
-
var
|
|
25
|
+
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
|
36
26
|
|
|
37
|
-
var
|
|
27
|
+
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
38
28
|
|
|
39
|
-
var
|
|
29
|
+
var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
40
30
|
|
|
41
|
-
var
|
|
31
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
42
32
|
|
|
43
|
-
var
|
|
33
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
44
34
|
|
|
45
35
|
_Object$defineProperty2(exports, "__esModule", {
|
|
46
36
|
value: true
|
|
@@ -48,43 +38,47 @@ _Object$defineProperty2(exports, "__esModule", {
|
|
|
48
38
|
|
|
49
39
|
exports.default = void 0;
|
|
50
40
|
|
|
51
|
-
var
|
|
41
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
52
42
|
|
|
53
|
-
var
|
|
43
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
54
44
|
|
|
55
|
-
var
|
|
45
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
56
46
|
|
|
57
|
-
var
|
|
47
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
58
48
|
|
|
59
|
-
var
|
|
49
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
60
50
|
|
|
61
|
-
var
|
|
51
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
62
52
|
|
|
63
|
-
var
|
|
53
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
64
54
|
|
|
65
|
-
var
|
|
55
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
66
56
|
|
|
67
|
-
var
|
|
57
|
+
var _freeze = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/freeze"));
|
|
68
58
|
|
|
69
|
-
var
|
|
59
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
60
|
+
|
|
61
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
70
62
|
|
|
71
63
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
72
64
|
|
|
73
|
-
var
|
|
65
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
74
66
|
|
|
75
|
-
var
|
|
67
|
+
var _getPrototypeOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of"));
|
|
76
68
|
|
|
77
|
-
var
|
|
69
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
78
70
|
|
|
79
|
-
var
|
|
71
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
80
72
|
|
|
81
|
-
var
|
|
73
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
82
74
|
|
|
83
|
-
var
|
|
75
|
+
var _create = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/create"));
|
|
84
76
|
|
|
85
|
-
var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs3/
|
|
77
|
+
var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
|
|
86
78
|
|
|
87
|
-
var
|
|
79
|
+
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
80
|
+
|
|
81
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
88
82
|
|
|
89
83
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
90
84
|
|
|
@@ -231,12 +225,12 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
231
225
|
}
|
|
232
226
|
|
|
233
227
|
function _unsupportedIterableToArray(o, minLen) {
|
|
234
|
-
var
|
|
228
|
+
var _context19;
|
|
235
229
|
|
|
236
230
|
if (!o) return;
|
|
237
231
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
238
232
|
|
|
239
|
-
var n = _sliceInstanceProperty(
|
|
233
|
+
var n = _sliceInstanceProperty(_context19 = Object.prototype.toString.call(o)).call(_context19, 8, -1);
|
|
240
234
|
|
|
241
235
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
242
236
|
if (n === "Map" || n === "Set") return _Array$from(o);
|
|
@@ -246,371 +240,11 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
246
240
|
function _arrayLikeToArray(arr, len) {
|
|
247
241
|
if (len == null || len > arr.length) len = arr.length;
|
|
248
242
|
|
|
249
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
250
|
-
arr2[i] = arr[i];
|
|
251
|
-
}
|
|
243
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
252
244
|
|
|
253
245
|
return arr2;
|
|
254
246
|
}
|
|
255
247
|
|
|
256
|
-
function _regeneratorRuntime() {
|
|
257
|
-
"use strict";
|
|
258
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
259
|
-
|
|
260
|
-
_regeneratorRuntime = function () {
|
|
261
|
-
return exports;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
var exports = {},
|
|
265
|
-
Op = Object.prototype,
|
|
266
|
-
hasOwn = Op.hasOwnProperty,
|
|
267
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
268
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
269
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
270
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
271
|
-
|
|
272
|
-
function define(obj, key, value) {
|
|
273
|
-
return _Object$defineProperty2(obj, key, {
|
|
274
|
-
value: value,
|
|
275
|
-
enumerable: !0,
|
|
276
|
-
configurable: !0,
|
|
277
|
-
writable: !0
|
|
278
|
-
}), obj[key];
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
try {
|
|
282
|
-
define({}, "");
|
|
283
|
-
} catch (err) {
|
|
284
|
-
define = function (obj, key, value) {
|
|
285
|
-
return obj[key] = value;
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
290
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
291
|
-
generator = _Object$create2(protoGenerator.prototype),
|
|
292
|
-
context = new Context(tryLocsList || []);
|
|
293
|
-
|
|
294
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
295
|
-
var state = "suspendedStart";
|
|
296
|
-
return function (method, arg) {
|
|
297
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
298
|
-
|
|
299
|
-
if ("completed" === state) {
|
|
300
|
-
if ("throw" === method) throw arg;
|
|
301
|
-
return doneResult();
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
for (context.method = method, context.arg = arg;;) {
|
|
305
|
-
var delegate = context.delegate;
|
|
306
|
-
|
|
307
|
-
if (delegate) {
|
|
308
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
309
|
-
|
|
310
|
-
if (delegateResult) {
|
|
311
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
312
|
-
return delegateResult;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
317
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
318
|
-
context.dispatchException(context.arg);
|
|
319
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
320
|
-
state = "executing";
|
|
321
|
-
var record = tryCatch(innerFn, self, context);
|
|
322
|
-
|
|
323
|
-
if ("normal" === record.type) {
|
|
324
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
325
|
-
return {
|
|
326
|
-
value: record.arg,
|
|
327
|
-
done: context.done
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
}(innerFn, self, context), generator;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function tryCatch(fn, obj, arg) {
|
|
338
|
-
try {
|
|
339
|
-
return {
|
|
340
|
-
type: "normal",
|
|
341
|
-
arg: fn.call(obj, arg)
|
|
342
|
-
};
|
|
343
|
-
} catch (err) {
|
|
344
|
-
return {
|
|
345
|
-
type: "throw",
|
|
346
|
-
arg: err
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
exports.wrap = wrap;
|
|
352
|
-
var ContinueSentinel = {};
|
|
353
|
-
|
|
354
|
-
function Generator() {}
|
|
355
|
-
|
|
356
|
-
function GeneratorFunction() {}
|
|
357
|
-
|
|
358
|
-
function GeneratorFunctionPrototype() {}
|
|
359
|
-
|
|
360
|
-
var IteratorPrototype = {};
|
|
361
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
362
|
-
return this;
|
|
363
|
-
});
|
|
364
|
-
var getProto = _Object$getPrototypeOf2,
|
|
365
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
366
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
367
|
-
|
|
368
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create2(IteratorPrototype);
|
|
369
|
-
|
|
370
|
-
function defineIteratorMethods(prototype) {
|
|
371
|
-
var _context18;
|
|
372
|
-
|
|
373
|
-
_forEachInstanceProperty2(_context18 = ["next", "throw", "return"]).call(_context18, function (method) {
|
|
374
|
-
define(prototype, method, function (arg) {
|
|
375
|
-
return this._invoke(method, arg);
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
381
|
-
function invoke(method, arg, resolve, reject) {
|
|
382
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
383
|
-
|
|
384
|
-
if ("throw" !== record.type) {
|
|
385
|
-
var result = record.arg,
|
|
386
|
-
value = result.value;
|
|
387
|
-
return value && "object" == _typeof3(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
388
|
-
invoke("next", value, resolve, reject);
|
|
389
|
-
}, function (err) {
|
|
390
|
-
invoke("throw", err, resolve, reject);
|
|
391
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
392
|
-
result.value = unwrapped, resolve(result);
|
|
393
|
-
}, function (error) {
|
|
394
|
-
return invoke("throw", error, resolve, reject);
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
reject(record.arg);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
var previousPromise;
|
|
402
|
-
|
|
403
|
-
this._invoke = function (method, arg) {
|
|
404
|
-
function callInvokeWithMethodAndArg() {
|
|
405
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
406
|
-
invoke(method, arg, resolve, reject);
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
415
|
-
var method = delegate.iterator[context.method];
|
|
416
|
-
|
|
417
|
-
if (undefined === method) {
|
|
418
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
419
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
420
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
return ContinueSentinel;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
427
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
428
|
-
var info = record.arg;
|
|
429
|
-
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);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
function pushTryEntry(locs) {
|
|
433
|
-
var entry = {
|
|
434
|
-
tryLoc: locs[0]
|
|
435
|
-
};
|
|
436
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
function resetTryEntry(entry) {
|
|
440
|
-
var record = entry.completion || {};
|
|
441
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
function Context(tryLocsList) {
|
|
445
|
-
this.tryEntries = [{
|
|
446
|
-
tryLoc: "root"
|
|
447
|
-
}], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
function values(iterable) {
|
|
451
|
-
if (iterable) {
|
|
452
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
453
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
454
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
455
|
-
|
|
456
|
-
if (!isNaN(iterable.length)) {
|
|
457
|
-
var i = -1,
|
|
458
|
-
next = function next() {
|
|
459
|
-
for (; ++i < iterable.length;) {
|
|
460
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
return next.value = undefined, next.done = !0, next;
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
return next.next = next;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
return {
|
|
471
|
-
next: doneResult
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
function doneResult() {
|
|
476
|
-
return {
|
|
477
|
-
value: undefined,
|
|
478
|
-
done: !0
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
483
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
484
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
485
|
-
}, exports.mark = function (genFun) {
|
|
486
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create2(Gp), genFun;
|
|
487
|
-
}, exports.awrap = function (arg) {
|
|
488
|
-
return {
|
|
489
|
-
__await: arg
|
|
490
|
-
};
|
|
491
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
492
|
-
return this;
|
|
493
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
494
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise2);
|
|
495
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
496
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
497
|
-
return result.done ? result.value : iter.next();
|
|
498
|
-
});
|
|
499
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
500
|
-
return this;
|
|
501
|
-
}), define(Gp, "toString", function () {
|
|
502
|
-
return "[object Generator]";
|
|
503
|
-
}), exports.keys = function (object) {
|
|
504
|
-
var keys = [];
|
|
505
|
-
|
|
506
|
-
for (var key in object) {
|
|
507
|
-
keys.push(key);
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
511
|
-
for (; keys.length;) {
|
|
512
|
-
var key = keys.pop();
|
|
513
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return next.done = !0, next;
|
|
517
|
-
};
|
|
518
|
-
}, exports.values = values, Context.prototype = {
|
|
519
|
-
constructor: Context,
|
|
520
|
-
reset: function (skipTempReset) {
|
|
521
|
-
var _context19;
|
|
522
|
-
|
|
523
|
-
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(_context19 = this.tryEntries).call(_context19, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
524
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
|
|
525
|
-
}
|
|
526
|
-
},
|
|
527
|
-
stop: function () {
|
|
528
|
-
this.done = !0;
|
|
529
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
530
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
531
|
-
return this.rval;
|
|
532
|
-
},
|
|
533
|
-
dispatchException: function (exception) {
|
|
534
|
-
if (this.done) throw exception;
|
|
535
|
-
var context = this;
|
|
536
|
-
|
|
537
|
-
function handle(loc, caught) {
|
|
538
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
542
|
-
var entry = this.tryEntries[i],
|
|
543
|
-
record = entry.completion;
|
|
544
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
545
|
-
|
|
546
|
-
if (entry.tryLoc <= this.prev) {
|
|
547
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
548
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
549
|
-
|
|
550
|
-
if (hasCatch && hasFinally) {
|
|
551
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
552
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
553
|
-
} else if (hasCatch) {
|
|
554
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
555
|
-
} else {
|
|
556
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
557
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
},
|
|
562
|
-
abrupt: function (type, arg) {
|
|
563
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
564
|
-
var entry = this.tryEntries[i];
|
|
565
|
-
|
|
566
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
567
|
-
var finallyEntry = entry;
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
573
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
574
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
575
|
-
},
|
|
576
|
-
complete: function (record, afterLoc) {
|
|
577
|
-
if ("throw" === record.type) throw record.arg;
|
|
578
|
-
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;
|
|
579
|
-
},
|
|
580
|
-
finish: function (finallyLoc) {
|
|
581
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
582
|
-
var entry = this.tryEntries[i];
|
|
583
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
catch: function (tryLoc) {
|
|
587
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
588
|
-
var entry = this.tryEntries[i];
|
|
589
|
-
|
|
590
|
-
if (entry.tryLoc === tryLoc) {
|
|
591
|
-
var record = entry.completion;
|
|
592
|
-
|
|
593
|
-
if ("throw" === record.type) {
|
|
594
|
-
var thrown = record.arg;
|
|
595
|
-
resetTryEntry(entry);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
return thrown;
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
throw new Error("illegal catch attempt");
|
|
603
|
-
},
|
|
604
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
605
|
-
return this.delegate = {
|
|
606
|
-
iterator: values(iterable),
|
|
607
|
-
resultName: resultName,
|
|
608
|
-
nextLoc: nextLoc
|
|
609
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
610
|
-
}
|
|
611
|
-
}, exports;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
248
|
function ownKeys(object, enumerableOnly) {
|
|
615
249
|
var keys = _Object$keys2(object);
|
|
616
250
|
|
|
@@ -627,12 +261,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
627
261
|
|
|
628
262
|
function _objectSpread(target) {
|
|
629
263
|
for (var i = 1; i < arguments.length; i++) {
|
|
630
|
-
var
|
|
264
|
+
var _context17, _context18;
|
|
631
265
|
|
|
632
266
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
633
|
-
i % 2 ? _forEachInstanceProperty2(
|
|
634
|
-
(0,
|
|
635
|
-
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(
|
|
267
|
+
i % 2 ? _forEachInstanceProperty2(_context17 = ownKeys(Object(source), !0)).call(_context17, function (key) {
|
|
268
|
+
(0, _defineProperty2.default)(target, key, source[key]);
|
|
269
|
+
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context18 = ownKeys(Object(source))).call(_context18, function (key) {
|
|
636
270
|
_Object$defineProperty2(target, key, _Object$getOwnPropertyDescriptor(source, key));
|
|
637
271
|
});
|
|
638
272
|
}
|
|
@@ -719,10 +353,10 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
719
353
|
/*:: ?: { ignoreValidation: boolean }*/
|
|
720
354
|
) {
|
|
721
355
|
(0, _classCallCheck2.default)(this, ParseObject);
|
|
722
|
-
(0,
|
|
723
|
-
(0,
|
|
724
|
-
(0,
|
|
725
|
-
(0,
|
|
356
|
+
(0, _defineProperty2.default)(this, "id", void 0);
|
|
357
|
+
(0, _defineProperty2.default)(this, "_localId", void 0);
|
|
358
|
+
(0, _defineProperty2.default)(this, "_objCount", void 0);
|
|
359
|
+
(0, _defineProperty2.default)(this, "className", void 0); // Enable legacy initializers
|
|
726
360
|
|
|
727
361
|
if (typeof this.initialize === 'function') {
|
|
728
362
|
this.initialize.apply(this, arguments);
|
|
@@ -741,9 +375,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
741
375
|
this.className = className.className;
|
|
742
376
|
toSet = {};
|
|
743
377
|
|
|
744
|
-
for (var
|
|
745
|
-
if (
|
|
746
|
-
toSet[
|
|
378
|
+
for (var _attr2 in className) {
|
|
379
|
+
if (_attr2 !== 'className') {
|
|
380
|
+
toSet[_attr2] = className[_attr2];
|
|
747
381
|
}
|
|
748
382
|
}
|
|
749
383
|
|
|
@@ -766,7 +400,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
766
400
|
(0, _createClass2.default)(ParseObject, [{
|
|
767
401
|
key: "attributes",
|
|
768
402
|
get:
|
|
769
|
-
|
|
403
|
+
/* Prototype getters / setters */
|
|
770
404
|
function ()
|
|
771
405
|
/*: AttributeMap*/
|
|
772
406
|
{
|
|
@@ -802,7 +436,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
802
436
|
{
|
|
803
437
|
return this._getServerData().updatedAt;
|
|
804
438
|
}
|
|
805
|
-
|
|
439
|
+
/* Private methods */
|
|
806
440
|
|
|
807
441
|
/**
|
|
808
442
|
* Returns a local or server Id used uniquely identify this object
|
|
@@ -869,8 +503,8 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
869
503
|
|
|
870
504
|
var unset = {};
|
|
871
505
|
|
|
872
|
-
for (var
|
|
873
|
-
unset[
|
|
506
|
+
for (var _attr4 in serverData) {
|
|
507
|
+
unset[_attr4] = undefined;
|
|
874
508
|
}
|
|
875
509
|
|
|
876
510
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
@@ -916,8 +550,8 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
916
550
|
var objectCache = stateController.getObjectCache(this._getStateIdentifier());
|
|
917
551
|
var dirty = {};
|
|
918
552
|
|
|
919
|
-
for (var
|
|
920
|
-
var val = attributes[
|
|
553
|
+
for (var _attr6 in attributes) {
|
|
554
|
+
var val = attributes[_attr6];
|
|
921
555
|
|
|
922
556
|
if (val && (0, _typeof2.default)(val) === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
|
|
923
557
|
// Due to the way browsers construct maps, the key order will not change
|
|
@@ -926,13 +560,13 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
926
560
|
var json = (0, _encode.default)(val, false, true);
|
|
927
561
|
var stringified = (0, _stringify.default)(json);
|
|
928
562
|
|
|
929
|
-
if (objectCache[
|
|
930
|
-
dirty[
|
|
563
|
+
if (objectCache[_attr6] !== stringified) {
|
|
564
|
+
dirty[_attr6] = val;
|
|
931
565
|
}
|
|
932
566
|
} catch (e) {
|
|
933
567
|
// Error occurred, possibly by a nested unsaved pointer in a mutable container
|
|
934
568
|
// No matter how it happened, it indicates a change in the attribute
|
|
935
|
-
dirty[
|
|
569
|
+
dirty[_attr6] = val;
|
|
936
570
|
}
|
|
937
571
|
}
|
|
938
572
|
}
|
|
@@ -1039,14 +673,14 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1039
673
|
stateController.initializeState(this._getStateIdentifier());
|
|
1040
674
|
var decoded = {};
|
|
1041
675
|
|
|
1042
|
-
for (var
|
|
1043
|
-
if (
|
|
1044
|
-
decoded[
|
|
1045
|
-
} else if (
|
|
1046
|
-
decoded[
|
|
676
|
+
for (var _attr8 in serverData) {
|
|
677
|
+
if (_attr8 === 'ACL') {
|
|
678
|
+
decoded[_attr8] = new _ParseACL.default(serverData[_attr8]);
|
|
679
|
+
} else if (_attr8 !== 'objectId') {
|
|
680
|
+
decoded[_attr8] = (0, _decode.default)(serverData[_attr8]);
|
|
1047
681
|
|
|
1048
|
-
if (decoded[
|
|
1049
|
-
decoded[
|
|
682
|
+
if (decoded[_attr8] instanceof _ParseRelation.default) {
|
|
683
|
+
decoded[_attr8]._ensureParentAndKey(this, _attr8);
|
|
1050
684
|
}
|
|
1051
685
|
}
|
|
1052
686
|
}
|
|
@@ -1164,7 +798,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1164
798
|
}, {
|
|
1165
799
|
key: "initialize",
|
|
1166
800
|
value:
|
|
1167
|
-
|
|
801
|
+
/* Public methods */
|
|
1168
802
|
function () {// NOOP
|
|
1169
803
|
}
|
|
1170
804
|
/**
|
|
@@ -1189,18 +823,18 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1189
823
|
var json = {};
|
|
1190
824
|
var attrs = this.attributes;
|
|
1191
825
|
|
|
1192
|
-
for (var
|
|
1193
|
-
if ((
|
|
1194
|
-
json[
|
|
826
|
+
for (var _attr10 in attrs) {
|
|
827
|
+
if ((_attr10 === 'createdAt' || _attr10 === 'updatedAt') && attrs[_attr10].toJSON) {
|
|
828
|
+
json[_attr10] = attrs[_attr10].toJSON();
|
|
1195
829
|
} else {
|
|
1196
|
-
json[
|
|
830
|
+
json[_attr10] = (0, _encode.default)(attrs[_attr10], false, false, seen, offline);
|
|
1197
831
|
}
|
|
1198
832
|
}
|
|
1199
833
|
|
|
1200
834
|
var pending = this._getPendingOps();
|
|
1201
835
|
|
|
1202
|
-
for (var
|
|
1203
|
-
json[
|
|
836
|
+
for (var _attr12 in pending[0]) {
|
|
837
|
+
json[_attr12] = pending[0][_attr12].toJSON(offline);
|
|
1204
838
|
}
|
|
1205
839
|
|
|
1206
840
|
if (this.id) {
|
|
@@ -1293,15 +927,15 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1293
927
|
var keys = {};
|
|
1294
928
|
|
|
1295
929
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
1296
|
-
for (var
|
|
1297
|
-
keys[
|
|
930
|
+
for (var _attr14 in pendingOps[i]) {
|
|
931
|
+
keys[_attr14] = true;
|
|
1298
932
|
}
|
|
1299
933
|
}
|
|
1300
934
|
|
|
1301
935
|
var dirtyObjects = this._getDirtyObjectAttributes();
|
|
1302
936
|
|
|
1303
|
-
for (var
|
|
1304
|
-
keys[
|
|
937
|
+
for (var _attr16 in dirtyObjects) {
|
|
938
|
+
keys[_attr16] = true;
|
|
1305
939
|
}
|
|
1306
940
|
|
|
1307
941
|
return (0, _keys.default)(keys);
|
|
@@ -1557,11 +1191,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1557
1191
|
|
|
1558
1192
|
var newValues = {};
|
|
1559
1193
|
|
|
1560
|
-
for (var
|
|
1561
|
-
if (newOps[
|
|
1562
|
-
newValues[
|
|
1563
|
-
} else if (!(newOps[
|
|
1564
|
-
newValues[
|
|
1194
|
+
for (var _attr18 in newOps) {
|
|
1195
|
+
if (newOps[_attr18] instanceof _ParseOp.RelationOp) {
|
|
1196
|
+
newValues[_attr18] = newOps[_attr18].applyTo(currentAttributes[_attr18], this, _attr18);
|
|
1197
|
+
} else if (!(newOps[_attr18] instanceof _ParseOp.UnsetOp)) {
|
|
1198
|
+
newValues[_attr18] = newOps[_attr18].applyTo(currentAttributes[_attr18]);
|
|
1565
1199
|
}
|
|
1566
1200
|
} // Validate changes
|
|
1567
1201
|
|
|
@@ -1585,10 +1219,10 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1585
1219
|
|
|
1586
1220
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
1587
1221
|
|
|
1588
|
-
for (var
|
|
1589
|
-
var nextOp = newOps[
|
|
1222
|
+
for (var _attr20 in newOps) {
|
|
1223
|
+
var nextOp = newOps[_attr20].mergeWith(pendingOps[last][_attr20]);
|
|
1590
1224
|
|
|
1591
|
-
stateController.setPendingOp(this._getStateIdentifier(),
|
|
1225
|
+
stateController.setPendingOp(this._getStateIdentifier(), _attr20, nextOp);
|
|
1592
1226
|
}
|
|
1593
1227
|
|
|
1594
1228
|
return this;
|
|
@@ -1800,7 +1434,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1800
1434
|
* object.op("x") would return an instance of Parse.Op.Increment.
|
|
1801
1435
|
*
|
|
1802
1436
|
* @param attr {String} The key.
|
|
1803
|
-
* @returns {Parse.Op} The operation, or undefined if none.
|
|
1437
|
+
* @returns {Parse.Op | undefined} The operation, or undefined if none.
|
|
1804
1438
|
*/
|
|
1805
1439
|
|
|
1806
1440
|
}, {
|
|
@@ -1936,53 +1570,51 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1936
1570
|
}, {
|
|
1937
1571
|
key: "exists",
|
|
1938
1572
|
value: function () {
|
|
1939
|
-
var _exists = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
1573
|
+
var _exists = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options
|
|
1940
1574
|
/*:: ?: RequestOptions*/
|
|
1941
1575
|
) {
|
|
1942
1576
|
var query;
|
|
1943
|
-
return
|
|
1944
|
-
while (1) {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
}
|
|
1577
|
+
return _regenerator.default.wrap(function (_context) {
|
|
1578
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1579
|
+
case 0:
|
|
1580
|
+
if (this.id) {
|
|
1581
|
+
_context.next = 2;
|
|
1582
|
+
break;
|
|
1583
|
+
}
|
|
1951
1584
|
|
|
1952
|
-
|
|
1585
|
+
return _context.abrupt("return", false);
|
|
1953
1586
|
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1587
|
+
case 2:
|
|
1588
|
+
_context.prev = 2;
|
|
1589
|
+
query = new _ParseQuery.default(this.className);
|
|
1590
|
+
_context.next = 6;
|
|
1591
|
+
return query.get(this.id, options);
|
|
1959
1592
|
|
|
1960
|
-
|
|
1961
|
-
|
|
1593
|
+
case 6:
|
|
1594
|
+
return _context.abrupt("return", true);
|
|
1962
1595
|
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1596
|
+
case 9:
|
|
1597
|
+
_context.prev = 9;
|
|
1598
|
+
_context.t0 = _context["catch"](2);
|
|
1966
1599
|
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1600
|
+
if (!(_context.t0.code === _ParseError.default.OBJECT_NOT_FOUND)) {
|
|
1601
|
+
_context.next = 13;
|
|
1602
|
+
break;
|
|
1603
|
+
}
|
|
1971
1604
|
|
|
1972
|
-
|
|
1605
|
+
return _context.abrupt("return", false);
|
|
1973
1606
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1607
|
+
case 13:
|
|
1608
|
+
throw _context.t0;
|
|
1976
1609
|
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
}
|
|
1610
|
+
case 14:
|
|
1611
|
+
case "end":
|
|
1612
|
+
return _context.stop();
|
|
1981
1613
|
}
|
|
1982
1614
|
}, _callee, this, [[2, 9]]);
|
|
1983
1615
|
}));
|
|
1984
1616
|
|
|
1985
|
-
function exists(
|
|
1617
|
+
function exists() {
|
|
1986
1618
|
return _exists.apply(this, arguments);
|
|
1987
1619
|
}
|
|
1988
1620
|
|
|
@@ -1996,7 +1628,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1996
1628
|
|
|
1997
1629
|
}, {
|
|
1998
1630
|
key: "isValid",
|
|
1999
|
-
value: function
|
|
1631
|
+
value: function ()
|
|
2000
1632
|
/*: boolean*/
|
|
2001
1633
|
{
|
|
2002
1634
|
return !this.validate(this.attributes);
|
|
@@ -2014,7 +1646,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2014
1646
|
|
|
2015
1647
|
}, {
|
|
2016
1648
|
key: "validate",
|
|
2017
|
-
value: function
|
|
1649
|
+
value: function (attrs
|
|
2018
1650
|
/*: AttributeMap*/
|
|
2019
1651
|
)
|
|
2020
1652
|
/*: ParseError | boolean*/
|
|
@@ -2023,8 +1655,8 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2023
1655
|
return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
|
|
2024
1656
|
}
|
|
2025
1657
|
|
|
2026
|
-
for (var
|
|
2027
|
-
if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(
|
|
1658
|
+
for (var _key2 in attrs) {
|
|
1659
|
+
if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(_key2)) {
|
|
2028
1660
|
return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME);
|
|
2029
1661
|
}
|
|
2030
1662
|
}
|
|
@@ -2040,7 +1672,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2040
1672
|
|
|
2041
1673
|
}, {
|
|
2042
1674
|
key: "getACL",
|
|
2043
|
-
value: function
|
|
1675
|
+
value: function ()
|
|
2044
1676
|
/*: ?ParseACL*/
|
|
2045
1677
|
{
|
|
2046
1678
|
var acl = this.get('ACL');
|
|
@@ -2062,7 +1694,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2062
1694
|
|
|
2063
1695
|
}, {
|
|
2064
1696
|
key: "setACL",
|
|
2065
|
-
value: function
|
|
1697
|
+
value: function (acl
|
|
2066
1698
|
/*: ParseACL*/
|
|
2067
1699
|
, options
|
|
2068
1700
|
/*:: ?: mixed*/
|
|
@@ -2079,13 +1711,13 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2079
1711
|
|
|
2080
1712
|
}, {
|
|
2081
1713
|
key: "revert",
|
|
2082
|
-
value: function
|
|
1714
|
+
value: function ()
|
|
2083
1715
|
/*: void*/
|
|
2084
1716
|
{
|
|
2085
1717
|
var keysToRevert;
|
|
2086
1718
|
|
|
2087
|
-
for (var _len = arguments.length, keys = new Array(_len),
|
|
2088
|
-
keys[
|
|
1719
|
+
for (var _len = arguments.length, keys = new Array(_len), _key3 = 0; _key3 < _len; _key3++) {
|
|
1720
|
+
keys[_key3] = arguments[_key3];
|
|
2089
1721
|
}
|
|
2090
1722
|
|
|
2091
1723
|
if (keys.length) {
|
|
@@ -2096,10 +1728,10 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2096
1728
|
|
|
2097
1729
|
try {
|
|
2098
1730
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2099
|
-
var
|
|
1731
|
+
var _key4 = _step.value;
|
|
2100
1732
|
|
|
2101
|
-
if (typeof
|
|
2102
|
-
keysToRevert.push(
|
|
1733
|
+
if (typeof _key4 === 'string') {
|
|
1734
|
+
keysToRevert.push(_key4);
|
|
2103
1735
|
} else {
|
|
2104
1736
|
throw new Error('Parse.Object#revert expects either no, or a list of string, arguments.');
|
|
2105
1737
|
}
|
|
@@ -2121,7 +1753,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2121
1753
|
|
|
2122
1754
|
}, {
|
|
2123
1755
|
key: "clear",
|
|
2124
|
-
value: function
|
|
1756
|
+
value: function ()
|
|
2125
1757
|
/*: ParseObject | boolean*/
|
|
2126
1758
|
{
|
|
2127
1759
|
var attributes = this.attributes;
|
|
@@ -2132,9 +1764,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2132
1764
|
readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());
|
|
2133
1765
|
}
|
|
2134
1766
|
|
|
2135
|
-
for (var
|
|
2136
|
-
if ((0, _indexOf.default)(readonly).call(readonly,
|
|
2137
|
-
erasable[
|
|
1767
|
+
for (var _attr22 in attributes) {
|
|
1768
|
+
if ((0, _indexOf.default)(readonly).call(readonly, _attr22) < 0) {
|
|
1769
|
+
erasable[_attr22] = true;
|
|
2138
1770
|
}
|
|
2139
1771
|
}
|
|
2140
1772
|
|
|
@@ -2162,7 +1794,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2162
1794
|
|
|
2163
1795
|
}, {
|
|
2164
1796
|
key: "fetch",
|
|
2165
|
-
value: function
|
|
1797
|
+
value: function (options
|
|
2166
1798
|
/*: RequestOptions*/
|
|
2167
1799
|
)
|
|
2168
1800
|
/*: Promise*/
|
|
@@ -2227,7 +1859,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2227
1859
|
|
|
2228
1860
|
}, {
|
|
2229
1861
|
key: "fetchWithInclude",
|
|
2230
|
-
value: function
|
|
1862
|
+
value: function (keys
|
|
2231
1863
|
/*: String | Array<string | Array<string>>*/
|
|
2232
1864
|
, options
|
|
2233
1865
|
/*: RequestOptions*/
|
|
@@ -2266,48 +1898,46 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2266
1898
|
}, {
|
|
2267
1899
|
key: "saveEventually",
|
|
2268
1900
|
value: function () {
|
|
2269
|
-
var _saveEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
1901
|
+
var _saveEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options
|
|
2270
1902
|
/*: SaveOptions*/
|
|
2271
1903
|
) {
|
|
2272
|
-
return
|
|
2273
|
-
while (1) {
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
return this.save(null, options);
|
|
1904
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
1905
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1906
|
+
case 0:
|
|
1907
|
+
_context4.prev = 0;
|
|
1908
|
+
_context4.next = 3;
|
|
1909
|
+
return this.save(null, options);
|
|
2279
1910
|
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
1911
|
+
case 3:
|
|
1912
|
+
_context4.next = 11;
|
|
1913
|
+
break;
|
|
2283
1914
|
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
1915
|
+
case 5:
|
|
1916
|
+
_context4.prev = 5;
|
|
1917
|
+
_context4.t0 = _context4["catch"](0);
|
|
2287
1918
|
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
1919
|
+
if (!(_context4.t0.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"')) {
|
|
1920
|
+
_context4.next = 11;
|
|
1921
|
+
break;
|
|
1922
|
+
}
|
|
2292
1923
|
|
|
2293
|
-
|
|
2294
|
-
|
|
1924
|
+
_context4.next = 10;
|
|
1925
|
+
return _EventuallyQueue.default.save(this, options);
|
|
2295
1926
|
|
|
2296
|
-
|
|
2297
|
-
|
|
1927
|
+
case 10:
|
|
1928
|
+
_EventuallyQueue.default.poll();
|
|
2298
1929
|
|
|
2299
|
-
|
|
2300
|
-
|
|
1930
|
+
case 11:
|
|
1931
|
+
return _context4.abrupt("return", this);
|
|
2301
1932
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
}
|
|
1933
|
+
case 12:
|
|
1934
|
+
case "end":
|
|
1935
|
+
return _context4.stop();
|
|
2306
1936
|
}
|
|
2307
1937
|
}, _callee2, this, [[0, 5]]);
|
|
2308
1938
|
}));
|
|
2309
1939
|
|
|
2310
|
-
function saveEventually(
|
|
1940
|
+
function saveEventually() {
|
|
2311
1941
|
return _saveEventually.apply(this, arguments);
|
|
2312
1942
|
}
|
|
2313
1943
|
|
|
@@ -2379,7 +2009,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2379
2009
|
|
|
2380
2010
|
}, {
|
|
2381
2011
|
key: "save",
|
|
2382
|
-
value: function
|
|
2012
|
+
value: function (arg1
|
|
2383
2013
|
/*: ?string | { [attr: string]: mixed }*/
|
|
2384
2014
|
, arg2
|
|
2385
2015
|
/*: SaveOptions | mixed*/
|
|
@@ -2467,48 +2097,46 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2467
2097
|
}, {
|
|
2468
2098
|
key: "destroyEventually",
|
|
2469
2099
|
value: function () {
|
|
2470
|
-
var _destroyEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
2100
|
+
var _destroyEventually = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(options
|
|
2471
2101
|
/*: RequestOptions*/
|
|
2472
2102
|
) {
|
|
2473
|
-
return
|
|
2474
|
-
while (1) {
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
return this.destroy(options);
|
|
2103
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
2104
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
2105
|
+
case 0:
|
|
2106
|
+
_context5.prev = 0;
|
|
2107
|
+
_context5.next = 3;
|
|
2108
|
+
return this.destroy(options);
|
|
2480
2109
|
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2110
|
+
case 3:
|
|
2111
|
+
_context5.next = 11;
|
|
2112
|
+
break;
|
|
2484
2113
|
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2114
|
+
case 5:
|
|
2115
|
+
_context5.prev = 5;
|
|
2116
|
+
_context5.t0 = _context5["catch"](0);
|
|
2488
2117
|
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2118
|
+
if (!(_context5.t0.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"')) {
|
|
2119
|
+
_context5.next = 11;
|
|
2120
|
+
break;
|
|
2121
|
+
}
|
|
2493
2122
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2123
|
+
_context5.next = 10;
|
|
2124
|
+
return _EventuallyQueue.default.destroy(this, options);
|
|
2496
2125
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2126
|
+
case 10:
|
|
2127
|
+
_EventuallyQueue.default.poll();
|
|
2499
2128
|
|
|
2500
|
-
|
|
2501
|
-
|
|
2129
|
+
case 11:
|
|
2130
|
+
return _context5.abrupt("return", this);
|
|
2502
2131
|
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
}
|
|
2132
|
+
case 12:
|
|
2133
|
+
case "end":
|
|
2134
|
+
return _context5.stop();
|
|
2507
2135
|
}
|
|
2508
2136
|
}, _callee3, this, [[0, 5]]);
|
|
2509
2137
|
}));
|
|
2510
2138
|
|
|
2511
|
-
function destroyEventually(
|
|
2139
|
+
function destroyEventually() {
|
|
2512
2140
|
return _destroyEventually.apply(this, arguments);
|
|
2513
2141
|
}
|
|
2514
2142
|
|
|
@@ -2531,7 +2159,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2531
2159
|
|
|
2532
2160
|
}, {
|
|
2533
2161
|
key: "destroy",
|
|
2534
|
-
value: function
|
|
2162
|
+
value: function (options
|
|
2535
2163
|
/*: RequestOptions*/
|
|
2536
2164
|
)
|
|
2537
2165
|
/*: Promise*/
|
|
@@ -2576,7 +2204,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2576
2204
|
|
|
2577
2205
|
}, {
|
|
2578
2206
|
key: "pin",
|
|
2579
|
-
value: function
|
|
2207
|
+
value: function ()
|
|
2580
2208
|
/*: Promise<void>*/
|
|
2581
2209
|
{
|
|
2582
2210
|
return ParseObject.pinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, [this]);
|
|
@@ -2594,7 +2222,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2594
2222
|
|
|
2595
2223
|
}, {
|
|
2596
2224
|
key: "unPin",
|
|
2597
|
-
value: function
|
|
2225
|
+
value: function ()
|
|
2598
2226
|
/*: Promise<void>*/
|
|
2599
2227
|
{
|
|
2600
2228
|
return ParseObject.unPinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, [this]);
|
|
@@ -2612,34 +2240,32 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2612
2240
|
}, {
|
|
2613
2241
|
key: "isPinned",
|
|
2614
2242
|
value: function () {
|
|
2615
|
-
var _isPinned = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
2243
|
+
var _isPinned = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
2616
2244
|
var localDatastore, objectKey, pin;
|
|
2617
|
-
return
|
|
2618
|
-
while (1) {
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
localDatastore = _CoreManager.default.getLocalDatastore();
|
|
2245
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
2246
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
2247
|
+
case 0:
|
|
2248
|
+
localDatastore = _CoreManager.default.getLocalDatastore();
|
|
2622
2249
|
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2250
|
+
if (localDatastore.isEnabled) {
|
|
2251
|
+
_context6.next = 3;
|
|
2252
|
+
break;
|
|
2253
|
+
}
|
|
2627
2254
|
|
|
2628
|
-
|
|
2255
|
+
return _context6.abrupt("return", _promise.default.reject('Parse.enableLocalDatastore() must be called first'));
|
|
2629
2256
|
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2257
|
+
case 3:
|
|
2258
|
+
objectKey = localDatastore.getKeyForObject(this);
|
|
2259
|
+
_context6.next = 6;
|
|
2260
|
+
return localDatastore.fromPinWithName(objectKey);
|
|
2634
2261
|
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2262
|
+
case 6:
|
|
2263
|
+
pin = _context6.sent;
|
|
2264
|
+
return _context6.abrupt("return", pin.length > 0);
|
|
2638
2265
|
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
}
|
|
2266
|
+
case 8:
|
|
2267
|
+
case "end":
|
|
2268
|
+
return _context6.stop();
|
|
2643
2269
|
}
|
|
2644
2270
|
}, _callee4, this);
|
|
2645
2271
|
}));
|
|
@@ -2669,7 +2295,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2669
2295
|
|
|
2670
2296
|
}, {
|
|
2671
2297
|
key: "pinWithName",
|
|
2672
|
-
value: function
|
|
2298
|
+
value: function (name
|
|
2673
2299
|
/*: string*/
|
|
2674
2300
|
)
|
|
2675
2301
|
/*: Promise<void>*/
|
|
@@ -2689,7 +2315,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2689
2315
|
|
|
2690
2316
|
}, {
|
|
2691
2317
|
key: "unPinWithName",
|
|
2692
|
-
value: function
|
|
2318
|
+
value: function (name
|
|
2693
2319
|
/*: string*/
|
|
2694
2320
|
)
|
|
2695
2321
|
/*: Promise<void>*/
|
|
@@ -2712,47 +2338,45 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2712
2338
|
}, {
|
|
2713
2339
|
key: "fetchFromLocalDatastore",
|
|
2714
2340
|
value: function () {
|
|
2715
|
-
var _fetchFromLocalDatastore = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
2341
|
+
var _fetchFromLocalDatastore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
2716
2342
|
var localDatastore, objectKey, pinned, result;
|
|
2717
|
-
return
|
|
2718
|
-
while (1) {
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
localDatastore = _CoreManager.default.getLocalDatastore();
|
|
2343
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
2344
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
2345
|
+
case 0:
|
|
2346
|
+
localDatastore = _CoreManager.default.getLocalDatastore();
|
|
2722
2347
|
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2348
|
+
if (localDatastore.isEnabled) {
|
|
2349
|
+
_context7.next = 3;
|
|
2350
|
+
break;
|
|
2351
|
+
}
|
|
2727
2352
|
|
|
2728
|
-
|
|
2353
|
+
throw new Error('Parse.enableLocalDatastore() must be called first');
|
|
2729
2354
|
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2355
|
+
case 3:
|
|
2356
|
+
objectKey = localDatastore.getKeyForObject(this);
|
|
2357
|
+
_context7.next = 6;
|
|
2358
|
+
return localDatastore._serializeObject(objectKey);
|
|
2734
2359
|
|
|
2735
|
-
|
|
2736
|
-
|
|
2360
|
+
case 6:
|
|
2361
|
+
pinned = _context7.sent;
|
|
2737
2362
|
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2363
|
+
if (pinned) {
|
|
2364
|
+
_context7.next = 9;
|
|
2365
|
+
break;
|
|
2366
|
+
}
|
|
2742
2367
|
|
|
2743
|
-
|
|
2368
|
+
throw new Error('Cannot fetch an unsaved ParseObject');
|
|
2744
2369
|
|
|
2745
|
-
|
|
2746
|
-
|
|
2370
|
+
case 9:
|
|
2371
|
+
result = ParseObject.fromJSON(pinned);
|
|
2747
2372
|
|
|
2748
|
-
|
|
2373
|
+
this._finishFetch(result.toJSON());
|
|
2749
2374
|
|
|
2750
|
-
|
|
2375
|
+
return _context7.abrupt("return", this);
|
|
2751
2376
|
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
}
|
|
2377
|
+
case 12:
|
|
2378
|
+
case "end":
|
|
2379
|
+
return _context7.stop();
|
|
2756
2380
|
}
|
|
2757
2381
|
}, _callee5, this);
|
|
2758
2382
|
}));
|
|
@@ -2763,16 +2387,16 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2763
2387
|
|
|
2764
2388
|
return fetchFromLocalDatastore;
|
|
2765
2389
|
}()
|
|
2766
|
-
|
|
2390
|
+
/* Static methods */
|
|
2767
2391
|
|
|
2768
2392
|
}], [{
|
|
2769
2393
|
key: "_getClassMap",
|
|
2770
|
-
value: function
|
|
2394
|
+
value: function () {
|
|
2771
2395
|
return classMap;
|
|
2772
2396
|
}
|
|
2773
2397
|
}, {
|
|
2774
2398
|
key: "_clearAllState",
|
|
2775
|
-
value: function
|
|
2399
|
+
value: function () {
|
|
2776
2400
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
2777
2401
|
|
|
2778
2402
|
stateController.clearAllState();
|
|
@@ -2806,7 +2430,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2806
2430
|
|
|
2807
2431
|
}, {
|
|
2808
2432
|
key: "fetchAll",
|
|
2809
|
-
value: function
|
|
2433
|
+
value: function (list
|
|
2810
2434
|
/*: Array<ParseObject>*/
|
|
2811
2435
|
) {
|
|
2812
2436
|
var options
|
|
@@ -2860,7 +2484,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2860
2484
|
|
|
2861
2485
|
}, {
|
|
2862
2486
|
key: "fetchAllWithInclude",
|
|
2863
|
-
value: function
|
|
2487
|
+
value: function (list
|
|
2864
2488
|
/*: Array<ParseObject>*/
|
|
2865
2489
|
, keys
|
|
2866
2490
|
/*: String | Array<string | Array<string>>*/
|
|
@@ -2904,7 +2528,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2904
2528
|
|
|
2905
2529
|
}, {
|
|
2906
2530
|
key: "fetchAllIfNeededWithInclude",
|
|
2907
|
-
value: function
|
|
2531
|
+
value: function (list
|
|
2908
2532
|
/*: Array<ParseObject>*/
|
|
2909
2533
|
, keys
|
|
2910
2534
|
/*: String | Array<string | Array<string>>*/
|
|
@@ -2936,7 +2560,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2936
2560
|
|
|
2937
2561
|
}, {
|
|
2938
2562
|
key: "fetchAllIfNeeded",
|
|
2939
|
-
value: function
|
|
2563
|
+
value: function (list
|
|
2940
2564
|
/*: Array<ParseObject>*/
|
|
2941
2565
|
, options) {
|
|
2942
2566
|
options = options || {};
|
|
@@ -2958,7 +2582,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2958
2582
|
}
|
|
2959
2583
|
}, {
|
|
2960
2584
|
key: "handleIncludeOptions",
|
|
2961
|
-
value: function
|
|
2585
|
+
value: function (options) {
|
|
2962
2586
|
var include = [];
|
|
2963
2587
|
|
|
2964
2588
|
if ((0, _isArray.default)(options.include)) {
|
|
@@ -3026,7 +2650,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3026
2650
|
|
|
3027
2651
|
}, {
|
|
3028
2652
|
key: "destroyAll",
|
|
3029
|
-
value: function
|
|
2653
|
+
value: function (list
|
|
3030
2654
|
/*: Array<ParseObject>*/
|
|
3031
2655
|
) {
|
|
3032
2656
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -3071,7 +2695,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3071
2695
|
|
|
3072
2696
|
}, {
|
|
3073
2697
|
key: "saveAll",
|
|
3074
|
-
value: function
|
|
2698
|
+
value: function (list
|
|
3075
2699
|
/*: Array<ParseObject>*/
|
|
3076
2700
|
) {
|
|
3077
2701
|
var options
|
|
@@ -3114,7 +2738,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3114
2738
|
|
|
3115
2739
|
}, {
|
|
3116
2740
|
key: "createWithoutData",
|
|
3117
|
-
value: function
|
|
2741
|
+
value: function (id
|
|
3118
2742
|
/*: string*/
|
|
3119
2743
|
) {
|
|
3120
2744
|
var obj = new this();
|
|
@@ -3134,7 +2758,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3134
2758
|
|
|
3135
2759
|
}, {
|
|
3136
2760
|
key: "fromJSON",
|
|
3137
|
-
value: function
|
|
2761
|
+
value: function (json
|
|
3138
2762
|
/*: any*/
|
|
3139
2763
|
, override
|
|
3140
2764
|
/*:: ?: boolean*/
|
|
@@ -3149,12 +2773,12 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3149
2773
|
var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
|
|
3150
2774
|
var otherAttributes = {};
|
|
3151
2775
|
|
|
3152
|
-
for (var
|
|
3153
|
-
if (
|
|
3154
|
-
otherAttributes[
|
|
2776
|
+
for (var _attr24 in json) {
|
|
2777
|
+
if (_attr24 !== 'className' && _attr24 !== '__type') {
|
|
2778
|
+
otherAttributes[_attr24] = json[_attr24];
|
|
3155
2779
|
|
|
3156
2780
|
if (dirty) {
|
|
3157
|
-
o.set(
|
|
2781
|
+
o.set(_attr24, json[_attr24]);
|
|
3158
2782
|
}
|
|
3159
2783
|
}
|
|
3160
2784
|
}
|
|
@@ -3198,7 +2822,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3198
2822
|
|
|
3199
2823
|
}, {
|
|
3200
2824
|
key: "registerSubclass",
|
|
3201
|
-
value: function
|
|
2825
|
+
value: function (className
|
|
3202
2826
|
/*: string*/
|
|
3203
2827
|
, constructor
|
|
3204
2828
|
/*: any*/
|
|
@@ -3229,7 +2853,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3229
2853
|
|
|
3230
2854
|
}, {
|
|
3231
2855
|
key: "unregisterSubclass",
|
|
3232
|
-
value: function
|
|
2856
|
+
value: function (className
|
|
3233
2857
|
/*: string*/
|
|
3234
2858
|
) {
|
|
3235
2859
|
if (typeof className !== 'string') {
|
|
@@ -3278,7 +2902,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3278
2902
|
|
|
3279
2903
|
}, {
|
|
3280
2904
|
key: "extend",
|
|
3281
|
-
value: function
|
|
2905
|
+
value: function (className
|
|
3282
2906
|
/*: any*/
|
|
3283
2907
|
, protoProps
|
|
3284
2908
|
/*: any*/
|
|
@@ -3303,11 +2927,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3303
2927
|
|
|
3304
2928
|
if (this.hasOwnProperty('__super__') && this.__super__) {
|
|
3305
2929
|
parentProto = this.prototype;
|
|
3306
|
-
} else if (classMap[adjustedClassName]) {
|
|
3307
|
-
parentProto = classMap[adjustedClassName].prototype;
|
|
3308
2930
|
}
|
|
3309
2931
|
|
|
3310
|
-
var ParseObjectSubclass = function
|
|
2932
|
+
var ParseObjectSubclass = function (attributes, options) {
|
|
3311
2933
|
this.className = adjustedClassName;
|
|
3312
2934
|
this._objCount = objectCount++; // Enable legacy initializers
|
|
3313
2935
|
|
|
@@ -3315,6 +2937,22 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3315
2937
|
this.initialize.apply(this, arguments);
|
|
3316
2938
|
}
|
|
3317
2939
|
|
|
2940
|
+
if (this._initializers) {
|
|
2941
|
+
var _iterator2 = _createForOfIteratorHelper(this._initializers),
|
|
2942
|
+
_step2;
|
|
2943
|
+
|
|
2944
|
+
try {
|
|
2945
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
2946
|
+
var initializer = _step2.value;
|
|
2947
|
+
initializer.apply(this, arguments);
|
|
2948
|
+
}
|
|
2949
|
+
} catch (err) {
|
|
2950
|
+
_iterator2.e(err);
|
|
2951
|
+
} finally {
|
|
2952
|
+
_iterator2.f();
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
|
|
3318
2956
|
if (attributes && (0, _typeof2.default)(attributes) === 'object') {
|
|
3319
2957
|
if (!this.set(attributes || {}, options)) {
|
|
3320
2958
|
throw new Error("Can't create an invalid Parse Object");
|
|
@@ -3322,21 +2960,46 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3322
2960
|
}
|
|
3323
2961
|
};
|
|
3324
2962
|
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
2963
|
+
if (classMap[adjustedClassName]) {
|
|
2964
|
+
ParseObjectSubclass = classMap[adjustedClassName];
|
|
2965
|
+
} else {
|
|
2966
|
+
ParseObjectSubclass.extend = function (name, protoProps, classProps) {
|
|
2967
|
+
if (typeof name === 'string') {
|
|
2968
|
+
return ParseObject.extend.call(ParseObjectSubclass, name, protoProps, classProps);
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
return ParseObject.extend.call(ParseObjectSubclass, adjustedClassName, name, protoProps);
|
|
2972
|
+
};
|
|
2973
|
+
|
|
2974
|
+
ParseObjectSubclass.createWithoutData = ParseObject.createWithoutData;
|
|
2975
|
+
ParseObjectSubclass.className = adjustedClassName;
|
|
2976
|
+
ParseObjectSubclass.__super__ = parentProto;
|
|
2977
|
+
ParseObjectSubclass.prototype = (0, _create.default)(parentProto, {
|
|
2978
|
+
constructor: {
|
|
2979
|
+
value: ParseObjectSubclass,
|
|
2980
|
+
enumerable: false,
|
|
2981
|
+
writable: true,
|
|
2982
|
+
configurable: true
|
|
2983
|
+
}
|
|
2984
|
+
});
|
|
2985
|
+
}
|
|
3335
2986
|
|
|
3336
2987
|
if (protoProps) {
|
|
3337
2988
|
for (var prop in protoProps) {
|
|
2989
|
+
if (prop === 'initialize') {
|
|
2990
|
+
var _context9;
|
|
2991
|
+
|
|
2992
|
+
(0, _defineProperty3.default)(ParseObjectSubclass.prototype, '_initializers', {
|
|
2993
|
+
value: (0, _concat.default)(_context9 = []).call(_context9, (0, _toConsumableArray2.default)(ParseObjectSubclass.prototype._initializers || []), [protoProps[prop]]),
|
|
2994
|
+
enumerable: false,
|
|
2995
|
+
writable: true,
|
|
2996
|
+
configurable: true
|
|
2997
|
+
});
|
|
2998
|
+
continue;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3338
3001
|
if (prop !== 'className') {
|
|
3339
|
-
(0,
|
|
3002
|
+
(0, _defineProperty3.default)(ParseObjectSubclass.prototype, prop, {
|
|
3340
3003
|
value: protoProps[prop],
|
|
3341
3004
|
enumerable: false,
|
|
3342
3005
|
writable: true,
|
|
@@ -3347,10 +3010,10 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3347
3010
|
}
|
|
3348
3011
|
|
|
3349
3012
|
if (classProps) {
|
|
3350
|
-
for (var
|
|
3351
|
-
if (
|
|
3352
|
-
(0,
|
|
3353
|
-
value: classProps[
|
|
3013
|
+
for (var _prop2 in classProps) {
|
|
3014
|
+
if (_prop2 !== 'className') {
|
|
3015
|
+
(0, _defineProperty3.default)(ParseObjectSubclass, _prop2, {
|
|
3016
|
+
value: classProps[_prop2],
|
|
3354
3017
|
enumerable: false,
|
|
3355
3018
|
writable: true,
|
|
3356
3019
|
configurable: true
|
|
@@ -3359,15 +3022,6 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3359
3022
|
}
|
|
3360
3023
|
}
|
|
3361
3024
|
|
|
3362
|
-
ParseObjectSubclass.extend = function (name, protoProps, classProps) {
|
|
3363
|
-
if (typeof name === 'string') {
|
|
3364
|
-
return ParseObject.extend.call(ParseObjectSubclass, name, protoProps, classProps);
|
|
3365
|
-
}
|
|
3366
|
-
|
|
3367
|
-
return ParseObject.extend.call(ParseObjectSubclass, adjustedClassName, name, protoProps);
|
|
3368
|
-
};
|
|
3369
|
-
|
|
3370
|
-
ParseObjectSubclass.createWithoutData = ParseObject.createWithoutData;
|
|
3371
3025
|
classMap[adjustedClassName] = ParseObjectSubclass;
|
|
3372
3026
|
return ParseObjectSubclass;
|
|
3373
3027
|
}
|
|
@@ -3382,7 +3036,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3382
3036
|
|
|
3383
3037
|
}, {
|
|
3384
3038
|
key: "enableSingleInstance",
|
|
3385
|
-
value: function
|
|
3039
|
+
value: function () {
|
|
3386
3040
|
singleInstance = true;
|
|
3387
3041
|
|
|
3388
3042
|
_CoreManager.default.setObjectStateController(SingleInstanceStateController);
|
|
@@ -3398,7 +3052,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3398
3052
|
|
|
3399
3053
|
}, {
|
|
3400
3054
|
key: "disableSingleInstance",
|
|
3401
|
-
value: function
|
|
3055
|
+
value: function () {
|
|
3402
3056
|
singleInstance = false;
|
|
3403
3057
|
|
|
3404
3058
|
_CoreManager.default.setObjectStateController(UniqueInstanceStateController);
|
|
@@ -3424,7 +3078,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3424
3078
|
|
|
3425
3079
|
}, {
|
|
3426
3080
|
key: "pinAll",
|
|
3427
|
-
value: function
|
|
3081
|
+
value: function (objects
|
|
3428
3082
|
/*: Array<ParseObject>*/
|
|
3429
3083
|
)
|
|
3430
3084
|
/*: Promise<void>*/
|
|
@@ -3458,7 +3112,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3458
3112
|
|
|
3459
3113
|
}, {
|
|
3460
3114
|
key: "pinAllWithName",
|
|
3461
|
-
value: function
|
|
3115
|
+
value: function (name
|
|
3462
3116
|
/*: string*/
|
|
3463
3117
|
, objects
|
|
3464
3118
|
/*: Array<ParseObject>*/
|
|
@@ -3488,7 +3142,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3488
3142
|
|
|
3489
3143
|
}, {
|
|
3490
3144
|
key: "unPinAll",
|
|
3491
|
-
value: function
|
|
3145
|
+
value: function (objects
|
|
3492
3146
|
/*: Array<ParseObject>*/
|
|
3493
3147
|
)
|
|
3494
3148
|
/*: Promise<void>*/
|
|
@@ -3516,7 +3170,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3516
3170
|
|
|
3517
3171
|
}, {
|
|
3518
3172
|
key: "unPinAllWithName",
|
|
3519
|
-
value: function
|
|
3173
|
+
value: function (name
|
|
3520
3174
|
/*: string*/
|
|
3521
3175
|
, objects
|
|
3522
3176
|
/*: Array<ParseObject>*/
|
|
@@ -3544,7 +3198,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3544
3198
|
|
|
3545
3199
|
}, {
|
|
3546
3200
|
key: "unPinAllObjects",
|
|
3547
|
-
value: function
|
|
3201
|
+
value: function ()
|
|
3548
3202
|
/*: Promise<void>*/
|
|
3549
3203
|
{
|
|
3550
3204
|
var localDatastore = _CoreManager.default.getLocalDatastore();
|
|
@@ -3570,7 +3224,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3570
3224
|
|
|
3571
3225
|
}, {
|
|
3572
3226
|
key: "unPinAllObjectsWithName",
|
|
3573
|
-
value: function
|
|
3227
|
+
value: function (name
|
|
3574
3228
|
/*: string*/
|
|
3575
3229
|
)
|
|
3576
3230
|
/*: Promise<void>*/
|
|
@@ -3588,7 +3242,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
3588
3242
|
}();
|
|
3589
3243
|
|
|
3590
3244
|
var DefaultController = {
|
|
3591
|
-
fetch: function
|
|
3245
|
+
fetch: function (target
|
|
3592
3246
|
/*: ParseObject | Array<ParseObject>*/
|
|
3593
3247
|
, forceFetch
|
|
3594
3248
|
/*: boolean*/
|
|
@@ -3647,108 +3301,106 @@ var DefaultController = {
|
|
|
3647
3301
|
|
|
3648
3302
|
query._limit = ids.length;
|
|
3649
3303
|
return (0, _find.default)(query).call(query, options).then( /*#__PURE__*/function () {
|
|
3650
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
3651
|
-
var idMap, i, obj,
|
|
3652
|
-
|
|
3653
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context9) {
|
|
3654
|
-
while (1) {
|
|
3655
|
-
switch (_context9.prev = _context9.next) {
|
|
3656
|
-
case 0:
|
|
3657
|
-
idMap = {};
|
|
3658
|
-
(0, _forEach.default)(objects).call(objects, function (o) {
|
|
3659
|
-
idMap[o.id] = o;
|
|
3660
|
-
});
|
|
3661
|
-
i = 0;
|
|
3662
|
-
|
|
3663
|
-
case 3:
|
|
3664
|
-
if (!(i < objs.length)) {
|
|
3665
|
-
_context9.next = 11;
|
|
3666
|
-
break;
|
|
3667
|
-
}
|
|
3304
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(objects) {
|
|
3305
|
+
var idMap, i, obj, _i2, _obj, id, _iterator3, _step3, object;
|
|
3668
3306
|
|
|
3669
|
-
|
|
3307
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
3308
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
3309
|
+
case 0:
|
|
3310
|
+
idMap = {};
|
|
3311
|
+
(0, _forEach.default)(objects).call(objects, function (o) {
|
|
3312
|
+
idMap[o.id] = o;
|
|
3313
|
+
});
|
|
3314
|
+
i = 0;
|
|
3670
3315
|
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3316
|
+
case 3:
|
|
3317
|
+
if (!(i < objs.length)) {
|
|
3318
|
+
_context10.next = 11;
|
|
3319
|
+
break;
|
|
3320
|
+
}
|
|
3675
3321
|
|
|
3676
|
-
|
|
3677
|
-
_context9.next = 8;
|
|
3678
|
-
break;
|
|
3679
|
-
}
|
|
3322
|
+
obj = objs[i];
|
|
3680
3323
|
|
|
3681
|
-
|
|
3324
|
+
if (!(!obj || !obj.id || !idMap[obj.id])) {
|
|
3325
|
+
_context10.next = 8;
|
|
3326
|
+
break;
|
|
3327
|
+
}
|
|
3682
3328
|
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
_context9.next = 3;
|
|
3329
|
+
if (!forceFetch) {
|
|
3330
|
+
_context10.next = 8;
|
|
3686
3331
|
break;
|
|
3332
|
+
}
|
|
3687
3333
|
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3334
|
+
return _context10.abrupt("return", _promise.default.reject(new _ParseError.default(_ParseError.default.OBJECT_NOT_FOUND, 'All objects must exist on the server.')));
|
|
3335
|
+
|
|
3336
|
+
case 8:
|
|
3337
|
+
i++;
|
|
3338
|
+
_context10.next = 3;
|
|
3339
|
+
break;
|
|
3340
|
+
|
|
3341
|
+
case 11:
|
|
3342
|
+
if (!singleInstance) {
|
|
3343
|
+
// If single instance objects are disabled, we need to replace the
|
|
3344
|
+
for (_i2 = 0; _i2 < results.length; _i2++) {
|
|
3345
|
+
_obj = results[_i2];
|
|
3693
3346
|
|
|
3694
|
-
|
|
3695
|
-
|
|
3347
|
+
if (_obj && _obj.id && idMap[_obj.id]) {
|
|
3348
|
+
id = _obj.id;
|
|
3696
3349
|
|
|
3697
|
-
|
|
3350
|
+
_obj._finishFetch(idMap[id].toJSON());
|
|
3698
3351
|
|
|
3699
|
-
|
|
3700
|
-
}
|
|
3352
|
+
results[_i2] = idMap[id];
|
|
3701
3353
|
}
|
|
3702
3354
|
}
|
|
3355
|
+
}
|
|
3703
3356
|
|
|
3704
|
-
|
|
3705
|
-
|
|
3357
|
+
_iterator3 = _createForOfIteratorHelper(results);
|
|
3358
|
+
_context10.prev = 13;
|
|
3706
3359
|
|
|
3707
|
-
|
|
3360
|
+
_iterator3.s();
|
|
3708
3361
|
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3362
|
+
case 15:
|
|
3363
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
3364
|
+
_context10.next = 21;
|
|
3365
|
+
break;
|
|
3366
|
+
}
|
|
3714
3367
|
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3368
|
+
object = _step3.value;
|
|
3369
|
+
_context10.next = 19;
|
|
3370
|
+
return localDatastore._updateObjectIfPinned(object);
|
|
3718
3371
|
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3372
|
+
case 19:
|
|
3373
|
+
_context10.next = 15;
|
|
3374
|
+
break;
|
|
3722
3375
|
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3376
|
+
case 21:
|
|
3377
|
+
_context10.next = 26;
|
|
3378
|
+
break;
|
|
3726
3379
|
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3380
|
+
case 23:
|
|
3381
|
+
_context10.prev = 23;
|
|
3382
|
+
_context10.t0 = _context10["catch"](13);
|
|
3730
3383
|
|
|
3731
|
-
|
|
3384
|
+
_iterator3.e(_context10.t0);
|
|
3732
3385
|
|
|
3733
|
-
|
|
3734
|
-
|
|
3386
|
+
case 26:
|
|
3387
|
+
_context10.prev = 26;
|
|
3735
3388
|
|
|
3736
|
-
|
|
3389
|
+
_iterator3.f();
|
|
3737
3390
|
|
|
3738
|
-
|
|
3391
|
+
return _context10.finish(26);
|
|
3739
3392
|
|
|
3740
|
-
|
|
3741
|
-
|
|
3393
|
+
case 29:
|
|
3394
|
+
return _context10.abrupt("return", _promise.default.resolve(results));
|
|
3742
3395
|
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
}
|
|
3396
|
+
case 30:
|
|
3397
|
+
case "end":
|
|
3398
|
+
return _context10.stop();
|
|
3747
3399
|
}
|
|
3748
3400
|
}, _callee6, null, [[13, 23, 26, 29]]);
|
|
3749
3401
|
}));
|
|
3750
3402
|
|
|
3751
|
-
return function (
|
|
3403
|
+
return function () {
|
|
3752
3404
|
return _ref.apply(this, arguments);
|
|
3753
3405
|
};
|
|
3754
3406
|
}());
|
|
@@ -3766,32 +3418,30 @@ var DefaultController = {
|
|
|
3766
3418
|
}
|
|
3767
3419
|
|
|
3768
3420
|
return RESTController.request('GET', 'classes/' + target.className + '/' + target._getId(), params, options).then( /*#__PURE__*/function () {
|
|
3769
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
3770
|
-
return
|
|
3771
|
-
while (1) {
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
target._clearPendingOps();
|
|
3421
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(response) {
|
|
3422
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
3423
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
3424
|
+
case 0:
|
|
3425
|
+
target._clearPendingOps();
|
|
3775
3426
|
|
|
3776
|
-
|
|
3427
|
+
target._clearServerData();
|
|
3777
3428
|
|
|
3778
|
-
|
|
3429
|
+
target._finishFetch(response);
|
|
3779
3430
|
|
|
3780
|
-
|
|
3781
|
-
|
|
3431
|
+
_context11.next = 5;
|
|
3432
|
+
return localDatastore._updateObjectIfPinned(target);
|
|
3782
3433
|
|
|
3783
|
-
|
|
3784
|
-
|
|
3434
|
+
case 5:
|
|
3435
|
+
return _context11.abrupt("return", target);
|
|
3785
3436
|
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
}
|
|
3437
|
+
case 6:
|
|
3438
|
+
case "end":
|
|
3439
|
+
return _context11.stop();
|
|
3790
3440
|
}
|
|
3791
3441
|
}, _callee7);
|
|
3792
3442
|
}));
|
|
3793
3443
|
|
|
3794
|
-
return function (
|
|
3444
|
+
return function () {
|
|
3795
3445
|
return _ref2.apply(this, arguments);
|
|
3796
3446
|
};
|
|
3797
3447
|
}());
|
|
@@ -3799,178 +3449,172 @@ var DefaultController = {
|
|
|
3799
3449
|
|
|
3800
3450
|
return _promise.default.resolve();
|
|
3801
3451
|
},
|
|
3802
|
-
destroy: function
|
|
3452
|
+
destroy: function (target
|
|
3803
3453
|
/*: ParseObject | Array<ParseObject>*/
|
|
3804
3454
|
, options
|
|
3805
3455
|
/*: RequestOptions*/
|
|
3806
3456
|
)
|
|
3807
3457
|
/*: Promise<Array<void> | ParseObject>*/
|
|
3808
3458
|
{
|
|
3809
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
3459
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
3810
3460
|
var batchSize, localDatastore, RESTController, batches, deleteCompleted, errors;
|
|
3811
|
-
return
|
|
3812
|
-
while (1) {
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
}
|
|
3823
|
-
|
|
3824
|
-
if (!(target.length < 1)) {
|
|
3825
|
-
_context13.next = 6;
|
|
3826
|
-
break;
|
|
3827
|
-
}
|
|
3461
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
3462
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
3463
|
+
case 0:
|
|
3464
|
+
batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');
|
|
3465
|
+
localDatastore = _CoreManager.default.getLocalDatastore();
|
|
3466
|
+
RESTController = _CoreManager.default.getRESTController();
|
|
3467
|
+
|
|
3468
|
+
if (!(0, _isArray.default)(target)) {
|
|
3469
|
+
_context14.next = 15;
|
|
3470
|
+
break;
|
|
3471
|
+
}
|
|
3828
3472
|
|
|
3829
|
-
|
|
3473
|
+
if (!(target.length < 1)) {
|
|
3474
|
+
_context14.next = 6;
|
|
3475
|
+
break;
|
|
3476
|
+
}
|
|
3830
3477
|
|
|
3831
|
-
|
|
3832
|
-
batches = [[]];
|
|
3833
|
-
(0, _forEach.default)(target).call(target, function (obj) {
|
|
3834
|
-
if (!obj.id) {
|
|
3835
|
-
return;
|
|
3836
|
-
}
|
|
3478
|
+
return _context14.abrupt("return", _promise.default.resolve([]));
|
|
3837
3479
|
|
|
3838
|
-
|
|
3480
|
+
case 6:
|
|
3481
|
+
batches = [[]];
|
|
3482
|
+
(0, _forEach.default)(target).call(target, function (obj) {
|
|
3483
|
+
if (!obj.id) {
|
|
3484
|
+
return;
|
|
3485
|
+
}
|
|
3839
3486
|
|
|
3840
|
-
|
|
3841
|
-
batches.push([]);
|
|
3842
|
-
}
|
|
3843
|
-
});
|
|
3487
|
+
batches[batches.length - 1].push(obj);
|
|
3844
3488
|
|
|
3845
|
-
if (batches[batches.length - 1].length
|
|
3846
|
-
|
|
3847
|
-
batches.pop();
|
|
3489
|
+
if (batches[batches.length - 1].length >= batchSize) {
|
|
3490
|
+
batches.push([]);
|
|
3848
3491
|
}
|
|
3492
|
+
});
|
|
3493
|
+
|
|
3494
|
+
if (batches[batches.length - 1].length === 0) {
|
|
3495
|
+
// If the last batch is empty, remove it
|
|
3496
|
+
batches.pop();
|
|
3497
|
+
}
|
|
3849
3498
|
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
}
|
|
3499
|
+
deleteCompleted = _promise.default.resolve();
|
|
3500
|
+
errors = [];
|
|
3501
|
+
(0, _forEach.default)(batches).call(batches, function (batch) {
|
|
3502
|
+
deleteCompleted = deleteCompleted.then(function () {
|
|
3503
|
+
return RESTController.request('POST', 'batch', {
|
|
3504
|
+
requests: (0, _map.default)(batch).call(batch, function (obj) {
|
|
3505
|
+
return {
|
|
3506
|
+
method: 'DELETE',
|
|
3507
|
+
path: getServerUrlPath() + 'classes/' + obj.className + '/' + obj._getId(),
|
|
3508
|
+
body: {}
|
|
3509
|
+
};
|
|
3510
|
+
})
|
|
3511
|
+
}, options).then(function (results) {
|
|
3512
|
+
for (var i = 0; i < results.length; i++) {
|
|
3513
|
+
if (results[i] && results[i].hasOwnProperty('error')) {
|
|
3514
|
+
var err = new _ParseError.default(results[i].error.code, results[i].error.error);
|
|
3515
|
+
err.object = batch[i];
|
|
3516
|
+
errors.push(err);
|
|
3869
3517
|
}
|
|
3870
|
-
}
|
|
3518
|
+
}
|
|
3871
3519
|
});
|
|
3872
3520
|
});
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3521
|
+
});
|
|
3522
|
+
return _context14.abrupt("return", deleteCompleted.then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
3523
|
+
var aggregate, _iterator4, _step4, object;
|
|
3524
|
+
|
|
3525
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
3526
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
3527
|
+
case 0:
|
|
3528
|
+
if (!errors.length) {
|
|
3529
|
+
_context12.next = 4;
|
|
3530
|
+
break;
|
|
3531
|
+
}
|
|
3884
3532
|
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3533
|
+
aggregate = new _ParseError.default(_ParseError.default.AGGREGATE_ERROR);
|
|
3534
|
+
aggregate.errors = errors;
|
|
3535
|
+
return _context12.abrupt("return", _promise.default.reject(aggregate));
|
|
3888
3536
|
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3537
|
+
case 4:
|
|
3538
|
+
_iterator4 = _createForOfIteratorHelper(target);
|
|
3539
|
+
_context12.prev = 5;
|
|
3892
3540
|
|
|
3893
|
-
|
|
3541
|
+
_iterator4.s();
|
|
3894
3542
|
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3543
|
+
case 7:
|
|
3544
|
+
if ((_step4 = _iterator4.n()).done) {
|
|
3545
|
+
_context12.next = 13;
|
|
3546
|
+
break;
|
|
3547
|
+
}
|
|
3900
3548
|
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3549
|
+
object = _step4.value;
|
|
3550
|
+
_context12.next = 11;
|
|
3551
|
+
return localDatastore._destroyObjectIfPinned(object);
|
|
3904
3552
|
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3553
|
+
case 11:
|
|
3554
|
+
_context12.next = 7;
|
|
3555
|
+
break;
|
|
3908
3556
|
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3557
|
+
case 13:
|
|
3558
|
+
_context12.next = 18;
|
|
3559
|
+
break;
|
|
3912
3560
|
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3561
|
+
case 15:
|
|
3562
|
+
_context12.prev = 15;
|
|
3563
|
+
_context12.t0 = _context12["catch"](5);
|
|
3916
3564
|
|
|
3917
|
-
|
|
3565
|
+
_iterator4.e(_context12.t0);
|
|
3918
3566
|
|
|
3919
|
-
|
|
3920
|
-
|
|
3567
|
+
case 18:
|
|
3568
|
+
_context12.prev = 18;
|
|
3921
3569
|
|
|
3922
|
-
|
|
3570
|
+
_iterator4.f();
|
|
3923
3571
|
|
|
3924
|
-
|
|
3572
|
+
return _context12.finish(18);
|
|
3925
3573
|
|
|
3926
|
-
|
|
3927
|
-
|
|
3574
|
+
case 21:
|
|
3575
|
+
return _context12.abrupt("return", _promise.default.resolve(target));
|
|
3928
3576
|
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
}))));
|
|
3577
|
+
case 22:
|
|
3578
|
+
case "end":
|
|
3579
|
+
return _context12.stop();
|
|
3580
|
+
}
|
|
3581
|
+
}, _callee8, null, [[5, 15, 18, 21]]);
|
|
3582
|
+
}))));
|
|
3936
3583
|
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3584
|
+
case 15:
|
|
3585
|
+
if (!(target instanceof ParseObject)) {
|
|
3586
|
+
_context14.next = 17;
|
|
3587
|
+
break;
|
|
3588
|
+
}
|
|
3942
3589
|
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
return localDatastore._destroyObjectIfPinned(target);
|
|
3590
|
+
return _context14.abrupt("return", RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
3591
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
3592
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
3593
|
+
case 0:
|
|
3594
|
+
_context13.next = 2;
|
|
3595
|
+
return localDatastore._destroyObjectIfPinned(target);
|
|
3950
3596
|
|
|
3951
|
-
|
|
3952
|
-
|
|
3597
|
+
case 2:
|
|
3598
|
+
return _context13.abrupt("return", _promise.default.resolve(target));
|
|
3953
3599
|
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
}))));
|
|
3600
|
+
case 3:
|
|
3601
|
+
case "end":
|
|
3602
|
+
return _context13.stop();
|
|
3603
|
+
}
|
|
3604
|
+
}, _callee9);
|
|
3605
|
+
}))));
|
|
3961
3606
|
|
|
3962
|
-
|
|
3963
|
-
|
|
3607
|
+
case 17:
|
|
3608
|
+
return _context14.abrupt("return", _promise.default.resolve(target));
|
|
3964
3609
|
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
}
|
|
3610
|
+
case 18:
|
|
3611
|
+
case "end":
|
|
3612
|
+
return _context14.stop();
|
|
3969
3613
|
}
|
|
3970
3614
|
}, _callee10);
|
|
3971
3615
|
}))();
|
|
3972
3616
|
},
|
|
3973
|
-
save: function
|
|
3617
|
+
save: function (target
|
|
3974
3618
|
/*: ParseObject | Array<ParseObject | ParseFile>*/
|
|
3975
3619
|
, options
|
|
3976
3620
|
/*: RequestOptions*/
|
|
@@ -4090,68 +3734,66 @@ var DefaultController = {
|
|
|
4090
3734
|
batchReturned.reject(new _ParseError.default(_ParseError.default.INCORRECT_TYPE, error.message));
|
|
4091
3735
|
});
|
|
4092
3736
|
return (0, _promiseUtils.when)(batchTasks);
|
|
4093
|
-
}).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
4094
|
-
var
|
|
4095
|
-
|
|
4096
|
-
return
|
|
4097
|
-
while (1) {
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
}
|
|
3737
|
+
}).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
3738
|
+
var _iterator5, _step5, object;
|
|
3739
|
+
|
|
3740
|
+
return _regenerator.default.wrap(function _callee11$(_context15) {
|
|
3741
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
3742
|
+
case 0:
|
|
3743
|
+
if (!objectError) {
|
|
3744
|
+
_context15.next = 2;
|
|
3745
|
+
break;
|
|
3746
|
+
}
|
|
4104
3747
|
|
|
4105
|
-
|
|
3748
|
+
return _context15.abrupt("return", _promise.default.reject(objectError));
|
|
4106
3749
|
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
3750
|
+
case 2:
|
|
3751
|
+
_iterator5 = _createForOfIteratorHelper(target);
|
|
3752
|
+
_context15.prev = 3;
|
|
4110
3753
|
|
|
4111
|
-
|
|
3754
|
+
_iterator5.s();
|
|
4112
3755
|
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
3756
|
+
case 5:
|
|
3757
|
+
if ((_step5 = _iterator5.n()).done) {
|
|
3758
|
+
_context15.next = 13;
|
|
3759
|
+
break;
|
|
3760
|
+
}
|
|
4118
3761
|
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
3762
|
+
object = _step5.value;
|
|
3763
|
+
_context15.next = 9;
|
|
3764
|
+
return localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object);
|
|
4122
3765
|
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
3766
|
+
case 9:
|
|
3767
|
+
_context15.next = 11;
|
|
3768
|
+
return localDatastore._updateObjectIfPinned(object);
|
|
4126
3769
|
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
3770
|
+
case 11:
|
|
3771
|
+
_context15.next = 5;
|
|
3772
|
+
break;
|
|
4130
3773
|
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
3774
|
+
case 13:
|
|
3775
|
+
_context15.next = 18;
|
|
3776
|
+
break;
|
|
4134
3777
|
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
3778
|
+
case 15:
|
|
3779
|
+
_context15.prev = 15;
|
|
3780
|
+
_context15.t0 = _context15["catch"](3);
|
|
4138
3781
|
|
|
4139
|
-
|
|
3782
|
+
_iterator5.e(_context15.t0);
|
|
4140
3783
|
|
|
4141
|
-
|
|
4142
|
-
|
|
3784
|
+
case 18:
|
|
3785
|
+
_context15.prev = 18;
|
|
4143
3786
|
|
|
4144
|
-
|
|
3787
|
+
_iterator5.f();
|
|
4145
3788
|
|
|
4146
|
-
|
|
3789
|
+
return _context15.finish(18);
|
|
4147
3790
|
|
|
4148
|
-
|
|
4149
|
-
|
|
3791
|
+
case 21:
|
|
3792
|
+
return _context15.abrupt("return", _promise.default.resolve(target));
|
|
4150
3793
|
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
}
|
|
3794
|
+
case 22:
|
|
3795
|
+
case "end":
|
|
3796
|
+
return _context15.stop();
|
|
4155
3797
|
}
|
|
4156
3798
|
}, _callee11, null, [[3, 15, 18, 21]]);
|
|
4157
3799
|
})));
|
|
@@ -4184,25 +3826,23 @@ var DefaultController = {
|
|
|
4184
3826
|
};
|
|
4185
3827
|
|
|
4186
3828
|
stateController.pushPendingState(target._getStateIdentifier());
|
|
4187
|
-
return stateController.enqueueTask(target._getStateIdentifier(), task).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
4188
|
-
return
|
|
4189
|
-
while (1) {
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
return localDatastore._updateLocalIdForObject(localId, target);
|
|
3829
|
+
return stateController.enqueueTask(target._getStateIdentifier(), task).then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
3830
|
+
return _regenerator.default.wrap(function _callee12$(_context16) {
|
|
3831
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
3832
|
+
case 0:
|
|
3833
|
+
_context16.next = 2;
|
|
3834
|
+
return localDatastore._updateLocalIdForObject(localId, target);
|
|
4194
3835
|
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
3836
|
+
case 2:
|
|
3837
|
+
_context16.next = 4;
|
|
3838
|
+
return localDatastore._updateObjectIfPinned(target);
|
|
4198
3839
|
|
|
4199
|
-
|
|
4200
|
-
|
|
3840
|
+
case 4:
|
|
3841
|
+
return _context16.abrupt("return", target);
|
|
4201
3842
|
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
}
|
|
3843
|
+
case 5:
|
|
3844
|
+
case "end":
|
|
3845
|
+
return _context16.stop();
|
|
4206
3846
|
}
|
|
4207
3847
|
}, _callee12);
|
|
4208
3848
|
})), function (error) {
|