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.
- package/README.md +0 -1
- package/dist/parse.js +70 -62
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +70 -62
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Cloud.js +1 -0
- package/lib/browser/CoreManager.js +2 -1
- package/lib/browser/EventuallyQueue.js +6 -9
- package/lib/browser/LiveQuerySubscription.js +4 -4
- package/lib/browser/Parse.js +12 -1
- package/lib/browser/ParseACL.js +1 -1
- package/lib/browser/ParseConfig.js +2 -4
- package/lib/browser/ParseLiveQuery.js +2 -2
- package/lib/browser/ParseObject.js +12 -12
- package/lib/browser/ParseQuery.js +7 -8
- package/lib/browser/ParseRole.js +1 -1
- package/lib/browser/ParseSchema.js +6 -6
- package/lib/browser/ParseUser.js +10 -12
- package/lib/browser/RESTController.js +3 -0
- package/lib/node/Cloud.js +1 -0
- package/lib/node/CoreManager.js +2 -1
- package/lib/node/EventuallyQueue.js +6 -6
- package/lib/node/LiveQuerySubscription.js +4 -4
- package/lib/node/Parse.js +12 -1
- package/lib/node/ParseACL.js +1 -1
- package/lib/node/ParseConfig.js +2 -2
- package/lib/node/ParseLiveQuery.js +2 -2
- package/lib/node/ParseObject.js +12 -9
- package/lib/node/ParseQuery.js +7 -7
- package/lib/node/ParseRole.js +1 -1
- package/lib/node/ParseSchema.js +6 -4
- package/lib/node/ParseUser.js +10 -10
- package/lib/node/RESTController.js +3 -0
- package/lib/react-native/CoreManager.js +2 -1
- package/lib/react-native/EventuallyQueue.js +5 -8
- package/lib/react-native/LiveQuerySubscription.js +7 -7
- package/lib/react-native/Parse.js +8 -1
- package/lib/react-native/ParseConfig.js +2 -4
- package/lib/react-native/ParseLiveQuery.js +2 -2
- package/lib/react-native/ParseObject.js +16 -18
- package/lib/react-native/ParseQuery.js +5 -6
- package/lib/react-native/ParseSchema.js +5 -6
- package/lib/react-native/ParseUser.js +3 -5
- package/lib/react-native/RESTController.js +3 -0
- package/lib/weapp/Cloud.js +1 -0
- package/lib/weapp/CoreManager.js +2 -1
- package/lib/weapp/EventuallyQueue.js +6 -9
- package/lib/weapp/LiveQuerySubscription.js +4 -4
- package/lib/weapp/Parse.js +12 -1
- package/lib/weapp/ParseACL.js +1 -1
- package/lib/weapp/ParseConfig.js +2 -4
- package/lib/weapp/ParseLiveQuery.js +2 -2
- package/lib/weapp/ParseObject.js +12 -12
- package/lib/weapp/ParseQuery.js +7 -8
- package/lib/weapp/ParseRole.js +1 -1
- package/lib/weapp/ParseSchema.js +6 -6
- package/lib/weapp/ParseUser.js +10 -12
- package/lib/weapp/RESTController.js +3 -0
- package/package.json +8 -6
|
@@ -40,8 +40,7 @@ const EventuallyQueue = {
|
|
|
40
40
|
* @static
|
|
41
41
|
* @see Parse.Object#saveEventually
|
|
42
42
|
*/
|
|
43
|
-
save(object) {
|
|
44
|
-
let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43
|
+
save(object, serverOptions) {
|
|
45
44
|
return this.enqueue('save', object, serverOptions);
|
|
46
45
|
},
|
|
47
46
|
/**
|
|
@@ -55,8 +54,7 @@ const EventuallyQueue = {
|
|
|
55
54
|
* @static
|
|
56
55
|
* @see Parse.Object#destroyEventually
|
|
57
56
|
*/
|
|
58
|
-
destroy(object) {
|
|
59
|
-
let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
57
|
+
destroy(object, serverOptions) {
|
|
60
58
|
return this.enqueue('destroy', object, serverOptions);
|
|
61
59
|
},
|
|
62
60
|
/**
|
|
@@ -106,7 +104,7 @@ const EventuallyQueue = {
|
|
|
106
104
|
queueId,
|
|
107
105
|
action,
|
|
108
106
|
object: object.toJSON(),
|
|
109
|
-
serverOptions,
|
|
107
|
+
serverOptions: serverOptions || {},
|
|
110
108
|
id: object.id,
|
|
111
109
|
className: object.className,
|
|
112
110
|
hash: object.get('hash'),
|
|
@@ -125,7 +123,7 @@ const EventuallyQueue = {
|
|
|
125
123
|
*
|
|
126
124
|
* @function getQueue
|
|
127
125
|
* @name Parse.EventuallyQueue.getQueue
|
|
128
|
-
* @returns {Promise<
|
|
126
|
+
* @returns {Promise<Queue>}
|
|
129
127
|
* @static
|
|
130
128
|
*/
|
|
131
129
|
async getQueue() {
|
|
@@ -280,8 +278,7 @@ const EventuallyQueue = {
|
|
|
280
278
|
* @param [ms] Milliseconds to ping the server. Default 2000ms
|
|
281
279
|
* @static
|
|
282
280
|
*/
|
|
283
|
-
poll() {
|
|
284
|
-
let ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
|
|
281
|
+
poll(ms) {
|
|
285
282
|
if (polling) {
|
|
286
283
|
return;
|
|
287
284
|
}
|
|
@@ -296,7 +293,7 @@ const EventuallyQueue = {
|
|
|
296
293
|
return this.sendQueue();
|
|
297
294
|
}
|
|
298
295
|
}).catch(e => e);
|
|
299
|
-
}, ms);
|
|
296
|
+
}, ms || 2000);
|
|
300
297
|
},
|
|
301
298
|
/**
|
|
302
299
|
* Turns off polling.
|
|
@@ -91,7 +91,7 @@ var _promiseUtils = require("./promiseUtils");
|
|
|
91
91
|
*
|
|
92
92
|
* });</pre></p>
|
|
93
93
|
*/
|
|
94
|
-
class
|
|
94
|
+
class LiveQuerySubscription {
|
|
95
95
|
/*
|
|
96
96
|
* @param {string | number} id - subscription id
|
|
97
97
|
* @param {string} query - query to subscribe to
|
|
@@ -114,8 +114,8 @@ class Subscription {
|
|
|
114
114
|
this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
|
|
115
115
|
this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
|
|
116
116
|
this.subscribed = false;
|
|
117
|
-
const
|
|
118
|
-
this.emitter = new
|
|
117
|
+
const Emitter = _CoreManager.default.getEventEmitter();
|
|
118
|
+
this.emitter = new Emitter();
|
|
119
119
|
this.on = (eventName, listener) => this.emitter.on(eventName, listener);
|
|
120
120
|
this.emit = function (eventName) {
|
|
121
121
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -140,4 +140,4 @@ class Subscription {
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
var _default = exports.default =
|
|
143
|
+
var _default = exports.default = LiveQuerySubscription;
|
package/lib/weapp/Parse.js
CHANGED
|
@@ -129,9 +129,10 @@ const Parse = {
|
|
|
129
129
|
initialize(applicationId, javaScriptKey) {
|
|
130
130
|
Parse._initialize(applicationId, javaScriptKey);
|
|
131
131
|
},
|
|
132
|
-
_initialize(applicationId, javaScriptKey, masterKey) {
|
|
132
|
+
_initialize(applicationId, javaScriptKey, masterKey, maintenanceKey) {
|
|
133
133
|
_CoreManager.default.set('APPLICATION_ID', applicationId);
|
|
134
134
|
_CoreManager.default.set('JAVASCRIPT_KEY', javaScriptKey);
|
|
135
|
+
_CoreManager.default.set('MAINTENANCE_KEY', maintenanceKey);
|
|
135
136
|
_CoreManager.default.set('MASTER_KEY', masterKey);
|
|
136
137
|
_CoreManager.default.set('USE_MASTER_KEY', false);
|
|
137
138
|
_CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
|
|
@@ -203,6 +204,16 @@ const Parse = {
|
|
|
203
204
|
get masterKey() {
|
|
204
205
|
return _CoreManager.default.get('MASTER_KEY');
|
|
205
206
|
},
|
|
207
|
+
/**
|
|
208
|
+
* @member {string} Parse.maintenanceKey
|
|
209
|
+
* @static
|
|
210
|
+
*/
|
|
211
|
+
set maintenanceKey(value) {
|
|
212
|
+
_CoreManager.default.set('MAINTENANCE_KEY', value);
|
|
213
|
+
},
|
|
214
|
+
get maintenanceKey() {
|
|
215
|
+
return _CoreManager.default.get('MAINTENANCE_KEY');
|
|
216
|
+
},
|
|
206
217
|
/**
|
|
207
218
|
* @member {string} Parse.serverURL
|
|
208
219
|
* @static
|
package/lib/weapp/ParseACL.js
CHANGED
|
@@ -27,7 +27,7 @@ const PUBLIC_KEY = '*';
|
|
|
27
27
|
*/
|
|
28
28
|
class ParseACL {
|
|
29
29
|
/**
|
|
30
|
-
* @param {(Parse.User | object)} arg1 The user to initialize the ACL for
|
|
30
|
+
* @param {(Parse.User | object | null)} arg1 The user to initialize the ACL for
|
|
31
31
|
*/
|
|
32
32
|
constructor(arg1) {
|
|
33
33
|
(0, _defineProperty2.default)(this, "permissionsById", void 0);
|
package/lib/weapp/ParseConfig.js
CHANGED
|
@@ -84,8 +84,7 @@ class ParseConfig {
|
|
|
84
84
|
* @returns {Promise} A promise that is resolved with a newly-created
|
|
85
85
|
* configuration object when the get completes.
|
|
86
86
|
*/
|
|
87
|
-
static get() {
|
|
88
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87
|
+
static get(options) {
|
|
89
88
|
const controller = _CoreManager.default.getConfigController();
|
|
90
89
|
return controller.get(options);
|
|
91
90
|
}
|
|
@@ -166,8 +165,7 @@ const DefaultController = {
|
|
|
166
165
|
return config;
|
|
167
166
|
});
|
|
168
167
|
},
|
|
169
|
-
get() {
|
|
170
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
168
|
+
get(options) {
|
|
171
169
|
const RESTController = _CoreManager.default.getRESTController();
|
|
172
170
|
return RESTController.request('GET', 'config', {}, options).then(response => {
|
|
173
171
|
if (!response || !response.params) {
|
|
@@ -48,8 +48,8 @@ class LiveQuery {
|
|
|
48
48
|
(0, _defineProperty2.default)(this, "emitter", void 0);
|
|
49
49
|
(0, _defineProperty2.default)(this, "on", void 0);
|
|
50
50
|
(0, _defineProperty2.default)(this, "emit", void 0);
|
|
51
|
-
const
|
|
52
|
-
this.emitter = new
|
|
51
|
+
const Emitter = _CoreManager.default.getEventEmitter();
|
|
52
|
+
this.emitter = new Emitter();
|
|
53
53
|
this.on = (eventName, listener) => this.emitter.on(eventName, listener);
|
|
54
54
|
this.emit = function (eventName) {
|
|
55
55
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
package/lib/weapp/ParseObject.js
CHANGED
|
@@ -214,7 +214,7 @@ class ParseObject {
|
|
|
214
214
|
id = this._getId();
|
|
215
215
|
}
|
|
216
216
|
return {
|
|
217
|
-
id
|
|
217
|
+
id,
|
|
218
218
|
className: this.className
|
|
219
219
|
};
|
|
220
220
|
} else {
|
|
@@ -440,6 +440,9 @@ class ParseObject {
|
|
|
440
440
|
if (hasOwn(options, 'useMasterKey')) {
|
|
441
441
|
requestOptions.useMasterKey = !!options.useMasterKey;
|
|
442
442
|
}
|
|
443
|
+
if (hasOwn(options, 'useMaintenanceKey')) {
|
|
444
|
+
requestOptions.useMaintenanceKey = !!options.useMaintenanceKey;
|
|
445
|
+
}
|
|
443
446
|
if (hasOwn(options, 'sessionToken') && typeof options.sessionToken === 'string') {
|
|
444
447
|
requestOptions.sessionToken = options.sessionToken;
|
|
445
448
|
}
|
|
@@ -1050,8 +1053,8 @@ class ParseObject {
|
|
|
1050
1053
|
return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
|
|
1051
1054
|
}
|
|
1052
1055
|
for (const key in attrs) {
|
|
1053
|
-
if (!/^[A-Za-
|
|
1054
|
-
return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name:
|
|
1056
|
+
if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(key)) {
|
|
1057
|
+
return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: ${key}`);
|
|
1055
1058
|
}
|
|
1056
1059
|
}
|
|
1057
1060
|
return false;
|
|
@@ -1274,6 +1277,7 @@ class ParseObject {
|
|
|
1274
1277
|
* @returns {Promise} A promise that is fulfilled when the save
|
|
1275
1278
|
* completes.
|
|
1276
1279
|
*/
|
|
1280
|
+
|
|
1277
1281
|
async save(arg1, arg2, arg3) {
|
|
1278
1282
|
let attrs;
|
|
1279
1283
|
let options;
|
|
@@ -1304,9 +1308,8 @@ class ParseObject {
|
|
|
1304
1308
|
const filePromise = unsavedFiles.length ? controller.save(unsavedFiles, saveOptions) : _promise.default.resolve();
|
|
1305
1309
|
return filePromise.then(() => controller.save(unsavedObjects, saveOptions)).then(savedOjbects => savedOjbects.pop());
|
|
1306
1310
|
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
});
|
|
1311
|
+
await controller.save(unsaved, saveOptions);
|
|
1312
|
+
return controller.save(this, saveOptions);
|
|
1310
1313
|
}
|
|
1311
1314
|
|
|
1312
1315
|
/**
|
|
@@ -1512,8 +1515,7 @@ class ParseObject {
|
|
|
1512
1515
|
* @static
|
|
1513
1516
|
* @returns {Parse.Object[]}
|
|
1514
1517
|
*/
|
|
1515
|
-
static fetchAll(list) {
|
|
1516
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1518
|
+
static fetchAll(list, options) {
|
|
1517
1519
|
const fetchOptions = ParseObject._getRequestOptions(options);
|
|
1518
1520
|
return _CoreManager.default.getObjectController().fetch(list, true, fetchOptions);
|
|
1519
1521
|
}
|
|
@@ -1692,8 +1694,7 @@ class ParseObject {
|
|
|
1692
1694
|
* @returns {Promise} A promise that is fulfilled when the destroyAll
|
|
1693
1695
|
* completes.
|
|
1694
1696
|
*/
|
|
1695
|
-
static destroyAll(list) {
|
|
1696
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1697
|
+
static destroyAll(list, options) {
|
|
1697
1698
|
const destroyOptions = ParseObject._getRequestOptions(options);
|
|
1698
1699
|
return _CoreManager.default.getObjectController().destroy(list, destroyOptions);
|
|
1699
1700
|
}
|
|
@@ -1727,8 +1728,7 @@ class ParseObject {
|
|
|
1727
1728
|
* @static
|
|
1728
1729
|
* @returns {Parse.Object[]}
|
|
1729
1730
|
*/
|
|
1730
|
-
static saveAll(list) {
|
|
1731
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1731
|
+
static saveAll(list, options) {
|
|
1732
1732
|
const saveOptions = ParseObject._getRequestOptions(options);
|
|
1733
1733
|
return _CoreManager.default.getObjectController().save(list, saveOptions);
|
|
1734
1734
|
}
|
package/lib/weapp/ParseQuery.js
CHANGED
|
@@ -1137,11 +1137,11 @@ class ParseQuery {
|
|
|
1137
1137
|
* be contained in the provided list of values.
|
|
1138
1138
|
*
|
|
1139
1139
|
* @param {string} key The key to check.
|
|
1140
|
-
* @param {Array<*>}
|
|
1140
|
+
* @param {Array<*>} values The values that will match.
|
|
1141
1141
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1142
1142
|
*/
|
|
1143
|
-
containedIn(key,
|
|
1144
|
-
return this._addCondition(key, '$in',
|
|
1143
|
+
containedIn(key, values) {
|
|
1144
|
+
return this._addCondition(key, '$in', values);
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
1147
|
/**
|
|
@@ -1149,11 +1149,11 @@ class ParseQuery {
|
|
|
1149
1149
|
* not be contained in the provided list of values.
|
|
1150
1150
|
*
|
|
1151
1151
|
* @param {string} key The key to check.
|
|
1152
|
-
* @param {Array<*>}
|
|
1152
|
+
* @param {Array<*>} values The values that will not match.
|
|
1153
1153
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1154
1154
|
*/
|
|
1155
|
-
notContainedIn(key,
|
|
1156
|
-
return this._addCondition(key, '$nin',
|
|
1155
|
+
notContainedIn(key, values) {
|
|
1156
|
+
return this._addCondition(key, '$nin', values);
|
|
1157
1157
|
}
|
|
1158
1158
|
|
|
1159
1159
|
/**
|
|
@@ -1363,8 +1363,7 @@ class ParseQuery {
|
|
|
1363
1363
|
* @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search.
|
|
1364
1364
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1365
1365
|
*/
|
|
1366
|
-
fullText(key, value) {
|
|
1367
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1366
|
+
fullText(key, value, options) {
|
|
1368
1367
|
options = options || {};
|
|
1369
1368
|
if (!key) {
|
|
1370
1369
|
throw new Error('A key is required.');
|
package/lib/weapp/ParseRole.js
CHANGED
|
@@ -66,7 +66,7 @@ class ParseRole extends _ParseObject.default {
|
|
|
66
66
|
* @param {string} name The name of the role.
|
|
67
67
|
* @param {object} options Standard options object with success and error
|
|
68
68
|
* callbacks.
|
|
69
|
-
* @returns {
|
|
69
|
+
* @returns {Parse.Object} Returns the object, so you can chain this call.
|
|
70
70
|
*/
|
|
71
71
|
setName(name, options) {
|
|
72
72
|
this._validateName(name);
|
package/lib/weapp/ParseSchema.js
CHANGED
|
@@ -12,6 +12,7 @@ var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
|
12
12
|
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
13
13
|
var _ParseCLP = _interopRequireDefault(require("./ParseCLP"));
|
|
14
14
|
const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* A Parse.Schema object is for handling schema data from Parse.
|
|
17
18
|
* <p>All the schemas methods require MasterKey.
|
|
@@ -186,9 +187,9 @@ class ParseSchema {
|
|
|
186
187
|
* </ul>
|
|
187
188
|
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
|
|
188
189
|
*/
|
|
189
|
-
addField(name, type) {
|
|
190
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
190
|
+
addField(name, type, options) {
|
|
191
191
|
type = type || 'String';
|
|
192
|
+
options = options || {};
|
|
192
193
|
if (!name) {
|
|
193
194
|
throw new Error('field name may not be null.');
|
|
194
195
|
}
|
|
@@ -370,8 +371,7 @@ class ParseSchema {
|
|
|
370
371
|
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
|
|
371
372
|
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
|
|
372
373
|
*/
|
|
373
|
-
addPointer(name, targetClass) {
|
|
374
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
374
|
+
addPointer(name, targetClass, options) {
|
|
375
375
|
if (!name) {
|
|
376
376
|
throw new Error('field name may not be null.');
|
|
377
377
|
}
|
|
@@ -382,10 +382,10 @@ class ParseSchema {
|
|
|
382
382
|
type: 'Pointer',
|
|
383
383
|
targetClass
|
|
384
384
|
};
|
|
385
|
-
if (typeof options
|
|
385
|
+
if (typeof options?.required === 'boolean') {
|
|
386
386
|
fieldOptions.required = options.required;
|
|
387
387
|
}
|
|
388
|
-
if (options
|
|
388
|
+
if (options?.defaultValue !== undefined) {
|
|
389
389
|
fieldOptions.defaultValue = options.defaultValue;
|
|
390
390
|
if (options.defaultValue instanceof _ParseObject.default) {
|
|
391
391
|
fieldOptions.defaultValue = options.defaultValue.toPointer();
|
package/lib/weapp/ParseUser.js
CHANGED
|
@@ -586,7 +586,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
586
586
|
* either from memory or localStorage, if necessary.
|
|
587
587
|
*
|
|
588
588
|
* @static
|
|
589
|
-
* @returns {Parse.
|
|
589
|
+
* @returns {Parse.User} The currently logged in Parse.User.
|
|
590
590
|
*/
|
|
591
591
|
static current() {
|
|
592
592
|
if (!canUseCurrentUser) {
|
|
@@ -653,8 +653,8 @@ class ParseUser extends _ParseObject.default {
|
|
|
653
653
|
}
|
|
654
654
|
const user = new this();
|
|
655
655
|
user._finishFetch({
|
|
656
|
-
username
|
|
657
|
-
password
|
|
656
|
+
username,
|
|
657
|
+
password
|
|
658
658
|
});
|
|
659
659
|
return user.logIn(options);
|
|
660
660
|
}
|
|
@@ -684,8 +684,8 @@ class ParseUser extends _ParseObject.default {
|
|
|
684
684
|
}
|
|
685
685
|
const user = new this();
|
|
686
686
|
user._finishFetch({
|
|
687
|
-
username
|
|
688
|
-
password
|
|
687
|
+
username,
|
|
688
|
+
password,
|
|
689
689
|
authData
|
|
690
690
|
});
|
|
691
691
|
return user.logIn(options);
|
|
@@ -742,8 +742,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
742
742
|
* @static
|
|
743
743
|
* @returns {Promise} A promise that is fulfilled with the user is fetched.
|
|
744
744
|
*/
|
|
745
|
-
static me(sessionToken) {
|
|
746
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
745
|
+
static me(sessionToken, options) {
|
|
747
746
|
const controller = _CoreManager.default.getUserController();
|
|
748
747
|
const meOptions = _ParseObject.default._getRequestOptions(options);
|
|
749
748
|
meOptions.sessionToken = sessionToken;
|
|
@@ -792,8 +791,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
792
791
|
* @returns {Promise} A promise that is resolved when the session is
|
|
793
792
|
* destroyed on the server.
|
|
794
793
|
*/
|
|
795
|
-
static logOut() {
|
|
796
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
794
|
+
static logOut(options) {
|
|
797
795
|
const controller = _CoreManager.default.getUserController();
|
|
798
796
|
return controller.logOut(options);
|
|
799
797
|
}
|
|
@@ -1154,7 +1152,7 @@ const DefaultController = {
|
|
|
1154
1152
|
},
|
|
1155
1153
|
logOut(options) {
|
|
1156
1154
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1157
|
-
if (options
|
|
1155
|
+
if (options?.sessionToken) {
|
|
1158
1156
|
return RESTController.request('POST', 'logout', {}, options);
|
|
1159
1157
|
}
|
|
1160
1158
|
return DefaultController.currentUserAsync().then(currentUser => {
|
|
@@ -1182,7 +1180,7 @@ const DefaultController = {
|
|
|
1182
1180
|
requestPasswordReset(email, options) {
|
|
1183
1181
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1184
1182
|
return RESTController.request('POST', 'requestPasswordReset', {
|
|
1185
|
-
email
|
|
1183
|
+
email
|
|
1186
1184
|
}, options);
|
|
1187
1185
|
},
|
|
1188
1186
|
async upgradeToRevocableSession(user, options) {
|
|
@@ -1226,7 +1224,7 @@ const DefaultController = {
|
|
|
1226
1224
|
requestEmailVerification(email, options) {
|
|
1227
1225
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1228
1226
|
return RESTController.request('POST', 'verificationEmailRequest', {
|
|
1229
|
-
email
|
|
1227
|
+
email
|
|
1230
1228
|
}, options);
|
|
1231
1229
|
}
|
|
1232
1230
|
};
|
|
@@ -234,6 +234,9 @@ const RESTController = {
|
|
|
234
234
|
throw new Error('Cannot use the Master Key, it has not been provided.');
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
+
if (options.useMaintenanceKey) {
|
|
238
|
+
payload._MaintenanceKey = _CoreManager.default.get('MAINTENANCE_KEY');
|
|
239
|
+
}
|
|
237
240
|
if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
|
|
238
241
|
payload._RevocableSession = '1';
|
|
239
242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.1.0-alpha.2",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@babel/preset-env": "7.26.9",
|
|
44
44
|
"@babel/preset-react": "7.26.3",
|
|
45
45
|
"@babel/preset-typescript": "7.26.0",
|
|
46
|
-
"@eslint/js": "9.
|
|
46
|
+
"@eslint/js": "9.21.0",
|
|
47
47
|
"@parse/minami": "git+https://github.com/parse-community/minami#main",
|
|
48
48
|
"@saithodev/semantic-release-backmerge": "4.0.1",
|
|
49
49
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"babel-plugin-transform-inline-environment-variables": "0.4.4",
|
|
60
60
|
"browserify": "17.0.0",
|
|
61
61
|
"codecov": "3.8.3",
|
|
62
|
-
"core-js": "3.
|
|
62
|
+
"core-js": "3.41.0",
|
|
63
63
|
"cross-env": "7.0.2",
|
|
64
64
|
"eslint": "9.21.0",
|
|
65
65
|
"eslint-plugin-expect-type": "0.6.2",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"puppeteer": "24.2.1",
|
|
90
90
|
"regenerator-runtime": "0.14.1",
|
|
91
91
|
"semantic-release": "24.2.3",
|
|
92
|
-
"typescript-eslint": "8.
|
|
92
|
+
"typescript-eslint": "8.26.0",
|
|
93
93
|
"vinyl-source-stream": "2.0.0"
|
|
94
94
|
},
|
|
95
95
|
"optionalDependencies": {
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
},
|
|
98
98
|
"scripts": {
|
|
99
99
|
"build": "node build_releases.js",
|
|
100
|
-
"build:types": "tsc
|
|
100
|
+
"build:types": "tsc",
|
|
101
|
+
"ci:typecheck": "node ./ci/typecheck.js",
|
|
101
102
|
"release": "node build_releases.js && npm publish",
|
|
102
103
|
"test": "cross-env PARSE_BUILD=node jest",
|
|
103
104
|
"test:mongodb": "npm run test:mongodb:runnerstart && npm run integration",
|
|
@@ -105,11 +106,12 @@
|
|
|
105
106
|
"posttest:mongodb": "mongodb-runner stop --all",
|
|
106
107
|
"lint": "eslint --cache src/ integration/",
|
|
107
108
|
"lint:fix": "eslint --fix --cache src/ integration/",
|
|
108
|
-
"test:types": "eslint
|
|
109
|
+
"test:types": "eslint types/tests.ts -c eslint.config.test.mjs",
|
|
109
110
|
"watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
|
|
110
111
|
"watch:browser": "cross-env PARSE_BUILD=browser npm run watch",
|
|
111
112
|
"watch:node": "cross-env PARSE_BUILD=node npm run watch",
|
|
112
113
|
"watch:react-native": "cross-env PARSE_BUILD=react-native npm run watch",
|
|
114
|
+
"watch:ts": "tsc --watch",
|
|
113
115
|
"integration": "cross-env TESTING=1 jasmine --config=jasmine.json",
|
|
114
116
|
"docs": "jsdoc -c ./jsdoc-conf.json ./src",
|
|
115
117
|
"madge:circular": "madge ./src --extensions js,ts --circular",
|