parse 4.0.0-alpha.7 → 4.0.0-alpha.9

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 +3942 -6528
  5. package/dist/parse.min.js +7 -6
  6. package/dist/parse.weapp.js +3103 -6459
  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 +549 -935
  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 +10 -14
  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 +225 -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 +549 -935
  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
@@ -2,395 +2,24 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
- var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
6
-
7
- var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
8
-
9
- var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise");
10
-
11
- var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
12
-
13
- var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
14
-
15
- var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
16
-
17
- var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
18
-
19
- var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
20
-
21
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
22
6
 
23
- var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
7
+ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
24
8
 
25
9
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
26
10
 
27
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
28
-
29
- var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
11
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
30
12
 
31
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
13
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
32
14
 
33
15
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
34
16
 
35
17
  var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
18
+ /**
19
+ * @flow
20
+ * @private
21
+ */
36
22
 
37
- function _regeneratorRuntime() {
38
- "use strict";
39
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
40
-
41
- _regeneratorRuntime = function () {
42
- return exports;
43
- };
44
-
45
- var exports = {},
46
- Op = Object.prototype,
47
- hasOwn = Op.hasOwnProperty,
48
- $Symbol = "function" == typeof _Symbol ? _Symbol : {},
49
- iteratorSymbol = $Symbol.iterator || "@@iterator",
50
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
51
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
52
-
53
- function define(obj, key, value) {
54
- return _Object$defineProperty(obj, key, {
55
- value: value,
56
- enumerable: !0,
57
- configurable: !0,
58
- writable: !0
59
- }), obj[key];
60
- }
61
-
62
- try {
63
- define({}, "");
64
- } catch (err) {
65
- define = function (obj, key, value) {
66
- return obj[key] = value;
67
- };
68
- }
69
-
70
- function wrap(innerFn, outerFn, self, tryLocsList) {
71
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
72
- generator = _Object$create(protoGenerator.prototype),
73
- context = new Context(tryLocsList || []);
74
-
75
- return generator._invoke = function (innerFn, self, context) {
76
- var state = "suspendedStart";
77
- return function (method, arg) {
78
- if ("executing" === state) throw new Error("Generator is already running");
79
-
80
- if ("completed" === state) {
81
- if ("throw" === method) throw arg;
82
- return doneResult();
83
- }
84
-
85
- for (context.method = method, context.arg = arg;;) {
86
- var delegate = context.delegate;
87
-
88
- if (delegate) {
89
- var delegateResult = maybeInvokeDelegate(delegate, context);
90
-
91
- if (delegateResult) {
92
- if (delegateResult === ContinueSentinel) continue;
93
- return delegateResult;
94
- }
95
- }
96
-
97
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
98
- if ("suspendedStart" === state) throw state = "completed", context.arg;
99
- context.dispatchException(context.arg);
100
- } else "return" === context.method && context.abrupt("return", context.arg);
101
- state = "executing";
102
- var record = tryCatch(innerFn, self, context);
103
-
104
- if ("normal" === record.type) {
105
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
106
- return {
107
- value: record.arg,
108
- done: context.done
109
- };
110
- }
111
-
112
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
113
- }
114
- };
115
- }(innerFn, self, context), generator;
116
- }
117
-
118
- function tryCatch(fn, obj, arg) {
119
- try {
120
- return {
121
- type: "normal",
122
- arg: fn.call(obj, arg)
123
- };
124
- } catch (err) {
125
- return {
126
- type: "throw",
127
- arg: err
128
- };
129
- }
130
- }
131
-
132
- exports.wrap = wrap;
133
- var ContinueSentinel = {};
134
-
135
- function Generator() {}
136
-
137
- function GeneratorFunction() {}
138
-
139
- function GeneratorFunctionPrototype() {}
140
-
141
- var IteratorPrototype = {};
142
- define(IteratorPrototype, iteratorSymbol, function () {
143
- return this;
144
- });
145
- var getProto = _Object$getPrototypeOf,
146
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
147
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
148
-
149
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
150
-
151
- function defineIteratorMethods(prototype) {
152
- var _context6;
153
-
154
- _forEachInstanceProperty2(_context6 = ["next", "throw", "return"]).call(_context6, function (method) {
155
- define(prototype, method, function (arg) {
156
- return this._invoke(method, arg);
157
- });
158
- });
159
- }
160
-
161
- function AsyncIterator(generator, PromiseImpl) {
162
- function invoke(method, arg, resolve, reject) {
163
- var record = tryCatch(generator[method], generator, arg);
164
-
165
- if ("throw" !== record.type) {
166
- var result = record.arg,
167
- value = result.value;
168
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
169
- invoke("next", value, resolve, reject);
170
- }, function (err) {
171
- invoke("throw", err, resolve, reject);
172
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
173
- result.value = unwrapped, resolve(result);
174
- }, function (error) {
175
- return invoke("throw", error, resolve, reject);
176
- });
177
- }
178
-
179
- reject(record.arg);
180
- }
181
-
182
- var previousPromise;
183
-
184
- this._invoke = function (method, arg) {
185
- function callInvokeWithMethodAndArg() {
186
- return new PromiseImpl(function (resolve, reject) {
187
- invoke(method, arg, resolve, reject);
188
- });
189
- }
190
-
191
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
192
- };
193
- }
194
-
195
- function maybeInvokeDelegate(delegate, context) {
196
- var method = delegate.iterator[context.method];
197
-
198
- if (undefined === method) {
199
- if (context.delegate = null, "throw" === context.method) {
200
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
201
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
202
- }
203
-
204
- return ContinueSentinel;
205
- }
206
-
207
- var record = tryCatch(method, delegate.iterator, context.arg);
208
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
209
- var info = record.arg;
210
- 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);
211
- }
212
-
213
- function pushTryEntry(locs) {
214
- var entry = {
215
- tryLoc: locs[0]
216
- };
217
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
218
- }
219
-
220
- function resetTryEntry(entry) {
221
- var record = entry.completion || {};
222
- record.type = "normal", delete record.arg, entry.completion = record;
223
- }
224
-
225
- function Context(tryLocsList) {
226
- this.tryEntries = [{
227
- tryLoc: "root"
228
- }], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
229
- }
230
-
231
- function values(iterable) {
232
- if (iterable) {
233
- var iteratorMethod = iterable[iteratorSymbol];
234
- if (iteratorMethod) return iteratorMethod.call(iterable);
235
- if ("function" == typeof iterable.next) return iterable;
236
-
237
- if (!isNaN(iterable.length)) {
238
- var i = -1,
239
- next = function next() {
240
- for (; ++i < iterable.length;) {
241
- if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
242
- }
243
-
244
- return next.value = undefined, next.done = !0, next;
245
- };
246
-
247
- return next.next = next;
248
- }
249
- }
250
-
251
- return {
252
- next: doneResult
253
- };
254
- }
255
-
256
- function doneResult() {
257
- return {
258
- value: undefined,
259
- done: !0
260
- };
261
- }
262
-
263
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
264
- var ctor = "function" == typeof genFun && genFun.constructor;
265
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
266
- }, exports.mark = function (genFun) {
267
- return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
268
- }, exports.awrap = function (arg) {
269
- return {
270
- __await: arg
271
- };
272
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
273
- return this;
274
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
275
- void 0 === PromiseImpl && (PromiseImpl = _Promise);
276
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
277
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
278
- return result.done ? result.value : iter.next();
279
- });
280
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
281
- return this;
282
- }), define(Gp, "toString", function () {
283
- return "[object Generator]";
284
- }), exports.keys = function (object) {
285
- var keys = [];
286
-
287
- for (var key in object) {
288
- keys.push(key);
289
- }
290
-
291
- return _reverseInstanceProperty(keys).call(keys), function next() {
292
- for (; keys.length;) {
293
- var key = keys.pop();
294
- if (key in object) return next.value = key, next.done = !1, next;
295
- }
296
-
297
- return next.done = !0, next;
298
- };
299
- }, exports.values = values, Context.prototype = {
300
- constructor: Context,
301
- reset: function (skipTempReset) {
302
- var _context7;
303
-
304
- 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(_context7 = this.tryEntries).call(_context7, resetTryEntry), !skipTempReset) for (var name in this) {
305
- "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
306
- }
307
- },
308
- stop: function () {
309
- this.done = !0;
310
- var rootRecord = this.tryEntries[0].completion;
311
- if ("throw" === rootRecord.type) throw rootRecord.arg;
312
- return this.rval;
313
- },
314
- dispatchException: function (exception) {
315
- if (this.done) throw exception;
316
- var context = this;
317
-
318
- function handle(loc, caught) {
319
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
320
- }
321
-
322
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
323
- var entry = this.tryEntries[i],
324
- record = entry.completion;
325
- if ("root" === entry.tryLoc) return handle("end");
326
-
327
- if (entry.tryLoc <= this.prev) {
328
- var hasCatch = hasOwn.call(entry, "catchLoc"),
329
- hasFinally = hasOwn.call(entry, "finallyLoc");
330
-
331
- if (hasCatch && hasFinally) {
332
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
333
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
334
- } else if (hasCatch) {
335
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
336
- } else {
337
- if (!hasFinally) throw new Error("try statement without catch or finally");
338
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
339
- }
340
- }
341
- }
342
- },
343
- abrupt: function (type, arg) {
344
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
345
- var entry = this.tryEntries[i];
346
-
347
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
348
- var finallyEntry = entry;
349
- break;
350
- }
351
- }
352
-
353
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
354
- var record = finallyEntry ? finallyEntry.completion : {};
355
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
356
- },
357
- complete: function (record, afterLoc) {
358
- if ("throw" === record.type) throw record.arg;
359
- 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;
360
- },
361
- finish: function (finallyLoc) {
362
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
363
- var entry = this.tryEntries[i];
364
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
365
- }
366
- },
367
- catch: function (tryLoc) {
368
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
369
- var entry = this.tryEntries[i];
370
-
371
- if (entry.tryLoc === tryLoc) {
372
- var record = entry.completion;
373
-
374
- if ("throw" === record.type) {
375
- var thrown = record.arg;
376
- resetTryEntry(entry);
377
- }
378
-
379
- return thrown;
380
- }
381
- }
382
-
383
- throw new Error("illegal catch attempt");
384
- },
385
- delegateYield: function (iterable, resultName, nextLoc) {
386
- return this.delegate = {
387
- iterator: values(iterable),
388
- resultName: resultName,
389
- nextLoc: nextLoc
390
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
391
- }
392
- }, exports;
393
- }
394
23
 
