parse 4.0.0-alpha.7 → 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.
Files changed (197) hide show
  1. package/LICENSE +167 -25
  2. package/NOTICE +10 -0
  3. package/README.md +1 -3
  4. package/dist/parse.js +3935 -6527
  5. package/dist/parse.min.js +7 -6
  6. package/dist/parse.weapp.js +3096 -6458
  7. package/dist/parse.weapp.min.js +7 -6
  8. package/lib/browser/Analytics.js +4 -11
  9. package/lib/browser/AnonymousUtils.js +2 -9
  10. package/lib/browser/Cloud.js +4 -11
  11. package/lib/browser/CloudCode.js +0 -1
  12. package/lib/browser/CoreManager.js +3 -10
  13. package/lib/browser/EventEmitter.js +0 -7
  14. package/lib/browser/EventuallyQueue.js +282 -668
  15. package/lib/browser/FacebookUtils.js +2 -9
  16. package/lib/browser/InstallationController.js +0 -7
  17. package/lib/browser/LiveQueryClient.js +35 -26
  18. package/lib/browser/LiveQuerySubscription.js +5 -4
  19. package/lib/browser/LocalDatastore.js +472 -864
  20. package/lib/browser/LocalDatastoreController.js +161 -547
  21. package/lib/browser/LocalDatastoreController.react-native.js +156 -537
  22. package/lib/browser/LocalDatastoreUtils.js +2 -9
  23. package/lib/browser/ObjectStateMutations.js +25 -25
  24. package/lib/browser/OfflineQuery.js +31 -33
  25. package/lib/browser/Parse.js +4 -13
  26. package/lib/browser/ParseACL.js +9 -16
  27. package/lib/browser/ParseCLP.js +46 -48
  28. package/lib/browser/ParseConfig.js +6 -13
  29. package/lib/browser/ParseError.js +2 -11
  30. package/lib/browser/ParseFile.js +107 -482
  31. package/lib/browser/ParseGeoPoint.js +4 -11
  32. package/lib/browser/ParseHooks.js +2 -2
  33. package/lib/browser/ParseInstallation.js +2 -2
  34. package/lib/browser/ParseLiveQuery.js +104 -480
  35. package/lib/browser/ParseObject.js +542 -934
  36. package/lib/browser/ParseOp.js +11 -11
  37. package/lib/browser/ParsePolygon.js +5 -12
  38. package/lib/browser/ParseQuery.js +365 -758
  39. package/lib/browser/ParseRelation.js +2 -9
  40. package/lib/browser/ParseRole.js +2 -2
  41. package/lib/browser/ParseSchema.js +2 -9
  42. package/lib/browser/ParseSession.js +2 -2
  43. package/lib/browser/ParseUser.js +221 -607
  44. package/lib/browser/Push.js +2 -9
  45. package/lib/browser/RESTController.js +12 -19
  46. package/lib/browser/SingleInstanceStateController.js +4 -11
  47. package/lib/browser/Storage.js +0 -7
  48. package/lib/browser/StorageController.browser.js +0 -7
  49. package/lib/browser/StorageController.default.js +0 -7
  50. package/lib/browser/StorageController.react-native.js +0 -7
  51. package/lib/browser/StorageController.weapp.js +0 -7
  52. package/lib/browser/TaskQueue.js +0 -7
  53. package/lib/browser/UniqueInstanceStateController.js +8 -15
  54. package/lib/browser/arrayContainsObject.js +2 -9
  55. package/lib/browser/canBeSerialized.js +2 -9
  56. package/lib/browser/decode.js +4 -11
  57. package/lib/browser/encode.js +8 -15
  58. package/lib/browser/equals.js +4 -13
  59. package/lib/browser/escape.js +0 -7
  60. package/lib/browser/isRevocableSession.js +2 -9
  61. package/lib/browser/parseDate.js +2 -9
  62. package/lib/browser/promiseUtils.js +4 -4
  63. package/lib/browser/unique.js +4 -11
  64. package/lib/browser/unsavedChildren.js +6 -13
  65. package/lib/browser/uuid.js +5 -1
  66. package/lib/node/Analytics.js +0 -7
  67. package/lib/node/AnonymousUtils.js +0 -7
  68. package/lib/node/Cloud.js +0 -7
  69. package/lib/node/CloudCode.js +0 -1
  70. package/lib/node/CoreManager.js +1 -8
  71. package/lib/node/EventEmitter.js +0 -7
  72. package/lib/node/FacebookUtils.js +0 -7
  73. package/lib/node/InstallationController.js +0 -7
  74. package/lib/node/LiveQueryClient.js +18 -17
  75. package/lib/node/LiveQuerySubscription.js +2 -11
  76. package/lib/node/LocalDatastore.js +0 -7
  77. package/lib/node/LocalDatastoreController.js +0 -7
  78. package/lib/node/LocalDatastoreController.react-native.js +0 -7
  79. package/lib/node/LocalDatastoreUtils.js +0 -7
  80. package/lib/node/ObjectStateMutations.js +0 -7
  81. package/lib/node/Parse.js +0 -9
  82. package/lib/node/ParseACL.js +0 -7
  83. package/lib/node/ParseCLP.js +0 -7
  84. package/lib/node/ParseConfig.js +0 -7
  85. package/lib/node/ParseError.js +0 -9
  86. package/lib/node/ParseFile.js +7 -12
  87. package/lib/node/ParseGeoPoint.js +0 -7
  88. package/lib/node/ParseInstallation.js +0 -7
  89. package/lib/node/ParseLiveQuery.js +0 -7
  90. package/lib/node/ParseObject.js +5 -12
  91. package/lib/node/ParseOp.js +0 -7
  92. package/lib/node/ParsePolygon.js +0 -7
  93. package/lib/node/ParseQuery.js +3 -18
  94. package/lib/node/ParseRelation.js +0 -7
  95. package/lib/node/ParseRole.js +0 -7
  96. package/lib/node/ParseSchema.js +0 -7
  97. package/lib/node/ParseSession.js +0 -7
  98. package/lib/node/ParseUser.js +0 -7
  99. package/lib/node/Push.js +0 -7
  100. package/lib/node/RESTController.js +0 -7
  101. package/lib/node/SingleInstanceStateController.js +0 -7
  102. package/lib/node/Storage.js +0 -7
  103. package/lib/node/StorageController.browser.js +0 -7
  104. package/lib/node/StorageController.default.js +0 -7
  105. package/lib/node/StorageController.react-native.js +0 -7
  106. package/lib/node/StorageController.weapp.js +0 -7
  107. package/lib/node/TaskQueue.js +0 -7
  108. package/lib/node/UniqueInstanceStateController.js +0 -7
  109. package/lib/node/arrayContainsObject.js +0 -7
  110. package/lib/node/canBeSerialized.js +0 -7
  111. package/lib/node/decode.js +0 -7
  112. package/lib/node/encode.js +0 -7
  113. package/lib/node/equals.js +0 -9
  114. package/lib/node/escape.js +0 -7
  115. package/lib/node/isRevocableSession.js +0 -7
  116. package/lib/node/parseDate.js +0 -7
  117. package/lib/node/unique.js +0 -7
  118. package/lib/node/unsavedChildren.js +0 -7
  119. package/lib/node/uuid.js +7 -1
  120. package/lib/react-native/CoreManager.js +2 -2
  121. package/lib/react-native/EventuallyQueue.js +169 -676
  122. package/lib/react-native/LiveQueryClient.js +16 -50
  123. package/lib/react-native/LiveQuerySubscription.js +3 -2
  124. package/lib/react-native/LocalDatastore.js +303 -863
  125. package/lib/react-native/LocalDatastoreController.js +75 -535
  126. package/lib/react-native/LocalDatastoreController.react-native.js +95 -503
  127. package/lib/react-native/ObjectStateMutations.js +2 -31
  128. package/lib/react-native/OfflineQuery.js +17 -63
  129. package/lib/react-native/ParseCLP.js +55 -129
  130. package/lib/react-native/ParseFile.js +63 -468
  131. package/lib/react-native/ParseLiveQuery.js +60 -455
  132. package/lib/react-native/ParseObject.js +223 -878
  133. package/lib/react-native/ParseQuery.js +207 -643
  134. package/lib/react-native/ParseSchema.js +3 -3
  135. package/lib/react-native/ParseUser.js +118 -573
  136. package/lib/react-native/RESTController.js +1 -29
  137. package/lib/react-native/uuid.js +5 -1
  138. package/lib/weapp/Analytics.js +4 -11
  139. package/lib/weapp/AnonymousUtils.js +2 -9
  140. package/lib/weapp/Cloud.js +4 -11
  141. package/lib/weapp/CloudCode.js +0 -1
  142. package/lib/weapp/CoreManager.js +3 -10
  143. package/lib/weapp/EventEmitter.js +0 -7
  144. package/lib/weapp/EventuallyQueue.js +282 -668
  145. package/lib/weapp/FacebookUtils.js +2 -9
  146. package/lib/weapp/InstallationController.js +0 -7
  147. package/lib/weapp/LiveQueryClient.js +35 -26
  148. package/lib/weapp/LiveQuerySubscription.js +5 -4
  149. package/lib/weapp/LocalDatastore.js +472 -864
  150. package/lib/weapp/LocalDatastoreController.js +161 -547
  151. package/lib/weapp/LocalDatastoreController.react-native.js +156 -537
  152. package/lib/weapp/LocalDatastoreUtils.js +2 -9
  153. package/lib/weapp/ObjectStateMutations.js +25 -25
  154. package/lib/weapp/OfflineQuery.js +31 -33
  155. package/lib/weapp/Parse.js +4 -13
  156. package/lib/weapp/ParseACL.js +9 -16
  157. package/lib/weapp/ParseCLP.js +46 -48
  158. package/lib/weapp/ParseConfig.js +6 -13
  159. package/lib/weapp/ParseError.js +2 -11
  160. package/lib/weapp/ParseFile.js +107 -482
  161. package/lib/weapp/ParseGeoPoint.js +4 -11
  162. package/lib/weapp/ParseHooks.js +2 -2
  163. package/lib/weapp/ParseInstallation.js +2 -2
  164. package/lib/weapp/ParseLiveQuery.js +104 -480
  165. package/lib/weapp/ParseObject.js +542 -934
  166. package/lib/weapp/ParseOp.js +11 -11
  167. package/lib/weapp/ParsePolygon.js +5 -12
  168. package/lib/weapp/ParseQuery.js +365 -758
  169. package/lib/weapp/ParseRelation.js +2 -9
  170. package/lib/weapp/ParseRole.js +2 -2
  171. package/lib/weapp/ParseSchema.js +2 -9
  172. package/lib/weapp/ParseSession.js +2 -2
  173. package/lib/weapp/ParseUser.js +221 -607
  174. package/lib/weapp/Push.js +2 -9
  175. package/lib/weapp/RESTController.js +12 -19
  176. package/lib/weapp/SingleInstanceStateController.js +4 -11
  177. package/lib/weapp/Storage.js +0 -7
  178. package/lib/weapp/StorageController.browser.js +0 -7
  179. package/lib/weapp/StorageController.default.js +0 -7
  180. package/lib/weapp/StorageController.react-native.js +0 -7
  181. package/lib/weapp/StorageController.weapp.js +0 -7
  182. package/lib/weapp/TaskQueue.js +0 -7
  183. package/lib/weapp/UniqueInstanceStateController.js +8 -15
  184. package/lib/weapp/arrayContainsObject.js +2 -9
  185. package/lib/weapp/canBeSerialized.js +2 -9
  186. package/lib/weapp/decode.js +4 -11
  187. package/lib/weapp/encode.js +8 -15
  188. package/lib/weapp/equals.js +4 -13
  189. package/lib/weapp/escape.js +0 -7
  190. package/lib/weapp/isRevocableSession.js +2 -9
  191. package/lib/weapp/parseDate.js +2 -9
  192. package/lib/weapp/promiseUtils.js +4 -4
  193. package/lib/weapp/unique.js +4 -11
  194. package/lib/weapp/unsavedChildren.js +6 -13
  195. package/lib/weapp/uuid.js +2 -0
  196. package/package.json +24 -24
  197. package/PATENTS +0 -37
