parse 5.0.0-alpha.1 → 5.0.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.
@@ -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.1",
190
+ VERSION: 'js' + "5.0.0-alpha.3",
191
191
  APPLICATION_ID: null,
192
192
  JAVASCRIPT_KEY: null,
193
193
  MASTER_KEY: null,
@@ -278,7 +278,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
278
278
  var className = query.className;
279
279
  var queryJSON = query.toJSON();
280
280
  var where = queryJSON.where;
281
- var fields = (_queryJSON$keys = (0, _keys.default)(queryJSON)) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
281
+ var keys = (_queryJSON$keys = (0, _keys.default)(queryJSON)) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
282
282
  var watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
283
283
  var subscribeRequest = {
284
284
  op: OP_TYPES.SUBSCRIBE,
@@ -286,7 +286,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
286
286
  query: {
287
287
  className: className,
288
288
  where: where,
289
- fields: fields,
289
+ keys: keys,
290
290
  watch: watch
291
291
  }
292
292
  };
@@ -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*/{
@@ -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.1",
186
+ VERSION: 'js' + "5.0.0-alpha.3",
187
187
  APPLICATION_ID: null,
188
188
  JAVASCRIPT_KEY: null,
189
189
  MASTER_KEY: null,
@@ -195,7 +195,7 @@ class LiveQueryClient {
195
195
  const className = query.className;
196
196
  const queryJSON = query.toJSON();
197
197
  const where = queryJSON.where;
198
- const fields = (_queryJSON$keys = queryJSON.keys) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
198
+ const keys = (_queryJSON$keys = queryJSON.keys) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
199
199
  const watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
200
200
  const subscribeRequest = {
201
201
  op: OP_TYPES.SUBSCRIBE,
@@ -203,7 +203,7 @@ class LiveQueryClient {
203
203
  query: {
204
204
  className,
205
205
  where,
206
- fields,
206
+ keys,
207
207
  watch
208
208
  }
209
209
  };
@@ -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>>*/{
@@ -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.1",
15
+ VERSION: 'js' + "5.0.0-alpha.3",
16
16
  APPLICATION_ID: null,
17
17
  JAVASCRIPT_KEY: null,
18
18
  MASTER_KEY: null,
@@ -102,7 +102,7 @@ var LiveQueryClient = function () {
102
102
  var className = query.className;
103
103
  var queryJSON = query.toJSON();
104
104
  var where = queryJSON.where;
105
- var fields = (_queryJSON$keys = queryJSON.keys) == null ? void 0 : _queryJSON$keys.split(',');
105
+ var keys = (_queryJSON$keys = queryJSON.keys) == null ? void 0 : _queryJSON$keys.split(',');
106
106
  var watch = (_queryJSON$watch = queryJSON.watch) == null ? void 0 : _queryJSON$watch.split(',');
107
107
  var subscribeRequest = {
108
108
  op: OP_TYPES.SUBSCRIBE,
@@ -110,7 +110,7 @@ var LiveQueryClient = function () {
110
110
  query: {
111
111
  className: className,
112
112
  where: where,
113
- fields: fields,
113
+ keys: keys,
114
114
  watch: watch
115
115
  }
116
116
  };
@@ -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) {
@@ -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.1",
190
+ VERSION: 'js' + "5.0.0-alpha.3",
191
191
  APPLICATION_ID: null,
192
192
  JAVASCRIPT_KEY: null,
193
193
  MASTER_KEY: null,
@@ -278,7 +278,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
278
278
  var className = query.className;
279
279
  var queryJSON = query.toJSON();
280
280
  var where = queryJSON.where;
281
- var fields = (_queryJSON$keys = (0, _keys.default)(queryJSON)) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
281
+ var keys = (_queryJSON$keys = (0, _keys.default)(queryJSON)) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
282
282
  var watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
283
283
  var subscribeRequest = {
284
284
  op: OP_TYPES.SUBSCRIBE,
@@ -286,7 +286,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
286
286
  query: {
287
287
  className: className,
288
288
  where: where,
289
- fields: fields,
289
+ keys: keys,
290
290
  watch: watch
291
291
  }
292
292
  };
@@ -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*/{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "5.0.0-alpha.1",
3
+ "version": "5.0.0-alpha.3",
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": "git+https://github.com/parse-community/parse-server#alpha",
88
+ "parse-server": "7.0.0-alpha.26",
89
89
  "prettier": "3.0.2",
90
90
  "puppeteer": "20.4.0",
91
91
  "regenerator-runtime": "0.13.11",