@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.
@@ -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 _callee12(_ref15) {
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 _callee12$(_context12) {
1011
- while (1) switch (_context12.prev = _context12.next) {
1090
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
1091
+ while (1) switch (_context13.prev = _context13.next) {
1012
1092
  case 0:
1013
- message = _ref15.message, addEthereumPrefix = _ref15.addEthereumPrefix, Sign = _ref15.Sign;
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 _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(message) {
1018
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
1019
- while (1) switch (_context11.prev = _context11.next) {
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
- _context11.t0 = Ethers.utils;
1101
+ _context12.t0 = Ethers.utils;
1022
1102
  if (!_this2.signer.signDigest) {
1023
- _context11.next = 7;
1103
+ _context12.next = 7;
1024
1104
  break;
1025
1105
  }
1026
- _context11.next = 4;
1106
+ _context12.next = 4;
1027
1107
  return _this2.signer.signDigest(message);
1028
1108
  case 4:
1029
- _context11.t1 = _context11.sent;
1030
- _context11.next = 10;
1109
+ _context12.t1 = _context12.sent;
1110
+ _context12.next = 10;
1031
1111
  break;
1032
1112
  case 7:
1033
- _context11.next = 9;
1113
+ _context12.next = 9;
1034
1114
  return _this2.signer._signingKey().signDigest(message);
1035
1115
  case 9:
1036
- _context11.t1 = _context11.sent;
1116
+ _context12.t1 = _context12.sent;
1037
1117
  case 10:
1038
- _context11.t2 = _context11.t1;
1039
- return _context11.abrupt("return", _context11.t0.joinSignature.call(_context11.t0, _context11.t2));
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 _context11.stop();
1122
+ return _context12.stop();
1043
1123
  }
1044
- }, _callee11);
1124
+ }, _callee12);
1045
1125
  }));
1046
1126
  return function Sign(_x8) {
1047
- return _ref16.apply(this, arguments);
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
- _context12.next = 5;
1134
+ _context13.next = 5;
1055
1135
  return Sign(message);
1056
1136
  case 5:
1057
- return _context12.abrupt("return", _context12.sent);
1137
+ return _context13.abrupt("return", _context13.sent);
1058
1138
  case 6:
1059
1139
  case "end":
1060
- return _context12.stop();
1140
+ return _context13.stop();
1061
1141
  }
1062
- }, _callee12);
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 _callee13() {
1084
- var _ref17,
1085
- _ref17$duration,
1163
+ var _CreateFabricToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
1164
+ var _ref18,
1165
+ _ref18$duration,
1086
1166
  duration,
1087
- _ref17$spec,
1167
+ _ref18$spec,
1088
1168
  spec,
1089
1169
  address,
1090
1170
  Sign,
1091
- _ref17$addEthereumPre,
1171
+ _ref18$addEthereumPre,
1092
1172
  addEthereumPrefix,
1093
- _ref17$context,
1173
+ _ref18$context,
1094
1174
  context,
1095
1175
  token,
1096
1176
  message,
1097
1177
  signature,
1098
1178
  compressedToken,
1099
- _args13 = arguments;
1100
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
1101
- while (1) switch (_context13.prev = _context13.next) {
1179
+ _args14 = arguments;
1180
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
1181
+ while (1) switch (_context14.prev = _context14.next) {
1102
1182
  case 0:
1103
- _ref17 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, _ref17$duration = _ref17.duration, duration = _ref17$duration === void 0 ? 24 * 60 * 60 * 1000 : _ref17$duration, _ref17$spec = _ref17.spec, spec = _ref17$spec === void 0 ? {} : _ref17$spec, address = _ref17.address, Sign = _ref17.Sign, _ref17$addEthereumPre = _ref17.addEthereumPrefix, addEthereumPrefix = _ref17$addEthereumPre === void 0 ? true : _ref17$addEthereumPre, _ref17$context = _ref17.context, context = _ref17$context === void 0 ? {} : _ref17$context;
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
- _context13.t0 = _objectSpread;
1106
- _context13.t1 = _objectSpread({}, spec);
1107
- _context13.t2 = {};
1108
- _context13.t3 = "iusr".concat(Utils.AddressToHash(address));
1109
- _context13.t4 = Buffer.from(address.replace(/^0x/, ""), "hex").toString("base64");
1110
- _context13.next = 9;
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
- _context13.t5 = _context13.sent;
1114
- _context13.t6 = Date.now();
1115
- _context13.t7 = Date.now() + duration;
1116
- _context13.t8 = context;
1117
- _context13.t9 = {
1118
- sub: _context13.t3,
1119
- adr: _context13.t4,
1120
- spc: _context13.t5,
1121
- iat: _context13.t6,
1122
- exp: _context13.t7,
1123
- ctx: _context13.t8
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, _context13.t0)(_context13.t1, _context13.t2, _context13.t9);
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
- _context13.next = 18;
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 = _context13.sent;
1214
+ signature = _context14.sent;
1135
1215
  compressedToken = Pako.deflateRaw(Buffer.from(JSON.stringify(token), "utf-8"));
1136
- return _context13.abrupt("return", "acspjc".concat(this.utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(compressedToken)]))));
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 _context13.stop();
1219
+ return _context14.stop();
1140
1220
  }