@@ -1,40 +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
4
 
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");
5
+ var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
20
6
 
21
- var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
7
+ var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
22
8
 
23
- var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
9
+ var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
24
10
 
25
- var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
11
+ var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
26
12
 
27
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
13
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
28
14
 
29
- var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
15
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
30
16
 
31
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
17
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
32
18
 
33
19
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
34
20
 
35
- var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
21
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
36
22
 
37
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
23
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
38
24
 
39
25
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
40
26
 
@@ -100,12 +86,12 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
100
86
  }
101
87
 
102
88
  function _unsupportedIterableToArray(o, minLen) {
103
- var _context9;
89
+ var _context7;
104
90
 
105
91
  if (!o) return;
106
92
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
107
93
 
108
- var n = _sliceInstanceProperty(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1);
94
+ var n = _sliceInstanceProperty(_context7 = Object.prototype.toString.call(o)).call(_context7, 8, -1);
109
95
 
110
96
  if (n === "Object" && o.constructor) n = o.constructor.name;
111
97
  if (n === "Map" || n === "Set") return _Array$from(o);
@@ -115,409 +101,47 @@ function _unsupportedIterableToArray(o, minLen) {
115
101
  function _arrayLikeToArray(arr, len) {
116
102
  if (len == null || len > arr.length) len = arr.length;
117
103
 
118
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
119
- arr2[i] = arr[i];
120
- }
104
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
121
105
 
122
106
  return arr2;
123
107
  }
124
108
 
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
109
  var LocalDatastoreController = {
484
110
  fromPinWithName: function (name
485
111
  /*: string*/
486
112
  )
487
113
  /*: Array<Object>*/
488
114
  {
489
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
115
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
490
116
  var values, objects;
491
- return _regeneratorRuntime().wrap(function _callee$(_context) {
492
- while (1) {
493
- switch (_context.prev = _context.next) {
494
- case 0:
495
- _context.next = 2;
496
- return _Storage.default.getItemAsync(name);
497
-
498
- case 2:
499
- values = _context.sent;
500
-
501
- if (values) {
502
- _context.next = 5;
503
- break;
504
- }
117
+ return _regenerator.default.wrap(function (_context) {
118
+ while (1) switch (_context.prev = _context.next) {
119
+ case 0:
120
+ _context.next = 2;
121
+ return _Storage.default.getItemAsync(name);
122
+
123
+ case 2:
124
+ values = _context.sent;
125
+
126
+ if (values) {
127
+ _context.next = 5;
128
+ break;
129
+ }
505
130
 
506
- return _context.abrupt("return", []);
131
+ return _context.abrupt("return", []);
507
132
 
508
- case 5:
509
- objects = JSON.parse(values);
510
- return _context.abrupt("return", objects);
133
+ case 5:
134
+ objects = JSON.parse(values);
135
+ return _context.abrupt("return", objects);
511
136
 
512
- case 7:
513
- case "end":
514
- return _context.stop();
515
- }
137
+ case 7:
138
+ case "end":
139
+ return _context.stop();
516
140
  }
517
141
  }, _callee);
518
142
  }))();
519
143
  },
520
- pinWithName: function pinWithName(name
144
+ pinWithName: function (name
521
145
  /*: string*/
522
146
  , value
523
147
  /*: any*/
@@ -525,176 +149,166 @@ var LocalDatastoreController = {
525
149
  var values = (0, _stringify.default)(value);
526
150
  return _Storage.default.setItemAsync(name, values);
527
151
  },
528
- unPinWithName: function unPinWithName(name
152
+ unPinWithName: function (name
529
153
  /*: string*/
530
154
  ) {
531
155
  return _Storage.default.removeItemAsync(name);
532
156
  },
533
- getAllContents: function getAllContents()
157
+ getAllContents: function ()
534
158
  /*: Object*/
535
159
  {
536
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
160
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
537
161
  var keys;
538
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
539
- while (1) {
540
- switch (_context3.prev = _context3.next) {
541
- case 0:
542
- _context3.next = 2;
543
- return _Storage.default.getAllKeysAsync();
544
-
545
- case 2:
546
- keys = _context3.sent;
547
- return _context3.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
548
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(previousPromise, key) {
549
- var LDS, value;
550
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
551
- while (1) {
552
- switch (_context2.prev = _context2.next) {
553
- case 0:
554
- _context2.next = 2;
555
- return previousPromise;
556
-
557
- case 2:
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();
162
+ return _regenerator.default.wrap(function (_context3) {
163
+ while (1) switch (_context3.prev = _context3.next) {
164
+ case 0:
165
+ _context3.next = 2;
166
+ return _Storage.default.getAllKeysAsync();
167
+
168
+ case 2:
169
+ keys = _context3.sent;
170
+ return _context3.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
171
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(previousPromise, key) {
172
+ var LDS, value;
173
+ return _regenerator.default.wrap(function (_context2) {
174
+ while (1) switch (_context2.prev = _context2.next) {
175
+ case 0:
176
+ _context2.next = 2;
177
+ return previousPromise;
178
+
179
+ case 2:
180
+ LDS = _context2.sent;
181
+
182
+ if (!(0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
183
+ _context2.next = 8;
184
+ break;
583
185
  }
584
- }
585
- }, _callee2);
586
- }));
587
-
588
- return function (_x, _x2) {
589
- return _ref.apply(this, arguments);
590
- };
591
- }(), _promise.default.resolve({})));
592
-
593
- case 4:
594
- case "end":
595
- return _context3.stop();
596
- }
186
+
187
+ _context2.next = 6;
188
+ return _Storage.default.getItemAsync(key);
189
+
190
+ case 6:
191
+ value = _context2.sent;
192
+
193
+ try {
194
+ LDS[key] = JSON.parse(value);
195
+ } catch (error) {
196
+ console.error('Error getAllContents: ', error);
197
+ }
198
+
199
+ case 8:
200
+ return _context2.abrupt("return", LDS);
201
+
202
+ case 9:
203
+ case "end":
204
+ return _context2.stop();
205
+ }
206
+ }, _callee2);
207
+ }));
208
+
209
+ return function () {
210
+ return _ref.apply(this, arguments);
211
+ };
212
+ }(), _promise.default.resolve({})));
213
+
214
+ case 4:
215
+ case "end":
216
+ return _context3.stop();
597
217
  }
