parse 5.1.1-alpha.1 → 5.2.0-alpha.1

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 (103) hide show
  1. package/dist/parse.js +1411 -1216
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +1414 -1219
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/Cloud.js +7 -11
  6. package/lib/browser/CoreManager.js +1 -1
  7. package/lib/browser/EventuallyQueue.js +1 -1
  8. package/lib/browser/InstallationController.js +3 -3
  9. package/lib/browser/LiveQueryClient.js +102 -60
  10. package/lib/browser/LocalDatastore.js +189 -147
  11. package/lib/browser/LocalDatastoreController.default.js +14 -9
  12. package/lib/browser/LocalDatastoreController.react-native.js +14 -12
  13. package/lib/browser/LocalDatastoreUtils.js +0 -5
  14. package/lib/browser/ObjectStateMutations.js +57 -21
  15. package/lib/browser/Parse.js +2 -2
  16. package/lib/browser/ParseCLP.js +9 -17
  17. package/lib/browser/ParseFile.js +27 -31
  18. package/lib/browser/ParseGeoPoint.js +9 -3
  19. package/lib/browser/ParseHooks.js +13 -13
  20. package/lib/browser/ParseInstallation.js +14 -0
  21. package/lib/browser/ParseObject.js +15 -13
  22. package/lib/browser/ParseOp.js +17 -17
  23. package/lib/browser/ParsePolygon.js +1 -1
  24. package/lib/browser/ParseQuery.js +147 -149
  25. package/lib/browser/ParseRole.js +5 -9
  26. package/lib/browser/ParseSchema.js +1 -1
  27. package/lib/browser/ParseUser.js +66 -51
  28. package/lib/browser/Push.js +5 -10
  29. package/lib/browser/RESTController.js +1 -1
  30. package/lib/browser/SingleInstanceStateController.js +1 -1
  31. package/lib/browser/TaskQueue.js +10 -10
  32. package/lib/browser/UniqueInstanceStateController.js +1 -1
  33. package/lib/node/Cloud.js +7 -11
  34. package/lib/node/CoreManager.js +1 -1
  35. package/lib/node/EventuallyQueue.js +1 -1
  36. package/lib/node/InstallationController.js +3 -3
  37. package/lib/node/LiveQueryClient.js +14 -24
  38. package/lib/node/LocalDatastore.js +7 -11
  39. package/lib/node/LocalDatastoreController.default.js +12 -10
  40. package/lib/node/LocalDatastoreController.react-native.js +13 -12
  41. package/lib/node/LocalDatastoreUtils.js +0 -5
  42. package/lib/node/ObjectStateMutations.js +45 -19
  43. package/lib/node/Parse.js +2 -2
  44. package/lib/node/ParseCLP.js +8 -18
  45. package/lib/node/ParseFile.js +27 -40
  46. package/lib/node/ParseGeoPoint.js +9 -3
  47. package/lib/node/ParseHooks.js +13 -13
  48. package/lib/node/ParseInstallation.js +14 -0
  49. package/lib/node/ParseObject.js +15 -13
  50. package/lib/node/ParseOp.js +21 -21
  51. package/lib/node/ParsePolygon.js +1 -1
  52. package/lib/node/ParseQuery.js +84 -107
  53. package/lib/node/ParseRole.js +3 -8
  54. package/lib/node/ParseSchema.js +4 -4
  55. package/lib/node/ParseUser.js +42 -37
  56. package/lib/node/Push.js +3 -8
  57. package/lib/node/RESTController.js +1 -1
  58. package/lib/node/SingleInstanceStateController.js +1 -1
  59. package/lib/node/TaskQueue.js +9 -11
  60. package/lib/node/UniqueInstanceStateController.js +1 -1
  61. package/lib/react-native/Cloud.js +0 -1
  62. package/lib/react-native/CoreManager.js +1 -1
  63. package/lib/react-native/LiveQueryClient.js +49 -32
  64. package/lib/react-native/LocalDatastore.js +38 -14
  65. package/lib/react-native/LocalDatastoreController.default.js +7 -1
  66. package/lib/react-native/LocalDatastoreController.react-native.js +7 -1
  67. package/lib/react-native/ObjectStateMutations.js +30 -9
  68. package/lib/react-native/ParseCLP.js +3 -3
  69. package/lib/react-native/ParseFile.js +7 -6
  70. package/lib/react-native/ParseObject.js +4 -3
  71. package/lib/react-native/ParseQuery.js +45 -37
  72. package/lib/react-native/ParseRole.js +1 -1
  73. package/lib/react-native/ParseUser.js +22 -16
  74. package/lib/react-native/TaskQueue.js +8 -2
  75. package/lib/weapp/Cloud.js +7 -11
  76. package/lib/weapp/CoreManager.js +1 -1
  77. package/lib/weapp/EventuallyQueue.js +1 -1
  78. package/lib/weapp/InstallationController.js +3 -3
  79. package/lib/weapp/LiveQueryClient.js +102 -60
  80. package/lib/weapp/LocalDatastore.js +189 -147
  81. package/lib/weapp/LocalDatastoreController.default.js +14 -9
  82. package/lib/weapp/LocalDatastoreController.react-native.js +14 -12
  83. package/lib/weapp/LocalDatastoreUtils.js +0 -5
  84. package/lib/weapp/ObjectStateMutations.js +57 -21
  85. package/lib/weapp/Parse.js +2 -2
  86. package/lib/weapp/ParseCLP.js +9 -17
  87. package/lib/weapp/ParseFile.js +27 -31
  88. package/lib/weapp/ParseGeoPoint.js +9 -3
  89. package/lib/weapp/ParseHooks.js +13 -13
  90. package/lib/weapp/ParseInstallation.js +14 -0
  91. package/lib/weapp/ParseObject.js +15 -13
  92. package/lib/weapp/ParseOp.js +17 -17
  93. package/lib/weapp/ParsePolygon.js +1 -1
  94. package/lib/weapp/ParseQuery.js +147 -149
  95. package/lib/weapp/ParseRole.js +5 -9
  96. package/lib/weapp/ParseSchema.js +1 -1
  97. package/lib/weapp/ParseUser.js +66 -51
  98. package/lib/weapp/Push.js +5 -10
  99. package/lib/weapp/RESTController.js +1 -1
  100. package/lib/weapp/SingleInstanceStateController.js +1 -1
  101. package/lib/weapp/TaskQueue.js +10 -10
  102. package/lib/weapp/UniqueInstanceStateController.js +1 -1
  103. package/package.json +5 -6
