parse 3.5.1-beta.1 → 4.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/dist/parse.js +421 -347
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +421 -347
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +31 -27
- package/lib/browser/LiveQueryClient.js +6 -2
- package/lib/browser/LocalDatastore.js +20 -20
- package/lib/browser/LocalDatastoreController.js +16 -14
- package/lib/browser/LocalDatastoreController.react-native.js +10 -10
- package/lib/browser/ParseCLP.js +32 -32
- package/lib/browser/ParseFile.js +26 -15
- package/lib/browser/ParseLiveQuery.js +6 -6
- package/lib/browser/ParseObject.js +84 -69
- package/lib/browser/ParseOp.js +3 -1
- package/lib/browser/ParseQuery.js +115 -88
- package/lib/browser/ParseUser.js +74 -64
- package/lib/browser/RESTController.js +6 -7
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/ObjectStateMutations.js +14 -43
- package/lib/node/ParseCLP.js +12 -41
- package/lib/node/ParseFile.js +15 -41
- package/lib/node/ParseObject.js +13 -41
- package/lib/node/ParseQuery.js +3 -1
- package/lib/node/RESTController.js +2 -43
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +6 -2
- package/lib/react-native/LocalDatastore.js +3 -2
- package/lib/react-native/ParseCLP.js +32 -32
- package/lib/react-native/ParseFile.js +9 -3
- package/lib/react-native/ParseObject.js +14 -9
- package/lib/react-native/ParseOp.js +3 -1
- package/lib/react-native/ParseQuery.js +21 -7
- package/lib/react-native/RESTController.js +6 -7
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +31 -27
- package/lib/weapp/LiveQueryClient.js +6 -2
- package/lib/weapp/LocalDatastore.js +20 -20
- package/lib/weapp/LocalDatastoreController.js +16 -14
- package/lib/weapp/LocalDatastoreController.react-native.js +10 -10
- package/lib/weapp/ParseCLP.js +32 -32
- package/lib/weapp/ParseFile.js +26 -15
- package/lib/weapp/ParseLiveQuery.js +6 -6
- package/lib/weapp/ParseObject.js +84 -69
- package/lib/weapp/ParseOp.js +3 -1
- package/lib/weapp/ParseQuery.js +115 -88
- package/lib/weapp/ParseUser.js +74 -64
- package/lib/weapp/RESTController.js +6 -7
- package/package.json +6 -2
package/lib/node/ParseCLP.js
CHANGED
|
@@ -14,47 +14,17 @@ function _interopRequireDefault(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Copyright (c) 2015-present, Parse, LLC.
|
|
19
|
+
* All rights reserved.
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the BSD-style license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
24
|
+
*
|
|
25
|
+
* @flow
|
|
26
|
+
*/
|
|
17
27
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) {
|
|
19
|
-
var keys = Object.keys(object);
|
|
20
|
-
|
|
21
|
-
if (Object.getOwnPropertySymbols) {
|
|
22
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
23
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
24
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
25
|
-
})), keys.push.apply(keys, symbols);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return keys;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _objectSpread(target) {
|
|
32
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
33
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
34
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
35
|
-
_defineProperty(target, key, source[key]);
|
|
36
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
37
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return target;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _defineProperty(obj, key, value) {
|
|
45
|
-
if (key in obj) {
|
|
46
|
-
Object.defineProperty(obj, key, {
|
|
47
|
-
value: value,
|
|
48
|
-
enumerable: true,
|
|
49
|
-
configurable: true,
|
|
50
|
-
writable: true
|
|
51
|
-
});
|
|
52
|
-
} else {
|
|
53
|
-
obj[key] = value;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return obj;
|
|
57
|
-
}
|
|
58
28
|
|
|
59
29
|
const PUBLIC_KEY = '*';
|
|
60
30
|
const VALID_PERMISSIONS
|
|
@@ -277,7 +247,8 @@ class ParseCLP {
|
|
|
277
247
|
toJSON()
|
|
278
248
|
/*: PermissionsMap*/
|
|
279
249
|
{
|
|
280
|
-
return
|
|
250
|
+
return { ...this.permissionsMap
|
|
251
|
+
};
|
|
281
252
|
}
|
|
282
253
|
/**
|
|
283
254
|
* Returns whether this CLP is equal to another object
|
package/lib/node/ParseFile.js
CHANGED
|
@@ -12,47 +12,19 @@ function _interopRequireDefault(obj) {
|
|
|
12
12
|
default: obj
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Copyright (c) 2015-present, Parse, LLC.
|
|
17
|
+
* All rights reserved.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the BSD-style license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
21
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
22
|
+
*
|
|
23
|
+
* @flow
|
|
24
|
+
*/
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
var keys = Object.keys(object);
|
|
18
|
-
|
|
19
|
-
if (Object.getOwnPropertySymbols) {
|
|
20
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
21
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
22
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
23
|
-
})), keys.push.apply(keys, symbols);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return keys;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function _objectSpread(target) {
|
|
30
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
31
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
32
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
33
|
-
_defineProperty(target, key, source[key]);
|
|
34
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
35
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return target;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _defineProperty(obj, key, value) {
|
|
43
|
-
if (key in obj) {
|
|
44
|
-
Object.defineProperty(obj, key, {
|
|
45
|
-
value: value,
|
|
46
|
-
enumerable: true,
|
|
47
|
-
configurable: true,
|
|
48
|
-
writable: true
|
|
49
|
-
});
|
|
50
|
-
} else {
|
|
51
|
-
obj[key] = value;
|
|
52
|
-
}
|
|
26
|
+
/* global XMLHttpRequest, Blob */
|
|
53
27
|
|
|
54
|
-
return obj;
|
|
55
|
-
}
|
|
56
28
|
|
|
57
29
|
const ParseError = require('./ParseError').default;
|
|
58
30
|
|
|
@@ -611,8 +583,10 @@ const DefaultController = {
|
|
|
611
583
|
= {
|
|
612
584
|
base64: source.base64,
|
|
613
585
|
fileData: {
|
|
614
|
-
metadata:
|
|
615
|
-
|
|
586
|
+
metadata: { ...options.metadata
|
|
587
|
+
},
|
|
588
|
+
tags: { ...options.tags
|
|
589
|
+
}
|
|
616
590
|
}
|
|
617
591
|
};
|
|
618
592
|
delete options.metadata;
|
package/lib/node/ParseObject.js
CHANGED
|
@@ -98,47 +98,17 @@ function _interopRequireDefault(obj) {
|
|
|
98
98
|
default: obj
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Copyright (c) 2015-present, Parse, LLC.
|
|
103
|
+
* All rights reserved.
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the BSD-style license found in the
|
|
106
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
107
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
108
|
+
*
|
|
109
|
+
* @flow
|
|
110
|
+
*/
|
|
101
111
|
|
|
102
|
-
function ownKeys(object, enumerableOnly) {
|
|
103
|
-
var keys = Object.keys(object);
|
|
104
|
-
|
|
105
|
-
if (Object.getOwnPropertySymbols) {
|
|
106
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
107
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
108
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
109
|
-
})), keys.push.apply(keys, symbols);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return keys;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function _objectSpread(target) {
|
|
116
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
117
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
118
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
119
|
-
_defineProperty(target, key, source[key]);
|
|
120
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
121
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return target;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _defineProperty(obj, key, value) {
|
|
129
|
-
if (key in obj) {
|
|
130
|
-
Object.defineProperty(obj, key, {
|
|
131
|
-
value: value,
|
|
132
|
-
enumerable: true,
|
|
133
|
-
configurable: true,
|
|
134
|
-
writable: true
|
|
135
|
-
});
|
|
136
|
-
} else {
|
|
137
|
-
obj[key] = value;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return obj;
|
|
141
|
-
}
|
|
142
112
|
|
|
143
113
|
const uuidv4 = require('./uuid');
|
|
144
114
|
/*:: export type Pointer = {
|
|
@@ -616,7 +586,9 @@ class ParseObject {
|
|
|
616
586
|
const val = (0, _decode.default)(response[attr]);
|
|
617
587
|
|
|
618
588
|
if (val && Object.getPrototypeOf(val) === Object.prototype) {
|
|
619
|
-
changes[attr] =
|
|
589
|
+
changes[attr] = { ...this.attributes[attr],
|
|
590
|
+
...val
|
|
591
|
+
};
|
|
620
592
|
} else {
|
|
621
593
|
changes[attr] = val;
|
|
622
594
|
}
|
package/lib/node/ParseQuery.js
CHANGED
|
@@ -1636,13 +1636,15 @@ class ParseQuery {
|
|
|
1636
1636
|
)
|
|
1637
1637
|
/*: ParseQuery*/
|
|
1638
1638
|
{
|
|
1639
|
+
const _this = this;
|
|
1640
|
+
|
|
1639
1641
|
if (!Array.isArray(values)) {
|
|
1640
1642
|
values = [values];
|
|
1641
1643
|
}
|
|
1642
1644
|
|
|
1643
1645
|
const regexObject = values.map(value => {
|
|
1644
1646
|
return {
|
|
1645
|
-
$regex:
|
|
1647
|
+
$regex: _this._regexStartWith(value)
|
|
1646
1648
|
};
|
|
1647
1649
|
});
|
|
1648
1650
|
return this.containsAll(key, regexObject);
|
|
@@ -11,47 +11,6 @@ function _interopRequireDefault(obj) {
|
|
|
11
11
|
default: obj
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
function ownKeys(object, enumerableOnly) {
|
|
16
|
-
var keys = Object.keys(object);
|
|
17
|
-
|
|
18
|
-
if (Object.getOwnPropertySymbols) {
|
|
19
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
20
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
21
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
22
|
-
})), keys.push.apply(keys, symbols);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return keys;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function _objectSpread(target) {
|
|
29
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
30
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
31
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
32
|
-
_defineProperty(target, key, source[key]);
|
|
33
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
34
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return target;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _defineProperty(obj, key, value) {
|
|
42
|
-
if (key in obj) {
|
|
43
|
-
Object.defineProperty(obj, key, {
|
|
44
|
-
value: value,
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true,
|
|
47
|
-
writable: true
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
obj[key] = value;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return obj;
|
|
54
|
-
}
|
|
55
14
|
/**
|
|
56
15
|
* Copyright (c) 2015-present, Parse, LLC.
|
|
57
16
|
* All rights reserved.
|
|
@@ -397,9 +356,9 @@ const RESTController = {
|
|
|
397
356
|
status
|
|
398
357
|
}) => {
|
|
399
358
|
if (options.returnStatus) {
|
|
400
|
-
return
|
|
359
|
+
return { ...response,
|
|
401
360
|
_status: status
|
|
402
|
-
}
|
|
361
|
+
};
|
|
403
362
|
} else {
|
|
404
363
|
return response;
|
|
405
364
|
}
|
|
@@ -190,6 +190,8 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
190
190
|
}, {
|
|
191
191
|
key: "subscribe",
|
|
192
192
|
value: function (query, sessionToken) {
|
|
193
|
+
var _this2 = this;
|
|
194
|
+
|
|
193
195
|
if (!query) {
|
|
194
196
|
return;
|
|
195
197
|
}
|
|
@@ -216,13 +218,15 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
216
218
|
this.subscriptions.set(this.requestId, subscription);
|
|
217
219
|
this.requestId += 1;
|
|
218
220
|
this.connectPromise.then(function () {
|
|
219
|
-
|
|
221
|
+
_this2.socket.send(JSON.stringify(subscribeRequest));
|
|
220
222
|
});
|
|
221
223
|
return subscription;
|
|
222
224
|
}
|
|
223
225
|
}, {
|
|
224
226
|
key: "unsubscribe",
|
|
225
227
|
value: function (subscription) {
|
|
228
|
+
var _this3 = this;
|
|
229
|
+
|
|
226
230
|
if (!subscription) {
|
|
227
231
|
return;
|
|
228
232
|
}
|
|
@@ -233,7 +237,7 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
233
237
|
requestId: subscription.id
|
|
234
238
|
};
|
|
235
239
|
this.connectPromise.then(function () {
|
|
236
|
-
|
|
240
|
+
_this3.socket.send(JSON.stringify(unsubscribeRequest));
|
|
237
241
|
});
|
|
238
242
|
}
|
|
239
243
|
}, {
|
|
@@ -616,7 +616,8 @@ var LocalDatastore = {
|
|
|
616
616
|
}
|
|
617
617
|
},
|
|
618
618
|
_serializeObjectsFromPinName: function (name) {
|
|
619
|
-
var
|
|
619
|
+
var _this = this,
|
|
620
|
+
_ref;
|
|
620
621
|
|
|
621
622
|
var localDatastore, allObjects, key, pinName, pinned, promises, objects;
|
|
622
623
|
return _regeneratorRuntime().async(function (_context3) {
|
|
@@ -656,7 +657,7 @@ var LocalDatastore = {
|
|
|
656
657
|
|
|
657
658
|
case 11:
|
|
658
659
|
promises = pinned.map(function (objectKey) {
|
|
659
|
-
return
|
|
660
|
+
return _this.fromPinWithName(objectKey);
|
|
660
661
|
});
|
|
661
662
|
_context3.next = 14;
|
|
662
663
|
return _regeneratorRuntime().awrap(Promise.all(promises));
|
|
@@ -104,7 +104,7 @@ var ParseCLP = function () {
|
|
|
104
104
|
(0, _classCallCheck2.default)(this, ParseCLP);
|
|
105
105
|
this.permissionsMap = {};
|
|
106
106
|
|
|
107
|
-
var _loop = function (operation, group) {
|
|
107
|
+
var _loop = function _loop(operation, group) {
|
|
108
108
|
_this.permissionsMap[operation] = (0, _extends2.default)({}, group);
|
|
109
109
|
var action = operation.charAt(0).toUpperCase() + operation.slice(1);
|
|
110
110
|
|
|
@@ -217,12 +217,12 @@ var ParseCLP = function () {
|
|
|
217
217
|
|
|
218
218
|
(0, _createClass2.default)(ParseCLP, [{
|
|
219
219
|
key: "toJSON",
|
|
220
|
-
value: function () {
|
|
220
|
+
value: function toJSON() {
|
|
221
221
|
return _objectSpread({}, this.permissionsMap);
|
|
222
222
|
}
|
|
223
223
|
}, {
|
|
224
224
|
key: "equals",
|
|
225
|
-
value: function (other) {
|
|
225
|
+
value: function equals(other) {
|
|
226
226
|
if (!(other instanceof ParseCLP)) {
|
|
227
227
|
return false;
|
|
228
228
|
}
|
|
@@ -261,7 +261,7 @@ var ParseCLP = function () {
|
|
|
261
261
|
}
|
|
262
262
|
}, {
|
|
263
263
|
key: "_getRoleName",
|
|
264
|
-
value: function (role) {
|
|
264
|
+
value: function _getRoleName(role) {
|
|
265
265
|
var name = role;
|
|
266
266
|
|
|
267
267
|
if (role instanceof _ParseRole.default) {
|
|
@@ -276,7 +276,7 @@ var ParseCLP = function () {
|
|
|
276
276
|
}
|
|
277
277
|
}, {
|
|
278
278
|
key: "_parseEntity",
|
|
279
|
-
value: function (entity) {
|
|
279
|
+
value: function _parseEntity(entity) {
|
|
280
280
|
var userId = entity;
|
|
281
281
|
|
|
282
282
|
if (userId instanceof _ParseUser.default) {
|
|
@@ -297,7 +297,7 @@ var ParseCLP = function () {
|
|
|
297
297
|
}
|
|
298
298
|
}, {
|
|
299
299
|
key: "_setAccess",
|
|
300
|
-
value: function (permission, userId, allowed) {
|
|
300
|
+
value: function _setAccess(permission, userId, allowed) {
|
|
301
301
|
userId = this._parseEntity(userId);
|
|
302
302
|
|
|
303
303
|
if (typeof allowed !== 'boolean') {
|
|
@@ -322,7 +322,7 @@ var ParseCLP = function () {
|
|
|
322
322
|
}
|
|
323
323
|
}, {
|
|
324
324
|
key: "_getAccess",
|
|
325
|
-
value: function (permission, userId) {
|
|
325
|
+
value: function _getAccess(permission, userId) {
|
|
326
326
|
var returnBoolean = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
327
327
|
userId = this._parseEntity(userId);
|
|
328
328
|
var permissions = this.permissionsMap[permission][userId];
|
|
@@ -339,7 +339,7 @@ var ParseCLP = function () {
|
|
|
339
339
|
}
|
|
340
340
|
}, {
|
|
341
341
|
key: "_setArrayAccess",
|
|
342
|
-
value: function (permission, userId, fields) {
|
|
342
|
+
value: function _setArrayAccess(permission, userId, fields) {
|
|
343
343
|
userId = this._parseEntity(userId);
|
|
344
344
|
var permissions = this.permissionsMap[permission][userId];
|
|
345
345
|
|
|
@@ -359,7 +359,7 @@ var ParseCLP = function () {
|
|
|
359
359
|
}
|
|
360
360
|
}, {
|
|
361
361
|
key: "_setGroupPointerPermission",
|
|
362
|
-
value: function (operation, pointerFields) {
|
|
362
|
+
value: function _setGroupPointerPermission(operation, pointerFields) {
|
|
363
363
|
var fields = this.permissionsMap[operation];
|
|
364
364
|
|
|
365
365
|
if (!fields) {
|
|
@@ -378,42 +378,42 @@ var ParseCLP = function () {
|
|
|
378
378
|
}
|
|
379
379
|
}, {
|
|
380
380
|
key: "_getGroupPointerPermissions",
|
|
381
|
-
value: function (operation) {
|
|
381
|
+
value: function _getGroupPointerPermissions(operation) {
|
|
382
382
|
return this.permissionsMap[operation];
|
|
383
383
|
}
|
|
384
384
|
}, {
|
|
385
385
|
key: "setReadUserFields",
|
|
386
|
-
value: function (pointerFields) {
|
|
386
|
+
value: function setReadUserFields(pointerFields) {
|
|
387
387
|
this._setGroupPointerPermission('readUserFields', pointerFields);
|
|
388
388
|
}
|
|
389
389
|
}, {
|
|
390
390
|
key: "getReadUserFields",
|
|
391
|
-
value: function () {
|
|
391
|
+
value: function getReadUserFields() {
|
|
392
392
|
return this._getGroupPointerPermissions('readUserFields');
|
|
393
393
|
}
|
|
394
394
|
}, {
|
|
395
395
|
key: "setWriteUserFields",
|
|
396
|
-
value: function (pointerFields) {
|
|
396
|
+
value: function setWriteUserFields(pointerFields) {
|
|
397
397
|
this._setGroupPointerPermission('writeUserFields', pointerFields);
|
|
398
398
|
}
|
|
399
399
|
}, {
|
|
400
400
|
key: "getWriteUserFields",
|
|
401
|
-
value: function () {
|
|
401
|
+
value: function getWriteUserFields() {
|
|
402
402
|
return this._getGroupPointerPermissions('writeUserFields');
|
|
403
403
|
}
|
|
404
404
|
}, {
|
|
405
405
|
key: "setProtectedFields",
|
|
406
|
-
value: function (userId, fields) {
|
|
406
|
+
value: function setProtectedFields(userId, fields) {
|
|
407
407
|
this._setArrayAccess('protectedFields', userId, fields);
|
|
408
408
|
}
|
|
409
409
|
}, {
|
|
410
410
|
key: "getProtectedFields",
|
|
411
|
-
value: function (userId) {
|
|
411
|
+
value: function getProtectedFields(userId) {
|
|
412
412
|
return this._getAccess('protectedFields', userId, false);
|
|
413
413
|
}
|
|
414
414
|
}, {
|
|
415
415
|
key: "setReadAccess",
|
|
416
|
-
value: function (userId, allowed) {
|
|
416
|
+
value: function setReadAccess(userId, allowed) {
|
|
417
417
|
this._setAccess('find', userId, allowed);
|
|
418
418
|
|
|
419
419
|
this._setAccess('get', userId, allowed);
|
|
@@ -422,12 +422,12 @@ var ParseCLP = function () {
|
|
|
422
422
|
}
|
|
423
423
|
}, {
|
|
424
424
|
key: "getReadAccess",
|
|
425
|
-
value: function (userId) {
|
|
425
|
+
value: function getReadAccess(userId) {
|
|
426
426
|
return this._getAccess('find', userId) && this._getAccess('get', userId) && this._getAccess('count', userId);
|
|
427
427
|
}
|
|
428
428
|
}, {
|
|
429
429
|
key: "setWriteAccess",
|
|
430
|
-
value: function (userId, allowed) {
|
|
430
|
+
value: function setWriteAccess(userId, allowed) {
|
|
431
431
|
this._setAccess('create', userId, allowed);
|
|
432
432
|
|
|
433
433
|
this._setAccess('update', userId, allowed);
|
|
@@ -438,67 +438,67 @@ var ParseCLP = function () {
|
|
|
438
438
|
}
|
|
439
439
|
}, {
|
|
440
440
|
key: "getWriteAccess",
|
|
441
|
-
value: function (userId) {
|
|
441
|
+
value: function getWriteAccess(userId) {
|
|
442
442
|
return this._getAccess('create', userId) && this._getAccess('update', userId) && this._getAccess('delete', userId) && this._getAccess('addField', userId);
|
|
443
443
|
}
|
|
444
444
|
}, {
|
|
445
445
|
key: "setPublicReadAccess",
|
|
446
|
-
value: function (allowed) {
|
|
446
|
+
value: function setPublicReadAccess(allowed) {
|
|
447
447
|
this.setReadAccess(PUBLIC_KEY, allowed);
|
|
448
448
|
}
|
|
449
449
|
}, {
|
|
450
450
|
key: "getPublicReadAccess",
|
|
451
|
-
value: function () {
|
|
451
|
+
value: function getPublicReadAccess() {
|
|
452
452
|
return this.getReadAccess(PUBLIC_KEY);
|
|
453
453
|
}
|
|
454
454
|
}, {
|
|
455
455
|
key: "setPublicWriteAccess",
|
|
456
|
-
value: function (allowed) {
|
|
456
|
+
value: function setPublicWriteAccess(allowed) {
|
|
457
457
|
this.setWriteAccess(PUBLIC_KEY, allowed);
|
|
458
458
|
}
|
|
459
459
|
}, {
|
|
460
460
|
key: "getPublicWriteAccess",
|
|
461
|
-
value: function () {
|
|
461
|
+
value: function getPublicWriteAccess() {
|
|
462
462
|
return this.getWriteAccess(PUBLIC_KEY);
|
|
463
463
|
}
|
|
464
464
|
}, {
|
|
465
465
|
key: "setPublicProtectedFields",
|
|
466
|
-
value: function (fields) {
|
|
466
|
+
value: function setPublicProtectedFields(fields) {
|
|
467
467
|
this.setProtectedFields(PUBLIC_KEY, fields);
|
|
468
468
|
}
|
|
469
469
|
}, {
|
|
470
470
|
key: "getPublicProtectedFields",
|
|
471
|
-
value: function () {
|
|
471
|
+
value: function getPublicProtectedFields() {
|
|
472
472
|
return this.getProtectedFields(PUBLIC_KEY);
|
|
473
473
|
}
|
|
474
474
|
}, {
|
|
475
475
|
key: "getRoleReadAccess",
|
|
476
|
-
value: function (role) {
|
|
476
|
+
value: function getRoleReadAccess(role) {
|
|
477
477
|
return this.getReadAccess(this._getRoleName(role));
|
|
478
478
|
}
|
|
479
479
|
}, {
|
|
480
480
|
key: "getRoleWriteAccess",
|
|
481
|
-
value: function (role) {
|
|
481
|
+
value: function getRoleWriteAccess(role) {
|
|
482
482
|
return this.getWriteAccess(this._getRoleName(role));
|
|
483
483
|
}
|
|
484
484
|
}, {
|
|
485
485
|
key: "setRoleReadAccess",
|
|
486
|
-
value: function (role, allowed) {
|
|
486
|
+
value: function setRoleReadAccess(role, allowed) {
|
|
487
487
|
this.setReadAccess(this._getRoleName(role), allowed);
|
|
488
488
|
}
|
|
489
489
|
}, {
|
|
490
490
|
key: "setRoleWriteAccess",
|
|
491
|
-
value: function (role, allowed) {
|
|
491
|
+
value: function setRoleWriteAccess(role, allowed) {
|
|
492
492
|
this.setWriteAccess(this._getRoleName(role), allowed);
|
|
493
493
|
}
|
|
494
494
|
}, {
|
|
495
495
|
key: "getRoleProtectedFields",
|
|
496
|
-
value: function (role) {
|
|
496
|
+
value: function getRoleProtectedFields(role) {
|
|
497
497
|
return this.getProtectedFields(this._getRoleName(role));
|
|
498
498
|
}
|
|
499
499
|
}, {
|
|
500
500
|
key: "setRoleProtectedFields",
|
|
501
|
-
value: function (role, fields) {
|
|
501
|
+
value: function setRoleProtectedFields(role, fields) {
|
|
502
502
|
this.setProtectedFields(this._getRoleName(role), fields);
|
|
503
503
|
}
|
|
504
504
|
}]);
|
|
@@ -470,6 +470,8 @@ var ParseFile = function () {
|
|
|
470
470
|
(0, _createClass2.default)(ParseFile, [{
|
|
471
471
|
key: "getData",
|
|
472
472
|
value: function () {
|
|
473
|
+
var _this = this;
|
|
474
|
+
|
|
473
475
|
var options, controller, result;
|
|
474
476
|
return _regeneratorRuntime().async(function (_context) {
|
|
475
477
|
while (1) {
|
|
@@ -493,7 +495,7 @@ var ParseFile = function () {
|
|
|
493
495
|
case 4:
|
|
494
496
|
options = {
|
|
495
497
|
requestTask: function (task) {
|
|
496
|
-
return
|
|
498
|
+
return _this._requestTask = task;
|
|
497
499
|
}
|
|
498
500
|
};
|
|
499
501
|
controller = _CoreManager.default.getFileController();
|
|
@@ -658,9 +660,11 @@ var ParseFile = function () {
|
|
|
658
660
|
}, {
|
|
659
661
|
key: "setMetadata",
|
|
660
662
|
value: function (metadata) {
|
|
663
|
+
var _this4 = this;
|
|
664
|
+
|
|
661
665
|
if (metadata && typeof metadata === 'object') {
|
|
662
666
|
Object.keys(metadata).forEach(function (key) {
|
|
663
|
-
|
|
667
|
+
_this4.addMetadata(key, metadata[key]);
|
|
664
668
|
});
|
|
665
669
|
}
|
|
666
670
|
}
|
|
@@ -674,9 +678,11 @@ var ParseFile = function () {
|
|
|
674
678
|
}, {
|
|
675
679
|
key: "setTags",
|
|
676
680
|
value: function (tags) {
|
|
681
|
+
var _this5 = this;
|
|
682
|
+
|
|
677
683
|
if (tags && typeof tags === 'object') {
|
|
678
684
|
Object.keys(tags).forEach(function (key) {
|
|
679
|
-
|
|
685
|
+
_this5.addTag(key, tags[key]);
|
|
680
686
|
});
|
|
681
687
|
}
|
|
682
688
|
}
|
|
@@ -1517,6 +1517,8 @@ var ParseObject = function () {
|
|
|
1517
1517
|
}, {
|
|
1518
1518
|
key: "save",
|
|
1519
1519
|
value: function (arg1, arg2, arg3) {
|
|
1520
|
+
var _this = this;
|
|
1521
|
+
|
|
1520
1522
|
var attrs;
|
|
1521
1523
|
var options;
|
|
1522
1524
|
|
|
@@ -1565,7 +1567,7 @@ var ParseObject = function () {
|
|
|
1565
1567
|
|
|
1566
1568
|
var unsaved = options.cascadeSave !== false ? (0, _unsavedChildren.default)(this) : null;
|
|
1567
1569
|
return controller.save(unsaved, saveOptions).then(function () {
|
|
1568
|
-
return controller.save(
|
|
1570
|
+
return controller.save(_this, saveOptions);
|
|
1569
1571
|
});
|
|
1570
1572
|
}
|
|
1571
1573
|
}, {
|
|
@@ -2503,8 +2505,8 @@ var DefaultController = {
|
|
|
2503
2505
|
batch.forEach(function (obj, index) {
|
|
2504
2506
|
var ready = new _promiseUtils.resolvingPromise();
|
|
2505
2507
|
batchReady.push(ready);
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
+
|
|
2509
|
+
var task = function task() {
|
|
2508
2510
|
ready.resolve();
|
|
2509
2511
|
return batchReturned.then(function (responses) {
|
|
2510
2512
|
if (responses[index].hasOwnProperty('success')) {
|
|
@@ -2524,7 +2526,10 @@ var DefaultController = {
|
|
|
2524
2526
|
obj._handleSaveError();
|
|
2525
2527
|
}
|
|
2526
2528
|
});
|
|
2527
|
-
}
|
|
2529
|
+
};
|
|
2530
|
+
|
|
2531
|
+
stateController.pushPendingState(obj._getStateIdentifier());
|
|
2532
|
+
batchTasks.push(stateController.enqueueTask(obj._getStateIdentifier(), task));
|
|
2528
2533
|
});
|
|
2529
2534
|
(0, _promiseUtils.when)(batchReady).then(function () {
|
|
2530
2535
|
return RESTController.request('POST', 'batch', {
|
|
@@ -2539,10 +2544,10 @@ var DefaultController = {
|
|
|
2539
2544
|
batchReturned.reject(new _ParseError.default(_ParseError.default.INCORRECT_TYPE, error.message));
|
|
2540
2545
|
});
|
|
2541
2546
|
return (0, _promiseUtils.when)(batchTasks);
|
|
2542
|
-
}).then(function () {
|
|
2547
|
+
}).then(function _callee5() {
|
|
2543
2548
|
var _iterator4, _step4, object;
|
|
2544
2549
|
|
|
2545
|
-
return _regeneratorRuntime().async(function (_context11) {
|
|
2550
|
+
return _regeneratorRuntime().async(function _callee5$(_context11) {
|
|
2546
2551
|
while (1) {
|
|
2547
2552
|
switch (_context11.prev = _context11.next) {
|
|
2548
2553
|
case 0:
|
|
@@ -2595,7 +2600,7 @@ var DefaultController = {
|
|
|
2595
2600
|
var localId = target._localId;
|
|
2596
2601
|
var targetCopy = target;
|
|
2597
2602
|
|
|
2598
|
-
var task = function () {
|
|
2603
|
+
var task = function task() {
|
|
2599
2604
|
var params = targetCopy._getSaveParams();
|
|
2600
2605
|
|
|
2601
2606
|
return RESTController.request(params.method, params.path, params.body, options).then(function (response) {
|
|
@@ -2611,8 +2616,8 @@ var DefaultController = {
|
|
|
2611
2616
|
};
|
|
2612
2617
|
|
|
2613
2618
|
stateController.pushPendingState(target._getStateIdentifier());
|
|
2614
|
-
return stateController.enqueueTask(target._getStateIdentifier(), task).then(function () {
|
|
2615
|
-
return _regeneratorRuntime().async(function (_context12) {
|
|
2619
|
+
return stateController.enqueueTask(target._getStateIdentifier(), task).then(function _callee6() {
|
|
2620
|
+
return _regeneratorRuntime().async(function _callee6$(_context12) {
|
|
2616
2621
|
while (1) {
|
|
2617
2622
|
switch (_context12.prev = _context12.next) {
|
|
2618
2623
|
case 0:
|