parse 4.0.1 → 4.1.0-beta.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 +17994 -26193
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +8738 -17728
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +2 -20
- package/lib/browser/AnonymousUtils.js +6 -35
- package/lib/browser/Cloud.js +12 -70
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -184
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -1
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -35
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -13
- package/lib/browser/LiveQueryClient.js +87 -204
- 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 -12
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +42 -222
- package/lib/browser/Parse.js +12 -106
- package/lib/browser/ParseACL.js +33 -141
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -88
- package/lib/browser/ParseError.js +63 -90
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -82
- 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 +628 -1840
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -63
- package/lib/browser/ParseQuery.js +404 -1505
- package/lib/browser/ParseRelation.js +12 -61
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -201
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -43
- package/lib/browser/RESTController.js +18 -140
- package/lib/browser/SingleInstanceStateController.js +19 -137
- package/lib/browser/Socket.weapp.js +2 -12
- package/lib/browser/Storage.js +10 -73
- package/lib/browser/StorageController.browser.js +4 -17
- package/lib/browser/StorageController.default.js +4 -17
- package/lib/browser/StorageController.react-native.js +6 -33
- package/lib/browser/StorageController.weapp.js +5 -16
- package/lib/browser/TaskQueue.js +1 -22
- package/lib/browser/UniqueInstanceStateController.js +19 -142
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -16
- package/lib/browser/canBeSerialized.js +3 -33
- package/lib/browser/decode.js +3 -33
- package/lib/browser/encode.js +9 -70
- package/lib/browser/equals.js +2 -25
- package/lib/browser/escape.js +1 -8
- package/lib/browser/isRevocableSession.js +2 -11
- package/lib/browser/parseDate.js +2 -13
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -17
- package/lib/browser/unsavedChildren.js +6 -50
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -18
- package/lib/node/AnonymousUtils.js +5 -37
- package/lib/node/Cloud.js +10 -66
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -220
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -1
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -37
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -15
- package/lib/node/LiveQueryClient.js +56 -136
- package/lib/node/LiveQuerySubscription.js +7 -16
- package/lib/node/LocalDatastore.js +19 -175
- package/lib/node/LocalDatastoreController.js +6 -38
- package/lib/node/LocalDatastoreController.react-native.js +6 -45
- package/lib/node/LocalDatastoreUtils.js +1 -6
- package/lib/node/ObjectStateMutations.js +13 -93
- package/lib/node/OfflineQuery.js +20 -152
- package/lib/node/Parse.js +11 -99
- package/lib/node/ParseACL.js +32 -150
- package/lib/node/ParseCLP.js +69 -262
- package/lib/node/ParseConfig.js +16 -84
- package/lib/node/ParseError.js +61 -65
- package/lib/node/ParseFile.js +49 -205
- package/lib/node/ParseGeoPoint.js +21 -82
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -10
- package/lib/node/ParseLiveQuery.js +10 -36
- package/lib/node/ParseObject.js +193 -939
- package/lib/node/ParseOp.js +31 -255
- package/lib/node/ParsePolygon.js +12 -62
- package/lib/node/ParseQuery.js +170 -882
- package/lib/node/ParseRelation.js +11 -61
- package/lib/node/ParseRole.js +10 -57
- package/lib/node/ParseSchema.js +46 -222
- package/lib/node/ParseSession.js +8 -50
- package/lib/node/ParseUser.js +107 -576
- package/lib/node/Push.js +4 -37
- package/lib/node/RESTController.js +8 -110
- package/lib/node/SingleInstanceStateController.js +17 -130
- package/lib/node/Socket.weapp.js +2 -9
- package/lib/node/Storage.js +10 -83
- package/lib/node/StorageController.browser.js +4 -23
- package/lib/node/StorageController.default.js +5 -21
- package/lib/node/StorageController.react-native.js +6 -40
- package/lib/node/StorageController.weapp.js +6 -21
- package/lib/node/TaskQueue.js +1 -17
- package/lib/node/UniqueInstanceStateController.js +16 -133
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -12
- package/lib/node/canBeSerialized.js +2 -28
- package/lib/node/decode.js +1 -26
- package/lib/node/encode.js +3 -54
- package/lib/node/equals.js +0 -18
- package/lib/node/escape.js +1 -6
- package/lib/node/isRevocableSession.js +1 -5
- package/lib/node/parseDate.js +1 -7
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -11
- package/lib/node/unsavedChildren.js +2 -38
- 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 +1 -5
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +4 -52
- 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 +24 -101
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +6 -113
- package/lib/react-native/LocalDatastoreController.js +0 -21
- package/lib/react-native/LocalDatastoreController.react-native.js +4 -31
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +0 -34
- package/lib/react-native/OfflineQuery.js +2 -137
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +32 -96
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +3 -72
- 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 +3 -25
- package/lib/react-native/ParseObject.js +4 -371
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +6 -262
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +0 -51
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +1 -224
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +1 -70
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +2 -12
- 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 -20
- package/lib/weapp/AnonymousUtils.js +6 -35
- package/lib/weapp/Cloud.js +12 -70
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -184
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -1
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -35
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -13
- package/lib/weapp/LiveQueryClient.js +87 -204
- 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 -12
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +42 -222
- package/lib/weapp/Parse.js +12 -106
- package/lib/weapp/ParseACL.js +33 -141
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -88
- package/lib/weapp/ParseError.js +63 -90
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -82
- 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 +628 -1840
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -63
- package/lib/weapp/ParseQuery.js +404 -1505
- package/lib/weapp/ParseRelation.js +12 -61
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -201
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -43
- package/lib/weapp/RESTController.js +18 -140
- package/lib/weapp/SingleInstanceStateController.js +19 -137
- package/lib/weapp/Socket.weapp.js +2 -12
- package/lib/weapp/Storage.js +10 -73
- package/lib/weapp/StorageController.browser.js +4 -17
- package/lib/weapp/StorageController.default.js +4 -17
- package/lib/weapp/StorageController.react-native.js +6 -33
- package/lib/weapp/StorageController.weapp.js +5 -16
- package/lib/weapp/TaskQueue.js +1 -22
- package/lib/weapp/UniqueInstanceStateController.js +19 -142
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -16
- package/lib/weapp/canBeSerialized.js +3 -33
- package/lib/weapp/decode.js +3 -33
- package/lib/weapp/encode.js +9 -70
- package/lib/weapp/equals.js +2 -25
- package/lib/weapp/escape.js +1 -8
- package/lib/weapp/isRevocableSession.js +2 -11
- package/lib/weapp/parseDate.js +2 -13
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -17
- package/lib/weapp/unsavedChildren.js +6 -50
- package/lib/weapp/uuid.js +1 -6
- package/package.json +45 -43
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
|
|
10
7
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
8
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
9
|
var _ParseRole = _interopRequireDefault(require("./ParseRole"));
|
|
15
|
-
|
|
16
10
|
var _ParseUser = _interopRequireDefault(require("./ParseUser"));
|
|
17
|
-
|
|
18
11
|
var PUBLIC_KEY = '*';
|
|
19
12
|
var VALID_PERMISSIONS = new Map();
|
|
20
13
|
VALID_PERMISSIONS.set('get', {});
|
|
@@ -26,76 +19,57 @@ VALID_PERMISSIONS.set('delete', {});
|
|
|
26
19
|
VALID_PERMISSIONS.set('addField', {});
|
|
27
20
|
var VALID_PERMISSIONS_EXTENDED = new Map();
|
|
28
21
|
VALID_PERMISSIONS_EXTENDED.set('protectedFields', {});
|
|
29
|
-
|
|
30
22
|
var ParseCLP = function () {
|
|
31
23
|
function ParseCLP(userId) {
|
|
32
24
|
var _this = this;
|
|
33
|
-
|
|
34
25
|
(0, _classCallCheck2.default)(this, ParseCLP);
|
|
35
26
|
this.permissionsMap = {};
|
|
36
|
-
|
|
37
|
-
var _loop = function (operation, group) {
|
|
27
|
+
var _loop = function _loop(operation, group) {
|
|
38
28
|
_this.permissionsMap[operation] = Object.assign({}, group);
|
|
39
29
|
var action = operation.charAt(0).toUpperCase() + operation.slice(1);
|
|
40
|
-
|
|
41
30
|
_this[`get${action}RequiresAuthentication`] = function () {
|
|
42
31
|
return this._getAccess(operation, 'requiresAuthentication');
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
_this[`set${action}RequiresAuthentication`] = function (allowed) {
|
|
46
34
|
this._setAccess(operation, 'requiresAuthentication', allowed);
|
|
47
35
|
};
|
|
48
|
-
|
|
49
36
|
_this[`get${action}PointerFields`] = function () {
|
|
50
37
|
return this._getAccess(operation, 'pointerFields', false);
|
|
51
38
|
};
|
|
52
|
-
|
|
53
39
|
_this[`set${action}PointerFields`] = function (pointerFields) {
|
|
54
40
|
this._setArrayAccess(operation, 'pointerFields', pointerFields);
|
|
55
41
|
};
|
|
56
|
-
|
|
57
42
|
_this[`get${action}Access`] = function (entity) {
|
|
58
43
|
return this._getAccess(operation, entity);
|
|
59
44
|
};
|
|
60
|
-
|
|
61
45
|
_this[`set${action}Access`] = function (entity, allowed) {
|
|
62
46
|
this._setAccess(operation, entity, allowed);
|
|
63
47
|
};
|
|
64
|
-
|
|
65
48
|
_this[`getPublic${action}Access`] = function () {
|
|
66
49
|
return this[`get${action}Access`](PUBLIC_KEY);
|
|
67
50
|
};
|
|
68
|
-
|
|
69
51
|
_this[`setPublic${action}Access`] = function (allowed) {
|
|
70
52
|
this[`set${action}Access`](PUBLIC_KEY, allowed);
|
|
71
53
|
};
|
|
72
|
-
|
|
73
54
|
_this[`getRole${action}Access`] = function (role) {
|
|
74
55
|
return this[`get${action}Access`](this._getRoleName(role));
|
|
75
56
|
};
|
|
76
|
-
|
|
77
57
|
_this[`setRole${action}Access`] = function (role, allowed) {
|
|
78
58
|
this[`set${action}Access`](this._getRoleName(role), allowed);
|
|
79
59
|
};
|
|
80
60
|
};
|
|
81
|
-
|
|
82
61
|
for (var _ref of VALID_PERMISSIONS.entries()) {
|
|
83
62
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2);
|
|
84
|
-
|
|
85
63
|
var operation = _ref2[0];
|
|
86
64
|
var group = _ref2[1];
|
|
87
|
-
|
|
88
65
|
_loop(operation, group);
|
|
89
66
|
}
|
|
90
|
-
|
|
91
67
|
for (var _ref3 of VALID_PERMISSIONS_EXTENDED.entries()) {
|
|
92
68
|
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2);
|
|
93
|
-
|
|
94
69
|
var _operation = _ref4[0];
|
|
95
70
|
var _group = _ref4[1];
|
|
96
71
|
this.permissionsMap[_operation] = Object.assign({}, _group);
|
|
97
72
|
}
|
|
98
|
-
|
|
99
73
|
if (userId && typeof userId === 'object') {
|
|
100
74
|
if (userId instanceof _ParseUser.default) {
|
|
101
75
|
this.setReadAccess(userId, true);
|
|
@@ -109,11 +83,9 @@ var ParseCLP = function () {
|
|
|
109
83
|
var isValidPermission = !!VALID_PERMISSIONS.get(_permission);
|
|
110
84
|
var isValidPermissionExtended = !!VALID_PERMISSIONS_EXTENDED.get(_permission);
|
|
111
85
|
var isValidGroupPermission = ['readUserFields', 'writeUserFields'].includes(_permission);
|
|
112
|
-
|
|
113
86
|
if (typeof _permission !== 'string' || !(isValidPermission || isValidPermissionExtended || isValidGroupPermission)) {
|
|
114
87
|
throw new TypeError('Tried to create an CLP with an invalid permission type.');
|
|
115
88
|
}
|
|
116
|
-
|
|
117
89
|
if (isValidGroupPermission) {
|
|
118
90
|
if (users.every(function (pointer) {
|
|
119
91
|
return typeof pointer === 'string';
|
|
@@ -124,14 +96,11 @@ var ParseCLP = function () {
|
|
|
124
96
|
throw new TypeError('Tried to create an CLP with an invalid permission value.');
|
|
125
97
|
}
|
|
126
98
|
}
|
|
127
|
-
|
|
128
99
|
for (var user in users) {
|
|
129
100
|
var allowed = users[user];
|
|
130
|
-
|
|
131
101
|
if (typeof allowed !== 'boolean' && !isValidPermissionExtended && user !== 'pointerFields') {
|
|
132
102
|
throw new TypeError('Tried to create an CLP with an invalid permission value.');
|
|
133
103
|
}
|
|
134
|
-
|
|
135
104
|
this.permissionsMap[_permission][user] = allowed;
|
|
136
105
|
}
|
|
137
106
|
}
|
|
@@ -140,98 +109,79 @@ var ParseCLP = function () {
|
|
|
140
109
|
throw new TypeError('ParseCLP constructed with a function. Did you forget ()?');
|
|
141
110
|
}
|
|
142
111
|
}
|
|
143
|
-
|
|
144
112
|
(0, _createClass2.default)(ParseCLP, [{
|
|
145
113
|
key: "toJSON",
|
|
146
|
-
value: function () {
|
|
114
|
+
value: function toJSON() {
|
|
147
115
|
return Object.assign({}, this.permissionsMap);
|
|
148
116
|
}
|
|
149
117
|
}, {
|
|
150
118
|
key: "equals",
|
|
151
|
-
value: function (other) {
|
|
119
|
+
value: function equals(other) {
|
|
152
120
|
if (!(other instanceof ParseCLP)) {
|
|
153
121
|
return false;
|
|
154
122
|
}
|
|
155
|
-
|
|
156
123
|
var permissions = Object.keys(this.permissionsMap);
|
|
157
124
|
var otherPermissions = Object.keys(other.permissionsMap);
|
|
158
|
-
|
|
159
125
|
if (permissions.length !== otherPermissions.length) {
|
|
160
126
|
return false;
|
|
161
127
|
}
|
|
162
|
-
|
|
163
128
|
for (var _permission2 in this.permissionsMap) {
|
|
164
129
|
if (!other.permissionsMap[_permission2]) {
|
|
165
130
|
return false;
|
|
166
131
|
}
|
|
167
|
-
|
|
168
132
|
var users = Object.keys(this.permissionsMap[_permission2]);
|
|
169
133
|
var otherUsers = Object.keys(other.permissionsMap[_permission2]);
|
|
170
|
-
|
|
171
134
|
if (users.length !== otherUsers.length) {
|
|
172
135
|
return false;
|
|
173
136
|
}
|
|
174
|
-
|
|
175
137
|
for (var user in this.permissionsMap[_permission2]) {
|
|
176
138
|
if (!other.permissionsMap[_permission2][user]) {
|
|
177
139
|
return false;
|
|
178
140
|
}
|
|
179
|
-
|
|
180
141
|
if (this.permissionsMap[_permission2][user] !== other.permissionsMap[_permission2][user]) {
|
|
181
142
|
return false;
|
|
182
143
|
}
|
|
183
144
|
}
|
|
184
145
|
}
|
|
185
|
-
|
|
186
146
|
return true;
|
|
187
147
|
}
|
|
188
148
|
}, {
|
|
189
149
|
key: "_getRoleName",
|
|
190
|
-
value: function (role) {
|
|
150
|
+
value: function _getRoleName(role) {
|
|
191
151
|
var name = role;
|
|
192
|
-
|
|
193
152
|
if (role instanceof _ParseRole.default) {
|
|
194
153
|
name = role.getName();
|
|
195
154
|
}
|
|
196
|
-
|
|
197
155
|
if (typeof name !== 'string') {
|
|
198
156
|
throw new TypeError('role must be a Parse.Role or a String');
|
|
199
157
|
}
|
|
200
|
-
|
|
201
158
|
return `role:${name}`;
|
|
202
159
|
}
|
|
203
160
|
}, {
|
|
204
161
|
key: "_parseEntity",
|
|
205
|
-
value: function (entity) {
|
|
162
|
+
value: function _parseEntity(entity) {
|
|
206
163
|
var userId = entity;
|
|
207
|
-
|
|
208
164
|
if (userId instanceof _ParseUser.default) {
|
|
209
165
|
userId = userId.id;
|
|
210
|
-
|
|
211
166
|
if (!userId) {
|
|
212
167
|
throw new Error('Cannot get access for a Parse.User without an id.');
|
|
213
168
|
}
|
|
214
169
|
} else if (userId instanceof _ParseRole.default) {
|
|
215
170
|
userId = this._getRoleName(userId);
|
|
216
171
|
}
|
|
217
|
-
|
|
218
172
|
if (typeof userId !== 'string') {
|
|
219
173
|
throw new TypeError('userId must be a string.');
|
|
220
174
|
}
|
|
221
|
-
|
|
222
175
|
return userId;
|
|
223
176
|
}
|
|
224
177
|
}, {
|
|
225
178
|
key: "_setAccess",
|
|
226
|
-
value: function (permission, userId, allowed) {
|
|
179
|
+
value: function _setAccess(permission, userId, allowed) {
|
|
227
180
|
userId = this._parseEntity(userId);
|
|
228
|
-
|
|
229
181
|
if (typeof allowed !== 'boolean') {
|
|
230
182
|
throw new TypeError('allowed must be either true or false.');
|
|
231
183
|
}
|
|
232
|
-
|
|
233
184
|
var permissions = this.permissionsMap[permission][userId];
|
|
234
|
-
|
|
235
185
|
if (!permissions) {
|
|
236
186
|
if (!allowed) {
|
|
237
187
|
return;
|
|
@@ -239,7 +189,6 @@ var ParseCLP = function () {
|
|
|
239
189
|
this.permissionsMap[permission][userId] = {};
|
|
240
190
|
}
|
|
241
191
|
}
|
|
242
|
-
|
|
243
192
|
if (allowed) {
|
|
244
193
|
this.permissionsMap[permission][userId] = true;
|
|
245
194
|
} else {
|
|
@@ -248,31 +197,26 @@ var ParseCLP = function () {
|
|
|
248
197
|
}
|
|
249
198
|
}, {
|
|
250
199
|
key: "_getAccess",
|
|
251
|
-
value: function (permission, userId) {
|
|
200
|
+
value: function _getAccess(permission, userId) {
|
|
252
201
|
var returnBoolean = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
253
202
|
userId = this._parseEntity(userId);
|
|
254
203
|
var permissions = this.permissionsMap[permission][userId];
|
|
255
|
-
|
|
256
204
|
if (returnBoolean) {
|
|
257
205
|
if (!permissions) {
|
|
258
206
|
return false;
|
|
259
207
|
}
|
|
260
|
-
|
|
261
208
|
return !!this.permissionsMap[permission][userId];
|
|
262
209
|
}
|
|
263
|
-
|
|
264
210
|
return permissions;
|
|
265
211
|
}
|
|
266
212
|
}, {
|
|
267
213
|
key: "_setArrayAccess",
|
|
268
|
-
value: function (permission, userId, fields) {
|
|
214
|
+
value: function _setArrayAccess(permission, userId, fields) {
|
|
269
215
|
userId = this._parseEntity(userId);
|
|
270
216
|
var permissions = this.permissionsMap[permission][userId];
|
|
271
|
-
|
|
272
217
|
if (!permissions) {
|
|
273
218
|
this.permissionsMap[permission][userId] = [];
|
|
274
219
|
}
|
|
275
|
-
|
|
276
220
|
if (!fields || Array.isArray(fields) && fields.length === 0) {
|
|
277
221
|
delete this.permissionsMap[permission][userId];
|
|
278
222
|
} else if (Array.isArray(fields) && fields.every(function (field) {
|
|
@@ -285,13 +229,11 @@ var ParseCLP = function () {
|
|
|
285
229
|
}
|
|
286
230
|
}, {
|
|
287
231
|
key: "_setGroupPointerPermission",
|
|
288
|
-
value: function (operation, pointerFields) {
|
|
232
|
+
value: function _setGroupPointerPermission(operation, pointerFields) {
|
|
289
233
|
var fields = this.permissionsMap[operation];
|
|
290
|
-
|
|
291
234
|
if (!fields) {
|
|
292
235
|
this.permissionsMap[operation] = [];
|
|
293
236
|
}
|
|
294
|
-
|
|
295
237
|
if (!pointerFields || Array.isArray(pointerFields) && pointerFields.length === 0) {
|
|
296
238
|
delete this.permissionsMap[operation];
|
|
297
239
|
} else if (Array.isArray(pointerFields) && pointerFields.every(function (field) {
|
|
@@ -304,132 +246,126 @@ var ParseCLP = function () {
|
|
|
304
246
|
}
|
|
305
247
|
}, {
|
|
306
248
|
key: "_getGroupPointerPermissions",
|
|
307
|
-
value: function (operation) {
|
|
249
|
+
value: function _getGroupPointerPermissions(operation) {
|
|
308
250
|
return this.permissionsMap[operation];
|
|
309
251
|
}
|
|
310
252
|
}, {
|
|
311
253
|
key: "setReadUserFields",
|
|
312
|
-
value: function (pointerFields) {
|
|
254
|
+
value: function setReadUserFields(pointerFields) {
|
|
313
255
|
this._setGroupPointerPermission('readUserFields', pointerFields);
|
|
314
256
|
}
|
|
315
257
|
}, {
|
|
316
258
|
key: "getReadUserFields",
|
|
317
|
-
value: function () {
|
|
259
|
+
value: function getReadUserFields() {
|
|
318
260
|
return this._getGroupPointerPermissions('readUserFields');
|
|
319
261
|
}
|
|
320
262
|
}, {
|
|
321
263
|
key: "setWriteUserFields",
|
|
322
|
-
value: function (pointerFields) {
|
|
264
|
+
value: function setWriteUserFields(pointerFields) {
|
|
323
265
|
this._setGroupPointerPermission('writeUserFields', pointerFields);
|
|
324
266
|
}
|
|
325
267
|
}, {
|
|
326
268
|
key: "getWriteUserFields",
|
|
327
|
-
value: function () {
|
|
269
|
+
value: function getWriteUserFields() {
|
|
328
270
|
return this._getGroupPointerPermissions('writeUserFields');
|
|
329
271
|
}
|
|
330
272
|
}, {
|
|
331
273
|
key: "setProtectedFields",
|
|
332
|
-
value: function (userId, fields) {
|
|
274
|
+
value: function setProtectedFields(userId, fields) {
|
|
333
275
|
this._setArrayAccess('protectedFields', userId, fields);
|
|
334
276
|
}
|
|
335
277
|
}, {
|
|
336
278
|
key: "getProtectedFields",
|
|
337
|
-
value: function (userId) {
|
|
279
|
+
value: function getProtectedFields(userId) {
|
|
338
280
|
return this._getAccess('protectedFields', userId, false);
|
|
339
281
|
}
|
|
340
282
|
}, {
|
|
341
283
|
key: "setReadAccess",
|
|
342
|
-
value: function (userId, allowed) {
|
|
284
|
+
value: function setReadAccess(userId, allowed) {
|
|
343
285
|
this._setAccess('find', userId, allowed);
|
|
344
|
-
|
|
345
286
|
this._setAccess('get', userId, allowed);
|
|
346
|
-
|
|
347
287
|
this._setAccess('count', userId, allowed);
|
|
348
288
|
}
|
|
349
289
|
}, {
|
|
350
290
|
key: "getReadAccess",
|
|
351
|
-
value: function (userId) {
|
|
291
|
+
value: function getReadAccess(userId) {
|
|
352
292
|
return this._getAccess('find', userId) && this._getAccess('get', userId) && this._getAccess('count', userId);
|
|
353
293
|
}
|
|
354
294
|
}, {
|
|
355
295
|
key: "setWriteAccess",
|
|
356
|
-
value: function (userId, allowed) {
|
|
296
|
+
value: function setWriteAccess(userId, allowed) {
|
|
357
297
|
this._setAccess('create', userId, allowed);
|
|
358
|
-
|
|
359
298
|
this._setAccess('update', userId, allowed);
|
|
360
|
-
|
|
361
299
|
this._setAccess('delete', userId, allowed);
|
|
362
|
-
|
|
363
300
|
this._setAccess('addField', userId, allowed);
|
|
364
301
|
}
|
|
365
302
|
}, {
|
|
366
303
|
key: "getWriteAccess",
|
|
367
|
-
value: function (userId) {
|
|
304
|
+
value: function getWriteAccess(userId) {
|
|
368
305
|
return this._getAccess('create', userId) && this._getAccess('update', userId) && this._getAccess('delete', userId) && this._getAccess('addField', userId);
|
|
369
306
|
}
|
|
370
307
|
}, {
|
|
371
308
|
key: "setPublicReadAccess",
|
|
372
|
-
value: function (allowed) {
|
|
309
|
+
value: function setPublicReadAccess(allowed) {
|
|
373
310
|
this.setReadAccess(PUBLIC_KEY, allowed);
|
|
374
311
|
}
|
|
375
312
|
}, {
|
|
376
313
|
key: "getPublicReadAccess",
|
|
377
|
-
value: function () {
|
|
314
|
+
value: function getPublicReadAccess() {
|
|
378
315
|
return this.getReadAccess(PUBLIC_KEY);
|
|
379
316
|
}
|
|
380
317
|
}, {
|
|
381
318
|
key: "setPublicWriteAccess",
|
|
382
|
-
value: function (allowed) {
|
|
319
|
+
value: function setPublicWriteAccess(allowed) {
|
|
383
320
|
this.setWriteAccess(PUBLIC_KEY, allowed);
|
|
384
321
|
}
|
|
385
322
|
}, {
|
|
386
323
|
key: "getPublicWriteAccess",
|
|
387
|
-
value: function () {
|
|
324
|
+
value: function getPublicWriteAccess() {
|
|
388
325
|
return this.getWriteAccess(PUBLIC_KEY);
|
|
389
326
|
}
|
|
390
327
|
}, {
|
|
391
328
|
key: "setPublicProtectedFields",
|
|
392
|
-
value: function (fields) {
|
|
329
|
+
value: function setPublicProtectedFields(fields) {
|
|
393
330
|
this.setProtectedFields(PUBLIC_KEY, fields);
|
|
394
331
|
}
|
|
395
332
|
}, {
|
|
396
333
|
key: "getPublicProtectedFields",
|
|
397
|
-
value: function () {
|
|
334
|
+
value: function getPublicProtectedFields() {
|
|
398
335
|
return this.getProtectedFields(PUBLIC_KEY);
|
|
399
336
|
}
|
|
400
337
|
}, {
|
|
401
338
|
key: "getRoleReadAccess",
|
|
402
|
-
value: function (role) {
|
|
339
|
+
value: function getRoleReadAccess(role) {
|
|
403
340
|
return this.getReadAccess(this._getRoleName(role));
|
|
404
341
|
}
|
|
405
342
|
}, {
|
|
406
343
|
key: "getRoleWriteAccess",
|
|
407
|
-
value: function (role) {
|
|
344
|
+
value: function getRoleWriteAccess(role) {
|
|
408
345
|
return this.getWriteAccess(this._getRoleName(role));
|
|
409
346
|
}
|
|
410
347
|
}, {
|
|
411
348
|
key: "setRoleReadAccess",
|
|
412
|
-
value: function (role, allowed) {
|
|
349
|
+
value: function setRoleReadAccess(role, allowed) {
|
|
413
350
|
this.setReadAccess(this._getRoleName(role), allowed);
|
|
414
351
|
}
|
|
415
352
|
}, {
|
|
416
353
|
key: "setRoleWriteAccess",
|
|
417
|
-
value: function (role, allowed) {
|
|
354
|
+
value: function setRoleWriteAccess(role, allowed) {
|
|
418
355
|
this.setWriteAccess(this._getRoleName(role), allowed);
|
|
419
356
|
}
|
|
420
357
|
}, {
|
|
421
358
|
key: "getRoleProtectedFields",
|
|
422
|
-
value: function (role) {
|
|
359
|
+
value: function getRoleProtectedFields(role) {
|
|
423
360
|
return this.getProtectedFields(this._getRoleName(role));
|
|
424
361
|
}
|
|
425
362
|
}, {
|
|
426
363
|
key: "setRoleProtectedFields",
|
|
427
|
-
value: function (role, fields) {
|
|
364
|
+
value: function setRoleProtectedFields(role, fields) {
|
|
428
365
|
this.setProtectedFields(this._getRoleName(role), fields);
|
|
429
366
|
}
|
|
430
367
|
}]);
|
|
431
368
|
return ParseCLP;
|
|
432
369
|
}();
|
|
433
|
-
|
|
434
370
|
var _default = ParseCLP;
|
|
435
371
|
exports.default = _default;
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
|
|
10
7
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
|
|
12
8
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
13
|
-
|
|
14
9
|
var _decode = _interopRequireDefault(require("./decode"));
|
|
15
|
-
|
|
16
10
|
var _encode = _interopRequireDefault(require("./encode"));
|
|
17
|
-
|
|
18
11
|
var _escape2 = _interopRequireDefault(require("./escape"));
|
|
19
|
-
|
|
20
12
|
var _ParseError = _interopRequireDefault(require("./ParseError"));
|
|
21
|
-
|
|
22
13
|
var _Storage = _interopRequireDefault(require("./Storage"));
|
|
23
|
-
|
|
24
14
|
var ParseConfig = function () {
|
|
25
15
|
function ParseConfig() {
|
|
26
16
|
(0, _classCallCheck2.default)(this, ParseConfig);
|
|
27
17
|
this.attributes = {};
|
|
28
18
|
this._escapedAttributes = {};
|
|
29
19
|
}
|
|
30
|
-
|
|
31
20
|
(0, _createClass2.default)(ParseConfig, [{
|
|
32
21
|
key: "get",
|
|
33
22
|
value: function (attr) {
|
|
@@ -37,18 +26,14 @@ var ParseConfig = function () {
|
|
|
37
26
|
key: "escape",
|
|
38
27
|
value: function (attr) {
|
|
39
28
|
var html = this._escapedAttributes[attr];
|
|
40
|
-
|
|
41
29
|
if (html) {
|
|
42
30
|
return html;
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
var val = this.attributes[attr];
|
|
46
33
|
var escaped = '';
|
|
47
|
-
|
|
48
34
|
if (val != null) {
|
|
49
35
|
escaped = (0, _escape2.default)(val.toString());
|
|
50
36
|
}
|
|
51
|
-
|
|
52
37
|
this._escapedAttributes[attr] = escaped;
|
|
53
38
|
return escaped;
|
|
54
39
|
}
|
|
@@ -56,23 +41,19 @@ var ParseConfig = function () {
|
|
|
56
41
|
key: "current",
|
|
57
42
|
value: function () {
|
|
58
43
|
var controller = _CoreManager.default.getConfigController();
|
|
59
|
-
|
|
60
44
|
return controller.current();
|
|
61
45
|
}
|
|
62
46
|
}, {
|
|
63
47
|
key: "get",
|
|
64
48
|
value: function () {
|
|
65
49
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
66
|
-
|
|
67
50
|
var controller = _CoreManager.default.getConfigController();
|
|
68
|
-
|
|
69
51
|
return controller.get(options);
|
|
70
52
|
}
|
|
71
53
|
}, {
|
|
72
54
|
key: "save",
|
|
73
55
|
value: function (attrs, masterKeyOnlyFlags) {
|
|
74
56
|
var controller = _CoreManager.default.getConfigController();
|
|
75
|
-
|
|
76
57
|
return controller.save(attrs, masterKeyOnlyFlags).then(function () {
|
|
77
58
|
return controller.get({
|
|
78
59
|
useMasterKey: true
|
|
@@ -89,14 +70,11 @@ var ParseConfig = function () {
|
|
|
89
70
|
}]);
|
|
90
71
|
return ParseConfig;
|
|
91
72
|
}();
|
|
92
|
-
|
|
93
73
|
var currentConfig = null;
|
|
94
74
|
var CURRENT_CONFIG_KEY = 'currentConfig';
|
|
95
|
-
|
|
96
75
|
function decodePayload(data) {
|
|
97
76
|
try {
|
|
98
77
|
var json = JSON.parse(data);
|
|
99
|
-
|
|
100
78
|
if (json && typeof json === 'object') {
|
|
101
79
|
return (0, _decode.default)(json);
|
|
102
80
|
}
|
|
@@ -104,63 +82,48 @@ function decodePayload(data) {
|
|
|
104
82
|
return null;
|
|
105
83
|
}
|
|
106
84
|
}
|
|
107
|
-
|
|
108
85
|
var DefaultController = {
|
|
109
86
|
current: function () {
|
|
110
87
|
if (currentConfig) {
|
|
111
88
|
return currentConfig;
|
|
112
89
|
}
|
|
113
|
-
|
|
114
90
|
var config = new ParseConfig();
|
|
115
|
-
|
|
116
91
|
var storagePath = _Storage.default.generatePath(CURRENT_CONFIG_KEY);
|
|
117
|
-
|
|
118
92
|
if (!_Storage.default.async()) {
|
|
119
93
|
var configData = _Storage.default.getItem(storagePath);
|
|
120
|
-
|
|
121
94
|
if (configData) {
|
|
122
95
|
var attributes = decodePayload(configData);
|
|
123
|
-
|
|
124
96
|
if (attributes) {
|
|
125
97
|
config.attributes = attributes;
|
|
126
98
|
currentConfig = config;
|
|
127
99
|
}
|
|
128
100
|
}
|
|
129
|
-
|
|
130
101
|
return config;
|
|
131
102
|
}
|
|
132
|
-
|
|
133
103
|
return _Storage.default.getItemAsync(storagePath).then(function (configData) {
|
|
134
104
|
if (configData) {
|
|
135
105
|
var _attributes = decodePayload(configData);
|
|
136
|
-
|
|
137
106
|
if (_attributes) {
|
|
138
107
|
config.attributes = _attributes;
|
|
139
108
|
currentConfig = config;
|
|
140
109
|
}
|
|
141
110
|
}
|
|
142
|
-
|
|
143
111
|
return config;
|
|
144
112
|
});
|
|
145
113
|
},
|
|
146
114
|
get: function () {
|
|
147
115
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
148
|
-
|
|
149
116
|
var RESTController = _CoreManager.default.getRESTController();
|
|
150
|
-
|
|
151
117
|
return RESTController.request('GET', 'config', {}, options).then(function (response) {
|
|
152
118
|
if (!response || !response.params) {
|
|
153
119
|
var error = new _ParseError.default(_ParseError.default.INVALID_JSON, 'Config JSON response invalid.');
|
|
154
120
|
return Promise.reject(error);
|
|
155
121
|
}
|
|
156
|
-
|
|
157
122
|
var config = new ParseConfig();
|
|
158
123
|
config.attributes = {};
|
|
159
|
-
|
|
160
124
|
for (var attr in response.params) {
|
|
161
125
|
config.attributes[attr] = (0, _decode.default)(response.params[attr]);
|
|
162
126
|
}
|
|
163
|
-
|
|
164
127
|
currentConfig = config;
|
|
165
128
|
return _Storage.default.setItemAsync(_Storage.default.generatePath(CURRENT_CONFIG_KEY), JSON.stringify(response.params)).then(function () {
|
|
166
129
|
return config;
|
|
@@ -169,13 +132,10 @@ var DefaultController = {
|
|
|
169
132
|
},
|
|
170
133
|
save: function (attrs, masterKeyOnlyFlags) {
|
|
171
134
|
var RESTController = _CoreManager.default.getRESTController();
|
|
172
|
-
|
|
173
135
|
var encodedAttrs = {};
|
|
174
|
-
|
|
175
136
|
for (var _key in attrs) {
|
|
176
137
|
encodedAttrs[_key] = (0, _encode.default)(attrs[_key]);
|
|
177
138
|
}
|
|
178
|
-
|
|
179
139
|
return RESTController.request('PUT', 'config', {
|
|
180
140
|
params: encodedAttrs,
|
|
181
141
|
masterKeyOnly: masterKeyOnlyFlags
|
|
@@ -191,8 +151,6 @@ var DefaultController = {
|
|
|
191
151
|
});
|
|
192
152
|
}
|
|
193
153
|
};
|
|
194
|
-
|
|
195
154
|
_CoreManager.default.setConfigController(DefaultController);
|
|
196
|
-
|
|
197
155
|
var _default = ParseConfig;
|
|
198
156
|
exports.default = _default;
|
|
@@ -1,47 +1,33 @@
|
|
|
1
1
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
|
|
10
7
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
|
|
12
8
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
13
|
-
|
|
14
9
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
12
|
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
21
|
-
|
|
22
13
|
function _createSuper(Derived) {
|
|
23
14
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
24
|
-
|
|
25
15
|
return function () {
|
|
26
16
|
var Super = (0, _getPrototypeOf2.default)(Derived),
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
result;
|
|
29
18
|
if (hasNativeReflectConstruct) {
|
|
30
19
|
var NewTarget = (0, _getPrototypeOf2.default)(this).constructor;
|
|
31
20
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
32
21
|
} else {
|
|
33
22
|
result = Super.apply(this, arguments);
|
|
34
23
|
}
|
|
35
|
-
|
|
36
24
|
return (0, _possibleConstructorReturn2.default)(this, result);
|
|
37
25
|
};
|
|
38
26
|
}
|
|
39
|
-
|
|
40
27
|
function _isNativeReflectConstruct() {
|
|
41
28
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
42
29
|
if (Reflect.construct.sham) return false;
|
|
43
30
|
if (typeof Proxy === "function") return true;
|
|
44
|
-
|
|
45
31
|
try {
|
|
46
32
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
47
33
|
return true;
|
|
@@ -49,15 +35,11 @@ function _isNativeReflectConstruct() {
|
|
|
49
35
|
return false;
|
|
50
36
|
}
|
|
51
37
|
}
|
|
52
|
-
|
|
53
38
|
var ParseError = function (_Error) {
|
|
54
39
|
(0, _inherits2.default)(ParseError, _Error);
|
|
55
|
-
|
|
56
40
|
var _super = _createSuper(ParseError);
|
|
57
|
-
|
|
58
41
|
function ParseError(code, message) {
|
|
59
42
|
var _this;
|
|
60
|
-
|
|
61
43
|
(0, _classCallCheck2.default)(this, ParseError);
|
|
62
44
|
_this = _super.call(this, message);
|
|
63
45
|
_this.code = code;
|
|
@@ -67,7 +49,6 @@ var ParseError = function (_Error) {
|
|
|
67
49
|
});
|
|
68
50
|
return _this;
|
|
69
51
|
}
|
|
70
|
-
|
|
71
52
|
(0, _createClass2.default)(ParseError, [{
|
|
72
53
|
key: "toString",
|
|
73
54
|
value: function () {
|
|
@@ -76,7 +57,6 @@ var ParseError = function (_Error) {
|
|
|
76
57
|
}]);
|
|
77
58
|
return ParseError;
|
|
78
59
|
}((0, _wrapNativeSuper2.default)(Error));
|
|
79
|
-
|
|
80
60
|
ParseError.OTHER_CAUSE = -1;
|
|
81
61
|
ParseError.INTERNAL_SERVER_ERROR = 1;
|
|
82
62
|
ParseError.CONNECTION_FAILED = 100;
|