parse 5.0.0-alpha.2 → 5.0.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.
@@ -187,7 +187,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
187
187
  SERVER_AUTH_TOKEN: null,
188
188
  LIVEQUERY_SERVER_URL: null,
189
189
  ENCRYPTED_KEY: null,
190
- VERSION: 'js' + "5.0.0-alpha.2",
190
+ VERSION: 'js' + "5.0.0-alpha.4",
191
191
  APPLICATION_ID: null,
192
192
  JAVASCRIPT_KEY: null,
193
193
  MASTER_KEY: null,
@@ -62,6 +62,7 @@ var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
62
62
  readPreference?: string,
63
63
  includeReadPreference?: string,
64
64
  subqueryReadPreference?: string,
65
+ comment?: string,
65
66
  };*/
66
67
  /**
67
68
  * Converts a string into a regex that matches it.
@@ -264,6 +265,7 @@ var ParseQuery = /*#__PURE__*/function () {
264
265
  (0, _defineProperty2.default)(this, "_hint", void 0);
265
266
  (0, _defineProperty2.default)(this, "_explain", void 0);
266
267
  (0, _defineProperty2.default)(this, "_xhrRequest", void 0);
268
+ (0, _defineProperty2.default)(this, "_comment", void 0);
267
269
  if (typeof objectClass === 'string') {
268
270
  if (objectClass === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {
269
271
  this.className = '_User';
@@ -299,6 +301,7 @@ var ParseQuery = /*#__PURE__*/function () {
299
301
  task: null,
300
302
  onchange: function () {}
301
303
  };
304
+ this._comment = null;
302
305
  }
303
306
 
304
307
  /**
@@ -515,6 +518,9 @@ var ParseQuery = /*#__PURE__*/function () {
515
518
  if (this._explain) {
516
519
  params.explain = true;
517
520
  }
521
+ if (this._comment) {
522
+ params.comment = this._comment;
523
+ }
518
524
  for (var _key3 in this._extraOptions) {
519
525
  params[_key3] = this._extraOptions[_key3];
520
526
  }
@@ -587,10 +593,13 @@ var ParseQuery = /*#__PURE__*/function () {
587
593
  if (json.explain) {
588
594
  this._explain = !!json.explain;
589
595
  }
596
+ if (json.comment) {
597
+ this._comment = json.comment;
598
+ }
590
599
  for (var _key4 in json) {
591
600
  if (json.hasOwnProperty(_key4)) {
592
601
  var _context4;
593
- if ((0, _indexOf.default)(_context4 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain']).call(_context4, _key4) === -1) {
602
+ if ((0, _indexOf.default)(_context4 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain', 'comment']).call(_context4, _key4) === -1) {
594
603
  this._extraOptions[_key4] = json[_key4];
595
604
  }
596
605
  }
@@ -2316,6 +2325,27 @@ var ParseQuery = /*#__PURE__*/function () {
2316
2325
  _this16._xhrRequest.onchange();
2317
2326
  };
2318
2327
  }
2328
+
2329
+ /**
2330
+ * Sets a comment to the query so that the query
2331
+ *can be identified when using a the profiler for MongoDB.
2332
+ *
2333
+ * @param {string} value a comment can make your profile data easier to interpret and trace.
2334
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
2335
+ */
2336
+ }, {
2337
+ key: "comment",
2338
+ value: function (value /*: string*/) /*: ParseQuery*/{
2339
+ if (value == null) {
2340
+ delete this._comment;
2341
+ return this;
2342
+ }
2343
+ if (typeof value !== 'string') {
2344
+ throw new Error('The value of a comment to be sent with this query must be a string.');
2345
+ }
2346
+ this._comment = value;
2347
+ return this;
2348
+ }
2319
2349
  }], [{
2320
2350
  key: "fromJSON",
2321
2351
  value: function (className /*: string*/, json /*: QueryJSON*/) /*: ParseQuery*/{
@@ -1124,13 +1124,8 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
1124
1124
  if (typeof password !== 'string') {
1125
1125
  return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
1126
1126
  }
1127
- options = options || {};
1128
- var verificationOption = {};
1129
- if (options.hasOwnProperty('useMasterKey')) {
1130
- verificationOption.useMasterKey = options.useMasterKey;
1131
- }
1132
1127
  var controller = _CoreManager.default.getUserController();
1133
- return controller.verifyPassword(username, password, verificationOption);
1128
+ return controller.verifyPassword(username, password, options || {});
1134
1129
  }
1135
1130
 
1136
1131
  /**
@@ -56,6 +56,7 @@ var uuidv4 = require('./uuid');
56
56
  progress?: any,
57
57
  context?: any,
58
58
  usePost?: boolean,
59
+ ignoreEmailVerification?: boolean,
59
60
  };*/
60
61
  /*:: export type FullOptions = {
61
62
  success?: any,
@@ -271,6 +272,9 @@ var RESTController = {
271
272
  throw new Error('Cannot use the Master Key, it has not been provided.');
272
273
  }
273
274
  }
275
+ if (options.ignoreEmailVerification !== undefined) {
276
+ payload.ignoreEmailVerification = options.ignoreEmailVerification;
277
+ }
274
278
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
275
279
  payload._RevocableSession = '1';
276
280
  }
@@ -183,7 +183,7 @@ const config /*: Config & { [key: string]: mixed }*/ = {
183
183
  SERVER_AUTH_TOKEN: null,
184
184
  LIVEQUERY_SERVER_URL: null,
185
185
  ENCRYPTED_KEY: null,
186
- VERSION: 'js' + "5.0.0-alpha.2",
186
+ VERSION: 'js' + "5.0.0-alpha.4",
187
187
  APPLICATION_ID: null,
188
188
  JAVASCRIPT_KEY: null,
189
189
  MASTER_KEY: null,
@@ -42,6 +42,7 @@ function _interopRequireDefault(obj) {
42
42
  readPreference?: string,
43
43
  includeReadPreference?: string,
44
44
  subqueryReadPreference?: string,
45
+ comment?: string,
45
46
  };*/
46
47
  /**
47
48
  * Converts a string into a regex that matches it.
@@ -239,6 +240,7 @@ class ParseQuery {
239
240
  /*:: _hint: mixed;*/
240
241
  /*:: _explain: boolean;*/
241
242
  /*:: _xhrRequest: any;*/
243
+ /*:: _comment: string;*/
242
244
  /**
243
245
  * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
244
246
  */
@@ -278,6 +280,7 @@ class ParseQuery {
278
280
  task: null,
279
281
  onchange: () => {}
280
282
  };
283
+ this._comment = null;
281
284
  }
282
285
 
283
286
  /**
@@ -454,6 +457,9 @@ class ParseQuery {
454
457
  if (this._explain) {
455
458
  params.explain = true;
456
459
  }
460
+ if (this._comment) {
461
+ params.comment = this._comment;
462
+ }
457
463
  for (const key in this._extraOptions) {
458
464
  params[key] = this._extraOptions[key];
459
465
  }
@@ -524,9 +530,12 @@ class ParseQuery {
524
530
  if (json.explain) {
525
531
  this._explain = !!json.explain;
526
532
  }
533
+ if (json.comment) {
534
+ this._comment = json.comment;
535
+ }
527
536
  for (const key in json) {
528
537
  if (json.hasOwnProperty(key)) {
529
- if (['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain'].indexOf(key) === -1) {
538
+ if (['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain', 'comment'].indexOf(key) === -1) {
530
539
  this._extraOptions[key] = json[key];
531
540
  }
532
541
  }
@@ -2000,6 +2009,25 @@ class ParseQuery {
2000
2009
  this._xhrRequest.onchange();
2001
2010
  };
2002
2011
  }
2012
+
2013
+ /**
2014
+ * Sets a comment to the query so that the query
2015
+ *can be identified when using a the profiler for MongoDB.
2016
+ *
2017
+ * @param {string} value a comment can make your profile data easier to interpret and trace.
2018
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
2019
+ */
2020
+ comment(value /*: string*/) /*: ParseQuery*/{
2021
+ if (value == null) {
2022
+ delete this._comment;
2023
+ return this;
2024
+ }
2025
+ if (typeof value !== 'string') {
2026
+ throw new Error('The value of a comment to be sent with this query must be a string.');
2027
+ }
2028
+ this._comment = value;
2029
+ return this;
2030
+ }
2003
2031
  }
2004
2032
  const DefaultController = {
2005
2033
  find(className /*: string*/, params /*: QueryJSON*/, options /*: RequestOptions*/) /*: Promise<Array<ParseObject>>*/{
@@ -855,13 +855,8 @@ class ParseUser extends _ParseObject.default {
855
855
  if (typeof password !== 'string') {
856
856
  return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
857
857
  }
858
- options = options || {};
859
- const verificationOption = {};
860
- if (options.hasOwnProperty('useMasterKey')) {
861
- verificationOption.useMasterKey = options.useMasterKey;
862
- }
863
858
  const controller = _CoreManager.default.getUserController();
864
- return controller.verifyPassword(username, password, verificationOption);
859
+ return controller.verifyPassword(username, password, options || {});
865
860
  }
866
861
 
867
862
  /**
@@ -23,6 +23,7 @@ const uuidv4 = require('./uuid');
23
23
  progress?: any,
24
24
  context?: any,
25
25
  usePost?: boolean,
26
+ ignoreEmailVerification?: boolean,
26
27
  };*/
27
28
  /*:: export type FullOptions = {
28
29
  success?: any,
@@ -239,6 +240,9 @@ const RESTController = {
239
240
  throw new Error('Cannot use the Master Key, it has not been provided.');
240
241
  }
241
242
  }
243
+ if (options.ignoreEmailVerification !== undefined) {
244
+ payload.ignoreEmailVerification = options.ignoreEmailVerification;
245
+ }
242
246
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
243
247
  payload._RevocableSession = '1';
244
248
  }
@@ -12,7 +12,7 @@ var config = {
12
12
  SERVER_AUTH_TOKEN: null,
13
13
  LIVEQUERY_SERVER_URL: null,
14
14
  ENCRYPTED_KEY: null,
15
- VERSION: 'js' + "5.0.0-alpha.2",
15
+ VERSION: 'js' + "5.0.0-alpha.4",
16
16
  APPLICATION_ID: null,
17
17
  JAVASCRIPT_KEY: null,
18
18
  MASTER_KEY: null,
@@ -147,6 +147,7 @@ var ParseQuery = function () {
147
147
  task: null,
148
148
  onchange: function () {}
149
149
  };
150
+ this._comment = null;
150
151
  }
151
152
  (0, _createClass2.default)(ParseQuery, [{
152
153
  key: "_orQuery",
@@ -302,6 +303,9 @@ var ParseQuery = function () {
302
303
  if (this._explain) {
303
304
  params.explain = true;
304
305
  }
306
+ if (this._comment) {
307
+ params.comment = this._comment;
308
+ }
305
309
  for (var _key3 in this._extraOptions) {
306
310
  params[_key3] = this._extraOptions[_key3];
307
311
  }
@@ -352,9 +356,12 @@ var ParseQuery = function () {
352
356
  if (json.explain) {
353
357
  this._explain = !!json.explain;
354
358
  }
359
+ if (json.comment) {
360
+ this._comment = json.comment;
361
+ }
355
362
  for (var _key4 in json) {
356
363
  if (json.hasOwnProperty(_key4)) {
357
- if (['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain'].indexOf(_key4) === -1) {
364
+ if (['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain', 'comment'].indexOf(_key4) === -1) {
358
365
  this._extraOptions[_key4] = json[_key4];
359
366
  }
360
367
  }
@@ -1245,6 +1252,19 @@ var ParseQuery = function () {
1245
1252
  _this16._xhrRequest.onchange();
1246
1253
  };
1247
1254
  }
1255
+ }, {
1256
+ key: "comment",
1257
+ value: function (value) {
1258
+ if (value == null) {
1259
+ delete this._comment;
1260
+ return this;
1261
+ }
1262
+ if (typeof value !== 'string') {
1263
+ throw new Error('The value of a comment to be sent with this query must be a string.');
1264
+ }
1265
+ this._comment = value;
1266
+ return this;
1267
+ }
1248
1268
  }], [{
1249
1269
  key: "fromJSON",
1250
1270
  value: function (className, json) {
@@ -634,13 +634,8 @@ var ParseUser = function (_ParseObject) {
634
634
  if (typeof password !== 'string') {
635
635
  return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
636
636
  }
637
- options = options || {};
638
- var verificationOption = {};
639
- if (options.hasOwnProperty('useMasterKey')) {
640
- verificationOption.useMasterKey = options.useMasterKey;
641
- }
642
637
  var controller = _CoreManager.default.getUserController();
643
- return controller.verifyPassword(username, password, verificationOption);
638
+ return controller.verifyPassword(username, password, options || {});
644
639
  }
645
640
  }, {
646
641
  key: "allowCustomUserClass",
@@ -200,6 +200,9 @@ var RESTController = {
200
200
  throw new Error('Cannot use the Master Key, it has not been provided.');
201
201
  }
202
202
  }
203
+ if (options.ignoreEmailVerification !== undefined) {
204
+ payload.ignoreEmailVerification = options.ignoreEmailVerification;
205
+ }
203
206
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
204
207
  payload._RevocableSession = '1';
205
208
  }
@@ -187,7 +187,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
187
187
  SERVER_AUTH_TOKEN: null,
188
188
  LIVEQUERY_SERVER_URL: null,
189
189
  ENCRYPTED_KEY: null,
190
- VERSION: 'js' + "5.0.0-alpha.2",
190
+ VERSION: 'js' + "5.0.0-alpha.4",
191
191
  APPLICATION_ID: null,
192
192
  JAVASCRIPT_KEY: null,
193
193
  MASTER_KEY: null,
@@ -62,6 +62,7 @@ var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
62
62
  readPreference?: string,
63
63
  includeReadPreference?: string,
64
64
  subqueryReadPreference?: string,
65
+ comment?: string,
65
66
  };*/
66
67
  /**
67
68
  * Converts a string into a regex that matches it.
@@ -264,6 +265,7 @@ var ParseQuery = /*#__PURE__*/function () {
264
265
  (0, _defineProperty2.default)(this, "_hint", void 0);
265
266
  (0, _defineProperty2.default)(this, "_explain", void 0);
266
267
  (0, _defineProperty2.default)(this, "_xhrRequest", void 0);
268
+ (0, _defineProperty2.default)(this, "_comment", void 0);
267
269
  if (typeof objectClass === 'string') {
268
270
  if (objectClass === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {
269
271
  this.className = '_User';
@@ -299,6 +301,7 @@ var ParseQuery = /*#__PURE__*/function () {
299
301
  task: null,
300
302
  onchange: function () {}
301
303
  };
304
+ this._comment = null;
302
305
  }
303
306
 
304
307
  /**
@@ -515,6 +518,9 @@ var ParseQuery = /*#__PURE__*/function () {
515
518
  if (this._explain) {
516
519
  params.explain = true;
517
520
  }
521
+ if (this._comment) {
522
+ params.comment = this._comment;
523
+ }
518
524
  for (var _key3 in this._extraOptions) {
519
525
  params[_key3] = this._extraOptions[_key3];
520
526
  }
@@ -587,10 +593,13 @@ var ParseQuery = /*#__PURE__*/function () {
587
593
  if (json.explain) {
588
594
  this._explain = !!json.explain;
589
595
  }
596
+ if (json.comment) {
597
+ this._comment = json.comment;
598
+ }
590
599
  for (var _key4 in json) {
591
600
  if (json.hasOwnProperty(_key4)) {
592
601
  var _context4;
593
- if ((0, _indexOf.default)(_context4 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain']).call(_context4, _key4) === -1) {
602
+ if ((0, _indexOf.default)(_context4 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain', 'comment']).call(_context4, _key4) === -1) {
594
603
  this._extraOptions[_key4] = json[_key4];
595
604
  }
596
605
  }
@@ -2316,6 +2325,27 @@ var ParseQuery = /*#__PURE__*/function () {
2316
2325
  _this16._xhrRequest.onchange();
2317
2326
  };
2318
2327
  }
2328
+
2329
+ /**
2330
+ * Sets a comment to the query so that the query
2331
+ *can be identified when using a the profiler for MongoDB.
2332
+ *
2333
+ * @param {string} value a comment can make your profile data easier to interpret and trace.
2334
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
2335
+ */
2336
+ }, {
2337
+ key: "comment",
2338
+ value: function (value /*: string*/) /*: ParseQuery*/{
2339
+ if (value == null) {
2340
+ delete this._comment;
2341
+ return this;
2342
+ }
2343
+ if (typeof value !== 'string') {
2344
+ throw new Error('The value of a comment to be sent with this query must be a string.');
2345
+ }
2346
+ this._comment = value;
2347
+ return this;
2348
+ }
2319
2349
  }], [{
2320
2350
  key: "fromJSON",
2321
2351
  value: function (className /*: string*/, json /*: QueryJSON*/) /*: ParseQuery*/{
@@ -1124,13 +1124,8 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
1124
1124
  if (typeof password !== 'string') {
1125
1125
  return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
1126
1126
  }
1127
- options = options || {};
1128
- var verificationOption = {};
1129
- if (options.hasOwnProperty('useMasterKey')) {
1130
- verificationOption.useMasterKey = options.useMasterKey;
1131
- }
1132
1127
  var controller = _CoreManager.default.getUserController();
1133
- return controller.verifyPassword(username, password, verificationOption);
1128
+ return controller.verifyPassword(username, password, options || {});
1134
1129
  }
1135
1130
 
1136
1131
  /**
@@ -56,6 +56,7 @@ var uuidv4 = require('./uuid');
56
56
  progress?: any,
57
57
  context?: any,
58
58
  usePost?: boolean,
59
+ ignoreEmailVerification?: boolean,
59
60
  };*/
60
61
  /*:: export type FullOptions = {
61
62
  success?: any,
@@ -272,6 +273,9 @@ var RESTController = {
272
273
  throw new Error('Cannot use the Master Key, it has not been provided.');
273
274
  }
274
275
  }
276
+ if (options.ignoreEmailVerification !== undefined) {
277
+ payload.ignoreEmailVerification = options.ignoreEmailVerification;
278
+ }
275
279
  if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
276
280
  payload._RevocableSession = '1';
277
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "5.0.0-alpha.2",
3
+ "version": "5.0.0-alpha.4",
4
4
  "description": "Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org",
6
6
  "keywords": [
@@ -85,7 +85,7 @@
85
85
  "lint-staged": "13.2.2",
86
86
  "metro-react-native-babel-preset": "0.76.4",
87
87
  "mongodb-runner": "5.4.3",
88
- "parse-server": "7.0.0-alpha.26",
88
+ "parse-server": "7.1.0-alpha.1",
89
89
  "prettier": "3.0.2",
90
90
  "puppeteer": "20.4.0",
91
91
  "regenerator-runtime": "0.13.11",