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
package/lib/node/Cloud.js CHANGED
@@ -26,13 +26,6 @@ function _interopRequireDefault(obj) {
26
26
  };
27
27
  }
28
28
  /**
29
- * Copyright (c) 2015-present, Parse, LLC.
30
- * All rights reserved.
31
- *
32
- * This source code is licensed under the BSD-style license found in the
33
- * LICENSE file in the root directory of this source tree. An additional grant
34
- * of patent rights can be found in the PATENTS file in the same directory.
35
- *
36
29
  * @flow
37
30
  */
38
31
 
@@ -247,7 +247,6 @@
247
247
  * @name Parse.Cloud.job
248
248
  * @param {string} name The name of the Background Job
249
249
  * @param {Function} func The Background Job to register. This function should take two parameters a {@link Parse.Cloud.JobRequest} and a {@link Parse.Cloud.JobStatus}
250
- *
251
250
  */
252
251
 
253
252
  /**
@@ -1,12 +1,5 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2015-present, Parse, LLC.
4
- * All rights reserved.
5
- *
6
- * This source code is licensed under the BSD-style license found in the
7
- * LICENSE file in the root directory of this source tree. An additional grant
8
- * of patent rights can be found in the PATENTS file in the same directory.
9
- *
10
3
  * @flow
11
4
  */
12
5
 
@@ -217,7 +210,7 @@ const config
217
210
  SERVER_AUTH_TOKEN: null,
218
211
  LIVEQUERY_SERVER_URL: null,
219
212
  ENCRYPTED_KEY: null,
220
- VERSION: 'js' + "4.0.0-alpha.7",
213
+ VERSION: 'js' + "4.0.0-alpha.9",
221
214
  APPLICATION_ID: null,
222
215
  JAVASCRIPT_KEY: null,
223
216
  MASTER_KEY: null,
@@ -1,12 +1,5 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2015-present, Parse, LLC.
4
- * All rights reserved.
5
- *
6
- * This source code is licensed under the BSD-style license found in the
7
- * LICENSE file in the root directory of this source tree. An additional grant
8
- * of patent rights can be found in the PATENTS file in the same directory.
9
- *
10
3
  * This is a simple wrapper to unify EventEmitter implementations across platforms.
11
4
  */
12
5
 
@@ -13,13 +13,6 @@ function _interopRequireDefault(obj) {
13
13
  };
14
14
  }
15
15
  /**
16
- * Copyright (c) 2015-present, Parse, LLC.
17
- * All rights reserved.
18
- *
19
- * This source code is licensed under the BSD-style license found in the
20
- * LICENSE file in the root directory of this source tree. An additional grant
21
- * of patent rights can be found in the PATENTS file in the same directory.
22
- *
23
16
  * @flow-weak
24
17
  */
25
18
 
@@ -8,13 +8,6 @@ function _interopRequireDefault(obj) {
8
8
  };
9
9
  }
10
10
  /**
11
- * Copyright (c) 2015-present, Parse, LLC.
12
- * All rights reserved.
13
- *
14
- * This source code is licensed under the BSD-style license found in the
15
- * LICENSE file in the root directory of this source tree. An additional grant
16
- * of patent rights can be found in the PATENTS file in the same directory.
17
- *
18
11
  * @flow
19
12
  */
20
13
 
@@ -22,16 +22,6 @@ function _interopRequireDefault(obj) {
22
22
  default: obj
23
23
  };
24
24
  }
25
- /**
26
- * Copyright (c) 2015-present, Parse, LLC.
27
- * All rights reserved.
28
- *
29
- * This source code is licensed under the BSD-style license found in the
30
- * LICENSE file in the root directory of this source tree. An additional grant
31
- * of patent rights can be found in the PATENTS file in the same directory.
32
- *
33
- */
34
-
35
25
  /* global WebSocket */
36
26
  // The LiveQuery client inner state
37
27
 
