parse 6.1.0-alpha.1 → 6.1.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 (213) hide show
  1. package/README.md +0 -8
  2. package/dist/parse.js +93 -105
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +93 -105
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/Cloud.js +1 -0
  7. package/lib/browser/CoreManager.js +2 -2
  8. package/lib/browser/CryptoController.js +0 -1
  9. package/lib/browser/EventEmitter.js +0 -1
  10. package/lib/browser/EventuallyQueue.js +6 -10
  11. package/lib/browser/IndexedDBStorageController.js +0 -1
  12. package/lib/browser/InstallationController.js +0 -1
  13. package/lib/browser/LiveQuerySubscription.js +4 -4
  14. package/lib/browser/LocalDatastore.js +0 -1
  15. package/lib/browser/LocalDatastoreController.default.js +0 -1
  16. package/lib/browser/LocalDatastoreController.js +0 -1
  17. package/lib/browser/LocalDatastoreController.react-native.js +0 -1
  18. package/lib/browser/OfflineQuery.js +0 -1
  19. package/lib/browser/Parse.js +12 -1
  20. package/lib/browser/ParseACL.js +1 -1
  21. package/lib/browser/ParseConfig.js +2 -4
  22. package/lib/browser/ParseInstallation.js +0 -1
  23. package/lib/browser/ParseLiveQuery.js +2 -2
  24. package/lib/browser/ParseObject.js +10 -10
  25. package/lib/browser/ParseQuery.js +26 -25
  26. package/lib/browser/ParseRole.js +1 -1
  27. package/lib/browser/ParseSchema.js +6 -6
  28. package/lib/browser/ParseUser.js +10 -12
  29. package/lib/browser/RESTController.js +7 -3
  30. package/lib/browser/Socket.weapp.js +0 -1
  31. package/lib/browser/Storage.js +0 -1
  32. package/lib/browser/StorageController.browser.js +0 -1
  33. package/lib/browser/StorageController.default.js +0 -1
  34. package/lib/browser/StorageController.js +0 -1
  35. package/lib/browser/StorageController.react-native.js +0 -1
  36. package/lib/browser/StorageController.weapp.js +0 -1
  37. package/lib/browser/TaskQueue.js +0 -1
  38. package/lib/browser/WebSocketController.js +0 -1
  39. package/lib/browser/Xhr.weapp.js +0 -1
  40. package/lib/browser/uuid.js +0 -1
  41. package/lib/node/Cloud.js +1 -0
  42. package/lib/node/CoreManager.js +2 -2
  43. package/lib/node/CryptoController.js +0 -1
  44. package/lib/node/EventEmitter.js +0 -1
  45. package/lib/node/EventuallyQueue.js +6 -7
  46. package/lib/node/IndexedDBStorageController.js +0 -1
  47. package/lib/node/InstallationController.js +0 -1
  48. package/lib/node/LiveQuerySubscription.js +4 -4
  49. package/lib/node/LocalDatastore.js +0 -1
  50. package/lib/node/LocalDatastoreController.default.js +0 -1
  51. package/lib/node/LocalDatastoreController.js +0 -1
  52. package/lib/node/LocalDatastoreController.react-native.js +0 -1
  53. package/lib/node/OfflineQuery.js +0 -1
  54. package/lib/node/Parse.js +12 -1
  55. package/lib/node/ParseACL.js +1 -1
  56. package/lib/node/ParseConfig.js +2 -2
  57. package/lib/node/ParseInstallation.js +0 -1
  58. package/lib/node/ParseLiveQuery.js +2 -2
  59. package/lib/node/ParseObject.js +10 -7
  60. package/lib/node/ParseQuery.js +7 -7
  61. package/lib/node/ParseRole.js +1 -1
  62. package/lib/node/ParseSchema.js +6 -4
  63. package/lib/node/ParseUser.js +10 -10
  64. package/lib/node/RESTController.js +3 -1
  65. package/lib/node/Socket.weapp.js +0 -1
  66. package/lib/node/Storage.js +0 -1
  67. package/lib/node/StorageController.browser.js +0 -1
  68. package/lib/node/StorageController.default.js +0 -1
  69. package/lib/node/StorageController.js +0 -1
  70. package/lib/node/StorageController.react-native.js +0 -1
  71. package/lib/node/StorageController.weapp.js +0 -1
  72. package/lib/node/TaskQueue.js +0 -1
  73. package/lib/node/WebSocketController.js +0 -1
  74. package/lib/node/Xhr.weapp.js +0 -1
  75. package/lib/node/uuid.js +0 -1
  76. package/lib/react-native/CoreManager.js +2 -2
  77. package/lib/react-native/CryptoController.js +0 -1
  78. package/lib/react-native/EventEmitter.js +0 -1
  79. package/lib/react-native/EventuallyQueue.js +5 -9
  80. package/lib/react-native/IndexedDBStorageController.js +0 -1
  81. package/lib/react-native/InstallationController.js +0 -1
  82. package/lib/react-native/LiveQuerySubscription.js +7 -7
  83. package/lib/react-native/LocalDatastore.js +0 -1
  84. package/lib/react-native/LocalDatastoreController.default.js +0 -1
  85. package/lib/react-native/LocalDatastoreController.js +0 -1
  86. package/lib/react-native/LocalDatastoreController.react-native.js +0 -1
  87. package/lib/react-native/OfflineQuery.js +0 -1
  88. package/lib/react-native/Parse.js +8 -1
  89. package/lib/react-native/ParseConfig.js +2 -4
  90. package/lib/react-native/ParseInstallation.js +0 -1
  91. package/lib/react-native/ParseLiveQuery.js +2 -2
  92. package/lib/react-native/ParseObject.js +16 -18
  93. package/lib/react-native/ParseQuery.js +5 -6
  94. package/lib/react-native/ParseSchema.js +5 -6
  95. package/lib/react-native/ParseUser.js +3 -5
  96. package/lib/react-native/RESTController.js +3 -1
  97. package/lib/react-native/Socket.weapp.js +0 -1
  98. package/lib/react-native/Storage.js +0 -1
  99. package/lib/react-native/StorageController.browser.js +0 -1
  100. package/lib/react-native/StorageController.default.js +0 -1
  101. package/lib/react-native/StorageController.js +0 -1
  102. package/lib/react-native/StorageController.react-native.js +0 -1
  103. package/lib/react-native/StorageController.weapp.js +0 -1
  104. package/lib/react-native/TaskQueue.js +0 -1
  105. package/lib/react-native/WebSocketController.js +0 -1
  106. package/lib/react-native/Xhr.weapp.js +0 -1
  107. package/lib/react-native/uuid.js +0 -1
  108. package/lib/weapp/Cloud.js +1 -0
  109. package/lib/weapp/CoreManager.js +2 -2
  110. package/lib/weapp/CryptoController.js +0 -1
  111. package/lib/weapp/EventEmitter.js +0 -1
  112. package/lib/weapp/EventuallyQueue.js +6 -10
  113. package/lib/weapp/IndexedDBStorageController.js +0 -1
  114. package/lib/weapp/InstallationController.js +0 -1
  115. package/lib/weapp/LiveQuerySubscription.js +4 -4
  116. package/lib/weapp/LocalDatastore.js +0 -1
  117. package/lib/weapp/LocalDatastoreController.default.js +0 -1
  118. package/lib/weapp/LocalDatastoreController.js +0 -1
  119. package/lib/weapp/LocalDatastoreController.react-native.js +0 -1
  120. package/lib/weapp/OfflineQuery.js +0 -1
  121. package/lib/weapp/Parse.js +12 -1
  122. package/lib/weapp/ParseACL.js +1 -1
  123. package/lib/weapp/ParseConfig.js +2 -4
  124. package/lib/weapp/ParseInstallation.js +0 -1
  125. package/lib/weapp/ParseLiveQuery.js +2 -2
  126. package/lib/weapp/ParseObject.js +10 -10
  127. package/lib/weapp/ParseQuery.js +26 -25
  128. package/lib/weapp/ParseRole.js +1 -1
  129. package/lib/weapp/ParseSchema.js +6 -6
  130. package/lib/weapp/ParseUser.js +10 -12
  131. package/lib/weapp/RESTController.js +7 -3
  132. package/lib/weapp/Socket.weapp.js +0 -1
  133. package/lib/weapp/Storage.js +0 -1
  134. package/lib/weapp/StorageController.browser.js +0 -1
  135. package/lib/weapp/StorageController.default.js +0 -1
  136. package/lib/weapp/StorageController.js +0 -1
  137. package/lib/weapp/StorageController.react-native.js +0 -1
  138. package/lib/weapp/StorageController.weapp.js +0 -1
  139. package/lib/weapp/TaskQueue.js +0 -1
  140. package/lib/weapp/WebSocketController.js +0 -1
  141. package/lib/weapp/Xhr.weapp.js +0 -1
  142. package/lib/weapp/uuid.js +0 -1
  143. package/package.json +15 -12
  144. package/types/Analytics.d.ts +42 -0
  145. package/types/AnonymousUtils.d.ts +84 -0
  146. package/types/Cloud.d.ts +65 -0
  147. package/types/CloudCode.d.ts +307 -0
  148. package/types/CoreManager.d.ts +325 -0
  149. package/types/CryptoController.d.ts +5 -0
  150. package/types/EventEmitter.d.ts +5 -0
  151. package/types/EventuallyQueue.d.ts +168 -0
  152. package/types/FacebookUtils.d.ts +107 -0
  153. package/types/IndexedDBStorageController.d.ts +2 -0
  154. package/types/InstallationController.d.ts +10 -0
  155. package/types/LiveQueryClient.d.ts +128 -0
  156. package/types/LiveQuerySubscription.d.ts +103 -0
  157. package/types/LocalDatastore.d.ts +56 -0
  158. package/types/LocalDatastoreController.d.ts +2 -0
  159. package/types/LocalDatastoreController.default.d.ts +9 -0
  160. package/types/LocalDatastoreController.react-native.d.ts +9 -0
  161. package/types/LocalDatastoreUtils.d.ts +5 -0
  162. package/types/ObjectStateMutations.d.ts +28 -0
  163. package/types/OfflineQuery.d.ts +20 -0
  164. package/types/Parse.d.ts +633 -0
  165. package/types/ParseACL.d.ts +141 -0
  166. package/types/ParseCLP.d.ts +293 -0
  167. package/types/ParseConfig.d.ts +77 -0
  168. package/types/ParseError.d.ts +476 -0
  169. package/types/ParseFile.d.ts +192 -0
  170. package/types/ParseGeoPoint.d.ts +104 -0
  171. package/types/ParseHooks.d.ts +27 -0
  172. package/types/ParseInstallation.d.ts +179 -0
  173. package/types/ParseLiveQuery.d.ts +48 -0
  174. package/types/ParseObject.d.ts +1072 -0
  175. package/types/ParseOp.d.ts +78 -0
  176. package/types/ParsePolygon.d.ts +69 -0
  177. package/types/ParseQuery.d.ts +961 -0
  178. package/types/ParseRelation.d.ts +56 -0
  179. package/types/ParseRole.d.ts +79 -0
  180. package/types/ParseSchema.d.ts +286 -0
  181. package/types/ParseSession.d.ts +45 -0
  182. package/types/ParseUser.d.ts +517 -0
  183. package/types/Push.d.ts +62 -0
  184. package/types/RESTController.d.ts +35 -0
  185. package/types/SingleInstanceStateController.d.ts +24 -0
  186. package/types/Socket.weapp.d.ts +10 -0
  187. package/types/Storage.d.ts +14 -0
  188. package/types/StorageController.browser.d.ts +9 -0
  189. package/types/StorageController.d.ts +2 -0
  190. package/types/StorageController.default.d.ts +9 -0
  191. package/types/StorageController.react-native.d.ts +11 -0
  192. package/types/StorageController.weapp.d.ts +9 -0
  193. package/types/TaskQueue.d.ts +11 -0
  194. package/types/UniqueInstanceStateController.d.ts +20 -0
  195. package/types/WebSocketController.d.ts +2 -0
  196. package/types/Xhr.weapp.d.ts +29 -0
  197. package/types/arrayContainsObject.d.ts +2 -0
  198. package/types/canBeSerialized.d.ts +2 -0
  199. package/types/decode.d.ts +1 -0
  200. package/types/encode.d.ts +1 -0
  201. package/types/equals.d.ts +1 -0
  202. package/types/escape.d.ts +1 -0
  203. package/types/index.d.ts +66 -0
  204. package/types/isRevocableSession.d.ts +1 -0
  205. package/types/node.d.ts +3 -0
  206. package/types/parseDate.d.ts +1 -0
  207. package/types/promiseUtils.d.ts +9 -0
  208. package/types/react-native.d.ts +3 -0
  209. package/types/tests.ts +2256 -0
  210. package/types/tsconfig.json +25 -0
  211. package/types/unique.d.ts +1 -0
  212. package/types/unsavedChildren.d.ts +11 -0
  213. package/types/uuid.d.ts +2 -0
