parse 4.3.0 → 4.3.1-alpha.2
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 +147 -97
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +1083 -698
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Cloud.js +22 -3
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/IndexedDBStorageController.js +25 -20
- package/lib/browser/ObjectStateMutations.js +11 -17
- package/lib/browser/Parse.js +2 -1
- package/lib/browser/ParseObject.js +6 -2
- package/lib/browser/ParseOp.js +13 -20
- package/lib/browser/Push.js +20 -1
- package/lib/browser/RESTController.js +18 -14
- package/lib/browser/SingleInstanceStateController.js +6 -4
- package/lib/browser/UniqueInstanceStateController.js +2 -2
- package/lib/node/Cloud.js +5 -2
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/IndexedDBStorageController.js +24 -19
- package/lib/node/ObjectStateMutations.js +6 -12
- package/lib/node/Parse.js +1 -0
- package/lib/node/ParseObject.js +6 -2
- package/lib/node/ParseOp.js +2 -8
- package/lib/node/Push.js +5 -2
- package/lib/node/RESTController.js +13 -9
- package/lib/node/SingleInstanceStateController.js +10 -4
- package/lib/node/UniqueInstanceStateController.js +2 -2
- package/lib/react-native/Cloud.js +15 -5
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/IndexedDBStorageController.js +24 -20
- package/lib/react-native/ObjectStateMutations.js +11 -17
- package/lib/react-native/Parse.js +1 -0
- package/lib/react-native/ParseObject.js +6 -2
- package/lib/react-native/ParseOp.js +2 -8
- package/lib/react-native/Push.js +13 -3
- package/lib/react-native/RESTController.js +13 -9
- package/lib/react-native/SingleInstanceStateController.js +4 -2
- package/lib/react-native/UniqueInstanceStateController.js +2 -2
- package/lib/weapp/Cloud.js +22 -3
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/IndexedDBStorageController.js +25 -20
- package/lib/weapp/ObjectStateMutations.js +11 -17
- package/lib/weapp/Parse.js +1 -0
- package/lib/weapp/ParseObject.js +6 -2
- package/lib/weapp/ParseOp.js +13 -20
- package/lib/weapp/Push.js +20 -1
- package/lib/weapp/RESTController.js +18 -14
- package/lib/weapp/SingleInstanceStateController.js +6 -4
- package/lib/weapp/UniqueInstanceStateController.js +2 -2
- package/package.json +7 -7
package/dist/parse.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parse JavaScript SDK v4.3.
|
|
2
|
+
* Parse JavaScript SDK v4.3.1-alpha.2
|
|
3
3
|
*
|
|
4
4
|
* The source tree of this library can be found at
|
|
5
5
|
* https://github.com/ParsePlatform/Parse-SDK-JS
|
|
@@ -217,8 +217,10 @@ exports.getJobStatus = getJobStatus;
|
|
|
217
217
|
exports.getJobsData = getJobsData;
|
|
218
218
|
exports.run = run;
|
|
219
219
|
exports.startJob = startJob;
|
|
220
|
+
var _regenerator = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/regenerator"));
|
|
220
221
|
var _keys = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
221
222
|
var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
223
|
+
var _asyncToGenerator2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
222
224
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
223
225
|
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
224
226
|
var _decode = _interopRequireDefault(_dereq_("./decode"));
|
|
@@ -341,13 +343,30 @@ var DefaultController = {
|
|
|
341
343
|
return RESTController.request('GET', 'cloud_code/jobs/data', null, options);
|
|
342
344
|
},
|
|
343
345
|
startJob: function (name, data, options /*: RequestOptions*/) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
347
|
+
var _response$_headers;
|
|
348
|
+
var RESTController, payload, response;
|
|
349
|
+
return _regenerator.default.wrap(function (_context) {
|
|
350
|
+
while (1) switch (_context.prev = _context.next) {
|
|
351
|
+
case 0:
|
|
352
|
+
RESTController = _CoreManager.default.getRESTController();
|
|
353
|
+
payload = (0, _encode.default)(data, true);
|
|
354
|
+
options.returnStatus = true;
|
|
355
|
+
_context.next = 5;
|
|
356
|
+
return RESTController.request('POST', 'jobs/' + name, payload, options);
|
|
357
|
+
case 5:
|
|
358
|
+
response = _context.sent;
|
|
359
|
+
return _context.abrupt("return", (_response$_headers = response._headers) === null || _response$_headers === void 0 ? void 0 : _response$_headers['X-Parse-Job-Status-Id']);
|
|
360
|
+
case 7:
|
|
361
|
+
case "end":
|
|
362
|
+
return _context.stop();
|
|
363
|
+
}
|
|
364
|
+
}, _callee);
|
|
365
|
+
}))();
|
|
347
366
|
}
|
|
348
367
|
};
|
|
349
368
|
_CoreManager.default.setCloudController(DefaultController);
|
|
350
|
-
},{"./CoreManager":4,"./ParseError":22,"./ParseObject":27,"./ParseQuery":30,"./decode":45,"./encode":46,"@babel/runtime-corejs3/core-js-stable/object/define-property":81,"@babel/runtime-corejs3/core-js-stable/object/keys":88,"@babel/runtime-corejs3/core-js-stable/promise":90,"@babel/runtime-corejs3/helpers/interopRequireDefault":110,"@babel/runtime-corejs3/helpers/typeof":125}],4:[function(_dereq_,module,exports){
|
|
369
|
+
},{"./CoreManager":4,"./ParseError":22,"./ParseObject":27,"./ParseQuery":30,"./decode":45,"./encode":46,"@babel/runtime-corejs3/core-js-stable/object/define-property":81,"@babel/runtime-corejs3/core-js-stable/object/keys":88,"@babel/runtime-corejs3/core-js-stable/promise":90,"@babel/runtime-corejs3/helpers/asyncToGenerator":102,"@babel/runtime-corejs3/helpers/interopRequireDefault":110,"@babel/runtime-corejs3/helpers/typeof":125,"@babel/runtime-corejs3/regenerator":128}],4:[function(_dereq_,module,exports){
|
|
351
370
|
(function (process){(function (){
|
|
352
371
|
"use strict";
|
|
353
372
|
|
|
@@ -538,7 +557,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
538
557
|
SERVER_AUTH_TOKEN: null,
|
|
539
558
|
LIVEQUERY_SERVER_URL: null,
|
|
540
559
|
ENCRYPTED_KEY: null,
|
|
541
|
-
VERSION: 'js' + "4.3.
|
|
560
|
+
VERSION: 'js' + "4.3.1-alpha.2",
|
|
542
561
|
APPLICATION_ID: null,
|
|
543
562
|
JAVASCRIPT_KEY: null,
|
|
544
563
|
MASTER_KEY: null,
|
|
@@ -1574,26 +1593,31 @@ var _idbKeyval = _dereq_("idb-keyval");
|
|
|
1574
1593
|
/* global window */
|
|
1575
1594
|
|
|
1576
1595
|
if (typeof window !== 'undefined' && window.indexedDB) {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1596
|
+
try {
|
|
1597
|
+
var ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
|
|
1598
|
+
var IndexedDBStorageController = {
|
|
1599
|
+
async: 1,
|
|
1600
|
+
getItemAsync: function (path /*: string*/) {
|
|
1601
|
+
return (0, _idbKeyval.get)(path, ParseStore);
|
|
1602
|
+
},
|
|
1603
|
+
setItemAsync: function (path /*: string*/, value /*: string*/) {
|
|
1604
|
+
return (0, _idbKeyval.set)(path, value, ParseStore);
|
|
1605
|
+
},
|
|
1606
|
+
removeItemAsync: function (path /*: string*/) {
|
|
1607
|
+
return (0, _idbKeyval.del)(path, ParseStore);
|
|
1608
|
+
},
|
|
1609
|
+
getAllKeysAsync: function () {
|
|
1610
|
+
return (0, _keysInstanceProperty(_idbKeyval))(ParseStore);
|
|
1611
|
+
},
|
|
1612
|
+
clear: function () {
|
|
1613
|
+
return (0, _idbKeyval.clear)(ParseStore);
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
module.exports = IndexedDBStorageController;
|
|
1617
|
+
} catch (_) {
|
|
1618
|
+
// IndexedDB not accessible
|
|
1619
|
+
module.exports = undefined;
|
|
1620
|
+
}
|
|
1597
1621
|
} else {
|
|
1598
1622
|
// IndexedDB not supported
|
|
1599
1623
|
module.exports = undefined;
|
|
@@ -3508,16 +3532,13 @@ function mergeFirstPendingState(pendingOps /*: Array<OpsMap>*/) {
|
|
|
3508
3532
|
}
|
|
3509
3533
|
}
|
|
3510
3534
|
}
|
|
3511
|
-
function estimateAttribute(serverData /*: AttributeMap*/, pendingOps /*: Array<OpsMap>*/,
|
|
3535
|
+
function estimateAttribute(serverData /*: AttributeMap*/, pendingOps /*: Array<OpsMap>*/, object /*: ParseObject*/, attr /*: string*/) /*: mixed*/{
|
|
3512
3536
|
var value = serverData[attr];
|
|
3513
3537
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
3514
3538
|
if (pendingOps[i][attr]) {
|
|
3515
3539
|
if (pendingOps[i][attr] instanceof _ParseOp.RelationOp) {
|
|
3516
|
-
if (id) {
|
|
3517
|
-
value = pendingOps[i][attr].applyTo(value,
|
|
3518
|
-
className: className,
|
|
3519
|
-
id: id
|
|
3520
|
-
}, attr);
|
|
3540
|
+
if (object.id) {
|
|
3541
|
+
value = pendingOps[i][attr].applyTo(value, object, attr);
|
|
3521
3542
|
}
|
|
3522
3543
|
} else {
|
|
3523
3544
|
value = pendingOps[i][attr].applyTo(value);
|
|
@@ -3526,7 +3547,7 @@ function estimateAttribute(serverData /*: AttributeMap*/, pendingOps /*: Array<O
|
|
|
3526
3547
|
}
|
|
3527
3548
|
return value;
|
|
3528
3549
|
}
|
|
3529
|
-
function estimateAttributes(serverData /*: AttributeMap*/, pendingOps /*: Array<OpsMap>*/,
|
|
3550
|
+
function estimateAttributes(serverData /*: AttributeMap*/, pendingOps /*: Array<OpsMap>*/, object /*: ParseObject*/) /*: AttributeMap*/{
|
|
3530
3551
|
var data = {};
|
|
3531
3552
|
for (var attr in serverData) {
|
|
3532
3553
|
data[attr] = serverData[attr];
|
|
@@ -3534,11 +3555,8 @@ function estimateAttributes(serverData /*: AttributeMap*/, pendingOps /*: Array<
|
|
|
3534
3555
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
3535
3556
|
for (attr in pendingOps[i]) {
|
|
3536
3557
|
if (pendingOps[i][attr] instanceof _ParseOp.RelationOp) {
|
|
3537
|
-
if (id) {
|
|
3538
|
-
data[attr] = pendingOps[i][attr].applyTo(data[attr],
|
|
3539
|
-
className: className,
|
|
3540
|
-
id: id
|
|
3541
|
-
}, attr);
|
|
3558
|
+
if (object.id) {
|
|
3559
|
+
data[attr] = pendingOps[i][attr].applyTo(data[attr], object, attr);
|
|
3542
3560
|
}
|
|
3543
3561
|
} else {
|
|
3544
3562
|
if ((0, _includes.default)(attr).call(attr, '.')) {
|
|
@@ -3547,15 +3565,15 @@ function estimateAttributes(serverData /*: AttributeMap*/, pendingOps /*: Array<
|
|
|
3547
3565
|
var first = fields[0];
|
|
3548
3566
|
var last = fields[fields.length - 1];
|
|
3549
3567
|
data[first] = _objectSpread({}, serverData[first]);
|
|
3550
|
-
var
|
|
3568
|
+
var _object = _objectSpread({}, data);
|
|
3551
3569
|
for (var _i = 0; _i < fields.length - 1; _i++) {
|
|
3552
3570
|
var key = fields[_i];
|
|
3553
|
-
if (!(key in
|
|
3554
|
-
|
|
3571
|
+
if (!(key in _object)) {
|
|
3572
|
+
_object[key] = {};
|
|
3555
3573
|
}
|
|
3556
|
-
|
|
3574
|
+
_object = _object[key];
|
|
3557
3575
|
}
|
|
3558
|
-
|
|
3576
|
+
_object[last] = pendingOps[i][attr].applyTo(_object[last]);
|
|
3559
3577
|
} else {
|
|
3560
3578
|
data[attr] = pendingOps[i][attr].applyTo(data[attr]);
|
|
3561
3579
|
}
|
|
@@ -4255,6 +4273,7 @@ var _decode2 = _interopRequireDefault(_dereq_("./decode"));
|
|
|
4255
4273
|
var _encode2 = _interopRequireDefault(_dereq_("./encode"));
|
|
4256
4274
|
var _CryptoController = _interopRequireDefault(_dereq_("./CryptoController"));
|
|
4257
4275
|
var _EventuallyQueue = _interopRequireDefault(_dereq_("./EventuallyQueue"));
|
|
4276
|
+
var _IndexedDBStorageController = _interopRequireDefault(_dereq_("./IndexedDBStorageController"));
|
|
4258
4277
|
var _InstallationController = _interopRequireDefault(_dereq_("./InstallationController"));
|
|
4259
4278
|
var ParseOp = _interopRequireWildcard(_dereq_("./ParseOp"));
|
|
4260
4279
|
var _RESTController = _interopRequireDefault(_dereq_("./RESTController"));
|
|
@@ -4395,6 +4414,7 @@ var Parse /*: ParseType*/ = {
|
|
|
4395
4414
|
_CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
|
|
4396
4415
|
Parse.LiveQuery = new _ParseLiveQuery.default();
|
|
4397
4416
|
_CoreManager.default.setIfNeeded('LiveQuery', Parse.LiveQuery);
|
|
4417
|
+
Parse.IndexedDB = _CoreManager.default.setIfNeeded('IndexedDBStorageController', _IndexedDBStorageController.default);
|
|
4398
4418
|
},
|
|
4399
4419
|
/**
|
|
4400
4420
|
* Call this method to set your AsyncStorage engine
|
|
@@ -4626,7 +4646,6 @@ var Parse /*: ParseType*/ = {
|
|
|
4626
4646
|
return this.encryptedUser;
|
|
4627
4647
|
}
|
|
4628
4648
|
};
|
|
4629
|
-
Parse.IndexedDB = _dereq_('./IndexedDBStorageController');
|
|
4630
4649
|
_CoreManager.default.setCryptoController(_CryptoController.default);
|
|
4631
4650
|
_CoreManager.default.setInstallationController(_InstallationController.default);
|
|
4632
4651
|
_CoreManager.default.setRESTController(_RESTController.default);
|
|
@@ -9227,7 +9246,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9227
9246
|
case 5:
|
|
9228
9247
|
_context4.prev = 5;
|
|
9229
9248
|
_context4.t0 = _context4["catch"](0);
|
|
9230
|
-
if (!(_context4.t0.
|
|
9249
|
+
if (!(_context4.t0.code === _ParseError.default.CONNECTION_FAILED)) {
|
|
9231
9250
|
_context4.next = 11;
|
|
9232
9251
|
break;
|
|
9233
9252
|
}
|
|
@@ -9393,7 +9412,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9393
9412
|
case 5:
|
|
9394
9413
|
_context5.prev = 5;
|
|
9395
9414
|
_context5.t0 = _context5["catch"](0);
|
|
9396
|
-
if (!(_context5.t0.
|
|
9415
|
+
if (!(_context5.t0.code === _ParseError.default.CONNECTION_FAILED)) {
|
|
9397
9416
|
_context5.next = 11;
|
|
9398
9417
|
break;
|
|
9399
9418
|
}
|
|
@@ -10667,6 +10686,8 @@ var DefaultController = {
|
|
|
10667
10686
|
var objectId = responses[index].success.objectId;
|
|
10668
10687
|
var status = responses[index]._status;
|
|
10669
10688
|
delete responses[index]._status;
|
|
10689
|
+
delete responses[index]._headers;
|
|
10690
|
+
delete responses[index]._xhr;
|
|
10670
10691
|
mapIdForPin[objectId] = obj._localId;
|
|
10671
10692
|
obj._handleSaveResponse(responses[index].success, status);
|
|
10672
10693
|
} else {
|
|
@@ -10762,6 +10783,8 @@ var DefaultController = {
|
|
|
10762
10783
|
return RESTController.request(params.method, params.path, params.body, options).then(function (response) {
|
|
10763
10784
|
var status = response._status;
|
|
10764
10785
|
delete response._status;
|
|
10786
|
+
delete response._headers;
|
|
10787
|
+
delete response._xhr;
|
|
10765
10788
|
targetCopy._handleSaveResponse(response, status);
|
|
10766
10789
|
}, function (error) {
|
|
10767
10790
|
targetCopy._handleSaveError();
|
|
@@ -11264,18 +11287,11 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
11264
11287
|
}
|
|
11265
11288
|
}, {
|
|
11266
11289
|
key: "applyTo",
|
|
11267
|
-
value: function (value /*: mixed*/,
|
|
11290
|
+
value: function (value /*: mixed*/, parent /*: ParseObject*/, key /*:: ?: string*/) /*: ?ParseRelation*/{
|
|
11268
11291
|
if (!value) {
|
|
11269
|
-
|
|
11270
|
-
if (!object || !key) {
|
|
11292
|
+
if (!parent || !key) {
|
|
11271
11293
|
throw new Error('Cannot apply a RelationOp without either a previous value, or an object and a key');
|
|
11272
11294
|
}
|
|
11273
|
-
var parent = new _ParseObject.default(object.className);
|
|
11274
|
-
if (object.id && (0, _indexOf.default)(_context3 = object.id).call(_context3, 'local') === 0) {
|
|
11275
|
-
parent._localId = object.id;
|
|
11276
|
-
} else if (object.id) {
|
|
11277
|
-
parent.id = object.id;
|
|
11278
|
-
}
|
|
11279
11295
|
var relation = new _ParseRelation.default(parent, key);
|
|
11280
11296
|
relation.targetClassName = this._targetClassName;
|
|
11281
11297
|
return relation;
|
|
@@ -11305,31 +11321,31 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
11305
11321
|
} else if (previous instanceof SetOp && previous._value instanceof _ParseRelation.default) {
|
|
11306
11322
|
return this;
|
|
11307
11323
|
} else if (previous instanceof RelationOp) {
|
|
11308
|
-
var _context4, _context5, _context6, _context7, _context8
|
|
11324
|
+
var _context3, _context4, _context5, _context6, _context7, _context8;
|
|
11309
11325
|
if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
|
|
11310
11326
|
throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + (this._targetClassName || 'null') + ' was passed in.');
|
|
11311
11327
|
}
|
|
11312
|
-
var newAdd = (0, _concat.default)(
|
|
11313
|
-
(0, _forEach.default)(
|
|
11328
|
+
var newAdd = (0, _concat.default)(_context3 = previous.relationsToAdd).call(_context3, []);
|
|
11329
|
+
(0, _forEach.default)(_context4 = this.relationsToRemove).call(_context4, function (r) {
|
|
11314
11330
|
var index = (0, _indexOf.default)(newAdd).call(newAdd, r);
|
|
11315
11331
|
if (index > -1) {
|
|
11316
11332
|
(0, _splice.default)(newAdd).call(newAdd, index, 1);
|
|
11317
11333
|
}
|
|
11318
11334
|
});
|
|
11319
|
-
(0, _forEach.default)(
|
|
11335
|
+
(0, _forEach.default)(_context5 = this.relationsToAdd).call(_context5, function (r) {
|
|
11320
11336
|
var index = (0, _indexOf.default)(newAdd).call(newAdd, r);
|
|
11321
11337
|
if (index < 0) {
|
|
11322
11338
|
newAdd.push(r);
|
|
11323
11339
|
}
|
|
11324
11340
|
});
|
|
11325
|
-
var newRemove = (0, _concat.default)(
|
|
11326
|
-
(0, _forEach.default)(
|
|
11341
|
+
var newRemove = (0, _concat.default)(_context6 = previous.relationsToRemove).call(_context6, []);
|
|
11342
|
+
(0, _forEach.default)(_context7 = this.relationsToAdd).call(_context7, function (r) {
|
|
11327
11343
|
var index = (0, _indexOf.default)(newRemove).call(newRemove, r);
|
|
11328
11344
|
if (index > -1) {
|
|
11329
11345
|
(0, _splice.default)(newRemove).call(newRemove, index, 1);
|
|
11330
11346
|
}
|
|
11331
11347
|
});
|
|
11332
|
-
(0, _forEach.default)(
|
|
11348
|
+
(0, _forEach.default)(_context8 = this.relationsToRemove).call(_context8, function (r) {
|
|
11333
11349
|
var index = (0, _indexOf.default)(newRemove).call(newRemove, r);
|
|
11334
11350
|
if (index < 0) {
|
|
11335
11351
|
newRemove.push(r);
|
|
@@ -11356,16 +11372,16 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
11356
11372
|
var removes = null;
|
|
11357
11373
|
var pointers = null;
|
|
11358
11374
|
if (this.relationsToAdd.length > 0) {
|
|
11359
|
-
var
|
|
11360
|
-
pointers = (0, _map.default)(
|
|
11375
|
+
var _context9;
|
|
11376
|
+
pointers = (0, _map.default)(_context9 = this.relationsToAdd).call(_context9, idToPointer);
|
|
11361
11377
|
adds = {
|
|
11362
11378
|
__op: 'AddRelation',
|
|
11363
11379
|
objects: pointers
|
|
11364
11380
|
};
|
|
11365
11381
|
}
|
|
11366
11382
|
if (this.relationsToRemove.length > 0) {
|
|
11367
|
-
var
|
|
11368
|
-
pointers = (0, _map.default)(
|
|
11383
|
+
var _context10;
|
|
11384
|
+
pointers = (0, _map.default)(_context10 = this.relationsToRemove).call(_context10, idToPointer);
|
|
11369
11385
|
removes = {
|
|
11370
11386
|
__op: 'RemoveRelation',
|
|
11371
11387
|
objects: pointers
|
|
@@ -16563,6 +16579,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
16563
16579
|
});
|
|
16564
16580
|
exports.getPushStatus = getPushStatus;
|
|
16565
16581
|
exports.send = send;
|
|
16582
|
+
var _regenerator = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/regenerator"));
|
|
16583
|
+
var _asyncToGenerator2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
16566
16584
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
16567
16585
|
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
16568
16586
|
var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
@@ -16661,11 +16679,28 @@ function getPushStatus(pushStatusId /*: string*/) /*: Promise<string>*/{
|
|
|
16661
16679
|
}
|
|
16662
16680
|
var DefaultController = {
|
|
16663
16681
|
send: function (data /*: PushData*/, options /*:: ?: FullOptions*/) {
|
|
16664
|
-
return
|
|
16682
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
16683
|
+
var _response$_headers;
|
|
16684
|
+
var response;
|
|
16685
|
+
return _regenerator.default.wrap(function (_context) {
|
|
16686
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16687
|
+
case 0:
|
|
16688
|
+
options.returnStatus = true;
|
|
16689
|
+
_context.next = 3;
|
|
16690
|
+
return _CoreManager.default.getRESTController().request('POST', 'push', data, options);
|
|
16691
|
+
case 3:
|
|
16692
|
+
response = _context.sent;
|
|
16693
|
+
return _context.abrupt("return", (_response$_headers = response._headers) === null || _response$_headers === void 0 ? void 0 : _response$_headers['X-Parse-Push-Status-Id']);
|
|
16694
|
+
case 5:
|
|
16695
|
+
case "end":
|
|
16696
|
+
return _context.stop();
|
|
16697
|
+
}
|
|
16698
|
+
}, _callee);
|
|
16699
|
+
}))();
|
|
16665
16700
|
}
|
|
16666
16701
|
};
|
|
16667
16702
|
_CoreManager.default.setPushController(DefaultController);
|
|
16668
|
-
},{"./CoreManager":4,"./ParseQuery":30,"@babel/runtime-corejs3/core-js-stable/object/define-property":81,"@babel/runtime-corejs3/helpers/interopRequireDefault":110,"@babel/runtime-corejs3/helpers/typeof":125}],37:[function(_dereq_,module,exports){
|
|
16703
|
+
},{"./CoreManager":4,"./ParseQuery":30,"@babel/runtime-corejs3/core-js-stable/object/define-property":81,"@babel/runtime-corejs3/helpers/asyncToGenerator":102,"@babel/runtime-corejs3/helpers/interopRequireDefault":110,"@babel/runtime-corejs3/helpers/typeof":125,"@babel/runtime-corejs3/regenerator":128}],37:[function(_dereq_,module,exports){
|
|
16669
16704
|
(function (process){(function (){
|
|
16670
16705
|
"use strict";
|
|
16671
16706
|
|
|
@@ -16673,7 +16708,7 @@ var _Object$keys = _dereq_("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
|
16673
16708
|
var _Object$getOwnPropertySymbols = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
16674
16709
|
var _filterInstanceProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
16675
16710
|
var _Object$getOwnPropertyDescriptor = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
16676
|
-
var
|
|
16711
|
+
var _forEachInstanceProperty2 = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16677
16712
|
var _Object$getOwnPropertyDescriptors = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
16678
16713
|
var _Object$defineProperties = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
16679
16714
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -16683,6 +16718,7 @@ var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/ty
|
|
|
16683
16718
|
var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
16684
16719
|
var _stringify = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
16685
16720
|
var _includes = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16721
|
+
var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
16686
16722
|
var _setTimeout2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
|
16687
16723
|
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
16688
16724
|
var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
|
|
@@ -16699,11 +16735,11 @@ function ownKeys(object, enumerableOnly) {
|
|
|
16699
16735
|
}
|
|
16700
16736
|
function _objectSpread(target) {
|
|
16701
16737
|
for (var i = 1; i < arguments.length; i++) {
|
|
16702
|
-
var
|
|
16738
|
+
var _context2, _context3;
|
|
16703
16739
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
16704
|
-
i % 2 ?
|
|
16740
|
+
i % 2 ? _forEachInstanceProperty2(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) {
|
|
16705
16741
|
(0, _defineProperty2.default)(target, key, source[key]);
|
|
16706
|
-
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) :
|
|
16742
|
+
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context3 = ownKeys(Object(source))).call(_context3, function (key) {
|
|
16707
16743
|
_Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key));
|
|
16708
16744
|
});
|
|
16709
16745
|
}
|
|
@@ -16805,14 +16841,12 @@ var RESTController = {
|
|
|
16805
16841
|
var response;
|
|
16806
16842
|
try {
|
|
16807
16843
|
response = JSON.parse(xhr.responseText);
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
response = xhr.getResponseHeader('x-parse-push-status-id');
|
|
16815
|
-
}
|
|
16844
|
+
headers = {};
|
|
16845
|
+
if (typeof xhr.getResponseHeader === 'function' && xhr.getResponseHeader('access-control-expose-headers')) {
|
|
16846
|
+
var responseHeaders = xhr.getResponseHeader('access-control-expose-headers').split(', ');
|
|
16847
|
+
(0, _forEach.default)(responseHeaders).call(responseHeaders, function (header) {
|
|
16848
|
+
headers[header] = xhr.getResponseHeader(header.toLowerCase());
|
|
16849
|
+
});
|
|
16816
16850
|
}
|
|
16817
16851
|
} catch (e) {
|
|
16818
16852
|
promise.reject(e.toString());
|
|
@@ -16820,6 +16854,7 @@ var RESTController = {
|
|
|
16820
16854
|
if (response) {
|
|
16821
16855
|
promise.resolve({
|
|
16822
16856
|
response: response,
|
|
16857
|
+
headers: headers,
|
|
16823
16858
|
status: xhr.status,
|
|
16824
16859
|
xhr: xhr
|
|
16825
16860
|
});
|
|
@@ -16972,10 +17007,14 @@ var RESTController = {
|
|
|
16972
17007
|
var payloadString = (0, _stringify.default)(payload);
|
|
16973
17008
|
return RESTController.ajax(method, url, payloadString, {}, options).then(function (_ref) {
|
|
16974
17009
|
var response = _ref.response,
|
|
16975
|
-
status = _ref.status
|
|
17010
|
+
status = _ref.status,
|
|
17011
|
+
headers = _ref.headers,
|
|
17012
|
+
xhr = _ref.xhr;
|
|
16976
17013
|
if (options.returnStatus) {
|
|
16977
17014
|
return _objectSpread(_objectSpread({}, response), {}, {
|
|
16978
|
-
_status: status
|
|
17015
|
+
_status: status,
|
|
17016
|
+
_headers: headers,
|
|
17017
|
+
_xhr: xhr
|
|
16979
17018
|
});
|
|
16980
17019
|
} else {
|
|
16981
17020
|
return response;
|
|
@@ -17017,6 +17056,7 @@ var _typeof = _dereq_("@babel/runtime-corejs3/helpers/typeof");
|
|
|
17017
17056
|
var _WeakMap = _dereq_("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
17018
17057
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
17019
17058
|
var _Object$getOwnPropertyDescriptor = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
17059
|
+
var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
17020
17060
|
_Object$defineProperty(exports, "__esModule", {
|
|
17021
17061
|
value: true
|
|
17022
17062
|
});
|
|
@@ -17038,6 +17078,7 @@ exports.removeState = removeState;
|
|
|
17038
17078
|
exports.setPendingOp = setPendingOp;
|
|
17039
17079
|
exports.setServerData = setServerData;
|
|
17040
17080
|
var ObjectStateMutations = _interopRequireWildcard(_dereq_("./ObjectStateMutations"));
|
|
17081
|
+
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
17041
17082
|
function _getRequireWildcardCache(nodeInterop) {
|
|
17042
17083
|
if (typeof _WeakMap !== "function") return null;
|
|
17043
17084
|
var cacheBabelInterop = new _WeakMap();
|
|
@@ -17161,15 +17202,15 @@ function getObjectCache(obj /*: ObjectIdentifier*/) /*: ObjectCache*/{
|
|
|
17161
17202
|
}
|
|
17162
17203
|
return {};
|
|
17163
17204
|
}
|
|
17164
|
-
function estimateAttribute(obj /*:
|
|
17205
|
+
function estimateAttribute(obj /*: ParseObject*/, attr /*: string*/) /*: mixed*/{
|
|
17165
17206
|
var serverData = getServerData(obj);
|
|
17166
17207
|
var pendingOps = getPendingOps(obj);
|
|
17167
|
-
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj
|
|
17208
|
+
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
|
|
17168
17209
|
}
|
|
17169
|
-
function estimateAttributes(obj /*:
|
|
17210
|
+
function estimateAttributes(obj /*: ParseObject*/) /*: AttributeMap*/{
|
|
17170
17211
|
var serverData = getServerData(obj);
|
|
17171
17212
|
var pendingOps = getPendingOps(obj);
|
|
17172
|
-
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj
|
|
17213
|
+
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
|
|
17173
17214
|
}
|
|
17174
17215
|
function commitServerChanges(obj /*: ObjectIdentifier*/, changes /*: AttributeMap*/) {
|
|
17175
17216
|
var state = initializeState(obj);
|
|
@@ -17185,7 +17226,7 @@ function clearAllState() {
|
|
|
17185
17226
|
function duplicateState(source /*: { id: string }*/, dest /*: { id: string }*/) {
|
|
17186
17227
|
dest.id = source.id;
|
|
17187
17228
|
}
|
|
17188
|
-
},{"./ObjectStateMutations":16,"@babel/runtime-corejs3/core-js-stable/object/define-property":81,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":84,"@babel/runtime-corejs3/core-js-stable/weak-map":96,"@babel/runtime-corejs3/helpers/typeof":125}],39:[function(_dereq_,module,exports){
|
|
17229
|
+
},{"./ObjectStateMutations":16,"./ParseObject":27,"@babel/runtime-corejs3/core-js-stable/object/define-property":81,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":84,"@babel/runtime-corejs3/core-js-stable/weak-map":96,"@babel/runtime-corejs3/helpers/interopRequireDefault":110,"@babel/runtime-corejs3/helpers/typeof":125}],39:[function(_dereq_,module,exports){
|
|
17189
17230
|
"use strict";
|
|
17190
17231
|
|
|
17191
17232
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -17531,12 +17572,12 @@ function getObjectCache(obj /*: ParseObject*/) /*: ObjectCache*/{
|
|
|
17531
17572
|
function estimateAttribute(obj /*: ParseObject*/, attr /*: string*/) /*: mixed*/{
|
|
17532
17573
|
var serverData = getServerData(obj);
|
|
17533
17574
|
var pendingOps = getPendingOps(obj);
|
|
17534
|
-
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj
|
|
17575
|
+
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
|
|
17535
17576
|
}
|
|
17536
17577
|
function estimateAttributes(obj /*: ParseObject*/) /*: AttributeMap*/{
|
|
17537
17578
|
var serverData = getServerData(obj);
|
|
17538
17579
|
var pendingOps = getPendingOps(obj);
|
|
17539
|
-
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj
|
|
17580
|
+
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
|
|
17540
17581
|
}
|
|
17541
17582
|
function commitServerChanges(obj /*: ParseObject*/, changes /*: AttributeMap*/) {
|
|
17542
17583
|
var state = initializeState(obj);
|
|
@@ -18435,8 +18476,12 @@ module.exports = _interopRequireDefault, module.exports.__esModule = true, modul
|
|
|
18435
18476
|
},{}],111:[function(_dereq_,module,exports){
|
|
18436
18477
|
var _indexOfInstanceProperty = _dereq_("core-js-pure/features/instance/index-of.js");
|
|
18437
18478
|
function _isNativeFunction(fn) {
|
|
18438
|
-
|
|
18439
|
-
|
|
18479
|
+
try {
|
|
18480
|
+
var _context;
|
|
18481
|
+
return _indexOfInstanceProperty(_context = Function.toString.call(fn)).call(_context, "[native code]") !== -1;
|
|
18482
|
+
} catch (e) {
|
|
18483
|
+
return typeof fn === "function";
|
|
18484
|
+
}
|
|
18440
18485
|
}
|
|
18441
18486
|
module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
18442
18487
|
},{"core-js-pure/features/instance/index-of.js":220}],112:[function(_dereq_,module,exports){
|
|
@@ -27976,14 +28021,19 @@ module.exports = parent;
|
|
|
27976
28021
|
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
|
|
27977
28022
|
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
|
|
27978
28023
|
*/
|
|
27979
|
-
execute: function (password, keySize, ivSize, salt) {
|
|
28024
|
+
execute: function (password, keySize, ivSize, salt, hasher) {
|
|
27980
28025
|
// Generate random salt
|
|
27981
28026
|
if (!salt) {
|
|
27982
28027
|
salt = WordArray.random(64/8);
|
|
27983
28028
|
}
|
|
27984
28029
|
|
|
27985
28030
|
// Derive key and IV
|
|
27986
|
-
|
|
28031
|
+
if (!hasher) {
|
|
28032
|
+
var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
|
|
28033
|
+
} else {
|
|
28034
|
+
var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt);
|
|
28035
|
+
}
|
|
28036
|
+
|
|
27987
28037
|
|
|
27988
28038
|
// Separate key and IV
|
|
27989
28039
|
var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
|
|
@@ -28030,7 +28080,7 @@ module.exports = parent;
|
|
|
28030
28080
|
cfg = this.cfg.extend(cfg);
|
|
28031
28081
|
|
|
28032
28082
|
// Derive key and other params
|
|
28033
|
-
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
|
|
28083
|
+
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);
|
|
28034
28084
|
|
|
28035
28085
|
// Add IV to config
|
|
28036
28086
|
cfg.iv = derivedParams.iv;
|
|
@@ -28069,7 +28119,7 @@ module.exports = parent;
|
|
|
28069
28119
|
ciphertext = this._parse(ciphertext, cfg.format);
|
|
28070
28120
|
|
|
28071
28121
|
// Derive key and other params
|
|
28072
|
-
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
|
|
28122
|
+
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);
|
|
28073
28123
|
|
|
28074
28124
|
// Add IV to config
|
|
28075
28125
|
cfg.iv = derivedParams.iv;
|
|
@@ -29407,7 +29457,7 @@ module.exports = parent;
|
|
|
29407
29457
|
var M_offset_14 = M[offset + 14];
|
|
29408
29458
|
var M_offset_15 = M[offset + 15];
|
|
29409
29459
|
|
|
29410
|
-
// Working
|
|
29460
|
+
// Working variables
|
|
29411
29461
|
var a = H[0];
|
|
29412
29462
|
var b = H[1];
|
|
29413
29463
|
var c = H[2];
|
|
@@ -31085,7 +31135,7 @@ for (let i = 0; i < 256; ++i) {
|
|
|
31085
31135
|
function unsafeStringify(arr, offset = 0) {
|
|
31086
31136
|
// Note: Be careful editing this code! It's been tuned for performance
|
|
31087
31137
|
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
31088
|
-
return
|
|
31138
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
31089
31139
|
}
|
|
31090
31140
|
|
|
31091
31141
|
function stringify(arr, offset = 0) {
|