598
218
  }, _callee3);
599
219
  }))();
600
220
  },
601
221
  // Used for testing
602
- getRawStorage: function getRawStorage()
222
+ getRawStorage: function ()
603
223
  /*: Object*/
604
224
  {
605
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
225
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
606
226
  var keys;
607
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
608
- while (1) {
609
- switch (_context5.prev = _context5.next) {
610
- case 0:
611
- _context5.next = 2;
612
- return _Storage.default.getAllKeysAsync();
613
-
614
- case 2:
615
- keys = _context5.sent;
616
- return _context5.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
617
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(previousPromise, key) {
618
- var LDS, value;
619
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
620
- while (1) {
621
- switch (_context4.prev = _context4.next) {
622
- case 0:
623
- _context4.next = 2;
624
- return previousPromise;
625
-
626
- case 2:
627
- LDS = _context4.sent;
628
- _context4.next = 5;
629
- return _Storage.default.getItemAsync(key);
630
-
631
- case 5:
632
- value = _context4.sent;
633
- LDS[key] = value;
634
- return _context4.abrupt("return", LDS);
635
-
636
- case 8:
637
- case "end":
638
- return _context4.stop();
639
- }
640
- }
641
- }, _callee4);
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
- }
227
+ return _regenerator.default.wrap(function (_context5) {
228
+ while (1) switch (_context5.prev = _context5.next) {
229
+ case 0:
230
+ _context5.next = 2;
231
+ return _Storage.default.getAllKeysAsync();
232
+
233
+ case 2:
234
+ keys = _context5.sent;
235
+ return _context5.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
236
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(previousPromise, key) {
237
+ var LDS, value;
238
+ return _regenerator.default.wrap(function (_context4) {
239
+ while (1) switch (_context4.prev = _context4.next) {
240
+ case 0:
241
+ _context4.next = 2;
242
+ return previousPromise;
243
+
244
+ case 2:
245
+ LDS = _context4.sent;
246
+ _context4.next = 5;
247
+ return _Storage.default.getItemAsync(key);
248
+
249
+ case 5:
250
+ value = _context4.sent;
251
+ LDS[key] = value;
252
+ return _context4.abrupt("return", LDS);
253
+
254
+ case 8:
255
+ case "end":
256
+ return _context4.stop();
257
+ }
258
+ }, _callee4);
259
+ }));
260
+
261
+ return function () {
262
+ return _ref2.apply(this, arguments);
263
+ };
264
+ }(), _promise.default.resolve({})));
265
+
266
+ case 4:
267
+ case "end":
268
+ return _context5.stop();
653
269
  }