1141
- }, _callee13, this);
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 _callee14(_ref18) {
1170
- var libraryId, objectId, versionHash, policyId, subject, _ref18$grantType, grantType, _ref18$allowDecryptio, allowDecryption, duration, _ref18$context, context, issueTime, expirationTime, issueDateTime, token, cap, compressedToken, signature;
1171
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
1172
- while (1) switch (_context14.prev = _context14.next) {
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 = _ref18.libraryId, objectId = _ref18.objectId, versionHash = _ref18.versionHash, policyId = _ref18.policyId, subject = _ref18.subject, _ref18$grantType = _ref18.grantType, grantType = _ref18$grantType === void 0 ? "read" : _ref18$grantType, _ref18$allowDecryptio = _ref18.allowDecryption, allowDecryption = _ref18$allowDecryptio === void 0 ? false : _ref18$allowDecryptio, duration = _ref18.duration, _ref18$context = _ref18.context, context = _ref18$context === void 0 ? {} : _ref18$context, issueTime = _ref18.issueTime, expirationTime = _ref18.expirationTime;
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
- _context14.next = 9;
1256
+ _context15.next = 9;
1177
1257
  break;
1178
1258
  }
1179
- _context14.t0 = "iusr";
1180
- _context14.t1 = this.utils;
1181
- _context14.next = 6;
1259
+ _context15.t0 = "iusr";
1260
+ _context15.t1 = this.utils;
1261
+ _context15.next = 6;
1182
1262
  return this.CurrentAccountAddress();
1183
1263
  case 6:
1184
- _context14.t2 = _context14.sent;
1185
- _context14.t3 = _context14.t1.AddressToHash.call(_context14.t1, _context14.t2);
1186
- subject = _context14.t0.concat.call(_context14.t0, _context14.t3);
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
- _context14.t4 = Buffer;
1193
- _context14.next = 14;
1272
+ _context15.t4 = Buffer;
1273
+ _context15.next = 14;
1194
1274
  return this.CurrentAccountAddress().replace(/^0x/, "");
1195
1275
  case 14:
1196
- _context14.t5 = _context14.sent;
1197
- _context14.t6 = _context14.t4.from.call(_context14.t4, _context14.t5, "hex").toString("base64");
1198
- _context14.t7 = subject;
1199
- _context14.next = 19;
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
- _context14.t8 = _context14.sent;
1203
- _context14.t9 = issueDateTime;
1204
- _context14.t10 = expirationTime || issueDateTime + duration;
1205
- _context14.t11 = grantType;
1206
- _context14.t12 = context;
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: _context14.t6,
1209
- sub: _context14.t7,
1210
- spc: _context14.t8,
1211
- iat: _context14.t9,
1212
- exp: _context14.t10,
1213
- gra: _context14.t11,
1214
- ctx: _context14.t12
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
- _context14.next = 32;
1300
+ _context15.next = 32;
1221
1301
  break;
1222
1302
  }