@@ -12,9 +12,10 @@ var config = {
12
12
  SERVER_AUTH_TOKEN: null,
13
13
  LIVEQUERY_SERVER_URL: null,
14
14
  ENCRYPTED_KEY: null,
15
- VERSION: 'js' + "6.1.0-alpha.1",
15
+ VERSION: 'js' + "6.1.0-alpha.3",
16
16
  APPLICATION_ID: null,
17
17
  JAVASCRIPT_KEY: null,
18
+ MAINTENANCE_KEY: null,
18
19
  MASTER_KEY: null,
19
20
  USE_MASTER_KEY: false,
20
21
  PERFORM_USER_REWRITE: true,
@@ -245,5 +246,4 @@ var CoreManager = {
245
246
  return config['ParseUser'];
246
247
  }
247
248
  };
248
- module.exports = CoreManager;
249
249
  var _default = exports.default = CoreManager;
@@ -17,5 +17,4 @@ var CryptoController = {
17
17
  return decryptedStr;
18
18
  }
19
19
  };
20
- module.exports = CryptoController;
21
20
  var _default = exports.default = CryptoController;
@@ -10,5 +10,4 @@ try {
10
10
  }
11
11
  EventEmitter.prototype.on = EventEmitter.prototype.addListener;
12
12
  } catch (_) {}
