@textrp/briij-js-sdk 41.0.1 → 43.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/CHANGELOG.md +14 -1
- package/LICENSE +177 -177
- package/README.md +85 -3
- package/lib/@types/AESEncryptedSecretStoragePayload.js.map +1 -1
- package/lib/@types/IIdentityServerProvider.js.map +1 -1
- package/lib/@types/PushRules.js +14 -14
- package/lib/@types/PushRules.js.map +1 -1
- package/lib/@types/another-json.d.js.map +1 -1
- package/lib/@types/auth.d.ts +72 -1
- package/lib/@types/auth.d.ts.map +1 -1
- package/lib/@types/auth.js +57 -54
- package/lib/@types/auth.js.map +1 -1
- package/lib/@types/beacon.js +100 -100
- package/lib/@types/beacon.js.map +1 -1
- package/lib/@types/common.js.map +1 -1
- package/lib/@types/crypto.js.map +1 -1
- package/lib/@types/event.d.ts +59 -0
- package/lib/@types/event.d.ts.map +1 -1
- package/lib/@types/event.js +105 -102
- package/lib/@types/event.js.map +1 -1
- package/lib/@types/events.js.map +1 -1
- package/lib/@types/extensible_events.js +53 -53
- package/lib/@types/extensible_events.js.map +1 -1
- package/lib/@types/local_notifications.js.map +1 -1
- package/lib/@types/location.js +41 -41
- package/lib/@types/location.js.map +1 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +1 -1
- package/lib/@types/media.js.map +1 -1
- package/lib/@types/membership.js +39 -39
- package/lib/@types/membership.js.map +1 -1
- package/lib/@types/partials.js +25 -25
- package/lib/@types/partials.js.map +1 -1
- package/lib/@types/polls.js +46 -46
- package/lib/@types/polls.js.map +1 -1
- package/lib/@types/read_receipts.js +14 -14
- package/lib/@types/read_receipts.js.map +1 -1
- package/lib/@types/registration.js.map +1 -1
- package/lib/@types/search.js +14 -14
- package/lib/@types/search.js.map +1 -1
- package/lib/@types/signed.js.map +1 -1
- package/lib/@types/spaces.js.map +1 -1
- package/lib/@types/state_events.js.map +1 -1
- package/lib/@types/synapse.js.map +1 -1
- package/lib/@types/sync.js +18 -18
- package/lib/@types/sync.js.map +1 -1
- package/lib/@types/threepids.js +14 -14
- package/lib/@types/threepids.js.map +1 -1
- package/lib/@types/topic.js +47 -47
- package/lib/@types/topic.js.map +1 -1
- package/lib/@types/uia.js.map +1 -1
- package/lib/NamespacedValue.js +20 -20
- package/lib/NamespacedValue.js.map +1 -1
- package/lib/ReEmitter.js +16 -16
- package/lib/ReEmitter.js.map +1 -1
- package/lib/base64.js +32 -32
- package/lib/base64.js.map +1 -1
- package/lib/briij.d.ts +4 -0
- package/lib/briij.d.ts.map +1 -1
- package/lib/briij.js +4 -0
- package/lib/briij.js.map +1 -1
- package/lib/client.d.ts +48 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +262 -108
- package/lib/client.js.map +1 -1
- package/lib/common-crypto/key-passphrase.js +19 -19
- package/lib/common-crypto/key-passphrase.js.map +1 -1
- package/lib/content-helpers.js +57 -57
- package/lib/content-helpers.js.map +1 -1
- package/lib/content-repo.js +36 -36
- package/lib/content-repo.js.map +1 -1
- package/lib/crypto/store/base.js +69 -69
- package/lib/crypto/store/base.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +58 -58
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +193 -193
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
- package/lib/crypto/store/localStorage-crypto-store.js +72 -72
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -1
- package/lib/crypto/store/memory-crypto-store.js +74 -74
- package/lib/crypto/store/memory-crypto-store.js.map +1 -1
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +1 -1
- package/lib/crypto-api/key-passphrase.js +22 -22
- package/lib/crypto-api/key-passphrase.js.map +1 -1
- package/lib/crypto-api/keybackup.js.map +1 -1
- package/lib/crypto-api/recovery-key.js +20 -20
- package/lib/crypto-api/recovery-key.js.map +1 -1
- package/lib/digest.js +21 -21
- package/lib/digest.js.map +1 -1
- package/lib/extensible_events_v1/ExtensibleEvent.js +39 -39
- package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -1
- package/lib/extensible_events_v1/InvalidEventError.js +16 -16
- package/lib/extensible_events_v1/InvalidEventError.js.map +1 -1
- package/lib/extensible_events_v1/MessageEvent.js +39 -39
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollEndEvent.js +29 -29
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollResponseEvent.js +39 -39
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollStartEvent.js +52 -52
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
- package/lib/extensible_events_v1/utilities.js +22 -22
- package/lib/extensible_events_v1/utilities.js.map +1 -1
- package/lib/feature.js +16 -16
- package/lib/feature.js.map +1 -1
- package/lib/http-api/method.js +14 -14
- package/lib/http-api/method.js.map +1 -1
- package/lib/http-api/prefix.js +26 -26
- package/lib/http-api/prefix.js.map +1 -1
- package/lib/indexeddb-helpers.js +21 -21
- package/lib/indexeddb-helpers.js.map +1 -1
- package/lib/indexeddb-worker.js +18 -18
- package/lib/indexeddb-worker.js.map +1 -1
- package/lib/matrixrtc/IKeyTransport.js +17 -17
- package/lib/matrixrtc/IKeyTransport.js.map +1 -1
- package/lib/matrixrtc/IMembershipManager.js +27 -27
- package/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/lib/matrixrtc/LivekitTransport.js +19 -19
- package/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/lib/matrixrtc/index.js +14 -14
- package/lib/matrixrtc/index.js.map +1 -1
- package/lib/matrixrtc/utils.js +27 -27
- package/lib/matrixrtc/utils.js.map +1 -1
- package/lib/models/ToDeviceMessage.js.map +1 -1
- package/lib/models/device.js +24 -24
- package/lib/models/device.js.map +1 -1
- package/lib/models/event-status.js +17 -17
- package/lib/models/event-status.js.map +1 -1
- package/lib/models/invites-ignorer-types.js +25 -25
- package/lib/models/invites-ignorer-types.js.map +1 -1
- package/lib/models/profile-keys.js +26 -26
- package/lib/models/profile-keys.js.map +1 -1
- package/lib/models/room-summary.js +26 -26
- package/lib/models/room-summary.js.map +1 -1
- package/lib/models/search-result.js +22 -22
- package/lib/models/search-result.js.map +1 -1
- package/lib/models/typed-event-emitter.js +122 -122
- package/lib/models/typed-event-emitter.js.map +1 -1
- package/lib/oidc/authorize.js +76 -76
- package/lib/oidc/authorize.js.map +1 -1
- package/lib/oidc/error.js +17 -17
- package/lib/oidc/error.js.map +1 -1
- package/lib/oidc/index.js +17 -17
- package/lib/oidc/index.js.map +1 -1
- package/lib/oidc/register.js +41 -41
- package/lib/oidc/register.js.map +1 -1
- package/lib/oidc/tokenRefresher.js +51 -51
- package/lib/oidc/tokenRefresher.js.map +1 -1
- package/lib/oidc/validate.js +59 -59
- package/lib/oidc/validate.js.map +1 -1
- package/lib/randomstring.js +35 -35
- package/lib/randomstring.js.map +1 -1
- package/lib/realtime-callbacks.js +39 -39
- package/lib/realtime-callbacks.js.map +1 -1
- package/lib/receipt-accumulator.js +44 -44
- package/lib/receipt-accumulator.js.map +1 -1
- package/lib/rendezvous/RendezvousChannel.js.map +1 -1
- package/lib/rendezvous/RendezvousCode.js.map +1 -1
- package/lib/rendezvous/RendezvousError.js +14 -14
- package/lib/rendezvous/RendezvousError.js.map +1 -1
- package/lib/rendezvous/RendezvousFailureReason.js +14 -14
- package/lib/rendezvous/RendezvousFailureReason.js.map +1 -1
- package/lib/rendezvous/RendezvousIntent.js +14 -14
- package/lib/rendezvous/RendezvousIntent.js.map +1 -1
- package/lib/rendezvous/RendezvousTransport.js.map +1 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +63 -63
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -1
- package/lib/rendezvous/channels/index.js +14 -14
- package/lib/rendezvous/channels/index.js.map +1 -1
- package/lib/rendezvous/index.js +14 -14
- package/lib/rendezvous/index.js.map +1 -1
- package/lib/rendezvous/transports/index.js +14 -14
- package/lib/rendezvous/transports/index.js.map +1 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +29 -29
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
- package/lib/rust-crypto/OutgoingRequestsManager.js +37 -37
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -1
- package/lib/rust-crypto/device-converter.js +30 -30
- package/lib/rust-crypto/device-converter.js.map +1 -1
- package/lib/rust-crypto/secret-storage.js +30 -30
- package/lib/rust-crypto/secret-storage.js.map +1 -1
- package/lib/service-types.js +14 -14
- package/lib/service-types.js.map +1 -1
- package/lib/store/local-storage-events-emitter.js +21 -21
- package/lib/store/local-storage-events-emitter.js.map +1 -1
- package/lib/sync-accumulator.js +50 -50
- package/lib/sync-accumulator.js.map +1 -1
- package/lib/thread-utils.js +20 -20
- package/lib/thread-utils.js.map +1 -1
- package/lib/types.js +34 -34
- package/lib/types.js.map +1 -1
- package/lib/utils/decryptAESSecretStorageItem.js +22 -22
- package/lib/utils/decryptAESSecretStorageItem.js.map +1 -1
- package/lib/utils/encryptAESSecretStorageItem.js +26 -26
- package/lib/utils/encryptAESSecretStorageItem.js.map +1 -1
- package/lib/utils/internal/deriveKeys.js +21 -21
- package/lib/utils/internal/deriveKeys.js.map +1 -1
- package/lib/utils/roomVersion.js +26 -26
- package/lib/utils/roomVersion.js.map +1 -1
- package/lib/version-support.js +26 -26
- package/lib/version-support.js.map +1 -1
- package/lib/wallet-recovery.d.ts +24 -0
- package/lib/wallet-recovery.d.ts.map +1 -0
- package/lib/wallet-recovery.js +232 -0
- package/lib/wallet-recovery.js.map +1 -0
- package/lib/webrtc/audioContext.js +24 -24
- package/lib/webrtc/audioContext.js.map +1 -1
- package/lib/webrtc/callEventTypes.js.map +1 -1
- package/lib/webrtc/stats/callFeedStatsReporter.js +14 -14
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportGatherer.js +14 -14
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportSummary.js.map +1 -1
- package/lib/webrtc/stats/connectionStats.js +14 -14
- package/lib/webrtc/stats/connectionStats.js.map +1 -1
- package/lib/webrtc/stats/connectionStatsBuilder.js +14 -14
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +14 -14
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -1
- package/lib/webrtc/stats/groupCallStats.js +14 -14
- package/lib/webrtc/stats/groupCallStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +14 -14
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.js +14 -14
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackStats.js +27 -27
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +20 -20
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
- package/lib/webrtc/stats/statsReport.js +14 -14
- package/lib/webrtc/stats/statsReport.js.map +1 -1
- package/lib/webrtc/stats/statsReportEmitter.js +14 -14
- package/lib/webrtc/stats/statsReportEmitter.js.map +1 -1
- package/lib/webrtc/stats/trackStatsBuilder.js +4 -4
- package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/transportStats.js.map +1 -1
- package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/valueFormatter.js +11 -11
- package/lib/webrtc/stats/valueFormatter.js.map +1 -1
- package/lib/xrpl/identity.d.ts +28 -0
- package/lib/xrpl/identity.d.ts.map +1 -0
- package/lib/xrpl/identity.js +213 -0
- package/lib/xrpl/identity.js.map +1 -0
- package/lib/xrpl/trust.d.ts +8 -0
- package/lib/xrpl/trust.d.ts.map +1 -0
- package/lib/xrpl/trust.js +61 -0
- package/lib/xrpl/trust.js.map +1 -0
- package/lib/xrpl/verification.d.ts +26 -0
- package/lib/xrpl/verification.d.ts.map +1 -0
- package/lib/xrpl/verification.js +295 -0
- package/lib/xrpl/verification.js.map +1 -0
- package/package.json +130 -129
- package/src/@types/AESEncryptedSecretStoragePayload.ts +29 -29
- package/src/@types/IIdentityServerProvider.ts +24 -24
- package/src/@types/PushRules.ts +208 -208
- package/src/@types/another-json.d.ts +19 -19
- package/src/@types/auth.ts +340 -258
- package/src/@types/beacon.ts +140 -140
- package/src/@types/common.ts +24 -24
- package/src/@types/crypto.ts +71 -71
- package/src/@types/event.ts +508 -449
- package/src/@types/events.ts +119 -119
- package/src/@types/extensible_events.ts +147 -147
- package/src/@types/local_notifications.ts +19 -19
- package/src/@types/location.ts +92 -92
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +39 -39
- package/src/@types/media.ts +245 -245
- package/src/@types/membership.ts +57 -57
- package/src/@types/partials.ts +103 -103
- package/src/@types/polls.ts +120 -120
- package/src/@types/read_receipts.ts +61 -61
- package/src/@types/registration.ts +102 -102
- package/src/@types/search.ts +119 -119
- package/src/@types/signed.ts +25 -25
- package/src/@types/spaces.ts +37 -37
- package/src/@types/state_events.ts +153 -153
- package/src/@types/synapse.ts +40 -40
- package/src/@types/sync.ts +27 -27
- package/src/@types/threepids.ts +29 -29
- package/src/@types/topic.ts +69 -69
- package/src/@types/uia.ts +24 -24
- package/src/NamespacedValue.ts +121 -121
- package/src/ReEmitter.ts +93 -93
- package/src/base64.ts +86 -86
- package/src/briij.ts +4 -0
- package/src/client.ts +183 -10
- package/src/common-crypto/README.md +4 -4
- package/src/common-crypto/key-passphrase.ts +43 -43
- package/src/content-helpers.ts +298 -298
- package/src/content-repo.ts +122 -122
- package/src/crypto/store/base.ts +388 -388
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +655 -655
- package/src/crypto/store/indexeddb-crypto-store.ts +555 -555
- package/src/crypto/store/localStorage-crypto-store.ts +409 -409
- package/src/crypto/store/memory-crypto-store.ts +326 -326
- package/src/crypto-api/CryptoEventHandlerMap.ts +42 -42
- package/src/crypto-api/key-passphrase.ts +58 -58
- package/src/crypto-api/keybackup.ts +114 -114
- package/src/crypto-api/recovery-key.ts +69 -69
- package/src/digest.ts +34 -34
- package/src/extensible_events_v1/ExtensibleEvent.ts +58 -58
- package/src/extensible_events_v1/InvalidEventError.ts +24 -24
- package/src/extensible_events_v1/MessageEvent.ts +143 -143
- package/src/extensible_events_v1/PollEndEvent.ts +97 -97
- package/src/extensible_events_v1/PollResponseEvent.ts +148 -148
- package/src/extensible_events_v1/PollStartEvent.ts +207 -207
- package/src/extensible_events_v1/utilities.ts +35 -35
- package/src/feature.ts +88 -88
- package/src/http-api/method.ts +25 -25
- package/src/http-api/prefix.ts +48 -48
- package/src/indexeddb-helpers.ts +50 -50
- package/src/indexeddb-worker.ts +24 -24
- package/src/matrixrtc/IKeyTransport.ts +63 -63
- package/src/matrixrtc/IMembershipManager.ts +120 -120
- package/src/matrixrtc/LivekitTransport.ts +46 -46
- package/src/matrixrtc/index.ts +24 -24
- package/src/matrixrtc/utils.ts +71 -71
- package/src/models/ToDeviceMessage.ts +38 -38
- package/src/models/device.ts +85 -85
- package/src/models/event-status.ts +39 -39
- package/src/models/invites-ignorer-types.ts +58 -58
- package/src/models/profile-keys.ts +33 -33
- package/src/models/room-summary.ts +78 -78
- package/src/models/search-result.ts +57 -57
- package/src/models/typed-event-emitter.ts +246 -246
- package/src/oidc/authorize.ts +279 -279
- package/src/oidc/error.ts +33 -33
- package/src/oidc/index.ts +33 -33
- package/src/oidc/register.ts +163 -163
- package/src/oidc/tokenRefresher.ts +184 -184
- package/src/oidc/validate.ts +265 -265
- package/src/randomstring.ts +103 -103
- package/src/realtime-callbacks.ts +191 -191
- package/src/receipt-accumulator.ts +189 -189
- package/src/rendezvous/RendezvousChannel.ts +48 -48
- package/src/rendezvous/RendezvousCode.ts +25 -25
- package/src/rendezvous/RendezvousError.ts +26 -26
- package/src/rendezvous/RendezvousFailureReason.ts +49 -49
- package/src/rendezvous/RendezvousIntent.ts +20 -20
- package/src/rendezvous/RendezvousTransport.ts +58 -58
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +270 -270
- package/src/rendezvous/channels/index.ts +17 -17
- package/src/rendezvous/index.ts +25 -25
- package/src/rendezvous/transports/index.ts +17 -17
- package/src/rust-crypto/CrossSigningIdentity.ts +195 -195
- package/src/rust-crypto/OutgoingRequestsManager.ts +170 -170
- package/src/rust-crypto/device-converter.ts +128 -128
- package/src/rust-crypto/secret-storage.ts +60 -60
- package/src/service-types.ts +20 -20
- package/src/store/local-storage-events-emitter.ts +46 -46
- package/src/sync-accumulator.ts +779 -779
- package/src/thread-utils.ts +31 -31
- package/src/types.ts +59 -59
- package/src/utils/decryptAESSecretStorageItem.ts +54 -54
- package/src/utils/encryptAESSecretStorageItem.ts +73 -73
- package/src/utils/internal/deriveKeys.ts +63 -63
- package/src/utils/roomVersion.ts +35 -35
- package/src/version-support.ts +50 -50
- package/src/wallet-recovery.ts +252 -0
- package/src/webrtc/audioContext.ts +44 -44
- package/src/webrtc/callEventTypes.ts +101 -101
- package/src/webrtc/stats/callFeedStatsReporter.ts +91 -91
- package/src/webrtc/stats/callStatsReportGatherer.ts +219 -219
- package/src/webrtc/stats/callStatsReportSummary.ts +30 -30
- package/src/webrtc/stats/connectionStats.ts +47 -47
- package/src/webrtc/stats/connectionStatsBuilder.ts +28 -28
- package/src/webrtc/stats/connectionStatsReportBuilder.ts +140 -140
- package/src/webrtc/stats/groupCallStats.ts +93 -93
- package/src/webrtc/stats/media/mediaSsrcHandler.ts +57 -57
- package/src/webrtc/stats/media/mediaTrackHandler.ts +70 -70
- package/src/webrtc/stats/media/mediaTrackStats.ts +176 -176
- package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +90 -90
- package/src/webrtc/stats/statsReport.ts +133 -133
- package/src/webrtc/stats/statsReportEmitter.ts +49 -49
- package/src/webrtc/stats/trackStatsBuilder.ts +207 -207
- package/src/webrtc/stats/transportStats.ts +26 -26
- package/src/webrtc/stats/transportStatsBuilder.ts +48 -48
- package/src/webrtc/stats/valueFormatter.ts +27 -27
- package/src/xrpl/identity.ts +245 -0
- package/src/xrpl/trust.ts +64 -0
- package/src/xrpl/verification.ts +284 -0
package/lib/NamespacedValue.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2021 - 2022 The Matrix.org Foundation C.I.C.
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2021 - 2022 The Matrix.org Foundation C.I.C.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Represents a simple Matrix namespaced value. This will assume that if a stable prefix
|
|
20
|
-
* is provided that the stable prefix should be used when representing the identifier.
|
|
18
|
+
/**
|
|
19
|
+
* Represents a simple Matrix namespaced value. This will assume that if a stable prefix
|
|
20
|
+
* is provided that the stable prefix should be used when representing the identifier.
|
|
21
21
|
*/
|
|
22
22
|
export class NamespacedValue {
|
|
23
23
|
// Stable is optional, but one of the two parameters is required, hence the weird-looking types.
|
|
@@ -91,9 +91,9 @@ export class ServerControlledNamespacedValue extends NamespacedValue {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* Represents a namespaced value which prioritizes the unstable value over the stable
|
|
96
|
-
* value.
|
|
94
|
+
/**
|
|
95
|
+
* Represents a namespaced value which prioritizes the unstable value over the stable
|
|
96
|
+
* value.
|
|
97
97
|
*/
|
|
98
98
|
export class UnstableValue extends NamespacedValue {
|
|
99
99
|
// Note: Constructor difference is that `unstable` is *required*.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamespacedValue.js","names":["NamespacedValue","constructor","stable","unstable","Error","name","altName","names","push","matches","val","findIn","obj","undefined","includedIn","arr","included","includes","ServerControlledNamespacedValue","arguments","_defineProperty","setPreferUnstable","preferUnstable","UnstableValue"],"sources":["../src/NamespacedValue.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"NamespacedValue.js","names":["NamespacedValue","constructor","stable","unstable","Error","name","altName","names","push","matches","val","findIn","obj","undefined","includedIn","arr","included","includes","ServerControlledNamespacedValue","arguments","_defineProperty","setPreferUnstable","preferUnstable","UnstableValue"],"sources":["../src/NamespacedValue.ts"],"sourcesContent":["/*\nCopyright 2021 - 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Represents a simple Matrix namespaced value. This will assume that if a stable prefix\n * is provided that the stable prefix should be used when representing the identifier.\n */\nexport class NamespacedValue<S extends string, U extends string> {\n // Stable is optional, but one of the two parameters is required, hence the weird-looking types.\n // Goal is to to have developers explicitly say there is no stable value (if applicable).\n public constructor(stable: S, unstable: U);\n public constructor(stable: S, unstable: U | null);\n public constructor(stable: null, unstable: U);\n public constructor(\n public readonly stable: S | null,\n public readonly unstable: U | null,\n ) {\n if (!this.unstable && !this.stable) {\n throw new Error(\"One of stable or unstable values must be supplied\");\n }\n }\n\n public get name(): U | S {\n if (this.stable) {\n return this.stable;\n }\n return this.unstable!;\n }\n\n public get altName(): U | S | null | undefined {\n if (!this.stable) {\n return null;\n }\n return this.unstable;\n }\n\n public get names(): (U | S)[] {\n const names = [this.name];\n const altName = this.altName;\n if (altName) names.push(altName);\n return names;\n }\n\n public matches(val: string): boolean {\n return this.name === val || this.altName === val;\n }\n\n // this desperately wants https://github.com/microsoft/TypeScript/pull/26349 at the top level of the class\n // so we can instantiate `NamespacedValue<string, _, _>` as a default type for that namespace.\n public findIn<V>(obj: Partial<Record<NonNullable<S | U>, V>>): V | undefined {\n let val: V | undefined = undefined;\n if (this.name) {\n val = obj?.[this.name];\n }\n if (!val && this.altName) {\n val = obj?.[this.altName];\n }\n return val;\n }\n\n public includedIn(arr: any[]): boolean {\n let included = false;\n if (this.name) {\n included = arr.includes(this.name);\n }\n if (!included && this.altName) {\n included = arr.includes(this.altName);\n }\n return included;\n }\n}\n\nexport class ServerControlledNamespacedValue<S extends string, U extends string> extends NamespacedValue<S, U> {\n private preferUnstable = false;\n\n public setPreferUnstable(preferUnstable: boolean): void {\n this.preferUnstable = preferUnstable;\n }\n\n public get name(): U | S {\n if (this.stable && !this.preferUnstable) {\n return this.stable;\n }\n return this.unstable!;\n }\n}\n\n/**\n * Represents a namespaced value which prioritizes the unstable value over the stable\n * value.\n */\nexport class UnstableValue<S extends string, U extends string> extends NamespacedValue<S, U> {\n // Note: Constructor difference is that `unstable` is *required*.\n public constructor(stable: S, unstable: U) {\n super(stable, unstable);\n if (!this.unstable) {\n throw new Error(\"Unstable value must be supplied\");\n }\n }\n\n public get name(): U {\n return this.unstable!;\n }\n\n public get altName(): S {\n return this.stable!;\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMA,eAAe,CAAqC;EAC7D;EACA;;EAIOC,WAAWA,CACEC,MAAgB,EAChBC,QAAkB,EACpC;IAAA,KAFkBD,MAAgB,GAAhBA,MAAgB;IAAA,KAChBC,QAAkB,GAAlBA,QAAkB;IAElC,IAAI,CAAC,IAAI,CAACA,QAAQ,IAAI,CAAC,IAAI,CAACD,MAAM,EAAE;MAChC,MAAM,IAAIE,KAAK,CAAC,mDAAmD,CAAC;IACxE;EACJ;EAEA,IAAWC,IAAIA,CAAA,EAAU;IACrB,IAAI,IAAI,CAACH,MAAM,EAAE;MACb,OAAO,IAAI,CAACA,MAAM;IACtB;IACA,OAAO,IAAI,CAACC,QAAQ;EACxB;EAEA,IAAWG,OAAOA,CAAA,EAA6B;IAC3C,IAAI,CAAC,IAAI,CAACJ,MAAM,EAAE;MACd,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACC,QAAQ;EACxB;EAEA,IAAWI,KAAKA,CAAA,EAAc;IAC1B,IAAMA,KAAK,GAAG,CAAC,IAAI,CAACF,IAAI,CAAC;IACzB,IAAMC,OAAO,GAAG,IAAI,CAACA,OAAO;IAC5B,IAAIA,OAAO,EAAEC,KAAK,CAACC,IAAI,CAACF,OAAO,CAAC;IAChC,OAAOC,KAAK;EAChB;EAEOE,OAAOA,CAACC,GAAW,EAAW;IACjC,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eAAe,CAAO;EACzF;EACOC,WAAWA,CAACC,MAAS,EAAEC,QAAW,EAAE;IACvC,KAAK,CAACD,MAAM,EAAEC,QAAQ,CAAC;IACvB,IAAI,CAAC,IAAI,CAACA,QAAQ,EAAE;MAChB,MAAM,IAAIC,KAAK,CAAC,iCAAiC,CAAC;IACtD;EACJ;EAEA,IAAWC,IAAIA,CAAA,EAAM;IACjB,OAAO,IAAI,CAACF,QAAQ;EACxB;EAEA,IAAWG,OAAOA,CAAA,EAAM;IACpB,OAAO,IAAI,CAACJ,MAAM;EACtB;AACJ","ignoreList":[]}
|
package/lib/ReEmitter.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2015, 2016 OpenMarket Ltd
|
|
4
|
-
Copyright 2017 Vector Creations Ltd
|
|
5
|
-
Copyright 2017 New Vector Ltd
|
|
6
|
-
|
|
7
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
you may not use this file except in compliance with the License.
|
|
9
|
-
You may obtain a copy of the License at
|
|
10
|
-
|
|
11
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
See the License for the specific language governing permissions and
|
|
17
|
-
limitations under the License.
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2015, 2016 OpenMarket Ltd
|
|
4
|
+
Copyright 2017 Vector Creations Ltd
|
|
5
|
+
Copyright 2017 New Vector Ltd
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line no-restricted-imports
|
package/lib/ReEmitter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReEmitter.js","names":["ReEmitter","constructor","target","_defineProperty","WeakMap","reEmit","source","eventNames","_this","reEmittersByEvent","reEmitters","get","Map","set","_loop","eventName","has","forSource","listenerCount","_len","arguments","length","args","Array","_key","emit","on","stopReEmitting","off","delete","size","TypedReEmitter"],"sources":["../src/ReEmitter.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"ReEmitter.js","names":["ReEmitter","constructor","target","_defineProperty","WeakMap","reEmit","source","eventNames","_this","reEmittersByEvent","reEmitters","get","Map","set","_loop","eventName","has","forSource","listenerCount","_len","arguments","length","args","Array","_key","emit","on","stopReEmitting","off","delete","size","TypedReEmitter"],"sources":["../src/ReEmitter.ts"],"sourcesContent":["/*\nCopyright 2015, 2016 OpenMarket Ltd\nCopyright 2017 Vector Creations Ltd\nCopyright 2017 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// eslint-disable-next-line no-restricted-imports\nimport { type EventEmitter } from \"events\";\n\nimport { type ListenerMap, type TypedEventEmitter } from \"./models/typed-event-emitter.ts\";\n\nexport class ReEmitter {\n public constructor(private readonly target: EventEmitter) {}\n\n // Map from emitter to event name to re-emitter\n private reEmitters = new WeakMap<EventEmitter, Map<string, (...args: any[]) => void>>();\n\n public reEmit(source: EventEmitter, eventNames: string[]): void {\n let reEmittersByEvent = this.reEmitters.get(source);\n if (!reEmittersByEvent) {\n reEmittersByEvent = new Map();\n this.reEmitters.set(source, reEmittersByEvent);\n }\n\n for (const eventName of eventNames) {\n if (reEmittersByEvent.has(eventName)) continue;\n\n // We include the source as the last argument for event handlers which may need it,\n // such as read receipt listeners on the client class which won't have the context\n // of the room.\n const forSource = (...args: any[]): void => {\n // EventEmitter special cases 'error' to make the emit function throw if no\n // handler is attached, which sort of makes sense for making sure that something\n // handles an error, but for re-emitting, there could be a listener on the original\n // source object so the test doesn't really work. We *could* try to replicate the\n // same logic and throw if there is no listener on either the source or the target,\n // but this behaviour is fairly undesireable for us anyway: the main place we throw\n // 'error' events is for calls, where error events are usually emitted some time\n // later by a different part of the code where 'emit' throwing because the app hasn't\n // added an error handler isn't terribly helpful. (A better fix in retrospect may\n // have been to just avoid using the event name 'error', but backwards compat...)\n if (eventName === \"error\" && this.target.listenerCount(\"error\") === 0) return;\n this.target.emit(eventName, ...args, source);\n };\n source.on(eventName, forSource);\n reEmittersByEvent.set(eventName, forSource);\n }\n }\n\n public stopReEmitting(source: EventEmitter, eventNames: string[]): void {\n const reEmittersByEvent = this.reEmitters.get(source);\n if (!reEmittersByEvent) return; // We were never re-emitting these events in the first place\n\n for (const eventName of eventNames) {\n source.off(eventName, reEmittersByEvent.get(eventName)!);\n reEmittersByEvent.delete(eventName);\n }\n\n if (reEmittersByEvent.size === 0) this.reEmitters.delete(source);\n }\n}\n\nexport class TypedReEmitter<Events extends string, Arguments extends ListenerMap<Events>> extends ReEmitter {\n public constructor(target: TypedEventEmitter<Events, Arguments>) {\n super(target);\n }\n\n public reEmit<ReEmittedEvents extends string, T extends Events & ReEmittedEvents>(\n source: TypedEventEmitter<ReEmittedEvents, any>,\n eventNames: T[],\n ): void {\n super.reEmit(source, eventNames);\n }\n\n public stopReEmitting<ReEmittedEvents extends string, T extends Events & ReEmittedEvents>(\n source: TypedEventEmitter<ReEmittedEvents, any>,\n eventNames: T[],\n ): void {\n super.stopReEmitting(source, eventNames);\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAKA,OAAO,MAAMA,SAAS,CAAC;EACZC,WAAWA,CAAkBC,MAAoB,EAAE;IAAA,KAAtBA,MAAoB,GAApBA,MAAoB;IAExD;IAAAC,eAAA,qBACqB,IAAIC,OAAO,CAAsD,CAAC;EAH5B;EAKpDC,MAAMA,CAACC,MAAoB,EAAEC,UAAoB,EAAQ;IAAA,IAAAC,KAAA;IAC5D,IAAIC,iBAAiB,GAAG,IAAI,CAACC,UAAU,CAACC,GAAG,CAACL,MAAM,CAAC;IACnD,IAAI,CAACG,iBAAiB,EAAE;MACpBA,iBAAiB,GAAG,IAAIG,GAAG,CAAC,CAAC;MAC7B,IAAI,CAACF,UAAU,CAACG,GAAG,CAACP,MAAM,EAAEG,iBAAiB,CAAC;IAClD;IAAC,IAAAK,KAAA,YAAAA,MAAAC,SAAA,EAEmC;MAChC,IAAIN,iBAAiB,CAACO,GAAG,CAACD,SAAS,CAAC;;MAEpC;MACA;MACA;MACA,IAAME,SAAS,GAAG,SAAZA,SAASA,CAAA,EAA6B;QACxC;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,IAAIF,SAAS,KAAK,OAAO,IAAIP,KAAI,CAACN,MAAM,CAACgB,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAAO,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAX5DC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;UAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CA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1
|
-
/*
|
|
2
|
-
Copyright 2023 The Matrix.org Foundation C.I.C.
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 The Matrix.org Foundation C.I.C.
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Base64 encoding and decoding utilities
|
|
17
|
+
/**
|
|
18
|
+
* Base64 encoding and decoding utilities
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
function toBase64(uint8Array, options) {
|
|
@@ -35,10 +35,10 @@ function toBase64(uint8Array, options) {
|
|
|
35
35
|
return base64;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* Encode a typed array of uint8 as base64.
|
|
40
|
-
* @param uint8Array - The data to encode.
|
|
41
|
-
* @returns The base64.
|
|
38
|
+
/**
|
|
39
|
+
* Encode a typed array of uint8 as base64.
|
|
40
|
+
* @param uint8Array - The data to encode.
|
|
41
|
+
* @returns The base64.
|
|
42
42
|
*/
|
|
43
43
|
export function encodeBase64(uint8Array) {
|
|
44
44
|
return toBase64(uint8Array, {
|
|
@@ -47,10 +47,10 @@ export function encodeBase64(uint8Array) {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* Encode a typed array of uint8 as unpadded base64.
|
|
52
|
-
* @param uint8Array - The data to encode.
|
|
53
|
-
* @returns The unpadded base64.
|
|
50
|
+
/**
|
|
51
|
+
* Encode a typed array of uint8 as unpadded base64.
|
|
52
|
+
* @param uint8Array - The data to encode.
|
|
53
|
+
* @returns The unpadded base64.
|
|
54
54
|
*/
|
|
55
55
|
export function encodeUnpaddedBase64(uint8Array) {
|
|
56
56
|
return toBase64(uint8Array, {
|
|
@@ -59,10 +59,10 @@ export function encodeUnpaddedBase64(uint8Array) {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
* Encode a typed array of uint8 as unpadded base64 using the URL-safe encoding.
|
|
64
|
-
* @param uint8Array - The data to encode.
|
|
65
|
-
* @returns The unpadded base64.
|
|
62
|
+
/**
|
|
63
|
+
* Encode a typed array of uint8 as unpadded base64 using the URL-safe encoding.
|
|
64
|
+
* @param uint8Array - The data to encode.
|
|
65
|
+
* @returns The unpadded base64.
|
|
66
66
|
*/
|
|
67
67
|
export function encodeUnpaddedBase64Url(uint8Array) {
|
|
68
68
|
return toBase64(uint8Array, {
|
|
@@ -80,10 +80,10 @@ function fromBase64(base64, options) {
|
|
|
80
80
|
return Uint8Array.from(atob(base64), c => c.charCodeAt(0));
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
/**
|
|
84
|
-
* Decode a base64 (or base64url) string to a typed array of uint8.
|
|
85
|
-
* @param base64 - The base64 to decode.
|
|
86
|
-
* @returns The decoded data.
|
|
83
|
+
/**
|
|
84
|
+
* Decode a base64 (or base64url) string to a typed array of uint8.
|
|
85
|
+
* @param base64 - The base64 to decode.
|
|
86
|
+
* @returns The decoded data.
|
|
87
87
|
*/
|
|
88
88
|
export function decodeBase64(base64) {
|
|
89
89
|
// The function requires us to select an alphabet, but we don't know if base64url was used so we convert.
|
package/lib/base64.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64.js","names":["toBase64","uint8Array","options","base64","btoa","reduce","acc","current","String","fromCharCode","omitPadding","replace","alphabet","encodeBase64","encodeUnpaddedBase64","encodeUnpaddedBase64Url","fromBase64","Uint8Array","from","atob","c","charCodeAt","decodeBase64","lastChunkHandling"],"sources":["../src/base64.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"base64.js","names":["toBase64","uint8Array","options","base64","btoa","reduce","acc","current","String","fromCharCode","omitPadding","replace","alphabet","encodeBase64","encodeUnpaddedBase64","encodeUnpaddedBase64Url","fromBase64","Uint8Array","from","atob","c","charCodeAt","decodeBase64","lastChunkHandling"],"sources":["../src/base64.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * Base64 encoding and decoding utilities\n */\n\nfunction toBase64(uint8Array: Uint8Array, options: Uint8ArrayToBase64Options): string {\n if (typeof uint8Array.toBase64 === \"function\") {\n // Currently this is only supported in Firefox,\n // but we match the options in the hope in the future we can rely on it for all environments.\n // https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.prototype.tobase64\n return uint8Array.toBase64(options);\n }\n\n let base64 = btoa(uint8Array.reduce((acc, current) => acc + String.fromCharCode(current), \"\"));\n if (options.omitPadding) {\n base64 = base64.replace(/={1,2}$/, \"\");\n }\n if (options.alphabet === \"base64url\") {\n base64 = base64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n }\n\n return base64;\n}\n\n/**\n * Encode a typed array of uint8 as base64.\n * @param uint8Array - The data to encode.\n * @returns The base64.\n */\nexport function encodeBase64(uint8Array: Uint8Array): string {\n return toBase64(uint8Array, { alphabet: \"base64\", omitPadding: false });\n}\n\n/**\n * Encode a typed array of uint8 as unpadded base64.\n * @param uint8Array - The data to encode.\n * @returns The unpadded base64.\n */\nexport function encodeUnpaddedBase64(uint8Array: Uint8Array): string {\n return toBase64(uint8Array, { alphabet: \"base64\", omitPadding: true });\n}\n\n/**\n * Encode a typed array of uint8 as unpadded base64 using the URL-safe encoding.\n * @param uint8Array - The data to encode.\n * @returns The unpadded base64.\n */\nexport function encodeUnpaddedBase64Url(uint8Array: Uint8Array): string {\n return toBase64(uint8Array, { alphabet: \"base64url\", omitPadding: true });\n}\n\nfunction fromBase64(base64: string, options: Uint8ArrayFromBase64Options): Uint8Array<ArrayBuffer> {\n if (typeof Uint8Array.fromBase64 === \"function\") {\n // Currently this is only supported in Firefox,\n // but we match the options in the hope in the future we can rely on it for all environments.\n // https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.frombase64\n return Uint8Array.fromBase64(base64, options);\n }\n\n return Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));\n}\n\n/**\n * Decode a base64 (or base64url) string to a typed array of uint8.\n * @param base64 - The base64 to decode.\n * @returns The decoded data.\n */\nexport function decodeBase64(base64: string): Uint8Array<ArrayBuffer> {\n // The function requires us to select an alphabet, but we don't know if base64url was used so we convert.\n return fromBase64(base64.replace(/-/g, \"+\").replace(/_/g, \"/\"), { alphabet: \"base64\", lastChunkHandling: \"loose\" });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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K,CAAC,CAAC;AAC7E;AAEA,SAASM,UAAUA,CAACb,MAAc,EAAED,OAAoC,EAA2B;EAC/F,IAAI,OAAOe,UAAU,CAACD,UAAU,KAAK,UAAU,EAAE;IAC7C;IACA;IACA;IACA,OAAOC,UAAU,CAACD,UAAU,CAACb,MAAM,EAAED,OAAO,CAAC;EACjD;EAEA,OAAOe,UAAU,CAACC,IAAI,CAACC,IAAI,CAAChB,MAAM,CAAC,EAAGiB,CAAC,IAAKA,CAAC,CAACC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACnB,MAAc,EAA2B;EAClE;EACA,OAAOa,UAAU,CAACb,MAAM,CAACQ,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAACA,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEW,iBAAiB,EAAE;EAAQ,CAAC,CAAC;AACvH","ignoreList":[]}
|
package/lib/briij.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export * from "./scheduler.ts";
|
|
|
28
28
|
export * from "./filter.ts";
|
|
29
29
|
export * from "./timeline-window.ts";
|
|
30
30
|
export * from "./interactive-auth.ts";
|
|
31
|
+
export * from "./xrpl/identity.ts";
|
|
32
|
+
export * from "./xrpl/trust.ts";
|
|
33
|
+
export * from "./xrpl/verification.ts";
|
|
34
|
+
export * from "./wallet-recovery.ts";
|
|
31
35
|
export * from "./version-support.ts";
|
|
32
36
|
export * from "./service-types.ts";
|
|
33
37
|
export * from "./store/memory.ts";
|
package/lib/briij.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"briij.d.ts","sourceRoot":"","sources":["../src/briij.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MA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E,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,YAAY,EAAE,QAAQ,IAAI,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvE,YAAY,EAAE,kBAAkB,IAAI,iBAAiB,EAAE,cAAc,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,IAAI,CAElE;AAcD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,WAAW,CAEjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,aAAa,EAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,iBAAiB,UAAO,GACzB,WAAW,CAEb"}
|
package/lib/briij.js
CHANGED
|
@@ -45,6 +45,10 @@ export * from "./scheduler.js";
|
|
|
45
45
|
export * from "./filter.js";
|
|
46
46
|
export * from "./timeline-window.js";
|
|
47
47
|
export * from "./interactive-auth.js";
|
|
48
|
+
export * from "./xrpl/identity.js";
|
|
49
|
+
export * from "./xrpl/trust.js";
|
|
50
|
+
export * from "./xrpl/verification.js";
|
|
51
|
+
export * from "./wallet-recovery.js";
|
|
48
52
|
export * from "./version-support.js";
|
|
49
53
|
export * from "./service-types.js";
|
|
50
54
|
export * from "./store/memory.js";
|
package/lib/briij.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"briij.js","names":["MemoryCryptoStore","MemoryStore","BriijScheduler","BriijClient","RoomWidgetClient","_ContentHelpers","ContentHelpers","_SecretStorage","SecretStorage","createNewBriijCall","CallEvent","GroupCall","GroupCallEvent","GroupCallIntent","GroupCallState","GroupCallType","GroupCallStatsReportEvent","SyncState","SetPresence","SlidingSyncEvent","MediaHandlerEvent","CallFeedEvent","StatsReport","Relations","RelationsEvent","TypedEventEmitter","LocalStorageErrors","localStorageErrorsEventsEmitter","IdentityProviderBrand","SSOAction","LocationAssetType","DebugLogger","cryptoStoreFactory","setCryptoStoreFactory","fac","amendClientOpts","opts","_opts$store","_opts$scheduler","_opts$cryptoStore","store","localStorage","globalThis","scheduler","cryptoStore","createClient","createRoomWidgetClient","widgetApi","capabilities","roomId","sendContentLoaded","arguments","length","undefined"],"sources":["../src/briij.ts"],"sourcesContent":["/*\nCopyright 2015-2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type WidgetApi } from \"matrix-widget-api\";\n\nimport { MemoryCryptoStore } from \"./crypto/store/memory-crypto-store.ts\";\nimport { MemoryStore } from \"./store/memory.ts\";\nimport { BriijScheduler } from \"./scheduler.ts\";\nimport { BriijClient, type ICreateClientOpts } from \"./client.ts\";\nimport { RoomWidgetClient, type ICapabilities } from \"./embedded.ts\";\nimport { type CryptoStore } from \"./crypto/store/base.ts\";\n\nexport * from \"./client.ts\";\nexport * from \"./serverCapabilities.ts\";\nexport * from \"./embedded.ts\";\nexport * from \"./http-api/index.ts\";\nexport * from \"./autodiscovery.ts\";\nexport * from \"./sync-accumulator.ts\";\nexport * from \"./errors.ts\";\nexport * from \"./base64.ts\";\nexport * from \"./models/beacon.ts\";\nexport * from \"./models/event.ts\";\nexport * from \"./models/room.ts\";\nexport * from \"./models/event-timeline.ts\";\nexport * from \"./models/event-timeline-set.ts\";\nexport * from \"./models/poll.ts\";\nexport * from \"./models/room-member.ts\";\nexport * from \"./models/room-state.ts\";\nexport * from \"./models/thread.ts\";\nexport * from \"./models/typed-event-emitter.ts\";\nexport * from \"./models/user.ts\";\nexport * from \"./models/device.ts\";\nexport * from \"./models/search-result.ts\";\nexport * from \"./oidc/index.ts\";\nexport * from \"./scheduler.ts\";\nexport * from \"./filter.ts\";\nexport * from \"./timeline-window.ts\";\nexport * from \"./interactive-auth.ts\";\nexport * from \"./version-support.ts\";\nexport * from \"./service-types.ts\";\nexport * from \"./store/memory.ts\";\nexport * from \"./store/indexeddb.ts\";\nexport * from \"./crypto/store/memory-crypto-store.ts\";\nexport * from \"./crypto/store/localStorage-crypto-store.ts\";\nexport * from \"./crypto/store/indexeddb-crypto-store.ts\";\nexport type { OutgoingRoomKeyRequest } from \"./crypto/store/base.ts\";\nexport * from \"./content-repo.ts\";\nexport type * from \"./@types/common.ts\";\nexport type * from \"./@types/uia.ts\";\nexport * from \"./@types/event.ts\";\nexport * from \"./@types/PushRules.ts\";\nexport * from \"./@types/partials.ts\";\nexport * from \"./@types/requests.ts\";\nexport * from \"./@types/search.ts\";\nexport * from \"./@types/beacon.ts\";\nexport * from \"./@types/topic.ts\";\nexport * from \"./@types/location.ts\";\nexport * from \"./@types/threepids.ts\";\nexport * from \"./@types/auth.ts\";\nexport * from \"./@types/polls.ts\";\nexport type * from \"./@types/local_notifications.ts\";\nexport type * from \"./@types/registration.ts\";\nexport * from \"./@types/read_receipts.ts\";\nexport * from \"./@types/crypto.ts\";\nexport * from \"./@types/extensible_events.ts\";\nexport * from \"./@types/IIdentityServerProvider.ts\";\nexport * from \"./@types/membership.ts\";\nexport * from \"./models/room-summary.ts\";\nexport * from \"./models/event-status.ts\";\nexport * from \"./models/profile-keys.ts\";\nexport * from \"./models/related-relations.ts\";\nexport type { RoomSummary } from \"./client.ts\";\nexport * as ContentHelpers from \"./content-helpers.ts\";\nexport * as SecretStorage from \"./secret-storage.ts\";\nexport { createNewBriijCall, CallEvent } from \"./webrtc/call.ts\";\nexport type { BriijCall } from \"./webrtc/call.ts\";\nexport {\n GroupCall,\n GroupCallEvent,\n GroupCallIntent,\n GroupCallState,\n GroupCallType,\n GroupCallStatsReportEvent,\n} from \"./webrtc/groupCall.ts\";\n\nexport { SyncState, SetPresence } from \"./sync.ts\";\nexport type { ISyncStateData as SyncStateData } from \"./sync.ts\";\nexport { SlidingSyncEvent } from \"./sliding-sync.ts\";\nexport { MediaHandlerEvent } from \"./webrtc/mediaHandler.ts\";\nexport { CallFeedEvent } from \"./webrtc/callFeed.ts\";\nexport { StatsReport } from \"./webrtc/stats/statsReport.ts\";\nexport { Relations, RelationsEvent } from \"./models/relations.ts\";\nexport { TypedEventEmitter } from \"./models/typed-event-emitter.ts\";\nexport { LocalStorageErrors, localStorageErrorsEventsEmitter } from \"./store/local-storage-events-emitter.ts\";\nexport { IdentityProviderBrand, SSOAction } from \"./@types/auth.ts\";\nexport type { ISSOFlow as SSOFlow, LoginFlow } from \"./@types/auth.ts\";\nexport type { IHierarchyRelation as HierarchyRelation, IHierarchyRoom as HierarchyRoom } from \"./@types/spaces.ts\";\nexport { LocationAssetType } from \"./@types/location.ts\";\nexport { DebugLogger } from \"./logger.ts\";\n\nlet cryptoStoreFactory = (): CryptoStore => new MemoryCryptoStore();\n\n/**\n * Configure a different factory to be used for creating crypto stores\n *\n * @param fac - a function which will return a new `CryptoStore`\n */\nexport function setCryptoStoreFactory(fac: () => CryptoStore): void {\n cryptoStoreFactory = fac;\n}\n\nfunction amendClientOpts(opts: ICreateClientOpts): ICreateClientOpts {\n opts.store =\n opts.store ??\n new MemoryStore({\n localStorage: globalThis.localStorage,\n });\n opts.scheduler = opts.scheduler ?? new BriijScheduler();\n opts.cryptoStore = opts.cryptoStore ?? cryptoStoreFactory();\n\n return opts;\n}\n\n/**\n * Construct a Briij client. Similar to {@link BriijClient}\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link BriijClient}.\n *\n * @returns A new Briij client.\n * @see {@link BriijClient} for the full list of options for\n * `opts`.\n */\nexport function createClient(opts: ICreateClientOpts): BriijClient {\n return new BriijClient(amendClientOpts(opts));\n}\n\n/**\n * Construct a Briij client that works in a widget.\n * This client has a subset of features compared to a full client.\n * It uses the widget-api to communicate with matrix. (widget \\<-\\> client \\<-\\> homeserver)\n * @returns A new Briij client with a subset of features.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link BriijClient}.\n * @param widgetApi - The widget api to use for communication.\n * @param capabilities - The capabilities the widget client will request.\n * @param roomId - The room id the widget is associated with.\n * @param sendContentLoaded - Whether to send a content loaded widget action immediately after initial setup.\n * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),\n * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.\n */\nexport function createRoomWidgetClient(\n widgetApi: WidgetApi,\n capabilities: ICapabilities,\n roomId: string,\n opts: ICreateClientOpts,\n sendContentLoaded = true,\n): BriijClient {\n return new RoomWidgetClient(widgetApi, capabilities, roomId, amendClientOpts(opts), sendContentLoaded);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,uCAAuC;AACzE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,WAAW,QAAgC,aAAa;AACjE,SAASC,gBAAgB,QAA4B,eAAe;AAGpE,cAAc,aAAa;AAC3B,cAAc,yBAAyB;AACvC,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,oBAAoB;AAClC,cAAc,mBAAmB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gC,eAAe,CAACC,IAAI,CAAC,CAAC;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,sBAAsBA,CAClCC,SAAoB,EACpBC,YAA2B,EAC3BC,MAAc,EACdb,IAAuB,EAEZ;EAAA,IADXc,iBAAiB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAExB,OAAO,IAAI/C,gBAAgB,CAAC2C,SAAS,EAAEC,YAAY,EAAEC,MAAM,EAAEd,eAAe,CAACC,IAAI,CAAC,EAAEc,iBAAiB,CAAC;AAC1G","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"briij.js","names":["MemoryCryptoStore","MemoryStore","BriijScheduler","BriijClient","RoomWidgetClient","_ContentHelpers","ContentHelpers","_SecretStorage","SecretStorage","createNewBriijCall","CallEvent","GroupCall","GroupCallEvent","GroupCallIntent","GroupCallState","GroupCallType","GroupCallStatsReportEvent","SyncState","SetPresence","SlidingSyncEvent","MediaHandlerEvent","CallFeedEvent","StatsReport","Relations","RelationsEvent","TypedEventEmitter","LocalStorageErrors","localStorageErrorsEventsEmitter","IdentityProviderBrand","SSOAction","LocationAssetType","DebugLogger","cryptoStoreFactory","setCryptoStoreFactory","fac","amendClientOpts","opts","_opts$store","_opts$scheduler","_opts$cryptoStore","store","localStorage","globalThis","scheduler","cryptoStore","createClient","createRoomWidgetClient","widgetApi","capabilities","roomId","sendContentLoaded","arguments","length","undefined"],"sources":["../src/briij.ts"],"sourcesContent":["/*\nCopyright 2015-2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type WidgetApi } from \"matrix-widget-api\";\n\nimport { MemoryCryptoStore } from \"./crypto/store/memory-crypto-store.ts\";\nimport { MemoryStore } from \"./store/memory.ts\";\nimport { BriijScheduler } from \"./scheduler.ts\";\nimport { BriijClient, type ICreateClientOpts } from \"./client.ts\";\nimport { RoomWidgetClient, type ICapabilities } from \"./embedded.ts\";\nimport { type CryptoStore } from \"./crypto/store/base.ts\";\n\nexport * from \"./client.ts\";\nexport * from \"./serverCapabilities.ts\";\nexport * from \"./embedded.ts\";\nexport * from \"./http-api/index.ts\";\nexport * from \"./autodiscovery.ts\";\nexport * from \"./sync-accumulator.ts\";\nexport * from \"./errors.ts\";\nexport * from \"./base64.ts\";\nexport * from \"./models/beacon.ts\";\nexport * from \"./models/event.ts\";\nexport * from \"./models/room.ts\";\nexport * from \"./models/event-timeline.ts\";\nexport * from \"./models/event-timeline-set.ts\";\nexport * from \"./models/poll.ts\";\nexport * from \"./models/room-member.ts\";\nexport * from \"./models/room-state.ts\";\nexport * from \"./models/thread.ts\";\nexport * from \"./models/typed-event-emitter.ts\";\nexport * from \"./models/user.ts\";\nexport * from \"./models/device.ts\";\nexport * from \"./models/search-result.ts\";\nexport * from \"./oidc/index.ts\";\nexport * from \"./scheduler.ts\";\nexport * from \"./filter.ts\";\nexport * from \"./timeline-window.ts\";\nexport * from \"./interactive-auth.ts\";\nexport * from \"./xrpl/identity.ts\";\nexport * from \"./xrpl/trust.ts\";\nexport * from \"./xrpl/verification.ts\";\nexport * from \"./wallet-recovery.ts\";\nexport * from \"./version-support.ts\";\nexport * from \"./service-types.ts\";\nexport * from \"./store/memory.ts\";\nexport * from \"./store/indexeddb.ts\";\nexport * from \"./crypto/store/memory-crypto-store.ts\";\nexport * from \"./crypto/store/localStorage-crypto-store.ts\";\nexport * from \"./crypto/store/indexeddb-crypto-store.ts\";\nexport type { OutgoingRoomKeyRequest } from \"./crypto/store/base.ts\";\nexport * from \"./content-repo.ts\";\nexport type * from \"./@types/common.ts\";\nexport type * from \"./@types/uia.ts\";\nexport * from \"./@types/event.ts\";\nexport * from \"./@types/PushRules.ts\";\nexport * from \"./@types/partials.ts\";\nexport * from \"./@types/requests.ts\";\nexport * from \"./@types/search.ts\";\nexport * from \"./@types/beacon.ts\";\nexport * from \"./@types/topic.ts\";\nexport * from \"./@types/location.ts\";\nexport * from \"./@types/threepids.ts\";\nexport * from \"./@types/auth.ts\";\nexport * from \"./@types/polls.ts\";\nexport type * from \"./@types/local_notifications.ts\";\nexport type * from \"./@types/registration.ts\";\nexport * from \"./@types/read_receipts.ts\";\nexport * from \"./@types/crypto.ts\";\nexport * from \"./@types/extensible_events.ts\";\nexport * from \"./@types/IIdentityServerProvider.ts\";\nexport * from \"./@types/membership.ts\";\nexport * from \"./models/room-summary.ts\";\nexport * from \"./models/event-status.ts\";\nexport * from \"./models/profile-keys.ts\";\nexport * from \"./models/related-relations.ts\";\nexport type { RoomSummary } from \"./client.ts\";\nexport * as ContentHelpers from \"./content-helpers.ts\";\nexport * as SecretStorage from \"./secret-storage.ts\";\nexport { createNewBriijCall, CallEvent } from \"./webrtc/call.ts\";\nexport type { BriijCall } from \"./webrtc/call.ts\";\nexport {\n GroupCall,\n GroupCallEvent,\n GroupCallIntent,\n GroupCallState,\n GroupCallType,\n GroupCallStatsReportEvent,\n} from \"./webrtc/groupCall.ts\";\n\nexport { SyncState, SetPresence } from \"./sync.ts\";\nexport type { ISyncStateData as SyncStateData } from \"./sync.ts\";\nexport { SlidingSyncEvent } from \"./sliding-sync.ts\";\nexport { MediaHandlerEvent } from \"./webrtc/mediaHandler.ts\";\nexport { CallFeedEvent } from \"./webrtc/callFeed.ts\";\nexport { StatsReport } from \"./webrtc/stats/statsReport.ts\";\nexport { Relations, RelationsEvent } from \"./models/relations.ts\";\nexport { TypedEventEmitter } from \"./models/typed-event-emitter.ts\";\nexport { LocalStorageErrors, localStorageErrorsEventsEmitter } from \"./store/local-storage-events-emitter.ts\";\nexport { IdentityProviderBrand, SSOAction } from \"./@types/auth.ts\";\nexport type { ISSOFlow as SSOFlow, LoginFlow } from \"./@types/auth.ts\";\nexport type { IHierarchyRelation as HierarchyRelation, IHierarchyRoom as HierarchyRoom } from \"./@types/spaces.ts\";\nexport { LocationAssetType } from \"./@types/location.ts\";\nexport { DebugLogger } from \"./logger.ts\";\n\nlet cryptoStoreFactory = (): CryptoStore => new MemoryCryptoStore();\n\n/**\n * Configure a different factory to be used for creating crypto stores\n *\n * @param fac - a function which will return a new `CryptoStore`\n */\nexport function setCryptoStoreFactory(fac: () => CryptoStore): void {\n cryptoStoreFactory = fac;\n}\n\nfunction amendClientOpts(opts: ICreateClientOpts): ICreateClientOpts {\n opts.store =\n opts.store ??\n new MemoryStore({\n localStorage: globalThis.localStorage,\n });\n opts.scheduler = opts.scheduler ?? new BriijScheduler();\n opts.cryptoStore = opts.cryptoStore ?? cryptoStoreFactory();\n\n return opts;\n}\n\n/**\n * Construct a Briij client. Similar to {@link BriijClient}\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link BriijClient}.\n *\n * @returns A new Briij client.\n * @see {@link BriijClient} for the full list of options for\n * `opts`.\n */\nexport function createClient(opts: ICreateClientOpts): BriijClient {\n return new BriijClient(amendClientOpts(opts));\n}\n\n/**\n * Construct a Briij client that works in a widget.\n * This client has a subset of features compared to a full client.\n * It uses the widget-api to communicate with matrix. (widget \\<-\\> client \\<-\\> homeserver)\n * @returns A new Briij client with a subset of features.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link BriijClient}.\n * @param widgetApi - The widget api to use for communication.\n * @param capabilities - The capabilities the widget client will request.\n * @param roomId - The room id the widget is associated with.\n * @param sendContentLoaded - Whether to send a content loaded widget action immediately after initial setup.\n * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),\n * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.\n */\nexport function createRoomWidgetClient(\n widgetApi: WidgetApi,\n capabilities: ICapabilities,\n roomId: string,\n opts: ICreateClientOpts,\n sendContentLoaded = true,\n): BriijClient {\n return new RoomWidgetClient(widgetApi, capabilities, roomId, amendClientOpts(opts), sendContentLoaded);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,uCAAuC;AACzE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,WAAW,QAAgC,aAAa;AACjE,SAASC,gBAAgB,QAA4B,eAAe;AAGpE,cAAc,aAAa;AAC3B,cAAc,yBAAyB;AACvC,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,oBAAoB;AAClC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,4BAA4B;AAC1C,cAAc,gCAAgC;AAC9C,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,iCAAiC;AAC/C,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,aAAa;AAC3B,cAAc,sBAAsB;AACpC,cAAc,uBAAuB;AACrC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,uCAAuC;AACrD,cAAc,6CAA6C;AAC3D,cAAc,0CAA0C;AAExD,cAAc,mBAAmB;AA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@types/threepids.ts";
|
|
|
41
41
|
import { type CryptoStore } from "./crypto/store/base.ts";
|
|
42
42
|
import { GroupCall, type GroupCallIntent, type GroupCallType, type IGroupCallDataChannelOptions } from "./webrtc/groupCall.ts";
|
|
43
43
|
import { MediaHandler } from "./webrtc/mediaHandler.ts";
|
|
44
|
-
import { type ILoginFlowsResponse, type IRefreshTokenResponse, type LoginRequest, type LoginResponse, type LoginTokenPostResponse, type SSOAction } from "./@types/auth.ts";
|
|
44
|
+
import { type ILoginFlowsResponse, type IRefreshTokenResponse, type LoginRequest, type LoginResponse, type LoginTokenPostResponse, type SSOAction, type WalletE2eeRecoveryEnvelope, type WalletIdentityAccountData, type XrplAuthChallengeRequest, type XrplAuthChallengeResponse, type XrplAuthCompleteRequest, type XrplWalletChallengePayload } from "./@types/auth.ts";
|
|
45
45
|
import { TypedEventEmitter } from "./models/typed-event-emitter.ts";
|
|
46
46
|
import { ReceiptType } from "./@types/read_receipts.ts";
|
|
47
47
|
import { type MSC3575SlidingSyncRequest, type MSC3575SlidingSyncResponse, type SlidingSync } from "./sliding-sync.ts";
|
|
@@ -786,6 +786,9 @@ export declare enum ClientEvent {
|
|
|
786
786
|
*/
|
|
787
787
|
ClientWellKnown = "WellKnown.client",
|
|
788
788
|
ReceivedVoipEvent = "received_voip_event",
|
|
789
|
+
XrplVerificationRequest = "xrpl.verification.request",
|
|
790
|
+
XrplVerificationAccept = "xrpl.verification.accept",
|
|
791
|
+
XrplVerified = "xrpl.verification.verified",
|
|
789
792
|
TurnServers = "turnServers",
|
|
790
793
|
TurnServersError = "turnServers.error"
|
|
791
794
|
}
|
|
@@ -807,6 +810,9 @@ export type ClientEventHandlerMap = {
|
|
|
807
810
|
[ClientEvent.SyncUnexpectedError]: (error: Error) => void;
|
|
808
811
|
[ClientEvent.ClientWellKnown]: (data: IClientWellKnown) => void;
|
|
809
812
|
[ClientEvent.ReceivedVoipEvent]: (event: BriijEvent) => void;
|
|
813
|
+
[ClientEvent.XrplVerificationRequest]: (event: BriijEvent) => void;
|
|
814
|
+
[ClientEvent.XrplVerificationAccept]: (event: BriijEvent) => void;
|
|
815
|
+
[ClientEvent.XrplVerified]: (event: BriijEvent) => void;
|
|
810
816
|
[ClientEvent.TurnServers]: (servers: ITurnServer[]) => void;
|
|
811
817
|
[ClientEvent.TurnServersError]: (error: Error, fatal: boolean) => void;
|
|
812
818
|
} & RoomEventHandlerMap & RoomStateEventHandlerMap & CryptoEventHandlerMap & BriijEventHandlerMap & RoomMemberEventHandlerMap & UserEventHandlerMap & CallEventHandlerEventHandlerMap & GroupCallEventHandlerEventHandlerMap & CallEventHandlerMap & HttpApiEventHandlerMap & BeaconEventHandlerMap;
|
|
@@ -925,6 +931,7 @@ export declare class BriijClient extends TypedEventEmitter<EmittedEvents, Client
|
|
|
925
931
|
constructor(opts: IBriijClientCreateOpts);
|
|
926
932
|
set store(newStore: Store);
|
|
927
933
|
get store(): Store;
|
|
934
|
+
private readonly dispatchXrplVerificationEvents;
|
|
928
935
|
/**
|
|
929
936
|
* High level helper method to begin syncing and poll for new events. To listen for these
|
|
930
937
|
* events, add a listener for {@link ClientEvent.Event}
|
|
@@ -2476,6 +2483,46 @@ export declare class BriijClient extends TypedEventEmitter<EmittedEvents, Client
|
|
|
2476
2483
|
* `BriijClient` instance using the results. See https://github.com/matrix-org/briij-js-sdk/issues/4502.
|
|
2477
2484
|
*/
|
|
2478
2485
|
loginWithPassword(user: string, password: string): Promise<LoginResponse>;
|
|
2486
|
+
/**
|
|
2487
|
+
* Request an XRPL login challenge from the homeserver.
|
|
2488
|
+
*
|
|
2489
|
+
* The briij homeserver responds with HTTP 401 as the successful challenge
|
|
2490
|
+
* response, so this helper normalizes that into a resolved promise.
|
|
2491
|
+
*/
|
|
2492
|
+
getXrplAuthChallenge(request: Omit<XrplAuthChallengeRequest, "type">): Promise<XrplAuthChallengeResponse>;
|
|
2493
|
+
/**
|
|
2494
|
+
* Complete XRPL login using the previously issued challenge session.
|
|
2495
|
+
*
|
|
2496
|
+
* @returns Promise which resolves to a LoginResponse object.
|
|
2497
|
+
* @returns Rejects: with an error response.
|
|
2498
|
+
*/
|
|
2499
|
+
completeXrplAuth(request: Omit<XrplAuthCompleteRequest, "type">): Promise<LoginResponse>;
|
|
2500
|
+
/**
|
|
2501
|
+
* Store a chain-agnostic wallet recovery envelope in account data.
|
|
2502
|
+
*
|
|
2503
|
+
* This uses a stable account-data type and does not affect core E2EE state.
|
|
2504
|
+
*
|
|
2505
|
+
* @param envelope - Wallet recovery envelope payload.
|
|
2506
|
+
*/
|
|
2507
|
+
setWalletRecoveryEnvelope(envelope: WalletE2eeRecoveryEnvelope): Promise<EmptyObject>;
|
|
2508
|
+
/**
|
|
2509
|
+
* Fetch wallet recovery envelope directly from the homeserver.
|
|
2510
|
+
*
|
|
2511
|
+
* @returns The stored envelope, or null if not found.
|
|
2512
|
+
*/
|
|
2513
|
+
getWalletRecoveryEnvelopeFromServer(): Promise<WalletE2eeRecoveryEnvelope | null>;
|
|
2514
|
+
/**
|
|
2515
|
+
* Fetch canonical wallet identity metadata from the homeserver.
|
|
2516
|
+
*
|
|
2517
|
+
* @returns Wallet identity metadata, or null if not found.
|
|
2518
|
+
*/
|
|
2519
|
+
getWalletIdentityFromServer(): Promise<WalletIdentityAccountData | null>;
|
|
2520
|
+
/**
|
|
2521
|
+
* @deprecated Use `getXrplAuthChallenge` + `completeXrplAuth` for explicit
|
|
2522
|
+
* two-step XRPL login flow. This wrapper now expects `challenge` to include
|
|
2523
|
+
* the `session` and optional `public_key`.
|
|
2524
|
+
*/
|
|
2525
|
+
loginWithXrplWallet(user: string, walletAddress: string, signature: string, challenge: string | XrplWalletChallengePayload, network?: string): Promise<LoginResponse>;
|
|
2479
2526
|
/**
|
|
2480
2527
|
* @param redirectUrl - The URL to redirect to after the HS
|
|
2481
2528
|
* authenticates with CAS.
|