@textrp/briij-js-sdk 43.2.1 → 44.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -58,6 +58,10 @@ import { PushRuleActionName, PushRuleKind } from "./@types/PushRules.js";
58
58
  import { GroupCall } from "./webrtc/groupCall.js";
59
59
  import { MediaHandler } from "./webrtc/mediaHandler.js";
60
60
  import { WALLET_E2EE_RECOVERY_ACCOUNT_DATA_TYPE, WALLET_IDENTITY_ACCOUNT_DATA_TYPE, XRPL_WALLET_LOGIN_TYPE } from "./@types/auth.js";
61
+ import { createMinimalDidDocument, deriveXrplDid, resolveDidViaHomeserver } from "./auth/did.js";
62
+ import { loadDidCredentialMetadata, requestCredentialCreate, storeDidCredentialMetadata, verifyCredential } from "./auth/credential.js";
63
+ import { generateE2eeZkProof } from "./auth/zkpE2EE.js";
64
+ import { buildWalletLoginSubmission } from "./auth/wallet.js";
61
65
  import { TypedEventEmitter } from "./models/typed-event-emitter.js";
62
66
  import { MAIN_ROOM_TIMELINE, ReceiptType } from "./@types/read_receipts.js";
63
67
  import { SlidingSyncSdk } from "./sliding-sync-sdk.js";
@@ -5509,6 +5513,148 @@ export class BriijClient extends TypedEventEmitter {
5509
5513
  }));
5510
5514
  }
5511
5515
 
5516
+ /**
5517
+ * XRPL DID + credential login flow:
5518
+ * 1) challenge request, 2) wallet proof submission, 3) DID resolve, 4) credential request.
5519
+ */
5520
+ loginWithXrplDidCredential(params) {
5521
+ var _this61 = this;
5522
+ return _asyncToGenerator(function* () {
5523
+ var _params$network, _params$didNetwork, _params$e2eePubkeyCom, _did$did_uri, _ref12, _params$longevityMode, _params$zkpLongevityM, _did$did_uri4;
5524
+ var network = (_params$network = params.network) !== null && _params$network !== void 0 ? _params$network : "xrpl";
5525
+ var didNetwork = (_params$didNetwork = params.didNetwork) !== null && _params$didNetwork !== void 0 ? _params$didNetwork : "testnet";
5526
+ var challenge = yield _this61.getXrplAuthChallenge({
5527
+ address: params.address,
5528
+ network,
5529
+ username: params.username,
5530
+ preferred_localpart: params.username
5531
+ });
5532
+ var walletProof = yield params.walletProofProvider(challenge.challenge, network);
5533
+ if (walletProof.address !== params.address) {
5534
+ throw new Error("Wallet proof address mismatch");
5535
+ }
5536
+ var loginResponse = yield _this61.completeXrplAuth(buildWalletLoginSubmission(walletProof, challenge.session, network, params.username));
5537
+ yield _this61.applyLoginResponse(loginResponse, XRPL_WALLET_LOGIN_TYPE);
5538
+ var didUri = deriveXrplDid(walletProof.address, didNetwork);
5539
+ var commitment = (_params$e2eePubkeyCom = params.e2eePubkeyCommitment) !== null && _params$e2eePubkeyCom !== void 0 ? _params$e2eePubkeyCom : yield _this61.createE2eeCommitment(loginResponse.user_id);
5540
+ var didDocument = createMinimalDidDocument(didUri, commitment);
5541
+ var did = yield resolveDidViaHomeserver(/*#__PURE__*/function () {
5542
+ var _ref1 = _asyncToGenerator(function* (path) {
5543
+ return _this61.http.authedRequest(Method.Get, path);
5544
+ });
5545
+ return function (_x4) {
5546
+ return _ref1.apply(this, arguments);
5547
+ };
5548
+ }(), walletProof.address);
5549
+ var credential = yield requestCredentialCreate(/*#__PURE__*/function () {
5550
+ var _ref10 = _asyncToGenerator(function* (path, method, body) {
5551
+ return _this61.http.authedRequest(Method.Post, path, undefined, body);
5552
+ });
5553
+ return function (_x5, _x6, _x7) {
5554
+ return _ref10.apply(this, arguments);
5555
+ };
5556
+ }(), {
5557
+ subject: walletProof.address,
5558
+ did_uri: (_did$did_uri = did.did_uri) !== null && _did$did_uri !== void 0 ? _did$did_uri : didUri,
5559
+ e2ee_pubkey_commitment: commitment
5560
+ });
5561
+ var credentialVerification = yield verifyCredential(/*#__PURE__*/function () {
5562
+ var _ref11 = _asyncToGenerator(function* (path, method, body) {
5563
+ return _this61.http.authedRequest(Method.Post, path, undefined, body);
5564
+ });
5565
+ return function (_x8, _x9, _x0) {
5566
+ return _ref11.apply(this, arguments);
5567
+ };
5568
+ }(), credential.credential_id);
5569
+ var zkpModeEnabled = (_ref12 = (_params$longevityMode = params.longevityMode) !== null && _params$longevityMode !== void 0 ? _params$longevityMode : (_params$zkpLongevityM = params.zkpLongevityMode) === null || _params$zkpLongevityM === void 0 ? void 0 : _params$zkpLongevityM.enabled) !== null && _ref12 !== void 0 ? _ref12 : false;
5570
+ var zkp;
5571
+ if (zkpModeEnabled) {
5572
+ try {
5573
+ var _yield$params$zkpLong, _params$zkpLongevityM2, _params$zkpLongevityM3, _did$did_uri2, _did$did_uri3, _params$zkpLongevityM4, _params$zkpLongevityM5;
5574
+ var generatedProof = (_yield$params$zkpLong = yield (_params$zkpLongevityM2 = params.zkpLongevityMode) === null || _params$zkpLongevityM2 === void 0 || (_params$zkpLongevityM3 = _params$zkpLongevityM2.generateProof) === null || _params$zkpLongevityM3 === void 0 ? void 0 : _params$zkpLongevityM3.call(_params$zkpLongevityM2, {
5575
+ didUri: (_did$did_uri2 = did.did_uri) !== null && _did$did_uri2 !== void 0 ? _did$did_uri2 : didUri,
5576
+ xrplAddress: walletProof.address,
5577
+ credentialId: credential.credential_id,
5578
+ e2eePubkeyCommitment: commitment
5579
+ })) !== null && _yield$params$zkpLong !== void 0 ? _yield$params$zkpLong : yield generateE2eeZkProof({
5580
+ didUri: (_did$did_uri3 = did.did_uri) !== null && _did$did_uri3 !== void 0 ? _did$did_uri3 : didUri,
5581
+ xrplAddress: walletProof.address,
5582
+ credentialId: credential.credential_id,
5583
+ e2eePrivateKey: (_params$zkpLongevityM4 = (_params$zkpLongevityM5 = params.zkpLongevityMode) === null || _params$zkpLongevityM5 === void 0 ? void 0 : _params$zkpLongevityM5.e2eePrivateKey) !== null && _params$zkpLongevityM4 !== void 0 ? _params$zkpLongevityM4 : commitment
5584
+ }, {
5585
+ wasmPath: "/circuits/e2ee_credential.wasm",
5586
+ zkeyPath: "/circuits/e2ee_credential.zkey"
5587
+ });
5588
+ zkp = yield _this61.http.authedRequest(Method.Post, "/zkp/verify", undefined, {
5589
+ proof: generatedProof.proof,
5590
+ public_signals: generatedProof.publicSignals,
5591
+ e2ee_pubkey_commitment: commitment
5592
+ });
5593
+ } catch (error) {
5594
+ var _params$zkpLongevityM6;
5595
+ if ((_params$zkpLongevityM6 = params.zkpLongevityMode) !== null && _params$zkpLongevityM6 !== void 0 && _params$zkpLongevityM6.strict) {
5596
+ throw error;
5597
+ }
5598
+ zkp = {
5599
+ valid: false,
5600
+ reason: "zkp_verification_skipped"
5601
+ };
5602
+ }
5603
+ }
5604
+ var metadata = {
5605
+ didUri: (_did$did_uri4 = did.did_uri) !== null && _did$did_uri4 !== void 0 ? _did$did_uri4 : didUri,
5606
+ credentialId: credential.credential_id,
5607
+ issuedAt: Date.now()
5608
+ };
5609
+ storeDidCredentialMetadata(loginResponse.user_id, metadata);
5610
+ yield _this61.persistDidDeviceBinding({
5611
+ didUri: metadata.didUri,
5612
+ credentialId: metadata.credentialId,
5613
+ e2eePubkeyCommitment: commitment,
5614
+ xrplAddress: walletProof.address,
5615
+ network
5616
+ });
5617
+ return _objectSpread(_objectSpread({}, loginResponse), {}, {
5618
+ did,
5619
+ didDocument,
5620
+ credential,
5621
+ credentialVerification,
5622
+ metadata,
5623
+ zkp
5624
+ });
5625
+ })();
5626
+ }
5627
+ getStoredDidCredentialMetadata(userId) {
5628
+ return loadDidCredentialMetadata(userId);
5629
+ }
5630
+ createE2eeCommitment(seed) {
5631
+ return _asyncToGenerator(function* () {
5632
+ var _globalThis$crypto;
5633
+ if (!((_globalThis$crypto = globalThis.crypto) !== null && _globalThis$crypto !== void 0 && _globalThis$crypto.subtle)) {
5634
+ return encodeUnpaddedBase64Url(new TextEncoder().encode(seed));
5635
+ }
5636
+ var digest = yield globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(seed));
5637
+ return Array.from(new Uint8Array(digest)).map(b => b.toString(16).padStart(2, "0")).join("");
5638
+ })();
5639
+ }
5640
+ persistDidDeviceBinding(binding) {
5641
+ var _this62 = this;
5642
+ return _asyncToGenerator(function* () {
5643
+ try {
5644
+ yield _this62.setAccountData(WALLET_IDENTITY_ACCOUNT_DATA_TYPE, {
5645
+ chain_id: "xrpl",
5646
+ account_id: binding.xrplAddress,
5647
+ network: binding.network,
5648
+ did_uri: binding.didUri,
5649
+ credential_id: binding.credentialId,
5650
+ e2ee_pubkey_commitment: binding.e2eePubkeyCommitment
5651
+ });
5652
+ } catch (error) {
5653
+ logger.warn("Failed to persist DID/E2EE device binding metadata", error);
5654
+ }
5655
+ })();
5656
+ }
5657
+
5512
5658
  /**
5513
5659
  * Store a chain-agnostic wallet recovery envelope in account data.
5514
5660
  *
@@ -5517,9 +5663,9 @@ export class BriijClient extends TypedEventEmitter {
5517
5663
  * @param envelope - Wallet recovery envelope payload.
5518
5664
  */
