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