13
- module.exports = EventEmitter;
14
13
  var _default = exports.default = EventEmitter;
@@ -15,12 +15,10 @@ var queueCache = [];
15
15
  var dirtyCache = true;
16
16
  var polling = undefined;
17
17
  var EventuallyQueue = {
18
- save: function (object) {
19
- var serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
18
+ save: function (object, serverOptions) {
20
19
  return this.enqueue('save', object, serverOptions);
21
20
  },
22
- destroy: function (object) {
23
- var serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21
+ destroy: function (object, serverOptions) {
24
22
  return this.enqueue('destroy', object, serverOptions);
25
23
  },
26
24
  generateQueueId: function (action, object) {
@@ -49,7 +47,7 @@ var EventuallyQueue = {
49
47
  queueId: queueId,
50
48
  action: action,
51
49
  object: object.toJSON(),
52
- serverOptions: serverOptions,
50
+ serverOptions: serverOptions || {},
53
51
  id: object.id,
54
52
  className: object.className,
55
53
  hash: object.get('hash'),
@@ -182,9 +180,8 @@ var EventuallyQueue = {
182
180
  }
183
181
  return sendQueueCallback;
184
182
  }(),
185
- poll: function () {
183
+ poll: function (ms) {
186
184
  var _this = this;
187
- var ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
188
185
  if (polling) {
189
186
  return;
190
187
  }
@@ -199,7 +196,7 @@ var EventuallyQueue = {
199
196
  }).catch(function (e) {
200
197
  return e;
201
198
  });
202
- }, ms);
199
+ }, ms || 2000);
203
200
  },