395
24
  var RNStorage = require('./StorageController.react-native');
396
25
 
@@ -400,213 +29,203 @@ var LocalDatastoreController = {
400
29
  )
401
30
  /*: Promise<Array<Object>>*/
402
31
  {
403
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
32
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
404
33
  var values, objects;
405
- return _regeneratorRuntime().wrap(function _callee$(_context) {
406
- while (1) {
407
- switch (_context.prev = _context.next) {
408
- case 0:
409
- _context.next = 2;
410
- return RNStorage.getItemAsync(name);
411
-
412
- case 2:
413
- values = _context.sent;
414
-
415
- if (values) {
416
- _context.next = 5;
417
- break;
418
- }
34
+ return _regenerator.default.wrap(function (_context) {
35
+ while (1) switch (_context.prev = _context.next) {
36
+ case 0:
37
+ _context.next = 2;
38
+ return RNStorage.getItemAsync(name);
39
+
40
+ case 2:
41
+ values = _context.sent;
42
+
43
+ if (values) {
44
+ _context.next = 5;
45
+ break;
46
+ }
419
47
 
420
- return _context.abrupt("return", []);
48
+ return _context.abrupt("return", []);
421
49
 
422
- case 5:
423
- objects = JSON.parse(values);
424
- return _context.abrupt("return", objects);
50
+ case 5:
51
+ objects = JSON.parse(values);
52
+ return _context.abrupt("return", objects);
425
53
 
426
- case 7:
427
- case "end":
428
- return _context.stop();
429
- }
54
+ case 7:
55
+ case "end":
56
+ return _context.stop();
430
57
  }
431
58
  }, _callee);
432
59
  }))();
433
60
  },
