parse 5.2.0-alpha.1 → 5.2.0-alpha.3

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 +10519 -15246
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +10499 -15371
  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 +312 -485
  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 +5 -9
  70. package/lib/node/AnonymousUtils.js +10 -15
  71. package/lib/node/Cloud.js +11 -11
  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 +20 -39
  76. package/lib/node/FacebookUtils.js +4 -8
  77. package/lib/node/IndexedDBStorageController.js +14 -10
  78. package/lib/node/InstallationController.js +12 -13
  79. package/lib/node/LiveQueryClient.js +23 -21
  80. package/lib/node/LiveQuerySubscription.js +6 -7
  81. package/lib/node/LocalDatastore.js +23 -23
  82. package/lib/node/LocalDatastoreController.default.js +11 -12
  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 +12 -22
  87. package/lib/node/OfflineQuery.js +37 -23
  88. package/lib/node/Parse.js +36 -50
  89. package/lib/node/ParseACL.js +21 -30
  90. package/lib/node/ParseCLP.js +38 -40
  91. package/lib/node/ParseConfig.js +10 -17
  92. package/lib/node/ParseError.js +460 -461
  93. package/lib/node/ParseFile.js +27 -47
  94. package/lib/node/ParseGeoPoint.js +16 -17
  95. package/lib/node/ParseHooks.js +16 -18
  96. package/lib/node/ParseInstallation.js +10 -11
  97. package/lib/node/ParseLiveQuery.js +9 -14
  98. package/lib/node/ParseObject.js +142 -173
  99. package/lib/node/ParseOp.js +35 -47
  100. package/lib/node/ParsePolygon.js +14 -20
  101. package/lib/node/ParseQuery.js +100 -123
  102. package/lib/node/ParseRelation.js +10 -19
  103. package/lib/node/ParseRole.js +10 -11
  104. package/lib/node/ParseSchema.js +29 -42
  105. package/lib/node/ParseSession.js +10 -11
  106. package/lib/node/ParseUser.js +76 -87
  107. package/lib/node/Push.js +7 -12
  108. package/lib/node/RESTController.js +24 -36
  109. package/lib/node/SingleInstanceStateController.js +41 -69
  110. package/lib/node/Socket.weapp.js +23 -2
  111. package/lib/node/Storage.js +14 -19
  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 +20 -20
  116. package/lib/node/StorageController.weapp.js +14 -8
  117. package/lib/node/TaskQueue.js +2 -3
  118. package/lib/node/UniqueInstanceStateController.js +43 -63
  119. package/lib/node/WebSocketController.js +15 -2
  120. package/lib/node/Xhr.weapp.js +11 -2
  121. package/lib/node/arrayContainsObject.js +4 -4
  122. package/lib/node/canBeSerialized.js +5 -5
  123. package/lib/node/decode.js +4 -4
  124. package/lib/node/encode.js +5 -5
  125. package/lib/node/equals.js +4 -4
  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 +5 -5
  131. package/lib/node/unsavedChildren.js +5 -5
  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 +8 -7
  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 +312 -485
  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 +24 -30
