parse 4.0.1-beta.1 → 4.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +17994 -26193
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +8738 -17728
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +2 -20
- package/lib/browser/AnonymousUtils.js +6 -35
- package/lib/browser/Cloud.js +12 -70
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -184
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -1
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -35
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -13
- package/lib/browser/LiveQueryClient.js +87 -204
- package/lib/browser/LiveQuerySubscription.js +10 -39
- package/lib/browser/LocalDatastore.js +451 -1081
- package/lib/browser/LocalDatastoreController.js +145 -602
- package/lib/browser/LocalDatastoreController.react-native.js +137 -573
- package/lib/browser/LocalDatastoreUtils.js +2 -12
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +42 -222
- package/lib/browser/Parse.js +12 -106
- package/lib/browser/ParseACL.js +33 -141
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -88
- package/lib/browser/ParseError.js +63 -90
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -82
- package/lib/browser/ParseHooks.js +1 -34
- package/lib/browser/ParseInstallation.js +4 -32
- package/lib/browser/ParseLiveQuery.js +96 -505
- package/lib/browser/ParseObject.js +628 -1840
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -63
- package/lib/browser/ParseQuery.js +404 -1505
- package/lib/browser/ParseRelation.js +12 -61
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -201
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -43
- package/lib/browser/RESTController.js +18 -140
- package/lib/browser/SingleInstanceStateController.js +19 -137
- package/lib/browser/Socket.weapp.js +2 -12
- package/lib/browser/Storage.js +10 -73
- package/lib/browser/StorageController.browser.js +4 -17
- package/lib/browser/StorageController.default.js +4 -17
- package/lib/browser/StorageController.react-native.js +6 -33
- package/lib/browser/StorageController.weapp.js +5 -16
- package/lib/browser/TaskQueue.js +1 -22
- package/lib/browser/UniqueInstanceStateController.js +19 -142
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -16
- package/lib/browser/canBeSerialized.js +3 -33
- package/lib/browser/decode.js +3 -33
- package/lib/browser/encode.js +9 -70
- package/lib/browser/equals.js +2 -25
- package/lib/browser/escape.js +1 -8
- package/lib/browser/isRevocableSession.js +2 -11
- package/lib/browser/parseDate.js +2 -13
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -17
- package/lib/browser/unsavedChildren.js +6 -50
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -18
- package/lib/node/AnonymousUtils.js +5 -37
- package/lib/node/Cloud.js +10 -66
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -220
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -1
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -37
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -15
- package/lib/node/LiveQueryClient.js +56 -136
- package/lib/node/LiveQuerySubscription.js +7 -16
- package/lib/node/LocalDatastore.js +19 -175
- package/lib/node/LocalDatastoreController.js +6 -38
- package/lib/node/LocalDatastoreController.react-native.js +6 -45
- package/lib/node/LocalDatastoreUtils.js +1 -6
- package/lib/node/ObjectStateMutations.js +13 -93
- package/lib/node/OfflineQuery.js +20 -152
- package/lib/node/Parse.js +11 -99
- package/lib/node/ParseACL.js +32 -150
- package/lib/node/ParseCLP.js +69 -262
- package/lib/node/ParseConfig.js +16 -84
- package/lib/node/ParseError.js +61 -65
- package/lib/node/ParseFile.js +49 -205
- package/lib/node/ParseGeoPoint.js +21 -82
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -10
- package/lib/node/ParseLiveQuery.js +10 -36
- package/lib/node/ParseObject.js +193 -939
- package/lib/node/ParseOp.js +31 -255
- package/lib/node/ParsePolygon.js +12 -62
- package/lib/node/ParseQuery.js +170 -882
- package/lib/node/ParseRelation.js +11 -61
- package/lib/node/ParseRole.js +10 -57
- package/lib/node/ParseSchema.js +46 -222
- package/lib/node/ParseSession.js +8 -50
- package/lib/node/ParseUser.js +107 -576
- package/lib/node/Push.js +4 -37
- package/lib/node/RESTController.js +8 -110
- package/lib/node/SingleInstanceStateController.js +17 -130
- package/lib/node/Socket.weapp.js +2 -9
- package/lib/node/Storage.js +10 -83
- package/lib/node/StorageController.browser.js +4 -23
- package/lib/node/StorageController.default.js +5 -21
- package/lib/node/StorageController.react-native.js +6 -40
- package/lib/node/StorageController.weapp.js +6 -21
- package/lib/node/TaskQueue.js +1 -17
- package/lib/node/UniqueInstanceStateController.js +16 -133
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -12
- package/lib/node/canBeSerialized.js +2 -28
- package/lib/node/decode.js +1 -26
- package/lib/node/encode.js +3 -54
- package/lib/node/equals.js +0 -18
- package/lib/node/escape.js +1 -6
- package/lib/node/isRevocableSession.js +1 -5
- package/lib/node/parseDate.js +1 -7
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -11
- package/lib/node/unsavedChildren.js +2 -38
- package/lib/node/uuid.js +6 -1
- package/lib/react-native/Analytics.js +0 -9
- package/lib/react-native/AnonymousUtils.js +0 -10
- package/lib/react-native/Cloud.js +0 -26
- package/lib/react-native/CoreManager.js +1 -5
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +4 -52
- package/lib/react-native/FacebookUtils.js +0 -22
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -6
- package/lib/react-native/LiveQueryClient.js +24 -101
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +6 -113
- package/lib/react-native/LocalDatastoreController.js +0 -21
- package/lib/react-native/LocalDatastoreController.react-native.js +4 -31
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +0 -34
- package/lib/react-native/OfflineQuery.js +2 -137
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +32 -96
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +3 -72
- package/lib/react-native/ParseGeoPoint.js +0 -17
- package/lib/react-native/ParseHooks.js +0 -30
- package/lib/react-native/ParseInstallation.js +1 -23
- package/lib/react-native/ParseLiveQuery.js +3 -25
- package/lib/react-native/ParseObject.js +4 -371
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +6 -262
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +0 -51
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +1 -224
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +1 -70
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +2 -12
- package/lib/react-native/Storage.js +0 -24
- package/lib/react-native/StorageController.browser.js +0 -2
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -2
- package/lib/react-native/TaskQueue.js +0 -15
- package/lib/react-native/UniqueInstanceStateController.js +0 -47
- package/lib/react-native/Xhr.weapp.js +0 -16
- package/lib/react-native/arrayContainsObject.js +0 -5
- package/lib/react-native/canBeSerialized.js +0 -18
- package/lib/react-native/decode.js +0 -21
- package/lib/react-native/encode.js +0 -25
- package/lib/react-native/equals.js +0 -18
- package/lib/react-native/escape.js +0 -1
- package/lib/react-native/isRevocableSession.js +0 -1
- package/lib/react-native/parseDate.js +0 -3
- package/lib/react-native/promiseUtils.js +0 -13
- package/lib/react-native/unique.js +0 -4
- package/lib/react-native/unsavedChildren.js +0 -21
- package/lib/react-native/uuid.js +3 -1
- package/lib/weapp/Analytics.js +2 -20
- package/lib/weapp/AnonymousUtils.js +6 -35
- package/lib/weapp/Cloud.js +12 -70
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -184
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -1
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -35
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -13
- package/lib/weapp/LiveQueryClient.js +87 -204
- package/lib/weapp/LiveQuerySubscription.js +10 -39
- package/lib/weapp/LocalDatastore.js +451 -1081
- package/lib/weapp/LocalDatastoreController.js +145 -602
- package/lib/weapp/LocalDatastoreController.react-native.js +137 -573
- package/lib/weapp/LocalDatastoreUtils.js +2 -12
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +42 -222
- package/lib/weapp/Parse.js +12 -106
- package/lib/weapp/ParseACL.js +33 -141
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -88
- package/lib/weapp/ParseError.js +63 -90
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -82
- package/lib/weapp/ParseHooks.js +1 -34
- package/lib/weapp/ParseInstallation.js +4 -32
- package/lib/weapp/ParseLiveQuery.js +96 -505
- package/lib/weapp/ParseObject.js +628 -1840
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -63
- package/lib/weapp/ParseQuery.js +404 -1505
- package/lib/weapp/ParseRelation.js +12 -61
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -201
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -43
- package/lib/weapp/RESTController.js +18 -140
- package/lib/weapp/SingleInstanceStateController.js +19 -137
- package/lib/weapp/Socket.weapp.js +2 -12
- package/lib/weapp/Storage.js +10 -73
- package/lib/weapp/StorageController.browser.js +4 -17
- package/lib/weapp/StorageController.default.js +4 -17
- package/lib/weapp/StorageController.react-native.js +6 -33
- package/lib/weapp/StorageController.weapp.js +5 -16
- package/lib/weapp/TaskQueue.js +1 -22
- package/lib/weapp/UniqueInstanceStateController.js +19 -142
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -16
- package/lib/weapp/canBeSerialized.js +3 -33
- package/lib/weapp/decode.js +3 -33
- package/lib/weapp/encode.js +9 -70
- package/lib/weapp/equals.js +2 -25
- package/lib/weapp/escape.js +1 -8
- package/lib/weapp/isRevocableSession.js +2 -11
- package/lib/weapp/parseDate.js +2 -13
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -17
- package/lib/weapp/unsavedChildren.js +6 -50
- package/lib/weapp/uuid.js +1 -6
- package/package.json +48 -46
|
@@ -1,57 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
6
|
-
|
|
7
|
-
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
8
|
-
|
|
9
|
-
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
10
|
-
|
|
11
3
|
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
12
|
-
|
|
13
|
-
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
14
|
-
|
|
15
|
-
var _Promise2 = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
16
|
-
|
|
17
|
-
var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
|
|
18
|
-
|
|
19
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
20
|
-
|
|
21
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
22
|
-
|
|
23
|
-
var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
|
|
24
|
-
|
|
25
|
-
var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
|
|
26
|
-
|
|
27
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
28
|
-
|
|
4
|
+
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
29
5
|
var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
34
|
-
|
|
35
|
-
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
36
|
-
|
|
6
|
+
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
7
|
+
var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
8
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
37
9
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
38
|
-
|
|
10
|
+
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
11
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
12
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
13
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
39
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
40
|
-
|
|
41
15
|
var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
|
|
42
|
-
|
|
43
16
|
var _Storage = _interopRequireDefault(require("./Storage"));
|
|
44
|
-
|
|
45
17
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
46
18
|
var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
|
|
47
|
-
|
|
48
19
|
if (!it) {
|
|
49
20
|
if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
50
21
|
if (it) o = it;
|
|
51
22
|
var i = 0;
|
|
52
|
-
|
|
53
23
|
var F = function () {};
|
|
54
|
-
|
|
55
24
|
return {
|
|
56
25
|
s: F,
|
|
57
26
|
n: function () {
|
|
@@ -69,13 +38,11 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
69
38
|
f: F
|
|
70
39
|
};
|
|
71
40
|
}
|
|
72
|
-
|
|
73
41
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
74
42
|
}
|
|
75
|
-
|
|
76
43
|
var normalCompletion = true,
|
|
77
|
-
|
|
78
|
-
|
|
44
|
+
didErr = false,
|
|
45
|
+
err;
|
|
79
46
|
return {
|
|
80
47
|
s: function () {
|
|
81
48
|
it = it.call(o);
|
|
@@ -98,603 +65,179 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
98
65
|
}
|
|
99
66
|
};
|
|
100
67
|
}
|
|
101
|
-
|
|
102
68
|
function _unsupportedIterableToArray(o, minLen) {
|
|
103
|
-
var
|
|
104
|
-
|
|
69
|
+
var _context7;
|
|
105
70
|
if (!o) return;
|
|
106
71
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
107
|
-
|
|
108
|
-
var n = _sliceInstanceProperty(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1);
|
|
109
|
-
|
|
72
|
+
var n = _sliceInstanceProperty(_context7 = Object.prototype.toString.call(o)).call(_context7, 8, -1);
|
|
110
73
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
111
74
|
if (n === "Map" || n === "Set") return _Array$from(o);
|
|
112
75
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
113
76
|
}
|
|
114
|
-
|
|
115
77
|
function _arrayLikeToArray(arr, len) {
|
|
116
78
|
if (len == null || len > arr.length) len = arr.length;
|
|
117
|
-
|
|
118
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
119
|
-
arr2[i] = arr[i];
|
|
120
|
-
}
|
|
121
|
-
|
|
79
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
122
80
|
return arr2;
|
|
123
81
|
}
|
|
124
|
-
|
|
125
|
-
function _regeneratorRuntime() {
|
|
126
|
-
"use strict";
|
|
127
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
128
|
-
|
|
129
|
-
_regeneratorRuntime = function () {
|
|
130
|
-
return exports;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
var exports = {},
|
|
134
|
-
Op = Object.prototype,
|
|
135
|
-
hasOwn = Op.hasOwnProperty,
|
|
136
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
137
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
138
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
139
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
140
|
-
|
|
141
|
-
function define(obj, key, value) {
|
|
142
|
-
return _Object$defineProperty(obj, key, {
|
|
143
|
-
value: value,
|
|
144
|
-
enumerable: !0,
|
|
145
|
-
configurable: !0,
|
|
146
|
-
writable: !0
|
|
147
|
-
}), obj[key];
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
try {
|
|
151
|
-
define({}, "");
|
|
152
|
-
} catch (err) {
|
|
153
|
-
define = function (obj, key, value) {
|
|
154
|
-
return obj[key] = value;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
159
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
160
|
-
generator = _Object$create(protoGenerator.prototype),
|
|
161
|
-
context = new Context(tryLocsList || []);
|
|
162
|
-
|
|
163
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
164
|
-
var state = "suspendedStart";
|
|
165
|
-
return function (method, arg) {
|
|
166
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
167
|
-
|
|
168
|
-
if ("completed" === state) {
|
|
169
|
-
if ("throw" === method) throw arg;
|
|
170
|
-
return doneResult();
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
for (context.method = method, context.arg = arg;;) {
|
|
174
|
-
var delegate = context.delegate;
|
|
175
|
-
|
|
176
|
-
if (delegate) {
|
|
177
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
178
|
-
|
|
179
|
-
if (delegateResult) {
|
|
180
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
181
|
-
return delegateResult;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
186
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
187
|
-
context.dispatchException(context.arg);
|
|
188
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
189
|
-
state = "executing";
|
|
190
|
-
var record = tryCatch(innerFn, self, context);
|
|
191
|
-
|
|
192
|
-
if ("normal" === record.type) {
|
|
193
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
194
|
-
return {
|
|
195
|
-
value: record.arg,
|
|
196
|
-
done: context.done
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}(innerFn, self, context), generator;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function tryCatch(fn, obj, arg) {
|
|
207
|
-
try {
|
|
208
|
-
return {
|
|
209
|
-
type: "normal",
|
|
210
|
-
arg: fn.call(obj, arg)
|
|
211
|
-
};
|
|
212
|
-
} catch (err) {
|
|
213
|
-
return {
|
|
214
|
-
type: "throw",
|
|
215
|
-
arg: err
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
exports.wrap = wrap;
|
|
221
|
-
var ContinueSentinel = {};
|
|
222
|
-
|
|
223
|
-
function Generator() {}
|
|
224
|
-
|
|
225
|
-
function GeneratorFunction() {}
|
|
226
|
-
|
|
227
|
-
function GeneratorFunctionPrototype() {}
|
|
228
|
-
|
|
229
|
-
var IteratorPrototype = {};
|
|
230
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
231
|
-
return this;
|
|
232
|
-
});
|
|
233
|
-
var getProto = _Object$getPrototypeOf,
|
|
234
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
235
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
236
|
-
|
|
237
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
238
|
-
|
|
239
|
-
function defineIteratorMethods(prototype) {
|
|
240
|
-
var _context7;
|
|
241
|
-
|
|
242
|
-
_forEachInstanceProperty(_context7 = ["next", "throw", "return"]).call(_context7, function (method) {
|
|
243
|
-
define(prototype, method, function (arg) {
|
|
244
|
-
return this._invoke(method, arg);
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
250
|
-
function invoke(method, arg, resolve, reject) {
|
|
251
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
252
|
-
|
|
253
|
-
if ("throw" !== record.type) {
|
|
254
|
-
var result = record.arg,
|
|
255
|
-
value = result.value;
|
|
256
|
-
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
257
|
-
invoke("next", value, resolve, reject);
|
|
258
|
-
}, function (err) {
|
|
259
|
-
invoke("throw", err, resolve, reject);
|
|
260
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
261
|
-
result.value = unwrapped, resolve(result);
|
|
262
|
-
}, function (error) {
|
|
263
|
-
return invoke("throw", error, resolve, reject);
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
reject(record.arg);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
var previousPromise;
|
|
271
|
-
|
|
272
|
-
this._invoke = function (method, arg) {
|
|
273
|
-
function callInvokeWithMethodAndArg() {
|
|
274
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
275
|
-
invoke(method, arg, resolve, reject);
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
284
|
-
var method = delegate.iterator[context.method];
|
|
285
|
-
|
|
286
|
-
if (undefined === method) {
|
|
287
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
288
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
289
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return ContinueSentinel;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
296
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
297
|
-
var info = record.arg;
|
|
298
|
-
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);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
function pushTryEntry(locs) {
|
|
302
|
-
var entry = {
|
|
303
|
-
tryLoc: locs[0]
|
|
304
|
-
};
|
|
305
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
function resetTryEntry(entry) {
|
|
309
|
-
var record = entry.completion || {};
|
|
310
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
function Context(tryLocsList) {
|
|
314
|
-
this.tryEntries = [{
|
|
315
|
-
tryLoc: "root"
|
|
316
|
-
}], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
function values(iterable) {
|
|
320
|
-
if (iterable) {
|
|
321
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
322
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
323
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
324
|
-
|
|
325
|
-
if (!isNaN(iterable.length)) {
|
|
326
|
-
var i = -1,
|
|
327
|
-
next = function next() {
|
|
328
|
-
for (; ++i < iterable.length;) {
|
|
329
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return next.value = undefined, next.done = !0, next;
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
return next.next = next;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
return {
|
|
340
|
-
next: doneResult
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function doneResult() {
|
|
345
|
-
return {
|
|
346
|
-
value: undefined,
|
|
347
|
-
done: !0
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
352
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
353
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
354
|
-
}, exports.mark = function (genFun) {
|
|
355
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
356
|
-
}, exports.awrap = function (arg) {
|
|
357
|
-
return {
|
|
358
|
-
__await: arg
|
|
359
|
-
};
|
|
360
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
361
|
-
return this;
|
|
362
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
363
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise2);
|
|
364
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
365
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
366
|
-
return result.done ? result.value : iter.next();
|
|
367
|
-
});
|
|
368
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
369
|
-
return this;
|
|
370
|
-
}), define(Gp, "toString", function () {
|
|
371
|
-
return "[object Generator]";
|
|
372
|
-
}), exports.keys = function (object) {
|
|
373
|
-
var keys = [];
|
|
374
|
-
|
|
375
|
-
for (var key in object) {
|
|
376
|
-
keys.push(key);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
380
|
-
for (; keys.length;) {
|
|
381
|
-
var key = keys.pop();
|
|
382
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return next.done = !0, next;
|
|
386
|
-
};
|
|
387
|
-
}, exports.values = values, Context.prototype = {
|
|
388
|
-
constructor: Context,
|
|
389
|
-
reset: function (skipTempReset) {
|
|
390
|
-
var _context8;
|
|
391
|
-
|
|
392
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context8 = this.tryEntries).call(_context8, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
393
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
stop: function () {
|
|
397
|
-
this.done = !0;
|
|
398
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
399
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
400
|
-
return this.rval;
|
|
401
|
-
},
|
|
402
|
-
dispatchException: function (exception) {
|
|
403
|
-
if (this.done) throw exception;
|
|
404
|
-
var context = this;
|
|
405
|
-
|
|
406
|
-
function handle(loc, caught) {
|
|
407
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
411
|
-
var entry = this.tryEntries[i],
|
|
412
|
-
record = entry.completion;
|
|
413
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
414
|
-
|
|
415
|
-
if (entry.tryLoc <= this.prev) {
|
|
416
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
417
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
418
|
-
|
|
419
|
-
if (hasCatch && hasFinally) {
|
|
420
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
421
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
422
|
-
} else if (hasCatch) {
|
|
423
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
424
|
-
} else {
|
|
425
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
426
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
abrupt: function (type, arg) {
|
|
432
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
433
|
-
var entry = this.tryEntries[i];
|
|
434
|
-
|
|
435
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
436
|
-
var finallyEntry = entry;
|
|
437
|
-
break;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
442
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
443
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
444
|
-
},
|
|
445
|
-
complete: function (record, afterLoc) {
|
|
446
|
-
if ("throw" === record.type) throw record.arg;
|
|
447
|
-
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;
|
|
448
|
-
},
|
|
449
|
-
finish: function (finallyLoc) {
|
|
450
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
451
|
-
var entry = this.tryEntries[i];
|
|
452
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
453
|
-
}
|
|
454
|
-
},
|
|
455
|
-
catch: function (tryLoc) {
|
|
456
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
457
|
-
var entry = this.tryEntries[i];
|
|
458
|
-
|
|
459
|
-
if (entry.tryLoc === tryLoc) {
|
|
460
|
-
var record = entry.completion;
|
|
461
|
-
|
|
462
|
-
if ("throw" === record.type) {
|
|
463
|
-
var thrown = record.arg;
|
|
464
|
-
resetTryEntry(entry);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return thrown;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
throw new Error("illegal catch attempt");
|
|
472
|
-
},
|
|
473
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
474
|
-
return this.delegate = {
|
|
475
|
-
iterator: values(iterable),
|
|
476
|
-
resultName: resultName,
|
|
477
|
-
nextLoc: nextLoc
|
|
478
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
479
|
-
}
|
|
480
|
-
}, exports;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
82
|
var LocalDatastoreController = {
|
|
484
|
-
fromPinWithName: function (name
|
|
485
|
-
|
|
486
|
-
)
|
|
487
|
-
/*: Array<Object>*/
|
|
488
|
-
{
|
|
489
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
83
|
+
fromPinWithName: function (name /*: string*/) /*: Array<Object>*/{
|
|
84
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
490
85
|
var values, objects;
|
|
491
|
-
return
|
|
492
|
-
while (1) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
objects = JSON.parse(values);
|
|
510
|
-
return _context.abrupt("return", objects);
|
|
511
|
-
|
|
512
|
-
case 7:
|
|
513
|
-
case "end":
|
|
514
|
-
return _context.stop();
|
|
515
|
-
}
|
|
86
|
+
return _regenerator.default.wrap(function (_context) {
|
|
87
|
+
while (1) switch (_context.prev = _context.next) {
|
|
88
|
+
case 0:
|
|
89
|
+
_context.next = 2;
|
|
90
|
+
return _Storage.default.getItemAsync(name);
|
|
91
|
+
case 2:
|
|
92
|
+
values = _context.sent;
|
|
93
|
+
if (values) {
|
|
94
|
+
_context.next = 5;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
return _context.abrupt("return", []);
|
|
98
|
+
case 5:
|
|
99
|
+
objects = JSON.parse(values);
|
|
100
|
+
return _context.abrupt("return", objects);
|
|
101
|
+
case 7:
|
|
102
|
+
case "end":
|
|
103
|
+
return _context.stop();
|
|
516
104
|
}
|
|
517
105
|
}, _callee);
|
|
518
106
|
}))();
|
|
519
107
|
},
|
|
520
|
-
pinWithName: function
|
|
521
|
-
/*: string*/
|
|
522
|
-
, value
|
|
523
|
-
/*: any*/
|
|
524
|
-
) {
|
|
108
|
+
pinWithName: function (name /*: string*/, value /*: any*/) {
|
|
525
109
|
var values = (0, _stringify.default)(value);
|
|
526
110
|
return _Storage.default.setItemAsync(name, values);
|
|
527
111
|
},
|
|
528
|
-
unPinWithName: function
|
|
529
|
-
/*: string*/
|
|
530
|
-
) {
|
|
112
|
+
unPinWithName: function (name /*: string*/) {
|
|
531
113
|
return _Storage.default.removeItemAsync(name);
|
|
532
114
|
},
|
|
533
|
-
getAllContents: function
|
|
534
|
-
|
|
535
|
-
{
|
|
536
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
115
|
+
getAllContents: function () /*: Object*/{
|
|
116
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
537
117
|
var keys;
|
|
538
|
-
return
|
|
539
|
-
while (1) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
LDS = _context2.sent;
|
|
559
|
-
|
|
560
|
-
if (!(0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
561
|
-
_context2.next = 8;
|
|
562
|
-
break;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
_context2.next = 6;
|
|
566
|
-
return _Storage.default.getItemAsync(key);
|
|
567
|
-
|
|
568
|
-
case 6:
|
|
569
|
-
value = _context2.sent;
|
|
570
|
-
|
|
571
|
-
try {
|
|
572
|
-
LDS[key] = JSON.parse(value);
|
|
573
|
-
} catch (error) {
|
|
574
|
-
console.error('Error getAllContents: ', error);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
case 8:
|
|
578
|
-
return _context2.abrupt("return", LDS);
|
|
579
|
-
|
|
580
|
-
case 9:
|
|
581
|
-
case "end":
|
|
582
|
-
return _context2.stop();
|
|
118
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
119
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
_context3.next = 2;
|
|
122
|
+
return _Storage.default.getAllKeysAsync();
|
|
123
|
+
case 2:
|
|
124
|
+
keys = _context3.sent;
|
|
125
|
+
return _context3.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
|
|
126
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(previousPromise, key) {
|
|
127
|
+
var LDS, value;
|
|
128
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
129
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
_context2.next = 2;
|
|
132
|
+
return previousPromise;
|
|
133
|
+
case 2:
|
|
134
|
+
LDS = _context2.sent;
|
|
135
|
+
if (!(0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
136
|
+
_context2.next = 8;
|
|
137
|
+
break;
|
|
583
138
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
139
|
+
_context2.next = 6;
|
|
140
|
+
return _Storage.default.getItemAsync(key);
|
|
141
|
+
case 6:
|
|
142
|
+
value = _context2.sent;
|
|
143
|
+
try {
|
|
144
|
+
LDS[key] = JSON.parse(value);
|
|
145
|
+
} catch (error) {
|
|
146
|
+
console.error('Error getAllContents: ', error);
|
|
147
|
+
}
|
|
148
|
+
case 8:
|
|
149
|
+
return _context2.abrupt("return", LDS);
|
|
150
|
+
case 9:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context2.stop();
|
|
153
|
+
}
|
|
154
|
+
}, _callee2);
|
|
155
|
+
}));
|
|
156
|
+
return function () {
|
|
157
|
+
return _ref.apply(this, arguments);
|
|
158
|
+
};
|
|
159
|
+
}(), _promise.default.resolve({})));
|
|
160
|
+
case 4:
|
|
161
|
+
case "end":
|
|
162
|
+
return _context3.stop();
|
|
597
163
|
}
|
|
598
164
|
}, _callee3);
|
|
599
165
|
}))();
|
|
600
166
|
},
|
|
601
167
|
// Used for testing
|
|
602
|
-
getRawStorage: function
|
|
603
|
-
|
|
604
|
-
{
|
|
605
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
168
|
+
getRawStorage: function () /*: Object*/{
|
|
169
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
606
170
|
var keys;
|
|
607
|
-
return
|
|
608
|
-
while (1) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
return function (_x3, _x4) {
|
|
645
|
-
return _ref2.apply(this, arguments);
|
|
646
|
-
};
|
|
647
|
-
}(), _promise.default.resolve({})));
|
|
648
|
-
|
|
649
|
-
case 4:
|
|
650
|
-
case "end":
|
|
651
|
-
return _context5.stop();
|
|
652
|
-
}
|
|
171
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
172
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
173
|
+
case 0:
|
|
174
|
+
_context5.next = 2;
|
|
175
|
+
return _Storage.default.getAllKeysAsync();
|
|
176
|
+
case 2:
|
|
177
|
+
keys = _context5.sent;
|
|
178
|
+
return _context5.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
|
|
179
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(previousPromise, key) {
|
|
180
|
+
var LDS, value;
|
|
181
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
182
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
_context4.next = 2;
|
|
185
|
+
return previousPromise;
|
|
186
|
+
case 2:
|
|
187
|
+
LDS = _context4.sent;
|
|
188
|
+
_context4.next = 5;
|
|
189
|
+
return _Storage.default.getItemAsync(key);
|
|
190
|
+
case 5:
|
|
191
|
+
value = _context4.sent;
|
|
192
|
+
LDS[key] = value;
|
|
193
|
+
return _context4.abrupt("return", LDS);
|
|
194
|
+
case 8:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context4.stop();
|
|
197
|
+
}
|
|
198
|
+
}, _callee4);
|
|
199
|
+
}));
|
|
200
|
+
return function () {
|
|
201
|
+
return _ref2.apply(this, arguments);
|
|
202
|
+
};
|
|
203
|
+
}(), _promise.default.resolve({})));
|
|
204
|
+
case 4:
|
|
205
|
+
case "end":
|
|
206
|
+
return _context5.stop();
|
|
653
207
|
}
|
|
654
208
|
}, _callee5);
|
|
655
209
|
}))();
|
|
656
210
|
},
|
|
657
|
-
clear: function
|
|
658
|
-
/*: Promise*/
|
|
659
|
-
{
|
|
211
|
+
clear: function () /*: Promise*/{
|
|
660
212
|
var _this = this;
|
|
661
|
-
|
|
662
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
213
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
663
214
|
var keys, toRemove, _iterator, _step, key, promises;
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
679
|
-
key = _step.value;
|
|
680
|
-
|
|
681
|
-
if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
682
|
-
toRemove.push(key);
|
|
683
|
-
}
|
|
215
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
216
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
217
|
+
case 0:
|
|
218
|
+
_context6.next = 2;
|
|
219
|
+
return _Storage.default.getAllKeysAsync();
|
|
220
|
+
case 2:
|
|
221
|
+
keys = _context6.sent;
|
|
222
|
+
toRemove = [];
|
|
223
|
+
_iterator = _createForOfIteratorHelper(keys);
|
|
224
|
+
try {
|
|
225
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
226
|
+
key = _step.value;
|
|
227
|
+
if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
|
|
228
|
+
toRemove.push(key);
|
|
684
229
|
}
|
|
685
|
-
} catch (err) {
|
|
686
|
-
_iterator.e(err);
|
|
687
|
-
} finally {
|
|
688
|
-
_iterator.f();
|
|
689
230
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
231
|
+
} catch (err) {
|
|
232
|
+
_iterator.e(err);
|
|
233
|
+
} finally {
|
|
234
|
+
_iterator.f();
|
|
235
|
+
}
|
|
236
|
+
promises = (0, _map.default)(toRemove).call(toRemove, _this.unPinWithName);
|
|
237
|
+
return _context6.abrupt("return", _promise.default.all(promises));
|
|
238
|
+
case 8:
|
|
239
|
+
case "end":
|
|
240
|
+
return _context6.stop();
|
|
698
241
|
}
|
|
699
242
|
}, _callee6);
|
|
700
243
|
}))();
|