parse 4.1.0-alpha.3 → 4.1.0-alpha.4

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 (83) hide show
  1. package/dist/parse.js +192 -36
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +192 -36
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/AnonymousUtils.js +1 -1
  6. package/lib/browser/Cloud.js +1 -2
  7. package/lib/browser/CoreManager.js +1 -1
  8. package/lib/browser/EventuallyQueue.js +13 -1
  9. package/lib/browser/LiveQueryClient.js +1 -1
  10. package/lib/browser/LocalDatastore.js +3 -1
  11. package/lib/browser/LocalDatastoreController.js +3 -1
  12. package/lib/browser/ObjectStateMutations.js +14 -1
  13. package/lib/browser/ParseACL.js +2 -1
  14. package/lib/browser/ParseCLP.js +6 -1
  15. package/lib/browser/ParseConfig.js +1 -0
  16. package/lib/browser/ParseFile.js +4 -1
  17. package/lib/browser/ParseInstallation.js +4 -1
  18. package/lib/browser/ParseObject.js +10 -7
  19. package/lib/browser/ParseOp.js +3 -1
  20. package/lib/browser/ParseQuery.js +26 -5
  21. package/lib/browser/ParseRole.js +5 -1
  22. package/lib/browser/ParseSchema.js +1 -1
  23. package/lib/browser/ParseSession.js +5 -1
  24. package/lib/browser/ParseUser.js +42 -1
  25. package/lib/browser/Push.js +8 -2
  26. package/lib/browser/RESTController.js +20 -0
  27. package/lib/browser/SingleInstanceStateController.js +6 -1
  28. package/lib/browser/TaskQueue.js +4 -0
  29. package/lib/browser/UniqueInstanceStateController.js +3 -1
  30. package/lib/browser/unsavedChildren.js +4 -1
  31. package/lib/node/AnonymousUtils.js +1 -1
  32. package/lib/node/Cloud.js +1 -2
  33. package/lib/node/CoreManager.js +1 -1
  34. package/lib/node/EventuallyQueue.js +13 -1
  35. package/lib/node/LocalDatastore.js +1 -1
  36. package/lib/node/ObjectStateMutations.js +11 -1
  37. package/lib/node/ParseACL.js +2 -1
  38. package/lib/node/ParseCLP.js +3 -1
  39. package/lib/node/ParseConfig.js +1 -2
  40. package/lib/node/ParseFile.js +1 -1
  41. package/lib/node/ParseInstallation.js +1 -1
  42. package/lib/node/ParseObject.js +2 -1
  43. package/lib/node/ParseQuery.js +23 -1
  44. package/lib/node/ParseRole.js +2 -1
  45. package/lib/node/ParseSchema.js +1 -1
  46. package/lib/node/ParseSession.js +2 -1
  47. package/lib/node/ParseUser.js +37 -1
  48. package/lib/node/Push.js +8 -2
  49. package/lib/node/RESTController.js +20 -0
  50. package/lib/node/SingleInstanceStateController.js +6 -1
  51. package/lib/node/TaskQueue.js +4 -1
  52. package/lib/node/UniqueInstanceStateController.js +3 -1
  53. package/lib/node/unsavedChildren.js +4 -1
  54. package/lib/react-native/CoreManager.js +1 -1
  55. package/lib/react-native/ParseCLP.js +2 -2
  56. package/lib/react-native/ParseUser.js +25 -0
  57. package/lib/weapp/AnonymousUtils.js +1 -1
  58. package/lib/weapp/Cloud.js +1 -2
  59. package/lib/weapp/CoreManager.js +1 -1
  60. package/lib/weapp/EventuallyQueue.js +13 -1
  61. package/lib/weapp/LiveQueryClient.js +1 -1
  62. package/lib/weapp/LocalDatastore.js +3 -1
  63. package/lib/weapp/LocalDatastoreController.js +3 -1
  64. package/lib/weapp/ObjectStateMutations.js +14 -1
  65. package/lib/weapp/ParseACL.js +2 -1
  66. package/lib/weapp/ParseCLP.js +6 -1
  67. package/lib/weapp/ParseConfig.js +1 -0
  68. package/lib/weapp/ParseFile.js +4 -1
  69. package/lib/weapp/ParseInstallation.js +4 -1
  70. package/lib/weapp/ParseObject.js +10 -7
  71. package/lib/weapp/ParseOp.js +3 -1
  72. package/lib/weapp/ParseQuery.js +26 -5
  73. package/lib/weapp/ParseRole.js +5 -1
  74. package/lib/weapp/ParseSchema.js +1 -1
  75. package/lib/weapp/ParseSession.js +5 -1
  76. package/lib/weapp/ParseUser.js +42 -1
  77. package/lib/weapp/Push.js +8 -2
  78. package/lib/weapp/RESTController.js +20 -0
  79. package/lib/weapp/SingleInstanceStateController.js +6 -1
  80. package/lib/weapp/TaskQueue.js +4 -0
  81. package/lib/weapp/UniqueInstanceStateController.js +3 -1
  82. package/lib/weapp/unsavedChildren.js +4 -1
  83. package/package.json +12 -12
