@eluvio/elv-client-js 4.0.129 → 4.0.131
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/ElvClient-min.js +14 -15
- package/dist/ElvClient-node-min.js +13 -14
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +14 -15
- package/dist/ElvWalletClient-node-min.js +13 -14
- package/dist/src/AuthorizationClient.js +12 -9
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +222 -263
- package/dist/src/ElvWallet.js +5 -7
- package/dist/src/EthClient.js +9 -8
- package/dist/src/FrameClient.js +10 -9
- package/dist/src/HttpClient.js +2 -1
- package/dist/src/Id.js +2 -1
- package/dist/src/PermissionsClient.js +19 -31
- package/dist/src/RemoteSigner.js +8 -6
- package/dist/src/UserProfileClient.js +20 -35
- package/dist/src/Utils.js +3 -2
- package/dist/src/client/ABRPublishing.js +2 -2
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +12 -8
- package/dist/src/client/ContentManagement.js +72 -82
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +5 -9
- package/dist/src/client/LiveStream.js +2 -0
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/client/Shares.js +24 -47
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +21 -35
- package/package.json +1 -1
- package/src/HttpClient.js +4 -3
- package/src/RemoteSigner.js +3 -2
- package/src/client/ContentManagement.js +1 -1
- package/src/walletClient/index.js +14 -4
package/dist/src/ElvClient.js
CHANGED
|
@@ -5,8 +5,8 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
|
5
5
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
6
6
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
7
7
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
8
|
-
function ownKeys(
|
|
9
|
-
function _objectSpread(
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
10
|
if (typeof globalThis.Buffer === "undefined") {
|
|
11
11
|
globalThis.Buffer = require("buffer/").Buffer;
|
|
12
12
|
}
|
|
@@ -142,7 +142,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
142
142
|
* @param {string=} clientIP - IP address to use in determining the region to use
|
|
143
143
|
* @return {Promise<Object>} - Object containing content space ID and fabric and ethereum URLs
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
_createClass(ElvClient, [{
|
|
146
146
|
key: "Log",
|
|
147
147
|
value: function Log(message) {
|
|
148
148
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -341,7 +341,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
341
341
|
*/
|
|
342
342
|
}, {
|
|
343
343
|
key: "UseRegion",
|
|
344
|
-
value:
|
|
344
|
+
value: function () {
|
|
345
345
|
var _UseRegion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
346
346
|
var region, _yield$ElvClient$Conf, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs;
|
|
347
347
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -401,10 +401,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
401
401
|
*
|
|
402
402
|
* @return {Promise<Object>} - An object containing the updated fabric and ethereum URLs in order of preference
|
|
403
403
|
*/
|
|
404
|
-
)
|
|
405
404
|
}, {
|
|
406
405
|
key: "ResetRegion",
|
|
407
|
-
value:
|
|
406
|
+
value: function () {
|
|
408
407
|
var _ResetRegion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
409
408
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
410
409
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -444,10 +443,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
444
443
|
*
|
|
445
444
|
* @return {Promise<string>} - The node ID reported by the fabric
|
|
446
445
|
*/
|
|
447
|
-
)
|
|
448
446
|
}, {
|
|
449
447
|
key: "NodeId",
|
|
450
|
-
value:
|
|
448
|
+
value: function () {
|
|
451
449
|
var _NodeId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
452
450
|
var region, _yield$ElvClient$Conf2, nodeId;
|
|
453
451
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -481,7 +479,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
481
479
|
*
|
|
482
480
|
* @return {Promise<Object>} - An object containing the lists of fabric, ethereum, auth service, and search urls in use by the client
|
|
483
481
|
*/
|
|
484
|
-
)
|
|
485
482
|
}, {
|
|
486
483
|
key: "Nodes",
|
|
487
484
|
value: function Nodes() {
|
|
@@ -553,7 +550,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
553
550
|
*/
|
|
554
551
|
}, {
|
|
555
552
|
key: "SpaceNodes",
|
|
556
|
-
value:
|
|
553
|
+
value: function () {
|
|
557
554
|
var _SpaceNodes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
558
555
|
var _this = this;
|
|
559
556
|
var _ref7,
|
|
@@ -640,7 +637,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
640
637
|
* @methodGroup Nodes
|
|
641
638
|
* @returns {Object} - The name, ID and configuration URL of the network
|
|
642
639
|
*/
|
|
643
|
-
)
|
|
644
640
|
}, {
|
|
645
641
|
key: "NetworkInfo",
|
|
646
642
|
value: function NetworkInfo() {
|
|
@@ -712,6 +708,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
712
708
|
}, {
|
|
713
709
|
key: "SetSigner",
|
|
714
710
|
value: function SetSigner(_ref10) {
|
|
711
|
+
var _this2 = this;
|
|
715
712
|
var signer = _ref10.signer,
|
|
716
713
|
_ref10$reset = _ref10.reset,
|
|
717
714
|
reset = _ref10$reset === void 0 ? true : _ref10$reset;
|
|
@@ -719,6 +716,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
719
716
|
signer.connect(this.ethClient.Provider());
|
|
720
717
|
signer.provider.pollingInterval = 500;
|
|
721
718
|
this.signer = signer;
|
|
719
|
+
this.CreateFabricToken({}).then(function (token) {
|
|
720
|
+
return _this2.signedToken = token;
|
|
721
|
+
});
|
|
722
722
|
if (reset) {
|
|
723
723
|
this.InitializeClients();
|
|
724
724
|
}
|
|
@@ -738,7 +738,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
738
738
|
*/
|
|
739
739
|
}, {
|
|
740
740
|
key: "SetRemoteSigner",
|
|
741
|
-
value:
|
|
741
|
+
value: function () {
|
|
742
742
|
var _SetRemoteSigner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref11) {
|
|
743
743
|
var idToken, authToken, tenantId, extraData, signerURIs, unsignedPublicAuth, signer;
|
|
744
744
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
@@ -793,10 +793,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
793
793
|
* @namedParams
|
|
794
794
|
* @param {object} provider - The web3 provider object
|
|
795
795
|
*/
|
|
796
|
-
)
|
|
797
796
|
}, {
|
|
798
797
|
key: "SetSignerFromWeb3Provider",
|
|
799
|
-
value:
|
|
798
|
+
value: function () {
|
|
800
799
|
var _SetSignerFromWeb3Provider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref12) {
|
|
801
800
|
var provider, ethProvider;
|
|
802
801
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
@@ -839,10 +838,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
839
838
|
*
|
|
840
839
|
* @return {string} - The address of the user
|
|
841
840
|
*/
|
|
842
|
-
)
|
|
843
841
|
}, {
|
|
844
842
|
key: "CreateAccount",
|
|
845
|
-
value:
|
|
843
|
+
value: function () {
|
|
846
844
|
var _CreateAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref13) {
|
|
847
845
|
var tenantId, fundingToken, _ref13$funds, funds, groupToken, wallet, signer;
|
|
848
846
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
@@ -917,12 +915,11 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
917
915
|
PAYLOAD 85b json-compressed
|
|
918
916
|
json 79b {"adr":"VVf4DQU357tDnZGYQeDrntRJ5rs=","spc":"ispc3ANoVSzNA3P6t7abLR69ho5YPPZU"}
|
|
919
917
|
*/
|
|
920
|
-
)
|
|
921
918
|
}, {
|
|
922
919
|
key: "PersonalSign",
|
|
923
|
-
value:
|
|
920
|
+
value: function () {
|
|
924
921
|
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref14) {
|
|
925
|
-
var
|
|
922
|
+
var _this3 = this;
|
|
926
923
|
var message, addEthereumPrefix, Sign;
|
|
927
924
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
928
925
|
while (1) switch (_context11.prev = _context11.next) {
|
|
@@ -936,19 +933,19 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
936
933
|
while (1) switch (_context10.prev = _context10.next) {
|
|
937
934
|
case 0:
|
|
938
935
|
_context10.t0 = Ethers.utils;
|
|
939
|
-
if (!
|
|
936
|
+
if (!_this3.signer.signDigest) {
|
|
940
937
|
_context10.next = 7;
|
|
941
938
|
break;
|
|
942
939
|
}
|
|
943
940
|
_context10.next = 4;
|
|
944
|
-
return
|
|
941
|
+
return _this3.signer.signDigest(message);
|
|
945
942
|
case 4:
|
|
946
943
|
_context10.t1 = _context10.sent;
|
|
947
944
|
_context10.next = 10;
|
|
948
945
|
break;
|
|
949
946
|
case 7:
|
|
950
947
|
_context10.next = 9;
|
|
951
|
-
return
|
|
948
|
+
return _this3.signer._signingKey().signDigest(message);
|
|
952
949
|
case 9:
|
|
953
950
|
_context10.t1 = _context10.sent;
|
|
954
951
|
case 10:
|
|
@@ -994,10 +991,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
994
991
|
* @param {function=} Sign - If specified, this function will be used to produce the signature instead of the client's current signer
|
|
995
992
|
* @param {boolean=} addEthereumPrefix=true - If specified, the 'Ethereum Signed Message' prefixed hash format will be performed. Disable this if the provided Sign method already does this (e.g. Metamask)
|
|
996
993
|
*/
|
|
997
|
-
)
|
|
998
994
|
}, {
|
|
999
995
|
key: "CreateFabricToken",
|
|
1000
|
-
value:
|
|
996
|
+
value: function () {
|
|
1001
997
|
var _CreateFabricToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
1002
998
|
var _ref16,
|
|
1003
999
|
_ref16$duration,
|
|
@@ -1078,19 +1074,16 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1078
1074
|
* @param {boolean} allowDecryption=false - If specified, the re-encryption key will be included in the token,
|
|
1079
1075
|
* enabling the user of this token to download encrypted content from the specified object
|
|
1080
1076
|
* @param {Object=} context - Additional JSON context
|
|
1081
|
-
* @param {number=} issueTime - Issue Time in milliseconds
|
|
1082
|
-
* @param {number=} expirationTime - Expiration Time in milliseconds
|
|
1083
1077
|
*/
|
|
1084
|
-
)
|
|
1085
1078
|
}, {
|
|
1086
1079
|
key: "CreateSignedToken",
|
|
1087
|
-
value:
|
|
1080
|
+
value: function () {
|
|
1088
1081
|
var _CreateSignedToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref17) {
|
|
1089
|
-
var libraryId, objectId, versionHash, policyId, subject, _ref17$grantType, grantType, _ref17$allowDecryptio, allowDecryption, duration, _ref17$context, context,
|
|
1082
|
+
var libraryId, objectId, versionHash, policyId, subject, _ref17$grantType, grantType, _ref17$allowDecryptio, allowDecryption, duration, _ref17$context, context, token, cap, compressedToken, signature;
|
|
1090
1083
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1091
1084
|
while (1) switch (_context13.prev = _context13.next) {
|
|
1092
1085
|
case 0:
|
|
1093
|
-
libraryId = _ref17.libraryId, objectId = _ref17.objectId, versionHash = _ref17.versionHash, policyId = _ref17.policyId, subject = _ref17.subject, _ref17$grantType = _ref17.grantType, grantType = _ref17$grantType === void 0 ? "read" : _ref17$grantType, _ref17$allowDecryptio = _ref17.allowDecryption, allowDecryption = _ref17$allowDecryptio === void 0 ? false : _ref17$allowDecryptio, duration = _ref17.duration, _ref17$context = _ref17.context, context = _ref17$context === void 0 ? {} : _ref17$context
|
|
1086
|
+
libraryId = _ref17.libraryId, objectId = _ref17.objectId, versionHash = _ref17.versionHash, policyId = _ref17.policyId, subject = _ref17.subject, _ref17$grantType = _ref17.grantType, grantType = _ref17$grantType === void 0 ? "read" : _ref17$grantType, _ref17$allowDecryptio = _ref17.allowDecryption, allowDecryption = _ref17$allowDecryptio === void 0 ? false : _ref17$allowDecryptio, duration = _ref17.duration, _ref17$context = _ref17.context, context = _ref17$context === void 0 ? {} : _ref17$context;
|
|
1094
1087
|
if (subject) {
|
|
1095
1088
|
_context13.next = 9;
|
|
1096
1089
|
break;
|
|
@@ -1107,20 +1100,19 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1107
1100
|
if (policyId) {
|
|
1108
1101
|
context["elv:delegation-id"] = policyId;
|
|
1109
1102
|
}
|
|
1110
|
-
issueDateTime = issueTime || Date.now();
|
|
1111
1103
|
_context13.t4 = Buffer;
|
|
1112
|
-
_context13.next =
|
|
1104
|
+
_context13.next = 13;
|
|
1113
1105
|
return this.CurrentAccountAddress().replace(/^0x/, "");
|
|
1114
|
-
case
|
|
1106
|
+
case 13:
|
|
1115
1107
|
_context13.t5 = _context13.sent;
|
|
1116
1108
|
_context13.t6 = _context13.t4.from.call(_context13.t4, _context13.t5, "hex").toString("base64");
|
|
1117
1109
|
_context13.t7 = subject;
|
|
1118
|
-
_context13.next =
|
|
1110
|
+
_context13.next = 18;
|
|
1119
1111
|
return this.ContentSpaceId();
|
|
1120
|
-
case
|
|
1112
|
+
case 18:
|
|
1121
1113
|
_context13.t8 = _context13.sent;
|
|
1122
|
-
_context13.t9 =
|
|
1123
|
-
_context13.t10 =
|
|
1114
|
+
_context13.t9 = Date.now();
|
|
1115
|
+
_context13.t10 = Date.now() + duration;
|
|
1124
1116
|
_context13.t11 = grantType;
|
|
1125
1117
|
_context13.t12 = context;
|
|
1126
1118
|
token = {
|
|
@@ -1136,44 +1128,44 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1136
1128
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
1137
1129
|
}
|
|
1138
1130
|
if (!objectId) {
|
|
1139
|
-
_context13.next =
|
|
1131
|
+
_context13.next = 31;
|
|
1140
1132
|
break;
|
|
1141
1133
|
}
|
|
1142
1134
|
token.qid = objectId;
|
|
1143
1135
|
if (libraryId) {
|
|
1144
|
-
_context13.next =
|
|
1136
|
+
_context13.next = 31;
|
|
1145
1137
|
break;
|
|
1146
1138
|
}
|
|
1147
|
-
_context13.next =
|
|
1139
|
+
_context13.next = 30;
|
|
1148
1140
|
return this.ContentObjectLibraryId({
|
|
1149
1141
|
objectId: objectId
|
|
1150
1142
|
});
|
|
1151
|
-
case
|
|
1143
|
+
case 30:
|
|
1152
1144
|
libraryId = _context13.sent;
|
|
1153
|
-
case
|
|
1145
|
+
case 31:
|
|
1154
1146
|
if (libraryId) {
|
|
1155
1147
|
token.lib = libraryId;
|
|
1156
1148
|
}
|
|
1157
1149
|
if (!allowDecryption) {
|
|
1158
|
-
_context13.next =
|
|
1150
|
+
_context13.next = 37;
|
|
1159
1151
|
break;
|
|
1160
1152
|
}
|
|
1161
|
-
_context13.next =
|
|
1153
|
+
_context13.next = 35;
|
|
1162
1154
|
return this.authClient.ReEncryptionConk({
|
|
1163
1155
|
libraryId: libraryId,
|
|
1164
1156
|
objectId: objectId
|
|
1165
1157
|
});
|
|
1166
|
-
case
|
|
1158
|
+
case 35:
|
|
1167
1159
|
cap = _context13.sent;
|
|
1168
1160
|
token.apk = cap.public_key;
|
|
1169
|
-
case
|
|
1161
|
+
case 37:
|
|
1170
1162
|
compressedToken = Pako.deflateRaw(Buffer.from(JSON.stringify(token), "utf-8"));
|
|
1171
|
-
_context13.next =
|
|
1163
|
+
_context13.next = 40;
|
|
1172
1164
|
return this.authClient.Sign(Ethers.utils.keccak256(compressedToken));
|
|
1173
|
-
case
|
|
1165
|
+
case 40:
|
|
1174
1166
|
signature = _context13.sent;
|
|
1175
1167
|
return _context13.abrupt("return", "aessjc".concat(this.utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(compressedToken)]))));
|
|
1176
|
-
case
|
|
1168
|
+
case 42:
|
|
1177
1169
|
case "end":
|
|
1178
1170
|
return _context13.stop();
|
|
1179
1171
|
}
|
|
@@ -1183,28 +1175,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1183
1175
|
return _CreateSignedToken.apply(this, arguments);
|
|
1184
1176
|
}
|
|
1185
1177
|
return CreateSignedToken;
|
|
1186
|
-
}())
|
|
1187
|
-
}, {
|
|
1188
|
-
key: "CreateAuthorizationToken",
|
|
1189
|
-
value: function () {
|
|
1190
|
-
var _CreateAuthorizationToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(args) {
|
|
1191
|
-
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1192
|
-
while (1) switch (_context14.prev = _context14.next) {
|
|
1193
|
-
case 0:
|
|
1194
|
-
_context14.next = 2;
|
|
1195
|
-
return this.authClient.AuthorizationToken(args);
|
|
1196
|
-
case 2:
|
|
1197
|
-
return _context14.abrupt("return", _context14.sent);
|
|
1198
|
-
case 3:
|
|
1199
|
-
case "end":
|
|
1200
|
-
return _context14.stop();
|
|
1201
|
-
}
|
|
1202
|
-
}, _callee14, this);
|
|
1203
|
-
}));
|
|
1204
|
-
function CreateAuthorizationToken(_x9) {
|
|
1205
|
-
return _CreateAuthorizationToken.apply(this, arguments);
|
|
1206
|
-
}
|
|
1207
|
-
return CreateAuthorizationToken;
|
|
1208
1178
|
}()
|
|
1209
1179
|
/**
|
|
1210
1180
|
* Build a signed message (JSON) using the current signer.
|
|
@@ -1222,31 +1192,31 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1222
1192
|
*/
|
|
1223
1193
|
}, {
|
|
1224
1194
|
key: "CreateSignedMessageJSON",
|
|
1225
|
-
value:
|
|
1226
|
-
var _CreateSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1195
|
+
value: function () {
|
|
1196
|
+
var _CreateSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref18) {
|
|
1227
1197
|
var message, type, msg, signature;
|
|
1228
|
-
return _regeneratorRuntime.wrap(function
|
|
1229
|
-
while (1) switch (
|
|
1198
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1199
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1230
1200
|
case 0:
|
|
1231
1201
|
message = _ref18.message;
|
|
1232
1202
|
// Only one kind of signature supported currently
|
|
1233
1203
|
type = "mje_"; // JSON message, EIP192 signature
|
|
1234
1204
|
msg = JSON.stringify(message);
|
|
1235
|
-
|
|
1205
|
+
_context14.next = 5;
|
|
1236
1206
|
return this.PersonalSign({
|
|
1237
1207
|
message: msg,
|
|
1238
1208
|
addEthereumPrefix: true
|
|
1239
1209
|
});
|
|
1240
1210
|
case 5:
|
|
1241
|
-
signature =
|
|
1242
|
-
return
|
|
1211
|
+
signature = _context14.sent;
|
|
1212
|
+
return _context14.abrupt("return", "".concat(type).concat(Utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(msg)]))));
|
|
1243
1213
|
case 7:
|
|
1244
1214
|
case "end":
|
|
1245
|
-
return
|
|
1215
|
+
return _context14.stop();
|
|
1246
1216
|
}
|
|
1247
|
-
},
|
|
1217
|
+
}, _callee14, this);
|
|
1248
1218
|
}));
|
|
1249
|
-
function CreateSignedMessageJSON(
|
|
1219
|
+
function CreateSignedMessageJSON(_x9) {
|
|
1250
1220
|
return _CreateSignedMessageJSON.apply(this, arguments);
|
|
1251
1221
|
}
|
|
1252
1222
|
return CreateSignedMessageJSON;
|
|
@@ -1259,19 +1229,18 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1259
1229
|
* @param {string} signedMessage - a signed message as created by CreateSignedMessageJSON
|
|
1260
1230
|
* @returns {Promise<Object>} - The decoded message, signer address, signature and signature type
|
|
1261
1231
|
*/
|
|
1262
|
-
)
|
|
1263
1232
|
}, {
|
|
1264
1233
|
key: "DecodeSignedMessageJSON",
|
|
1265
|
-
value:
|
|
1266
|
-
var _DecodeSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1234
|
+
value: function () {
|
|
1235
|
+
var _DecodeSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref19) {
|
|
1267
1236
|
var signedMessage, type, msgBytes, signature, msg, obj, prefixedMsgHash, signerAddr;
|
|
1268
|
-
return _regeneratorRuntime.wrap(function
|
|
1269
|
-
while (1) switch (
|
|
1237
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
1238
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1270
1239
|
case 0:
|
|
1271
1240
|
signedMessage = _ref19.signedMessage;
|
|
1272
1241
|
type = signedMessage.slice(0, 4);
|
|
1273
|
-
|
|
1274
|
-
|
|
1242
|
+
_context15.t0 = type;
|
|
1243
|
+
_context15.next = _context15.t0 === "mje_" ? 5 : 12;
|
|
1275
1244
|
break;
|
|
1276
1245
|
case 5:
|
|
1277
1246
|
msgBytes = Utils.FromB58(signedMessage.slice(4));
|
|
@@ -1280,7 +1249,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1280
1249
|
obj = JSON.parse(msg);
|
|
1281
1250
|
prefixedMsgHash = Ethers.utils.keccak256(Buffer.from("\x19Ethereum Signed Message:\n".concat(msg.length).concat(msg), "utf-8"));
|
|
1282
1251
|
signerAddr = Ethers.utils.recoverAddress(prefixedMsgHash, signature);
|
|
1283
|
-
return
|
|
1252
|
+
return _context15.abrupt("return", {
|
|
1284
1253
|
type: type,
|
|
1285
1254
|
message: obj,
|
|
1286
1255
|
signerAddress: signerAddr,
|
|
@@ -1290,11 +1259,11 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1290
1259
|
throw new Error("Bad message type: ".concat(type));
|
|
1291
1260
|
case 13:
|
|
1292
1261
|
case "end":
|
|
1293
|
-
return
|
|
1262
|
+
return _context15.stop();
|
|
1294
1263
|
}
|
|
1295
|
-
},
|
|
1264
|
+
}, _callee15);
|
|
1296
1265
|
}));
|
|
1297
|
-
function DecodeSignedMessageJSON(
|
|
1266
|
+
function DecodeSignedMessageJSON(_x10) {
|
|
1298
1267
|
return _DecodeSignedMessageJSON.apply(this, arguments);
|
|
1299
1268
|
}
|
|
1300
1269
|
return DecodeSignedMessageJSON;
|
|
@@ -1305,7 +1274,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1305
1274
|
* @methodGroup Signers
|
|
1306
1275
|
* @returns {string} - The address of the current signer
|
|
1307
1276
|
*/
|
|
1308
|
-
)
|
|
1309
1277
|
}, {
|
|
1310
1278
|
key: "CurrentAccountAddress",
|
|
1311
1279
|
value: function CurrentAccountAddress() {
|
|
@@ -1321,11 +1289,11 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1321
1289
|
*/
|
|
1322
1290
|
}, {
|
|
1323
1291
|
key: "SetOauthToken",
|
|
1324
|
-
value:
|
|
1325
|
-
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1292
|
+
value: function () {
|
|
1293
|
+
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref20) {
|
|
1326
1294
|
var token, wallet, signer;
|
|
1327
|
-
return _regeneratorRuntime.wrap(function
|
|
1328
|
-
while (1) switch (
|
|
1295
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
1296
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1329
1297
|
case 0:
|
|
1330
1298
|
token = _ref20.token;
|
|
1331
1299
|
this.oauthToken = token;
|
|
@@ -1338,11 +1306,11 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1338
1306
|
});
|
|
1339
1307
|
case 5:
|
|
1340
1308
|
case "end":
|
|
1341
|
-
return
|
|
1309
|
+
return _context16.stop();
|
|
1342
1310
|
}
|
|
1343
|
-
},
|
|
1311
|
+
}, _callee16, this);
|
|
1344
1312
|
}));
|
|
1345
|
-
function SetOauthToken(
|
|
1313
|
+
function SetOauthToken(_x11) {
|
|
1346
1314
|
return _SetOauthToken.apply(this, arguments);
|
|
1347
1315
|
}
|
|
1348
1316
|
return SetOauthToken;
|
|
@@ -1357,48 +1325,47 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1357
1325
|
* @namedParams
|
|
1358
1326
|
* @param {string} token - The OAuth ID
|
|
1359
1327
|
*/
|
|
1360
|
-
)
|
|
1361
1328
|
}, {
|
|
1362
1329
|
key: "SetSignerFromOauthToken",
|
|
1363
|
-
value:
|
|
1364
|
-
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1330
|
+
value: function () {
|
|
1331
|
+
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref21) {
|
|
1365
1332
|
var token, wallet, client, _yield$client$authCli, urls, path, httpClient, response, privateKey;
|
|
1366
|
-
return _regeneratorRuntime.wrap(function
|
|
1367
|
-
while (1) switch (
|
|
1333
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1334
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1368
1335
|
case 0:
|
|
1369
1336
|
token = _ref21.token;
|
|
1370
1337
|
if (this.trustAuthorityId) {
|
|
1371
|
-
|
|
1338
|
+
_context17.next = 3;
|
|
1372
1339
|
break;
|
|
1373
1340
|
}
|
|
1374
1341
|
throw Error("Unable to authorize with OAuth token: No trust authority ID set");
|
|
1375
1342
|
case 3:
|
|
1376
1343
|
wallet = this.GenerateWallet();
|
|
1377
|
-
|
|
1344
|
+
_context17.prev = 4;
|
|
1378
1345
|
if (this.kmsURIs) {
|
|
1379
|
-
|
|
1346
|
+
_context17.next = 17;
|
|
1380
1347
|
break;
|
|
1381
1348
|
}
|
|
1382
|
-
|
|
1349
|
+
_context17.next = 8;
|
|
1383
1350
|
return ElvClient.FromConfigurationUrl({
|
|
1384
1351
|
configUrl: this.configUrl
|
|
1385
1352
|
});
|
|
1386
1353
|
case 8:
|
|
1387
|
-
client =
|
|
1354
|
+
client = _context17.sent;
|
|
1388
1355
|
client.SetSigner({
|
|
1389
1356
|
signer: wallet.AddAccountFromMnemonic({
|
|
1390
1357
|
mnemonic: wallet.GenerateMnemonic()
|
|
1391
1358
|
})
|
|
1392
1359
|
});
|
|
1393
|
-
|
|
1360
|
+
_context17.next = 12;
|
|
1394
1361
|
return client.authClient.KMSInfo({
|
|
1395
1362
|
kmsId: this.trustAuthorityId
|
|
1396
1363
|
});
|
|
1397
1364
|
case 12:
|
|
1398
|
-
_yield$client$authCli =
|
|
1365
|
+
_yield$client$authCli = _context17.sent;
|
|
1399
1366
|
urls = _yield$client$authCli.urls;
|
|
1400
1367
|
if (!(!urls || urls.length === 0)) {
|
|
1401
|
-
|
|
1368
|
+
_context17.next = 16;
|
|
1402
1369
|
break;
|
|
1403
1370
|
}
|
|
1404
1371
|
throw Error("Unable to authorize with OAuth token: No KMS URLs set");
|
|
@@ -1411,7 +1378,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1411
1378
|
uris: this.kmsURIs,
|
|
1412
1379
|
debug: this.debug
|
|
1413
1380
|
});
|
|
1414
|
-
|
|
1381
|
+
_context17.next = 22;
|
|
1415
1382
|
return this.utils.ResponseToJson(httpClient.Request({
|
|
1416
1383
|
headers: {
|
|
1417
1384
|
Authorization: "Bearer ".concat(token)
|
|
@@ -1421,7 +1388,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1421
1388
|
forceFailover: true
|
|
1422
1389
|
}));
|
|
1423
1390
|
case 22:
|
|
1424
|
-
response =
|
|
1391
|
+
response = _context17.sent;
|
|
1425
1392
|
privateKey = response["UserSKHex"];
|
|
1426
1393
|
this.SetSigner({
|
|
1427
1394
|
signer: wallet.AddAccount({
|
|
@@ -1430,27 +1397,27 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1430
1397
|
});
|
|
1431
1398
|
|
|
1432
1399
|
// Ensure wallet is initialized
|
|
1433
|
-
|
|
1400
|
+
_context17.next = 27;
|
|
1434
1401
|
return this.userProfileClient.WalletAddress();
|
|
1435
1402
|
case 27:
|
|
1436
|
-
|
|
1403
|
+
_context17.next = 36;
|
|
1437
1404
|
break;
|
|
1438
1405
|
case 29:
|
|
1439
|
-
|
|
1440
|
-
|
|
1406
|
+
_context17.prev = 29;
|
|
1407
|
+
_context17.t0 = _context17["catch"](4);
|
|
1441
1408
|
this.Log("Failed to set signer from OAuth token:", true);
|
|
1442
|
-
this.Log(
|
|
1443
|
-
|
|
1409
|
+
this.Log(_context17.t0, true);
|
|
1410
|
+
_context17.next = 35;
|
|
1444
1411
|
return this.ClearSigner();
|
|
1445
1412
|
case 35:
|
|
1446
|
-
throw
|
|
1413
|
+
throw _context17.t0;
|
|
1447
1414
|
case 36:
|
|
1448
1415
|
case "end":
|
|
1449
|
-
return
|
|
1416
|
+
return _context17.stop();
|
|
1450
1417
|
}
|
|
1451
|
-
},
|
|
1418
|
+
}, _callee17, this, [[4, 29]]);
|
|
1452
1419
|
}));
|
|
1453
|
-
function SetSignerFromOauthToken(
|
|
1420
|
+
function SetSignerFromOauthToken(_x12) {
|
|
1454
1421
|
return _SetSignerFromOauthToken.apply(this, arguments);
|
|
1455
1422
|
}
|
|
1456
1423
|
return SetSignerFromOauthToken;
|
|
@@ -1464,7 +1431,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1464
1431
|
*
|
|
1465
1432
|
* @return {string} - The created static token
|
|
1466
1433
|
*/
|
|
1467
|
-
)
|
|
1468
1434
|
}, {
|
|
1469
1435
|
key: "CreateStaticToken",
|
|
1470
1436
|
value: function CreateStaticToken(_ref22) {
|
|
@@ -1523,31 +1489,31 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1523
1489
|
*/
|
|
1524
1490
|
}, {
|
|
1525
1491
|
key: "SetPolicyAuthorization",
|
|
1526
|
-
value:
|
|
1527
|
-
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1492
|
+
value: function () {
|
|
1493
|
+
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref24) {
|
|
1528
1494
|
var objectId;
|
|
1529
|
-
return _regeneratorRuntime.wrap(function
|
|
1530
|
-
while (1) switch (
|
|
1495
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1496
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1531
1497
|
case 0:
|
|
1532
1498
|
objectId = _ref24.objectId;
|
|
1533
|
-
|
|
1534
|
-
|
|
1499
|
+
_context18.t0 = this;
|
|
1500
|
+
_context18.next = 4;
|
|
1535
1501
|
return this.GenerateStateChannelToken({
|
|
1536
1502
|
objectId: objectId
|
|
1537
1503
|
});
|
|
1538
1504
|
case 4:
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
token:
|
|
1505
|
+
_context18.t1 = _context18.sent;
|
|
1506
|
+
_context18.t2 = {
|
|
1507
|
+
token: _context18.t1
|
|
1542
1508
|
};
|
|
1543
|
-
|
|
1509
|
+
_context18.t0.SetStaticToken.call(_context18.t0, _context18.t2);
|
|
1544
1510
|
case 7:
|
|
1545
1511
|
case "end":
|
|
1546
|
-
return
|
|
1512
|
+
return _context18.stop();
|
|
1547
1513
|
}
|
|
1548
|
-
},
|
|
1514
|
+
}, _callee18, this);
|
|
1549
1515
|
}));
|
|
1550
|
-
function SetPolicyAuthorization(
|
|
1516
|
+
function SetPolicyAuthorization(_x13) {
|
|
1551
1517
|
return _SetPolicyAuthorization.apply(this, arguments);
|
|
1552
1518
|
}
|
|
1553
1519
|
return SetPolicyAuthorization;
|
|
@@ -1558,27 +1524,26 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1558
1524
|
* @param {string} string - The string to sign
|
|
1559
1525
|
* @return {Promise<string>} - The signed string
|
|
1560
1526
|
*/
|
|
1561
|
-
)
|
|
1562
1527
|
}, {
|
|
1563
1528
|
key: "Sign",
|
|
1564
|
-
value:
|
|
1565
|
-
var _Sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1529
|
+
value: function () {
|
|
1530
|
+
var _Sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(string) {
|
|
1566
1531
|
var signature;
|
|
1567
|
-
return _regeneratorRuntime.wrap(function
|
|
1568
|
-
while (1) switch (
|
|
1532
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1533
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1569
1534
|
case 0:
|
|
1570
|
-
|
|
1535
|
+
_context19.next = 2;
|
|
1571
1536
|
return this.authClient.Sign(Ethers.utils.keccak256(Ethers.utils.toUtf8Bytes(string)));
|
|
1572
1537
|
case 2:
|
|
1573
|
-
signature =
|
|
1574
|
-
return
|
|
1538
|
+
signature = _context19.sent;
|
|
1539
|
+
return _context19.abrupt("return", this.utils.FormatSignature(signature));
|
|
1575
1540
|
case 4:
|
|
1576
1541
|
case "end":
|
|
1577
|
-
return
|
|
1542
|
+
return _context19.stop();
|
|
1578
1543
|
}
|
|
1579
|
-
},
|
|
1544
|
+
}, _callee19, this);
|
|
1580
1545
|
}));
|
|
1581
|
-
function Sign(
|
|
1546
|
+
function Sign(_x14) {
|
|
1582
1547
|
return _Sign.apply(this, arguments);
|
|
1583
1548
|
}
|
|
1584
1549
|
return Sign;
|
|
@@ -1592,34 +1557,33 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1592
1557
|
*
|
|
1593
1558
|
* @return {Promise<string>} - The encrypted message
|
|
1594
1559
|
*/
|
|
1595
|
-
)
|
|
1596
1560
|
}, {
|
|
1597
1561
|
key: "EncryptECIES",
|
|
1598
|
-
value:
|
|
1599
|
-
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1562
|
+
value: function () {
|
|
1563
|
+
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref25) {
|
|
1600
1564
|
var message, publicKey;
|
|
1601
|
-
return _regeneratorRuntime.wrap(function
|
|
1602
|
-
while (1) switch (
|
|
1565
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1566
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1603
1567
|
case 0:
|
|
1604
1568
|
message = _ref25.message, publicKey = _ref25.publicKey;
|
|
1605
1569
|
if (this.signer) {
|
|
1606
|
-
|
|
1570
|
+
_context20.next = 3;
|
|
1607
1571
|
break;
|
|
1608
1572
|
}
|
|
1609
1573
|
throw "Signer not set";
|
|
1610
1574
|
case 3:
|
|
1611
1575
|
ValidatePresence("message", message);
|
|
1612
|
-
|
|
1576
|
+
_context20.next = 6;
|
|
1613
1577
|
return this.Crypto.EncryptConk(message, publicKey || this.signer._signingKey().publicKey);
|
|
1614
1578
|
case 6:
|
|
1615
|
-
return
|
|
1579
|
+
return _context20.abrupt("return", _context20.sent);
|
|
1616
1580
|
case 7:
|
|
1617
1581
|
case "end":
|
|
1618
|
-
return
|
|
1582
|
+
return _context20.stop();
|
|
1619
1583
|
}
|
|
1620
|
-
},
|
|
1584
|
+
}, _callee20, this);
|
|
1621
1585
|
}));
|
|
1622
|
-
function EncryptECIES(
|
|
1586
|
+
function EncryptECIES(_x15) {
|
|
1623
1587
|
return _EncryptECIES.apply(this, arguments);
|
|
1624
1588
|
}
|
|
1625
1589
|
return EncryptECIES;
|
|
@@ -1632,34 +1596,33 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1632
1596
|
*
|
|
1633
1597
|
* @return {Promise<string | Object>} - The decrypted string or object
|
|
1634
1598
|
*/
|
|
1635
|
-
)
|
|
1636
1599
|
}, {
|
|
1637
1600
|
key: "DecryptECIES",
|
|
1638
|
-
value:
|
|
1639
|
-
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1601
|
+
value: function () {
|
|
1602
|
+
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref26) {
|
|
1640
1603
|
var message;
|
|
1641
|
-
return _regeneratorRuntime.wrap(function
|
|
1642
|
-
while (1) switch (
|
|
1604
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1605
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1643
1606
|
case 0:
|
|
1644
1607
|
message = _ref26.message;
|
|
1645
1608
|
if (this.signer) {
|
|
1646
|
-
|
|
1609
|
+
_context21.next = 3;
|
|
1647
1610
|
break;
|
|
1648
1611
|
}
|
|
1649
1612
|
throw "Signer not set";
|
|
1650
1613
|
case 3:
|
|
1651
1614
|
ValidatePresence("message", message);
|
|
1652
|
-
|
|
1615
|
+
_context21.next = 6;
|
|
1653
1616
|
return this.Crypto.DecryptCap(message, this.signer._signingKey().privateKey);
|
|
1654
1617
|
case 6:
|
|
1655
|
-
return
|
|
1618
|
+
return _context21.abrupt("return", _context21.sent);
|
|
1656
1619
|
case 7:
|
|
1657
1620
|
case "end":
|
|
1658
|
-
return
|
|
1621
|
+
return _context21.stop();
|
|
1659
1622
|
}
|
|
1660
|
-
},
|
|
1623
|
+
}, _callee21, this);
|
|
1661
1624
|
}));
|
|
1662
|
-
function DecryptECIES(
|
|
1625
|
+
function DecryptECIES(_x16) {
|
|
1663
1626
|
return _DecryptECIES.apply(this, arguments);
|
|
1664
1627
|
}
|
|
1665
1628
|
return DecryptECIES;
|
|
@@ -1675,39 +1638,38 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1675
1638
|
*
|
|
1676
1639
|
* @return {Promise<*>} - Response in the specified format
|
|
1677
1640
|
*/
|
|
1678
|
-
)
|
|
1679
1641
|
}, {
|
|
1680
1642
|
key: "Request",
|
|
1681
|
-
value:
|
|
1682
|
-
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1643
|
+
value: function () {
|
|
1644
|
+
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(_ref27) {
|
|
1683
1645
|
var url, _ref27$format, format, _ref27$method, method, _ref27$headers, headers, body;
|
|
1684
|
-
return _regeneratorRuntime.wrap(function
|
|
1685
|
-
while (1) switch (
|
|
1646
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1647
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1686
1648
|
case 0:
|
|
1687
1649
|
url = _ref27.url, _ref27$format = _ref27.format, format = _ref27$format === void 0 ? "json" : _ref27$format, _ref27$method = _ref27.method, method = _ref27$method === void 0 ? "GET" : _ref27$method, _ref27$headers = _ref27.headers, headers = _ref27$headers === void 0 ? {} : _ref27$headers, body = _ref27.body;
|
|
1688
|
-
return
|
|
1650
|
+
return _context22.abrupt("return", this.utils.ResponseToFormat(format, HttpClient.Fetch(url, {
|
|
1689
1651
|
method: method,
|
|
1690
1652
|
headers: headers,
|
|
1691
1653
|
body: body
|
|
1692
1654
|
})));
|
|
1693
1655
|
case 2:
|
|
1694
1656
|
case "end":
|
|
1695
|
-
return
|
|
1657
|
+
return _context22.stop();
|
|
1696
1658
|
}
|
|
1697
|
-
},
|
|
1659
|
+
}, _callee22, this);
|
|
1698
1660
|
}));
|
|
1699
|
-
function Request(
|
|
1661
|
+
function Request(_x17) {
|
|
1700
1662
|
return _Request.apply(this, arguments);
|
|
1701
1663
|
}
|
|
1702
1664
|
return Request;
|
|
1703
|
-
}()
|
|
1665
|
+
}()
|
|
1704
1666
|
}, {
|
|
1705
1667
|
key: "MakeAuthServiceRequest",
|
|
1706
1668
|
value: function () {
|
|
1707
|
-
var _MakeAuthServiceRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1669
|
+
var _MakeAuthServiceRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref28) {
|
|
1708
1670
|
var kmsId, objectId, versionHash, _ref28$method, method, path, bodyType, _ref28$body, body, _ref28$queryParams, queryParams, headers, format, response;
|
|
1709
|
-
return _regeneratorRuntime.wrap(function
|
|
1710
|
-
while (1) switch (
|
|
1671
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1672
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1711
1673
|
case 0:
|
|
1712
1674
|
kmsId = _ref28.kmsId, objectId = _ref28.objectId, versionHash = _ref28.versionHash, _ref28$method = _ref28.method, method = _ref28$method === void 0 ? "GET" : _ref28$method, path = _ref28.path, bodyType = _ref28.bodyType, _ref28$body = _ref28.body, body = _ref28$body === void 0 ? {} : _ref28$body, _ref28$queryParams = _ref28.queryParams, queryParams = _ref28$queryParams === void 0 ? {} : _ref28$queryParams, headers = _ref28.headers, format = _ref28.format;
|
|
1713
1675
|
response = this.authClient.MakeAuthServiceRequest({
|
|
@@ -1721,14 +1683,14 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1721
1683
|
queryParams: queryParams,
|
|
1722
1684
|
headers: headers
|
|
1723
1685
|
});
|
|
1724
|
-
return
|
|
1686
|
+
return _context23.abrupt("return", !format ? response : this.utils.ResponseToFormat(format, response));
|
|
1725
1687
|
case 3:
|
|
1726
1688
|
case "end":
|
|
1727
|
-
return
|
|
1689
|
+
return _context23.stop();
|
|
1728
1690
|
}
|
|
1729
|
-
},
|
|
1691
|
+
}, _callee23, this);
|
|
1730
1692
|
}));
|
|
1731
|
-
function MakeAuthServiceRequest(
|
|
1693
|
+
function MakeAuthServiceRequest(_x18) {
|
|
1732
1694
|
return _MakeAuthServiceRequest.apply(this, arguments);
|
|
1733
1695
|
}
|
|
1734
1696
|
return MakeAuthServiceRequest;
|
|
@@ -1738,10 +1700,10 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1738
1700
|
}, {
|
|
1739
1701
|
key: "FrameAllowedMethods",
|
|
1740
1702
|
value: function FrameAllowedMethods() {
|
|
1741
|
-
var
|
|
1703
|
+
var _this4 = this;
|
|
1742
1704
|
var forbiddenMethods = ["constructor", "AccessGroupMembershipMethod", "CallFromFrameMessage", "ClearSigner", "CreateAccount", "EnableMethodLogging", "FormatBlockNumbers", "FrameAllowedMethods", "FromConfigurationUrl", "GenerateWallet", "InitializeClients", "Log", "PersonalSign", "SetRemoteSigner", "SetSigner", "SetSignerFromWeb3Provider", "Sign", "ToggleLogging"];
|
|
1743
1705
|
return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(function (method) {
|
|
1744
|
-
return typeof
|
|
1706
|
+
return typeof _this4[method] === "function" && !forbiddenMethods.includes(method);
|
|
1745
1707
|
});
|
|
1746
1708
|
}
|
|
1747
1709
|
|
|
@@ -1749,21 +1711,21 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1749
1711
|
}, {
|
|
1750
1712
|
key: "CallFromFrameMessage",
|
|
1751
1713
|
value: function () {
|
|
1752
|
-
var _CallFromFrameMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1753
|
-
var
|
|
1714
|
+
var _CallFromFrameMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(message, Respond) {
|
|
1715
|
+
var _this5 = this;
|
|
1754
1716
|
var callback, method, methodResults, responseError;
|
|
1755
|
-
return _regeneratorRuntime.wrap(function
|
|
1756
|
-
while (1) switch (
|
|
1717
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1718
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1757
1719
|
case 0:
|
|
1758
1720
|
if (!(message.type !== "ElvFrameRequest")) {
|
|
1759
|
-
|
|
1721
|
+
_context24.next = 2;
|
|
1760
1722
|
break;
|
|
1761
1723
|
}
|
|
1762
|
-
return
|
|
1724
|
+
return _context24.abrupt("return");
|
|
1763
1725
|
case 2:
|
|
1764
1726
|
if (message.callbackId) {
|
|
1765
1727
|
callback = function callback(result) {
|
|
1766
|
-
Respond(
|
|
1728
|
+
Respond(_this5.utils.MakeClonable({
|
|
1767
1729
|
type: "ElvFrameResponse",
|
|
1768
1730
|
requestId: message.callbackId,
|
|
1769
1731
|
response: result
|
|
@@ -1771,103 +1733,101 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1771
1733
|
};
|
|
1772
1734
|
message.args.callback = callback;
|
|
1773
1735
|
}
|
|
1774
|
-
|
|
1736
|
+
_context24.prev = 3;
|
|
1775
1737
|
method = message.calledMethod;
|
|
1776
1738
|
if (!(message.module === "walletClient")) {
|
|
1777
|
-
|
|
1739
|
+
_context24.next = 15;
|
|
1778
1740
|
break;
|
|
1779
1741
|
}
|
|
1780
1742
|
if (this.walletClient) {
|
|
1781
|
-
|
|
1743
|
+
_context24.next = 8;
|
|
1782
1744
|
break;
|
|
1783
1745
|
}
|
|
1784
1746
|
throw Error("Wallet client not set");
|
|
1785
1747
|
case 8:
|
|
1786
1748
|
if (!this.walletClient.ForbiddenMethods().includes(method)) {
|
|
1787
|
-
|
|
1749
|
+
_context24.next = 10;
|
|
1788
1750
|
break;
|
|
1789
1751
|
}
|
|
1790
1752
|
throw Error("Invalid user profile method: " + method);
|
|
1791
1753
|
case 10:
|
|
1792
|
-
|
|
1754
|
+
_context24.next = 12;
|
|
1793
1755
|
return this.walletClient[method](message.args);
|
|
1794
1756
|
case 12:
|
|
1795
|
-
methodResults =
|
|
1796
|
-
|
|
1757
|
+
methodResults = _context24.sent;
|
|
1758
|
+
_context24.next = 28;
|
|
1797
1759
|
break;
|
|
1798
1760
|
case 15:
|
|
1799
1761
|
if (!(message.module === "userProfileClient")) {
|
|
1800
|
-
|
|
1762
|
+
_context24.next = 23;
|
|
1801
1763
|
break;
|
|
1802
1764
|
}
|
|
1803
1765
|
if (this.userProfileClient.FrameAllowedMethods().includes(method)) {
|
|
1804
|
-
|
|
1766
|
+
_context24.next = 18;
|
|
1805
1767
|
break;
|
|
1806
1768
|
}
|
|
1807
1769
|
throw Error("Invalid user profile method: " + method);
|
|
1808
1770
|
case 18:
|
|
1809
|
-
|
|
1771
|
+
_context24.next = 20;
|
|
1810
1772
|
return this.userProfileClient[method](message.args);
|
|
1811
1773
|
case 20:
|
|
1812
|
-
methodResults =
|
|
1813
|
-
|
|
1774
|
+
methodResults = _context24.sent;
|
|
1775
|
+
_context24.next = 28;
|
|
1814
1776
|
break;
|
|
1815
1777
|
case 23:
|
|
1816
1778
|
if (this.FrameAllowedMethods().includes(method)) {
|
|
1817
|
-
|
|
1779
|
+
_context24.next = 25;
|
|
1818
1780
|
break;
|
|
1819
1781
|
}
|
|
1820
1782
|
throw Error("Invalid method: " + method);
|
|
1821
1783
|
case 25:
|
|
1822
|
-
|
|
1784
|
+
_context24.next = 27;
|
|
1823
1785
|
return this[method](message.args);
|
|
1824
1786
|
case 27:
|
|
1825
|
-
methodResults =
|
|
1787
|
+
methodResults = _context24.sent;
|
|
1826
1788
|
case 28:
|
|
1827
1789
|
Respond(this.utils.MakeClonable({
|
|
1828
1790
|
type: "ElvFrameResponse",
|
|
1829
1791
|
requestId: message.requestId,
|
|
1830
1792
|
response: methodResults
|
|
1831
1793
|
}));
|
|
1832
|
-
|
|
1794
|
+
_context24.next = 37;
|
|
1833
1795
|
break;
|
|
1834
1796
|
case 31:
|
|
1835
|
-
|
|
1836
|
-
|
|
1797
|
+
_context24.prev = 31;
|
|
1798
|
+
_context24.t0 = _context24["catch"](3);
|
|
1837
1799
|
// eslint-disable-next-line no-console
|
|
1838
|
-
this.Log("Frame Message Error:\n Method: ".concat(message.calledMethod, "\n Arguments: ").concat(JSON.stringify(message.args, null, 2), "\n Error: ").concat(_typeof(
|
|
1800
|
+
this.Log("Frame Message Error:\n Method: ".concat(message.calledMethod, "\n Arguments: ").concat(JSON.stringify(message.args, null, 2), "\n Error: ").concat(_typeof(_context24.t0) === "object" ? JSON.stringify(_context24.t0, null, 2) : _context24.t0), true);
|
|
1839
1801
|
|
|
1840
1802
|
// eslint-disable-next-line no-console
|
|
1841
|
-
console.error(
|
|
1842
|
-
|
|
1843
|
-
console.error(_context25.t0);
|
|
1844
|
-
responseError = _context25.t0 instanceof Error ? _context25.t0.message : _context25.t0;
|
|
1803
|
+
console.error(_context24.t0);
|
|
1804
|
+
responseError = _context24.t0 instanceof Error ? _context24.t0.message : _context24.t0;
|
|
1845
1805
|
Respond(this.utils.MakeClonable({
|
|
1846
1806
|
type: "ElvFrameResponse",
|
|
1847
1807
|
requestId: message.requestId,
|
|
1848
1808
|
error: responseError
|
|
1849
1809
|
}));
|
|
1850
|
-
case
|
|
1810
|
+
case 37:
|
|
1851
1811
|
case "end":
|
|
1852
|
-
return
|
|
1812
|
+
return _context24.stop();
|
|
1853
1813
|
}
|
|
1854
|
-
},
|
|
1814
|
+
}, _callee24, this, [[3, 31]]);
|
|
1855
1815
|
}));
|
|
1856
|
-
function CallFromFrameMessage(
|
|
1816
|
+
function CallFromFrameMessage(_x19, _x20) {
|
|
1857
1817
|
return _CallFromFrameMessage.apply(this, arguments);
|
|
1858
1818
|
}
|
|
1859
1819
|
return CallFromFrameMessage;
|
|
1860
1820
|
}()
|
|
1861
1821
|
}], [{
|
|
1862
1822
|
key: "Configuration",
|
|
1863
|
-
value:
|
|
1864
|
-
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1823
|
+
value: function () {
|
|
1824
|
+
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref29) {
|
|
1865
1825
|
var configUrl, _ref29$kmsUrls, kmsUrls, region, clientIP, uri, fabricInfo, filterHTTPS, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion;
|
|
1866
|
-
return _regeneratorRuntime.wrap(function
|
|
1867
|
-
while (1) switch (
|
|
1826
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1827
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1868
1828
|
case 0:
|
|
1869
1829
|
configUrl = _ref29.configUrl, _ref29$kmsUrls = _ref29.kmsUrls, kmsUrls = _ref29$kmsUrls === void 0 ? [] : _ref29$kmsUrls, region = _ref29.region, clientIP = _ref29.clientIP;
|
|
1870
|
-
|
|
1830
|
+
_context25.prev = 1;
|
|
1871
1831
|
uri = new URI(configUrl);
|
|
1872
1832
|
uri.pathname("/config");
|
|
1873
1833
|
if (region) {
|
|
@@ -1876,10 +1836,10 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1876
1836
|
if (clientIP) {
|
|
1877
1837
|
uri.addSearch("client_ip", clientIP);
|
|
1878
1838
|
}
|
|
1879
|
-
|
|
1839
|
+
_context25.next = 8;
|
|
1880
1840
|
return Utils.ResponseToJson(HttpClient.Fetch(uri.toString()));
|
|
1881
1841
|
case 8:
|
|
1882
|
-
fabricInfo =
|
|
1842
|
+
fabricInfo = _context25.sent;
|
|
1883
1843
|
// If any HTTPS urls present, throw away HTTP urls so only HTTPS will be used
|
|
1884
1844
|
filterHTTPS = function filterHTTPS(uri) {
|
|
1885
1845
|
return uri.toLowerCase().startsWith("https");
|
|
@@ -1902,7 +1862,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1902
1862
|
}
|
|
1903
1863
|
searchURIs = fabricInfo.network.services.search || [];
|
|
1904
1864
|
fabricVersion = Math.max.apply(Math, _toConsumableArray(fabricInfo.network.api_versions || [2]));
|
|
1905
|
-
return
|
|
1865
|
+
return _context25.abrupt("return", {
|
|
1906
1866
|
nodeId: fabricInfo.node_id,
|
|
1907
1867
|
contentSpaceId: fabricInfo.qspace.id,
|
|
1908
1868
|
networkId: (fabricInfo.qspace.ethereum || {}).network_id,
|
|
@@ -1916,20 +1876,20 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1916
1876
|
fabricVersion: fabricVersion
|
|
1917
1877
|
});
|
|
1918
1878
|
case 23:
|
|
1919
|
-
|
|
1920
|
-
|
|
1879
|
+
_context25.prev = 23;
|
|
1880
|
+
_context25.t0 = _context25["catch"](1);
|
|
1921
1881
|
// eslint-disable-next-line no-console
|
|
1922
1882
|
console.error("Error retrieving fabric configuration:");
|
|
1923
1883
|
// eslint-disable-next-line no-console
|
|
1924
|
-
console.error(
|
|
1925
|
-
throw
|
|
1884
|
+
console.error(_context25.t0);
|
|
1885
|
+
throw _context25.t0;
|
|
1926
1886
|
case 28:
|
|
1927
1887
|
case "end":
|
|
1928
|
-
return
|
|
1888
|
+
return _context25.stop();
|
|
1929
1889
|
}
|
|
1930
|
-
},
|
|
1890
|
+
}, _callee25, null, [[1, 23]]);
|
|
1931
1891
|
}));
|
|
1932
|
-
function Configuration(
|
|
1892
|
+
function Configuration(_x21) {
|
|
1933
1893
|
return _Configuration.apply(this, arguments);
|
|
1934
1894
|
}
|
|
1935
1895
|
return Configuration;
|
|
@@ -1941,7 +1901,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1941
1901
|
*
|
|
1942
1902
|
* @return {Object} - An object using network names as keys and configuration URLs as values.
|
|
1943
1903
|
*/
|
|
1944
|
-
)
|
|
1945
1904
|
}, {
|
|
1946
1905
|
key: "Networks",
|
|
1947
1906
|
value: function Networks() {
|
|
@@ -1966,21 +1925,21 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1966
1925
|
*/
|
|
1967
1926
|
}, {
|
|
1968
1927
|
key: "FromNetworkName",
|
|
1969
|
-
value:
|
|
1970
|
-
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1928
|
+
value: function () {
|
|
1929
|
+
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref30) {
|
|
1971
1930
|
var networkName, region, clientIP, trustAuthorityId, staticToken, _ref30$ethereumContra, ethereumContractTimeout, _ref30$noCache, noCache, _ref30$noAuth, noAuth, assumeV3, configUrl;
|
|
1972
|
-
return _regeneratorRuntime.wrap(function
|
|
1973
|
-
while (1) switch (
|
|
1931
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1932
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1974
1933
|
case 0:
|
|
1975
1934
|
networkName = _ref30.networkName, region = _ref30.region, clientIP = _ref30.clientIP, trustAuthorityId = _ref30.trustAuthorityId, staticToken = _ref30.staticToken, _ref30$ethereumContra = _ref30.ethereumContractTimeout, ethereumContractTimeout = _ref30$ethereumContra === void 0 ? 10 : _ref30$ethereumContra, _ref30$noCache = _ref30.noCache, noCache = _ref30$noCache === void 0 ? false : _ref30$noCache, _ref30$noAuth = _ref30.noAuth, noAuth = _ref30$noAuth === void 0 ? false : _ref30$noAuth, assumeV3 = _ref30.assumeV3;
|
|
1976
1935
|
configUrl = networks[networkName];
|
|
1977
1936
|
if (configUrl) {
|
|
1978
|
-
|
|
1937
|
+
_context26.next = 4;
|
|
1979
1938
|
break;
|
|
1980
1939
|
}
|
|
1981
1940
|
throw Error("Invalid network name: " + networkName);
|
|
1982
1941
|
case 4:
|
|
1983
|
-
|
|
1942
|
+
_context26.next = 6;
|
|
1984
1943
|
return this.FromConfigurationUrl({
|
|
1985
1944
|
configUrl: configUrl,
|
|
1986
1945
|
region: region,
|
|
@@ -1993,14 +1952,14 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1993
1952
|
assumeV3: assumeV3
|
|
1994
1953
|
});
|
|
1995
1954
|
case 6:
|
|
1996
|
-
return
|
|
1955
|
+
return _context26.abrupt("return", _context26.sent);
|
|
1997
1956
|
case 7:
|
|
1998
1957
|
case "end":
|
|
1999
|
-
return
|
|
1958
|
+
return _context26.stop();
|
|
2000
1959
|
}
|
|
2001
|
-
},
|
|
1960
|
+
}, _callee26, this);
|
|
2002
1961
|
}));
|
|
2003
|
-
function FromNetworkName(
|
|
1962
|
+
function FromNetworkName(_x22) {
|
|
2004
1963
|
return _FromNetworkName.apply(this, arguments);
|
|
2005
1964
|
}
|
|
2006
1965
|
return FromNetworkName;
|
|
@@ -2021,24 +1980,23 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2021
1980
|
*
|
|
2022
1981
|
* @return {Promise<ElvClient>} - New ElvClient connected to the specified content fabric and blockchain
|
|
2023
1982
|
*/
|
|
2024
|
-
)
|
|
2025
1983
|
}, {
|
|
2026
1984
|
key: "FromConfigurationUrl",
|
|
2027
|
-
value:
|
|
2028
|
-
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1985
|
+
value: function () {
|
|
1986
|
+
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref31) {
|
|
2029
1987
|
var configUrl, region, clientIP, trustAuthorityId, staticToken, _ref31$ethereumContra, ethereumContractTimeout, _ref31$noCache, noCache, _ref31$noAuth, noAuth, _ref31$assumeV, assumeV3, _yield$ElvClient$Conf3, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion, client;
|
|
2030
|
-
return _regeneratorRuntime.wrap(function
|
|
2031
|
-
while (1) switch (
|
|
1988
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1989
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2032
1990
|
case 0:
|
|
2033
1991
|
configUrl = _ref31.configUrl, region = _ref31.region, clientIP = _ref31.clientIP, trustAuthorityId = _ref31.trustAuthorityId, staticToken = _ref31.staticToken, _ref31$ethereumContra = _ref31.ethereumContractTimeout, ethereumContractTimeout = _ref31$ethereumContra === void 0 ? 10 : _ref31$ethereumContra, _ref31$noCache = _ref31.noCache, noCache = _ref31$noCache === void 0 ? false : _ref31$noCache, _ref31$noAuth = _ref31.noAuth, noAuth = _ref31$noAuth === void 0 ? false : _ref31$noAuth, _ref31$assumeV = _ref31.assumeV3, assumeV3 = _ref31$assumeV === void 0 ? false : _ref31$assumeV;
|
|
2034
|
-
|
|
1992
|
+
_context27.next = 3;
|
|
2035
1993
|
return ElvClient.Configuration({
|
|
2036
1994
|
configUrl: configUrl,
|
|
2037
1995
|
clientIP: clientIP,
|
|
2038
1996
|
region: region
|
|
2039
1997
|
});
|
|
2040
1998
|
case 3:
|
|
2041
|
-
_yield$ElvClient$Conf3 =
|
|
1999
|
+
_yield$ElvClient$Conf3 = _context27.sent;
|
|
2042
2000
|
contentSpaceId = _yield$ElvClient$Conf3.contentSpaceId;
|
|
2043
2001
|
networkId = _yield$ElvClient$Conf3.networkId;
|
|
2044
2002
|
networkName = _yield$ElvClient$Conf3.networkName;
|
|
@@ -2068,19 +2026,20 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2068
2026
|
client.configUrl = configUrl;
|
|
2069
2027
|
client.region = region;
|
|
2070
2028
|
client.clientIP = clientIP;
|
|
2071
|
-
return
|
|
2029
|
+
return _context27.abrupt("return", client);
|
|
2072
2030
|
case 18:
|
|
2073
2031
|
case "end":
|
|
2074
|
-
return
|
|
2032
|
+
return _context27.stop();
|
|
2075
2033
|
}
|
|
2076
|
-
},
|
|
2034
|
+
}, _callee27);
|
|
2077
2035
|
}));
|
|
2078
|
-
function FromConfigurationUrl(
|
|
2036
|
+
function FromConfigurationUrl(_x23) {
|
|
2079
2037
|
return _FromConfigurationUrl.apply(this, arguments);
|
|
2080
2038
|
}
|
|
2081
2039
|
return FromConfigurationUrl;
|
|
2082
|
-
}()
|
|
2040
|
+
}()
|
|
2083
2041
|
}]);
|
|
2042
|
+
return ElvClient;
|
|
2084
2043
|
}();
|
|
2085
2044
|
Object.assign(ElvClient.prototype, require("./client/AccessGroups"));
|
|
2086
2045
|
Object.assign(ElvClient.prototype, require("./client/ContentAccess"));
|