matrix-js-sdk 27.2.0 → 27.3.0-rc.1

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +2 -0
  3. package/dist/browser-matrix.js +141 -231
  4. package/dist/browser-matrix.js.map +16 -14
  5. package/dist/browser-matrix.min.js +1 -1
  6. package/dist/browser-matrix.min.js.map +1 -1
  7. package/git-revision.txt +1 -1
  8. package/lib/@types/requests.d.ts +0 -5
  9. package/lib/@types/requests.d.ts.map +1 -1
  10. package/lib/@types/requests.js.map +1 -1
  11. package/lib/autodiscovery.d.ts +3 -1
  12. package/lib/autodiscovery.d.ts.map +1 -1
  13. package/lib/autodiscovery.js +17 -2
  14. package/lib/autodiscovery.js.map +1 -1
  15. package/lib/client.d.ts +7 -69
  16. package/lib/client.d.ts.map +1 -1
  17. package/lib/client.js +21 -171
  18. package/lib/client.js.map +1 -1
  19. package/lib/content-repo.js +2 -2
  20. package/lib/content-repo.js.map +1 -1
  21. package/lib/crypto/backup.d.ts.map +1 -1
  22. package/lib/crypto/backup.js +18 -7
  23. package/lib/crypto/backup.js.map +1 -1
  24. package/lib/crypto/index.d.ts +7 -1
  25. package/lib/crypto/index.d.ts.map +1 -1
  26. package/lib/crypto/index.js +14 -0
  27. package/lib/crypto/index.js.map +1 -1
  28. package/lib/crypto-api/keybackup.d.ts +7 -0
  29. package/lib/crypto-api/keybackup.d.ts.map +1 -1
  30. package/lib/crypto-api/keybackup.js.map +1 -1
  31. package/lib/crypto-api.d.ts +20 -1
  32. package/lib/crypto-api.d.ts.map +1 -1
  33. package/lib/crypto-api.js.map +1 -1
  34. package/lib/http-api/index.js +3 -3
  35. package/lib/http-api/index.js.map +1 -1
  36. package/lib/http-api/prefix.d.ts +7 -7
  37. package/lib/http-api/prefix.d.ts.map +1 -1
  38. package/lib/http-api/prefix.js +2 -2
  39. package/lib/http-api/prefix.js.map +1 -1
  40. package/lib/interactive-auth.d.ts.map +1 -1
  41. package/lib/interactive-auth.js +2 -4
  42. package/lib/interactive-auth.js.map +1 -1
  43. package/lib/matrix.d.ts +1 -0
  44. package/lib/matrix.d.ts.map +1 -1
  45. package/lib/matrix.js +12 -0
  46. package/lib/matrix.js.map +1 -1
  47. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +1 -1
  48. package/lib/rust-crypto/OutgoingRequestProcessor.js +4 -2
  49. package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -1
  50. package/lib/rust-crypto/backup.d.ts +53 -3
  51. package/lib/rust-crypto/backup.d.ts.map +1 -1
  52. package/lib/rust-crypto/backup.js +206 -4
  53. package/lib/rust-crypto/backup.js.map +1 -1
  54. package/lib/rust-crypto/rust-crypto.d.ts +28 -5
  55. package/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
  56. package/lib/rust-crypto/rust-crypto.js +66 -7
  57. package/lib/rust-crypto/rust-crypto.js.map +1 -1
  58. package/lib/rust-crypto/verification.d.ts +10 -0
  59. package/lib/rust-crypto/verification.d.ts.map +1 -1
  60. package/lib/rust-crypto/verification.js +27 -0
  61. package/lib/rust-crypto/verification.js.map +1 -1
  62. package/lib/sync.d.ts.map +1 -1
  63. package/lib/sync.js +4 -11
  64. package/lib/sync.js.map +1 -1
  65. package/lib/version-support.d.ts +5 -0
  66. package/lib/version-support.d.ts.map +1 -0
  67. package/lib/version-support.js +28 -0
  68. package/lib/version-support.js.map +1 -0
  69. package/package.json +4 -4
  70. package/src/@types/requests.ts +0 -6
  71. package/src/autodiscovery.ts +19 -1
  72. package/src/client.ts +24 -185
  73. package/src/content-repo.ts +2 -2
  74. package/src/crypto/backup.ts +18 -10
  75. package/src/crypto/index.ts +15 -0
  76. package/src/crypto-api/keybackup.ts +8 -0
  77. package/src/crypto-api.ts +22 -1
  78. package/src/http-api/index.ts +3 -3
  79. package/src/http-api/prefix.ts +7 -7
  80. package/src/interactive-auth.ts +2 -4
  81. package/src/matrix.ts +1 -0
  82. package/src/rust-crypto/OutgoingRequestProcessor.ts +7 -2
  83. package/src/rust-crypto/backup.ts +244 -5
  84. package/src/rust-crypto/rust-crypto.ts +94 -15
  85. package/src/rust-crypto/verification.ts +27 -0
  86. package/src/sync.ts +4 -11
  87. package/src/version-support.ts +20 -0
@@ -53908,6 +53908,7 @@ const http_api_1 = require("./http-api");
53908
53908
  const discovery_1 = require("./oidc/discovery");
53909
53909
  const validate_1 = require("./oidc/validate");
53910
53910
  const error_1 = require("./oidc/error");
53911
+ const version_support_1 = require("./version-support");
53911
53912
  // Dev note: Auto discovery is part of the spec.
53912
53913
  // See: https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery
53913
53914
  var AutoDiscoveryAction;
@@ -53929,6 +53930,9 @@ var AutoDiscoveryError;
53929
53930
  AutoDiscoveryError["InvalidIs"] = "Invalid identity server discovery response";
53930
53931
  AutoDiscoveryError["MissingWellknown"] = "No .well-known JSON file found";
53931
53932
  AutoDiscoveryError["InvalidJson"] = "Invalid JSON";
53933
+ AutoDiscoveryError["HomeserverTooOld"] = "The homeserver does not meet the minimum version requirements";
53934
+ // TODO: Implement when Sydent supports the `/versions` endpoint - https://github.com/matrix-org/sydent/issues/424
53935
+ //IdentityServerTooOld = "The identity server does not meet the minimum version requirements",
53932
53936
  })(AutoDiscoveryError || (AutoDiscoveryError = {}));