@@ -218,7 +208,7 @@ class LiveQueryClient extends _EventEmitter.default {
218
208
  *
219
209
  * @param {object} query - the ParseQuery you want to subscribe to
220
210
  * @param {string} sessionToken (optional)
221
- * @returns {LiveQuerySubscription} subscription
211
+ * @returns {LiveQuerySubscription | undefined}
222
212
  */
223
213
 
224
214
 
@@ -265,23 +255,27 @@ class LiveQueryClient extends _EventEmitter.default {
265
255
  * After calling unsubscribe you'll stop receiving events from the subscription object.
266
256
  *
267
257
  * @param {object} subscription - subscription you would like to unsubscribe from.
258
+ * @returns {Promise | undefined}
268
259
  */
269
260
 
270
261
 
271
262
  unsubscribe(subscription
272
263
  /*: Object*/
273
- ) {
264
+ )
265
+ /*: ?Promise*/
266
+ {
274
267
  if (!subscription) {
275
268
  return;
276
269
  }
277
270
 
278
- this.subscriptions.delete(subscription.id);
279
271
  const unsubscribeRequest = {
280
272
  op: OP_TYPES.UNSUBSCRIBE,
281
273
  requestId: subscription.id
282
274
  };
283
- this.connectPromise.then(() => {
284
- this.socket.send(JSON.stringify(unsubscribeRequest));
275
+ return this.connectPromise.then(() => {
276
+ return this.socket.send(JSON.stringify(unsubscribeRequest));
277
+ }).then(() => {
278
+ return subscription.unsubscribePromise;
285
279
  });
286
280
  }
287
281
  /**
@@ -471,8 +465,15 @@ class LiveQueryClient extends _EventEmitter.default {
471
465
  }
472
466
 
473
467
  case OP_EVENTS.UNSUBSCRIBED:
474
- // We have already deleted subscription in unsubscribe(), do nothing here
475
- break;
468
+ {
469
+ if (subscription) {
470
+ this.subscriptions.delete(data.requestId);
471
+ subscription.subscribed = false;
472
+ subscription.unsubscribePromise.resolve();
473
+ }
474
+
475
+ break;
476
+ }
476
477
 
477
478
  default:
478
479
  {
@@ -16,16 +16,6 @@ function _interopRequireDefault(obj) {
16
16
  default: obj
17
17
  };
18
18
  }
19
- /*
20
- * Copyright (c) 2015-present, Parse, LLC.
21
- * All rights reserved.
22
- *
23
- * This source code is licensed under the BSD-style license found in the
24
- * LICENSE file in the root directory of this source tree. An additional grant
25
- * of patent rights can be found in the PATENTS file in the same directory.
26
- *
27
- */
28
-
29
19
  /**
30
20
  * Creates a new LiveQuery Subscription.
31
21
  * Extends events.EventEmitter
@@ -125,6 +115,7 @@ class Subscription extends _EventEmitter.default {
125
115
  this.query = query;
126
116
  this.sessionToken = sessionToken;
127
117
  this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
118
+ this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
128
119
  this.subscribed = false; // adding listener so process does not crash
129
120
  // best practice is for developer to register their own listener
130
121
 
@@ -141,8 +132,8 @@ class Subscription extends _EventEmitter.default {
141
132
  /*: Promise*/
142
133
  {
143
134
  return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient().then(liveQueryClient => {
144
- liveQueryClient.unsubscribe(this);
145
135
  this.emit('close');
136
+ return liveQueryClient.unsubscribe(this);
146
137
  });
147
138
  }
148
139
 
@@ -12,13 +12,6 @@ function _interopRequireDefault(obj) {
12
12
  };
13
13
  }
14
14
  /**
15
- * Copyright (c) 2015-present, Parse, LLC.
16
- * All rights reserved.
17
- *
18
- * This source code is licensed under the BSD-style license found in the
19
- * LICENSE file in the root directory of this source tree. An additional grant
20
- * of patent rights can be found in the PATENTS file in the same directory.
21
- *
22
15
  * @flow
23
16
  */
24
17
 
@@ -10,13 +10,6 @@ function _interopRequireDefault(obj) {
10
10
  };
11
11
  }
12
12
  /**
13
- * Copyright (c) 2015-present, Parse, LLC.
14
- * All rights reserved.
15
- *
16
- * This source code is licensed under the BSD-style license found in the
17
- * LICENSE file in the root directory of this source tree. An additional grant
18
- * of patent rights can be found in the PATENTS file in the same directory.
19
- *
20
13
  * @flow
21
14
  */
22
15
 
@@ -2,13 +2,6 @@
2
2
 
3
3
  var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
4
4
  /**
5
- * Copyright (c) 2015-present, Parse, LLC.
6
- * All rights reserved.
7
- *
8
- * This source code is licensed under the BSD-style license found in the
9
- * LICENSE file in the root directory of this source tree. An additional grant
10
- * of patent rights can be found in the PATENTS file in the same directory.
11
- *
12
5
  * @flow
13
6
  * @private
14
7
  */
@@ -6,13 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.PIN_PREFIX = exports.OBJECT_PREFIX = exports.DEFAULT_PIN = void 0;
7
7
  exports.isLocalDatastoreKey = isLocalDatastoreKey;
8
8
  /**
9
- * Copyright (c) 2015-present, Parse, LLC.
10
- * All rights reserved.
11
- *
12
- * This source code is licensed under the BSD-style license found in the
13
- * LICENSE file in the root directory of this source tree. An additional grant
14
- * of patent rights can be found in the PATENTS file in the same directory.
15
- *
16
9
  * @flow
17
10
  * @private
18
11
  */
@@ -31,13 +31,6 @@ function _interopRequireDefault(obj) {
31
31
  };
32
32
  }
33
33
  /**
34
- * Copyright (c) 2015-present, Parse, LLC.
35
- * All rights reserved.
36
- *
37
- * This source code is licensed under the BSD-style license found in the
38
- * LICENSE file in the root directory of this source tree. An additional grant
39
- * of patent rights can be found in the PATENTS file in the same directory.
40
- *
41
34
  * @flow
42
35
  */
43
36
 
package/lib/node/Parse.js CHANGED
@@ -71,15 +71,6 @@ function _interopRequireDefault(obj) {
71
71
  default: obj
72
72
  };
73
73
  }
