@textrp/briij-js-sdk 41.0.1 → 42.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.
Files changed (375) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/LICENSE +177 -177
  3. package/README.md +14 -3
  4. package/lib/@types/AESEncryptedSecretStoragePayload.js.map +1 -1
  5. package/lib/@types/IIdentityServerProvider.js.map +1 -1
  6. package/lib/@types/PushRules.js +14 -14
  7. package/lib/@types/PushRules.js.map +1 -1
  8. package/lib/@types/another-json.d.js.map +1 -1
  9. package/lib/@types/auth.d.ts +19 -1
  10. package/lib/@types/auth.d.ts.map +1 -1
  11. package/lib/@types/auth.js +55 -54
  12. package/lib/@types/auth.js.map +1 -1
  13. package/lib/@types/beacon.js +100 -100
  14. package/lib/@types/beacon.js.map +1 -1
  15. package/lib/@types/common.js.map +1 -1
  16. package/lib/@types/crypto.js.map +1 -1
  17. package/lib/@types/event.d.ts +27 -0
  18. package/lib/@types/event.d.ts.map +1 -1
  19. package/lib/@types/event.js +105 -102
  20. package/lib/@types/event.js.map +1 -1
  21. package/lib/@types/events.js.map +1 -1
  22. package/lib/@types/extensible_events.js +53 -53
  23. package/lib/@types/extensible_events.js.map +1 -1
  24. package/lib/@types/local_notifications.js.map +1 -1
  25. package/lib/@types/location.js +41 -41
  26. package/lib/@types/location.js.map +1 -1
  27. package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +1 -1
  28. package/lib/@types/media.js.map +1 -1
  29. package/lib/@types/membership.js +39 -39
  30. package/lib/@types/membership.js.map +1 -1
  31. package/lib/@types/partials.js +25 -25
  32. package/lib/@types/partials.js.map +1 -1
  33. package/lib/@types/polls.js +46 -46
  34. package/lib/@types/polls.js.map +1 -1
  35. package/lib/@types/read_receipts.js +14 -14
  36. package/lib/@types/read_receipts.js.map +1 -1
  37. package/lib/@types/registration.js.map +1 -1
  38. package/lib/@types/search.js +14 -14
  39. package/lib/@types/search.js.map +1 -1
  40. package/lib/@types/signed.js.map +1 -1
  41. package/lib/@types/spaces.js.map +1 -1
  42. package/lib/@types/state_events.js.map +1 -1
  43. package/lib/@types/synapse.js.map +1 -1
  44. package/lib/@types/sync.js +18 -18
  45. package/lib/@types/sync.js.map +1 -1
  46. package/lib/@types/threepids.js +14 -14
  47. package/lib/@types/threepids.js.map +1 -1
  48. package/lib/@types/topic.js +47 -47
  49. package/lib/@types/topic.js.map +1 -1
  50. package/lib/@types/uia.js.map +1 -1
  51. package/lib/NamespacedValue.js +20 -20
  52. package/lib/NamespacedValue.js.map +1 -1
  53. package/lib/ReEmitter.js +16 -16
  54. package/lib/ReEmitter.js.map +1 -1
  55. package/lib/base64.js +32 -32
  56. package/lib/base64.js.map +1 -1
  57. package/lib/briij.d.ts +3 -0
  58. package/lib/briij.d.ts.map +1 -1
  59. package/lib/briij.js +3 -0
  60. package/lib/briij.js.map +1 -1
  61. package/lib/client.d.ts +18 -1
  62. package/lib/client.d.ts.map +1 -1
  63. package/lib/client.js +166 -103
  64. package/lib/client.js.map +1 -1
  65. package/lib/common-crypto/key-passphrase.js +19 -19
  66. package/lib/common-crypto/key-passphrase.js.map +1 -1
  67. package/lib/content-helpers.js +57 -57
  68. package/lib/content-helpers.js.map +1 -1
  69. package/lib/content-repo.js +36 -36
  70. package/lib/content-repo.js.map +1 -1
  71. package/lib/crypto/store/base.js +69 -69
  72. package/lib/crypto/store/base.js.map +1 -1
  73. package/lib/crypto/store/indexeddb-crypto-store-backend.js +58 -58
  74. package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
  75. package/lib/crypto/store/indexeddb-crypto-store.js +193 -193
  76. package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
  77. package/lib/crypto/store/localStorage-crypto-store.js +72 -72
  78. package/lib/crypto/store/localStorage-crypto-store.js.map +1 -1
  79. package/lib/crypto/store/memory-crypto-store.js +74 -74
  80. package/lib/crypto/store/memory-crypto-store.js.map +1 -1
  81. package/lib/crypto-api/CryptoEventHandlerMap.js.map +1 -1
  82. package/lib/crypto-api/key-passphrase.js +22 -22
  83. package/lib/crypto-api/key-passphrase.js.map +1 -1
  84. package/lib/crypto-api/keybackup.js.map +1 -1
  85. package/lib/crypto-api/recovery-key.js +20 -20
  86. package/lib/crypto-api/recovery-key.js.map +1 -1
  87. package/lib/digest.js +21 -21
  88. package/lib/digest.js.map +1 -1
  89. package/lib/extensible_events_v1/ExtensibleEvent.js +39 -39
  90. package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -1
  91. package/lib/extensible_events_v1/InvalidEventError.js +16 -16
  92. package/lib/extensible_events_v1/InvalidEventError.js.map +1 -1
  93. package/lib/extensible_events_v1/MessageEvent.js +39 -39
  94. package/lib/extensible_events_v1/MessageEvent.js.map +1 -1
  95. package/lib/extensible_events_v1/PollEndEvent.js +29 -29
  96. package/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
  97. package/lib/extensible_events_v1/PollResponseEvent.js +39 -39
  98. package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
  99. package/lib/extensible_events_v1/PollStartEvent.js +52 -52
  100. package/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
  101. package/lib/extensible_events_v1/utilities.js +22 -22
  102. package/lib/extensible_events_v1/utilities.js.map +1 -1
  103. package/lib/feature.js +16 -16
  104. package/lib/feature.js.map +1 -1
  105. package/lib/http-api/method.js +14 -14
  106. package/lib/http-api/method.js.map +1 -1
  107. package/lib/http-api/prefix.js +26 -26
  108. package/lib/http-api/prefix.js.map +1 -1
  109. package/lib/indexeddb-helpers.js +21 -21
  110. package/lib/indexeddb-helpers.js.map +1 -1
  111. package/lib/indexeddb-worker.js +18 -18
  112. package/lib/indexeddb-worker.js.map +1 -1
  113. package/lib/matrixrtc/IKeyTransport.js +17 -17
  114. package/lib/matrixrtc/IKeyTransport.js.map +1 -1
  115. package/lib/matrixrtc/IMembershipManager.js +27 -27
  116. package/lib/matrixrtc/IMembershipManager.js.map +1 -1
  117. package/lib/matrixrtc/LivekitTransport.js +19 -19
  118. package/lib/matrixrtc/LivekitTransport.js.map +1 -1
  119. package/lib/matrixrtc/index.js +14 -14
  120. package/lib/matrixrtc/index.js.map +1 -1
  121. package/lib/matrixrtc/utils.js +27 -27
  122. package/lib/matrixrtc/utils.js.map +1 -1
  123. package/lib/models/ToDeviceMessage.js.map +1 -1
  124. package/lib/models/device.js +24 -24
  125. package/lib/models/device.js.map +1 -1
  126. package/lib/models/event-status.js +17 -17
  127. package/lib/models/event-status.js.map +1 -1
  128. package/lib/models/invites-ignorer-types.js +25 -25
  129. package/lib/models/invites-ignorer-types.js.map +1 -1
  130. package/lib/models/profile-keys.js +26 -26
  131. package/lib/models/profile-keys.js.map +1 -1
  132. package/lib/models/room-summary.js +26 -26
  133. package/lib/models/room-summary.js.map +1 -1
  134. package/lib/models/search-result.js +22 -22
  135. package/lib/models/search-result.js.map +1 -1
  136. package/lib/models/typed-event-emitter.js +122 -122
  137. package/lib/models/typed-event-emitter.js.map +1 -1
  138. package/lib/oidc/authorize.js +76 -76
  139. package/lib/oidc/authorize.js.map +1 -1
  140. package/lib/oidc/error.js +17 -17
  141. package/lib/oidc/error.js.map +1 -1
  142. package/lib/oidc/index.js +17 -17
  143. package/lib/oidc/index.js.map +1 -1
  144. package/lib/oidc/register.js +41 -41
  145. package/lib/oidc/register.js.map +1 -1
  146. package/lib/oidc/tokenRefresher.js +51 -51
  147. package/lib/oidc/tokenRefresher.js.map +1 -1
  148. package/lib/oidc/validate.js +59 -59
  149. package/lib/oidc/validate.js.map +1 -1
  150. package/lib/randomstring.js +35 -35
  151. package/lib/randomstring.js.map +1 -1
  152. package/lib/realtime-callbacks.js +39 -39
  153. package/lib/realtime-callbacks.js.map +1 -1
  154. package/lib/receipt-accumulator.js +44 -44
  155. package/lib/receipt-accumulator.js.map +1 -1
  156. package/lib/rendezvous/RendezvousChannel.js.map +1 -1
  157. package/lib/rendezvous/RendezvousCode.js.map +1 -1
  158. package/lib/rendezvous/RendezvousError.js +14 -14
  159. package/lib/rendezvous/RendezvousError.js.map +1 -1
  160. package/lib/rendezvous/RendezvousFailureReason.js +14 -14
  161. package/lib/rendezvous/RendezvousFailureReason.js.map +1 -1
  162. package/lib/rendezvous/RendezvousIntent.js +14 -14
  163. package/lib/rendezvous/RendezvousIntent.js.map +1 -1
  164. package/lib/rendezvous/RendezvousTransport.js.map +1 -1
  165. package/lib/rendezvous/channels/MSC4108SecureChannel.js +63 -63
  166. package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -1
  167. package/lib/rendezvous/channels/index.js +14 -14
  168. package/lib/rendezvous/channels/index.js.map +1 -1
  169. package/lib/rendezvous/index.js +14 -14
  170. package/lib/rendezvous/index.js.map +1 -1
  171. package/lib/rendezvous/transports/index.js +14 -14
  172. package/lib/rendezvous/transports/index.js.map +1 -1
  173. package/lib/rust-crypto/CrossSigningIdentity.js +29 -29
  174. package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
  175. package/lib/rust-crypto/OutgoingRequestsManager.js +37 -37
  176. package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -1
  177. package/lib/rust-crypto/device-converter.js +30 -30
  178. package/lib/rust-crypto/device-converter.js.map +1 -1
  179. package/lib/rust-crypto/secret-storage.js +30 -30
  180. package/lib/rust-crypto/secret-storage.js.map +1 -1
  181. package/lib/service-types.js +14 -14
  182. package/lib/service-types.js.map +1 -1
  183. package/lib/store/local-storage-events-emitter.js +21 -21
  184. package/lib/store/local-storage-events-emitter.js.map +1 -1
  185. package/lib/sync-accumulator.js +50 -50
  186. package/lib/sync-accumulator.js.map +1 -1
  187. package/lib/thread-utils.js +20 -20
  188. package/lib/thread-utils.js.map +1 -1
  189. package/lib/types.js +34 -34
  190. package/lib/types.js.map +1 -1
  191. package/lib/utils/decryptAESSecretStorageItem.js +22 -22
  192. package/lib/utils/decryptAESSecretStorageItem.js.map +1 -1
  193. package/lib/utils/encryptAESSecretStorageItem.js +26 -26
  194. package/lib/utils/encryptAESSecretStorageItem.js.map +1 -1
  195. package/lib/utils/internal/deriveKeys.js +21 -21
  196. package/lib/utils/internal/deriveKeys.js.map +1 -1
  197. package/lib/utils/roomVersion.js +26 -26
  198. package/lib/utils/roomVersion.js.map +1 -1
  199. package/lib/version-support.js +26 -26
  200. package/lib/version-support.js.map +1 -1
  201. package/lib/webrtc/audioContext.js +24 -24
  202. package/lib/webrtc/audioContext.js.map +1 -1
  203. package/lib/webrtc/callEventTypes.js.map +1 -1
  204. package/lib/webrtc/stats/callFeedStatsReporter.js +14 -14
  205. package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -1
  206. package/lib/webrtc/stats/callStatsReportGatherer.js +14 -14
  207. package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
  208. package/lib/webrtc/stats/callStatsReportSummary.js.map +1 -1
  209. package/lib/webrtc/stats/connectionStats.js +14 -14
  210. package/lib/webrtc/stats/connectionStats.js.map +1 -1
  211. package/lib/webrtc/stats/connectionStatsBuilder.js +14 -14
  212. package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -1
  213. package/lib/webrtc/stats/connectionStatsReportBuilder.js +14 -14
  214. package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -1
  215. package/lib/webrtc/stats/groupCallStats.js +14 -14
  216. package/lib/webrtc/stats/groupCallStats.js.map +1 -1
  217. package/lib/webrtc/stats/media/mediaSsrcHandler.js +14 -14
  218. package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
  219. package/lib/webrtc/stats/media/mediaTrackHandler.js +14 -14
  220. package/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -1
  221. package/lib/webrtc/stats/media/mediaTrackStats.js +27 -27
  222. package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -1
  223. package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +20 -20
  224. package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
  225. package/lib/webrtc/stats/statsReport.js +14 -14
  226. package/lib/webrtc/stats/statsReport.js.map +1 -1
  227. package/lib/webrtc/stats/statsReportEmitter.js +14 -14
  228. package/lib/webrtc/stats/statsReportEmitter.js.map +1 -1
  229. package/lib/webrtc/stats/trackStatsBuilder.js +4 -4
  230. package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -1
  231. package/lib/webrtc/stats/transportStats.js.map +1 -1
  232. package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -1
  233. package/lib/webrtc/stats/valueFormatter.js +11 -11
  234. package/lib/webrtc/stats/valueFormatter.js.map +1 -1
  235. package/lib/xrpl/identity.d.ts +28 -0
  236. package/lib/xrpl/identity.d.ts.map +1 -0
  237. package/lib/xrpl/identity.js +213 -0
  238. package/lib/xrpl/identity.js.map +1 -0
  239. package/lib/xrpl/trust.d.ts +8 -0
  240. package/lib/xrpl/trust.d.ts.map +1 -0
  241. package/lib/xrpl/trust.js +61 -0
  242. package/lib/xrpl/trust.js.map +1 -0
  243. package/lib/xrpl/verification.d.ts +26 -0
  244. package/lib/xrpl/verification.d.ts.map +1 -0
  245. package/lib/xrpl/verification.js +295 -0
  246. package/lib/xrpl/verification.js.map +1 -0
  247. package/package.json +128 -129
  248. package/src/@types/AESEncryptedSecretStoragePayload.ts +29 -29
  249. package/src/@types/IIdentityServerProvider.ts +24 -24
  250. package/src/@types/PushRules.ts +208 -208
  251. package/src/@types/another-json.d.ts +19 -19
  252. package/src/@types/auth.ts +280 -258
  253. package/src/@types/beacon.ts +140 -140
  254. package/src/@types/common.ts +24 -24
  255. package/src/@types/crypto.ts +71 -71
  256. package/src/@types/event.ts +476 -449
  257. package/src/@types/events.ts +119 -119
  258. package/src/@types/extensible_events.ts +147 -147
  259. package/src/@types/local_notifications.ts +19 -19
  260. package/src/@types/location.ts +92 -92
  261. package/src/@types/matrix-sdk-crypto-wasm.d.ts +39 -39
  262. package/src/@types/media.ts +245 -245
  263. package/src/@types/membership.ts +57 -57
  264. package/src/@types/partials.ts +103 -103
  265. package/src/@types/polls.ts +120 -120
  266. package/src/@types/read_receipts.ts +61 -61
  267. package/src/@types/registration.ts +102 -102
  268. package/src/@types/search.ts +119 -119
  269. package/src/@types/signed.ts +25 -25
  270. package/src/@types/spaces.ts +37 -37
  271. package/src/@types/state_events.ts +153 -153
  272. package/src/@types/synapse.ts +40 -40
  273. package/src/@types/sync.ts +27 -27
  274. package/src/@types/threepids.ts +29 -29
  275. package/src/@types/topic.ts +69 -69
  276. package/src/@types/uia.ts +24 -24
  277. package/src/NamespacedValue.ts +121 -121
  278. package/src/ReEmitter.ts +93 -93
  279. package/src/base64.ts +86 -86
  280. package/src/briij.ts +3 -0
  281. package/src/client.ts +90 -10
  282. package/src/common-crypto/README.md +4 -4
  283. package/src/common-crypto/key-passphrase.ts +43 -43
  284. package/src/content-helpers.ts +298 -298
  285. package/src/content-repo.ts +122 -122
  286. package/src/crypto/store/base.ts +388 -388
  287. package/src/crypto/store/indexeddb-crypto-store-backend.ts +655 -655
  288. package/src/crypto/store/indexeddb-crypto-store.ts +555 -555
  289. package/src/crypto/store/localStorage-crypto-store.ts +409 -409
  290. package/src/crypto/store/memory-crypto-store.ts +326 -326
  291. package/src/crypto-api/CryptoEventHandlerMap.ts +42 -42
  292. package/src/crypto-api/key-passphrase.ts +58 -58
  293. package/src/crypto-api/keybackup.ts +114 -114
  294. package/src/crypto-api/recovery-key.ts +69 -69
  295. package/src/digest.ts +34 -34
  296. package/src/extensible_events_v1/ExtensibleEvent.ts +58 -58
  297. package/src/extensible_events_v1/InvalidEventError.ts +24 -24
  298. package/src/extensible_events_v1/MessageEvent.ts +143 -143
  299. package/src/extensible_events_v1/PollEndEvent.ts +97 -97
  300. package/src/extensible_events_v1/PollResponseEvent.ts +148 -148
  301. package/src/extensible_events_v1/PollStartEvent.ts +207 -207
  302. package/src/extensible_events_v1/utilities.ts +35 -35
  303. package/src/feature.ts +88 -88
  304. package/src/http-api/method.ts +25 -25
  305. package/src/http-api/prefix.ts +48 -48
  306. package/src/indexeddb-helpers.ts +50 -50
  307. package/src/indexeddb-worker.ts +24 -24
  308. package/src/matrixrtc/IKeyTransport.ts +63 -63
  309. package/src/matrixrtc/IMembershipManager.ts +120 -120
  310. package/src/matrixrtc/LivekitTransport.ts +46 -46
  311. package/src/matrixrtc/index.ts +24 -24
  312. package/src/matrixrtc/utils.ts +71 -71
  313. package/src/models/ToDeviceMessage.ts +38 -38
  314. package/src/models/device.ts +85 -85
  315. package/src/models/event-status.ts +39 -39
  316. package/src/models/invites-ignorer-types.ts +58 -58
  317. package/src/models/profile-keys.ts +33 -33
  318. package/src/models/room-summary.ts +78 -78
  319. package/src/models/search-result.ts +57 -57
  320. package/src/models/typed-event-emitter.ts +246 -246
  321. package/src/oidc/authorize.ts +279 -279
  322. package/src/oidc/error.ts +33 -33
  323. package/src/oidc/index.ts +33 -33
  324. package/src/oidc/register.ts +163 -163
  325. package/src/oidc/tokenRefresher.ts +184 -184
  326. package/src/oidc/validate.ts +265 -265
  327. package/src/randomstring.ts +103 -103
  328. package/src/realtime-callbacks.ts +191 -191
  329. package/src/receipt-accumulator.ts +189 -189
  330. package/src/rendezvous/RendezvousChannel.ts +48 -48
  331. package/src/rendezvous/RendezvousCode.ts +25 -25
  332. package/src/rendezvous/RendezvousError.ts +26 -26
  333. package/src/rendezvous/RendezvousFailureReason.ts +49 -49
  334. package/src/rendezvous/RendezvousIntent.ts +20 -20
  335. package/src/rendezvous/RendezvousTransport.ts +58 -58
  336. package/src/rendezvous/channels/MSC4108SecureChannel.ts +270 -270
  337. package/src/rendezvous/channels/index.ts +17 -17
  338. package/src/rendezvous/index.ts +25 -25
  339. package/src/rendezvous/transports/index.ts +17 -17
  340. package/src/rust-crypto/CrossSigningIdentity.ts +195 -195
  341. package/src/rust-crypto/OutgoingRequestsManager.ts +170 -170
  342. package/src/rust-crypto/device-converter.ts +128 -128
  343. package/src/rust-crypto/secret-storage.ts +60 -60
  344. package/src/service-types.ts +20 -20
  345. package/src/store/local-storage-events-emitter.ts +46 -46
  346. package/src/sync-accumulator.ts +779 -779
  347. package/src/thread-utils.ts +31 -31
  348. package/src/types.ts +59 -59
  349. package/src/utils/decryptAESSecretStorageItem.ts +54 -54
  350. package/src/utils/encryptAESSecretStorageItem.ts +73 -73
  351. package/src/utils/internal/deriveKeys.ts +63 -63
  352. package/src/utils/roomVersion.ts +35 -35
  353. package/src/version-support.ts +50 -50
  354. package/src/webrtc/audioContext.ts +44 -44
  355. package/src/webrtc/callEventTypes.ts +101 -101
  356. package/src/webrtc/stats/callFeedStatsReporter.ts +91 -91
  357. package/src/webrtc/stats/callStatsReportGatherer.ts +219 -219
  358. package/src/webrtc/stats/callStatsReportSummary.ts +30 -30
  359. package/src/webrtc/stats/connectionStats.ts +47 -47
  360. package/src/webrtc/stats/connectionStatsBuilder.ts +28 -28
  361. package/src/webrtc/stats/connectionStatsReportBuilder.ts +140 -140
  362. package/src/webrtc/stats/groupCallStats.ts +93 -93
  363. package/src/webrtc/stats/media/mediaSsrcHandler.ts +57 -57
  364. package/src/webrtc/stats/media/mediaTrackHandler.ts +70 -70
  365. package/src/webrtc/stats/media/mediaTrackStats.ts +176 -176
  366. package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +90 -90
  367. package/src/webrtc/stats/statsReport.ts +133 -133
  368. package/src/webrtc/stats/statsReportEmitter.ts +49 -49
  369. package/src/webrtc/stats/trackStatsBuilder.ts +207 -207
  370. package/src/webrtc/stats/transportStats.ts +26 -26
  371. package/src/webrtc/stats/transportStatsBuilder.ts +48 -48
  372. package/src/webrtc/stats/valueFormatter.ts +27 -27
  373. package/src/xrpl/identity.ts +245 -0
  374. package/src/xrpl/trust.ts +64 -0
  375. package/src/xrpl/verification.ts +284 -0
