parse 5.3.0-alpha.5 → 5.3.0-alpha.6
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/README.md +4 -4
- package/dist/parse.js +171 -296
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +171 -296
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Cloud.js +12 -16
- package/lib/browser/CoreManager.js +3 -3
- package/lib/browser/ParseFile.js +1 -1
- package/lib/browser/ParseObject.js +86 -120
- package/lib/browser/ParseQuery.js +21 -88
- package/lib/browser/ParseSession.js +1 -5
- package/lib/browser/ParseUser.js +40 -56
- package/lib/browser/Push.js +2 -2
- package/lib/browser/Storage.js +1 -1
- package/lib/browser/StorageController.default.js +2 -2
- package/lib/node/Cloud.js +12 -16
- package/lib/node/CoreManager.js +3 -3
- package/lib/node/ParseFile.js +1 -1
- package/lib/node/ParseObject.js +82 -115
- package/lib/node/ParseQuery.js +21 -88
- package/lib/node/ParseSession.js +1 -5
- package/lib/node/ParseUser.js +40 -56
- package/lib/node/Push.js +2 -2
- package/lib/node/Storage.js +1 -1
- package/lib/node/StorageController.default.js +2 -2
- package/lib/react-native/Cloud.js +4 -16
- package/lib/react-native/CoreManager.js +3 -3
- package/lib/react-native/ParseFile.js +1 -1
- package/lib/react-native/ParseObject.js +54 -115
- package/lib/react-native/ParseQuery.js +20 -88
- package/lib/react-native/ParseSession.js +1 -5
- package/lib/react-native/ParseUser.js +13 -56
- package/lib/react-native/Push.js +2 -2
- package/lib/react-native/Storage.js +1 -1
- package/lib/react-native/StorageController.default.js +2 -2
- package/lib/weapp/Cloud.js +12 -16
- package/lib/weapp/CoreManager.js +3 -3
- package/lib/weapp/ParseFile.js +1 -1
- package/lib/weapp/ParseObject.js +86 -120
- package/lib/weapp/ParseQuery.js +21 -88
- package/lib/weapp/ParseSession.js +1 -5
- package/lib/weapp/ParseUser.js +40 -56
- package/lib/weapp/Push.js +2 -2
- package/lib/weapp/Storage.js +1 -1
- package/lib/weapp/StorageController.default.js +2 -2
- package/package.json +5 -5
package/lib/weapp/ParseQuery.js
CHANGED
|
@@ -73,7 +73,7 @@ function handleSelectResult(data, select) {
|
|
|
73
73
|
const serverDataMask = {};
|
|
74
74
|
(0, _forEach.default)(select).call(select, field => {
|
|
75
75
|
const hasSubObjectSelect = (0, _indexOf.default)(field).call(field, '.') !== -1;
|
|
76
|
-
if (!hasSubObjectSelect && !
|
|
76
|
+
if (!hasSubObjectSelect && !Object.hasOwn(data, field)) {
|
|
77
77
|
// this field was selected, but is missing from the retrieved data
|
|
78
78
|
data[field] = undefined;
|
|
79
79
|
} else if (hasSubObjectSelect) {
|
|
@@ -84,7 +84,7 @@ function handleSelectResult(data, select) {
|
|
|
84
84
|
let serverMask = serverDataMask;
|
|
85
85
|
(0, _forEach.default)(pathComponents).call(pathComponents, (component, index, arr) => {
|
|
86
86
|
// add keys if the expected data is missing
|
|
87
|
-
if (obj && !
|
|
87
|
+
if (obj && !Object.hasOwn(obj, component)) {
|
|
88
88
|
obj[component] = undefined;
|
|
89
89
|
}
|
|
90
90
|
if (obj && typeof obj === 'object') {
|
|
@@ -118,7 +118,7 @@ function copyMissingDataWithMask(src, dest, mask, copyThisLevel) {
|
|
|
118
118
|
//copy missing elements at this level
|
|
119
119
|
if (copyThisLevel) {
|
|
120
120
|
for (const key in src) {
|
|
121
|
-
if (
|
|
121
|
+
if (Object.hasOwn(src, key) && !Object.hasOwn(dest, key)) {
|
|
122
122
|
dest[key] = src[key];
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -522,7 +522,7 @@ class ParseQuery {
|
|
|
522
522
|
this._comment = json.comment;
|
|
523
523
|
}
|
|
524
524
|
for (const key in json) {
|
|
525
|
-
if (
|
|
525
|
+
if (Object.hasOwn(json, key)) {
|
|
526
526
|
var _context3;
|
|
527
527
|
if ((0, _indexOf.default)(_context3 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain', 'comment']).call(_context3, key) === -1) {
|
|
528
528
|
this._extraOptions[key] = json[key];
|
|
@@ -564,19 +564,7 @@ class ParseQuery {
|
|
|
564
564
|
*/
|
|
565
565
|
get(objectId, options) {
|
|
566
566
|
this.equalTo('objectId', objectId);
|
|
567
|
-
const firstOptions =
|
|
568
|
-
if (options && options.hasOwnProperty('useMasterKey')) {
|
|
569
|
-
firstOptions.useMasterKey = options.useMasterKey;
|
|
570
|
-
}
|
|
571
|
-
if (options && options.hasOwnProperty('sessionToken')) {
|
|
572
|
-
firstOptions.sessionToken = options.sessionToken;
|
|
573
|
-
}
|
|
574
|
-
if (options && options.hasOwnProperty('context') && typeof options.context === 'object') {
|
|
575
|
-
firstOptions.context = options.context;
|
|
576
|
-
}
|
|
577
|
-
if (options && options.hasOwnProperty('json')) {
|
|
578
|
-
firstOptions.json = options.json;
|
|
579
|
-
}
|
|
567
|
+
const firstOptions = _ParseObject.default._getRequestOptions(options);
|
|
580
568
|
return this.first(firstOptions).then(response => {
|
|
581
569
|
if (response) {
|
|
582
570
|
return response;
|
|
@@ -602,17 +590,7 @@ class ParseQuery {
|
|
|
602
590
|
* the query completes.
|
|
603
591
|
*/
|
|
604
592
|
find(options) {
|
|
605
|
-
|
|
606
|
-
const findOptions = {};
|
|
607
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
608
|
-
findOptions.useMasterKey = options.useMasterKey;
|
|
609
|
-
}
|
|
610
|
-
if (options.hasOwnProperty('sessionToken')) {
|
|
611
|
-
findOptions.sessionToken = options.sessionToken;
|
|
612
|
-
}
|
|
613
|
-
if (options.hasOwnProperty('context') && typeof options.context === 'object') {
|
|
614
|
-
findOptions.context = options.context;
|
|
615
|
-
}
|
|
593
|
+
const findOptions = _ParseObject.default._getRequestOptions(options);
|
|
616
594
|
this._setRequestTask(findOptions);
|
|
617
595
|
const controller = _CoreManager.default.getQueryController();
|
|
618
596
|
const select = this._select;
|
|
@@ -638,7 +616,7 @@ class ParseQuery {
|
|
|
638
616
|
if (select) {
|
|
639
617
|
handleSelectResult(data, select);
|
|
640
618
|
}
|
|
641
|
-
if (
|
|
619
|
+
if (findOptions.json) {
|
|
642
620
|
return data;
|
|
643
621
|
} else {
|
|
644
622
|
return _ParseObject.default.fromJSON(data, !select);
|
|
@@ -666,6 +644,7 @@ class ParseQuery {
|
|
|
666
644
|
* be used for this request.
|
|
667
645
|
* <li>sessionToken: A valid session token, used for making a request on
|
|
668
646
|
* behalf of a specific user.
|
|
647
|
+
* <li>json: Return raw JSON without converting to Parse.Object.
|
|
669
648
|
* </ul>
|
|
670
649
|
* @returns {Promise} A promise that is resolved with the results when
|
|
671
650
|
* the query completes.
|
|
@@ -695,13 +674,7 @@ class ParseQuery {
|
|
|
695
674
|
*/
|
|
696
675
|
count(options) {
|
|
697
676
|
options = options || {};
|
|
698
|
-
const findOptions =
|
|
699
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
700
|
-
findOptions.useMasterKey = options.useMasterKey;
|
|
701
|
-
}
|
|
702
|
-
if (options.hasOwnProperty('sessionToken')) {
|
|
703
|
-
findOptions.sessionToken = options.sessionToken;
|
|
704
|
-
}
|
|
677
|
+
const findOptions = _ParseObject.default._getRequestOptions(options);
|
|
705
678
|
this._setRequestTask(findOptions);
|
|
706
679
|
const controller = _CoreManager.default.getQueryController();
|
|
707
680
|
const params = this.toJSON();
|
|
@@ -725,7 +698,7 @@ class ParseQuery {
|
|
|
725
698
|
const distinctOptions = {
|
|
726
699
|
useMasterKey: true
|
|
727
700
|
};
|
|
728
|
-
if (
|
|
701
|
+
if (Object.hasOwn(options, 'sessionToken')) {
|
|
729
702
|
distinctOptions.sessionToken = options.sessionToken;
|
|
730
703
|
}
|
|
731
704
|
this._setRequestTask(distinctOptions);
|
|
@@ -753,7 +726,7 @@ class ParseQuery {
|
|
|
753
726
|
const aggregateOptions = {
|
|
754
727
|
useMasterKey: true
|
|
755
728
|
};
|
|
756
|
-
if (
|
|
729
|
+
if (Object.hasOwn(options, 'sessionToken')) {
|
|
757
730
|
aggregateOptions.sessionToken = options.sessionToken;
|
|
758
731
|
}
|
|
759
732
|
this._setRequestTask(aggregateOptions);
|
|
@@ -798,16 +771,7 @@ class ParseQuery {
|
|
|
798
771
|
*/
|
|
799
772
|
first() {
|
|
800
773
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
801
|
-
const findOptions =
|
|
802
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
803
|
-
findOptions.useMasterKey = options.useMasterKey;
|
|
804
|
-
}
|
|
805
|
-
if (options.hasOwnProperty('sessionToken')) {
|
|
806
|
-
findOptions.sessionToken = options.sessionToken;
|
|
807
|
-
}
|
|
808
|
-
if (options.hasOwnProperty('context') && typeof options.context === 'object') {
|
|
809
|
-
findOptions.context = options.context;
|
|
810
|
-
}
|
|
774
|
+
const findOptions = _ParseObject.default._getRequestOptions(options);
|
|
811
775
|
this._setRequestTask(findOptions);
|
|
812
776
|
const controller = _CoreManager.default.getQueryController();
|
|
813
777
|
const params = this.toJSON();
|
|
@@ -836,7 +800,7 @@ class ParseQuery {
|
|
|
836
800
|
if (select) {
|
|
837
801
|
handleSelectResult(objects[0], select);
|
|
838
802
|
}
|
|
839
|
-
if (
|
|
803
|
+
if (findOptions.json) {
|
|
840
804
|
return objects[0];
|
|
841
805
|
} else {
|
|
842
806
|
return _ParseObject.default.fromJSON(objects[0], !select);
|
|
@@ -870,45 +834,10 @@ class ParseQuery {
|
|
|
870
834
|
if (this._order || this._skip || this._limit >= 0) {
|
|
871
835
|
return _promise.default.reject('Cannot iterate on a query with sort, skip, or limit.');
|
|
872
836
|
}
|
|
873
|
-
const query =
|
|
874
|
-
query._limit = options.batchSize || 100;
|
|
875
|
-
query._include = [...this._include];
|
|
876
|
-
query._exclude = [...this._exclude];
|
|
877
|
-
if (this._select) {
|
|
878
|
-
query._select = [...this._select];
|
|
879
|
-
}
|
|
880
|
-
query._hint = this._hint;
|
|
881
|
-
query._where = {};
|
|
882
|
-
for (const attr in this._where) {
|
|
883
|
-
const val = this._where[attr];
|
|
884
|
-
if ((0, _isArray.default)(val)) {
|
|
885
|
-
query._where[attr] = (0, _map.default)(val).call(val, v => {
|
|
886
|
-
return v;
|
|
887
|
-
});
|
|
888
|
-
} else if (val && typeof val === 'object') {
|
|
889
|
-
const conditionMap = {};
|
|
890
|
-
query._where[attr] = conditionMap;
|
|
891
|
-
for (const cond in val) {
|
|
892
|
-
conditionMap[cond] = val[cond];
|
|
893
|
-
}
|
|
894
|
-
} else {
|
|
895
|
-
query._where[attr] = val;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
837
|
+
const query = ParseQuery.fromJSON(this.className, this.toJSON());
|
|
898
838
|
query.ascending('objectId');
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
findOptions.useMasterKey = options.useMasterKey;
|
|
902
|
-
}
|
|
903
|
-
if (options.hasOwnProperty('sessionToken')) {
|
|
904
|
-
findOptions.sessionToken = options.sessionToken;
|
|
905
|
-
}
|
|
906
|
-
if (options.hasOwnProperty('context') && typeof options.context === 'object') {
|
|
907
|
-
findOptions.context = options.context;
|
|
908
|
-
}
|
|
909
|
-
if (options.hasOwnProperty('json')) {
|
|
910
|
-
findOptions.json = options.json;
|
|
911
|
-
}
|
|
839
|
+
query._limit = options.batchSize || 100;
|
|
840
|
+
const findOptions = _ParseObject.default._getRequestOptions(options);
|
|
912
841
|
let finished = false;
|
|
913
842
|
let previousResults = [];
|
|
914
843
|
return (0, _promiseUtils.continueWhile)(() => {
|
|
@@ -916,7 +845,11 @@ class ParseQuery {
|
|
|
916
845
|
}, async () => {
|
|
917
846
|
const [results] = await _promise.default.all([(0, _find.default)(query).call(query, findOptions), _promise.default.resolve(previousResults.length > 0 && callback(previousResults))]);
|
|
918
847
|
if (results.length >= query._limit) {
|
|
919
|
-
|
|
848
|
+
if (findOptions.json) {
|
|
849
|
+
query.greaterThan('objectId', results[results.length - 1].objectId);
|
|
850
|
+
} else {
|
|
851
|
+
query.greaterThan('objectId', results[results.length - 1].id);
|
|
852
|
+
}
|
|
920
853
|
previousResults = results;
|
|
921
854
|
} else if (results.length > 0) {
|
|
922
855
|
await _promise.default.resolve(callback(results));
|
|
@@ -58,12 +58,8 @@ class ParseSession extends _ParseObject.default {
|
|
|
58
58
|
* promise will be rejected.
|
|
59
59
|
*/
|
|
60
60
|
static current(options) {
|
|
61
|
-
options = options || {};
|
|
62
61
|
const controller = _CoreManager.default.getSessionController();
|
|
63
|
-
const sessionOptions =
|
|
64
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
65
|
-
sessionOptions.useMasterKey = options.useMasterKey;
|
|
66
|
-
}
|
|
62
|
+
const sessionOptions = _ParseObject.default._getRequestOptions(options);
|
|
67
63
|
return _ParseUser.default.currentAsync().then(user => {
|
|
68
64
|
if (!user) {
|
|
69
65
|
return _promise.default.reject('There is no current user.');
|
package/lib/weapp/ParseUser.js
CHANGED
|
@@ -47,15 +47,15 @@ class ParseUser extends _ParseObject.default {
|
|
|
47
47
|
* Request a revocable session token to replace the older style of token.
|
|
48
48
|
*
|
|
49
49
|
* @param {object} options
|
|
50
|
+
* Valid options are:<ul>
|
|
51
|
+
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
52
|
+
* be used for this request.
|
|
53
|
+
* </ul>
|
|
50
54
|
* @returns {Promise} A promise that is resolved when the replacement
|
|
51
55
|
* token has been fetched.
|
|
52
56
|
*/
|
|
53
57
|
_upgradeToRevocableSession(options) {
|
|
54
|
-
|
|
55
|
-
const upgradeOptions = {};
|
|
56
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
57
|
-
upgradeOptions.useMasterKey = options.useMasterKey;
|
|
58
|
-
}
|
|
58
|
+
const upgradeOptions = _ParseObject.default._getRequestOptions(options);
|
|
59
59
|
const controller = _CoreManager.default.getUserController();
|
|
60
60
|
return controller.upgradeToRevocableSession(this, upgradeOptions);
|
|
61
61
|
}
|
|
@@ -99,7 +99,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
99
99
|
} else {
|
|
100
100
|
authType = provider.getAuthType();
|
|
101
101
|
}
|
|
102
|
-
if (options &&
|
|
102
|
+
if (options && Object.hasOwn(options, 'authData')) {
|
|
103
103
|
const authData = this.get('authData') || {};
|
|
104
104
|
if (typeof authData !== 'object') {
|
|
105
105
|
throw new Error('Invalid type: authData field should be an object');
|
|
@@ -305,7 +305,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
305
305
|
}
|
|
306
306
|
stripAnonymity() {
|
|
307
307
|
const authData = this.get('authData');
|
|
308
|
-
if (authData && typeof authData === 'object' &&
|
|
308
|
+
if (authData && typeof authData === 'object' && Object.hasOwn(authData, 'anonymous')) {
|
|
309
309
|
// We need to set anonymous to null instead of deleting it in order to remove it from Parse.
|
|
310
310
|
authData.anonymous = null;
|
|
311
311
|
}
|
|
@@ -407,21 +407,17 @@ class ParseUser extends _ParseObject.default {
|
|
|
407
407
|
*
|
|
408
408
|
* @param {object} attrs Extra fields to set on the new user, or null.
|
|
409
409
|
* @param {object} options
|
|
410
|
+
* Valid options are:<ul>
|
|
411
|
+
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
412
|
+
* be used for this request.
|
|
413
|
+
* <li>installationId: the installationId which made the request
|
|
414
|
+
* <li>context: A dictionary that is accessible in Cloud Code `beforeLogin` and `afterLogin` triggers.
|
|
415
|
+
* </ul>
|
|
410
416
|
* @returns {Promise} A promise that is fulfilled when the signup
|
|
411
417
|
* finishes.
|
|
412
418
|
*/
|
|
413
419
|
signUp(attrs, options) {
|
|
414
|
-
|
|
415
|
-
const signupOptions = {};
|
|
416
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
417
|
-
signupOptions.useMasterKey = options.useMasterKey;
|
|
418
|
-
}
|
|
419
|
-
if (options.hasOwnProperty('installationId')) {
|
|
420
|
-
signupOptions.installationId = options.installationId;
|
|
421
|
-
}
|
|
422
|
-
if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
|
|
423
|
-
signupOptions.context = options.context;
|
|
424
|
-
}
|
|
420
|
+
const signupOptions = _ParseObject.default._getRequestOptions(options);
|
|
425
421
|
const controller = _CoreManager.default.getUserController();
|
|
426
422
|
return controller.signUp(this, attrs, signupOptions);
|
|
427
423
|
}
|
|
@@ -434,26 +430,21 @@ class ParseUser extends _ParseObject.default {
|
|
|
434
430
|
* <p>A username and password must be set before calling logIn.</p>
|
|
435
431
|
*
|
|
436
432
|
* @param {object} options
|
|
433
|
+
* Valid options are:<ul>
|
|
434
|
+
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
435
|
+
* be used for this request.
|
|
436
|
+
* <li>usePost: Use POST method to make the request (default: true)
|
|
437
|
+
* <li>installationId: the installationId which made the request
|
|
438
|
+
* <li>context: A dictionary that is accessible in Cloud Code `beforeLogin` and `afterLogin` triggers.
|
|
439
|
+
* </ul>
|
|
437
440
|
* @returns {Promise} A promise that is fulfilled with the user when
|
|
438
441
|
* the login is complete.
|
|
439
442
|
*/
|
|
440
443
|
logIn() {
|
|
441
444
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
usePost
|
|
445
|
-
};
|
|
446
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
447
|
-
loginOptions.useMasterKey = options.useMasterKey;
|
|
448
|
-
}
|
|
449
|
-
if (options.hasOwnProperty('installationId')) {
|
|
450
|
-
loginOptions.installationId = options.installationId;
|
|
451
|
-
}
|
|
452
|
-
if (options.hasOwnProperty('usePost')) {
|
|
453
|
-
loginOptions.usePost = options.usePost;
|
|
454
|
-
}
|
|
455
|
-
if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
|
|
456
|
-
loginOptions.context = options.context;
|
|
445
|
+
const loginOptions = _ParseObject.default._getRequestOptions(options);
|
|
446
|
+
if (!Object.hasOwn(loginOptions, 'usePost')) {
|
|
447
|
+
loginOptions.usePost = true;
|
|
457
448
|
}
|
|
458
449
|
const controller = _CoreManager.default.getUserController();
|
|
459
450
|
return controller.logIn(this, loginOptions);
|
|
@@ -724,6 +715,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
724
715
|
*
|
|
725
716
|
* @param {string} sessionToken The sessionToken to log in with.
|
|
726
717
|
* @param {object} options
|
|
718
|
+
* @param {boolean} [options.useMasterKey]
|
|
727
719
|
* @static
|
|
728
720
|
* @returns {Promise} A promise that is fulfilled with the user when
|
|
729
721
|
* the login completes.
|
|
@@ -732,13 +724,8 @@ class ParseUser extends _ParseObject.default {
|
|
|
732
724
|
if (!canUseCurrentUser) {
|
|
733
725
|
throw new Error('It is not memory-safe to become a user in a server environment');
|
|
734
726
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
sessionToken: sessionToken
|
|
738
|
-
};
|
|
739
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
740
|
-
becomeOptions.useMasterKey = options.useMasterKey;
|
|
741
|
-
}
|
|
727
|
+
const becomeOptions = _ParseObject.default._getRequestOptions(options);
|
|
728
|
+
becomeOptions.sessionToken = sessionToken;
|
|
742
729
|
const controller = _CoreManager.default.getUserController();
|
|
743
730
|
const user = new this();
|
|
744
731
|
return controller.become(user, becomeOptions);
|
|
@@ -749,18 +736,15 @@ class ParseUser extends _ParseObject.default {
|
|
|
749
736
|
*
|
|
750
737
|
* @param {string} sessionToken The sessionToken to get user with.
|
|
751
738
|
* @param {object} options
|
|
739
|
+
* @param {boolean} [options.useMasterKey]
|
|
752
740
|
* @static
|
|
753
741
|
* @returns {Promise} A promise that is fulfilled with the user is fetched.
|
|
754
742
|
*/
|
|
755
743
|
static me(sessionToken) {
|
|
756
744
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
757
745
|
const controller = _CoreManager.default.getUserController();
|
|
758
|
-
const meOptions =
|
|
759
|
-
|
|
760
|
-
};
|
|
761
|
-
if (options.useMasterKey) {
|
|
762
|
-
meOptions.useMasterKey = options.useMasterKey;
|
|
763
|
-
}
|
|
746
|
+
const meOptions = _ParseObject.default._getRequestOptions(options);
|
|
747
|
+
meOptions.sessionToken = sessionToken;
|
|
764
748
|
const user = new this();
|
|
765
749
|
return controller.me(user, meOptions);
|
|
766
750
|
}
|
|
@@ -820,15 +804,15 @@ class ParseUser extends _ParseObject.default {
|
|
|
820
804
|
* @param {string} email The email address associated with the user that
|
|
821
805
|
* forgot their password.
|
|
822
806
|
* @param {object} options
|
|
807
|
+
* Valid options are:<ul>
|
|
808
|
+
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
809
|
+
* be used for this request.
|
|
810
|
+
* </ul>
|
|
823
811
|
* @static
|
|
824
812
|
* @returns {Promise}
|
|
825
813
|
*/
|
|
826
814
|
static requestPasswordReset(email, options) {
|
|
827
|
-
|
|
828
|
-
const requestOptions = {};
|
|
829
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
830
|
-
requestOptions.useMasterKey = options.useMasterKey;
|
|
831
|
-
}
|
|
815
|
+
const requestOptions = _ParseObject.default._getRequestOptions(options);
|
|
832
816
|
const controller = _CoreManager.default.getUserController();
|
|
833
817
|
return controller.requestPasswordReset(email, requestOptions);
|
|
834
818
|
}
|
|
@@ -839,15 +823,15 @@ class ParseUser extends _ParseObject.default {
|
|
|
839
823
|
* @param {string} email The email address associated with the user that
|
|
840
824
|
* needs to verify their email.
|
|
841
825
|
* @param {object} options
|
|
826
|
+
* Valid options are:<ul>
|
|
827
|
+
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
828
|
+
* be used for this request.
|
|
829
|
+
* </ul>
|
|
842
830
|
* @static
|
|
843
831
|
* @returns {Promise}
|
|
844
832
|
*/
|
|
845
833
|
static requestEmailVerification(email, options) {
|
|
846
|
-
|
|
847
|
-
const requestOptions = {};
|
|
848
|
-
if (options.hasOwnProperty('useMasterKey')) {
|
|
849
|
-
requestOptions.useMasterKey = options.useMasterKey;
|
|
850
|
-
}
|
|
834
|
+
const requestOptions = _ParseObject.default._getRequestOptions(options);
|
|
851
835
|
const controller = _CoreManager.default.getUserController();
|
|
852
836
|
return controller.requestEmailVerification(email, requestOptions);
|
|
853
837
|
}
|
package/lib/weapp/Push.js
CHANGED
|
@@ -62,7 +62,7 @@ function send(data) {
|
|
|
62
62
|
const pushOptions = {
|
|
63
63
|
useMasterKey: true
|
|
64
64
|
};
|
|
65
|
-
if (
|
|
65
|
+
if (Object.hasOwn(options, 'useMasterKey')) {
|
|
66
66
|
pushOptions.useMasterKey = options.useMasterKey;
|
|
67
67
|
}
|
|
68
68
|
return _CoreManager.default.getPushController().send(data, pushOptions);
|
|
@@ -86,7 +86,7 @@ function getPushStatus(pushStatusId) {
|
|
|
86
86
|
const pushOptions = {
|
|
87
87
|
useMasterKey: true
|
|
88
88
|
};
|
|
89
|
-
if (
|
|
89
|
+
if (Object.hasOwn(options, 'useMasterKey')) {
|
|
90
90
|
pushOptions.useMasterKey = options.useMasterKey;
|
|
91
91
|
}
|
|
92
92
|
const query = new _ParseQuery.default('_PushStatus');
|
package/lib/weapp/Storage.js
CHANGED
|
@@ -12,7 +12,7 @@ const memMap = {};
|
|
|
12
12
|
const StorageController = {
|
|
13
13
|
async: 0,
|
|
14
14
|
getItem(path) {
|
|
15
|
-
if (
|
|
15
|
+
if (Object.hasOwn(memMap, path)) {
|
|
16
16
|
return memMap[path];
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
@@ -28,7 +28,7 @@ const StorageController = {
|
|
|
28
28
|
},
|
|
29
29
|
clear() {
|
|
30
30
|
for (const key in memMap) {
|
|
31
|
-
if (
|
|
31
|
+
if (Object.hasOwn(memMap, key)) {
|
|
32
32
|
delete memMap[key];
|
|
33
33
|
}
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "5.3.0-alpha.
|
|
3
|
+
"version": "5.3.0-alpha.6",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@babel/core": "7.26.7",
|
|
41
41
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
42
42
|
"@babel/plugin-transform-runtime": "7.26.8",
|
|
43
|
-
"@babel/preset-env": "7.26.
|
|
43
|
+
"@babel/preset-env": "7.26.8",
|
|
44
44
|
"@babel/preset-react": "7.26.3",
|
|
45
45
|
"@babel/preset-typescript": "7.26.0",
|
|
46
46
|
"@definitelytyped/dtslint": "0.0.163",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"codecov": "3.8.3",
|
|
63
63
|
"core-js": "3.40.0",
|
|
64
64
|
"cross-env": "7.0.2",
|
|
65
|
-
"eslint": "9.20.
|
|
65
|
+
"eslint": "9.20.1",
|
|
66
66
|
"eslint-plugin-jsdoc": "50.6.3",
|
|
67
67
|
"express": "4.21.2",
|
|
68
68
|
"gulp": "5.0.0",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"lint-staged": "15.4.3",
|
|
84
84
|
"madge": "8.0.0",
|
|
85
85
|
"metro-react-native-babel-preset": "0.77.0",
|
|
86
|
-
"mongodb-runner": "5.
|
|
86
|
+
"mongodb-runner": "5.8.0",
|
|
87
87
|
"parse-server": "7.3.0",
|
|
88
|
-
"prettier": "3.5.
|
|
88
|
+
"prettier": "3.5.1",
|
|
89
89
|
"puppeteer": "24.2.0",
|
|
90
90
|
"regenerator-runtime": "0.14.1",
|
|
91
91
|
"semantic-release": "24.2.2",
|