parse 4.0.0-alpha.1 → 4.0.0-alpha.11
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/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +6 -5
- package/dist/parse.js +12838 -21190
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +7921 -17062
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +2 -27
- package/lib/browser/AnonymousUtils.js +6 -42
- package/lib/browser/Cloud.js +12 -77
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -191
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -8
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -42
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -20
- package/lib/browser/LiveQueryClient.js +105 -213
- package/lib/browser/LiveQuerySubscription.js +10 -39
- package/lib/browser/LocalDatastore.js +451 -1081
- package/lib/browser/LocalDatastoreController.js +145 -602
- package/lib/browser/LocalDatastoreController.react-native.js +137 -573
- package/lib/browser/LocalDatastoreUtils.js +2 -19
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +61 -222
- package/lib/browser/Parse.js +12 -115
- package/lib/browser/ParseACL.js +33 -148
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -95
- package/lib/browser/ParseError.js +63 -99
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -89
- package/lib/browser/ParseHooks.js +1 -34
- package/lib/browser/ParseInstallation.js +4 -32
- package/lib/browser/ParseLiveQuery.js +96 -505
- package/lib/browser/ParseObject.js +665 -1845
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -70
- package/lib/browser/ParseQuery.js +403 -1504
- package/lib/browser/ParseRelation.js +12 -68
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -208
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -50
- package/lib/browser/RESTController.js +28 -157
- package/lib/browser/SingleInstanceStateController.js +19 -144
- package/lib/browser/Socket.weapp.js +0 -10
- package/lib/browser/Storage.js +10 -80
- package/lib/browser/StorageController.browser.js +4 -24
- package/lib/browser/StorageController.default.js +4 -24
- package/lib/browser/StorageController.react-native.js +6 -40
- package/lib/browser/StorageController.weapp.js +5 -23
- package/lib/browser/TaskQueue.js +1 -29
- package/lib/browser/UniqueInstanceStateController.js +19 -149
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -23
- package/lib/browser/canBeSerialized.js +3 -40
- package/lib/browser/decode.js +3 -40
- package/lib/browser/encode.js +9 -77
- package/lib/browser/equals.js +2 -34
- package/lib/browser/escape.js +1 -15
- package/lib/browser/isRevocableSession.js +2 -18
- package/lib/browser/parseDate.js +2 -20
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -24
- package/lib/browser/unsavedChildren.js +6 -57
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -25
- package/lib/node/AnonymousUtils.js +5 -44
- package/lib/node/Cloud.js +10 -73
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -227
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -8
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -44
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -22
- package/lib/node/LiveQueryClient.js +72 -154
- package/lib/node/LiveQuerySubscription.js +7 -26
- package/lib/node/LocalDatastore.js +19 -182
- package/lib/node/LocalDatastoreController.js +6 -45
- package/lib/node/LocalDatastoreController.react-native.js +6 -52
- package/lib/node/LocalDatastoreUtils.js +1 -13
- package/lib/node/ObjectStateMutations.js +13 -100
- package/lib/node/OfflineQuery.js +27 -151
- package/lib/node/Parse.js +11 -108
- package/lib/node/ParseACL.js +32 -157
- package/lib/node/ParseCLP.js +69 -269
- package/lib/node/ParseConfig.js +16 -91
- package/lib/node/ParseError.js +61 -74
- package/lib/node/ParseFile.js +49 -212
- package/lib/node/ParseGeoPoint.js +21 -89
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -17
- package/lib/node/ParseLiveQuery.js +10 -43
- package/lib/node/ParseObject.js +229 -964
- package/lib/node/ParseOp.js +31 -262
- package/lib/node/ParsePolygon.js +12 -69
- package/lib/node/ParseQuery.js +169 -888
- package/lib/node/ParseRelation.js +11 -68
- package/lib/node/ParseRole.js +10 -64
- package/lib/node/ParseSchema.js +46 -229
- package/lib/node/ParseSession.js +8 -57
- package/lib/node/ParseUser.js +107 -583
- package/lib/node/Push.js +4 -44
- package/lib/node/RESTController.js +18 -127
- package/lib/node/SingleInstanceStateController.js +17 -137
- package/lib/node/Socket.weapp.js +0 -7
- package/lib/node/Storage.js +10 -90
- package/lib/node/StorageController.browser.js +4 -30
- package/lib/node/StorageController.default.js +5 -28
- package/lib/node/StorageController.react-native.js +6 -47
- package/lib/node/StorageController.weapp.js +6 -28
- package/lib/node/TaskQueue.js +1 -24
- package/lib/node/UniqueInstanceStateController.js +16 -140
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -19
- package/lib/node/canBeSerialized.js +2 -35
- package/lib/node/decode.js +1 -33
- package/lib/node/encode.js +3 -61
- package/lib/node/equals.js +0 -27
- package/lib/node/escape.js +1 -13
- package/lib/node/isRevocableSession.js +1 -12
- package/lib/node/parseDate.js +1 -14
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -18
- package/lib/node/unsavedChildren.js +2 -45
- package/lib/node/uuid.js +6 -1
- package/lib/react-native/Analytics.js +0 -9
- package/lib/react-native/AnonymousUtils.js +0 -10
- package/lib/react-native/Cloud.js +0 -26
- package/lib/react-native/CoreManager.js +2 -6
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +156 -711
- package/lib/react-native/FacebookUtils.js +0 -22
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -6
- package/lib/react-native/LiveQueryClient.js +46 -157
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +281 -948
- package/lib/react-native/LocalDatastoreController.js +71 -552
- package/lib/react-native/LocalDatastoreController.react-native.js +91 -526
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +2 -65
- package/lib/react-native/OfflineQuery.js +25 -196
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +23 -161
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +55 -529
- package/lib/react-native/ParseGeoPoint.js +0 -17
- package/lib/react-native/ParseHooks.js +0 -30
- package/lib/react-native/ParseInstallation.js +1 -23
- package/lib/react-native/ParseLiveQuery.js +55 -472
- package/lib/react-native/ParseObject.js +245 -1246
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +182 -874
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +3 -54
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +95 -773
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +12 -109
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +0 -10
- package/lib/react-native/Storage.js +0 -24
- package/lib/react-native/StorageController.browser.js +0 -2
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -2
- package/lib/react-native/TaskQueue.js +0 -15
- package/lib/react-native/UniqueInstanceStateController.js +0 -47
- package/lib/react-native/Xhr.weapp.js +0 -16
- package/lib/react-native/arrayContainsObject.js +0 -5
- package/lib/react-native/canBeSerialized.js +0 -18
- package/lib/react-native/decode.js +0 -21
- package/lib/react-native/encode.js +0 -25
- package/lib/react-native/equals.js +0 -18
- package/lib/react-native/escape.js +0 -1
- package/lib/react-native/isRevocableSession.js +0 -1
- package/lib/react-native/parseDate.js +0 -3
- package/lib/react-native/promiseUtils.js +0 -13
- package/lib/react-native/unique.js +0 -4
- package/lib/react-native/unsavedChildren.js +0 -21
- package/lib/react-native/uuid.js +3 -1
- package/lib/weapp/Analytics.js +2 -27
- package/lib/weapp/AnonymousUtils.js +6 -42
- package/lib/weapp/Cloud.js +12 -77
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -191
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -8
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -42
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -20
- package/lib/weapp/LiveQueryClient.js +105 -213
- package/lib/weapp/LiveQuerySubscription.js +10 -39
- package/lib/weapp/LocalDatastore.js +451 -1081
- package/lib/weapp/LocalDatastoreController.js +145 -602
- package/lib/weapp/LocalDatastoreController.react-native.js +137 -573
- package/lib/weapp/LocalDatastoreUtils.js +2 -19
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +61 -222
- package/lib/weapp/Parse.js +12 -115
- package/lib/weapp/ParseACL.js +33 -148
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -95
- package/lib/weapp/ParseError.js +63 -99
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -89
- package/lib/weapp/ParseHooks.js +1 -34
- package/lib/weapp/ParseInstallation.js +4 -32
- package/lib/weapp/ParseLiveQuery.js +96 -505
- package/lib/weapp/ParseObject.js +665 -1845
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -70
- package/lib/weapp/ParseQuery.js +403 -1504
- package/lib/weapp/ParseRelation.js +12 -68
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -208
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -50
- package/lib/weapp/RESTController.js +28 -157
- package/lib/weapp/SingleInstanceStateController.js +19 -144
- package/lib/weapp/Socket.weapp.js +0 -10
- package/lib/weapp/Storage.js +10 -80
- package/lib/weapp/StorageController.browser.js +4 -24
- package/lib/weapp/StorageController.default.js +4 -24
- package/lib/weapp/StorageController.react-native.js +6 -40
- package/lib/weapp/StorageController.weapp.js +5 -23
- package/lib/weapp/TaskQueue.js +1 -29
- package/lib/weapp/UniqueInstanceStateController.js +19 -149
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -23
- package/lib/weapp/canBeSerialized.js +3 -40
- package/lib/weapp/decode.js +3 -40
- package/lib/weapp/encode.js +9 -77
- package/lib/weapp/equals.js +2 -34
- package/lib/weapp/escape.js +1 -15
- package/lib/weapp/isRevocableSession.js +2 -18
- package/lib/weapp/parseDate.js +2 -20
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -24
- package/lib/weapp/unsavedChildren.js +6 -57
- package/lib/weapp/uuid.js +1 -6
- package/package.json +35 -31
- package/PATENTS +0 -37
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
@@ -12,47 +11,12 @@ exports.popPendingState = popPendingState;
|
|
|
12
11
|
exports.pushPendingState = pushPendingState;
|
|
13
12
|
exports.setPendingOp = setPendingOp;
|
|
14
13
|
exports.setServerData = setServerData;
|
|
15
|
-
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
14
|
var _encode = _interopRequireDefault(require("./encode"));
|
|
19
|
-
|
|
20
15
|
var _ParseFile = _interopRequireDefault(require("./ParseFile"));
|
|
21
|
-
|
|
22
16
|
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
23
|
-
|
|
24
17
|
var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
|
|
25
|
-
|
|
26
18
|
var _TaskQueue = _interopRequireDefault(require("./TaskQueue"));
|
|
27
|
-
|
|
28
19
|
var _ParseOp = require("./ParseOp");
|
|
29
|
-
|
|
30
|
-
function ownKeys(object, enumerableOnly) {
|
|
31
|
-
var keys = Object.keys(object);
|
|
32
|
-
|
|
33
|
-
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
35
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
36
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
-
})), keys.push.apply(keys, symbols);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _objectSpread(target) {
|
|
44
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
45
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
46
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
47
|
-
(0, _defineProperty2.default)(target, key, source[key]);
|
|
48
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
49
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return target;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
20
|
function defaultState() {
|
|
57
21
|
return {
|
|
58
22
|
serverData: {},
|
|
@@ -62,7 +26,6 @@ function defaultState() {
|
|
|
62
26
|
existed: false
|
|
63
27
|
};
|
|
64
28
|
}
|
|
65
|
-
|
|
66
29
|
function setServerData(serverData, attributes) {
|
|
67
30
|
for (var _attr in attributes) {
|
|
68
31
|
if (typeof attributes[_attr] !== 'undefined') {
|
|
@@ -72,39 +35,30 @@ function setServerData(serverData, attributes) {
|
|
|
72
35
|
}
|
|
73
36
|
}
|
|
74
37
|
}
|
|
75
|
-
|
|
76
38
|
function setPendingOp(pendingOps, attr, op) {
|
|
77
39
|
var last = pendingOps.length - 1;
|
|
78
|
-
|
|
79
40
|
if (op) {
|
|
80
41
|
pendingOps[last][attr] = op;
|
|
81
42
|
} else {
|
|
82
43
|
delete pendingOps[last][attr];
|
|
83
44
|
}
|
|
84
45
|
}
|
|
85
|
-
|
|
86
46
|
function pushPendingState(pendingOps) {
|
|
87
47
|
pendingOps.push({});
|
|
88
48
|
}
|
|
89
|
-
|
|
90
49
|
function popPendingState(pendingOps) {
|
|
91
50
|
var first = pendingOps.shift();
|
|
92
|
-
|
|
93
51
|
if (!pendingOps.length) {
|
|
94
52
|
pendingOps[0] = {};
|
|
95
53
|
}
|
|
96
|
-
|
|
97
54
|
return first;
|
|
98
55
|
}
|
|
99
|
-
|
|
100
56
|
function mergeFirstPendingState(pendingOps) {
|
|
101
57
|
var first = popPendingState(pendingOps);
|
|
102
58
|
var next = pendingOps[0];
|
|
103
|
-
|
|
104
59
|
for (var _attr2 in first) {
|
|
105
60
|
if (next[_attr2] && first[_attr2]) {
|
|
106
61
|
var merged = next[_attr2].mergeWith(first[_attr2]);
|
|
107
|
-
|
|
108
62
|
if (merged) {
|
|
109
63
|
next[_attr2] = merged;
|
|
110
64
|
}
|
|
@@ -113,10 +67,8 @@ function mergeFirstPendingState(pendingOps) {
|
|
|
113
67
|
}
|
|
114
68
|
}
|
|
115
69
|
}
|
|
116
|
-
|
|
117
70
|
function estimateAttribute(serverData, pendingOps, className, id, attr) {
|
|
118
71
|
var value = serverData[attr];
|
|
119
|
-
|
|
120
72
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
121
73
|
if (pendingOps[i][attr]) {
|
|
122
74
|
if (pendingOps[i][attr] instanceof _ParseOp.RelationOp) {
|
|
@@ -131,17 +83,13 @@ function estimateAttribute(serverData, pendingOps, className, id, attr) {
|
|
|
131
83
|
}
|
|
132
84
|
}
|
|
133
85
|
}
|
|
134
|
-
|
|
135
86
|
return value;
|
|
136
87
|
}
|
|
137
|
-
|
|
138
88
|
function estimateAttributes(serverData, pendingOps, className, id) {
|
|
139
89
|
var data = {};
|
|
140
|
-
|
|
141
90
|
for (var attr in serverData) {
|
|
142
91
|
data[attr] = serverData[attr];
|
|
143
92
|
}
|
|
144
|
-
|
|
145
93
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
146
94
|
for (attr in pendingOps[i]) {
|
|
147
95
|
if (pendingOps[i][attr] instanceof _ParseOp.RelationOp) {
|
|
@@ -156,20 +104,15 @@ function estimateAttributes(serverData, pendingOps, className, id) {
|
|
|
156
104
|
var fields = attr.split('.');
|
|
157
105
|
var first = fields[0];
|
|
158
106
|
var last = fields[fields.length - 1];
|
|
159
|
-
data[first] =
|
|
160
|
-
|
|
161
|
-
var object = _objectSpread({}, data);
|
|
162
|
-
|
|
107
|
+
data[first] = Object.assign({}, serverData[first]);
|
|
108
|
+
var object = Object.assign({}, data);
|
|
163
109
|
for (var _i = 0; _i < fields.length - 1; _i++) {
|
|
164
110
|
var key = fields[_i];
|
|
165
|
-
|
|
166
111
|
if (!(key in object)) {
|
|
167
112
|
object[key] = {};
|
|
168
113
|
}
|
|
169
|
-
|
|
170
114
|
object = object[key];
|
|
171
115
|
}
|
|
172
|
-
|
|
173
116
|
object[last] = pendingOps[i][attr].applyTo(object[last]);
|
|
174
117
|
} else {
|
|
175
118
|
data[attr] = pendingOps[i][attr].applyTo(data[attr]);
|
|
@@ -177,30 +120,24 @@ function estimateAttributes(serverData, pendingOps, className, id) {
|
|
|
177
120
|
}
|
|
178
121
|
}
|
|
179
122
|
}
|
|
180
|
-
|
|
181
123
|
return data;
|
|
182
124
|
}
|
|
183
|
-
|
|
184
125
|
function nestedSet(obj, key, value) {
|
|
185
126
|
var path = key.split('.');
|
|
186
|
-
|
|
187
127
|
for (var i = 0; i < path.length - 1; i++) {
|
|
188
128
|
if (!(path[i] in obj)) obj[path[i]] = {};
|
|
189
129
|
obj = obj[path[i]];
|
|
190
130
|
}
|
|
191
|
-
|
|
192
131
|
if (typeof value === 'undefined') {
|
|
193
132
|
delete obj[path[path.length - 1]];
|
|
194
133
|
} else {
|
|
195
134
|
obj[path[path.length - 1]] = value;
|
|
196
135
|
}
|
|
197
136
|
}
|
|
198
|
-
|
|
199
137
|
function commitServerChanges(serverData, objectCache, changes) {
|
|
200
138
|
for (var _attr3 in changes) {
|
|
201
139
|
var val = changes[_attr3];
|
|
202
140
|
nestedSet(serverData, _attr3, val);
|
|
203
|
-
|
|
204
141
|
if (val && typeof val === 'object' && !(val instanceof _ParseObject.default) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
|
|
205
142
|
var json = (0, _encode.default)(val, false, true);
|
|
206
143
|
objectCache[_attr3] = JSON.stringify(json);
|