654
270
  }, _callee5);
655
271
  }))();
656
272
  },
657
- clear: function clear()
273
+ clear: function ()
658
274
  /*: Promise*/
659
275
  {
660
276
  var _this = this;
661
277
 
662
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
278
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
663
279
  var keys, toRemove, _iterator, _step, key, promises;
664
280
 
665
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
666
- while (1) {
667
- switch (_context6.prev = _context6.next) {
668
- case 0:
669
- _context6.next = 2;
670
- return _Storage.default.getAllKeysAsync();
281
+ return _regenerator.default.wrap(function (_context6) {
282
+ while (1) switch (_context6.prev = _context6.next) {
283
+ case 0:
284
+ _context6.next = 2;
285
+ return _Storage.default.getAllKeysAsync();
671
286
 
672
- case 2:
673
- keys = _context6.sent;
674
- toRemove = [];
675
- _iterator = _createForOfIteratorHelper(keys);
287
+ case 2:
288
+ keys = _context6.sent;
289
+ toRemove = [];
290
+ _iterator = _createForOfIteratorHelper(keys);
676
291
 
677
- try {
678
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
679
- key = _step.value;
292
+ try {
293
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
294
+ key = _step.value;
680
295
 
681
- if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
682
- toRemove.push(key);
683
- }
296
+ if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
297
+ toRemove.push(key);
684
298
  }
685
- } catch (err) {
686
- _iterator.e(err);
687
- } finally {
688
- _iterator.f();
689
299
  }
300
+ } catch (err) {
301
+ _iterator.e(err);
302
+ } finally {
303
+ _iterator.f();
304
+ }
690
305
 
691
- promises = (0, _map.default)(toRemove).call(toRemove, _this.unPinWithName);
692
- return _context6.abrupt("return", _promise.default.all(promises));
306
+ promises = (0, _map.default)(toRemove).call(toRemove, _this.unPinWithName);
307
+ return _context6.abrupt("return", _promise.default.all(promises));
693
308
 
694
- case 8:
695
- case "end":
696
- return _context6.stop();
697
- }
309
+ case 8:
310
+ case "end":
311
+ return _context6.stop();
698
312
  }
699
313
  }, _callee6);
700
314
  }))();