parse 5.3.0 → 6.0.0-alpha.1
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 +6 -5
- package/dist/parse.js +822 -877
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +822 -875
- 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/FacebookUtils.js +1 -1
- package/lib/browser/LocalDatastoreController.react-native.js +1 -1
- package/lib/browser/OfflineQuery.js +5 -9
- package/lib/browser/Parse.js +1 -3
- package/lib/browser/ParseConfig.js +1 -1
- package/lib/browser/ParseFile.js +1 -2
- package/lib/browser/ParseInstallation.js +3 -1
- package/lib/browser/ParseObject.js +160 -163
- package/lib/browser/ParseQuery.js +22 -89
- package/lib/browser/ParseSession.js +4 -6
- package/lib/browser/ParseUser.js +44 -58
- package/lib/browser/Push.js +2 -2
- package/lib/browser/RESTController.js +2 -2
- package/lib/browser/Storage.js +1 -1
- package/lib/browser/StorageController.default.js +2 -2
- package/lib/browser/StorageController.weapp.js +1 -1
- package/lib/node/Cloud.js +12 -16
- package/lib/node/CoreManager.js +3 -3
- package/lib/node/FacebookUtils.js +1 -1
- package/lib/node/LocalDatastoreController.react-native.js +1 -1
- package/lib/node/OfflineQuery.js +5 -9
- package/lib/node/Parse.js +1 -1
- package/lib/node/ParseConfig.js +1 -1
- package/lib/node/ParseFile.js +1 -2
- package/lib/node/ParseInstallation.js +3 -1
- package/lib/node/ParseObject.js +155 -158
- package/lib/node/ParseQuery.js +22 -89
- package/lib/node/ParseSession.js +4 -6
- package/lib/node/ParseUser.js +44 -58
- package/lib/node/Push.js +2 -2
- package/lib/node/RESTController.js +2 -2
- package/lib/node/Storage.js +1 -1
- package/lib/node/StorageController.default.js +2 -2
- package/lib/node/StorageController.weapp.js +1 -1
- package/lib/react-native/Cloud.js +4 -16
- package/lib/react-native/CoreManager.js +3 -3
- package/lib/react-native/LocalDatastoreController.react-native.js +1 -1
- package/lib/react-native/OfflineQuery.js +5 -5
- package/lib/react-native/ParseConfig.js +1 -1
- package/lib/react-native/ParseFile.js +1 -1
- package/lib/react-native/ParseInstallation.js +14 -6
- package/lib/react-native/ParseObject.js +147 -163
- package/lib/react-native/ParseQuery.js +21 -89
- package/lib/react-native/ParseRole.js +8 -2
- package/lib/react-native/ParseSession.js +4 -6
- package/lib/react-native/ParseUser.js +28 -63
- package/lib/react-native/Push.js +2 -2
- package/lib/react-native/RESTController.js +11 -10
- package/lib/react-native/Storage.js +1 -1
- package/lib/react-native/StorageController.default.js +2 -2
- package/lib/react-native/StorageController.weapp.js +1 -1
- package/lib/weapp/Cloud.js +12 -16
- package/lib/weapp/CoreManager.js +3 -3
- package/lib/weapp/FacebookUtils.js +1 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +1 -1
- package/lib/weapp/OfflineQuery.js +5 -9
- package/lib/weapp/Parse.js +1 -1
- package/lib/weapp/ParseConfig.js +1 -1
- package/lib/weapp/ParseFile.js +1 -2
- package/lib/weapp/ParseInstallation.js +3 -1
- package/lib/weapp/ParseObject.js +160 -163
- package/lib/weapp/ParseQuery.js +22 -89
- package/lib/weapp/ParseSession.js +4 -6
- package/lib/weapp/ParseUser.js +44 -58
- package/lib/weapp/Push.js +2 -2
- package/lib/weapp/RESTController.js +2 -2
- package/lib/weapp/Storage.js +1 -1
- package/lib/weapp/StorageController.default.js +2 -2
- package/lib/weapp/StorageController.weapp.js +1 -1
- package/package.json +30 -28
package/lib/node/OfflineQuery.js
CHANGED
|
@@ -311,11 +311,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
311
311
|
compareTo = parserResult.result;
|
|
312
312
|
}
|
|
313
313
|
// Compare Date Object or Date String
|
|
314
|
-
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' &&
|
|
315
|
-
// @ts-ignore
|
|
316
|
-
new Date(compareTo) !== 'Invalid Date' &&
|
|
317
|
-
// @ts-ignore
|
|
318
|
-
!isNaN(new Date(compareTo))) {
|
|
314
|
+
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' && new Date(compareTo).toString() !== 'Invalid Date') {
|
|
319
315
|
object[key] = new Date(object[key].iso ? object[key].iso : object[key]);
|
|
320
316
|
}
|
|
321
317
|
switch (condition) {
|
|
@@ -435,7 +431,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
435
431
|
break;
|
|
436
432
|
case '$select':
|
|
437
433
|
{
|
|
438
|
-
const subQueryObjects = objects.filter((obj,
|
|
434
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
439
435
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
440
436
|
});
|
|
441
437
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -446,7 +442,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
446
442
|
}
|
|
447
443
|
case '$dontSelect':
|
|
448
444
|
{
|
|
449
|
-
const subQueryObjects = objects.filter((obj,
|
|
445
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
450
446
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
451
447
|
});
|
|
452
448
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -457,7 +453,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
457
453
|
}
|
|
458
454
|
case '$inQuery':
|
|
459
455
|
{
|
|
460
|
-
const subQueryObjects = objects.filter((obj,
|
|
456
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
461
457
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
462
458
|
});
|
|
463
459
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -470,7 +466,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
470
466
|
}
|
|
471
467
|
case '$notInQuery':
|
|
472
468
|
{
|
|
473
|
-
const subQueryObjects = objects.filter((obj,
|
|
469
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
474
470
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
475
471
|
});
|
|
476
472
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
package/lib/node/Parse.js
CHANGED
|
@@ -360,7 +360,7 @@ const Parse = {
|
|
|
360
360
|
*/
|
|
361
361
|
dumpLocalDatastore() {
|
|
362
362
|
if (!this.LocalDatastore.isEnabled) {
|
|
363
|
-
console.log('Parse.enableLocalDatastore() must be called first');
|
|
363
|
+
console.log('Parse.enableLocalDatastore() must be called first');
|
|
364
364
|
return Promise.resolve({});
|
|
365
365
|
} else {
|
|
366
366
|
return Parse.LocalDatastore._getAllContents();
|
package/lib/node/ParseConfig.js
CHANGED
package/lib/node/ParseFile.js
CHANGED
|
@@ -285,7 +285,7 @@ class ParseFile {
|
|
|
285
285
|
const destroyOptions = {
|
|
286
286
|
useMasterKey: true
|
|
287
287
|
};
|
|
288
|
-
if (
|
|
288
|
+
if (Object.hasOwn(options, 'useMasterKey')) {
|
|
289
289
|
destroyOptions.useMasterKey = !!options.useMasterKey;
|
|
290
290
|
}
|
|
291
291
|
const controller = _CoreManager.default.getFileController();
|
|
@@ -387,7 +387,6 @@ const DefaultController = {
|
|
|
387
387
|
throw new Error('saveFile can only be used with File-type sources.');
|
|
388
388
|
}
|
|
389
389
|
const base64Data = await new Promise((res, rej) => {
|
|
390
|
-
// eslint-disable-next-line no-undef
|
|
391
390
|
const reader = new FileReader();
|
|
392
391
|
reader.onload = () => res(reader.result);
|
|
393
392
|
reader.onerror = error => rej(error);
|
|
@@ -39,7 +39,9 @@ class ParseInstallation extends _ParseObject.default {
|
|
|
39
39
|
constructor(attributes) {
|
|
40
40
|
super('_Installation');
|
|
41
41
|
if (attributes && typeof attributes === 'object') {
|
|
42
|
-
|
|
42
|
+
try {
|
|
43
|
+
this.set(attributes || {});
|
|
44
|
+
} catch (_) {
|
|
43
45
|
throw new Error("Can't create an invalid Installation");
|
|
44
46
|
}
|
|
45
47
|
}
|