parse 3.1.0 → 3.3.2-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 +32 -41
- package/dist/parse.js +2973 -1735
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +2989 -1830
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/AnonymousUtils.js +15 -1
- package/lib/browser/Cloud.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/InstallationController.js +1 -1
- package/lib/browser/LiveQueryClient.js +4 -6
- package/lib/browser/LiveQuerySubscription.js +1 -1
- package/lib/browser/LocalDatastore.js +3 -5
- package/lib/browser/LocalDatastoreController.js +3 -5
- package/lib/browser/LocalDatastoreUtils.js +1 -1
- package/lib/browser/ObjectStateMutations.js +28 -10
- package/lib/browser/OfflineQuery.js +197 -22
- package/lib/browser/Parse.js +57 -2
- package/lib/browser/ParseCLP.js +9 -8
- package/lib/browser/ParseError.js +9 -1
- package/lib/browser/ParseFile.js +6 -3
- package/lib/browser/ParseHooks.js +9 -9
- package/lib/browser/ParseInstallation.js +1 -1
- package/lib/browser/ParseObject.js +100 -32
- package/lib/browser/ParseOp.js +2 -6
- package/lib/browser/ParseQuery.js +1 -1
- package/lib/browser/ParseRole.js +1 -1
- package/lib/browser/ParseSession.js +1 -1
- package/lib/browser/ParseUser.js +20 -64
- package/lib/browser/Push.js +1 -1
- package/lib/browser/RESTController.js +7 -4
- package/lib/browser/SingleInstanceStateController.js +67 -14
- package/lib/browser/UniqueInstanceStateController.js +68 -15
- package/lib/browser/promiseUtils.js +1 -1
- package/lib/browser/uuid.js +5 -0
- package/lib/node/AnonymousUtils.js +15 -1
- package/lib/node/Cloud.js +2 -2
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/InstallationController.js +1 -1
- package/lib/node/LocalDatastoreUtils.js +1 -1
- package/lib/node/ObjectStateMutations.js +29 -10
- package/lib/node/OfflineQuery.js +162 -0
- package/lib/node/Parse.js +10 -12
- package/lib/node/ParseCLP.js +7 -3
- package/lib/node/ParseError.js +8 -0
- package/lib/node/ParseFile.js +7 -3
- package/lib/node/ParseHooks.js +9 -9
- package/lib/node/ParseObject.js +48 -31
- package/lib/node/ParseOp.js +1 -5
- package/lib/node/ParseQuery.js +1 -1
- package/lib/node/ParseUser.js +2 -21
- package/lib/node/Push.js +1 -1
- package/lib/node/RESTController.js +8 -4
- package/lib/node/SingleInstanceStateController.js +23 -25
- package/lib/node/UniqueInstanceStateController.js +23 -25
- package/lib/node/promiseUtils.js +2 -2
- package/lib/node/uuid.js +5 -0
- package/lib/react-native/AnonymousUtils.js +4 -1
- package/lib/react-native/Cloud.js +2 -2
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/EventEmitter.js +4 -0
- package/lib/react-native/InstallationController.js +1 -1
- package/lib/react-native/LiveQueryClient.js +16 -20
- package/lib/react-native/LiveQuerySubscription.js +1 -1
- package/lib/react-native/LocalDatastore.js +15 -19
- package/lib/react-native/LocalDatastoreController.js +15 -19
- package/lib/react-native/LocalDatastoreUtils.js +1 -1
- package/lib/react-native/ObjectStateMutations.js +29 -10
- package/lib/react-native/OfflineQuery.js +171 -27
- package/lib/react-native/Parse.js +50 -2
- package/lib/react-native/ParseCLP.js +22 -22
- package/lib/react-native/ParseError.js +2 -1
- package/lib/react-native/ParseFile.js +7 -3
- package/lib/react-native/ParseHooks.js +9 -9
- package/lib/react-native/ParseInstallation.js +1 -1
- package/lib/react-native/ParseObject.js +91 -39
- package/lib/react-native/ParseOp.js +2 -2
- package/lib/react-native/ParseRole.js +1 -1
- package/lib/react-native/ParseSession.js +1 -1
- package/lib/react-native/ParseUser.js +17 -56
- package/lib/react-native/Push.js +1 -1
- package/lib/react-native/RESTController.js +8 -4
- package/lib/react-native/SingleInstanceStateController.js +63 -15
- package/lib/react-native/UniqueInstanceStateController.js +63 -15
- package/lib/react-native/promiseUtils.js +1 -1
- package/lib/react-native/uuid.js +3 -0
- package/lib/weapp/AnonymousUtils.js +15 -1
- package/lib/weapp/Cloud.js +2 -2
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/InstallationController.js +1 -1
- package/lib/weapp/LiveQueryClient.js +4 -6
- package/lib/weapp/LiveQuerySubscription.js +1 -1
- package/lib/weapp/LocalDatastore.js +3 -5
- package/lib/weapp/LocalDatastoreController.js +3 -5
- package/lib/weapp/LocalDatastoreUtils.js +1 -1
- package/lib/weapp/ObjectStateMutations.js +28 -10
- package/lib/weapp/OfflineQuery.js +197 -22
- package/lib/weapp/Parse.js +57 -2
- package/lib/weapp/ParseCLP.js +9 -8
- package/lib/weapp/ParseError.js +9 -1
- package/lib/weapp/ParseFile.js +6 -3
- package/lib/weapp/ParseHooks.js +9 -9
- package/lib/weapp/ParseInstallation.js +1 -1
- package/lib/weapp/ParseObject.js +100 -32
- package/lib/weapp/ParseOp.js +2 -6
- package/lib/weapp/ParseQuery.js +1 -1
- package/lib/weapp/ParseRole.js +1 -1
- package/lib/weapp/ParseSession.js +1 -1
- package/lib/weapp/ParseUser.js +20 -64
- package/lib/weapp/Push.js +1 -1
- package/lib/weapp/RESTController.js +7 -4
- package/lib/weapp/SingleInstanceStateController.js +67 -14
- package/lib/weapp/UniqueInstanceStateController.js +68 -15
- package/lib/weapp/promiseUtils.js +1 -1
- package/lib/weapp/uuid.js +21 -0
- package/package.json +15 -7
- package/CHANGELOG.md +0 -389
package/lib/browser/ParseCLP.js
CHANGED
|
@@ -18,8 +18,6 @@ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stab
|
|
|
18
18
|
|
|
19
19
|
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
20
20
|
|
|
21
|
-
var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator");
|
|
22
|
-
|
|
23
21
|
var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
24
22
|
|
|
25
23
|
var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method");
|
|
@@ -72,9 +70,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
72
70
|
if (_Object$getOwnPropertySymbols) {
|
|
73
71
|
var symbols = _Object$getOwnPropertySymbols(object);
|
|
74
72
|
|
|
75
|
-
if (enumerableOnly)
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
if (enumerableOnly) {
|
|
74
|
+
symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
75
|
+
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
78
79
|
keys.push.apply(keys, symbols);
|
|
79
80
|
}
|
|
80
81
|
|
|
@@ -106,9 +107,9 @@ function _objectSpread(target) {
|
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
109
|
-
var it;
|
|
110
|
+
var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
|
|
110
111
|
|
|
111
|
-
if (
|
|
112
|
+
if (!it) {
|
|
112
113
|
if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
113
114
|
if (it) o = it;
|
|
114
115
|
var i = 0;
|
|
@@ -141,7 +142,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
141
142
|
err;
|
|
142
143
|
return {
|
|
143
144
|
s: function () {
|
|
144
|
-
it =
|
|
145
|
+
it = it.call(o);
|
|
145
146
|
},
|
|
146
147
|
n: function () {
|
|
147
148
|
var step = it.next();
|
|
@@ -52,7 +52,7 @@ function _isNativeReflectConstruct() {
|
|
|
52
52
|
if (typeof Proxy === "function") return true;
|
|
53
53
|
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
56
56
|
return true;
|
|
57
57
|
} catch (e) {
|
|
58
58
|
return false;
|
|
@@ -452,6 +452,14 @@ ParseError.DUPLICATE_REQUEST = 159;
|
|
|
452
452
|
*/
|
|
453
453
|
|
|
454
454
|
ParseError.INVALID_EVENT_NAME = 160;
|
|
455
|
+
/**
|
|
456
|
+
* Error code indicating that a field had an invalid value.
|
|
457
|
+
*
|
|
458
|
+
* @property {number} INVALID_VALUE
|
|
459
|
+
* @static
|
|
460
|
+
*/
|
|
461
|
+
|
|
462
|
+
ParseError.INVALID_VALUE = 162;
|
|
455
463
|
/**
|
|
456
464
|
* Error code indicating that the username is missing or empty.
|
|
457
465
|
*
|
package/lib/browser/ParseFile.js
CHANGED
|
@@ -58,9 +58,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
58
58
|
if (_Object$getOwnPropertySymbols) {
|
|
59
59
|
var symbols = _Object$getOwnPropertySymbols(object);
|
|
60
60
|
|
|
61
|
-
if (enumerableOnly)
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
if (enumerableOnly) {
|
|
62
|
+
symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
63
|
+
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
64
67
|
keys.push.apply(keys, symbols);
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -8,19 +8,19 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
exports.
|
|
12
|
-
exports.getTriggers = getTriggers;
|
|
13
|
-
exports.getFunction = getFunction;
|
|
14
|
-
exports.getTrigger = getTrigger;
|
|
11
|
+
exports.create = create;
|
|
15
12
|
exports.createFunction = createFunction;
|
|
16
13
|
exports.createTrigger = createTrigger;
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
14
|
+
exports.getFunction = getFunction;
|
|
15
|
+
exports.getFunctions = getFunctions;
|
|
16
|
+
exports.getTrigger = getTrigger;
|
|
17
|
+
exports.getTriggers = getTriggers;
|
|
18
|
+
exports.remove = remove;
|
|
21
19
|
exports.removeFunction = removeFunction;
|
|
22
20
|
exports.removeTrigger = removeTrigger;
|
|
23
|
-
exports.
|
|
21
|
+
exports.update = update;
|
|
22
|
+
exports.updateFunction = updateFunction;
|
|
23
|
+
exports.updateTrigger = updateTrigger;
|
|
24
24
|
|
|
25
25
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
26
26
|
|
|
@@ -48,7 +48,7 @@ function _isNativeReflectConstruct() {
|
|
|
48
48
|
if (typeof Proxy === "function") return true;
|
|
49
49
|
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
52
52
|
return true;
|
|
53
53
|
} catch (e) {
|
|
54
54
|
return false;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
|
-
var
|
|
5
|
+
var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
8
8
|
|
|
9
9
|
var _Array$isArray2 = require("@babel/runtime-corejs3/core-js-stable/array/is-array");
|
|
10
10
|
|
|
@@ -116,10 +116,59 @@ var UniqueInstanceStateController = _interopRequireWildcard(require("./UniqueIns
|
|
|
116
116
|
|
|
117
117
|
var _unsavedChildren = _interopRequireDefault(require("./unsavedChildren"));
|
|
118
118
|
|
|
119
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
120
|
+
if (typeof _WeakMap !== "function") return null;
|
|
121
|
+
var cacheBabelInterop = new _WeakMap();
|
|
122
|
+
var cacheNodeInterop = new _WeakMap();
|
|
123
|
+
return (_getRequireWildcardCache = function (nodeInterop) {
|
|
124
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
125
|
+
})(nodeInterop);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
129
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
130
|
+
return obj;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") {
|
|
134
|
+
return {
|
|
135
|
+
default: obj
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
140
|
+
|
|
141
|
+
if (cache && cache.has(obj)) {
|
|
142
|
+
return cache.get(obj);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var newObj = {};
|
|
146
|
+
|
|
147
|
+
for (var key in obj) {
|
|
148
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
149
|
+
var desc = _Object$defineProperty2 && _Object$getOwnPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null;
|
|
150
|
+
|
|
151
|
+
if (desc && (desc.get || desc.set)) {
|
|
152
|
+
_Object$defineProperty2(newObj, key, desc);
|
|
153
|
+
} else {
|
|
154
|
+
newObj[key] = obj[key];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
newObj.default = obj;
|
|
160
|
+
|
|
161
|
+
if (cache) {
|
|
162
|
+
cache.set(obj, newObj);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return newObj;
|
|
166
|
+
}
|
|
167
|
+
|
|
119
168
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
120
|
-
var it;
|
|
169
|
+
var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
|
|
121
170
|
|
|
122
|
-
if (
|
|
171
|
+
if (!it) {
|
|
123
172
|
if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
124
173
|
if (it) o = it;
|
|
125
174
|
var i = 0;
|
|
@@ -152,7 +201,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
152
201
|
err;
|
|
153
202
|
return {
|
|
154
203
|
s: function () {
|
|
155
|
-
it =
|
|
204
|
+
it = it.call(o);
|
|
156
205
|
},
|
|
157
206
|
n: function () {
|
|
158
207
|
var step = it.next();
|
|
@@ -202,9 +251,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
202
251
|
if (_Object$getOwnPropertySymbols) {
|
|
203
252
|
var symbols = _Object$getOwnPropertySymbols(object);
|
|
204
253
|
|
|
205
|
-
if (enumerableOnly)
|
|
206
|
-
|
|
207
|
-
|
|
254
|
+
if (enumerableOnly) {
|
|
255
|
+
symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
256
|
+
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
208
260
|
keys.push.apply(keys, symbols);
|
|
209
261
|
}
|
|
210
262
|
|
|
@@ -235,7 +287,7 @@ function _objectSpread(target) {
|
|
|
235
287
|
return target;
|
|
236
288
|
}
|
|
237
289
|
|
|
238
|
-
var uuidv4 = require('uuid
|
|
290
|
+
var uuidv4 = require('./uuid');
|
|
239
291
|
/*:: export type Pointer = {
|
|
240
292
|
__type: string,
|
|
241
293
|
className: string,
|
|
@@ -711,7 +763,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
711
763
|
for (var attr in pending) {
|
|
712
764
|
if (pending[attr] instanceof _ParseOp.RelationOp) {
|
|
713
765
|
changes[attr] = pending[attr].applyTo(undefined, this, attr);
|
|
714
|
-
} else if (!(attr in response)
|
|
766
|
+
} else if (!(attr in response)) {
|
|
715
767
|
// Only SetOps and UnsetOps should not come back with results
|
|
716
768
|
changes[attr] = pending[attr].applyTo(undefined);
|
|
717
769
|
}
|
|
@@ -756,11 +808,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
756
808
|
|
|
757
809
|
stateController.mergeFirstPendingState(this._getStateIdentifier());
|
|
758
810
|
}
|
|
759
|
-
/** Public methods **/
|
|
760
|
-
|
|
761
811
|
}, {
|
|
762
812
|
key: "initialize",
|
|
763
|
-
value:
|
|
813
|
+
value:
|
|
814
|
+
/** Public methods **/
|
|
815
|
+
function () {// NOOP
|
|
764
816
|
}
|
|
765
817
|
/**
|
|
766
818
|
* Returns a JSON version of the object suitable for saving to Parse.
|
|
@@ -1424,12 +1476,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1424
1476
|
value: function clone()
|
|
1425
1477
|
/*: any*/
|
|
1426
1478
|
{
|
|
1427
|
-
var clone = new this.constructor();
|
|
1428
|
-
|
|
1429
|
-
if (!clone.className) {
|
|
1430
|
-
clone.className = this.className;
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1479
|
+
var clone = new this.constructor(this.className);
|
|
1433
1480
|
var attributes = this.attributes;
|
|
1434
1481
|
|
|
1435
1482
|
if (typeof this.constructor.readOnlyAttributes === 'function') {
|
|
@@ -1464,12 +1511,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1464
1511
|
value: function ()
|
|
1465
1512
|
/*: any*/
|
|
1466
1513
|
{
|
|
1467
|
-
var clone = new this.constructor();
|
|
1468
|
-
|
|
1469
|
-
if (!clone.className) {
|
|
1470
|
-
clone.className = this.className;
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1514
|
+
var clone = new this.constructor(this.className);
|
|
1473
1515
|
clone.id = this.id;
|
|
1474
1516
|
|
|
1475
1517
|
if (singleInstance) {
|
|
@@ -1926,9 +1968,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1926
1968
|
* or<pre>
|
|
1927
1969
|
* object.save(attrs, options);</pre>
|
|
1928
1970
|
* or<pre>
|
|
1971
|
+
* object.save(key, value);</pre>
|
|
1972
|
+
* or<pre>
|
|
1929
1973
|
* object.save(key, value, options);</pre>
|
|
1930
1974
|
*
|
|
1931
|
-
*
|
|
1975
|
+
* Example 1: <pre>
|
|
1932
1976
|
* gameTurn.save({
|
|
1933
1977
|
* player: "Jake Cutter",
|
|
1934
1978
|
* diceRoll: 2
|
|
@@ -1938,6 +1982,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1938
1982
|
* // The save failed. Error is an instance of Parse.Error.
|
|
1939
1983
|
* });</pre>
|
|
1940
1984
|
*
|
|
1985
|
+
* Example 2: <pre>
|
|
1986
|
+
* gameTurn.save("player", "Jake Cutter");</pre>
|
|
1987
|
+
*
|
|
1941
1988
|
* @param {string | object | null} [arg1]
|
|
1942
1989
|
* Valid options are:<ul>
|
|
1943
1990
|
* <li>`Object` - Key/value pairs to update on the object.</li>
|
|
@@ -2356,6 +2403,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2356
2403
|
/** Static methods **/
|
|
2357
2404
|
|
|
2358
2405
|
}], [{
|
|
2406
|
+
key: "_getClassMap",
|
|
2407
|
+
value: function () {
|
|
2408
|
+
return classMap;
|
|
2409
|
+
}
|
|
2410
|
+
}, {
|
|
2359
2411
|
key: "_clearAllState",
|
|
2360
2412
|
value: function () {
|
|
2361
2413
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
@@ -2731,7 +2783,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2731
2783
|
}
|
|
2732
2784
|
|
|
2733
2785
|
var constructor = classMap[json.className];
|
|
2734
|
-
var o = constructor ? new constructor() : new ParseObject(json.className);
|
|
2786
|
+
var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
|
|
2735
2787
|
var otherAttributes = {};
|
|
2736
2788
|
|
|
2737
2789
|
for (var _attr12 in json) {
|
|
@@ -2806,6 +2858,23 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2806
2858
|
constructor.className = className;
|
|
2807
2859
|
}
|
|
2808
2860
|
}
|
|
2861
|
+
/**
|
|
2862
|
+
* Unegisters a subclass of Parse.Object with a specific class name.
|
|
2863
|
+
*
|
|
2864
|
+
* @param {string} className The class name of the subclass
|
|
2865
|
+
*/
|
|
2866
|
+
|
|
2867
|
+
}, {
|
|
2868
|
+
key: "unregisterSubclass",
|
|
2869
|
+
value: function (className
|
|
2870
|
+
/*: string*/
|
|
2871
|
+
) {
|
|
2872
|
+
if (typeof className !== 'string') {
|
|
2873
|
+
throw new TypeError('The first argument must be a valid class name.');
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
delete classMap[className];
|
|
2877
|
+
}
|
|
2809
2878
|
/**
|
|
2810
2879
|
* Creates a new subclass of Parse.Object for the given Parse class name.
|
|
2811
2880
|
*
|
|
@@ -3430,10 +3499,9 @@ var DefaultController = {
|
|
|
3430
3499
|
}, options).then(function (results) {
|
|
3431
3500
|
for (var i = 0; i < results.length; i++) {
|
|
3432
3501
|
if (results[i] && results[i].hasOwnProperty('error')) {
|
|
3433
|
-
var
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
errors.push(_err);
|
|
3502
|
+
var err = new _ParseError.default(results[i].error.code, results[i].error.error);
|
|
3503
|
+
err.object = batch[i];
|
|
3504
|
+
errors.push(err);
|
|
3437
3505
|
}
|
|
3438
3506
|
}
|
|
3439
3507
|
});
|
package/lib/browser/ParseOp.js
CHANGED
|
@@ -10,8 +10,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
10
10
|
value: true
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
+
exports.UnsetOp = exports.SetOp = exports.RemoveOp = exports.RelationOp = exports.Op = exports.IncrementOp = exports.AddUniqueOp = exports.AddOp = void 0;
|
|
13
14
|
exports.opFromJSON = opFromJSON;
|
|
14
|
-
exports.RelationOp = exports.RemoveOp = exports.AddUniqueOp = exports.AddOp = exports.IncrementOp = exports.UnsetOp = exports.SetOp = exports.Op = void 0;
|
|
15
15
|
|
|
16
16
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
17
17
|
|
|
@@ -75,7 +75,7 @@ function _isNativeReflectConstruct() {
|
|
|
75
75
|
if (typeof Proxy === "function") return true;
|
|
76
76
|
|
|
77
77
|
try {
|
|
78
|
-
|
|
78
|
+
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
79
79
|
return true;
|
|
80
80
|
} catch (e) {
|
|
81
81
|
return false;
|
|
@@ -158,8 +158,6 @@ var Op = /*#__PURE__*/function () {
|
|
|
158
158
|
key: "applyTo",
|
|
159
159
|
value: // Empty parent class
|
|
160
160
|
function ()
|
|
161
|
-
/*: mixed*/
|
|
162
|
-
|
|
163
161
|
/*: mixed*/
|
|
164
162
|
{}
|
|
165
163
|
/* eslint-disable-line no-unused-vars */
|
|
@@ -167,8 +165,6 @@ var Op = /*#__PURE__*/function () {
|
|
|
167
165
|
}, {
|
|
168
166
|
key: "mergeWith",
|
|
169
167
|
value: function ()
|
|
170
|
-
/*: Op*/
|
|
171
|
-
|
|
172
168
|
/*: ?Op*/
|
|
173
169
|
{}
|
|
174
170
|
/* eslint-disable-line no-unused-vars */
|
package/lib/browser/ParseRole.js
CHANGED
|
@@ -54,7 +54,7 @@ function _isNativeReflectConstruct() {
|
|
|
54
54
|
if (typeof Proxy === "function") return true;
|
|
55
55
|
|
|
56
56
|
try {
|
|
57
|
-
|
|
57
|
+
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
58
58
|
return true;
|
|
59
59
|
} catch (e) {
|
|
60
60
|
return false;
|
|
@@ -58,7 +58,7 @@ function _isNativeReflectConstruct() {
|
|
|
58
58
|
if (typeof Proxy === "function") return true;
|
|
59
59
|
|
|
60
60
|
try {
|
|
61
|
-
|
|
61
|
+
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
62
62
|
return true;
|
|
63
63
|
} catch (e) {
|
|
64
64
|
return false;
|
package/lib/browser/ParseUser.js
CHANGED
|
@@ -36,8 +36,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
36
36
|
|
|
37
37
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
38
38
|
|
|
39
|
-
var _AnonymousUtils = _interopRequireDefault(require("./AnonymousUtils"));
|
|
40
|
-
|
|
41
39
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
42
40
|
|
|
43
41
|
var _isRevocableSession = _interopRequireDefault(require("./isRevocableSession"));
|
|
@@ -74,7 +72,7 @@ function _isNativeReflectConstruct() {
|
|
|
74
72
|
if (typeof Proxy === "function") return true;
|
|
75
73
|
|
|
76
74
|
try {
|
|
77
|
-
|
|
75
|
+
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
78
76
|
return true;
|
|
79
77
|
} catch (e) {
|
|
80
78
|
return false;
|
|
@@ -527,8 +525,7 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
|
|
|
527
525
|
value: function (username
|
|
528
526
|
/*: string*/
|
|
529
527
|
) {
|
|
530
|
-
// Strip anonymity
|
|
531
|
-
// encounter anonymous user created by android/iOS in cloud code.
|
|
528
|
+
// Strip anonymity
|
|
532
529
|
var authData = this.get('authData');
|
|
533
530
|
|
|
534
531
|
if (authData && (0, _typeof2.default)(authData) === 'object' && authData.hasOwnProperty('anonymous')) {
|
|
@@ -1516,46 +1513,13 @@ var DefaultController = {
|
|
|
1516
1513
|
return _Storage.default.removeItemAsync(path);
|
|
1517
1514
|
},
|
|
1518
1515
|
setCurrentUser: function (user) {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1522
|
-
var currentUser;
|
|
1523
|
-
return _regenerator.default.wrap(function (_context6) {
|
|
1524
|
-
while (1) {
|
|
1525
|
-
switch (_context6.prev = _context6.next) {
|
|
1526
|
-
case 0:
|
|
1527
|
-
_context6.next = 2;
|
|
1528
|
-
return _this4.currentUserAsync();
|
|
1529
|
-
|
|
1530
|
-
case 2:
|
|
1531
|
-
currentUser = _context6.sent;
|
|
1532
|
-
|
|
1533
|
-
if (!(currentUser && !user.equals(currentUser) && _AnonymousUtils.default.isLinked(currentUser))) {
|
|
1534
|
-
_context6.next = 6;
|
|
1535
|
-
break;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
_context6.next = 6;
|
|
1539
|
-
return currentUser.destroy({
|
|
1540
|
-
sessionToken: currentUser.getSessionToken()
|
|
1541
|
-
});
|
|
1542
|
-
|
|
1543
|
-
case 6:
|
|
1544
|
-
currentUserCache = user;
|
|
1545
|
-
|
|
1546
|
-
user._cleanupAuthData();
|
|
1516
|
+
currentUserCache = user;
|
|
1547
1517
|
|
|
1548
|
-
|
|
1518
|
+
user._cleanupAuthData();
|
|
1549
1519
|
|
|
1550
|
-
|
|
1520
|
+
user._synchronizeAllAuthData();
|
|
1551
1521
|
|
|
1552
|
-
|
|
1553
|
-
case "end":
|
|
1554
|
-
return _context6.stop();
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
}, _callee6);
|
|
1558
|
-
}))();
|
|
1522
|
+
return DefaultController.updateUserOnDisk(user);
|
|
1559
1523
|
},
|
|
1560
1524
|
currentUser: function ()
|
|
1561
1525
|
/*: ?ParseUser*/
|
|
@@ -1806,18 +1770,10 @@ var DefaultController = {
|
|
|
1806
1770
|
var promise = _Storage.default.removeItemAsync(path);
|
|
1807
1771
|
|
|
1808
1772
|
if (currentUser !== null) {
|
|
1809
|
-
var isAnonymous = _AnonymousUtils.default.isLinked(currentUser);
|
|
1810
|
-
|
|
1811
1773
|
var currentSession = currentUser.getSessionToken();
|
|
1812
1774
|
|
|
1813
1775
|
if (currentSession && (0, _isRevocableSession.default)(currentSession)) {
|
|
1814
1776
|
promise = promise.then(function () {
|
|
1815
|
-
if (isAnonymous) {
|
|
1816
|
-
return currentUser.destroy({
|
|
1817
|
-
sessionToken: currentSession
|
|
1818
|
-
});
|
|
1819
|
-
}
|
|
1820
|
-
}).then(function () {
|
|
1821
1777
|
return RESTController.request('POST', 'logout', {}, {
|
|
1822
1778
|
sessionToken: currentSession
|
|
1823
1779
|
});
|
|
@@ -1852,29 +1808,29 @@ var DefaultController = {
|
|
|
1852
1808
|
, options
|
|
1853
1809
|
/*: RequestOptions*/
|
|
1854
1810
|
) {
|
|
1855
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1811
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1856
1812
|
var token, RESTController, result, session, current;
|
|
1857
|
-
return _regenerator.default.wrap(function (
|
|
1813
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
1858
1814
|
while (1) {
|
|
1859
|
-
switch (
|
|
1815
|
+
switch (_context6.prev = _context6.next) {
|
|
1860
1816
|
case 0:
|
|
1861
1817
|
token = user.getSessionToken();
|
|
1862
1818
|
|
|
1863
1819
|
if (token) {
|
|
1864
|
-
|
|
1820
|
+
_context6.next = 3;
|
|
1865
1821
|
break;
|
|
1866
1822
|
}
|
|
1867
1823
|
|
|
1868
|
-
return
|
|
1824
|
+
return _context6.abrupt("return", _promise.default.reject(new _ParseError.default(_ParseError.default.SESSION_MISSING, 'Cannot upgrade a user with no session token')));
|
|
1869
1825
|
|
|
1870
1826
|
case 3:
|
|
1871
1827
|
options.sessionToken = token;
|
|
1872
1828
|
RESTController = _CoreManager.default.getRESTController();
|
|
1873
|
-
|
|
1829
|
+
_context6.next = 7;
|
|
1874
1830
|
return RESTController.request('POST', 'upgradeToRevocableSession', {}, options);
|
|
1875
1831
|
|
|
1876
1832
|
case 7:
|
|
1877
|
-
result =
|
|
1833
|
+
result = _context6.sent;
|
|
1878
1834
|
session = new _ParseSession.default();
|
|
1879
1835
|
|
|
1880
1836
|
session._finishFetch(result);
|
|
@@ -1883,28 +1839,28 @@ var DefaultController = {
|
|
|
1883
1839
|
sessionToken: session.getSessionToken()
|
|
1884
1840
|
});
|
|
1885
1841
|
|
|
1886
|
-
|
|
1842
|
+
_context6.next = 13;
|
|
1887
1843
|
return user.isCurrentAsync();
|
|
1888
1844
|
|
|
1889
1845
|
case 13:
|
|
1890
|
-
current =
|
|
1846
|
+
current = _context6.sent;
|
|
1891
1847
|
|
|
1892
1848
|
if (!current) {
|
|
1893
|
-
|
|
1849
|
+
_context6.next = 16;
|
|
1894
1850
|
break;
|
|
1895
1851
|
}
|
|
1896
1852
|
|
|
1897
|
-
return
|
|
1853
|
+
return _context6.abrupt("return", DefaultController.setCurrentUser(user));
|
|
1898
1854
|
|
|
1899
1855
|
case 16:
|
|
1900
|
-
return
|
|
1856
|
+
return _context6.abrupt("return", _promise.default.resolve(user));
|
|
1901
1857
|
|
|
1902
1858
|
case 17:
|
|
1903
1859
|
case "end":
|
|
1904
|
-
return
|
|
1860
|
+
return _context6.stop();
|
|
1905
1861
|
}
|
|
1906
1862
|
}
|
|
1907
|
-
},
|
|
1863
|
+
}, _callee6);
|
|
1908
1864
|
}))();
|
|
1909
1865
|
},
|
|
1910
1866
|
linkWith: function (user
|
package/lib/browser/Push.js
CHANGED
|
@@ -42,9 +42,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
42
42
|
if (_Object$getOwnPropertySymbols) {
|
|
43
43
|
var symbols = _Object$getOwnPropertySymbols(object);
|
|
44
44
|
|
|
45
|
-
if (enumerableOnly)
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
if (enumerableOnly) {
|
|
46
|
+
symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) {
|
|
47
|
+
return _Object$getOwnPropertyDescriptor(object, sym).enumerable;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
48
51
|
keys.push.apply(keys, symbols);
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -88,7 +91,7 @@ function _objectSpread(target) {
|
|
|
88
91
|
/* global XMLHttpRequest, XDomainRequest */
|
|
89
92
|
|
|
90
93
|
|
|
91
|
-
var uuidv4 = require('uuid
|
|
94
|
+
var uuidv4 = require('./uuid');
|
|
92
95
|
|
|
93
96
|
var XHR = null;
|
|
94
97
|
|