53933
53937
  /**
53934
53938
  * Utilities for automatically discovery resources, such as homeservers
@@ -53990,7 +53994,7 @@ class AutoDiscovery {
53990
53994
  }
53991
53995
  // Step 3: Make sure the homeserver URL points to a homeserver.
53992
53996
  const hsVersions = yield this.fetchWellKnownObject(`${hsUrl}/_matrix/client/versions`);
53993
- if (!((_a = hsVersions === null || hsVersions === void 0 ? void 0 : hsVersions.raw) === null || _a === void 0 ? void 0 : _a["versions"])) {
53997
+ if (!hsVersions || !Array.isArray((_a = hsVersions.raw) === null || _a === void 0 ? void 0 : _a["versions"])) {
53994
53998
  logger_1.logger.error("Invalid /versions response");
53995
53999
  clientConfig["m.homeserver"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER;
53996
54000
  // Supply the base_url to the caller because they may be ignoring liveliness
@@ -53998,6 +54002,15 @@ class AutoDiscovery {
53998
54002
  clientConfig["m.homeserver"].base_url = hsUrl;
53999
54003
  return Promise.resolve(clientConfig);
54000
54004
  }
54005
+ // Step 3.1: Non-spec check to ensure the server will actually work for us
54006
+ if (!hsVersions.raw["versions"].includes(version_support_1.MINIMUM_MATRIX_VERSION)) {
54007
+ logger_1.logger.error("Homeserver does not meet minimum version requirements");
54008
+ clientConfig["m.homeserver"].error = AutoDiscovery.ERROR_HOMESERVER_TOO_OLD;
54009
+ // Supply the base_url to the caller because they may be ignoring liveliness
54010
+ // errors, like this one.
54011
+ clientConfig["m.homeserver"].base_url = hsUrl;
54012
+ return Promise.resolve(clientConfig);
54013
+ }
54001
54014
  // Step 4: Now that the homeserver looks valid, update our client config.
54002
54015
  clientConfig["m.homeserver"] = {
54003
54016
  state: AutoDiscovery.SUCCESS,
@@ -54362,6 +54375,7 @@ AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER = AutoDiscoveryError.InvalidIdentity
54362
54375
  AutoDiscovery.ERROR_INVALID_IS = AutoDiscoveryError.InvalidIs;
54363
54376
  AutoDiscovery.ERROR_MISSING_WELLKNOWN = AutoDiscoveryError.MissingWellknown;
54364
54377
  AutoDiscovery.ERROR_INVALID_JSON = AutoDiscoveryError.InvalidJson;
54378
+ AutoDiscovery.ERROR_HOMESERVER_TOO_OLD = AutoDiscoveryError.HomeserverTooOld;
54365
54379
  AutoDiscovery.ALL_ERRORS = Object.keys(AutoDiscoveryError);
54366
54380
  /**
54367
54381
  * The auto discovery failed. The client is expected to communicate
@@ -54389,7 +54403,7 @@ AutoDiscovery.SUCCESS = AutoDiscoveryAction.SUCCESS;
54389
54403
 
54390
54404
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
54391
54405
 
54392
- },{"./client":331,"./http-api":382,"./logger":389,"./oidc/discovery":413,"./oidc/error":414,"./oidc/validate":415}],330:[function(require,module,exports){
54406
+ },{"./client":331,"./http-api":382,"./logger":389,"./oidc/discovery":413,"./oidc/error":414,"./oidc/validate":415,"./version-support":438}],330:[function(require,module,exports){
54393
54407
  (function (global){(function (){
54394
54408
  "use strict";
54395
54409
  /*
@@ -54701,7 +54715,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
54701
54715
  baseUrl: opts.baseUrl,
54702
54716
  idBaseUrl: opts.idBaseUrl,
54703
54717
  accessToken: opts.accessToken,
54704
- prefix: http_api_1.ClientPrefix.R0,
54718
+ prefix: http_api_1.ClientPrefix.V3,
54705
54719
  onlyData: true,
54706
54720
  extraParams: opts.queryParams,
54707
54721
  localTimeoutMs: opts.localTimeoutMs,
@@ -55514,6 +55528,9 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
55514
55528
  this.reEmitter.reEmit(rustCrypto, [
55515
55529
  crypto_1.CryptoEvent.VerificationRequestReceived,
55516
55530
  crypto_1.CryptoEvent.UserTrustStatusChanged,
55531
+ crypto_1.CryptoEvent.KeyBackupStatus,
55532
+ crypto_1.CryptoEvent.KeyBackupSessionsRemaining,
55533
+ crypto_1.CryptoEvent.KeyBackupFailed,
55517
55534
  ]);
55518
55535
  });
55519
55536
  }
@@ -55690,6 +55707,8 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
55690
55707
  *
55691
55708
  * @returns resolves to a VerificationRequest
55692
55709
  * when the request has been sent to the other party.
55710
+ *
55711
+ * @deprecated Prefer {@link CryptoApi.requestVerificationDM}.
55693
55712
  */
