parse 6.1.0-alpha.3 → 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 +28 -38
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +28 -38
- 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/ParseObject.js +2 -1
- package/lib/browser/ParseOp.js +1 -1
- package/lib/browser/ParseQuery.js +8 -20
- package/lib/browser/TaskQueue.js +1 -0
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/Parse.js +14 -14
- package/lib/node/ParseObject.js +2 -1
- package/lib/node/ParseOp.js +1 -1
- package/lib/node/ParseQuery.js +8 -20
- package/lib/node/TaskQueue.js +1 -0
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/ObjectStateMutations.js +13 -13
- package/lib/react-native/ParseACL.js +7 -7
- package/lib/react-native/ParseCLP.js +15 -15
- package/lib/react-native/ParseObject.js +9 -9
- package/lib/react-native/ParseQuery.js +8 -16
- package/lib/react-native/ParseUser.js +15 -15
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/Parse.js +14 -14
- package/lib/weapp/ParseObject.js +2 -1
- package/lib/weapp/ParseOp.js +1 -1
- package/lib/weapp/ParseQuery.js +8 -20
- package/lib/weapp/TaskQueue.js +1 -0
- package/package.json +8 -8
- package/types/Analytics.d.ts +1 -3
- package/types/CoreManager.d.ts +56 -62
- package/types/LocalDatastore.d.ts +3 -3
- package/types/LocalDatastoreController.default.d.ts +1 -1
- package/types/LocalDatastoreController.react-native.d.ts +1 -1
- package/types/ObjectStateMutations.d.ts +12 -18
- package/types/Parse.d.ts +63 -324
- package/types/ParseACL.d.ts +2 -6
- package/types/ParseCLP.d.ts +2 -6
- package/types/ParseConfig.d.ts +3 -11
- package/types/ParseFile.d.ts +8 -12
- package/types/ParseInstallation.d.ts +4 -4
- package/types/ParseObject.d.ts +24 -26
- package/types/ParseOp.d.ts +13 -15
- package/types/ParsePolygon.d.ts +3 -3
- package/types/ParseQuery.d.ts +39 -55
- package/types/ParseSchema.d.ts +12 -28
- package/types/ParseUser.d.ts +8 -14
- package/types/Push.d.ts +2 -2
- package/types/RESTController.d.ts +4 -4
- package/types/SingleInstanceStateController.d.ts +1 -1
- package/types/Storage.d.ts +2 -2
- package/types/StorageController.react-native.d.ts +2 -2
- package/types/TaskQueue.d.ts +3 -3
- package/types/UniqueInstanceStateController.d.ts +1 -1
- package/types/arrayContainsObject.d.ts +1 -1
- package/types/encode.d.ts +1 -1
- package/types/eslint.config.mjs +30 -0
- package/types/unique.d.ts +1 -1
- package/types/unsavedChildren.d.ts +1 -1
|
@@ -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
|
});
|
|
@@ -153,8 +153,8 @@ var ParseUser = function (_ParseObject) {
|
|
|
153
153
|
if (typeof authData !== 'object') {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
for (var
|
|
157
|
-
this._synchronizeAuthData(
|
|
156
|
+
for (var key in authData) {
|
|
157
|
+
this._synchronizeAuthData(key);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
@@ -167,9 +167,9 @@ var ParseUser = function (_ParseObject) {
|
|
|
167
167
|
if (typeof authData !== 'object') {
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
for (var
|
|
171
|
-
if (!authData[
|
|
172
|
-
delete authData[
|
|
170
|
+
for (var key in authData) {
|
|
171
|
+
if (!authData[key]) {
|
|
172
|
+
delete authData[key];
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
@@ -206,8 +206,8 @@ var ParseUser = function (_ParseObject) {
|
|
|
206
206
|
if (typeof authData !== 'object') {
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
for (var
|
|
210
|
-
this._logOutWith(
|
|
209
|
+
for (var key in authData) {
|
|
210
|
+
this._logOutWith(key);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}, {
|
|
@@ -335,8 +335,8 @@ var ParseUser = function (_ParseObject) {
|
|
|
335
335
|
key: "save",
|
|
336
336
|
value: function () {
|
|
337
337
|
var _save = (0, _asyncToGenerator2.default)(function* () {
|
|
338
|
-
for (var _len = arguments.length, args = new Array(_len),
|
|
339
|
-
args[
|
|
338
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
339
|
+
args[_key] = arguments[_key];
|
|
340
340
|
}
|
|
341
341
|
yield _superPropGet(ParseUser, "save", this, 1).apply(this, args);
|
|
342
342
|
var current = yield this.isCurrentAsync();
|
|
@@ -354,8 +354,8 @@ var ParseUser = function (_ParseObject) {
|
|
|
354
354
|
key: "destroy",
|
|
355
355
|
value: function () {
|
|
356
356
|
var _destroy = (0, _asyncToGenerator2.default)(function* () {
|
|
357
|
-
for (var _len2 = arguments.length, args = new Array(_len2),
|
|
358
|
-
args[
|
|
357
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
358
|
+
args[_key2] = arguments[_key2];
|
|
359
359
|
}
|
|
360
360
|
yield _superPropGet(ParseUser, "destroy", this, 1).apply(this, args);
|
|
361
361
|
var current = yield this.isCurrentAsync();
|
|
@@ -373,8 +373,8 @@ var ParseUser = function (_ParseObject) {
|
|
|
373
373
|
key: "fetch",
|
|
374
374
|
value: function () {
|
|
375
375
|
var _fetch = (0, _asyncToGenerator2.default)(function* () {
|
|
376
|
-
for (var _len3 = arguments.length, args = new Array(_len3),
|
|
377
|
-
args[
|
|
376
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
377
|
+
args[_key3] = arguments[_key3];
|
|
378
378
|
}
|
|
379
379
|
yield _superPropGet(ParseUser, "fetch", this, 1).apply(this, args);
|
|
380
380
|
var current = yield this.isCurrentAsync();
|
|
@@ -392,8 +392,8 @@ var ParseUser = function (_ParseObject) {
|
|
|
392
392
|
key: "fetchWithInclude",
|
|
393
393
|
value: function () {
|
|
394
394
|
var _fetchWithInclude = (0, _asyncToGenerator2.default)(function* () {
|
|
395
|
-
for (var _len4 = arguments.length, args = new Array(_len4),
|
|
396
|
-
args[
|
|
395
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
396
|
+
args[_key4] = arguments[_key4];
|
|
397
397
|
}
|
|
398
398
|
yield _superPropGet(ParseUser, "fetchWithInclude", this, 1).apply(this, args);
|
|
399
399
|
var current = yield this.isCurrentAsync();
|
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/ParseObject.js
CHANGED
|
@@ -1362,7 +1362,7 @@ class ParseObject {
|
|
|
1362
1362
|
*/
|
|
1363
1363
|
destroy(options) {
|
|
1364
1364
|
if (!this.id) {
|
|
1365
|
-
return _promise.default.resolve();
|
|
1365
|
+
return _promise.default.resolve(undefined);
|
|
1366
1366
|
}
|
|
1367
1367
|
const destroyOptions = ParseObject._getRequestOptions(options);
|
|
1368
1368
|
return _CoreManager.default.getObjectController().destroy(this, destroyOptions);
|
|
@@ -2346,6 +2346,7 @@ const DefaultController = {
|
|
|
2346
2346
|
const batchReady = [];
|
|
2347
2347
|
const batchTasks = [];
|
|
2348
2348
|
(0, _forEach.default)(batch).call(batch, (obj, index) => {
|
|
2349
|
+
// eslint-disable-next-line
|
|
2349
2350
|
const ready = (0, _promiseUtils.resolvingPromise)();
|
|
2350
2351
|
batchReady.push(ready);
|
|
2351
2352
|
stateController.pushPendingState(obj._getStateIdentifier());
|
package/lib/weapp/ParseOp.js
CHANGED
|
@@ -70,7 +70,7 @@ function opFromJSON(json) {
|
|
|
70
70
|
class Op {
|
|
71
71
|
// Empty parent class
|
|
72
72
|
applyTo() {} /* eslint-disable-line @typescript-eslint/no-unused-vars */
|
|
73
|
-
mergeWith() {} /* eslint-disable-line
|
|
73
|
+
mergeWith() {} /* eslint-disable-line */
|
|
74
74
|
toJSON() {} /* eslint-disable-line @typescript-eslint/no-unused-vars */
|
|
75
75
|
}
|
|
76
76
|
exports.Op = Op;
|
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
|
});
|
package/lib/weapp/TaskQueue.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "6.1.0-alpha.
|
|
3
|
+
"version": "6.1.0-alpha.5",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-native": false
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@babel/runtime-corejs3": "7.
|
|
34
|
+
"@babel/runtime-corejs3": "7.27.0",
|
|
35
35
|
"idb-keyval": "6.2.1",
|
|
36
36
|
"react-native-crypto-js": "1.0.0",
|
|
37
37
|
"uuid": "10.0.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@babel/plugin-transform-runtime": "7.26.10",
|
|
45
45
|
"@babel/preset-env": "7.26.9",
|
|
46
46
|
"@babel/preset-react": "7.26.3",
|
|
47
|
-
"@babel/preset-typescript": "7.
|
|
48
|
-
"@eslint/js": "9.
|
|
47
|
+
"@babel/preset-typescript": "7.27.0",
|
|
48
|
+
"@eslint/js": "9.23.0",
|
|
49
49
|
"@parse/minami": "git+https://github.com/parse-community/minami#main",
|
|
50
50
|
"@saithodev/semantic-release-backmerge": "4.0.1",
|
|
51
51
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"codecov": "3.8.3",
|
|
64
64
|
"core-js": "3.41.0",
|
|
65
65
|
"cross-env": "7.0.2",
|
|
66
|
-
"eslint": "9.
|
|
66
|
+
"eslint": "9.23.0",
|
|
67
67
|
"eslint-plugin-expect-type": "0.6.2",
|
|
68
|
-
"eslint-plugin-jsdoc": "50.6.
|
|
68
|
+
"eslint-plugin-jsdoc": "50.6.9",
|
|
69
69
|
"express": "4.21.2",
|
|
70
70
|
"gulp": "5.0.0",
|
|
71
71
|
"gulp-babel": "8.0.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"puppeteer": "24.4.0",
|
|
92
92
|
"regenerator-runtime": "0.14.1",
|
|
93
93
|
"semantic-release": "24.2.3",
|
|
94
|
-
"typescript-eslint": "8.
|
|
94
|
+
"typescript-eslint": "8.28.0",
|
|
95
95
|
"vinyl-source-stream": "2.0.0"
|
|
96
96
|
},
|
|
97
97
|
"optionalDependencies": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"posttest:mongodb": "mongodb-runner stop --all",
|
|
109
109
|
"lint": "eslint --cache src/ integration/",
|
|
110
110
|
"lint:fix": "eslint --fix --cache src/ integration/",
|
|
111
|
-
"test:types": "eslint types/tests.ts -c eslint.config.
|
|
111
|
+
"test:types": "eslint types/tests.ts -c ./types/eslint.config.mjs",
|
|
112
112
|
"watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
|
|
113
113
|
"watch:browser": "cross-env PARSE_BUILD=browser npm run watch",
|
|
114
114
|
"watch:node": "cross-env PARSE_BUILD=node npm run watch",
|
package/types/Analytics.d.ts
CHANGED
|
@@ -37,6 +37,4 @@
|
|
|
37
37
|
* @returns {Promise} A promise that is resolved when the round-trip
|
|
38
38
|
* to the server completes.
|
|
39
39
|
*/
|
|
40
|
-
export declare function track(name: string, dimensions:
|
|
41
|
-
[key: string]: string;
|
|
42
|
-
}): Promise<void>;
|
|
40
|
+
export declare function track(name: string, dimensions: Record<string, string>): Promise<void>;
|
package/types/CoreManager.d.ts
CHANGED
|
@@ -14,31 +14,25 @@ import type { HookDeclaration, HookDeleteArg } from './ParseHooks';
|
|
|
14
14
|
import type ParseConfig from './ParseConfig';
|
|
15
15
|
import type LiveQueryClient from './LiveQueryClient';
|
|
16
16
|
import type ParseInstallation from './ParseInstallation';
|
|
17
|
-
|
|
18
|
-
track: (name: string, dimensions:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
type CloudController = {
|
|
17
|
+
export interface AnalyticsController {
|
|
18
|
+
track: (name: string, dimensions: Record<string, string>) => Promise<any>;
|
|
19
|
+
}
|
|
20
|
+
export interface CloudController {
|
|
23
21
|
run: (name: string, data: any, options?: RequestOptions) => Promise<any>;
|
|
24
22
|
getJobsData: (options?: RequestOptions) => Promise<any>;
|
|
25
23
|
/** Returns promise which resolves with JobStatusId of the job */
|
|
26
24
|
startJob: (name: string, data: any, options?: RequestOptions) => Promise<string>;
|
|
27
|
-
}
|
|
28
|
-
|
|
25
|
+
}
|
|
26
|
+
export interface ConfigController {
|
|
29
27
|
current: () => Promise<ParseConfig> | ParseConfig;
|
|
30
28
|
get: (opts?: RequestOptions) => Promise<ParseConfig>;
|
|
31
|
-
save: (attrs:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}) => Promise<void>;
|
|
36
|
-
};
|
|
37
|
-
type CryptoController = {
|
|
29
|
+
save: (attrs: Record<string, any>, masterKeyOnlyFlags?: Record<string, any>) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export interface CryptoController {
|
|
38
32
|
encrypt: (obj: any, secretKey: string) => string;
|
|
39
33
|
decrypt: (encryptedText: string, secretKey: any) => string;
|
|
40
|
-
}
|
|
41
|
-
|
|
34
|
+
}
|
|
35
|
+
export interface FileController {
|
|
42
36
|
saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise<any>;
|
|
43
37
|
saveBase64: (name: string, source: FileSource, options?: FileSaveOptions) => Promise<{
|
|
44
38
|
name: string;
|
|
@@ -51,24 +45,24 @@ type FileController = {
|
|
|
51
45
|
deleteFile: (name: string, options?: {
|
|
52
46
|
useMasterKey?: boolean;
|
|
53
47
|
}) => Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
|
|
48
|
+
}
|
|
49
|
+
export interface InstallationController {
|
|
56
50
|
currentInstallationId: () => Promise<string>;
|
|
57
51
|
currentInstallation: () => Promise<ParseInstallation | null>;
|
|
58
52
|
updateInstallationOnDisk: (installation: ParseInstallation) => Promise<void>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
fetch: (object: ParseObject |
|
|
62
|
-
save: (object: ParseObject |
|
|
63
|
-
destroy: (object: ParseObject |
|
|
64
|
-
}
|
|
65
|
-
|
|
53
|
+
}
|
|
54
|
+
export interface ObjectController {
|
|
55
|
+
fetch: (object: ParseObject | ParseObject[], forceFetch: boolean, options?: RequestOptions) => Promise<(ParseObject | undefined)[] | ParseObject | undefined>;
|
|
56
|
+
save: (object: ParseObject | (ParseObject | ParseFile)[] | null, options?: RequestOptions) => Promise<ParseObject | ParseObject[] | ParseFile | undefined>;
|
|
57
|
+
destroy: (object: ParseObject | ParseObject[], options?: RequestOptions) => Promise<ParseObject | ParseObject[]>;
|
|
58
|
+
}
|
|
59
|
+
export interface ObjectStateController {
|
|
66
60
|
getState: (obj: any) => State | null;
|
|
67
61
|
initializeState: (obj: any, initial?: State) => State;
|
|
68
62
|
removeState: (obj: any) => State | null;
|
|
69
63
|
getServerData: (obj: any) => AttributeMap;
|
|
70
64
|
setServerData: (obj: any, attributes: AttributeMap) => void;
|
|
71
|
-
getPendingOps: (obj: any) =>
|
|
65
|
+
getPendingOps: (obj: any) => OpsMap[];
|
|
72
66
|
setPendingOp: (obj: any, attr: string, op?: Op) => void;
|
|
73
67
|
pushPendingState: (obj: any) => void;
|
|
74
68
|
popPendingState: (obj: any) => OpsMap | undefined;
|
|
@@ -80,21 +74,21 @@ type ObjectStateController = {
|
|
|
80
74
|
enqueueTask: (obj: any, task: () => Promise<void>) => Promise<void>;
|
|
81
75
|
clearAllState: () => void;
|
|
82
76
|
duplicateState: (source: any, dest: any) => void;
|
|
83
|
-
}
|
|
84
|
-
|
|
77
|
+
}
|
|
78
|
+
export interface PushController {
|
|
85
79
|
send: (data: PushData, options?: FullOptions) => Promise<any>;
|
|
86
|
-
}
|
|
87
|
-
|
|
80
|
+
}
|
|
81
|
+
export interface QueryController {
|
|
88
82
|
find(className: string, params: QueryJSON, options?: RequestOptions): Promise<{
|
|
89
|
-
results?:
|
|
83
|
+
results?: ParseObject[];
|
|
90
84
|
className?: string;
|
|
91
85
|
count?: number;
|
|
92
86
|
}>;
|
|
93
87
|
aggregate(className: string, params: any, options?: RequestOptions): Promise<{
|
|
94
|
-
results?:
|
|
88
|
+
results?: any[];
|
|
95
89
|
}>;
|
|
96
|
-
}
|
|
97
|
-
export
|
|
90
|
+
}
|
|
91
|
+
export interface QueueObject {
|
|
98
92
|
queueId: string;
|
|
99
93
|
action: string;
|
|
100
94
|
object: ParseObject;
|
|
@@ -103,9 +97,9 @@ export type QueueObject = {
|
|
|
103
97
|
className: string;
|
|
104
98
|
hash: string;
|
|
105
99
|
createdAt: Date;
|
|
106
|
-
}
|
|
107
|
-
export type Queue =
|
|
108
|
-
export
|
|
100
|
+
}
|
|
101
|
+
export type Queue = QueueObject[];
|
|
102
|
+
export interface EventuallyQueue {
|
|
109
103
|
save: (object: ParseObject, serverOptions?: SaveOptions) => Promise<void>;
|
|
110
104
|
destroy: (object: ParseObject, serverOptions?: RequestOptions) => Promise<void>;
|
|
111
105
|
generateQueueId: (action: string, object: ParseObject) => string;
|
|
@@ -128,23 +122,23 @@ export type EventuallyQueue = {
|
|
|
128
122
|
byId(ObjectType: any, queueObject: any): Promise<void>;
|
|
129
123
|
byHash(ObjectType: any, queueObject: any): Promise<void>;
|
|
130
124
|
};
|
|
131
|
-
}
|
|
132
|
-
|
|
125
|
+
}
|
|
126
|
+
export interface RESTController {
|
|
133
127
|
request: (method: string, path: string, data?: any, options?: RequestOptions) => Promise<any>;
|
|
134
128
|
ajax: (method: string, url: string, data: any, headers?: any, options?: FullOptions) => Promise<any>;
|
|
135
129
|
handleError: (err?: any) => void;
|
|
136
|
-
}
|
|
137
|
-
|
|
130
|
+
}
|
|
131
|
+
export interface SchemaController {
|
|
138
132
|
purge: (className: string) => Promise<any>;
|
|
139
133
|
get: (className: string, options?: RequestOptions) => Promise<any>;
|
|
140
134
|
delete: (className: string, options?: RequestOptions) => Promise<void>;
|
|
141
135
|
create: (className: string, params: any, options?: RequestOptions) => Promise<any>;
|
|
142
136
|
update: (className: string, params: any, options?: RequestOptions) => Promise<any>;
|
|
143
137
|
send(className: string, method: string, params: any, options?: RequestOptions): Promise<any>;
|
|
144
|
-
}
|
|
145
|
-
|
|
138
|
+
}
|
|
139
|
+
export interface SessionController {
|
|
146
140
|
getSession: (options?: RequestOptions) => Promise<ParseSession>;
|
|
147
|
-
}
|
|
141
|
+
}
|
|
148
142
|
type StorageController = {
|
|
149
143
|
async: 0;
|
|
150
144
|
getItem: (path: string) => string | null;
|
|
@@ -154,8 +148,8 @@ type StorageController = {
|
|
|
154
148
|
setItemAsync?: (path: string, value: string) => Promise<void>;
|
|
155
149
|
removeItemAsync?: (path: string) => Promise<void>;
|
|
156
150
|
clear: () => void;
|
|
157
|
-
getAllKeys?: () =>
|
|
158
|
-
getAllKeysAsync?: () => Promise<
|
|
151
|
+
getAllKeys?: () => string[];
|
|
152
|
+
getAllKeysAsync?: () => Promise<string[]>;
|
|
159
153
|
} | {
|
|
160
154
|
async: 1;
|
|
161
155
|
getItem?: (path: string) => string | null;
|
|
@@ -165,17 +159,17 @@ type StorageController = {
|
|
|
165
159
|
setItemAsync: (path: string, value: string) => Promise<void>;
|
|
166
160
|
removeItemAsync: (path: string) => Promise<void>;
|
|
167
161
|
clear: () => void;
|
|
168
|
-
getAllKeys?: () =>
|
|
169
|
-
getAllKeysAsync?: () => Promise<
|
|
162
|
+
getAllKeys?: () => string[];
|
|
163
|
+
getAllKeysAsync?: () => Promise<string[]>;
|
|
170
164
|
};
|
|
171
|
-
|
|
165
|
+
export interface LocalDatastoreController {
|
|
172
166
|
fromPinWithName: (name: string) => any | undefined;
|
|
173
167
|
pinWithName: (name: string, objects: any) => void;
|
|
174
168
|
unPinWithName: (name: string) => void;
|
|
175
169
|
getAllContents: () => any | undefined;
|
|
176
170
|
clear: () => void;
|
|
177
|
-
}
|
|
178
|
-
|
|
171
|
+
}
|
|
172
|
+
export interface UserController {
|
|
179
173
|
setCurrentUser: (user: ParseUser) => Promise<void>;
|
|
180
174
|
currentUser: () => ParseUser | null;
|
|
181
175
|
currentUserAsync: () => Promise<ParseUser | null>;
|
|
@@ -190,24 +184,24 @@ type UserController = {
|
|
|
190
184
|
updateUserOnDisk: (user: ParseUser) => Promise<ParseUser>;
|
|
191
185
|
upgradeToRevocableSession: (user: ParseUser, options?: RequestOptions) => Promise<void>;
|
|
192
186
|
linkWith: (user: ParseUser, authData: AuthData, options?: FullOptions) => Promise<ParseUser>;
|
|
193
|
-
removeUserFromDisk: () => Promise<
|
|
187
|
+
removeUserFromDisk: () => Promise<void>;
|
|
194
188
|
verifyPassword: (username: string, password: string, options?: RequestOptions) => Promise<ParseUser>;
|
|
195
189
|
requestEmailVerification: (email: string, options?: RequestOptions) => Promise<void>;
|
|
196
|
-
}
|
|
197
|
-
|
|
190
|
+
}
|
|
191
|
+
export interface HooksController {
|
|
198
192
|
get: (type: string, functionName?: string, triggerName?: string) => Promise<any>;
|
|
199
193
|
create: (hook: HookDeclaration) => Promise<any>;
|
|
200
194
|
remove: (hook: HookDeleteArg) => Promise<any>;
|
|
201
195
|
update: (hook: HookDeclaration) => Promise<any>;
|
|
202
196
|
sendRequest?: (method: string, path: string, body?: any) => Promise<any>;
|
|
203
|
-
}
|
|
204
|
-
|
|
197
|
+
}
|
|
198
|
+
export interface LiveQueryControllerType {
|
|
205
199
|
setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void;
|
|
206
200
|
getDefaultLiveQueryClient(): Promise<LiveQueryClient>;
|
|
207
201
|
_clearCachedDefaultClient(): void;
|
|
208
|
-
}
|
|
202
|
+
}
|
|
209
203
|
/** Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts */
|
|
210
|
-
|
|
204
|
+
export interface AsyncStorageType {
|
|
211
205
|
/** Fetches an item for a `key` and invokes a callback upon completion. */
|
|
212
206
|
getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise<string | null>;
|
|
213
207
|
/** Sets the value for a `key` and invokes a callback upon completion. */
|
|
@@ -250,15 +244,15 @@ type AsyncStorageType = {
|
|
|
250
244
|
* See https://react-native-async-storage.github.io/async-storage/docs/api#multimerge
|
|
251
245
|
*/
|
|
252
246
|
multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise<void>;
|
|
253
|
-
}
|
|
254
|
-
export
|
|
247
|
+
}
|
|
248
|
+
export interface WebSocketController {
|
|
255
249
|
onopen: () => void;
|
|
256
250
|
onmessage: (message: any) => void;
|
|
257
251
|
onclose: (arg?: any) => void;
|
|
258
252
|
onerror: (error: any) => void;
|
|
259
253
|
send: (data: any) => void;
|
|
260
254
|
close: () => void;
|
|
261
|
-
}
|
|
255
|
+
}
|
|
262
256
|
declare const CoreManager: {
|
|
263
257
|
get: (key: string) => any;
|
|
264
258
|
set: (key: string, value: any) => void;
|