parse 6.0.0 → 6.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +0 -1
  2. package/dist/parse.js +70 -62
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +70 -62
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/Cloud.js +1 -0
  7. package/lib/browser/CoreManager.js +2 -1
  8. package/lib/browser/EventuallyQueue.js +6 -9
  9. package/lib/browser/LiveQuerySubscription.js +4 -4
  10. package/lib/browser/Parse.js +12 -1
  11. package/lib/browser/ParseACL.js +1 -1
  12. package/lib/browser/ParseConfig.js +2 -4
  13. package/lib/browser/ParseLiveQuery.js +2 -2
  14. package/lib/browser/ParseObject.js +12 -12
  15. package/lib/browser/ParseQuery.js +7 -8
  16. package/lib/browser/ParseRole.js +1 -1
  17. package/lib/browser/ParseSchema.js +6 -6
  18. package/lib/browser/ParseUser.js +10 -12
  19. package/lib/browser/RESTController.js +3 -0
  20. package/lib/node/Cloud.js +1 -0
  21. package/lib/node/CoreManager.js +2 -1
  22. package/lib/node/EventuallyQueue.js +6 -6
  23. package/lib/node/LiveQuerySubscription.js +4 -4
  24. package/lib/node/Parse.js +12 -1
  25. package/lib/node/ParseACL.js +1 -1
  26. package/lib/node/ParseConfig.js +2 -2
  27. package/lib/node/ParseLiveQuery.js +2 -2
  28. package/lib/node/ParseObject.js +12 -9
  29. package/lib/node/ParseQuery.js +7 -7
  30. package/lib/node/ParseRole.js +1 -1
  31. package/lib/node/ParseSchema.js +6 -4
  32. package/lib/node/ParseUser.js +10 -10
  33. package/lib/node/RESTController.js +3 -0
  34. package/lib/react-native/CoreManager.js +2 -1
  35. package/lib/react-native/EventuallyQueue.js +5 -8
  36. package/lib/react-native/LiveQuerySubscription.js +7 -7
  37. package/lib/react-native/Parse.js +8 -1
  38. package/lib/react-native/ParseConfig.js +2 -4
  39. package/lib/react-native/ParseLiveQuery.js +2 -2
  40. package/lib/react-native/ParseObject.js +16 -18
  41. package/lib/react-native/ParseQuery.js +5 -6
  42. package/lib/react-native/ParseSchema.js +5 -6
  43. package/lib/react-native/ParseUser.js +3 -5
  44. package/lib/react-native/RESTController.js +3 -0
  45. package/lib/weapp/Cloud.js +1 -0
  46. package/lib/weapp/CoreManager.js +2 -1
  47. package/lib/weapp/EventuallyQueue.js +6 -9
  48. package/lib/weapp/LiveQuerySubscription.js +4 -4
  49. package/lib/weapp/Parse.js +12 -1
  50. package/lib/weapp/ParseACL.js +1 -1
  51. package/lib/weapp/ParseConfig.js +2 -4
  52. package/lib/weapp/ParseLiveQuery.js +2 -2
  53. package/lib/weapp/ParseObject.js +12 -12
  54. package/lib/weapp/ParseQuery.js +7 -8
  55. package/lib/weapp/ParseRole.js +1 -1
  56. package/lib/weapp/ParseSchema.js +6 -6
  57. package/lib/weapp/ParseUser.js +10 -12
  58. package/lib/weapp/RESTController.js +3 -0
  59. package/package.json +8 -6