55694
55713
  requestVerificationDM(userId, roomId) {
55695
55714
  if (!this.crypto) {
@@ -56446,6 +56465,8 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
56446
56465
  * getKeyBackupVersion) in backupInfo and
56447
56466
  * trust information (as returned by isKeyBackupTrusted)
56448
56467
  * in trustInfo.
56468
+ *
56469
+ * @deprecated Prefer {@link CryptoApi.checkKeyBackupAndEnable}.
56449
56470
  */
56450
56471
  checkKeyBackup() {
56451
56472
  if (!this.crypto) {
@@ -56509,6 +56530,8 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
56509
56530
  *
56510
56531
  * @param info - Backup information object as returned by getKeyBackupVersion
56511
56532
  * @returns Promise which resolves when complete.
56533
+ *
56534
+ * @deprecated Do not call this directly. Instead call {@link CryptoApi.checkKeyBackupAndEnable}.
56512
56535
  */
56513
56536
  enableKeyBackup(info) {
56514
56537
  if (!this.crypto) {
@@ -56597,9 +56620,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
56597
56620
  // XXX: Private member access
56598
56621
  yield this.crypto.crossSigningInfo.signObject(data.auth_data, "master");
56599
56622
  }
56600
- const res = yield this.http.authedRequest(http_api_1.Method.Post, "/room_keys/version", undefined, data, {
56601
- prefix: http_api_1.ClientPrefix.V3,
56602
- });
56623
+ const res = yield this.http.authedRequest(http_api_1.Method.Post, "/room_keys/version", undefined, data);
56603
56624
  // We could assume everything's okay and enable directly, but this ensures
56604
56625
  // we run the same signature verification that will be used for future
56605
56626
  // sessions.
@@ -56900,7 +56921,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
56900
56921
  */
56901
56922
  getMediaConfig() {
56902
56923
  return this.http.authedRequest(http_api_1.Method.Get, "/config", undefined, undefined, {
56903
- prefix: http_api_1.MediaPrefix.R0,
56924
+ prefix: http_api_1.MediaPrefix.V3,
56904
56925
  });
56905
56926
  }
56906
56927
  /**
@@ -57826,7 +57847,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
57826
57847
  url,
57827
57848
  ts: ts.toString(),
57828
57849
  }, undefined, {
57829
- prefix: http_api_1.MediaPrefix.R0,
57850
+ prefix: http_api_1.MediaPrefix.V3,
57830
57851
  priority: "low",
57831
57852
  });
57832
57853
  // TODO: Expire the URL preview cache sometimes
@@ -57974,7 +57995,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
57974
57995
  medium: medium,
57975
57996
  address: address,
57976
57997
  };
57977
- if (((_a = this.identityServer) === null || _a === void 0 ? void 0 : _a.getAccessToken) && (yield this.doesServerAcceptIdentityAccessToken())) {
57998
+ if ((_a = this.identityServer) === null || _a === void 0 ? void 0 : _a.getAccessToken) {
57978
57999
  const identityAccessToken = yield this.identityServer.getAccessToken();
57979
58000
  if (identityAccessToken) {
57980
58001
  params["id_access_token"] = identityAccessToken;
@@ -58623,7 +58644,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
58623
58644
  }
58624
58645
  const opts = {
58625
58646
  prefix: thread_1.Thread.hasServerSideListSupport === thread_1.FeatureSupport.Stable
58626
- ? "/_matrix/client/v1"
58647
+ ? http_api_1.ClientPrefix.V1
58627
58648
  : "/_matrix/client/unstable/org.matrix.msc3856",
58628
58649
  };
58629
58650
  return this.http
@@ -59041,21 +59062,8 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
59041
59062
  * @returns Promise which resolves: As requestEmailToken
59042
59063
  */
59043
59064
  requestTokenFromEndpoint(endpoint, params) {
59044
- var _a;
59045
59065
  return __awaiter(this, void 0, void 0, function* () {
59046
59066
  const postParams = Object.assign({}, params);
59047
- // If the HS supports separate add and bind, then requestToken endpoints
59048
- // don't need an IS as they are all validated by the HS directly.
59049
- if (!(yield this.doesServerSupportSeparateAddAndBind()) && this.idBaseUrl) {
59050
- const idServerUrl = new URL(this.idBaseUrl);
59051
- postParams.id_server = idServerUrl.host;
59052
- if (((_a = this.identityServer) === null || _a === void 0 ? void 0 : _a.getAccessToken) && (yield this.doesServerAcceptIdentityAccessToken())) {
59053
- const identityAccessToken = yield this.identityServer.getAccessToken();
59054
- if (identityAccessToken) {
59055
- postParams.id_access_token = identityAccessToken;
59056
- }
59057
- }
59058
- }
59059
59067
  return this.http.request(http_api_1.Method.Post, endpoint, undefined, postParams);
59060
59068
  });
59061
59069
  }
@@ -59668,78 +59676,6 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
59668
59676
  return versions && versions.includes(version);
59669
59677
  });
59670
59678
  }
59671
- /**
59672
- * Query the server to see if it supports members lazy loading
59673
- * @returns true if server supports lazy loading
59674
- */
59675
- doesServerSupportLazyLoading() {
59676
- return __awaiter(this, void 0, void 0, function* () {
59677
- const response = yield this.getVersions();
59678
- if (!response)
59679
- return false;
59680
- const versions = response["versions"];
59681
- const unstableFeatures = response["unstable_features"];
59682
- return ((versions && versions.includes("r0.5.0")) || (unstableFeatures && unstableFeatures["m.lazy_load_members"]));
59683
- });
59684
- }
59685
- /**
59686
- * Query the server to see if the `id_server` parameter is required
59687
- * when registering with an 3pid, adding a 3pid or resetting password.
59688
- * @returns true if id_server parameter is required
59689
- */
59690
- doesServerRequireIdServerParam() {
59691
- return __awaiter(this, void 0, void 0, function* () {
59692
- const response = yield this.getVersions();
59693
- if (!response)
59694
- return true;
59695
- const versions = response["versions"];
59696
- // Supporting r0.6.0 is the same as having the flag set to false
59697
- if (versions && versions.includes("r0.6.0")) {
59698
- return false;
59699
- }
59700
- const unstableFeatures = response["unstable_features"];
59701
- if (!unstableFeatures)
59702
- return true;
59703
- if (unstableFeatures["m.require_identity_server"] === undefined) {
59704
- return true;
59705
- }
59706
- else {
59707
- return unstableFeatures["m.require_identity_server"];
59708
- }
59709
- });
59710
- }
59711
- /**
59712
- * Query the server to see if the `id_access_token` parameter can be safely
59713
- * passed to the homeserver. Some homeservers may trigger errors if they are not
59714
- * prepared for the new parameter.
59715
- * @returns true if id_access_token can be sent
59716
- */
59717
- doesServerAcceptIdentityAccessToken() {
59718
- return __awaiter(this, void 0, void 0, function* () {
59719
- const response = yield this.getVersions();
59720
- if (!response)
59721
- return false;
59722
- const versions = response["versions"];
59723
- const unstableFeatures = response["unstable_features"];
59724
- return (versions && versions.includes("r0.6.0")) || (unstableFeatures && unstableFeatures["m.id_access_token"]);
59725
- });
59726
- }
59727
- /**
59728
- * Query the server to see if it supports separate 3PID add and bind functions.
59729
- * This affects the sequence of API calls clients should use for these operations,
59730
- * so it's helpful to be able to check for support.
59731
- * @returns true if separate functions are supported
59732
- */
59733
- doesServerSupportSeparateAddAndBind() {
59734
- return __awaiter(this, void 0, void 0, function* () {
59735
- const response = yield this.getVersions();
59736
- if (!response)
59737
- return false;
59738
- const versions = response["versions"];
59739
- const unstableFeatures = response["unstable_features"];
59740
- return (versions === null || versions === void 0 ? void 0 : versions.includes("r0.6.0")) || (unstableFeatures === null || unstableFeatures === void 0 ? void 0 : unstableFeatures["m.separate_add_and_bind"]);
59741
- });
59742
- }
59743
59679
  /**
59744
59680
  * Query the server to see if it lists support for an unstable feature
59745
59681
  * in the /versions response
@@ -59808,13 +59744,6 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
59808
59744
  }
59809
59745
  });
59810
59746
  }
59811
- /**
59812
- * Query the server to see if it supports the MSC2457 `logout_devices` parameter when setting password
59813
- * @returns true if server supports the `logout_devices` parameter
59814
- */
59815
- doesServerSupportLogoutDevices() {
59816
- return this.isVersionSupported("r0.6.1");
59817
- }
59818
59747
  /**
59819
59748
  * Get if lazy loading members is being used.
59820
59749
  * @returns Whether or not members are lazy loaded by this client
@@ -60147,17 +60076,6 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60147
60076
  password: password,
60148
60077
  });
60149
60078
  }
60150
- /**
60151
- * @param relayState - URL Callback after SAML2 Authentication
60152
- * @returns Promise which resolves to a LoginResponse object
60153
- * @returns Rejects: with an error response.
60154
- * @deprecated this isn't in the Matrix spec anymore
60155
- */
60156
- loginWithSAML2(relayState) {
60157
- return this.login("m.login.saml2", {
60158
- relay_state: relayState,
60159
- });
60160
- }
60161
60079
  /**
60162
60080
  * @param redirectUrl - The URL to redirect to after the HS
60163
60081
  * authenticates with CAS.
@@ -60184,7 +60102,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60184
60102
  redirectUrl,
60185
60103
  [SSO_ACTION_PARAM.unstable]: action,
60186
60104
  };
60187
- return this.http.getUrl(url, params, http_api_1.ClientPrefix.R0).href;
60105
+ return this.http.getUrl(url, params).href;
60188
60106
  }
60189
60107
  /**
60190
60108
  * @param token - Login token previously received from homeserver
@@ -60292,7 +60210,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60292
60210
  });
60293
60211
  return this.http.getUrl(path, {
60294
60212
  session: authSessionId,
60295
- }, http_api_1.ClientPrefix.R0).href;
60213
+ }).href;
60296
60214
  }
60297
60215
  /**
60298
60216
  * Create a new room.
@@ -60307,9 +60225,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60307
60225
  // some valid options include: room_alias_name, visibility, invite
60308
60226
  // inject the id_access_token if inviting 3rd party addresses
60309
60227
  const invitesNeedingToken = (options.invite_3pid || []).filter((i) => !i.id_access_token);
60310
- if (invitesNeedingToken.length > 0 &&
60311
- ((_a = this.identityServer) === null || _a === void 0 ? void 0 : _a.getAccessToken) &&
60312
- (yield this.doesServerAcceptIdentityAccessToken())) {
60228
+ if (invitesNeedingToken.length > 0 && ((_a = this.identityServer) === null || _a === void 0 ? void 0 : _a.getAccessToken)) {
60313
60229
  const identityAccessToken = yield this.identityServer.getAccessToken();
60314
60230
  if (identityAccessToken) {
60315
60231
  for (const invite of invitesNeedingToken) {
@@ -60617,25 +60533,6 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60617
60533
  });
60618
60534
  return this.http.authedRequest(http_api_1.Method.Put, path, undefined, { visibility });
60619
60535
  }
60620
- /**
60621
- * Set the visbility of a room bridged to a 3rd party network in
60622
- * the current HS's room directory.
60623
- * @param networkId - the network ID of the 3rd party
60624
- * instance under which this room is published under.
60625
- * @param visibility - "public" to make the room visible
60626
- * in the public directory, or "private" to make
60627
- * it invisible.
60628
- * @returns Promise which resolves: result object
60629
- * @returns Rejects: with an error response.
60630
- * @deprecated missing from the spec
60631
- */
60632
- setRoomDirectoryVisibilityAppService(networkId, roomId, visibility) {
60633
- const path = utils.encodeUri("/directory/list/appservice/$networkId/$roomId", {
60634
- $networkId: networkId,
60635
- $roomId: roomId,
60636
- });
60637
- return this.http.authedRequest(http_api_1.Method.Put, path, undefined, { visibility: visibility });
60638
- }
60639
60536
  /**
60640
60537
  * Query the user directory with a term matching user IDs, display names and domains.
60641
60538
  * @param term - the term with which to search.
@@ -60706,30 +60603,10 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60706
60603
  getThreePids() {
60707
60604
  return this.http.authedRequest(http_api_1.Method.Get, "/account/3pid");
60708
60605
  }
60709
- /**
60710
- * Add a 3PID to your homeserver account and optionally bind it to an identity
60711
- * server as well. An identity server is required as part of the `creds` object.
60712
- *
60713
- * @deprecated this API is deprecated, and you should instead use `addThreePidOnly` for homeservers that support it.
60714
- *
60715
- * @returns Promise which resolves: on success
60716
- * @returns Rejects: with an error response.
60717
- */
60718
- addThreePid(creds, bind) {
60719
- const path = "/account/3pid";
60720
- const data = {
60721
- threePidCreds: creds,
60722
- bind: bind,
60723
- };
60724
- return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data);
60725
- }
60726
60606
  /**
60727
60607
  * Add a 3PID to your homeserver account. This API does not use an identity
60728
60608
  * server, as the homeserver is expected to handle 3PID ownership validation.
60729
60609
  *
60730
- * You can check whether a homeserver supports this API via
60731
- * `doesServerSupportSeparateAddAndBind`.
60732
- *
60733
60610
  * @param data - A object with 3PID validation data from having called
60734
60611
  * `account/3pid/<medium>/requestToken` on the homeserver.
60735
60612
  * @returns Promise which resolves: to an empty object `{}`
@@ -60738,8 +60615,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60738
60615
  addThreePidOnly(data) {
60739
60616
  return __awaiter(this, void 0, void 0, function* () {
60740
60617
  const path = "/account/3pid/add";
60741
- const prefix = (yield this.isVersionSupported("r0.6.0")) ? http_api_1.ClientPrefix.R0 : http_api_1.ClientPrefix.Unstable;
60742
- return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data, { prefix });
60618
+ return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data);
60743
60619
  });
60744
60620
  }
60745
60621
  /**
@@ -60747,9 +60623,6 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60747
60623
  * identity server handles 3PID ownership validation and the homeserver records
60748
60624
  * the new binding to track where all 3PIDs for the account are bound.
60749
60625
  *
60750
- * You can check whether a homeserver supports this API via
60751
- * `doesServerSupportSeparateAddAndBind`.
60752
- *
60753
60626
  * @param data - A object with 3PID validation data from having called
60754
60627
  * `validate/<medium>/requestToken` on the identity server. It should also
60755
60628
  * contain `id_server` and `id_access_token` fields as well.
@@ -60759,8 +60632,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60759
60632
  bindThreePid(data) {
60760
60633
  return __awaiter(this, void 0, void 0, function* () {
60761
60634
  const path = "/account/3pid/bind";
60762
- const prefix = (yield this.isVersionSupported("r0.6.0")) ? http_api_1.ClientPrefix.R0 : http_api_1.ClientPrefix.Unstable;
60763
- return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data, { prefix });
60635
+ return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data);
60764
60636
  });
60765
60637
  }
60766
60638
  /**
@@ -60782,8 +60654,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
60782
60654
  address,
60783
60655
  id_server: this.getIdentityServerUrl(true),
60784
60656
  };
60785
- const prefix = (yield this.isVersionSupported("r0.6.0")) ? http_api_1.ClientPrefix.R0 : http_api_1.ClientPrefix.Unstable;
60786
- return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data, { prefix });
60657
+ return this.http.authedRequest(http_api_1.Method.Post, path, undefined, data);
60787
60658
  });
60788
60659
  }
60789
60660
  /**
@@ -61040,9 +60911,7 @@ class MatrixClient extends typed_event_emitter_1.TypedEventEmitter {
61040
60911
  return this.http.authedRequest(http_api_1.Method.Post, "/keys/upload", undefined, content);
61041
60912
  }
61042
60913
  uploadKeySignatures(content) {
61043
- return this.http.authedRequest(http_api_1.Method.Post, "/keys/signatures/upload", undefined, content, {
61044
- prefix: http_api_1.ClientPrefix.V3,
61045
- });
60914
+ return this.http.authedRequest(http_api_1.Method.Post, "/keys/signatures/upload", undefined, content);
61046
60915
  }
61047
60916
  /**
61048
60917
  * Download device keys
@@ -61866,7 +61735,7 @@ exports.fixNotificationCountOnDecryption = fixNotificationCountOnDecryption;
61866
61735
 
61867
61736
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
61868
61737
 
61869
- },{"./@types/PushRules":312,"./@types/beacon":314,"./@types/event":315,"./@types/partials":318,"./@types/read_receipts":320,"./@types/search":322,"./NamespacedValue":326,"./ReEmitter":327,"./ToDeviceMessageQueue":328,"./autodiscovery":329,"./content-helpers":332,"./content-repo":333,"./crypto":356,"./crypto/RoomList":342,"./crypto/api":350,"./crypto/backup":351,"./crypto/dehydration":353,"./crypto/key_passphrase":357,"./crypto/olmlib":358,"./crypto/recoverykey":359,"./event-mapper":375,"./feature":377,"./filter":379,"./http-api":382,"./logger":389,"./models/MSC3089TreeSpace":392,"./models/event":399,"./models/event-timeline":398,"./models/invites-ignorer":400,"./models/room":408,"./models/room-member":405,"./models/search-result":409,"./models/thread":410,"./models/typed-event-emitter":411,"./models/user":412,"./pushprocessor":416,"./randomstring":417,"./rust-crypto":422,"./rust-crypto/constants":421,"./secret-storage":424,"./service-types":425,"./sliding-sync-sdk":426,"./store/stub":433,"./sync":435,"./utils":437,"./webrtc/call":439,"./webrtc/callEventHandler":440,"./webrtc/groupCall":443,"./webrtc/groupCallEventHandler":444,"./webrtc/mediaHandler":445}],332:[function(require,module,exports){
61738
+ },{"./@types/PushRules":312,"./@types/beacon":314,"./@types/event":315,"./@types/partials":318,"./@types/read_receipts":320,"./@types/search":322,"./NamespacedValue":326,"./ReEmitter":327,"./ToDeviceMessageQueue":328,"./autodiscovery":329,"./content-helpers":332,"./content-repo":333,"./crypto":356,"./crypto/RoomList":342,"./crypto/api":350,"./crypto/backup":351,"./crypto/dehydration":353,"./crypto/key_passphrase":357,"./crypto/olmlib":358,"./crypto/recoverykey":359,"./event-mapper":375,"./feature":377,"./filter":379,"./http-api":382,"./logger":389,"./models/MSC3089TreeSpace":392,"./models/event":399,"./models/event-timeline":398,"./models/invites-ignorer":400,"./models/room":408,"./models/room-member":405,"./models/search-result":409,"./models/thread":410,"./models/typed-event-emitter":411,"./models/user":412,"./pushprocessor":416,"./randomstring":417,"./rust-crypto":422,"./rust-crypto/constants":421,"./secret-storage":424,"./service-types":425,"./sliding-sync-sdk":426,"./store/stub":433,"./sync":435,"./utils":437,"./webrtc/call":440,"./webrtc/callEventHandler":441,"./webrtc/groupCall":444,"./webrtc/groupCallEventHandler":445,"./webrtc/mediaHandler":446}],332:[function(require,module,exports){
61870
61739
  "use strict";
61871
61740
  /*
61872
61741
  Copyright 2018 - 2022 The Matrix.org Foundation C.I.C.
@@ -62135,7 +62004,7 @@ function getHttpUriForMxc(baseUrl, mxc, width, height, resizeMethod, allowDirect
62135
62004
  }
62136
62005
  }
62137
62006
  let serverAndMediaId = mxc.slice(6); // strips mxc://
62138
- let prefix = "/_matrix/media/r0/download/";
62007
+ let prefix = "/_matrix/media/v3/download/";
62139
62008
  const params = {};
62140
62009
  if (width) {
62141
62010
  params["width"] = Math.round(width).toString();
@@ -62149,7 +62018,7 @@ function getHttpUriForMxc(baseUrl, mxc, width, height, resizeMethod, allowDirect
62149
62018
  if (Object.keys(params).length > 0) {
62150
62019
  // these are thumbnailing params so they probably want the
62151
62020
  // thumbnailing API...
62152
- prefix = "/_matrix/media/r0/thumbnail/";
62021
+ prefix = "/_matrix/media/v3/thumbnail/";
62153
62022
  }
62154
62023
  const fragmentOffset = serverAndMediaId.indexOf("#");
62155
62024
  let fragment = "";
@@ -69015,6 +68884,7 @@ class BackupManager {
69015
68884
  */