@@ -5,16 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
8
- function _interopRequireDefault(obj) {
9
- return obj && obj.__esModule ? obj : {
10
- default: obj
8
+ function _interopRequireDefault(e) {
9
+ return e && e.__esModule ? e : {
10
+ default: e
11
11
  };
12
12
  }
13
- /**
14
- * @flow
15
- */
16
- /*:: import type ParseObject from './ParseObject';*/
17
- /*:: import type ParseQuery from './ParseQuery';*/
18
13
  /**
19
14
  * Creates a new Relation for the given parent object and key. This
20
15
  * constructor should rarely be used directly, but rather created by
@@ -29,14 +24,11 @@ function _interopRequireDefault(obj) {
29
24
  * @alias Parse.Relation
30
25
  */
31
26
  class ParseRelation {
32
- /*:: parent: ?ParseObject;*/
33
- /*:: key: ?string;*/
34
- /*:: targetClassName: ?string;*/
35
27
  /**
36
28
  * @param {Parse.Object} parent The parent of this relation.
37
29
  * @param {string} key The key for this relation on the parent.
38
30
  */
39
- constructor(parent /*: ?ParseObject*/, key /*: ?string*/) {
31
+ constructor(parent, key) {
40
32
  this.parent = parent;
41
33
  this.key = key;
42
34
  this.targetClassName = null;
@@ -45,7 +37,7 @@ class ParseRelation {
45
37
  /*
46
38
  * Makes sure that this relation has the right parent and key.
47
39
  */
48
- _ensureParentAndKey(parent /*: ParseObject*/, key /*: string*/) {
40
+ _ensureParentAndKey(parent, key) {
49
41
  this.key = this.key || key;
50
42
  if (this.key !== key) {
51
43
  throw new Error('Internal Error. Relation retrieved from two different keys.');
@@ -72,7 +64,7 @@ class ParseRelation {
72
64
  * @param {(Parse.Object|Array)} objects The item or items to add.
73
65
  * @returns {Parse.Object} The parent of the relation.
74
66
  */
75
- add(objects /*: ParseObject | Array<ParseObject | string>*/) /*: ParseObject*/{
67
+ add(objects) {
76
68
  if (!Array.isArray(objects)) {
77
69
  objects = [objects];
78
70
  }
@@ -97,7 +89,7 @@ class ParseRelation {
97
89
  *
98
90
  * @param {(Parse.Object|Array)} objects The item or items to remove.
99
91
  */
100
- remove(objects /*: ParseObject | Array<ParseObject | string>*/) {
92
+ remove(objects) {
101
93
  if (!Array.isArray(objects)) {
102
94
  objects = [objects];
103
95
  }
@@ -120,7 +112,7 @@ class ParseRelation {
120
112
  *
121
113
  * @returns {object} JSON representation of Relation
122
114
  */
123
- toJSON() /*: { __type: 'Relation', className: ?string }*/{
115
+ toJSON() {
124
116
  return {
125
117
  __type: 'Relation',
126
118
  className: this.targetClassName
@@ -133,7 +125,7 @@ class ParseRelation {
133
125
  *
134
126
  * @returns {Parse.Query} Relation Query
135
127
  */
136
- query() /*: ParseQuery*/{
128
+ query() {
137
129
  let query;
138
130
  const parent = this.parent;
139
131
  if (!parent) {
@@ -155,5 +147,4 @@ class ParseRelation {
155
147
  return query;
156
148
  }
157
149
  }
158
- var _default = ParseRelation;
159
- exports.default = _default;
150
+ var _default = exports.default = ParseRelation;
@@ -8,9 +8,9 @@ var _CoreManager = _interopRequireDefault(require("./CoreManager"));
8
8
  var _ParseACL = _interopRequireDefault(require("./ParseACL"));
9
9
  var _ParseError = _interopRequireDefault(require("./ParseError"));
10
10
  var _ParseObject = _interopRequireDefault(require("./ParseObject"));
11
- function _interopRequireDefault(obj) {
12
- return obj && obj.__esModule ? obj : {
13
- default: obj
11
+ function _interopRequireDefault(e) {
12
+ return e && e.__esModule ? e : {
13
+ default: e
14
14
  };
15
15
  }
16
16
  /**
@@ -33,7 +33,7 @@ class ParseRole extends _ParseObject.default {
33
33
  * A Parse.Role is a local representation of a role persisted to the Parse
34
34
  * cloud.
35
35
  */
36
- constructor(name /*: string*/, acl /*: ParseACL*/) {
36
+ constructor(name, acl) {
37
37
  super('_Role');
38
38
  if (typeof name === 'string' && acl instanceof _ParseACL.default) {
39
39
  this.setName(name);
@@ -46,7 +46,7 @@ class ParseRole extends _ParseObject.default {
46
46
  *
47
47
  * @returns {string} the name of the role.
48
48
  */
49
- getName() /*: string | null*/{
49
+ getName() {
50
50
  const name = this.get('name');
51
51
  if (name == null || typeof name === 'string') {
52
52
  return name;
@@ -71,7 +71,7 @@ class ParseRole extends _ParseObject.default {
71
71
  * callbacks.
72
72
  * @returns {(ParseObject|boolean)} true if the set succeeded.
73
73
  */
74
- setName(name /*: string*/, options /*:: ?: any*/) /*: ParseObject | boolean*/{
74
+ setName(name, options) {
75
75
  this._validateName(name);
76
76
  return this.set('name', name, options);
77
77
  }
@@ -87,7 +87,7 @@ class ParseRole extends _ParseObject.default {
87
87
  * @returns {Parse.Relation} the relation for the users belonging to this
88
88
  * role.
89
89
  */
90
- getUsers() /*: ParseRelation*/{
90
+ getUsers() {
91
91
  return this.relation('users');
92
92
  }
93
93
 
@@ -102,7 +102,7 @@ class ParseRole extends _ParseObject.default {
102
102
  * @returns {Parse.Relation} the relation for the roles belonging to this
103
103
  * role.
104
104
  */
105
- getRoles() /*: ParseRelation*/{
105
+ getRoles() {
106
106
  return this.relation('roles');
107
107
  }
108
108
  _validateName(newName) {
@@ -113,7 +113,7 @@ class ParseRole extends _ParseObject.default {
113
113
  throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
114
114
  }
115
115
  }
116
- validate(attrs /*: AttributeMap*/, options /*:: ?: any*/) /*: ParseError | boolean*/{
116
+ validate(attrs, options) {
117
117
  const isInvalid = super.validate(attrs, options);
118
118
  if (isInvalid) {
119
119
  return isInvalid;
@@ -137,5 +137,4 @@ class ParseRole extends _ParseObject.default {
137
137
  }
138
138
  _CoreManager.default.setParseRole(ParseRole);
139
139
  _ParseObject.default.registerSubclass('_Role', ParseRole);
140
- var _default = ParseRole;
141
- exports.default = _default;
140
+ var _default = exports.default = ParseRole;
@@ -7,20 +7,12 @@ exports.default = void 0;
7
7
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
8
8
  var _ParseObject = _interopRequireDefault(require("./ParseObject"));
9
9
  var _ParseCLP = _interopRequireDefault(require("./ParseCLP"));
10
- function _interopRequireDefault(obj) {
11
- return obj && obj.__esModule ? obj : {
12
- default: obj
10
+ function _interopRequireDefault(e) {
11
+ return e && e.__esModule ? e : {
12
+ default: e
13
13
  };
14
14
  }
15
- /**
16
- * @flow
17
- */
18
- /*:: import type { PermissionsMap } from './ParseCLP';*/
19
15
  const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
20
- /*:: type FieldOptions = {
21
- required: boolean,
22
- defaultValue: any,
23
- };*/
24
16
  /**
25
17
  * A Parse.Schema object is for handling schema data from Parse.
26
18
  * <p>All the schemas methods require MasterKey.
@@ -39,14 +31,10 @@ const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'Ge
39
31
  * @alias Parse.Schema
40
32
  */
41
33
  class ParseSchema {
42
- /*:: className: string;*/
43
- /*:: _fields: { [key: string]: any };*/
44
- /*:: _indexes: { [key: string]: any };*/
45
- /*:: _clp: { [key: string]: any };*/
46
34
  /**
47
35
  * @param {string} className Parse Class string.
48
36
  */
49
- constructor(className /*: string*/) {
37
+ constructor(className) {
50
38
  if (typeof className === 'string') {
51
39
  if (className === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {
52
40
  this.className = '_User';
@@ -173,7 +161,7 @@ class ParseSchema {
173
161
  * @param {object | Parse.CLP} clp Class Level Permissions
174
162
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
175
163
  */
176
- setCLP(clp /*: PermissionsMap | ParseCLP*/) {
164
+ setCLP(clp) {
177
165
  if (clp instanceof _ParseCLP.default) {
178
166
  this._clp = clp.toJSON();
179
167
  } else {
@@ -195,7 +183,7 @@ class ParseSchema {
195
183
  * </ul>
196
184
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
197
185
  */
198
- addField(name /*: string*/, type /*: string*/, options /*: FieldOptions*/ = {}) {
186
+ addField(name, type, options = {}) {
199
187
  type = type || 'String';
200
188
  if (!name) {
201
189
  throw new Error('field name may not be null.');
@@ -207,7 +195,7 @@ class ParseSchema {
207
195
  return this.addPointer(name, options.targetClass, options);
208
196
  }
209
197
  if (type === 'Relation') {
210
- return this.addRelation(name, options.targetClass, options);
198
+ return this.addRelation(name, options.targetClass);
211
199
  }
212
200
  const fieldOptions = {
213
201
  type
@@ -249,7 +237,7 @@ class ParseSchema {
249
237
  * schema.addIndex('index_name', { 'field': 1 });
250
238
  * </pre>
251
239
  */
252
- addIndex(name /*: string*/, index /*: any*/) {
240
+ addIndex(name, index) {
253
241
  if (!name) {
254
242
  throw new Error('index name may not be null.');
255
243
  }
@@ -267,7 +255,7 @@ class ParseSchema {
267
255
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
268
256
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
269
257
  */
270
- addString(name /*: string*/, options /*: FieldOptions*/) {
258
+ addString(name, options) {
271
259
  return this.addField(name, 'String', options);
272
260
  }
273
261
 
@@ -278,7 +266,7 @@ class ParseSchema {
278
266
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
279
267
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
280
268
  */
281
- addNumber(name /*: string*/, options /*: FieldOptions*/) {
269
+ addNumber(name, options) {
282
270
  return this.addField(name, 'Number', options);
283
271
  }
284
272
 
@@ -289,7 +277,7 @@ class ParseSchema {
289
277
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
290
278
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
291
279
  */
292
- addBoolean(name /*: string*/, options /*: FieldOptions*/) {
280
+ addBoolean(name, options) {
293
281
  return this.addField(name, 'Boolean', options);
294
282
  }
295
283
 
@@ -300,7 +288,7 @@ class ParseSchema {
300
288
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
301
289
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
302
290
  */
303
- addBytes(name /*: string*/, options /*: FieldOptions*/) {
291
+ addBytes(name, options) {
304
292
  return this.addField(name, 'Bytes', options);
305
293
  }
306
294
 
@@ -311,7 +299,7 @@ class ParseSchema {
311
299
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
312
300
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
313
301
  */
314
- addDate(name /*: string*/, options /*: FieldOptions*/) {
302
+ addDate(name, options) {
315
303
  return this.addField(name, 'Date', options);
316
304
  }
317
305
 
@@ -322,7 +310,7 @@ class ParseSchema {
322
310
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
323
311
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
324
312
  */
325
- addFile(name /*: string*/, options /*: FieldOptions*/) {
313
+ addFile(name, options) {
326
314
  return this.addField(name, 'File', options);
327
315
  }
328
316
 
@@ -333,7 +321,7 @@ class ParseSchema {
333
321
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
334
322
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
335
323
  */
336
- addGeoPoint(name /*: string*/, options /*: FieldOptions*/) {
324
+ addGeoPoint(name, options) {
337
325
  return this.addField(name, 'GeoPoint', options);
338
326
  }
339
327
 
@@ -344,7 +332,7 @@ class ParseSchema {
344
332
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
345
333
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
346
334
  */
347
- addPolygon(name /*: string*/, options /*: FieldOptions*/) {
335
+ addPolygon(name, options) {
348
336
  return this.addField(name, 'Polygon', options);
349
337
  }
350
338
 
@@ -355,7 +343,7 @@ class ParseSchema {
355
343
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
356
344
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
357
345
  */
358
- addArray(name /*: string*/, options /*: FieldOptions*/) {
346
+ addArray(name, options) {
359
347
  return this.addField(name, 'Array', options);
360
348
  }
361
349
 
@@ -366,7 +354,7 @@ class ParseSchema {
366
354
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
367
355
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
368
356
  */
369
- addObject(name /*: string*/, options /*: FieldOptions*/) {
357
+ addObject(name, options) {
370
358
  return this.addField(name, 'Object', options);
371
359
  }
372
360
 
@@ -378,7 +366,7 @@ class ParseSchema {
378
366
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
379
367
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
380
368
  */
381
- addPointer(name /*: string*/, targetClass /*: string*/, options /*: FieldOptions*/ = {}) {
369
+ addPointer(name, targetClass, options = {}) {
382
370
  if (!name) {
383
371
  throw new Error('field name may not be null.');
384
372
  }
@@ -409,7 +397,7 @@ class ParseSchema {
409
397
  * @param {string} targetClass Name of the target Pointer Class
410
398
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
411
399
  */
412
- addRelation(name /*: string*/, targetClass /*: string*/) {
400
+ addRelation(name, targetClass) {
413
401
  if (!name) {
414
402
  throw new Error('field name may not be null.');
415
403
  }
@@ -429,7 +417,7 @@ class ParseSchema {
429
417
  * @param {string} name Name of the field
430
418
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
431
419
  */
432
- deleteField(name /*: string*/) {
420
+ deleteField(name) {
433
421
  this._fields[name] = {
434
422
  __op: 'Delete'
435
423
  };
@@ -442,7 +430,7 @@ class ParseSchema {
442
430
  * @param {string} name Name of the field
443
431
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
444
432
  */
445
- deleteIndex(name /*: string*/) {
433
+ deleteIndex(name) {
446
434
  this._indexes[name] = {
447
435
  __op: 'Delete'
448
436
  };
@@ -450,25 +438,25 @@ class ParseSchema {
450
438
  }
451
439
  }
452
440
  const DefaultController = {
453
- send(className /*: string*/, method /*: string*/, params /*: any*/ = {}) /*: Promise*/{
441
+ send(className, method, params = {}) {
454
442
  const RESTController = _CoreManager.default.getRESTController();
455
443
  return RESTController.request(method, `schemas/${className}`, params, {
456
444
  useMasterKey: true
457
445
  });
458
446
  },
459
- get(className /*: string*/) /*: Promise*/{
447
+ get(className) {
460
448
  return this.send(className, 'GET');
461
449
  },
462
- create(className /*: string*/, params /*: any*/) /*: Promise*/{
450
+ create(className, params) {
463
451
  return this.send(className, 'POST', params);
464
452
  },
465
- update(className /*: string*/, params /*: any*/) /*: Promise*/{
453
+ update(className, params) {
466
454
  return this.send(className, 'PUT', params);
467
455
  },
468
- delete(className /*: string*/) /*: Promise*/{
456
+ delete(className) {
469
457
  return this.send(className, 'DELETE');
470
458
  },
471
- purge(className /*: string*/) /*: Promise*/{
459
+ purge(className) {
472
460
  const RESTController = _CoreManager.default.getRESTController();
473
461
  return RESTController.request('DELETE', `purge/${className}`, {}, {
474
462
  useMasterKey: true
@@ -476,5 +464,4 @@ const DefaultController = {
476
464
  }
477
465
  };
478
466
  _CoreManager.default.setSchemaController(DefaultController);
479
- var _default = ParseSchema;
480
- exports.default = _default;
467
+ var _default = exports.default = ParseSchema;
@@ -8,9 +8,9 @@ var _CoreManager = _interopRequireDefault(require("./CoreManager"));
8
8
  var _isRevocableSession = _interopRequireDefault(require("./isRevocableSession"));
9
9
  var _ParseObject = _interopRequireDefault(require("./ParseObject"));
10
10
  var _ParseUser = _interopRequireDefault(require("./ParseUser"));
11
- function _interopRequireDefault(obj) {
12
- return obj && obj.__esModule ? obj : {
13
- default: obj
11
+ function _interopRequireDefault(e) {
12
+ return e && e.__esModule ? e : {
13
+ default: e
14
14
  };
15
15
  }
16
16
  /**
@@ -25,7 +25,7 @@ class ParseSession extends _ParseObject.default {
25
25
  /**
26
26
  * @param {object} attributes The initial set of data to store in the user.
27
27
  */
28
- constructor(attributes /*:: ?: any*/) {
28
+ constructor(attributes) {
29
29
  super('_Session');
30
30
  if (attributes && typeof attributes === 'object') {
31
31
  if (!this.set(attributes || {})) {
@@ -39,7 +39,7 @@ class ParseSession extends _ParseObject.default {
39
39
  *
40
40
  * @returns {string}
41
41
  */
42
- getSessionToken() /*: string*/{
42
+ getSessionToken() {
43
43
  const token = this.get('sessionToken');
44
44
  if (typeof token === 'string') {
45
45
  return token;
@@ -59,10 +59,10 @@ class ParseSession extends _ParseObject.default {
59
59
  * object after it has been fetched. If there is no current user, the
60
60
  * promise will be rejected.
61
61
  */
62
- static current(options /*: FullOptions*/) {
62
+ static current(options) {
63
63
  options = options || {};
64
64
  const controller = _CoreManager.default.getSessionController();
65
- const sessionOptions /*: FullOptions*/ = {};
65
+ const sessionOptions = {};
66
66
  if (options.hasOwnProperty('useMasterKey')) {
67
67
  sessionOptions.useMasterKey = options.useMasterKey;
68
68
  }
@@ -85,7 +85,7 @@ class ParseSession extends _ParseObject.default {
85
85
  * @static
86
86
  * @returns {boolean}
87
87
  */
88
- static isCurrentSessionRevocable() /*: boolean*/{
88
+ static isCurrentSessionRevocable() {
89
89
  const currentUser = _ParseUser.default.current();
90
90
  if (currentUser) {
91
91
  return (0, _isRevocableSession.default)(currentUser.getSessionToken() || '');
@@ -95,7 +95,7 @@ class ParseSession extends _ParseObject.default {
95
95
  }
96
96
  _ParseObject.default.registerSubclass('_Session', ParseSession);
97
97
  const DefaultController = {
98
- getSession(options /*: RequestOptions*/) /*: Promise<ParseSession>*/{
98
+ getSession(options) {
99
99
  const RESTController = _CoreManager.default.getRESTController();
100
100
  const session = new ParseSession();
101
101
  return RESTController.request('GET', 'sessions/me', {}, options).then(sessionData => {
@@ -106,5 +106,4 @@ const DefaultController = {
106
106
  }
107
107
  };
108
108
  _CoreManager.default.setSessionController(DefaultController);
109
- var _default = ParseSession;
110
- exports.default = _default;
109
+ var _default = exports.default = ParseSession;