parse 5.2.0-alpha.1 → 5.2.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 (247) hide show
  1. package/dist/parse.js +10102 -15029
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +10093 -15165
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/Analytics.js +7 -11
  6. package/lib/browser/AnonymousUtils.js +17 -22
  7. package/lib/browser/Cloud.js +23 -41
  8. package/lib/browser/CoreManager.js +71 -79
  9. package/lib/browser/CryptoController.js +14 -9
  10. package/lib/browser/EventEmitter.js +9 -2
  11. package/lib/browser/EventuallyQueue.js +156 -357
  12. package/lib/browser/FacebookUtils.js +23 -28
  13. package/lib/browser/IndexedDBStorageController.js +18 -14
  14. package/lib/browser/InstallationController.js +55 -121
  15. package/lib/browser/LiveQueryClient.js +308 -484
  16. package/lib/browser/LiveQuerySubscription.js +25 -28
  17. package/lib/browser/LocalDatastore.js +258 -624
  18. package/lib/browser/LocalDatastoreController.default.js +42 -226
  19. package/lib/browser/LocalDatastoreController.js +11 -1
  20. package/lib/browser/LocalDatastoreController.react-native.js +66 -160
  21. package/lib/browser/LocalDatastoreUtils.js +4 -7
  22. package/lib/browser/ObjectStateMutations.js +54 -96
  23. package/lib/browser/OfflineQuery.js +106 -198
  24. package/lib/browser/Parse.js +44 -60
  25. package/lib/browser/ParseACL.js +242 -288
  26. package/lib/browser/ParseCLP.js +372 -572
  27. package/lib/browser/ParseConfig.js +115 -138
  28. package/lib/browser/ParseError.js +85 -182
  29. package/lib/browser/ParseFile.js +294 -438
  30. package/lib/browser/ParseGeoPoint.js +121 -146
  31. package/lib/browser/ParseHooks.js +23 -25
  32. package/lib/browser/ParseInstallation.js +225 -367
  33. package/lib/browser/ParseLiveQuery.js +74 -148
  34. package/lib/browser/ParseObject.js +2014 -2621
  35. package/lib/browser/ParseOp.js +343 -484
  36. package/lib/browser/ParsePolygon.js +101 -120
  37. package/lib/browser/ParseQuery.js +1708 -2052
  38. package/lib/browser/ParseRelation.js +99 -118
  39. package/lib/browser/ParseRole.js +88 -140
  40. package/lib/browser/ParseSchema.js +372 -434
  41. package/lib/browser/ParseSession.js +62 -110
  42. package/lib/browser/ParseUser.js +941 -1284
  43. package/lib/browser/Push.js +15 -38
  44. package/lib/browser/RESTController.js +85 -124
  45. package/lib/browser/SingleInstanceStateController.js +57 -86
  46. package/lib/browser/Socket.weapp.js +50 -33
  47. package/lib/browser/Storage.js +23 -28
  48. package/lib/browser/StorageController.browser.js +16 -13
  49. package/lib/browser/StorageController.default.js +15 -14
  50. package/lib/browser/StorageController.js +14 -1
  51. package/lib/browser/StorageController.react-native.js +31 -30
  52. package/lib/browser/StorageController.weapp.js +19 -13
  53. package/lib/browser/TaskQueue.js +31 -43
  54. package/lib/browser/UniqueInstanceStateController.js +65 -86
  55. package/lib/browser/WebSocketController.js +11 -4
  56. package/lib/browser/Xhr.weapp.js +90 -78
  57. package/lib/browser/arrayContainsObject.js +3 -3
  58. package/lib/browser/canBeSerialized.js +10 -11
  59. package/lib/browser/decode.js +11 -11
  60. package/lib/browser/encode.js +11 -11
  61. package/lib/browser/equals.js +9 -10
  62. package/lib/browser/escape.js +2 -2
  63. package/lib/browser/isRevocableSession.js +1 -1
  64. package/lib/browser/parseDate.js +10 -10
  65. package/lib/browser/promiseUtils.js +19 -19
  66. package/lib/browser/unique.js +4 -4
  67. package/lib/browser/unsavedChildren.js +20 -21
  68. package/lib/browser/uuid.js +2 -4
  69. package/lib/node/Analytics.js +2 -6
  70. package/lib/node/AnonymousUtils.js +7 -12
  71. package/lib/node/Cloud.js +8 -8
  72. package/lib/node/CoreManager.js +59 -67
  73. package/lib/node/CryptoController.js +8 -3
  74. package/lib/node/EventEmitter.js +7 -1
  75. package/lib/node/EventuallyQueue.js +17 -36
  76. package/lib/node/FacebookUtils.js +1 -5
  77. package/lib/node/IndexedDBStorageController.js +14 -10
  78. package/lib/node/InstallationController.js +9 -10
  79. package/lib/node/LiveQueryClient.js +12 -14
  80. package/lib/node/LiveQuerySubscription.js +3 -4
  81. package/lib/node/LocalDatastore.js +20 -20
  82. package/lib/node/LocalDatastoreController.default.js +8 -9
  83. package/lib/node/LocalDatastoreController.js +14 -1
  84. package/lib/node/LocalDatastoreController.react-native.js +25 -21
  85. package/lib/node/LocalDatastoreUtils.js +4 -7
  86. package/lib/node/ObjectStateMutations.js +9 -19
  87. package/lib/node/OfflineQuery.js +37 -23
  88. package/lib/node/Parse.js +33 -47
  89. package/lib/node/ParseACL.js +18 -27
  90. package/lib/node/ParseCLP.js +35 -37
  91. package/lib/node/ParseConfig.js +7 -14
  92. package/lib/node/ParseError.js +457 -458
  93. package/lib/node/ParseFile.js +24 -44
  94. package/lib/node/ParseGeoPoint.js +16 -17
  95. package/lib/node/ParseHooks.js +13 -15
  96. package/lib/node/ParseInstallation.js +7 -8
  97. package/lib/node/ParseLiveQuery.js +6 -11
  98. package/lib/node/ParseObject.js +139 -170
  99. package/lib/node/ParseOp.js +32 -44
  100. package/lib/node/ParsePolygon.js +11 -17
  101. package/lib/node/ParseQuery.js +97 -120
  102. package/lib/node/ParseRelation.js +7 -16
  103. package/lib/node/ParseRole.js +7 -8
  104. package/lib/node/ParseSchema.js +26 -39
  105. package/lib/node/ParseSession.js +7 -8
  106. package/lib/node/ParseUser.js +73 -84
  107. package/lib/node/Push.js +4 -9
  108. package/lib/node/RESTController.js +21 -33
  109. package/lib/node/SingleInstanceStateController.js +41 -69
  110. package/lib/node/Socket.weapp.js +23 -2
  111. package/lib/node/Storage.js +11 -16
  112. package/lib/node/StorageController.browser.js +10 -8
  113. package/lib/node/StorageController.default.js +9 -9
  114. package/lib/node/StorageController.js +16 -1
  115. package/lib/node/StorageController.react-native.js +17 -17
  116. package/lib/node/StorageController.weapp.js +14 -8
  117. package/lib/node/TaskQueue.js +2 -3
  118. package/lib/node/UniqueInstanceStateController.js +40 -60
  119. package/lib/node/WebSocketController.js +15 -2
  120. package/lib/node/Xhr.weapp.js +11 -2
  121. package/lib/node/arrayContainsObject.js +1 -1
  122. package/lib/node/canBeSerialized.js +2 -2
  123. package/lib/node/decode.js +1 -1
  124. package/lib/node/encode.js +2 -2
  125. package/lib/node/equals.js +1 -1
  126. package/lib/node/escape.js +1 -1
  127. package/lib/node/isRevocableSession.js +1 -1
  128. package/lib/node/parseDate.js +1 -1
  129. package/lib/node/promiseUtils.js +7 -7
  130. package/lib/node/unique.js +2 -2
  131. package/lib/node/unsavedChildren.js +2 -2
  132. package/lib/node/uuid.js +2 -4
  133. package/lib/react-native/Analytics.js +2 -2
  134. package/lib/react-native/AnonymousUtils.js +3 -4
  135. package/lib/react-native/CoreManager.js +2 -3
  136. package/lib/react-native/CryptoController.js +6 -1
  137. package/lib/react-native/EventEmitter.js +6 -1
  138. package/lib/react-native/EventuallyQueue.js +1 -2
  139. package/lib/react-native/FacebookUtils.js +1 -2
  140. package/lib/react-native/IndexedDBStorageController.js +11 -5
  141. package/lib/react-native/InstallationController.js +1 -2
  142. package/lib/react-native/LiveQueryClient.js +2 -4
  143. package/lib/react-native/LiveQuerySubscription.js +2 -4
  144. package/lib/react-native/LocalDatastore.js +3 -3
  145. package/lib/react-native/LocalDatastoreController.default.js +1 -2
  146. package/lib/react-native/LocalDatastoreController.js +11 -1
  147. package/lib/react-native/LocalDatastoreController.react-native.js +11 -12
  148. package/lib/react-native/LocalDatastoreUtils.js +3 -6
  149. package/lib/react-native/OfflineQuery.js +25 -20
  150. package/lib/react-native/Parse.js +24 -38
  151. package/lib/react-native/ParseACL.js +4 -6
  152. package/lib/react-native/ParseCLP.js +2 -4
  153. package/lib/react-native/ParseConfig.js +4 -6
  154. package/lib/react-native/ParseError.js +13 -31
  155. package/lib/react-native/ParseFile.js +3 -4
  156. package/lib/react-native/ParseGeoPoint.js +2 -4
  157. package/lib/react-native/ParseInstallation.js +13 -30
  158. package/lib/react-native/ParseLiveQuery.js +2 -4
  159. package/lib/react-native/ParseObject.js +77 -87
  160. package/lib/react-native/ParseOp.js +41 -79
  161. package/lib/react-native/ParsePolygon.js +2 -4
  162. package/lib/react-native/ParseQuery.js +43 -45
  163. package/lib/react-native/ParseRelation.js +2 -4
  164. package/lib/react-native/ParseRole.js +13 -30
  165. package/lib/react-native/ParseSchema.js +3 -5
  166. package/lib/react-native/ParseSession.js +12 -29
  167. package/lib/react-native/ParseUser.js +24 -49
  168. package/lib/react-native/RESTController.js +10 -4
  169. package/lib/react-native/SingleInstanceStateController.js +23 -37
  170. package/lib/react-native/Socket.weapp.js +9 -4
  171. package/lib/react-native/Storage.js +1 -2
  172. package/lib/react-native/StorageController.browser.js +6 -1
  173. package/lib/react-native/StorageController.default.js +6 -1
  174. package/lib/react-native/StorageController.js +13 -1
  175. package/lib/react-native/StorageController.react-native.js +11 -6
  176. package/lib/react-native/StorageController.weapp.js +6 -1
  177. package/lib/react-native/TaskQueue.js +2 -4
  178. package/lib/react-native/UniqueInstanceStateController.js +23 -37
  179. package/lib/react-native/WebSocketController.js +9 -1
  180. package/lib/react-native/Xhr.weapp.js +9 -4
  181. package/lib/react-native/unsavedChildren.js +3 -3
  182. package/lib/react-native/uuid.js +1 -2
  183. package/lib/weapp/Analytics.js +7 -11
  184. package/lib/weapp/AnonymousUtils.js +17 -22
  185. package/lib/weapp/Cloud.js +23 -41
  186. package/lib/weapp/CoreManager.js +71 -79
  187. package/lib/weapp/CryptoController.js +14 -9
  188. package/lib/weapp/EventEmitter.js +9 -2
  189. package/lib/weapp/EventuallyQueue.js +156 -357
  190. package/lib/weapp/FacebookUtils.js +23 -28
  191. package/lib/weapp/IndexedDBStorageController.js +18 -14
  192. package/lib/weapp/InstallationController.js +55 -121
  193. package/lib/weapp/LiveQueryClient.js +308 -484
  194. package/lib/weapp/LiveQuerySubscription.js +25 -28
  195. package/lib/weapp/LocalDatastore.js +258 -624
  196. package/lib/weapp/LocalDatastoreController.default.js +42 -226
  197. package/lib/weapp/LocalDatastoreController.js +11 -1
  198. package/lib/weapp/LocalDatastoreController.react-native.js +66 -160
  199. package/lib/weapp/LocalDatastoreUtils.js +4 -7
  200. package/lib/weapp/ObjectStateMutations.js +54 -96
  201. package/lib/weapp/OfflineQuery.js +106 -198
  202. package/lib/weapp/Parse.js +44 -59
  203. package/lib/weapp/ParseACL.js +242 -288
  204. package/lib/weapp/ParseCLP.js +372 -572
  205. package/lib/weapp/ParseConfig.js +115 -138
  206. package/lib/weapp/ParseError.js +85 -182
  207. package/lib/weapp/ParseFile.js +295 -440
  208. package/lib/weapp/ParseGeoPoint.js +121 -146
  209. package/lib/weapp/ParseHooks.js +23 -25
  210. package/lib/weapp/ParseInstallation.js +225 -367
  211. package/lib/weapp/ParseLiveQuery.js +74 -148
  212. package/lib/weapp/ParseObject.js +2014 -2621
  213. package/lib/weapp/ParseOp.js +343 -484
  214. package/lib/weapp/ParsePolygon.js +101 -120
  215. package/lib/weapp/ParseQuery.js +1708 -2052
  216. package/lib/weapp/ParseRelation.js +99 -118
  217. package/lib/weapp/ParseRole.js +88 -140
  218. package/lib/weapp/ParseSchema.js +372 -434
  219. package/lib/weapp/ParseSession.js +62 -110
  220. package/lib/weapp/ParseUser.js +941 -1284
  221. package/lib/weapp/Push.js +15 -38
  222. package/lib/weapp/RESTController.js +86 -125
  223. package/lib/weapp/SingleInstanceStateController.js +57 -86
  224. package/lib/weapp/Socket.weapp.js +50 -33
  225. package/lib/weapp/Storage.js +23 -28
  226. package/lib/weapp/StorageController.browser.js +16 -13
  227. package/lib/weapp/StorageController.default.js +15 -14
  228. package/lib/weapp/StorageController.js +14 -1
  229. package/lib/weapp/StorageController.react-native.js +31 -30
  230. package/lib/weapp/StorageController.weapp.js +19 -13
  231. package/lib/weapp/TaskQueue.js +31 -43
  232. package/lib/weapp/UniqueInstanceStateController.js +65 -86
  233. package/lib/weapp/WebSocketController.js +11 -4
  234. package/lib/weapp/Xhr.weapp.js +90 -78
  235. package/lib/weapp/arrayContainsObject.js +3 -3
  236. package/lib/weapp/canBeSerialized.js +10 -11
  237. package/lib/weapp/decode.js +11 -11
  238. package/lib/weapp/encode.js +11 -11
  239. package/lib/weapp/equals.js +9 -10
  240. package/lib/weapp/escape.js +2 -2
  241. package/lib/weapp/isRevocableSession.js +1 -1
  242. package/lib/weapp/parseDate.js +10 -10
  243. package/lib/weapp/promiseUtils.js +19 -19
  244. package/lib/weapp/unique.js +4 -4
  245. package/lib/weapp/unsavedChildren.js +20 -21
  246. package/lib/weapp/uuid.js +6 -8
  247. package/package.json +19 -25