74
- /**
75
- * Copyright (c) 2015-present, Parse, LLC.
76
- * All rights reserved.
77
- *
78
- * This source code is licensed under the BSD-style license found in the
79
- * LICENSE file in the root directory of this source tree. An additional grant
80
- * of patent rights can be found in the PATENTS file in the same directory.
81
- */
82
-
83
74
  /**
84
75
  * Contains all Parse API classes and functions.
85
76
  *
@@ -15,13 +15,6 @@ function _interopRequireDefault(obj) {
15
15
  };
16
16
  }
17
17
  /**
18
- * Copyright (c) 2015-present, Parse, LLC.
19
- * All rights reserved.
20
- *
21
- * This source code is licensed under the BSD-style license found in the
22
- * LICENSE file in the root directory of this source tree. An additional grant
23
- * of patent rights can be found in the PATENTS file in the same directory.
24
- *
25
18
  * @flow
26
19
  */
27
20
 
@@ -15,13 +15,6 @@ function _interopRequireDefault(obj) {
15
15
  };
16
16
  }
17
17
  /**
18
- * Copyright (c) 2015-present, Parse, LLC.
19
- * All rights reserved.
20
- *
21
- * This source code is licensed under the BSD-style license found in the
22
- * LICENSE file in the root directory of this source tree. An additional grant
23
- * of patent rights can be found in the PATENTS file in the same directory.
24
- *
25
18
  * @flow
26
19
  */
27
20
 
@@ -23,13 +23,6 @@ function _interopRequireDefault(obj) {
23
23
  };
24
24
  }
25
25
  /**
26
- * Copyright (c) 2015-present, Parse, LLC.
27
- * All rights reserved.
28
- *
29
- * This source code is licensed under the BSD-style license found in the
30
- * LICENSE file in the root directory of this source tree. An additional grant
31
- * of patent rights can be found in the PATENTS file in the same directory.
32
- *
33
26
  * @flow
34
27
  */
35
28
 
