@eluvio/elv-client-js 4.2.27 → 4.2.30
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 +1 -1
- package/dist/ElvClient-node-min.js +1 -1
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +1 -1
- package/dist/src/ElvClient.js +355 -275
- package/dist/src/EthClient.js +3 -2
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/client/ABRPublishing.js +71 -60
- package/dist/src/client/ContentAccess.js +298 -204
- package/dist/src/client/Files.js +1400 -844
- package/dist/src/client/LiveConf.js +54 -37
- package/dist/src/client/LiveStream.js +123 -81
- package/package.json +1 -1
- package/src/ElvClient.js +51 -0
- package/src/EthClient.js +2 -1
- package/src/FrameClient.js +1 -0
- package/src/client/ContentAccess.js +70 -1
- package/src/client/Files.js +413 -208
- package/src/client/LiveStream.js +32 -16
- package/utilities/MigrateEncryptionConkForNewUser.js +62 -0
- package/utilities/ObjectAddFiles.js +29 -9
- package/utilities/lib/concerns/CloudFile.js +2 -1
- package/utilities/lib/concerns/LocalFile.js +2 -1
- package/dist/src/ContentObjectVerification.js +0 -281
package/dist/src/ElvClient.js
CHANGED
|
@@ -1001,65 +1001,145 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1001
1001
|
PAYLOAD 85b json-compressed
|
|
1002
1002
|
json 79b {"adr":"VVf4DQU357tDnZGYQeDrntRJ5rs=","spc":"ispc3ANoVSzNA3P6t7abLR69ho5YPPZU"}
|
|
1003
1003
|
*/
|
|
1004
|
+
/*
|
|
1005
|
+
PLAIN TOKEN PREFIX + BODY | aplsjcJf1HYcDDUuCdXcSZtU86nYK162YmYJeuqwMczEBJVkD5D5EvsBvVwYDRsf4hzDvBWMoe9piBpqx...
|
|
1006
|
+
PREFIX 6b aplsjc | apl=plain s=ES256K jc=json-compressed
|
|
1007
|
+
BODY base58(SIGNATURE + PAYLOAD)
|
|
1008
|
+
SIGNATURE 65b ES256K signature
|
|
1009
|
+
PAYLOAD raw-deflate JSON
|
|
1010
|
+
json {"adr":"VVf4DQU357tDnZGYQeDrntRJ5rs=","spc":"ispc3ANoVSzNA3P6t7abLR69ho5YPPZU"}
|
|
1011
|
+
*/
|
|
1012
|
+
/**
|
|
1013
|
+
* Create a signed "plain" authorization token (`aplsjc...`).
|
|
1014
|
+
*
|
|
1015
|
+
* Plain tokens are largely the same as client-signed access tokens - they do not contain a b/c transaction
|
|
1016
|
+
* and authorization is determined from the rights of the current signer's address.
|
|
1017
|
+
* Currently needed for tenant content query /tenant/:tid/q/query
|
|
1018
|
+
* This token will be deprecated in the future in favor of client-signed access tokens.
|
|
1019
|
+
*
|
|
1020
|
+
* @methodGroup Authorization
|
|
1021
|
+
* @namedParams
|
|
1022
|
+
* @param {string=} libraryId - Optional library ID to scope the token. If omitted, the token is space-wide.
|
|
1023
|
+
* @returns {Promise<string>} - The signed Plain auth token
|
|
1024
|
+
*/
|
|
1025
|
+
}, {
|
|
1026
|
+
key: "CreatePlainToken",
|
|
1027
|
+
value: function () {
|
|
1028
|
+
var _CreatePlainToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
1029
|
+
var _ref15,
|
|
1030
|
+
libraryId,
|
|
1031
|
+
address,
|
|
1032
|
+
token,
|
|
1033
|
+
compressedToken,
|
|
1034
|
+
signature,
|
|
1035
|
+
signatureBytes,
|
|
1036
|
+
_args11 = arguments;
|
|
1037
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
1038
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1039
|
+
case 0:
|
|
1040
|
+
_ref15 = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {}, libraryId = _ref15.libraryId;
|
|
1041
|
+
address = this.CurrentAccountAddress();
|
|
1042
|
+
if (address) {
|
|
1043
|
+
_context11.next = 4;
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
throw Error("Unable to create plain token: No signer is configured");
|
|
1047
|
+
case 4:
|
|
1048
|
+
_context11.t0 = Buffer.from(address.replace(/^0x/, ""), "hex").toString("base64");
|
|
1049
|
+
_context11.next = 7;
|
|
1050
|
+
return this.ContentSpaceId();
|
|
1051
|
+
case 7:
|
|
1052
|
+
_context11.t1 = _context11.sent;
|
|
1053
|
+
token = {
|
|
1054
|
+
adr: _context11.t0,
|
|
1055
|
+
spc: _context11.t1
|
|
1056
|
+
};
|
|
1057
|
+
if (libraryId) {
|
|
1058
|
+
token.lib = libraryId;
|
|
1059
|
+
}
|
|
1060
|
+
compressedToken = Pako.deflateRaw(Buffer.from(JSON.stringify(token), "utf-8"));
|
|
1061
|
+
_context11.next = 13;
|
|
1062
|
+
return this.authClient.Sign(Ethers.utils.keccak256(compressedToken));
|
|
1063
|
+
case 13:
|
|
1064
|
+
signature = _context11.sent;
|
|
1065
|
+
signatureBytes = Buffer.from(signature.replace(/^0x/, ""), "hex");
|
|
1066
|
+
if (!(signatureBytes.length !== 65)) {
|
|
1067
|
+
_context11.next = 17;
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
throw Error("Unable to create plain token: Expected a 65-byte ES256K signature");
|
|
1071
|
+
case 17:
|
|
1072
|
+
return _context11.abrupt("return", "aplsjc".concat(this.utils.B58(Buffer.concat([signatureBytes, Buffer.from(compressedToken)]))));
|
|
1073
|
+
case 18:
|
|
1074
|
+
case "end":
|
|
1075
|
+
return _context11.stop();
|
|
1076
|
+
}
|
|
1077
|
+
}, _callee11, this);
|
|
1078
|
+
}));
|
|
1079
|
+
function CreatePlainToken() {
|
|
1080
|
+
return _CreatePlainToken.apply(this, arguments);
|
|
1081
|
+
}
|
|
1082
|
+
return CreatePlainToken;
|
|
1083
|
+
}()
|
|
1004
1084
|
}, {
|
|
1005
1085
|
key: "PersonalSign",
|
|
1006
1086
|
value: function () {
|
|
1007
|
-
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1087
|
+
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref16) {
|
|
1008
1088
|
var _this2 = this;
|
|
1009
1089
|
var message, addEthereumPrefix, Sign;
|
|
1010
|
-
return _regeneratorRuntime.wrap(function
|
|
1011
|
-
while (1) switch (
|
|
1090
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1091
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1012
1092
|
case 0:
|
|
1013
|
-
message =
|
|
1093
|
+
message = _ref16.message, addEthereumPrefix = _ref16.addEthereumPrefix, Sign = _ref16.Sign;
|
|
1014
1094
|
if (!Sign) {
|
|
1015
1095
|
// Same as authClient.Sign, but authClient may not yet be initialized
|
|
1016
1096
|
Sign = /*#__PURE__*/function () {
|
|
1017
|
-
var
|
|
1018
|
-
return _regeneratorRuntime.wrap(function
|
|
1019
|
-
while (1) switch (
|
|
1097
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(message) {
|
|
1098
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
1099
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1020
1100
|
case 0:
|
|
1021
|
-
|
|
1101
|
+
_context12.t0 = Ethers.utils;
|
|
1022
1102
|
if (!_this2.signer.signDigest) {
|
|
1023
|
-
|
|
1103
|
+
_context12.next = 7;
|
|
1024
1104
|
break;
|
|
1025
1105
|
}
|
|
1026
|
-
|
|
1106
|
+
_context12.next = 4;
|
|
1027
1107
|
return _this2.signer.signDigest(message);
|
|
1028
1108
|
case 4:
|
|
1029
|
-
|
|
1030
|
-
|
|
1109
|
+
_context12.t1 = _context12.sent;
|
|
1110
|
+
_context12.next = 10;
|
|
1031
1111
|
break;
|
|
1032
1112
|
case 7:
|
|
1033
|
-
|
|
1113
|
+
_context12.next = 9;
|
|
1034
1114
|
return _this2.signer._signingKey().signDigest(message);
|
|
1035
1115
|
case 9:
|
|
1036
|
-
|
|
1116
|
+
_context12.t1 = _context12.sent;
|
|
1037
1117
|
case 10:
|
|
1038
|
-
|
|
1039
|
-
return
|
|
1118
|
+
_context12.t2 = _context12.t1;
|
|
1119
|
+
return _context12.abrupt("return", _context12.t0.joinSignature.call(_context12.t0, _context12.t2));
|
|
1040
1120
|
case 12:
|
|
1041
1121
|
case "end":
|
|
1042
|
-
return
|
|
1122
|
+
return _context12.stop();
|
|
1043
1123
|
}
|
|
1044
|
-
},
|
|
1124
|
+
}, _callee12);
|
|
1045
1125
|
}));
|
|
1046
1126
|
return function Sign(_x8) {
|
|
1047
|
-
return
|
|
1127
|
+
return _ref17.apply(this, arguments);
|
|
1048
1128
|
};
|
|
1049
1129
|
}();
|
|
1050
1130
|
}
|
|
1051
1131
|
if (addEthereumPrefix) {
|
|
1052
1132
|
message = Ethers.utils.keccak256(Buffer.from("\x19Ethereum Signed Message:\n".concat(message.length).concat(message), "utf-8"));
|
|
1053
1133
|
}
|
|
1054
|
-
|
|
1134
|
+
_context13.next = 5;
|
|
1055
1135
|
return Sign(message);
|
|
1056
1136
|
case 5:
|
|
1057
|
-
return
|
|
1137
|
+
return _context13.abrupt("return", _context13.sent);
|
|
1058
1138
|
case 6:
|
|
1059
1139
|
case "end":
|
|
1060
|
-
return
|
|
1140
|
+
return _context13.stop();
|
|
1061
1141
|
}
|
|
1062
|
-
},
|
|
1142
|
+
}, _callee13);
|
|
1063
1143
|
}));
|
|
1064
1144
|
function PersonalSign(_x7) {
|
|
1065
1145
|
return _PersonalSign.apply(this, arguments);
|
|
@@ -1080,65 +1160,65 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1080
1160
|
}, {
|
|
1081
1161
|
key: "CreateFabricToken",
|
|
1082
1162
|
value: function () {
|
|
1083
|
-
var _CreateFabricToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1163
|
+
var _CreateFabricToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
1164
|
+
var _ref18,
|
|
1165
|
+
_ref18$duration,
|
|
1086
1166
|
duration,
|
|
1087
|
-
|
|
1167
|
+
_ref18$spec,
|
|
1088
1168
|
spec,
|
|
1089
1169
|
address,
|
|
1090
1170
|
Sign,
|
|
1091
|
-
|
|
1171
|
+
_ref18$addEthereumPre,
|
|
1092
1172
|
addEthereumPrefix,
|
|
1093
|
-
|
|
1173
|
+
_ref18$context,
|
|
1094
1174
|
context,
|
|
1095
1175
|
token,
|
|
1096
1176
|
message,
|
|
1097
1177
|
signature,
|
|
1098
1178
|
compressedToken,
|
|
1099
|
-
|
|
1100
|
-
return _regeneratorRuntime.wrap(function
|
|
1101
|
-
while (1) switch (
|
|
1179
|
+
_args14 = arguments;
|
|
1180
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1181
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1102
1182
|
case 0:
|
|
1103
|
-
|
|
1183
|
+
_ref18 = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {}, _ref18$duration = _ref18.duration, duration = _ref18$duration === void 0 ? 24 * 60 * 60 * 1000 : _ref18$duration, _ref18$spec = _ref18.spec, spec = _ref18$spec === void 0 ? {} : _ref18$spec, address = _ref18.address, Sign = _ref18.Sign, _ref18$addEthereumPre = _ref18.addEthereumPrefix, addEthereumPrefix = _ref18$addEthereumPre === void 0 ? true : _ref18$addEthereumPre, _ref18$context = _ref18.context, context = _ref18$context === void 0 ? {} : _ref18$context;
|
|
1104
1184
|
address = address || this.CurrentAccountAddress();
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1185
|
+
_context14.t0 = _objectSpread;
|
|
1186
|
+
_context14.t1 = _objectSpread({}, spec);
|
|
1187
|
+
_context14.t2 = {};
|
|
1188
|
+
_context14.t3 = "iusr".concat(Utils.AddressToHash(address));
|
|
1189
|
+
_context14.t4 = Buffer.from(address.replace(/^0x/, ""), "hex").toString("base64");
|
|
1190
|
+
_context14.next = 9;
|
|
1111
1191
|
return this.ContentSpaceId();
|
|
1112
1192
|
case 9:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
sub:
|
|
1119
|
-
adr:
|
|
1120
|
-
spc:
|
|
1121
|
-
iat:
|
|
1122
|
-
exp:
|
|
1123
|
-
ctx:
|
|
1193
|
+
_context14.t5 = _context14.sent;
|
|
1194
|
+
_context14.t6 = Date.now();
|
|
1195
|
+
_context14.t7 = Date.now() + duration;
|
|
1196
|
+
_context14.t8 = context;
|
|
1197
|
+
_context14.t9 = {
|
|
1198
|
+
sub: _context14.t3,
|
|
1199
|
+
adr: _context14.t4,
|
|
1200
|
+
spc: _context14.t5,
|
|
1201
|
+
iat: _context14.t6,
|
|
1202
|
+
exp: _context14.t7,
|
|
1203
|
+
ctx: _context14.t8
|
|
1124
1204
|
};
|
|
1125
|
-
token = (0,
|
|
1205
|
+
token = (0, _context14.t0)(_context14.t1, _context14.t2, _context14.t9);
|
|
1126
1206
|
message = "Eluvio Content Fabric Access Token 1.0\n".concat(JSON.stringify(token));
|
|
1127
|
-
|
|
1207
|
+
_context14.next = 18;
|
|
1128
1208
|
return this.PersonalSign({
|
|
1129
1209
|
message: message,
|
|
1130
1210
|
addEthereumPrefix: addEthereumPrefix,
|
|
1131
1211
|
Sign: Sign
|
|
1132
1212
|
});
|
|
1133
1213
|
case 18:
|
|
1134
|
-
signature =
|
|
1214
|
+
signature = _context14.sent;
|
|
1135
1215
|
compressedToken = Pako.deflateRaw(Buffer.from(JSON.stringify(token), "utf-8"));
|
|
1136
|
-
return
|
|
1216
|
+
return _context14.abrupt("return", "acspjc".concat(this.utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(compressedToken)]))));
|
|
1137
1217
|
case 21:
|
|
1138
1218
|
case "end":
|
|
1139
|
-
return
|
|
1219
|
+
return _context14.stop();
|
|
1140
1220
|
}
|
|
1141
|
-
},
|
|
1221
|
+
}, _callee14, this);
|
|
1142
1222
|
}));
|
|
1143
1223
|
function CreateFabricToken() {
|
|
1144
1224
|
return _CreateFabricToken.apply(this, arguments);
|
|
@@ -1166,99 +1246,99 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1166
1246
|
}, {
|
|
1167
1247
|
key: "CreateSignedToken",
|
|
1168
1248
|
value: function () {
|
|
1169
|
-
var _CreateSignedToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1170
|
-
var libraryId, objectId, versionHash, policyId, subject,
|
|
1171
|
-
return _regeneratorRuntime.wrap(function
|
|
1172
|
-
while (1) switch (
|
|
1249
|
+
var _CreateSignedToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref19) {
|
|
1250
|
+
var libraryId, objectId, versionHash, policyId, subject, _ref19$grantType, grantType, _ref19$allowDecryptio, allowDecryption, duration, _ref19$context, context, issueTime, expirationTime, issueDateTime, token, cap, compressedToken, signature;
|
|
1251
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
1252
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1173
1253
|
case 0:
|
|
1174
|
-
libraryId =
|
|
1254
|
+
libraryId = _ref19.libraryId, objectId = _ref19.objectId, versionHash = _ref19.versionHash, policyId = _ref19.policyId, subject = _ref19.subject, _ref19$grantType = _ref19.grantType, grantType = _ref19$grantType === void 0 ? "read" : _ref19$grantType, _ref19$allowDecryptio = _ref19.allowDecryption, allowDecryption = _ref19$allowDecryptio === void 0 ? false : _ref19$allowDecryptio, duration = _ref19.duration, _ref19$context = _ref19.context, context = _ref19$context === void 0 ? {} : _ref19$context, issueTime = _ref19.issueTime, expirationTime = _ref19.expirationTime;
|
|
1175
1255
|
if (subject) {
|
|
1176
|
-
|
|
1256
|
+
_context15.next = 9;
|
|
1177
1257
|
break;
|
|
1178
1258
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1259
|
+
_context15.t0 = "iusr";
|
|
1260
|
+
_context15.t1 = this.utils;
|
|
1261
|
+
_context15.next = 6;
|
|
1182
1262
|
return this.CurrentAccountAddress();
|
|
1183
1263
|
case 6:
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
subject =
|
|
1264
|
+
_context15.t2 = _context15.sent;
|
|
1265
|
+
_context15.t3 = _context15.t1.AddressToHash.call(_context15.t1, _context15.t2);
|
|
1266
|
+
subject = _context15.t0.concat.call(_context15.t0, _context15.t3);
|
|
1187
1267
|
case 9:
|
|
1188
1268
|
if (policyId) {
|
|
1189
1269
|
context["elv:delegation-id"] = policyId;
|
|
1190
1270
|
}
|
|
1191
1271
|
issueDateTime = issueTime || Date.now();
|
|
1192
|
-
|
|
1193
|
-
|
|
1272
|
+
_context15.t4 = Buffer;
|
|
1273
|
+
_context15.next = 14;
|
|
1194
1274
|
return this.CurrentAccountAddress().replace(/^0x/, "");
|
|
1195
1275
|
case 14:
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1276
|
+
_context15.t5 = _context15.sent;
|
|
1277
|
+
_context15.t6 = _context15.t4.from.call(_context15.t4, _context15.t5, "hex").toString("base64");
|
|
1278
|
+
_context15.t7 = subject;
|
|
1279
|
+
_context15.next = 19;
|
|
1200
1280
|
return this.ContentSpaceId();
|
|
1201
1281
|
case 19:
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1282
|
+
_context15.t8 = _context15.sent;
|
|
1283
|
+
_context15.t9 = issueDateTime;
|
|
1284
|
+
_context15.t10 = expirationTime || issueDateTime + duration;
|
|
1285
|
+
_context15.t11 = grantType;
|
|
1286
|
+
_context15.t12 = context;
|
|
1207
1287
|
token = {
|
|
1208
|
-
adr:
|
|
1209
|
-
sub:
|
|
1210
|
-
spc:
|
|
1211
|
-
iat:
|
|
1212
|
-
exp:
|
|
1213
|
-
gra:
|
|
1214
|
-
ctx:
|
|
1288
|
+
adr: _context15.t6,
|
|
1289
|
+
sub: _context15.t7,
|
|
1290
|
+
spc: _context15.t8,
|
|
1291
|
+
iat: _context15.t9,
|
|
1292
|
+
exp: _context15.t10,
|
|
1293
|
+
gra: _context15.t11,
|
|
1294
|
+
ctx: _context15.t12
|
|
1215
1295
|
};
|
|
1216
1296
|
if (versionHash) {
|
|
1217
1297
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
1218
1298
|
}
|
|
1219
1299
|
if (!objectId) {
|
|
1220
|
-
|
|
1300
|
+
_context15.next = 32;
|
|
1221
1301
|
break;
|
|
1222
1302
|
}
|
|
1223
1303
|
token.qid = objectId;
|
|
1224
1304
|
if (libraryId) {
|
|
1225
|
-
|
|
1305
|
+
_context15.next = 32;
|
|
1226
1306
|
break;
|
|
1227
1307
|
}
|
|
1228
|
-
|
|
1308
|
+
_context15.next = 31;
|
|
1229
1309
|
return this.ContentObjectLibraryId({
|
|
1230
1310
|
objectId: objectId
|
|
1231
1311
|
});
|
|
1232
1312
|
case 31:
|
|
1233
|
-
libraryId =
|
|
1313
|
+
libraryId = _context15.sent;
|
|
1234
1314
|
case 32:
|
|
1235
1315
|
if (libraryId) {
|
|
1236
1316
|
token.lib = libraryId;
|
|
1237
1317
|
}
|
|
1238
1318
|
if (!allowDecryption) {
|
|
1239
|
-
|
|
1319
|
+
_context15.next = 38;
|
|
1240
1320
|
break;
|
|
1241
1321
|
}
|
|
1242
|
-
|
|
1322
|
+
_context15.next = 36;
|
|
1243
1323
|
return this.authClient.ReEncryptionConk({
|
|
1244
1324
|
libraryId: libraryId,
|
|
1245
1325
|
objectId: objectId
|
|
1246
1326
|
});
|
|
1247
1327
|
case 36:
|
|
1248
|
-
cap =
|
|
1328
|
+
cap = _context15.sent;
|
|
1249
1329
|
token.apk = cap.public_key;
|
|
1250
1330
|
case 38:
|
|
1251
1331
|
compressedToken = Pako.deflateRaw(Buffer.from(JSON.stringify(token), "utf-8"));
|
|
1252
|
-
|
|
1332
|
+
_context15.next = 41;
|
|
1253
1333
|
return this.authClient.Sign(Ethers.utils.keccak256(compressedToken));
|
|
1254
1334
|
case 41:
|
|
1255
|
-
signature =
|
|
1256
|
-
return
|
|
1335
|
+
signature = _context15.sent;
|
|
1336
|
+
return _context15.abrupt("return", "aessjc".concat(this.utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(compressedToken)]))));
|
|
1257
1337
|
case 43:
|
|
1258
1338
|
case "end":
|
|
1259
|
-
return
|
|
1339
|
+
return _context15.stop();
|
|
1260
1340
|
}
|
|
1261
|
-
},
|
|
1341
|
+
}, _callee15, this);
|
|
1262
1342
|
}));
|
|
1263
1343
|
function CreateSignedToken(_x9) {
|
|
1264
1344
|
return _CreateSignedToken.apply(this, arguments);
|
|
@@ -1268,19 +1348,19 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1268
1348
|
}, {
|
|
1269
1349
|
key: "CreateAuthorizationToken",
|
|
1270
1350
|
value: function () {
|
|
1271
|
-
var _CreateAuthorizationToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1272
|
-
return _regeneratorRuntime.wrap(function
|
|
1273
|
-
while (1) switch (
|
|
1351
|
+
var _CreateAuthorizationToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(args) {
|
|
1352
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
1353
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1274
1354
|
case 0:
|
|
1275
|
-
|
|
1355
|
+
_context16.next = 2;
|
|
1276
1356
|
return this.authClient.AuthorizationToken(args);
|
|
1277
1357
|
case 2:
|
|
1278
|
-
return
|
|
1358
|
+
return _context16.abrupt("return", _context16.sent);
|
|
1279
1359
|
case 3:
|
|
1280
1360
|
case "end":
|
|
1281
|
-
return
|
|
1361
|
+
return _context16.stop();
|
|
1282
1362
|
}
|
|
1283
|
-
},
|
|
1363
|
+
}, _callee16, this);
|
|
1284
1364
|
}));
|
|
1285
1365
|
function CreateAuthorizationToken(_x10) {
|
|
1286
1366
|
return _CreateAuthorizationToken.apply(this, arguments);
|
|
@@ -1304,28 +1384,28 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1304
1384
|
}, {
|
|
1305
1385
|
key: "CreateSignedMessageJSON",
|
|
1306
1386
|
value: function () {
|
|
1307
|
-
var _CreateSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1387
|
+
var _CreateSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref20) {
|
|
1308
1388
|
var message, type, msg, signature;
|
|
1309
|
-
return _regeneratorRuntime.wrap(function
|
|
1310
|
-
while (1) switch (
|
|
1389
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1390
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1311
1391
|
case 0:
|
|
1312
|
-
message =
|
|
1392
|
+
message = _ref20.message;
|
|
1313
1393
|
// Only one kind of signature supported currently
|
|
1314
1394
|
type = "mje_"; // JSON message, EIP192 signature
|
|
1315
1395
|
msg = JSON.stringify(message);
|
|
1316
|
-
|
|
1396
|
+
_context17.next = 5;
|
|
1317
1397
|
return this.PersonalSign({
|
|
1318
1398
|
message: msg,
|
|
1319
1399
|
addEthereumPrefix: true
|
|
1320
1400
|
});
|
|
1321
1401
|
case 5:
|
|
1322
|
-
signature =
|
|
1323
|
-
return
|
|
1402
|
+
signature = _context17.sent;
|
|
1403
|
+
return _context17.abrupt("return", "".concat(type).concat(Utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(msg)]))));
|
|
1324
1404
|
case 7:
|
|
1325
1405
|
case "end":
|
|
1326
|
-
return
|
|
1406
|
+
return _context17.stop();
|
|
1327
1407
|
}
|
|
1328
|
-
},
|
|
1408
|
+
}, _callee17, this);
|
|
1329
1409
|
}));
|
|
1330
1410
|
function CreateSignedMessageJSON(_x11) {
|
|
1331
1411
|
return _CreateSignedMessageJSON.apply(this, arguments);
|
|
@@ -1343,15 +1423,15 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1343
1423
|
}, {
|
|
1344
1424
|
key: "DecodeSignedMessageJSON",
|
|
1345
1425
|
value: function () {
|
|
1346
|
-
var _DecodeSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1426
|
+
var _DecodeSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref21) {
|
|
1347
1427
|
var signedMessage, type, msgBytes, signature, msg, obj, prefixedMsgHash, signerAddr;
|
|
1348
|
-
return _regeneratorRuntime.wrap(function
|
|
1349
|
-
while (1) switch (
|
|
1428
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1429
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1350
1430
|
case 0:
|
|
1351
|
-
signedMessage =
|
|
1431
|
+
signedMessage = _ref21.signedMessage;
|
|
1352
1432
|
type = signedMessage.slice(0, 4);
|
|
1353
|
-
|
|
1354
|
-
|
|
1433
|
+
_context18.t0 = type;
|
|
1434
|
+
_context18.next = _context18.t0 === "mje_" ? 5 : 12;
|
|
1355
1435
|
break;
|
|
1356
1436
|
case 5:
|
|
1357
1437
|
msgBytes = Utils.FromB58(signedMessage.slice(4));
|
|
@@ -1360,7 +1440,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1360
1440
|
obj = JSON.parse(msg);
|
|
1361
1441
|
prefixedMsgHash = Ethers.utils.keccak256(Buffer.from("\x19Ethereum Signed Message:\n".concat(msg.length).concat(msg), "utf-8"));
|
|
1362
1442
|
signerAddr = Ethers.utils.recoverAddress(prefixedMsgHash, signature);
|
|
1363
|
-
return
|
|
1443
|
+
return _context18.abrupt("return", {
|
|
1364
1444
|
type: type,
|
|
1365
1445
|
message: obj,
|
|
1366
1446
|
signerAddress: signerAddr,
|
|
@@ -1370,9 +1450,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1370
1450
|
throw new Error("Bad message type: ".concat(type));
|
|
1371
1451
|
case 13:
|
|
1372
1452
|
case "end":
|
|
1373
|
-
return
|
|
1453
|
+
return _context18.stop();
|
|
1374
1454
|
}
|
|
1375
|
-
},
|
|
1455
|
+
}, _callee18);
|
|
1376
1456
|
}));
|
|
1377
1457
|
function DecodeSignedMessageJSON(_x12) {
|
|
1378
1458
|
return _DecodeSignedMessageJSON.apply(this, arguments);
|
|
@@ -1401,12 +1481,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1401
1481
|
}, {
|
|
1402
1482
|
key: "SetOauthToken",
|
|
1403
1483
|
value: function () {
|
|
1404
|
-
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1484
|
+
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref22) {
|
|
1405
1485
|
var token, wallet, signer;
|
|
1406
|
-
return _regeneratorRuntime.wrap(function
|
|
1407
|
-
while (1) switch (
|
|
1486
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1487
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1408
1488
|
case 0:
|
|
1409
|
-
token =
|
|
1489
|
+
token = _ref22.token;
|
|
1410
1490
|
this.oauthToken = token;
|
|
1411
1491
|
wallet = this.GenerateWallet();
|
|
1412
1492
|
signer = wallet.AddAccountFromMnemonic({
|
|
@@ -1417,9 +1497,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1417
1497
|
});
|
|
1418
1498
|
case 5:
|
|
1419
1499
|
case "end":
|
|
1420
|
-
return
|
|
1500
|
+
return _context19.stop();
|
|
1421
1501
|
}
|
|
1422
|
-
},
|
|
1502
|
+
}, _callee19, this);
|
|
1423
1503
|
}));
|
|
1424
1504
|
function SetOauthToken(_x13) {
|
|
1425
1505
|
return _SetOauthToken.apply(this, arguments);
|
|
@@ -1439,44 +1519,44 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1439
1519
|
}, {
|
|
1440
1520
|
key: "SetSignerFromOauthToken",
|
|
1441
1521
|
value: function () {
|
|
1442
|
-
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1522
|
+
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref23) {
|
|
1443
1523
|
var token, wallet, client, _yield$client$authCli, urls, path, httpClient, response, privateKey;
|
|
1444
|
-
return _regeneratorRuntime.wrap(function
|
|
1445
|
-
while (1) switch (
|
|
1524
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1525
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1446
1526
|
case 0:
|
|
1447
|
-
token =
|
|
1527
|
+
token = _ref23.token;
|
|
1448
1528
|
if (this.trustAuthorityId) {
|
|
1449
|
-
|
|
1529
|
+
_context20.next = 3;
|
|
1450
1530
|
break;
|
|
1451
1531
|
}
|
|
1452
1532
|
throw Error("Unable to authorize with OAuth token: No trust authority ID set");
|
|
1453
1533
|
case 3:
|
|
1454
1534
|
wallet = this.GenerateWallet();
|
|
1455
|
-
|
|
1535
|
+
_context20.prev = 4;
|
|
1456
1536
|
if (this.kmsURIs) {
|
|
1457
|
-
|
|
1537
|
+
_context20.next = 17;
|
|
1458
1538
|
break;
|
|
1459
1539
|
}
|
|
1460
|
-
|
|
1540
|
+
_context20.next = 8;
|
|
1461
1541
|
return ElvClient.FromConfigurationUrl({
|
|
1462
1542
|
configUrl: this.configUrl
|
|
1463
1543
|
});
|
|
1464
1544
|
case 8:
|
|
1465
|
-
client =
|
|
1545
|
+
client = _context20.sent;
|
|
1466
1546
|
client.SetSigner({
|
|
1467
1547
|
signer: wallet.AddAccount({
|
|
1468
1548
|
privateKey: this.defaultKey
|
|
1469
1549
|
})
|
|
1470
1550
|
});
|
|
1471
|
-
|
|
1551
|
+
_context20.next = 12;
|
|
1472
1552
|
return client.authClient.KMSInfo({
|
|
1473
1553
|
kmsId: this.trustAuthorityId
|
|
1474
1554
|
});
|
|
1475
1555
|
case 12:
|
|
1476
|
-
_yield$client$authCli =
|
|
1556
|
+
_yield$client$authCli = _context20.sent;
|
|
1477
1557
|
urls = _yield$client$authCli.urls;
|
|
1478
1558
|
if (!(!urls || urls.length === 0)) {
|
|
1479
|
-
|
|
1559
|
+
_context20.next = 16;
|
|
1480
1560
|
break;
|
|
1481
1561
|
}
|
|
1482
1562
|
throw Error("Unable to authorize with OAuth token: No KMS URLs set");
|
|
@@ -1490,7 +1570,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1490
1570
|
networkName: this.networkName,
|
|
1491
1571
|
debug: this.debug
|
|
1492
1572
|
});
|
|
1493
|
-
|
|
1573
|
+
_context20.next = 22;
|
|
1494
1574
|
return this.utils.ResponseToJson(httpClient.Request({
|
|
1495
1575
|
headers: {
|
|
1496
1576
|
Authorization: "Bearer ".concat(token)
|
|
@@ -1500,7 +1580,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1500
1580
|
forceFailover: true
|
|
1501
1581
|
}));
|
|
1502
1582
|
case 22:
|
|
1503
|
-
response =
|
|
1583
|
+
response = _context20.sent;
|
|
1504
1584
|
privateKey = response["UserSKHex"];
|
|
1505
1585
|
this.SetSigner({
|
|
1506
1586
|
signer: wallet.AddAccount({
|
|
@@ -1509,25 +1589,25 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1509
1589
|
});
|
|
1510
1590
|
|
|
1511
1591
|
// Ensure wallet is initialized
|
|
1512
|
-
|
|
1592
|
+
_context20.next = 27;
|
|
1513
1593
|
return this.userProfileClient.WalletAddress();
|
|
1514
1594
|
case 27:
|
|
1515
|
-
|
|
1595
|
+
_context20.next = 36;
|
|
1516
1596
|
break;
|
|
1517
1597
|
case 29:
|
|
1518
|
-
|
|
1519
|
-
|
|
1598
|
+
_context20.prev = 29;
|
|
1599
|
+
_context20.t0 = _context20["catch"](4);
|
|
1520
1600
|
this.Log("Failed to set signer from OAuth token:", true);
|
|
1521
|
-
this.Log(
|
|
1522
|
-
|
|
1601
|
+
this.Log(_context20.t0, true);
|
|
1602
|
+
_context20.next = 35;
|
|
1523
1603
|
return this.ClearSigner();
|
|
1524
1604
|
case 35:
|
|
1525
|
-
throw
|
|
1605
|
+
throw _context20.t0;
|
|
1526
1606
|
case 36:
|
|
1527
1607
|
case "end":
|
|
1528
|
-
return
|
|
1608
|
+
return _context20.stop();
|
|
1529
1609
|
}
|
|
1530
|
-
},
|
|
1610
|
+
}, _callee20, this, [[4, 29]]);
|
|
1531
1611
|
}));
|
|
1532
1612
|
function SetSignerFromOauthToken(_x14) {
|
|
1533
1613
|
return _SetSignerFromOauthToken.apply(this, arguments);
|
|
@@ -1545,8 +1625,8 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1545
1625
|
*/
|
|
1546
1626
|
}, {
|
|
1547
1627
|
key: "CreateStaticToken",
|
|
1548
|
-
value: function CreateStaticToken(
|
|
1549
|
-
var libraryId =
|
|
1628
|
+
value: function CreateStaticToken(_ref24) {
|
|
1629
|
+
var libraryId = _ref24.libraryId;
|
|
1550
1630
|
var token = {
|
|
1551
1631
|
qspace_id: this.contentSpaceId
|
|
1552
1632
|
};
|
|
@@ -1567,10 +1647,10 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1567
1647
|
}, {
|
|
1568
1648
|
key: "SetStaticToken",
|
|
1569
1649
|
value: function SetStaticToken() {
|
|
1570
|
-
var
|
|
1571
|
-
token =
|
|
1572
|
-
|
|
1573
|
-
update =
|
|
1650
|
+
var _ref25 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1651
|
+
token = _ref25.token,
|
|
1652
|
+
_ref25$update = _ref25.update,
|
|
1653
|
+
update = _ref25$update === void 0 ? false : _ref25$update;
|
|
1574
1654
|
if (token) {
|
|
1575
1655
|
this.staticToken = token;
|
|
1576
1656
|
} else {
|
|
@@ -1602,28 +1682,28 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1602
1682
|
}, {
|
|
1603
1683
|
key: "SetPolicyAuthorization",
|
|
1604
1684
|
value: function () {
|
|
1605
|
-
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1685
|
+
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref26) {
|
|
1606
1686
|
var objectId;
|
|
1607
|
-
return _regeneratorRuntime.wrap(function
|
|
1608
|
-
while (1) switch (
|
|
1687
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1688
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1609
1689
|
case 0:
|
|
1610
|
-
objectId =
|
|
1611
|
-
|
|
1612
|
-
|
|
1690
|
+
objectId = _ref26.objectId;
|
|
1691
|
+
_context21.t0 = this;
|
|
1692
|
+
_context21.next = 4;
|
|
1613
1693
|
return this.GenerateStateChannelToken({
|
|
1614
1694
|
objectId: objectId
|
|
1615
1695
|
});
|
|
1616
1696
|
case 4:
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
token:
|
|
1697
|
+
_context21.t1 = _context21.sent;
|
|
1698
|
+
_context21.t2 = {
|
|
1699
|
+
token: _context21.t1
|
|
1620
1700
|
};
|
|
1621
|
-
|
|
1701
|
+
_context21.t0.SetStaticToken.call(_context21.t0, _context21.t2);
|
|
1622
1702
|
case 7:
|
|
1623
1703
|
case "end":
|
|
1624
|
-
return
|
|
1704
|
+
return _context21.stop();
|
|
1625
1705
|
}
|
|
1626
|
-
},
|
|
1706
|
+
}, _callee21, this);
|
|
1627
1707
|
}));
|
|
1628
1708
|
function SetPolicyAuthorization(_x15) {
|
|
1629
1709
|
return _SetPolicyAuthorization.apply(this, arguments);
|
|
@@ -1639,21 +1719,21 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1639
1719
|
}, {
|
|
1640
1720
|
key: "Sign",
|
|
1641
1721
|
value: function () {
|
|
1642
|
-
var _Sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1722
|
+
var _Sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(string) {
|
|
1643
1723
|
var signature;
|
|
1644
|
-
return _regeneratorRuntime.wrap(function
|
|
1645
|
-
while (1) switch (
|
|
1724
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1725
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1646
1726
|
case 0:
|
|
1647
|
-
|
|
1727
|
+
_context22.next = 2;
|
|
1648
1728
|
return this.authClient.Sign(Ethers.utils.keccak256(Ethers.utils.toUtf8Bytes(string)));
|
|
1649
1729
|
case 2:
|
|
1650
|
-
signature =
|
|
1651
|
-
return
|
|
1730
|
+
signature = _context22.sent;
|
|
1731
|
+
return _context22.abrupt("return", this.utils.FormatSignature(signature));
|
|
1652
1732
|
case 4:
|
|
1653
1733
|
case "end":
|
|
1654
|
-
return
|
|
1734
|
+
return _context22.stop();
|
|
1655
1735
|
}
|
|
1656
|
-
},
|
|
1736
|
+
}, _callee22, this);
|
|
1657
1737
|
}));
|
|
1658
1738
|
function Sign(_x16) {
|
|
1659
1739
|
return _Sign.apply(this, arguments);
|
|
@@ -1672,28 +1752,28 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1672
1752
|
}, {
|
|
1673
1753
|
key: "EncryptECIES",
|
|
1674
1754
|
value: function () {
|
|
1675
|
-
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1755
|
+
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref27) {
|
|
1676
1756
|
var message, publicKey;
|
|
1677
|
-
return _regeneratorRuntime.wrap(function
|
|
1678
|
-
while (1) switch (
|
|
1757
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1758
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1679
1759
|
case 0:
|
|
1680
|
-
message =
|
|
1760
|
+
message = _ref27.message, publicKey = _ref27.publicKey;
|
|
1681
1761
|
if (this.signer) {
|
|
1682
|
-
|
|
1762
|
+
_context23.next = 3;
|
|
1683
1763
|
break;
|
|
1684
1764
|
}
|
|
1685
1765
|
throw "Signer not set";
|
|
1686
1766
|
case 3:
|
|
1687
1767
|
ValidatePresence("message", message);
|
|
1688
|
-
|
|
1768
|
+
_context23.next = 6;
|
|
1689
1769
|
return this.Crypto.EncryptConk(message, publicKey || this.signer._signingKey().publicKey);
|
|
1690
1770
|
case 6:
|
|
1691
|
-
return
|
|
1771
|
+
return _context23.abrupt("return", _context23.sent);
|
|
1692
1772
|
case 7:
|
|
1693
1773
|
case "end":
|
|
1694
|
-
return
|
|
1774
|
+
return _context23.stop();
|
|
1695
1775
|
}
|
|
1696
|
-
},
|
|
1776
|
+
}, _callee23, this);
|
|
1697
1777
|
}));
|
|
1698
1778
|
function EncryptECIES(_x17) {
|
|
1699
1779
|
return _EncryptECIES.apply(this, arguments);
|
|
@@ -1711,28 +1791,28 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1711
1791
|
}, {
|
|
1712
1792
|
key: "DecryptECIES",
|
|
1713
1793
|
value: function () {
|
|
1714
|
-
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1794
|
+
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(_ref28) {
|
|
1715
1795
|
var message;
|
|
1716
|
-
return _regeneratorRuntime.wrap(function
|
|
1717
|
-
while (1) switch (
|
|
1796
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1797
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1718
1798
|
case 0:
|
|
1719
|
-
message =
|
|
1799
|
+
message = _ref28.message;
|
|
1720
1800
|
if (this.signer) {
|
|
1721
|
-
|
|
1801
|
+
_context24.next = 3;
|
|
1722
1802
|
break;
|
|
1723
1803
|
}
|
|
1724
1804
|
throw "Signer not set";
|
|
1725
1805
|
case 3:
|
|
1726
1806
|
ValidatePresence("message", message);
|
|
1727
|
-
|
|
1807
|
+
_context24.next = 6;
|
|
1728
1808
|
return this.Crypto.DecryptCap(message, this.signer);
|
|
1729
1809
|
case 6:
|
|
1730
|
-
return
|
|
1810
|
+
return _context24.abrupt("return", _context24.sent);
|
|
1731
1811
|
case 7:
|
|
1732
1812
|
case "end":
|
|
1733
|
-
return
|
|
1813
|
+
return _context24.stop();
|
|
1734
1814
|
}
|
|
1735
|
-
},
|
|
1815
|
+
}, _callee24, this);
|
|
1736
1816
|
}));
|
|
1737
1817
|
function DecryptECIES(_x18) {
|
|
1738
1818
|
return _DecryptECIES.apply(this, arguments);
|
|
@@ -1753,22 +1833,22 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1753
1833
|
}, {
|
|
1754
1834
|
key: "Request",
|
|
1755
1835
|
value: function () {
|
|
1756
|
-
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1757
|
-
var url,
|
|
1758
|
-
return _regeneratorRuntime.wrap(function
|
|
1759
|
-
while (1) switch (
|
|
1836
|
+
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref29) {
|
|
1837
|
+
var url, _ref29$format, format, _ref29$method, method, _ref29$headers, headers, body;
|
|
1838
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1839
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1760
1840
|
case 0:
|
|
1761
|
-
url =
|
|
1762
|
-
return
|
|
1841
|
+
url = _ref29.url, _ref29$format = _ref29.format, format = _ref29$format === void 0 ? "json" : _ref29$format, _ref29$method = _ref29.method, method = _ref29$method === void 0 ? "GET" : _ref29$method, _ref29$headers = _ref29.headers, headers = _ref29$headers === void 0 ? {} : _ref29$headers, body = _ref29.body;
|
|
1842
|
+
return _context25.abrupt("return", this.utils.ResponseToFormat(format, HttpClient.Fetch(url, {
|
|
1763
1843
|
method: method,
|
|
1764
1844
|
headers: headers,
|
|
1765
1845
|
body: body
|
|
1766
1846
|
})));
|
|
1767
1847
|
case 2:
|
|
1768
1848
|
case "end":
|
|
1769
|
-
return
|
|
1849
|
+
return _context25.stop();
|
|
1770
1850
|
}
|
|
1771
|
-
},
|
|
1851
|
+
}, _callee25, this);
|
|
1772
1852
|
}));
|
|
1773
1853
|
function Request(_x19) {
|
|
1774
1854
|
return _Request.apply(this, arguments);
|
|
@@ -1778,12 +1858,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1778
1858
|
}, {
|
|
1779
1859
|
key: "MakeAuthServiceRequest",
|
|
1780
1860
|
value: function () {
|
|
1781
|
-
var _MakeAuthServiceRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1782
|
-
var kmsId, objectId, versionHash,
|
|
1783
|
-
return _regeneratorRuntime.wrap(function
|
|
1784
|
-
while (1) switch (
|
|
1861
|
+
var _MakeAuthServiceRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref30) {
|
|
1862
|
+
var kmsId, objectId, versionHash, _ref30$method, method, path, bodyType, _ref30$body, body, _ref30$queryParams, queryParams, headers, format, response;
|
|
1863
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1864
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1785
1865
|
case 0:
|
|
1786
|
-
kmsId =
|
|
1866
|
+
kmsId = _ref30.kmsId, objectId = _ref30.objectId, versionHash = _ref30.versionHash, _ref30$method = _ref30.method, method = _ref30$method === void 0 ? "GET" : _ref30$method, path = _ref30.path, bodyType = _ref30.bodyType, _ref30$body = _ref30.body, body = _ref30$body === void 0 ? {} : _ref30$body, _ref30$queryParams = _ref30.queryParams, queryParams = _ref30$queryParams === void 0 ? {} : _ref30$queryParams, headers = _ref30.headers, format = _ref30.format;
|
|
1787
1867
|
response = this.authClient.MakeAuthServiceRequest({
|
|
1788
1868
|
kmsId: kmsId,
|
|
1789
1869
|
objectId: objectId,
|
|
@@ -1795,12 +1875,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1795
1875
|
queryParams: queryParams,
|
|
1796
1876
|
headers: headers
|
|
1797
1877
|
});
|
|
1798
|
-
return
|
|
1878
|
+
return _context26.abrupt("return", !format ? response : this.utils.ResponseToFormat(format, response));
|
|
1799
1879
|
case 3:
|
|
1800
1880
|
case "end":
|
|
1801
|
-
return
|
|
1881
|
+
return _context26.stop();
|
|
1802
1882
|
}
|
|
1803
|
-
},
|
|
1883
|
+
}, _callee26, this);
|
|
1804
1884
|
}));
|
|
1805
1885
|
function MakeAuthServiceRequest(_x20) {
|
|
1806
1886
|
return _MakeAuthServiceRequest.apply(this, arguments);
|
|
@@ -1823,17 +1903,17 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1823
1903
|
}, {
|
|
1824
1904
|
key: "CallFromFrameMessage",
|
|
1825
1905
|
value: function () {
|
|
1826
|
-
var _CallFromFrameMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1906
|
+
var _CallFromFrameMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(message, Respond) {
|
|
1827
1907
|
var _this4 = this;
|
|
1828
1908
|
var callback, method, methodResults, responseError;
|
|
1829
|
-
return _regeneratorRuntime.wrap(function
|
|
1830
|
-
while (1) switch (
|
|
1909
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1910
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1831
1911
|
case 0:
|
|
1832
1912
|
if (!(message.type !== "ElvFrameRequest")) {
|
|
1833
|
-
|
|
1913
|
+
_context27.next = 2;
|
|
1834
1914
|
break;
|
|
1835
1915
|
}
|
|
1836
|
-
return
|
|
1916
|
+
return _context27.abrupt("return");
|
|
1837
1917
|
case 2:
|
|
1838
1918
|
if (message.callbackId) {
|
|
1839
1919
|
callback = function callback(result) {
|
|
@@ -1845,77 +1925,77 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1845
1925
|
};
|
|
1846
1926
|
message.args.callback = callback;
|
|
1847
1927
|
}
|
|
1848
|
-
|
|
1928
|
+
_context27.prev = 3;
|
|
1849
1929
|
method = message.calledMethod;
|
|
1850
1930
|
if (!(message.module === "walletClient")) {
|
|
1851
|
-
|
|
1931
|
+
_context27.next = 15;
|
|
1852
1932
|
break;
|
|
1853
1933
|
}
|
|
1854
1934
|
if (this.walletClient) {
|
|
1855
|
-
|
|
1935
|
+
_context27.next = 8;
|
|
1856
1936
|
break;
|
|
1857
1937
|
}
|
|
1858
1938
|
throw Error("Wallet client not set");
|
|
1859
1939
|
case 8:
|
|
1860
1940
|
if (!this.walletClient.ForbiddenMethods().includes(method)) {
|
|
1861
|
-
|
|
1941
|
+
_context27.next = 10;
|
|
1862
1942
|
break;
|
|
1863
1943
|
}
|
|
1864
1944
|
throw Error("Invalid user profile method: " + method);
|
|
1865
1945
|
case 10:
|
|
1866
|
-
|
|
1946
|
+
_context27.next = 12;
|
|
1867
1947
|
return this.walletClient[method](message.args);
|
|
1868
1948
|
case 12:
|
|
1869
|
-
methodResults =
|
|
1870
|
-
|
|
1949
|
+
methodResults = _context27.sent;
|
|
1950
|
+
_context27.next = 28;
|
|
1871
1951
|
break;
|
|
1872
1952
|
case 15:
|
|
1873
1953
|
if (!(message.module === "userProfileClient")) {
|
|
1874
|
-
|
|
1954
|
+
_context27.next = 23;
|
|
1875
1955
|
break;
|
|
1876
1956
|
}
|
|
1877
1957
|
if (this.userProfileClient.FrameAllowedMethods().includes(method)) {
|
|
1878
|
-
|
|
1958
|
+
_context27.next = 18;
|
|
1879
1959
|
break;
|
|
1880
1960
|
}
|
|
1881
1961
|
throw Error("Invalid user profile method: " + method);
|
|
1882
1962
|
case 18:
|
|
1883
|
-
|
|
1963
|
+
_context27.next = 20;
|
|
1884
1964
|
return this.userProfileClient[method](message.args);
|
|
1885
1965
|
case 20:
|
|
1886
|
-
methodResults =
|
|
1887
|
-
|
|
1966
|
+
methodResults = _context27.sent;
|
|
1967
|
+
_context27.next = 28;
|
|
1888
1968
|
break;
|
|
1889
1969
|
case 23:
|
|
1890
1970
|
if (this.FrameAllowedMethods().includes(method)) {
|
|
1891
|
-
|
|
1971
|
+
_context27.next = 25;
|
|
1892
1972
|
break;
|
|
1893
1973
|
}
|
|
1894
1974
|
throw Error("Invalid method: " + method);
|
|
1895
1975
|
case 25:
|
|
1896
|
-
|
|
1976
|
+
_context27.next = 27;
|
|
1897
1977
|
return this[method](message.args);
|
|
1898
1978
|
case 27:
|
|
1899
|
-
methodResults =
|
|
1979
|
+
methodResults = _context27.sent;
|
|
1900
1980
|
case 28:
|
|
1901
1981
|
Respond(this.utils.MakeClonable({
|
|
1902
1982
|
type: "ElvFrameResponse",
|
|
1903
1983
|
requestId: message.requestId,
|
|
1904
1984
|
response: methodResults
|
|
1905
1985
|
}));
|
|
1906
|
-
|
|
1986
|
+
_context27.next = 38;
|
|
1907
1987
|
break;
|
|
1908
1988
|
case 31:
|
|
1909
|
-
|
|
1910
|
-
|
|
1989
|
+
_context27.prev = 31;
|
|
1990
|
+
_context27.t0 = _context27["catch"](3);
|
|
1911
1991
|
// eslint-disable-next-line no-console
|
|
1912
|
-
this.Log("Frame Message Error:\n Method: ".concat(message.calledMethod, "\n Arguments: ").concat(JSON.stringify(message.args, null, 2), "\n Error: ").concat(_typeof(
|
|
1992
|
+
this.Log("Frame Message Error:\n Method: ".concat(message.calledMethod, "\n Arguments: ").concat(JSON.stringify(message.args, null, 2), "\n Error: ").concat(_typeof(_context27.t0) === "object" ? JSON.stringify(_context27.t0, null, 2) : _context27.t0), true);
|
|
1913
1993
|
|
|
1914
1994
|
// eslint-disable-next-line no-console
|
|
1915
1995
|
console.error(message);
|
|
1916
1996
|
// eslint-disable-next-line no-console
|
|
1917
|
-
console.error(
|
|
1918
|
-
responseError =
|
|
1997
|
+
console.error(_context27.t0);
|
|
1998
|
+
responseError = _context27.t0 instanceof Error ? _context27.t0.message : _context27.t0;
|
|
1919
1999
|
Respond(this.utils.MakeClonable({
|
|
1920
2000
|
type: "ElvFrameResponse",
|
|
1921
2001
|
requestId: message.requestId,
|
|
@@ -1923,9 +2003,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1923
2003
|
}));
|
|
1924
2004
|
case 38:
|
|
1925
2005
|
case "end":
|
|
1926
|
-
return
|
|
2006
|
+
return _context27.stop();
|
|
1927
2007
|
}
|
|
1928
|
-
},
|
|
2008
|
+
}, _callee27, this, [[3, 31]]);
|
|
1929
2009
|
}));
|
|
1930
2010
|
function CallFromFrameMessage(_x21, _x22) {
|
|
1931
2011
|
return _CallFromFrameMessage.apply(this, arguments);
|
|
@@ -1935,13 +2015,13 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1935
2015
|
}], [{
|
|
1936
2016
|
key: "Configuration",
|
|
1937
2017
|
value: function () {
|
|
1938
|
-
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1939
|
-
var configUrl,
|
|
1940
|
-
return _regeneratorRuntime.wrap(function
|
|
1941
|
-
while (1) switch (
|
|
2018
|
+
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref31) {
|
|
2019
|
+
var configUrl, _ref31$kmsUrls, kmsUrls, region, clientIP, uri, fabricInfo, filterHTTPS, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion;
|
|
2020
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
2021
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1942
2022
|
case 0:
|
|
1943
|
-
configUrl =
|
|
1944
|
-
|
|
2023
|
+
configUrl = _ref31.configUrl, _ref31$kmsUrls = _ref31.kmsUrls, kmsUrls = _ref31$kmsUrls === void 0 ? [] : _ref31$kmsUrls, region = _ref31.region, clientIP = _ref31.clientIP;
|
|
2024
|
+
_context28.prev = 1;
|
|
1945
2025
|
uri = new URI(configUrl);
|
|
1946
2026
|
uri.pathname("/config");
|
|
1947
2027
|
if (region) {
|
|
@@ -1950,10 +2030,10 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1950
2030
|
if (clientIP) {
|
|
1951
2031
|
uri.addSearch("client_ip", clientIP);
|
|
1952
2032
|
}
|
|
1953
|
-
|
|
2033
|
+
_context28.next = 8;
|
|
1954
2034
|
return Utils.ResponseToJson(HttpClient.Fetch(uri.toString()));
|
|
1955
2035
|
case 8:
|
|
1956
|
-
fabricInfo =
|
|
2036
|
+
fabricInfo = _context28.sent;
|
|
1957
2037
|
// If any HTTPS urls present, throw away HTTP urls so only HTTPS will be used
|
|
1958
2038
|
filterHTTPS = function filterHTTPS(uri) {
|
|
1959
2039
|
return uri.toLowerCase().startsWith("https");
|
|
@@ -1976,7 +2056,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1976
2056
|
}
|
|
1977
2057
|
searchURIs = fabricInfo.network.services.search || [];
|
|
1978
2058
|
fabricVersion = Math.max.apply(Math, _toConsumableArray(fabricInfo.network.api_versions || [2]));
|
|
1979
|
-
return
|
|
2059
|
+
return _context28.abrupt("return", {
|
|
1980
2060
|
nodeId: fabricInfo.node_id,
|
|
1981
2061
|
contentSpaceId: fabricInfo.qspace.id,
|
|
1982
2062
|
networkId: (fabricInfo.qspace.ethereum || {}).network_id,
|
|
@@ -1990,18 +2070,18 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1990
2070
|
fabricVersion: fabricVersion
|
|
1991
2071
|
});
|
|
1992
2072
|
case 23:
|
|
1993
|
-
|
|
1994
|
-
|
|
2073
|
+
_context28.prev = 23;
|
|
2074
|
+
_context28.t0 = _context28["catch"](1);
|
|
1995
2075
|
// eslint-disable-next-line no-console
|
|
1996
2076
|
console.error("Error retrieving fabric configuration:");
|
|
1997
2077
|
// eslint-disable-next-line no-console
|
|
1998
|
-
console.error(
|
|
1999
|
-
throw
|
|
2078
|
+
console.error(_context28.t0);
|
|
2079
|
+
throw _context28.t0;
|
|
2000
2080
|
case 28:
|
|
2001
2081
|
case "end":
|
|
2002
|
-
return
|
|
2082
|
+
return _context28.stop();
|
|
2003
2083
|
}
|
|
2004
|
-
},
|
|
2084
|
+
}, _callee28, null, [[1, 23]]);
|
|
2005
2085
|
}));
|
|
2006
2086
|
function Configuration(_x23) {
|
|
2007
2087
|
return _Configuration.apply(this, arguments);
|
|
@@ -2040,20 +2120,20 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2040
2120
|
}, {
|
|
2041
2121
|
key: "FromNetworkName",
|
|
2042
2122
|
value: function () {
|
|
2043
|
-
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2044
|
-
var networkName, region, clientIP, trustAuthorityId, staticToken,
|
|
2045
|
-
return _regeneratorRuntime.wrap(function
|
|
2046
|
-
while (1) switch (
|
|
2123
|
+
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref32) {
|
|
2124
|
+
var networkName, region, clientIP, trustAuthorityId, staticToken, _ref32$ethereumContra, ethereumContractTimeout, _ref32$noCache, noCache, _ref32$noAuth, noAuth, assumeV3, configUrl;
|
|
2125
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
2126
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2047
2127
|
case 0:
|
|
2048
|
-
networkName =
|
|
2128
|
+
networkName = _ref32.networkName, region = _ref32.region, clientIP = _ref32.clientIP, trustAuthorityId = _ref32.trustAuthorityId, staticToken = _ref32.staticToken, _ref32$ethereumContra = _ref32.ethereumContractTimeout, ethereumContractTimeout = _ref32$ethereumContra === void 0 ? 10 : _ref32$ethereumContra, _ref32$noCache = _ref32.noCache, noCache = _ref32$noCache === void 0 ? false : _ref32$noCache, _ref32$noAuth = _ref32.noAuth, noAuth = _ref32$noAuth === void 0 ? false : _ref32$noAuth, assumeV3 = _ref32.assumeV3;
|
|
2049
2129
|
configUrl = this.Networks()[networkName];
|
|
2050
2130
|
if (configUrl) {
|
|
2051
|
-
|
|
2131
|
+
_context29.next = 4;
|
|
2052
2132
|
break;
|
|
2053
2133
|
}
|
|
2054
2134
|
throw Error("Invalid network name: " + networkName);
|
|
2055
2135
|
case 4:
|
|
2056
|
-
|
|
2136
|
+
_context29.next = 6;
|
|
2057
2137
|
return this.FromConfigurationUrl({
|
|
2058
2138
|
configUrl: configUrl,
|
|
2059
2139
|
region: region,
|
|
@@ -2066,12 +2146,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2066
2146
|
assumeV3: assumeV3
|
|
2067
2147
|
});
|
|
2068
2148
|
case 6:
|
|
2069
|
-
return
|
|
2149
|
+
return _context29.abrupt("return", _context29.sent);
|
|
2070
2150
|
case 7:
|
|
2071
2151
|
case "end":
|
|
2072
|
-
return
|
|
2152
|
+
return _context29.stop();
|
|
2073
2153
|
}
|
|
2074
|
-
},
|
|
2154
|
+
}, _callee29, this);
|
|
2075
2155
|
}));
|
|
2076
2156
|
function FromNetworkName(_x24) {
|
|
2077
2157
|
return _FromNetworkName.apply(this, arguments);
|
|
@@ -2097,20 +2177,20 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2097
2177
|
}, {
|
|
2098
2178
|
key: "FromConfigurationUrl",
|
|
2099
2179
|
value: function () {
|
|
2100
|
-
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2101
|
-
var configUrl, region, clientIP, trustAuthorityId, staticToken,
|
|
2102
|
-
return _regeneratorRuntime.wrap(function
|
|
2103
|
-
while (1) switch (
|
|
2180
|
+
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref33) {
|
|
2181
|
+
var configUrl, region, clientIP, trustAuthorityId, staticToken, _ref33$ethereumContra, ethereumContractTimeout, _ref33$noCache, noCache, _ref33$noAuth, noAuth, _ref33$assumeV, assumeV3, _yield$ElvClient$Conf3, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion, client;
|
|
2182
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
2183
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2104
2184
|
case 0:
|
|
2105
|
-
configUrl =
|
|
2106
|
-
|
|
2185
|
+
configUrl = _ref33.configUrl, region = _ref33.region, clientIP = _ref33.clientIP, trustAuthorityId = _ref33.trustAuthorityId, staticToken = _ref33.staticToken, _ref33$ethereumContra = _ref33.ethereumContractTimeout, ethereumContractTimeout = _ref33$ethereumContra === void 0 ? 10 : _ref33$ethereumContra, _ref33$noCache = _ref33.noCache, noCache = _ref33$noCache === void 0 ? false : _ref33$noCache, _ref33$noAuth = _ref33.noAuth, noAuth = _ref33$noAuth === void 0 ? false : _ref33$noAuth, _ref33$assumeV = _ref33.assumeV3, assumeV3 = _ref33$assumeV === void 0 ? false : _ref33$assumeV;
|
|
2186
|
+
_context30.next = 3;
|
|
2107
2187
|
return ElvClient.Configuration({
|
|
2108
2188
|
configUrl: configUrl,
|
|
2109
2189
|
clientIP: clientIP,
|
|
2110
2190
|
region: region
|
|
2111
2191
|
});
|
|
2112
2192
|
case 3:
|
|
2113
|
-
_yield$ElvClient$Conf3 =
|
|
2193
|
+
_yield$ElvClient$Conf3 = _context30.sent;
|
|
2114
2194
|
contentSpaceId = _yield$ElvClient$Conf3.contentSpaceId;
|
|
2115
2195
|
networkId = _yield$ElvClient$Conf3.networkId;
|
|
2116
2196
|
networkName = _yield$ElvClient$Conf3.networkName;
|
|
@@ -2140,12 +2220,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2140
2220
|
client.configUrl = configUrl;
|
|
2141
2221
|
client.region = region;
|
|
2142
2222
|
client.clientIP = clientIP;
|
|
2143
|
-
return
|
|
2223
|
+
return _context30.abrupt("return", client);
|
|
2144
2224
|
case 18:
|
|
2145
2225
|
case "end":
|
|
2146
|
-
return
|
|
2226
|
+
return _context30.stop();
|
|
2147
2227
|
}
|
|
2148
|
-
},
|
|
2228
|
+
}, _callee30);
|
|
2149
2229
|
}));
|
|
2150
2230
|
function FromConfigurationUrl(_x25) {
|
|
2151
2231
|
return _FromConfigurationUrl.apply(this, arguments);
|