parse 5.1.0-alpha.9 → 5.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +243 -153
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +1108 -154
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +31 -1
- package/lib/browser/EventuallyQueue.js +1 -1
- package/lib/browser/ObjectStateMutations.js +3 -2
- package/lib/browser/ParseACL.js +21 -11
- package/lib/browser/ParseGeoPoint.js +12 -8
- package/lib/browser/ParseInstallation.js +1 -1
- package/lib/browser/ParseObject.js +74 -68
- package/lib/browser/ParseOp.js +21 -7
- package/lib/browser/ParseQuery.js +1 -0
- package/lib/browser/ParseRelation.js +12 -7
- package/lib/browser/ParseRole.js +2 -0
- package/lib/browser/ParseUser.js +1 -0
- package/lib/browser/SingleInstanceStateController.js +2 -4
- package/lib/browser/arrayContainsObject.js +4 -3
- package/lib/browser/canBeSerialized.js +6 -4
- package/lib/browser/decode.js +8 -5
- package/lib/browser/encode.js +6 -4
- package/lib/browser/equals.js +4 -3
- package/lib/browser/unique.js +3 -2
- package/lib/browser/unsavedChildren.js +4 -2
- package/lib/browser/uuid.js +11 -5
- package/lib/node/CoreManager.js +31 -1
- package/lib/node/EventuallyQueue.js +1 -1
- package/lib/node/ObjectStateMutations.js +3 -2
- package/lib/node/ParseACL.js +21 -11
- package/lib/node/ParseGeoPoint.js +11 -11
- package/lib/node/ParseInstallation.js +2 -2
- package/lib/node/ParseObject.js +68 -66
- package/lib/node/ParseOp.js +21 -7
- package/lib/node/ParseQuery.js +1 -0
- package/lib/node/ParseRelation.js +14 -8
- package/lib/node/ParseRole.js +2 -0
- package/lib/node/ParseUser.js +1 -0
- package/lib/node/SingleInstanceStateController.js +2 -8
- package/lib/node/arrayContainsObject.js +4 -3
- package/lib/node/canBeSerialized.js +6 -4
- package/lib/node/decode.js +9 -5
- package/lib/node/encode.js +7 -4
- package/lib/node/equals.js +4 -3
- package/lib/node/unique.js +3 -2
- package/lib/node/unsavedChildren.js +4 -2
- package/lib/node/uuid.js +10 -8
- package/lib/react-native/CoreManager.js +31 -1
- package/lib/react-native/ObjectStateMutations.js +3 -2
- package/lib/react-native/ParseACL.js +19 -11
- package/lib/react-native/ParseGeoPoint.js +5 -3
- package/lib/react-native/ParseObject.js +8 -6
- package/lib/react-native/ParseOp.js +20 -6
- package/lib/react-native/ParseQuery.js +1 -0
- package/lib/react-native/ParseRelation.js +10 -7
- package/lib/react-native/ParseRole.js +2 -0
- package/lib/react-native/ParseUser.js +1 -0
- package/lib/react-native/SingleInstanceStateController.js +0 -2
- package/lib/react-native/arrayContainsObject.js +3 -2
- package/lib/react-native/canBeSerialized.js +5 -3
- package/lib/react-native/decode.js +7 -5
- package/lib/react-native/encode.js +6 -4
- package/lib/react-native/equals.js +4 -3
- package/lib/react-native/unique.js +3 -2
- package/lib/react-native/unsavedChildren.js +3 -2
- package/lib/react-native/uuid.js +9 -4
- package/lib/weapp/CoreManager.js +31 -1
- package/lib/weapp/EventuallyQueue.js +1 -1
- package/lib/weapp/ObjectStateMutations.js +3 -2
- package/lib/weapp/ParseACL.js +21 -11
- package/lib/weapp/ParseGeoPoint.js +12 -8
- package/lib/weapp/ParseInstallation.js +1 -1
- package/lib/weapp/ParseObject.js +74 -68
- package/lib/weapp/ParseOp.js +21 -7
- package/lib/weapp/ParseQuery.js +1 -0
- package/lib/weapp/ParseRelation.js +12 -7
- package/lib/weapp/ParseRole.js +2 -0
- package/lib/weapp/ParseUser.js +1 -0
- package/lib/weapp/SingleInstanceStateController.js +2 -4
- package/lib/weapp/arrayContainsObject.js +4 -3
- package/lib/weapp/canBeSerialized.js +6 -4
- package/lib/weapp/decode.js +8 -5
- package/lib/weapp/encode.js +6 -4
- package/lib/weapp/equals.js +4 -3
- package/lib/weapp/unique.js +3 -2
- package/lib/weapp/unsavedChildren.js +4 -2
- package/lib/weapp/uuid.js +12 -5
- package/package.json +4 -1
package/dist/parse.weapp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parse JavaScript SDK v5.1.0-
|
|
2
|
+
* Parse JavaScript SDK v5.1.0-beta.1
|
|
3
3
|
*
|
|
4
4
|
* The source tree of this library can be found at
|
|
5
5
|
* https://github.com/ParsePlatform/Parse-SDK-JS
|
|
@@ -397,7 +397,7 @@ var config /*: Config & { [key: string]: any }*/ = {
|
|
|
397
397
|
SERVER_AUTH_TOKEN: null,
|
|
398
398
|
LIVEQUERY_SERVER_URL: null,
|
|
399
399
|
ENCRYPTED_KEY: null,
|
|
400
|
-
VERSION: 'js' + "5.1.0-
|
|
400
|
+
VERSION: 'js' + "5.1.0-beta.1",
|
|
401
401
|
APPLICATION_ID: null,
|
|
402
402
|
JAVASCRIPT_KEY: null,
|
|
403
403
|
MASTER_KEY: null,
|
|
@@ -599,6 +599,36 @@ var CoreManager = {
|
|
|
599
599
|
},
|
|
600
600
|
getHooksController: function () /*: HooksController*/{
|
|
601
601
|
return config['HooksController'];
|
|
602
|
+
},
|
|
603
|
+
setParseOp: function (op /*: typeof ParseOp*/) {
|
|
604
|
+
config['ParseOp'] = op;
|
|
605
|
+
},
|
|
606
|
+
getParseOp: function () {
|
|
607
|
+
return config['ParseOp'];
|
|
608
|
+
},
|
|
609
|
+
setParseObject: function (object /*: typeof ParseObject*/) {
|
|
610
|
+
config['ParseObject'] = object;
|
|
611
|
+
},
|
|
612
|
+
getParseObject: function () /*: ParseObject*/{
|
|
613
|
+
return config['ParseObject'];
|
|
614
|
+
},
|
|
615
|
+
setParseQuery: function (query /*: typeof ParseQuery*/) {
|
|
616
|
+
config['ParseQuery'] = query;
|
|
617
|
+
},
|
|
618
|
+
getParseQuery: function () /*: ParseQuery*/{
|
|
619
|
+
return config['ParseQuery'];
|
|
620
|
+
},
|
|
621
|
+
setParseRole: function (role /*: typeof ParseRole*/) {
|
|
622
|
+
config['ParseRole'] = role;
|
|
623
|
+
},
|
|
624
|
+
getParseRole: function () /*: ParseRole*/{
|
|
625
|
+
return config['ParseRole'];
|
|
626
|
+
},
|
|
627
|
+
setParseUser: function (user /*: typeof ParseUser*/) {
|
|
628
|
+
config['ParseUser'] = user;
|
|
629
|
+
},
|
|
630
|
+
getParseUser: function () /*: ParseUser*/{
|
|
631
|
+
return config['ParseUser'];
|
|
602
632
|
}
|
|
603
633
|
};
|
|
604
634
|
module.exports = CoreManager;
|
|
@@ -1096,7 +1126,7 @@ var EventuallyQueue = {
|
|
|
1096
1126
|
*/
|
|
1097
1127
|
poll: function () {
|
|
1098
1128
|
var _this7 = this;
|
|
1099
|
-
var ms
|
|
1129
|
+
var ms /*:: ?: number*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
|
|
1100
1130
|
if (polling) {
|
|
1101
1131
|
return;
|
|
1102
1132
|
}
|
|
@@ -3422,8 +3452,8 @@ var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/he
|
|
|
3422
3452
|
var _includes = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
3423
3453
|
var _stringify = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
3424
3454
|
var _encode = _interopRequireDefault(_dereq_("./encode"));
|
|
3455
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
3425
3456
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
3426
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
3427
3457
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
3428
3458
|
var _TaskQueue = _interopRequireDefault(_dereq_("./TaskQueue"));
|
|
3429
3459
|
var _ParseOp = _dereq_("./ParseOp");
|
|
@@ -3577,16 +3607,17 @@ function nestedSet(obj, key, value) {
|
|
|
3577
3607
|
}
|
|
3578
3608
|
}
|
|
3579
3609
|
function commitServerChanges(serverData /*: AttributeMap*/, objectCache /*: ObjectCache*/, changes /*: AttributeMap*/) {
|
|
3610
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
3580
3611
|
for (var _attr3 in changes) {
|
|
3581
3612
|
var val = changes[_attr3];
|
|
3582
3613
|
nestedSet(serverData, _attr3, val);
|
|
3583
|
-
if (val && (0, _typeof2.default)(val) === 'object' && !(val instanceof
|
|
3614
|
+
if (val && (0, _typeof2.default)(val) === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
|
|
3584
3615
|
var json = (0, _encode.default)(val, false, true);
|
|
3585
3616
|
objectCache[_attr3] = (0, _stringify.default)(json);
|
|
3586
3617
|
}
|
|
3587
3618
|
}
|
|
3588
3619
|
}
|
|
3589
|
-
},{"./
|
|
3620
|
+
},{"./CoreManager":4,"./ParseFile":24,"./ParseOp":29,"./ParseRelation":32,"./TaskQueue":44,"./encode":51,"@babel/runtime-corejs3/core-js-stable/instance/filter":66,"@babel/runtime-corejs3/core-js-stable/instance/for-each":69,"@babel/runtime-corejs3/core-js-stable/instance/includes":70,"@babel/runtime-corejs3/core-js-stable/json/stringify":80,"@babel/runtime-corejs3/core-js-stable/object/define-properties":85,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":89,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":90,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":91,"@babel/runtime-corejs3/core-js-stable/object/keys":93,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],18:[function(_dereq_,module,exports){
|
|
3590
3621
|
"use strict";
|
|
3591
3622
|
|
|
3592
3623
|
var _sliceInstanceProperty2 = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
@@ -4665,11 +4696,12 @@ var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/ty
|
|
|
4665
4696
|
var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
4666
4697
|
var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
|
|
4667
4698
|
var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
4668
|
-
var
|
|
4669
|
-
var _ParseUser = _interopRequireDefault(_dereq_("./ParseUser"));
|
|
4699
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
4670
4700
|
/**
|
|
4671
4701
|
* @flow
|
|
4672
4702
|
*/
|
|
4703
|
+
/*:: import type ParseRole from './ParseRole';*/
|
|
4704
|
+
/*:: import type ParseUser from './ParseUser';*/
|
|
4673
4705
|
/*:: type PermissionsMap = { [permission: string]: boolean };*/
|
|
4674
4706
|
/*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
|
|
4675
4707
|
var PUBLIC_KEY = '*';
|
|
@@ -4697,7 +4729,8 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4697
4729
|
(0, _defineProperty2.default)(this, "permissionsById", void 0);
|
|
4698
4730
|
this.permissionsById = {};
|
|
4699
4731
|
if (arg1 && (0, _typeof2.default)(arg1) === 'object') {
|
|
4700
|
-
|
|
4732
|
+
var _ParseUser = _CoreManager.default.getParseUser();
|
|
4733
|
+
if (arg1 instanceof _ParseUser) {
|
|
4701
4734
|
this.setReadAccess(arg1, true);
|
|
4702
4735
|
this.setWriteAccess(arg1, true);
|
|
4703
4736
|
} else {
|
|
@@ -4769,9 +4802,11 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4769
4802
|
}, {
|
|
4770
4803
|
key: "_setAccess",
|
|
4771
4804
|
value: function (accessType /*: string*/, userId /*: ParseUser | ParseRole | string*/, allowed /*: boolean*/) {
|
|
4772
|
-
|
|
4805
|
+
var ParseRole = _CoreManager.default.getParseRole();
|
|
4806
|
+
var ParseUser = _CoreManager.default.getParseUser();
|
|
4807
|
+
if (userId instanceof ParseUser) {
|
|
4773
4808
|
userId = userId.id;
|
|
4774
|
-
} else if (userId instanceof
|
|
4809
|
+
} else if (userId instanceof ParseRole) {
|
|
4775
4810
|
var name = userId.getName();
|
|
4776
4811
|
if (!name) {
|
|
4777
4812
|
throw new TypeError('Role must have a name');
|
|
@@ -4806,12 +4841,14 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4806
4841
|
}, {
|
|
4807
4842
|
key: "_getAccess",
|
|
4808
4843
|
value: function (accessType /*: string*/, userId /*: ParseUser | ParseRole | string*/) /*: boolean*/{
|
|
4809
|
-
|
|
4844
|
+
var ParseRole = _CoreManager.default.getParseRole();
|
|
4845
|
+
var ParseUser = _CoreManager.default.getParseUser();
|
|
4846
|
+
if (userId instanceof ParseUser) {
|
|
4810
4847
|
userId = userId.id;
|
|
4811
4848
|
if (!userId) {
|
|
4812
4849
|
throw new Error('Cannot get access for a ParseUser without an ID');
|
|
4813
4850
|
}
|
|
4814
|
-
} else if (userId instanceof
|
|
4851
|
+
} else if (userId instanceof ParseRole) {
|
|
4815
4852
|
var name = userId.getName();
|
|
4816
4853
|
if (!name) {
|
|
4817
4854
|
throw new TypeError('Role must have a name');
|
|
@@ -4935,7 +4972,8 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4935
4972
|
}, {
|
|
4936
4973
|
key: "getRoleReadAccess",
|
|
4937
4974
|
value: function (role /*: ParseRole | string*/) /*: boolean*/{
|
|
4938
|
-
|
|
4975
|
+
var ParseRole = _CoreManager.default.getParseRole();
|
|
4976
|
+
if (role instanceof ParseRole) {
|
|
4939
4977
|
// Normalize to the String name
|
|
4940
4978
|
role = role.getName();
|
|
4941
4979
|
}
|
|
@@ -4957,7 +4995,8 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4957
4995
|
}, {
|
|
4958
4996
|
key: "getRoleWriteAccess",
|
|
4959
4997
|
value: function (role /*: ParseRole | string*/) /*: boolean*/{
|
|
4960
|
-
|
|
4998
|
+
var ParseRole = _CoreManager.default.getParseRole();
|
|
4999
|
+
if (role instanceof ParseRole) {
|
|
4961
5000
|
// Normalize to the String name
|
|
4962
5001
|
role = role.getName();
|
|
4963
5002
|
}
|
|
@@ -4978,7 +5017,8 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4978
5017
|
}, {
|
|
4979
5018
|
key: "setRoleReadAccess",
|
|
4980
5019
|
value: function (role /*: ParseRole | string*/, allowed /*: boolean*/) {
|
|
4981
|
-
|
|
5020
|
+
var ParseRole = _CoreManager.default.getParseRole();
|
|
5021
|
+
if (role instanceof ParseRole) {
|
|
4982
5022
|
// Normalize to the String name
|
|
4983
5023
|
role = role.getName();
|
|
4984
5024
|
}
|
|
@@ -4999,7 +5039,8 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
4999
5039
|
}, {
|
|
5000
5040
|
key: "setRoleWriteAccess",
|
|
5001
5041
|
value: function (role /*: ParseRole | string*/, allowed /*: boolean*/) {
|
|
5002
|
-
|
|
5042
|
+
var ParseRole = _CoreManager.default.getParseRole();
|
|
5043
|
+
if (role instanceof ParseRole) {
|
|
5003
5044
|
// Normalize to the String name
|
|
5004
5045
|
role = role.getName();
|
|
5005
5046
|
}
|
|
@@ -5013,7 +5054,7 @@ var ParseACL = /*#__PURE__*/function () {
|
|
|
5013
5054
|
}();
|
|
5014
5055
|
var _default = ParseACL;
|
|
5015
5056
|
exports.default = _default;
|
|
5016
|
-
},{"./
|
|
5057
|
+
},{"./CoreManager":4,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/object/keys":93,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],21:[function(_dereq_,module,exports){
|
|
5017
5058
|
"use strict";
|
|
5018
5059
|
|
|
5019
5060
|
var _sliceInstanceProperty2 = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
@@ -7305,13 +7346,11 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
7305
7346
|
});
|
|
7306
7347
|
exports.default = void 0;
|
|
7307
7348
|
var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
7349
|
+
var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
7308
7350
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
7309
7351
|
var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
7310
7352
|
var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
|
|
7311
7353
|
var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
7312
|
-
/**
|
|
7313
|
-
* @flow
|
|
7314
|
-
*/
|
|
7315
7354
|
/**
|
|
7316
7355
|
* Creates a new GeoPoint with any of the following forms:<br>
|
|
7317
7356
|
* <pre>
|
|
@@ -7414,7 +7453,7 @@ var ParseGeoPoint = /*#__PURE__*/function () {
|
|
|
7414
7453
|
}
|
|
7415
7454
|
}, {
|
|
7416
7455
|
key: "equals",
|
|
7417
|
-
value: function (other /*:
|
|
7456
|
+
value: function (other /*: any*/) /*: boolean*/{
|
|
7418
7457
|
return other instanceof ParseGeoPoint && this.latitude === other.latitude && this.longitude === other.longitude;
|
|
7419
7458
|
}
|
|
7420
7459
|
|
|
@@ -7490,14 +7529,20 @@ var ParseGeoPoint = /*#__PURE__*/function () {
|
|
|
7490
7529
|
/**
|
|
7491
7530
|
* Creates a GeoPoint with the user's current location, if available.
|
|
7492
7531
|
*
|
|
7532
|
+
* @param {object} options The options.
|
|
7533
|
+
* @param {boolean} [options.enableHighAccuracy=false] A boolean value that indicates the application would like to receive the best possible results. If true and if the device is able to provide a more accurate position, it will do so. Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile device for example). On the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. Default: false.
|
|
7534
|
+
* @param {number} [options.timeout=Infinity] A positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. The default value is Infinity, meaning that getCurrentPosition() won't return until the position is available.
|
|
7535
|
+
* @param {number} [options.maximumAge=0] A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to Infinity the device must return a cached position regardless of its age. Default: 0.
|
|
7493
7536
|
* @static
|
|
7494
|
-
* @returns {Parse.GeoPoint} User's current location
|
|
7537
|
+
* @returns {Promise<Parse.GeoPoint>} User's current location
|
|
7495
7538
|
*/
|
|
7496
7539
|
}, {
|
|
7497
7540
|
key: "current",
|
|
7498
|
-
value: function () {
|
|
7499
|
-
return
|
|
7500
|
-
|
|
7541
|
+
value: function (options) /*: Promise<ParseGeoPoint>*/{
|
|
7542
|
+
return new _promise.default(function (resolve, reject) {
|
|
7543
|
+
navigator.geolocation.getCurrentPosition(function (location) {
|
|
7544
|
+
resolve(new ParseGeoPoint(location.coords.latitude, location.coords.longitude));
|
|
7545
|
+
}, reject, options);
|
|
7501
7546
|
});
|
|
7502
7547
|
}
|
|
7503
7548
|
}]);
|
|
@@ -7505,7 +7550,7 @@ var ParseGeoPoint = /*#__PURE__*/function () {
|
|
|
7505
7550
|
}();
|
|
7506
7551
|
var _default = ParseGeoPoint;
|
|
7507
7552
|
exports.default = _default;
|
|
7508
|
-
},{"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],26:[function(_dereq_,module,exports){
|
|
7553
|
+
},{"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/promise":95,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],26:[function(_dereq_,module,exports){
|
|
7509
7554
|
"use strict";
|
|
7510
7555
|
|
|
7511
7556
|
var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
@@ -7759,7 +7804,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
7759
7804
|
* Parse.Installation.DEVICE_TYPES.WEB
|
|
7760
7805
|
* </pre
|
|
7761
7806
|
*
|
|
7762
|
-
* @property {
|
|
7807
|
+
* @property {object} DEVICE_TYPES
|
|
7763
7808
|
* @static
|
|
7764
7809
|
*/
|
|
7765
7810
|
}, {
|
|
@@ -8097,8 +8142,8 @@ var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
|
|
|
8097
8142
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
8098
8143
|
var _promiseUtils = _dereq_("./promiseUtils");
|
|
8099
8144
|
var _LocalDatastoreUtils = _dereq_("./LocalDatastoreUtils");
|
|
8145
|
+
var _uuid = _interopRequireDefault(_dereq_("./uuid"));
|
|
8100
8146
|
var _ParseOp = _dereq_("./ParseOp");
|
|
8101
|
-
var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
8102
8147
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
8103
8148
|
var SingleInstanceStateController = _interopRequireWildcard(_dereq_("./SingleInstanceStateController"));
|
|
8104
8149
|
var _unique = _interopRequireDefault(_dereq_("./unique"));
|
|
@@ -8228,25 +8273,17 @@ function _objectSpread(target) {
|
|
|
8228
8273
|
});
|
|
8229
8274
|
}
|
|
8230
8275
|
return target;
|
|
8231
|
-
}
|
|
8232
|
-
* @flow
|
|
8233
|
-
*/
|
|
8234
|
-
/*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
|
|
8235
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
8236
|
-
var uuidv4 = _dereq_('./uuid');
|
|
8276
|
+
}
|
|
8237
8277
|
/*:: export type Pointer = {
|
|
8238
8278
|
__type: string,
|
|
8239
8279
|
className: string,
|
|
8240
|
-
objectId
|
|
8241
|
-
|
|
8242
|
-
/*:: type SaveParams = {
|
|
8243
|
-
method: string,
|
|
8244
|
-
path: string,
|
|
8245
|
-
body: AttributeMap,
|
|
8280
|
+
objectId?: string,
|
|
8281
|
+
_localId?: string,
|
|
8246
8282
|
};*/
|
|
8247
8283
|
/*:: export type SaveOptions = FullOptions & {
|
|
8248
8284
|
cascadeSave?: boolean,
|
|
8249
8285
|
context?: AttributeMap,
|
|
8286
|
+
batchSize?: number,
|
|
8250
8287
|
};*/
|
|
8251
8288
|
// Mapping of class names to constructors, so we can populate objects from the
|
|
8252
8289
|
// server with appropriate subclasses of ParseObject
|
|
@@ -8296,7 +8333,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8296
8333
|
* @param {object} attributes The initial set of data to store in the object.
|
|
8297
8334
|
* @param {object} options The options for this object instance.
|
|
8298
8335
|
*/
|
|
8299
|
-
function ParseObject(className
|
|
8336
|
+
function ParseObject(className /*:: ?: string | { className: string, [attr: string]: any }*/, attributes /*:: ?: { [attr: string]: any }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
|
|
8300
8337
|
(0, _classCallCheck2.default)(this, ParseObject);
|
|
8301
8338
|
/**
|
|
8302
8339
|
* The ID of this object, unique within its class.
|
|
@@ -8351,7 +8388,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8351
8388
|
*/
|
|
8352
8389
|
}, {
|
|
8353
8390
|
key: "createdAt",
|
|
8354
|
-
get: function () /*:
|
|
8391
|
+
get: function () /*: Date | undefined*/{
|
|
8355
8392
|
return this._getServerData().createdAt;
|
|
8356
8393
|
}
|
|
8357
8394
|
|
|
@@ -8363,7 +8400,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8363
8400
|
*/
|
|
8364
8401
|
}, {
|
|
8365
8402
|
key: "updatedAt",
|
|
8366
|
-
get: function () /*:
|
|
8403
|
+
get: function () /*: Date | undefined*/{
|
|
8367
8404
|
return this._getServerData().updatedAt;
|
|
8368
8405
|
}
|
|
8369
8406
|
|
|
@@ -8383,7 +8420,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8383
8420
|
if (typeof this._localId === 'string') {
|
|
8384
8421
|
return this._localId;
|
|
8385
8422
|
}
|
|
8386
|
-
var localId = 'local' +
|
|
8423
|
+
var localId = 'local' + (0, _uuid.default)();
|
|
8387
8424
|
this._localId = localId;
|
|
8388
8425
|
return localId;
|
|
8389
8426
|
}
|
|
@@ -8477,7 +8514,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8477
8514
|
}, {
|
|
8478
8515
|
key: "_toFullJSON",
|
|
8479
8516
|
value: function (seen /*:: ?: Array<any>*/, offline /*:: ?: boolean*/) /*: AttributeMap*/{
|
|
8480
|
-
var json /*: { [key: string]:
|
|
8517
|
+
var json /*: { [key: string]: any }*/ = this.toJSON(seen, offline);
|
|
8481
8518
|
json.__type = 'Object';
|
|
8482
8519
|
json.className = this.className;
|
|
8483
8520
|
return json;
|
|
@@ -8544,7 +8581,13 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8544
8581
|
}
|
|
8545
8582
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
8546
8583
|
stateController.initializeState(this._getStateIdentifier());
|
|
8547
|
-
var decoded
|
|
8584
|
+
var decoded
|
|
8585
|
+
/*: Partial<{
|
|
8586
|
+
createdAt?: Date,
|
|
8587
|
+
updatedAt?: Date,
|
|
8588
|
+
ACL?: any,
|
|
8589
|
+
[key: string]: any,
|
|
8590
|
+
}>*/ = {};
|
|
8548
8591
|
for (var _attr4 in serverData) {
|
|
8549
8592
|
if (_attr4 === 'ACL') {
|
|
8550
8593
|
decoded[_attr4] = new _ParseACL.default(serverData[_attr4]);
|
|
@@ -8596,7 +8639,12 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8596
8639
|
}, {
|
|
8597
8640
|
key: "_handleSaveResponse",
|
|
8598
8641
|
value: function (response /*: AttributeMap*/, status /*: number*/) {
|
|
8599
|
-
var changes
|
|
8642
|
+
var changes
|
|
8643
|
+
/*: Partial<{
|
|
8644
|
+
createdAt: string,
|
|
8645
|
+
updatedAt: string,
|
|
8646
|
+
[key: string]: any
|
|
8647
|
+
}>*/ = {};
|
|
8600
8648
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
8601
8649
|
var pending = stateController.popPendingState(this._getStateIdentifier());
|
|
8602
8650
|
for (var attr in pending) {
|
|
@@ -8659,7 +8707,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8659
8707
|
value: function (seen /*: Array<any> | void*/, offline /*:: ?: boolean*/) /*: AttributeMap*/{
|
|
8660
8708
|
var seenEntry = this.id ? this.className + ':' + this.id : this;
|
|
8661
8709
|
seen = seen || [seenEntry];
|
|
8662
|
-
var json = {};
|
|
8710
|
+
var json /*: AttributeMap*/ = {};
|
|
8663
8711
|
var attrs = this.attributes;
|
|
8664
8712
|
for (var _attr5 in attrs) {
|
|
8665
8713
|
if ((_attr5 === 'createdAt' || _attr5 === 'updatedAt') && attrs[_attr5].toJSON) {
|
|
@@ -8682,7 +8730,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8682
8730
|
*/
|
|
8683
8731
|
}, {
|
|
8684
8732
|
key: "equals",
|
|
8685
|
-
value: function (other /*:
|
|
8733
|
+
value: function (other /*: any*/) /*: boolean*/{
|
|
8686
8734
|
if (this === other) {
|
|
8687
8735
|
return true;
|
|
8688
8736
|
}
|
|
@@ -8803,7 +8851,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8803
8851
|
*/
|
|
8804
8852
|
}, {
|
|
8805
8853
|
key: "get",
|
|
8806
|
-
value: function (attr /*: string*/) /*:
|
|
8854
|
+
value: function (attr /*: string*/) /*: any*/{
|
|
8807
8855
|
return this.attributes[attr];
|
|
8808
8856
|
}
|
|
8809
8857
|
|
|
@@ -8898,7 +8946,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8898
8946
|
*/
|
|
8899
8947
|
}, {
|
|
8900
8948
|
key: "set",
|
|
8901
|
-
value: function (key /*:
|
|
8949
|
+
value: function (key /*: any*/, value /*:: ?: any*/, options /*:: ?: any*/) /*: ParseObject | boolean*/{
|
|
8902
8950
|
var changes = {};
|
|
8903
8951
|
var newOps = {};
|
|
8904
8952
|
if (key && (0, _typeof2.default)(key) === 'object') {
|
|
@@ -8987,7 +9035,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
8987
9035
|
*/
|
|
8988
9036
|
}, {
|
|
8989
9037
|
key: "unset",
|
|
8990
|
-
value: function (attr /*: string*/, options /*:: ?: { [opt: string]:
|
|
9038
|
+
value: function (attr /*: string*/, options /*:: ?: { [opt: string]: any }*/) /*: ParseObject | boolean*/{
|
|
8991
9039
|
options = options || {};
|
|
8992
9040
|
options.unset = true;
|
|
8993
9041
|
return this.set(attr, null, options);
|
|
@@ -9043,7 +9091,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9043
9091
|
*/
|
|
9044
9092
|
}, {
|
|
9045
9093
|
key: "add",
|
|
9046
|
-
value: function (attr /*: string*/, item /*:
|
|
9094
|
+
value: function (attr /*: string*/, item /*: any*/) /*: ParseObject | boolean*/{
|
|
9047
9095
|
return this.set(attr, new _ParseOp.AddOp([item]));
|
|
9048
9096
|
}
|
|
9049
9097
|
|
|
@@ -9057,7 +9105,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9057
9105
|
*/
|
|
9058
9106
|
}, {
|
|
9059
9107
|
key: "addAll",
|
|
9060
|
-
value: function (attr /*: string*/, items /*: Array<
|
|
9108
|
+
value: function (attr /*: string*/, items /*: Array<any>*/) /*: ParseObject | boolean*/{
|
|
9061
9109
|
return this.set(attr, new _ParseOp.AddOp(items));
|
|
9062
9110
|
}
|
|
9063
9111
|
|
|
@@ -9072,7 +9120,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9072
9120
|
*/
|
|
9073
9121
|
}, {
|
|
9074
9122
|
key: "addUnique",
|
|
9075
|
-
value: function (attr /*: string*/, item /*:
|
|
9123
|
+
value: function (attr /*: string*/, item /*: any*/) /*: ParseObject | boolean*/{
|
|
9076
9124
|
return this.set(attr, new _ParseOp.AddUniqueOp([item]));
|
|
9077
9125
|
}
|
|
9078
9126
|
|
|
@@ -9087,7 +9135,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9087
9135
|
*/
|
|
9088
9136
|
}, {
|
|
9089
9137
|
key: "addAllUnique",
|
|
9090
|
-
value: function (attr /*: string*/, items /*: Array<
|
|
9138
|
+
value: function (attr /*: string*/, items /*: Array<any>*/) /*: ParseObject | boolean*/{
|
|
9091
9139
|
return this.set(attr, new _ParseOp.AddUniqueOp(items));
|
|
9092
9140
|
}
|
|
9093
9141
|
|
|
@@ -9101,7 +9149,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9101
9149
|
*/
|
|
9102
9150
|
}, {
|
|
9103
9151
|
key: "remove",
|
|
9104
|
-
value: function (attr /*: string*/, item /*:
|
|
9152
|
+
value: function (attr /*: string*/, item /*: any*/) /*: ParseObject | boolean*/{
|
|
9105
9153
|
return this.set(attr, new _ParseOp.RemoveOp([item]));
|
|
9106
9154
|
}
|
|
9107
9155
|
|
|
@@ -9115,7 +9163,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9115
9163
|
*/
|
|
9116
9164
|
}, {
|
|
9117
9165
|
key: "removeAll",
|
|
9118
|
-
value: function (attr /*: string*/, items /*: Array<
|
|
9166
|
+
value: function (attr /*: string*/, items /*: Array<any>*/) /*: ParseObject | boolean*/{
|
|
9119
9167
|
return this.set(attr, new _ParseOp.RemoveOp(items));
|
|
9120
9168
|
}
|
|
9121
9169
|
|
|
@@ -9130,7 +9178,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9130
9178
|
*/
|
|
9131
9179
|
}, {
|
|
9132
9180
|
key: "op",
|
|
9133
|
-
value: function (attr /*: string*/) /*:
|
|
9181
|
+
value: function (attr /*: string*/) /*: Op | undefined*/{
|
|
9134
9182
|
var pending = this._getPendingOps();
|
|
9135
9183
|
for (var i = pending.length; i--;) {
|
|
9136
9184
|
if (pending[i][attr]) {
|
|
@@ -9236,7 +9284,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9236
9284
|
key: "exists",
|
|
9237
9285
|
value: function () {
|
|
9238
9286
|
var _exists = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options /*:: ?: RequestOptions*/) {
|
|
9239
|
-
var query;
|
|
9287
|
+
var ParseQuery, query;
|
|
9240
9288
|
return _regenerator.default.wrap(function (_context) {
|
|
9241
9289
|
while (1) switch (_context.prev = _context.next) {
|
|
9242
9290
|
case 0:
|
|
@@ -9247,26 +9295,27 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9247
9295
|
return _context.abrupt("return", false);
|
|
9248
9296
|
case 2:
|
|
9249
9297
|
_context.prev = 2;
|
|
9250
|
-
|
|
9251
|
-
|
|
9298
|
+
ParseQuery = _CoreManager.default.getParseQuery();
|
|
9299
|
+
query = new ParseQuery(this.className);
|
|
9300
|
+
_context.next = 7;
|
|
9252
9301
|
return query.get(this.id, options);
|
|
9253
|
-
case
|
|
9302
|
+
case 7:
|
|
9254
9303
|
return _context.abrupt("return", true);
|
|
9255
|
-
case
|
|
9256
|
-
_context.prev =
|
|
9304
|
+
case 10:
|
|
9305
|
+
_context.prev = 10;
|
|
9257
9306
|
_context.t0 = _context["catch"](2);
|
|
9258
9307
|
if (!(_context.t0.code === _ParseError.default.OBJECT_NOT_FOUND)) {
|
|
9259
|
-
_context.next =
|
|
9308
|
+
_context.next = 14;
|
|
9260
9309
|
break;
|
|
9261
9310
|
}
|
|
9262
9311
|
return _context.abrupt("return", false);
|
|
9263
|
-
case 13:
|
|
9264
|
-
throw _context.t0;
|
|
9265
9312
|
case 14:
|
|
9313
|
+
throw _context.t0;
|
|
9314
|
+
case 15:
|
|
9266
9315
|
case "end":
|
|
9267
9316
|
return _context.stop();
|
|
9268
9317
|
}
|
|
9269
|
-
}, _callee, this, [[2,
|
|
9318
|
+
}, _callee, this, [[2, 10]]);
|
|
9270
9319
|
}));
|
|
9271
9320
|
function exists() {
|
|
9272
9321
|
return _exists.apply(this, arguments);
|
|
@@ -9316,7 +9365,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9316
9365
|
*/
|
|
9317
9366
|
}, {
|
|
9318
9367
|
key: "getACL",
|
|
9319
|
-
value: function () /*:
|
|
9368
|
+
value: function () /*: ParseACL | null*/{
|
|
9320
9369
|
var acl = this.get('ACL');
|
|
9321
9370
|
if (acl instanceof _ParseACL.default) {
|
|
9322
9371
|
return acl;
|
|
@@ -9334,7 +9383,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9334
9383
|
*/
|
|
9335
9384
|
}, {
|
|
9336
9385
|
key: "setACL",
|
|
9337
|
-
value: function (acl /*: ParseACL*/, options /*:: ?:
|
|
9386
|
+
value: function (acl /*: ParseACL*/, options /*:: ?: any*/) /*: ParseObject | boolean*/{
|
|
9338
9387
|
return this.set('ACL', acl, options);
|
|
9339
9388
|
}
|
|
9340
9389
|
|
|
@@ -9415,9 +9464,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9415
9464
|
*/
|
|
9416
9465
|
}, {
|
|
9417
9466
|
key: "fetch",
|
|
9418
|
-
value: function (options /*:
|
|
9467
|
+
value: function (options /*: FetchOptions*/) /*: Promise<any>*/{
|
|
9419
9468
|
options = options || {};
|
|
9420
|
-
var fetchOptions = {};
|
|
9469
|
+
var fetchOptions /*: FetchOptions*/ = {};
|
|
9421
9470
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
9422
9471
|
fetchOptions.useMasterKey = options.useMasterKey;
|
|
9423
9472
|
}
|
|
@@ -9467,7 +9516,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9467
9516
|
*/
|
|
9468
9517
|
}, {
|
|
9469
9518
|
key: "fetchWithInclude",
|
|
9470
|
-
value: function (keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise
|
|
9519
|
+
value: function (keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise<any>*/{
|
|
9471
9520
|
options = options || {};
|
|
9472
9521
|
options.include = keys;
|
|
9473
9522
|
return this.fetch(options);
|
|
@@ -9599,7 +9648,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9599
9648
|
*/
|
|
9600
9649
|
}, {
|
|
9601
9650
|
key: "save",
|
|
9602
|
-
value: function (arg1 /*:
|
|
9651
|
+
value: function (arg1 /*: undefined | string | { [attr: string]: any } | null*/, arg2 /*: SaveOptions | any*/, arg3 /*:: ?: SaveOptions*/) /*: Promise<this>*/{
|
|
9603
9652
|
var _this = this;
|
|
9604
9653
|
var attrs;
|
|
9605
9654
|
var options;
|
|
@@ -9624,7 +9673,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9624
9673
|
return _promise.default.reject(validationError);
|
|
9625
9674
|
}
|
|
9626
9675
|
}
|
|
9627
|
-
var saveOptions = {};
|
|
9676
|
+
var saveOptions /*: SaveOptions*/ = {};
|
|
9628
9677
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
9629
9678
|
saveOptions.useMasterKey = !!options.useMasterKey;
|
|
9630
9679
|
}
|
|
@@ -9719,9 +9768,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9719
9768
|
*/
|
|
9720
9769
|
}, {
|
|
9721
9770
|
key: "destroy",
|
|
9722
|
-
value: function (options /*: RequestOptions*/) /*: Promise
|
|
9771
|
+
value: function (options /*: RequestOptions*/) /*: Promise<void | ParseObject>*/{
|
|
9723
9772
|
options = options || {};
|
|
9724
|
-
var destroyOptions = {};
|
|
9773
|
+
var destroyOptions /*: RequestOptions*/ = {};
|
|
9725
9774
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
9726
9775
|
destroyOptions.useMasterKey = options.useMasterKey;
|
|
9727
9776
|
}
|
|
@@ -9948,7 +9997,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
9948
9997
|
key: "fetchAll",
|
|
9949
9998
|
value: function (list /*: Array<ParseObject>*/) {
|
|
9950
9999
|
var options /*: RequestOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9951
|
-
var queryOptions = {};
|
|
10000
|
+
var queryOptions /*: RequestOptions*/ = {};
|
|
9952
10001
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
9953
10002
|
queryOptions.useMasterKey = options.useMasterKey;
|
|
9954
10003
|
}
|
|
@@ -10056,9 +10105,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10056
10105
|
*/
|
|
10057
10106
|
}, {
|
|
10058
10107
|
key: "fetchAllIfNeeded",
|
|
10059
|
-
value: function (list /*: Array<ParseObject>*/, options) {
|
|
10108
|
+
value: function (list /*: Array<ParseObject>*/, options /*: FetchOptions*/) {
|
|
10060
10109
|
options = options || {};
|
|
10061
|
-
var queryOptions = {};
|
|
10110
|
+
var queryOptions /*: FetchOptions*/ = {};
|
|
10062
10111
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
10063
10112
|
queryOptions.useMasterKey = options.useMasterKey;
|
|
10064
10113
|
}
|
|
@@ -10072,7 +10121,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10072
10121
|
}
|
|
10073
10122
|
}, {
|
|
10074
10123
|
key: "handleIncludeOptions",
|
|
10075
|
-
value: function (options) {
|
|
10124
|
+
value: function (options /*: { include?: string | string[] }*/) {
|
|
10076
10125
|
var include = [];
|
|
10077
10126
|
if ((0, _isArray.default)(options.include)) {
|
|
10078
10127
|
var _context8;
|
|
@@ -10138,8 +10187,8 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10138
10187
|
}, {
|
|
10139
10188
|
key: "destroyAll",
|
|
10140
10189
|
value: function (list /*: Array<ParseObject>*/) {
|
|
10141
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10142
|
-
var destroyOptions = {};
|
|
10190
|
+
var options /*: SaveOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10191
|
+
var destroyOptions /*: SaveOptions*/ = {};
|
|
10143
10192
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
10144
10193
|
destroyOptions.useMasterKey = options.useMasterKey;
|
|
10145
10194
|
}
|
|
@@ -10176,8 +10225,8 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10176
10225
|
}, {
|
|
10177
10226
|
key: "saveAll",
|
|
10178
10227
|
value: function (list /*: Array<ParseObject>*/) {
|
|
10179
|
-
var options /*:
|
|
10180
|
-
var saveOptions = {};
|
|
10228
|
+
var options /*: SaveOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10229
|
+
var saveOptions /*: SaveOptions*/ = {};
|
|
10181
10230
|
if (options.hasOwnProperty('useMasterKey')) {
|
|
10182
10231
|
saveOptions.useMasterKey = options.useMasterKey;
|
|
10183
10232
|
}
|
|
@@ -10209,7 +10258,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10209
10258
|
*/
|
|
10210
10259
|
}, {
|
|
10211
10260
|
key: "createWithoutData",
|
|
10212
|
-
value: function (id /*: string*/) {
|
|
10261
|
+
value: function (id /*: string*/) /*: ParseObject*/{
|
|
10213
10262
|
var obj = new this();
|
|
10214
10263
|
obj.id = id;
|
|
10215
10264
|
return obj;
|
|
@@ -10227,13 +10276,13 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10227
10276
|
*/
|
|
10228
10277
|
}, {
|
|
10229
10278
|
key: "fromJSON",
|
|
10230
|
-
value: function (json /*: any*/, override /*:: ?: boolean*/, dirty /*:: ?: boolean*/) {
|
|
10279
|
+
value: function (json /*: any*/, override /*:: ?: boolean*/, dirty /*:: ?: boolean*/) /*: ParseObject*/{
|
|
10231
10280
|
if (!json.className) {
|
|
10232
10281
|
throw new Error('Cannot create an object without a className');
|
|
10233
10282
|
}
|
|
10234
10283
|
var constructor = classMap[json.className];
|
|
10235
10284
|
var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
|
|
10236
|
-
var otherAttributes = {};
|
|
10285
|
+
var otherAttributes /*: AttributeMap*/ = {};
|
|
10237
10286
|
for (var _attr11 in json) {
|
|
10238
10287
|
if (_attr11 !== 'className' && _attr11 !== '__type') {
|
|
10239
10288
|
otherAttributes[_attr11] = json[_attr11];
|
|
@@ -10620,7 +10669,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
10620
10669
|
return ParseObject;
|
|
10621
10670
|
}();
|
|
10622
10671
|
var DefaultController = {
|
|
10623
|
-
fetch: function (target /*: ParseObject | Array<ParseObject>*/, forceFetch /*: boolean*/, options /*: RequestOptions*/) /*: Promise<Array<
|
|
10672
|
+
fetch: function (target /*: ParseObject | Array<ParseObject>*/, forceFetch /*: boolean*/, options /*: RequestOptions*/) /*: Promise<Array<ParseObject | undefined> | ParseObject | undefined>*/{
|
|
10624
10673
|
var localDatastore = _CoreManager.default.getLocalDatastore();
|
|
10625
10674
|
if ((0, _isArray.default)(target)) {
|
|
10626
10675
|
if (target.length < 1) {
|
|
@@ -10653,7 +10702,8 @@ var DefaultController = {
|
|
|
10653
10702
|
if (error) {
|
|
10654
10703
|
return _promise.default.reject(error);
|
|
10655
10704
|
}
|
|
10656
|
-
var
|
|
10705
|
+
var ParseQuery = _CoreManager.default.getParseQuery();
|
|
10706
|
+
var query = new ParseQuery(className);
|
|
10657
10707
|
query.containedIn('objectId', ids);
|
|
10658
10708
|
if (options && options.include) {
|
|
10659
10709
|
query.include(options.include);
|
|
@@ -10731,7 +10781,7 @@ var DefaultController = {
|
|
|
10731
10781
|
return _promise.default.reject(new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'Object does not have an ID'));
|
|
10732
10782
|
}
|
|
10733
10783
|
var RESTController = _CoreManager.default.getRESTController();
|
|
10734
|
-
var params = {};
|
|
10784
|
+
var params /*: RequestOptions*/ = {};
|
|
10735
10785
|
if (options && options.include) {
|
|
10736
10786
|
params.include = options.include.join();
|
|
10737
10787
|
}
|
|
@@ -10758,9 +10808,9 @@ var DefaultController = {
|
|
|
10758
10808
|
};
|
|
10759
10809
|
}());
|
|
10760
10810
|
}
|
|
10761
|
-
return _promise.default.resolve();
|
|
10811
|
+
return _promise.default.resolve(undefined);
|
|
10762
10812
|
},
|
|
10763
|
-
destroy: function (target /*: ParseObject | Array<ParseObject>*/, options /*: RequestOptions*/) /*: Promise<
|
|
10813
|
+
destroy: function (target /*: ParseObject | Array<ParseObject>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject>>*/{
|
|
10764
10814
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
10765
10815
|
var batchSize, localDatastore, RESTController, batches, deleteCompleted, errors;
|
|
10766
10816
|
return _regenerator.default.wrap(function (_context14) {
|
|
@@ -10890,7 +10940,7 @@ var DefaultController = {
|
|
|
10890
10940
|
}, _callee10);
|
|
10891
10941
|
}))();
|
|
10892
10942
|
},
|
|
10893
|
-
save: function (target /*: ParseObject | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) {
|
|
10943
|
+
save: function (target /*: ParseObject | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject> | ParseFile>*/{
|
|
10894
10944
|
var batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');
|
|
10895
10945
|
var localDatastore = _CoreManager.default.getLocalDatastore();
|
|
10896
10946
|
var mapIdForPin = {};
|
|
@@ -11085,10 +11135,11 @@ var DefaultController = {
|
|
|
11085
11135
|
return _promise.default.resolve();
|
|
11086
11136
|
}
|
|
11087
11137
|
};
|
|
11138
|
+
_CoreManager.default.setParseObject(ParseObject);
|
|
11088
11139
|
_CoreManager.default.setObjectController(DefaultController);
|
|
11089
11140
|
var _default = ParseObject;
|
|
11090
11141
|
exports.default = _default;
|
|
11091
|
-
},{"./CoreManager":4,"./LocalDatastoreUtils":16,"./ParseACL":20,"./ParseError":23,"./ParseFile":24,"./ParseOp":29,"./
|
|
11142
|
+
},{"./CoreManager":4,"./LocalDatastoreUtils":16,"./ParseACL":20,"./ParseError":23,"./ParseFile":24,"./ParseOp":29,"./ParseRelation":32,"./SingleInstanceStateController":39,"./UniqueInstanceStateController":45,"./canBeSerialized":49,"./decode":50,"./encode":51,"./escape":53,"./parseDate":55,"./promiseUtils":56,"./unique":57,"./unsavedChildren":58,"./uuid":59,"@babel/runtime-corejs3/core-js-stable/array/from":60,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/instance/concat":63,"@babel/runtime-corejs3/core-js-stable/instance/filter":66,"@babel/runtime-corejs3/core-js-stable/instance/find":68,"@babel/runtime-corejs3/core-js-stable/instance/for-each":69,"@babel/runtime-corejs3/core-js-stable/instance/includes":70,"@babel/runtime-corejs3/core-js-stable/instance/index-of":71,"@babel/runtime-corejs3/core-js-stable/instance/map":73,"@babel/runtime-corejs3/core-js-stable/instance/slice":75,"@babel/runtime-corejs3/core-js-stable/json/stringify":80,"@babel/runtime-corejs3/core-js-stable/object/create":84,"@babel/runtime-corejs3/core-js-stable/object/define-properties":85,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/object/freeze":88,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":89,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":90,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":91,"@babel/runtime-corejs3/core-js-stable/object/get-prototype-of":92,"@babel/runtime-corejs3/core-js-stable/object/keys":93,"@babel/runtime-corejs3/core-js-stable/promise":95,"@babel/runtime-corejs3/core-js-stable/symbol":100,"@babel/runtime-corejs3/core-js-stable/weak-map":101,"@babel/runtime-corejs3/core-js/get-iterator-method":102,"@babel/runtime-corejs3/helpers/asyncToGenerator":107,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/toConsumableArray":127,"@babel/runtime-corejs3/helpers/typeof":130,"@babel/runtime-corejs3/regenerator":133}],29:[function(_dereq_,module,exports){
|
|
11092
11143
|
"use strict";
|
|
11093
11144
|
|
|
11094
11145
|
var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
@@ -11115,7 +11166,7 @@ var _map = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable
|
|
|
11115
11166
|
var _arrayContainsObject = _interopRequireDefault(_dereq_("./arrayContainsObject"));
|
|
11116
11167
|
var _decode = _interopRequireDefault(_dereq_("./decode"));
|
|
11117
11168
|
var _encode = _interopRequireDefault(_dereq_("./encode"));
|
|
11118
|
-
var
|
|
11169
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
11119
11170
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
11120
11171
|
var _unique = _interopRequireDefault(_dereq_("./unique"));
|
|
11121
11172
|
function _createSuper(Derived) {
|
|
@@ -11144,7 +11195,7 @@ function _isNativeReflectConstruct() {
|
|
|
11144
11195
|
}
|
|
11145
11196
|
} /**
|
|
11146
11197
|
* @flow
|
|
11147
|
-
*/
|
|
11198
|
+
*/ /*:: import type ParseObject from './ParseObject';*/
|
|
11148
11199
|
function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
|
|
11149
11200
|
if (!json || !json.__op) {
|
|
11150
11201
|
return null;
|
|
@@ -11393,9 +11444,10 @@ var AddUniqueOp = /*#__PURE__*/function (_Op5) {
|
|
|
11393
11444
|
}
|
|
11394
11445
|
if ((0, _isArray.default)(value)) {
|
|
11395
11446
|
var _context;
|
|
11447
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
11396
11448
|
var toAdd = [];
|
|
11397
11449
|
(0, _forEach.default)(_context = this._value).call(_context, function (v) {
|
|
11398
|
-
if (v instanceof
|
|
11450
|
+
if (v instanceof ParseObject) {
|
|
11399
11451
|
if (!(0, _arrayContainsObject.default)(value, v)) {
|
|
11400
11452
|
toAdd.push(v);
|
|
11401
11453
|
}
|
|
@@ -11456,6 +11508,7 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
|
|
|
11456
11508
|
return [];
|
|
11457
11509
|
}
|
|
11458
11510
|
if ((0, _isArray.default)(value)) {
|
|
11511
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
11459
11512
|
// var i = value.indexOf(this._value);
|
|
11460
11513
|
var removed = (0, _concat.default)(value).call(value, []);
|
|
11461
11514
|
for (var i = 0; i < this._value.length; i++) {
|
|
@@ -11464,9 +11517,9 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
|
|
|
11464
11517
|
(0, _splice.default)(removed).call(removed, index, 1);
|
|
11465
11518
|
index = (0, _indexOf.default)(removed).call(removed, this._value[i]);
|
|
11466
11519
|
}
|
|
11467
|
-
if (this._value[i] instanceof
|
|
11520
|
+
if (this._value[i] instanceof ParseObject && this._value[i].id) {
|
|
11468
11521
|
for (var j = 0; j < removed.length; j++) {
|
|
11469
|
-
if (removed[j] instanceof
|
|
11522
|
+
if (removed[j] instanceof ParseObject && this._value[i].id === removed[j].id) {
|
|
11470
11523
|
(0, _splice.default)(removed).call(removed, j, 1);
|
|
11471
11524
|
j--;
|
|
11472
11525
|
}
|
|
@@ -11491,9 +11544,10 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
|
|
|
11491
11544
|
}
|
|
11492
11545
|
if (previous instanceof RemoveOp) {
|
|
11493
11546
|
var _context2;
|
|
11547
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
11494
11548
|
var uniques = (0, _concat.default)(_context2 = previous._value).call(_context2, []);
|
|
11495
11549
|
for (var i = 0; i < this._value.length; i++) {
|
|
11496
|
-
if (this._value[i] instanceof
|
|
11550
|
+
if (this._value[i] instanceof ParseObject) {
|
|
11497
11551
|
if (!(0, _arrayContainsObject.default)(uniques, this._value[i])) {
|
|
11498
11552
|
uniques.push(this._value[i]);
|
|
11499
11553
|
}
|
|
@@ -11669,7 +11723,18 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
11669
11723
|
return RelationOp;
|
|
11670
11724
|
}(Op);
|
|
11671
11725
|
exports.RelationOp = RelationOp;
|
|
11672
|
-
|
|
11726
|
+
_CoreManager.default.setParseOp({
|
|
11727
|
+
Op: Op,
|
|
11728
|
+
opFromJSON: opFromJSON,
|
|
11729
|
+
SetOp: SetOp,
|
|
11730
|
+
UnsetOp: UnsetOp,
|
|
11731
|
+
IncrementOp: IncrementOp,
|
|
11732
|
+
AddOp: AddOp,
|
|
11733
|
+
RelationOp: RelationOp,
|
|
11734
|
+
RemoveOp: RemoveOp,
|
|
11735
|
+
AddUniqueOp: AddUniqueOp
|
|
11736
|
+
});
|
|
11737
|
+
},{"./CoreManager":4,"./ParseRelation":32,"./arrayContainsObject":48,"./decode":50,"./encode":51,"./unique":57,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/instance/concat":63,"@babel/runtime-corejs3/core-js-stable/instance/for-each":69,"@babel/runtime-corejs3/core-js-stable/instance/index-of":71,"@babel/runtime-corejs3/core-js-stable/instance/map":73,"@babel/runtime-corejs3/core-js-stable/instance/splice":77,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/reflect/construct":96,"@babel/runtime-corejs3/helpers/assertThisInitialized":106,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/getPrototypeOf":113,"@babel/runtime-corejs3/helpers/inherits":114,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":122}],30:[function(_dereq_,module,exports){
|
|
11673
11738
|
"use strict";
|
|
11674
11739
|
|
|
11675
11740
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -14268,6 +14333,7 @@ var DefaultController = {
|
|
|
14268
14333
|
return RESTController.request('GET', 'aggregate/' + className, params, options);
|
|
14269
14334
|
}
|
|
14270
14335
|
};
|
|
14336
|
+
_CoreManager.default.setParseQuery(ParseQuery);
|
|
14271
14337
|
_CoreManager.default.setQueryController(DefaultController);
|
|
14272
14338
|
var _default = ParseQuery;
|
|
14273
14339
|
exports.default = _default;
|
|
@@ -14284,12 +14350,12 @@ var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-st
|
|
|
14284
14350
|
var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
14285
14351
|
var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
|
|
14286
14352
|
var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
14287
|
-
var
|
|
14288
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
14289
|
-
var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
14353
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
14290
14354
|
/**
|
|
14291
14355
|
* @flow
|
|
14292
14356
|
*/
|
|
14357
|
+
/*:: import type ParseObject from './ParseObject';*/
|
|
14358
|
+
/*:: import type ParseQuery from './ParseQuery';*/
|
|
14293
14359
|
/**
|
|
14294
14360
|
* Creates a new Relation for the given parent object and key. This
|
|
14295
14361
|
* constructor should rarely be used directly, but rather created by
|
|
@@ -14356,7 +14422,9 @@ var ParseRelation = /*#__PURE__*/function () {
|
|
|
14356
14422
|
if (!(0, _isArray.default)(objects)) {
|
|
14357
14423
|
objects = [objects];
|
|
14358
14424
|
}
|
|
14359
|
-
var
|
|
14425
|
+
var _CoreManager$getParse = _CoreManager.default.getParseOp(),
|
|
14426
|
+
RelationOp = _CoreManager$getParse.RelationOp;
|
|
14427
|
+
var change = new RelationOp(objects, []);
|
|
14360
14428
|
var parent = this.parent;
|
|
14361
14429
|
if (!parent) {
|
|
14362
14430
|
throw new Error('Cannot add to a Relation without a parent');
|
|
@@ -14380,7 +14448,9 @@ var ParseRelation = /*#__PURE__*/function () {
|
|
|
14380
14448
|
if (!(0, _isArray.default)(objects)) {
|
|
14381
14449
|
objects = [objects];
|
|
14382
14450
|
}
|
|
14383
|
-
var
|
|
14451
|
+
var _CoreManager$getParse2 = _CoreManager.default.getParseOp(),
|
|
14452
|
+
RelationOp = _CoreManager$getParse2.RelationOp;
|
|
14453
|
+
var change = new RelationOp([], objects);
|
|
14384
14454
|
if (!this.parent) {
|
|
14385
14455
|
throw new Error('Cannot remove from a Relation without a parent');
|
|
14386
14456
|
}
|
|
@@ -14419,11 +14489,12 @@ var ParseRelation = /*#__PURE__*/function () {
|
|
|
14419
14489
|
if (!parent) {
|
|
14420
14490
|
throw new Error('Cannot construct a query for a Relation without a parent');
|
|
14421
14491
|
}
|
|
14492
|
+
var ParseQuery = _CoreManager.default.getParseQuery();
|
|
14422
14493
|
if (!this.targetClassName) {
|
|
14423
|
-
query = new
|
|
14494
|
+
query = new ParseQuery(parent.className);
|
|
14424
14495
|
query._extraOptions.redirectClassNameForKey = this.key;
|
|
14425
14496
|
} else {
|
|
14426
|
-
query = new
|
|
14497
|
+
query = new ParseQuery(this.targetClassName);
|
|
14427
14498
|
}
|
|
14428
14499
|
query._addCondition('$relatedTo', 'object', {
|
|
14429
14500
|
__type: 'Pointer',
|
|
@@ -14438,7 +14509,7 @@ var ParseRelation = /*#__PURE__*/function () {
|
|
|
14438
14509
|
}();
|
|
14439
14510
|
var _default = ParseRelation;
|
|
14440
14511
|
exports.default = _default;
|
|
14441
|
-
},{"./
|
|
14512
|
+
},{"./CoreManager":4,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/defineProperty":111,"@babel/runtime-corejs3/helpers/interopRequireDefault":115}],33:[function(_dereq_,module,exports){
|
|
14442
14513
|
"use strict";
|
|
14443
14514
|
|
|
14444
14515
|
var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
@@ -14454,6 +14525,7 @@ var _get2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/get")
|
|
|
14454
14525
|
var _inherits2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/inherits"));
|
|
14455
14526
|
var _possibleConstructorReturn2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
14456
14527
|
var _getPrototypeOf2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
14528
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
14457
14529
|
var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
|
|
14458
14530
|
var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
|
|
14459
14531
|
var _ParseObject2 = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
@@ -14627,10 +14699,11 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
|
|
|
14627
14699
|
}]);
|
|
14628
14700
|
return ParseRole;
|
|
14629
14701
|
}(_ParseObject2.default);
|
|
14702
|
+
_CoreManager.default.setParseRole(ParseRole);
|
|
14630
14703
|
_ParseObject2.default.registerSubclass('_Role', ParseRole);
|
|
14631
14704
|
var _default = ParseRole;
|
|
14632
14705
|
exports.default = _default;
|
|
14633
|
-
},{"./ParseACL":20,"./ParseError":23,"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/reflect/construct":96,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/get":112,"@babel/runtime-corejs3/helpers/getPrototypeOf":113,"@babel/runtime-corejs3/helpers/inherits":114,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":122}],34:[function(_dereq_,module,exports){
|
|
14706
|
+
},{"./CoreManager":4,"./ParseACL":20,"./ParseError":23,"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/reflect/construct":96,"@babel/runtime-corejs3/helpers/classCallCheck":108,"@babel/runtime-corejs3/helpers/createClass":110,"@babel/runtime-corejs3/helpers/get":112,"@babel/runtime-corejs3/helpers/getPrototypeOf":113,"@babel/runtime-corejs3/helpers/inherits":114,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":122}],34:[function(_dereq_,module,exports){
|
|
14634
14707
|
"use strict";
|
|
14635
14708
|
|
|
14636
14709
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -16896,6 +16969,7 @@ var DefaultController = {
|
|
|
16896
16969
|
}, options);
|
|
16897
16970
|
}
|
|
16898
16971
|
};
|
|
16972
|
+
_CoreManager.default.setParseUser(ParseUser);
|
|
16899
16973
|
_CoreManager.default.setUserController(DefaultController);
|
|
16900
16974
|
var _default = ParseUser;
|
|
16901
16975
|
exports.default = _default;
|
|
@@ -17392,7 +17466,6 @@ var _typeof = _dereq_("@babel/runtime-corejs3/helpers/typeof");
|
|
|
17392
17466
|
var _WeakMap = _dereq_("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
17393
17467
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
17394
17468
|
var _Object$getOwnPropertyDescriptor = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
17395
|
-
var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
17396
17469
|
_Object$defineProperty(exports, "__esModule", {
|
|
17397
17470
|
value: true
|
|
17398
17471
|
});
|
|
@@ -17414,7 +17487,6 @@ exports.removeState = removeState;
|
|
|
17414
17487
|
exports.setPendingOp = setPendingOp;
|
|
17415
17488
|
exports.setServerData = setServerData;
|
|
17416
17489
|
var ObjectStateMutations = _interopRequireWildcard(_dereq_("./ObjectStateMutations"));
|
|
17417
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
17418
17490
|
function _getRequireWildcardCache(nodeInterop) {
|
|
17419
17491
|
if (typeof _WeakMap !== "function") return null;
|
|
17420
17492
|
var cacheBabelInterop = new _WeakMap();
|
|
@@ -17538,12 +17610,12 @@ function getObjectCache(obj /*: ObjectIdentifier*/) /*: ObjectCache*/{
|
|
|
17538
17610
|
}
|
|
17539
17611
|
return {};
|
|
17540
17612
|
}
|
|
17541
|
-
function estimateAttribute(obj /*:
|
|
17613
|
+
function estimateAttribute(obj /*: ObjectIdentifier*/, attr /*: string*/) /*: mixed*/{
|
|
17542
17614
|
var serverData = getServerData(obj);
|
|
17543
17615
|
var pendingOps = getPendingOps(obj);
|
|
17544
17616
|
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
|
|
17545
17617
|
}
|
|
17546
|
-
function estimateAttributes(obj /*:
|
|
17618
|
+
function estimateAttributes(obj /*: ObjectIdentifier*/) /*: AttributeMap*/{
|
|
17547
17619
|
var serverData = getServerData(obj);
|
|
17548
17620
|
var pendingOps = getPendingOps(obj);
|
|
17549
17621
|
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
|
|
@@ -17562,7 +17634,7 @@ function clearAllState() {
|
|
|
17562
17634
|
function duplicateState(source /*: { id: string }*/, dest /*: { id: string }*/) {
|
|
17563
17635
|
dest.id = source.id;
|
|
17564
17636
|
}
|
|
17565
|
-
},{"./ObjectStateMutations":17,"
|
|
17637
|
+
},{"./ObjectStateMutations":17,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":89,"@babel/runtime-corejs3/core-js-stable/weak-map":101,"@babel/runtime-corejs3/helpers/typeof":130}],40:[function(_dereq_,module,exports){
|
|
17566
17638
|
"use strict";
|
|
17567
17639
|
|
|
17568
17640
|
var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
@@ -18114,23 +18186,24 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
18114
18186
|
});
|
|
18115
18187
|
exports.default = arrayContainsObject;
|
|
18116
18188
|
var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
18117
|
-
var
|
|
18189
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18118
18190
|
/**
|
|
18119
18191
|
* @flow
|
|
18120
18192
|
*/
|
|
18121
|
-
|
|
18193
|
+
/*:: import type ParseObject from './ParseObject';*/
|
|
18122
18194
|
function arrayContainsObject(array /*: Array<any>*/, object /*: ParseObject*/) /*: boolean*/{
|
|
18123
18195
|
if ((0, _indexOf.default)(array).call(array, object) > -1) {
|
|
18124
18196
|
return true;
|
|
18125
18197
|
}
|
|
18198
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18126
18199
|
for (var i = 0; i < array.length; i++) {
|
|
18127
|
-
if (array[i] instanceof
|
|
18200
|
+
if (array[i] instanceof ParseObject && array[i].className === object.className && array[i]._getId() === object._getId()) {
|
|
18128
18201
|
return true;
|
|
18129
18202
|
}
|
|
18130
18203
|
}
|
|
18131
18204
|
return false;
|
|
18132
18205
|
}
|
|
18133
|
-
},{"./
|
|
18206
|
+
},{"./CoreManager":4,"@babel/runtime-corejs3/core-js-stable/instance/index-of":71,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/interopRequireDefault":115}],49:[function(_dereq_,module,exports){
|
|
18134
18207
|
"use strict";
|
|
18135
18208
|
|
|
18136
18209
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -18141,15 +18214,16 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
18141
18214
|
exports.default = canBeSerialized;
|
|
18142
18215
|
var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18143
18216
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
18217
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18144
18218
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
18145
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
18146
18219
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
18147
18220
|
/**
|
|
18148
18221
|
* @flow
|
|
18149
18222
|
*/
|
|
18150
|
-
|
|
18223
|
+
/*:: import type ParseObject from './ParseObject';*/
|
|
18151
18224
|
function canBeSerialized(obj /*: ParseObject*/) /*: boolean*/{
|
|
18152
|
-
|
|
18225
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18226
|
+
if (!(obj instanceof ParseObject)) {
|
|
18153
18227
|
return true;
|
|
18154
18228
|
}
|
|
18155
18229
|
var attributes = obj.attributes;
|
|
@@ -18168,7 +18242,8 @@ function canBeSerializedHelper(value /*: any*/) /*: boolean*/{
|
|
|
18168
18242
|
if (value instanceof _ParseRelation.default) {
|
|
18169
18243
|
return true;
|
|
18170
18244
|
}
|
|
18171
|
-
|
|
18245
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18246
|
+
if (value instanceof ParseObject) {
|
|
18172
18247
|
return !!value.id;
|
|
18173
18248
|
}
|
|
18174
18249
|
if (value instanceof _ParseFile.default) {
|
|
@@ -18192,7 +18267,7 @@ function canBeSerializedHelper(value /*: any*/) /*: boolean*/{
|
|
|
18192
18267
|
}
|
|
18193
18268
|
return true;
|
|
18194
18269
|
}
|
|
18195
|
-
},{"./
|
|
18270
|
+
},{"./CoreManager":4,"./ParseFile":24,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],50:[function(_dereq_,module,exports){
|
|
18196
18271
|
"use strict";
|
|
18197
18272
|
|
|
18198
18273
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -18204,16 +18279,16 @@ exports.default = decode;
|
|
|
18204
18279
|
var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18205
18280
|
var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
18206
18281
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
18282
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18207
18283
|
var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
|
|
18208
18284
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
18209
18285
|
var _ParseGeoPoint = _interopRequireDefault(_dereq_("./ParseGeoPoint"));
|
|
18210
18286
|
var _ParsePolygon = _interopRequireDefault(_dereq_("./ParsePolygon"));
|
|
18211
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
18212
|
-
var _ParseOp = _dereq_("./ParseOp");
|
|
18213
18287
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
18214
18288
|
/**
|
|
18215
18289
|
* @flow
|
|
18216
18290
|
*/
|
|
18291
|
+
|
|
18217
18292
|
// eslint-disable-line no-unused-vars
|
|
18218
18293
|
|
|
18219
18294
|
function decode(value /*: any*/) /*: any*/{
|
|
@@ -18228,13 +18303,16 @@ function decode(value /*: any*/) /*: any*/{
|
|
|
18228
18303
|
return dup;
|
|
18229
18304
|
}
|
|
18230
18305
|
if (typeof value.__op === 'string') {
|
|
18231
|
-
|
|
18306
|
+
var _CoreManager$getParse = _CoreManager.default.getParseOp(),
|
|
18307
|
+
opFromJSON = _CoreManager$getParse.opFromJSON;
|
|
18308
|
+
return opFromJSON(value);
|
|
18232
18309
|
}
|
|
18310
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18233
18311
|
if (value.__type === 'Pointer' && value.className) {
|
|
18234
|
-
return
|
|
18312
|
+
return ParseObject.fromJSON(value);
|
|
18235
18313
|
}
|
|
18236
18314
|
if (value.__type === 'Object' && value.className) {
|
|
18237
|
-
return
|
|
18315
|
+
return ParseObject.fromJSON(value);
|
|
18238
18316
|
}
|
|
18239
18317
|
if (value.__type === 'Relation') {
|
|
18240
18318
|
// The parent and key fields will be populated by the parent
|
|
@@ -18263,7 +18341,7 @@ function decode(value /*: any*/) /*: any*/{
|
|
|
18263
18341
|
}
|
|
18264
18342
|
return copy;
|
|
18265
18343
|
}
|
|
18266
|
-
},{"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./
|
|
18344
|
+
},{"./CoreManager":4,"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParsePolygon":30,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/instance/for-each":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],51:[function(_dereq_,module,exports){
|
|
18267
18345
|
"use strict";
|
|
18268
18346
|
|
|
18269
18347
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -18279,19 +18357,19 @@ var _startsWith = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js
|
|
|
18279
18357
|
var _concat = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
18280
18358
|
var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18281
18359
|
var _map = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
18360
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18282
18361
|
var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
|
|
18283
18362
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
18284
18363
|
var _ParseGeoPoint = _interopRequireDefault(_dereq_("./ParseGeoPoint"));
|
|
18285
18364
|
var _ParsePolygon = _interopRequireDefault(_dereq_("./ParsePolygon"));
|
|
18286
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
18287
|
-
var _ParseOp = _dereq_("./ParseOp");
|
|
18288
18365
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
18289
18366
|
/**
|
|
18290
18367
|
* @flow
|
|
18291
18368
|
*/
|
|
18292
18369
|
|
|
18293
18370
|
function encode(value /*: mixed*/, disallowObjects /*: boolean*/, forcePointers /*: boolean*/, seen /*: Array<mixed>*/, offline /*: boolean*/) /*: any*/{
|
|
18294
|
-
|
|
18371
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18372
|
+
if (value instanceof ParseObject) {
|
|
18295
18373
|
if (disallowObjects) {
|
|
18296
18374
|
throw new Error('Parse Objects not allowed here');
|
|
18297
18375
|
}
|
|
@@ -18306,7 +18384,9 @@ function encode(value /*: mixed*/, disallowObjects /*: boolean*/, forcePointers
|
|
|
18306
18384
|
seen = (0, _concat.default)(seen).call(seen, seenEntry);
|
|
18307
18385
|
return value._toFullJSON(seen, offline);
|
|
18308
18386
|
}
|
|
18309
|
-
|
|
18387
|
+
var _CoreManager$getParse = _CoreManager.default.getParseOp(),
|
|
18388
|
+
Op = _CoreManager$getParse.Op;
|
|
18389
|
+
if (value instanceof Op || value instanceof _ParseACL.default || value instanceof _ParseGeoPoint.default || value instanceof _ParsePolygon.default || value instanceof _ParseRelation.default) {
|
|
18310
18390
|
return value.toJSON();
|
|
18311
18391
|
}
|
|
18312
18392
|
if (value instanceof _ParseFile.default) {
|
|
@@ -18344,7 +18424,7 @@ function encode(value /*: mixed*/, disallowObjects /*: boolean*/, forcePointers
|
|
|
18344
18424
|
function _default(value /*: mixed*/, disallowObjects /*:: ?: boolean*/, forcePointers /*:: ?: boolean*/, seen /*:: ?: Array<mixed>*/, offline /*:: ?: boolean*/) /*: any*/{
|
|
18345
18425
|
return encode(value, !!disallowObjects, !!forcePointers, seen || [], offline);
|
|
18346
18426
|
}
|
|
18347
|
-
},{"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./
|
|
18427
|
+
},{"./CoreManager":4,"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParsePolygon":30,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/instance/concat":63,"@babel/runtime-corejs3/core-js-stable/instance/index-of":71,"@babel/runtime-corejs3/core-js-stable/instance/map":73,"@babel/runtime-corejs3/core-js-stable/instance/starts-with":78,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/object/keys":93,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],52:[function(_dereq_,module,exports){
|
|
18348
18428
|
"use strict";
|
|
18349
18429
|
|
|
18350
18430
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -18356,10 +18436,10 @@ exports.default = equals;
|
|
|
18356
18436
|
var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18357
18437
|
var _keys = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
18358
18438
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
18439
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18359
18440
|
var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
|
|
18360
18441
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
18361
18442
|
var _ParseGeoPoint = _interopRequireDefault(_dereq_("./ParseGeoPoint"));
|
|
18362
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
18363
18443
|
function equals(a, b) {
|
|
18364
18444
|
var toString = Object.prototype.toString;
|
|
18365
18445
|
if (toString.call(a) === '[object Date]' || toString.call(b) === '[object Date]') {
|
|
@@ -18388,10 +18468,11 @@ function equals(a, b) {
|
|
|
18388
18468
|
}
|
|
18389
18469
|
return true;
|
|
18390
18470
|
}
|
|
18391
|
-
|
|
18471
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18472
|
+
if (a instanceof _ParseACL.default || a instanceof _ParseFile.default || a instanceof _ParseGeoPoint.default || a instanceof ParseObject) {
|
|
18392
18473
|
return a.equals(b);
|
|
18393
18474
|
}
|
|
18394
|
-
if (b instanceof
|
|
18475
|
+
if (b instanceof ParseObject) {
|
|
18395
18476
|
if (a.__type === 'Object' || a.__type === 'Pointer') {
|
|
18396
18477
|
return a.objectId === b.id && a.className === b.className;
|
|
18397
18478
|
}
|
|
@@ -18406,7 +18487,7 @@ function equals(a, b) {
|
|
|
18406
18487
|
}
|
|
18407
18488
|
return true;
|
|
18408
18489
|
}
|
|
18409
|
-
},{"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"
|
|
18490
|
+
},{"./CoreManager":4,"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/core-js-stable/object/keys":93,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],53:[function(_dereq_,module,exports){
|
|
18410
18491
|
"use strict";
|
|
18411
18492
|
|
|
18412
18493
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -18571,7 +18652,7 @@ exports.default = unique;
|
|
|
18571
18652
|
var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
18572
18653
|
var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
18573
18654
|
var _arrayContainsObject = _interopRequireDefault(_dereq_("./arrayContainsObject"));
|
|
18574
|
-
var
|
|
18655
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18575
18656
|
/**
|
|
18576
18657
|
* @flow
|
|
18577
18658
|
*/
|
|
@@ -18579,7 +18660,8 @@ var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
|
18579
18660
|
function unique /*:: <T>*/(arr /*: Array<T>*/) /*: Array<T>*/{
|
|
18580
18661
|
var uniques = [];
|
|
18581
18662
|
(0, _forEach.default)(arr).call(arr, function (value) {
|
|
18582
|
-
|
|
18663
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18664
|
+
if (value instanceof ParseObject) {
|
|
18583
18665
|
if (!(0, _arrayContainsObject.default)(uniques, value)) {
|
|
18584
18666
|
uniques.push(value);
|
|
18585
18667
|
}
|
|
@@ -18591,7 +18673,7 @@ function unique /*:: <T>*/(arr /*: Array<T>*/) /*: Array<T>*/{
|
|
|
18591
18673
|
});
|
|
18592
18674
|
return uniques;
|
|
18593
18675
|
}
|
|
18594
|
-
},{"./
|
|
18676
|
+
},{"./CoreManager":4,"./arrayContainsObject":48,"@babel/runtime-corejs3/core-js-stable/instance/for-each":69,"@babel/runtime-corejs3/core-js-stable/instance/index-of":71,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/interopRequireDefault":115}],58:[function(_dereq_,module,exports){
|
|
18595
18677
|
"use strict";
|
|
18596
18678
|
|
|
18597
18679
|
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
@@ -18605,12 +18687,13 @@ var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-st
|
|
|
18605
18687
|
var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18606
18688
|
var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
18607
18689
|
var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
|
|
18690
|
+
var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
|
|
18608
18691
|
var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
|
|
18609
|
-
var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
18610
18692
|
var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
18611
18693
|
/**
|
|
18612
18694
|
* @flow
|
|
18613
18695
|
*/
|
|
18696
|
+
/*:: import type ParseObject from './ParseObject';*/
|
|
18614
18697
|
/*:: type EncounterMap = {
|
|
18615
18698
|
objects: { [identifier: string]: ParseObject | boolean },
|
|
18616
18699
|
files: Array<ParseFile>,
|
|
@@ -18645,7 +18728,8 @@ function unsavedChildren(obj /*: ParseObject*/, allowDeepUnsaved /*:: ?: boolean
|
|
|
18645
18728
|
return (0, _concat.default)(unsaved).call(unsaved, encountered.files);
|
|
18646
18729
|
}
|
|
18647
18730
|
function traverse(obj /*: ParseObject*/, encountered /*: EncounterMap*/, shouldThrow /*: boolean*/, allowDeepUnsaved /*: boolean*/) {
|
|
18648
|
-
|
|
18731
|
+
var ParseObject = _CoreManager.default.getParseObject();
|
|
18732
|
+
if (obj instanceof ParseObject) {
|
|
18649
18733
|
if (!obj.id && shouldThrow) {
|
|
18650
18734
|
throw new Error('Cannot create a pointer to an unsaved Object.');
|
|
18651
18735
|
}
|
|
@@ -18684,24 +18768,31 @@ function traverse(obj /*: ParseObject*/, encountered /*: EncounterMap*/, shouldT
|
|
|
18684
18768
|
}
|
|
18685
18769
|
}
|
|
18686
18770
|
}
|
|
18687
|
-
},{"./
|
|
18771
|
+
},{"./CoreManager":4,"./ParseFile":24,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":61,"@babel/runtime-corejs3/core-js-stable/instance/concat":63,"@babel/runtime-corejs3/core-js-stable/instance/for-each":69,"@babel/runtime-corejs3/core-js-stable/instance/index-of":71,"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"@babel/runtime-corejs3/helpers/interopRequireDefault":115,"@babel/runtime-corejs3/helpers/typeof":130}],59:[function(_dereq_,module,exports){
|
|
18688
18772
|
"use strict";
|
|
18689
18773
|
|
|
18690
|
-
var
|
|
18774
|
+
var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
18775
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
18776
|
+
value: true
|
|
18777
|
+
});
|
|
18778
|
+
exports.default = void 0;
|
|
18779
|
+
var _uuid = _dereq_("uuid");
|
|
18780
|
+
var uuid /*: () => string*/ = null;
|
|
18691
18781
|
uuid = function () {
|
|
18692
|
-
var s = [];
|
|
18782
|
+
var s /*: string[]*/ = [];
|
|
18693
18783
|
var hexDigits = '0123456789abcdef';
|
|
18694
18784
|
for (var i = 0; i < 36; i++) {
|
|
18695
18785
|
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
18696
18786
|
}
|
|
18697
18787
|
s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
|
18698
|
-
s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
18788
|
+
s[19] = hexDigits.substr(Number(s[19]) & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
18699
18789
|
s[8] = s[13] = s[18] = s[23] = '-';
|
|
18700
18790
|
return s.join('');
|
|
18701
18791
|
};
|
|
18702
|
-
var _require, v4;
|
|
18703
18792
|
module.exports = uuid;
|
|
18704
|
-
|
|
18793
|
+
var _default = uuid;
|
|
18794
|
+
exports.default = _default;
|
|
18795
|
+
},{"@babel/runtime-corejs3/core-js-stable/object/define-property":86,"uuid":626}],60:[function(_dereq_,module,exports){
|
|
18705
18796
|
module.exports = _dereq_("core-js-pure/stable/array/from");
|
|
18706
18797
|
},{"core-js-pure/stable/array/from":562}],61:[function(_dereq_,module,exports){
|
|
18707
18798
|
module.exports = _dereq_("core-js-pure/stable/array/is-array");
|
|
@@ -31105,5 +31196,868 @@ exports.setMany = setMany;
|
|
|
31105
31196
|
exports.update = update;
|
|
31106
31197
|
exports.values = values;
|
|
31107
31198
|
|
|
31108
|
-
},{}]
|
|
31199
|
+
},{}],626:[function(_dereq_,module,exports){
|
|
31200
|
+
"use strict";
|
|
31201
|
+
|
|
31202
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31203
|
+
value: true
|
|
31204
|
+
});
|
|
31205
|
+
Object.defineProperty(exports, "NIL", {
|
|
31206
|
+
enumerable: true,
|
|
31207
|
+
get: function () {
|
|
31208
|
+
return _nil.default;
|
|
31209
|
+
}
|
|
31210
|
+
});
|
|
31211
|
+
Object.defineProperty(exports, "parse", {
|
|
31212
|
+
enumerable: true,
|
|
31213
|
+
get: function () {
|
|
31214
|
+
return _parse.default;
|
|
31215
|
+
}
|
|
31216
|
+
});
|
|
31217
|
+
Object.defineProperty(exports, "stringify", {
|
|
31218
|
+
enumerable: true,
|
|
31219
|
+
get: function () {
|
|
31220
|
+
return _stringify.default;
|
|
31221
|
+
}
|
|
31222
|
+
});
|
|
31223
|
+
Object.defineProperty(exports, "v1", {
|
|
31224
|
+
enumerable: true,
|
|
31225
|
+
get: function () {
|
|
31226
|
+
return _v.default;
|
|
31227
|
+
}
|
|
31228
|
+
});
|
|
31229
|
+
Object.defineProperty(exports, "v3", {
|
|
31230
|
+
enumerable: true,
|
|
31231
|
+
get: function () {
|
|
31232
|
+
return _v2.default;
|
|
31233
|
+
}
|
|
31234
|
+
});
|
|
31235
|
+
Object.defineProperty(exports, "v4", {
|
|
31236
|
+
enumerable: true,
|
|
31237
|
+
get: function () {
|
|
31238
|
+
return _v3.default;
|
|
31239
|
+
}
|
|
31240
|
+
});
|
|
31241
|
+
Object.defineProperty(exports, "v5", {
|
|
31242
|
+
enumerable: true,
|
|
31243
|
+
get: function () {
|
|
31244
|
+
return _v4.default;
|
|
31245
|
+
}
|
|
31246
|
+
});
|
|
31247
|
+
Object.defineProperty(exports, "validate", {
|
|
31248
|
+
enumerable: true,
|
|
31249
|
+
get: function () {
|
|
31250
|
+
return _validate.default;
|
|
31251
|
+
}
|
|
31252
|
+
});
|
|
31253
|
+
Object.defineProperty(exports, "version", {
|
|
31254
|
+
enumerable: true,
|
|
31255
|
+
get: function () {
|
|
31256
|
+
return _version.default;
|
|
31257
|
+
}
|
|
31258
|
+
});
|
|
31259
|
+
|
|
31260
|
+
var _v = _interopRequireDefault(_dereq_("./v1.js"));
|
|
31261
|
+
|
|
31262
|
+
var _v2 = _interopRequireDefault(_dereq_("./v3.js"));
|
|
31263
|
+
|
|
31264
|
+
var _v3 = _interopRequireDefault(_dereq_("./v4.js"));
|
|
31265
|
+
|
|
31266
|
+
var _v4 = _interopRequireDefault(_dereq_("./v5.js"));
|
|
31267
|
+
|
|
31268
|
+
var _nil = _interopRequireDefault(_dereq_("./nil.js"));
|
|
31269
|
+
|
|
31270
|
+
var _version = _interopRequireDefault(_dereq_("./version.js"));
|
|
31271
|
+
|
|
31272
|
+
var _validate = _interopRequireDefault(_dereq_("./validate.js"));
|
|
31273
|
+
|
|
31274
|
+
var _stringify = _interopRequireDefault(_dereq_("./stringify.js"));
|
|
31275
|
+
|
|
31276
|
+
var _parse = _interopRequireDefault(_dereq_("./parse.js"));
|
|
31277
|
+
|
|
31278
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31279
|
+
},{"./nil.js":629,"./parse.js":630,"./stringify.js":634,"./v1.js":635,"./v3.js":636,"./v4.js":638,"./v5.js":639,"./validate.js":640,"./version.js":641}],627:[function(_dereq_,module,exports){
|
|
31280
|
+
"use strict";
|
|
31281
|
+
|
|
31282
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31283
|
+
value: true
|
|
31284
|
+
});
|
|
31285
|
+
exports.default = void 0;
|
|
31286
|
+
|
|
31287
|
+
/*
|
|
31288
|
+
* Browser-compatible JavaScript MD5
|
|
31289
|
+
*
|
|
31290
|
+
* Modification of JavaScript MD5
|
|
31291
|
+
* https://github.com/blueimp/JavaScript-MD5
|
|
31292
|
+
*
|
|
31293
|
+
* Copyright 2011, Sebastian Tschan
|
|
31294
|
+
* https://blueimp.net
|
|
31295
|
+
*
|
|
31296
|
+
* Licensed under the MIT license:
|
|
31297
|
+
* https://opensource.org/licenses/MIT
|
|
31298
|
+
*
|
|
31299
|
+
* Based on
|
|
31300
|
+
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
31301
|
+
* Digest Algorithm, as defined in RFC 1321.
|
|
31302
|
+
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
31303
|
+
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
31304
|
+
* Distributed under the BSD License
|
|
31305
|
+
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
31306
|
+
*/
|
|
31307
|
+
function md5(bytes) {
|
|
31308
|
+
if (typeof bytes === 'string') {
|
|
31309
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
31310
|
+
|
|
31311
|
+
bytes = new Uint8Array(msg.length);
|
|
31312
|
+
|
|
31313
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
31314
|
+
bytes[i] = msg.charCodeAt(i);
|
|
31315
|
+
}
|
|
31316
|
+
}
|
|
31317
|
+
|
|
31318
|
+
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
|
31319
|
+
}
|
|
31320
|
+
/*
|
|
31321
|
+
* Convert an array of little-endian words to an array of bytes
|
|
31322
|
+
*/
|
|
31323
|
+
|
|
31324
|
+
|
|
31325
|
+
function md5ToHexEncodedArray(input) {
|
|
31326
|
+
const output = [];
|
|
31327
|
+
const length32 = input.length * 32;
|
|
31328
|
+
const hexTab = '0123456789abcdef';
|
|
31329
|
+
|
|
31330
|
+
for (let i = 0; i < length32; i += 8) {
|
|
31331
|
+
const x = input[i >> 5] >>> i % 32 & 0xff;
|
|
31332
|
+
const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
|
31333
|
+
output.push(hex);
|
|
31334
|
+
}
|
|
31335
|
+
|
|
31336
|
+
return output;
|
|
31337
|
+
}
|
|
31338
|
+
/**
|
|
31339
|
+
* Calculate output length with padding and bit length
|
|
31340
|
+
*/
|
|
31341
|
+
|
|
31342
|
+
|
|
31343
|
+
function getOutputLength(inputLength8) {
|
|
31344
|
+
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
|
|
31345
|
+
}
|
|
31346
|
+
/*
|
|
31347
|
+
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
31348
|
+
*/
|
|
31349
|
+
|
|
31350
|
+
|
|
31351
|
+
function wordsToMd5(x, len) {
|
|
31352
|
+
/* append padding */
|
|
31353
|
+
x[len >> 5] |= 0x80 << len % 32;
|
|
31354
|
+
x[getOutputLength(len) - 1] = len;
|
|
31355
|
+
let a = 1732584193;
|
|
31356
|
+
let b = -271733879;
|
|
31357
|
+
let c = -1732584194;
|
|
31358
|
+
let d = 271733878;
|
|
31359
|
+
|
|
31360
|
+
for (let i = 0; i < x.length; i += 16) {
|
|
31361
|
+
const olda = a;
|
|
31362
|
+
const oldb = b;
|
|
31363
|
+
const oldc = c;
|
|
31364
|
+
const oldd = d;
|
|
31365
|
+
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
|
31366
|
+
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
31367
|
+
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
31368
|
+
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
31369
|
+
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
31370
|
+
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
31371
|
+
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
31372
|
+
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
31373
|
+
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
31374
|
+
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
31375
|
+
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
31376
|
+
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
31377
|
+
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
31378
|
+
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
31379
|
+
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
31380
|
+
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
31381
|
+
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
31382
|
+
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
31383
|
+
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
31384
|
+
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
|
31385
|
+
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
31386
|
+
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
31387
|
+
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
31388
|
+
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
31389
|
+
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
31390
|
+
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
31391
|
+
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
31392
|
+
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
31393
|
+
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
31394
|
+
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
31395
|
+
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
31396
|
+
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
31397
|
+
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
31398
|
+
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
31399
|
+
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
31400
|
+
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
31401
|
+
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
31402
|
+
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
31403
|
+
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
31404
|
+
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
31405
|
+
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
31406
|
+
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
|
31407
|
+
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
31408
|
+
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
31409
|
+
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
31410
|
+
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
31411
|
+
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
31412
|
+
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
31413
|
+
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
|
31414
|
+
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
31415
|
+
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
31416
|
+
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
31417
|
+
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
31418
|
+
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
31419
|
+
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
31420
|
+
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
31421
|
+
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
31422
|
+
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
31423
|
+
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
31424
|
+
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
31425
|
+
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
31426
|
+
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
31427
|
+
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
31428
|
+
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
31429
|
+
a = safeAdd(a, olda);
|
|
31430
|
+
b = safeAdd(b, oldb);
|
|
31431
|
+
c = safeAdd(c, oldc);
|
|
31432
|
+
d = safeAdd(d, oldd);
|
|
31433
|
+
}
|
|
31434
|
+
|
|
31435
|
+
return [a, b, c, d];
|
|
31436
|
+
}
|
|
31437
|
+
/*
|
|
31438
|
+
* Convert an array bytes to an array of little-endian words
|
|
31439
|
+
* Characters >255 have their high-byte silently ignored.
|
|
31440
|
+
*/
|
|
31441
|
+
|
|
31442
|
+
|
|
31443
|
+
function bytesToWords(input) {
|
|
31444
|
+
if (input.length === 0) {
|
|
31445
|
+
return [];
|
|
31446
|
+
}
|
|
31447
|
+
|
|
31448
|
+
const length8 = input.length * 8;
|
|
31449
|
+
const output = new Uint32Array(getOutputLength(length8));
|
|
31450
|
+
|
|
31451
|
+
for (let i = 0; i < length8; i += 8) {
|
|
31452
|
+
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
|
31453
|
+
}
|
|
31454
|
+
|
|
31455
|
+
return output;
|
|
31456
|
+
}
|
|
31457
|
+
/*
|
|
31458
|
+
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
31459
|
+
* to work around bugs in some JS interpreters.
|
|
31460
|
+
*/
|
|
31461
|
+
|
|
31462
|
+
|
|
31463
|
+
function safeAdd(x, y) {
|
|
31464
|
+
const lsw = (x & 0xffff) + (y & 0xffff);
|
|
31465
|
+
const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
31466
|
+
return msw << 16 | lsw & 0xffff;
|
|
31467
|
+
}
|
|
31468
|
+
/*
|
|
31469
|
+
* Bitwise rotate a 32-bit number to the left.
|
|
31470
|
+
*/
|
|
31471
|
+
|
|
31472
|
+
|
|
31473
|
+
function bitRotateLeft(num, cnt) {
|
|
31474
|
+
return num << cnt | num >>> 32 - cnt;
|
|
31475
|
+
}
|
|
31476
|
+
/*
|
|
31477
|
+
* These functions implement the four basic operations the algorithm uses.
|
|
31478
|
+
*/
|
|
31479
|
+
|
|
31480
|
+
|
|
31481
|
+
function md5cmn(q, a, b, x, s, t) {
|
|
31482
|
+
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
|
31483
|
+
}
|
|
31484
|
+
|
|
31485
|
+
function md5ff(a, b, c, d, x, s, t) {
|
|
31486
|
+
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
|
31487
|
+
}
|
|
31488
|
+
|
|
31489
|
+
function md5gg(a, b, c, d, x, s, t) {
|
|
31490
|
+
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
|
31491
|
+
}
|
|
31492
|
+
|
|
31493
|
+
function md5hh(a, b, c, d, x, s, t) {
|
|
31494
|
+
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
|
31495
|
+
}
|
|
31496
|
+
|
|
31497
|
+
function md5ii(a, b, c, d, x, s, t) {
|
|
31498
|
+
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
31499
|
+
}
|
|
31500
|
+
|
|
31501
|
+
var _default = md5;
|
|
31502
|
+
exports.default = _default;
|
|
31503
|
+
},{}],628:[function(_dereq_,module,exports){
|
|
31504
|
+
"use strict";
|
|
31505
|
+
|
|
31506
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31507
|
+
value: true
|
|
31508
|
+
});
|
|
31509
|
+
exports.default = void 0;
|
|
31510
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
31511
|
+
var _default = {
|
|
31512
|
+
randomUUID
|
|
31513
|
+
};
|
|
31514
|
+
exports.default = _default;
|
|
31515
|
+
},{}],629:[function(_dereq_,module,exports){
|
|
31516
|
+
"use strict";
|
|
31517
|
+
|
|
31518
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31519
|
+
value: true
|
|
31520
|
+
});
|
|
31521
|
+
exports.default = void 0;
|
|
31522
|
+
var _default = '00000000-0000-0000-0000-000000000000';
|
|
31523
|
+
exports.default = _default;
|
|
31524
|
+
},{}],630:[function(_dereq_,module,exports){
|
|
31525
|
+
"use strict";
|
|
31526
|
+
|
|
31527
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31528
|
+
value: true
|
|
31529
|
+
});
|
|
31530
|
+
exports.default = void 0;
|
|
31531
|
+
|
|
31532
|
+
var _validate = _interopRequireDefault(_dereq_("./validate.js"));
|
|
31533
|
+
|
|
31534
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31535
|
+
|
|
31536
|
+
function parse(uuid) {
|
|
31537
|
+
if (!(0, _validate.default)(uuid)) {
|
|
31538
|
+
throw TypeError('Invalid UUID');
|
|
31539
|
+
}
|
|
31540
|
+
|
|
31541
|
+
let v;
|
|
31542
|
+
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
31543
|
+
|
|
31544
|
+
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
31545
|
+
arr[1] = v >>> 16 & 0xff;
|
|
31546
|
+
arr[2] = v >>> 8 & 0xff;
|
|
31547
|
+
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
31548
|
+
|
|
31549
|
+
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
31550
|
+
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
31551
|
+
|
|
31552
|
+
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
31553
|
+
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
31554
|
+
|
|
31555
|
+
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
31556
|
+
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
31557
|
+
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
31558
|
+
|
|
31559
|
+
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
31560
|
+
arr[11] = v / 0x100000000 & 0xff;
|
|
31561
|
+
arr[12] = v >>> 24 & 0xff;
|
|
31562
|
+
arr[13] = v >>> 16 & 0xff;
|
|
31563
|
+
arr[14] = v >>> 8 & 0xff;
|
|
31564
|
+
arr[15] = v & 0xff;
|
|
31565
|
+
return arr;
|
|
31566
|
+
}
|
|
31567
|
+
|
|
31568
|
+
var _default = parse;
|
|
31569
|
+
exports.default = _default;
|
|
31570
|
+
},{"./validate.js":640}],631:[function(_dereq_,module,exports){
|
|
31571
|
+
"use strict";
|
|
31572
|
+
|
|
31573
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31574
|
+
value: true
|
|
31575
|
+
});
|
|
31576
|
+
exports.default = void 0;
|
|
31577
|
+
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
31578
|
+
exports.default = _default;
|
|
31579
|
+
},{}],632:[function(_dereq_,module,exports){
|
|
31580
|
+
"use strict";
|
|
31581
|
+
|
|
31582
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31583
|
+
value: true
|
|
31584
|
+
});
|
|
31585
|
+
exports.default = rng;
|
|
31586
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
31587
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
31588
|
+
// generators (like Math.random()).
|
|
31589
|
+
let getRandomValues;
|
|
31590
|
+
const rnds8 = new Uint8Array(16);
|
|
31591
|
+
|
|
31592
|
+
function rng() {
|
|
31593
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
31594
|
+
if (!getRandomValues) {
|
|
31595
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
31596
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
31597
|
+
|
|
31598
|
+
if (!getRandomValues) {
|
|
31599
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
31600
|
+
}
|
|
31601
|
+
}
|
|
31602
|
+
|
|
31603
|
+
return getRandomValues(rnds8);
|
|
31604
|
+
}
|
|
31605
|
+
},{}],633:[function(_dereq_,module,exports){
|
|
31606
|
+
"use strict";
|
|
31607
|
+
|
|
31608
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31609
|
+
value: true
|
|
31610
|
+
});
|
|
31611
|
+
exports.default = void 0;
|
|
31612
|
+
|
|
31613
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
31614
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
31615
|
+
function f(s, x, y, z) {
|
|
31616
|
+
switch (s) {
|
|
31617
|
+
case 0:
|
|
31618
|
+
return x & y ^ ~x & z;
|
|
31619
|
+
|
|
31620
|
+
case 1:
|
|
31621
|
+
return x ^ y ^ z;
|
|
31622
|
+
|
|
31623
|
+
case 2:
|
|
31624
|
+
return x & y ^ x & z ^ y & z;
|
|
31625
|
+
|
|
31626
|
+
case 3:
|
|
31627
|
+
return x ^ y ^ z;
|
|
31628
|
+
}
|
|
31629
|
+
}
|
|
31630
|
+
|
|
31631
|
+
function ROTL(x, n) {
|
|
31632
|
+
return x << n | x >>> 32 - n;
|
|
31633
|
+
}
|
|
31634
|
+
|
|
31635
|
+
function sha1(bytes) {
|
|
31636
|
+
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
31637
|
+
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
31638
|
+
|
|
31639
|
+
if (typeof bytes === 'string') {
|
|
31640
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
31641
|
+
|
|
31642
|
+
bytes = [];
|
|
31643
|
+
|
|
31644
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
31645
|
+
bytes.push(msg.charCodeAt(i));
|
|
31646
|
+
}
|
|
31647
|
+
} else if (!Array.isArray(bytes)) {
|
|
31648
|
+
// Convert Array-like to Array
|
|
31649
|
+
bytes = Array.prototype.slice.call(bytes);
|
|
31650
|
+
}
|
|
31651
|
+
|
|
31652
|
+
bytes.push(0x80);
|
|
31653
|
+
const l = bytes.length / 4 + 2;
|
|
31654
|
+
const N = Math.ceil(l / 16);
|
|
31655
|
+
const M = new Array(N);
|
|
31656
|
+
|
|
31657
|
+
for (let i = 0; i < N; ++i) {
|
|
31658
|
+
const arr = new Uint32Array(16);
|
|
31659
|
+
|
|
31660
|
+
for (let j = 0; j < 16; ++j) {
|
|
31661
|
+
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
31662
|
+
}
|
|
31663
|
+
|
|
31664
|
+
M[i] = arr;
|
|
31665
|
+
}
|
|
31666
|
+
|
|
31667
|
+
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
31668
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
31669
|
+
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
31670
|
+
|
|
31671
|
+
for (let i = 0; i < N; ++i) {
|
|
31672
|
+
const W = new Uint32Array(80);
|
|
31673
|
+
|
|
31674
|
+
for (let t = 0; t < 16; ++t) {
|
|
31675
|
+
W[t] = M[i][t];
|
|
31676
|
+
}
|
|
31677
|
+
|
|
31678
|
+
for (let t = 16; t < 80; ++t) {
|
|
31679
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
31680
|
+
}
|
|
31681
|
+
|
|
31682
|
+
let a = H[0];
|
|
31683
|
+
let b = H[1];
|
|
31684
|
+
let c = H[2];
|
|
31685
|
+
let d = H[3];
|
|
31686
|
+
let e = H[4];
|
|
31687
|
+
|
|
31688
|
+
for (let t = 0; t < 80; ++t) {
|
|
31689
|
+
const s = Math.floor(t / 20);
|
|
31690
|
+
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
31691
|
+
e = d;
|
|
31692
|
+
d = c;
|
|
31693
|
+
c = ROTL(b, 30) >>> 0;
|
|
31694
|
+
b = a;
|
|
31695
|
+
a = T;
|
|
31696
|
+
}
|
|
31697
|
+
|
|
31698
|
+
H[0] = H[0] + a >>> 0;
|
|
31699
|
+
H[1] = H[1] + b >>> 0;
|
|
31700
|
+
H[2] = H[2] + c >>> 0;
|
|
31701
|
+
H[3] = H[3] + d >>> 0;
|
|
31702
|
+
H[4] = H[4] + e >>> 0;
|
|
31703
|
+
}
|
|
31704
|
+
|
|
31705
|
+
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
31706
|
+
}
|
|
31707
|
+
|
|
31708
|
+
var _default = sha1;
|
|
31709
|
+
exports.default = _default;
|
|
31710
|
+
},{}],634:[function(_dereq_,module,exports){
|
|
31711
|
+
"use strict";
|
|
31712
|
+
|
|
31713
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31714
|
+
value: true
|
|
31715
|
+
});
|
|
31716
|
+
exports.default = void 0;
|
|
31717
|
+
exports.unsafeStringify = unsafeStringify;
|
|
31718
|
+
|
|
31719
|
+
var _validate = _interopRequireDefault(_dereq_("./validate.js"));
|
|
31720
|
+
|
|
31721
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31722
|
+
|
|
31723
|
+
/**
|
|
31724
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
31725
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
31726
|
+
*/
|
|
31727
|
+
const byteToHex = [];
|
|
31728
|
+
|
|
31729
|
+
for (let i = 0; i < 256; ++i) {
|
|
31730
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
31731
|
+
}
|
|
31732
|
+
|
|
31733
|
+
function unsafeStringify(arr, offset = 0) {
|
|
31734
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
31735
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
31736
|
+
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]];
|
|
31737
|
+
}
|
|
31738
|
+
|
|
31739
|
+
function stringify(arr, offset = 0) {
|
|
31740
|
+
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
31741
|
+
// of the following:
|
|
31742
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
31743
|
+
// "undefined" in the uuid)
|
|
31744
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
31745
|
+
|
|
31746
|
+
if (!(0, _validate.default)(uuid)) {
|
|
31747
|
+
throw TypeError('Stringified UUID is invalid');
|
|
31748
|
+
}
|
|
31749
|
+
|
|
31750
|
+
return uuid;
|
|
31751
|
+
}
|
|
31752
|
+
|
|
31753
|
+
var _default = stringify;
|
|
31754
|
+
exports.default = _default;
|
|
31755
|
+
},{"./validate.js":640}],635:[function(_dereq_,module,exports){
|
|
31756
|
+
"use strict";
|
|
31757
|
+
|
|
31758
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31759
|
+
value: true
|
|
31760
|
+
});
|
|
31761
|
+
exports.default = void 0;
|
|
31762
|
+
|
|
31763
|
+
var _rng = _interopRequireDefault(_dereq_("./rng.js"));
|
|
31764
|
+
|
|
31765
|
+
var _stringify = _dereq_("./stringify.js");
|
|
31766
|
+
|
|
31767
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31768
|
+
|
|
31769
|
+
// **`v1()` - Generate time-based UUID**
|
|
31770
|
+
//
|
|
31771
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
|
31772
|
+
// and http://docs.python.org/library/uuid.html
|
|
31773
|
+
let _nodeId;
|
|
31774
|
+
|
|
31775
|
+
let _clockseq; // Previous uuid creation time
|
|
31776
|
+
|
|
31777
|
+
|
|
31778
|
+
let _lastMSecs = 0;
|
|
31779
|
+
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
|
31780
|
+
|
|
31781
|
+
function v1(options, buf, offset) {
|
|
31782
|
+
let i = buf && offset || 0;
|
|
31783
|
+
const b = buf || new Array(16);
|
|
31784
|
+
options = options || {};
|
|
31785
|
+
let node = options.node || _nodeId;
|
|
31786
|
+
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
|
31787
|
+
// specified. We do this lazily to minimize issues related to insufficient
|
|
31788
|
+
// system entropy. See #189
|
|
31789
|
+
|
|
31790
|
+
if (node == null || clockseq == null) {
|
|
31791
|
+
const seedBytes = options.random || (options.rng || _rng.default)();
|
|
31792
|
+
|
|
31793
|
+
if (node == null) {
|
|
31794
|
+
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
31795
|
+
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
31796
|
+
}
|
|
31797
|
+
|
|
31798
|
+
if (clockseq == null) {
|
|
31799
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
|
31800
|
+
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
31801
|
+
}
|
|
31802
|
+
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
31803
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
31804
|
+
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
31805
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
31806
|
+
|
|
31807
|
+
|
|
31808
|
+
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
31809
|
+
// cycle to simulate higher resolution clock
|
|
31810
|
+
|
|
31811
|
+
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
|
31812
|
+
|
|
31813
|
+
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
|
31814
|
+
|
|
31815
|
+
if (dt < 0 && options.clockseq === undefined) {
|
|
31816
|
+
clockseq = clockseq + 1 & 0x3fff;
|
|
31817
|
+
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
31818
|
+
// time interval
|
|
31819
|
+
|
|
31820
|
+
|
|
31821
|
+
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
31822
|
+
nsecs = 0;
|
|
31823
|
+
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
|
31824
|
+
|
|
31825
|
+
|
|
31826
|
+
if (nsecs >= 10000) {
|
|
31827
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
31828
|
+
}
|
|
31829
|
+
|
|
31830
|
+
_lastMSecs = msecs;
|
|
31831
|
+
_lastNSecs = nsecs;
|
|
31832
|
+
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
31833
|
+
|
|
31834
|
+
msecs += 12219292800000; // `time_low`
|
|
31835
|
+
|
|
31836
|
+
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
31837
|
+
b[i++] = tl >>> 24 & 0xff;
|
|
31838
|
+
b[i++] = tl >>> 16 & 0xff;
|
|
31839
|
+
b[i++] = tl >>> 8 & 0xff;
|
|
31840
|
+
b[i++] = tl & 0xff; // `time_mid`
|
|
31841
|
+
|
|
31842
|
+
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
|
31843
|
+
b[i++] = tmh >>> 8 & 0xff;
|
|
31844
|
+
b[i++] = tmh & 0xff; // `time_high_and_version`
|
|
31845
|
+
|
|
31846
|
+
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
31847
|
+
|
|
31848
|
+
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
31849
|
+
|
|
31850
|
+
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
|
31851
|
+
|
|
31852
|
+
b[i++] = clockseq & 0xff; // `node`
|
|
31853
|
+
|
|
31854
|
+
for (let n = 0; n < 6; ++n) {
|
|
31855
|
+
b[i + n] = node[n];
|
|
31856
|
+
}
|
|
31857
|
+
|
|
31858
|
+
return buf || (0, _stringify.unsafeStringify)(b);
|
|
31859
|
+
}
|
|
31860
|
+
|
|
31861
|
+
var _default = v1;
|
|
31862
|
+
exports.default = _default;
|
|
31863
|
+
},{"./rng.js":632,"./stringify.js":634}],636:[function(_dereq_,module,exports){
|
|
31864
|
+
"use strict";
|
|
31865
|
+
|
|
31866
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31867
|
+
value: true
|
|
31868
|
+
});
|
|
31869
|
+
exports.default = void 0;
|
|
31870
|
+
|
|
31871
|
+
var _v = _interopRequireDefault(_dereq_("./v35.js"));
|
|
31872
|
+
|
|
31873
|
+
var _md = _interopRequireDefault(_dereq_("./md5.js"));
|
|
31874
|
+
|
|
31875
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31876
|
+
|
|
31877
|
+
const v3 = (0, _v.default)('v3', 0x30, _md.default);
|
|
31878
|
+
var _default = v3;
|
|
31879
|
+
exports.default = _default;
|
|
31880
|
+
},{"./md5.js":627,"./v35.js":637}],637:[function(_dereq_,module,exports){
|
|
31881
|
+
"use strict";
|
|
31882
|
+
|
|
31883
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31884
|
+
value: true
|
|
31885
|
+
});
|
|
31886
|
+
exports.URL = exports.DNS = void 0;
|
|
31887
|
+
exports.default = v35;
|
|
31888
|
+
|
|
31889
|
+
var _stringify = _dereq_("./stringify.js");
|
|
31890
|
+
|
|
31891
|
+
var _parse = _interopRequireDefault(_dereq_("./parse.js"));
|
|
31892
|
+
|
|
31893
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31894
|
+
|
|
31895
|
+
function stringToBytes(str) {
|
|
31896
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
31897
|
+
|
|
31898
|
+
const bytes = [];
|
|
31899
|
+
|
|
31900
|
+
for (let i = 0; i < str.length; ++i) {
|
|
31901
|
+
bytes.push(str.charCodeAt(i));
|
|
31902
|
+
}
|
|
31903
|
+
|
|
31904
|
+
return bytes;
|
|
31905
|
+
}
|
|
31906
|
+
|
|
31907
|
+
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
31908
|
+
exports.DNS = DNS;
|
|
31909
|
+
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
31910
|
+
exports.URL = URL;
|
|
31911
|
+
|
|
31912
|
+
function v35(name, version, hashfunc) {
|
|
31913
|
+
function generateUUID(value, namespace, buf, offset) {
|
|
31914
|
+
var _namespace;
|
|
31915
|
+
|
|
31916
|
+
if (typeof value === 'string') {
|
|
31917
|
+
value = stringToBytes(value);
|
|
31918
|
+
}
|
|
31919
|
+
|
|
31920
|
+
if (typeof namespace === 'string') {
|
|
31921
|
+
namespace = (0, _parse.default)(namespace);
|
|
31922
|
+
}
|
|
31923
|
+
|
|
31924
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
31925
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
31926
|
+
} // Compute hash of namespace and value, Per 4.3
|
|
31927
|
+
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
31928
|
+
// hashfunc([...namespace, ... value])`
|
|
31929
|
+
|
|
31930
|
+
|
|
31931
|
+
let bytes = new Uint8Array(16 + value.length);
|
|
31932
|
+
bytes.set(namespace);
|
|
31933
|
+
bytes.set(value, namespace.length);
|
|
31934
|
+
bytes = hashfunc(bytes);
|
|
31935
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
31936
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
31937
|
+
|
|
31938
|
+
if (buf) {
|
|
31939
|
+
offset = offset || 0;
|
|
31940
|
+
|
|
31941
|
+
for (let i = 0; i < 16; ++i) {
|
|
31942
|
+
buf[offset + i] = bytes[i];
|
|
31943
|
+
}
|
|
31944
|
+
|
|
31945
|
+
return buf;
|
|
31946
|
+
}
|
|
31947
|
+
|
|
31948
|
+
return (0, _stringify.unsafeStringify)(bytes);
|
|
31949
|
+
} // Function#name is not settable on some platforms (#270)
|
|
31950
|
+
|
|
31951
|
+
|
|
31952
|
+
try {
|
|
31953
|
+
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
31954
|
+
} catch (err) {} // For CommonJS default export support
|
|
31955
|
+
|
|
31956
|
+
|
|
31957
|
+
generateUUID.DNS = DNS;
|
|
31958
|
+
generateUUID.URL = URL;
|
|
31959
|
+
return generateUUID;
|
|
31960
|
+
}
|
|
31961
|
+
},{"./parse.js":630,"./stringify.js":634}],638:[function(_dereq_,module,exports){
|
|
31962
|
+
"use strict";
|
|
31963
|
+
|
|
31964
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31965
|
+
value: true
|
|
31966
|
+
});
|
|
31967
|
+
exports.default = void 0;
|
|
31968
|
+
|
|
31969
|
+
var _native = _interopRequireDefault(_dereq_("./native.js"));
|
|
31970
|
+
|
|
31971
|
+
var _rng = _interopRequireDefault(_dereq_("./rng.js"));
|
|
31972
|
+
|
|
31973
|
+
var _stringify = _dereq_("./stringify.js");
|
|
31974
|
+
|
|
31975
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31976
|
+
|
|
31977
|
+
function v4(options, buf, offset) {
|
|
31978
|
+
if (_native.default.randomUUID && !buf && !options) {
|
|
31979
|
+
return _native.default.randomUUID();
|
|
31980
|
+
}
|
|
31981
|
+
|
|
31982
|
+
options = options || {};
|
|
31983
|
+
|
|
31984
|
+
const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
31985
|
+
|
|
31986
|
+
|
|
31987
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
31988
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
31989
|
+
|
|
31990
|
+
if (buf) {
|
|
31991
|
+
offset = offset || 0;
|
|
31992
|
+
|
|
31993
|
+
for (let i = 0; i < 16; ++i) {
|
|
31994
|
+
buf[offset + i] = rnds[i];
|
|
31995
|
+
}
|
|
31996
|
+
|
|
31997
|
+
return buf;
|
|
31998
|
+
}
|
|
31999
|
+
|
|
32000
|
+
return (0, _stringify.unsafeStringify)(rnds);
|
|
32001
|
+
}
|
|
32002
|
+
|
|
32003
|
+
var _default = v4;
|
|
32004
|
+
exports.default = _default;
|
|
32005
|
+
},{"./native.js":628,"./rng.js":632,"./stringify.js":634}],639:[function(_dereq_,module,exports){
|
|
32006
|
+
"use strict";
|
|
32007
|
+
|
|
32008
|
+
Object.defineProperty(exports, "__esModule", {
|
|
32009
|
+
value: true
|
|
32010
|
+
});
|
|
32011
|
+
exports.default = void 0;
|
|
32012
|
+
|
|
32013
|
+
var _v = _interopRequireDefault(_dereq_("./v35.js"));
|
|
32014
|
+
|
|
32015
|
+
var _sha = _interopRequireDefault(_dereq_("./sha1.js"));
|
|
32016
|
+
|
|
32017
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32018
|
+
|
|
32019
|
+
const v5 = (0, _v.default)('v5', 0x50, _sha.default);
|
|
32020
|
+
var _default = v5;
|
|
32021
|
+
exports.default = _default;
|
|
32022
|
+
},{"./sha1.js":633,"./v35.js":637}],640:[function(_dereq_,module,exports){
|
|
32023
|
+
"use strict";
|
|
32024
|
+
|
|
32025
|
+
Object.defineProperty(exports, "__esModule", {
|
|
32026
|
+
value: true
|
|
32027
|
+
});
|
|
32028
|
+
exports.default = void 0;
|
|
32029
|
+
|
|
32030
|
+
var _regex = _interopRequireDefault(_dereq_("./regex.js"));
|
|
32031
|
+
|
|
32032
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32033
|
+
|
|
32034
|
+
function validate(uuid) {
|
|
32035
|
+
return typeof uuid === 'string' && _regex.default.test(uuid);
|
|
32036
|
+
}
|
|
32037
|
+
|
|
32038
|
+
var _default = validate;
|
|
32039
|
+
exports.default = _default;
|
|
32040
|
+
},{"./regex.js":631}],641:[function(_dereq_,module,exports){
|
|
32041
|
+
"use strict";
|
|
32042
|
+
|
|
32043
|
+
Object.defineProperty(exports, "__esModule", {
|
|
32044
|
+
value: true
|
|
32045
|
+
});
|
|
32046
|
+
exports.default = void 0;
|
|
32047
|
+
|
|
32048
|
+
var _validate = _interopRequireDefault(_dereq_("./validate.js"));
|
|
32049
|
+
|
|
32050
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32051
|
+
|
|
32052
|
+
function version(uuid) {
|
|
32053
|
+
if (!(0, _validate.default)(uuid)) {
|
|
32054
|
+
throw TypeError('Invalid UUID');
|
|
32055
|
+
}
|
|
32056
|
+
|
|
32057
|
+
return parseInt(uuid.slice(14, 15), 16);
|
|
32058
|
+
}
|
|
32059
|
+
|
|
32060
|
+
var _default = version;
|
|
32061
|
+
exports.default = _default;
|
|
32062
|
+
},{"./validate.js":640}]},{},[19])(19)
|
|
31109
32063
|
});
|