@@ -4,15 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- /**
8
- * Copyright (c) 2015-present, Parse, LLC.
9
- * All rights reserved.
10
- *
11
- * This source code is licensed under the BSD-style license found in the
12
- * LICENSE file in the root directory of this source tree. An additional grant
13
- * of patent rights can be found in the PATENTS file in the same directory.
14
- */
15
-
16
7
  /**
17
8
  * Constructs a new Parse.Error object with the given code and message.
18
9
  *
@@ -13,13 +13,6 @@ function _interopRequireDefault(obj) {
13
13
  };
14
14
  }
15
15
  /**
16
- * Copyright (c) 2015-present, Parse, LLC.
17
- * All rights reserved.
18
- *
19
- * This source code is licensed under the BSD-style license found in the
20
- * LICENSE file in the root directory of this source tree. An additional grant
21
- * of patent rights can be found in the PATENTS file in the same directory.
22
- *
23
16
  * @flow
24
17
  */
25
18
 
@@ -235,7 +228,7 @@ class ParseFile {
235
228
  * after you get the file from a Parse.Object.
236
229
  *
237
230
  * @param {object} options An object to specify url options
238
- * @returns {string}
231
+ * @returns {string | undefined}
239
232
  */
240
233
 
241
234
 
@@ -284,7 +277,7 @@ class ParseFile {
284
277
  * Saves the file to the Parse cloud.
285
278
  *
286
279
  * @param {object} options
287
- * * Valid options are:<ul>
280
+ * Valid options are:<ul>
288
281
  * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
289
282
  * be used for this request.
290
283
  * <li>sessionToken: A valid session token, used for making a request on
@@ -301,13 +294,15 @@ class ParseFile {
301
294
  * });
302
295
  * </pre>
303
296
  * </ul>
304
- * @returns {Promise} Promise that is resolved when the save finishes.
297
+ * @returns {Promise | undefined} Promise that is resolved when the save finishes.
305
298
  */
306
299
 
307
300
 
308
301
  save(options
309
302
  /*:: ?: FullOptions*/
310
- ) {
303
+ )
304
+ /*: ?Promise*/
305
+ {
311
306
  options = options || {};
312
307
 
313
308
  options.requestTask = task => this._requestTask = task;
@@ -377,7 +372,7 @@ class ParseFile {
377
372
  * In Cloud Code and Node only with Master Key.
378
373
  *
379
374
  * @param {object} options
380
- * * Valid options are:<ul>
375
+ * Valid options are:<ul>
381
376
  * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
382
377
  * be used for this request.
383
378
  * <pre>
@@ -5,13 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * Copyright (c) 2015-present, Parse, LLC.
9
- * All rights reserved.
10
- *
11
- * This source code is licensed under the BSD-style license found in the
12
- * LICENSE file in the root directory of this source tree. An additional grant
13
- * of patent rights can be found in the PATENTS file in the same directory.
14
- *
15
8
  * @flow
16
9
  */
17
10
 
@@ -13,13 +13,6 @@ function _interopRequireDefault(obj) {
13
13
  };
14
14
  }
15
15
  /**
16
- * Copyright (c) 2015-present, Parse, LLC.
17
- * All rights reserved.
18
- *
19
- * This source code is licensed under the BSD-style license found in the
20
- * LICENSE file in the root directory of this source tree. An additional grant
21
- * of patent rights can be found in the PATENTS file in the same directory.
22
- *
23
16
  * @flow
24
17
  */
25
18
 
@@ -17,13 +17,6 @@ function _interopRequireDefault(obj) {
17
17
  };
18
18
  }
19
19
  /**
20
- * Copyright (c) 2015-present, Parse, LLC.
21
- * All rights reserved.
22
- *
23
- * This source code is licensed under the BSD-style license found in the
24
- * LICENSE file in the root directory of this source tree. An additional grant
25
- * of patent rights can be found in the PATENTS file in the same directory.
26
- *
27
20
  * @flow
28
21
  */
29
22
 
@@ -99,13 +99,6 @@ function _interopRequireDefault(obj) {
99
99
  };
100
100
  }
