parse 4.2.0 → 4.3.0-alpha.2

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 (84) hide show
  1. package/dist/parse.js +2172 -1735
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +2154 -1717
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/Cloud.js +25 -3
  6. package/lib/browser/CoreManager.js +31 -4
  7. package/lib/browser/EventEmitter.js +7 -2
  8. package/lib/browser/EventuallyQueue.js +11 -3
  9. package/lib/browser/LiveQueryClient.js +52 -86
  10. package/lib/browser/LiveQuerySubscription.js +16 -51
  11. package/lib/browser/LocalDatastore.js +7 -0
  12. package/lib/browser/ObjectStateMutations.js +3 -1
  13. package/lib/browser/OfflineQuery.js +1 -1
  14. package/lib/browser/Parse.js +171 -135
  15. package/lib/browser/ParseError.js +12 -1
  16. package/lib/browser/ParseLiveQuery.js +79 -51
  17. package/lib/browser/ParseObject.js +5 -1
  18. package/lib/browser/ParseQuery.js +53 -58
  19. package/lib/browser/ParseSchema.js +22 -1
  20. package/lib/browser/ParseSession.js +2 -6
  21. package/lib/browser/ParseUser.js +65 -8
  22. package/lib/browser/Push.js +20 -1
  23. package/lib/browser/RESTController.js +18 -14
  24. package/lib/browser/Storage.js +7 -0
  25. package/lib/node/Cloud.js +8 -2
  26. package/lib/node/CoreManager.js +30 -4
  27. package/lib/node/EventEmitter.js +7 -1
  28. package/lib/node/EventuallyQueue.js +10 -3
  29. package/lib/node/LiveQueryClient.js +5 -5
  30. package/lib/node/LiveQuerySubscription.js +5 -7
  31. package/lib/node/LocalDatastore.js +6 -0
  32. package/lib/node/ObjectStateMutations.js +3 -1
  33. package/lib/node/OfflineQuery.js +1 -1
  34. package/lib/node/Parse.js +162 -126
  35. package/lib/node/ParseError.js +15 -1
  36. package/lib/node/ParseLiveQuery.js +32 -24
  37. package/lib/node/ParseObject.js +5 -1
  38. package/lib/node/ParseQuery.js +3 -6
  39. package/lib/node/ParseSchema.js +20 -1
  40. package/lib/node/ParseSession.js +1 -6
  41. package/lib/node/ParseUser.js +58 -8
  42. package/lib/node/Push.js +5 -2
  43. package/lib/node/RESTController.js +13 -9
  44. package/lib/node/Storage.js +6 -0
  45. package/lib/react-native/Cloud.js +18 -5
  46. package/lib/react-native/CoreManager.js +30 -4
  47. package/lib/react-native/EventEmitter.js +8 -5
  48. package/lib/react-native/EventuallyQueue.js +10 -3
  49. package/lib/react-native/LiveQueryClient.js +38 -68
  50. package/lib/react-native/LiveQuerySubscription.js +16 -46
  51. package/lib/react-native/LocalDatastore.js +6 -0
  52. package/lib/react-native/ObjectStateMutations.js +3 -1
  53. package/lib/react-native/OfflineQuery.js +1 -1
  54. package/lib/react-native/Parse.js +127 -90
  55. package/lib/react-native/ParseError.js +8 -1
  56. package/lib/react-native/ParseLiveQuery.js +39 -11
  57. package/lib/react-native/ParseObject.js +4 -0
  58. package/lib/react-native/ParseQuery.js +3 -6
  59. package/lib/react-native/ParseSchema.js +14 -1
  60. package/lib/react-native/ParseUser.js +49 -6
  61. package/lib/react-native/Push.js +13 -3
  62. package/lib/react-native/RESTController.js +13 -9
  63. package/lib/react-native/Storage.js +6 -0
  64. package/lib/weapp/Cloud.js +25 -3
  65. package/lib/weapp/CoreManager.js +31 -4
  66. package/lib/weapp/EventEmitter.js +7 -2
  67. package/lib/weapp/EventuallyQueue.js +11 -3
  68. package/lib/weapp/LiveQueryClient.js +52 -86
  69. package/lib/weapp/LiveQuerySubscription.js +16 -51
  70. package/lib/weapp/LocalDatastore.js +7 -0
  71. package/lib/weapp/ObjectStateMutations.js +3 -1
  72. package/lib/weapp/OfflineQuery.js +1 -1
  73. package/lib/weapp/Parse.js +170 -134
  74. package/lib/weapp/ParseError.js +12 -1
  75. package/lib/weapp/ParseLiveQuery.js +79 -51
  76. package/lib/weapp/ParseObject.js +5 -1
  77. package/lib/weapp/ParseQuery.js +53 -58
  78. package/lib/weapp/ParseSchema.js +22 -1
  79. package/lib/weapp/ParseSession.js +2 -6
  80. package/lib/weapp/ParseUser.js +65 -8
  81. package/lib/weapp/Push.js +20 -1
  82. package/lib/weapp/RESTController.js +18 -14
  83. package/lib/weapp/Storage.js +7 -0
  84. package/package.json +22 -18
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
4
3
  var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