@@ -10,7 +10,7 @@ var _ParseUser = _interopRequireDefault(require("./ParseUser"));
10
10
  /**
11
11
  * @flow-weak
12
12
  */
13
-
13
+ /*:: import type { RequestOptions } from './RESTController';*/
14
14
  var uuidv4 = require('./uuid');
15
15
  var registered = false;
16
16
 
@@ -21,7 +21,7 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
21
21
  /**
22
22
  * @flow
23
23
  */
24
-
24
+ /*:: import type { RequestOptions } from './RESTController';*/
25
25
  /**
26
26
  * Contains functions for calling and declaring
27
27
  * <a href="/docs/cloud_code_guide#functions">cloud functions</a>.
@@ -33,7 +33,6 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
33
33
  * @static
34
34
  * @hideconstructor
35
35
  */
36
-
37
36
  /**
38
37
  * Makes a call to a cloud function.
39
38
  *
@@ -182,7 +182,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
182
182
  SERVER_AUTH_TOKEN: null,
183
183
  LIVEQUERY_SERVER_URL: null,
184
184
  ENCRYPTED_KEY: null,
185
- VERSION: 'js' + "4.1.0-alpha.3",
185
+ VERSION: 'js' + "4.1.0-alpha.4",
186
186
  APPLICATION_ID: null,
187
187
  JAVASCRIPT_KEY: null,
188
188
  MASTER_KEY: null,
@@ -18,7 +18,19 @@ var _Storage = _interopRequireDefault(require("./Storage"));
18
18
  *
19
19
  * @flow
20
20
  */
21
-
21
+ /*:: import type { SaveOptions } from './ParseObject';*/
22
+ /*:: import type { RequestOptions } from './RESTController';*/
23
+ /*:: type QueueObject = {
24
+ queueId: string,
25
+ action: string,
26
+ object: ParseObject,
27
+ serverOptions: SaveOptions | RequestOptions,
28
+ id: string,
29
+ className: string,
30
+ hash: string,
31
+ createdAt: Date,
32
+ };*/
33
+ /*:: type Queue = Array<QueueObject>;*/
22
34
  var QUEUE_KEY = 'Parse/Eventually/Queue';
23
35
  var queueCache = [];
24
36
  var dirtyCache = true;
@@ -123,7 +123,7 @@ function _isNativeReflectConstruct() {
123
123
  } catch (e) {
124
124
  return false;
125
125
  }
126
- }
126
+ } /* global WebSocket */
127
127
  // The LiveQuery client inner state
128
128
  var CLIENT_STATE = {
129
129
  INITIALIZED: 'initialized',
@@ -89,7 +89,9 @@ function _arrayLikeToArray(arr, len) {
89
89
  if (len == null || len > arr.length) len = arr.length;
90
90
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
91
91
  return arr2;
92
- }
92
+ } /**
93
+ * @flow
94
+ */ /*:: import type ParseObject from './ParseObject';*/
93
95
  /**
94
96
  * Provides a local datastore which can be used to store and retrieve <code>Parse.Object</code>. <br />
95
97
  * To enable this functionality, call <code>Parse.enableLocalDatastore()</code>.
@@ -78,7 +78,9 @@ function _arrayLikeToArray(arr, len) {
78
78
  if (len == null || len > arr.length) len = arr.length;
79
79
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
80
80
  return arr2;
81
- }
81
+ } /**
82
+ * @flow
83
+ */
82
84
  var LocalDatastoreController = {
83
85
  fromPinWithName: function (name /*: string*/) /*: Array<Object>*/{
84
86
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
@@ -52,7 +52,20 @@ function _objectSpread(target) {
52
52
  });
53
53
  }
