@jeongsu816/matrix-bot-sdk 0.0.0-stage → 0.8.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.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/lib/AdminApis.d.ts +52 -0
- package/lib/AdminApis.js +29 -0
- package/lib/AdminApis.js.map +1 -0
- package/lib/DMs.d.ts +48 -0
- package/lib/DMs.js +160 -0
- package/lib/DMs.js.map +1 -0
- package/lib/IFilter.d.ts +7 -0
- package/lib/IFilter.js +3 -0
- package/lib/IFilter.js.map +1 -0
- package/lib/MatrixAuth.d.ts +45 -0
- package/lib/MatrixAuth.js +125 -0
- package/lib/MatrixAuth.js.map +1 -0
- package/lib/MatrixClient.d.ts +834 -0
- package/lib/MatrixClient.js +2268 -0
- package/lib/MatrixClient.js.map +1 -0
- package/lib/PantalaimonClient.d.ts +42 -0
- package/lib/PantalaimonClient.js +44 -0
- package/lib/PantalaimonClient.js.map +1 -0
- package/lib/SynapseAdminApis.d.ts +350 -0
- package/lib/SynapseAdminApis.js +244 -0
- package/lib/SynapseAdminApis.js.map +1 -0
- package/lib/SynchronousMatrixClient.d.ts +82 -0
- package/lib/SynchronousMatrixClient.js +130 -0
- package/lib/SynchronousMatrixClient.js.map +1 -0
- package/lib/UnstableApis.d.ts +43 -0
- package/lib/UnstableApis.js +74 -0
- package/lib/UnstableApis.js.map +1 -0
- package/lib/appservice/Appservice.d.ts +328 -0
- package/lib/appservice/Appservice.js +803 -0
- package/lib/appservice/Appservice.js.map +1 -0
- package/lib/appservice/Intent.d.ts +113 -0
- package/lib/appservice/Intent.js +363 -0
- package/lib/appservice/Intent.js.map +1 -0
- package/lib/appservice/MatrixBridge.d.ts +85 -0
- package/lib/appservice/MatrixBridge.js +111 -0
- package/lib/appservice/MatrixBridge.js.map +1 -0
- package/lib/appservice/UnstableAppserviceApis.d.ts +41 -0
- package/lib/appservice/UnstableAppserviceApis.js +62 -0
- package/lib/appservice/UnstableAppserviceApis.js.map +1 -0
- package/lib/appservice/http_responses.d.ts +77 -0
- package/lib/appservice/http_responses.js +3 -0
- package/lib/appservice/http_responses.js.map +1 -0
- package/lib/b64.d.ts +42 -0
- package/lib/b64.js +68 -0
- package/lib/b64.js.map +1 -0
- package/lib/e2ee/CrossSigningBootstrap.d.ts +73 -0
- package/lib/e2ee/CrossSigningBootstrap.js +86 -0
- package/lib/e2ee/CrossSigningBootstrap.js.map +1 -0
- package/lib/e2ee/CryptoClient.d.ts +163 -0
- package/lib/e2ee/CryptoClient.js +382 -0
- package/lib/e2ee/CryptoClient.js.map +1 -0
- package/lib/e2ee/ICryptoRoomInformation.d.ts +8 -0
- package/lib/e2ee/ICryptoRoomInformation.js +3 -0
- package/lib/e2ee/ICryptoRoomInformation.js.map +1 -0
- package/lib/e2ee/RoomTracker.d.ts +41 -0
- package/lib/e2ee/RoomTracker.js +96 -0
- package/lib/e2ee/RoomTracker.js.map +1 -0
- package/lib/e2ee/RustEngine.d.ts +149 -0
- package/lib/e2ee/RustEngine.js +467 -0
- package/lib/e2ee/RustEngine.js.map +1 -0
- package/lib/e2ee/decorators.d.ts +10 -0
- package/lib/e2ee/decorators.js +37 -0
- package/lib/e2ee/decorators.js.map +1 -0
- package/lib/helpers/MatrixEntity.d.ts +37 -0
- package/lib/helpers/MatrixEntity.js +67 -0
- package/lib/helpers/MatrixEntity.js.map +1 -0
- package/lib/helpers/MatrixGlob.d.ts +22 -0
- package/lib/helpers/MatrixGlob.js +35 -0
- package/lib/helpers/MatrixGlob.js.map +1 -0
- package/lib/helpers/MentionPill.d.ts +40 -0
- package/lib/helpers/MentionPill.js +91 -0
- package/lib/helpers/MentionPill.js.map +1 -0
- package/lib/helpers/Permalinks.d.ts +58 -0
- package/lib/helpers/Permalinks.js +73 -0
- package/lib/helpers/Permalinks.js.map +1 -0
- package/lib/helpers/ProfileCache.d.ts +48 -0
- package/lib/helpers/ProfileCache.js +114 -0
- package/lib/helpers/ProfileCache.js.map +1 -0
- package/lib/helpers/RichReply.d.ts +17 -0
- package/lib/helpers/RichReply.js +47 -0
- package/lib/helpers/RichReply.js.map +1 -0
- package/lib/helpers/UnpaddedBase64.d.ts +31 -0
- package/lib/helpers/UnpaddedBase64.js +45 -0
- package/lib/helpers/UnpaddedBase64.js.map +1 -0
- package/lib/http.d.ts +17 -0
- package/lib/http.js +147 -0
- package/lib/http.js.map +1 -0
- package/lib/identity/IdentityClient.d.ts +93 -0
- package/lib/identity/IdentityClient.js +248 -0
- package/lib/identity/IdentityClient.js.map +1 -0
- package/lib/index.d.ts +91 -0
- package/lib/index.js +125 -0
- package/lib/index.js.map +1 -0
- package/lib/logging/ConsoleLogger.d.ts +12 -0
- package/lib/logging/ConsoleLogger.js +28 -0
- package/lib/logging/ConsoleLogger.js.map +1 -0
- package/lib/logging/ILogger.d.ts +36 -0
- package/lib/logging/ILogger.js +3 -0
- package/lib/logging/ILogger.js.map +1 -0
- package/lib/logging/LogService.d.ts +100 -0
- package/lib/logging/LogService.js +169 -0
- package/lib/logging/LogService.js.map +1 -0
- package/lib/logging/RichConsoleLogger.d.ts +20 -0
- package/lib/logging/RichConsoleLogger.js +41 -0
- package/lib/logging/RichConsoleLogger.js.map +1 -0
- package/lib/metrics/IMetricListener.d.ts +52 -0
- package/lib/metrics/IMetricListener.js +3 -0
- package/lib/metrics/IMetricListener.js.map +1 -0
- package/lib/metrics/Metrics.d.ts +66 -0
- package/lib/metrics/Metrics.js +128 -0
- package/lib/metrics/Metrics.js.map +1 -0
- package/lib/metrics/contexts.d.ts +51 -0
- package/lib/metrics/contexts.js +3 -0
- package/lib/metrics/contexts.js.map +1 -0
- package/lib/metrics/decorators.d.ts +15 -0
- package/lib/metrics/decorators.js +92 -0
- package/lib/metrics/decorators.js.map +1 -0
- package/lib/metrics/names.d.ts +45 -0
- package/lib/metrics/names.js +49 -0
- package/lib/metrics/names.js.map +1 -0
- package/lib/mixins/AutojoinRoomsMixin.d.ts +10 -0
- package/lib/mixins/AutojoinRoomsMixin.js +25 -0
- package/lib/mixins/AutojoinRoomsMixin.js.map +1 -0
- package/lib/mixins/AutojoinUpgradedRoomsMixin.d.ts +10 -0
- package/lib/mixins/AutojoinUpgradedRoomsMixin.js +40 -0
- package/lib/mixins/AutojoinUpgradedRoomsMixin.js.map +1 -0
- package/lib/models/Account.d.ts +8 -0
- package/lib/models/Account.js +3 -0
- package/lib/models/Account.js.map +1 -0
- package/lib/models/CreateRoom.d.ts +125 -0
- package/lib/models/CreateRoom.js +3 -0
- package/lib/models/CreateRoom.js.map +1 -0
- package/lib/models/Crypto.d.ts +167 -0
- package/lib/models/Crypto.js +31 -0
- package/lib/models/Crypto.js.map +1 -0
- package/lib/models/EventContext.d.ts +19 -0
- package/lib/models/EventContext.js +3 -0
- package/lib/models/EventContext.js.map +1 -0
- package/lib/models/IdentityServerModels.d.ts +20 -0
- package/lib/models/IdentityServerModels.js +3 -0
- package/lib/models/IdentityServerModels.js.map +1 -0
- package/lib/models/MSC2176.d.ts +42 -0
- package/lib/models/MSC2176.js +3 -0
- package/lib/models/MSC2176.js.map +1 -0
- package/lib/models/MatrixError.d.ts +38 -0
- package/lib/models/MatrixError.js +30 -0
- package/lib/models/MatrixError.js.map +1 -0
- package/lib/models/MatrixProfile.d.ts +43 -0
- package/lib/models/MatrixProfile.js +43 -0
- package/lib/models/MatrixProfile.js.map +1 -0
- package/lib/models/OpenIDConnect.d.ts +10 -0
- package/lib/models/OpenIDConnect.js +3 -0
- package/lib/models/OpenIDConnect.js.map +1 -0
- package/lib/models/Policies.d.ts +25 -0
- package/lib/models/Policies.js +3 -0
- package/lib/models/Policies.js.map +1 -0
- package/lib/models/PowerLevelAction.d.ts +27 -0
- package/lib/models/PowerLevelAction.js +32 -0
- package/lib/models/PowerLevelAction.js.map +1 -0
- package/lib/models/PowerLevelBounds.d.ts +15 -0
- package/lib/models/PowerLevelBounds.js +3 -0
- package/lib/models/PowerLevelBounds.js.map +1 -0
- package/lib/models/Presence.d.ts +25 -0
- package/lib/models/Presence.js +38 -0
- package/lib/models/Presence.js.map +1 -0
- package/lib/models/ServerVersions.d.ts +8 -0
- package/lib/models/ServerVersions.js +3 -0
- package/lib/models/ServerVersions.js.map +1 -0
- package/lib/models/Spaces.d.ts +116 -0
- package/lib/models/Spaces.js +91 -0
- package/lib/models/Spaces.js.map +1 -0
- package/lib/models/Threepid.d.ts +8 -0
- package/lib/models/Threepid.js +3 -0
- package/lib/models/Threepid.js.map +1 -0
- package/lib/models/events/AliasesEvent.d.ts +27 -0
- package/lib/models/events/AliasesEvent.js +27 -0
- package/lib/models/events/AliasesEvent.js.map +1 -0
- package/lib/models/events/CanonicalAliasEvent.d.ts +23 -0
- package/lib/models/events/CanonicalAliasEvent.js +21 -0
- package/lib/models/events/CanonicalAliasEvent.js.map +1 -0
- package/lib/models/events/CreateEvent.d.ts +63 -0
- package/lib/models/events/CreateEvent.js +33 -0
- package/lib/models/events/CreateEvent.js.map +1 -0
- package/lib/models/events/EncryptedRoomEvent.d.ts +42 -0
- package/lib/models/events/EncryptedRoomEvent.js +28 -0
- package/lib/models/events/EncryptedRoomEvent.js.map +1 -0
- package/lib/models/events/EncryptionEvent.d.ts +47 -0
- package/lib/models/events/EncryptionEvent.js +42 -0
- package/lib/models/events/EncryptionEvent.js.map +1 -0
- package/lib/models/events/Event.d.ts +26 -0
- package/lib/models/events/Event.js +40 -0
- package/lib/models/events/Event.js.map +1 -0
- package/lib/models/events/EventKind.d.ts +15 -0
- package/lib/models/events/EventKind.js +20 -0
- package/lib/models/events/EventKind.js.map +1 -0
- package/lib/models/events/InvalidEventError.d.ts +14 -0
- package/lib/models/events/InvalidEventError.js +24 -0
- package/lib/models/events/InvalidEventError.js.map +1 -0
- package/lib/models/events/JoinRulesEvent.d.ts +29 -0
- package/lib/models/events/JoinRulesEvent.js +21 -0
- package/lib/models/events/JoinRulesEvent.js.map +1 -0
- package/lib/models/events/MembershipEvent.d.ts +54 -0
- package/lib/models/events/MembershipEvent.js +49 -0
- package/lib/models/events/MembershipEvent.js.map +1 -0
- package/lib/models/events/MessageEvent.d.ts +233 -0
- package/lib/models/events/MessageEvent.js +49 -0
- package/lib/models/events/MessageEvent.js.map +1 -0
- package/lib/models/events/PinnedEventsEvent.d.ts +23 -0
- package/lib/models/events/PinnedEventsEvent.js +21 -0
- package/lib/models/events/PinnedEventsEvent.js.map +1 -0
- package/lib/models/events/PowerLevelsEvent.d.ts +96 -0
- package/lib/models/events/PowerLevelsEvent.js +70 -0
- package/lib/models/events/PowerLevelsEvent.js.map +1 -0
- package/lib/models/events/PresenceEvent.d.ts +56 -0
- package/lib/models/events/PresenceEvent.js +21 -0
- package/lib/models/events/PresenceEvent.js.map +1 -0
- package/lib/models/events/RedactionEvent.d.ts +28 -0
- package/lib/models/events/RedactionEvent.js +36 -0
- package/lib/models/events/RedactionEvent.js.map +1 -0
- package/lib/models/events/RoomAvatarEvent.d.ts +28 -0
- package/lib/models/events/RoomAvatarEvent.js +21 -0
- package/lib/models/events/RoomAvatarEvent.js.map +1 -0
- package/lib/models/events/RoomEvent.d.ts +58 -0
- package/lib/models/events/RoomEvent.js +57 -0
- package/lib/models/events/RoomEvent.js.map +1 -0
- package/lib/models/events/RoomNameEvent.d.ts +20 -0
- package/lib/models/events/RoomNameEvent.js +21 -0
- package/lib/models/events/RoomNameEvent.js.map +1 -0
- package/lib/models/events/RoomTopicEvent.d.ts +20 -0
- package/lib/models/events/RoomTopicEvent.js +21 -0
- package/lib/models/events/RoomTopicEvent.js.map +1 -0
- package/lib/models/events/SpaceChildEvent.d.ts +53 -0
- package/lib/models/events/SpaceChildEvent.js +49 -0
- package/lib/models/events/SpaceChildEvent.js.map +1 -0
- package/lib/models/events/converter.d.ts +8 -0
- package/lib/models/events/converter.js +50 -0
- package/lib/models/events/converter.js.map +1 -0
- package/lib/models/unstable/MediaInfo.d.ts +16 -0
- package/lib/models/unstable/MediaInfo.js +3 -0
- package/lib/models/unstable/MediaInfo.js.map +1 -0
- package/lib/preprocessors/IPreprocessor.d.ts +22 -0
- package/lib/preprocessors/IPreprocessor.js +3 -0
- package/lib/preprocessors/IPreprocessor.js.map +1 -0
- package/lib/preprocessors/RichRepliesPreprocessor.d.ts +67 -0
- package/lib/preprocessors/RichRepliesPreprocessor.js +112 -0
- package/lib/preprocessors/RichRepliesPreprocessor.js.map +1 -0
- package/lib/request.d.ts +13 -0
- package/lib/request.js +23 -0
- package/lib/request.js.map +1 -0
- package/lib/simple-validation.d.ts +10 -0
- package/lib/simple-validation.js +30 -0
- package/lib/simple-validation.js.map +1 -0
- package/lib/storage/IAppserviceStorageProvider.d.ts +48 -0
- package/lib/storage/IAppserviceStorageProvider.js +3 -0
- package/lib/storage/IAppserviceStorageProvider.js.map +1 -0
- package/lib/storage/ICryptoStorageProvider.d.ts +32 -0
- package/lib/storage/ICryptoStorageProvider.js +3 -0
- package/lib/storage/ICryptoStorageProvider.js.map +1 -0
- package/lib/storage/IStorageProvider.d.ts +47 -0
- package/lib/storage/IStorageProvider.js +3 -0
- package/lib/storage/IStorageProvider.js.map +1 -0
- package/lib/storage/MemoryStorageProvider.d.ts +26 -0
- package/lib/storage/MemoryStorageProvider.js +55 -0
- package/lib/storage/MemoryStorageProvider.js.map +1 -0
- package/lib/storage/RustSdkCryptoStorageProvider.d.ts +38 -0
- package/lib/storage/RustSdkCryptoStorageProvider.js +69 -0
- package/lib/storage/RustSdkCryptoStorageProvider.js.map +1 -0
- package/lib/storage/SimpleFsStorageProvider.d.ts +31 -0
- package/lib/storage/SimpleFsStorageProvider.js +122 -0
- package/lib/storage/SimpleFsStorageProvider.js.map +1 -0
- package/lib/storage/SimplePostgresStorageProvider.d.ts +32 -0
- package/lib/storage/SimplePostgresStorageProvider.js +148 -0
- package/lib/storage/SimplePostgresStorageProvider.js.map +1 -0
- package/lib/strategies/AppserviceJoinRoomStrategy.d.ts +14 -0
- package/lib/strategies/AppserviceJoinRoomStrategy.js +54 -0
- package/lib/strategies/AppserviceJoinRoomStrategy.js.map +1 -0
- package/lib/strategies/JoinRoomStrategy.d.ts +11 -0
- package/lib/strategies/JoinRoomStrategy.js +44 -0
- package/lib/strategies/JoinRoomStrategy.js.map +1 -0
- package/package.json +136 -4
- package/src/AdminApis.ts +60 -0
- package/src/DMs.ts +164 -0
- package/src/IFilter.ts +7 -0
- package/src/MatrixAuth.ts +129 -0
- package/src/MatrixClient.ts +2046 -0
- package/src/PantalaimonClient.ts +62 -0
- package/src/SynapseAdminApis.ts +482 -0
- package/src/SynchronousMatrixClient.ts +129 -0
- package/src/UnstableApis.ts +75 -0
- package/src/appservice/Appservice.ts +1089 -0
- package/src/appservice/Intent.ts +342 -0
- package/src/appservice/MatrixBridge.ts +139 -0
- package/src/appservice/UnstableAppserviceApis.ts +63 -0
- package/src/appservice/http_responses.ts +77 -0
- package/src/b64.ts +63 -0
- package/src/e2ee/CrossSigningBootstrap.ts +141 -0
- package/src/e2ee/CryptoClient.ts +378 -0
- package/src/e2ee/ICryptoRoomInformation.ts +9 -0
- package/src/e2ee/RoomTracker.ts +99 -0
- package/src/e2ee/RustEngine.ts +580 -0
- package/src/e2ee/decorators.ts +38 -0
- package/src/helpers/MatrixEntity.ts +65 -0
- package/src/helpers/MatrixGlob.ts +38 -0
- package/src/helpers/MentionPill.ts +95 -0
- package/src/helpers/Permalinks.ts +101 -0
- package/src/helpers/ProfileCache.ts +119 -0
- package/src/helpers/RichReply.ts +46 -0
- package/src/helpers/UnpaddedBase64.ts +44 -0
- package/src/http.ts +166 -0
- package/src/identity/IdentityClient.ts +225 -0
- package/src/index.ts +125 -0
- package/src/logging/ConsoleLogger.ts +31 -0
- package/src/logging/ILogger.ts +40 -0
- package/src/logging/LogService.ts +167 -0
- package/src/logging/RichConsoleLogger.ts +70 -0
- package/src/metrics/IMetricListener.ts +57 -0
- package/src/metrics/Metrics.ts +134 -0
- package/src/metrics/contexts.ts +56 -0
- package/src/metrics/decorators.ts +94 -0
- package/src/metrics/names.ts +53 -0
- package/src/mixins/AutojoinRoomsMixin.ts +24 -0
- package/src/mixins/AutojoinUpgradedRoomsMixin.ts +37 -0
- package/src/models/Account.ts +8 -0
- package/src/models/CreateRoom.ts +144 -0
- package/src/models/Crypto.ts +188 -0
- package/src/models/EventContext.ts +23 -0
- package/src/models/IdentityServerModels.ts +18 -0
- package/src/models/MSC2176.ts +47 -0
- package/src/models/MatrixError.ts +39 -0
- package/src/models/MatrixProfile.ts +55 -0
- package/src/models/OpenIDConnect.ts +10 -0
- package/src/models/Policies.ts +28 -0
- package/src/models/PowerLevelAction.ts +31 -0
- package/src/models/PowerLevelBounds.ts +16 -0
- package/src/models/Presence.ts +38 -0
- package/src/models/ServerVersions.ts +8 -0
- package/src/models/Spaces.ts +167 -0
- package/src/models/Threepid.ts +8 -0
- package/src/models/events/AliasesEvent.ts +37 -0
- package/src/models/events/CanonicalAliasEvent.ts +30 -0
- package/src/models/events/CreateEvent.ts +82 -0
- package/src/models/events/EncryptedRoomEvent.ts +58 -0
- package/src/models/events/EncryptionEvent.ts +63 -0
- package/src/models/events/Event.ts +38 -0
- package/src/models/events/EventKind.ts +16 -0
- package/src/models/events/InvalidEventError.ts +19 -0
- package/src/models/events/JoinRulesEvent.ts +37 -0
- package/src/models/events/MembershipEvent.ts +77 -0
- package/src/models/events/MessageEvent.ts +292 -0
- package/src/models/events/PinnedEventsEvent.ts +30 -0
- package/src/models/events/PowerLevelsEvent.ts +135 -0
- package/src/models/events/PresenceEvent.ts +69 -0
- package/src/models/events/RedactionEvent.ts +44 -0
- package/src/models/events/RoomAvatarEvent.ts +36 -0
- package/src/models/events/RoomEvent.ts +83 -0
- package/src/models/events/RoomNameEvent.ts +27 -0
- package/src/models/events/RoomTopicEvent.ts +27 -0
- package/src/models/events/SpaceChildEvent.ts +74 -0
- package/src/models/events/_MissingEvents.md +35 -0
- package/src/models/events/converter.ts +47 -0
- package/src/models/unstable/MediaInfo.ts +16 -0
- package/src/preprocessors/IPreprocessor.ts +24 -0
- package/src/preprocessors/RichRepliesPreprocessor.ts +159 -0
- package/src/request.ts +21 -0
- package/src/simple-validation.ts +30 -0
- package/src/storage/IAppserviceStorageProvider.ts +54 -0
- package/src/storage/ICryptoStorageProvider.ts +36 -0
- package/src/storage/IStorageProvider.ts +53 -0
- package/src/storage/MemoryStorageProvider.ts +65 -0
- package/src/storage/RustSdkCryptoStorageProvider.ts +81 -0
- package/src/storage/SimpleFsStorageProvider.ts +142 -0
- package/src/storage/SimplePostgresStorageProvider.ts +168 -0
- package/src/strategies/AppserviceJoinRoomStrategy.ts +47 -0
- package/src/strategies/JoinRoomStrategy.ts +45 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions that can be guarded by power levels.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum PowerLevelAction {
|
|
5
|
+
/**
|
|
6
|
+
* Power level required to ban other users.
|
|
7
|
+
*/
|
|
8
|
+
Ban = "ban",
|
|
9
|
+
/**
|
|
10
|
+
* Power level required to kick other users.
|
|
11
|
+
*/
|
|
12
|
+
Kick = "kick",
|
|
13
|
+
/**
|
|
14
|
+
* Power level required to redact events sent by other users. Users can redact
|
|
15
|
+
* their own messages regardless of this power level requirement, unless forbidden
|
|
16
|
+
* by the `events` section of the power levels content.
|
|
17
|
+
*/
|
|
18
|
+
RedactEvents = "redact",
|
|
19
|
+
/**
|
|
20
|
+
* Power level required to invite other users.
|
|
21
|
+
*/
|
|
22
|
+
Invite = "invite",
|
|
23
|
+
/**
|
|
24
|
+
* Power level required to notify the whole room with "@room".
|
|
25
|
+
*/
|
|
26
|
+
NotifyRoom = "notifications.room"
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PowerLevelAction = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Actions that can be guarded by power levels.
|
|
6
|
+
*/
|
|
7
|
+
var PowerLevelAction;
|
|
8
|
+
(function (PowerLevelAction) {
|
|
9
|
+
/**
|
|
10
|
+
* Power level required to ban other users.
|
|
11
|
+
*/
|
|
12
|
+
PowerLevelAction["Ban"] = "ban";
|
|
13
|
+
/**
|
|
14
|
+
* Power level required to kick other users.
|
|
15
|
+
*/
|
|
16
|
+
PowerLevelAction["Kick"] = "kick";
|
|
17
|
+
/**
|
|
18
|
+
* Power level required to redact events sent by other users. Users can redact
|
|
19
|
+
* their own messages regardless of this power level requirement, unless forbidden
|
|
20
|
+
* by the `events` section of the power levels content.
|
|
21
|
+
*/
|
|
22
|
+
PowerLevelAction["RedactEvents"] = "redact";
|
|
23
|
+
/**
|
|
24
|
+
* Power level required to invite other users.
|
|
25
|
+
*/
|
|
26
|
+
PowerLevelAction["Invite"] = "invite";
|
|
27
|
+
/**
|
|
28
|
+
* Power level required to notify the whole room with "@room".
|
|
29
|
+
*/
|
|
30
|
+
PowerLevelAction["NotifyRoom"] = "notifications.room";
|
|
31
|
+
})(PowerLevelAction || (exports.PowerLevelAction = PowerLevelAction = {}));
|
|
32
|
+
//# sourceMappingURL=PowerLevelAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerLevelAction.js","sourceRoot":"","sources":["../../src/models/PowerLevelAction.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,gBA2BX;AA3BD,WAAY,gBAAgB;IACxB;;OAEG;IACH,+BAAW,CAAA;IAEX;;OAEG;IACH,iCAAa,CAAA;IAEb;;;;OAIG;IACH,2CAAuB,CAAA;IAEvB;;OAEG;IACH,qCAAiB,CAAA;IAEjB;;OAEG;IACH,qDAAiC,CAAA;AACrC,CAAC,EA3BW,gBAAgB,gCAAhB,gBAAgB,QA2B3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Information on the bounds of a power level change a user can apply.
|
|
3
|
+
*/
|
|
4
|
+
export interface PowerLevelBounds {
|
|
5
|
+
/**
|
|
6
|
+
* Whether or not the user can even modify the power level of the user. This
|
|
7
|
+
* will be false if the user can't send power level events, or the user is
|
|
8
|
+
* unobtainably high in power.
|
|
9
|
+
*/
|
|
10
|
+
canModify: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The maximum possible power level the user can set on the target user.
|
|
13
|
+
*/
|
|
14
|
+
maximumPossibleLevel: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerLevelBounds.js","sourceRoot":"","sources":["../../src/models/PowerLevelBounds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PresenceEventContent, PresenceState } from "./events/PresenceEvent";
|
|
2
|
+
/**
|
|
3
|
+
* Presence information for a user.
|
|
4
|
+
* @category Models
|
|
5
|
+
*/
|
|
6
|
+
export declare class Presence {
|
|
7
|
+
protected presence: PresenceEventContent;
|
|
8
|
+
constructor(presence: PresenceEventContent);
|
|
9
|
+
/**
|
|
10
|
+
* The state for this presence update.
|
|
11
|
+
*/
|
|
12
|
+
get state(): PresenceState;
|
|
13
|
+
/**
|
|
14
|
+
* The status message which accompanies this presence. May be falsey.
|
|
15
|
+
*/
|
|
16
|
+
get statusMessage(): string;
|
|
17
|
+
/**
|
|
18
|
+
* How long ago in milliseconds this presence was changed. May be falsey.
|
|
19
|
+
*/
|
|
20
|
+
get lastActiveAgo(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Whether or not the user is currently active.
|
|
23
|
+
*/
|
|
24
|
+
get currentlyActive(): boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Presence = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Presence information for a user.
|
|
6
|
+
* @category Models
|
|
7
|
+
*/
|
|
8
|
+
class Presence {
|
|
9
|
+
constructor(presence) {
|
|
10
|
+
this.presence = presence;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The state for this presence update.
|
|
14
|
+
*/
|
|
15
|
+
get state() {
|
|
16
|
+
return this.presence.presence;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The status message which accompanies this presence. May be falsey.
|
|
20
|
+
*/
|
|
21
|
+
get statusMessage() {
|
|
22
|
+
return this.presence.status_msg;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* How long ago in milliseconds this presence was changed. May be falsey.
|
|
26
|
+
*/
|
|
27
|
+
get lastActiveAgo() {
|
|
28
|
+
return this.presence.last_active_ago;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether or not the user is currently active.
|
|
32
|
+
*/
|
|
33
|
+
get currentlyActive() {
|
|
34
|
+
return this.presence.currently_active;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Presence = Presence;
|
|
38
|
+
//# sourceMappingURL=Presence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Presence.js","sourceRoot":"","sources":["../../src/models/Presence.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,QAAQ;IACjB,YAAsB,QAA8B;QAA9B,aAAQ,GAAR,QAAQ,CAAsB;IACpD,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC1C,CAAC;CACJ;AA/BD,4BA+BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVersions.js","sourceRoot":"","sources":["../../src/models/ServerVersions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { MatrixClient } from "../MatrixClient";
|
|
2
|
+
import { SpaceChildEvent } from "./events/SpaceChildEvent";
|
|
3
|
+
/**
|
|
4
|
+
* Options to be specified when creating a Space.
|
|
5
|
+
* @category Models
|
|
6
|
+
*/
|
|
7
|
+
export interface SpaceCreateOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the space.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The topic/description for the space.
|
|
14
|
+
*/
|
|
15
|
+
topic?: string;
|
|
16
|
+
/**
|
|
17
|
+
* An MXC URI for the space's avatar.
|
|
18
|
+
*/
|
|
19
|
+
avatarUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether or not the space should be publicly joinable or not.
|
|
22
|
+
*/
|
|
23
|
+
isPublic: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Optional localpart for the alias of the space.
|
|
26
|
+
*/
|
|
27
|
+
localpart?: string;
|
|
28
|
+
/**
|
|
29
|
+
* User IDs to invite to the space upon creation.
|
|
30
|
+
*/
|
|
31
|
+
invites?: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Options for displaying/handling a child room/space.
|
|
35
|
+
* @category Models
|
|
36
|
+
*/
|
|
37
|
+
export interface SpaceChildEntityOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Whether or not the entity is intended to be a suggested entity.
|
|
40
|
+
*/
|
|
41
|
+
suggested?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Servers to try and join through. When not provided, the SDK will try to
|
|
44
|
+
* determine a set.
|
|
45
|
+
*/
|
|
46
|
+
via?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* A short string to differentiate the rendering order of entities.
|
|
49
|
+
* @see validateSpaceOrderString
|
|
50
|
+
*/
|
|
51
|
+
order?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options for creating a new child space or room.
|
|
55
|
+
* @category Models
|
|
56
|
+
*/
|
|
57
|
+
export type NewChildOpts = SpaceCreateOptions & SpaceChildEntityOptions;
|
|
58
|
+
/**
|
|
59
|
+
* A mapping of room ID to space child information.
|
|
60
|
+
* @category Models
|
|
61
|
+
*/
|
|
62
|
+
export interface SpaceEntityMap {
|
|
63
|
+
[roomId: string]: SpaceChildEvent;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* An instance representing a Matrix Space. A space is tied to a room.
|
|
67
|
+
* @category Models
|
|
68
|
+
*/
|
|
69
|
+
export declare class Space {
|
|
70
|
+
readonly roomId: string;
|
|
71
|
+
readonly client: MatrixClient;
|
|
72
|
+
constructor(roomId: string, client: MatrixClient);
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new child space under this space.
|
|
75
|
+
* @param {SpaceCreateOptions} opts The options for the new space.
|
|
76
|
+
* @returns {Promise<Space>} Resolves to the created space.
|
|
77
|
+
*/
|
|
78
|
+
createChildSpace(opts: NewChildOpts): Promise<Space>;
|
|
79
|
+
/**
|
|
80
|
+
* Adds a child space to the space. Must be joined to both spaces.
|
|
81
|
+
* @param {Space} space The space to add.
|
|
82
|
+
* @param {SpaceChildEntityOptions} childOpts Related options for the child's representation.
|
|
83
|
+
* @returns {Promise<Space>} Resolves when complete.
|
|
84
|
+
*/
|
|
85
|
+
addChildSpace(space: Space, childOpts?: SpaceChildEntityOptions): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Removes a child space from the space. Must be joined to the current space (not needed for child space).
|
|
88
|
+
* @param {Space} space The space to remove.
|
|
89
|
+
* @returns {Promise<void>} Resolves when complete.
|
|
90
|
+
*/
|
|
91
|
+
removeChildSpace(space: Space): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Adds a child room to the space. Must be joined to both the room and the space.
|
|
94
|
+
* @param {string} roomId The room ID to add.
|
|
95
|
+
* @param {SpaceChildEntityOptions} childOpts Additional options for the child space.
|
|
96
|
+
* @returns {Promise<void>} Resolves when complete.
|
|
97
|
+
*/
|
|
98
|
+
addChildRoom(roomId: string, childOpts?: SpaceChildEntityOptions): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Removes a child room from the space. Must be joined to the current space (not needed for child room).
|
|
101
|
+
* @param {string} roomId The room ID to remove.
|
|
102
|
+
* @returns {Promise<void>} Resolves when complete.
|
|
103
|
+
*/
|
|
104
|
+
removeChildRoom(roomId: string): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Gets all the child rooms on the space. These may be spaces or other rooms.
|
|
107
|
+
* @returns {Promise<SpaceEntityMap>} Resolves to a map of children for this space.
|
|
108
|
+
*/
|
|
109
|
+
getChildEntities(): Promise<SpaceEntityMap>;
|
|
110
|
+
/**
|
|
111
|
+
* Invite a user to the current space.
|
|
112
|
+
* @param {string} userId The user ID to invite.
|
|
113
|
+
* @returns {Promise<void>} Resolves when completed.
|
|
114
|
+
*/
|
|
115
|
+
inviteUser(userId: string): Promise<any>;
|
|
116
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Space = void 0;
|
|
4
|
+
const MatrixEntity_1 = require("../helpers/MatrixEntity");
|
|
5
|
+
const simple_validation_1 = require("../simple-validation");
|
|
6
|
+
const SpaceChildEvent_1 = require("./events/SpaceChildEvent");
|
|
7
|
+
/**
|
|
8
|
+
* An instance representing a Matrix Space. A space is tied to a room.
|
|
9
|
+
* @category Models
|
|
10
|
+
*/
|
|
11
|
+
class Space {
|
|
12
|
+
constructor(roomId, client) {
|
|
13
|
+
this.roomId = roomId;
|
|
14
|
+
this.client = client;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new child space under this space.
|
|
18
|
+
* @param {SpaceCreateOptions} opts The options for the new space.
|
|
19
|
+
* @returns {Promise<Space>} Resolves to the created space.
|
|
20
|
+
*/
|
|
21
|
+
async createChildSpace(opts) {
|
|
22
|
+
const space = await this.client.createSpace(opts);
|
|
23
|
+
await this.addChildSpace(space, opts);
|
|
24
|
+
return space;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds a child space to the space. Must be joined to both spaces.
|
|
28
|
+
* @param {Space} space The space to add.
|
|
29
|
+
* @param {SpaceChildEntityOptions} childOpts Related options for the child's representation.
|
|
30
|
+
* @returns {Promise<Space>} Resolves when complete.
|
|
31
|
+
*/
|
|
32
|
+
async addChildSpace(space, childOpts = {}) {
|
|
33
|
+
await this.addChildRoom(space.roomId, childOpts);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Removes a child space from the space. Must be joined to the current space (not needed for child space).
|
|
37
|
+
* @param {Space} space The space to remove.
|
|
38
|
+
* @returns {Promise<void>} Resolves when complete.
|
|
39
|
+
*/
|
|
40
|
+
async removeChildSpace(space) {
|
|
41
|
+
await this.removeChildRoom(space.roomId);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Adds a child room to the space. Must be joined to both the room and the space.
|
|
45
|
+
* @param {string} roomId The room ID to add.
|
|
46
|
+
* @param {SpaceChildEntityOptions} childOpts Additional options for the child space.
|
|
47
|
+
* @returns {Promise<void>} Resolves when complete.
|
|
48
|
+
*/
|
|
49
|
+
async addChildRoom(roomId, childOpts = {}) {
|
|
50
|
+
const via = childOpts.via ?? [new MatrixEntity_1.UserID(await this.client.getUserId()).domain];
|
|
51
|
+
const childContent = { via };
|
|
52
|
+
if (childOpts.suggested)
|
|
53
|
+
childContent.suggested = childOpts.suggested;
|
|
54
|
+
if (childOpts.order) {
|
|
55
|
+
(0, simple_validation_1.validateSpaceOrderString)(childOpts.order);
|
|
56
|
+
childContent.order = childOpts.order;
|
|
57
|
+
}
|
|
58
|
+
await this.client.sendStateEvent(this.roomId, "m.space.child", roomId, childContent);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Removes a child room from the space. Must be joined to the current space (not needed for child room).
|
|
62
|
+
* @param {string} roomId The room ID to remove.
|
|
63
|
+
* @returns {Promise<void>} Resolves when complete.
|
|
64
|
+
*/
|
|
65
|
+
async removeChildRoom(roomId) {
|
|
66
|
+
await this.client.sendStateEvent(this.roomId, "m.space.child", roomId, {});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Gets all the child rooms on the space. These may be spaces or other rooms.
|
|
70
|
+
* @returns {Promise<SpaceEntityMap>} Resolves to a map of children for this space.
|
|
71
|
+
*/
|
|
72
|
+
async getChildEntities() {
|
|
73
|
+
const roomState = await this.client.getRoomState(this.roomId);
|
|
74
|
+
const mapping = {};
|
|
75
|
+
roomState
|
|
76
|
+
.filter(s => s.type === "m.space.child")
|
|
77
|
+
.filter(s => s.content?.via)
|
|
78
|
+
.forEach(s => mapping[s.state_key] = new SpaceChildEvent_1.SpaceChildEvent(s));
|
|
79
|
+
return mapping;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Invite a user to the current space.
|
|
83
|
+
* @param {string} userId The user ID to invite.
|
|
84
|
+
* @returns {Promise<void>} Resolves when completed.
|
|
85
|
+
*/
|
|
86
|
+
async inviteUser(userId) {
|
|
87
|
+
return this.client.inviteUser(userId, this.roomId);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.Space = Space;
|
|
91
|
+
//# sourceMappingURL=Spaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spaces.js","sourceRoot":"","sources":["../../src/models/Spaces.ts"],"names":[],"mappings":";;;AACA,0DAAiD;AACjD,4DAAgE;AAChE,8DAAmF;AA2EnF;;;GAGG;AACH,MAAa,KAAK;IACd,YAAmC,MAAc,EAAkB,MAAoB;QAApD,WAAM,GAAN,MAAM,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAc;IACvF,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,gBAAgB,CAAC,IAAkB;QAC5C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,KAAY,EAAE,YAAqC,EAAE;QAC5E,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,gBAAgB,CAAC,KAAY;QACtC,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,YAAqC,EAAE;QAC7E,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,IAAI,qBAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QAChF,MAAM,YAAY,GAA2B,EAAE,GAAG,EAAE,CAAC;QAErD,IAAI,SAAS,CAAC,SAAS;YAAE,YAAY,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QACtE,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,IAAA,4CAAwB,EAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC1C,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;QACzC,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IACzF,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,MAAc;QACvC,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QACzB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAmB,EAAE,CAAC;QACnC,SAAS;aACJ,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC;aACvC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC;aAC3B,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,iCAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU,CAAC,MAAc;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;CACJ;AApFD,sBAoFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Threepid.js","sourceRoot":"","sources":["../../src/models/Threepid.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StateEvent } from "./RoomEvent";
|
|
2
|
+
/**
|
|
3
|
+
* The content definition for m.room.aliases events
|
|
4
|
+
* @category Matrix event contents
|
|
5
|
+
* @see AliasesEvent
|
|
6
|
+
*/
|
|
7
|
+
export interface AliasesEventContent {
|
|
8
|
+
/**
|
|
9
|
+
* The aliases this domain has published to the room.
|
|
10
|
+
*/
|
|
11
|
+
aliases: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents an m.room.aliases state event
|
|
15
|
+
* @category Matrix events
|
|
16
|
+
*/
|
|
17
|
+
export declare class AliasesEvent extends StateEvent<AliasesEventContent> {
|
|
18
|
+
constructor(event: any);
|
|
19
|
+
/**
|
|
20
|
+
* The domain the aliases belong to.
|
|
21
|
+
*/
|
|
22
|
+
get forDomain(): string;
|
|
23
|
+
/**
|
|
24
|
+
* The aliases the domain has published to the room.
|
|
25
|
+
*/
|
|
26
|
+
get aliases(): string[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AliasesEvent = void 0;
|
|
4
|
+
const RoomEvent_1 = require("./RoomEvent");
|
|
5
|
+
/**
|
|
6
|
+
* Represents an m.room.aliases state event
|
|
7
|
+
* @category Matrix events
|
|
8
|
+
*/
|
|
9
|
+
class AliasesEvent extends RoomEvent_1.StateEvent {
|
|
10
|
+
constructor(event) {
|
|
11
|
+
super(event);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The domain the aliases belong to.
|
|
15
|
+
*/
|
|
16
|
+
get forDomain() {
|
|
17
|
+
return this.stateKey;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The aliases the domain has published to the room.
|
|
21
|
+
*/
|
|
22
|
+
get aliases() {
|
|
23
|
+
return this.content.aliases || [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.AliasesEvent = AliasesEvent;
|
|
27
|
+
//# sourceMappingURL=AliasesEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AliasesEvent.js","sourceRoot":"","sources":["../../../src/models/events/AliasesEvent.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAczC;;;GAGG;AACH,MAAa,YAAa,SAAQ,sBAA+B;IAC7D,YAAY,KAAU;QAClB,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IACtC,CAAC;CACJ;AAlBD,oCAkBC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StateEvent } from "./RoomEvent";
|
|
2
|
+
/**
|
|
3
|
+
* The content definition for m.room.canonical_alias events
|
|
4
|
+
* @category Matrix event contents
|
|
5
|
+
* @see CanonicalAliasEvent
|
|
6
|
+
*/
|
|
7
|
+
export interface CanonicalAliasEventContent {
|
|
8
|
+
/**
|
|
9
|
+
* The canonical alias for the room.
|
|
10
|
+
*/
|
|
11
|
+
alias: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents an m.room.canonical_alias state event
|
|
15
|
+
* @category Matrix events
|
|
16
|
+
*/
|
|
17
|
+
export declare class CanonicalAliasEvent extends StateEvent<CanonicalAliasEventContent> {
|
|
18
|
+
constructor(event: any);
|
|
19
|
+
/**
|
|
20
|
+
* The alias the room is considering canonical
|
|
21
|
+
*/
|
|
22
|
+
get aliases(): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CanonicalAliasEvent = void 0;
|
|
4
|
+
const RoomEvent_1 = require("./RoomEvent");
|
|
5
|
+
/**
|
|
6
|
+
* Represents an m.room.canonical_alias state event
|
|
7
|
+
* @category Matrix events
|
|
8
|
+
*/
|
|
9
|
+
class CanonicalAliasEvent extends RoomEvent_1.StateEvent {
|
|
10
|
+
constructor(event) {
|
|
11
|
+
super(event);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The alias the room is considering canonical
|
|
15
|
+
*/
|
|
16
|
+
get aliases() {
|
|
17
|
+
return this.content.alias;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.CanonicalAliasEvent = CanonicalAliasEvent;
|
|
21
|
+
//# sourceMappingURL=CanonicalAliasEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanonicalAliasEvent.js","sourceRoot":"","sources":["../../../src/models/events/CanonicalAliasEvent.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAczC;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,sBAAsC;IAC3E,YAAY,KAAU;QAClB,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9B,CAAC;CACJ;AAXD,kDAWC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { StateEvent } from "./RoomEvent";
|
|
2
|
+
/**
|
|
3
|
+
* Information about the previous room.
|
|
4
|
+
* @category Matrix event info
|
|
5
|
+
* @see CreateEventContent
|
|
6
|
+
*/
|
|
7
|
+
export interface PreviousRoomInfo {
|
|
8
|
+
/**
|
|
9
|
+
* The old room ID.
|
|
10
|
+
*/
|
|
11
|
+
room_id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The last known event ID in the old room.
|
|
14
|
+
* Optional only for room versions >=12.
|
|
15
|
+
*/
|
|
16
|
+
event_id?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The content definition for m.room.create events
|
|
20
|
+
* @category Matrix event contents
|
|
21
|
+
* @see CreateEvent
|
|
22
|
+
*/
|
|
23
|
+
export interface CreateEventContent extends Record<string, unknown> {
|
|
24
|
+
/**
|
|
25
|
+
* The user ID who created the room.
|
|
26
|
+
*/
|
|
27
|
+
creator: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether or not this room is federated. Default true.
|
|
30
|
+
*/
|
|
31
|
+
"m.federate"?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The version of the room. Default "1".
|
|
34
|
+
*/
|
|
35
|
+
room_version?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Information about the old room.
|
|
38
|
+
*/
|
|
39
|
+
predecessor?: PreviousRoomInfo;
|
|
40
|
+
/**
|
|
41
|
+
* The type of the room, if applicable. For example, `m.space`.
|
|
42
|
+
*/
|
|
43
|
+
type?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents an m.room.create state event
|
|
47
|
+
* @category Matrix events
|
|
48
|
+
*/
|
|
49
|
+
export declare class CreateEvent extends StateEvent<CreateEventContent> {
|
|
50
|
+
constructor(event: any);
|
|
51
|
+
/**
|
|
52
|
+
* The user ID who created the room.
|
|
53
|
+
*/
|
|
54
|
+
get creator(): string;
|
|
55
|
+
/**
|
|
56
|
+
* The version of the room. Defaults to "1".
|
|
57
|
+
*/
|
|
58
|
+
get version(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Whether or not the room is federated. Default true (federated).
|
|
61
|
+
*/
|
|
62
|
+
get federated(): boolean;
|
|
63
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateEvent = void 0;
|
|
4
|
+
const RoomEvent_1 = require("./RoomEvent");
|
|
5
|
+
/**
|
|
6
|
+
* Represents an m.room.create state event
|
|
7
|
+
* @category Matrix events
|
|
8
|
+
*/
|
|
9
|
+
class CreateEvent extends RoomEvent_1.StateEvent {
|
|
10
|
+
constructor(event) {
|
|
11
|
+
super(event);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The user ID who created the room.
|
|
15
|
+
*/
|
|
16
|
+
get creator() {
|
|
17
|
+
return this.content.creator || this.sender;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The version of the room. Defaults to "1".
|
|
21
|
+
*/
|
|
22
|
+
get version() {
|
|
23
|
+
return this.content.room_version || "1";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether or not the room is federated. Default true (federated).
|
|
27
|
+
*/
|
|
28
|
+
get federated() {
|
|
29
|
+
return this.content['m.federate'] !== false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.CreateEvent = CreateEvent;
|
|
33
|
+
//# sourceMappingURL=CreateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateEvent.js","sourceRoot":"","sources":["../../../src/models/events/CreateEvent.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAoDzC;;;GAGG;AACH,MAAa,WAAY,SAAQ,sBAA8B;IAC3D,YAAY,KAAU;QAClB,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,GAAG,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,KAAK,CAAC;IAChD,CAAC;CACJ;AAzBD,kCAyBC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RoomEvent } from "./RoomEvent";
|
|
2
|
+
import { EncryptionAlgorithm, IMegolmEncrypted } from "../Crypto";
|
|
3
|
+
/**
|
|
4
|
+
* The content definition for m.room.encrypted events
|
|
5
|
+
* @category Matrix event contents
|
|
6
|
+
* @see EncryptedRoomEvent
|
|
7
|
+
*/
|
|
8
|
+
export interface EncryptedRoomEventContent {
|
|
9
|
+
algorithm: EncryptionAlgorithm;
|
|
10
|
+
/**
|
|
11
|
+
* For m.megolm.v1.aes-sha2 messages. The sender's Curve25519 key.
|
|
12
|
+
*/
|
|
13
|
+
sender_key?: string;
|
|
14
|
+
/**
|
|
15
|
+
* For m.megolm.v1.aes-sha2 messages. The session ID established by the sender.
|
|
16
|
+
*/
|
|
17
|
+
session_id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* For m.megolm.v1.aes-sha2 messages. The encrypted payload.
|
|
20
|
+
*/
|
|
21
|
+
ciphertext?: string;
|
|
22
|
+
/**
|
|
23
|
+
* For m.megolm.v1.aes-sha2 messages. The sender's device ID.
|
|
24
|
+
*/
|
|
25
|
+
device_id?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Represents an m.room.encrypted room event
|
|
29
|
+
* @category Matrix events
|
|
30
|
+
*/
|
|
31
|
+
export declare class EncryptedRoomEvent extends RoomEvent<EncryptedRoomEventContent> {
|
|
32
|
+
constructor(event: any);
|
|
33
|
+
/**
|
|
34
|
+
* The encryption algorithm used on the event. Should match the m.room.encryption
|
|
35
|
+
* state config.
|
|
36
|
+
*/
|
|
37
|
+
get algorithm(): EncryptionAlgorithm;
|
|
38
|
+
/**
|
|
39
|
+
* The Megolm encrypted payload information.
|
|
40
|
+
*/
|
|
41
|
+
get megolmProperties(): IMegolmEncrypted;
|
|
42
|
+
}
|