parse 5.1.1-alpha.1 → 5.2.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/dist/parse.js +10186 -14918
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +10180 -15057
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +7 -11
- package/lib/browser/AnonymousUtils.js +17 -22
- package/lib/browser/Cloud.js +24 -46
- package/lib/browser/CoreManager.js +71 -79
- package/lib/browser/CryptoController.js +14 -9
- package/lib/browser/EventEmitter.js +9 -2
- package/lib/browser/EventuallyQueue.js +156 -357
- package/lib/browser/FacebookUtils.js +23 -28
- package/lib/browser/IndexedDBStorageController.js +18 -14
- package/lib/browser/InstallationController.js +55 -121
- package/lib/browser/LiveQueryClient.js +312 -446
- package/lib/browser/LiveQuerySubscription.js +25 -28
- package/lib/browser/LocalDatastore.js +254 -578
- package/lib/browser/LocalDatastoreController.default.js +48 -227
- package/lib/browser/LocalDatastoreController.js +11 -1
- package/lib/browser/LocalDatastoreController.react-native.js +72 -164
- package/lib/browser/LocalDatastoreUtils.js +4 -12
- package/lib/browser/ObjectStateMutations.js +89 -95
- package/lib/browser/OfflineQuery.js +106 -198
- package/lib/browser/Parse.js +45 -61
- package/lib/browser/ParseACL.js +242 -288
- package/lib/browser/ParseCLP.js +372 -580
- package/lib/browser/ParseConfig.js +115 -138
- package/lib/browser/ParseError.js +85 -182
- package/lib/browser/ParseFile.js +296 -444
- package/lib/browser/ParseGeoPoint.js +121 -140
- package/lib/browser/ParseHooks.js +12 -14
- package/lib/browser/ParseInstallation.js +226 -354
- package/lib/browser/ParseLiveQuery.js +74 -148
- package/lib/browser/ParseObject.js +2017 -2622
- package/lib/browser/ParseOp.js +343 -484
- package/lib/browser/ParsePolygon.js +101 -120
- package/lib/browser/ParseQuery.js +1722 -2068
- package/lib/browser/ParseRelation.js +99 -118
- package/lib/browser/ParseRole.js +88 -144
- package/lib/browser/ParseSchema.js +372 -434
- package/lib/browser/ParseSession.js +62 -110
- package/lib/browser/ParseUser.js +942 -1270
- package/lib/browser/Push.js +16 -44
- package/lib/browser/RESTController.js +85 -124
- package/lib/browser/SingleInstanceStateController.js +57 -86
- package/lib/browser/Socket.weapp.js +50 -33
- package/lib/browser/Storage.js +23 -28
- package/lib/browser/StorageController.browser.js +16 -13
- package/lib/browser/StorageController.default.js +15 -14
- package/lib/browser/StorageController.js +14 -1
- package/lib/browser/StorageController.react-native.js +31 -30
- package/lib/browser/StorageController.weapp.js +19 -13
- package/lib/browser/TaskQueue.js +37 -49
- package/lib/browser/UniqueInstanceStateController.js +65 -86
- package/lib/browser/WebSocketController.js +11 -4
- package/lib/browser/Xhr.weapp.js +90 -78
- package/lib/browser/arrayContainsObject.js +3 -3
- package/lib/browser/canBeSerialized.js +10 -11
- package/lib/browser/decode.js +11 -11
- package/lib/browser/encode.js +11 -11
- package/lib/browser/equals.js +9 -10
- package/lib/browser/escape.js +2 -2
- package/lib/browser/isRevocableSession.js +1 -1
- package/lib/browser/parseDate.js +10 -10
- package/lib/browser/promiseUtils.js +19 -19
- package/lib/browser/unique.js +4 -4
- package/lib/browser/unsavedChildren.js +20 -21
- package/lib/browser/uuid.js +2 -4
- package/lib/node/Analytics.js +2 -6
- package/lib/node/AnonymousUtils.js +7 -12
- package/lib/node/Cloud.js +8 -12
- package/lib/node/CoreManager.js +59 -67
- package/lib/node/CryptoController.js +8 -3
- package/lib/node/EventEmitter.js +7 -1
- package/lib/node/EventuallyQueue.js +18 -37
- package/lib/node/FacebookUtils.js +1 -5
- package/lib/node/IndexedDBStorageController.js +14 -10
- package/lib/node/InstallationController.js +7 -8
- package/lib/node/LiveQueryClient.js +20 -32
- package/lib/node/LiveQuerySubscription.js +3 -4
- package/lib/node/LocalDatastore.js +20 -24
- package/lib/node/LocalDatastoreController.default.js +12 -11
- package/lib/node/LocalDatastoreController.js +14 -1
- package/lib/node/LocalDatastoreController.react-native.js +27 -22
- package/lib/node/LocalDatastoreUtils.js +4 -12
- package/lib/node/ObjectStateMutations.js +52 -36
- package/lib/node/OfflineQuery.js +37 -23
- package/lib/node/Parse.js +35 -49
- package/lib/node/ParseACL.js +18 -27
- package/lib/node/ParseCLP.js +38 -50
- package/lib/node/ParseConfig.js +7 -14
- package/lib/node/ParseError.js +457 -458
- package/lib/node/ParseFile.js +33 -66
- package/lib/node/ParseGeoPoint.js +22 -17
- package/lib/node/ParseHooks.js +0 -2
- package/lib/node/ParseInstallation.js +21 -8
- package/lib/node/ParseLiveQuery.js +6 -11
- package/lib/node/ParseObject.js +138 -167
- package/lib/node/ParseOp.js +32 -44
- package/lib/node/ParsePolygon.js +11 -17
- package/lib/node/ParseQuery.js +118 -164
- package/lib/node/ParseRelation.js +7 -16
- package/lib/node/ParseRole.js +7 -13
- package/lib/node/ParseSchema.js +26 -39
- package/lib/node/ParseSession.js +7 -8
- package/lib/node/ParseUser.js +70 -76
- package/lib/node/Push.js +5 -15
- package/lib/node/RESTController.js +21 -33
- package/lib/node/SingleInstanceStateController.js +41 -69
- package/lib/node/Socket.weapp.js +23 -2
- package/lib/node/Storage.js +11 -16
- package/lib/node/StorageController.browser.js +10 -8
- package/lib/node/StorageController.default.js +9 -9
- package/lib/node/StorageController.js +16 -1
- package/lib/node/StorageController.react-native.js +17 -17
- package/lib/node/StorageController.weapp.js +14 -8
- package/lib/node/TaskQueue.js +8 -11
- package/lib/node/UniqueInstanceStateController.js +40 -60
- package/lib/node/WebSocketController.js +15 -2
- package/lib/node/Xhr.weapp.js +11 -2
- package/lib/node/arrayContainsObject.js +1 -1
- package/lib/node/canBeSerialized.js +2 -2
- package/lib/node/decode.js +1 -1
- package/lib/node/encode.js +2 -2
- package/lib/node/equals.js +1 -1
- package/lib/node/escape.js +1 -1
- package/lib/node/isRevocableSession.js +1 -1
- package/lib/node/parseDate.js +1 -1
- package/lib/node/promiseUtils.js +7 -7
- package/lib/node/unique.js +2 -2
- package/lib/node/unsavedChildren.js +2 -2
- package/lib/node/uuid.js +2 -4
- package/lib/react-native/Analytics.js +2 -2
- package/lib/react-native/AnonymousUtils.js +3 -4
- package/lib/react-native/Cloud.js +0 -1
- package/lib/react-native/CoreManager.js +2 -3
- package/lib/react-native/CryptoController.js +6 -1
- package/lib/react-native/EventEmitter.js +6 -1
- package/lib/react-native/EventuallyQueue.js +1 -2
- package/lib/react-native/FacebookUtils.js +1 -2
- package/lib/react-native/IndexedDBStorageController.js +11 -5
- package/lib/react-native/InstallationController.js +1 -2
- package/lib/react-native/LiveQueryClient.js +51 -36
- package/lib/react-native/LiveQuerySubscription.js +2 -4
- package/lib/react-native/LocalDatastore.js +41 -17
- package/lib/react-native/LocalDatastoreController.default.js +6 -1
- package/lib/react-native/LocalDatastoreController.js +11 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +16 -11
- package/lib/react-native/LocalDatastoreUtils.js +3 -6
- package/lib/react-native/ObjectStateMutations.js +30 -9
- package/lib/react-native/OfflineQuery.js +25 -20
- package/lib/react-native/Parse.js +24 -38
- package/lib/react-native/ParseACL.js +4 -6
- package/lib/react-native/ParseCLP.js +5 -7
- package/lib/react-native/ParseConfig.js +4 -6
- package/lib/react-native/ParseError.js +13 -31
- package/lib/react-native/ParseFile.js +10 -10
- package/lib/react-native/ParseGeoPoint.js +2 -4
- package/lib/react-native/ParseInstallation.js +13 -30
- package/lib/react-native/ParseLiveQuery.js +2 -4
- package/lib/react-native/ParseObject.js +81 -90
- package/lib/react-native/ParseOp.js +41 -79
- package/lib/react-native/ParsePolygon.js +2 -4
- package/lib/react-native/ParseQuery.js +87 -81
- package/lib/react-native/ParseRelation.js +2 -4
- package/lib/react-native/ParseRole.js +14 -31
- package/lib/react-native/ParseSchema.js +3 -5
- package/lib/react-native/ParseSession.js +12 -29
- package/lib/react-native/ParseUser.js +32 -51
- package/lib/react-native/RESTController.js +10 -4
- package/lib/react-native/SingleInstanceStateController.js +23 -37
- package/lib/react-native/Socket.weapp.js +9 -4
- package/lib/react-native/Storage.js +1 -2
- package/lib/react-native/StorageController.browser.js +6 -1
- package/lib/react-native/StorageController.default.js +6 -1
- package/lib/react-native/StorageController.js +13 -1
- package/lib/react-native/StorageController.react-native.js +11 -6
- package/lib/react-native/StorageController.weapp.js +6 -1
- package/lib/react-native/TaskQueue.js +8 -4
- package/lib/react-native/UniqueInstanceStateController.js +23 -37
- package/lib/react-native/WebSocketController.js +9 -1
- package/lib/react-native/Xhr.weapp.js +9 -4
- package/lib/react-native/unsavedChildren.js +3 -3
- package/lib/react-native/uuid.js +1 -2
- package/lib/weapp/Analytics.js +7 -11
- package/lib/weapp/AnonymousUtils.js +17 -22
- package/lib/weapp/Cloud.js +24 -46
- package/lib/weapp/CoreManager.js +71 -79
- package/lib/weapp/CryptoController.js +14 -9
- package/lib/weapp/EventEmitter.js +9 -2
- package/lib/weapp/EventuallyQueue.js +156 -357
- package/lib/weapp/FacebookUtils.js +23 -28
- package/lib/weapp/IndexedDBStorageController.js +18 -14
- package/lib/weapp/InstallationController.js +55 -121
- package/lib/weapp/LiveQueryClient.js +312 -446
- package/lib/weapp/LiveQuerySubscription.js +25 -28
- package/lib/weapp/LocalDatastore.js +254 -578
- package/lib/weapp/LocalDatastoreController.default.js +48 -227
- package/lib/weapp/LocalDatastoreController.js +11 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +72 -164
- package/lib/weapp/LocalDatastoreUtils.js +4 -12
- package/lib/weapp/ObjectStateMutations.js +89 -95
- package/lib/weapp/OfflineQuery.js +106 -198
- package/lib/weapp/Parse.js +45 -60
- package/lib/weapp/ParseACL.js +242 -288
- package/lib/weapp/ParseCLP.js +372 -580
- package/lib/weapp/ParseConfig.js +115 -138
- package/lib/weapp/ParseError.js +85 -182
- package/lib/weapp/ParseFile.js +297 -446
- package/lib/weapp/ParseGeoPoint.js +121 -140
- package/lib/weapp/ParseHooks.js +12 -14
- package/lib/weapp/ParseInstallation.js +226 -354
- package/lib/weapp/ParseLiveQuery.js +74 -148
- package/lib/weapp/ParseObject.js +2017 -2622
- package/lib/weapp/ParseOp.js +343 -484
- package/lib/weapp/ParsePolygon.js +101 -120
- package/lib/weapp/ParseQuery.js +1722 -2068
- package/lib/weapp/ParseRelation.js +99 -118
- package/lib/weapp/ParseRole.js +88 -144
- package/lib/weapp/ParseSchema.js +372 -434
- package/lib/weapp/ParseSession.js +62 -110
- package/lib/weapp/ParseUser.js +942 -1270
- package/lib/weapp/Push.js +16 -44
- package/lib/weapp/RESTController.js +86 -125
- package/lib/weapp/SingleInstanceStateController.js +57 -86
- package/lib/weapp/Socket.weapp.js +50 -33
- package/lib/weapp/Storage.js +23 -28
- package/lib/weapp/StorageController.browser.js +16 -13
- package/lib/weapp/StorageController.default.js +15 -14
- package/lib/weapp/StorageController.js +14 -1
- package/lib/weapp/StorageController.react-native.js +31 -30
- package/lib/weapp/StorageController.weapp.js +19 -13
- package/lib/weapp/TaskQueue.js +37 -49
- package/lib/weapp/UniqueInstanceStateController.js +65 -86
- package/lib/weapp/WebSocketController.js +11 -4
- package/lib/weapp/Xhr.weapp.js +90 -78
- package/lib/weapp/arrayContainsObject.js +3 -3
- package/lib/weapp/canBeSerialized.js +10 -11
- package/lib/weapp/decode.js +11 -11
- package/lib/weapp/encode.js +11 -11
- package/lib/weapp/equals.js +9 -10
- package/lib/weapp/escape.js +2 -2
- package/lib/weapp/isRevocableSession.js +1 -1
- package/lib/weapp/parseDate.js +10 -10
- package/lib/weapp/promiseUtils.js +19 -19
- package/lib/weapp/unique.js +4 -4
- package/lib/weapp/unsavedChildren.js +20 -21
- package/lib/weapp/uuid.js +6 -8
- package/package.json +23 -30
package/lib/weapp/decode.js
CHANGED
|
@@ -8,29 +8,29 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = decode;
|
|
9
9
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
10
10
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
11
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
12
11
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
13
12
|
var _ParseFile = _interopRequireDefault(require("./ParseFile"));
|
|
14
13
|
var _ParseGeoPoint = _interopRequireDefault(require("./ParseGeoPoint"));
|
|
15
14
|
var _ParsePolygon = _interopRequireDefault(require("./ParsePolygon"));
|
|
16
15
|
var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
|
|
17
|
-
function decode(value
|
|
18
|
-
if (value === null ||
|
|
16
|
+
function decode(value) {
|
|
17
|
+
if (value === null || typeof value !== 'object' || value instanceof Date) {
|
|
19
18
|
return value;
|
|
20
19
|
}
|
|
21
20
|
if ((0, _isArray.default)(value)) {
|
|
22
|
-
|
|
23
|
-
(0, _forEach.default)(value).call(value,
|
|
21
|
+
const dup = [];
|
|
22
|
+
(0, _forEach.default)(value).call(value, (v, i) => {
|
|
24
23
|
dup[i] = decode(v);
|
|
25
24
|
});
|
|
26
25
|
return dup;
|
|
27
26
|
}
|
|
28
27
|
if (typeof value.__op === 'string') {
|
|
29
|
-
|
|
30
|
-
opFromJSON
|
|
28
|
+
const {
|
|
29
|
+
opFromJSON
|
|
30
|
+
} = _CoreManager.default.getParseOp();
|
|
31
31
|
return opFromJSON(value);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const ParseObject = _CoreManager.default.getParseObject();
|
|
34
34
|
if (value.__type === 'Pointer' && value.className) {
|
|
35
35
|
return ParseObject.fromJSON(value);
|
|
36
36
|
}
|
|
@@ -39,7 +39,7 @@ function decode(value /*: any*/) /*: any*/{
|
|
|
39
39
|
}
|
|
40
40
|
if (value.__type === 'Relation') {
|
|
41
41
|
// The parent and key fields will be populated by the parent
|
|
42
|
-
|
|
42
|
+
const relation = new _ParseRelation.default(null, null);
|
|
43
43
|
relation.targetClassName = value.className;
|
|
44
44
|
return relation;
|
|
45
45
|
}
|
|
@@ -58,8 +58,8 @@ function decode(value /*: any*/) /*: any*/{
|
|
|
58
58
|
if (value.__type === 'Polygon') {
|
|
59
59
|
return new _ParsePolygon.default(value.coordinates);
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
for (
|
|
61
|
+
const copy = {};
|
|
62
|
+
for (const k in value) {
|
|
63
63
|
copy[k] = decode(value[k]);
|
|
64
64
|
}
|
|
65
65
|
return copy;
|
package/lib/weapp/encode.js
CHANGED
|
@@ -6,7 +6,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = _default;
|
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
10
9
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
11
10
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
12
11
|
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
|
|
@@ -19,13 +18,13 @@ var _ParseFile = _interopRequireDefault(require("./ParseFile"));
|
|
|
19
18
|
var _ParseGeoPoint = _interopRequireDefault(require("./ParseGeoPoint"));
|
|
20
19
|
var _ParsePolygon = _interopRequireDefault(require("./ParsePolygon"));
|
|
21
20
|
var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
|
|
22
|
-
function encode(value
|
|
23
|
-
|
|
21
|
+
function encode(value, disallowObjects, forcePointers, seen, offline) {
|
|
22
|
+
const ParseObject = _CoreManager.default.getParseObject();
|
|
24
23
|
if (value instanceof ParseObject) {
|
|
25
24
|
if (disallowObjects) {
|
|
26
25
|
throw new Error('Parse Objects not allowed here');
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
const seenEntry = value.id ? value.className + ':' + value.id : value;
|
|
29
28
|
if (forcePointers || !seen || (0, _indexOf.default)(seen).call(seen, seenEntry) > -1 || value.dirty() || (0, _keys.default)(value._getServerData()).length < 1) {
|
|
30
29
|
var _context;
|
|
31
30
|
if (offline && (0, _startsWith.default)(_context = value._getId()).call(_context, 'local')) {
|
|
@@ -36,8 +35,9 @@ function encode(value /*: any*/, disallowObjects /*: boolean*/, forcePointers /*
|
|
|
36
35
|
seen = (0, _concat.default)(seen).call(seen, seenEntry);
|
|
37
36
|
return value._toFullJSON(seen, offline);
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
Op
|
|
38
|
+
const {
|
|
39
|
+
Op
|
|
40
|
+
} = _CoreManager.default.getParseOp();
|
|
41
41
|
if (value instanceof Op || value instanceof _ParseACL.default || value instanceof _ParseGeoPoint.default || value instanceof _ParsePolygon.default || value instanceof _ParseRelation.default) {
|
|
42
42
|
return value.toJSON();
|
|
43
43
|
}
|
|
@@ -60,19 +60,19 @@ function encode(value /*: any*/, disallowObjects /*: boolean*/, forcePointers /*
|
|
|
60
60
|
return value.source;
|
|
61
61
|
}
|
|
62
62
|
if ((0, _isArray.default)(value)) {
|
|
63
|
-
return (0, _map.default)(value).call(value,
|
|
63
|
+
return (0, _map.default)(value).call(value, v => {
|
|
64
64
|
return encode(v, disallowObjects, forcePointers, seen, offline);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
if (value &&
|
|
68
|
-
|
|
69
|
-
for (
|
|
67
|
+
if (value && typeof value === 'object') {
|
|
68
|
+
const output = {};
|
|
69
|
+
for (const k in value) {
|
|
70
70
|
output[k] = encode(value[k], disallowObjects, forcePointers, seen, offline);
|
|
71
71
|
}
|
|
72
72
|
return output;
|
|
73
73
|
}
|
|
74
74
|
return value;
|
|
75
75
|
}
|
|
76
|
-
function _default(value
|
|
76
|
+
function _default(value, disallowObjects, forcePointers, seen, offline) {
|
|
77
77
|
return encode(value, !!disallowObjects, !!forcePointers, seen || [], offline);
|
|
78
78
|
}
|
package/lib/weapp/equals.js
CHANGED
|
@@ -8,22 +8,21 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = equals;
|
|
9
9
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
10
10
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
11
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
12
11
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
13
12
|
var _ParseACL = _interopRequireDefault(require("./ParseACL"));
|
|
14
13
|
var _ParseFile = _interopRequireDefault(require("./ParseFile"));
|
|
15
14
|
var _ParseGeoPoint = _interopRequireDefault(require("./ParseGeoPoint"));
|
|
16
|
-
function equals(a
|
|
17
|
-
|
|
15
|
+
function equals(a, b) {
|
|
16
|
+
const toString = Object.prototype.toString;
|
|
18
17
|
if (toString.call(a) === '[object Date]' || toString.call(b) === '[object Date]') {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const dateA = new Date(a);
|
|
19
|
+
const dateB = new Date(b);
|
|
21
20
|
return +dateA === +dateB;
|
|
22
21
|
}
|
|
23
|
-
if (
|
|
22
|
+
if (typeof a !== typeof b) {
|
|
24
23
|
return false;
|
|
25
24
|
}
|
|
26
|
-
if (!a ||
|
|
25
|
+
if (!a || typeof a !== 'object') {
|
|
27
26
|
// a is a primitive
|
|
28
27
|
return a === b;
|
|
29
28
|
}
|
|
@@ -34,14 +33,14 @@ function equals(a /*: any*/, b /*: any*/) /*: boolean*/{
|
|
|
34
33
|
if (a.length !== b.length) {
|
|
35
34
|
return false;
|
|
36
35
|
}
|
|
37
|
-
for (
|
|
36
|
+
for (let i = a.length; i--;) {
|
|
38
37
|
if (!equals(a[i], b[i])) {
|
|
39
38
|
return false;
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
return true;
|
|
43
42
|
}
|
|
44
|
-
|
|
43
|
+
const ParseObject = _CoreManager.default.getParseObject();
|
|
45
44
|
if (a instanceof _ParseACL.default || a instanceof _ParseFile.default || a instanceof _ParseGeoPoint.default || a instanceof ParseObject) {
|
|
46
45
|
return a.equals(b);
|
|
47
46
|
}
|
|
@@ -53,7 +52,7 @@ function equals(a /*: any*/, b /*: any*/) /*: boolean*/{
|
|
|
53
52
|
if ((0, _keys.default)(a).length !== (0, _keys.default)(b).length) {
|
|
54
53
|
return false;
|
|
55
54
|
}
|
|
56
|
-
for (
|
|
55
|
+
for (const k in a) {
|
|
57
56
|
if (!equals(a[k], b[k])) {
|
|
58
57
|
return false;
|
|
59
58
|
}
|
package/lib/weapp/escape.js
CHANGED
|
@@ -5,7 +5,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = escape;
|
|
8
|
-
|
|
8
|
+
const encoded = {
|
|
9
9
|
'&': '&',
|
|
10
10
|
'<': '<',
|
|
11
11
|
'>': '>',
|
|
@@ -13,7 +13,7 @@ var encoded = {
|
|
|
13
13
|
"'": ''',
|
|
14
14
|
'"': '"'
|
|
15
15
|
};
|
|
16
|
-
function escape(str
|
|
16
|
+
function escape(str) {
|
|
17
17
|
return str.replace(/[&<>\/'"]/g, function (char) {
|
|
18
18
|
return encoded[char];
|
|
19
19
|
});
|
|
@@ -7,6 +7,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = isRevocableSession;
|
|
9
9
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
10
|
-
function isRevocableSession(token
|
|
10
|
+
function isRevocableSession(token) {
|
|
11
11
|
return (0, _indexOf.default)(token).call(token, 'r:') > -1;
|
|
12
12
|
}
|
package/lib/weapp/parseDate.js
CHANGED
|
@@ -7,18 +7,18 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = parseDate;
|
|
9
9
|
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
|
|
10
|
-
function parseDate(iso8601
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
function parseDate(iso8601) {
|
|
11
|
+
const regexp = new RegExp('^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})' + 'T' + '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})' + '(.([0-9]+))?' + 'Z$');
|
|
12
|
+
const match = regexp.exec(iso8601);
|
|
13
13
|
if (!match) {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const year = (0, _parseInt2.default)(match[1]) || 0;
|
|
17
|
+
const month = ((0, _parseInt2.default)(match[2]) || 1) - 1;
|
|
18
|
+
const day = (0, _parseInt2.default)(match[3]) || 0;
|
|
19
|
+
const hour = (0, _parseInt2.default)(match[4]) || 0;
|
|
20
|
+
const minute = (0, _parseInt2.default)(match[5]) || 0;
|
|
21
|
+
const second = (0, _parseInt2.default)(match[6]) || 0;
|
|
22
|
+
const milli = (0, _parseInt2.default)(match[8]) || 0;
|
|
23
23
|
return new Date(Date.UTC(year, month, day, hour, minute, second, milli));
|
|
24
24
|
}
|
|
@@ -11,38 +11,38 @@ exports.when = when;
|
|
|
11
11
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
12
12
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
13
13
|
// Create Deferred Promise
|
|
14
|
-
function resolvingPromise
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
function resolvingPromise() {
|
|
15
|
+
let res;
|
|
16
|
+
let rej;
|
|
17
|
+
const promise = new _promise.default((resolve, reject) => {
|
|
18
18
|
res = resolve;
|
|
19
19
|
rej = reject;
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
const defer = promise;
|
|
22
22
|
defer.resolve = res;
|
|
23
23
|
defer.reject = rej;
|
|
24
24
|
return defer;
|
|
25
25
|
}
|
|
26
|
-
function when(promises
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
function when(promises) {
|
|
27
|
+
let objects;
|
|
28
|
+
const arrayArgument = (0, _isArray.default)(promises);
|
|
29
29
|
if (arrayArgument) {
|
|
30
30
|
objects = promises;
|
|
31
31
|
} else {
|
|
32
32
|
objects = arguments;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
let total = objects.length;
|
|
35
|
+
let hadError = false;
|
|
36
|
+
const results = [];
|
|
37
|
+
const returnValue = arrayArgument ? [results] : results;
|
|
38
|
+
const errors = [];
|
|
39
39
|
results.length = objects.length;
|
|
40
40
|
errors.length = objects.length;
|
|
41
41
|
if (total === 0) {
|
|
42
42
|
return _promise.default.resolve(returnValue);
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const promise = resolvingPromise();
|
|
45
|
+
const resolveOne = function () {
|
|
46
46
|
total--;
|
|
47
47
|
if (total <= 0) {
|
|
48
48
|
if (hadError) {
|
|
@@ -52,7 +52,7 @@ function when(promises /*: any*/) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
const chain = function (object, index) {
|
|
56
56
|
if (object && typeof object.then === 'function') {
|
|
57
57
|
object.then(function (result) {
|
|
58
58
|
results[index] = result;
|
|
@@ -67,14 +67,14 @@ function when(promises /*: any*/) {
|
|
|
67
67
|
resolveOne();
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
for (
|
|
70
|
+
for (let i = 0; i < objects.length; i++) {
|
|
71
71
|
chain(objects[i], i);
|
|
72
72
|
}
|
|
73
73
|
return promise;
|
|
74
74
|
}
|
|
75
|
-
function continueWhile(test
|
|
75
|
+
function continueWhile(test, emitter) {
|
|
76
76
|
if (test()) {
|
|
77
|
-
return emitter().then(
|
|
77
|
+
return emitter().then(() => {
|
|
78
78
|
return continueWhile(test, emitter);
|
|
79
79
|
});
|
|
80
80
|
}
|
package/lib/weapp/unique.js
CHANGED
|
@@ -10,10 +10,10 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
10
10
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
11
11
|
var _arrayContainsObject = _interopRequireDefault(require("./arrayContainsObject"));
|
|
12
12
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
13
|
-
function unique
|
|
14
|
-
|
|
15
|
-
(0, _forEach.default)(arr).call(arr,
|
|
16
|
-
|
|
13
|
+
function unique(arr) {
|
|
14
|
+
const uniques = [];
|
|
15
|
+
(0, _forEach.default)(arr).call(arr, value => {
|
|
16
|
+
const ParseObject = _CoreManager.default.getParseObject();
|
|
17
17
|
if (value instanceof ParseObject) {
|
|
18
18
|
if (!(0, _arrayContainsObject.default)(uniques, value)) {
|
|
19
19
|
uniques.push(value);
|
|
@@ -10,7 +10,6 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
|
10
10
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
11
11
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
12
12
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
13
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
14
13
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
15
14
|
var _ParseFile = _interopRequireDefault(require("./ParseFile"));
|
|
16
15
|
var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
|
|
@@ -22,39 +21,39 @@ var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
|
|
|
22
21
|
* @param {boolean} allowDeepUnsaved
|
|
23
22
|
* @returns {Array}
|
|
24
23
|
*/
|
|
25
|
-
function unsavedChildren(obj
|
|
26
|
-
|
|
24
|
+
function unsavedChildren(obj, allowDeepUnsaved) {
|
|
25
|
+
const encountered = {
|
|
27
26
|
objects: {},
|
|
28
27
|
files: []
|
|
29
28
|
};
|
|
30
|
-
|
|
29
|
+
const identifier = obj.className + ':' + obj._getId();
|
|
31
30
|
encountered.objects[identifier] = obj.dirty() ? obj : true;
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
if (
|
|
31
|
+
const attributes = obj.attributes;
|
|
32
|
+
for (const attr in attributes) {
|
|
33
|
+
if (typeof attributes[attr] === 'object') {
|
|
35
34
|
traverse(attributes[attr], encountered, false, !!allowDeepUnsaved);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
for (
|
|
37
|
+
const unsaved = [];
|
|
38
|
+
for (const id in encountered.objects) {
|
|
40
39
|
if (id !== identifier && encountered.objects[id] !== true) {
|
|
41
40
|
unsaved.push(encountered.objects[id]);
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
return (0, _concat.default)(unsaved).call(unsaved, encountered.files);
|
|
45
44
|
}
|
|
46
|
-
function traverse(obj
|
|
47
|
-
|
|
45
|
+
function traverse(obj, encountered, shouldThrow, allowDeepUnsaved) {
|
|
46
|
+
const ParseObject = _CoreManager.default.getParseObject();
|
|
48
47
|
if (obj instanceof ParseObject) {
|
|
49
48
|
if (!obj.id && shouldThrow) {
|
|
50
49
|
throw new Error('Cannot create a pointer to an unsaved Object.');
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
if (!encountered.objects[
|
|
54
|
-
encountered.objects[
|
|
55
|
-
|
|
56
|
-
for (
|
|
57
|
-
if (
|
|
51
|
+
const identifier = obj.className + ':' + obj._getId();
|
|
52
|
+
if (!encountered.objects[identifier]) {
|
|
53
|
+
encountered.objects[identifier] = obj.dirty() ? obj : true;
|
|
54
|
+
const attributes = obj.attributes;
|
|
55
|
+
for (const attr in attributes) {
|
|
56
|
+
if (typeof attributes[attr] === 'object') {
|
|
58
57
|
traverse(attributes[attr], encountered, !allowDeepUnsaved, allowDeepUnsaved);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -72,14 +71,14 @@ function traverse(obj /*: ParseObject*/, encountered /*: EncounterMap*/, shouldT
|
|
|
72
71
|
return;
|
|
73
72
|
}
|
|
74
73
|
if ((0, _isArray.default)(obj)) {
|
|
75
|
-
(0, _forEach.default)(obj).call(obj,
|
|
76
|
-
if (
|
|
74
|
+
(0, _forEach.default)(obj).call(obj, el => {
|
|
75
|
+
if (typeof el === 'object') {
|
|
77
76
|
traverse(el, encountered, shouldThrow, allowDeepUnsaved);
|
|
78
77
|
}
|
|
79
78
|
});
|
|
80
79
|
}
|
|
81
|
-
for (
|
|
82
|
-
if (
|
|
80
|
+
for (const k in obj) {
|
|
81
|
+
if (typeof obj[k] === 'object') {
|
|
83
82
|
traverse(obj[k], encountered, shouldThrow, allowDeepUnsaved);
|
|
84
83
|
}
|
|
85
84
|
}
|
package/lib/weapp/uuid.js
CHANGED
|
@@ -6,18 +6,16 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _uuid = require("uuid");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (
|
|
9
|
+
let uuid = function () {
|
|
10
|
+
const s = [];
|
|
11
|
+
const hexDigits = '0123456789abcdef';
|
|
12
|
+
for (let i = 0; i < 36; i++) {
|
|
13
13
|
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
14
14
|
}
|
|
15
15
|
s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
|
16
16
|
s[19] = hexDigits.substr(Number(s[19]) & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
17
17
|
s[8] = s[13] = s[18] = s[23] = '-';
|
|
18
18
|
return s.join('');
|
|
19
|
-
}
|
|
20
|
-
|
|
19
|
+
};
|
|
21
20
|
module.exports = uuid;
|
|
22
|
-
var _default = uuid;
|
|
23
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = uuid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0-alpha.2",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -29,21 +29,18 @@
|
|
|
29
29
|
"react-native": false
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime-corejs3": "7.
|
|
32
|
+
"@babel/runtime-corejs3": "7.24.6",
|
|
33
33
|
"idb-keyval": "6.2.1",
|
|
34
34
|
"react-native-crypto-js": "1.0.0",
|
|
35
35
|
"uuid": "9.0.1",
|
|
36
|
-
"ws": "8.
|
|
36
|
+
"ws": "8.17.0",
|
|
37
37
|
"xmlhttprequest": "1.8.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@babel/core": "7.
|
|
41
|
-
"@babel/eslint-parser": "7.21.8",
|
|
40
|
+
"@babel/core": "7.24.5",
|
|
42
41
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
43
|
-
"@babel/plugin-transform-
|
|
44
|
-
"@babel/
|
|
45
|
-
"@babel/plugin-transform-runtime": "7.21.4",
|
|
46
|
-
"@babel/preset-env": "7.21.5",
|
|
42
|
+
"@babel/plugin-transform-runtime": "7.24.6",
|
|
43
|
+
"@babel/preset-env": "7.24.6",
|
|
47
44
|
"@babel/preset-react": "7.22.5",
|
|
48
45
|
"@babel/preset-typescript": "7.22.5",
|
|
49
46
|
"@definitelytyped/dtslint": "0.0.163",
|
|
@@ -55,17 +52,17 @@
|
|
|
55
52
|
"@semantic-release/github": "8.0.7",
|
|
56
53
|
"@semantic-release/npm": "9.0.2",
|
|
57
54
|
"@semantic-release/release-notes-generator": "10.0.3",
|
|
55
|
+
"@types/facebook-js-sdk": "3.3.11",
|
|
58
56
|
"babel-jest": "29.5.0",
|
|
59
57
|
"babel-plugin-inline-package-json": "2.0.0",
|
|
60
58
|
"babel-plugin-minify-dead-code-elimination": "0.5.2",
|
|
61
59
|
"babel-plugin-transform-inline-environment-variables": "0.4.4",
|
|
62
60
|
"browserify": "17.0.0",
|
|
63
61
|
"codecov": "3.8.3",
|
|
64
|
-
"core-js": "3.
|
|
62
|
+
"core-js": "3.37.1",
|
|
65
63
|
"cross-env": "7.0.2",
|
|
66
|
-
"eslint": "8.
|
|
67
|
-
"eslint-plugin-
|
|
68
|
-
"eslint-plugin-jsdoc": "43.0.7",
|
|
64
|
+
"eslint": "8.56.0",
|
|
65
|
+
"eslint-plugin-jsdoc": "48.2.5",
|
|
69
66
|
"express": "4.18.2",
|
|
70
67
|
"gulp": "4.0.2",
|
|
71
68
|
"gulp-babel": "8.0.0",
|
|
@@ -74,20 +71,20 @@
|
|
|
74
71
|
"gulp-rename": "2.0.0",
|
|
75
72
|
"gulp-uglify": "3.0.2",
|
|
76
73
|
"gulp-watch": "5.0.1",
|
|
77
|
-
"husky": "
|
|
74
|
+
"husky": "9.0.11",
|
|
78
75
|
"jasmine": "5.1.0",
|
|
79
76
|
"jasmine-reporters": "2.5.2",
|
|
80
77
|
"jasmine-spec-reporter": "7.0.0",
|
|
81
|
-
"jest": "29.
|
|
82
|
-
"jest-environment-jsdom": "29.
|
|
83
|
-
"jsdoc": "4.0.
|
|
78
|
+
"jest": "29.7.0",
|
|
79
|
+
"jest-environment-jsdom": "29.7.0",
|
|
80
|
+
"jsdoc": "4.0.3",
|
|
84
81
|
"jsdoc-babel": "0.5.0",
|
|
85
|
-
"lint-staged": "
|
|
82
|
+
"lint-staged": "15.2.2",
|
|
86
83
|
"madge": "7.0.0",
|
|
87
84
|
"metro-react-native-babel-preset": "0.76.4",
|
|
88
85
|
"mongodb-runner": "5.4.3",
|
|
89
86
|
"parse-server": "7.1.0-alpha.1",
|
|
90
|
-
"prettier": "3.
|
|
87
|
+
"prettier": "3.2.5",
|
|
91
88
|
"puppeteer": "20.4.0",
|
|
92
89
|
"regenerator-runtime": "0.13.11",
|
|
93
90
|
"semantic-release": "19.0.5",
|
|
@@ -98,15 +95,15 @@
|
|
|
98
95
|
},
|
|
99
96
|
"scripts": {
|
|
100
97
|
"build": "node build_releases.js",
|
|
101
|
-
"build:types": "tsc",
|
|
98
|
+
"build:types": "tsc && prettier --write 'types/{**/*,*}.ts' && npm run lint:fix",
|
|
102
99
|
"release": "node build_releases.js && npm publish",
|
|
103
100
|
"test": "cross-env PARSE_BUILD=node jest",
|
|
104
101
|
"test:mongodb": "npm run test:mongodb:runnerstart && npm run integration",
|
|
105
102
|
"test:mongodb:runnerstart": "mongodb-runner start -- --port 27017",
|
|
106
103
|
"test:types": "dtslint --expectOnly types",
|
|
107
104
|
"posttest:mongodb": "mongodb-runner stop --all",
|
|
108
|
-
"lint": "eslint --cache src/ integration/",
|
|
109
|
-
"lint:fix": "eslint --fix --cache src/ integration/",
|
|
105
|
+
"lint": "eslint --cache src/ integration/ --ext .js --ext .ts",
|
|
106
|
+
"lint:fix": "eslint --fix --cache src/ integration/ --ext .js --ext .ts",
|
|
110
107
|
"lint:types": "dtslint types",
|
|
111
108
|
"watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
|
|
112
109
|
"watch:browser": "cross-env PARSE_BUILD=browser npm run watch",
|
|
@@ -115,19 +112,15 @@
|
|
|
115
112
|
"integration": "cross-env TESTING=1 jasmine --config=jasmine.json",
|
|
116
113
|
"docs": "jsdoc -c ./jsdoc-conf.json ./src",
|
|
117
114
|
"madge:circular": "madge ./src --extensions js,ts --circular",
|
|
118
|
-
"prepare": "npm run build",
|
|
115
|
+
"prepare": "husky && npm run build",
|
|
116
|
+
"pre-commit": "lint-staged",
|
|
119
117
|
"release_docs": "./release_docs.sh",
|
|
120
118
|
"gulp": "gulp",
|
|
121
|
-
"prettier": "prettier --write '{src,integration}/{**/*,*}.js' && npm run lint:fix",
|
|
119
|
+
"prettier": "prettier --write '{src,integration,types}/{**/*,*}.{js,ts}' && npm run lint:fix",
|
|
122
120
|
"cross-env": "cross-env"
|
|
123
121
|
},
|
|
124
|
-
"husky": {
|
|
125
|
-
"hooks": {
|
|
126
|
-
"pre-commit": "lint-staged"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
122
|
"lint-staged": {
|
|
130
|
-
"{src,integration}/{**/*,*}.js": [
|
|
123
|
+
"{src,integration}/{**/*,*}.{js,ts}": [
|
|
131
124
|
"prettier --write",
|
|
132
125
|
"eslint --fix --cache",
|
|
133
126
|
"git add"
|