434
- pinWithName: function pinWithName(name
61
+ pinWithName: function (name
435
62
  /*: string*/
436
63
  , value
437
64
  /*: any*/
438
65
  )
439
66
  /*: Promise<void>*/
440
67
  {
441
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
68
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
442
69
  var values;
443
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
444
- while (1) {
445
- switch (_context2.prev = _context2.next) {
446
- case 0:
447
- _context2.prev = 0;
448
- values = (0, _stringify.default)(value);
449
- _context2.next = 4;
450
- return RNStorage.setItemAsync(name, values);
451
-
452
- case 4:
453
- _context2.next = 9;
454
- break;
455
-
456
- case 6:
457
- _context2.prev = 6;
458
- _context2.t0 = _context2["catch"](0); // Quota exceeded, possibly due to Safari Private Browsing mode
459
-
460
- console.error(_context2.t0.message);
461
-
462
- case 9:
463
- case "end":
464
- return _context2.stop();
465
- }
70
+ return _regenerator.default.wrap(function (_context2) {
71
+ while (1) switch (_context2.prev = _context2.next) {
72
+ case 0:
73
+ _context2.prev = 0;
74
+ values = (0, _stringify.default)(value);
75
+ _context2.next = 4;
76
+ return RNStorage.setItemAsync(name, values);
77
+
78
+ case 4:
79
+ _context2.next = 9;
80
+ break;
81
+
82
+ case 6:
83
+ _context2.prev = 6;
84
+ _context2.t0 = _context2["catch"](0); // Quota exceeded, possibly due to Safari Private Browsing mode
85
+
86
+ console.error(_context2.t0.message);
87
+
88
+ case 9:
89
+ case "end":
90
+ return _context2.stop();
466
91
  }
467
92
  }, _callee2, null, [[0, 6]]);
468
93
  }))();