package/README.md CHANGED
@@ -11,7 +11,6 @@
11
11
  [![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
12
12
 
13
13
  [![npm latest version](https://img.shields.io/npm/v/parse/latest.svg)](https://www.npmjs.com/package/parse)
14
- [![npm beta version](https://img.shields.io/npm/v/parse/beta.svg)](https://www.npmjs.com/package/parse)
15
14
  [![npm alpha version](https://img.shields.io/npm/v/parse/alpha.svg)](https://www.npmjs.com/package/parse)
16
15
 
17
16
  [![Backers on Open Collective](https://opencollective.com/parse-server/backers/badge.svg)][open-collective-link]
package/dist/parse.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v6.0.0
2
+ * Parse JavaScript SDK v6.1.0-alpha.2
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -247,6 +247,7 @@ var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
247
247
  * @returns {Promise} A promise that will be resolved with the result
248
248
  * of the function.
249
249
  */
250
+
250
251
  function run(name, data, options) {
251
252
  if (typeof name !== 'string' || name.length === 0) {
252
253
  throw new TypeError('Cloud function name must be a string.');
@@ -354,9 +355,10 @@ const config = {
354
355
  SERVER_AUTH_TOKEN: null,
355
356
  LIVEQUERY_SERVER_URL: null,
356
357
  ENCRYPTED_KEY: null,
357
- VERSION: 'js' + "6.0.0",
358
+ VERSION: 'js' + "6.1.0-alpha.2",
358
359
  APPLICATION_ID: null,
359
360
  JAVASCRIPT_KEY: null,
361
+ MAINTENANCE_KEY: null,
360
362
  MASTER_KEY: null,
361
363
  USE_MASTER_KEY: false,
362
364
  PERFORM_USER_REWRITE: true,
@@ -681,8 +683,7 @@ const EventuallyQueue = {
681
683
  * @static
682
684
  * @see Parse.Object#saveEventually
683
685
  */
684
- save(object) {
685
- let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
686
+ save(object, serverOptions) {
686
687
  return this.enqueue('save', object, serverOptions);
687
688
  },
688
689
  /**
@@ -696,8 +697,7 @@ const EventuallyQueue = {
696
697
  * @static
697
698
  * @see Parse.Object#destroyEventually
698
699
  */
699
- destroy(object) {
700
- let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
700
+ destroy(object, serverOptions) {
701
701
  return this.enqueue('destroy', object, serverOptions);
702
702
  },
703
703
  /**
@@ -747,7 +747,7 @@ const EventuallyQueue = {
747
747
  queueId,
748
748
  action,
749
749
  object: object.toJSON(),
750
- serverOptions,
750
+ serverOptions: serverOptions || {},
751
751
  id: object.id,
752
752
  className: object.className,
753
753
  hash: object.get('hash'),
@@ -766,7 +766,7 @@ const EventuallyQueue = {
766
766
  *
767
767
  * @function getQueue
768
768
  * @name Parse.EventuallyQueue.getQueue
769
- * @returns {Promise<QueueObject[]>}
769
+ * @returns {Promise<Queue>}
770
770
  * @static
771
771
  */
772
772
  async getQueue() {
@@ -921,8 +921,7 @@ const EventuallyQueue = {
921
921
  * @param [ms] Milliseconds to ping the server. Default 2000ms
922
922
  * @static
923
923
  */
924
- poll() {
925
- let ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
924
+ poll(ms) {
926
925
  if (polling) {
927
926
  return;
928
927
  }
@@ -937,7 +936,7 @@ const EventuallyQueue = {
937
936
  return this.sendQueue();
938
937
  }
939
938
  }).catch(e => e);
940
- }, ms);
939
+ }, ms || 2000);
941
940
  },
942
941
  /**
943
942
  * Turns off polling.
@@ -1951,7 +1950,7 @@ var _promiseUtils = _dereq_("./promiseUtils");
1951
1950
  *
1952
1951
  * });</pre></p>
1953
1952
  */
1954
- class Subscription {
1953
+ class LiveQuerySubscription {
1955
1954
  /*
1956
1955
  * @param {string | number} id - subscription id
1957
1956
  * @param {string} query - query to subscribe to
@@ -1974,8 +1973,8 @@ class Subscription {
1974
1973
  this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
1975
1974
  this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
1976
1975
  this.subscribed = false;
1977
- const EventEmitter = _CoreManager.default.getEventEmitter();
1978
- this.emitter = new EventEmitter();
1976
+ const Emitter = _CoreManager.default.getEventEmitter();
1977
+ this.emitter = new Emitter();
1979
1978
  this.on = (eventName, listener) => this.emitter.on(eventName, listener);
1980
1979
  this.emit = function (eventName) {
1981
1980
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -2000,7 +1999,7 @@ class Subscription {
2000
1999
  });
2001
2000
  }
2002
2001
  }
2003
- var _default = exports.default = Subscription;
2002
+ var _default = exports.default = LiveQuerySubscription;
2004
2003
  },{"./CoreManager":4,"./promiseUtils":61,"@babel/runtime-corejs3/core-js-stable/object/define-property":91,"@babel/runtime-corejs3/helpers/defineProperty":103,"@babel/runtime-corejs3/helpers/interopRequireDefault":104}],13:[function(_dereq_,module,exports){
2005
2004
  "use strict";
2006
2005
 
@@ -3446,9 +3445,10 @@ const Parse = {
3446
3445
  }
3447
3446
  Parse._initialize(applicationId, javaScriptKey);
3448
3447
  },
3449
- _initialize(applicationId, javaScriptKey, masterKey) {
3448
+ _initialize(applicationId, javaScriptKey, masterKey, maintenanceKey) {
3450
3449
  _CoreManager.default.set('APPLICATION_ID', applicationId);
3451
3450
  _CoreManager.default.set('JAVASCRIPT_KEY', javaScriptKey);
3451
+ _CoreManager.default.set('MAINTENANCE_KEY', maintenanceKey);
3452
3452
  _CoreManager.default.set('MASTER_KEY', masterKey);
3453
3453
  _CoreManager.default.set('USE_MASTER_KEY', false);
3454
3454
  _CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
@@ -3521,6 +3521,16 @@ const Parse = {
3521
3521
  get masterKey() {
3522
3522
  return _CoreManager.default.get('MASTER_KEY');
3523
3523
  },
3524
+ /**
3525
+ * @member {string} Parse.maintenanceKey
3526
+ * @static
3527
+ */
3528
+ set maintenanceKey(value) {
3529
+ _CoreManager.default.set('MAINTENANCE_KEY', value);
3530
+ },
3531
+ get maintenanceKey() {
3532
+ return _CoreManager.default.get('MAINTENANCE_KEY');
3533
+ },
3524
3534
  /**
3525
3535
  * @member {string} Parse.serverURL
3526
3536
  * @static
@@ -3735,7 +3745,7 @@ const PUBLIC_KEY = '*';
3735
3745
  */
3736
3746
  class ParseACL {
3737
3747
  /**
3738
- * @param {(Parse.User | object)} arg1 The user to initialize the ACL for
3748
+ * @param {(Parse.User | object | null)} arg1 The user to initialize the ACL for
3739
3749
  */
3740
3750
  constructor(arg1) {
3741
3751
  (0, _defineProperty2.default)(this, "permissionsById", void 0);
@@ -4695,8 +4705,7 @@ class ParseConfig {
4695
4705
  * @returns {Promise} A promise that is resolved with a newly-created
4696
4706
  * configuration object when the get completes.
4697
4707
  */
4698
- static get() {
4699
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4708
+ static get(options) {
4700
4709
  const controller = _CoreManager.default.getConfigController();
4701
4710
  return controller.get(options);
4702
4711
  }
@@ -4777,8 +4786,7 @@ const DefaultController = {
4777
4786
  return config;
4778
4787
  });
4779
4788
  },
4780
- get() {
4781
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4789
+ get(options) {
4782
4790
  const RESTController = _CoreManager.default.getRESTController();
4783
4791
  return RESTController.request('GET', 'config', {}, options).then(response => {
4784
4792
  if (!response || !response.params) {
@@ -6529,8 +6537,8 @@ class LiveQuery {
6529
6537
  (0, _defineProperty2.default)(this, "emitter", void 0);
6530
6538
  (0, _defineProperty2.default)(this, "on", void 0);
6531
6539
  (0, _defineProperty2.default)(this, "emit", void 0);
6532
- const EventEmitter = _CoreManager.default.getEventEmitter();
6533
- this.emitter = new EventEmitter();
6540
+ const Emitter = _CoreManager.default.getEventEmitter();
6541
+ this.emitter = new Emitter();
6534
6542
  this.on = (eventName, listener) => this.emitter.on(eventName, listener);
6535
6543
  this.emit = function (eventName) {
6536
6544
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -6834,7 +6842,7 @@ class ParseObject {
6834
6842
  id = this._getId();
6835
6843
  }
6836
6844
  return {
6837
- id: id,
6845
+ id,
6838
6846
  className: this.className
6839
6847
  };
6840
6848
  } else {
@@ -7060,6 +7068,9 @@ class ParseObject {
7060
7068
  if (hasOwn(options, 'useMasterKey')) {
7061
7069
  requestOptions.useMasterKey = !!options.useMasterKey;
7062
7070
  }
7071
+ if (hasOwn(options, 'useMaintenanceKey')) {
7072
+ requestOptions.useMaintenanceKey = !!options.useMaintenanceKey;
7073
+ }
7063
7074
  if (hasOwn(options, 'sessionToken') && typeof options.sessionToken === 'string') {
7064
7075
  requestOptions.sessionToken = options.sessionToken;
7065
7076
  }
@@ -7670,8 +7681,8 @@ class ParseObject {
7670
7681
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
7671
7682
  }
7672
7683
  for (const key in attrs) {
7673
- if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(key)) {
7674
- return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: "${key}"`);
7684
+ if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(key)) {
7685
+ return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: ${key}`);
7675
7686
  }
7676
7687
  }
7677
7688
  return false;
@@ -7894,6 +7905,7 @@ class ParseObject {
7894
7905
  * @returns {Promise} A promise that is fulfilled when the save
7895
7906
  * completes.
7896
7907
  */
7908
+
7897
7909
  async save(arg1, arg2, arg3) {
7898
7910
  let attrs;
7899
7911
  let options;
@@ -7924,9 +7936,8 @@ class ParseObject {
7924
7936
  const filePromise = unsavedFiles.length ? controller.save(unsavedFiles, saveOptions) : _promise.default.resolve();
7925
7937
  return filePromise.then(() => controller.save(unsavedObjects, saveOptions)).then(savedOjbects => savedOjbects.pop());
7926
7938
  }
7927
- return controller.save(unsaved, saveOptions).then(() => {
7928
- return controller.save(this, saveOptions);
7929
- });
7939
+ await controller.save(unsaved, saveOptions);
7940
+ return controller.save(this, saveOptions);
7930
7941
  }
7931
7942
 
7932
7943
  /**
@@ -8132,8 +8143,7 @@ class ParseObject {
8132
8143
  * @static
8133
8144
  * @returns {Parse.Object[]}
8134
8145
  */
8135
- static fetchAll(list) {
8136
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8146
+ static fetchAll(list, options) {
8137
8147
  const fetchOptions = ParseObject._getRequestOptions(options);
8138
8148
  return _CoreManager.default.getObjectController().fetch(list, true, fetchOptions);
8139
8149
  }
@@ -8312,8 +8322,7 @@ class ParseObject {
8312
8322
  * @returns {Promise} A promise that is fulfilled when the destroyAll
8313
8323
  * completes.
8314
8324
  */
8315
- static destroyAll(list) {
8316
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8325
+ static destroyAll(list, options) {
8317
8326
  const destroyOptions = ParseObject._getRequestOptions(options);
8318
8327
  return _CoreManager.default.getObjectController().destroy(list, destroyOptions);
8319
8328
  }
@@ -8347,8 +8356,7 @@ class ParseObject {
8347
8356
  * @static
8348
8357
  * @returns {Parse.Object[]}
8349
8358
  */
8350
- static saveAll(list) {
8351
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8359
+ static saveAll(list, options) {
8352
8360
  const saveOptions = ParseObject._getRequestOptions(options);
8353
8361
  return _CoreManager.default.getObjectController().save(list, saveOptions);
8354
8362
  }
@@ -10808,11 +10816,11 @@ class ParseQuery {
10808
10816
  * be contained in the provided list of values.
10809
10817
  *
10810
10818
  * @param {string} key The key to check.
10811
- * @param {Array<*>} value The values that will match.
10819
+ * @param {Array<*>} values The values that will match.
10812
10820
  * @returns {Parse.Query} Returns the query, so you can chain this call.
10813
10821
  */
10814
- containedIn(key, value) {
10815
- return this._addCondition(key, '$in', value);
10822
+ containedIn(key, values) {
10823
+ return this._addCondition(key, '$in', values);
10816
10824
  }
10817
10825
 
10818
10826
  /**
@@ -10820,11 +10828,11 @@ class ParseQuery {
10820
10828
  * not be contained in the provided list of values.
10821
10829
  *
10822
10830
  * @param {string} key The key to check.
10823
- * @param {Array<*>} value The values that will not match.
10831
+ * @param {Array<*>} values The values that will not match.
10824
10832
  * @returns {Parse.Query} Returns the query, so you can chain this call.
10825
10833
  */
10826
- notContainedIn(key, value) {
10827
- return this._addCondition(key, '$nin', value);
10834
+ notContainedIn(key, values) {
10835
+ return this._addCondition(key, '$nin', values);
10828
10836
  }
10829
10837
 
10830
10838
  /**
@@ -11034,8 +11042,7 @@ class ParseQuery {
11034
11042
  * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search.
11035
11043
  * @returns {Parse.Query} Returns the query, so you can chain this call.
11036
11044
  */
11037
- fullText(key, value) {
11038
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
11045
+ fullText(key, value, options) {
11039
11046
  options = options || {};
11040
11047
  if (!key) {
11041
11048
  throw new Error('A key is required.');
@@ -11908,7 +11915,7 @@ class ParseRole extends _ParseObject.default {
11908
11915
  * @param {string} name The name of the role.
11909
11916
  * @param {object} options Standard options object with success and error
11910
11917
  * callbacks.
11911
- * @returns {(ParseObject|boolean)} true if the set succeeded.
11918
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
11912
11919
  */
11913
11920
  setName(name, options) {
11914
11921
  this._validateName(name);
@@ -11992,6 +11999,7 @@ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
11992
11999
  var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
11993
12000
  var _ParseCLP = _interopRequireDefault(_dereq_("./ParseCLP"));
11994
12001
  const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
12002
+
11995
12003
  /**
11996
12004
  * A Parse.Schema object is for handling schema data from Parse.
11997
12005
  * <p>All the schemas methods require MasterKey.
@@ -12166,9 +12174,9 @@ class ParseSchema {
12166
12174
  * </ul>
12167
12175
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
12168
12176
  */
12169
- addField(name, type) {
12170
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
12177
+ addField(name, type, options) {
12171
12178
  type = type || 'String';
12179
+ options = options || {};
12172
12180
  if (!name) {
12173
12181
  throw new Error('field name may not be null.');
12174
12182
  }
@@ -12350,8 +12358,7 @@ class ParseSchema {
12350
12358
  * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
12351
12359
  * @returns {Parse.Schema} Returns the schema, so you can chain this call.
12352
12360
  */
12353
- addPointer(name, targetClass) {
12354
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
12361
+ addPointer(name, targetClass, options) {
12355
12362
  if (!name) {
12356
12363
  throw new Error('field name may not be null.');
12357
12364
  }
@@ -12362,10 +12369,10 @@ class ParseSchema {
12362
12369
  type: 'Pointer',
12363
12370
  targetClass
12364
12371
  };
12365
- if (typeof options.required === 'boolean') {
12372
+ if (typeof options?.required === 'boolean') {
12366
12373
  fieldOptions.required = options.required;
12367
12374
  }
12368
- if (options.defaultValue !== undefined) {
12375
+ if (options?.defaultValue !== undefined) {
12369
12376
  fieldOptions.defaultValue = options.defaultValue;
12370
12377
  if (options.defaultValue instanceof _ParseObject.default) {
12371
12378
  fieldOptions.defaultValue = options.defaultValue.toPointer();
@@ -13146,7 +13153,7 @@ class ParseUser extends _ParseObject.default {
13146
13153
  * either from memory or localStorage, if necessary.
13147
13154
  *
13148
13155
  * @static
13149
- * @returns {Parse.Object} The currently logged in Parse.User.
13156
+ * @returns {Parse.User} The currently logged in Parse.User.
13150
13157
  */
13151
13158
  static current() {
13152
13159
  if (!canUseCurrentUser) {
@@ -13213,8 +13220,8 @@ class ParseUser extends _ParseObject.default {
13213
13220
  }
13214
13221
  const user = new this();
13215
13222
  user._finishFetch({
13216
- username: username,
13217
- password: password
13223
+ username,
13224
+ password
13218
13225
  });
13219
13226
  return user.logIn(options);
13220
13227
  }
@@ -13244,8 +13251,8 @@ class ParseUser extends _ParseObject.default {
13244
13251
  }
13245
13252
  const user = new this();
13246
13253
  user._finishFetch({
13247
- username: username,
13248
- password: password,
13254
+ username,
13255
+ password,
13249
13256
  authData
13250
13257
  });
13251
13258
  return user.logIn(options);
@@ -13302,8 +13309,7 @@ class ParseUser extends _ParseObject.default {
13302
13309
  * @static
13303
13310
  * @returns {Promise} A promise that is fulfilled with the user is fetched.
13304
13311
  */
13305
- static me(sessionToken) {
13306
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13312
+ static me(sessionToken, options) {
13307
13313
  const controller = _CoreManager.default.getUserController();
13308
13314
  const meOptions = _ParseObject.default._getRequestOptions(options);
13309
13315
  meOptions.sessionToken = sessionToken;
@@ -13352,8 +13358,7 @@ class ParseUser extends _ParseObject.default {
13352
13358
  * @returns {Promise} A promise that is resolved when the session is
13353
13359
  * destroyed on the server.
13354
13360
  */
13355
- static logOut() {
13356
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13361
+ static logOut(options) {
13357
13362
  const controller = _CoreManager.default.getUserController();
13358
13363
  return controller.logOut(options);
13359
13364
  }
@@ -13714,7 +13719,7 @@ const DefaultController = {
13714
13719
  },
13715
13720
  logOut(options) {
13716
13721
  const RESTController = _CoreManager.default.getRESTController();
13717
- if (options.sessionToken) {
13722
+ if (options?.sessionToken) {
13718
13723
  return RESTController.request('POST', 'logout', {}, options);
13719
13724
  }
13720
13725
  return DefaultController.currentUserAsync().then(currentUser => {
@@ -13742,7 +13747,7 @@ const DefaultController = {
13742
13747
  requestPasswordReset(email, options) {
13743
13748
  const RESTController = _CoreManager.default.getRESTController();
13744
13749
  return RESTController.request('POST', 'requestPasswordReset', {
13745
- email: email
13750
+ email
13746
13751
  }, options);
13747
13752
  },
13748
13753
  async upgradeToRevocableSession(user, options) {
@@ -13786,7 +13791,7 @@ const DefaultController = {
13786
13791
  requestEmailVerification(email, options) {
13787
13792
  const RESTController = _CoreManager.default.getRESTController();
13788
13793
  return RESTController.request('POST', 'verificationEmailRequest', {
13789
- email: email
13794
+ email
13790
13795
  }, options);
13791
13796
  }
13792
13797
  };
@@ -14133,6 +14138,9 @@ const RESTController = {
14133
14138
  throw new Error('Cannot use the Master Key, it has not been provided.');
14134
14139
  }
14135
14140
  }
14141
+ if (options.useMaintenanceKey) {
14142
+ payload._MaintenanceKey = _CoreManager.default.get('MAINTENANCE_KEY');
14143
+ }
14136
14144
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
14137
14145
  payload._RevocableSession = '1';
14138
14146
  }