@@ -1,17 +1,17 @@
1
- /*
2
- Copyright 2020-2026 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 2020-2026 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
17
  import { NamespacedValue, UnstableValue } from "../NamespacedValue.js";
@@ -70,6 +70,9 @@ export var EventType = /*#__PURE__*/function (EventType) {
70
70
  EventType["RoomMessageFeedback"] = "m.room.message.feedback";
71
71
  EventType["Reaction"] = "m.reaction";
72
72
  EventType["PollStart"] = "org.matrix.msc3381.poll.start";
73
+ EventType["UserVerifyRequest"] = "m.user.verify.request";
74
+ EventType["UserVerifyAccept"] = "m.user.verify.accept";
75
+ EventType["UserVerified"] = "m.user.verified";
73
76
  // Room ephemeral events
74
77
  EventType["Typing"] = "m.typing";
75
78
  EventType["Receipt"] = "m.receipt";
@@ -136,145 +139,145 @@ export var RoomType = /*#__PURE__*/function (RoomType) {
136
139
  }({});
137
140
  export var ToDeviceMessageId = "org.matrix.msgid";
138
141
 
139
- /**
140
- * Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
141
- * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
142
- * including its eventual removal.
142
+ /**
143
+ * Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
144
+ * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
145
+ * including its eventual removal.
143
146
  */
144
147
  export var UNSTABLE_MSC3088_PURPOSE = new UnstableValue("m.room.purpose", "org.matrix.msc3088.purpose");
145
148
 
146
- /**
147
- * Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
148
- * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
149
- * including its eventual removal.
149
+ /**
150
+ * Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
151
+ * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
152
+ * including its eventual removal.
150
153
  */
151
154
  export var UNSTABLE_MSC3088_ENABLED = new UnstableValue("m.enabled", "org.matrix.msc3088.enabled");
152
155
 
153
- /**
154
- * Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
155
- * Note that this reference is UNSTABLE and subject to breaking changes, including its
156
- * eventual removal.
156
+ /**
157
+ * Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
158
+ * Note that this reference is UNSTABLE and subject to breaking changes, including its
159
+ * eventual removal.
157
160
  */
158
161
  export var UNSTABLE_MSC3089_TREE_SUBTYPE = new UnstableValue("m.data_tree", "org.matrix.msc3089.data_tree");
159
162
 
160
- /**
161
- * Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
162
- * Note that this reference is UNSTABLE and subject to breaking changes, including its
163
- * eventual removal.
163
+ /**
164
+ * Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
165
+ * Note that this reference is UNSTABLE and subject to breaking changes, including its
166
+ * eventual removal.
164
167
  */
165
168
  export var UNSTABLE_MSC3089_LEAF = new UnstableValue("m.leaf", "org.matrix.msc3089.leaf");
166
169
 
167
- /**
168
- * Branch (Leaf Reference) type for the index approach in a
169
- * [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is
170
- * UNSTABLE and subject to breaking changes, including its eventual removal.
170
+ /**
171
+ * Branch (Leaf Reference) type for the index approach in a
172
+ * [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is
173
+ * UNSTABLE and subject to breaking changes, including its eventual removal.
171
174
  */
172
175
  export var UNSTABLE_MSC3089_BRANCH = new UnstableValue("m.branch", "org.matrix.msc3089.branch");
173
176
 
174
- /**
175
- * Marker event type to point back at imported historical content in a room. See
176
- * [MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716).
177
- * Note that this reference is UNSTABLE and subject to breaking changes,
178
- * including its eventual removal.
177
+ /**
178
+ * Marker event type to point back at imported historical content in a room. See
179
+ * [MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716).
180
+ * Note that this reference is UNSTABLE and subject to breaking changes,
181
+ * including its eventual removal.
179
182
  */
180
183
  export var UNSTABLE_MSC2716_MARKER = new UnstableValue("m.room.marker", "org.matrix.msc2716.marker");
181
184
 
182
- /**
183
- * Name of the request property for relation based redactions.
184
- * {@link https://github.com/matrix-org/matrix-spec-proposals/pull/3912}
185
+ /**
186
+ * Name of the request property for relation based redactions.
187
+ * {@link https://github.com/matrix-org/matrix-spec-proposals/pull/3912}
185
188
  */
186
189
  export var MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue("with_rel_types", "org.matrix.msc3912.with_relations");
187
190
 
188
- /**
189
- * Functional members type for declaring a purpose of room members (e.g. helpful bots).
190
- * Note that this reference is UNSTABLE and subject to breaking changes, including its
191
- * eventual removal.
192
- *
193
- * Schema (TypeScript):
194
- * ```
195
- * {
196
- * service_members?: string[]
197
- * }
198
- * ```
199
- *
200
- * @example
201
- * ```
202
- * {
203
- * "service_members": [
204
- * "@helperbot:localhost",
205
- * "@reminderbot:alice.tdl"
206
- * ]
207
- * }
208
- * ```
191
+ /**
192
+ * Functional members type for declaring a purpose of room members (e.g. helpful bots).
193
+ * Note that this reference is UNSTABLE and subject to breaking changes, including its
194
+ * eventual removal.
195
+ *
196
+ * Schema (TypeScript):
197
+ * ```
198
+ * {
199
+ * service_members?: string[]
200
+ * }
201
+ * ```
202
+ *
203
+ * @example
204
+ * ```
205
+ * {
206
+ * "service_members": [
207
+ * "@helperbot:localhost",
208
+ * "@reminderbot:alice.tdl"
209
+ * ]
210
+ * }
211
+ * ```
209
212
  */
210
213
  export var UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue("io.element.functional_members", "io.element.functional_members");
211
214
 
212
- /**
213
- * A type of message that affects visibility of a message,
214
- * as per https://github.com/matrix-org/matrix-doc/pull/3531
215
- *
216
- * @experimental
215
+ /**
216
+ * A type of message that affects visibility of a message,
217
+ * as per https://github.com/matrix-org/matrix-doc/pull/3531
218
+ *
219
+ * @experimental
217
220
  */
218
221
  export var EVENT_VISIBILITY_CHANGE_TYPE = new UnstableValue("m.visibility", "org.matrix.msc3531.visibility");
219
222
 
220
- /**
221
- * https://github.com/matrix-org/matrix-doc/pull/3881
222
- *
223
- * @experimental
223
+ /**
224
+ * https://github.com/matrix-org/matrix-doc/pull/3881
225
+ *
226
+ * @experimental
224
227
  */
225
228
  export var PUSHER_ENABLED = new UnstableValue("enabled", "org.matrix.msc3881.enabled");
226
229
 
227
- /**
228
- * https://github.com/matrix-org/matrix-doc/pull/3881
229
- *
230
- * @experimental
230
+ /**
231
+ * https://github.com/matrix-org/matrix-doc/pull/3881
232
+ *
233
+ * @experimental
231
234
  */
232
235
  export var PUSHER_DEVICE_ID = new UnstableValue("device_id", "org.matrix.msc3881.device_id");
233
236
 
234
- /**
235
- * https://github.com/matrix-org/matrix-doc/pull/3890
236
- *
237
- * @experimental
237
+ /**
238
+ * https://github.com/matrix-org/matrix-doc/pull/3890
239
+ *
240
+ * @experimental
238
241
  */
239
242
  export var LOCAL_NOTIFICATION_SETTINGS_PREFIX = new UnstableValue("m.local_notification_settings", "org.matrix.msc3890.local_notification_settings");
240
243
 
241
- /**
242
- * https://github.com/matrix-org/matrix-doc/pull/4023
243
- *
244
- * @experimental
244
+ /**
245
+ * https://github.com/matrix-org/matrix-doc/pull/4023
246
+ *
247
+ * @experimental
245
248
  */
246
249
  export var UNSIGNED_THREAD_ID_FIELD = new UnstableValue("thread_id", "org.matrix.msc4023.thread_id");
247
250
 
248
- /**
249
- * https://github.com/matrix-org/matrix-spec-proposals/pull/4115
250
- *
251
- * @experimental
251
+ /**
252
+ * https://github.com/matrix-org/matrix-spec-proposals/pull/4115
253
+ *
254
+ * @experimental
252
255
  */
253
256
  export var UNSIGNED_MEMBERSHIP_FIELD = new NamespacedValue("membership", "io.element.msc4115.membership");
254
257
 
255
- /**
256
- * Mapped type from event type to content type for all specified non-state room events.
258
+ /**
259
+ * Mapped type from event type to content type for all specified non-state room events.
257
260
  */
258
261
 
259
- /**
260
- * Mapped type from event type to content type for all specified room state events.
262
+ /**
263
+ * Mapped type from event type to content type for all specified room state events.
261
264
  */
262
265
 
263
- /**
264
- * Mapped type from event type to content type for all specified room-specific account_data events.
266
+ /**
267
+ * Mapped type from event type to content type for all specified room-specific account_data events.
265
268
  */
266
269
 
267
- /**
268
- * Mapped type from event type to content type for all specified global account_data events.
270
+ /**
271
+ * Mapped type from event type to content type for all specified global account_data events.
269
272
  */
270
273
 
271
- /**
272
- * Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12
274
+ /**
275
+ * Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12
273
276
  */
274
277
 
275
- /**
276
- * Mapped type from event type to content type for all specified global events encrypted by secret storage.
277
- *
278
- * See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1
278
+ /**
279
+ * Mapped type from event type to content type for all specified global events encrypted by secret storage.
280
+ *
281
+ * See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1
279
282
  */
280
283
  //# sourceMappingURL=event.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event.js","names":["NamespacedValue","UnstableValue","EventType","RelationType","MsgType","RoomCreateTypeField","RoomType","ToDeviceMessageId","UNSTABLE_MSC3088_PURPOSE","UNSTABLE_MSC3088_ENABLED","UNSTABLE_MSC3089_TREE_SUBTYPE","UNSTABLE_MSC3089_LEAF","UNSTABLE_MSC3089_BRANCH","UNSTABLE_MSC2716_MARKER","MSC3912_RELATION_BASED_REDACTIONS_PROP","UNSTABLE_ELEMENT_FUNCTIONAL_USERS","EVENT_VISIBILITY_CHANGE_TYPE","PUSHER_ENABLED","PUSHER_DEVICE_ID","LOCAL_NOTIFICATION_SETTINGS_PREFIX","UNSIGNED_THREAD_ID_FIELD","UNSIGNED_MEMBERSHIP_FIELD"],"sources":["../../src/@types/event.ts"],"sourcesContent":["/*\r\nCopyright 2020-2026 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\nimport { type EitherAnd } from \"matrix-events-sdk\";\r\n\r\nimport { NamespacedValue, UnstableValue } from \"../NamespacedValue.ts\";\r\nimport {\r\n type PolicyRuleEventContent,\r\n type RoomAvatarEventContent,\r\n type RoomCanonicalAliasEventContent,\r\n type RoomCreateEventContent,\r\n type RoomEncryptionEventContent,\r\n type RoomGuestAccessEventContent,\r\n type RoomHistoryVisibilityEventContent,\r\n type RoomJoinRulesEventContent,\r\n type RoomMemberEventContent,\r\n type RoomNameEventContent,\r\n type RoomPinnedEventsEventContent,\r\n type RoomPolicyContent,\r\n type RoomPowerLevelsEventContent,\r\n type RoomServerAclEventContent,\r\n type RoomThirdPartyInviteEventContent,\r\n type RoomTombstoneEventContent,\r\n type RoomTopicEventContent,\r\n type SpaceChildEventContent,\r\n type SpaceParentEventContent,\r\n} from \"./state_events.ts\";\r\nimport { type IGroupCallRoomMemberState, type IGroupCallRoomState } from \"../webrtc/groupCall.ts\";\r\nimport { type MSC3089EventContent } from \"../models/MSC3089Branch.ts\";\r\nimport { type M_BEACON, type M_BEACON_INFO, type MBeaconEventContent, type MBeaconInfoEventContent } from \"./beacon.ts\";\r\nimport { type EmptyObject } from \"./common.ts\";\r\nimport { type ReactionEventContent, type RoomMessageEventContent, type StickerEventContent } from \"./events.ts\";\r\nimport {\r\n type MCallAnswer,\r\n type MCallBase,\r\n type MCallCandidates,\r\n type MCallHangupReject,\r\n type MCallInviteNegotiate,\r\n type MCallReplacesEvent,\r\n type MCallSelectAnswer,\r\n type SDPStreamMetadata,\r\n} from \"../webrtc/callEventTypes.ts\";\r\nimport {\r\n type IRTCNotificationContent,\r\n type IRTCDeclineContent,\r\n type EncryptionKeysEventContent,\r\n type ICallNotifyContent,\r\n} from \"../matrixrtc/types.ts\";\r\nimport { type M_POLL_END, type M_POLL_START, type PollEndEventContent, type PollStartEventContent } from \"./polls.ts\";\r\nimport { type RtcMembershipData, type SessionMembershipData } from \"../matrixrtc/membershipData/index.ts\";\r\nimport { type LocalNotificationSettings } from \"./local_notifications.ts\";\r\nimport { type IPushRules } from \"./PushRules.ts\";\r\nimport { type SecretInfo, type SecretStorageKeyDescription } from \"../secret-storage.ts\";\r\nimport { type POLICIES_ACCOUNT_EVENT_TYPE } from \"../models/invites-ignorer-types.ts\";\r\n\r\nexport enum EventType {\r\n // Room state events\r\n RoomCanonicalAlias = \"m.room.canonical_alias\",\r\n RoomCreate = \"m.room.create\",\r\n RoomJoinRules = \"m.room.join_rules\",\r\n RoomMember = \"m.room.member\",\r\n RoomThirdPartyInvite = \"m.room.third_party_invite\",\r\n RoomPowerLevels = \"m.room.power_levels\",\r\n RoomName = \"m.room.name\",\r\n RoomTopic = \"m.room.topic\",\r\n RoomAvatar = \"m.room.avatar\",\r\n RoomPinnedEvents = \"m.room.pinned_events\",\r\n RoomEncryption = \"m.room.encryption\",\r\n RoomHistoryVisibility = \"m.room.history_visibility\",\r\n RoomGuestAccess = \"m.room.guest_access\",\r\n RoomServerAcl = \"m.room.server_acl\",\r\n RoomTombstone = \"m.room.tombstone\",\r\n RoomPredecessor = \"org.matrix.msc3946.room_predecessor\",\r\n\r\n // Moderation policy lists\r\n PolicyRuleUser = \"m.policy.rule.user\",\r\n PolicyRuleRoom = \"m.policy.rule.room\",\r\n PolicyRuleServer = \"m.policy.rule.server\",\r\n\r\n SpaceChild = \"m.space.child\",\r\n SpaceParent = \"m.space.parent\",\r\n\r\n // Room timeline events\r\n RoomRedaction = \"m.room.redaction\",\r\n RoomMessage = \"m.room.message\",\r\n RoomMessageEncrypted = \"m.room.encrypted\",\r\n Sticker = \"m.sticker\",\r\n CallInvite = \"m.call.invite\",\r\n CallCandidates = \"m.call.candidates\",\r\n CallAnswer = \"m.call.answer\",\r\n CallHangup = \"m.call.hangup\",\r\n CallReject = \"m.call.reject\",\r\n CallSelectAnswer = \"m.call.select_answer\",\r\n CallNegotiate = \"m.call.negotiate\",\r\n CallSDPStreamMetadataChanged = \"m.call.sdp_stream_metadata_changed\",\r\n CallSDPStreamMetadataChangedPrefix = \"org.matrix.call.sdp_stream_metadata_changed\",\r\n CallReplaces = \"m.call.replaces\",\r\n CallAssertedIdentity = \"m.call.asserted_identity\",\r\n CallAssertedIdentityPrefix = \"org.matrix.call.asserted_identity\",\r\n CallEncryptionKeysPrefix = \"io.element.call.encryption_keys\",\r\n KeyVerificationRequest = \"m.key.verification.request\",\r\n KeyVerificationStart = \"m.key.verification.start\",\r\n KeyVerificationCancel = \"m.key.verification.cancel\",\r\n KeyVerificationMac = \"m.key.verification.mac\",\r\n KeyVerificationDone = \"m.key.verification.done\",\r\n KeyVerificationKey = \"m.key.verification.key\",\r\n KeyVerificationAccept = \"m.key.verification.accept\",\r\n // Not used directly - see READY_TYPE in VerificationRequest.\r\n KeyVerificationReady = \"m.key.verification.ready\",\r\n // use of this is discouraged https://matrix.org/docs/spec/client_server/r0.6.1#m-room-message-feedback\r\n RoomMessageFeedback = \"m.room.message.feedback\",\r\n Reaction = \"m.reaction\",\r\n PollStart = \"org.matrix.msc3381.poll.start\",\r\n\r\n // Room ephemeral events\r\n Typing = \"m.typing\",\r\n Receipt = \"m.receipt\",\r\n Presence = \"m.presence\",\r\n\r\n // Room account_data events\r\n FullyRead = \"m.fully_read\",\r\n Tag = \"m.tag\",\r\n SpaceOrder = \"org.matrix.msc3230.space_order\", // MSC3230\r\n MarkedUnread = \"m.marked_unread\",\r\n\r\n // User account_data events\r\n PushRules = \"m.push_rules\",\r\n Direct = \"m.direct\",\r\n IgnoredUserList = \"m.ignored_user_list\",\r\n InvitePermissionConfig = \"m.invite_permission_config\", // MSC4380\r\n\r\n // to_device events\r\n RoomKey = \"m.room_key\",\r\n RoomKeyRequest = \"m.room_key_request\",\r\n ForwardedRoomKey = \"m.forwarded_room_key\",\r\n Dummy = \"m.dummy\",\r\n SecretRequest = \"m.secret.request\",\r\n SecretSend = \"m.secret.send\",\r\n\r\n // Group call events\r\n GroupCallPrefix = \"org.matrix.msc3401.call\",\r\n GroupCallMemberPrefix = \"org.matrix.msc3401.call.member\",\r\n\r\n // MatrixRTC events\r\n RTCMembership = \"org.matrix.msc4143.rtc.member\",\r\n CallNotify = \"org.matrix.msc4075.call.notify\",\r\n RTCNotification = \"org.matrix.msc4075.rtc.notification\",\r\n RTCDecline = \"org.matrix.msc4310.rtc.decline\",\r\n\r\n // Policy servers\r\n RoomPolicy = \"org.matrix.msc4284.policy\",\r\n}\r\n\r\nexport enum RelationType {\r\n Annotation = \"m.annotation\",\r\n Replace = \"m.replace\",\r\n Reference = \"m.reference\",\r\n\r\n // Don't use this yet: it's only the stable version. The code still assumes we support the unstable prefix and,\r\n // moreover, our tests currently use the unstable prefix. Use THREAD_RELATION_TYPE.name.\r\n // Once we support *only* the stable prefix, THREAD_RELATION_TYPE can die and we can switch to this.\r\n Thread = \"m.thread\",\r\n}\r\n\r\nexport enum MsgType {\r\n Text = \"m.text\",\r\n Emote = \"m.emote\",\r\n Notice = \"m.notice\",\r\n Image = \"m.image\",\r\n File = \"m.file\",\r\n Audio = \"m.audio\",\r\n Location = \"m.location\",\r\n Video = \"m.video\",\r\n KeyVerificationRequest = \"m.key.verification.request\",\r\n}\r\n\r\nexport const RoomCreateTypeField = \"type\";\r\n\r\nexport enum RoomType {\r\n Space = \"m.space\",\r\n UnstableCall = \"org.matrix.msc3417.call\",\r\n ElementVideo = \"io.element.video\",\r\n}\r\n\r\nexport const ToDeviceMessageId = \"org.matrix.msgid\";\r\n\r\n/**\r\n * Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)\r\n * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,\r\n * including its eventual removal.\r\n */\r\nexport const UNSTABLE_MSC3088_PURPOSE = new UnstableValue(\"m.room.purpose\", \"org.matrix.msc3088.purpose\");\r\n\r\n/**\r\n * Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)\r\n * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,\r\n * including its eventual removal.\r\n */\r\nexport const UNSTABLE_MSC3088_ENABLED = new UnstableValue(\"m.enabled\", \"org.matrix.msc3088.enabled\");\r\n\r\n/**\r\n * Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.\r\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\r\n * eventual removal.\r\n */\r\nexport const UNSTABLE_MSC3089_TREE_SUBTYPE = new UnstableValue(\"m.data_tree\", \"org.matrix.msc3089.data_tree\");\r\n\r\n/**\r\n * Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.\r\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\r\n * eventual removal.\r\n */\r\nexport const UNSTABLE_MSC3089_LEAF = new UnstableValue(\"m.leaf\", \"org.matrix.msc3089.leaf\");\r\n\r\n/**\r\n * Branch (Leaf Reference) type for the index approach in a\r\n * [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is\r\n * UNSTABLE and subject to breaking changes, including its eventual removal.\r\n */\r\nexport const UNSTABLE_MSC3089_BRANCH = new UnstableValue(\"m.branch\", \"org.matrix.msc3089.branch\");\r\n\r\n/**\r\n * Marker event type to point back at imported historical content in a room. See\r\n * [MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716).\r\n * Note that this reference is UNSTABLE and subject to breaking changes,\r\n * including its eventual removal.\r\n */\r\nexport const UNSTABLE_MSC2716_MARKER = new UnstableValue(\"m.room.marker\", \"org.matrix.msc2716.marker\");\r\n\r\n/**\r\n * Name of the request property for relation based redactions.\r\n * {@link https://github.com/matrix-org/matrix-spec-proposals/pull/3912}\r\n */\r\nexport const MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue(\r\n \"with_rel_types\",\r\n \"org.matrix.msc3912.with_relations\",\r\n);\r\n\r\n/**\r\n * Functional members type for declaring a purpose of room members (e.g. helpful bots).\r\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\r\n * eventual removal.\r\n *\r\n * Schema (TypeScript):\r\n * ```\r\n * {\r\n * service_members?: string[]\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```\r\n * {\r\n * \"service_members\": [\r\n * \"@helperbot:localhost\",\r\n * \"@reminderbot:alice.tdl\"\r\n * ]\r\n * }\r\n * ```\r\n */\r\nexport const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue(\r\n \"io.element.functional_members\",\r\n \"io.element.functional_members\",\r\n);\r\n\r\n/**\r\n * A type of message that affects visibility of a message,\r\n * as per https://github.com/matrix-org/matrix-doc/pull/3531\r\n *\r\n * @experimental\r\n */\r\nexport const EVENT_VISIBILITY_CHANGE_TYPE = new UnstableValue(\"m.visibility\", \"org.matrix.msc3531.visibility\");\r\n\r\n/**\r\n * https://github.com/matrix-org/matrix-doc/pull/3881\r\n *\r\n * @experimental\r\n */\r\nexport const PUSHER_ENABLED = new UnstableValue(\"enabled\", \"org.matrix.msc3881.enabled\");\r\n\r\n/**\r\n * https://github.com/matrix-org/matrix-doc/pull/3881\r\n *\r\n * @experimental\r\n */\r\nexport const PUSHER_DEVICE_ID = new UnstableValue(\"device_id\", \"org.matrix.msc3881.device_id\");\r\n\r\n/**\r\n * https://github.com/matrix-org/matrix-doc/pull/3890\r\n *\r\n * @experimental\r\n */\r\nexport const LOCAL_NOTIFICATION_SETTINGS_PREFIX = new UnstableValue(\r\n \"m.local_notification_settings\",\r\n \"org.matrix.msc3890.local_notification_settings\",\r\n);\r\n\r\n/**\r\n * https://github.com/matrix-org/matrix-doc/pull/4023\r\n *\r\n * @experimental\r\n */\r\nexport const UNSIGNED_THREAD_ID_FIELD = new UnstableValue(\"thread_id\", \"org.matrix.msc4023.thread_id\");\r\n\r\n/**\r\n * https://github.com/matrix-org/matrix-spec-proposals/pull/4115\r\n *\r\n * @experimental\r\n */\r\nexport const UNSIGNED_MEMBERSHIP_FIELD = new NamespacedValue(\"membership\", \"io.element.msc4115.membership\");\r\n\r\n/**\r\n * Mapped type from event type to content type for all specified non-state room events.\r\n */\r\nexport interface TimelineEvents {\r\n [EventType.RoomMessage]: RoomMessageEventContent;\r\n [EventType.Sticker]: StickerEventContent;\r\n [EventType.Reaction]: ReactionEventContent;\r\n [EventType.CallReplaces]: MCallReplacesEvent;\r\n [EventType.CallAnswer]: MCallAnswer;\r\n [EventType.CallSelectAnswer]: MCallSelectAnswer;\r\n [EventType.CallNegotiate]: Omit<MCallInviteNegotiate, \"offer\">;\r\n [EventType.CallInvite]: MCallInviteNegotiate;\r\n [EventType.CallCandidates]: MCallCandidates;\r\n [EventType.CallHangup]: MCallHangupReject;\r\n [EventType.CallReject]: MCallHangupReject;\r\n [EventType.CallSDPStreamMetadataChangedPrefix]: MCallBase &\r\n EitherAnd<\r\n { sdp_stream_metadata: SDPStreamMetadata },\r\n { \"org.matrix.msc3077.sdp_stream_metadata\": SDPStreamMetadata }\r\n >;\r\n [EventType.CallSDPStreamMetadataChanged]: MCallBase &\r\n EitherAnd<\r\n { sdp_stream_metadata: SDPStreamMetadata },\r\n { \"org.matrix.msc3077.sdp_stream_metadata\": SDPStreamMetadata }\r\n >;\r\n [EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;\r\n [EventType.CallNotify]: ICallNotifyContent;\r\n [EventType.RTCNotification]: IRTCNotificationContent;\r\n [EventType.RTCDecline]: IRTCDeclineContent;\r\n [M_BEACON.name]: MBeaconEventContent;\r\n [M_POLL_START.name]: PollStartEventContent;\r\n [M_POLL_END.name]: PollEndEventContent;\r\n [EventType.RTCMembership]: RtcMembershipData | { msc4354_sticky_key: string }; // An object containing just the sticky key is empty.\r\n}\r\n\r\n/**\r\n * Mapped type from event type to content type for all specified room state events.\r\n */\r\nexport interface StateEvents {\r\n [EventType.RoomCanonicalAlias]: RoomCanonicalAliasEventContent;\r\n [EventType.RoomCreate]: RoomCreateEventContent;\r\n [EventType.RoomJoinRules]: RoomJoinRulesEventContent;\r\n [EventType.RoomMember]: RoomMemberEventContent;\r\n // XXX: Spec says this event has 3 required fields but kicking such an invitation requires sending `{}`\r\n [EventType.RoomThirdPartyInvite]: RoomThirdPartyInviteEventContent | EmptyObject;\r\n [EventType.RoomPowerLevels]: RoomPowerLevelsEventContent;\r\n [EventType.RoomName]: RoomNameEventContent;\r\n [EventType.RoomTopic]: RoomTopicEventContent;\r\n [EventType.RoomAvatar]: RoomAvatarEventContent;\r\n [EventType.RoomPinnedEvents]: RoomPinnedEventsEventContent;\r\n [EventType.RoomEncryption]: RoomEncryptionEventContent;\r\n [EventType.RoomHistoryVisibility]: RoomHistoryVisibilityEventContent;\r\n [EventType.RoomGuestAccess]: RoomGuestAccessEventContent;\r\n [EventType.RoomServerAcl]: RoomServerAclEventContent;\r\n [EventType.RoomTombstone]: RoomTombstoneEventContent;\r\n [EventType.SpaceChild]: SpaceChildEventContent;\r\n [EventType.SpaceParent]: SpaceParentEventContent;\r\n\r\n [EventType.PolicyRuleUser]: PolicyRuleEventContent | EmptyObject;\r\n [EventType.PolicyRuleRoom]: PolicyRuleEventContent | EmptyObject;\r\n [EventType.PolicyRuleServer]: PolicyRuleEventContent | EmptyObject;\r\n\r\n // MSC4284: Policy servers\r\n [EventType.RoomPolicy]: RoomPolicyContent | EmptyObject;\r\n\r\n // MSC3401\r\n [EventType.GroupCallPrefix]: IGroupCallRoomState;\r\n [EventType.GroupCallMemberPrefix]: IGroupCallRoomMemberState | SessionMembershipData | EmptyObject;\r\n [EventType.RTCMembership]: RtcMembershipData | EmptyObject;\r\n // MSC3089\r\n [UNSTABLE_MSC3089_BRANCH.name]: MSC3089EventContent;\r\n\r\n // MSC3672\r\n [M_BEACON_INFO.name]: MBeaconInfoEventContent;\r\n}\r\n\r\n/**\r\n * Mapped type from event type to content type for all specified room-specific account_data events.\r\n */\r\nexport interface RoomAccountDataEvents extends SecretStorageAccountDataEvents {\r\n [EventType.FullyRead]: { event_id: string };\r\n [EventType.Tag]: { tags: { [name: string]: { order?: number } } };\r\n [EventType.SpaceOrder]: { order: string };\r\n [EventType.MarkedUnread]: { unread: boolean };\r\n}\r\n\r\n/**\r\n * Mapped type from event type to content type for all specified global account_data events.\r\n */\r\nexport interface AccountDataEvents extends SecretStorageAccountDataEvents {\r\n [EventType.PushRules]: IPushRules;\r\n [EventType.Direct]: { [userId: string]: string[] };\r\n [EventType.IgnoredUserList]: { ignored_users: { [userId: string]: EmptyObject } };\r\n \"m.secret_storage.default_key\": { key: string };\r\n // Flag set by the rust SDK (Element X) and also used by us to mark that the user opted out of backup\r\n // (I don't know why it's m.org.matrix...)\r\n \"m.org.matrix.custom.backup_disabled\": { disabled: boolean };\r\n \"m.identity_server\": { base_url: string | null };\r\n [key: `${typeof LOCAL_NOTIFICATION_SETTINGS_PREFIX.name}.${string}`]: LocalNotificationSettings;\r\n [key: `m.secret_storage.key.${string}`]: SecretStorageKeyDescription;\r\n\r\n // Invites-ignorer events\r\n [POLICIES_ACCOUNT_EVENT_TYPE.name]: { [key: string]: any };\r\n [POLICIES_ACCOUNT_EVENT_TYPE.altName]: { [key: string]: any };\r\n\r\n [EventType.InvitePermissionConfig]: { default_action?: string };\r\n}\r\n\r\n/**\r\n * Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12\r\n */\r\nexport type WritableAccountDataEvents = Exclude<AccountDataEvents, \"m.fully_read\" | \"m.push_rules\">;\r\n\r\n/**\r\n * Mapped type from event type to content type for all specified global events encrypted by secret storage.\r\n *\r\n * See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1\r\n */\r\nexport interface SecretStorageAccountDataEvents {\r\n \"m.megolm_backup.v1\": SecretInfo;\r\n \"m.cross_signing.master\": SecretInfo;\r\n \"m.cross_signing.self_signing\": SecretInfo;\r\n \"m.cross_signing.user_signing\": SecretInfo;\r\n \"org.matrix.msc3814\": SecretInfo;\r\n}\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,eAAe,EAAEC,aAAa,QAAQ,uBAAuB;AAkDtE,WAAYC,SAAS,0BAATA,SAAS;EACjB;EADQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAmBjB;EAnBQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EA2BjB;EA3BQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAoDjB;EApDQA,SAAS;EAsDjB;EAtDQA,SAAS;EAATA,SAAS;EAATA,SAAS;EA2DjB;EA3DQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAgEjB;EAhEQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAmE8B;EAnEvCA,SAAS;EAsEjB;EAtEQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EA0EsC;EAEvD;EA5EQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAoFjB;EApFQA,SAAS;EAATA,SAAS;EAwFjB;EAxFQA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EA8FjB;EA9FQA,SAAS;EAAA,OAATA,SAAS;AAAA;AAkGrB,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAKpB;EACA;EACA;EAPQA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAWxB,WAAYC,OAAO,0BAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;AAYnB,OAAO,IAAMC,mBAAmB,GAAG,MAAM;AAEzC,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAMpB,OAAO,IAAMC,iBAAiB,GAAG,kBAAkB;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,wBAAwB,GAAG,IAAIP,aAAa,CAAC,gBAAgB,EAAE,4BAA4B,CAAC;;AAEzG;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMQ,wBAAwB,GAAG,IAAIR,aAAa,CAAC,WAAW,EAAE,4BAA4B,CAAC;;AAEpG;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMS,6BAA6B,GAAG,IAAIT,aAAa,CAAC,aAAa,EAAE,8BAA8B,CAAC;;AAE7G;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMU,qBAAqB,GAAG,IAAIV,aAAa,CAAC,QAAQ,EAAE,yBAAyB,CAAC;;AAE3F;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMW,uBAAuB,GAAG,IAAIX,aAAa,CAAC,UAAU,EAAE,2BAA2B,CAAC;;AAEjG;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMY,uBAAuB,GAAG,IAAIZ,aAAa,CAAC,eAAe,EAAE,2BAA2B,CAAC;;AAEtG;AACA;AACA;AACA;AACA,OAAO,IAAMa,sCAAsC,GAAG,IAAIb,aAAa,CACnE,gBAAgB,EAChB,mCACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMc,iCAAiC,GAAG,IAAId,aAAa,CAC9D,+BAA+B,EAC/B,+BACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMe,4BAA4B,GAAG,IAAIf,aAAa,CAAC,cAAc,EAAE,+BAA+B,CAAC;;AAE9G;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMgB,cAAc,GAAG,IAAIhB,aAAa,CAAC,SAAS,EAAE,4BAA4B,CAAC;;AAExF;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMiB,gBAAgB,GAAG,IAAIjB,aAAa,CAAC,WAAW,EAAE,8BAA8B,CAAC;;AAE9F;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMkB,kCAAkC,GAAG,IAAIlB,aAAa,CAC/D,+BAA+B,EAC/B,gDACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMmB,wBAAwB,GAAG,IAAInB,aAAa,CAAC,WAAW,EAAE,8BAA8B,CAAC;;AAEtG;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMoB,yBAAyB,GAAG,IAAIrB,eAAe,CAAC,YAAY,EAAE,+BAA+B,CAAC;;AAE3G;AACA;AACA;;AAiCA;AACA;AACA;;AAuCA;AACA;AACA;;AAQA;AACA;AACA;;AAoBA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"event.js","names":["NamespacedValue","UnstableValue","EventType","RelationType","MsgType","RoomCreateTypeField","RoomType","ToDeviceMessageId","UNSTABLE_MSC3088_PURPOSE","UNSTABLE_MSC3088_ENABLED","UNSTABLE_MSC3089_TREE_SUBTYPE","UNSTABLE_MSC3089_LEAF","UNSTABLE_MSC3089_BRANCH","UNSTABLE_MSC2716_MARKER","MSC3912_RELATION_BASED_REDACTIONS_PROP","UNSTABLE_ELEMENT_FUNCTIONAL_USERS","EVENT_VISIBILITY_CHANGE_TYPE","PUSHER_ENABLED","PUSHER_DEVICE_ID","LOCAL_NOTIFICATION_SETTINGS_PREFIX","UNSIGNED_THREAD_ID_FIELD","UNSIGNED_MEMBERSHIP_FIELD"],"sources":["../../src/@types/event.ts"],"sourcesContent":["/*\nCopyright 2020-2026 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 EitherAnd } from \"matrix-events-sdk\";\n\nimport { NamespacedValue, UnstableValue } from \"../NamespacedValue.ts\";\nimport {\n type PolicyRuleEventContent,\n type RoomAvatarEventContent,\n type RoomCanonicalAliasEventContent,\n type RoomCreateEventContent,\n type RoomEncryptionEventContent,\n type RoomGuestAccessEventContent,\n type RoomHistoryVisibilityEventContent,\n type RoomJoinRulesEventContent,\n type RoomMemberEventContent,\n type RoomNameEventContent,\n type RoomPinnedEventsEventContent,\n type RoomPolicyContent,\n type RoomPowerLevelsEventContent,\n type RoomServerAclEventContent,\n type RoomThirdPartyInviteEventContent,\n type RoomTombstoneEventContent,\n type RoomTopicEventContent,\n type SpaceChildEventContent,\n type SpaceParentEventContent,\n} from \"./state_events.ts\";\nimport { type IGroupCallRoomMemberState, type IGroupCallRoomState } from \"../webrtc/groupCall.ts\";\nimport { type MSC3089EventContent } from \"../models/MSC3089Branch.ts\";\nimport { type M_BEACON, type M_BEACON_INFO, type MBeaconEventContent, type MBeaconInfoEventContent } from \"./beacon.ts\";\nimport { type EmptyObject } from \"./common.ts\";\nimport { type ReactionEventContent, type RoomMessageEventContent, type StickerEventContent } from \"./events.ts\";\nimport {\n type MCallAnswer,\n type MCallBase,\n type MCallCandidates,\n type MCallHangupReject,\n type MCallInviteNegotiate,\n type MCallReplacesEvent,\n type MCallSelectAnswer,\n type SDPStreamMetadata,\n} from \"../webrtc/callEventTypes.ts\";\nimport {\n type IRTCNotificationContent,\n type IRTCDeclineContent,\n type EncryptionKeysEventContent,\n type ICallNotifyContent,\n} from \"../matrixrtc/types.ts\";\nimport { type M_POLL_END, type M_POLL_START, type PollEndEventContent, type PollStartEventContent } from \"./polls.ts\";\nimport { type RtcMembershipData, type SessionMembershipData } from \"../matrixrtc/membershipData/index.ts\";\nimport { type LocalNotificationSettings } from \"./local_notifications.ts\";\nimport { type IPushRules } from \"./PushRules.ts\";\nimport { type SecretInfo, type SecretStorageKeyDescription } from \"../secret-storage.ts\";\nimport { type POLICIES_ACCOUNT_EVENT_TYPE } from \"../models/invites-ignorer-types.ts\";\n\nexport enum EventType {\n // Room state events\n RoomCanonicalAlias = \"m.room.canonical_alias\",\n RoomCreate = \"m.room.create\",\n RoomJoinRules = \"m.room.join_rules\",\n RoomMember = \"m.room.member\",\n RoomThirdPartyInvite = \"m.room.third_party_invite\",\n RoomPowerLevels = \"m.room.power_levels\",\n RoomName = \"m.room.name\",\n RoomTopic = \"m.room.topic\",\n RoomAvatar = \"m.room.avatar\",\n RoomPinnedEvents = \"m.room.pinned_events\",\n RoomEncryption = \"m.room.encryption\",\n RoomHistoryVisibility = \"m.room.history_visibility\",\n RoomGuestAccess = \"m.room.guest_access\",\n RoomServerAcl = \"m.room.server_acl\",\n RoomTombstone = \"m.room.tombstone\",\n RoomPredecessor = \"org.matrix.msc3946.room_predecessor\",\n\n // Moderation policy lists\n PolicyRuleUser = \"m.policy.rule.user\",\n PolicyRuleRoom = \"m.policy.rule.room\",\n PolicyRuleServer = \"m.policy.rule.server\",\n\n SpaceChild = \"m.space.child\",\n SpaceParent = \"m.space.parent\",\n\n // Room timeline events\n RoomRedaction = \"m.room.redaction\",\n RoomMessage = \"m.room.message\",\n RoomMessageEncrypted = \"m.room.encrypted\",\n Sticker = \"m.sticker\",\n CallInvite = \"m.call.invite\",\n CallCandidates = \"m.call.candidates\",\n CallAnswer = \"m.call.answer\",\n CallHangup = \"m.call.hangup\",\n CallReject = \"m.call.reject\",\n CallSelectAnswer = \"m.call.select_answer\",\n CallNegotiate = \"m.call.negotiate\",\n CallSDPStreamMetadataChanged = \"m.call.sdp_stream_metadata_changed\",\n CallSDPStreamMetadataChangedPrefix = \"org.matrix.call.sdp_stream_metadata_changed\",\n CallReplaces = \"m.call.replaces\",\n CallAssertedIdentity = \"m.call.asserted_identity\",\n CallAssertedIdentityPrefix = \"org.matrix.call.asserted_identity\",\n CallEncryptionKeysPrefix = \"io.element.call.encryption_keys\",\n KeyVerificationRequest = \"m.key.verification.request\",\n KeyVerificationStart = \"m.key.verification.start\",\n KeyVerificationCancel = \"m.key.verification.cancel\",\n KeyVerificationMac = \"m.key.verification.mac\",\n KeyVerificationDone = \"m.key.verification.done\",\n KeyVerificationKey = \"m.key.verification.key\",\n KeyVerificationAccept = \"m.key.verification.accept\",\n // Not used directly - see READY_TYPE in VerificationRequest.\n KeyVerificationReady = \"m.key.verification.ready\",\n // use of this is discouraged https://matrix.org/docs/spec/client_server/r0.6.1#m-room-message-feedback\n RoomMessageFeedback = \"m.room.message.feedback\",\n Reaction = \"m.reaction\",\n PollStart = \"org.matrix.msc3381.poll.start\",\n UserVerifyRequest = \"m.user.verify.request\",\n UserVerifyAccept = \"m.user.verify.accept\",\n UserVerified = \"m.user.verified\",\n\n // Room ephemeral events\n Typing = \"m.typing\",\n Receipt = \"m.receipt\",\n Presence = \"m.presence\",\n\n // Room account_data events\n FullyRead = \"m.fully_read\",\n Tag = \"m.tag\",\n SpaceOrder = \"org.matrix.msc3230.space_order\", // MSC3230\n MarkedUnread = \"m.marked_unread\",\n\n // User account_data events\n PushRules = \"m.push_rules\",\n Direct = \"m.direct\",\n IgnoredUserList = \"m.ignored_user_list\",\n InvitePermissionConfig = \"m.invite_permission_config\", // MSC4380\n\n // to_device events\n RoomKey = \"m.room_key\",\n RoomKeyRequest = \"m.room_key_request\",\n ForwardedRoomKey = \"m.forwarded_room_key\",\n Dummy = \"m.dummy\",\n SecretRequest = \"m.secret.request\",\n SecretSend = \"m.secret.send\",\n\n // Group call events\n GroupCallPrefix = \"org.matrix.msc3401.call\",\n GroupCallMemberPrefix = \"org.matrix.msc3401.call.member\",\n\n // MatrixRTC events\n RTCMembership = \"org.matrix.msc4143.rtc.member\",\n CallNotify = \"org.matrix.msc4075.call.notify\",\n RTCNotification = \"org.matrix.msc4075.rtc.notification\",\n RTCDecline = \"org.matrix.msc4310.rtc.decline\",\n\n // Policy servers\n RoomPolicy = \"org.matrix.msc4284.policy\",\n}\n\nexport enum RelationType {\n Annotation = \"m.annotation\",\n Replace = \"m.replace\",\n Reference = \"m.reference\",\n\n // Don't use this yet: it's only the stable version. The code still assumes we support the unstable prefix and,\n // moreover, our tests currently use the unstable prefix. Use THREAD_RELATION_TYPE.name.\n // Once we support *only* the stable prefix, THREAD_RELATION_TYPE can die and we can switch to this.\n Thread = \"m.thread\",\n}\n\nexport enum MsgType {\n Text = \"m.text\",\n Emote = \"m.emote\",\n Notice = \"m.notice\",\n Image = \"m.image\",\n File = \"m.file\",\n Audio = \"m.audio\",\n Location = \"m.location\",\n Video = \"m.video\",\n KeyVerificationRequest = \"m.key.verification.request\",\n}\n\nexport const RoomCreateTypeField = \"type\";\n\nexport enum RoomType {\n Space = \"m.space\",\n UnstableCall = \"org.matrix.msc3417.call\",\n ElementVideo = \"io.element.video\",\n}\n\nexport const ToDeviceMessageId = \"org.matrix.msgid\";\n\n/**\n * Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)\n * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,\n * including its eventual removal.\n */\nexport const UNSTABLE_MSC3088_PURPOSE = new UnstableValue(\"m.room.purpose\", \"org.matrix.msc3088.purpose\");\n\n/**\n * Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)\n * room purpose. Note that this reference is UNSTABLE and subject to breaking changes,\n * including its eventual removal.\n */\nexport const UNSTABLE_MSC3088_ENABLED = new UnstableValue(\"m.enabled\", \"org.matrix.msc3088.enabled\");\n\n/**\n * Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\n * eventual removal.\n */\nexport const UNSTABLE_MSC3089_TREE_SUBTYPE = new UnstableValue(\"m.data_tree\", \"org.matrix.msc3089.data_tree\");\n\n/**\n * Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\n * eventual removal.\n */\nexport const UNSTABLE_MSC3089_LEAF = new UnstableValue(\"m.leaf\", \"org.matrix.msc3089.leaf\");\n\n/**\n * Branch (Leaf Reference) type for the index approach in a\n * [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is\n * UNSTABLE and subject to breaking changes, including its eventual removal.\n */\nexport const UNSTABLE_MSC3089_BRANCH = new UnstableValue(\"m.branch\", \"org.matrix.msc3089.branch\");\n\n/**\n * Marker event type to point back at imported historical content in a room. See\n * [MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716).\n * Note that this reference is UNSTABLE and subject to breaking changes,\n * including its eventual removal.\n */\nexport const UNSTABLE_MSC2716_MARKER = new UnstableValue(\"m.room.marker\", \"org.matrix.msc2716.marker\");\n\n/**\n * Name of the request property for relation based redactions.\n * {@link https://github.com/matrix-org/matrix-spec-proposals/pull/3912}\n */\nexport const MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue(\n \"with_rel_types\",\n \"org.matrix.msc3912.with_relations\",\n);\n\n/**\n * Functional members type for declaring a purpose of room members (e.g. helpful bots).\n * Note that this reference is UNSTABLE and subject to breaking changes, including its\n * eventual removal.\n *\n * Schema (TypeScript):\n * ```\n * {\n * service_members?: string[]\n * }\n * ```\n *\n * @example\n * ```\n * {\n * \"service_members\": [\n * \"@helperbot:localhost\",\n * \"@reminderbot:alice.tdl\"\n * ]\n * }\n * ```\n */\nexport const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue(\n \"io.element.functional_members\",\n \"io.element.functional_members\",\n);\n\n/**\n * A type of message that affects visibility of a message,\n * as per https://github.com/matrix-org/matrix-doc/pull/3531\n *\n * @experimental\n */\nexport const EVENT_VISIBILITY_CHANGE_TYPE = new UnstableValue(\"m.visibility\", \"org.matrix.msc3531.visibility\");\n\n/**\n * https://github.com/matrix-org/matrix-doc/pull/3881\n *\n * @experimental\n */\nexport const PUSHER_ENABLED = new UnstableValue(\"enabled\", \"org.matrix.msc3881.enabled\");\n\n/**\n * https://github.com/matrix-org/matrix-doc/pull/3881\n *\n * @experimental\n */\nexport const PUSHER_DEVICE_ID = new UnstableValue(\"device_id\", \"org.matrix.msc3881.device_id\");\n\n/**\n * https://github.com/matrix-org/matrix-doc/pull/3890\n *\n * @experimental\n */\nexport const LOCAL_NOTIFICATION_SETTINGS_PREFIX = new UnstableValue(\n \"m.local_notification_settings\",\n \"org.matrix.msc3890.local_notification_settings\",\n);\n\n/**\n * https://github.com/matrix-org/matrix-doc/pull/4023\n *\n * @experimental\n */\nexport const UNSIGNED_THREAD_ID_FIELD = new UnstableValue(\"thread_id\", \"org.matrix.msc4023.thread_id\");\n\n/**\n * https://github.com/matrix-org/matrix-spec-proposals/pull/4115\n *\n * @experimental\n */\nexport const UNSIGNED_MEMBERSHIP_FIELD = new NamespacedValue(\"membership\", \"io.element.msc4115.membership\");\n\n/**\n * Mapped type from event type to content type for all specified non-state room events.\n */\nexport interface TimelineEvents {\n [EventType.RoomMessage]: RoomMessageEventContent;\n [EventType.Sticker]: StickerEventContent;\n [EventType.Reaction]: ReactionEventContent;\n [EventType.CallReplaces]: MCallReplacesEvent;\n [EventType.CallAnswer]: MCallAnswer;\n [EventType.CallSelectAnswer]: MCallSelectAnswer;\n [EventType.CallNegotiate]: Omit<MCallInviteNegotiate, \"offer\">;\n [EventType.CallInvite]: MCallInviteNegotiate;\n [EventType.CallCandidates]: MCallCandidates;\n [EventType.CallHangup]: MCallHangupReject;\n [EventType.CallReject]: MCallHangupReject;\n [EventType.CallSDPStreamMetadataChangedPrefix]: MCallBase &\n EitherAnd<\n { sdp_stream_metadata: SDPStreamMetadata },\n { \"org.matrix.msc3077.sdp_stream_metadata\": SDPStreamMetadata }\n >;\n [EventType.CallSDPStreamMetadataChanged]: MCallBase &\n EitherAnd<\n { sdp_stream_metadata: SDPStreamMetadata },\n { \"org.matrix.msc3077.sdp_stream_metadata\": SDPStreamMetadata }\n >;\n [EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;\n [EventType.CallNotify]: ICallNotifyContent;\n [EventType.RTCNotification]: IRTCNotificationContent;\n [EventType.RTCDecline]: IRTCDeclineContent;\n [M_BEACON.name]: MBeaconEventContent;\n [M_POLL_START.name]: PollStartEventContent;\n [M_POLL_END.name]: PollEndEventContent;\n [EventType.RTCMembership]: RtcMembershipData | { msc4354_sticky_key: string }; // An object containing just the sticky key is empty.\n [EventType.UserVerifyRequest]: {\n tx_hash: string;\n issuer_xrpl_address: string;\n target_xrpl_address: string;\n credential_type_bytes?: \"textrp_verify\";\n trust_model?: \"nft_metadata\";\n };\n [EventType.UserVerifyAccept]: {\n tx_hash: string;\n issuer_xrpl_address: string;\n accepter_xrpl_address: string;\n credential_type_bytes?: \"textrp_verify\";\n trust_model?: \"nft_metadata\";\n nft_token_id?: string;\n ipfs_uri?: string;\n };\n}\n\n/**\n * Mapped type from event type to content type for all specified room state events.\n */\nexport interface StateEvents {\n [EventType.RoomCanonicalAlias]: RoomCanonicalAliasEventContent;\n [EventType.RoomCreate]: RoomCreateEventContent;\n [EventType.RoomJoinRules]: RoomJoinRulesEventContent;\n [EventType.RoomMember]: RoomMemberEventContent;\n // XXX: Spec says this event has 3 required fields but kicking such an invitation requires sending `{}`\n [EventType.RoomThirdPartyInvite]: RoomThirdPartyInviteEventContent | EmptyObject;\n [EventType.RoomPowerLevels]: RoomPowerLevelsEventContent;\n [EventType.RoomName]: RoomNameEventContent;\n [EventType.RoomTopic]: RoomTopicEventContent;\n [EventType.RoomAvatar]: RoomAvatarEventContent;\n [EventType.RoomPinnedEvents]: RoomPinnedEventsEventContent;\n [EventType.RoomEncryption]: RoomEncryptionEventContent;\n [EventType.RoomHistoryVisibility]: RoomHistoryVisibilityEventContent;\n [EventType.RoomGuestAccess]: RoomGuestAccessEventContent;\n [EventType.RoomServerAcl]: RoomServerAclEventContent;\n [EventType.RoomTombstone]: RoomTombstoneEventContent;\n [EventType.SpaceChild]: SpaceChildEventContent;\n [EventType.SpaceParent]: SpaceParentEventContent;\n\n [EventType.PolicyRuleUser]: PolicyRuleEventContent | EmptyObject;\n [EventType.PolicyRuleRoom]: PolicyRuleEventContent | EmptyObject;\n [EventType.PolicyRuleServer]: PolicyRuleEventContent | EmptyObject;\n\n // MSC4284: Policy servers\n [EventType.RoomPolicy]: RoomPolicyContent | EmptyObject;\n\n // MSC3401\n [EventType.GroupCallPrefix]: IGroupCallRoomState;\n [EventType.GroupCallMemberPrefix]: IGroupCallRoomMemberState | SessionMembershipData | EmptyObject;\n [EventType.RTCMembership]: RtcMembershipData | EmptyObject;\n // MSC3089\n [UNSTABLE_MSC3089_BRANCH.name]: MSC3089EventContent;\n\n // MSC3672\n [M_BEACON_INFO.name]: MBeaconInfoEventContent;\n [EventType.UserVerified]: {\n status: \"requested\" | \"verified\";\n credential_type?: \"textrp_verify\";\n trust_model?: \"nft_metadata\";\n tx_hash: string;\n validated: boolean;\n [key: string]: unknown;\n };\n}\n\n/**\n * Mapped type from event type to content type for all specified room-specific account_data events.\n */\nexport interface RoomAccountDataEvents extends SecretStorageAccountDataEvents {\n [EventType.FullyRead]: { event_id: string };\n [EventType.Tag]: { tags: { [name: string]: { order?: number } } };\n [EventType.SpaceOrder]: { order: string };\n [EventType.MarkedUnread]: { unread: boolean };\n}\n\n/**\n * Mapped type from event type to content type for all specified global account_data events.\n */\nexport interface AccountDataEvents extends SecretStorageAccountDataEvents {\n [EventType.PushRules]: IPushRules;\n [EventType.Direct]: { [userId: string]: string[] };\n [EventType.IgnoredUserList]: { ignored_users: { [userId: string]: EmptyObject } };\n \"m.secret_storage.default_key\": { key: string };\n // Flag set by the rust SDK (Element X) and also used by us to mark that the user opted out of backup\n // (I don't know why it's m.org.matrix...)\n \"m.org.matrix.custom.backup_disabled\": { disabled: boolean };\n \"m.identity_server\": { base_url: string | null };\n [key: `${typeof LOCAL_NOTIFICATION_SETTINGS_PREFIX.name}.${string}`]: LocalNotificationSettings;\n [key: `m.secret_storage.key.${string}`]: SecretStorageKeyDescription;\n\n // Invites-ignorer events\n [POLICIES_ACCOUNT_EVENT_TYPE.name]: { [key: string]: any };\n [POLICIES_ACCOUNT_EVENT_TYPE.altName]: { [key: string]: any };\n\n [EventType.InvitePermissionConfig]: { default_action?: string };\n}\n\n/**\n * Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12\n */\nexport type WritableAccountDataEvents = Exclude<AccountDataEvents, \"m.fully_read\" | \"m.push_rules\">;\n\n/**\n * Mapped type from event type to content type for all specified global events encrypted by secret storage.\n *\n * See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1\n */\nexport interface SecretStorageAccountDataEvents {\n \"m.megolm_backup.v1\": SecretInfo;\n \"m.cross_signing.master\": SecretInfo;\n \"m.cross_signing.self_signing\": SecretInfo;\n \"m.cross_signing.user_signing\": SecretInfo;\n \"org.matrix.msc3814\": SecretInfo;\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":[],"sources":["../../src/@types/events.ts"],"sourcesContent":["/*\r\nCopyright 2024 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\nimport { type MsgType, type RelationType } from \"./event.ts\";\r\nimport { type FileInfo, type ImageInfo, type MediaEventContent } from \"./media.ts\";\r\nimport { type XOR } from \"./common.ts\";\r\n\r\ninterface BaseTimelineEvent {\r\n \"body\": string;\r\n \"m.mentions\"?: {\r\n user_ids?: string[];\r\n room?: boolean;\r\n };\r\n}\r\n\r\ninterface ReplyEvent {\r\n \"m.relates_to\"?: {\r\n \"m.in_reply_to\"?: {\r\n event_id: string;\r\n };\r\n };\r\n}\r\n\r\ninterface NoRelationEvent {\r\n \"m.new_content\"?: never;\r\n \"m.relates_to\"?: never;\r\n}\r\n\r\n/**\r\n * Partial content format of timeline events with rel_type `m.replace`\r\n *\r\n * @see https://spec.matrix.org/v1.9/client-server-api/#event-replacements\r\n */\r\nexport interface ReplacementEvent<T> {\r\n \"m.new_content\": T;\r\n \"m.relates_to\": {\r\n event_id: string;\r\n rel_type: RelationType.Replace;\r\n };\r\n}\r\n\r\n/**\r\n * Partial content format of timeline events with rel_type other than `m.replace`\r\n *\r\n * @see https://spec.matrix.org/v1.9/client-server-api/#forming-relationships-between-events\r\n */\r\nexport interface RelationEvent {\r\n \"m.new_content\"?: never;\r\n \"m.relates_to\": {\r\n event_id: string;\r\n rel_type: Exclude<RelationType, RelationType.Replace>;\r\n };\r\n}\r\n\r\n/**\r\n * Content format of timeline events with type `m.room.message` and `msgtype` `m.text`, `m.emote`, or `m.notice`\r\n *\r\n * @see https://spec.matrix.org/v1.9/client-server-api/#mroommessage\r\n */\r\nexport interface RoomMessageTextEventContent extends BaseTimelineEvent {\r\n msgtype: MsgType.Text | MsgType.Emote | MsgType.Notice;\r\n format?: \"org.matrix.custom.html\";\r\n formatted_body?: string;\r\n}\r\n\r\n/**\r\n * Content format of timeline events with type `m.room.message` and `msgtype` `m.location`\r\n *\r\n * @see https://spec.matrix.org/v1.9/client-server-api/#mlocation\r\n */\r\nexport interface RoomMessageLocationEventContent extends BaseTimelineEvent {\r\n body: string;\r\n geo_uri: string;\r\n info: Pick<FileInfo, \"thumbnail_info\" | \"thumbnail_file\" | \"thumbnail_url\">;\r\n msgtype: MsgType.Location;\r\n}\r\n\r\ntype MessageEventContent = RoomMessageTextEventContent | RoomMessageLocationEventContent | MediaEventContent;\r\n\r\nexport type RoomMessageEventContent = BaseTimelineEvent &\r\n XOR<XOR<ReplacementEvent<MessageEventContent>, RelationEvent>, XOR<ReplyEvent, NoRelationEvent>> &\r\n MessageEventContent;\r\n\r\n/**\r\n * Content format of timeline events with type `m.sticker`\r\n *\r\n * @see https://spec.matrix.org/v1.9/client-server-api/#msticker\r\n */\r\nexport interface StickerEventContent extends BaseTimelineEvent {\r\n body: string;\r\n info: ImageInfo;\r\n url: string;\r\n}\r\n\r\n/**\r\n * Content format of timeline events with type `m.reaction`\r\n *\r\n * @see https://spec.matrix.org/v1.9/client-server-api/#mreaction\r\n */\r\nexport interface ReactionEventContent {\r\n \"m.relates_to\": {\r\n event_id: string;\r\n key: string;\r\n rel_type: RelationType.Annotation;\r\n };\r\n}\r\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"events.js","names":[],"sources":["../../src/@types/events.ts"],"sourcesContent":["/*\nCopyright 2024 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 MsgType, type RelationType } from \"./event.ts\";\nimport { type FileInfo, type ImageInfo, type MediaEventContent } from \"./media.ts\";\nimport { type XOR } from \"./common.ts\";\n\ninterface BaseTimelineEvent {\n \"body\": string;\n \"m.mentions\"?: {\n user_ids?: string[];\n room?: boolean;\n };\n}\n\ninterface ReplyEvent {\n \"m.relates_to\"?: {\n \"m.in_reply_to\"?: {\n event_id: string;\n };\n };\n}\n\ninterface NoRelationEvent {\n \"m.new_content\"?: never;\n \"m.relates_to\"?: never;\n}\n\n/**\n * Partial content format of timeline events with rel_type `m.replace`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#event-replacements\n */\nexport interface ReplacementEvent<T> {\n \"m.new_content\": T;\n \"m.relates_to\": {\n event_id: string;\n rel_type: RelationType.Replace;\n };\n}\n\n/**\n * Partial content format of timeline events with rel_type other than `m.replace`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#forming-relationships-between-events\n */\nexport interface RelationEvent {\n \"m.new_content\"?: never;\n \"m.relates_to\": {\n event_id: string;\n rel_type: Exclude<RelationType, RelationType.Replace>;\n };\n}\n\n/**\n * Content format of timeline events with type `m.room.message` and `msgtype` `m.text`, `m.emote`, or `m.notice`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#mroommessage\n */\nexport interface RoomMessageTextEventContent extends BaseTimelineEvent {\n msgtype: MsgType.Text | MsgType.Emote | MsgType.Notice;\n format?: \"org.matrix.custom.html\";\n formatted_body?: string;\n}\n\n/**\n * Content format of timeline events with type `m.room.message` and `msgtype` `m.location`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#mlocation\n */\nexport interface RoomMessageLocationEventContent extends BaseTimelineEvent {\n body: string;\n geo_uri: string;\n info: Pick<FileInfo, \"thumbnail_info\" | \"thumbnail_file\" | \"thumbnail_url\">;\n msgtype: MsgType.Location;\n}\n\ntype MessageEventContent = RoomMessageTextEventContent | RoomMessageLocationEventContent | MediaEventContent;\n\nexport type RoomMessageEventContent = BaseTimelineEvent &\n XOR<XOR<ReplacementEvent<MessageEventContent>, RelationEvent>, XOR<ReplyEvent, NoRelationEvent>> &\n MessageEventContent;\n\n/**\n * Content format of timeline events with type `m.sticker`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#msticker\n */\nexport interface StickerEventContent extends BaseTimelineEvent {\n body: string;\n info: ImageInfo;\n url: string;\n}\n\n/**\n * Content format of timeline events with type `m.reaction`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#mreaction\n */\nexport interface ReactionEventContent {\n \"m.relates_to\": {\n event_id: string;\n key: string;\n rel_type: RelationType.Annotation;\n };\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,17 +1,17 @@
1
- /*
2
- Copyright 2021 - 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 2021 - 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
17
  import { NamespacedValue, UnstableValue } from "matrix-events-sdk";
@@ -19,82 +19,82 @@ import { isProvided } from "../extensible_events_v1/utilities.js";
19
19
 
20
20
  // Types and utilities for MSC1767: Extensible events (version 1) in Matrix
21
21
 
22
- /**
23
- * Represents the stable and unstable values of a given namespace.
22
+ /**
23
+ * Represents the stable and unstable values of a given namespace.
24
24
  */
25
25
 
26
- /**
27
- * Represents a namespaced value, if the value is a string. Used to extract provided types
28
- * from a TSNamespace<N> (in cases where only stable *or* unstable is provided).
26
+ /**
27
+ * Represents a namespaced value, if the value is a string. Used to extract provided types
28
+ * from a TSNamespace<N> (in cases where only stable *or* unstable is provided).
29
29
  */
30
30
 
31
- /**
32
- * Creates a type which is V when T is `never`, otherwise T.
31
+ /**
32
+ * Creates a type which is V when T is `never`, otherwise T.
33
33
  */
34
34
  // See https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887 for details on the array syntax.
35
35
 
36
- /**
37
- * The namespaced value for m.message
36
+ /**
37
+ * The namespaced value for m.message
38
38
  */
39
39
  export var M_MESSAGE = new UnstableValue("m.message", "org.matrix.msc1767.message");
40
40
 
41
- /**
42
- * An m.message event rendering
41
+ /**
42
+ * An m.message event rendering
43
43
  */
44
44
 
45
- /**
46
- * The content for an m.message event
45
+ /**
46
+ * The content for an m.message event
47
47
  */
48
48
 
49
- /**
50
- * The namespaced value for m.text
49
+ /**
50
+ * The namespaced value for m.text
51
51
  */
52
52
  export var M_TEXT = new UnstableValue("m.text", "org.matrix.msc1767.text");
53
53
 
54
- /**
55
- * The content for an m.text event
54
+ /**
55
+ * The content for an m.text event
56
56
  */
57
57
 
58
- /**
59
- * The namespaced value for m.html
58
+ /**
59
+ * The namespaced value for m.html
60
60
  */
61
61
  export var M_HTML = new UnstableValue("m.html", "org.matrix.msc1767.html");
62
62
 
63
- /**
64
- * The content for an m.html event
63
+ /**
64
+ * The content for an m.html event
65
65
  */
66
66
 
67
- /**
68
- * The content for an m.message, m.text, or m.html event
67
+ /**
68
+ * The content for an m.message, m.text, or m.html event
69
69
  */
70
70
 
71
- /**
72
- * The namespaced value for an m.reference relation
71
+ /**
72
+ * The namespaced value for an m.reference relation
73
73
  */
74
74
  export var REFERENCE_RELATION = new NamespacedValue("m.reference");
75
75
 
76
- /**
77
- * Represents any relation type
76
+ /**
77
+ * Represents any relation type
78
78
  */
79
79
 
80
- /**
81
- * An m.relates_to relationship
80
+ /**
81
+ * An m.relates_to relationship
82
82
  */
83
83
 
84
- /**
85
- * Partial types for a Matrix Event.
84
+ /**
85
+ * Partial types for a Matrix Event.
86
86
  */
87
87
 
88
- /**
89
- * Represents a potentially namespaced event type.
88
+ /**
89
+ * Represents a potentially namespaced event type.
90
90
  */
91
91
 
92
- /**
93
- * Determines if two event types are the same, including namespaces.
94
- * @param given - The given event type. This will be compared
95
- * against the expected type.
96
- * @param expected - The expected event type.
97
- * @returns True if the given type matches the expected type.
92
+ /**
93
+ * Determines if two event types are the same, including namespaces.
94
+ * @param given - The given event type. This will be compared
95
+ * against the expected type.
96
+ * @param expected - The expected event type.
97
+ * @returns True if the given type matches the expected type.
98
98
  */
99
99
  export function isEventTypeSame(given, expected) {
100
100
  if (typeof given === "string") {
@@ -1 +1 @@
1
- {"version":3,"file":"extensible_events.js","names":["NamespacedValue","UnstableValue","isProvided","M_MESSAGE","M_TEXT","M_HTML","REFERENCE_RELATION","isEventTypeSame","given","expected","matches","expectedNs","givenNs","name","altName"],"sources":["../../src/@types/extensible_events.ts"],"sourcesContent":["/*\r\nCopyright 2021 - 2023 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\nimport { type EitherAnd, NamespacedValue, UnstableValue } from \"matrix-events-sdk\";\r\n\r\nimport { isProvided } from \"../extensible_events_v1/utilities.ts\";\r\n\r\n// Types and utilities for MSC1767: Extensible events (version 1) in Matrix\r\n\r\n/**\r\n * Represents the stable and unstable values of a given namespace.\r\n */\r\nexport type TSNamespace<N> =\r\n N extends NamespacedValue<infer S, infer U> ? TSNamespaceValue<S> | TSNamespaceValue<U> : never;\r\n\r\n/**\r\n * Represents a namespaced value, if the value is a string. Used to extract provided types\r\n * from a TSNamespace<N> (in cases where only stable *or* unstable is provided).\r\n */\r\nexport type TSNamespaceValue<V> = V extends string ? V : never;\r\n\r\n/**\r\n * Creates a type which is V when T is `never`, otherwise T.\r\n */\r\n// See https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887 for details on the array syntax.\r\nexport type DefaultNever<T, V> = [T] extends [never] ? V : T;\r\n\r\n/**\r\n * The namespaced value for m.message\r\n */\r\nexport const M_MESSAGE = new UnstableValue(\"m.message\", \"org.matrix.msc1767.message\");\r\n\r\n/**\r\n * An m.message event rendering\r\n */\r\nexport interface IMessageRendering {\r\n body: string;\r\n mimetype?: string;\r\n}\r\n\r\n/**\r\n * The content for an m.message event\r\n */\r\nexport type ExtensibleMessageEventContent = EitherAnd<\r\n { [M_MESSAGE.name]: IMessageRendering[] },\r\n { [M_MESSAGE.altName]: IMessageRendering[] }\r\n>;\r\n\r\n/**\r\n * The namespaced value for m.text\r\n */\r\nexport const M_TEXT = new UnstableValue(\"m.text\", \"org.matrix.msc1767.text\");\r\n\r\n/**\r\n * The content for an m.text event\r\n */\r\nexport type TextEventContent = EitherAnd<{ [M_TEXT.name]: string }, { [M_TEXT.altName]: string }>;\r\n\r\n/**\r\n * The namespaced value for m.html\r\n */\r\nexport const M_HTML = new UnstableValue(\"m.html\", \"org.matrix.msc1767.html\");\r\n\r\n/**\r\n * The content for an m.html event\r\n */\r\nexport type HtmlEventContent = EitherAnd<{ [M_HTML.name]: string }, { [M_HTML.altName]: string }>;\r\n\r\n/**\r\n * The content for an m.message, m.text, or m.html event\r\n */\r\nexport type ExtensibleAnyMessageEventContent = ExtensibleMessageEventContent | TextEventContent | HtmlEventContent;\r\n\r\n/**\r\n * The namespaced value for an m.reference relation\r\n */\r\nexport const REFERENCE_RELATION = new NamespacedValue(\"m.reference\");\r\n\r\n/**\r\n * Represents any relation type\r\n */\r\nexport type AnyRelation = TSNamespace<typeof REFERENCE_RELATION> | string;\r\n\r\n/**\r\n * An m.relates_to relationship\r\n */\r\nexport type RelatesToRelationship<R = never> = {\r\n \"m.relates_to\": {\r\n // See https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887 for array syntax\r\n rel_type: [R] extends [never] ? AnyRelation : TSNamespace<R>;\r\n event_id: string;\r\n };\r\n};\r\n\r\n/**\r\n * Partial types for a Matrix Event.\r\n */\r\nexport interface IPartialEvent<TContent> {\r\n type: string;\r\n content: TContent;\r\n}\r\n\r\n/**\r\n * Represents a potentially namespaced event type.\r\n */\r\nexport type ExtensibleEventType = NamespacedValue<string, string> | string;\r\n\r\n/**\r\n * Determines if two event types are the same, including namespaces.\r\n * @param given - The given event type. This will be compared\r\n * against the expected type.\r\n * @param expected - The expected event type.\r\n * @returns True if the given type matches the expected type.\r\n */\r\nexport function isEventTypeSame(given: ExtensibleEventType | null, expected: ExtensibleEventType | null): boolean {\r\n if (typeof given === \"string\") {\r\n if (typeof expected === \"string\") {\r\n return expected === given;\r\n } else {\r\n return (expected as NamespacedValue<string, string>).matches(given as string);\r\n }\r\n } else {\r\n if (typeof expected === \"string\") {\r\n return (given as NamespacedValue<string, string>).matches(expected as string);\r\n } else {\r\n const expectedNs = expected as NamespacedValue<string, string>;\r\n const givenNs = given as NamespacedValue<string, string>;\r\n return (\r\n expectedNs.matches(givenNs.name) ||\r\n (isProvided(givenNs.altName) && expectedNs.matches(givenNs.altName!))\r\n );\r\n }\r\n }\r\n}\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAyBA,eAAe,EAAEC,aAAa,QAAQ,mBAAmB;AAElF,SAASC,UAAU,QAAQ,sCAAsC;;AAEjE;;AAEA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,IAAMC,SAAS,GAAG,IAAIF,aAAa,CAAC,WAAW,EAAE,4BAA4B,CAAC;;AAErF;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;AACA,OAAO,IAAMG,MAAM,GAAG,IAAIH,aAAa,CAAC,QAAQ,EAAE,yBAAyB,CAAC;;AAE5E;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,IAAMI,MAAM,GAAG,IAAIJ,aAAa,CAAC,QAAQ,EAAE,yBAAyB,CAAC;;AAE5E;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,IAAMK,kBAAkB,GAAG,IAAIN,eAAe,CAAC,aAAa,CAAC;;AAEpE;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,eAAeA,CAACC,KAAiC,EAAEC,QAAoC,EAAW;EAC9G,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC3B,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MAC9B,OAAOA,QAAQ,KAAKD,KAAK;IAC7B,CAAC,MAAM;MACH,OAAQC,QAAQ,CAAqCC,OAAO,CAACF,KAAe,CAAC;IACjF;EACJ,CAAC,MAAM;IACH,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MAC9B,OAAQD,KAAK,CAAqCE,OAAO,CAACD,QAAkB,CAAC;IACjF,CAAC,MAAM;MACH,IAAME,UAAU,GAAGF,QAA2C;MAC9D,IAAMG,OAAO,GAAGJ,KAAwC;MACxD,OACIG,UAAU,CAACD,OAAO,CAACE,OAAO,CAACC,IAAI,CAAC,IAC/BX,UAAU,CAACU,OAAO,CAACE,OAAO,CAAC,IAAIH,UAAU,CAACD,OAAO,CAACE,OAAO,CAACE,OAAQ,CAAE;IAE7E;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"extensible_events.js","names":["NamespacedValue","UnstableValue","isProvided","M_MESSAGE","M_TEXT","M_HTML","REFERENCE_RELATION","isEventTypeSame","given","expected","matches","expectedNs","givenNs","name","altName"],"sources":["../../src/@types/extensible_events.ts"],"sourcesContent":["/*\nCopyright 2021 - 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\nimport { type EitherAnd, NamespacedValue, UnstableValue } from \"matrix-events-sdk\";\n\nimport { isProvided } from \"../extensible_events_v1/utilities.ts\";\n\n// Types and utilities for MSC1767: Extensible events (version 1) in Matrix\n\n/**\n * Represents the stable and unstable values of a given namespace.\n */\nexport type TSNamespace<N> =\n N extends NamespacedValue<infer S, infer U> ? TSNamespaceValue<S> | TSNamespaceValue<U> : never;\n\n/**\n * Represents a namespaced value, if the value is a string. Used to extract provided types\n * from a TSNamespace<N> (in cases where only stable *or* unstable is provided).\n */\nexport type TSNamespaceValue<V> = V extends string ? V : never;\n\n/**\n * Creates a type which is V when T is `never`, otherwise T.\n */\n// See https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887 for details on the array syntax.\nexport type DefaultNever<T, V> = [T] extends [never] ? V : T;\n\n/**\n * The namespaced value for m.message\n */\nexport const M_MESSAGE = new UnstableValue(\"m.message\", \"org.matrix.msc1767.message\");\n\n/**\n * An m.message event rendering\n */\nexport interface IMessageRendering {\n body: string;\n mimetype?: string;\n}\n\n/**\n * The content for an m.message event\n */\nexport type ExtensibleMessageEventContent = EitherAnd<\n { [M_MESSAGE.name]: IMessageRendering[] },\n { [M_MESSAGE.altName]: IMessageRendering[] }\n>;\n\n/**\n * The namespaced value for m.text\n */\nexport const M_TEXT = new UnstableValue(\"m.text\", \"org.matrix.msc1767.text\");\n\n/**\n * The content for an m.text event\n */\nexport type TextEventContent = EitherAnd<{ [M_TEXT.name]: string }, { [M_TEXT.altName]: string }>;\n\n/**\n * The namespaced value for m.html\n */\nexport const M_HTML = new UnstableValue(\"m.html\", \"org.matrix.msc1767.html\");\n\n/**\n * The content for an m.html event\n */\nexport type HtmlEventContent = EitherAnd<{ [M_HTML.name]: string }, { [M_HTML.altName]: string }>;\n\n/**\n * The content for an m.message, m.text, or m.html event\n */\nexport type ExtensibleAnyMessageEventContent = ExtensibleMessageEventContent | TextEventContent | HtmlEventContent;\n\n/**\n * The namespaced value for an m.reference relation\n */\nexport const REFERENCE_RELATION = new NamespacedValue(\"m.reference\");\n\n/**\n * Represents any relation type\n */\nexport type AnyRelation = TSNamespace<typeof REFERENCE_RELATION> | string;\n\n/**\n * An m.relates_to relationship\n */\nexport type RelatesToRelationship<R = never> = {\n \"m.relates_to\": {\n // See https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887 for array syntax\n rel_type: [R] extends [never] ? AnyRelation : TSNamespace<R>;\n event_id: string;\n };\n};\n\n/**\n * Partial types for a Matrix Event.\n */\nexport interface IPartialEvent<TContent> {\n type: string;\n content: TContent;\n}\n\n/**\n * Represents a potentially namespaced event type.\n */\nexport type ExtensibleEventType = NamespacedValue<string, string> | string;\n\n/**\n * Determines if two event types are the same, including namespaces.\n * @param given - The given event type. This will be compared\n * against the expected type.\n * @param expected - The expected event type.\n * @returns True if the given type matches the expected type.\n */\nexport function isEventTypeSame(given: ExtensibleEventType | null, expected: ExtensibleEventType | null): boolean {\n if (typeof given === \"string\") {\n if (typeof expected === \"string\") {\n return expected === given;\n } else {\n return (expected as NamespacedValue<string, string>).matches(given as string);\n }\n } else {\n if (typeof expected === \"string\") {\n return (given as NamespacedValue<string, string>).matches(expected as string);\n } else {\n const expectedNs = expected as NamespacedValue<string, string>;\n const givenNs = given as NamespacedValue<string, string>;\n return (\n expectedNs.matches(givenNs.name) ||\n (isProvided(givenNs.altName) && expectedNs.matches(givenNs.altName!))\n );\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAyBA,eAAe,EAAEC,aAAa,QAAQ,mBAAmB;AAElF,SAASC,UAAU,QAAQ,sCAAsC;;AAEjE;;AAEA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,IAAMC,SAAS,GAAG,IAAIF,aAAa,CAAC,WAAW,EAAE,4BAA4B,CAAC;;AAErF;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;AACA,OAAO,IAAMG,MAAM,GAAG,IAAIH,aAAa,CAAC,QAAQ,EAAE,yBAAyB,CAAC;;AAE5E;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,IAAMI,MAAM,GAAG,IAAIJ,aAAa,CAAC,QAAQ,EAAE,yBAAyB,CAAC;;AAE5E;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,IAAMK,kBAAkB,GAAG,IAAIN,eAAe,CAAC,aAAa,CAAC;;AAEpE;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,eAAeA,CAACC,KAAiC,EAAEC,QAAoC,EAAW;EAC9G,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC3B,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MAC9B,OAAOA,QAAQ,KAAKD,KAAK;IAC7B,CAAC,MAAM;MACH,OAAQC,QAAQ,CAAqCC,OAAO,CAACF,KAAe,CAAC;IACjF;EACJ,CAAC,MAAM;IACH,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MAC9B,OAAQD,KAAK,CAAqCE,OAAO,CAACD,QAAkB,CAAC;IACjF,CAAC,MAAM;MACH,IAAME,UAAU,GAAGF,QAA2C;MAC9D,IAAMG,OAAO,GAAGJ,KAAwC;MACxD,OACIG,UAAU,CAACD,OAAO,CAACE,OAAO,CAACC,IAAI,CAAC,IAC/BX,UAAU,CAACU,OAAO,CAACE,OAAO,CAAC,IAAIH,UAAU,CAACD,OAAO,CAACE,OAAO,CAACE,OAAQ,CAAE;IAE7E;EACJ;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"local_notifications.js","names":[],"sources":["../../src/@types/local_notifications.ts"],"sourcesContent":["/*\r\nCopyright 2022 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\nexport interface LocalNotificationSettings {\r\n is_silenced: boolean;\r\n}\r\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"local_notifications.js","names":[],"sources":["../../src/@types/local_notifications.ts"],"sourcesContent":["/*\nCopyright 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\nexport interface LocalNotificationSettings {\n is_silenced: boolean;\n}\n"],"mappings":"","ignoreList":[]}