469
94
  },
470
- unPinWithName: function unPinWithName(name
95
+ unPinWithName: function (name
471
96
  /*: string*/
472
97
  )
473
98
  /*: Promise<void>*/
474
99
  {
475
100
  return RNStorage.removeItemAsync(name);
476
101
  },
477
- getAllContents: function getAllContents()
102
+ getAllContents: function ()
478
103
  /*: Promise<Object>*/
479
104
  {
480
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
105
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
481
106
  var keys, batch, i, key, LDS, results;
482
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
483
- while (1) {
484
- switch (_context3.prev = _context3.next) {
485
- case 0:
486
- _context3.next = 2;
487
- return RNStorage.getAllKeysAsync();
488
-
489
- case 2:
490
- keys = _context3.sent;
491
- batch = [];
492
-
493
- for (i = 0; i < keys.length; i += 1) {
494
- key = keys[i];
495
-
496
- if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
497
- batch.push(key);
498
- }
499
- }
107
+ return _regenerator.default.wrap(function (_context3) {
108
+ while (1) switch (_context3.prev = _context3.next) {
109
+ case 0:
110
+ _context3.next = 2;
111
+ return RNStorage.getAllKeysAsync();
500
112
 
501
- LDS = {};
502
- results = [];
503
- _context3.prev = 7;
504
- _context3.next = 10;
505
- return RNStorage.multiGet(batch);
113
+ case 2:
114
+ keys = _context3.sent;
115
+ batch = [];
506
116
 
507
- case 10:
508
- results = _context3.sent;
509
- _context3.next = 17;
510
- break;
117
+ for (i = 0; i < keys.length; i += 1) {
118
+ key = keys[i];
119
+
120
+ if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
121
+ batch.push(key);
122
+ }
123
+ }
124
+
125
+ LDS = {};
126
+ results = [];
127
+ _context3.prev = 7;
128
+ _context3.next = 10;
129
+ return RNStorage.multiGet(batch);
130
+
131
+ case 10:
132
+ results = _context3.sent;
133
+ _context3.next = 17;
134
+ break;
135
+
136
+ case 13:
137
+ _context3.prev = 13;
138
+ _context3.t0 = _context3["catch"](7);
139
+ console.error('Error getAllContents: ', _context3.t0);
140
+ return _context3.abrupt("return", {});
141
+
142
+ case 17:
143
+ (0, _forEach.default)(results).call(results, function (pair) {
144
+ var _pair = (0, _slicedToArray2.default)(pair, 2),
145
+ key = _pair[0],
146
+ value = _pair[1];
147
+
148
+ try {
149
+ LDS[key] = JSON.parse(value);
150
+ } catch (error) {
151
+ LDS[key] = null;
152
+ }
153
+ });
154
+ return _context3.abrupt("return", LDS);
511
155
 
512
- case 13:
513
- _context3.prev = 13;
514
- _context3.t0 = _context3["catch"](7);
515
- console.error('Error getAllContents: ', _context3.t0);
516
- return _context3.abrupt("return", {});
517
-
518
- case 17:
519
- (0, _forEach.default)(results).call(results, function (pair) {
520
- var _pair = (0, _slicedToArray2.default)(pair, 2),
521
- key = _pair[0],
522
- value = _pair[1];
523
-
524
- try {
525
- LDS[key] = JSON.parse(value);
526
- } catch (error) {
527
- LDS[key] = null;
528
- }
529
- });
530
- return _context3.abrupt("return", LDS);
531
-
532
- case 19:
533
- case "end":
534
- return _context3.stop();
535
- }
156
+ case 19:
157
+ case "end":
158
+ return _context3.stop();
536
159
  }
537
160
  }, _callee3, null, [[7, 13]]);
538
161
  }))();