5
4
  var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
6
5
  var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
@@ -23,13 +22,8 @@ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stabl
23
22
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
24
23
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
25
24
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
26
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
27
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
28
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
29
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
30
25
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
31
26
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
32
- var _EventEmitter2 = _interopRequireDefault(require("./EventEmitter"));
33
27
  var _ParseObject = _interopRequireDefault(require("./ParseObject"));
34
28
  var _LiveQuerySubscription = _interopRequireDefault(require("./LiveQuerySubscription"));
35
29
  var _promiseUtils = require("./promiseUtils");
@@ -98,31 +92,6 @@ function _arrayLikeToArray(arr, len) {
98
92
  if (len == null || len > arr.length) len = arr.length;
99
93
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
100
94
  return arr2;
101
- }
102
- function _createSuper(Derived) {
103
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
104
- return function () {
105
- var Super = (0, _getPrototypeOf2.default)(Derived),
106
- result;
107
- if (hasNativeReflectConstruct) {
108
- var NewTarget = (0, _getPrototypeOf2.default)(this).constructor;
109
- result = _Reflect$construct(Super, arguments, NewTarget);
110
- } else {
111
- result = Super.apply(this, arguments);
112
- }
113
- return (0, _possibleConstructorReturn2.default)(this, result);
114
- };
115
- }
116
- function _isNativeReflectConstruct() {
117
- if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
118
- if (_Reflect$construct.sham) return false;
119
- if (typeof Proxy === "function") return true;
120
- try {
121
- Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
122
- return true;
123
- } catch (e) {
124
- return false;
125
- }
126
95
  } /* global WebSocket */
127
96
  // The LiveQuery client inner state
128
97
  var CLIENT_STATE = {
@@ -179,7 +148,6 @@ var generateInterval = function (k) {
179
148
 
180
149
  /**
181
150
  * Creates a new LiveQueryClient.
182
- * Extends events.EventEmitter
183
151
  * <a href="https://nodejs.org/api/events.html#events_class_eventemitter">cloud functions</a>.
184
152
  *
185
153
  * A wrapper of a standard WebSocket client. We add several useful methods to
@@ -221,9 +189,7 @@ var generateInterval = function (k) {
221
189
  *
222
190
  * @alias Parse.LiveQueryClient
223
191
  */
224
- var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
225
- (0, _inherits2.default)(LiveQueryClient, _EventEmitter);
226
- var _super = _createSuper(LiveQueryClient);
192
+ var LiveQueryClient = /*#__PURE__*/function () {
227
193
  /**
228
194
  * @param {object} options
229
195
  * @param {string} options.applicationId - applicationId of your Parse app
@@ -234,7 +200,6 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
234
200
  * @param {string} options.installationId (optional)
235
201
  */
236
202
  function LiveQueryClient(_ref) {
237
- var _this;
238
203
  var applicationId = _ref.applicationId,
239
204
  serverURL = _ref.serverURL,
240
205
  javascriptKey = _ref.javascriptKey,
@@ -242,43 +207,44 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
242
207
  sessionToken = _ref.sessionToken,
243
208
  installationId = _ref.installationId;
244
209
  (0, _classCallCheck2.default)(this, LiveQueryClient);
245
- _this = _super.call(this);
246
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "attempts", void 0);
247
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "id", void 0);
248
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "requestId", void 0);
249
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "applicationId", void 0);
250
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "serverURL", void 0);
251
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "javascriptKey", void 0);
252
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "masterKey", void 0);
253
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sessionToken", void 0);
254
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "installationId", void 0);
255
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "additionalProperties", void 0);
256
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "connectPromise", void 0);
257
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "subscriptions", void 0);
258
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "socket", void 0);
259
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", void 0);
210
+ (0, _defineProperty2.default)(this, "attempts", void 0);
211
+ (0, _defineProperty2.default)(this, "id", void 0);
212
+ (0, _defineProperty2.default)(this, "requestId", void 0);
213
+ (0, _defineProperty2.default)(this, "applicationId", void 0);
214
+ (0, _defineProperty2.default)(this, "serverURL", void 0);
215
+ (0, _defineProperty2.default)(this, "javascriptKey", void 0);
216
+ (0, _defineProperty2.default)(this, "masterKey", void 0);
217
+ (0, _defineProperty2.default)(this, "sessionToken", void 0);
218
+ (0, _defineProperty2.default)(this, "installationId", void 0);
219
+ (0, _defineProperty2.default)(this, "additionalProperties", void 0);
220
+ (0, _defineProperty2.default)(this, "connectPromise", void 0);
221
+ (0, _defineProperty2.default)(this, "subscriptions", void 0);
222
+ (0, _defineProperty2.default)(this, "socket", void 0);
223
+ (0, _defineProperty2.default)(this, "state", void 0);
260
224
  if (!serverURL || (0, _indexOf.default)(serverURL).call(serverURL, 'ws') !== 0) {
261
225
  throw new Error('You need to set a proper Parse LiveQuery server url before using LiveQueryClient');
262
226
  }
