parse 8.1.0 → 8.1.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +1 -1
- package/dist/parse.min.js +1 -1
- package/dist/parse.weapp.js +1 -1
- package/dist/parse.weapp.min.js +1 -1
- package/lib/browser/Cloud.js +2 -1
- package/lib/browser/CoreManager.js +4 -2
- package/lib/browser/LiveQueryClient.js +11 -7
- package/lib/browser/LocalDatastore.js +6 -4
- package/lib/browser/ObjectStateMutations.js +31 -3
- package/lib/browser/OfflineQuery.js +17 -14
- package/lib/browser/Parse.js +31 -2
- package/lib/browser/ParseCLP.js +46 -19
- package/lib/browser/ParseFile.js +36 -11
- package/lib/browser/ParseObject.js +37 -11
- package/lib/browser/ParseQuery.js +20 -21
- package/lib/browser/ParseSchema.js +5 -5
- package/lib/browser/ParseUser.js +40 -11
- package/lib/browser/Push.js +2 -1
- package/lib/browser/RESTController.js +35 -6
- package/lib/node/CoreManager.js +1 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/weapp/Cloud.js +2 -1
- package/lib/weapp/CoreManager.js +4 -2
- package/lib/weapp/LiveQueryClient.js +11 -7
- package/lib/weapp/LocalDatastore.js +6 -4
- package/lib/weapp/ObjectStateMutations.js +31 -3
- package/lib/weapp/OfflineQuery.js +17 -14
- package/lib/weapp/Parse.js +31 -2
- package/lib/weapp/ParseCLP.js +46 -19
- package/lib/weapp/ParseFile.js +36 -11
- package/lib/weapp/ParseObject.js +37 -11
- package/lib/weapp/ParseQuery.js +20 -21
- package/lib/weapp/ParseSchema.js +5 -5
- package/lib/weapp/ParseUser.js +40 -11
- package/lib/weapp/Push.js +2 -1
- package/lib/weapp/RESTController.js +35 -6
- package/package.json +6 -6
- package/types/ParseQuery.d.ts +3 -3
- package/types/tests.ts +12 -0
package/lib/weapp/ParseQuery.js
CHANGED
|
@@ -20,7 +20,6 @@ var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stabl
|
|
|
20
20
|
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
21
21
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
22
22
|
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
23
|
-
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
24
23
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
25
24
|
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
26
25
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
@@ -145,7 +144,7 @@ function handleOfflineSort(a, b, sorts) {
|
|
|
145
144
|
order = 'updatedAt';
|
|
146
145
|
}
|
|
147
146
|
if (!/^[A-Za-z][0-9A-Za-z_]*$/.test(order) || order === 'password') {
|
|
148
|
-
throw new _ParseError.default(_ParseError.default.INVALID_KEY_NAME,
|
|
147
|
+
throw new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, "Invalid Key: ".concat(order));
|
|
149
148
|
}
|
|
150
149
|
const field1 = a.get(order);
|
|
151
150
|
const field2 = b.get(order);
|
|
@@ -599,12 +598,12 @@ class ParseQuery {
|
|
|
599
598
|
return this._handleOfflineQuery(this.toJSON());
|
|
600
599
|
}
|
|
601
600
|
return (0, _find.default)(controller).call(controller, this.className, this.toJSON(), findOptions).then(response => {
|
|
602
|
-
var
|
|
601
|
+
var _response$results;
|
|
603
602
|
// Return generic object when explain is used
|
|
604
603
|
if (this._explain) {
|
|
605
604
|
return response.results;
|
|
606
605
|
}
|
|
607
|
-
const results = (
|
|
606
|
+
const results = (_response$results = response.results) === null || _response$results === void 0 ? void 0 : (0, _map.default)(_response$results).call(_response$results, data => {
|
|
608
607
|
// In cases of relations, the server may send back a className
|
|
609
608
|
// on the top level of the payload
|
|
610
609
|
const override = response.className || this.className;
|
|
@@ -1040,8 +1039,8 @@ class ParseQuery {
|
|
|
1040
1039
|
*/
|
|
1041
1040
|
equalTo(key, value) {
|
|
1042
1041
|
if (key && typeof key === 'object') {
|
|
1043
|
-
var
|
|
1044
|
-
(0, _forEach.default)(
|
|
1042
|
+
var _context4;
|
|
1043
|
+
(0, _forEach.default)(_context4 = (0, _entries.default)(key)).call(_context4, _ref => {
|
|
1045
1044
|
let [k, val] = _ref;
|
|
1046
1045
|
return this.equalTo(k, val);
|
|
1047
1046
|
});
|
|
@@ -1064,8 +1063,8 @@ class ParseQuery {
|
|
|
1064
1063
|
*/
|
|
1065
1064
|
notEqualTo(key, value) {
|
|
1066
1065
|
if (key && typeof key === 'object') {
|
|
1067
|
-
var
|
|
1068
|
-
(0, _forEach.default)(
|
|
1066
|
+
var _context5;
|
|
1067
|
+
(0, _forEach.default)(_context5 = (0, _entries.default)(key)).call(_context5, _ref2 => {
|
|
1069
1068
|
let [k, val] = _ref2;
|
|
1070
1069
|
return this.notEqualTo(k, val);
|
|
1071
1070
|
});
|
|
@@ -1378,7 +1377,7 @@ class ParseQuery {
|
|
|
1378
1377
|
fullOptions.$diacriticSensitive = options[option];
|
|
1379
1378
|
break;
|
|
1380
1379
|
default:
|
|
1381
|
-
throw new Error(
|
|
1380
|
+
throw new Error("Unknown option: ".concat(option));
|
|
1382
1381
|
}
|
|
1383
1382
|
}
|
|
1384
1383
|
return this._addCondition(key, '$text', {
|
|
@@ -1592,11 +1591,11 @@ class ParseQuery {
|
|
|
1592
1591
|
keys[_key2] = arguments[_key2];
|
|
1593
1592
|
}
|
|
1594
1593
|
(0, _forEach.default)(keys).call(keys, key => {
|
|
1595
|
-
var
|
|
1594
|
+
var _context6;
|
|
1596
1595
|
if ((0, _isArray.default)(key)) {
|
|
1597
1596
|
key = key.join();
|
|
1598
1597
|
}
|
|
1599
|
-
this._order = (0, _concat.default)(
|
|
1598
|
+
this._order = (0, _concat.default)(_context6 = this._order).call(_context6, key.replace(/\s/g, '').split(','));
|
|
1600
1599
|
});
|
|
1601
1600
|
return this;
|
|
1602
1601
|
}
|
|
@@ -1632,11 +1631,11 @@ class ParseQuery {
|
|
|
1632
1631
|
keys[_key4] = arguments[_key4];
|
|
1633
1632
|
}
|
|
1634
1633
|
(0, _forEach.default)(keys).call(keys, key => {
|
|
1635
|
-
var
|
|
1634
|
+
var _context7, _context8;
|
|
1636
1635
|
if ((0, _isArray.default)(key)) {
|
|
1637
1636
|
key = key.join();
|
|
1638
1637
|
}
|
|
1639
|
-
this._order = (0, _concat.default)(
|
|
1638
|
+
this._order = (0, _concat.default)(_context7 = this._order).call(_context7, (0, _map.default)(_context8 = key.replace(/\s/g, '').split(',')).call(_context8, k => {
|
|
1640
1639
|
return '-' + k;
|
|
1641
1640
|
}));
|
|
1642
1641
|
});
|
|
@@ -1709,8 +1708,8 @@ class ParseQuery {
|
|
|
1709
1708
|
}
|
|
1710
1709
|
(0, _forEach.default)(keys).call(keys, key => {
|
|
1711
1710
|
if ((0, _isArray.default)(key)) {
|
|
1712
|
-
var
|
|
1713
|
-
this._include = (0, _concat.default)(
|
|
1711
|
+
var _context9;
|
|
1712
|
+
this._include = (0, _concat.default)(_context9 = this._include).call(_context9, key);
|
|
1714
1713
|
} else {
|
|
1715
1714
|
this._include.push(key);
|
|
1716
1715
|
}
|
|
@@ -1746,8 +1745,8 @@ class ParseQuery {
|
|
|
1746
1745
|
}
|
|
1747
1746
|
(0, _forEach.default)(keys).call(keys, key => {
|
|
1748
1747
|
if ((0, _isArray.default)(key)) {
|
|
1749
|
-
var
|
|
1750
|
-
this._select = (0, _concat.default)(
|
|
1748
|
+
var _context0;
|
|
1749
|
+
this._select = (0, _concat.default)(_context0 = this._select).call(_context0, key);
|
|
1751
1750
|
} else {
|
|
1752
1751
|
this._select.push(key);
|
|
1753
1752
|
}
|
|
@@ -1770,8 +1769,8 @@ class ParseQuery {
|
|
|
1770
1769
|
}
|
|
1771
1770
|
(0, _forEach.default)(keys).call(keys, key => {
|
|
1772
1771
|
if ((0, _isArray.default)(key)) {
|
|
1773
|
-
var
|
|
1774
|
-
this._exclude = (0, _concat.default)(
|
|
1772
|
+
var _context1;
|
|
1773
|
+
this._exclude = (0, _concat.default)(_context1 = this._exclude).call(_context1, key);
|
|
1775
1774
|
} else {
|
|
1776
1775
|
this._exclude.push(key);
|
|
1777
1776
|
}
|
|
@@ -1793,8 +1792,8 @@ class ParseQuery {
|
|
|
1793
1792
|
}
|
|
1794
1793
|
(0, _forEach.default)(keys).call(keys, key => {
|
|
1795
1794
|
if ((0, _isArray.default)(key)) {
|
|
1796
|
-
var
|
|
1797
|
-
this._watch = (0, _concat.default)(
|
|
1795
|
+
var _context10;
|
|
1796
|
+
this._watch = (0, _concat.default)(_context10 = this._watch).call(_context10, key);
|
|
1798
1797
|
} else {
|
|
1799
1798
|
this._watch.push(key);
|
|
1800
1799
|
}
|
package/lib/weapp/ParseSchema.js
CHANGED
|
@@ -194,7 +194,7 @@ class ParseSchema {
|
|
|
194
194
|
throw new Error('field name may not be null.');
|
|
195
195
|
}
|
|
196
196
|
if ((0, _indexOf.default)(FIELD_TYPES).call(FIELD_TYPES, type) === -1) {
|
|
197
|
-
throw new Error(
|
|
197
|
+
throw new Error("".concat(type, " is not a valid type."));
|
|
198
198
|
}
|
|
199
199
|
if (type === 'Pointer') {
|
|
200
200
|
return this.addPointer(name, options.targetClass, options);
|
|
@@ -382,10 +382,10 @@ class ParseSchema {
|
|
|
382
382
|
type: 'Pointer',
|
|
383
383
|
targetClass
|
|
384
384
|
};
|
|
385
|
-
if (typeof options
|
|
385
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.required) === 'boolean') {
|
|
386
386
|
fieldOptions.required = options.required;
|
|
387
387
|
}
|
|
388
|
-
if (options
|
|
388
|
+
if ((options === null || options === void 0 ? void 0 : options.defaultValue) !== undefined) {
|
|
389
389
|
fieldOptions.defaultValue = options.defaultValue;
|
|
390
390
|
if (options.defaultValue instanceof _ParseObject.default) {
|
|
391
391
|
fieldOptions.defaultValue = options.defaultValue.toPointer();
|
|
@@ -446,7 +446,7 @@ const DefaultController = {
|
|
|
446
446
|
send(className, method) {
|
|
447
447
|
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
448
448
|
const RESTController = _CoreManager.default.getRESTController();
|
|
449
|
-
return RESTController.request(method,
|
|
449
|
+
return RESTController.request(method, "schemas/".concat(className), params, {
|
|
450
450
|
useMasterKey: true
|
|
451
451
|
});
|
|
452
452
|
},
|
|
@@ -464,7 +464,7 @@ const DefaultController = {
|
|
|
464
464
|
},
|
|
465
465
|
purge(className) {
|
|
466
466
|
const RESTController = _CoreManager.default.getRESTController();
|
|
467
|
-
return RESTController.request('DELETE',
|
|
467
|
+
return RESTController.request('DELETE', "purge/".concat(className), {}, {
|
|
468
468
|
useMasterKey: true
|
|
469
469
|
});
|
|
470
470
|
}
|
package/lib/weapp/ParseUser.js
CHANGED
|
@@ -1,19 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
5
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
7
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
8
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
9
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
3
10
|
var _Object$defineProperty2 = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
11
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
12
|
_Object$defineProperty2(exports, "__esModule", {
|
|
6
13
|
value: true
|
|
7
14
|
});
|
|
8
15
|
exports.default = void 0;
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
9
17
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
10
|
-
var
|
|
18
|
+
var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
|
|
11
19
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
12
20
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
13
21
|
var _isRevocableSession = _interopRequireDefault(require("./isRevocableSession"));
|
|
14
22
|
var _ParseError = _interopRequireDefault(require("./ParseError"));
|
|
15
23
|
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
16
24
|
var _Storage = _interopRequireDefault(require("./Storage"));
|
|
25
|
+
function ownKeys(e, r) {
|
|
26
|
+
var t = _Object$keys(e);
|
|
27
|
+
if (_Object$getOwnPropertySymbols) {
|
|
28
|
+
var o = _Object$getOwnPropertySymbols(e);
|
|
29
|
+
r && (o = _filterInstanceProperty(o).call(o, function (r) {
|
|
30
|
+
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
31
|
+
})), t.push.apply(t, o);
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function _objectSpread(e) {
|
|
36
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
37
|
+
var _context, _context2;
|
|
38
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
39
|
+
r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) {
|
|
40
|
+
(0, _defineProperty2.default)(e, r, t[r]);
|
|
41
|
+
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) {
|
|
42
|
+
_Object$defineProperty2(e, r, _Object$getOwnPropertyDescriptor(t, r));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
17
47
|
const CURRENT_USER_KEY = 'currentUser';
|
|
18
48
|
let canUseCurrentUser = !_CoreManager.default.get('IS_NODE');
|
|
19
49
|
let currentUserCacheMatchesDisk = false;
|
|
@@ -557,7 +587,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
557
587
|
if (protoProps) {
|
|
558
588
|
for (const prop in protoProps) {
|
|
559
589
|
if (prop !== 'className') {
|
|
560
|
-
(0,
|
|
590
|
+
(0, _defineProperty3.default)(ParseUser.prototype, prop, {
|
|
561
591
|
value: protoProps[prop],
|
|
562
592
|
enumerable: false,
|
|
563
593
|
writable: true,
|
|
@@ -569,7 +599,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
569
599
|
if (classProps) {
|
|
570
600
|
for (const prop in classProps) {
|
|
571
601
|
if (prop !== 'className') {
|
|
572
|
-
(0,
|
|
602
|
+
(0, _defineProperty3.default)(ParseUser, prop, {
|
|
573
603
|
value: classProps[prop],
|
|
574
604
|
enumerable: false,
|
|
575
605
|
writable: true,
|
|
@@ -1152,7 +1182,7 @@ const DefaultController = {
|
|
|
1152
1182
|
},
|
|
1153
1183
|
logOut(options) {
|
|
1154
1184
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1155
|
-
if (options
|
|
1185
|
+
if (options !== null && options !== void 0 && options.sessionToken) {
|
|
1156
1186
|
return RESTController.request('POST', 'logout', {}, options);
|
|
1157
1187
|
}
|
|
1158
1188
|
return DefaultController.currentUserAsync().then(currentUser => {
|
|
@@ -1192,7 +1222,7 @@ const DefaultController = {
|
|
|
1192
1222
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1193
1223
|
const result = await RESTController.request('POST', 'upgradeToRevocableSession', {}, options);
|
|
1194
1224
|
user._finishFetch({
|
|
1195
|
-
sessionToken: result
|
|
1225
|
+
sessionToken: (result === null || result === void 0 ? void 0 : result.sessionToken) || ''
|
|
1196
1226
|
});
|
|
1197
1227
|
const current = await user.isCurrentAsync();
|
|
1198
1228
|
if (current) {
|
|
@@ -1212,13 +1242,12 @@ const DefaultController = {
|
|
|
1212
1242
|
},
|
|
1213
1243
|
verifyPassword(username, password, options) {
|
|
1214
1244
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1215
|
-
const data = {
|
|
1245
|
+
const data = _objectSpread({
|
|
1216
1246
|
username,
|
|
1217
|
-
password
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
};
|
|
1247
|
+
password
|
|
1248
|
+
}, options.ignoreEmailVerification !== undefined && {
|
|
1249
|
+
ignoreEmailVerification: options.ignoreEmailVerification
|
|
1250
|
+
});
|
|
1222
1251
|
return RESTController.request('GET', 'verifyPassword', data, options);
|
|
1223
1252
|
},
|
|
1224
1253
|
requestEmailVerification(email, options) {
|
package/lib/weapp/Push.js
CHANGED
|
@@ -94,9 +94,10 @@ function getPushStatus(pushStatusId) {
|
|
|
94
94
|
}
|
|
95
95
|
const DefaultController = {
|
|
96
96
|
async send(data, options) {
|
|
97
|
+
var _response$_headers;
|
|
97
98
|
options.returnStatus = true;
|
|
98
99
|
const response = await _CoreManager.default.getRESTController().request('POST', 'push', data, options);
|
|
99
|
-
return response._headers
|
|
100
|
+
return (_response$_headers = response._headers) === null || _response$_headers === void 0 ? void 0 : _response$_headers['X-Parse-Push-Status-Id'];
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
_CoreManager.default.setPushController(DefaultController);
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
5
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
7
|
+
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
8
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
9
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
3
10
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
11
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
12
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
13
|
value: true
|
|
7
14
|
});
|
|
8
15
|
exports.default = void 0;
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
9
17
|
var _endsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/ends-with"));
|
|
10
18
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
11
19
|
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
|
|
@@ -19,7 +27,28 @@ var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
|
19
27
|
var _ParseError = _interopRequireDefault(require("./ParseError"));
|
|
20
28
|
var _promiseUtils = require("./promiseUtils");
|
|
21
29
|
var _Xhr = require("./Xhr.weapp");
|
|
22
|
-
|
|
30
|
+
function ownKeys(e, r) {
|
|
31
|
+
var t = _Object$keys(e);
|
|
32
|
+
if (_Object$getOwnPropertySymbols) {
|
|
33
|
+
var o = _Object$getOwnPropertySymbols(e);
|
|
34
|
+
r && (o = _filterInstanceProperty(o).call(o, function (r) {
|
|
35
|
+
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
36
|
+
})), t.push.apply(t, o);
|
|
37
|
+
}
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
function _objectSpread(e) {
|
|
41
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
42
|
+
var _context4, _context5;
|
|
43
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
44
|
+
r % 2 ? _forEachInstanceProperty2(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) {
|
|
45
|
+
(0, _defineProperty2.default)(e, r, t[r]);
|
|
46
|
+
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty2(_context5 = ownKeys(Object(t))).call(_context5, function (r) {
|
|
47
|
+
_Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return e;
|
|
51
|
+
} /* global XMLHttpRequest, XDomainRequest */
|
|
23
52
|
|
|
24
53
|
(0, _Xhr.polyfillFetch)();
|
|
25
54
|
let useXDomainRequest = false;
|
|
@@ -157,7 +186,7 @@ const RESTController = {
|
|
|
157
186
|
break;
|
|
158
187
|
}
|
|
159
188
|
chunks.push(value);
|
|
160
|
-
recieved += value
|
|
189
|
+
recieved += (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
161
190
|
options.progress(recieved / length, recieved, length);
|
|
162
191
|
}
|
|
163
192
|
const body = new Uint8Array(recieved);
|
|
@@ -205,6 +234,7 @@ const RESTController = {
|
|
|
205
234
|
promise.reject(response);
|
|
206
235
|
}
|
|
207
236
|
} catch (error) {
|
|
237
|
+
var _error$cause;
|
|
208
238
|
if (error.name === 'AbortError') {
|
|
209
239
|
promise.resolve({
|
|
210
240
|
response: {
|
|
@@ -212,7 +242,7 @@ const RESTController = {
|
|
|
212
242
|
},
|
|
213
243
|
status: 0
|
|
214
244
|
});
|
|
215
|
-
} else if (error.cause
|
|
245
|
+
} else if (((_error$cause = error.cause) === null || _error$cause === void 0 ? void 0 : _error$cause.code) === 'ECONNREFUSED') {
|
|
216
246
|
promise.reject('Unable to connect to the Parse API');
|
|
217
247
|
} else {
|
|
218
248
|
promise.reject(error);
|
|
@@ -316,11 +346,10 @@ const RESTController = {
|
|
|
316
346
|
headers
|
|
317
347
|
} = result;
|
|
318
348
|
if (options.returnStatus) {
|
|
319
|
-
return {
|
|
320
|
-
...response,
|
|
349
|
+
return _objectSpread(_objectSpread({}, response), {}, {
|
|
321
350
|
_status: status,
|
|
322
351
|
_headers: headers
|
|
323
|
-
};
|
|
352
|
+
});
|
|
324
353
|
} else {
|
|
325
354
|
return response;
|
|
326
355
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.1-alpha.1",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@babel/core": "7.29.0",
|
|
78
78
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
79
|
-
"@babel/plugin-transform-runtime": "7.
|
|
80
|
-
"@babel/preset-env": "7.
|
|
79
|
+
"@babel/plugin-transform-runtime": "7.29.0",
|
|
80
|
+
"@babel/preset-env": "7.29.0",
|
|
81
81
|
"@babel/preset-react": "7.28.5",
|
|
82
82
|
"@babel/preset-typescript": "7.27.1",
|
|
83
83
|
"@eslint/js": "9.39.2",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"cross-env": "10.1.0",
|
|
100
100
|
"eslint": "9.39.2",
|
|
101
101
|
"eslint-plugin-expect-type": "0.6.2",
|
|
102
|
-
"eslint-plugin-jsdoc": "62.5.
|
|
102
|
+
"eslint-plugin-jsdoc": "62.5.2",
|
|
103
103
|
"express": "5.2.1",
|
|
104
104
|
"gulp": "5.0.1",
|
|
105
105
|
"gulp-babel": "8.0.0",
|
|
@@ -115,8 +115,8 @@
|
|
|
115
115
|
"madge": "8.0.0",
|
|
116
116
|
"metro-react-native-babel-preset": "0.77.0",
|
|
117
117
|
"mongodb-runner": "6.6.0",
|
|
118
|
-
"parse-server": "
|
|
119
|
-
"puppeteer": "24.
|
|
118
|
+
"parse-server": "9.2.0",
|
|
119
|
+
"puppeteer": "24.37.2",
|
|
120
120
|
"regenerator-runtime": "0.14.1",
|
|
121
121
|
"semantic-release": "25.0.3",
|
|
122
122
|
"typescript-eslint": "8.54.0",
|
package/types/ParseQuery.d.ts
CHANGED
|
@@ -874,7 +874,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
874
874
|
* @static
|
|
875
875
|
* @returns {Parse.Query} The query that is the OR of the passed in queries.
|
|
876
876
|
*/
|
|
877
|
-
static or(...queries: ParseQuery[]): ParseQuery
|
|
877
|
+
static or<T extends ParseObject>(...queries: ParseQuery<T>[]): ParseQuery<T>;
|
|
878
878
|
/**
|
|
879
879
|
* Constructs a Parse.Query that is the AND of the passed in queries. For
|
|
880
880
|
* example:
|
|
@@ -887,7 +887,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
887
887
|
* @static
|
|
888
888
|
* @returns {Parse.Query} The query that is the AND of the passed in queries.
|
|
889
889
|
*/
|
|
890
|
-
static and(...queries: ParseQuery[]): ParseQuery
|
|
890
|
+
static and<T extends ParseObject>(...queries: ParseQuery<T>[]): ParseQuery<T>;
|
|
891
891
|
/**
|
|
892
892
|
* Constructs a Parse.Query that is the NOR of the passed in queries. For
|
|
893
893
|
* example:
|
|
@@ -900,7 +900,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
|
|
|
900
900
|
* @static
|
|
901
901
|
* @returns {Parse.Query} The query that is the NOR of the passed in queries.
|
|
902
902
|
*/
|
|
903
|
-
static nor(...queries: ParseQuery[]): ParseQuery
|
|
903
|
+
static nor<T extends ParseObject>(...queries: ParseQuery<T>[]): ParseQuery<T>;
|
|
904
904
|
/**
|
|
905
905
|
* Change the source of this query to the server.
|
|
906
906
|
*
|
package/types/tests.ts
CHANGED
|
@@ -217,6 +217,18 @@ async function test_query() {
|
|
|
217
217
|
await query.distinct('name');
|
|
218
218
|
|
|
219
219
|
const testQuery = Parse.Query.or(query, query);
|
|
220
|
+
|
|
221
|
+
// Test that query can do `or`/`and` joins while preserving class types
|
|
222
|
+
// This was the behaviour with the old DefinitelyTyped typings.
|
|
223
|
+
class MyClass extends Parse.Object<{ a: number }> {};
|
|
224
|
+
const q1 = new Parse.Query(MyClass).equalTo('a', 2);
|
|
225
|
+
const q2 = new Parse.Query(MyClass).equalTo('a', 3);
|
|
226
|
+
// $ExpectType ParseQuery<MyClass>
|
|
227
|
+
const orQ = Parse.Query.or(q1, q2);
|
|
228
|
+
// $ExpectType ParseQuery<MyClass>
|
|
229
|
+
const andQ = Parse.Query.and(q1, q2);
|
|
230
|
+
// $ExpectType ParseQuery<MyClass>
|
|
231
|
+
const norQ = Parse.Query.nor(q1, q2);
|
|
220
232
|
}
|
|
221
233
|
|
|
222
234
|
function test_query_exclude() {
|