204
201
  stopPoll: function () {
205
202
  clearInterval(polling);
@@ -251,5 +248,4 @@ var EventuallyQueue = {
251
248
  }()
252
249
  }
253
250
  };
254
- module.exports = EventuallyQueue;
255
251
  var _default = exports.default = EventuallyQueue;
@@ -31,5 +31,4 @@ if (typeof window !== 'undefined' && window.indexedDB) {
31
31
  } else {
32
32
  IndexedDBStorageController = undefined;
33
33
  }
34
- module.exports = IndexedDBStorageController;
35
34
  var _default = exports.default = IndexedDBStorageController;
@@ -93,5 +93,4 @@ var InstallationController = {
93
93
  currentInstallationCacheMatchesDisk = matchesDisk;
94
94
  }
95
95
  };
96
- module.exports = InstallationController;
97
96
  var _default = exports.default = InstallationController;
@@ -7,18 +7,18 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
7
7
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
8
8
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
9
9
  var _promiseUtils = require("./promiseUtils");
10
- var Subscription = function () {
11
- function Subscription(id, query, sessionToken) {
10
+ var LiveQuerySubscription = function () {
11
+ function LiveQuerySubscription(id, query, sessionToken) {
12
12
  var _this = this;
13
- (0, _classCallCheck2.default)(this, Subscription);
13
+ (0, _classCallCheck2.default)(this, LiveQuerySubscription);
14
14
  this.id = id;
15
15
  this.query = query;
16
16
  this.sessionToken = sessionToken;
17
17
  this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
18
18
  this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
19
19
  this.subscribed = false;
20
- var EventEmitter = _CoreManager.default.getEventEmitter();
21
- this.emitter = new EventEmitter();
20
+ var Emitter = _CoreManager.default.getEventEmitter();
21
+ this.emitter = new Emitter();
22
22
  this.on = function (eventName, listener) {
23
23
  return _this.emitter.on(eventName, listener);
24
24
  };
@@ -31,7 +31,7 @@ var Subscription = function () {
31
31
  };
32
32
  this.on('error', function () {});
33
33
  }
34
- return (0, _createClass2.default)(Subscription, [{
34
+ return (0, _createClass2.default)(LiveQuerySubscription, [{
35
35
  key: "unsubscribe",
36
36
  value: function () {
37
37
  var _this2 = this;
@@ -42,4 +42,4 @@ var Subscription = function () {
42
42
  }
43
43
  }]);
44
44
  }();
45
- var _default = exports.default = Subscription;
45
+ var _default = exports.default = LiveQuerySubscription;
@@ -408,7 +408,6 @@ var LocalDatastore = {
408
408
  return this.isEnabled;
409
409
  }
410
410
  };
411
- module.exports = LocalDatastore;
412
411
  var _default = exports.default = LocalDatastore;
413
412
  _CoreManager.default.setLocalDatastoreController(_LocalDatastoreController.default);
414
413
  _CoreManager.default.setLocalDatastore(LocalDatastore);
@@ -92,5 +92,4 @@ var LocalDatastoreController = {
92
92
  return clear;
93
93
  }()
94
94
  };
95
- module.exports = LocalDatastoreController;
96
95
  var _default = exports.default = LocalDatastoreController;
@@ -7,5 +7,4 @@ var _LocalDatastoreController = _interopRequireDefault(require("./LocalDatastore
7
7
  var _LocalDatastoreController2 = _interopRequireDefault(require("./LocalDatastoreController.default"));
8
8
  var LocalDatastoreController = _LocalDatastoreController2.default;
9
9
  LocalDatastoreController = _LocalDatastoreController.default;
10
- module.exports = LocalDatastoreController;
11
10
  var _default = exports.default = LocalDatastoreController;
@@ -112,5 +112,4 @@ var LocalDatastoreController = {
112
112
  return clear;
113
113
  }()
114
114
  };
115
- module.exports = LocalDatastoreController;
116
115
  var _default = exports.default = LocalDatastoreController;
@@ -472,5 +472,4 @@ var OfflineQuery = {
472
472
  matchesQuery: matchesQuery,
473
473
  validateQuery: validateQuery
474
474
  };
475
- module.exports = OfflineQuery;
476
475
  var _default = exports.default = OfflineQuery;
@@ -112,9 +112,10 @@ var Parse = {
112
112
  initialize: function (applicationId, javaScriptKey) {
113
113
  Parse._initialize(applicationId, javaScriptKey);
114
114
  },
115
- _initialize: function (applicationId, javaScriptKey, masterKey) {
115
+ _initialize: function (applicationId, javaScriptKey, masterKey, maintenanceKey) {
116
116
  _CoreManager.default.set('APPLICATION_ID', applicationId);
117
117
  _CoreManager.default.set('JAVASCRIPT_KEY', javaScriptKey);
118
+ _CoreManager.default.set('MAINTENANCE_KEY', maintenanceKey);
118
119
  _CoreManager.default.set('MASTER_KEY', masterKey);
119
120
  _CoreManager.default.set('USE_MASTER_KEY', false);
120
121
  _CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
@@ -153,6 +154,12 @@ var Parse = {
153
154
  get masterKey() {
154
155
  return _CoreManager.default.get('MASTER_KEY');
155
156
  },
157
+ set maintenanceKey(value) {
158
+ _CoreManager.default.set('MAINTENANCE_KEY', value);
159
+ },
160
+ get maintenanceKey() {
161
+ return _CoreManager.default.get('MAINTENANCE_KEY');
162
+ },
156
163
  set serverURL(value) {
157
164
  _CoreManager.default.set('SERVER_URL', value);
158
165
  },
@@ -45,8 +45,7 @@ var ParseConfig = function () {
45
45
  }
46
46
  }, {
47
47
  key: "get",
48
- value: function () {
49
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
48
+ value: function (options) {
50
49
  var controller = _CoreManager.default.getConfigController();
51
50
  return controller.get(options);
52
51
  }
@@ -110,8 +109,7 @@ var DefaultController = {
110
109
  return config;
111
110
  });
112
111
  },
113
- get: function () {
114
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
112
+ get: function (options) {
115
113
  var RESTController = _CoreManager.default.getRESTController();
116
114
  return RESTController.request('GET', 'config', {}, options).then(function (response) {
117
115
  if (!response || !response.params) {
@@ -194,5 +194,4 @@ var ParseInstallation = function (_ParseObject) {
194
194
  }]);
195
195
  }(_ParseObject2.default);
196
196
  _ParseObject2.default.registerSubclass('_Installation', ParseInstallation);
197
- module.exports = ParseInstallation;
198
197
  var _default = exports.default = ParseInstallation;
@@ -16,8 +16,8 @@ var LiveQuery = function () {
16
16
  function LiveQuery() {
17
17
  var _this = this;
18
18
  (0, _classCallCheck2.default)(this, LiveQuery);
19
- var EventEmitter = _CoreManager.default.getEventEmitter();
20
- this.emitter = new EventEmitter();
19
+ var Emitter = _CoreManager.default.getEventEmitter();
20
+ this.emitter = new Emitter();
21
21
  this.on = function (eventName, listener) {
22
22
  return _this.emitter.on(eventName, listener);
23
23
  };
@@ -740,9 +740,9 @@ var ParseObject = function () {
740
740
  if (Object.hasOwn(attrs, 'ACL') && !(attrs.ACL instanceof _ParseACL.default)) {
741
741
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
742
742
  }
743
- for (var key in attrs) {
744
- if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(key)) {
745
- return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: ${key}`);
743
+ for (var _key in attrs) {
744
+ if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(_key)) {
745
+ return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: ${_key}`);
746
746
  }
747
747
  }
748
748
  return false;
@@ -765,14 +765,14 @@ var ParseObject = function () {
765
765
  key: "revert",
766
766
  value: function () {
767
767
  var keysToRevert;
768
- for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
769
- keys[_key] = arguments[_key];
768
+ for (var _len = arguments.length, keys = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
769
+ keys[_key2] = arguments[_key2];
770
770
  }
771
771
  if (keys.length) {
772
772
  keysToRevert = [];
773
- for (var key of keys) {
774
- if (typeof key === 'string') {
775
- keysToRevert.push(key);
773
+ for (var _key3 of keys) {
774
+ if (typeof _key3 === 'string') {
775
+ keysToRevert.push(_key3);
776
776
  } else {
777
777
  throw new Error('Parse.Object#revert expects either no, or a list of string, arguments.');
778
778
  }
@@ -835,7 +835,6 @@ var ParseObject = function () {
835
835
  key: "save",
836
836
  value: function () {
837
837
  var _save = (0, _asyncToGenerator2.default)(function* (arg1, arg2, arg3) {
838
- var _this = this;
839
838
  var attrs;
840
839
  var options;
841
840
  if (typeof arg1 === 'object' || typeof arg1 === 'undefined') {
@@ -871,9 +870,8 @@ var ParseObject = function () {
871
870
  return savedOjbects.pop();
872
871
  });
873
872
  }
874
- return controller.save(unsaved, saveOptions).then(function () {
875
- return controller.save(_this, saveOptions);
876
- });
873
+ yield controller.save(unsaved, saveOptions);
874
+ return controller.save(this, saveOptions);
877
875
  });
878
876
  function save() {
879
877
  return _save.apply(this, arguments);
@@ -981,6 +979,9 @@ var ParseObject = function () {
981
979
  if (hasOwn(options, 'useMasterKey')) {
982
980
  requestOptions.useMasterKey = !!options.useMasterKey;
983
981
  }
982
+ if (hasOwn(options, 'useMaintenanceKey')) {
983
+ requestOptions.useMaintenanceKey = !!options.useMaintenanceKey;
984
+ }
984
985
  if (hasOwn(options, 'sessionToken') && typeof options.sessionToken === 'string') {
985
986
  requestOptions.sessionToken = options.sessionToken;
986
987
  }
@@ -1015,8 +1016,7 @@ var ParseObject = function () {
1015
1016
  }
1016
1017
  }, {
1017
1018
  key: "fetchAll",
1018
- value: function (list) {
1019
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1019
+ value: function (list, options) {
1020
1020
  var fetchOptions = ParseObject._getRequestOptions(options);
1021
1021
  return _CoreManager.default.getObjectController().fetch(list, true, fetchOptions);
1022
1022
  }
@@ -1059,15 +1059,13 @@ var ParseObject = function () {
1059
1059
  }
1060
1060
  }, {
1061
1061
  key: "destroyAll",
1062
- value: function (list) {
1063
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1062
+ value: function (list, options) {
1064
1063
  var destroyOptions = ParseObject._getRequestOptions(options);
1065
1064
  return _CoreManager.default.getObjectController().destroy(list, destroyOptions);
1066
1065
  }
1067
1066
  }, {
1068
1067
  key: "saveAll",
1069
- value: function (list) {
1070
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1068
+ value: function (list, options) {
1071
1069
  var saveOptions = ParseObject._getRequestOptions(options);
1072
1070
  return _CoreManager.default.getObjectController().save(list, saveOptions);
1073
1071
  }
@@ -734,13 +734,13 @@ var ParseQuery = function () {
734
734
  }
735
735
  }, {
736
736
  key: "containedIn",
737
- value: function (key, value) {
738
- return this._addCondition(key, '$in', value);
737
+ value: function (key, values) {
738
+ return this._addCondition(key, '$in', values);
739
739
  }
740
740
  }, {
741
741
  key: "notContainedIn",
742
- value: function (key, value) {
743
- return this._addCondition(key, '$nin', value);
742
+ value: function (key, values) {
743
+ return this._addCondition(key, '$nin', values);
744
744
  }
745
745
  }, {
746
746
  key: "containedBy",
@@ -840,8 +840,7 @@ var ParseQuery = function () {
840
840
  }
841
841
  }, {
842
842
  key: "fullText",
843
- value: function (key, value) {
844
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
843
+ value: function (key, value, options) {
845
844
  options = options || {};
846
845
  if (!key) {
847
846
  throw new Error('A key is required.');
@@ -95,9 +95,9 @@ var ParseSchema = function () {
95
95
  }
96
96
  }, {
97
97
  key: "addField",
98
- value: function (name, type) {
99
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
98
+ value: function (name, type, options) {
100
99
  type = type || 'String';
100
+ options = options || {};
101
101
  if (!name) {
102
102
  throw new Error('field name may not be null.');
103
103
  }
@@ -202,8 +202,7 @@ var ParseSchema = function () {
202
202
  }
203
203
  }, {
204
204
  key: "addPointer",
205
- value: function (name, targetClass) {
206
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
205
+ value: function (name, targetClass, options) {
207
206
  if (!name) {
208
207
  throw new Error('field name may not be null.');
209
208
  }
@@ -214,10 +213,10 @@ var ParseSchema = function () {
214
213
  type: 'Pointer',
215
214
  targetClass: targetClass
216
215
  };
217
- if (typeof options.required === 'boolean') {
216
+ if (typeof (options == null ? void 0 : options.required) === 'boolean') {
218
217
  fieldOptions.required = options.required;
219
218
  }
220
- if (options.defaultValue !== undefined) {
219
+ if ((options == null ? void 0 : options.defaultValue) !== undefined) {
221
220
  fieldOptions.defaultValue = options.defaultValue;
222
221
  if (options.defaultValue instanceof _ParseObject.default) {
223
222
  fieldOptions.defaultValue = options.defaultValue.toPointer();
@@ -533,8 +533,7 @@ var ParseUser = function (_ParseObject) {
533
533
  }
534
534
  }, {
535
535
  key: "me",
536
- value: function (sessionToken) {
537
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
536
+ value: function (sessionToken, options) {
538
537
  var controller = _CoreManager.default.getUserController();
539
538
  var meOptions = _ParseObject2.default._getRequestOptions(options);
540
539
  meOptions.sessionToken = sessionToken;
@@ -556,8 +555,7 @@ var ParseUser = function (_ParseObject) {
556
555
  }
557
556
  }, {
558
557
  key: "logOut",
559
- value: function () {
560
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
558
+ value: function (options) {
561
559
  var controller = _CoreManager.default.getUserController();
562
560
  return controller.logOut(options);
563
561
  }
@@ -832,7 +830,7 @@ var DefaultController = {
832
830
  },
833
831
  logOut: function (options) {
834
832
  var RESTController = _CoreManager.default.getRESTController();
835
- if (options.sessionToken) {
833
+ if (options != null && options.sessionToken) {
836
834
  return RESTController.request('POST', 'logout', {}, options);
837
835
  }
838
836
  return DefaultController.currentUserAsync().then(function (currentUser) {
@@ -209,6 +209,9 @@ var RESTController = {
209
209
  throw new Error('Cannot use the Master Key, it has not been provided.');
210
210
  }
211
211
  }
212
+ if (options.useMaintenanceKey) {
213
+ payload._MaintenanceKey = _CoreManager.default.get('MAINTENANCE_KEY');
214
+ }
212
215
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
213
216
  payload._RevocableSession = '1';
214
217
  }
@@ -278,5 +281,4 @@ var RESTController = {
278
281
  return XHR;
279
282
  }
280
283
  };
281
- module.exports = RESTController;
282
284
  var _default = exports.default = RESTController;
@@ -43,5 +43,4 @@ var SocketWeapp = function () {
43
43
  }
44
44
  }]);
45
45
  }();
46
- module.exports = SocketWeapp;
47
46
  var _default = exports.default = SocketWeapp;
@@ -84,5 +84,4 @@ var Storage = {
84
84
  }
85
85
  }
86
86
  };
87
- module.exports = Storage;
88
87
  var _default = exports.default = Storage;
@@ -28,5 +28,4 @@ var StorageController = {
28
28
  localStorage.clear();
29
29
  }
30
30
  };
31
- module.exports = StorageController;
32
31
  var _default = exports.default = StorageController;
@@ -28,5 +28,4 @@ var StorageController = {
28
28
  }
29
29
  }
30
30
  };
31
- module.exports = StorageController;
32
31
  var _default = exports.default = StorageController;
@@ -9,5 +9,4 @@ var _StorageController3 = _interopRequireDefault(require("./StorageController.we
9
9
  var _StorageController4 = _interopRequireDefault(require("./StorageController.default"));
10
10
  var StorageController = _StorageController4.default;
11
11
  StorageController = _StorageController.default;
12
- module.exports = StorageController;
13
12
  var _default = exports.default = StorageController;
@@ -76,5 +76,4 @@ var StorageController = {
76
76
  return _CoreManager.default.getAsyncStorage().clear();
77
77
  }
78
78
  };
79
- module.exports = StorageController;
80
79
  var _default = exports.default = StorageController;
@@ -23,5 +23,4 @@ var StorageController = {
23
23
  wx.clearStorageSync();
24
24
  }
25
25
  };
26
- module.exports = StorageController;
27
26
  var _default = exports.default = StorageController;
@@ -49,5 +49,4 @@ var TaskQueue = function () {
49
49
  }
50
50
  }]);
51
51
  }();
52
- module.exports = TaskQueue;
53
52
  var _default = exports.default = TaskQueue;
@@ -9,5 +9,4 @@ var WebSocketController;
9
9
  try {
10
10
  WebSocketController = WebSocket;
11
11
  } catch (_) {}
12
- module.exports = WebSocketController;
13
12
  var _default = exports.default = WebSocketController;
@@ -99,5 +99,4 @@ var XhrWeapp = function () {
99
99
  }
100
100
  }]);
101
101
  }();
102
- module.exports = XhrWeapp;
103
102
  var _default = exports.default = XhrWeapp;
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  exports.default = void 0;
5
5
  var _uuid = require("uuid");
6
6
  var uuid = _uuid.v4;
7
- module.exports = uuid;
8
7
  var _default = exports.default = uuid;
@@ -48,6 +48,7 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
48
48
  * @returns {Promise} A promise that will be resolved with the result
49
49
  * of the function.
50
50
  */
51
+
51
52
  function run(name, data, options) {
52
53
  if (typeof name !== 'string' || name.length === 0) {
53
54
  throw new TypeError('Cloud function name must be a string.');
@@ -19,9 +19,10 @@ const config = {
19
19
  SERVER_AUTH_TOKEN: null,
20
20
  LIVEQUERY_SERVER_URL: null,
21
21
  ENCRYPTED_KEY: null,
22
- VERSION: 'js' + "6.1.0-alpha.1",
22
+ VERSION: 'js' + "6.1.0-alpha.3",
23
23
  APPLICATION_ID: null,
24
24
  JAVASCRIPT_KEY: null,
25
+ MAINTENANCE_KEY: null,
25
26
  MASTER_KEY: null,
26
27
  USE_MASTER_KEY: false,
27
28
  PERFORM_USER_REWRITE: true,
@@ -254,5 +255,4 @@ const CoreManager = {
254
255
  return config['ParseUser'];
255
256
  }
256
257
  };
257
- module.exports = CoreManager;
258
258
  var _default = exports.default = CoreManager;
@@ -21,5 +21,4 @@ const CryptoController = {
21
21
  return decryptedStr;
22
22
  }
23
23
  };
24
- module.exports = CryptoController;
25
24
  var _default = exports.default = CryptoController;
@@ -15,5 +15,4 @@ try {
15
15
  } catch (_) {
16
16
  // EventEmitter unavailable
17
17
  }
18
- module.exports = EventEmitter;
19
18
  var _default = exports.default = EventEmitter;
@@ -40,8 +40,7 @@ const EventuallyQueue = {
40
40
  * @static
41
41
  * @see Parse.Object#saveEventually
42
42
  */
43
- save(object) {
44
- let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
43
+ save(object, serverOptions) {
45
44
  return this.enqueue('save', object, serverOptions);
46
45
  },
47
46
  /**
@@ -55,8 +54,7 @@ const EventuallyQueue = {
55
54
  * @static
56
55
  * @see Parse.Object#destroyEventually
57
56
  */
58
- destroy(object) {
59
- let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
57
+ destroy(object, serverOptions) {
60
58
  return this.enqueue('destroy', object, serverOptions);
61
59
  },
62
60
  /**
@@ -106,7 +104,7 @@ const EventuallyQueue = {
106
104
  queueId,
107
105
  action,
108
106
  object: object.toJSON(),
109
- serverOptions,
107
+ serverOptions: serverOptions || {},
110
108
  id: object.id,
111
109
  className: object.className,
112
110
  hash: object.get('hash'),
@@ -125,7 +123,7 @@ const EventuallyQueue = {
125
123
  *
126
124
  * @function getQueue
127
125
  * @name Parse.EventuallyQueue.getQueue
128
- * @returns {Promise<QueueObject[]>}
126
+ * @returns {Promise<Queue>}
129
127
  * @static
130
128
  */
131
129
  async getQueue() {
@@ -280,8 +278,7 @@ const EventuallyQueue = {
280
278
  * @param [ms] Milliseconds to ping the server. Default 2000ms
281
279
  * @static
282
280
  */
283
- poll() {
284
- let ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
281
+ poll(ms) {
285
282
  if (polling) {
286
283
  return;
287
284
  }
@@ -296,7 +293,7 @@ const EventuallyQueue = {
296
293
  return this.sendQueue();
297
294
  }
298
295
  }).catch(e => e);
299
- }, ms);
296
+ }, ms || 2000);
300
297
  },
301
298
  /**
302
299
  * Turns off polling.
@@ -355,5 +352,4 @@ const EventuallyQueue = {
355
352
  }
356
353
  }
357
354
  };
358
- module.exports = EventuallyQueue;
359
355
  var _default = exports.default = EventuallyQueue;
@@ -39,5 +39,4 @@ if (typeof window !== 'undefined' && window.indexedDB) {
39
39
  // IndexedDB not supported
40
40
  IndexedDBStorageController = undefined;
41
41
  }
42
- module.exports = IndexedDBStorageController;
43
42
  var _default = exports.default = IndexedDBStorageController;
@@ -78,5 +78,4 @@ const InstallationController = {
78
78
  currentInstallationCacheMatchesDisk = matchesDisk;
79
79
  }
80
80
  };
81
- module.exports = InstallationController;
82
81
  var _default = exports.default = InstallationController;