@@ -17,27 +17,6 @@ function _interopRequireDefault(obj) {
17
17
  default: obj
18
18
  };
19
19
  }
20
- /*:: export type WhereClause = {
21
- [attr: string]: any,
22
- };*/
23
- /*:: export type QueryJSON = {
24
- where: WhereClause,
25
- watch?: string,
26
- include?: string,
27
- excludeKeys?: string,
28
- keys?: string,
29
- limit?: number,
30
- skip?: number,
31
- order?: string,
32
- className?: string,
33
- count?: number,
34
- hint?: any,
35
- explain?: boolean,
36
- readPreference?: string,
37
- includeReadPreference?: string,
38
- subqueryReadPreference?: string,
39
- comment?: string,
40
- };*/
41
20
  /**
42
21
  * Converts a string into a regex that matches it.
43
22
  * Surrounding with \Q .. \E does this, we just need to escape any \E's in
@@ -47,7 +26,7 @@ function _interopRequireDefault(obj) {
47
26
  * @private
48
27
  * @returns {string}
49
28
  */
50
- function quote(s /*: string*/) /*: string*/{
29
+ function quote(s) {
51
30
  return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
52
31
  }
53
32
 
@@ -59,8 +38,8 @@ function quote(s /*: string*/) /*: string*/{
59
38
  * @private
60
39
  * @returns {string}
61
40
  */
62
- function _getClassNameFromQueries(queries /*: Array<ParseQuery>*/) /*: string | null*/{
63
- let className /*: string | null*/ = null;
41
+ function _getClassNameFromQueries(queries) {
42
+ let className = null;
64
43
  queries.forEach(q => {
65
44
  if (!className) {
66
45
  className = q.className;
@@ -77,7 +56,7 @@ function _getClassNameFromQueries(queries /*: Array<ParseQuery>*/) /*: string |
77
56
  * making sure that the data object contains keys for all objects that have
78
57
  * been requested with a select, so that our cached state updates correctly.
79
58
  */
80
- function handleSelectResult(data /*: any*/, select /*: Array<string>*/) {
59
+ function handleSelectResult(data, select) {
81
60
  const serverDataMask = {};
82
61
  select.forEach(field => {
83
62
  const hasSubObjectSelect = field.indexOf('.') !== -1;
@@ -219,7 +198,7 @@ class ParseQuery {
219
198
  /**
220
199
  * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
221
200
  */
222
- constructor(objectClass /*: string | ParseObject*/) {
201
+ constructor(objectClass) {
223
202
  if (typeof objectClass === 'string') {
224
203
  if (objectClass === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {
225
204
  this.className = '_User';
@@ -265,7 +244,7 @@ class ParseQuery {
265
244
  * @param {Array} queries
266
245
  * @returns {Parse.Query} Returns the query, so you can chain this call.
267
246
  */
268
- _orQuery(queries /*: Array<ParseQuery>*/) /*: ParseQuery*/{
247
+ _orQuery(queries) {
269
248
  const queryJSON = queries.map(q => {
270
249
  return q.toJSON().where;
271
250
  });
@@ -279,7 +258,7 @@ class ParseQuery {
279
258
  * @param {Array} queries
280
259
  * @returns {Parse.Query} Returns the query, so you can chain this call.
281
260
  */
282
- _andQuery(queries /*: Array<ParseQuery>*/) /*: ParseQuery*/{
261
+ _andQuery(queries) {
283
262
  const queryJSON = queries.map(q => {
284
263
  return q.toJSON().where;
285
264
  });
@@ -293,7 +272,7 @@ class ParseQuery {
293
272
  * @param {Array} queries
294
273
  * @returns {Parse.Query} Returns the query, so you can chain this call.
295
274
  */
296
- _norQuery(queries /*: Array<ParseQuery>*/) /*: ParseQuery*/{
275
+ _norQuery(queries) {
297
276
  const queryJSON = queries.map(q => {
298
277
  return q.toJSON().where;
299
278
  });
@@ -309,7 +288,7 @@ class ParseQuery {
309
288
  * @param value
310
289
  * @returns {Parse.Query}
311
290
  */
312
- _addCondition(key /*: string*/, condition /*: string*/, value /*: any*/) /*: ParseQuery*/{
291
+ _addCondition(key, condition, value) {
313
292
  if (!this._where[key] || typeof this._where[key] === 'string') {
314
293
  this._where[key] = {};
315
294
  }
@@ -323,10 +302,10 @@ class ParseQuery {
323
302
  * @param string
324
303
  * @returns {string}
325
304
  */
326
- _regexStartWith(string /*: string*/) /*: string*/{
305
+ _regexStartWith(string) {
327
306
  return '^' + quote(string);
328
307
  }
329
- async _handleOfflineQuery(params /*: QueryJSON*/) {
308
+ async _handleOfflineQuery(params) {
330
309
  _OfflineQuery.default.validateQuery(this);
331
310
  const localDatastore = _CoreManager.default.getLocalDatastore();
332
311
  const objects = await localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
@@ -363,7 +342,6 @@ class ParseQuery {
363
342
  if (params.count) {
364
343
  count = results.length; // total count from response
365
344
  }
366
-
367
345
  if (params.skip) {
368
346
  if (params.skip >= results.length) {
369
347
  results = [];
@@ -390,8 +368,8 @@ class ParseQuery {
390
368
  *
391
369
  * @returns {object} The JSON representation of the query.
392
370
  */
393
- toJSON() /*: QueryJSON*/{
394
- const params /*: QueryJSON*/ = {
371
+ toJSON() {
372
+ const params = {
395
373
  where: this._where
396
374
  };
397
375
  if (this._watch.length) {
@@ -463,7 +441,7 @@ class ParseQuery {
463
441
  * @param {QueryJSON} json from Parse.Query.toJSON() method
464
442
  * @returns {Parse.Query} Returns the query, so you can chain this call.
465
443
  */
466
- withJSON(json /*: QueryJSON*/) /*: ParseQuery*/{
444
+ withJSON(json) {
467
445
  if (json.where) {
468
446
  this._where = json.where;
469
447
  }
@@ -527,7 +505,7 @@ class ParseQuery {
527
505
  * @param {QueryJSON} json from Parse.Query.toJSON() method
528
506
  * @returns {Parse.Query} new created query
529
507
  */
530
- static fromJSON(className /*: string*/, json /*: QueryJSON*/) /*: ParseQuery*/{
508
+ static fromJSON(className, json) {
531
509
  const query = new ParseQuery(className);
532
510
  return query.withJSON(json);
533
511
  }
@@ -549,9 +527,9 @@ class ParseQuery {
549
527
  * @returns {Promise} A promise that is resolved with the result when
550
528
  * the query completes.
551
529
  */
552
- get(objectId /*: string*/, options /*:: ?: QueryOptions*/) /*: Promise<ParseObject>*/{
530
+ get(objectId, options) {
553
531
  this.equalTo('objectId', objectId);
554
- const firstOptions /*: QueryOptions*/ = {};
532
+ const firstOptions = {};
555
533
  if (options && options.hasOwnProperty('useMasterKey')) {
556
534
  firstOptions.useMasterKey = options.useMasterKey;
557
535
  }
@@ -588,9 +566,9 @@ class ParseQuery {
588
566
  * @returns {Promise} A promise that is resolved with the results when
589
567
  * the query completes.
590
568
  */
591
- find(options /*:: ?: QueryOptions*/) /*: Promise<Array<ParseObject>>*/{
569
+ find(options) {
592
570
  options = options || {};
593
- const findOptions /*: QueryOptions*/ = {};
571
+ const findOptions = {};
594
572
  if (options.hasOwnProperty('useMasterKey')) {
595
573
  findOptions.useMasterKey = options.useMasterKey;
596
574
  }
@@ -658,9 +636,9 @@ class ParseQuery {
658
636
  * @returns {Promise} A promise that is resolved with the results when
659
637
  * the query completes.
660
638
  */
661
- async findAll(options /*:: ?: BatchOptions*/) /*: Promise<Array<ParseObject>>*/{
662
- let result /*: ParseObject[]*/ = [];
663
- await this.eachBatch((objects /*: ParseObject[]*/) => {
639
+ async findAll(options) {
640
+ let result = [];
641
+ await this.eachBatch(objects => {
664
642
  result = [...result, ...objects];
665
643
  }, options);
666
644
  return result;
@@ -681,9 +659,9 @@ class ParseQuery {
681
659
  * @returns {Promise} A promise that is resolved with the count when
682
660
  * the query completes.
683
661
  */
684
- count(options /*:: ?: { useMasterKey?: boolean, sessionToken?: string }*/) /*: Promise<number>*/{
662
+ count(options) {
685
663
  options = options || {};
686
- const findOptions /*: { useMasterKey?: boolean, sessionToken?: string }*/ = {};
664
+ const findOptions = {};
687
665
  if (options.hasOwnProperty('useMasterKey')) {
688
666
  findOptions.useMasterKey = options.useMasterKey;
689
667
  }
@@ -708,9 +686,9 @@ class ParseQuery {
708
686
  * @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
709
687
  * @returns {Promise} A promise that is resolved with the query completes.
710
688
  */
711
- distinct(key /*: string*/, options /*:: ?: { sessionToken?: string }*/) /*: Promise<Array<any>>*/{
689
+ distinct(key, options) {
712
690
  options = options || {};
713
- const distinctOptions /*: { sessionToken?: string, useMasterKey: boolean }*/ = {
691
+ const distinctOptions = {
714
692
  useMasterKey: true
715
693
  };
716
694
  if (options.hasOwnProperty('sessionToken')) {
@@ -736,9 +714,9 @@ class ParseQuery {
736
714
  * @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
737
715
  * @returns {Promise} A promise that is resolved with the query completes.
738
716
  */
739
- aggregate(pipeline /*: any*/, options /*:: ?: { sessionToken?: string }*/) /*: Promise<Array<any>>*/{
717
+ aggregate(pipeline, options) {
740
718
  options = options || {};
741
- const aggregateOptions /*: { sessionToken?: string, useMasterKey: boolean }*/ = {
719
+ const aggregateOptions = {
742
720
  useMasterKey: true
743
721
  };
744
722
  if (options.hasOwnProperty('sessionToken')) {
@@ -784,8 +762,8 @@ class ParseQuery {
784
762
  * @returns {Promise} A promise that is resolved with the object when
785
763
  * the query completes.
786
764
  */
787
- first(options /*: QueryOptions*/ = {}) /*: Promise<ParseObject | void>*/{
788
- const findOptions /*: QueryOptions*/ = {};
765
+ first(options = {}) {
766
+ const findOptions = {};
789
767
  if (options.hasOwnProperty('useMasterKey')) {
790
768
  findOptions.useMasterKey = options.useMasterKey;
791
769
  }
@@ -852,7 +830,7 @@ class ParseQuery {
852
830
  * @returns {Promise} A promise that will be fulfilled once the
853
831
  * iteration has completed.
854
832
  */
855
- eachBatch(callback /*: (objs: Array<ParseObject>) => void*/, options /*:: ?: BatchOptions*/) /*: Promise<void>*/{
833
+ eachBatch(callback, options) {
856
834
  options = options || {};
857
835
  if (this._order || this._skip || this._limit >= 0) {
858
836
  return Promise.reject('Cannot iterate on a query with sort, skip, or limit.');
@@ -883,7 +861,7 @@ class ParseQuery {
883
861
  }
884
862
  }
885
863
  query.ascending('objectId');
886
- const findOptions /*: BatchOptions*/ = {};
864
+ const findOptions = {};
887
865
  if (options.hasOwnProperty('useMasterKey')) {
888
866
  findOptions.useMasterKey = options.useMasterKey;
889
867
  }
@@ -897,7 +875,7 @@ class ParseQuery {
897
875
  findOptions.json = options.json;
898
876
  }
899
877
  let finished = false;
900
- let previousResults /*: ParseObject[]*/ = [];
878
+ let previousResults = [];
901
879
  return (0, _promiseUtils.continueWhile)(() => {
902
880
  return !finished;
903
881
  }, async () => {
@@ -934,7 +912,7 @@ class ParseQuery {
934
912
  * @returns {Promise} A promise that will be fulfilled once the
935
913
  * iteration has completed.
936
914
  */
937
- each(callback /*: (obj: ParseObject) => any*/, options /*:: ?: BatchOptions*/) /*: Promise<void>*/{
915
+ each(callback, options) {
938
916
  return this.eachBatch(results => {
939
917
  let callbacksDone = Promise.resolve();
940
918
  results.forEach(result => {
@@ -952,7 +930,7 @@ class ParseQuery {
952
930
  * @param {(string|object)} value String or Object of index that should be used when executing query
953
931
  * @returns {Parse.Query} Returns the query, so you can chain this call.
954
932
  */
955
- hint(value /*: any*/) /*: ParseQuery*/{
933
+ hint(value) {
956
934
  if (typeof value === 'undefined') {
957
935
  delete this._hint;
958
936
  }
@@ -966,7 +944,7 @@ class ParseQuery {
966
944
  * @param {boolean} explain Used to toggle the information on the query plan.
967
945
  * @returns {Parse.Query} Returns the query, so you can chain this call.
968
946
  */
969
- explain(explain = true) /*: ParseQuery*/{
947
+ explain(explain = true) {
970
948
  if (typeof explain !== 'boolean') {
971
949
  throw new Error('You can only set explain to a boolean value');
972
950
  }
@@ -996,8 +974,8 @@ class ParseQuery {
996
974
  * @returns {Promise} A promise that will be fulfilled once the
997
975
  * iteration has completed.
998
976
  */
999
- async map(callback /*: (currentObject: ParseObject, index: number, query: ParseQuery) => any*/, options /*:: ?: BatchOptions*/) /*: Promise<Array<any>>*/{
1000
- const array /*: ParseObject[]*/ = [];
977
+ async map(callback, options) {
978
+ const array = [];
1001
979
  let index = 0;
1002
980
  await this.each(object => {
1003
981
  return Promise.resolve(callback(object, index, this)).then(result => {
@@ -1031,7 +1009,7 @@ class ParseQuery {
1031
1009
  * @returns {Promise} A promise that will be fulfilled once the
1032
1010
  * iteration has completed.
1033
1011
  */
1034
- async reduce(callback /*: (accumulator: any, currentObject: ParseObject, index: number) => any*/, initialValue /*: any*/, options /*:: ?: BatchOptions*/) /*: Promise<Array<any>>*/{
1012
+ async reduce(callback, initialValue, options) {
1035
1013
  let accumulator = initialValue;
1036
1014
  let index = 0;
1037
1015
  await this.each(object => {
@@ -1077,8 +1055,8 @@ class ParseQuery {
1077
1055
  * @returns {Promise} A promise that will be fulfilled once the
1078
1056
  * iteration has completed.
1079
1057
  */
1080
- async filter(callback /*: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean*/, options /*:: ?: BatchOptions*/) /*: Promise<Array<ParseObject>>*/{
1081
- const array /*: ParseObject[]*/ = [];
1058
+ async filter(callback, options) {
1059
+ const array = [];
1082
1060
  let index = 0;
1083
1061
  await this.each(object => {
1084
1062
  return Promise.resolve(callback(object, index, this)).then(flag => {
@@ -1101,7 +1079,7 @@ class ParseQuery {
1101
1079
  * @param value The value that the Parse.Object must contain.
1102
1080
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1103
1081
  */
1104
- equalTo(key /*: string | { [key: string]: any }*/, value /*:: ?: any*/) /*: ParseQuery*/{
1082
+ equalTo(key, value) {
1105
1083
  if (key && typeof key === 'object') {
1106
1084
  Object.entries(key).forEach(([k, val]) => this.equalTo(k, val));
1107
1085
  return this;
@@ -1121,7 +1099,7 @@ class ParseQuery {
1121
1099
  * @param value The value that must not be equalled.
1122
1100
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1123
1101
  */
1124
- notEqualTo(key /*: string | { [key: string]: any }*/, value /*:: ?: any*/) /*: ParseQuery*/{
1102
+ notEqualTo(key, value) {
1125
1103
  if (key && typeof key === 'object') {
1126
1104
  Object.entries(key).forEach(([k, val]) => this.notEqualTo(k, val));
1127
1105
  return this;
@@ -1137,7 +1115,7 @@ class ParseQuery {
1137
1115
  * @param value The value that provides an upper bound.
1138
1116
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1139
1117
  */
1140
- lessThan(key /*: string*/, value /*: any*/) /*: ParseQuery*/{
1118
+ lessThan(key, value) {
1141
1119
  return this._addCondition(key, '$lt', value);
1142
1120
  }
1143
1121
 
@@ -1149,7 +1127,7 @@ class ParseQuery {
1149
1127
  * @param value The value that provides an lower bound.
1150
1128
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1151
1129
  */
1152
- greaterThan(key /*: string*/, value /*: any*/) /*: ParseQuery*/{
1130
+ greaterThan(key, value) {
1153
1131
  return this._addCondition(key, '$gt', value);
1154
1132
  }
1155
1133
 
@@ -1161,7 +1139,7 @@ class ParseQuery {
1161
1139
  * @param value The value that provides an upper bound.
1162
1140
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1163
1141
  */
1164
- lessThanOrEqualTo(key /*: string*/, value /*: any*/) /*: ParseQuery*/{
1142
+ lessThanOrEqualTo(key, value) {
1165
1143
  return this._addCondition(key, '$lte', value);
1166
1144
  }
1167
1145
 
@@ -1173,7 +1151,7 @@ class ParseQuery {
1173
1151
  * @param {*} value The value that provides an lower bound.
1174
1152
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1175
1153
  */
1176
- greaterThanOrEqualTo(key /*: string*/, value /*: any*/) /*: ParseQuery*/{
1154
+ greaterThanOrEqualTo(key, value) {
1177
1155
  return this._addCondition(key, '$gte', value);
1178
1156
  }
1179
1157
 
@@ -1185,7 +1163,7 @@ class ParseQuery {
1185
1163
  * @param {Array<*>} value The values that will match.
1186
1164
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1187
1165
  */
1188
- containedIn(key /*: string*/, value /*: Array<any>*/) /*: ParseQuery*/{
1166
+ containedIn(key, value) {
1189
1167
  return this._addCondition(key, '$in', value);
1190
1168
  }
1191
1169
 
@@ -1197,7 +1175,7 @@ class ParseQuery {
1197
1175
  * @param {Array<*>} value The values that will not match.
1198
1176
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1199
1177
  */
1200
- notContainedIn(key /*: string*/, value /*: Array<any>*/) /*: ParseQuery*/{
1178
+ notContainedIn(key, value) {
1201
1179
  return this._addCondition(key, '$nin', value);
1202
1180
  }
1203
1181
 
@@ -1209,7 +1187,7 @@ class ParseQuery {
1209
1187
  * @param {Array} values The values that will match.
1210
1188
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1211
1189
  */
1212
- containedBy(key /*: string*/, values /*: Array<any>*/) /*: ParseQuery*/{
1190
+ containedBy(key, values) {
1213
1191
  return this._addCondition(key, '$containedBy', values);
1214
1192
  }
1215
1193
 
@@ -1221,7 +1199,7 @@ class ParseQuery {
1221
1199
  * @param {Array} values The values that will match.
1222
1200
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1223
1201
  */
1224
- containsAll(key /*: string*/, values /*: Array<any>*/) /*: ParseQuery*/{
1202
+ containsAll(key, values) {
1225
1203
  return this._addCondition(key, '$all', values);
1226
1204
  }
1227
1205
 
@@ -1233,7 +1211,7 @@ class ParseQuery {
1233
1211
  * @param {Array<string>} values The string values that will match as starting string.
1234
1212
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1235
1213
  */
1236
- containsAllStartingWith(key /*: string*/, values /*: Array<string>*/) /*: ParseQuery*/{
1214
+ containsAllStartingWith(key, values) {
1237
1215
  if (!Array.isArray(values)) {
1238
1216
  values = [values];
1239
1217
  }
@@ -1251,7 +1229,7 @@ class ParseQuery {
1251
1229
  * @param {string} key The key that should exist.
1252
1230
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1253
1231
  */
1254
- exists(key /*: string*/) /*: ParseQuery*/{
1232
+ exists(key) {
1255
1233
  return this._addCondition(key, '$exists', true);
1256
1234
  }
1257
1235
 
@@ -1261,7 +1239,7 @@ class ParseQuery {
1261
1239
  * @param {string} key The key that should not exist
1262
1240
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1263
1241
  */
1264
- doesNotExist(key /*: string*/) /*: ParseQuery*/{
1242
+ doesNotExist(key) {
1265
1243
  return this._addCondition(key, '$exists', false);
1266
1244
  }
1267
1245
 
@@ -1275,7 +1253,7 @@ class ParseQuery {
1275
1253
  * @param {string} modifiers The regular expression mode.
1276
1254
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1277
1255
  */
1278
- matches(key /*: string*/, regex /*: RegExp | string*/, modifiers /*: string*/) /*: ParseQuery*/{
1256
+ matches(key, regex, modifiers) {
1279
1257
  this._addCondition(key, '$regex', regex);
1280
1258
  if (!modifiers) {
1281
1259
  modifiers = '';
@@ -1303,7 +1281,7 @@ class ParseQuery {
1303
1281
  * @param {Parse.Query} query The query that should match.
1304
1282
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1305
1283
  */
1306
- matchesQuery(key /*: string*/, query /*: ParseQuery*/) /*: ParseQuery*/{
1284
+ matchesQuery(key, query) {
1307
1285
  const queryJSON = query.toJSON();
1308
1286
  queryJSON.className = query.className;
1309
1287
  return this._addCondition(key, '$inQuery', queryJSON);
@@ -1318,7 +1296,7 @@ class ParseQuery {
1318
1296
  * @param {Parse.Query} query The query that should not match.
1319
1297
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1320
1298
  */
1321
- doesNotMatchQuery(key /*: string*/, query /*: ParseQuery*/) /*: ParseQuery*/{
1299
+ doesNotMatchQuery(key, query) {
1322
1300
  const queryJSON = query.toJSON();
1323
1301
  queryJSON.className = query.className;
1324
1302
  return this._addCondition(key, '$notInQuery', queryJSON);
@@ -1335,7 +1313,7 @@ class ParseQuery {
1335
1313
  * @param {Parse.Query} query The query to run.
1336
1314
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1337
1315
  */
1338
- matchesKeyInQuery(key /*: string*/, queryKey /*: string*/, query /*: ParseQuery*/) /*: ParseQuery*/{
1316
+ matchesKeyInQuery(key, queryKey, query) {
1339
1317
  const queryJSON = query.toJSON();
1340
1318
  queryJSON.className = query.className;
1341
1319
  return this._addCondition(key, '$select', {
@@ -1355,7 +1333,7 @@ class ParseQuery {
1355
1333
  * @param {Parse.Query} query The query to run.
1356
1334
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1357
1335
  */
1358
- doesNotMatchKeyInQuery(key /*: string*/, queryKey /*: string*/, query /*: ParseQuery*/) /*: ParseQuery*/{
1336
+ doesNotMatchKeyInQuery(key, queryKey, query) {
1359
1337
  const queryJSON = query.toJSON();
1360
1338
  queryJSON.className = query.className;
1361
1339
  return this._addCondition(key, '$dontSelect', {
@@ -1372,7 +1350,7 @@ class ParseQuery {
1372
1350
  * @param {string} substring The substring that the value must contain.
1373
1351
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1374
1352
  */
1375
- contains(key /*: string*/, substring /*: string*/) /*: ParseQuery*/{
1353
+ contains(key, substring) {
1376
1354
  if (typeof substring !== 'string') {
1377
1355
  throw new Error('The value being searched for must be a string.');
1378
1356
  }
@@ -1408,7 +1386,7 @@ class ParseQuery {
1408
1386
  * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search.
1409
1387
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1410
1388
  */
1411
- fullText(key /*: string*/, value /*: string*/, options /*: FullTextQueryOptions*/ = {}) /*: ParseQuery*/{
1389
+ fullText(key, value, options = {}) {
1412
1390
  options = options || {};
1413
1391
  if (!key) {
1414
1392
  throw new Error('A key is required.');
@@ -1419,7 +1397,7 @@ class ParseQuery {
1419
1397
  if (typeof value !== 'string') {
1420
1398
  throw new Error('The value being searched for must be a string.');
1421
1399
  }
1422
- const fullOptions /*: { $term?: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }*/ = {};
1400
+ const fullOptions = {};
1423
1401
  fullOptions.$term = value;
1424
1402
  for (const option in options) {
1425
1403
  switch (option) {
@@ -1462,7 +1440,7 @@ class ParseQuery {
1462
1440
  * @param {string} modifiers The regular expression mode.
1463
1441
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1464
1442
  */
1465
- startsWith(key /*: string*/, prefix /*: string*/, modifiers /*: string*/) /*: ParseQuery*/{
1443
+ startsWith(key, prefix, modifiers) {
1466
1444
  if (typeof prefix !== 'string') {
1467
1445
  throw new Error('The value being searched for must be a string.');
1468
1446
  }
@@ -1478,7 +1456,7 @@ class ParseQuery {
1478
1456
  * @param {string} modifiers The regular expression mode.
1479
1457
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1480
1458
  */
1481
- endsWith(key /*: string*/, suffix /*: string*/, modifiers /*: string*/) /*: ParseQuery*/{
1459
+ endsWith(key, suffix, modifiers) {
1482
1460
  if (typeof suffix !== 'string') {
1483
1461
  throw new Error('The value being searched for must be a string.');
1484
1462
  }
@@ -1493,7 +1471,7 @@ class ParseQuery {
1493
1471
  * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used.
1494
1472
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1495
1473
  */
1496
- near(key /*: string*/, point /*: ParseGeoPoint*/) /*: ParseQuery*/{
1474
+ near(key, point) {
1497
1475
  if (!(point instanceof _ParseGeoPoint.default)) {
1498
1476
  // Try to cast it as a GeoPoint
1499
1477
  point = new _ParseGeoPoint.default(point);
@@ -1513,7 +1491,7 @@ class ParseQuery {
1513
1491
  * defaults to true.
1514
1492
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1515
1493
  */
1516
- withinRadians(key /*: string*/, point /*: ParseGeoPoint*/, maxDistance /*: number*/, sorted /*: boolean*/) /*: ParseQuery*/{
1494
+ withinRadians(key, point, maxDistance, sorted) {
1517
1495
  if (sorted || sorted === undefined) {
1518
1496
  this.near(key, point);
1519
1497
  return this._addCondition(key, '$maxDistance', maxDistance);
@@ -1537,7 +1515,7 @@ class ParseQuery {
1537
1515
  * defaults to true.
1538
1516
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1539
1517
  */
1540
- withinMiles(key /*: string*/, point /*: ParseGeoPoint*/, maxDistance /*: number*/, sorted /*: boolean*/) /*: ParseQuery*/{
1518
+ withinMiles(key, point, maxDistance, sorted) {
1541
1519
  return this.withinRadians(key, point, maxDistance / 3958.8, sorted);
1542
1520
  }
1543
1521
 
@@ -1554,7 +1532,7 @@ class ParseQuery {
1554
1532
  * defaults to true.
1555
1533
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1556
1534
  */
1557
- withinKilometers(key /*: string*/, point /*: ParseGeoPoint*/, maxDistance /*: number*/, sorted /*: boolean*/) /*: ParseQuery*/{
1535
+ withinKilometers(key, point, maxDistance, sorted) {
1558
1536
  return this.withinRadians(key, point, maxDistance / 6371.0, sorted);
1559
1537
  }
1560
1538
 
@@ -1570,7 +1548,7 @@ class ParseQuery {
1570
1548
  * The upper-right inclusive corner of the box.
1571
1549
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1572
1550
  */
1573
- withinGeoBox(key /*: string*/, southwest /*: ParseGeoPoint*/, northeast /*: ParseGeoPoint*/) /*: ParseQuery*/{
1551
+ withinGeoBox(key, southwest, northeast) {
1574
1552
  if (!(southwest instanceof _ParseGeoPoint.default)) {
1575
1553
  southwest = new _ParseGeoPoint.default(southwest);
1576
1554
  }
@@ -1594,7 +1572,7 @@ class ParseQuery {
1594
1572
  * @param {Array} points Array of Coordinates / GeoPoints
1595
1573
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1596
1574
  */
1597
- withinPolygon(key /*: string*/, points /*: Array<Array<number>>*/) /*: ParseQuery*/{
1575
+ withinPolygon(key, points) {
1598
1576
  return this._addCondition(key, '$geoWithin', {
1599
1577
  $polygon: points
1600
1578
  });
@@ -1608,7 +1586,7 @@ class ParseQuery {
1608
1586
  * @param {Parse.GeoPoint} point
1609
1587
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1610
1588
  */
1611
- polygonContains(key /*: string*/, point /*: ParseGeoPoint*/) /*: ParseQuery*/{
1589
+ polygonContains(key, point) {
1612
1590
  return this._addCondition(key, '$geoIntersects', {
1613
1591
  $point: point
1614
1592
  });
@@ -1623,7 +1601,7 @@ class ParseQuery {
1623
1601
  * string of comma separated values, or an Array of keys, or multiple keys.
1624
1602
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1625
1603
  */
1626
- ascending(...keys) /*: ParseQuery*/{
1604
+ ascending(...keys) {
1627
1605
  this._order = [];
1628
1606
  return this.addAscending.apply(this, keys);
1629
1607
  }
@@ -1636,7 +1614,7 @@ class ParseQuery {
1636
1614
  * string of comma separated values, or an Array of keys, or multiple keys.
1637
1615
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1638
1616
  */
1639
- addAscending(...keys) /*: ParseQuery*/{
1617
+ addAscending(...keys) {
1640
1618
  if (!this._order) {
1641
1619
  this._order = [];
1642
1620
  }
@@ -1656,7 +1634,7 @@ class ParseQuery {
1656
1634
  * string of comma separated values, or an Array of keys, or multiple keys.
1657
1635
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1658
1636
  */
1659
- descending(...keys) /*: ParseQuery*/{
1637
+ descending(...keys) {
1660
1638
  this._order = [];
1661
1639
  return this.addDescending.apply(this, keys);
1662
1640
  }
@@ -1669,7 +1647,7 @@ class ParseQuery {
1669
1647
  * string of comma separated values, or an Array of keys, or multiple keys.
1670
1648
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1671
1649
  */
1672
- addDescending(...keys) /*: ParseQuery*/{
1650
+ addDescending(...keys) {
1673
1651
  if (!this._order) {
1674
1652
  this._order = [];
1675
1653
  }
@@ -1694,7 +1672,7 @@ class ParseQuery {
1694
1672
  * @param {number} n the number of results to skip.
1695
1673
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1696
1674
  */
1697
- skip(n /*: number*/) /*: ParseQuery*/{
1675
+ skip(n) {
1698
1676
  if (typeof n !== 'number' || n < 0) {
1699
1677
  throw new Error('You can only skip by a positive number');
1700
1678
  }
@@ -1708,7 +1686,7 @@ class ParseQuery {
1708
1686
  * @param {number} n the number of results to limit to.
1709
1687
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1710
1688
  */
1711
- limit(n /*: number*/) /*: ParseQuery*/{
1689
+ limit(n) {
1712
1690
  if (typeof n !== 'number') {
1713
1691
  throw new Error('You can only set the limit to a numeric value');
1714
1692
  }
@@ -1725,7 +1703,7 @@ class ParseQuery {
1725
1703
  * @param {boolean} includeCount false - disable, true - enable.
1726
1704
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1727
1705
  */
1728
- withCount(includeCount = true) /*: ParseQuery*/{
1706
+ withCount(includeCount = true) {
1729
1707
  if (typeof includeCount !== 'boolean') {
1730
1708
  throw new Error('You can only set withCount to a boolean value');
1731
1709
  }
@@ -1743,7 +1721,7 @@ class ParseQuery {
1743
1721
  * @param {...string|Array<string>} keys The name(s) of the key(s) to include.
1744
1722
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1745
1723
  */
1746
- include(...keys) /*: ParseQuery*/{
1724
+ include(...keys) {
1747
1725
  keys.forEach(key => {
1748
1726
  if (Array.isArray(key)) {
1749
1727
  this._include = this._include.concat(key);
@@ -1761,7 +1739,7 @@ class ParseQuery {
1761
1739
  *
1762
1740
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1763
1741
  */
1764
- includeAll() /*: ParseQuery*/{
1742
+ includeAll() {
1765
1743
  return this.include('*');
1766
1744
  }
1767
1745
 
@@ -1773,7 +1751,7 @@ class ParseQuery {
1773
1751
  * @param {...string|Array<string>} keys The name(s) of the key(s) to include.
1774
1752
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1775
1753
  */
1776
- select(...keys) /*: ParseQuery*/{
1754
+ select(...keys) {
1777
1755
  if (!this._select) {
1778
1756
  this._select = [];
1779
1757
  }
@@ -1796,7 +1774,7 @@ class ParseQuery {
1796
1774
  * @param {...string|Array<string>} keys The name(s) of the key(s) to exclude.
1797
1775
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1798
1776
  */
1799
- exclude(...keys) /*: ParseQuery*/{
1777
+ exclude(...keys) {
1800
1778
  keys.forEach(key => {
1801
1779
  if (Array.isArray(key)) {
1802
1780
  this._exclude = this._exclude.concat(key);
@@ -1815,7 +1793,7 @@ class ParseQuery {
1815
1793
  * @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
1816
1794
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1817
1795
  */
1818
- watch(...keys) /*: ParseQuery*/{
1796
+ watch(...keys) {
1819
1797
  keys.forEach(key => {
1820
1798
  if (Array.isArray(key)) {
1821
1799
  this._watch = this._watch.concat(key);
@@ -1834,7 +1812,7 @@ class ParseQuery {
1834
1812
  * @param {string} subqueryReadPreference The read preference for the sub queries.
1835
1813
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1836
1814
  */
1837
- readPreference(readPreference /*: string*/, includeReadPreference /*:: ?: string*/, subqueryReadPreference /*:: ?: string*/) /*: ParseQuery*/{
1815
+ readPreference(readPreference, includeReadPreference, subqueryReadPreference) {
1838
1816
  this._readPreference = readPreference;
1839
1817
  this._includeReadPreference = includeReadPreference || null;
1840
1818
  this._subqueryReadPreference = subqueryReadPreference || null;
@@ -1848,7 +1826,7 @@ class ParseQuery {
1848
1826
  * @returns {Promise<LiveQuerySubscription>} Returns the liveQuerySubscription, it's an event emitter
1849
1827
  * which can be used to get liveQuery updates.
1850
1828
  */
1851
- async subscribe(sessionToken /*:: ?: string*/) /*: Promise<LiveQuerySubscription>*/{
1829
+ async subscribe(sessionToken) {
1852
1830
  const currentUser = await _CoreManager.default.getUserController().currentUserAsync();
1853
1831
  if (!sessionToken) {
1854
1832
  sessionToken = currentUser ? currentUser.getSessionToken() || undefined : undefined;
@@ -1875,7 +1853,7 @@ class ParseQuery {
1875
1853
  * @static
1876
1854
  * @returns {Parse.Query} The query that is the OR of the passed in queries.
1877
1855
  */
1878
- static or(...queries) /*: ParseQuery*/{
1856
+ static or(...queries) {
1879
1857
  const className = _getClassNameFromQueries(queries);
1880
1858
  const query = new ParseQuery(className);
1881
1859
  query._orQuery(queries);
@@ -1894,7 +1872,7 @@ class ParseQuery {
1894
1872
  * @static
1895
1873
  * @returns {Parse.Query} The query that is the AND of the passed in queries.
1896
1874
  */
1897
- static and(...queries) /*: ParseQuery*/{
1875
+ static and(...queries) {
1898
1876
  const className = _getClassNameFromQueries(queries);
1899
1877
  const query = new ParseQuery(className);
1900
1878
  query._andQuery(queries);
@@ -1913,7 +1891,7 @@ class ParseQuery {
1913
1891
  * @static
1914
1892
  * @returns {Parse.Query} The query that is the NOR of the passed in queries.
1915
1893
  */
1916
- static nor(...queries) /*: ParseQuery*/{
1894
+ static nor(...queries) {
1917
1895
  const className = _getClassNameFromQueries(queries);
1918
1896
  const query = new ParseQuery(className);
1919
1897
  query._norQuery(queries);
@@ -1925,7 +1903,7 @@ class ParseQuery {
1925
1903
  *
1926
1904
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1927
1905
  */
1928
- fromNetwork() /*: ParseQuery*/{
1906
+ fromNetwork() {
1929
1907
  this._queriesLocalDatastore = false;
1930
1908
  this._localDatastorePinName = null;
1931
1909
  return this;
@@ -1936,7 +1914,7 @@ class ParseQuery {
1936
1914
  *
1937
1915
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1938
1916
  */
1939
- fromLocalDatastore() /*: ParseQuery*/{
1917
+ fromLocalDatastore() {
1940
1918
  return this.fromPinWithName(null);
1941
1919
  }
1942
1920
 
@@ -1945,7 +1923,7 @@ class ParseQuery {
1945
1923
  *
1946
1924
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1947
1925
  */
1948
- fromPin() /*: ParseQuery*/{
1926
+ fromPin() {
1949
1927
  return this.fromPinWithName(_LocalDatastoreUtils.DEFAULT_PIN);
1950
1928
  }
1951
1929
 
@@ -1955,7 +1933,7 @@ class ParseQuery {
1955
1933
  * @param {string} name The name of query source.
1956
1934
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1957
1935
  */
1958
- fromPinWithName(name /*:: ?: string | null*/) /*: ParseQuery*/{
1936
+ fromPinWithName(name) {
1959
1937
  const localDatastore = _CoreManager.default.getLocalDatastore();
1960
1938
  if (localDatastore.checkIfEnabled()) {
1961
1939
  this._queriesLocalDatastore = true;
@@ -1969,7 +1947,7 @@ class ParseQuery {
1969
1947
  *
1970
1948
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1971
1949
  */
1972
- cancel() /*: ParseQuery*/{
1950
+ cancel() {
1973
1951
  if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') {
1974
1952
  this._xhrRequest.task._aborted = true;
1975
1953
  this._xhrRequest.task.abort();
@@ -1994,7 +1972,7 @@ class ParseQuery {
1994
1972
  * @param {string} value a comment can make your profile data easier to interpret and trace.
1995
1973
  * @returns {Parse.Query} Returns the query, so you can chain this call.
1996
1974
  */
1997
- comment(value /*: string*/) /*: ParseQuery*/{
1975
+ comment(value) {
1998
1976
  if (value == null) {
1999
1977
  delete this._comment;
2000
1978
  return this;
@@ -2007,16 +1985,15 @@ class ParseQuery {
2007
1985
  }
2008
1986
  }
2009
1987
  const DefaultController = {
2010
- find(className /*: string*/, params /*: QueryJSON*/, options /*: RequestOptions*/) /*: Promise<{ results: Array<ParseObject> }>*/{
1988
+ find(className, params, options) {
2011
1989
  const RESTController = _CoreManager.default.getRESTController();
2012
1990
  return RESTController.request('GET', 'classes/' + className, params, options);
2013
1991
  },
2014
- aggregate(className /*: string*/, params /*: any*/, options /*: RequestOptions*/) /*: Promise<{ results: Array<any> }>*/{
1992
+ aggregate(className, params, options) {
2015
1993
  const RESTController = _CoreManager.default.getRESTController();
2016
1994
  return RESTController.request('GET', 'aggregate/' + className, params, options);
2017
1995
  }
2018
1996
  };
2019
1997
  _CoreManager.default.setParseQuery(ParseQuery);
2020
1998
  _CoreManager.default.setQueryController(DefaultController);
2021
- var _default = ParseQuery;
2022
- exports.default = _default;
1999
+ var _default = exports.default = ParseQuery;