5519
5665
  setWalletRecoveryEnvelope(envelope) {
5520
- var _this61 = this;
5666
+ var _this63 = this;
5521
5667
  return _asyncToGenerator(function* () {
5522
- return yield _this61.setAccountData(WALLET_E2EE_RECOVERY_ACCOUNT_DATA_TYPE, envelope);
5668
+ return yield _this63.setAccountData(WALLET_E2EE_RECOVERY_ACCOUNT_DATA_TYPE, envelope);
5523
5669
  })();
5524
5670
  }
5525
5671
 
@@ -5548,7 +5694,7 @@ export class BriijClient extends TypedEventEmitter {
5548
5694
  */
5549
5695
  loginWithXrplWallet(user, walletAddress, signature, challenge) {
5550
5696
  var _arguments13 = arguments,
5551
- _this62 = this;
5697
+ _this64 = this;
5552
5698
  return _asyncToGenerator(function* () {
5553
5699
  var _parsedChallenge, _parsedChallenge2;
5554
5700
  var network = _arguments13.length > 4 && _arguments13[4] !== undefined ? _arguments13[4] : "xrpl";
@@ -5566,7 +5712,7 @@ export class BriijClient extends TypedEventEmitter {
5566
5712
  if (!session) {
5567
5713
  throw new Error("XRPL challenge payload is missing session; call getXrplAuthChallenge first");
5568
5714
  }
5569
- var response = yield _this62.completeXrplAuth({
5715
+ var response = yield _this64.completeXrplAuth({
5570
5716
  user,
5571
5717
  identifier: {
5572
5718
  type: "m.id.user",
@@ -5578,7 +5724,7 @@ export class BriijClient extends TypedEventEmitter {
5578
5724
  public_key: (_parsedChallenge2 = parsedChallenge) === null || _parsedChallenge2 === void 0 ? void 0 : _parsedChallenge2.public_key,
5579
5725
  network
5580
5726
  });
5581
- yield _this62.applyLoginResponse(response, XRPL_WALLET_LOGIN_TYPE);
5727
+ yield _this64.applyLoginResponse(response, XRPL_WALLET_LOGIN_TYPE);
5582
5728
  return response;
5583
5729
  })();
5584
5730
  }
@@ -5643,9 +5789,9 @@ export class BriijClient extends TypedEventEmitter {
5643
5789
  * @param data - Credentials and other details for the login request.
5644
5790
  */
5645
5791
  loginRequest(data) {
5646
- var _this63 = this;
5792
+ var _this65 = this;
5647
5793
  return _asyncToGenerator(function* () {
5648
- return yield _this63.http.authedRequest(Method.Post, "/login", undefined, data);
5794
+ return yield _this65.http.authedRequest(Method.Post, "/login", undefined, data);
5649
5795
  })();
5650
5796
  }
5651
5797
 
@@ -5660,14 +5806,14 @@ export class BriijClient extends TypedEventEmitter {
5660
5806
  */
5661
5807
  logout() {
5662
5808
  var _arguments14 = arguments,
5663
- _this64 = this;
5809
+ _this66 = this;
5664
5810
  return _asyncToGenerator(function* () {
5665
5811
  var stopClient = _arguments14.length > 0 && _arguments14[0] !== undefined ? _arguments14[0] : false;
5666
5812
  if (stopClient) {
5667
- _this64.stopClient();
5668
- _this64.http.abort();
5813
+ _this66.stopClient();
5814
+ _this66.http.abort();
5669
5815
  }
5670
- return _this64.http.authedRequest(Method.Post, "/logout");
5816
+ return _this66.http.authedRequest(Method.Post, "/logout");
5671
5817
  })();
5672
5818
  }
5673
5819
 
@@ -5705,12 +5851,12 @@ export class BriijClient extends TypedEventEmitter {
5705
5851
  * or UIA auth data.
5706
5852
  */
5707
5853
  requestLoginToken(auth) {
5708
- var _this65 = this;
5854
+ var _this67 = this;
5709
5855
  return _asyncToGenerator(function* () {
5710
5856
  var body = {
5711
5857
  auth
5712
5858
  };
5713
- return _this65.http.authedRequest(Method.Post, "/login/get_token", undefined,
5859
+ return _this67.http.authedRequest(Method.Post, "/login/get_token", undefined,
5714
5860
  // no query params
5715
5861
  body, {
5716
5862
  prefix: ClientPrefix.V1
@@ -5742,23 +5888,23 @@ export class BriijClient extends TypedEventEmitter {
5742
5888
  * @returns Rejects: with an error response.
5743
5889
  */
5744
5890
  createRoom(options) {
5745
- var _this66 = this;
5891
+ var _this68 = this;
5746
5892
  return _asyncToGenerator(function* () {
5747
- var _this66$identityServe;
5893
+ var _this68$identityServe;
5748
5894
  // eslint-disable-line camelcase
5749
5895
  // some valid options include: room_alias_name, visibility, invite
5750
5896
 
5751
5897
  // inject the id_access_token if inviting 3rd party addresses
5752
5898
  var invitesNeedingToken = (options.invite_3pid || []).filter(i => !i.id_access_token);
5753
- if (invitesNeedingToken.length > 0 && (_this66$identityServe = _this66.identityServer) !== null && _this66$identityServe !== void 0 && _this66$identityServe.getAccessToken) {
5754
- var identityAccessToken = yield _this66.identityServer.getAccessToken();
5899
+ if (invitesNeedingToken.length > 0 && (_this68$identityServe = _this68.identityServer) !== null && _this68$identityServe !== void 0 && _this68$identityServe.getAccessToken) {
5900
+ var identityAccessToken = yield _this68.identityServer.getAccessToken();
5755
5901
  if (identityAccessToken) {
5756
5902
  for (var invite of invitesNeedingToken) {
5757
5903
  invite.id_access_token = identityAccessToken;
5758
5904
  }
5759
5905
  }
5760
5906
  }
5761
- return _this66.http.authedRequest(Method.Post, "/createRoom", undefined, options);
5907
+ return _this68.http.authedRequest(Method.Post, "/createRoom", undefined, options);
5762
5908
  })();
5763
5909
  }
5764
5910
 
@@ -5904,11 +6050,11 @@ export class BriijClient extends TypedEventEmitter {
5904
6050
  */
5905
6051
  sendStateEvent(roomId, eventType, content) {
5906
6052
  var _arguments15 = arguments,
5907
- _this67 = this;
6053
+ _this69 = this;
5908
6054
  return _asyncToGenerator(function* () {
5909
6055
  var stateKey = _arguments15.length > 3 && _arguments15[3] !== undefined ? _arguments15[3] : "";
5910
6056
  var opts = _arguments15.length > 4 && _arguments15[4] !== undefined ? _arguments15[4] : {};
5911
- var room = _this67.getRoom(roomId);
6057
+ var room = _this69.getRoom(roomId);
5912
6058
  var event = new BriijEvent({
5913
6059
  room_id: roomId,
5914
6060
  type: eventType,
@@ -5916,7 +6062,7 @@ export class BriijClient extends TypedEventEmitter {
5916
6062
  // Cast safety: StateEvents[K] is a stronger bound than IContent, which has [key: string]: any
5917
6063
  content: content
5918
6064
  });
5919
- yield _this67.encryptStateEventIfNeeded(event, room !== null && room !== void 0 ? room : undefined);
6065
+ yield _this69.encryptStateEventIfNeeded(event, room !== null && room !== void 0 ? room : undefined);
5920
6066
  var pathParams = {
5921
6067
  $roomId: roomId,
5922
6068
  $eventType: event.getWireType(),
@@ -5926,36 +6072,36 @@ export class BriijClient extends TypedEventEmitter {
5926
6072
  if (stateKey !== undefined) {
5927
6073
  path = utils.encodeUri(path + "/$stateKey", pathParams);
5928
6074
  }
5929
- return _this67.http.authedRequest(Method.Put, path, undefined, event.getWireContent(), opts);
6075
+ return _this69.http.authedRequest(Method.Put, path, undefined, event.getWireContent(), opts);
5930
6076
  })();
5931
6077
  }
5932
6078
  encryptStateEventIfNeeded(event, room) {
5933
- var _this68 = this;
6079
+ var _this70 = this;
5934
6080
  return _asyncToGenerator(function* () {
5935
- if (!_this68.enableEncryptedStateEvents) {
6081
+ if (!_this70.enableEncryptedStateEvents) {
5936
6082
  return;
5937
6083
  }
5938
6084
 
5939
6085
  // If the room is unknown, we cannot encrypt for it
5940
6086
  if (!room) return;
5941
- if (!_this68.cryptoBackend && _this68.usingExternalCrypto) {
6087
+ if (!_this70.cryptoBackend && _this70.usingExternalCrypto) {
5942
6088
  // The client has opted to allow sending messages to encrypted
5943
6089
  // rooms even if the room is encrypted, and we haven't set up
5944
6090
  // crypto. This is useful for users of matrix-org/pantalaimon
5945
6091
  return;
5946
6092
  }
5947
- if (!_this68.cryptoBackend) {
6093
+ if (!_this70.cryptoBackend) {
5948
6094
  throw new Error("This room is configured to use encryption, but your client does not support encryption.");
5949
6095
  }
5950
6096
 
5951
6097
  // Check regular encryption conditions.
5952
- if (!(yield _this68.shouldEncryptEventForRoom(event, room))) {
6098
+ if (!(yield _this70.shouldEncryptEventForRoom(event, room))) {
5953
6099
  return;
5954
6100
  }
5955
6101
 
5956
6102
  // If the crypto impl thinks we shouldn't encrypt, then we shouldn't.
5957
6103
  // Safety: we checked the crypto impl exists above.
5958
- if (!(yield _this68.cryptoBackend.isStateEncryptionEnabledInRoom(room.roomId))) {
6104
+ if (!(yield _this70.cryptoBackend.isStateEncryptionEnabledInRoom(room.roomId))) {
5959
6105
  return;
5960
6106
  }
5961
6107
 
@@ -5963,7 +6109,7 @@ export class BriijClient extends TypedEventEmitter {
5963
6109
  if (["m.room.create", "m.room.member", "m.room.join_rules", "m.room.power_levels", "m.room.third_party_invite", "m.room.history_visibility", "m.room.guest_access", "m.room.encryption"].includes(event.getType())) {
5964
6110
  return;
5965
6111
  }
5966
- yield _this68.cryptoBackend.encryptEvent(event, room);
6112
+ yield _this70.cryptoBackend.encryptEvent(event, room);
5967
6113
  })();
5968
6114
  }
5969
6115
 
@@ -5996,7 +6142,7 @@ export class BriijClient extends TypedEventEmitter {
5996
6142
  * @returns Promise which resolves: the empty object, `{}`.
5997
6143
  */
5998
6144
  setRoomReadMarkersHttpRequest(roomId, rmEventId, rrEventId, rpEventId) {
5999
- var _this69 = this;
6145
+ var _this71 = this;
6000
6146
  return _asyncToGenerator(function* () {
6001
6147
  var path = utils.encodeUri("/rooms/$roomId/read_markers", {
6002
6148
  $roomId: roomId
@@ -6005,10 +6151,10 @@ export class BriijClient extends TypedEventEmitter {
6005
6151
  [ReceiptType.FullyRead]: rmEventId,
6006
6152
  [ReceiptType.Read]: rrEventId
6007
6153
  };
6008
- if ((yield _this69.doesServerSupportUnstableFeature("org.matrix.msc2285.stable")) || (yield _this69.isVersionSupported("v1.4"))) {
6154
+ if ((yield _this71.doesServerSupportUnstableFeature("org.matrix.msc2285.stable")) || (yield _this71.isVersionSupported("v1.4"))) {
6009
6155
  content[ReceiptType.ReadPrivate] = rpEventId;
6010
6156
  }
6011
- return _this69.http.authedRequest(Method.Post, path, undefined, content);
6157
+ return _this71.http.authedRequest(Method.Post, path, undefined, content);
6012
6158
  })();
6013
6159
  }
6014
6160
 
@@ -6044,13 +6190,13 @@ export class BriijClient extends TypedEventEmitter {
6044
6190
  * @see BriijSafetyError
6045
6191
  */
6046
6192
  publicRooms() {
6047
- var _ref1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6193
+ var _ref13 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6048
6194
  var {
6049
6195
  server,
6050
6196
  limit,
6051
6197
  since
6052
- } = _ref1,
6053
- options = _objectWithoutProperties(_ref1, _excluded);
6198
+ } = _ref13,
6199
+ options = _objectWithoutProperties(_ref13, _excluded);
6054
6200
  if (Object.keys(options).length === 0) {
6055
6201
  var queryParams = {
6056
6202
  server,
@@ -6168,11 +6314,11 @@ export class BriijClient extends TypedEventEmitter {
6168
6314
  * @param options.limit - the maximum number of results to return. The server will apply a limit if unspecified.
6169
6315
  * @returns Promise which resolves: an array of results.
6170
6316
  */
6171
- searchUserDirectory(_ref10) {
6317
+ searchUserDirectory(_ref14) {
6172
6318
  var {
6173
6319
  term,
6174
6320
  limit
6175
- } = _ref10;
6321
+ } = _ref14;
6176
6322
  var body = {
6177
6323
  search_term: term
6178
6324
  };
@@ -6242,9 +6388,9 @@ export class BriijClient extends TypedEventEmitter {
6242
6388
  * @returns `true` if supported, otherwise `false`
6243
6389
  */
6244
6390
  doesServerSupportExtendedProfiles() {
6245
- var _this70 = this;
6391
+ var _this72 = this;
6246
6392
  return _asyncToGenerator(function* () {
6247
- return (yield _this70.isVersionSupported("v1.16")) || (yield _this70.doesServerSupportUnstableFeature(UNSTABLE_MSC4133_EXTENDED_PROFILES)) || (yield _this70.doesServerSupportUnstableFeature(STABLE_MSC4133_EXTENDED_PROFILES));
6393
+ return (yield _this72.isVersionSupported("v1.16")) || (yield _this72.doesServerSupportUnstableFeature(UNSTABLE_MSC4133_EXTENDED_PROFILES)) || (yield _this72.doesServerSupportUnstableFeature(STABLE_MSC4133_EXTENDED_PROFILES));
6248
6394
  })();
6249
6395
  }
6250
6396
 
@@ -6254,9 +6400,9 @@ export class BriijClient extends TypedEventEmitter {
6254
6400
  * @returns The prefix for use with `authedRequest`
6255
6401
  */
6256
6402
  getExtendedProfileRequestPrefix() {
6257
- var _this71 = this;
6403
+ var _this73 = this;
6258
6404
  return _asyncToGenerator(function* () {
6259
- if ((yield _this71.isVersionSupported("v1.16")) || (yield _this71.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable"))) {
6405
+ if ((yield _this73.isVersionSupported("v1.16")) || (yield _this73.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable"))) {
6260
6406
  return ClientPrefix.V3;
6261
6407
  }
6262
6408
  return "/_matrix/client/unstable/uk.tcpip.msc4133";
@@ -6274,15 +6420,15 @@ export class BriijClient extends TypedEventEmitter {
6274
6420
  * @throws A M_NOT_FOUND error if the profile could not be found.
6275
6421
  */
6276
6422
  getExtendedProfile(userId) {
6277
- var _this72 = this;
6423
+ var _this74 = this;
6278
6424
  return _asyncToGenerator(function* () {
6279
- if (!(yield _this72.doesServerSupportExtendedProfiles())) {
6425
+ if (!(yield _this74.doesServerSupportExtendedProfiles())) {
6280
6426
  throw new Error("Server does not support extended profiles");
6281
6427
  }
6282
- return _this72.http.authedRequest(Method.Get, utils.encodeUri("/profile/$userId", {
6428
+ return _this74.http.authedRequest(Method.Get, utils.encodeUri("/profile/$userId", {
6283
6429
  $userId: userId
6284
6430
  }), undefined, undefined, {
6285
- prefix: yield _this72.getExtendedProfileRequestPrefix()
6431
+ prefix: yield _this74.getExtendedProfileRequestPrefix()
6286
6432
  });
6287
6433
  })();
6288
6434
  }
@@ -6299,16 +6445,16 @@ export class BriijClient extends TypedEventEmitter {
6299
6445
  * @throws A M_NOT_FOUND error if the key was not set OR the profile could not be found.
6300
6446
  */
6301
6447
  getExtendedProfileProperty(userId, key) {
6302
- var _this73 = this;
6448
+ var _this75 = this;
6303
6449
  return _asyncToGenerator(function* () {
6304
- if (!(yield _this73.doesServerSupportExtendedProfiles())) {
6450
+ if (!(yield _this75.doesServerSupportExtendedProfiles())) {
6305
6451
  throw new Error("Server does not support extended profiles");
6306
6452
  }
6307
- var profile = yield _this73.http.authedRequest(Method.Get, utils.encodeUri("/profile/$userId/$key", {
6453
+ var profile = yield _this75.http.authedRequest(Method.Get, utils.encodeUri("/profile/$userId/$key", {
6308
6454
  $userId: userId,
6309
6455
  $key: key
6310
6456
  }), undefined, undefined, {
6311
- prefix: yield _this73.getExtendedProfileRequestPrefix()
6457
+ prefix: yield _this75.getExtendedProfileRequestPrefix()
6312
6458
  });
6313
6459
  return profile[key];
6314
6460
  })();
@@ -6324,19 +6470,19 @@ export class BriijClient extends TypedEventEmitter {
6324
6470
  * @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
6325
6471
  */
6326
6472
  setExtendedProfileProperty(key, value) {
6327
- var _this74 = this;
6473
+ var _this76 = this;
6328
6474
  return _asyncToGenerator(function* () {
6329
- if (!(yield _this74.doesServerSupportExtendedProfiles())) {
6475
+ if (!(yield _this76.doesServerSupportExtendedProfiles())) {
6330
6476
  throw new Error("Server does not support extended profiles");
6331
6477
  }
6332
- var userId = _this74.getUserId();
6333
- yield _this74.http.authedRequest(Method.Put, utils.encodeUri("/profile/$userId/$key", {
6478
+ var userId = _this76.getUserId();
6479
+ yield _this76.http.authedRequest(Method.Put, utils.encodeUri("/profile/$userId/$key", {
6334
6480
  $userId: userId,
6335
6481
  $key: key
6336
6482
  }), undefined, {
6337
6483
  [key]: value
6338
6484
  }, {
6339
- prefix: yield _this74.getExtendedProfileRequestPrefix()
6485
+ prefix: yield _this76.getExtendedProfileRequestPrefix()
6340
6486
  });
6341
6487
  })();
6342
6488
  }
@@ -6350,17 +6496,17 @@ export class BriijClient extends TypedEventEmitter {
6350
6496
  * @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
6351
6497
  */
6352
6498
  deleteExtendedProfileProperty(key) {
6353
- var _this75 = this;
6499
+ var _this77 = this;
6354
6500
  return _asyncToGenerator(function* () {
6355
- if (!(yield _this75.doesServerSupportExtendedProfiles())) {
6501
+ if (!(yield _this77.doesServerSupportExtendedProfiles())) {
6356
6502
  throw new Error("Server does not support extended profiles");
6357
6503
  }
6358
- var userId = _this75.getUserId();
6359
- yield _this75.http.authedRequest(Method.Delete, utils.encodeUri("/profile/$userId/$key", {
6504
+ var userId = _this77.getUserId();
6505
+ yield _this77.http.authedRequest(Method.Delete, utils.encodeUri("/profile/$userId/$key", {
6360
6506
  $userId: userId,
6361
6507
  $key: key
6362
6508
  }), undefined, undefined, {
6363
- prefix: yield _this75.getExtendedProfileRequestPrefix()
6509
+ prefix: yield _this77.getExtendedProfileRequestPrefix()
6364
6510
  });
6365
6511
  })();
6366
6512
  }
@@ -6376,16 +6522,16 @@ export class BriijClient extends TypedEventEmitter {
6376
6522
  * @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
6377
6523
  */
6378
6524
  patchExtendedProfile(profile) {
6379
- var _this76 = this;
6525
+ var _this78 = this;
6380
6526
  return _asyncToGenerator(function* () {
6381
- if (!(yield _this76.doesServerSupportExtendedProfiles())) {
6527
+ if (!(yield _this78.doesServerSupportExtendedProfiles())) {
6382
6528
  throw new Error("Server does not support extended profiles");
6383
6529
  }
6384
- var userId = _this76.getUserId();
6385
- return _this76.http.authedRequest(Method.Patch, utils.encodeUri("/profile/$userId", {
6530
+ var userId = _this78.getUserId();
6531
+ return _this78.http.authedRequest(Method.Patch, utils.encodeUri("/profile/$userId", {
6386
6532
  $userId: userId
6387
6533
  }), {}, profile, {
6388
- prefix: yield _this76.getExtendedProfileRequestPrefix()
6534
+ prefix: yield _this78.getExtendedProfileRequestPrefix()
6389
6535
  });
6390
6536
  })();
6391
6537
  }
@@ -6400,16 +6546,16 @@ export class BriijClient extends TypedEventEmitter {
6400
6546
  * @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
6401
6547
  */
6402
6548
  setExtendedProfile(profile) {
6403
- var _this77 = this;
6549
+ var _this79 = this;
6404
6550
  return _asyncToGenerator(function* () {
6405
- if (!(yield _this77.doesServerSupportExtendedProfiles())) {
6551
+ if (!(yield _this79.doesServerSupportExtendedProfiles())) {
6406
6552
  throw new Error("Server does not support extended profiles");
6407
6553
  }
6408
- var userId = _this77.getUserId();
6409
- yield _this77.http.authedRequest(Method.Put, utils.encodeUri("/profile/$userId", {
6554
+ var userId = _this79.getUserId();
6555
+ yield _this79.http.authedRequest(Method.Put, utils.encodeUri("/profile/$userId", {
6410
6556
  $userId: userId
6411
6557
  }), {}, profile, {
6412
- prefix: yield _this77.getExtendedProfileRequestPrefix()
6558
+ prefix: yield _this79.getExtendedProfileRequestPrefix()
6413
6559
  });
6414
6560
  })();
6415
6561
  }
@@ -6432,10 +6578,10 @@ export class BriijClient extends TypedEventEmitter {
6432
6578
  * @returns Rejects: with an error response.
6433
6579
  */
6434
6580
  addThreePidOnly(data) {
6435
- var _this78 = this;
6581
+ var _this80 = this;
6436
6582
  return _asyncToGenerator(function* () {
6437
6583
  var path = "/account/3pid/add";
6438
- return _this78.http.authedRequest(Method.Post, path, undefined, data);
6584
+ return _this80.http.authedRequest(Method.Post, path, undefined, data);
6439
6585
  })();
6440
6586
  }
6441
6587
 
@@ -6451,10 +6597,10 @@ export class BriijClient extends TypedEventEmitter {
6451
6597
  * @returns Rejects: with an error response.
6452
6598
  */
6453
6599
  bindThreePid(data) {
6454
- var _this79 = this;
6600
+ var _this81 = this;
6455
6601
  return _asyncToGenerator(function* () {
6456
6602
  var path = "/account/3pid/bind";
6457
- return _this79.http.authedRequest(Method.Post, path, undefined, data);
6603
+ return _this81.http.authedRequest(Method.Post, path, undefined, data);
6458
6604
  })();
6459
6605
  }
6460
6606
 
@@ -6472,15 +6618,15 @@ export class BriijClient extends TypedEventEmitter {
6472
6618
  unbindThreePid(medium, address
6473
6619
  // eslint-disable-next-line camelcase
6474
6620
  ) {
6475
- var _this80 = this;
6621
+ var _this82 = this;
6476
6622
  return _asyncToGenerator(function* () {
6477
6623
  var path = "/account/3pid/unbind";
6478
6624
  var data = {
6479
6625
  medium,
6480
6626
  address,
6481
- id_server: _this80.getIdentityServerUrl(true)
6627
+ id_server: _this82.getIdentityServerUrl(true)
6482
6628
  };
6483
- return _this80.http.authedRequest(Method.Post, path, undefined, data);
6629
+ return _this82.http.authedRequest(Method.Post, path, undefined, data);
6484
6630
  })();
6485
6631
  }
6486
6632
 
@@ -6602,13 +6748,13 @@ export class BriijClient extends TypedEventEmitter {
6602
6748
  * @returns Rejects: with an error response.
6603
6749
  */
6604
6750
  getPushers() {
6605
- var _this81 = this;
6751
+ var _this83 = this;
6606
6752
  return _asyncToGenerator(function* () {
6607
- var response = yield _this81.http.authedRequest(Method.Get, "/pushers");
6753
+ var response = yield _this83.http.authedRequest(Method.Get, "/pushers");
6608
6754
 
6609
6755
  // Migration path for clients that connect to a homeserver that does not support
6610
6756
  // MSC3881 yet, see https://github.com/matrix-org/matrix-spec-proposals/blob/kerry/remote-push-toggle/proposals/3881-remote-push-notification-toggling.md#migration
6611
- if (!(yield _this81.doesServerSupportUnstableFeature("org.matrix.msc3881"))) {
6757
+ if (!(yield _this83.doesServerSupportUnstableFeature("org.matrix.msc3881"))) {
6612
6758
  response.pushers = response.pushers.map(pusher => {
6613
6759
  if (!pusher.hasOwnProperty(PUSHER_ENABLED.name)) {
6614
6760
  pusher[PUSHER_ENABLED.name] = true;
@@ -6747,11 +6893,11 @@ export class BriijClient extends TypedEventEmitter {
6747
6893
  * @returns Promise which resolves to the search response object.
6748
6894
  * @returns Rejects: with an error response.
6749
6895
  */
6750
- search(_ref11, abortSignal) {
6896
+ search(_ref15, abortSignal) {
6751
6897
  var {
6752
6898
  body,
6753
6899
  next_batch: nextBatch
6754
- } = _ref11;
6900
+ } = _ref15;
6755
6901
  var queryParams = {};
6756
6902
  if (nextBatch) {
6757
6903
  queryParams.next_batch = nextBatch;
@@ -7038,7 +7184,7 @@ export class BriijClient extends TypedEventEmitter {
7038
7184
  * found MXIDs. Results where no user could be found will not be listed.
7039
7185
  */
7040
7186
  identityHashedLookup(addressPairs, identityAccessToken) {
7041
- var _this82 = this;
7187
+ var _this84 = this;
7042
7188
  return _asyncToGenerator(function* () {
7043
7189
  var params = {
7044
7190
  // addresses: ["email@example.org", "10005550000"],
@@ -7047,7 +7193,7 @@ export class BriijClient extends TypedEventEmitter {
7047
7193
  };
7048
7194
 
7049
7195
  // Get hash information first before trying to do a lookup
7050
- var hashes = yield _this82.getIdentityHashDetails(identityAccessToken);
7196
+ var hashes = yield _this84.getIdentityHashDetails(identityAccessToken);
7051
7197
  if (!hashes || !hashes["lookup_pepper"] || !hashes["algorithms"]) {
7052
7198
  throw new Error("Unsupported identity server: bad response");
7053
7199
  }
@@ -7060,7 +7206,7 @@ export class BriijClient extends TypedEventEmitter {
7060
7206
  // When picking an algorithm, we pick the hashed over no hashes
7061
7207
  if (hashes["algorithms"].includes("sha256")) {
7062
7208
  params["addresses"] = yield Promise.all(addressPairs.map(/*#__PURE__*/function () {
7063
- var _ref12 = _asyncToGenerator(function* (p) {
7209
+ var _ref16 = _asyncToGenerator(function* (p) {
7064
7210
  var addr = p[0].toLowerCase(); // lowercase to get consistent hashes
7065
7211
  var med = p[1].toLowerCase();
7066
7212
  var hashBuffer = yield sha256("".concat(addr, " ").concat(med, " ").concat(params["pepper"]));
@@ -7071,8 +7217,8 @@ export class BriijClient extends TypedEventEmitter {
7071
7217
  localMapping[hashed] = p[0];
7072
7218
  return hashed;
7073
7219
  });
7074
- return function (_x4) {
7075
- return _ref12.apply(this, arguments);
7220
+ return function (_x1) {
7221
+ return _ref16.apply(this, arguments);
7076
7222
  };
7077
7223
  }()));
7078
7224
  params["algorithm"] = "sha256";
@@ -7090,7 +7236,7 @@ export class BriijClient extends TypedEventEmitter {
7090
7236
  } else {
7091
7237
  throw new Error("Unsupported identity server: unknown hash algorithm");
7092
7238
  }
7093
- var response = yield _this82.http.idServerRequest(Method.Post, "/lookup", params, IdentityPrefix.V2, identityAccessToken);
7239
+ var response = yield _this84.http.idServerRequest(Method.Post, "/lookup", params, IdentityPrefix.V2, identityAccessToken);
7094
7240
  if (!(response !== null && response !== void 0 && response["mappings"])) return []; // no results
7095
7241
 
7096
7242
  var foundAddresses = [];
@@ -7124,12 +7270,12 @@ export class BriijClient extends TypedEventEmitter {
7124
7270
  * @returns Rejects: with an error response.
7125
7271
  */
7126
7272
  lookupThreePid(medium, address, identityAccessToken) {
7127
- var _this83 = this;
7273
+ var _this85 = this;
7128
7274
  return _asyncToGenerator(function* () {
7129
7275
  // Note: we're using the V2 API by calling this function, but our
7130
7276
  // function contract requires a V1 response. We therefore have to
7131
7277
  // convert it manually.
7132
- var response = yield _this83.identityHashedLookup([[address, medium]], identityAccessToken);
7278
+ var response = yield _this85.identityHashedLookup([[address, medium]], identityAccessToken);
7133
7279
  var result = response.find(p => p.address === address);
7134
7280
  if (!result) {
7135
7281
  return {};
@@ -7161,12 +7307,12 @@ export class BriijClient extends TypedEventEmitter {
7161
7307
  * @returns Rejects: with an error response.
7162
7308
  */
7163
7309
  bulkLookupThreePids(query, identityAccessToken) {
7164
- var _this84 = this;
7310
+ var _this86 = this;
7165
7311
  return _asyncToGenerator(function* () {
7166
7312
  // Note: we're using the V2 API by calling this function, but our
7167
7313
  // function contract requires a V1 response. We therefore have to
7168
7314
  // convert it manually.
7169
- var response = yield _this84.identityHashedLookup(
7315
+ var response = yield _this86.identityHashedLookup(
7170
7316
  // We have to reverse the query order to get [address, medium] pairs
7171
7317
  query.map(p => [p[1], p[0]]), identityAccessToken);
7172
7318
  var v1results = [];
@@ -7240,16 +7386,16 @@ export class BriijClient extends TypedEventEmitter {
7240
7386
  * @returns Promise which resolves once queued there is no error feedback when sending fails.
7241
7387
  */
7242
7388
  encryptAndSendToDevice(eventType, devices, payload) {
7243
- var _this85 = this;
7389
+ var _this87 = this;
7244
7390
  return _asyncToGenerator(function* () {
7245
- if (!_this85.cryptoBackend) {
7391
+ if (!_this87.cryptoBackend) {
7246
7392
  throw new Error("Cannot encrypt to device event, your client does not support encryption.");
7247
7393
  }
7248
- var batch = yield _this85.cryptoBackend.encryptToDeviceMessages(eventType, devices, payload);
7394
+ var batch = yield _this87.cryptoBackend.encryptToDeviceMessages(eventType, devices, payload);
7249
7395
 
7250
7396
  // TODO The batch mechanism removes all possibility to get error feedbacks..
7251
7397
  // We might want instead to do the API call directly and pass the errors back.
7252
- yield _this85.queueToDevice(batch);
7398
+ yield _this87.queueToDevice(batch);
7253
7399
  })();
7254
7400
  }
7255
7401
 
@@ -7406,16 +7552,16 @@ export class BriijClient extends TypedEventEmitter {
7406
7552
  * @returns Promise which resolves to the created space.
7407
7553
  */
7408
7554
  unstableCreateFileTree(name) {
7409
- var _this86 = this;
7555
+ var _this88 = this;
7410
7556
  return _asyncToGenerator(function* () {
7411
7557
  var {
7412
7558
  room_id: roomId
7413
- } = yield _this86.createRoom({
7559
+ } = yield _this88.createRoom({
7414
7560
  name: name,
7415
7561
  preset: Preset.PrivateChat,
7416
7562
  power_level_content_override: _objectSpread(_objectSpread({}, DEFAULT_TREE_POWER_LEVELS_TEMPLATE), {}, {
7417
7563
  users: {
7418
- [_this86.getUserId()]: 100
7564
+ [_this88.getUserId()]: 100
7419
7565
  }
7420
7566
  }),
7421
7567
  creation_content: {
@@ -7435,7 +7581,7 @@ export class BriijClient extends TypedEventEmitter {
7435
7581
  }
7436
7582
  }]
7437
7583
  });
7438
- return new MSC3089TreeSpace(_this86, roomId);
7584
+ return new MSC3089TreeSpace(_this88, roomId);
7439
7585
  })();
7440
7586
  }
7441
7587
 
@@ -7512,7 +7658,7 @@ export class BriijClient extends TypedEventEmitter {
7512
7658
  * @param via - The list of servers which know about the room if only an ID was provided.
7513
7659
  */
7514
7660
  getRoomSummary(roomIdOrAlias, via) {
7515
- var _this87 = this;
7661
+ var _this89 = this;
7516
7662
  return _asyncToGenerator(function* () {
7517
7663
  var paramOpts = {
7518
7664
  prefix: "/_matrix/client/unstable/im.nheko.summary"
@@ -7521,7 +7667,7 @@ export class BriijClient extends TypedEventEmitter {
7521
7667
  var path = utils.encodeUri("/summary/$roomid", {
7522
7668
  $roomid: roomIdOrAlias
7523
7669
  });
7524
- return yield _this87.http.authedRequest(Method.Get, path, {
7670
+ return yield _this89.http.authedRequest(Method.Get, path, {
7525
7671
  via
7526
7672
  }, undefined, paramOpts);
7527
7673
  } catch (e) {
@@ -7529,7 +7675,7 @@ export class BriijClient extends TypedEventEmitter {
7529
7675
  var _path = utils.encodeUri("/rooms/$roomid/summary", {
7530
7676
  $roomid: roomIdOrAlias
7531
7677
  });
7532
- return yield _this87.http.authedRequest(Method.Get, _path, {
7678
+ return yield _this89.http.authedRequest(Method.Get, _path, {
7533
7679
  via
7534
7680
  }, undefined, paramOpts);
7535
7681
  } else {
@@ -7581,9 +7727,9 @@ export class BriijClient extends TypedEventEmitter {
7581
7727
  * Fetches information about the user for the configured access token.
7582
7728
  */
7583
7729
  whoami() {
7584
- var _this88 = this;
7730
+ var _this90 = this;
7585
7731
  return _asyncToGenerator(function* () {
7586
- return _this88.http.authedRequest(Method.Get, "/account/whoami");
7732
+ return _this90.http.authedRequest(Method.Get, "/account/whoami");
7587
7733
  })();
7588
7734
  }
7589
7735
 
@@ -7594,7 +7740,7 @@ export class BriijClient extends TypedEventEmitter {
7594
7740
  * @returns Rejects: when the request fails (module:http-api.BriijError)
7595
7741
  */
7596
7742
  timestampToEvent(roomId, timestamp, dir) {
7597
- var _this89 = this;
7743
+ var _this91 = this;
7598
7744
  return _asyncToGenerator(function* () {
7599
7745
  var path = utils.encodeUri("/rooms/$roomId/timestamp_to_event", {
7600
7746
  $roomId: roomId
@@ -7604,7 +7750,7 @@ export class BriijClient extends TypedEventEmitter {
7604
7750
  dir: dir
7605
7751
  };
7606
7752
  try {
7607
- return yield _this89.http.authedRequest(Method.Get, path, queryParams, undefined, {
7753
+ return yield _this91.http.authedRequest(Method.Get, path, queryParams, undefined, {
7608
7754
  prefix: ClientPrefix.V1
7609
7755
  });
7610
7756
  } catch (err) {
@@ -7620,7 +7766,7 @@ export class BriijClient extends TypedEventEmitter {
7620
7766
  // both indicate that this endpoint+verb combination is
7621
7767
  // not supported.
7622
7768
  err.httpStatus === 404 || err.httpStatus === 405)) {
7623
- return yield _this89.http.authedRequest(Method.Get, path, queryParams, undefined, {
7769
+ return yield _this91.http.authedRequest(Method.Get, path, queryParams, undefined, {
7624
7770
  prefix: "/_matrix/client/unstable/org.matrix.msc3030"
7625
7771
  });
7626
7772
  }
@@ -7640,12 +7786,12 @@ export class BriijClient extends TypedEventEmitter {
7640
7786
  * @throws when delegated auth config is invalid or unreachable
7641
7787
  */
7642
7788
  getAuthMetadata() {
7643
- var _this90 = this;
7789
+ var _this92 = this;
7644
7790
  return _asyncToGenerator(function* () {
7645
7791
  var authMetadata;
7646
7792
  try {
7647
- var useStable = yield _this90.isVersionSupported("v1.15");
7648
- authMetadata = yield _this90.http.request(Method.Get, "/auth_metadata", undefined, undefined, {
7793
+ var useStable = yield _this92.isVersionSupported("v1.15");
7794
+ authMetadata = yield _this92.http.request(Method.Get, "/auth_metadata", undefined, undefined, {
7649
7795
  prefix: useStable ? ClientPrefix.V1 : ClientPrefix.Unstable + "/org.matrix.msc2965"
7650
7796
  });
7651
7797
  } catch (e) {
@@ -7653,7 +7799,7 @@ export class BriijClient extends TypedEventEmitter {
7653
7799
  // Fall back to older variant of MSC2965
7654
7800
  var {
7655
7801
  issuer
7656
- } = yield _this90.http.request(Method.Get, "/auth_issuer", undefined, undefined, {
7802
+ } = yield _this92.http.request(Method.Get, "/auth_issuer", undefined, undefined, {
7657
7803
  prefix: ClientPrefix.Unstable + "/org.matrix.msc2965"
7658
7804
  });
7659
7805
  return discoverAndValidateOIDCIssuerWellKnown(issuer);
@@ -7666,8 +7812,8 @@ export class BriijClient extends TypedEventEmitter {
7666
7812
  }
7667
7813
  _defineProperty(BriijClient, "RESTORE_BACKUP_ERROR_BAD_KEY", "RESTORE_BACKUP_ERROR_BAD_KEY");
7668
7814
  function getUnstableDelayQueryOpts(delayOpts) {
7669
- return Object.fromEntries(Object.entries(delayOpts).map(_ref13 => {
7670
- var [k, v] = _ref13;
7815
+ return Object.fromEntries(Object.entries(delayOpts).map(_ref17 => {
7816
+ var [k, v] = _ref17;
7671
7817
  return ["".concat(UNSTABLE_MSC4140_DELAYED_EVENTS, ".").concat(k), v];
7672
7818
  }));
7673
7819
  }