1223
1303
  token.qid = objectId;
1224
1304
  if (libraryId) {
1225
- _context14.next = 32;
1305
+ _context15.next = 32;
1226
1306
  break;
1227
1307
  }
1228
- _context14.next = 31;
1308
+ _context15.next = 31;
1229
1309
  return this.ContentObjectLibraryId({
1230
1310
  objectId: objectId
1231
1311
  });
1232
1312
  case 31:
1233
- libraryId = _context14.sent;
1313
+ libraryId = _context15.sent;
1234
1314
  case 32:
1235
1315
  if (libraryId) {
1236
1316
  token.lib = libraryId;
1237
1317
  }
1238
1318
  if (!allowDecryption) {
1239
- _context14.next = 38;
1319
+ _context15.next = 38;
1240
1320
  break;
1241
1321
  }
1242
- _context14.next = 36;
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 = _context14.sent;
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
- _context14.next = 41;
1332
+ _context15.next = 41;
1253
1333
  return this.authClient.Sign(Ethers.utils.keccak256(compressedToken));
1254
1334
  case 41:
1255
- signature = _context14.sent;
1256
- return _context14.abrupt("return", "aessjc".concat(this.utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(compressedToken)]))));
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 _context14.stop();
1339
+ return _context15.stop();
1260
1340
  }
