parse 6.1.0-alpha.4 → 6.1.0-alpha.5
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.
- package/dist/parse.js +24 -36
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +24 -36
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/Parse.js +14 -14
- package/lib/browser/ParseQuery.js +8 -20
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/Parse.js +14 -14
- package/lib/node/ParseQuery.js +8 -20
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/ParseQuery.js +8 -16
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/Parse.js +14 -14
- package/lib/weapp/ParseQuery.js +8 -20
- package/package.json +1 -1
- package/types/Parse.d.ts +14 -14
- package/types/ParseQuery.d.ts +2 -10
package/lib/browser/Parse.js
CHANGED
|
@@ -109,7 +109,7 @@ const Parse = {
|
|
|
109
109
|
Hooks: undefined,
|
|
110
110
|
Parse: undefined,
|
|
111
111
|
/**
|
|
112
|
-
* @
|
|
112
|
+
* @property {EventuallyQueue} Parse.EventuallyQueue
|
|
113
113
|
* @static
|
|
114
114
|
*/
|
|
115
115
|
set EventuallyQueue(queue) {
|
|
@@ -179,7 +179,7 @@ const Parse = {
|
|
|
179
179
|
return _CoreManager.default.getRESTController().request('GET', 'health');
|
|
180
180
|
},
|
|
181
181
|
/**
|
|
182
|
-
* @
|
|
182
|
+
* @property {string} Parse.applicationId
|
|
183
183
|
* @static
|
|
184
184
|
*/
|
|
185
185
|
set applicationId(value) {
|
|
@@ -189,7 +189,7 @@ const Parse = {
|
|
|
189
189
|
return _CoreManager.default.get('APPLICATION_ID');
|
|
190
190
|
},
|
|
191
191
|
/**
|
|
192
|
-
* @
|
|
192
|
+
* @property {string} Parse.javaScriptKey
|
|
193
193
|
* @static
|
|
194
194
|
*/
|
|
195
195
|
set javaScriptKey(value) {
|
|
@@ -199,7 +199,7 @@ const Parse = {
|
|
|
199
199
|
return _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
200
200
|
},
|
|
201
201
|
/**
|
|
202
|
-
* @
|
|
202
|
+
* @property {string} Parse.masterKey
|
|
203
203
|
* @static
|
|
204
204
|
*/
|
|
205
205
|
set masterKey(value) {
|
|
@@ -209,7 +209,7 @@ const Parse = {
|
|
|
209
209
|
return _CoreManager.default.get('MASTER_KEY');
|
|
210
210
|
},
|
|
211
211
|
/**
|
|
212
|
-
* @
|
|
212
|
+
* @property {string} Parse.maintenanceKey
|
|
213
213
|
* @static
|
|
214
214
|
*/
|
|
215
215
|
set maintenanceKey(value) {
|
|
@@ -219,7 +219,7 @@ const Parse = {
|
|
|
219
219
|
return _CoreManager.default.get('MAINTENANCE_KEY');
|
|
220
220
|
},
|
|
221
221
|
/**
|
|
222
|
-
* @
|
|
222
|
+
* @property {string} Parse.serverURL
|
|
223
223
|
* @static
|
|
224
224
|
*/
|
|
225
225
|
set serverURL(value) {
|
|
@@ -229,7 +229,7 @@ const Parse = {
|
|
|
229
229
|
return _CoreManager.default.get('SERVER_URL');
|
|
230
230
|
},
|
|
231
231
|
/**
|
|
232
|
-
* @
|
|
232
|
+
* @property {string} Parse.serverAuthToken
|
|
233
233
|
* @static
|
|
234
234
|
*/
|
|
235
235
|
set serverAuthToken(value) {
|
|
@@ -239,7 +239,7 @@ const Parse = {
|
|
|
239
239
|
return _CoreManager.default.get('SERVER_AUTH_TOKEN');
|
|
240
240
|
},
|
|
241
241
|
/**
|
|
242
|
-
* @
|
|
242
|
+
* @property {string} Parse.serverAuthType
|
|
243
243
|
* @static
|
|
244
244
|
*/
|
|
245
245
|
set serverAuthType(value) {
|
|
@@ -249,7 +249,7 @@ const Parse = {
|
|
|
249
249
|
return _CoreManager.default.get('SERVER_AUTH_TYPE');
|
|
250
250
|
},
|
|
251
251
|
/**
|
|
252
|
-
* @
|
|
252
|
+
* @property {ParseLiveQuery} Parse.LiveQuery
|
|
253
253
|
* @static
|
|
254
254
|
*/
|
|
255
255
|
set LiveQuery(liveQuery) {
|
|
@@ -259,7 +259,7 @@ const Parse = {
|
|
|
259
259
|
return _CoreManager.default.getLiveQuery();
|
|
260
260
|
},
|
|
261
261
|
/**
|
|
262
|
-
* @
|
|
262
|
+
* @property {string} Parse.liveQueryServerURL
|
|
263
263
|
* @static
|
|
264
264
|
*/
|
|
265
265
|
set liveQueryServerURL(value) {
|
|
@@ -269,7 +269,7 @@ const Parse = {
|
|
|
269
269
|
return _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
270
270
|
},
|
|
271
271
|
/**
|
|
272
|
-
* @
|
|
272
|
+
* @property {boolean} Parse.encryptedUser
|
|
273
273
|
* @static
|
|
274
274
|
*/
|
|
275
275
|
set encryptedUser(value) {
|
|
@@ -279,7 +279,7 @@ const Parse = {
|
|
|
279
279
|
return _CoreManager.default.get('ENCRYPTED_USER');
|
|
280
280
|
},
|
|
281
281
|
/**
|
|
282
|
-
* @
|
|
282
|
+
* @property {string} Parse.secret
|
|
283
283
|
* @static
|
|
284
284
|
*/
|
|
285
285
|
set secret(value) {
|
|
@@ -289,7 +289,7 @@ const Parse = {
|
|
|
289
289
|
return _CoreManager.default.get('ENCRYPTED_KEY');
|
|
290
290
|
},
|
|
291
291
|
/**
|
|
292
|
-
* @
|
|
292
|
+
* @property {boolean} Parse.idempotency
|
|
293
293
|
* @static
|
|
294
294
|
*/
|
|
295
295
|
set idempotency(value) {
|
|
@@ -299,7 +299,7 @@ const Parse = {
|
|
|
299
299
|
return _CoreManager.default.get('IDEMPOTENCY');
|
|
300
300
|
},
|
|
301
301
|
/**
|
|
302
|
-
* @
|
|
302
|
+
* @property {boolean} Parse.allowCustomObjectId
|
|
303
303
|
* @static
|
|
304
304
|
*/
|
|
305
305
|
set allowCustomObjectId(value) {
|
|
@@ -691,25 +691,19 @@ class ParseQuery {
|
|
|
691
691
|
* Executes a distinct query and returns unique values
|
|
692
692
|
*
|
|
693
693
|
* @param {string} key A field to find distinct values
|
|
694
|
-
* @param {object} options
|
|
695
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
696
694
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
697
695
|
*/
|
|
698
|
-
distinct(key
|
|
699
|
-
options = options || {};
|
|
696
|
+
distinct(key) {
|
|
700
697
|
const distinctOptions = {
|
|
701
698
|
useMasterKey: true
|
|
702
699
|
};
|
|
703
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
704
|
-
distinctOptions.sessionToken = options.sessionToken;
|
|
705
|
-
}
|
|
706
700
|
this._setRequestTask(distinctOptions);
|
|
707
|
-
const controller = _CoreManager.default.getQueryController();
|
|
708
701
|
const params = {
|
|
709
702
|
distinct: key,
|
|
710
703
|
where: this._where,
|
|
711
704
|
hint: this._hint
|
|
712
705
|
};
|
|
706
|
+
const controller = _CoreManager.default.getQueryController();
|
|
713
707
|
return controller.aggregate(this.className, params, distinctOptions).then(results => {
|
|
714
708
|
return results.results;
|
|
715
709
|
});
|
|
@@ -719,20 +713,9 @@ class ParseQuery {
|
|
|
719
713
|
* Executes an aggregate query and returns aggregate results
|
|
720
714
|
*
|
|
721
715
|
* @param {(Array|object)} pipeline Array or Object of stages to process query
|
|
722
|
-
* @param {object} options
|
|
723
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
724
716
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
725
717
|
*/
|
|
726
|
-
aggregate(pipeline
|
|
727
|
-
options = options || {};
|
|
728
|
-
const aggregateOptions = {
|
|
729
|
-
useMasterKey: true
|
|
730
|
-
};
|
|
731
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
732
|
-
aggregateOptions.sessionToken = options.sessionToken;
|
|
733
|
-
}
|
|
734
|
-
this._setRequestTask(aggregateOptions);
|
|
735
|
-
const controller = _CoreManager.default.getQueryController();
|
|
718
|
+
aggregate(pipeline) {
|
|
736
719
|
if (!(0, _isArray.default)(pipeline) && typeof pipeline !== 'object') {
|
|
737
720
|
throw new Error('Invalid pipeline must be Array or Object');
|
|
738
721
|
}
|
|
@@ -750,6 +733,11 @@ class ParseQuery {
|
|
|
750
733
|
explain: this._explain,
|
|
751
734
|
readPreference: this._readPreference
|
|
752
735
|
};
|
|
736
|
+
const aggregateOptions = {
|
|
737
|
+
useMasterKey: true
|
|
738
|
+
};
|
|
739
|
+
this._setRequestTask(aggregateOptions);
|
|
740
|
+
const controller = _CoreManager.default.getQueryController();
|
|
753
741
|
return controller.aggregate(this.className, params, aggregateOptions).then(results => {
|
|
754
742
|
return results.results;
|
|
755
743
|
});
|
package/lib/node/CoreManager.js
CHANGED
package/lib/node/Parse.js
CHANGED
|
@@ -110,7 +110,7 @@ const Parse = {
|
|
|
110
110
|
Hooks: undefined,
|
|
111
111
|
Parse: undefined,
|
|
112
112
|
/**
|
|
113
|
-
* @
|
|
113
|
+
* @property {EventuallyQueue} Parse.EventuallyQueue
|
|
114
114
|
* @static
|
|
115
115
|
*/
|
|
116
116
|
set EventuallyQueue(queue) {
|
|
@@ -176,7 +176,7 @@ const Parse = {
|
|
|
176
176
|
return _CoreManager.default.getRESTController().request('GET', 'health');
|
|
177
177
|
},
|
|
178
178
|
/**
|
|
179
|
-
* @
|
|
179
|
+
* @property {string} Parse.applicationId
|
|
180
180
|
* @static
|
|
181
181
|
*/
|
|
182
182
|
set applicationId(value) {
|
|
@@ -186,7 +186,7 @@ const Parse = {
|
|
|
186
186
|
return _CoreManager.default.get('APPLICATION_ID');
|
|
187
187
|
},
|
|
188
188
|
/**
|
|
189
|
-
* @
|
|
189
|
+
* @property {string} Parse.javaScriptKey
|
|
190
190
|
* @static
|
|
191
191
|
*/
|
|
192
192
|
set javaScriptKey(value) {
|
|
@@ -196,7 +196,7 @@ const Parse = {
|
|
|
196
196
|
return _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
197
197
|
},
|
|
198
198
|
/**
|
|
199
|
-
* @
|
|
199
|
+
* @property {string} Parse.masterKey
|
|
200
200
|
* @static
|
|
201
201
|
*/
|
|
202
202
|
set masterKey(value) {
|
|
@@ -206,7 +206,7 @@ const Parse = {
|
|
|
206
206
|
return _CoreManager.default.get('MASTER_KEY');
|
|
207
207
|
},
|
|
208
208
|
/**
|
|
209
|
-
* @
|
|
209
|
+
* @property {string} Parse.maintenanceKey
|
|
210
210
|
* @static
|
|
211
211
|
*/
|
|
212
212
|
set maintenanceKey(value) {
|
|
@@ -216,7 +216,7 @@ const Parse = {
|
|
|
216
216
|
return _CoreManager.default.get('MAINTENANCE_KEY');
|
|
217
217
|
},
|
|
218
218
|
/**
|
|
219
|
-
* @
|
|
219
|
+
* @property {string} Parse.serverURL
|
|
220
220
|
* @static
|
|
221
221
|
*/
|
|
222
222
|
set serverURL(value) {
|
|
@@ -226,7 +226,7 @@ const Parse = {
|
|
|
226
226
|
return _CoreManager.default.get('SERVER_URL');
|
|
227
227
|
},
|
|
228
228
|
/**
|
|
229
|
-
* @
|
|
229
|
+
* @property {string} Parse.serverAuthToken
|
|
230
230
|
* @static
|
|
231
231
|
*/
|
|
232
232
|
set serverAuthToken(value) {
|
|
@@ -236,7 +236,7 @@ const Parse = {
|
|
|
236
236
|
return _CoreManager.default.get('SERVER_AUTH_TOKEN');
|
|
237
237
|
},
|
|
238
238
|
/**
|
|
239
|
-
* @
|
|
239
|
+
* @property {string} Parse.serverAuthType
|
|
240
240
|
* @static
|
|
241
241
|
*/
|
|
242
242
|
set serverAuthType(value) {
|
|
@@ -246,7 +246,7 @@ const Parse = {
|
|
|
246
246
|
return _CoreManager.default.get('SERVER_AUTH_TYPE');
|
|
247
247
|
},
|
|
248
248
|
/**
|
|
249
|
-
* @
|
|
249
|
+
* @property {ParseLiveQuery} Parse.LiveQuery
|
|
250
250
|
* @static
|
|
251
251
|
*/
|
|
252
252
|
set LiveQuery(liveQuery) {
|
|
@@ -256,7 +256,7 @@ const Parse = {
|
|
|
256
256
|
return _CoreManager.default.getLiveQuery();
|
|
257
257
|
},
|
|
258
258
|
/**
|
|
259
|
-
* @
|
|
259
|
+
* @property {string} Parse.liveQueryServerURL
|
|
260
260
|
* @static
|
|
261
261
|
*/
|
|
262
262
|
set liveQueryServerURL(value) {
|
|
@@ -266,7 +266,7 @@ const Parse = {
|
|
|
266
266
|
return _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
267
267
|
},
|
|
268
268
|
/**
|
|
269
|
-
* @
|
|
269
|
+
* @property {boolean} Parse.encryptedUser
|
|
270
270
|
* @static
|
|
271
271
|
*/
|
|
272
272
|
set encryptedUser(value) {
|
|
@@ -276,7 +276,7 @@ const Parse = {
|
|
|
276
276
|
return _CoreManager.default.get('ENCRYPTED_USER');
|
|
277
277
|
},
|
|
278
278
|
/**
|
|
279
|
-
* @
|
|
279
|
+
* @property {string} Parse.secret
|
|
280
280
|
* @static
|
|
281
281
|
*/
|
|
282
282
|
set secret(value) {
|
|
@@ -286,7 +286,7 @@ const Parse = {
|
|
|
286
286
|
return _CoreManager.default.get('ENCRYPTED_KEY');
|
|
287
287
|
},
|
|
288
288
|
/**
|
|
289
|
-
* @
|
|
289
|
+
* @property {boolean} Parse.idempotency
|
|
290
290
|
* @static
|
|
291
291
|
*/
|
|
292
292
|
set idempotency(value) {
|
|
@@ -296,7 +296,7 @@ const Parse = {
|
|
|
296
296
|
return _CoreManager.default.get('IDEMPOTENCY');
|
|
297
297
|
},
|
|
298
298
|
/**
|
|
299
|
-
* @
|
|
299
|
+
* @property {boolean} Parse.allowCustomObjectId
|
|
300
300
|
* @static
|
|
301
301
|
*/
|
|
302
302
|
set allowCustomObjectId(value) {
|
package/lib/node/ParseQuery.js
CHANGED
|
@@ -655,25 +655,19 @@ class ParseQuery {
|
|
|
655
655
|
* Executes a distinct query and returns unique values
|
|
656
656
|
*
|
|
657
657
|
* @param {string} key A field to find distinct values
|
|
658
|
-
* @param {object} options
|
|
659
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
660
658
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
661
659
|
*/
|
|
662
|
-
distinct(key
|
|
663
|
-
options = options || {};
|
|
660
|
+
distinct(key) {
|
|
664
661
|
const distinctOptions = {
|
|
665
662
|
useMasterKey: true
|
|
666
663
|
};
|
|
667
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
668
|
-
distinctOptions.sessionToken = options.sessionToken;
|
|
669
|
-
}
|
|
670
664
|
this._setRequestTask(distinctOptions);
|
|
671
|
-
const controller = _CoreManager.default.getQueryController();
|
|
672
665
|
const params = {
|
|
673
666
|
distinct: key,
|
|
674
667
|
where: this._where,
|
|
675
668
|
hint: this._hint
|
|
676
669
|
};
|
|
670
|
+
const controller = _CoreManager.default.getQueryController();
|
|
677
671
|
return controller.aggregate(this.className, params, distinctOptions).then(results => {
|
|
678
672
|
return results.results;
|
|
679
673
|
});
|
|
@@ -683,20 +677,9 @@ class ParseQuery {
|
|
|
683
677
|
* Executes an aggregate query and returns aggregate results
|
|
684
678
|
*
|
|
685
679
|
* @param {(Array|object)} pipeline Array or Object of stages to process query
|
|
686
|
-
* @param {object} options
|
|
687
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
688
680
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
689
681
|
*/
|
|
690
|
-
aggregate(pipeline
|
|
691
|
-
options = options || {};
|
|
692
|
-
const aggregateOptions = {
|
|
693
|
-
useMasterKey: true
|
|
694
|
-
};
|
|
695
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
696
|
-
aggregateOptions.sessionToken = options.sessionToken;
|
|
697
|
-
}
|
|
698
|
-
this._setRequestTask(aggregateOptions);
|
|
699
|
-
const controller = _CoreManager.default.getQueryController();
|
|
682
|
+
aggregate(pipeline) {
|
|
700
683
|
if (!Array.isArray(pipeline) && typeof pipeline !== 'object') {
|
|
701
684
|
throw new Error('Invalid pipeline must be Array or Object');
|
|
702
685
|
}
|
|
@@ -714,6 +697,11 @@ class ParseQuery {
|
|
|
714
697
|
explain: this._explain,
|
|
715
698
|
readPreference: this._readPreference
|
|
716
699
|
};
|
|
700
|
+
const aggregateOptions = {
|
|
701
|
+
useMasterKey: true
|
|
702
|
+
};
|
|
703
|
+
this._setRequestTask(aggregateOptions);
|
|
704
|
+
const controller = _CoreManager.default.getQueryController();
|
|
717
705
|
return controller.aggregate(this.className, params, aggregateOptions).then(results => {
|
|
718
706
|
return results.results;
|
|
719
707
|
});
|
|
@@ -454,37 +454,24 @@ var ParseQuery = function () {
|
|
|
454
454
|
}
|
|
455
455
|
}, {
|
|
456
456
|
key: "distinct",
|
|
457
|
-
value: function (key
|
|
458
|
-
options = options || {};
|
|
457
|
+
value: function (key) {
|
|
459
458
|
var distinctOptions = {
|
|
460
459
|
useMasterKey: true
|
|
461
460
|
};
|
|
462
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
463
|
-
distinctOptions.sessionToken = options.sessionToken;
|
|
464
|
-
}
|
|
465
461
|
this._setRequestTask(distinctOptions);
|
|
466
|
-
var controller = _CoreManager.default.getQueryController();
|
|
467
462
|
var params = {
|
|
468
463
|
distinct: key,
|
|
469
464
|
where: this._where,
|
|
470
465
|
hint: this._hint
|
|
471
466
|
};
|
|
467
|
+
var controller = _CoreManager.default.getQueryController();
|
|
472
468
|
return controller.aggregate(this.className, params, distinctOptions).then(function (results) {
|
|
473
469
|
return results.results;
|
|
474
470
|
});
|
|
475
471
|
}
|
|
476
472
|
}, {
|
|
477
473
|
key: "aggregate",
|
|
478
|
-
value: function (pipeline
|
|
479
|
-
options = options || {};
|
|
480
|
-
var aggregateOptions = {
|
|
481
|
-
useMasterKey: true
|
|
482
|
-
};
|
|
483
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
484
|
-
aggregateOptions.sessionToken = options.sessionToken;
|
|
485
|
-
}
|
|
486
|
-
this._setRequestTask(aggregateOptions);
|
|
487
|
-
var controller = _CoreManager.default.getQueryController();
|
|
474
|
+
value: function (pipeline) {
|
|
488
475
|
if (!Array.isArray(pipeline) && typeof pipeline !== 'object') {
|
|
489
476
|
throw new Error('Invalid pipeline must be Array or Object');
|
|
490
477
|
}
|
|
@@ -502,6 +489,11 @@ var ParseQuery = function () {
|
|
|
502
489
|
explain: this._explain,
|
|
503
490
|
readPreference: this._readPreference
|
|
504
491
|
};
|
|
492
|
+
var aggregateOptions = {
|
|
493
|
+
useMasterKey: true
|
|
494
|
+
};
|
|
495
|
+
this._setRequestTask(aggregateOptions);
|
|
496
|
+
var controller = _CoreManager.default.getQueryController();
|
|
505
497
|
return controller.aggregate(this.className, params, aggregateOptions).then(function (results) {
|
|
506
498
|
return results.results;
|
|
507
499
|
});
|
package/lib/weapp/CoreManager.js
CHANGED
package/lib/weapp/Parse.js
CHANGED
|
@@ -109,7 +109,7 @@ const Parse = {
|
|
|
109
109
|
Hooks: undefined,
|
|
110
110
|
Parse: undefined,
|
|
111
111
|
/**
|
|
112
|
-
* @
|
|
112
|
+
* @property {EventuallyQueue} Parse.EventuallyQueue
|
|
113
113
|
* @static
|
|
114
114
|
*/
|
|
115
115
|
set EventuallyQueue(queue) {
|
|
@@ -175,7 +175,7 @@ const Parse = {
|
|
|
175
175
|
return _CoreManager.default.getRESTController().request('GET', 'health');
|
|
176
176
|
},
|
|
177
177
|
/**
|
|
178
|
-
* @
|
|
178
|
+
* @property {string} Parse.applicationId
|
|
179
179
|
* @static
|
|
180
180
|
*/
|
|
181
181
|
set applicationId(value) {
|
|
@@ -185,7 +185,7 @@ const Parse = {
|
|
|
185
185
|
return _CoreManager.default.get('APPLICATION_ID');
|
|
186
186
|
},
|
|
187
187
|
/**
|
|
188
|
-
* @
|
|
188
|
+
* @property {string} Parse.javaScriptKey
|
|
189
189
|
* @static
|
|
190
190
|
*/
|
|
191
191
|
set javaScriptKey(value) {
|
|
@@ -195,7 +195,7 @@ const Parse = {
|
|
|
195
195
|
return _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
196
196
|
},
|
|
197
197
|
/**
|
|
198
|
-
* @
|
|
198
|
+
* @property {string} Parse.masterKey
|
|
199
199
|
* @static
|
|
200
200
|
*/
|
|
201
201
|
set masterKey(value) {
|
|
@@ -205,7 +205,7 @@ const Parse = {
|
|
|
205
205
|
return _CoreManager.default.get('MASTER_KEY');
|
|
206
206
|
},
|
|
207
207
|
/**
|
|
208
|
-
* @
|
|
208
|
+
* @property {string} Parse.maintenanceKey
|
|
209
209
|
* @static
|
|
210
210
|
*/
|
|
211
211
|
set maintenanceKey(value) {
|
|
@@ -215,7 +215,7 @@ const Parse = {
|
|
|
215
215
|
return _CoreManager.default.get('MAINTENANCE_KEY');
|
|
216
216
|
},
|
|
217
217
|
/**
|
|
218
|
-
* @
|
|
218
|
+
* @property {string} Parse.serverURL
|
|
219
219
|
* @static
|
|
220
220
|
*/
|
|
221
221
|
set serverURL(value) {
|
|
@@ -225,7 +225,7 @@ const Parse = {
|
|
|
225
225
|
return _CoreManager.default.get('SERVER_URL');
|
|
226
226
|
},
|
|
227
227
|
/**
|
|
228
|
-
* @
|
|
228
|
+
* @property {string} Parse.serverAuthToken
|
|
229
229
|
* @static
|
|
230
230
|
*/
|
|
231
231
|
set serverAuthToken(value) {
|
|
@@ -235,7 +235,7 @@ const Parse = {
|
|
|
235
235
|
return _CoreManager.default.get('SERVER_AUTH_TOKEN');
|
|
236
236
|
},
|
|
237
237
|
/**
|
|
238
|
-
* @
|
|
238
|
+
* @property {string} Parse.serverAuthType
|
|
239
239
|
* @static
|
|
240
240
|
*/
|
|
241
241
|
set serverAuthType(value) {
|
|
@@ -245,7 +245,7 @@ const Parse = {
|
|
|
245
245
|
return _CoreManager.default.get('SERVER_AUTH_TYPE');
|
|
246
246
|
},
|
|
247
247
|
/**
|
|
248
|
-
* @
|
|
248
|
+
* @property {ParseLiveQuery} Parse.LiveQuery
|
|
249
249
|
* @static
|
|
250
250
|
*/
|
|
251
251
|
set LiveQuery(liveQuery) {
|
|
@@ -255,7 +255,7 @@ const Parse = {
|
|
|
255
255
|
return _CoreManager.default.getLiveQuery();
|
|
256
256
|
},
|
|
257
257
|
/**
|
|
258
|
-
* @
|
|
258
|
+
* @property {string} Parse.liveQueryServerURL
|
|
259
259
|
* @static
|
|
260
260
|
*/
|
|
261
261
|
set liveQueryServerURL(value) {
|
|
@@ -265,7 +265,7 @@ const Parse = {
|
|
|
265
265
|
return _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
266
266
|
},
|
|
267
267
|
/**
|
|
268
|
-
* @
|
|
268
|
+
* @property {boolean} Parse.encryptedUser
|
|
269
269
|
* @static
|
|
270
270
|
*/
|
|
271
271
|
set encryptedUser(value) {
|
|
@@ -275,7 +275,7 @@ const Parse = {
|
|
|
275
275
|
return _CoreManager.default.get('ENCRYPTED_USER');
|
|
276
276
|
},
|
|
277
277
|
/**
|
|
278
|
-
* @
|
|
278
|
+
* @property {string} Parse.secret
|
|
279
279
|
* @static
|
|
280
280
|
*/
|
|
281
281
|
set secret(value) {
|
|
@@ -285,7 +285,7 @@ const Parse = {
|
|
|
285
285
|
return _CoreManager.default.get('ENCRYPTED_KEY');
|
|
286
286
|
},
|
|
287
287
|
/**
|
|
288
|
-
* @
|
|
288
|
+
* @property {boolean} Parse.idempotency
|
|
289
289
|
* @static
|
|
290
290
|
*/
|
|
291
291
|
set idempotency(value) {
|
|
@@ -295,7 +295,7 @@ const Parse = {
|
|
|
295
295
|
return _CoreManager.default.get('IDEMPOTENCY');
|
|
296
296
|
},
|
|
297
297
|
/**
|
|
298
|
-
* @
|
|
298
|
+
* @property {boolean} Parse.allowCustomObjectId
|
|
299
299
|
* @static
|
|
300
300
|
*/
|
|
301
301
|
set allowCustomObjectId(value) {
|
package/lib/weapp/ParseQuery.js
CHANGED
|
@@ -691,25 +691,19 @@ class ParseQuery {
|
|
|
691
691
|
* Executes a distinct query and returns unique values
|
|
692
692
|
*
|
|
693
693
|
* @param {string} key A field to find distinct values
|
|
694
|
-
* @param {object} options
|
|
695
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
696
694
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
697
695
|
*/
|
|
698
|
-
distinct(key
|
|
699
|
-
options = options || {};
|
|
696
|
+
distinct(key) {
|
|
700
697
|
const distinctOptions = {
|
|
701
698
|
useMasterKey: true
|
|
702
699
|
};
|
|
703
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
704
|
-
distinctOptions.sessionToken = options.sessionToken;
|
|
705
|
-
}
|
|
706
700
|
this._setRequestTask(distinctOptions);
|
|
707
|
-
const controller = _CoreManager.default.getQueryController();
|
|
708
701
|
const params = {
|
|
709
702
|
distinct: key,
|
|
710
703
|
where: this._where,
|
|
711
704
|
hint: this._hint
|
|
712
705
|
};
|
|
706
|
+
const controller = _CoreManager.default.getQueryController();
|
|
713
707
|
return controller.aggregate(this.className, params, distinctOptions).then(results => {
|
|
714
708
|
return results.results;
|
|
715
709
|
});
|
|
@@ -719,20 +713,9 @@ class ParseQuery {
|
|
|
719
713
|
* Executes an aggregate query and returns aggregate results
|
|
720
714
|
*
|
|
721
715
|
* @param {(Array|object)} pipeline Array or Object of stages to process query
|
|
722
|
-
* @param {object} options
|
|
723
|
-
* @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
|
|
724
716
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
725
717
|
*/
|
|
726
|
-
aggregate(pipeline
|
|
727
|
-
options = options || {};
|
|
728
|
-
const aggregateOptions = {
|
|
729
|
-
useMasterKey: true
|
|
730
|
-
};
|
|
731
|
-
if (Object.hasOwn(options, 'sessionToken')) {
|
|
732
|
-
aggregateOptions.sessionToken = options.sessionToken;
|
|
733
|
-
}
|
|
734
|
-
this._setRequestTask(aggregateOptions);
|
|
735
|
-
const controller = _CoreManager.default.getQueryController();
|
|
718
|
+
aggregate(pipeline) {
|
|
736
719
|
if (!(0, _isArray.default)(pipeline) && typeof pipeline !== 'object') {
|
|
737
720
|
throw new Error('Invalid pipeline must be Array or Object');
|
|
738
721
|
}
|
|
@@ -750,6 +733,11 @@ class ParseQuery {
|
|
|
750
733
|
explain: this._explain,
|
|
751
734
|
readPreference: this._readPreference
|
|
752
735
|
};
|
|
736
|
+
const aggregateOptions = {
|
|
737
|
+
useMasterKey: true
|
|
738
|
+
};
|
|
739
|
+
this._setRequestTask(aggregateOptions);
|
|
740
|
+
const controller = _CoreManager.default.getQueryController();
|
|
753
741
|
return controller.aggregate(this.className, params, aggregateOptions).then(results => {
|
|
754
742
|
return results.results;
|
|
755
743
|
});
|