@@ -5,24 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
8
+ var _ParseError = _interopRequireDefault(require("./ParseError"));
8
9
  function _interopRequireDefault(obj) {
9
10
  return obj && obj.__esModule ? obj : {
10
11
  default: obj
11
12
  };
12
13
  }
13
- /**
14
- * @flow
15
- */
16
14
  /* global XMLHttpRequest, Blob */
17
- /*:: import type { FullOptions } from './RESTController';*/
18
- const ParseError = require('./ParseError').default;
15
+
19
16
  let XHR = null;
20
17
  if (typeof XMLHttpRequest !== 'undefined') {
21
18
  XHR = XMLHttpRequest;
22
19
  }
23
- /*:: type Base64 = { base64: string };*/
24
- /*:: type Uri = { uri: string };*/
25
- /*:: type FileData = Array<number> | Base64 | Blob | Uri;*/
26
20
  /*:: export type FileSaveOptions = FullOptions & {
27
21
  metadata?: { [key: string]: any },
28
22
  tags?: { [key: string]: any },
@@ -31,17 +25,17 @@ if (typeof XMLHttpRequest !== 'undefined') {
31
25
  | {
32
26
  format: 'file',
33
27
  file: Blob,
34
- type: string,
28
+ type: string | undefined,
35
29
  }
36
30
  | {
37
31
  format: 'base64',
38
32
  base64: string,
39
- type: string,
33
+ type: string | undefined,
40
34
  }
41
35
  | {
42
36
  format: 'uri',
43
37
  uri: string,
44
- type: string,
38
+ type: string | undefined,
45
39
  };*/