263
- _this.reconnectHandle = null;
264
- _this.attempts = 1;
265
- _this.id = 0;
266
- _this.requestId = 1;
267
- _this.serverURL = serverURL;
268
- _this.applicationId = applicationId;
269
- _this.javascriptKey = javascriptKey || undefined;
270
- _this.masterKey = masterKey || undefined;
271
- _this.sessionToken = sessionToken || undefined;
272
- _this.installationId = installationId || undefined;
273
- _this.additionalProperties = true;
274
- _this.connectPromise = (0, _promiseUtils.resolvingPromise)();
275
- _this.subscriptions = new _map.default();
276
- _this.state = CLIENT_STATE.INITIALIZED;
277
-
227
+ this.reconnectHandle = null;
228
+ this.attempts = 1;
229
+ this.id = 0;
230
+ this.requestId = 1;
231
+ this.serverURL = serverURL;
232
+ this.applicationId = applicationId;
233
+ this.javascriptKey = javascriptKey || undefined;
234
+ this.masterKey = masterKey || undefined;
235
+ this.sessionToken = sessionToken || undefined;
236
+ this.installationId = installationId || undefined;
237
+ this.additionalProperties = true;
238
+ this.connectPromise = (0, _promiseUtils.resolvingPromise)();
239
+ this.subscriptions = new _map.default();
240
+ this.state = CLIENT_STATE.INITIALIZED;
241
+ var EventEmitter = _CoreManager.default.getEventEmitter();
242
+ this.emitter = new EventEmitter();
243
+ this.on = this.emitter.on;
244
+ this.emit = this.emitter.emit;
278
245
  // adding listener so process does not crash
279
246
  // best practice is for developer to register their own listener
280
- _this.on('error', function () {});
281
- return _this;
247
+ this.on('error', function () {});
282
248
  }