54
54
  return target;
55
- }
55
+ } /**
56
+ * @flow
57
+ */
58
+ /*:: import type { Op } from './ParseOp';*/
59
+ /*:: export type AttributeMap = { [attr: string]: any };*/
60
+ /*:: export type OpsMap = { [attr: string]: Op };*/
61
+ /*:: export type ObjectCache = { [attr: string]: string };*/
62
+ /*:: export type State = {
63
+ serverData: AttributeMap,
64
+ pendingOps: Array<OpsMap>,
65
+ objectCache: ObjectCache,
66
+ tasks: TaskQueue,
67
+ existed: boolean,
68
+ };*/
56
69
  function defaultState() /*: State*/{
57
70
  return {
58
71
  serverData: {},
@@ -16,7 +16,8 @@ var _ParseUser = _interopRequireDefault(require("./ParseUser"));
16
16
  /**
17
17
  * @flow
18
18
  */
19
-
19
+ /*:: type PermissionsMap = { [permission: string]: boolean };*/
20
+ /*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
20
21
  var PUBLIC_KEY = '*';
21
22
 
22
23
  /**
@@ -119,7 +119,12 @@ function _arrayLikeToArray(arr, len) {
119
119
  if (len == null || len > arr.length) len = arr.length;
120
120
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
121
121
  return arr2;
122
- }
122
+ } /**
123
+ * @flow
124
+ */
125
+ /*:: type Entity = Entity;*/
126
+ /*:: type UsersMap = { [userId: string]: boolean | any };*/
127
+ /*:: export type PermissionsMap = { [permission: string]: UsersMap };*/
123
128
  var PUBLIC_KEY = '*';
124
129
  var VALID_PERMISSIONS /*: Map<string, UsersMap>*/ = new _map.default(
125
130
  /*:: <string, UsersMap>*/
@@ -21,6 +21,7 @@ var _Storage = _interopRequireDefault(require("./Storage"));
21
21
  /**
22
22
  * @flow
23
23
  */
24
+ /*:: import type { RequestOptions } from './RESTController';*/
24
25
  /**
25
26
  * Parse.Config is a local representation of configuration data that
26
27
  * can be set from the Parse dashboard.
@@ -48,7 +48,10 @@ function _objectSpread(target) {
48
48
  });
49
49
  }
50
50
  return target;
51
- }
51
+ } /**
52
+ * @flow
53
+ */ /* global XMLHttpRequest, Blob */
54
+ /*:: import type { FullOptions } from './RESTController';*/
52
55
  var ParseError = require('./ParseError').default;
53
56
  var XHR = null;
54
57
  if (typeof XMLHttpRequest !== 'undefined') {
@@ -38,7 +38,10 @@ function _isNativeReflectConstruct() {
38
38
  } catch (e) {
39
39
  return false;
40
40
  }
41
- }
41
+ } /**
42
+ * @flow
43
+ */
44
+ /*:: import type { AttributeMap } from './ObjectStateMutations';*/
42
45
  var Installation = /*#__PURE__*/function (_ParseObject) {
43
46
  (0, _inherits2.default)(Installation, _ParseObject);
44
47
  var _super = _createSuper(Installation);
@@ -184,7 +184,11 @@ function _objectSpread(target) {
184
184
  });
185
185
  }
186
186
  return target;
187
- }
187
+ } /**
188
+ * @flow
189
+ */
190
+ /*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
191
+ /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
188
192
  var uuidv4 = require('./uuid');
189
193
  /*:: export type Pointer = {
190
194
  __type: string,
@@ -250,6 +254,11 @@ var ParseObject = /*#__PURE__*/function () {
250
254
  */
251
255
  function ParseObject(className /*: ?string | { className: string, [attr: string]: mixed }*/, attributes /*:: ?: { [attr: string]: mixed }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
252
256
  (0, _classCallCheck2.default)(this, ParseObject);
257
+ /**
258
+ * The ID of this object, unique within its class.
259
+ *
260
+ * @property {string} id
261
+ */
253
262
  (0, _defineProperty2.default)(this, "id", void 0);
254
263
  (0, _defineProperty2.default)(this, "_localId", void 0);
255
264
  (0, _defineProperty2.default)(this, "_objCount", void 0);
@@ -281,12 +290,6 @@ var ParseObject = /*#__PURE__*/function () {
281
290
  throw new Error("Can't create an invalid Parse Object");
282
291
  }
283
292
  }
284
-
285
- /**
286
- * The ID of this object, unique within its class.
287
- *
288
- * @property {string} id
289
- */
290
293
  (0, _createClass2.default)(ParseObject, [{
291
294
  key: "attributes",
292
295
  get: /* Prototype getters / setters */
@@ -51,7 +51,9 @@ function _isNativeReflectConstruct() {
51
51
  } catch (e) {
52
52
  return false;
53
53
  }
54
- }
54
+ } /**
55
+ * @flow
56
+ */
55
57
  function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
56
58
  if (!json || !json.__op) {
57
59
  return null;
@@ -40,7 +40,29 @@ var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
40
40
  /*
41
41
  * @flow
42
42
  */
43
-
43
+ /*:: import type LiveQuerySubscription from './LiveQuerySubscription';*/
44
+ /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
45
+ /*:: type BatchOptions = FullOptions & { batchSize?: number };*/
46
+ /*:: export type WhereClause = {
47
+ [attr: string]: mixed,
48
+ };*/
49
+ /*:: export type QueryJSON = {
50
+ where: WhereClause,
51
+ watch?: string,
52
+ include?: string,
53
+ excludeKeys?: string,
54
+ keys?: string,
55
+ limit?: number,
56
+ skip?: number,
57
+ order?: string,
58
+ className?: string,
59
+ count?: number,
60
+ hint?: mixed,
61
+ explain?: boolean,
62
+ readPreference?: string,
63
+ includeReadPreference?: string,
64
+ subqueryReadPreference?: string,
65
+ };*/
44
66
  /**
45
67
  * Converts a string into a regex that matches it.
46
68
  * Surrounding with \Q .. \E does this, we just need to escape any \E's in
@@ -215,15 +237,14 @@ function handleOfflineSort(a, b, sorts) {
215
237
  * @alias Parse.Query
216
238
  */
217
239
  var ParseQuery = /*#__PURE__*/function () {
218
- /**
219
- * @property {string} className
220
- */
221
-
222
240
  /**
223
241
  * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
224
242
  */
225
243
  function ParseQuery(objectClass /*: string | ParseObject*/) {
226
244
  (0, _classCallCheck2.default)(this, ParseQuery);
245
+ /**
246
+ * @property {string} className
247
+ */
227
248
  (0, _defineProperty2.default)(this, "className", void 0);
228
249
  (0, _defineProperty2.default)(this, "_where", void 0);
229
250
  (0, _defineProperty2.default)(this, "_watch", void 0);
@@ -40,7 +40,11 @@ function _isNativeReflectConstruct() {
40
40
  } catch (e) {
41
41
  return false;
42
42
  }
43
- }
43
+ } /**
44
+ * @flow
45
+ */
46
+ /*:: import type { AttributeMap } from './ObjectStateMutations';*/
47
+ /*:: import type ParseRelation from './ParseRelation';*/
44
48
  /**
45
49
  * Represents a Role on the Parse server. Roles represent groupings of
46
50
  * Users for the purposes of granting permissions (e.g. specifying an ACL
@@ -16,7 +16,7 @@ var _ParseCLP = _interopRequireDefault(require("./ParseCLP"));
16
16
  /**
17
17
  * @flow
18
18
  */
19
-
19
+ /*:: import type { PermissionsMap } from './ParseCLP';*/
20
20
  var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
21
21
  /*:: type FieldOptions = {
22
22
  required: boolean,
@@ -42,7 +42,11 @@ function _isNativeReflectConstruct() {
42
42
  } catch (e) {
43
43
  return false;
44
44
  }
45
- }
45
+ } /**
46
+ * @flow
47
+ */
48
+ /*:: import type { AttributeMap } from './ObjectStateMutations';*/
49
+ /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
46
50
  /**
47
51
  * <p>A Parse.Session object is a local representation of a revocable session.
48
52
  * This class is a subclass of a Parse.Object, and retains the same
@@ -49,7 +49,12 @@ function _isNativeReflectConstruct() {
49
49
  } catch (e) {
50
50
  return false;
51
51
  }
52
- }
52
+ } /**
53
+ * @flow
54
+ */
55
+ /*:: import type { AttributeMap } from './ObjectStateMutations';*/
56
+ /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
57
+ /*:: export type AuthData = ?{ [key: string]: mixed };*/
53
58
  var CURRENT_USER_KEY = 'currentUser';
54
59
  var canUseCurrentUser = !_CoreManager.default.get('IS_NODE');
55
60
  var currentUserCacheMatchesDisk = false;
@@ -875,6 +880,27 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
875
880
  return user.logIn(options);
876
881
  }
877
882
 
883
+ /**
884
+ * Logs in a user with an objectId. On success, this saves the session
885
+ * to disk, so you can retrieve the currently logged in user using
886
+ * <code>current</code>.
887
+ *
888
+ * @param {string} userId The objectId for the user.
889
+ * @static
890
+ * @returns {Promise} A promise that is fulfilled with the user when
891
+ * the login completes.
892
+ */
893
+ }, {
894
+ key: "loginAs",
895
+ value: function (userId /*: string*/) {
896
+ if (!userId) {
897
+ throw new _ParseError.default(_ParseError.default.USERNAME_MISSING, 'Cannot log in as user with an empty user id');
898
+ }
899
+ var controller = _CoreManager.default.getUserController();
900
+ var user = new this();
901
+ return controller.loginAs(user, userId);
902
+ }
903
+
878
904
  /**
879
905
  * Logs in a user with a session token. On success, this saves the session
880
906
  * to disk, so you can retrieve the currently logged in user using
@@ -1319,6 +1345,21 @@ var DefaultController = {
1319
1345
  return DefaultController.setCurrentUser(user);
1320
1346
  });
1321
1347
  },
1348
+ loginAs: function (user /*: ParseUser*/, userId /*: string*/) /*: Promise<ParseUser>*/{
1349
+ var RESTController = _CoreManager.default.getRESTController();
1350
+ return RESTController.request('POST', 'loginAs', {
1351
+ userId: userId
1352
+ }, {
1353
+ useMasterKey: true
1354
+ }).then(function (response) {
1355
+ user._finishFetch(response);
1356
+ user._setExisted(true);
1357
+ if (!canUseCurrentUser) {
1358
+ return _promise.default.resolve(user);
1359
+ }
1360
+ return DefaultController.setCurrentUser(user);
1361
+ });
1362
+ },
1322
1363
  become: function (user /*: ParseUser*/, options /*: RequestOptions*/) /*: Promise<ParseUser>*/{
1323
1364
  var RESTController = _CoreManager.default.getRESTController();
1324
1365
  return RESTController.request('GET', 'users/me', {}, options).then(function (response) {
@@ -13,7 +13,14 @@ var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
13
13
  /**
14
14
  * @flow
15
15
  */
16
-
16
+ /*:: import type { WhereClause } from './ParseQuery';*/
17
+ /*:: import type { FullOptions } from './RESTController';*/
18
+ /*:: export type PushData = {
19
+ where?: WhereClause | ParseQuery,
20
+ push_time?: Date | string,
21
+ expiration_time?: Date | string,
22
+ expiration_interval?: number,
23
+ };*/
17
24
  /**
18
25
  * Contains functions to deal with Push in Parse.
19
26
  *
@@ -21,7 +28,6 @@ var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
21
28
  * @static
22
29
  * @hideconstructor
23
30
  */
24
-
25
31
  /**
26
32
  * Sends a push notification.
27
33
  * **Available in Cloud Code only.**
@@ -45,6 +45,26 @@ function _objectSpread(target) {
45
45
  */
46
46
  /* global XMLHttpRequest, XDomainRequest */
47
47
  var uuidv4 = require('./uuid');
48
+ /*:: export type RequestOptions = {
49
+ useMasterKey?: boolean,
50
+ sessionToken?: string,
51
+ installationId?: string,
52
+ returnStatus?: boolean,
53
+ batchSize?: number,
54
+ include?: any,
55
+ progress?: any,
56
+ context?: any,
57
+ usePost?: boolean,
58
+ };*/
59
+ /*:: export type FullOptions = {
60
+ success?: any,
61
+ error?: any,
62
+ useMasterKey?: boolean,
63
+ sessionToken?: string,
64
+ installationId?: string,
65
+ progress?: any,
66
+ usePost?: boolean,
67
+ };*/
48
68
  var XHR = null;
49
69
  if (typeof XMLHttpRequest !== 'undefined') {
50
70
  XHR = XMLHttpRequest;
@@ -66,7 +66,12 @@ function _interopRequireWildcard(obj, nodeInterop) {
66
66
  /**
67
67
  * @flow
68
68
  */
69
-
69
+ /*:: import type { Op } from './ParseOp';*/
70
+ /*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
71
+ /*:: type ObjectIdentifier = {
72
+ className: string,
73
+ id: string,
74
+ };*/
70
75
  var objectState
71
76
  /*: {
72
77
  [className: string]: {
@@ -8,6 +8,10 @@ var _promiseUtils = require("./promiseUtils");
8
8
  /**
9
9
  * @flow
10
10
  */
11
+ /*:: type Task = {
12
+ task: () => Promise,
13
+ _completion: Promise,
14
+ };*/
11
15
  var TaskQueue = /*#__PURE__*/function () {
12
16
  function TaskQueue() {
13
17
  (0, _classCallCheck2.default)(this, TaskQueue);
@@ -69,7 +69,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
69
69
  /**
70
70
  * @flow
71
71
  */
72
-
72
+ /*:: import type { Op } from './ParseOp';*/
73
+ /*:: import type ParseObject from './ParseObject';*/
74
+ /*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
73
75
  var objectState = new _weakMap.default();
74
76
  function getState(obj /*: ParseObject*/) /*: ?State*/{
75
77
  var classData = objectState.get(obj);
@@ -17,7 +17,10 @@ var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
17
17
  /**
18
18
  * @flow
19
19
  */
20
-
20
+ /*:: type EncounterMap = {
21
+ objects: { [identifier: string]: ParseObject | boolean },
22
+ files: Array<ParseFile>,
23
+ };*/
21
24
  /**
22
25
  * Return an array of unsaved children, which are either Parse Objects or Files.
23
26
  * If it encounters any dirty Objects without Ids, it will throw an exception.
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) {
13
13
  /**
14
14
  * @flow-weak
15
15
  */
16
-
16
+ /*:: import type { RequestOptions } from './RESTController';*/
17
17
  const uuidv4 = require('./uuid');
18
18
  let registered = false;
19
19
 
package/lib/node/Cloud.js CHANGED
@@ -21,7 +21,7 @@ function _interopRequireDefault(obj) {
21
21
  /**
22
22
  * @flow
23
23
  */
24
-
24
+ /*:: import type { RequestOptions } from './RESTController';*/
25
25
  /**
26
26
  * Contains functions for calling and declaring
27
27
  * <a href="/docs/cloud_code_guide#functions">cloud functions</a>.
@@ -33,7 +33,6 @@ function _interopRequireDefault(obj) {
33
33
  * @static
34
34
  * @hideconstructor
35
35
  */
36
-
37
36
  /**
38
37
  * Makes a call to a cloud function.
39
38
  *
@@ -179,7 +179,7 @@ const config /*: Config & { [key: string]: mixed }*/ = {
179
179
  SERVER_AUTH_TOKEN: null,
180
180
  LIVEQUERY_SERVER_URL: null,
181
181
  ENCRYPTED_KEY: null,
182
- VERSION: 'js' + "4.1.0-alpha.3",
182
+ VERSION: 'js' + "4.1.0-alpha.4",
183
183
  APPLICATION_ID: null,
184
184
  JAVASCRIPT_KEY: null,
185
185
  MASTER_KEY: null,
@@ -14,7 +14,19 @@ function _interopRequireDefault(obj) {
14
14
  *
15
15
  * @flow
16
16
  */
17
-
17
+ /*:: import type { SaveOptions } from './ParseObject';*/
18
+ /*:: import type { RequestOptions } from './RESTController';*/
19
+ /*:: type QueueObject = {
20
+ queueId: string,
21
+ action: string,
22
+ object: ParseObject,
23
+ serverOptions: SaveOptions | RequestOptions,
24
+ id: string,
25
+ className: string,
26
+ hash: string,
27
+ createdAt: Date,
28
+ };*/
29
+ /*:: type Queue = Array<QueueObject>;*/
18
30
  const QUEUE_KEY = 'Parse/Eventually/Queue';
19
31
  let queueCache = [];
20
32
  let dirtyCache = true;
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) {
11
11
  /**
12
12
  * @flow
13
13
  */
14
-
14
+ /*:: import type ParseObject from './ParseObject';*/
15
15
  /**
16
16
  * Provides a local datastore which can be used to store and retrieve <code>Parse.Object</code>. <br />
17
17
  * To enable this functionality, call <code>Parse.enableLocalDatastore()</code>.
@@ -26,7 +26,17 @@ function _interopRequireDefault(obj) {
26
26
  /**
27
27
  * @flow
28
28
  */
29
-
29
+ /*:: import type { Op } from './ParseOp';*/
30
+ /*:: export type AttributeMap = { [attr: string]: any };*/
31
+ /*:: export type OpsMap = { [attr: string]: Op };*/
32
+ /*:: export type ObjectCache = { [attr: string]: string };*/
33
+ /*:: export type State = {
34
+ serverData: AttributeMap,
35
+ pendingOps: Array<OpsMap>,
36
+ objectCache: ObjectCache,
37
+ tasks: TaskQueue,
38
+ existed: boolean,
39
+ };*/
30
40
  function defaultState() /*: State*/{
31
41
  return {
32
42
  serverData: {},
@@ -14,7 +14,8 @@ function _interopRequireDefault(obj) {
14
14
  /**
15
15
  * @flow
16
16
  */
17
-
17
+ /*:: type PermissionsMap = { [permission: string]: boolean };*/
18
+ /*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
18
19
  const PUBLIC_KEY = '*';
19
20
 
20
21
  /**
@@ -14,7 +14,9 @@ function _interopRequireDefault(obj) {
14
14
  /**
15
15
  * @flow
16
16
  */
17
-
17
+ /*:: type Entity = Entity;*/
18
+ /*:: type UsersMap = { [userId: string]: boolean | any };*/
19
+ /*:: export type PermissionsMap = { [permission: string]: UsersMap };*/
18
20
  const PUBLIC_KEY = '*';
19
21
  const VALID_PERMISSIONS /*: Map<string, UsersMap>*/ = new Map(
20
22
  /*:: <string, UsersMap>*/
@@ -18,14 +18,13 @@ function _interopRequireDefault(obj) {
18
18
  /**
19
19
  * @flow
20
20
  */
21
-
21
+ /*:: import type { RequestOptions } from './RESTController';*/
22
22
  /**
23
23
  * Parse.Config is a local representation of configuration data that
24
24
  * can be set from the Parse dashboard.
25
25
  *
26
26
  * @alias Parse.Config
27
27
  */
28
-
29
28
  class ParseConfig {
30
29
  /*:: attributes: { [key: string]: any };*/
31
30
  /*:: _escapedAttributes: { [key: string]: any };*/
@@ -14,7 +14,7 @@ function _interopRequireDefault(obj) {
14
14
  * @flow
15
15
  */
16
16
  /* global XMLHttpRequest, Blob */
17
-
17
+ /*:: import type { FullOptions } from './RESTController';*/
18
18
  const ParseError = require('./ParseError').default;
19
19
  let XHR = null;
20
20
  if (typeof XMLHttpRequest !== 'undefined') {
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) {
13
13
  /**
14
14
  * @flow
15
15
  */
16
-
16
+ /*:: import type { AttributeMap } from './ObjectStateMutations';*/
17
17
  class Installation extends _ParseObject.default {
18
18
  constructor(attributes /*: ?AttributeMap*/) {
19
19
  super('_Installation');
@@ -70,7 +70,8 @@ function _interopRequireDefault(obj) {
70
70
  /**
71
71
  * @flow
72
72
  */
73
-
73
+ /*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
74
+ /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
74
75
  const uuidv4 = require('./uuid');
75
76
  /*:: export type Pointer = {
76
77
  __type: string,