@eluvio/elv-client-js 4.2.30 → 4.2.31

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