parse 5.1.0 → 5.2.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/dist/parse.js +1556 -1309
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +1560 -1313
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Cloud.js +7 -11
- package/lib/browser/CoreManager.js +10 -10
- package/lib/browser/EventuallyQueue.js +1 -1
- package/lib/browser/InstallationController.js +3 -3
- package/lib/browser/LiveQueryClient.js +102 -60
- package/lib/browser/LocalDatastore.js +189 -147
- package/lib/browser/LocalDatastoreController.default.js +14 -9
- package/lib/browser/LocalDatastoreController.react-native.js +14 -12
- package/lib/browser/LocalDatastoreUtils.js +0 -5
- package/lib/browser/ObjectStateMutations.js +57 -21
- package/lib/browser/Parse.js +2 -2
- package/lib/browser/ParseCLP.js +9 -17
- package/lib/browser/ParseFile.js +27 -31
- package/lib/browser/ParseGeoPoint.js +9 -3
- package/lib/browser/ParseHooks.js +13 -13
- package/lib/browser/ParseInstallation.js +117 -9
- package/lib/browser/ParseObject.js +19 -17
- package/lib/browser/ParseOp.js +17 -17
- package/lib/browser/ParsePolygon.js +1 -1
- package/lib/browser/ParseQuery.js +147 -149
- package/lib/browser/ParseRole.js +5 -9
- package/lib/browser/ParseSchema.js +1 -1
- package/lib/browser/ParseUser.js +66 -51
- package/lib/browser/Push.js +5 -10
- package/lib/browser/RESTController.js +1 -1
- package/lib/browser/SingleInstanceStateController.js +1 -1
- package/lib/browser/TaskQueue.js +10 -10
- package/lib/browser/UniqueInstanceStateController.js +1 -1
- package/lib/browser/arrayContainsObject.js +0 -4
- package/lib/browser/canBeSerialized.js +0 -4
- package/lib/browser/decode.js +0 -7
- package/lib/browser/encode.js +3 -7
- package/lib/browser/equals.js +1 -1
- package/lib/browser/escape.js +0 -4
- package/lib/browser/isRevocableSession.js +0 -4
- package/lib/browser/parseDate.js +1 -5
- package/lib/browser/promiseUtils.js +11 -10
- package/lib/browser/unique.js +1 -5
- package/lib/browser/unsavedChildren.js +0 -8
- package/lib/browser/uuid.js +2 -2
- package/lib/node/Cloud.js +7 -11
- package/lib/node/CoreManager.js +10 -10
- package/lib/node/EventuallyQueue.js +1 -1
- package/lib/node/InstallationController.js +3 -3
- package/lib/node/LiveQueryClient.js +14 -24
- package/lib/node/LocalDatastore.js +7 -11
- package/lib/node/LocalDatastoreController.default.js +12 -10
- package/lib/node/LocalDatastoreController.react-native.js +13 -12
- package/lib/node/LocalDatastoreUtils.js +0 -5
- package/lib/node/ObjectStateMutations.js +45 -19
- package/lib/node/Parse.js +2 -2
- package/lib/node/ParseCLP.js +8 -18
- package/lib/node/ParseFile.js +27 -40
- package/lib/node/ParseGeoPoint.js +9 -3
- package/lib/node/ParseHooks.js +13 -13
- package/lib/node/ParseInstallation.js +60 -2
- package/lib/node/ParseObject.js +19 -17
- package/lib/node/ParseOp.js +21 -21
- package/lib/node/ParsePolygon.js +1 -1
- package/lib/node/ParseQuery.js +84 -107
- package/lib/node/ParseRole.js +3 -8
- package/lib/node/ParseSchema.js +4 -4
- package/lib/node/ParseUser.js +42 -37
- package/lib/node/Push.js +3 -8
- package/lib/node/RESTController.js +1 -1
- package/lib/node/SingleInstanceStateController.js +1 -1
- package/lib/node/TaskQueue.js +9 -11
- package/lib/node/UniqueInstanceStateController.js +1 -1
- package/lib/node/arrayContainsObject.js +0 -4
- package/lib/node/canBeSerialized.js +0 -4
- package/lib/node/decode.js +0 -7
- package/lib/node/encode.js +3 -7
- package/lib/node/equals.js +1 -1
- package/lib/node/escape.js +0 -4
- package/lib/node/isRevocableSession.js +0 -4
- package/lib/node/parseDate.js +1 -5
- package/lib/node/promiseUtils.js +11 -10
- package/lib/node/unique.js +1 -5
- package/lib/node/unsavedChildren.js +0 -8
- package/lib/node/uuid.js +2 -2
- package/lib/react-native/Cloud.js +0 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +49 -32
- package/lib/react-native/LocalDatastore.js +38 -14
- package/lib/react-native/LocalDatastoreController.default.js +7 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +7 -1
- package/lib/react-native/ObjectStateMutations.js +30 -9
- package/lib/react-native/ParseCLP.js +3 -3
- package/lib/react-native/ParseFile.js +7 -6
- package/lib/react-native/ParseInstallation.js +51 -3
- package/lib/react-native/ParseObject.js +6 -5
- package/lib/react-native/ParseQuery.js +45 -37
- package/lib/react-native/ParseRole.js +1 -1
- package/lib/react-native/ParseUser.js +22 -16
- package/lib/react-native/TaskQueue.js +8 -2
- package/lib/react-native/decode.js +0 -1
- package/lib/react-native/promiseUtils.js +5 -4
- package/lib/react-native/uuid.js +1 -2
- package/lib/weapp/Cloud.js +7 -11
- package/lib/weapp/CoreManager.js +10 -10
- package/lib/weapp/EventuallyQueue.js +1 -1
- package/lib/weapp/InstallationController.js +3 -3
- package/lib/weapp/LiveQueryClient.js +102 -60
- package/lib/weapp/LocalDatastore.js +189 -147
- package/lib/weapp/LocalDatastoreController.default.js +14 -9
- package/lib/weapp/LocalDatastoreController.react-native.js +14 -12
- package/lib/weapp/LocalDatastoreUtils.js +0 -5
- package/lib/weapp/ObjectStateMutations.js +57 -21
- package/lib/weapp/Parse.js +2 -2
- package/lib/weapp/ParseCLP.js +9 -17
- package/lib/weapp/ParseFile.js +27 -31
- package/lib/weapp/ParseGeoPoint.js +9 -3
- package/lib/weapp/ParseHooks.js +13 -13
- package/lib/weapp/ParseInstallation.js +117 -9
- package/lib/weapp/ParseObject.js +19 -17
- package/lib/weapp/ParseOp.js +17 -17
- package/lib/weapp/ParsePolygon.js +1 -1
- package/lib/weapp/ParseQuery.js +147 -149
- package/lib/weapp/ParseRole.js +5 -9
- package/lib/weapp/ParseSchema.js +1 -1
- package/lib/weapp/ParseUser.js +66 -51
- package/lib/weapp/Push.js +5 -10
- package/lib/weapp/RESTController.js +1 -1
- package/lib/weapp/SingleInstanceStateController.js +1 -1
- package/lib/weapp/TaskQueue.js +10 -10
- package/lib/weapp/UniqueInstanceStateController.js +1 -1
- package/lib/weapp/arrayContainsObject.js +0 -4
- package/lib/weapp/canBeSerialized.js +0 -4
- package/lib/weapp/decode.js +0 -7
- package/lib/weapp/encode.js +3 -7
- package/lib/weapp/equals.js +1 -1
- package/lib/weapp/escape.js +0 -4
- package/lib/weapp/isRevocableSession.js +0 -4
- package/lib/weapp/parseDate.js +1 -5
- package/lib/weapp/promiseUtils.js +11 -10
- package/lib/weapp/unique.js +1 -5
- package/lib/weapp/unsavedChildren.js +0 -8
- package/lib/weapp/uuid.js +3 -3
- package/package.json +5 -6
|
@@ -11,18 +11,19 @@ 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
|
-
var res
|
|
16
|
-
var rej
|
|
14
|
+
function resolvingPromise /*:: <T = any>*/() {
|
|
15
|
+
var res /*: (value: T) => void*/;
|
|
16
|
+
var rej /*: (error: T) => void*/;
|
|
17
17
|
var promise = new _promise.default(function (resolve, reject) {
|
|
18
18
|
res = resolve;
|
|
19
19
|
rej = reject;
|
|
20
20
|
});
|
|
21
|
-
promise
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
var defer /*: typeof promise & { resolve: (res: T) => void, reject: (err: any) => void }*/ = promise;
|
|
22
|
+
defer.resolve = res;
|
|
23
|
+
defer.reject = rej;
|
|
24
|
+
return defer;
|
|
24
25
|
}
|
|
25
|
-
function when(promises) {
|
|
26
|
+
function when(promises /*: any*/) {
|
|
26
27
|
var objects;
|
|
27
28
|
var arrayArgument = (0, _isArray.default)(promises);
|
|
28
29
|
if (arrayArgument) {
|
|
@@ -40,7 +41,7 @@ function when(promises) {
|
|
|
40
41
|
if (total === 0) {
|
|
41
42
|
return _promise.default.resolve(returnValue);
|
|
42
43
|
}
|
|
43
|
-
var promise =
|
|
44
|
+
var promise = resolvingPromise();
|
|
44
45
|
var resolveOne = function () {
|
|
45
46
|
total--;
|
|
46
47
|
if (total <= 0) {
|
|
@@ -51,7 +52,7 @@ function when(promises) {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
|
-
var chain = function (object
|
|
55
|
+
var chain = function (object /*: Promise<any>*/, index /*: number*/) {
|
|
55
56
|
if (object && typeof object.then === 'function') {
|
|
56
57
|
object.then(function (result) {
|
|
57
58
|
results[index] = result;
|
|
@@ -71,7 +72,7 @@ function when(promises) {
|
|
|
71
72
|
}
|
|
72
73
|
return promise;
|
|
73
74
|
}
|
|
74
|
-
function continueWhile(test
|
|
75
|
+
function continueWhile(test /*: () => any*/, emitter /*: () => Promise<any>*/) {
|
|
75
76
|
if (test()) {
|
|
76
77
|
return emitter().then(function () {
|
|
77
78
|
return continueWhile(test, emitter);
|
package/lib/weapp/unique.js
CHANGED
|
@@ -10,12 +10,8 @@ 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
|
-
/**
|
|
14
|
-
* @flow
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
13
|
function unique /*:: <T>*/(arr /*: Array<T>*/) /*: Array<T>*/{
|
|
18
|
-
var uniques = [];
|
|
14
|
+
var uniques /*: T[]*/ = [];
|
|
19
15
|
(0, _forEach.default)(arr).call(arr, function (value) {
|
|
20
16
|
var ParseObject = _CoreManager.default.getParseObject();
|
|
21
17
|
if (value instanceof ParseObject) {
|
|
@@ -14,14 +14,6 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/ty
|
|
|
14
14
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
15
15
|
var _ParseFile = _interopRequireDefault(require("./ParseFile"));
|
|
16
16
|
var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
|
|
17
|
-
/**
|
|
18
|
-
* @flow
|
|
19
|
-
*/
|
|
20
|
-
/*:: import type ParseObject from './ParseObject';*/
|
|
21
|
-
/*:: type EncounterMap = {
|
|
22
|
-
objects: { [identifier: string]: ParseObject | boolean },
|
|
23
|
-
files: Array<ParseFile>,
|
|
24
|
-
};*/
|
|
25
17
|
/**
|
|
26
18
|
* Return an array of unsaved children, which are either Parse Objects or Files.
|
|
27
19
|
* If it encounters any dirty Objects without Ids, it will throw an exception.
|
package/lib/weapp/uuid.js
CHANGED
|
@@ -6,8 +6,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _uuid = require("uuid");
|
|
9
|
-
var uuid
|
|
10
|
-
uuid = function () {
|
|
9
|
+
var uuid = function () {
|
|
11
10
|
var s /*: string[]*/ = [];
|
|
12
11
|
var hexDigits = '0123456789abcdef';
|
|
13
12
|
for (var i = 0; i < 36; i++) {
|
|
@@ -17,7 +16,8 @@ uuid = function () {
|
|
|
17
16
|
s[19] = hexDigits.substr(Number(s[19]) & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
18
17
|
s[8] = s[13] = s[18] = s[23] = '-';
|
|
19
18
|
return s.join('');
|
|
20
|
-
}
|
|
19
|
+
} /*: () => string*/;
|
|
20
|
+
|
|
21
21
|
module.exports = uuid;
|
|
22
22
|
var _default = uuid;
|
|
23
23
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0-alpha.1",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@babel/core": "7.22.0",
|
|
41
|
-
"@babel/eslint-parser": "7.21.8",
|
|
42
41
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
43
42
|
"@babel/plugin-transform-flow-comments": "7.22.5",
|
|
44
43
|
"@babel/plugin-transform-flow-strip-types": "7.21.0",
|
|
@@ -63,9 +62,9 @@
|
|
|
63
62
|
"codecov": "3.8.3",
|
|
64
63
|
"core-js": "3.30.2",
|
|
65
64
|
"cross-env": "7.0.2",
|
|
66
|
-
"eslint": "8.
|
|
65
|
+
"eslint": "8.56.0",
|
|
67
66
|
"eslint-plugin-flowtype": "8.0.3",
|
|
68
|
-
"eslint-plugin-jsdoc": "
|
|
67
|
+
"eslint-plugin-jsdoc": "48.2.5",
|
|
69
68
|
"express": "4.18.2",
|
|
70
69
|
"gulp": "4.0.2",
|
|
71
70
|
"gulp-babel": "8.0.0",
|
|
@@ -105,8 +104,8 @@
|
|
|
105
104
|
"test:mongodb:runnerstart": "mongodb-runner start -- --port 27017",
|
|
106
105
|
"test:types": "dtslint --expectOnly types",
|
|
107
106
|
"posttest:mongodb": "mongodb-runner stop --all",
|
|
108
|
-
"lint": "eslint --cache src/ integration/",
|
|
109
|
-
"lint:fix": "eslint --fix --cache src/ integration/",
|
|
107
|
+
"lint": "eslint --cache src/ integration/ --ext .js --ext .ts",
|
|
108
|
+
"lint:fix": "eslint --fix --cache src/ integration/ --ext .js --ext .ts",
|
|
110
109
|
"lint:types": "dtslint types",
|
|
111
110
|
"watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
|
|
112
111
|
"watch:browser": "cross-env PARSE_BUILD=browser npm run watch",
|