1261
- }, _callee14, this);
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 _callee15(args) {
1272
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
1273
- while (1) switch (_context15.prev = _context15.next) {
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
- _context15.next = 2;
1355
+ _context16.next = 2;
1276
1356
  return this.authClient.AuthorizationToken(args);
1277
1357
  case 2:
1278
- return _context15.abrupt("return", _context15.sent);
1358
+ return _context16.abrupt("return", _context16.sent);
1279
1359
  case 3:
1280
1360
  case "end":
1281
- return _context15.stop();
1361
+ return _context16.stop();
1282
1362
  }
1283
- }, _callee15, this);
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 _callee16(_ref19) {
1387
+ var _CreateSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref20) {
1308
1388
  var message, type, msg, signature;
1309
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1310
- while (1) switch (_context16.prev = _context16.next) {
1389
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
1390
+ while (1) switch (_context17.prev = _context17.next) {
1311
1391
  case 0:
1312
- message = _ref19.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
- _context16.next = 5;
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 = _context16.sent;
1323
- return _context16.abrupt("return", "".concat(type).concat(Utils.B58(Buffer.concat([Buffer.from(signature.replace(/^0x/, ""), "hex"), Buffer.from(msg)]))));
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 _context16.stop();
1406
+ return _context17.stop();
1327
1407
  }
1328
- }, _callee16, this);
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 _callee17(_ref20) {
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 _callee17$(_context17) {
1349
- while (1) switch (_context17.prev = _context17.next) {
1428
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
1429
+ while (1) switch (_context18.prev = _context18.next) {
1350
1430
  case 0:
1351
- signedMessage = _ref20.signedMessage;
1431
+ signedMessage = _ref21.signedMessage;
1352
1432
  type = signedMessage.slice(0, 4);
1353
- _context17.t0 = type;
1354
- _context17.next = _context17.t0 === "mje_" ? 5 : 12;
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 _context17.abrupt("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 _context17.stop();
1453
+ return _context18.stop();
1374
1454
  }
1375
- }, _callee17);
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 _callee18(_ref21) {
1484
+ var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref22) {
1405
1485
  var token, wallet, signer;
1406
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
1407
- while (1) switch (_context18.prev = _context18.next) {
1486
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
1487
+ while (1) switch (_context19.prev = _context19.next) {
1408
1488
  case 0:
1409
- token = _ref21.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 _context18.stop();
1500
+ return _context19.stop();
1421
1501
  }
1422
- }, _callee18, this);
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 _callee19(_ref22) {
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 _callee19$(_context19) {
1445
- while (1) switch (_context19.prev = _context19.next) {
1524
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1525
+ while (1) switch (_context20.prev = _context20.next) {
1446
1526
  case 0:
1447
- token = _ref22.token;
1527
+ token = _ref23.token;
1448
1528
  if (this.trustAuthorityId) {
1449
- _context19.next = 3;
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
- _context19.prev = 4;
1535
+ _context20.prev = 4;
1456
1536
  if (this.kmsURIs) {
1457
- _context19.next = 17;
1537
+ _context20.next = 17;
1458
1538
  break;
1459
1539
  }
1460
- _context19.next = 8;
1540
+ _context20.next = 8;
1461
1541
  return ElvClient.FromConfigurationUrl({
1462
1542
  configUrl: this.configUrl
1463
1543
  });
1464
1544
  case 8:
1465
- client = _context19.sent;
1545
+ client = _context20.sent;
1466
1546
  client.SetSigner({
1467
1547
  signer: wallet.AddAccount({
1468
1548
  privateKey: this.defaultKey
1469
1549
  })
1470
1550
  });
1471
- _context19.next = 12;
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 = _context19.sent;
1556
+ _yield$client$authCli = _context20.sent;
1477
1557
  urls = _yield$client$authCli.urls;
1478
1558
  if (!(!urls || urls.length === 0)) {
1479
- _context19.next = 16;
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
- _context19.next = 22;
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 = _context19.sent;
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
- _context19.next = 27;
1592
+ _context20.next = 27;
1513
1593
  return this.userProfileClient.WalletAddress();
1514
1594
  case 27:
1515
- _context19.next = 36;
1595
+ _context20.next = 36;
1516
1596
  break;
1517
1597
  case 29:
1518
- _context19.prev = 29;
1519
- _context19.t0 = _context19["catch"](4);
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(_context19.t0, true);
1522
- _context19.next = 35;
1601
+ this.Log(_context20.t0, true);
1602
+ _context20.next = 35;
1523
1603
  return this.ClearSigner();
1524
1604
  case 35:
1525
- throw _context19.t0;
1605
+ throw _context20.t0;
1526
1606
  case 36:
1527
1607
  case "end":
1528
- return _context19.stop();
1608
+ return _context20.stop();
1529
1609
  }
1530
- }, _callee19, this, [[4, 29]]);
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(_ref23) {
1549
- var libraryId = _ref23.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 _ref24 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1571
- token = _ref24.token,
1572
- _ref24$update = _ref24.update,
1573
- update = _ref24$update === void 0 ? false : _ref24$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 _callee20(_ref25) {
1685
+ var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref26) {
1606
1686
  var objectId;
1607
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1608
- while (1) switch (_context20.prev = _context20.next) {
1687
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
1688
+ while (1) switch (_context21.prev = _context21.next) {
1609
1689
  case 0:
1610
- objectId = _ref25.objectId;
1611
- _context20.t0 = this;
1612
- _context20.next = 4;
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
- _context20.t1 = _context20.sent;
1618
- _context20.t2 = {
1619
- token: _context20.t1
1697
+ _context21.t1 = _context21.sent;
1698
+ _context21.t2 = {
1699
+ token: _context21.t1
1620
1700
  };
1621
- _context20.t0.SetStaticToken.call(_context20.t0, _context20.t2);
1701
+ _context21.t0.SetStaticToken.call(_context21.t0, _context21.t2);
1622
1702
  case 7:
1623
1703
  case "end":
1624
- return _context20.stop();
1704
+ return _context21.stop();
1625
1705
  }
1626
- }, _callee20, this);
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 _callee21(string) {
1722
+ var _Sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(string) {
1643
1723
  var signature;
1644
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
1645
- while (1) switch (_context21.prev = _context21.next) {
1724
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
1725
+ while (1) switch (_context22.prev = _context22.next) {
1646
1726
  case 0:
1647
- _context21.next = 2;
1727
+ _context22.next = 2;
1648
1728
  return this.authClient.Sign(Ethers.utils.keccak256(Ethers.utils.toUtf8Bytes(string)));
1649
1729
  case 2:
1650
- signature = _context21.sent;
1651
- return _context21.abrupt("return", this.utils.FormatSignature(signature));
1730
+ signature = _context22.sent;
1731
+ return _context22.abrupt("return", this.utils.FormatSignature(signature));
1652
1732
  case 4:
1653
1733
  case "end":
1654
- return _context21.stop();
1734
+ return _context22.stop();
1655
1735
  }
1656
- }, _callee21, this);
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 _callee22(_ref26) {
1755
+ var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref27) {
1676
1756
  var message, publicKey;
1677
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
1678
- while (1) switch (_context22.prev = _context22.next) {
1757
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1758
+ while (1) switch (_context23.prev = _context23.next) {
1679
1759
  case 0:
1680
- message = _ref26.message, publicKey = _ref26.publicKey;
1760
+ message = _ref27.message, publicKey = _ref27.publicKey;
1681
1761
  if (this.signer) {
1682
- _context22.next = 3;
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
- _context22.next = 6;
1768
+ _context23.next = 6;
1689
1769
  return this.Crypto.EncryptConk(message, publicKey || this.signer._signingKey().publicKey);
1690
1770
  case 6:
1691
- return _context22.abrupt("return", _context22.sent);
1771
+ return _context23.abrupt("return", _context23.sent);
1692
1772
  case 7:
1693
1773
  case "end":
1694
- return _context22.stop();
1774
+ return _context23.stop();
1695
1775
  }
1696
- }, _callee22, this);
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 _callee23(_ref27) {
1794
+ var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(_ref28) {
1715
1795
  var message;
1716
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1717
- while (1) switch (_context23.prev = _context23.next) {
1796
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1797
+ while (1) switch (_context24.prev = _context24.next) {
1718
1798
  case 0:
1719
- message = _ref27.message;
1799
+ message = _ref28.message;
1720
1800
  if (this.signer) {
1721
- _context23.next = 3;
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
- _context23.next = 6;
1807
+ _context24.next = 6;
1728
1808
  return this.Crypto.DecryptCap(message, this.signer);
1729
1809
  case 6:
1730
- return _context23.abrupt("return", _context23.sent);
1810
+ return _context24.abrupt("return", _context24.sent);
1731
1811
  case 7:
1732
1812
  case "end":
1733
- return _context23.stop();
1813
+ return _context24.stop();
1734
1814
  }
1735
- }, _callee23, this);
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 _callee24(_ref28) {
1757
- var url, _ref28$format, format, _ref28$method, method, _ref28$headers, headers, body;
1758
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1759
- while (1) switch (_context24.prev = _context24.next) {
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 = _ref28.url, _ref28$format = _ref28.format, format = _ref28$format === void 0 ? "json" : _ref28$format, _ref28$method = _ref28.method, method = _ref28$method === void 0 ? "GET" : _ref28$method, _ref28$headers = _ref28.headers, headers = _ref28$headers === void 0 ? {} : _ref28$headers, body = _ref28.body;
1762
- return _context24.abrupt("return", this.utils.ResponseToFormat(format, HttpClient.Fetch(url, {
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 _context24.stop();
1849
+ return _context25.stop();
1770
1850
  }
1771
- }, _callee24, this);
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 _callee25(_ref29) {
1782
- var kmsId, objectId, versionHash, _ref29$method, method, path, bodyType, _ref29$body, body, _ref29$queryParams, queryParams, headers, format, response;
1783
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
1784
- while (1) switch (_context25.prev = _context25.next) {
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 = _ref29.kmsId, objectId = _ref29.objectId, versionHash = _ref29.versionHash, _ref29$method = _ref29.method, method = _ref29$method === void 0 ? "GET" : _ref29$method, path = _ref29.path, bodyType = _ref29.bodyType, _ref29$body = _ref29.body, body = _ref29$body === void 0 ? {} : _ref29$body, _ref29$queryParams = _ref29.queryParams, queryParams = _ref29$queryParams === void 0 ? {} : _ref29$queryParams, headers = _ref29.headers, format = _ref29.format;
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 _context25.abrupt("return", !format ? response : this.utils.ResponseToFormat(format, response));
1878
+ return _context26.abrupt("return", !format ? response : this.utils.ResponseToFormat(format, response));
1799
1879
  case 3:
1800
1880
  case "end":
1801
- return _context25.stop();
1881
+ return _context26.stop();
1802
1882
  }
1803
- }, _callee25, this);
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 _callee26(message, Respond) {
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 _callee26$(_context26) {
1830
- while (1) switch (_context26.prev = _context26.next) {
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
- _context26.next = 2;
1913
+ _context27.next = 2;
1834
1914
  break;
1835
1915
  }
1836
- return _context26.abrupt("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
- _context26.prev = 3;
1928
+ _context27.prev = 3;
1849
1929
  method = message.calledMethod;
1850
1930
  if (!(message.module === "walletClient")) {
1851
- _context26.next = 15;
1931
+ _context27.next = 15;
1852
1932
  break;
1853
1933
  }
1854
1934
  if (this.walletClient) {
1855
- _context26.next = 8;
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
- _context26.next = 10;
1941
+ _context27.next = 10;
1862
1942
  break;
1863
1943
  }
1864
1944
  throw Error("Invalid user profile method: " + method);
1865
1945
  case 10:
1866
- _context26.next = 12;
1946
+ _context27.next = 12;
1867
1947
  return this.walletClient[method](message.args);
1868
1948
  case 12:
1869
- methodResults = _context26.sent;
1870
- _context26.next = 28;
1949
+ methodResults = _context27.sent;
1950
+ _context27.next = 28;
1871
1951
  break;
1872
1952
  case 15:
1873
1953
  if (!(message.module === "userProfileClient")) {
1874
- _context26.next = 23;
1954
+ _context27.next = 23;
1875
1955
  break;
1876
1956
  }
1877
1957
  if (this.userProfileClient.FrameAllowedMethods().includes(method)) {
1878
- _context26.next = 18;
1958
+ _context27.next = 18;
1879
1959
  break;
1880
1960
  }
1881
1961
  throw Error("Invalid user profile method: " + method);
1882
1962
  case 18:
1883
- _context26.next = 20;
1963
+ _context27.next = 20;
1884
1964
  return this.userProfileClient[method](message.args);
1885
1965
  case 20:
1886
- methodResults = _context26.sent;
1887
- _context26.next = 28;
1966
+ methodResults = _context27.sent;
1967
+ _context27.next = 28;
1888
1968
  break;
1889
1969
  case 23:
1890
1970
  if (this.FrameAllowedMethods().includes(method)) {
1891
- _context26.next = 25;
1971
+ _context27.next = 25;
1892
1972
  break;
1893
1973
  }
1894
1974
  throw Error("Invalid method: " + method);
1895
1975
  case 25:
1896
- _context26.next = 27;
1976
+ _context27.next = 27;
1897
1977
  return this[method](message.args);
1898
1978
  case 27:
1899
- methodResults = _context26.sent;
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
- _context26.next = 38;
1986
+ _context27.next = 38;
1907
1987
  break;
1908
1988
  case 31:
1909
- _context26.prev = 31;
1910
- _context26.t0 = _context26["catch"](3);
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(_context26.t0) === "object" ? JSON.stringify(_context26.t0, null, 2) : _context26.t0), true);
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(_context26.t0);
1918
- responseError = _context26.t0 instanceof Error ? _context26.t0.message : _context26.t0;
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 _context26.stop();
2006
+ return _context27.stop();
1927
2007
  }
1928
- }, _callee26, this, [[3, 31]]);
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 _callee27(_ref30) {
1939
- var configUrl, _ref30$kmsUrls, kmsUrls, region, clientIP, uri, fabricInfo, filterHTTPS, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion;
1940
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
1941
- while (1) switch (_context27.prev = _context27.next) {
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 = _ref30.configUrl, _ref30$kmsUrls = _ref30.kmsUrls, kmsUrls = _ref30$kmsUrls === void 0 ? [] : _ref30$kmsUrls, region = _ref30.region, clientIP = _ref30.clientIP;
1944
- _context27.prev = 1;
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
- _context27.next = 8;
2033
+ _context28.next = 8;
1954
2034
  return Utils.ResponseToJson(HttpClient.Fetch(uri.toString()));
1955
2035
  case 8:
1956
- fabricInfo = _context27.sent;
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 _context27.abrupt("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
- _context27.prev = 23;
1994
- _context27.t0 = _context27["catch"](1);
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(_context27.t0);
1999
- throw _context27.t0;
2078
+ console.error(_context28.t0);
2079
+ throw _context28.t0;
2000
2080
  case 28:
2001
2081
  case "end":
2002
- return _context27.stop();
2082
+ return _context28.stop();
2003
2083
  }
2004
- }, _callee27, null, [[1, 23]]);
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 _callee28(_ref31) {
2044
- var networkName, region, clientIP, trustAuthorityId, staticToken, _ref31$ethereumContra, ethereumContractTimeout, _ref31$noCache, noCache, _ref31$noAuth, noAuth, assumeV3, configUrl;
2045
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
2046
- while (1) switch (_context28.prev = _context28.next) {
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 = _ref31.networkName, 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, assumeV3 = _ref31.assumeV3;
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
- _context28.next = 4;
2131
+ _context29.next = 4;
2052
2132
  break;
2053
2133
  }
2054
2134
  throw Error("Invalid network name: " + networkName);
2055
2135
  case 4:
2056
- _context28.next = 6;
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 _context28.abrupt("return", _context28.sent);
2149
+ return _context29.abrupt("return", _context29.sent);
2070
2150
  case 7:
2071
2151
  case "end":
2072
- return _context28.stop();
2152
+ return _context29.stop();
2073
2153
  }
2074
- }, _callee28, this);
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 _callee29(_ref32) {
2101
- var configUrl, region, clientIP, trustAuthorityId, staticToken, _ref32$ethereumContra, ethereumContractTimeout, _ref32$noCache, noCache, _ref32$noAuth, noAuth, _ref32$assumeV, assumeV3, _yield$ElvClient$Conf3, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion, client;
2102
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
2103
- while (1) switch (_context29.prev = _context29.next) {
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 = _ref32.configUrl, 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, _ref32$assumeV = _ref32.assumeV3, assumeV3 = _ref32$assumeV === void 0 ? false : _ref32$assumeV;
2106
- _context29.next = 3;
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 = _context29.sent;
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 _context29.abrupt("return", client);
2223
+ return _context30.abrupt("return", client);
2144
2224
  case 18:
2145
2225
  case "end":
2146
- return _context29.stop();
2226
+ return _context30.stop();
2147
2227
  }
2148
- }, _callee29);
2228
+ }, _callee30);
2149
2229
  }));
2150
2230
  function FromConfigurationUrl(_x25) {
2151
2231
  return _FromConfigurationUrl.apply(this, arguments);