101
101
  /**
102
- * Copyright (c) 2015-present, Parse, LLC.
103
- * All rights reserved.
104
- *
105
- * This source code is licensed under the BSD-style license found in the
106
- * LICENSE file in the root directory of this source tree. An additional grant
107
- * of patent rights can be found in the PATENTS file in the same directory.
108
- *
109
102
  * @flow
110
103
  */
111
104
 
@@ -235,7 +228,7 @@ class ParseObject {
235
228
 
236
229
  /*:: className: string;*/
237
230
 
238
- /** Prototype getters / setters **/
231
+ /* Prototype getters / setters */
239
232
 
240
233
 
241
234
  get attributes()
@@ -271,7 +264,7 @@ class ParseObject {
271
264
  {
272
265
  return this._getServerData().updatedAt;
273
266
  }
274
- /** Private methods **/
267
+ /* Private methods */
275
268
 
276
269
  /**
277
270
  * Returns a local or server Id used uniquely identify this object
@@ -621,7 +614,7 @@ class ParseObject {
621
614
  static _getClassMap() {
622
615
  return classMap;
623
616
  }
624
- /** Public methods **/
617
+ /* Public methods */
625
618
 
626
619
 
627
620
  initialize() {// NOOP
@@ -1237,7 +1230,7 @@ class ParseObject {
1237
1230
  * object.op("x") would return an instance of Parse.Op.Increment.
1238
1231
  *
1239
1232
  * @param attr {String} The key.
1240
- * @returns {Parse.Op} The operation, or undefined if none.
1233
+ * @returns {Parse.Op | undefined} The operation, or undefined if none.
1241
1234
  */
1242
1235
 
1243
1236
 
@@ -2005,7 +1998,7 @@ class ParseObject {
2005
1998
 
2006
1999
  return this;
2007
2000
  }
2008
- /** Static methods **/
2001
+ /* Static methods */
2009
2002
 
2010
2003
 
2011
2004
  static _clearAllState() {
@@ -3144,8 +3137,11 @@ const DefaultController = {
3144
3137
  }
3145
3138
 
3146
3139
  for (const object of target) {
3147
- await localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object);
3148
- await localDatastore._updateObjectIfPinned(object);
3140
+ // Make sure that it is a ParseObject before updating it into the localDataStore
3141
+ if (object instanceof ParseObject) {
3142
+ await localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object);
3143
+ await localDatastore._updateObjectIfPinned(object);
3144
+ }
3149
3145
  }
3150
3146
 
3151
3147
  return Promise.resolve(target);
@@ -24,13 +24,6 @@ function _interopRequireDefault(obj) {
24
24
  };
25
25
  }
26
26
  /**
27
- * Copyright (c) 2015-present, Parse, LLC.
28
- * All rights reserved.
29
- *
30
- * This source code is licensed under the BSD-style license found in the
31
- * LICENSE file in the root directory of this source tree. An additional grant
32
- * of patent rights can be found in the PATENTS file in the same directory.
33
- *
34
27
  * @flow
35
28
  */
36
29
 
@@ -13,13 +13,6 @@ function _interopRequireDefault(obj) {
13
13
  };
14
14
  }
15
15
  /**
16
- * Copyright (c) 2015-present, Parse, LLC.
17
- * All rights reserved.
18
- *
19
- * This source code is licensed under the BSD-style license found in the
20
- * LICENSE file in the root directory of this source tree. An additional grant
21
- * of patent rights can be found in the PATENTS file in the same directory.
22
- *
23
16
  * @flow
24
17
  */
25
18
 
@@ -27,13 +27,6 @@ function _interopRequireDefault(obj) {
27
27
  };
28
28
  }
29
29
  /*
30
- * Copyright (c) 2015-present, Parse, LLC.
31
- * All rights reserved.
32
- *
33
- * This source code is licensed under the BSD-style license found in the
34
- * LICENSE file in the root directory of this source tree. An additional grant
35
- * of patent rights can be found in the PATENTS file in the same directory.
36
- *
37
30
  * @flow
38
31
  */
39
32
 