46
40
  function b64Digit(number /*: number*/) /*: string*/{
47
41
  if (number < 26) {
@@ -69,14 +63,6 @@ function b64Digit(number /*: number*/) /*: string*/{
69
63
  * @alias Parse.File
70
64
  */
71
65
  class ParseFile {
72
- /*:: _name: string;*/
73
- /*:: _url: ?string;*/
74
- /*:: _source: FileSource;*/
75
- /*:: _previousSave: ?Promise<ParseFile>;*/
76
- /*:: _data: ?string;*/
77
- /*:: _requestTask: ?any;*/
78
- /*:: _metadata: ?Object;*/
79
- /*:: _tags: ?Object;*/
80
66
  /**
81
67
  * @param name {String} The file's name. This will be prefixed by a unique
82
68
  * value once the file has finished saving. The file name must begin with
@@ -104,10 +90,10 @@ class ParseFile {
104
90
  * @param type {String} Optional Content-Type header to use for the file. If
105
91
  * this is omitted, the content type will be inferred from the name's
106
92
  * extension.
107
- * @param metadata {Object} Optional key value pairs to be stored with file object
108
- * @param tags {Object} Optional key value pairs to be stored with file object
93
+ * @param metadata {object} Optional key value pairs to be stored with file object
94
+ * @param tags {object} Optional key value pairs to be stored with file object
109
95
  */
110
- constructor(name /*: string*/, data /*:: ?: FileData*/, type /*:: ?: string*/, metadata /*:: ?: Object*/, tags /*:: ?: Object*/) {
96
+ constructor(name /*: string*/, data /*:: ?: FileData*/, type /*:: ?: string*/, metadata /*:: ?: object*/, tags /*:: ?: object*/) {
111
97
  const specifiedType = type || '';
112
98
  this._name = name;
113
99
  this._metadata = metadata || {};
@@ -154,7 +140,7 @@ class ParseFile {
154
140
  *
155
141
  * @returns {Promise} Promise that is resolve with base64 data
156
142
  */
157
- async getData() /*: Promise<String>*/{
143
+ async getData() /*: Promise<string>*/{
158
144
  if (this._data) {
159
145
  return this._data;
160
146
  }
@@ -185,9 +171,10 @@ class ParseFile {
185
171
  * after you get the file from a Parse.Object.
186
172
  *
187
173
  * @param {object} options An object to specify url options
174
+ * @param {boolean} [options.forceSecure] force the url to be secure
188
175
  * @returns {string | undefined}
189
176
  */
190
- url(options /*:: ?: { forceSecure?: boolean }*/) /*: ?string*/{
177
+ url(options /*:: ?: { forceSecure?: boolean }*/) /*: string | undefined*/{
191
178
  options = options || {};
192
179
  if (!this._url) {
193
180
  return;
@@ -204,7 +191,7 @@ class ParseFile {
204
191
  *
205
192
  * @returns {object}
206
193
  */
207
- metadata() /*: Object*/{
194
+ metadata() {
208
195
  return this._metadata;
209
196
  }
210
197
 
@@ -213,7 +200,7 @@ class ParseFile {
213
200
  *
214
201
  * @returns {object}
215
202
  */
216
- tags() /*: Object*/{
203
+ tags() {
217
204
  return this._tags;
218
205
  }
219
206
 
@@ -240,7 +227,7 @@ class ParseFile {
240
227
  * </ul>
241
228
  * @returns {Promise | undefined} Promise that is resolved when the save finishes.
242
229
  */
243
- save(options /*:: ?: FullOptions*/) /*: ?Promise*/{
230
+ save(options /*:: ?: FileSaveOptions*/) /*: Promise<ParseFile> | undefined*/{
244
231
  options = options || {};
245
232
  options.requestTask = task => this._requestTask = task;
246
233
  options.metadata = this._metadata;
@@ -268,7 +255,7 @@ class ParseFile {
268
255
  this._data = result.base64;
269
256
  this._requestTask = null;
270
257
  return controller.saveBase64(this._name, newSource, options);
271
- }).then(res => {
258
+ }).then((res /*: { name?: string, url?: string }*/) => {
272
259
  this._name = res.name;
273
260
  this._url = res.url;
274
261
  this._requestTask = null;
@@ -310,31 +297,31 @@ class ParseFile {
310
297
  * <pre>
311
298
  * @returns {Promise} Promise that is resolved when the delete finishes.
312
299
  */
313
- destroy(options /*:: ?: FullOptions*/ = {}) {
300
+ destroy(options /*: FullOptions*/ = {}) {
314
301
  if (!this._name) {
315
- throw new ParseError(ParseError.FILE_DELETE_UNNAMED_ERROR, 'Cannot delete an unnamed file.');
302
+ throw new _ParseError.default(_ParseError.default.FILE_DELETE_UNNAMED_ERROR, 'Cannot delete an unnamed file.');
316
303
  }
317
304
  const destroyOptions = {
318
305
  useMasterKey: true
319
306
  };
320
307
  if (options.hasOwnProperty('useMasterKey')) {
321
- destroyOptions.useMasterKey = options.useMasterKey;
308
+ destroyOptions.useMasterKey = !!options.useMasterKey;
322
309
  }
323
310
  const controller = _CoreManager.default.getFileController();
324
311
  return controller.deleteFile(this._name, destroyOptions).then(() => {
325
- this._data = null;
312
+ this._data = undefined;
326
313
  this._requestTask = null;
327
314
  return this;
328
315
  });
329
316
  }
330
- toJSON() /*: { name: ?string, url: ?string }*/{
317
+ toJSON() /*: { __type: 'File', name?: string, url?: string }*/{
331
318
  return {
332
319
  __type: 'File',
333
320
  name: this._name,
334
321
  url: this._url
335
322
  };
336
323
  }
337
- equals(other /*: mixed*/) /*: boolean*/{
324
+ equals(other /*: any*/) /*: boolean*/{
338
325
  if (this === other) {
339
326
  return true;
340
327
  }
@@ -399,7 +386,7 @@ class ParseFile {
399
386
  file._url = obj.url;
400
387
  return file;
401
388
  }
402
- static encodeBase64(bytes /*: Array<number>*/) /*: string*/{
389
+ static encodeBase64(bytes /*: Array<number> | Uint8Array*/) /*: string*/{
403
390
  const chunks = [];
404
391
  chunks.length = Math.ceil(bytes.length / 3);
405
392
  for (let i = 0; i < chunks.length; i++) {
@@ -414,7 +401,7 @@ class ParseFile {
414
401
  }
415
402
  }
416
403
  const DefaultController = {
417
- saveFile: async function (name /*: string*/, source /*: FileSource*/, options /*:: ?: FullOptions*/) {
404
+ saveFile: async function (name /*: string*/, source /*: FileSource*/, options /*:: ?: FileSaveOptions*/) {
418
405
  if (source.format !== 'file') {
419
406
  throw new Error('saveFile can only be used with File-type sources.');
420
407
  }
@@ -434,15 +421,15 @@ const DefaultController = {
434
421
  const newSource = {
435
422
  format: 'base64',
436
423
  base64: data,
437
- type: source.type || (source.file ? source.file.type : null)
424
+ type: source.type || (source.file ? source.file.type : undefined)
438
425
  };
439
426
  return await DefaultController.saveBase64(name, newSource, options);
440
427
  },
441
- saveBase64: function (name /*: string*/, source /*: FileSource*/, options /*:: ?: FullOptions*/) {
428
+ saveBase64: function (name /*: string*/, source /*: FileSource*/, options /*: FileSaveOptions*/ = {}) {
442
429
  if (source.format !== 'base64') {
443
430
  throw new Error('saveBase64 can only be used with Base64-type sources.');
444
431
  }
445
- const data /*: { base64: any, _ContentType?: any, fileData: Object }*/ = {
432
+ const data /*: { base64: any, _ContentType?: any, fileData: any }*/ = {
446
433
  base64: source.base64,
447
434
  fileData: {
448
435
  metadata: {
@@ -485,7 +472,7 @@ const DefaultController = {
485
472
  });
486
473
  }
487
474
  },
488
- downloadAjax: function (uri, options) {
475
+ downloadAjax: function (uri /*: string*/, options /*: any*/) {
489
476
  return new Promise((resolve, reject) => {
490
477
  const xhr = new XHR();
491
478
  xhr.open('GET', uri, true);
@@ -164,9 +164,15 @@ class ParseGeoPoint {
164
164
  * Creates a GeoPoint with the user's current location, if available.
165
165
  *
166
166
  * @param {object} options The options.
167
- * @param {boolean} [options.enableHighAccuracy=false] A boolean value that indicates the application would like to receive the best possible results. If true and if the device is able to provide a more accurate position, it will do so. Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile device for example). On the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. Default: false.
168
- * @param {number} [options.timeout=Infinity] A positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. The default value is Infinity, meaning that getCurrentPosition() won't return until the position is available.
169
- * @param {number} [options.maximumAge=0] A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to Infinity the device must return a cached position regardless of its age. Default: 0.
167
+ * @param {boolean} [options.enableHighAccuracy=false] A boolean value that indicates the application would like to receive the best possible results.
168
+ * If true and if the device is able to provide a more accurate position, it will do so.
169
+ * Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile device for example).
170
+ * On the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. Default: false.
171
+ * @param {number} [options.timeout=Infinity] A positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position.
172
+ * The default value is Infinity, meaning that getCurrentPosition() won't return until the position is available.
173
+ * @param {number} [options.maximumAge=0] A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return.
174
+ * If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position.
175
+ * If set to Infinity the device must return a cached position regardless of its age. Default: 0.
170
176
  * @static
171
177
  * @returns {Promise<Parse.GeoPoint>} User's current location
172
178
  */
@@ -32,60 +32,60 @@ function getFunctions() {
32
32
  function getTriggers() {
33
33
  return _CoreManager.default.getHooksController().get('triggers');
34
34
  }
35
- function getFunction(name) {
35
+ function getFunction(name /*: string*/) {
36
36
  return _CoreManager.default.getHooksController().get('functions', name);
37
37
  }
38
- function getTrigger(className, triggerName) {
38
+ function getTrigger(className /*: string*/, triggerName /*: string*/) {
39
39
  return _CoreManager.default.getHooksController().get('triggers', className, triggerName);
40
40
  }
41
- function createFunction(functionName, url) {
41
+ function createFunction(functionName /*: string*/, url /*: string*/) {
42
42
  return create({
43
43
  functionName: functionName,
44
44
  url: url
45
45
  });
46
46
  }
47
- function createTrigger(className, triggerName, url) {
47
+ function createTrigger(className /*: string*/, triggerName /*: string*/, url /*: string*/) {
48
48
  return create({
49
49
  className: className,
50
50
  triggerName: triggerName,
51
51
  url: url
52
52
  });
53
53
  }
54
- function create(hook) {
54
+ function create(hook /*: HookDeclaration*/) {
55
55
  return _CoreManager.default.getHooksController().create(hook);
56
56
  }
57
- function updateFunction(functionName, url) {
57
+ function updateFunction(functionName /*: string*/, url /*: string*/) {
58
58
  return update({
59
59
  functionName: functionName,
60
60
  url: url
61
61
  });
62
62
  }
63
- function updateTrigger(className, triggerName, url) {
63
+ function updateTrigger(className /*: string*/, triggerName /*: string*/, url /*: string*/) {
64
64
  return update({
65
65
  className: className,
66
66
  triggerName: triggerName,
67
67
  url: url
68
68
  });
69
69
  }
70
- function update(hook) {
70
+ function update(hook /*: HookDeclaration*/) {
71
71
  return _CoreManager.default.getHooksController().update(hook);
72
72
  }
73
- function removeFunction(functionName) {
73
+ function removeFunction(functionName /*: string*/) {
74
74
  return remove({
75
75
  functionName: functionName
76
76
  });
77
77
  }
78
- function removeTrigger(className, triggerName) {
78
+ function removeTrigger(className /*: string*/, triggerName /*: string*/) {
79
79
  return remove({
80
80
  className: className,
81
81
  triggerName: triggerName
82
82
  });
83
83
  }
84
- function remove(hook) {
84
+ function remove(hook /*: HookDeleteArg*/) {
85
85
  return _CoreManager.default.getHooksController().remove(hook);
86
86
  }
87
87
  const DefaultController = {
88
- get(type, functionName, triggerName) {
88
+ get(type /*: string*/, functionName /*:: ?: string*/, triggerName /*:: ?: string*/) {
89
89
  let url = '/hooks/' + type;
90
90
  if (functionName) {
91
91
  url += '/' + functionName;
@@ -145,7 +145,7 @@ const DefaultController = {
145
145
  }
146
146
  return this.sendRequest('PUT', url, hook);
147
147
  },
148
- sendRequest(method, url, body) {
148
+ sendRequest(method /*: string*/, url /*: string*/, body /*:: ?: any*/) {
149
149
  return _CoreManager.default.getRESTController().request(method, url, body, {
150
150
  useMasterKey: true
151
151
  }).then(res => {
@@ -50,6 +50,7 @@ class ParseInstallation extends _ParseObject.default {
50
50
  *
51
51
  * @property {string} appIdentifier
52
52
  * @static
53
+ * @returns {string}
53
54
  */
54
55
  get appIdentifier() {
55
56
  return this.get('appIdentifier');
@@ -60,6 +61,7 @@ class ParseInstallation extends _ParseObject.default {
60
61
  *
61
62
  * @property {string} appVersion
62
63
  * @static
64
+ * @returns {string}
63
65
  */
64
66
  get appVersion() {
65
67
  return this.get('appVersion');
@@ -70,6 +72,7 @@ class ParseInstallation extends _ParseObject.default {
70
72
  *
71
73
  * @property {string} appName
72
74
  * @static
75
+ * @returns {string}
73
76
  */
74
77
  get appName() {
75
78
  return this.get('appName');
@@ -82,6 +85,7 @@ class ParseInstallation extends _ParseObject.default {
82
85
  *
83
86
  * @property {number} badge
84
87
  * @static
88
+ * @returns {number}
85
89
  */
86
90
  get badge() {
87
91
  return this.get('badge');
@@ -92,6 +96,7 @@ class ParseInstallation extends _ParseObject.default {
92
96
  *
93
97
  * @property {string[]} channels
94
98
  * @static
99
+ * @returns {string[]}
95
100
  */
96
101
  get channels() {
97
102
  return this.get('channels');
@@ -102,6 +107,7 @@ class ParseInstallation extends _ParseObject.default {
102
107
  *
103
108
  * @property {string} deviceToken
104
109
  * @static
110
+ * @returns {string}
105
111
  */
106
112
  get deviceToken() {
107
113
  return this.get('deviceToken');
@@ -112,6 +118,7 @@ class ParseInstallation extends _ParseObject.default {
112
118
  *
113
119
  * @property {string} deviceType
114
120
  * @static
121
+ * @returns {string}
115
122
  */
116
123
  get deviceType() {
117
124
  return this.get('deviceType');
@@ -122,6 +129,7 @@ class ParseInstallation extends _ParseObject.default {
122
129
  *
123
130
  * @property {string} GCMSenderId
124
131
  * @static
132
+ * @returns {string}
125
133
  */
126
134
  get GCMSenderId() {
127
135
  return this.get('GCMSenderId');
@@ -132,6 +140,7 @@ class ParseInstallation extends _ParseObject.default {
132
140
  *
133
141
  * @property {string} installationId
134
142
  * @static
143
+ * @returns {string}
135
144
  */
136
145
  get installationId() {
137
146
  return this.get('installationId');
@@ -142,6 +151,7 @@ class ParseInstallation extends _ParseObject.default {
142
151
  *
143
152
  * @property {string} localeIdentifier
144
153
  * @static
154
+ * @returns {string}
145
155
  */
146
156
  get localeIdentifier() {
147
157
  return this.get('localeIdentifier');
@@ -152,6 +162,7 @@ class ParseInstallation extends _ParseObject.default {
152
162
  *
153
163
  * @property {string} parseVersion
154
164
  * @static
165
+ * @returns {string}
155
166
  */
156
167
  get parseVersion() {
157
168
  return this.get('parseVersion');
@@ -162,6 +173,7 @@ class ParseInstallation extends _ParseObject.default {
162
173
  *
163
174
  * @property {string} pushType
164
175
  * @static
176
+ * @returns {string}
165
177
  */
166
178
  get pushType() {
167
179
  return this.get('pushType');
@@ -172,6 +184,7 @@ class ParseInstallation extends _ParseObject.default {
172
184
  *
173
185
  * @property {string} timeZone
174
186
  * @static
187
+ * @returns {string}
175
188
  */
176
189
  get timeZone() {
177
190
  return this.get('timeZone');
@@ -191,6 +204,7 @@ class ParseInstallation extends _ParseObject.default {
191
204
  *
192
205
  * @property {object} DEVICE_TYPES
193
206
  * @static
207
+ * @returns {object}
194
208
  */
195
209
  static get DEVICE_TYPES() /*: DeviceInterface*/{
196
210
  return DEVICE_TYPES;
@@ -124,6 +124,7 @@ class ParseObject {
124
124
  * @param {string} className The class name for the object
125
125
  * @param {object} attributes The initial set of data to store in the object.
126
126
  * @param {object} options The options for this object instance.
127
+ * @param {boolean} [options.ignoreValidation=false] Set to `true` ignore any attribute validation errors.
127
128
  */
128
129
  constructor(className /*:: ?: string | { className: string, [attr: string]: any }*/, attributes /*:: ?: { [attr: string]: any }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
129
130
  // Enable legacy initializers
@@ -1167,7 +1168,7 @@ class ParseObject {
1167
1168
  * @returns {Promise} A promise that is fulfilled when the fetch
1168
1169
  * completes.
1169
1170
  */
1170
- fetchWithInclude(keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise<any>*/{
1171
+ fetchWithInclude(keys /*: string | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise<any>*/{
1171
1172
  options = options || {};
1172
1173
  options.include = keys;
1173
1174
  return this.fetch(options);
@@ -1572,7 +1573,7 @@ class ParseObject {
1572
1573
  * @static
1573
1574
  * @returns {Parse.Object[]}
1574
1575
  */
1575
- static fetchAllWithInclude(list /*: Array<ParseObject>*/, keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) {
1576
+ static fetchAllWithInclude(list /*: Array<ParseObject>*/, keys /*: string | Array<string | Array<string>>*/, options /*: RequestOptions*/) {
1576
1577
  options = options || {};
1577
1578
  options.include = keys;
1578
1579
  return ParseObject.fetchAll(list, options);
@@ -1608,7 +1609,7 @@ class ParseObject {
1608
1609
  * @static
1609
1610
  * @returns {Parse.Object[]}
1610
1611
  */
1611
- static fetchAllIfNeededWithInclude(list /*: Array<ParseObject>*/, keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) {
1612
+ static fetchAllIfNeededWithInclude(list /*: Array<ParseObject>*/, keys /*: string | Array<string | Array<string>>*/, options /*: RequestOptions*/) {
1612
1613
  options = options || {};
1613
1614
  options.include = keys;
1614
1615
  return ParseObject.fetchAllIfNeeded(list, options);
@@ -2155,11 +2156,11 @@ const DefaultController = {
2155
2156
  if (target.length < 1) {
2156
2157
  return Promise.resolve([]);
2157
2158
  }
2158
- const objs = [];
2159
- const ids = [];
2160
- let className = null;
2161
- const results = [];
2162
- let error = null;
2159
+ const objs /*: ParseObject[]*/ = [];
2160
+ const ids /*: string[]*/ = [];
2161
+ let className /*: string | null*/ = null;
2162
+ const results /*: ParseObject[]*/ = [];
2163
+ let error /*: ParseError | null*/ = null;
2163
2164
  target.forEach(el => {
2164
2165
  if (error) {
2165
2166
  return;
@@ -2301,7 +2302,7 @@ const DefaultController = {
2301
2302
  }
2302
2303
  return Promise.resolve(target);
2303
2304
  },
2304
- save(target /*: ParseObject | null | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject> | ParseFile>*/{
2305
+ save(target /*: ParseObject | null | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject> | ParseFile | undefined>*/{
2305
2306
  const batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');
2306
2307
  const localDatastore = _CoreManager.default.getLocalDatastore();
2307
2308
  const mapIdForPin = {};
@@ -2316,12 +2317,13 @@ const DefaultController = {
2316
2317
  }
2317
2318
  let unsaved = target.concat();
2318
2319
  for (let i = 0; i < target.length; i++) {
2319
- if (target[i] instanceof ParseObject) {
2320
- unsaved = unsaved.concat((0, _unsavedChildren.default)(target[i], true));
2320
+ const target_i = target[i];
2321
+ if (target_i instanceof ParseObject) {
2322
+ unsaved = unsaved.concat((0, _unsavedChildren.default)(target_i, true));
2321
2323
  }
2322
2324
  }
2323
2325
  unsaved = (0, _unique.default)(unsaved);
2324
- const filesSaved /*: Array<ParseFile>*/ = [];
2326
+ const filesSaved /*: Array<Promise<ParseFile> | undefined>*/ = [];
2325
2327
  let pending /*: Array<ParseObject>*/ = [];
2326
2328
  unsaved.forEach(el => {
2327
2329
  if (el instanceof _ParseFile.default) {
@@ -2442,7 +2444,7 @@ const DefaultController = {
2442
2444
  return Promise.reject(error);
2443
2445
  });
2444
2446
  }
2445
- return Promise.resolve();
2447
+ return Promise.resolve(undefined);
2446
2448
  }
2447
2449
  };
2448
2450
  _CoreManager.default.setParseObject(ParseObject);
@@ -69,18 +69,18 @@ function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
69
69
  }
70
70
  class Op {
71
71
  // Empty parent class
72
- applyTo() /*: mixed*/{} /* eslint-disable-line no-unused-vars */
73
- mergeWith() /*: ?Op*/{} /* eslint-disable-line no-unused-vars */
74
- toJSON() /*: mixed*/{}
72
+ applyTo() /*: any*/{} /* eslint-disable-line @typescript-eslint/no-unused-vars */
73
+ mergeWith() /*: ?Op*/{} /* eslint-disable-line @typescript-eslint/no-unused-vars */
74
+ toJSON() /*: any*/{}
75
75
  }
76
76
  exports.Op = Op;
77
77
  class SetOp extends Op {
78
- /*:: _value: ?mixed;*/
79
- constructor(value /*: mixed*/) {
78
+ /*:: _value: ?any;*/
79
+ constructor(value /*: any*/) {
80
80
  super();
81
81
  this._value = value;
82
82
  }
83
- applyTo() /*: mixed*/{
83
+ applyTo() /*: any*/{
84
84
  return this._value;
85
85
  }
86
86
  mergeWith() /*: SetOp*/{
@@ -114,7 +114,7 @@ class IncrementOp extends Op {
114
114
  }
115
115
  this._amount = amount;
116
116
  }
117
- applyTo(value /*: ?mixed*/) /*: number*/{
117
+ applyTo(value /*: ?any*/) /*: number*/{
118
118
  if (typeof value === 'undefined') {
119
119
  return this._amount;
120
120
  }
@@ -147,12 +147,12 @@ class IncrementOp extends Op {
147
147
  }
148
148
  exports.IncrementOp = IncrementOp;
149
149
  class AddOp extends Op {
150
- /*:: _value: Array<mixed>;*/
151
- constructor(value /*: mixed | Array<mixed>*/) {
150
+ /*:: _value: Array<any>;*/
151
+ constructor(value /*: any | Array<any>*/) {
152
152
  super();
153
153
  this._value = Array.isArray(value) ? value : [value];
154
154
  }
155
- applyTo(value /*: mixed*/) /*: Array<mixed>*/{
155
+ applyTo(value /*: any*/) /*: Array<any>*/{
156
156
  if (value == null) {
157
157
  return this._value;
158
158
  }
@@ -176,7 +176,7 @@ class AddOp extends Op {
176
176
  }
177
177
  throw new Error('Cannot merge Add Op with the previous Op');
178
178
  }
179
- toJSON() /*: { __op: string, objects: mixed }*/{
179
+ toJSON() /*: { __op: string, objects: any }*/{
180
180
  return {
181
181
  __op: 'Add',
182
182
  objects: (0, _encode.default)(this._value, false, true)
@@ -185,12 +185,12 @@ class AddOp extends Op {
185
185
  }
186
186
  exports.AddOp = AddOp;
187
187
  class AddUniqueOp extends Op {
188
- /*:: _value: Array<mixed>;*/
189
- constructor(value /*: mixed | Array<mixed>*/) {
188
+ /*:: _value: Array<any>;*/
189
+ constructor(value /*: any | Array<any>*/) {
190
190
  super();
191
191
  this._value = (0, _unique.default)(Array.isArray(value) ? value : [value]);
192
192
  }
193
- applyTo(value /*: mixed | Array<mixed>*/) /*: Array<mixed>*/{
193
+ applyTo(value /*: any | Array<any>*/) /*: Array<any>*/{
194
194
  if (value == null) {
195
195
  return this._value || [];
196
196
  }
@@ -227,7 +227,7 @@ class AddUniqueOp extends Op {
227
227
  }
228
228
  throw new Error('Cannot merge AddUnique Op with the previous Op');
229
229
  }
230
- toJSON() /*: { __op: string, objects: mixed }*/{
230
+ toJSON() /*: { __op: string, objects: any }*/{
231
231
  return {
232
232
  __op: 'AddUnique',
233
233
  objects: (0, _encode.default)(this._value, false, true)
@@ -236,12 +236,12 @@ class AddUniqueOp extends Op {
236
236
  }
237
237
  exports.AddUniqueOp = AddUniqueOp;
238
238
  class RemoveOp extends Op {
239
- /*:: _value: Array<mixed>;*/
240
- constructor(value /*: mixed | Array<mixed>*/) {
239
+ /*:: _value: Array<any>;*/
240
+ constructor(value /*: any | Array<any>*/) {
241
241
  super();
242
242
  this._value = (0, _unique.default)(Array.isArray(value) ? value : [value]);
243
243
  }
244
- applyTo(value /*: mixed | Array<mixed>*/) /*: Array<mixed>*/{
244
+ applyTo(value /*: any | Array<any>*/) /*: Array<any>*/{
245
245
  if (value == null) {
246
246
  return [];
247
247
  }
@@ -296,7 +296,7 @@ class RemoveOp extends Op {
296
296
  }
297
297
  throw new Error('Cannot merge Remove Op with the previous Op');
298
298
  }
299
- toJSON() /*: { __op: string, objects: mixed }*/{
299
+ toJSON() /*: { __op: string, objects: any }*/{
300
300
  return {
301
301
  __op: 'Remove',
302
302
  objects: (0, _encode.default)(this._value, false, true)
@@ -333,7 +333,7 @@ class RelationOp extends Op {
333
333
  }
334
334
  return obj.id;
335
335
  }
336
- applyTo(value /*: mixed*/, parent /*: ParseObject*/, key /*:: ?: string*/) /*: ?ParseRelation*/{
336
+ applyTo(value /*: any*/, parent /*: ParseObject*/, key /*:: ?: string*/) /*: ?ParseRelation*/{
337
337
  if (!value) {
338
338
  if (!parent || !key) {
339
339
  throw new Error('Cannot apply a RelationOp without either a previous value, or an object and a key');
@@ -400,7 +400,7 @@ class RelationOp extends Op {
400
400
  }
401
401
  throw new Error('Cannot merge Relation Op with the previous Op');
402
402
  }
403
- toJSON() /*: { __op?: string, objects?: mixed, ops?: mixed }*/{
403
+ toJSON() /*: { __op?: string, objects?: any, ops?: any }*/{
404
404
  const idToPointer = id => {
405
405
  return {
406
406
  __type: 'Pointer',
@@ -75,7 +75,7 @@ class ParsePolygon {
75
75
  * @param {(Parse.Polygon | object)} other
76
76
  * @returns {boolean}
77
77
  */
78
- equals(other /*: mixed*/) /*: boolean*/{
78
+ equals(other /*: any*/) /*: boolean*/{
79
79
  if (!(other instanceof ParsePolygon) || this.coordinates.length !== other.coordinates.length) {
80
80
  return false;
81
81
  }