69016
68885
  scheduleKeyBackupSend(maxDelay = 10000) {
69017
68886
  return __awaiter(this, void 0, void 0, function* () {
68887
+ logger_1.logger.debug(`Key backup: scheduleKeyBackupSend currentSending:${this.sendingBackups} delay:${maxDelay}`);
69018
68888
  if (this.sendingBackups)
69019
68889
  return;
69020
68890
  this.sendingBackups = true;
@@ -69026,6 +68896,7 @@ class BackupManager {
69026
68896
  yield (0, utils_1.sleep)(delay);
69027
68897
  if (!this.clientRunning) {
69028
68898
  logger_1.logger.debug("Key backup send aborted, client stopped");
68899
+ this.sendingBackups = false;
69029
68900
  return;
69030
68901
  }
69031
68902
  let numFailures = 0; // number of consecutive failures
@@ -69037,6 +68908,7 @@ class BackupManager {
69037
68908
  const numBackedUp = yield this.backupPendingKeys(KEY_BACKUP_KEYS_PER_REQUEST);
69038
68909
  if (numBackedUp === 0) {
69039
68910
  // no sessions left needing backup: we're done
68911
+ this.sendingBackups = false;
69040
68912
  return;
69041
68913
  }
69042
68914
  numFailures = 0;
@@ -69044,16 +68916,19 @@ class BackupManager {
69044
68916
  catch (err) {
69045
68917
  numFailures++;
69046
68918
  logger_1.logger.log("Key backup request failed", err);
69047
- if (err.data) {
69048
- if (err.data.errcode == "M_NOT_FOUND" ||
69049
- err.data.errcode == "M_WRONG_ROOM_KEYS_VERSION") {
68919
+ if (err instanceof http_api_1.MatrixError) {
68920
+ const errCode = err.data.errcode;
68921
+ if (errCode == "M_NOT_FOUND" || errCode == "M_WRONG_ROOM_KEYS_VERSION") {
68922
+ // Set to false now as `checkKeyBackup` might schedule a backupsend before this one ends.
68923
+ this.sendingBackups = false;
68924
+ // Backup version has changed or this backup version
68925
+ // has been deleted
68926
+ this.baseApis.crypto.emit(index_1.CryptoEvent.KeyBackupFailed, errCode);
69050
68927
  // Re-check key backup status on error, so we can be
69051
68928
  // sure to present the current situation when asked.
68929
+ // This call might restart the backup loop if new backup version is trusted
69052
68930
  yield this.checkKeyBackup();
69053
- // Backup version has changed or this backup version
69054
- // has been deleted
69055
- this.baseApis.crypto.emit(index_1.CryptoEvent.KeyBackupFailed, err.data.errcode);
69056
- throw err;
68931
+ return;
69057
68932
  }
69058
68933
  }
69059
68934
  }
@@ -69063,11 +68938,15 @@ class BackupManager {
69063
68938
  }
69064
68939
  if (!this.clientRunning) {
69065
68940
  logger_1.logger.debug("Key backup send loop aborted, client stopped");
68941
+ this.sendingBackups = false;
69066
68942
  return;
69067
68943
  }
69068
68944
  }
69069
68945
  }
69070
- finally {
68946
+ catch (err) {
68947
+ // No one actually checks errors on this promise, it's spawned internally.
68948
+ // Just log, apps/client should use events to check status
68949
+ logger_1.logger.log(`Backup loop failed ${err}`);
69071
68950
  this.sendingBackups = false;
69072
68951
  }
69073
68952
  });
@@ -70954,6 +70833,22 @@ class Crypto extends typed_event_emitter_1.TypedEventEmitter {
70954
70833
  return (0, backup_1.backupTrustInfoFromLegacyTrustInfo)(trustInfo);
70955
70834
  });
70956
70835
  }
70836
+ /**
70837
+ * Force a re-check of the key backup and enable/disable it as appropriate.
70838
+ *
70839
+ * Implementation of {@link CryptoApi.checkKeyBackupAndEnable}.
70840
+ */
70841
+ checkKeyBackupAndEnable() {
70842
+ return __awaiter(this, void 0, void 0, function* () {
70843
+ const checkResult = yield this.backupManager.checkKeyBackup();
70844
+ if (!checkResult || !checkResult.backupInfo)
70845
+ return null;
70846
+ return {
70847
+ backupInfo: checkResult.backupInfo,
70848
+ trustInfo: (0, backup_1.backupTrustInfoFromLegacyTrustInfo)(checkResult.trustInfo),
70849
+ };
70850
+ });
70851
+ }
70957
70852
  /**
70958
70853
  * Checks that a given cross-signing private key matches a given public key.
70959
70854
  * This can be used by the getCrossSigningKey callback to verify that the
@@ -77087,7 +76982,7 @@ const emojiMapping = [
77087
76982
  ["🚂", "train"],
77088
76983
  ["🚲", "bicycle"],
77089
76984
  ["✈️", "aeroplane"],
77090
- ["���", "rocket"],
76985
+ ["🚀", "rocket"],
77091
76986
  ["🏆", "trophy"],
77092
76987
  ["⚽", "ball"],
77093
76988
  ["🎸", "guitar"],
@@ -80448,7 +80343,7 @@ class MatrixHttpApi extends fetch_1.FetchHttpApi {
80448
80343
  total: ev.total,
80449
80344
  });
80450
80345
  };
80451
- const url = this.getUrl("/upload", undefined, prefix_1.MediaPrefix.R0);
80346
+ const url = this.getUrl("/upload", undefined, prefix_1.MediaPrefix.V3);
80452
80347
  if (includeFilename && fileName) {
80453
80348
  url.searchParams.set("filename", encodeURIComponent(fileName));
80454
80349
  }
@@ -80472,7 +80367,7 @@ class MatrixHttpApi extends fetch_1.FetchHttpApi {
80472
80367
  }
80473
80368
  const headers = { "Content-Type": contentType };
80474
80369
  this.authedRequest(method_1.Method.Post, "/upload", queryParams, file, {
80475
- prefix: prefix_1.MediaPrefix.R0,
80370
+ prefix: prefix_1.MediaPrefix.V3,
80476
80371
  headers,
80477
80372
  abortSignal: abortController.signal,
80478
80373
  })
@@ -80511,7 +80406,7 @@ class MatrixHttpApi extends fetch_1.FetchHttpApi {
80511
80406
  getContentUri() {
80512
80407
  return {
80513
80408
  base: this.opts.baseUrl,
80514
- path: prefix_1.MediaPrefix.R0 + "/upload",
80409
+ path: prefix_1.MediaPrefix.V3 + "/upload",
80515
80410
  params: {
80516
80411
  access_token: this.opts.accessToken,
80517
80412
  },
@@ -80596,11 +80491,7 @@ exports.MediaPrefix = exports.IdentityPrefix = exports.ClientPrefix = void 0;
80596
80491
  var ClientPrefix;
80597
80492
  (function (ClientPrefix) {
80598
80493
  /**
80599
- * A constant representing the URI path for release 0 of the Client-Server HTTP API.
80600
- */
80601
- ClientPrefix["R0"] = "/_matrix/client/r0";
80602
- /**
80603
- * A constant representing the URI path for the legacy release v1 of the Client-Server HTTP API.
80494
+ * A constant representing the URI path for Client-Server API endpoints versioned at v1.
80604
80495
  */
80605
80496
  ClientPrefix["V1"] = "/_matrix/client/v1";
80606
80497
  /**
@@ -80622,9 +80513,13 @@ var IdentityPrefix;
80622
80513
  var MediaPrefix;
80623
80514
  (function (MediaPrefix) {
80624
80515
  /**
80625
- * URI path for the media repo API
80516
+ * A constant representing the URI path for Client-Server API Media endpoints versioned at v1.
80626
80517
  */
80627
- MediaPrefix["R0"] = "/_matrix/media/r0";
80518
+ MediaPrefix["V1"] = "/_matrix/media/v3";
80519
+ /**
80520
+ * A constant representing the URI path for Client-Server API Media endpoints versioned at v3.
80521
+ */
80522
+ MediaPrefix["V3"] = "/_matrix/media/v3";
80628
80523
  })(MediaPrefix || (exports.MediaPrefix = MediaPrefix = {}));
80629
80524
 
80630
80525
  },{}],386:[function(require,module,exports){
@@ -81019,10 +80914,8 @@ class InteractiveAuth {
81019
80914
  sid: this.emailSid,
81020
80915
  client_secret: this.clientSecret,
81021
80916
  };
81022
- if (yield this.matrixClient.doesServerRequireIdServerParam()) {
81023
- const idServerParsedUrl = new URL(this.matrixClient.getIdentityServerUrl());
81024
- creds.id_server = idServerParsedUrl.host;
81025
- }
80917
+ const idServerParsedUrl = new URL(this.matrixClient.getIdentityServerUrl());
80918
+ creds.id_server = idServerParsedUrl.host;
81026
80919
  authDict = {
81027
80920
  type: EMAIL_STAGE_TYPE,
81028
80921
  // TODO: Remove `threepid_creds` once servers support proper UIA
@@ -81504,6 +81397,7 @@ __exportStar(require("./service-types"), exports);
81504
81397
  __exportStar(require("./store/memory"), exports);
81505
81398
  __exportStar(require("./store/indexeddb"), exports);
81506
81399
  __exportStar(require("./crypto/store/memory-crypto-store"), exports);
81400
+ __exportStar(require("./crypto/store/localStorage-crypto-store"), exports);
81507
81401
  __exportStar(require("./crypto/store/indexeddb-crypto-store"), exports);
81508
81402
  __exportStar(require("./content-repo"), exports);
81509
81403
  __exportStar(require("./@types/uia"), exports);
@@ -81606,7 +81500,7 @@ exports.createRoomWidgetClient = createRoomWidgetClient;
81606
81500
 
81607
81501
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
81608
81502
 
81609
- },{"./@types/PushRules":312,"./@types/auth":313,"./@types/event":315,"./@types/location":317,"./@types/partials":318,"./@types/requests":321,"./@types/search":322,"./@types/uia":325,"./autodiscovery":329,"./client":331,"./content-helpers":332,"./content-repo":333,"./crypto":356,"./crypto-api":334,"./crypto/store/indexeddb-crypto-store":361,"./crypto/store/memory-crypto-store":363,"./embedded":373,"./errors":374,"./filter":379,"./http-api":382,"./interactive-auth":388,"./models/beacon":393,"./models/device":394,"./models/event":399,"./models/event-status":396,"./models/event-timeline":398,"./models/event-timeline-set":397,"./models/poll":401,"./models/relations":404,"./models/room":408,"./models/room-member":405,"./models/room-state":406,"./models/room-summary":407,"./models/search-result":409,"./models/thread":410,"./models/typed-event-emitter":411,"./models/user":412,"./scheduler":423,"./secret-storage":424,"./service-types":425,"./sliding-sync":427,"./store/indexeddb":430,"./store/local-storage-events-emitter":431,"./store/memory":432,"./sync":435,"./sync-accumulator":434,"./timeline-window":436,"./webrtc/call":439,"./webrtc/callFeed":442,"./webrtc/groupCall":443,"./webrtc/mediaHandler":445,"./webrtc/stats/statsReport":456}],391:[function(require,module,exports){
81503
+ },{"./@types/PushRules":312,"./@types/auth":313,"./@types/event":315,"./@types/location":317,"./@types/partials":318,"./@types/requests":321,"./@types/search":322,"./@types/uia":325,"./autodiscovery":329,"./client":331,"./content-helpers":332,"./content-repo":333,"./crypto":356,"./crypto-api":334,"./crypto/store/indexeddb-crypto-store":361,"./crypto/store/localStorage-crypto-store":362,"./crypto/store/memory-crypto-store":363,"./embedded":373,"./errors":374,"./filter":379,"./http-api":382,"./interactive-auth":388,"./models/beacon":393,"./models/device":394,"./models/event":399,"./models/event-status":396,"./models/event-timeline":398,"./models/event-timeline-set":397,"./models/poll":401,"./models/relations":404,"./models/room":408,"./models/room-member":405,"./models/room-state":406,"./models/room-summary":407,"./models/search-result":409,"./models/thread":410,"./models/typed-event-emitter":411,"./models/user":412,"./scheduler":423,"./secret-storage":424,"./service-types":425,"./sliding-sync":427,"./store/indexeddb":430,"./store/local-storage-events-emitter":431,"./store/memory":432,"./sync":435,"./sync-accumulator":434,"./timeline-window":436,"./webrtc/call":440,"./webrtc/callFeed":443,"./webrtc/groupCall":444,"./webrtc/mediaHandler":446,"./webrtc/stats/statsReport":457}],391:[function(require,module,exports){
81610
81504
  "use strict";
81611
81505
  /*
81612
81506
  Copyright 2021 The Matrix.org Foundation C.I.C.
@@ -98206,19 +98100,11 @@ class SyncApi {
98206
98100
  this.opts.lazyLoadMembers = false;
98207
98101
  }
98208
98102
  if (this.opts.lazyLoadMembers) {
98209
- debuglog("Checking server lazy load support...");
98210
- const supported = yield this.client.doesServerSupportLazyLoading();
98211
- if (supported) {
98212
- debuglog("Enabling lazy load on sync filter...");
98213
- if (!this.opts.filter) {
98214
- this.opts.filter = this.buildDefaultFilter();
98215
- }
98216
- this.opts.filter.setLazyLoadMembers(true);
98217
- }
98218
- else {
98219
- debuglog("LL: lazy loading requested but not supported " + "by server, so disabling");
98220
- this.opts.lazyLoadMembers = false;
98103
+ debuglog("Enabling lazy load on sync filter...");
98104
+ if (!this.opts.filter) {
98105
+ this.opts.filter = this.buildDefaultFilter();
98221
98106
  }
98107
+ this.opts.filter.setLazyLoadMembers(true);
98222
98108
  }
98223
98109
  // need to vape the store when enabling LL and wasn't enabled before
98224
98110
  debuglog("Checking whether lazy loading has changed in store...");
@@ -100838,6 +100724,30 @@ exports.MapWithDefault = MapWithDefault;
100838
100724
  /*
100839
100725
  Copyright 2022 The Matrix.org Foundation C.I.C.
100840
100726
 
100727
+ Licensed under the Apache License, Version 2.0 (the "License");
100728
+ you may not use this file except in compliance with the License.
100729
+ You may obtain a copy of the License at
100730
+
100731
+ http://www.apache.org/licenses/LICENSE-2.0
100732
+
100733
+ Unless required by applicable law or agreed to in writing, software
100734
+ distributed under the License is distributed on an "AS IS" BASIS,
100735
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
100736
+ See the License for the specific language governing permissions and
100737
+ limitations under the License.
100738
+ */
100739
+ Object.defineProperty(exports, "__esModule", { value: true });
100740
+ exports.MINIMUM_MATRIX_VERSION = void 0;
100741
+ /**
100742
+ * The minimum Matrix specification version the js-sdk supports.
100743
+ */
100744
+ exports.MINIMUM_MATRIX_VERSION = "v1.1";
100745
+
100746
+ },{}],439:[function(require,module,exports){
100747
+ "use strict";
100748
+ /*
100749
+ Copyright 2022 The Matrix.org Foundation C.I.C.
100750
+
100841
100751
  Licensed under the Apache License, Version 2.0 (the "License");
100842
100752
  you may not use this file except in compliance with the License.
100843
100753
  You may obtain a copy of the License at
@@ -100882,7 +100792,7 @@ const releaseContext = () => {
100882
100792
  };
100883
100793
  exports.releaseContext = releaseContext;
100884
100794
 
100885
- },{}],439:[function(require,module,exports){
100795
+ },{}],440:[function(require,module,exports){
100886
100796
  (function (process){(function (){
100887
100797
  "use strict";
100888
100798
  /*
@@ -103355,7 +103265,7 @@ exports.createNewMatrixCall = createNewMatrixCall;
103355
103265
 
103356
103266
  }).call(this)}).call(this,require('_process'))
103357
103267
 
103358
- },{"../@types/event":315,"../crypto/deviceinfo":355,"../http-api":382,"../logger":389,"../models/typed-event-emitter":411,"../randomstring":417,"../utils":437,"./callEventTypes":441,"./callFeed":442,"./groupCall":443,"_process":245,"sdp-transform":261,"uuid":295}],440:[function(require,module,exports){
103268
+ },{"../@types/event":315,"../crypto/deviceinfo":355,"../http-api":382,"../logger":389,"../models/typed-event-emitter":411,"../randomstring":417,"../utils":437,"./callEventTypes":442,"./callFeed":443,"./groupCall":444,"_process":245,"sdp-transform":261,"uuid":295}],441:[function(require,module,exports){
103359
103269
  "use strict";
103360
103270
  /*
103361
103271
  Copyright 2020 The Matrix.org Foundation C.I.C.
@@ -103717,7 +103627,7 @@ class CallEventHandler {
103717
103627
  }
103718
103628
  exports.CallEventHandler = CallEventHandler;
103719
103629
 
103720
- },{"../@types/event":315,"../client":331,"../logger":389,"../models/room":408,"./call":439,"./groupCall":443}],441:[function(require,module,exports){
103630
+ },{"../@types/event":315,"../client":331,"../logger":389,"../models/room":408,"./call":440,"./groupCall":444}],442:[function(require,module,exports){
103721
103631
  "use strict";
103722
103632
  // allow non-camelcase as these are events type that go onto the wire
103723
103633
  /* eslint-disable camelcase */
@@ -103732,7 +103642,7 @@ var SDPStreamMetadataPurpose;
103732
103642
  })(SDPStreamMetadataPurpose || (exports.SDPStreamMetadataPurpose = SDPStreamMetadataPurpose = {}));
103733
103643
  /* eslint-enable camelcase */
103734
103644
 
103735
- },{}],442:[function(require,module,exports){
103645
+ },{}],443:[function(require,module,exports){
103736
103646
  "use strict";
103737
103647
  /*
103738
103648
  Copyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>
@@ -104014,7 +103924,7 @@ class CallFeed extends typed_event_emitter_1.TypedEventEmitter {
104014
103924
  }
104015
103925
  exports.CallFeed = CallFeed;
104016
103926
 
104017
- },{"../logger":389,"../models/typed-event-emitter":411,"./audioContext":438,"./call":439,"./callEventTypes":441}],443:[function(require,module,exports){
103927
+ },{"../logger":389,"../models/typed-event-emitter":411,"./audioContext":439,"./call":440,"./callEventTypes":442}],444:[function(require,module,exports){
104018
103928
  "use strict";
104019
103929
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
104020
103930
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -105279,7 +105189,7 @@ class GroupCall extends typed_event_emitter_1.TypedEventEmitter {
105279
105189
  }
105280
105190
  exports.GroupCall = GroupCall;
105281
105191
 
105282
- },{"../@types/event":315,"../ReEmitter":327,"../logger":389,"../models/room-state":406,"../models/typed-event-emitter":411,"../utils":437,"./call":439,"./callEventHandler":440,"./callEventTypes":441,"./callFeed":442,"./groupCallEventHandler":444,"./stats/callFeedStatsReporter":446,"./stats/groupCallStats":451,"./stats/statsReport":456,"./stats/summaryStatsReportGatherer":458}],444:[function(require,module,exports){
105192
+ },{"../@types/event":315,"../ReEmitter":327,"../logger":389,"../models/room-state":406,"../models/typed-event-emitter":411,"../utils":437,"./call":440,"./callEventHandler":441,"./callEventTypes":442,"./callFeed":443,"./groupCallEventHandler":445,"./stats/callFeedStatsReporter":447,"./stats/groupCallStats":452,"./stats/statsReport":457,"./stats/summaryStatsReportGatherer":459}],445:[function(require,module,exports){
105283
105193
  "use strict";
105284
105194
  /*
105285
105195
  Copyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>
@@ -105459,7 +105369,7 @@ class GroupCallEventHandler {
105459
105369
  }
105460
105370
  exports.GroupCallEventHandler = GroupCallEventHandler;
105461
105371
 
105462
- },{"../@types/event":315,"../client":331,"../logger":389,"../models/room-state":406,"../sync":435,"./groupCall":443}],445:[function(require,module,exports){
105372
+ },{"../@types/event":315,"../client":331,"../logger":389,"../models/room-state":406,"../sync":435,"./groupCall":444}],446:[function(require,module,exports){
105463
105373
  "use strict";
105464
105374
  /*
105465
105375
  Copyright 2015, 2016 OpenMarket Ltd
@@ -105871,7 +105781,7 @@ class MediaHandler extends typed_event_emitter_1.TypedEventEmitter {
105871
105781
  }
105872
105782
  exports.MediaHandler = MediaHandler;
105873
105783
 
105874
- },{"../logger":389,"../models/typed-event-emitter":411,"../webrtc/groupCall":443}],446:[function(require,module,exports){
105784
+ },{"../logger":389,"../models/typed-event-emitter":411,"../webrtc/groupCall":444}],447:[function(require,module,exports){
105875
105785
  "use strict";
105876
105786
  Object.defineProperty(exports, "__esModule", { value: true });
105877
105787
  exports.CallFeedStatsReporter = void 0;
@@ -105944,7 +105854,7 @@ class CallFeedStatsReporter {
105944
105854
  }
105945
105855
  exports.CallFeedStatsReporter = CallFeedStatsReporter;
105946
105856
 
105947
- },{}],447:[function(require,module,exports){
105857
+ },{}],448:[function(require,module,exports){
105948
105858
  "use strict";
105949
105859
  /*
105950
105860
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106132,7 +106042,7 @@ class CallStatsReportGatherer {
106132
106042
  }
106133
106043
  exports.CallStatsReportGatherer = CallStatsReportGatherer;
106134
106044
 
106135
- },{"../../logger":389,"./callFeedStatsReporter":446,"./connectionStats":448,"./connectionStatsBuilder":449,"./connectionStatsReportBuilder":450,"./media/mediaSsrcHandler":452,"./media/mediaTrackHandler":453,"./media/mediaTrackStatsHandler":455,"./trackStatsBuilder":459,"./transportStatsBuilder":460,"./valueFormatter":461}],448:[function(require,module,exports){
106045
+ },{"../../logger":389,"./callFeedStatsReporter":447,"./connectionStats":449,"./connectionStatsBuilder":450,"./connectionStatsReportBuilder":451,"./media/mediaSsrcHandler":453,"./media/mediaTrackHandler":454,"./media/mediaTrackStatsHandler":456,"./trackStatsBuilder":460,"./transportStatsBuilder":461,"./valueFormatter":462}],449:[function(require,module,exports){
106136
106046
  "use strict";
106137
106047
  /*
106138
106048
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106161,7 +106071,7 @@ class ConnectionStats {
106161
106071
  }
106162
106072
  exports.ConnectionStats = ConnectionStats;
106163
106073
 
106164
- },{}],449:[function(require,module,exports){
106074
+ },{}],450:[function(require,module,exports){
106165
106075
  "use strict";
106166
106076
  Object.defineProperty(exports, "__esModule", { value: true });
106167
106077
  exports.ConnectionStatsBuilder = void 0;
@@ -106177,7 +106087,7 @@ class ConnectionStatsBuilder {
106177
106087
  }
106178
106088
  exports.ConnectionStatsBuilder = ConnectionStatsBuilder;
106179
106089
 
106180
- },{}],450:[function(require,module,exports){
106090
+ },{}],451:[function(require,module,exports){
106181
106091
  "use strict";
106182
106092
  Object.defineProperty(exports, "__esModule", { value: true });
106183
106093
  exports.ConnectionStatsReportBuilder = void 0;
@@ -106279,7 +106189,7 @@ class ConnectionStatsReportBuilder {
106279
106189
  }
106280
106190
  exports.ConnectionStatsReportBuilder = ConnectionStatsReportBuilder;
106281
106191
 
106282
- },{}],451:[function(require,module,exports){
106192
+ },{}],452:[function(require,module,exports){
106283
106193
  "use strict";
106284
106194
  Object.defineProperty(exports, "__esModule", { value: true });
106285
106195
  exports.GroupCallStats = void 0;
@@ -106361,7 +106271,7 @@ class GroupCallStats {
106361
106271
  }
106362
106272
  exports.GroupCallStats = GroupCallStats;
106363
106273
 
106364
- },{"../../logger":389,"./callStatsReportGatherer":447,"./statsReportEmitter":457,"./summaryStatsReportGatherer":458}],452:[function(require,module,exports){
106274
+ },{"../../logger":389,"./callStatsReportGatherer":448,"./statsReportEmitter":458,"./summaryStatsReportGatherer":459}],453:[function(require,module,exports){
106365
106275
  "use strict";
106366
106276
  /*
106367
106277
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106418,7 +106328,7 @@ class MediaSsrcHandler {
106418
106328
  }
106419
106329
  exports.MediaSsrcHandler = MediaSsrcHandler;
106420
106330
 
106421
- },{"sdp-transform":261}],453:[function(require,module,exports){
106331
+ },{"sdp-transform":261}],454:[function(require,module,exports){
106422
106332
  "use strict";
106423
106333
  /*
106424
106334
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106493,7 +106403,7 @@ class MediaTrackHandler {
106493
106403
  }
106494
106404
  exports.MediaTrackHandler = MediaTrackHandler;
106495
106405
 
106496
- },{}],454:[function(require,module,exports){
106406
+ },{}],455:[function(require,module,exports){
106497
106407
  "use strict";
106498
106408
  /*
106499
106409
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106617,7 +106527,7 @@ class MediaTrackStats {
106617
106527
  }
106618
106528
  exports.MediaTrackStats = MediaTrackStats;
106619
106529
 
106620
- },{}],455:[function(require,module,exports){
106530
+ },{}],456:[function(require,module,exports){
106621
106531
  "use strict";
106622
106532
  Object.defineProperty(exports, "__esModule", { value: true });
106623
106533
  exports.MediaTrackStatsHandler = void 0;
@@ -106689,7 +106599,7 @@ class MediaTrackStatsHandler {
106689
106599
  }
106690
106600
  exports.MediaTrackStatsHandler = MediaTrackStatsHandler;
106691
106601
 
106692
- },{"./mediaTrackStats":454}],456:[function(require,module,exports){
106602
+ },{"./mediaTrackStats":455}],457:[function(require,module,exports){
106693
106603
  "use strict";
106694
106604
  /*
106695
106605
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106716,7 +106626,7 @@ var StatsReport;
106716
106626
  StatsReport["SUMMARY_STATS"] = "StatsReport.summary_stats";
106717
106627
  })(StatsReport || (exports.StatsReport = StatsReport = {}));
106718
106628
 
106719
- },{}],457:[function(require,module,exports){
106629
+ },{}],458:[function(require,module,exports){
106720
106630
  "use strict";
106721
106631
  /*
106722
106632
  Copyright 2023 The Matrix.org Foundation C.I.C.
@@ -106753,7 +106663,7 @@ class StatsReportEmitter extends typed_event_emitter_1.TypedEventEmitter {
106753
106663
  }
106754
106664
  exports.StatsReportEmitter = StatsReportEmitter;
106755
106665
 
106756
- },{"../../models/typed-event-emitter":411,"./statsReport":456}],458:[function(require,module,exports){
106666
+ },{"../../models/typed-event-emitter":411,"./statsReport":457}],459:[function(require,module,exports){
106757
106667
  "use strict";
106758
106668
  Object.defineProperty(exports, "__esModule", { value: true });
106759
106669
  exports.SummaryStatsReportGatherer = void 0;
@@ -106865,7 +106775,7 @@ class SummaryStatsReportGatherer {
106865
106775
  }
106866
106776
  exports.SummaryStatsReportGatherer = SummaryStatsReportGatherer;
106867
106777
 
106868
- },{}],459:[function(require,module,exports){
106778
+ },{}],460:[function(require,module,exports){
106869
106779
  "use strict";
106870
106780
  Object.defineProperty(exports, "__esModule", { value: true });
106871
106781
  exports.TrackStatsBuilder = void 0;
@@ -107035,7 +106945,7 @@ class TrackStatsBuilder {
107035
106945
  }
107036
106946
  exports.TrackStatsBuilder = TrackStatsBuilder;
107037
106947
 
107038
- },{"./valueFormatter":461}],460:[function(require,module,exports){
106948
+ },{"./valueFormatter":462}],461:[function(require,module,exports){
107039
106949
  "use strict";
107040
106950
  Object.defineProperty(exports, "__esModule", { value: true });
107041
106951
  exports.TransportStatsBuilder = void 0;
@@ -107072,7 +106982,7 @@ class TransportStatsBuilder {
107072
106982
  }
107073
106983
  exports.TransportStatsBuilder = TransportStatsBuilder;
107074
106984
 
107075
- },{}],461:[function(require,module,exports){
106985
+ },{}],462:[function(require,module,exports){
107076
106986
  "use strict";
107077
106987
  Object.defineProperty(exports, "__esModule", { value: true });
107078
106988
  exports.ValueFormatter = void 0;