@@ -697,7 +690,6 @@ class ParseQuery {
697
690
  * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
698
691
  * <li>json: Return raw json without converting to Parse.Object
699
692
  * </ul>
700
- *
701
693
  * @returns {Promise} A promise that is resolved with the result when
702
694
  * the query completes.
703
695
  */
@@ -750,7 +742,6 @@ class ParseQuery {
750
742
  * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
751
743
  * <li>json: Return raw json without converting to Parse.Object
752
744
  * </ul>
753
- *
754
745
  * @returns {Promise} A promise that is resolved with the results when
755
746
  * the query completes.
756
747
  */
@@ -867,7 +858,6 @@ class ParseQuery {
867
858
  * <li>sessionToken: A valid session token, used for making a request on
868
859
  * behalf of a specific user.
869
860
  * </ul>
870
- *
871
861
  * @returns {Promise} A promise that is resolved with the count when
872
862
  * the query completes.
873
863
  */
@@ -909,7 +899,6 @@ class ParseQuery {
909
899
  * <li>sessionToken: A valid session token, used for making a request on
910
900
  * behalf of a specific user.
911
901
  * </ul>
912
- *
913
902
  * @returns {Promise} A promise that is resolved with the query completes.
914
903
  */
915
904
 
@@ -950,7 +939,6 @@ class ParseQuery {
950
939
  * <li>sessionToken: A valid session token, used for making a request on
951
940
  * behalf of a specific user.
952
941
  * </ul>
953
- *
954
942
  * @returns {Promise} A promise that is resolved with the query completes.
955
943
  */
956
944
 
@@ -1011,7 +999,6 @@ class ParseQuery {
1011
999
  * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
1012
1000
  * <li>json: Return raw json without converting to Parse.Object
1013
1001
  * </ul>
1014
- *
1015
1002
  * @returns {Promise} A promise that is resolved with the object when
1016
1003
  * the query completes.
1017
1004
  */
@@ -1279,7 +1266,6 @@ class ParseQuery {
1279
1266
  * <li>index: The index of the current Parse.Object being processed in the array.</li>
1280
1267
  * <li>query: The query map was called upon.</li>
1281
1268
  * </ul>
1282
- *
1283
1269
  * @param {object} options Valid options are:<ul>
1284
1270
  * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
1285
1271
  * be used for this request.
@@ -1380,7 +1366,6 @@ class ParseQuery {
1380
1366
  * <li>index: The index of the current Parse.Object being processed in the array.</li>
1381
1367
  * <li>query: The query filter was called upon.</li>
1382
1368
  * </ul>
1383
- *
1384
1369
  * @param {object} options Valid options are:<ul>
1385
1370
  * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
1386
1371
  * be used for this request.
@@ -1412,7 +1397,7 @@ class ParseQuery {
1412
1397
  }, options);
1413
1398
  return array;
1414
1399
  }
1415
- /** Query Conditions **/
1400
+ /* Query Conditions */
1416
1401
 
1417
1402
  /**
1418
1403
  * Adds a constraint to the query that requires a particular key's value to
@@ -2186,7 +2171,7 @@ class ParseQuery {
2186
2171
  $point: point
2187
2172
  });
2188
2173
  }
2189
- /** Query Orderings **/
2174
+ /* Query Orderings */
2190
2175
 
2191
2176
  /**
2192
2177
  * Sorts the results in ascending order by the given key.
@@ -2272,7 +2257,7 @@ class ParseQuery {
2272
2257
  });
2273
2258
  return this;
2274
2259
  }
2275
- /** Query Options **/
2260
+ /* Query Options */
2276
2261
 
2277
2262
  /**
2278
2263
  * Sets the number of results to skip before returning any results.
@@ -17,13 +17,6 @@ function _interopRequireDefault(obj) {
17
17
  };
18
18
  }
19
19
  /**
20
- * Copyright (c) 2015-present, Parse, LLC.
21
- * All rights reserved.
22
- *
23
- * This source code is licensed under the BSD-style license found in the
24
- * LICENSE file in the root directory of this source tree. An additional grant
25
- * of patent rights can be found in the PATENTS file in the same directory.
26
- *
27
20
  * @flow
28
21
  */
29
22