283
249
  (0, _createClass2.default)(LiveQueryClient, [{
284
250
  key: "shouldOpen",
@@ -305,7 +271,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
305
271
  value: function (query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
306
272
  var _queryJSON$keys,
307
273
  _queryJSON$watch,
308
- _this2 = this;
274
+ _this = this;
309
275
  if (!query) {
310
276
  return;
311
277
  }
@@ -331,7 +297,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
331
297
  this.subscriptions.set(this.requestId, subscription);
332
298
  this.requestId += 1;
333
299
  this.connectPromise.then(function () {
334
- _this2.socket.send((0, _stringify.default)(subscribeRequest));
300
+ _this.socket.send((0, _stringify.default)(subscribeRequest));
335
301
  }).catch(function (error) {
336
302
  subscription.subscribePromise.reject(error);
337
303
  });
@@ -347,7 +313,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
347
313
  }, {
348
314
  key: "unsubscribe",
349
315
  value: function (subscription /*: Object*/) /*: ?Promise*/{
350
- var _this3 = this;
316
+ var _this2 = this;
351
317
  if (!subscription) {
352
318
  return;
353
319
  }
@@ -356,7 +322,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
356
322
  requestId: subscription.id
357
323
  };
358
324
  return this.connectPromise.then(function () {
359
- return _this3.socket.send((0, _stringify.default)(unsubscribeRequest));
325
+ return _this2.socket.send((0, _stringify.default)(unsubscribeRequest));
360
326
  }).then(function () {
361
327
  return subscription.unsubscribePromise;
362
328
  });
@@ -370,7 +336,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
370
336
  }, {
371
337
  key: "open",
372
338
  value: function () {
373
- var _this4 = this;
339
+ var _this3 = this;
374
340
  var WebSocketImplementation = _CoreManager.default.getWebSocketController();
375
341
  if (!WebSocketImplementation) {
376
342
  this.emit(CLIENT_EMMITER_TYPES.ERROR, 'Can not find WebSocket implementation');
@@ -384,24 +350,24 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
384
350
 
385
351
  // Bind WebSocket callbacks
386
352
  this.socket.onopen = function () {
387
- _this4._handleWebSocketOpen();
353
+ _this3._handleWebSocketOpen();
388
354
  };
389
355
  this.socket.onmessage = function (event) {
390
- _this4._handleWebSocketMessage(event);
356
+ _this3._handleWebSocketMessage(event);
391
357
  };
392
358
  this.socket.onclose = function (event) {
393
- _this4.socket.closingPromise.resolve(event);
394
- _this4._handleWebSocketClose();
359
+ _this3.socket.closingPromise.resolve(event);
360
+ _this3._handleWebSocketClose();
395
361
  };
396
362
  this.socket.onerror = function (error) {
397
- _this4._handleWebSocketError(error);
363
+ _this3._handleWebSocketError(error);
398
364
  };
399
365
  }
400
366
  }, {
401
367
  key: "resubscribe",
402
368
  value: function () {
403
369
  var _context,
404
- _this5 = this;
370
+ _this4 = this;
405
371
  (0, _forEach.default)(_context = this.subscriptions).call(_context, function (subscription, requestId) {
406
372
  var query = subscription.query;
407
373
  var queryJSON = query.toJSON();
@@ -421,8 +387,8 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
421
387
  if (sessionToken) {
422
388
  subscribeRequest.sessionToken = sessionToken;
423
389
  }
424
- _this5.connectPromise.then(function () {
425
- _this5.socket.send((0, _stringify.default)(subscribeRequest));
390
+ _this4.connectPromise.then(function () {
391
+ _this4.socket.send((0, _stringify.default)(subscribeRequest));
426
392
  });
427
393
  });
428
394
  }
@@ -634,7 +600,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
634
600
  key: "_handleReconnect",
635
601
  value: function () {
636
602
  var _context5,
637
- _this6 = this;
603
+ _this5 = this;
638
604
  // if closed or currently reconnecting we stop attempting to reconnect
639
605
  if (this.state === CLIENT_STATE.DISCONNECTED) {
640
606
  return;
@@ -651,14 +617,14 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
651
617
  clearTimeout(this.reconnectHandle);
652
618
  }
653
619
  this.reconnectHandle = (0, _setTimeout2.default)((0, _bind.default)(_context5 = function () {
654
- _this6.attempts++;
655
- _this6.connectPromise = (0, _promiseUtils.resolvingPromise)();
656
- _this6.open();
620
+ _this5.attempts++;
621
+ _this5.connectPromise = (0, _promiseUtils.resolvingPromise)();
622
+ _this5.open();
657
623
  }).call(_context5, this), time);
658
624
  }
659
625
  }]);
660
626
  return LiveQueryClient;
661
- }(_EventEmitter2.default);
627
+ }();
662
628
  _CoreManager.default.setWebSocketController(require('./Socket.weapp'));
663
629
  var _default = LiveQueryClient;
664
630
  exports.default = _default;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
4
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
5
  _Object$defineProperty(exports, "__esModule", {
@@ -9,40 +8,10 @@ _Object$defineProperty(exports, "__esModule", {
9
8
  exports.default = void 0;
10
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
11
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
15
- var _EventEmitter2 = _interopRequireDefault(require("./EventEmitter"));
16
11
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
17
12
  var _promiseUtils = require("./promiseUtils");
18
- function _createSuper(Derived) {
19
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
20
- return function () {
21
- var Super = (0, _getPrototypeOf2.default)(Derived),
22
- result;
23
- if (hasNativeReflectConstruct) {
24
- var NewTarget = (0, _getPrototypeOf2.default)(this).constructor;
25
- result = _Reflect$construct(Super, arguments, NewTarget);
26
- } else {
27
- result = Super.apply(this, arguments);
28
- }
29
- return (0, _possibleConstructorReturn2.default)(this, result);
30
- };
31
- }
32
- function _isNativeReflectConstruct() {
33
- if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
34
- if (_Reflect$construct.sham) return false;
35
- if (typeof Proxy === "function") return true;
36
- try {
37
- Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
38
- return true;
39
- } catch (e) {
40
- return false;
41
- }
42
- }
43
13
  /**
44
14
  * Creates a new LiveQuery Subscription.
45
- * Extends events.EventEmitter
46
15
  * <a href="https://nodejs.org/api/events.html#events_class_eventemitter">cloud functions</a>.
47
16
  *
48
17
  * <p>Response Object - Contains data from the client that made the request
@@ -122,32 +91,28 @@ function _isNativeReflectConstruct() {
122
91
  * subscription.on('close', () => {
123
92
  *
124
93
  * });</pre></p>
125
- *
126
- * @alias Parse.LiveQuerySubscription
127
94
  */
128
- var Subscription = /*#__PURE__*/function (_EventEmitter) {
129
- (0, _inherits2.default)(Subscription, _EventEmitter);
130
- var _super = _createSuper(Subscription);
95
+ var Subscription = /*#__PURE__*/function () {
131
96
  /*
132
97
  * @param {string} id - subscription id
133
98
  * @param {string} query - query to subscribe to
134
99
  * @param {string} sessionToken - optional session token
135
100
  */
136
101
  function Subscription(id, query, sessionToken) {
137
- var _this;
138
102
  (0, _classCallCheck2.default)(this, Subscription);
139
- _this = _super.call(this);
140
- _this.id = id;
141
- _this.query = query;
142
- _this.sessionToken = sessionToken;
143
- _this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
144
- _this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
145
- _this.subscribed = false;
146
-
103
+ this.id = id;
104
+ this.query = query;
105
+ this.sessionToken = sessionToken;
106
+ this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
107
+ this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
108
+ this.subscribed = false;
109
+ var EventEmitter = _CoreManager.default.getEventEmitter();
110
+ this.emitter = new EventEmitter();
111
+ this.on = this.emitter.on;
112
+ this.emit = this.emitter.emit;
147
113
  // adding listener so process does not crash
148
114
  // best practice is for developer to register their own listener
149
- _this.on('error', function () {});
150
- return _this;
115
+ this.on('error', function () {});
151
116
  }
152
117
 
153
118
  /**
@@ -158,14 +123,14 @@ var Subscription = /*#__PURE__*/function (_EventEmitter) {
158
123
  (0, _createClass2.default)(Subscription, [{
159
124
  key: "unsubscribe",
160
125
  value: function () /*: Promise*/{
161
- var _this2 = this;
126
+ var _this = this;
162
127
  return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient().then(function (liveQueryClient) {
163
- _this2.emit('close');
164
- return liveQueryClient.unsubscribe(_this2);
128
+ _this.emit('close');
129
+ return liveQueryClient.unsubscribe(_this);
165
130
  });
166
131
  }
167
132
  }]);
168
133
  return Subscription;
169
- }(_EventEmitter2.default);
134
+ }();
170
135
  var _default = Subscription;
171
136
  exports.default = _default;
@@ -5,7 +5,12 @@ var _Array$from2 = require("@babel/runtime-corejs3/core-js-stable/array/from");
5
5
  var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
6
6
  var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
7
7
  var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
8
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
8
9
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
10
+ _Object$defineProperty(exports, "__esModule", {
11
+ value: true
12
+ });
13
+ exports.default = void 0;
9
14
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
10
15
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
11
16
  var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
@@ -699,5 +704,7 @@ var LocalDatastore = {
699
704
  }
700
705
  };
701
706
  module.exports = LocalDatastore;
707
+ var _default = LocalDatastore;
708
+ exports.default = _default;
702
709
  _CoreManager.default.setLocalDatastoreController(require('./LocalDatastoreController'));
703
710
  _CoreManager.default.setLocalDatastore(LocalDatastore);
@@ -175,7 +175,9 @@ function estimateAttributes(serverData /*: AttributeMap*/, pendingOps /*: Array<
175
175
  function nestedSet(obj, key, value) {
176
176
  var path = key.split('.');
177
177
  for (var i = 0; i < path.length - 1; i++) {
178
- if (!(path[i] in obj)) obj[path[i]] = {};
178
+ if (!(path[i] in obj)) {
179
+ obj[path[i]] = {};
180
+ }
179
181
  obj = obj[path[i]];
180
182
  }
181
183
  if (typeof value === 'undefined') {
@@ -607,7 +607,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
607
607
  var _distance = point.radiansTo(centerPoint);
608
608
  return _distance <= maxDistance;
609
609
  }
610
- break;
610
+ return false;
611
611
  }
612
612
  case '$geoIntersects':
613
613
  {