539
162
  },
540
163
  // Used for testing
541
- getRawStorage: function getRawStorage()
164
+ getRawStorage: function ()
542
165
  /*: Promise<Object>*/
543
166
  {
544
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
167
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
545
168
  var keys, storage, results;
546
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
547
- while (1) {
548
- switch (_context4.prev = _context4.next) {
549
- case 0:
550
- _context4.next = 2;
551
- return RNStorage.getAllKeysAsync();
552
-
553
- case 2:
554
- keys = _context4.sent;
555
- storage = {};
556
- _context4.next = 6;
557
- return RNStorage.multiGet(keys);
558
-
559
- case 6:
560
- results = _context4.sent;
561
- (0, _map.default)(results).call(results, function (pair) {
562
- var _pair2 = (0, _slicedToArray2.default)(pair, 2),
563
- key = _pair2[0],
564
- value = _pair2[1];
565
-
566
- storage[key] = value;
567
- });
568
- return _context4.abrupt("return", storage);
569
-
570
- case 9:
571
- case "end":
572
- return _context4.stop();
573
- }
169
+ return _regenerator.default.wrap(function (_context4) {
170
+ while (1) switch (_context4.prev = _context4.next) {
171
+ case 0:
172
+ _context4.next = 2;
173
+ return RNStorage.getAllKeysAsync();
174
+
175
+ case 2:
176
+ keys = _context4.sent;
177
+ storage = {};
178
+ _context4.next = 6;
179
+ return RNStorage.multiGet(keys);
180
+
181
+ case 6:
182
+ results = _context4.sent;
183
+ (0, _map.default)(results).call(results, function (pair) {
184
+ var _pair2 = (0, _slicedToArray2.default)(pair, 2),
185
+ key = _pair2[0],
186
+ value = _pair2[1];
187
+
188
+ storage[key] = value;
189
+ });
190
+ return _context4.abrupt("return", storage);
191
+
192
+ case 9:
193
+ case "end":
194
+ return _context4.stop();
574
195
  }
575
196
  }, _callee4);
576
197
  }))();
577
198
  },
578
- clear: function clear()
199
+ clear: function ()
579
200
  /*: Promise<void>*/
580
201
  {
581
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
202
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
582
203
  var keys, batch, i, key;
583
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
584
- while (1) {
585
- switch (_context5.prev = _context5.next) {
586
- case 0:
587
- _context5.next = 2;
588
- return RNStorage.getAllKeysAsync();
589
-
590
- case 2:
591
- keys = _context5.sent;
592
- batch = [];
593
-
594
- for (i = 0; i < keys.length; i += 1) {
595
- key = keys[i];
596
-
597
- if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
598
- batch.push(key);
599
- }
204
+ return _regenerator.default.wrap(function (_context5) {
205
+ while (1) switch (_context5.prev = _context5.next) {
206
+ case 0:
207
+ _context5.next = 2;
208
+ return RNStorage.getAllKeysAsync();
209
+
210
+ case 2:
211
+ keys = _context5.sent;
212
+ batch = [];
213
+
214
+ for (i = 0; i < keys.length; i += 1) {
215
+ key = keys[i];
216
+
217
+ if ((0, _LocalDatastoreUtils.isLocalDatastoreKey)(key)) {
218
+ batch.push(key);
600
219
  }
220
+ }
601
221
 
602
- return _context5.abrupt("return", RNStorage.multiRemove(batch).catch(function (error) {
603
- return console.error('Error clearing local datastore: ', error);
604
- }));
222
+ return _context5.abrupt("return", RNStorage.multiRemove(batch).catch(function (error) {
223
+ return console.error('Error clearing local datastore: ', error);
224
+ }));
605
225
 
606
- case 6:
607
- case "end":
608
- return _context5.stop();
609
- }
226
+ case 6:
227
+ case "end":
228
+ return _context5.stop();
610
229
  }
611
230
  }, _callee5);
612
231
  }))();