feat: complete Ancestor quote bot with production-ready Docker support

This commit is contained in:
unfunny
2026-09-13 14:14:38 -04:00
parent f2016da05a
commit fe7351a7dc
1145 changed files with 30890 additions and 97684 deletions

1280
node_modules/matrix-js-sdk/CHANGELOG.md generated vendored

File diff suppressed because it is too large Load Diff

361
node_modules/matrix-js-sdk/README.md generated vendored
View File

@@ -11,24 +11,6 @@
This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a
browser or in Node.js.
---
<picture>
<source srcset="contrib/element-logo-light.png" media="(prefers-color-scheme: dark)">
<source srcset="contrib/element-logo-dark.png" media="(prefers-color-scheme: light)">
<img src="contrib/element-logo-fallback.png" alt="Element logo">
</picture>
<br>
Development and maintenance is proudly sponsored by [Element](https://element.io). Element uses the SDK in their flagship [web](https://github.com/element-hq/element-web) and [desktop](https://github.com/element-hq/element-desktop) clients.
The SDK is also the basis for multiple Matrix projects and we welcome contributions from all.
---
#### Minimum Matrix server version: v1.1
The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only
guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports
is removed in v1.4 then the feature is _eligible_ for removal from the SDK when v1.8 is released. This SDK has no
@@ -37,14 +19,32 @@ endpoints from before Matrix 1.1, for example.
# Quickstart
> [!IMPORTANT]
> Servers may require or use authenticated endpoints for media (images, files, avatars, etc). See the
> [Authenticated Media](#authenticated-media) section for information on how to enable support for this.
## In a browser
Using `pnpm` instead of `npm` is recommended. Please see the pnpm [install
guide](https://pnpm.io/installation#using-corepack) if you do not have it already.
### Note, the browserify build has been deprecated. Please use a bundler like webpack or vite instead.
`pnpm add matrix-js-sdk`
Download the browser version from
https://github.com/matrix-org/matrix-js-sdk/releases/latest and add that as a
`<script>` to your page. There will be a global variable `matrixcs`
attached to `window` through which you can access the SDK. See below for how to
include libolm to enable end-to-end-encryption.
The browser bundle supports recent versions of browsers. Typically this is ES2015
or `> 0.5%, last 2 versions, Firefox ESR, not dead` if using
[browserlists](https://github.com/browserslist/browserslist).
Please check [the working browser example](examples/browser) for more information.
## In Node.js
Ensure you have the latest LTS version of Node.js installed.
This library relies on `fetch` which is available in Node from v18.0.0 - it should work fine also with polyfills.
If you wish to use a ponyfill or adapter of some sort then pass it as `fetchFn` to the MatrixClient constructor options.
Using `yarn` instead of `npm` is recommended. Please see the Yarn [install guide](https://classic.yarnpkg.com/en/docs/install)
if you do not have it already.
`yarn add matrix-js-sdk`
```javascript
import * as sdk from "matrix-js-sdk";
@@ -54,8 +54,10 @@ client.publicRooms(function (err, data) {
});
```
See [below](#end-to-end-encryption-support) for how to enable end-to-end-encryption, or check
[the Node.js terminal app](https://github.com/matrix-org/matrix-js-sdk/tree/develop/examples/node) for a more complex example.
See below for how to include libolm to enable end-to-end-encryption. Please check
[the Node.js terminal app](examples/node) for a more complex example.
You can also use the sdk with [Deno](https://deno.land/) (`import npm:matrix-js-sdk`) but its not officialy supported.
To start the client:
@@ -66,7 +68,7 @@ await client.startClient({ initialSyncLimit: 10 });
You can perform a call to `/sync` to get the current state of the client:
```javascript
client.once(ClientEvent.sync, function (state, prevState, res) {
client.once("sync", function (state, prevState, res) {
if (state === "PREPARED") {
console.log("prepared");
} else {
@@ -91,7 +93,7 @@ client.sendEvent("roomId", "m.room.message", content, "", (err, res) => {
To listen for message events:
```javascript
client.on(RoomEvent.Timeline, function (event, room, toStartOfTimeline) {
client.on("Room.timeline", function (event, room, toStartOfTimeline) {
if (event.getType() !== "m.room.message") {
return; // only use messages
}
@@ -109,83 +111,55 @@ Object.keys(client.store.rooms).forEach((roomId) => {
});
```
## Authenticated media
Servers supporting [MSC3916](https://github.com/matrix-org/matrix-spec-proposals/pull/3916) (Matrix 1.11) will require clients, like
yours, to include an `Authorization` header when `/download`ing or `/thumbnail`ing media. For NodeJS environments this
may be as easy as the following code snippet, though web browsers may need to use [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)
to append the header when using the endpoints in `<img />` elements and similar.
```javascript
const downloadUrl = client.mxcUrlToHttp(
/*mxcUrl=*/ "mxc://example.org/abc123", // the MXC URI to download/thumbnail, typically from an event or profile
/*width=*/ undefined, // part of the thumbnail API. Use as required.
/*height=*/ undefined, // part of the thumbnail API. Use as required.
/*resizeMethod=*/ undefined, // part of the thumbnail API. Use as required.
/*allowDirectLinks=*/ false, // should generally be left `false`.
/*allowRedirects=*/ true, // implied supported with authentication
/*useAuthentication=*/ true, // the flag we're after in this example
);
const img = await fetch(downloadUrl, {
headers: {
Authorization: `Bearer ${client.getAccessToken()}`,
},
});
// Do something with `img`.
```
> [!WARNING]
> In future the js-sdk will _only_ return authentication-required URLs, mandating population of the `Authorization` header.
## What does this SDK do?
This SDK provides a full object model around the Matrix Client-Server API and emits
events for incoming data and state changes. Aside from wrapping the HTTP API, it:
- Handles syncing (via `/sync`)
- Handles the generation of "friendly" room and member names.
- Handles historical `RoomMember` information (e.g. display names).
- Manages room member state across multiple events (e.g. it handles typing, power
levels and membership changes).
- Exposes high-level objects like `Rooms`, `RoomState`, `RoomMembers` and `Users`
which can be listened to for things like name changes, new messages, membership
changes, presence changes, and more.
- Handle "local echo" of messages sent using the SDK. This means that messages
that have just been sent will appear in the timeline as 'sending', until it
completes. This is beneficial because it prevents there being a gap between
hitting the send button and having the "remote echo" arrive.
- Mark messages which failed to send as not sent.
- Automatically retry requests to send messages due to network errors.
- Automatically retry requests to send messages due to rate limiting errors.
- Handle queueing of messages.
- Handles pagination.
- Handle assigning push actions for events.
- Handles room initial sync on accepting invites.
- Handles WebRTC calling.
- Handles syncing (via `/initialSync` and `/events`)
- Handles the generation of "friendly" room and member names.
- Handles historical `RoomMember` information (e.g. display names).
- Manages room member state across multiple events (e.g. it handles typing, power
levels and membership changes).
- Exposes high-level objects like `Rooms`, `RoomState`, `RoomMembers` and `Users`
which can be listened to for things like name changes, new messages, membership
changes, presence changes, and more.
- Handle "local echo" of messages sent using the SDK. This means that messages
that have just been sent will appear in the timeline as 'sending', until it
completes. This is beneficial because it prevents there being a gap between
hitting the send button and having the "remote echo" arrive.
- Mark messages which failed to send as not sent.
- Automatically retry requests to send messages due to network errors.
- Automatically retry requests to send messages due to rate limiting errors.
- Handle queueing of messages.
- Handles pagination.
- Handle assigning push actions for events.
- Handles room initial sync on accepting invites.
- Handles WebRTC calling.
Later versions of the SDK will:
- Expose a `RoomSummary` which would be suitable for a recents page.
- Provide different pluggable storage layers (e.g. local storage, database-backed)
# Usage
## Supported platforms
## Conventions
`matrix-js-sdk` can be used in either Node.js applications (ensure you have the latest LTS version of Node.js installed),
or in browser applications, via a bundler such as Webpack or Vite.
### Emitted events
You can also use the sdk with [Deno](https://deno.land/) (`import npm:matrix-js-sdk`) but its not officially supported.
## Emitted events
The SDK raises notifications to the application using
[`EventEmitter`s](https://nodejs.org/api/events.html#class-eventemitter). The `MatrixClient` itself
implements `EventEmitter`, as do many of the high-level abstractions such as `Room` and `RoomMember`.
The SDK will emit events using an `EventEmitter`. It also
emits object models (e.g. `Rooms`, `RoomMembers`) when they
are updated.
```javascript
// Listen for low-level MatrixEvents
client.on(ClientEvent.Event, function (event) {
client.on("event", function (event) {
console.log(event.getType());
});
// Listen for typing changes
client.on(RoomMemberEvent.Typing, function (event, member) {
client.on("RoomMember.typing", function (event, member) {
if (member.typing) {
console.log(member.name + " is typing...");
} else {
@@ -197,23 +171,41 @@ client.on(RoomMemberEvent.Typing, function (event, member) {
client.startClient();
```
## Entry points
### Promises and Callbacks
As well as the primary entry point (`matrix-js-sdk`), there are several other entry points which may be useful:
Most of the methods in the SDK are asynchronous: they do not directly return a
result, but instead return a [Promise](http://documentup.com/kriskowal/q/)
which will be fulfilled in the future.
| Entry point | Description |
| ------------------------------ | --------------------------------------------------------------------------------------------------- |
| `matrix-js-sdk` | Primary entry point. High-level functionality, and lots of historical clutter in need of a cleanup. |
| `matrix-js-sdk/lib/crypto-api` | Cryptography functionality. |
| `matrix-js-sdk/lib/types` | Low-level types, reflecting data structures defined in the Matrix spec. |
| `matrix-js-sdk/lib/testing` | Test utilities, which may be useful in test code but should not be used in production code. |
| `matrix-js-sdk/lib/rendezvous` | Utilities around MSC4108 QR code login and rendezvous servers. |
| `matrix-js-sdk/lib/utils/*.js` | A set of modules exporting standalone functions (and their types). |
The typical usage is something like:
```javascript
matrixClient.someMethod(arg1, arg2).then(function(result) {
...
});
```
Alternatively, if you have a Node.js-style `callback(err, result)` function,
you can pass the result of the promise into it with something like:
```javascript
matrixClient.someMethod(arg1, arg2).nodeify(callback);
```
The main thing to note is that it is problematic to discard the result of a
promise-returning function, as that will cause exceptions to go unobserved.
Methods which return a promise show this in their documentation.
Many methods in the SDK support _both_ Node.js-style callbacks _and_ Promises,
via an optional `callback` argument. The callback support is now deprecated:
new methods do not include a `callback` argument, and in the future it may be
removed from existing methods.
## Examples
This section provides some useful code snippets which demonstrate the
core functionality of the SDK. These examples assume the SDK is set up like this:
core functionality of the SDK. These examples assume the SDK is setup like this:
```javascript
import * as sdk from "matrix-js-sdk";
@@ -229,10 +221,10 @@ const matrixClient = sdk.createClient({
### Automatically join rooms when invited
```javascript
matrixClient.on(RoomEvent.MyMembership, function (room, membership, prevMembership) {
if (membership === KnownMembership.Invite) {
matrixClient.joinRoom(room.roomId).then(function () {
console.log("Auto-joined %s", room.roomId);
matrixClient.on("RoomMember.membership", function (event, member) {
if (member.membership === "invite" && member.userId === myUserId) {
matrixClient.joinRoom(member.roomId).then(function () {
console.log("Auto-joined %s", member.roomId);
});
}
});
@@ -243,7 +235,7 @@ matrixClient.startClient();
### Print out messages for all rooms
```javascript
matrixClient.on(RoomEvent.Timeline, function (event, room, toStartOfTimeline) {
matrixClient.on("Room.timeline", function (event, room, toStartOfTimeline) {
if (toStartOfTimeline) {
return; // don't print paginated results
}
@@ -275,7 +267,7 @@ Output:
### Print out membership lists whenever they are changed
```javascript
matrixClient.on(RoomStateEvent.Members, function (event, state, member) {
matrixClient.on("RoomState.members", function (event, state, member) {
const room = matrixClient.getRoom(state.roomId);
if (!room) {
return;
@@ -311,8 +303,8 @@ This SDK uses [Typedoc](https://typedoc.org/guides/doccomments) doc comments. Yo
host the API reference from the source files like this:
```
$ pnpm gendoc
$ cd docs
$ yarn gendoc
$ cd _docs
$ python -m http.server 8005
```
@@ -320,131 +312,41 @@ Then visit `http://localhost:8005` to see the API docs.
# End-to-end encryption support
`matrix-js-sdk`'s end-to-end encryption support is based on the [WebAssembly bindings](https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm) of the Rust [matrix-sdk-crypto](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) library.
The SDK supports end-to-end encryption via the Olm and Megolm protocols, using
[libolm](https://gitlab.matrix.org/matrix-org/olm). It is left up to the
application to make libolm available, via the `Olm` global.
## Initialization
It is also necessary to call `await matrixClient.initCrypto()` after creating a new
`MatrixClient` (but **before** calling `matrixClient.startClient()`) to
initialise the crypto layer.
To initialize the end-to-end encryption support in the matrix client:
If the `Olm` global is not available, the SDK will show a warning, as shown
below; `initCrypto()` will also fail.
```javascript
// Create a new matrix client
const matrixClient = sdk.createClient({
baseUrl: "http://localhost:8008",
accessToken: myAccessToken,
userId: myUserId,
});
// Initialize to enable end-to-end encryption support.
await matrixClient.initRustCrypto();
```
Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
```
Note that by default it will attempt to use the Indexed DB provided by the browser as a crypto store. If running outside the browser, you will need to pass [an options object](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html#initrustcrypto) which includes `useIndexedDB: false`, to use an ephemeral in-memory store instead. Note that without a persistent store, you'll need to create a new device on the server side (with [`MatrixClient.loginRequest`](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html#loginrequest)) each time your application starts.
If the crypto layer is not (successfully) initialised, the SDK will continue to
work for unencrypted rooms, but it will not support the E2E parts of the Matrix
specification.
After calling `initRustCrypto`, you can obtain a reference to the [`CryptoApi`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto-api.CryptoApi.html) interface, which is the main entry point for end-to-end encryption, by calling [`MatrixClient.getCrypto`](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html#getCrypto).
To provide the Olm library in a browser application:
**WARNING**: the cryptography stack is not thread-safe. Having multiple `MatrixClient` instances connected to the same Indexed DB will cause data corruption and decryption failures. The application layer is responsible for ensuring that only one `MatrixClient` issue is instantiated at a time.
- download the transpiled libolm (from https://packages.matrix.org/npm/olm/).
- load `olm.js` as a `<script>` _before_ `browser-matrix.js`.
## Secret storage
To provide the Olm library in a node.js application:
You should normally set up [secret storage](https://spec.matrix.org/v1.12/client-server-api/#secret-storage) before using the end-to-end encryption. To do this, call [`CryptoApi.bootstrapSecretStorage`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html#bootstrapSecretStorage).
`bootstrapSecretStorage` can be called unconditionally: it will only set up the secret storage if it is not already set up (unless you use the `setupNewSecretStorage` parameter).
- `yarn add https://packages.matrix.org/npm/olm/olm-3.1.4.tgz`
(replace the URL with the latest version you want to use from
https://packages.matrix.org/npm/olm/)
- `global.Olm = require('olm');` _before_ loading `matrix-js-sdk`.
```javascript
const matrixClient = sdk.createClient({
...,
cryptoCallbacks: {
getSecretStorageKey: async (keys) => {
// This function should prompt the user to enter their secret storage key.
return mySecretStorageKeys;
},
},
});
matrixClient.getCrypto().bootstrapSecretStorage({
// This function will be called if a new secret storage key (aka recovery key) is needed.
// You should prompt the user to save the key somewhere, because they will need it to unlock secret storage in future.
createSecretStorageKey: async () => {
return mySecretStorageKey;
},
});
```
The example above will create a new secret storage key if secret storage was not previously set up.
The secret storage data will be encrypted using the secret storage key returned in [`createSecretStorageKey`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CreateSecretStorageOpts.html#createSecretStorageKey).
We recommend that you prompt the user to re-enter this key when [`CryptoCallbacks.getSecretStorageKey`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoCallbacks.html#getSecretStorageKey) is called (when the secret storage access is needed).
## Set up cross-signing
To set up cross-signing to verify devices and other users, call
[`CryptoApi.bootstrapCrossSigning`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html#bootstrapCrossSigning):
```javascript
matrixClient.getCrypto().bootstrapCrossSigning({
authUploadDeviceSigningKeys: async (makeRequest) => {
return makeRequest(authDict);
},
});
```
The [`authUploadDeviceSigningKeys`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.BootstrapCrossSigningOpts.html#authUploadDeviceSigningKeys)
callback is required in order to upload newly-generated public cross-signing keys to the server.
## Key backup
If the user doesn't already have a [key backup](https://spec.matrix.org/v1.12/client-server-api/#server-side-key-backups) you should create one:
```javascript
// Check if we have a key backup.
// If checkKeyBackupAndEnable returns null, there is no key backup.
const hasKeyBackup = (await matrixClient.getCrypto().checkKeyBackupAndEnable()) !== null;
// Create the key backup
await matrixClient.getCrypto().resetKeyBackup();
```
## Verify a new device
Once the cross-signing is set up on one of your devices, you can verify another device with two methods:
1. Use `CryptoApi.bootstrapCrossSigning`.
`bootstrapCrossSigning` will call the [CryptoCallbacks.getSecretStorageKey](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoCallbacks.html#getSecretStorageKey) callback. The device is verified with the private cross-signing keys fetched from the secret storage.
2. Request an interactive verification against existing devices, by calling [CryptoApi.requestOwnUserVerification](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html#requestOwnUserVerification).
## Migrating from the legacy crypto stack to Rust crypto
If your application previously used the legacy crypto stack, (i.e, it called `MatrixClient.initLegacyCrypto()`), you will
need to migrate existing devices to the Rust crypto stack.
This migration happens automatically when you call `initRustCrypto()` instead of `initLegacyCrypto()`,
but you need to provide the legacy [`cryptoStore`](https://matrix-org.github.io/matrix-js-sdk/interfaces/matrix.ICreateClientOpts.html#cryptoStore) and [`pickleKey`](https://matrix-org.github.io/matrix-js-sdk/interfaces/matrix.ICreateClientOpts.html#pickleKey) to [`createClient`](https://matrix-org.github.io/matrix-js-sdk/functions/matrix.createClient.html):
```javascript
// You should provide the legacy crypto store and the pickle key to the matrix client in order to migrate the data.
const matrixClient = sdk.createClient({
cryptoStore: myCryptoStore,
pickleKey: myPickleKey,
baseUrl: "http://localhost:8008",
accessToken: myAccessToken,
userId: myUserId,
});
// The migration will be done automatically when you call `initRustCrypto`.
await matrixClient.initRustCrypto();
```
To follow the migration progress, you can listen to the [`CryptoEvent.LegacyCryptoStoreMigrationProgress`](https://matrix-org.github.io/matrix-js-sdk/enums/crypto_api.CryptoEvent.html#LegacyCryptoStoreMigrationProgress) event:
```javascript
// When progress === total === -1, the migration is finished.
matrixClient.on(CryptoEvent.LegacyCryptoStoreMigrationProgress, (progress, total) => {
...
});
```
The Rust crypto stack is not supported in a lot of deprecated methods of [`MatrixClient`](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html). If you use them, you should migrate to the [`CryptoApi`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html). Also, the legacy `MatrixClient.crypto` object is not available any more: you should use `MatrixClient.getCrypto()` instead.
If you want to package Olm as dependency for your node.js application, you can
use `yarn add https://packages.matrix.org/npm/olm/olm-3.1.4.tgz`. If your
application also works without e2e crypto enabled, add `--optional` to mark it
as an optional dependency.
# Contributing
@@ -454,25 +356,28 @@ want to use this SDK, skip this section._
First, you need to pull in the right build tools:
```
$ pnpm install
$ yarn install
```
## Building
To build a browser version from scratch when developing:
To build a browser version from scratch when developing::
```
$ pnpm build
$ yarn build
```
To run tests:
To run tests (Jest):
```
$ pnpm test
$ yarn test
```
> **Note**
> The `sync-browserify.spec.ts` requires a browser build (`yarn build`) in order to pass
To run linting:
```
$ pnpm lint
$ yarn lint
```

View File

@@ -1,14 +0,0 @@
/**
* An AES-encrypted secret storage payload.
* See https://spec.matrix.org/v1.11/client-server-api/#msecret_storagev1aes-hmac-sha2-1
*/
export interface AESEncryptedSecretStoragePayload {
[key: string]: any;
/** the initialization vector in base64 */
iv: string;
/** the ciphertext in base64 */
ciphertext: string;
/** the HMAC in base64 */
mac: string;
}
//# sourceMappingURL=AESEncryptedSecretStoragePayload.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"AESEncryptedSecretStoragePayload.d.ts","sourceRoot":"","sources":["../../src/@types/AESEncryptedSecretStoragePayload.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC7C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;CACf"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=AESEncryptedSecretStoragePayload.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"AESEncryptedSecretStoragePayload.js","names":[],"sources":["../../src/@types/AESEncryptedSecretStoragePayload.ts"],"sourcesContent":["/*\n * Copyright 2024 The Matrix.org Foundation C.I.C.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An AES-encrypted secret storage payload.\n * See https://spec.matrix.org/v1.11/client-server-api/#msecret_storagev1aes-hmac-sha2-1\n */\nexport interface AESEncryptedSecretStoragePayload {\n [key: string]: any; // extensible\n /** the initialization vector in base64 */\n iv: string;\n /** the ciphertext in base64 */\n ciphertext: string;\n /** the HMAC in base64 */\n mac: string;\n}\n"],"mappings":"","ignoreList":[]}

View File

@@ -1,3 +1,6 @@
export {};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=IIdentityServerProvider.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"IIdentityServerProvider.js","names":[],"sources":["../../src/@types/IIdentityServerProvider.ts"],"sourcesContent":["/*\nCopyright 2021 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 IIdentityServerProvider {\n /**\n * Gets an access token for use against the identity server,\n * for the associated client.\n * @returns Promise which resolves to the access token.\n */\n getAccessToken(): Promise<string | null>;\n}\n"],"mappings":"","ignoreList":[]}
{"version":3,"file":"IIdentityServerProvider.js","names":[],"sources":["../../src/@types/IIdentityServerProvider.ts"],"sourcesContent":["/*\nCopyright 2021 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 IIdentityServerProvider {\n /**\n * Gets an access token for use against the identity server,\n * for the associated client.\n * @returns Promise which resolves to the access token.\n */\n getAccessToken(): Promise<string | null>;\n}\n"],"mappings":""}

View File

@@ -1 +1 @@
{"version":3,"file":"PushRules.d.ts","sourceRoot":"","sources":["../../src/@types/PushRules.ts"],"names":[],"mappings":"AAgBA,oBAAY,kBAAkB;IAC1B,UAAU,gBAAgB;IAC1B,MAAM,WAAW;IACjB,QAAQ,aAAa;CACxB;AAED,oBAAY,SAAS;IACj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B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,4BAA4B,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8BAA8B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,8BAA8B,CAAC;IAC/F,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB"}

View File

@@ -1,3 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TweakName = exports.RuleId = exports.PushRuleKind = exports.PushRuleActionName = exports.DMMemberCountCondition = exports.ConditionOperator = exports.ConditionKind = void 0;
exports.isDmMemberCountCondition = isDmMemberCountCondition;
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
@@ -13,19 +20,22 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export let PushRuleActionName = /*#__PURE__*/function (PushRuleActionName) {
// allow camelcase as these are things that go onto the wire
/* eslint-disable camelcase */
let PushRuleActionName = /*#__PURE__*/function (PushRuleActionName) {
PushRuleActionName["DontNotify"] = "dont_notify";
PushRuleActionName["Notify"] = "notify";
PushRuleActionName["Coalesce"] = "coalesce";
return PushRuleActionName;
}({});
export let TweakName = /*#__PURE__*/function (TweakName) {
exports.PushRuleActionName = PushRuleActionName;
let TweakName = /*#__PURE__*/function (TweakName) {
TweakName["Highlight"] = "highlight";
TweakName["Sound"] = "sound";
return TweakName;
}({});
export let ConditionOperator = /*#__PURE__*/function (ConditionOperator) {
exports.TweakName = TweakName;
let ConditionOperator = /*#__PURE__*/function (ConditionOperator) {
ConditionOperator["ExactEquals"] = "==";
ConditionOperator["LessThan"] = "<";
ConditionOperator["GreaterThan"] = ">";
@@ -33,11 +43,13 @@ export let ConditionOperator = /*#__PURE__*/function (ConditionOperator) {
ConditionOperator["LessThanOrEqual"] = "<=";
return ConditionOperator;
}({});
export const DMMemberCountCondition = "2";
export function isDmMemberCountCondition(condition) {
exports.ConditionOperator = ConditionOperator;
const DMMemberCountCondition = "2";
exports.DMMemberCountCondition = DMMemberCountCondition;
function isDmMemberCountCondition(condition) {
return condition === "==2" || condition === "2";
}
export let ConditionKind = /*#__PURE__*/function (ConditionKind) {
let ConditionKind = /*#__PURE__*/function (ConditionKind) {
ConditionKind["EventMatch"] = "event_match";
ConditionKind["EventPropertyIs"] = "event_property_is";
ConditionKind["EventPropertyContains"] = "event_property_contains";
@@ -47,12 +59,10 @@ export let ConditionKind = /*#__PURE__*/function (ConditionKind) {
ConditionKind["CallStarted"] = "call_started";
ConditionKind["CallStartedPrefix"] = "org.matrix.msc3914.call_started";
return ConditionKind;
}({});
// XXX: custom conditions are possible but always fail, and break the typescript discriminated union so ignore them here
}({}); // XXX: custom conditions are possible but always fail, and break the typescript discriminated union so ignore them here
// IPushRuleCondition<Exclude<string, ConditionKind>> unfortunately does not resolve this at the time of writing.
export let PushRuleKind = /*#__PURE__*/function (PushRuleKind) {
exports.ConditionKind = ConditionKind;
let PushRuleKind = /*#__PURE__*/function (PushRuleKind) {
PushRuleKind["Override"] = "override";
PushRuleKind["ContentSpecific"] = "content";
PushRuleKind["RoomSpecific"] = "room";
@@ -60,7 +70,8 @@ export let PushRuleKind = /*#__PURE__*/function (PushRuleKind) {
PushRuleKind["Underride"] = "underride";
return PushRuleKind;
}({});
export let RuleId = /*#__PURE__*/function (RuleId) {
exports.PushRuleKind = PushRuleKind;
let RuleId = /*#__PURE__*/function (RuleId) {
RuleId["Master"] = ".m.rule.master";
RuleId["IsUserMention"] = ".m.rule.is_user_mention";
RuleId["IsRoomMention"] = ".m.rule.is_room_mention";
@@ -86,4 +97,6 @@ export let RuleId = /*#__PURE__*/function (RuleId) {
RuleId["PollEndOneToOneUnstable"] = ".org.matrix.msc3930.rule.poll_end_one_to_one";
return RuleId;
}({});
/* eslint-enable camelcase */
exports.RuleId = RuleId;
//# sourceMappingURL=PushRules.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";

View File

@@ -1 +1 @@
{"version":3,"file":"another-json.d.js","names":[],"sources":["../../src/@types/another-json.d.ts"],"sourcesContent":["/*\nCopyright 2021 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\ndeclare module \"another-json\" {\n export function stringify(o: object): string;\n}\n"],"mappings":"","ignoreList":[]}
{"version":3,"file":"another-json.d.js","names":[],"sources":["../../src/@types/another-json.d.ts"],"sourcesContent":["/*\nCopyright 2021 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\ndeclare module \"another-json\" {\n export function stringify(o: object): string;\n}\n"],"mappings":""}

View File

@@ -1,5 +1,5 @@
import { UnstableValue } from "../NamespacedValue.ts";
import { type IClientWellKnown } from "../client.ts";
import { UnstableValue } from "../NamespacedValue";
import { IClientWellKnown } from "../client";
/**
* Represents a response to the CSAPI `/refresh` endpoint.
*/
@@ -21,15 +21,15 @@ export interface ILoginFlow {
export interface IPasswordFlow extends ILoginFlow {
type: "m.login.password";
}
export declare const OAUTH_AWARE_PREFERRED_FLOW_FIELD: UnstableValue<"oauth_aware_preferred", "org.matrix.msc3824.delegated_oidc_compatibility">;
export declare const DELEGATED_OIDC_COMPATIBILITY: UnstableValue<"delegated_oidc_compatibility", "org.matrix.msc3824.delegated_oidc_compatibility">;
/**
* Representation of SSO flow as per https://spec.matrix.org/v1.3/client-server-api/#client-login-via-sso
*/
export interface ISSOFlow extends ILoginFlow {
type: "m.login.sso" | "m.login.cas";
identity_providers?: IIdentityProvider[];
[OAUTH_AWARE_PREFERRED_FLOW_FIELD.name]?: boolean;
[OAUTH_AWARE_PREFERRED_FLOW_FIELD.altName]?: boolean;
[DELEGATED_OIDC_COMPATIBILITY.name]?: boolean;
[DELEGATED_OIDC_COMPATIBILITY.altName]?: boolean;
}
export declare enum IdentityProviderBrand {
Gitlab = "gitlab",
@@ -106,6 +106,11 @@ export interface LoginRequest {
* The login type being used.
*/
type: "m.login.password" | "m.login.token" | string;
/**
* Third-party identifier for the user.
* @deprecated in favour of `identifier`.
*/
address?: string;
/**
* ID of the client device.
* If this does not correspond to a known client device, a new device will be created.
@@ -192,13 +197,21 @@ export interface LoginResponse {
home_server?: string;
}
/**
* The result of a successful `m.login.token` issuance request as per https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv1loginget_token
* The result of a successful [MSC3882](https://github.com/matrix-org/matrix-spec-proposals/pull/3882)
* `m.login.token` issuance request.
* Note that this is UNSTABLE and subject to breaking changes without notice.
*/
export interface LoginTokenPostResponse {
/**
* The token to use with `m.login.token` to authenticate.
*/
login_token: string;
/**
* Expiration in seconds.
*
* @deprecated this is only provided for compatibility with original revision of the MSC.
*/
expires_in: number;
/**
* Expiration in milliseconds.
*/

View File

@@ -1 +1 @@
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/@types/auth.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD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
});
exports.SSOAction = exports.IdentityProviderBrand = exports.DELEGATED_OIDC_COMPATIBILITY = void 0;
var _NamespacedValue = require("../NamespacedValue");
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
@@ -14,23 +21,26 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { UnstableValue } from "../NamespacedValue.js";
// disable lint because these are wire responses
/* eslint-disable camelcase */
/**
* Represents a response to the CSAPI `/refresh` endpoint.
*/
/* eslint-enable camelcase */
/**
* Response to GET login flows as per https://spec.matrix.org/v1.3/client-server-api/#get_matrixclientv3login
*/
export const OAUTH_AWARE_PREFERRED_FLOW_FIELD = new UnstableValue("oauth_aware_preferred", "org.matrix.msc3824.delegated_oidc_compatibility");
const DELEGATED_OIDC_COMPATIBILITY = new _NamespacedValue.UnstableValue("delegated_oidc_compatibility", "org.matrix.msc3824.delegated_oidc_compatibility");
/**
* Representation of SSO flow as per https://spec.matrix.org/v1.3/client-server-api/#client-login-via-sso
*/
export let IdentityProviderBrand = /*#__PURE__*/function (IdentityProviderBrand) {
exports.DELEGATED_OIDC_COMPATIBILITY = DELEGATED_OIDC_COMPATIBILITY;
let IdentityProviderBrand = /*#__PURE__*/function (IdentityProviderBrand) {
IdentityProviderBrand["Gitlab"] = "gitlab";
IdentityProviderBrand["Github"] = "github";
IdentityProviderBrand["Apple"] = "apple";
@@ -39,27 +49,23 @@ export let IdentityProviderBrand = /*#__PURE__*/function (IdentityProviderBrand)
IdentityProviderBrand["Twitter"] = "twitter";
return IdentityProviderBrand;
}({});
export let SSOAction = /*#__PURE__*/function (SSOAction) {
/** The user intends to login to an existing account */
exports.IdentityProviderBrand = IdentityProviderBrand;
let SSOAction = /*#__PURE__*/function (SSOAction) {
SSOAction["LOGIN"] = "login";
/** The user intends to register for a new account */
SSOAction["REGISTER"] = "register";
return SSOAction;
}({});
/**
* A client can identify a user using their Matrix ID.
* This can either be the fully qualified Matrix user ID, or just the localpart of the user ID.
* @see https://spec.matrix.org/v1.7/client-server-api/#matrix-user-id
*/
/**
* A client can identify a user using a 3PID associated with the user’s account on the homeserver,
* where the 3PID was previously associated using the /account/3pid API.
* See the 3PID Types Appendix for a list of Third-party ID media.
* @see https://spec.matrix.org/v1.7/client-server-api/#third-party-id
*/
/**
* A client can identify a user using a phone number associated with the user’s account,
* where the phone number was previously associated using the /account/3pid API.
@@ -71,26 +77,24 @@ export let SSOAction = /*#__PURE__*/function (SSOAction) {
*
* @see https://spec.matrix.org/v1.7/client-server-api/#phone-number
*/
/**
* User Identifiers usable for login & user-interactive authentication.
*
* Extensibly allows more than Matrix specified identifiers.
*/
/**
* Request body for POST /login request
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3login
*/
// Export for backwards compatibility
/**
* Response body for POST /login request
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3login
*/
/**
* The result of a successful `m.login.token` issuance request as per https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv1loginget_token
* The result of a successful [MSC3882](https://github.com/matrix-org/matrix-spec-proposals/pull/3882)
* `m.login.token` issuance request.
* Note that this is UNSTABLE and subject to breaking changes without notice.
*/
exports.SSOAction = SSOAction;
//# sourceMappingURL=auth.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
import { type RelatesToRelationship, type REFERENCE_RELATION } from "./extensible_events.ts";
import { UnstableValue } from "../NamespacedValue.ts";
import { type MAssetEvent, type MLocationEvent, type MTimestampEvent } from "./location.ts";
import { RelatesToRelationship, REFERENCE_RELATION } from "./extensible_events";
import { UnstableValue } from "../NamespacedValue";
import { MAssetEvent, MLocationEvent, MTimestampEvent } from "./location";
/**
* Beacon info and beacon event types as described in MSC3672
* https://github.com/matrix-org/matrix-spec-proposals/pull/3672
@@ -12,7 +12,7 @@ import { type MAssetEvent, type MLocationEvent, type MTimestampEvent } from "./l
* 2. a user can have an arbitrary number of beacon_info events
*
* 1. is achieved by setting the state_key to the owners mxid.
* Event keys in room state are a combination of `typestate_key`.
* Event keys in room state are a combination of `type` + `state_key`.
* To achieve an arbitrary number of only owner-writable state events
* we introduce a variable suffix to the event type
*

View File

@@ -1 +1 @@
{"version":3,"file":"beacon.d.ts","sourceRoot":"","sources":["../../src/@types/beacon.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5F;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,kEAAuE,CAAC;AAClG,eAAO,MAAM,QAAQ,wDAA6D,CAAC;AAEnF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,OAAO,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,GAEpD,eAAe,GAEf,WAAW,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAE5C,eAAe,GAEf,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
{"version":3,"file":"beacon.d.ts","sourceRoot":"","sources":["../../src/@types/beacon.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE1E;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,kEAAuE,CAAC;AAClG,eAAO,MAAM,QAAQ,wDAA6D,CAAC;AAEnF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,OAAO,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,GAEpD,eAAe,GAEf,WAAW,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAE5C,eAAe,GAEf,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,CAAC"}

View File

@@ -1,3 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.M_BEACON_INFO = exports.M_BEACON = void 0;
var _NamespacedValue = require("../NamespacedValue");
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
@@ -14,7 +21,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { UnstableValue } from "../NamespacedValue.js";
/**
* Beacon info and beacon event types as described in MSC3672
* https://github.com/matrix-org/matrix-spec-proposals/pull/3672
@@ -27,7 +33,7 @@ import { UnstableValue } from "../NamespacedValue.js";
* 2. a user can have an arbitrary number of beacon_info events
*
* 1. is achieved by setting the state_key to the owners mxid.
* Event keys in room state are a combination of `typestate_key`.
* Event keys in room state are a combination of `type` + `state_key`.
* To achieve an arbitrary number of only owner-writable state events
* we introduce a variable suffix to the event type
*
@@ -61,8 +67,9 @@ import { UnstableValue } from "../NamespacedValue.js";
/**
* Non-variable type for m.beacon_info event content
*/
export const M_BEACON_INFO = new UnstableValue("m.beacon_info", "org.matrix.msc3672.beacon_info");
export const M_BEACON = new UnstableValue("m.beacon", "org.matrix.msc3672.beacon");
const M_BEACON_INFO = new _NamespacedValue.UnstableValue("m.beacon_info", "org.matrix.msc3672.beacon_info");
exports.M_BEACON_INFO = M_BEACON_INFO;
const M_BEACON = new _NamespacedValue.UnstableValue("m.beacon", "org.matrix.msc3672.beacon");
/**
* m.beacon_info Event example from the spec
@@ -116,4 +123,5 @@ export const M_BEACON = new UnstableValue("m.beacon", "org.matrix.msc3672.beacon
/**
* Content of an m.beacon event
*/
exports.M_BEACON = M_BEACON;
//# sourceMappingURL=beacon.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +0,0 @@
export type NonEmptyArray<T> = [T, ...T[]];
export type Without<T, U> = {
[P in Exclude<keyof T, keyof U>]?: never;
};
export type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
export type Writeable<T> = {
-readonly [P in keyof T]: T[P];
};
export type EmptyObject = Record<PropertyKey, never>;
//# sourceMappingURL=common.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/@types/common.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAG3C,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK;CAAE,CAAC;AACzE,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACjG,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=common.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"common.js","names":[],"sources":["../../src/@types/common.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\nhttp://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 type NonEmptyArray<T> = [T, ...T[]];\n\n// Based on https://stackoverflow.com/a/53229857/3532235\nexport type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };\nexport type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;\nexport type Writeable<T> = { -readonly [P in keyof T]: T[P] };\n\nexport type EmptyObject = Record<PropertyKey, never>;\n"],"mappings":"","ignoreList":[]}

View File

@@ -1,12 +1,40 @@
import type { ISignatures } from "./signed.ts";
import type { EventDecryptionResult } from "../common-crypto/CryptoBackend.ts";
/** @deprecated This is an internal type and should not be used. */
type IEventDecryptionResult = EventDecryptionResult;
export type { IEventDecryptionResult };
import type { IClearEvent } from "../models/event";
import type { ISignatures } from "./signed";
export type OlmGroupSessionExtraData = {
untrusted?: boolean;
sharedHistory?: boolean;
};
/**
* The result of a (successful) call to {@link Crypto.decryptEvent}
*/
export interface IEventDecryptionResult {
/**
* The plaintext payload for the event (typically containing <tt>type</tt> and <tt>content</tt> fields).
*/
clearEvent: IClearEvent;
/**
* List of curve25519 keys involved in telling us about the senderCurve25519Key and claimedEd25519Key.
* See {@link MatrixEvent#getForwardingCurve25519KeyChain}.
*/
forwardingCurve25519KeyChain?: string[];
/**
* Key owned by the sender of this event. See {@link MatrixEvent#getSenderKey}.
*/
senderCurve25519Key?: string;
/**
* ed25519 key claimed by the sender of this event. See {@link MatrixEvent#getClaimedEd25519Key}.
*/
claimedEd25519Key?: string;
untrusted?: boolean;
/**
* The sender doesn't authorize the unverified devices to decrypt his messages
*/
encryptedDisabledForUnverifiedDevices?: boolean;
}
interface Extensible {
[key: string]: any;
}
/** The result of a call to {@link crypto-api!CryptoApi.exportRoomKeys} */
/** The result of a call to {@link MatrixClient.exportRoomKeys} */
export interface IMegolmSessionData extends Extensible {
/** Sender's Curve25519 device key */
sender_key: string;
@@ -43,4 +71,5 @@ export interface IOneTimeKey {
fallback?: boolean;
signatures?: ISignatures;
}
export {};
//# sourceMappingURL=crypto.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/@types/crypto.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E,mEAAmE;AACnE,KAAK,sBAAsB,GAAG,qBAAqB,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC,UAAU,UAAU;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IAClD,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,+BAA+B,EAAE,MAAM,EAAE,CAAC;IAC1C,oCAAoC;IACpC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,g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AE,MAAM,GAAG,GAAG,CAAC;CACtB;AAID,kEAAkE;AAClE,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IAClD,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,+BAA+B,EAAE,MAAM,EAAE,CAAC;IAC1C,oCAAoC;IACpC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAID;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B"}

View File

@@ -1,3 +1,6 @@
export {};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=crypto.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"crypto.js","names":[],"sources":["../../src/@types/crypto.ts"],"sourcesContent":["/*\nCopyright 2022-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 { ISignatures } from \"./signed.ts\";\nimport type { EventDecryptionResult } from \"../common-crypto/CryptoBackend.ts\";\n\n// Backwards compatible re-export\n/** @deprecated This is an internal type and should not be used. */\ntype IEventDecryptionResult = EventDecryptionResult;\nexport type { IEventDecryptionResult };\n\ninterface Extensible {\n [key: string]: any;\n}\n\n/** The result of a call to {@link crypto-api!CryptoApi.exportRoomKeys} */\nexport interface IMegolmSessionData extends Extensible {\n /** Sender's Curve25519 device key */\n sender_key: string;\n /** Devices which forwarded this session to us (normally empty). */\n forwarding_curve25519_key_chain: string[];\n /** Other keys the sender claims. */\n sender_claimed_keys: Record<string, string>;\n /** Room this session is used in */\n room_id: string;\n /** Unique id for the session */\n session_id: string;\n /** Base64'ed key data */\n session_key: string;\n algorithm?: string;\n untrusted?: boolean;\n}\n\n/** the type of the `device_keys` parameter on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IDeviceKeys {\n algorithms: Array<string>;\n device_id: string;\n user_id: string;\n keys: Record<string, string>;\n signatures?: ISignatures;\n}\n\n/** the type of the `one_time_keys` and `fallback_keys` parameters on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IOneTimeKey {\n key: string;\n fallback?: boolean;\n signatures?: ISignatures;\n}\n"],"mappings":"","ignoreList":[]}
{"version":3,"file":"crypto.js","names":[],"sources":["../../src/@types/crypto.ts"],"sourcesContent":["/*\nCopyright 2022-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 { IClearEvent } from \"../models/event\";\nimport type { ISignatures } from \"./signed\";\n\nexport type OlmGroupSessionExtraData = {\n untrusted?: boolean;\n sharedHistory?: boolean;\n};\n\n/**\n * The result of a (successful) call to {@link Crypto.decryptEvent}\n */\nexport interface IEventDecryptionResult {\n /**\n * The plaintext payload for the event (typically containing <tt>type</tt> and <tt>content</tt> fields).\n */\n clearEvent: IClearEvent;\n /**\n * List of curve25519 keys involved in telling us about the senderCurve25519Key and claimedEd25519Key.\n * See {@link MatrixEvent#getForwardingCurve25519KeyChain}.\n */\n forwardingCurve25519KeyChain?: string[];\n /**\n * Key owned by the sender of this event. See {@link MatrixEvent#getSenderKey}.\n */\n senderCurve25519Key?: string;\n /**\n * ed25519 key claimed by the sender of this event. See {@link MatrixEvent#getClaimedEd25519Key}.\n */\n claimedEd25519Key?: string;\n untrusted?: boolean;\n /**\n * The sender doesn't authorize the unverified devices to decrypt his messages\n */\n encryptedDisabledForUnverifiedDevices?: boolean;\n}\n\ninterface Extensible {\n [key: string]: any;\n}\n\n/* eslint-disable camelcase */\n\n/** The result of a call to {@link MatrixClient.exportRoomKeys} */\nexport interface IMegolmSessionData extends Extensible {\n /** Sender's Curve25519 device key */\n sender_key: string;\n /** Devices which forwarded this session to us (normally empty). */\n forwarding_curve25519_key_chain: string[];\n /** Other keys the sender claims. */\n sender_claimed_keys: Record<string, string>;\n /** Room this session is used in */\n room_id: string;\n /** Unique id for the session */\n session_id: string;\n /** Base64'ed key data */\n session_key: string;\n algorithm?: string;\n untrusted?: boolean;\n}\n\n/* eslint-enable camelcase */\n\n/** the type of the `device_keys` parameter on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IDeviceKeys {\n algorithms: Array<string>;\n device_id: string; // eslint-disable-line camelcase\n user_id: string; // eslint-disable-line camelcase\n keys: Record<string, string>;\n signatures?: ISignatures;\n}\n\n/** the type of the `one_time_keys` and `fallback_keys` parameters on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IOneTimeKey {\n key: string;\n fallback?: boolean;\n signatures?: ISignatures;\n}\n"],"mappings":""}

View File

@@ -1,20 +1,4 @@
import { type EitherAnd } from "matrix-events-sdk";
import { NamespacedValue, UnstableValue } from "../NamespacedValue.ts";
import { type PolicyRuleEventContent, type RoomAvatarEventContent, type RoomCanonicalAliasEventContent, type RoomCreateEventContent, type RoomEncryptionEventContent, type RoomGuestAccessEventContent, type RoomHistoryVisibilityEventContent, type RoomJoinRulesEventContent, type RoomMemberEventContent, type RoomNameEventContent, type RoomPinnedEventsEventContent, type RoomPolicyContent, type RoomPowerLevelsEventContent, type RoomServerAclEventContent, type RoomThirdPartyInviteEventContent, type RoomTombstoneEventContent, type RoomTopicEventContent, type SpaceChildEventContent, type SpaceParentEventContent } from "./state_events.ts";
import { type IGroupCallRoomMemberState, type IGroupCallRoomState } from "../webrtc/groupCall.ts";
import { type MSC3089EventContent } from "../models/MSC3089Branch.ts";
import { type M_BEACON, type M_BEACON_INFO, type MBeaconEventContent, type MBeaconInfoEventContent } from "./beacon.ts";
import { type EmptyObject } from "./common.ts";
import { type ReactionEventContent, type RoomMessageEventContent, type StickerEventContent } from "./events.ts";
import { type MCallAnswer, type MCallBase, type MCallCandidates, type MCallHangupReject, type MCallInviteNegotiate, type MCallReplacesEvent, type MCallSelectAnswer, type SDPStreamMetadata } from "../webrtc/callEventTypes.ts";
import { type IRTCNotificationContent, type IRTCDeclineContent, type EncryptionKeysEventContent, type ICallNotifyContent, type RtcSlotEventContent } from "../matrixrtc/types.ts";
import { type M_POLL_END, type M_POLL_START, type PollEndEventContent, type PollStartEventContent } from "./polls.ts";
import { type RtcMembershipData, type SessionMembershipData } from "../matrixrtc/membershipData/index.ts";
import { type LocalNotificationSettings } from "./local_notifications.ts";
import { type IPushRules } from "./PushRules.ts";
import { type SecretInfo, type SecretStorageKeyDescription } from "../secret-storage.ts";
import { type POLICIES_ACCOUNT_EVENT_TYPE } from "../models/invites-ignorer-types.ts";
import type { ROOM_RETENTION_TYPE, RoomRetentionContent } from "./retention.ts";
import { UnstableValue } from "../NamespacedValue";
export declare enum EventType {
RoomCanonicalAlias = "m.room.canonical_alias",
RoomCreate = "m.room.create",
@@ -32,9 +16,6 @@ export declare enum EventType {
RoomServerAcl = "m.room.server_acl",
RoomTombstone = "m.room.tombstone",
RoomPredecessor = "org.matrix.msc3946.room_predecessor",
PolicyRuleUser = "m.policy.rule.user",
PolicyRuleRoom = "m.policy.rule.room",
PolicyRuleServer = "m.policy.rule.server",
SpaceChild = "m.space.child",
SpaceParent = "m.space.parent",
RoomRedaction = "m.room.redaction",
@@ -53,7 +34,6 @@ export declare enum EventType {
CallReplaces = "m.call.replaces",
CallAssertedIdentity = "m.call.asserted_identity",
CallAssertedIdentityPrefix = "org.matrix.call.asserted_identity",
CallEncryptionKeysPrefix = "io.element.call.encryption_keys",
KeyVerificationRequest = "m.key.verification.request",
KeyVerificationStart = "m.key.verification.start",
KeyVerificationCancel = "m.key.verification.cancel",
@@ -70,28 +50,16 @@ export declare enum EventType {
Presence = "m.presence",
FullyRead = "m.fully_read",
Tag = "m.tag",
SpaceOrder = "org.matrix.msc3230.space_order",// MSC3230
MarkedUnread = "m.marked_unread",
SpaceOrder = "org.matrix.msc3230.space_order",
PushRules = "m.push_rules",
Direct = "m.direct",
IgnoredUserList = "m.ignored_user_list",
InvitePermissionConfig = "m.invite_permission_config",// MSC4380
RoomKey = "m.room_key",
RoomKeyRequest = "m.room_key_request",
ForwardedRoomKey = "m.forwarded_room_key",
Dummy = "m.dummy",
SecretRequest = "m.secret.request",
SecretSend = "m.secret.send",
GroupCallPrefix = "org.matrix.msc3401.call",
GroupCallMemberPrefix = "org.matrix.msc3401.call.member",
RTCSlot = "org.matrix.msc4143.rtc.slot",
RTCMembership = "org.matrix.msc4143.rtc.member",
CallNotify = "org.matrix.msc4075.call.notify",
RTCNotification = "org.matrix.msc4075.rtc.notification",
RTCDecline = "org.matrix.msc4310.rtc.decline",
RoomPolicy = "org.matrix.msc4284.policy",
RetentionPolicy = "m.room.retention",
RetentionPolicyUnstable = "org.matrix.msc1763.retention"
GroupCallMemberPrefix = "org.matrix.msc3401.call.member"
}
export declare enum RelationType {
Annotation = "m.annotation",
@@ -213,160 +181,20 @@ export declare const LOCAL_NOTIFICATION_SETTINGS_PREFIX: UnstableValue<"m.local_
* @experimental
*/
export declare const UNSIGNED_THREAD_ID_FIELD: UnstableValue<"thread_id", "org.matrix.msc4023.thread_id">;
/**
* https://github.com/matrix-org/matrix-spec-proposals/pull/4115
*
* @experimental
*/
export declare const UNSIGNED_MEMBERSHIP_FIELD: NamespacedValue<"membership", "io.element.msc4115.membership">;
/**
* Mapped type from event type to content type for all specified non-state room events.
*/
export interface TimelineEvents {
[EventType.RoomMessage]: RoomMessageEventContent;
[EventType.Sticker]: StickerEventContent;
[EventType.Reaction]: ReactionEventContent;
[EventType.CallReplaces]: MCallReplacesEvent;
[EventType.CallAnswer]: MCallAnswer;
[EventType.CallSelectAnswer]: MCallSelectAnswer;
[EventType.CallNegotiate]: Omit<MCallInviteNegotiate, "offer">;
[EventType.CallInvite]: MCallInviteNegotiate;
[EventType.CallCandidates]: MCallCandidates;
[EventType.CallHangup]: MCallHangupReject;
[EventType.CallReject]: MCallHangupReject;
[EventType.CallSDPStreamMetadataChangedPrefix]: MCallBase & EitherAnd<{
sdp_stream_metadata: SDPStreamMetadata;
}, {
"org.matrix.msc3077.sdp_stream_metadata": SDPStreamMetadata;
}>;
[EventType.CallSDPStreamMetadataChanged]: MCallBase & EitherAnd<{
sdp_stream_metadata: SDPStreamMetadata;
}, {
"org.matrix.msc3077.sdp_stream_metadata": SDPStreamMetadata;
}>;
[EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;
[EventType.CallNotify]: ICallNotifyContent;
[EventType.RTCNotification]: IRTCNotificationContent;
[EventType.RTCDecline]: IRTCDeclineContent;
[M_BEACON.name]: MBeaconEventContent;
[M_POLL_START.name]: PollStartEventContent;
[M_POLL_END.name]: PollEndEventContent;
[EventType.RTCMembership]: RtcMembershipData | {
msc4354_sticky_key: string;
export interface IEncryptedFile {
url: string;
mimetype?: string;
key: {
alg: string;
key_ops: string[];
kty: string;
k: string;
ext: boolean;
};
}
/**
* Mapped type from event type to content type for all specified room state events.
*/
export interface StateEvents {
[EventType.RoomCanonicalAlias]: RoomCanonicalAliasEventContent;
[EventType.RoomCreate]: RoomCreateEventContent;
[EventType.RoomJoinRules]: RoomJoinRulesEventContent;
[EventType.RoomMember]: RoomMemberEventContent;
[EventType.RoomThirdPartyInvite]: RoomThirdPartyInviteEventContent | EmptyObject;
[EventType.RoomPowerLevels]: RoomPowerLevelsEventContent;
[EventType.RoomName]: RoomNameEventContent;
[EventType.RoomTopic]: RoomTopicEventContent;
[EventType.RoomAvatar]: RoomAvatarEventContent;
[EventType.RoomPinnedEvents]: RoomPinnedEventsEventContent;
[EventType.RoomEncryption]: RoomEncryptionEventContent;
[EventType.RoomHistoryVisibility]: RoomHistoryVisibilityEventContent;
[EventType.RoomGuestAccess]: RoomGuestAccessEventContent;
[EventType.RoomServerAcl]: RoomServerAclEventContent;
[EventType.RoomTombstone]: RoomTombstoneEventContent;
[EventType.SpaceChild]: SpaceChildEventContent;
[EventType.SpaceParent]: SpaceParentEventContent;
[EventType.PolicyRuleUser]: PolicyRuleEventContent | EmptyObject;
[EventType.PolicyRuleRoom]: PolicyRuleEventContent | EmptyObject;
[EventType.PolicyRuleServer]: PolicyRuleEventContent | EmptyObject;
[EventType.RoomPolicy]: RoomPolicyContent | EmptyObject;
[EventType.GroupCallPrefix]: IGroupCallRoomState;
[EventType.GroupCallMemberPrefix]: IGroupCallRoomMemberState | SessionMembershipData | EmptyObject;
[EventType.RTCMembership]: RtcMembershipData | EmptyObject;
[EventType.RTCSlot]: RtcSlotEventContent | EmptyObject;
[UNSTABLE_MSC3089_BRANCH.name]: MSC3089EventContent;
[M_BEACON_INFO.name]: MBeaconInfoEventContent;
[ROOM_RETENTION_TYPE.name]: RoomRetentionContent | EmptyObject;
[ROOM_RETENTION_TYPE.altName]: RoomRetentionContent | EmptyObject;
}
/**
* Mapped type from event type to content type for all specified room-specific account_data events.
*/
export interface RoomAccountDataEvents extends SecretStorageAccountDataEvents {
[EventType.FullyRead]: {
event_id: string;
iv: string;
hashes: {
[alg: string]: string;
};
[EventType.Tag]: {
tags: {
[name: string]: {
order?: number;
};
};
};
[EventType.SpaceOrder]: {
order: string;
};
[EventType.MarkedUnread]: {
unread: boolean;
};
}
/**
* Mapped type from event type to content type for all specified global account_data events.
*/
export interface AccountDataEvents extends SecretStorageAccountDataEvents {
[EventType.PushRules]: IPushRules;
[EventType.Direct]: {
[userId: string]: string[];
};
[EventType.IgnoredUserList]: {
ignored_users: {
[userId: string]: EmptyObject;
};
};
"m.secret_storage.default_key": {
key: string;
};
"m.key_backup": {
enabled: boolean;
};
"m.org.matrix.custom.backup_disabled": {
disabled: boolean;
};
"m.identity_server": {
base_url: string | null;
};
[key: `${typeof LOCAL_NOTIFICATION_SETTINGS_PREFIX.name}.${string}`]: LocalNotificationSettings;
[key: `m.secret_storage.key.${string}`]: SecretStorageKeyDescription;
[POLICIES_ACCOUNT_EVENT_TYPE.name]: {
[key: string]: any;
};
[POLICIES_ACCOUNT_EVENT_TYPE.altName]: {
[key: string]: any;
};
[EventType.InvitePermissionConfig]: {
default_action?: string;
};
"m.recent_emoji": {
recent_emoji: Array<{
emoji: string;
total: number;
}>;
};
}
/**
* Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12
*/
export type WritableAccountDataEvents = Exclude<AccountDataEvents, "m.fully_read" | "m.push_rules">;
/**
* Mapped type from event type to content type for all specified global events encrypted by secret storage.
*
* See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1
*/
export interface SecretStorageAccountDataEvents {
"m.megolm_backup.v1": SecretInfo;
"m.cross_signing.master": SecretInfo;
"m.cross_signing.self_signing": SecretInfo;
"m.cross_signing.user_signing": SecretInfo;
"org.matrix.msc3814": SecretInfo;
v: string;
}
//# sourceMappingURL=event.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UNSTABLE_MSC3089_TREE_SUBTYPE = exports.UNSTABLE_MSC3089_LEAF = exports.UNSTABLE_MSC3089_BRANCH = exports.UNSTABLE_MSC3088_PURPOSE = exports.UNSTABLE_MSC3088_ENABLED = exports.UNSTABLE_MSC2716_MARKER = exports.UNSTABLE_ELEMENT_FUNCTIONAL_USERS = exports.UNSIGNED_THREAD_ID_FIELD = exports.ToDeviceMessageId = exports.RoomType = exports.RoomCreateTypeField = exports.RelationType = exports.PUSHER_ENABLED = exports.PUSHER_DEVICE_ID = exports.MsgType = exports.MSC3912_RELATION_BASED_REDACTIONS_PROP = exports.LOCAL_NOTIFICATION_SETTINGS_PREFIX = exports.EventType = exports.EVENT_VISIBILITY_CHANGE_TYPE = void 0;
var _NamespacedValue = require("../NamespacedValue");
/*
Copyright 2020-2026 The Matrix.org Foundation C.I.C.
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -13,10 +20,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { NamespacedValue, UnstableValue } from "../NamespacedValue.js";
export let EventType = /*#__PURE__*/function (EventType) {
// Room state events
let EventType = /*#__PURE__*/function (EventType) {
EventType["RoomCanonicalAlias"] = "m.room.canonical_alias";
EventType["RoomCreate"] = "m.room.create";
EventType["RoomJoinRules"] = "m.room.join_rules";
@@ -33,13 +37,8 @@ export let EventType = /*#__PURE__*/function (EventType) {
EventType["RoomServerAcl"] = "m.room.server_acl";
EventType["RoomTombstone"] = "m.room.tombstone";
EventType["RoomPredecessor"] = "org.matrix.msc3946.room_predecessor";
// Moderation policy lists
EventType["PolicyRuleUser"] = "m.policy.rule.user";
EventType["PolicyRuleRoom"] = "m.policy.rule.room";
EventType["PolicyRuleServer"] = "m.policy.rule.server";
EventType["SpaceChild"] = "m.space.child";
EventType["SpaceParent"] = "m.space.parent";
// Room timeline events
EventType["RoomRedaction"] = "m.room.redaction";
EventType["RoomMessage"] = "m.room.message";
EventType["RoomMessageEncrypted"] = "m.room.encrypted";
@@ -56,7 +55,6 @@ export let EventType = /*#__PURE__*/function (EventType) {
EventType["CallReplaces"] = "m.call.replaces";
EventType["CallAssertedIdentity"] = "m.call.asserted_identity";
EventType["CallAssertedIdentityPrefix"] = "org.matrix.call.asserted_identity";
EventType["CallEncryptionKeysPrefix"] = "io.element.call.encryption_keys";
EventType["KeyVerificationRequest"] = "m.key.verification.request";
EventType["KeyVerificationStart"] = "m.key.verification.start";
EventType["KeyVerificationCancel"] = "m.key.verification.cancel";
@@ -64,62 +62,37 @@ export let EventType = /*#__PURE__*/function (EventType) {
EventType["KeyVerificationDone"] = "m.key.verification.done";
EventType["KeyVerificationKey"] = "m.key.verification.key";
EventType["KeyVerificationAccept"] = "m.key.verification.accept";
// Not used directly - see READY_TYPE in VerificationRequest.
EventType["KeyVerificationReady"] = "m.key.verification.ready";
// use of this is discouraged https://matrix.org/docs/spec/client_server/r0.6.1#m-room-message-feedback
EventType["RoomMessageFeedback"] = "m.room.message.feedback";
EventType["Reaction"] = "m.reaction";
EventType["PollStart"] = "org.matrix.msc3381.poll.start";
// Room ephemeral events
EventType["Typing"] = "m.typing";
EventType["Receipt"] = "m.receipt";
EventType["Presence"] = "m.presence";
// Room account_data events
EventType["FullyRead"] = "m.fully_read";
EventType["Tag"] = "m.tag";
EventType["SpaceOrder"] = "org.matrix.msc3230.space_order";
// MSC3230
EventType["MarkedUnread"] = "m.marked_unread";
// User account_data events
EventType["PushRules"] = "m.push_rules";
EventType["Direct"] = "m.direct";
EventType["IgnoredUserList"] = "m.ignored_user_list";
EventType["InvitePermissionConfig"] = "m.invite_permission_config";
// MSC4380
// to_device events
EventType["RoomKey"] = "m.room_key";
EventType["RoomKeyRequest"] = "m.room_key_request";
EventType["ForwardedRoomKey"] = "m.forwarded_room_key";
EventType["Dummy"] = "m.dummy";
EventType["SecretRequest"] = "m.secret.request";
EventType["SecretSend"] = "m.secret.send";
// Group call events
EventType["GroupCallPrefix"] = "org.matrix.msc3401.call";
EventType["GroupCallMemberPrefix"] = "org.matrix.msc3401.call.member";
// MatrixRTC events
EventType["RTCSlot"] = "org.matrix.msc4143.rtc.slot";
EventType["RTCMembership"] = "org.matrix.msc4143.rtc.member";
EventType["CallNotify"] = "org.matrix.msc4075.call.notify";
EventType["RTCNotification"] = "org.matrix.msc4075.rtc.notification";
EventType["RTCDecline"] = "org.matrix.msc4310.rtc.decline";
// Policy servers
EventType["RoomPolicy"] = "org.matrix.msc4284.policy";
// Retention
EventType["RetentionPolicy"] = "m.room.retention";
EventType["RetentionPolicyUnstable"] = "org.matrix.msc1763.retention";
return EventType;
}({});
export let RelationType = /*#__PURE__*/function (RelationType) {
exports.EventType = EventType;
let RelationType = /*#__PURE__*/function (RelationType) {
RelationType["Annotation"] = "m.annotation";
RelationType["Replace"] = "m.replace";
RelationType["Reference"] = "m.reference";
// Don't use this yet: it's only the stable version. The code still assumes we support the unstable prefix and,
// moreover, our tests currently use the unstable prefix. Use THREAD_RELATION_TYPE.name.
// Once we support *only* the stable prefix, THREAD_RELATION_TYPE can die and we can switch to this.
RelationType["Thread"] = "m.thread";
return RelationType;
}({});
export let MsgType = /*#__PURE__*/function (MsgType) {
exports.RelationType = RelationType;
let MsgType = /*#__PURE__*/function (MsgType) {
MsgType["Text"] = "m.text";
MsgType["Emote"] = "m.emote";
MsgType["Notice"] = "m.notice";
@@ -131,49 +104,57 @@ export let MsgType = /*#__PURE__*/function (MsgType) {
MsgType["KeyVerificationRequest"] = "m.key.verification.request";
return MsgType;
}({});
export const RoomCreateTypeField = "type";
export let RoomType = /*#__PURE__*/function (RoomType) {
exports.MsgType = MsgType;
const RoomCreateTypeField = "type";
exports.RoomCreateTypeField = RoomCreateTypeField;
let RoomType = /*#__PURE__*/function (RoomType) {
RoomType["Space"] = "m.space";
RoomType["UnstableCall"] = "org.matrix.msc3417.call";
RoomType["ElementVideo"] = "io.element.video";
return RoomType;
}({});
export const ToDeviceMessageId = "org.matrix.msgid";
exports.RoomType = RoomType;
const ToDeviceMessageId = "org.matrix.msgid";
/**
* Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
* room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
* including its eventual removal.
*/
export const UNSTABLE_MSC3088_PURPOSE = new UnstableValue("m.room.purpose", "org.matrix.msc3088.purpose");
exports.ToDeviceMessageId = ToDeviceMessageId;
const UNSTABLE_MSC3088_PURPOSE = new _NamespacedValue.UnstableValue("m.room.purpose", "org.matrix.msc3088.purpose");
/**
* Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
* room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
* including its eventual removal.
*/
export const UNSTABLE_MSC3088_ENABLED = new UnstableValue("m.enabled", "org.matrix.msc3088.enabled");
exports.UNSTABLE_MSC3088_PURPOSE = UNSTABLE_MSC3088_PURPOSE;
const UNSTABLE_MSC3088_ENABLED = new _NamespacedValue.UnstableValue("m.enabled", "org.matrix.msc3088.enabled");
/**
* Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
* Note that this reference is UNSTABLE and subject to breaking changes, including its
* eventual removal.
*/
export const UNSTABLE_MSC3089_TREE_SUBTYPE = new UnstableValue("m.data_tree", "org.matrix.msc3089.data_tree");
exports.UNSTABLE_MSC3088_ENABLED = UNSTABLE_MSC3088_ENABLED;
const UNSTABLE_MSC3089_TREE_SUBTYPE = new _NamespacedValue.UnstableValue("m.data_tree", "org.matrix.msc3089.data_tree");
/**
* Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
* Note that this reference is UNSTABLE and subject to breaking changes, including its
* eventual removal.
*/
export const UNSTABLE_MSC3089_LEAF = new UnstableValue("m.leaf", "org.matrix.msc3089.leaf");
exports.UNSTABLE_MSC3089_TREE_SUBTYPE = UNSTABLE_MSC3089_TREE_SUBTYPE;
const UNSTABLE_MSC3089_LEAF = new _NamespacedValue.UnstableValue("m.leaf", "org.matrix.msc3089.leaf");
/**
* Branch (Leaf Reference) type for the index approach in a
* [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is
* UNSTABLE and subject to breaking changes, including its eventual removal.
*/
export const UNSTABLE_MSC3089_BRANCH = new UnstableValue("m.branch", "org.matrix.msc3089.branch");
exports.UNSTABLE_MSC3089_LEAF = UNSTABLE_MSC3089_LEAF;
const UNSTABLE_MSC3089_BRANCH = new _NamespacedValue.UnstableValue("m.branch", "org.matrix.msc3089.branch");
/**
* Marker event type to point back at imported historical content in a room. See
@@ -181,13 +162,15 @@ export const UNSTABLE_MSC3089_BRANCH = new UnstableValue("m.branch", "org.matrix
* Note that this reference is UNSTABLE and subject to breaking changes,
* including its eventual removal.
*/
export const UNSTABLE_MSC2716_MARKER = new UnstableValue("m.room.marker", "org.matrix.msc2716.marker");
exports.UNSTABLE_MSC3089_BRANCH = UNSTABLE_MSC3089_BRANCH;
const UNSTABLE_MSC2716_MARKER = new _NamespacedValue.UnstableValue("m.room.marker", "org.matrix.msc2716.marker");
/**
* Name of the request property for relation based redactions.
* {@link https://github.com/matrix-org/matrix-spec-proposals/pull/3912}
*/
export const MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue("with_rel_types", "org.matrix.msc3912.with_relations");
exports.UNSTABLE_MSC2716_MARKER = UNSTABLE_MSC2716_MARKER;
const MSC3912_RELATION_BASED_REDACTIONS_PROP = new _NamespacedValue.UnstableValue("with_rel_types", "org.matrix.msc3912.with_relations");
/**
* Functional members type for declaring a purpose of room members (e.g. helpful bots).
@@ -211,7 +194,8 @@ export const MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue("with_re
* }
* ```
*/
export const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue("io.element.functional_members", "io.element.functional_members");
exports.MSC3912_RELATION_BASED_REDACTIONS_PROP = MSC3912_RELATION_BASED_REDACTIONS_PROP;
const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new _NamespacedValue.UnstableValue("io.element.functional_members", "io.element.functional_members");
/**
* A type of message that affects visibility of a message,
@@ -219,66 +203,39 @@ export const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue("io.element.f
*
* @experimental
*/
export const EVENT_VISIBILITY_CHANGE_TYPE = new UnstableValue("m.visibility", "org.matrix.msc3531.visibility");
exports.UNSTABLE_ELEMENT_FUNCTIONAL_USERS = UNSTABLE_ELEMENT_FUNCTIONAL_USERS;
const EVENT_VISIBILITY_CHANGE_TYPE = new _NamespacedValue.UnstableValue("m.visibility", "org.matrix.msc3531.visibility");
/**
* https://github.com/matrix-org/matrix-doc/pull/3881
*
* @experimental
*/
export const PUSHER_ENABLED = new UnstableValue("enabled", "org.matrix.msc3881.enabled");
exports.EVENT_VISIBILITY_CHANGE_TYPE = EVENT_VISIBILITY_CHANGE_TYPE;
const PUSHER_ENABLED = new _NamespacedValue.UnstableValue("enabled", "org.matrix.msc3881.enabled");
/**
* https://github.com/matrix-org/matrix-doc/pull/3881
*
* @experimental
*/
export const PUSHER_DEVICE_ID = new UnstableValue("device_id", "org.matrix.msc3881.device_id");
exports.PUSHER_ENABLED = PUSHER_ENABLED;
const PUSHER_DEVICE_ID = new _NamespacedValue.UnstableValue("device_id", "org.matrix.msc3881.device_id");
/**
* https://github.com/matrix-org/matrix-doc/pull/3890
*
* @experimental
*/
export const LOCAL_NOTIFICATION_SETTINGS_PREFIX = new UnstableValue("m.local_notification_settings", "org.matrix.msc3890.local_notification_settings");
exports.PUSHER_DEVICE_ID = PUSHER_DEVICE_ID;
const LOCAL_NOTIFICATION_SETTINGS_PREFIX = new _NamespacedValue.UnstableValue("m.local_notification_settings", "org.matrix.msc3890.local_notification_settings");
/**
* https://github.com/matrix-org/matrix-doc/pull/4023
*
* @experimental
*/
export const UNSIGNED_THREAD_ID_FIELD = new UnstableValue("thread_id", "org.matrix.msc4023.thread_id");
/**
* https://github.com/matrix-org/matrix-spec-proposals/pull/4115
*
* @experimental
*/
export const UNSIGNED_MEMBERSHIP_FIELD = new NamespacedValue("membership", "io.element.msc4115.membership");
/**
* Mapped type from event type to content type for all specified non-state room events.
*/
/**
* Mapped type from event type to content type for all specified room state events.
*/
/**
* Mapped type from event type to content type for all specified room-specific account_data events.
*/
/**
* Mapped type from event type to content type for all specified global account_data events.
*/
/**
* Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12
*/
/**
* Mapped type from event type to content type for all specified global events encrypted by secret storage.
*
* See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1
*/
exports.LOCAL_NOTIFICATION_SETTINGS_PREFIX = LOCAL_NOTIFICATION_SETTINGS_PREFIX;
const UNSIGNED_THREAD_ID_FIELD = new _NamespacedValue.UnstableValue("thread_id", "org.matrix.msc4023.thread_id");
exports.UNSIGNED_THREAD_ID_FIELD = UNSIGNED_THREAD_ID_FIELD;
//# sourceMappingURL=event.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,92 +0,0 @@
import { type MsgType, type RelationType } from "./event.ts";
import { type FileInfo, type ImageInfo, type MediaEventContent } from "./media.ts";
import { type XOR } from "./common.ts";
interface BaseTimelineEvent {
"body": string;
"m.mentions"?: {
user_ids?: string[];
room?: boolean;
};
}
interface ReplyEvent {
"m.relates_to"?: {
"m.in_reply_to"?: {
event_id: string;
};
};
}
interface NoRelationEvent {
"m.new_content"?: never;
"m.relates_to"?: never;
}
/**
* Partial content format of timeline events with rel_type `m.replace`
*
* @see https://spec.matrix.org/v1.9/client-server-api/#event-replacements
*/
export interface ReplacementEvent<T> {
"m.new_content": T;
"m.relates_to": {
event_id: string;
rel_type: RelationType.Replace;
};
}
/**
* Partial content format of timeline events with rel_type other than `m.replace`
*
* @see https://spec.matrix.org/v1.9/client-server-api/#forming-relationships-between-events
*/
export interface RelationEvent {
"m.new_content"?: never;
"m.relates_to": {
event_id: string;
rel_type: Exclude<RelationType, RelationType.Replace>;
};
}
/**
* Content format of timeline events with type `m.room.message` and `msgtype` `m.text`, `m.emote`, or `m.notice`
*
* @see https://spec.matrix.org/v1.9/client-server-api/#mroommessage
*/
export interface RoomMessageTextEventContent extends BaseTimelineEvent {
msgtype: MsgType.Text | MsgType.Emote | MsgType.Notice;
format?: "org.matrix.custom.html";
formatted_body?: string;
}
/**
* Content format of timeline events with type `m.room.message` and `msgtype` `m.location`
*
* @see https://spec.matrix.org/v1.9/client-server-api/#mlocation
*/
export interface RoomMessageLocationEventContent extends BaseTimelineEvent {
body: string;
geo_uri: string;
info: Pick<FileInfo, "thumbnail_info" | "thumbnail_file" | "thumbnail_url">;
msgtype: MsgType.Location;
}
type MessageEventContent = RoomMessageTextEventContent | RoomMessageLocationEventContent | MediaEventContent;
export type RoomMessageEventContent = BaseTimelineEvent & XOR<XOR<ReplacementEvent<MessageEventContent>, RelationEvent>, XOR<ReplyEvent, NoRelationEvent>> & MessageEventContent;
/**
* Content format of timeline events with type `m.sticker`
*
* @see https://spec.matrix.org/v1.9/client-server-api/#msticker
*/
export interface StickerEventContent extends BaseTimelineEvent {
body: string;
info: ImageInfo;
url: string;
}
/**
* Content format of timeline events with type `m.reaction`
*
* @see https://spec.matrix.org/v1.9/client-server-api/#mreaction
*/
export interface ReactionEventContent {
"m.relates_to": {
event_id: string;
key: string;
rel_type: RelationType.Annotation;
};
}
export {};
//# sourceMappingURL=events.d.ts.map

View File

@@ -1 +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AC;IACvD,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iBAAiB;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,eAAe,CAAC,CAAC;IAC5E,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;CAC7B;AAED,KAAK,mBAAmB,GAAG,2BAA2B,GAAG,+BAA+B,GAAG,iBAAiB,CAAC;AAE7G,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GACnD,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,GAChG,mBAAmB,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC;KACrC,CAAC;CACL"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=events.js.map

View File

@@ -1 +0,0 @@
{"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":[]}

View File

@@ -1,4 +1,4 @@
import { type EitherAnd, NamespacedValue, UnstableValue } from "matrix-events-sdk";
import { EitherAnd, NamespacedValue, Optional, UnstableValue } from "matrix-events-sdk";
/**
* Represents the stable and unstable values of a given namespace.
*/
@@ -70,11 +70,11 @@ export type AnyRelation = TSNamespace<typeof REFERENCE_RELATION> | string;
/**
* An m.relates_to relationship
*/
export type RelatesToRelationship<R = never> = {
export type RelatesToRelationship<R = never, C = never> = {
"m.relates_to": {
rel_type: [R] extends [never] ? AnyRelation : TSNamespace<R>;
event_id: string;
};
} & DefaultNever<C, {}>;
};
/**
* Partial types for a Matrix Event.
@@ -94,5 +94,5 @@ export type ExtensibleEventType = NamespacedValue<string, string> | string;
* @param expected - The expected event type.
* @returns True if the given type matches the expected type.
*/
export declare function isEventTypeSame(given: ExtensibleEventType | null, expected: ExtensibleEventType | null): boolean;
export declare function isEventTypeSame(given: Optional<ExtensibleEventType>, expected: Optional<ExtensibleEventType>): boolean;
//# sourceMappingURL=extensible_events.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"extensible_events.d.ts","sourceRoot":"","sources":["../../src/@types/extensible_events.ts"],"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EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElG;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,6BAA6B,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEnH;;GAEG;AACH,eAAO,MAAM,kBAAkB,wCAAqC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,kBAAkB,CAAC,GAAG,MAAM,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI;IACtD,cAAc,EAAE;QAEZ,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7D,QAAQ,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,QAAQ;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC3B,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EACpC,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACxC,OAAO,CAmBT"}

View File

@@ -1,3 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.REFERENCE_RELATION = exports.M_TEXT = exports.M_MESSAGE = exports.M_HTML = void 0;
exports.isEventTypeSame = isEventTypeSame;
var _matrixEventsSdk = require("matrix-events-sdk");
var _utilities = require("../extensible_events_v1/utilities");
/*
Copyright 2021 - 2023 The Matrix.org Foundation C.I.C.
@@ -14,9 +23,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { NamespacedValue, UnstableValue } from "matrix-events-sdk";
import { isProvided } from "../extensible_events_v1/utilities.js";
// Types and utilities for MSC1767: Extensible events (version 1) in Matrix
/**
@@ -36,7 +42,7 @@ import { isProvided } from "../extensible_events_v1/utilities.js";
/**
* The namespaced value for m.message
*/
export const M_MESSAGE = new UnstableValue("m.message", "org.matrix.msc1767.message");
const M_MESSAGE = new _matrixEventsSdk.UnstableValue("m.message", "org.matrix.msc1767.message");
/**
* An m.message event rendering
@@ -45,20 +51,20 @@ export const M_MESSAGE = new UnstableValue("m.message", "org.matrix.msc1767.mess
/**
* The content for an m.message event
*/
exports.M_MESSAGE = M_MESSAGE;
/**
* The namespaced value for m.text
*/
export const M_TEXT = new UnstableValue("m.text", "org.matrix.msc1767.text");
const M_TEXT = new _matrixEventsSdk.UnstableValue("m.text", "org.matrix.msc1767.text");
/**
* The content for an m.text event
*/
exports.M_TEXT = M_TEXT;
/**
* The namespaced value for m.html
*/
export const M_HTML = new UnstableValue("m.html", "org.matrix.msc1767.html");
const M_HTML = new _matrixEventsSdk.UnstableValue("m.html", "org.matrix.msc1767.html");
/**
* The content for an m.html event
@@ -67,11 +73,11 @@ export const M_HTML = new UnstableValue("m.html", "org.matrix.msc1767.html");
/**
* The content for an m.message, m.text, or m.html event
*/
exports.M_HTML = M_HTML;
/**
* The namespaced value for an m.reference relation
*/
export const REFERENCE_RELATION = new NamespacedValue("m.reference");
const REFERENCE_RELATION = new _matrixEventsSdk.NamespacedValue("m.reference");
/**
* Represents any relation type
@@ -88,7 +94,7 @@ export const REFERENCE_RELATION = new NamespacedValue("m.reference");
/**
* Represents a potentially namespaced event type.
*/
exports.REFERENCE_RELATION = REFERENCE_RELATION;
/**
* Determines if two event types are the same, including namespaces.
* @param given - The given event type. This will be compared
@@ -96,7 +102,7 @@ export const REFERENCE_RELATION = new NamespacedValue("m.reference");
* @param expected - The expected event type.
* @returns True if the given type matches the expected type.
*/
export function isEventTypeSame(given, expected) {
function isEventTypeSame(given, expected) {
if (typeof given === "string") {
if (typeof expected === "string") {
return expected === given;
@@ -109,7 +115,7 @@ export function isEventTypeSame(given, expected) {
} else {
const expectedNs = expected;
const givenNs = given;
return expectedNs.matches(givenNs.name) || isProvided(givenNs.altName) && expectedNs.matches(givenNs.altName);
return expectedNs.matches(givenNs.name) || (0, _utilities.isProvided)(givenNs.altName) && expectedNs.matches(givenNs.altName);
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,18 +1,7 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
"use strict";
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
Object.defineProperty(exports, "__esModule", {
value: true
});
require("@matrix-org/olm");
//# sourceMappingURL=global.d.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"global.d.js","names":[],"sources":["../../src/@types/global.d.ts"],"sourcesContent":["/*\nCopyright 2020 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 {};\n\ndeclare global {\n // use `number` as the return type in all cases for globalThis.set{Interval,Timeout},\n // so we don't accidentally use the methods on NodeJS.Timeout - they only exist in a subset of environments.\n // The overload for clear{Interval,Timeout} is resolved as expected.\n // We use `ReturnType<typeof setTimeout>` in the code to be agnostic of if this definition gets loaded.\n function setInterval(handler: TimerHandler, timeout: number, ...args: any[]): number;\n function setTimeout(handler: TimerHandler, timeout: number, ...args: any[]): number;\n\n namespace NodeJS {\n interface Global {\n // marker variable used to detect both the browser & node entrypoints being used at once\n __js_sdk_entrypoint: unknown;\n }\n }\n\n // Chrome-specific getUserMedia constraints\n interface MediaTrackConstraints {\n mandatory?: {\n chromeMediaSource: string;\n chromeMediaSourceId: string;\n };\n }\n\n interface Navigator {\n // We check for the webkit-prefixed getUserMedia to detect if we're\n // on webkit: we should check if we still need to do this\n webkitGetUserMedia?: unknown;\n }\n\n export interface Uint8ArrayToBase64Options {\n alphabet?: \"base64\" | \"base64url\";\n omitPadding?: boolean;\n }\n\n interface Uint8Array {\n // https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.prototype.tobase64\n toBase64?(options?: Uint8ArrayToBase64Options): string;\n }\n\n export interface Uint8ArrayFromBase64Options {\n alphabet?: \"base64\"; // Our fallback code only handles base64.\n lastChunkHandling?: \"loose\"; // Our fallback code doesn't support other handling at this time.\n }\n\n interface Uint8ArrayConstructor {\n // https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.frombase64\n fromBase64?(base64: string, options?: Uint8ArrayFromBase64Options): Uint8Array<ArrayBuffer>;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA","ignoreList":[]}
{"version":3,"file":"global.d.js","names":["require"],"sources":["../../src/@types/global.d.ts"],"sourcesContent":["/*\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// this is needed to tell TS about global.Olm\nimport \"@matrix-org/olm\";\n\nexport {};\n\ndeclare global {\n // use `number` as the return type in all cases for global.set{Interval,Timeout},\n // so we don't accidentally use the methods on NodeJS.Timeout - they only exist in a subset of environments.\n // The overload for clear{Interval,Timeout} is resolved as expected.\n // We use `ReturnType<typeof setTimeout>` in the code to be agnostic of if this definition gets loaded.\n function setInterval(handler: TimerHandler, timeout: number, ...arguments: any[]): number;\n function setTimeout(handler: TimerHandler, timeout: number, ...arguments: any[]): number;\n\n namespace NodeJS {\n interface Global {\n localStorage: Storage;\n // marker variable used to detect both the browser & node entrypoints being used at once\n __js_sdk_entrypoint: unknown;\n }\n }\n\n interface Window {\n webkitAudioContext: typeof AudioContext;\n }\n\n interface Crypto {\n webkitSubtle?: Window[\"crypto\"][\"subtle\"];\n }\n\n interface MediaDevices {\n // This is experimental and types don't know about it yet\n // https://github.com/microsoft/TypeScript/issues/33232\n getDisplayMedia(constraints: MediaStreamConstraints | DesktopCapturerConstraints): Promise<MediaStream>;\n getUserMedia(constraints: MediaStreamConstraints | DesktopCapturerConstraints): Promise<MediaStream>;\n }\n\n interface DesktopCapturerConstraints {\n audio:\n | boolean\n | {\n mandatory: {\n chromeMediaSource: string;\n chromeMediaSourceId: string;\n };\n };\n video:\n | boolean\n | {\n mandatory: {\n chromeMediaSource: string;\n chromeMediaSourceId: string;\n };\n };\n }\n\n interface DummyInterfaceWeShouldntBeUsingThis {}\n\n interface Navigator {\n // We check for the webkit-prefixed getUserMedia to detect if we're\n // on webkit: we should check if we still need to do this\n webkitGetUserMedia: DummyInterfaceWeShouldntBeUsingThis;\n }\n\n export interface ISettledFulfilled<T> {\n status: \"fulfilled\";\n value: T;\n }\n export interface ISettledRejected {\n status: \"rejected\";\n reason: any;\n }\n\n interface PromiseConstructor {\n allSettled<T>(promises: Promise<T>[]): Promise<Array<ISettledFulfilled<T> | ISettledRejected>>;\n }\n\n interface RTCRtpTransceiver {\n // This has been removed from TS\n // (https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1029),\n // but we still need this for MatrixCall::getRidOfRTXCodecs()\n setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;\n }\n\n interface RequestInit {\n /**\n * Specifies the priority of the fetch request relative to other requests of the same type.\n * Must be one of the following strings:\n * high: A high priority fetch request relative to other requests of the same type.\n * low: A low priority fetch request relative to other requests of the same type.\n * auto: Automatically determine the priority of the fetch request relative to other requests of the same type (default).\n *\n * @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fetch-priority-attribute\n * @see https://github.com/microsoft/TypeScript/issues/54472\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#browser_compatibility\n * Not yet supported in Safari or Firefox\n */\n priority?: \"high\" | \"low\" | \"auto\";\n }\n}\n"],"mappings":";;;;;AAiBAA,OAAA"}

View File

@@ -1,7 +0,0 @@
export type JsonValue = null | string | number | boolean;
export type JsonArray = Array<JsonValue | JsonObject | JsonArray>;
export interface JsonObject {
[key: string]: JsonObject | JsonArray | JsonValue;
}
export type Json = JsonArray | JsonObject;
//# sourceMappingURL=json.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/@types/json.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAClE,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;CACrD;AACD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=json.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"json.js","names":[],"sources":["../../src/@types/json.ts"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n// Types for JSON and JSON objects, copied from element-web (left in both places as I don't think we\n// want this as a part of js-sdk's interface and I don't think it's worth it being its own package)\n\nexport type JsonValue = null | string | number | boolean;\nexport type JsonArray = Array<JsonValue | JsonObject | JsonArray>;\nexport interface JsonObject {\n [key: string]: JsonObject | JsonArray | JsonValue;\n}\nexport type Json = JsonArray | JsonObject;\n"],"mappings":"","ignoreList":[]}

View File

@@ -1,3 +1,6 @@
export {};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=local_notifications.js.map

View File

@@ -1 +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":[]}
{"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":""}

View File

@@ -1,6 +1,6 @@
import { type EitherAnd } from "matrix-events-sdk";
import { UnstableValue } from "../NamespacedValue.ts";
import { type M_TEXT } from "./extensible_events.ts";
import { EitherAnd } from "matrix-events-sdk";
import { UnstableValue } from "../NamespacedValue";
import { M_TEXT } from "./extensible_events";
export declare enum LocationAssetType {
Self = "m.self",
Pin = "m.pin"

View File

@@ -1 +1 @@
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/@types/location.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,oBAAY,iBAAiB;IACzB,IAAI,WAAW;IACf,GAAG,UAAU;CAChB;AAED,eAAO,MAAM,OAAO,sDAA2D,CAAC;AAChF,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AACxD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;IAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,EAAE;IAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE7G,eAAO,MAAM,WAAW,gDAAqD,CAAC;AAC9E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;IAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE;IAAE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE3G,eAAO,MAAM,UAAU,4DAAiE,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,E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AAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,GAAG,qBAAqB,CAAC,CAAC;AAEnG,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,0BAA0B,CAAC"}

View File

@@ -1,3 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.M_TIMESTAMP = exports.M_LOCATION = exports.M_ASSET = exports.LocationAssetType = void 0;
var _NamespacedValue = require("../NamespacedValue");
var _extensible_events = require("./extensible_events");
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
@@ -13,27 +21,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Types for MSC3488 - m.location: Extending events with location data
import { UnstableValue } from "../NamespacedValue.js";
export let LocationAssetType = /*#__PURE__*/function (LocationAssetType) {
let LocationAssetType = /*#__PURE__*/function (LocationAssetType) {
LocationAssetType["Self"] = "m.self";
LocationAssetType["Pin"] = "m.pin";
return LocationAssetType;
}({});
export const M_ASSET = new UnstableValue("m.asset", "org.matrix.msc3488.asset");
exports.LocationAssetType = LocationAssetType;
const M_ASSET = new _NamespacedValue.UnstableValue("m.asset", "org.matrix.msc3488.asset");
/**
* The event definition for an m.asset event (in content)
*/
export const M_TIMESTAMP = new UnstableValue("m.ts", "org.matrix.msc3488.ts");
exports.M_ASSET = M_ASSET;
const M_TIMESTAMP = new _NamespacedValue.UnstableValue("m.ts", "org.matrix.msc3488.ts");
/**
* The event definition for an m.ts event (in content)
*/
export const M_LOCATION = new UnstableValue("m.location", "org.matrix.msc3488.location");
exports.M_TIMESTAMP = M_TIMESTAMP;
const M_LOCATION = new _NamespacedValue.UnstableValue("m.location", "org.matrix.msc3488.location");
/* From the spec at:
* https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md
@@ -63,4 +69,5 @@ export const M_LOCATION = new UnstableValue("m.location", "org.matrix.msc3488.lo
/**
* Possible content for location events as sent over the wire
*/
exports.M_LOCATION = M_LOCATION;
//# sourceMappingURL=location.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"location.js","names":[],"sources":["../../src/@types/location.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types for MSC3488 - m.location: Extending events with location data\nimport { type EitherAnd } from \"matrix-events-sdk\";\n\nimport { UnstableValue } from \"../NamespacedValue.ts\";\nimport { type M_TEXT } from \"./extensible_events.ts\";\n\nexport enum LocationAssetType {\n Self = \"m.self\",\n Pin = \"m.pin\",\n}\n\nexport const M_ASSET = new UnstableValue(\"m.asset\", \"org.matrix.msc3488.asset\");\nexport type MAssetContent = { type: LocationAssetType };\n/**\n * The event definition for an m.asset event (in content)\n */\nexport type MAssetEvent = EitherAnd<{ [M_ASSET.name]: MAssetContent }, { [M_ASSET.altName]: MAssetContent }>;\n\nexport const M_TIMESTAMP = new UnstableValue(\"m.ts\", \"org.matrix.msc3488.ts\");\n/**\n * The event definition for an m.ts event (in content)\n */\nexport type MTimestampEvent = EitherAnd<{ [M_TIMESTAMP.name]: number }, { [M_TIMESTAMP.altName]: number }>;\n\nexport const M_LOCATION = new UnstableValue(\"m.location\", \"org.matrix.msc3488.location\");\n\nexport type MLocationContent = {\n uri: string;\n description?: string | null;\n};\n\nexport type MLocationEvent = EitherAnd<\n { [M_LOCATION.name]: MLocationContent },\n { [M_LOCATION.altName]: MLocationContent }\n>;\n\nexport type MTextEvent = EitherAnd<{ [M_TEXT.name]: string }, { [M_TEXT.altName]: string }>;\n\n/* From the spec at:\n * https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md\n{\n \"type\": \"m.room.message\",\n \"content\": {\n \"body\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"msgtype\": \"m.location\",\n \"geo_uri\": \"geo:51.5008,0.1247;u=35\",\n \"m.location\": {\n \"uri\": \"geo:51.5008,0.1247;u=35\",\n \"description\": \"Matthew's whereabouts\",\n },\n \"m.asset\": {\n \"type\": \"m.self\"\n },\n \"m.text\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"m.ts\": 1636829458432,\n }\n}\n*/\ntype OptionalTimestampEvent = MTimestampEvent | undefined;\n/**\n * The content for an m.location event\n */\nexport type MLocationEventContent = MLocationEvent & MAssetEvent & MTextEvent & OptionalTimestampEvent;\n\nexport type LegacyLocationEventContent = {\n body: string;\n msgtype: string;\n geo_uri: string;\n};\n\n/**\n * Possible content for location events as sent over the wire\n */\nexport type LocationEventWireContent = Partial<LegacyLocationEventContent & MLocationEventContent>;\n\nexport type ILocationContent = MLocationEventContent & LegacyLocationEventContent;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAGA,SAAS,aAAa,QAAQ,uBAAuB;AAGrD,WAAY,iBAAiB,0BAAjB,iBAAiB;EAAjB,iBAAiB;EAAjB,iBAAiB;EAAA,OAAjB,iBAAiB;AAAA;AAK7B,OAAO,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC;;AAE/E;AACA;AACA;;AAGA,OAAO,MAAM,WAAW,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,uBAAuB,CAAC;AAC7E;AACA;AACA;;AAGA,OAAO,MAAM,UAAU,GAAG,IAAI,aAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;;AAcxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA","ignoreList":[]}
{"version":3,"file":"location.js","names":["_NamespacedValue","require","_extensible_events","LocationAssetType","exports","M_ASSET","UnstableValue","M_TIMESTAMP","M_LOCATION"],"sources":["../../src/@types/location.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types for MSC3488 - m.location: Extending events with location data\nimport { EitherAnd } from \"matrix-events-sdk\";\n\nimport { UnstableValue } from \"../NamespacedValue\";\nimport { M_TEXT } from \"./extensible_events\";\n\nexport enum LocationAssetType {\n Self = \"m.self\",\n Pin = \"m.pin\",\n}\n\nexport const M_ASSET = new UnstableValue(\"m.asset\", \"org.matrix.msc3488.asset\");\nexport type MAssetContent = { type: LocationAssetType };\n/**\n * The event definition for an m.asset event (in content)\n */\nexport type MAssetEvent = EitherAnd<{ [M_ASSET.name]: MAssetContent }, { [M_ASSET.altName]: MAssetContent }>;\n\nexport const M_TIMESTAMP = new UnstableValue(\"m.ts\", \"org.matrix.msc3488.ts\");\n/**\n * The event definition for an m.ts event (in content)\n */\nexport type MTimestampEvent = EitherAnd<{ [M_TIMESTAMP.name]: number }, { [M_TIMESTAMP.altName]: number }>;\n\nexport const M_LOCATION = new UnstableValue(\"m.location\", \"org.matrix.msc3488.location\");\n\nexport type MLocationContent = {\n uri: string;\n description?: string | null;\n};\n\nexport type MLocationEvent = EitherAnd<\n { [M_LOCATION.name]: MLocationContent },\n { [M_LOCATION.altName]: MLocationContent }\n>;\n\nexport type MTextEvent = EitherAnd<{ [M_TEXT.name]: string }, { [M_TEXT.altName]: string }>;\n\n/* From the spec at:\n * https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md\n{\n \"type\": \"m.room.message\",\n \"content\": {\n \"body\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"msgtype\": \"m.location\",\n \"geo_uri\": \"geo:51.5008,0.1247;u=35\",\n \"m.location\": {\n \"uri\": \"geo:51.5008,0.1247;u=35\",\n \"description\": \"Matthew's whereabouts\",\n },\n \"m.asset\": {\n \"type\": \"m.self\"\n },\n \"m.text\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"m.ts\": 1636829458432,\n }\n}\n*/\ntype OptionalTimestampEvent = MTimestampEvent | undefined;\n/**\n * The content for an m.location event\n */\nexport type MLocationEventContent = MLocationEvent & MAssetEvent & MTextEvent & OptionalTimestampEvent;\n\nexport type LegacyLocationEventContent = {\n body: string;\n msgtype: string;\n geo_uri: string;\n};\n\n/**\n * Possible content for location events as sent over the wire\n */\nexport type LocationEventWireContent = Partial<LegacyLocationEventContent & MLocationEventContent>;\n\nexport type ILocationContent = MLocationEventContent & LegacyLocationEventContent;\n"],"mappings":";;;;;;AAmBA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA,IAMYE,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAAAC,OAAA,CAAAD,iBAAA,GAAAA,iBAAA;AAKtB,MAAME,OAAO,GAAG,IAAIC,8BAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC;;AAE/E;AACA;AACA;AAFAF,OAAA,CAAAC,OAAA,GAAAA,OAAA;AAKO,MAAME,WAAW,GAAG,IAAID,8BAAa,CAAC,MAAM,EAAE,uBAAuB,CAAC;AAC7E;AACA;AACA;AAFAF,OAAA,CAAAG,WAAA,GAAAA,WAAA;AAKO,MAAMC,UAAU,GAAG,IAAIF,8BAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;;AAcxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AAFAF,OAAA,CAAAI,UAAA,GAAAA,UAAA"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=matrix-sdk-crypto-wasm.d.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"matrix-sdk-crypto-wasm.d.js","names":[],"sources":["../../src/@types/matrix-sdk-crypto-wasm.d.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 * as RustSdkCryptoJs from \"@matrix-org/matrix-sdk-crypto-wasm\";\n\ndeclare module \"@matrix-org/matrix-sdk-crypto-wasm\" {\n interface SecretsBundle {\n to_json(): Promise<{\n cross_signing: {\n master_key: string;\n self_signing_key: string;\n user_signing_key: string;\n };\n backup?: {\n algorithm: string;\n key: string;\n backup_version: string;\n };\n }>;\n }\n\n interface Device {\n requestVerification(methods?: any[]): [RustSdkCryptoJs.VerificationRequest, RustSdkCryptoJs.ToDeviceRequest];\n }\n}\n"],"mappings":"","ignoreList":[]}

View File

@@ -1,220 +0,0 @@
import { type MsgType } from "../@types/event.ts";
/**
* Information on encrypted media attachments.
*
* Used within `m.room.message` events that reference files, such as `m.file` and `m.image`.
*
* @see https://spec.matrix.org/v1.11/client-server-api/#extensions-to-mroommessage-msgtypes
*/
export interface EncryptedFile {
/**
* The URL to the file.
*/
url: string;
/**
* A JSON Web Key object.
*/
key: {
alg: string;
key_ops: string[];
kty: string;
k: string;
ext: boolean;
};
/**
* The 128-bit unique counter block used by AES-CTR, encoded as unpadded base64.
*/
iv: string;
/**
* A map from an algorithm name to a hash of the ciphertext, encoded as unpadded base64.
* Clients should support the SHA-256 hash, which uses the key `sha256`.
*/
hashes: {
[alg: string]: string;
};
/**
* Version of the encrypted attachment's protocol. Must be `v2`.
*/
v: string;
}
interface ThumbnailInfo {
/**
* The mimetype of the image, e.g. image/jpeg.
*/
mimetype?: string;
/**
* The intended display width of the image in pixels.
* This may differ from the intrinsic dimensions of the image file.
*/
w?: number;
/**
* The intended display height of the image in pixels.
* This may differ from the intrinsic dimensions of the image file.
*/
h?: number;
/**
* Size of the image in bytes.
*/
size?: number;
}
interface BaseInfo {
mimetype?: string;
size?: number;
}
/**
* Information on media attachments of msgtype `m.file`
*
* Used within `m.room.message` events that reference files.
*
* @see https://spec.matrix.org/v1.11/client-server-api/#mfile
*/
export interface FileInfo extends BaseInfo {
/**
* Information on the encrypted thumbnail file, as specified in End-to-end encryption.
* Only present if the thumbnail is encrypted.
* @see https://spec.matrix.org/v1.11/client-server-api/#sending-encrypted-attachments
*/
thumbnail_file?: EncryptedFile;
/**
* Metadata about the image referred to in thumbnail_url.
*/
thumbnail_info?: ThumbnailInfo;
/**
* The URL to the thumbnail of the file. Only present if the thumbnail is unencrypted.
*/
thumbnail_url?: string;
}
/**
* Information on media attachments of msgtype `m.image`
*
* Used within `m.room.message` events that reference images.
*
* @see https://spec.matrix.org/v1.11/client-server-api/#mimage
*/
export interface ImageInfo extends FileInfo, ThumbnailInfo {
}
/**
* Information on media attachments of msgtype `m.audio`
*
* Used within `m.room.message` events that reference audio files.
*
* @see https://spec.matrix.org/v1.11/client-server-api/#maudio
*/
export interface AudioInfo extends BaseInfo {
/**
* The duration of the audio in milliseconds.
*/
duration?: number;
}
/**
* Information on media attachments of msgtype `m.video`
*
* Used within `m.room.message` events that reference video files.
*
* @see https://spec.matrix.org/v1.11/client-server-api/#mvideo
*/
export interface VideoInfo extends AudioInfo, ImageInfo {
/**
* The duration of the video in milliseconds.
*/
duration?: number;
}
/**
* Union type representing the `content.info` field of all specified media events.
*/
export type MediaEventInfo = FileInfo | ImageInfo | AudioInfo | VideoInfo;
interface BaseContent {
/**
* Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption.
* @see https://spec.matrix.org/v1.11/client-server-api/#sending-encrypted-attachments
*/
file?: EncryptedFile;
/**
* Required if the file is unencrypted. The URL (typically mxc:// URI) to the file.
*/
url?: string;
/**
* If filename is not set or the value of both properties are identical,
* this is the filename of the original upload. Otherwise, this is a
* caption for the file.
*/
body: string;
/**
* The original filename of the uploaded file.
*/
filename?: string;
/**
* The format used in the `formatted_body`.
*/
format?: "org.matrix.custom.html";
/**
* The formatted version of the `body`, when it acts as a caption. This is required if `format` is specified.
*/
formatted_body?: string;
}
/**
* Content format of media events with msgtype `m.file`
*
* @see https://spec.matrix.org/v1.11/client-server-api/#mfile
*/
export interface FileContent extends BaseContent {
/**
* Information about the file referred to in url.
*/
info?: FileInfo;
/**
* One of: [m.file].
*/
msgtype: MsgType.File;
}
/**
* Content format of media events with msgtype `m.image`
*
* @see https://spec.matrix.org/v1.11/client-server-api/#mimage
*/
export interface ImageContent extends BaseContent {
/**
* Metadata about the image referred to in url.
*/
info?: ImageInfo;
/**
* One of: [m.image].
*/
msgtype: MsgType.Image;
}
/**
* Content format of media events with msgtype `m.audio`
*
* @see https://spec.matrix.org/v1.11/client-server-api/#maudio
*/
export interface AudioContent extends BaseContent {
/**
* Metadata for the audio clip referred to in url.
*/
info?: AudioInfo;
/**
* One of: [m.audio].
*/
msgtype: MsgType.Audio;
}
/**
* Content format of media events with msgtype `m.video`
*
* @see https://spec.matrix.org/v1.11/client-server-api/#mvideo
*/
export interface VideoContent extends BaseContent {
/**
* Metadata about the video clip referred to in url.
*/
info?: VideoInfo;
/**
* One of: [m.video].
*/
msgtype: MsgType.Video;
}
/**
* Type representing media event contents for `m.room.message` events listed in the Matrix specification
*/
export type MediaEventContent = FileContent | ImageContent | AudioContent | VideoContent;
export {};
//# sourceMappingURL=media.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/@types/media.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,GAAG,EAAE,MAAM,CAAC;QACZ,CAAC,EAAE,MAAM,CAAC;QACV,GAAG,EAAE,OAAO,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAClC;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACb;AAED,UAAU,aAAa;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,QAAQ;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAS,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,YAAa,SAAQ,WAAW;IAC7C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=media.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,41 +0,0 @@
/**
* Well-known values (from the spec or MSCs) that are allowed in the
* {@link Membership} type.
*/
export declare enum KnownMembership {
/**
* The user has been banned from the room, and is no longer allowed to join
* it until they are un-banned from the room (by having their membership
* state set to a value other than ban).
*/
Ban = "ban",
/**
* The user has been invited to join a room, but has not yet joined it.
* They may not participate in the room until they join.
* */
Invite = "invite",
/**
* The user has joined the room (possibly after accepting an invite), and
* may participate in it.
*/
Join = "join",
/**
* The user has knocked on the room, requesting permission to participate.
* They may not participate in the room until they join.
*/
Knock = "knock",
/**
* The user was once joined to the room, but has since left (possibly by
* choice, or possibly by being kicked).
*/
Leave = "leave"
}
/**
* The membership state for a user in a room [1]. A value from
* {@link KnownMembership} should be used where available, but all string values
* are allowed to provide flexibility for upcoming spec changes or proposals.
*
* [1] https://spec.matrix.org/latest/client-server-api/#mroommember
*/
export type Membership = KnownMembership | string;
//# sourceMappingURL=membership.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../src/@types/membership.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,oBAAY,eAAe;IACvB;;;;OAIG;IACH,GAAG,QAAQ;IACX;;;SAGK;IACL,MAAM,WAAW;IACjB;;;OAGG;IACH,IAAI,SAAS;IACb;;;OAGG;IACH,KAAK,UAAU;IACf;;;OAGG;IACH,KAAK,UAAU;CAClB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,MAAM,CAAC"}

View File

@@ -1,58 +0,0 @@
/*
Copyright 2024 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* Well-known values (from the spec or MSCs) that are allowed in the
* {@link Membership} type.
*/
export let KnownMembership = /*#__PURE__*/function (KnownMembership) {
/**
* The user has been banned from the room, and is no longer allowed to join
* it until they are un-banned from the room (by having their membership
* state set to a value other than ban).
*/
KnownMembership["Ban"] = "ban";
/**
* The user has been invited to join a room, but has not yet joined it.
* They may not participate in the room until they join.
* */
KnownMembership["Invite"] = "invite";
/**
* The user has joined the room (possibly after accepting an invite), and
* may participate in it.
*/
KnownMembership["Join"] = "join";
/**
* The user has knocked on the room, requesting permission to participate.
* They may not participate in the room until they join.
*/
KnownMembership["Knock"] = "knock";
/**
* The user was once joined to the room, but has since left (possibly by
* choice, or possibly by being kicked).
*/
KnownMembership["Leave"] = "leave";
return KnownMembership;
}({});
/**
* The membership state for a user in a room [1]. A value from
* {@link KnownMembership} should be used where available, but all string values
* are allowed to provide flexibility for upcoming spec changes or proposals.
*
* [1] https://spec.matrix.org/latest/client-server-api/#mroommember
*/
//# sourceMappingURL=membership.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"membership.js","names":[],"sources":["../../src/@types/membership.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\n/**\n * Well-known values (from the spec or MSCs) that are allowed in the\n * {@link Membership} type.\n */\nexport enum KnownMembership {\n /**\n * The user has been banned from the room, and is no longer allowed to join\n * it until they are un-banned from the room (by having their membership\n * state set to a value other than ban).\n */\n Ban = \"ban\",\n /**\n * The user has been invited to join a room, but has not yet joined it.\n * They may not participate in the room until they join.\n * */\n Invite = \"invite\",\n /**\n * The user has joined the room (possibly after accepting an invite), and\n * may participate in it.\n */\n Join = \"join\",\n /**\n * The user has knocked on the room, requesting permission to participate.\n * They may not participate in the room until they join.\n */\n Knock = \"knock\",\n /**\n * The user was once joined to the room, but has since left (possibly by\n * choice, or possibly by being kicked).\n */\n Leave = \"leave\",\n}\n\n/**\n * The membership state for a user in a room [1]. A value from\n * {@link KnownMembership} should be used where available, but all string values\n * are allowed to provide flexibility for upcoming spec changes or proposals.\n *\n * [1] https://spec.matrix.org/latest/client-server-api/#mroommember\n */\nexport type Membership = KnownMembership | string;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAY,eAAe,0BAAf,eAAe;EACvB;AACJ;AACA;AACA;AACA;EALY,eAAe;EAOvB;AACJ;AACA;AACA;EAVY,eAAe;EAYvB;AACJ;AACA;AACA;EAfY,eAAe;EAiBvB;AACJ;AACA;AACA;EApBY,eAAe;EAsBvB;AACJ;AACA;AACA;EAzBY,eAAe;EAAA,OAAf,eAAe;AAAA;;AA6B3B;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}

View File

@@ -1,3 +1,15 @@
export interface IImageInfo {
size?: number;
mimetype?: string;
thumbnail_info?: {
w?: number;
h?: number;
size?: number;
mimetype?: string;
};
w?: number;
h?: number;
}
export declare enum Visibility {
Public = "public",
Private = "private"
@@ -22,6 +34,13 @@ export declare enum JoinRule {
export declare enum RestrictedAllowType {
RoomMembership = "m.room_membership"
}
export interface IJoinRuleEventContent {
join_rule: JoinRule;
allow?: {
type: RestrictedAllowType;
room_id: string;
}[];
}
export declare enum GuestAccess {
CanJoin = "can_join",
Forbidden = "forbidden"
@@ -36,37 +55,4 @@ export interface IUsageLimit {
limit_type: "monthly_active_user" | "hs_disabled" | string;
admin_contact?: string;
}
/**
* A policy name & url in a specific internationalisation
* @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms_response-200_internationalised-policy
*/
export interface InternationalisedPolicy {
name: string;
url: string;
}
/**
* A versioned policy with internationalised variants
* @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms_response-200_policy-object
*/
export interface Policy {
/**
* The version for the policy.
* There are no requirements on what this might be and could be “alpha”, semantically versioned, or arbitrary.
*/
version: string;
/**
* The policy information for the specified language.
* @remarks the type has to include a union with string due to limitations in the type system.
*/
[lang: string]: InternationalisedPolicy | string;
}
/**
* Response from the Terms API for Identity servers
* @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms
*/
export interface Terms {
policies: {
[policyName: string]: Policy;
};
}
//# sourceMappingURL=partials.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"partials.d.ts","sourceRoot":"","sources":["../../src/@types/partials.ts"],"names":[],"mappings":"AAgBA,oBAAY,UAAU;IAClB,MAAM,WAAW;IACjB,OAAO,YAAY;CACtB;AAED,oBAAY,MAAM;IACd,WAAW,iBAAiB;IAC5B,kBAAkB,yBAAyB;IAC3C,UAAU,gBAAgB;CAC7B;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,SAAS,CAAC;AAG5D,oBAAY,QAAQ;IAChB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,UAAU,eAAe;CAC5B;AAED,oBAAY,mBAAmB;IAC3B,cAAc,sBAAsB;CACvC;AAED,oBAAY,WAAW;IACnB,OAAO,aAAa;IACpB,SAAS,cAAc;CAC1B;AAED,oBAAY,iBAAiB;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,aAAa,mBAAmB;CACnC;AAED,MAAM,WAAW,WAAW;IAGxB,UAAU,EAAE,qBAAqB,GAAG,aAAa,GAAG,MAAM,CAAC;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACnB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,GAAG,MAAM,CAAC;CACpD;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IAClB,QAAQ,EAAE;QACN,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;KAChC,CAAC;CACL"}
{"version":3,"file":"partials.d.ts","sourceRoot":"","sources":["../../src/@types/partials.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,UAAU;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE;QAEb,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACd;AAED,oBAAY,UAAU;IAClB,MAAM,WAAW;IACjB,OAAO,YAAY;CACtB;AAED,oBAAY,MAAM;IACd,WAAW,iBAAiB;IAC5B,kBAAkB,yBAAyB;IAC3C,UAAU,gBAAgB;CAC7B;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,SAAS,CAAC;AAG5D,oBAAY,QAAQ;IAChB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,UAAU,eAAe;CAC5B;AAED,oBAAY,mBAAmB;IAC3B,cAAc,sBAAsB;CACvC;AAED,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE;QACJ,IAAI,EAAE,mBAAmB,CAAC;QAC1B,OAAO,EAAE,MAAM,CAAC;KACnB,EAAE,CAAC;CACP;AAED,oBAAY,WAAW;IACnB,OAAO,aAAa;IACpB,SAAS,cAAc;CAC1B;AAED,oBAAY,iBAAiB;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,aAAa,mBAAmB;CACnC;AAED,MAAM,WAAW,WAAW;IAIxB,UAAU,EAAE,qBAAqB,GAAG,aAAa,GAAG,MAAM,CAAC;IAE3D,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}

View File

@@ -1,3 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Visibility = exports.RestrictedAllowType = exports.Preset = exports.JoinRule = exports.HistoryVisibility = exports.GuestAccess = void 0;
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
@@ -13,59 +19,46 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export let Visibility = /*#__PURE__*/function (Visibility) {
let Visibility = /*#__PURE__*/function (Visibility) {
Visibility["Public"] = "public";
Visibility["Private"] = "private";
return Visibility;
}({});
export let Preset = /*#__PURE__*/function (Preset) {
exports.Visibility = Visibility;
let Preset = /*#__PURE__*/function (Preset) {
Preset["PrivateChat"] = "private_chat";
Preset["TrustedPrivateChat"] = "trusted_private_chat";
Preset["PublicChat"] = "public_chat";
return Preset;
}({});
exports.Preset = Preset;
// Knock and private are reserved keywords which are not yet implemented.
export let JoinRule = /*#__PURE__*/function (JoinRule) {
let JoinRule = /*#__PURE__*/function (JoinRule) {
JoinRule["Public"] = "public";
JoinRule["Invite"] = "invite";
/**
* @deprecated Reserved keyword. Should not be used. Not yet implemented.
*/
JoinRule["Private"] = "private";
JoinRule["Knock"] = "knock";
JoinRule["Restricted"] = "restricted";
return JoinRule;
}({});
export let RestrictedAllowType = /*#__PURE__*/function (RestrictedAllowType) {
exports.JoinRule = JoinRule;
let RestrictedAllowType = /*#__PURE__*/function (RestrictedAllowType) {
RestrictedAllowType["RoomMembership"] = "m.room_membership";
return RestrictedAllowType;
}({});
export let GuestAccess = /*#__PURE__*/function (GuestAccess) {
exports.RestrictedAllowType = RestrictedAllowType;
let GuestAccess = /*#__PURE__*/function (GuestAccess) {
GuestAccess["CanJoin"] = "can_join";
GuestAccess["Forbidden"] = "forbidden";
return GuestAccess;
}({});
export let HistoryVisibility = /*#__PURE__*/function (HistoryVisibility) {
exports.GuestAccess = GuestAccess;
let HistoryVisibility = /*#__PURE__*/function (HistoryVisibility) {
HistoryVisibility["Invited"] = "invited";
HistoryVisibility["Joined"] = "joined";
HistoryVisibility["Shared"] = "shared";
HistoryVisibility["WorldReadable"] = "world_readable";
return HistoryVisibility;
}({});
/**
* A policy name & url in a specific internationalisation
* @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms_response-200_internationalised-policy
*/
/**
* A versioned policy with internationalised variants
* @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms_response-200_policy-object
*/
/**
* Response from the Terms API for Identity servers
* @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms
*/
exports.HistoryVisibility = HistoryVisibility;
//# sourceMappingURL=partials.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"partials.js","names":[],"sources":["../../src/@types/partials.ts"],"sourcesContent":["/*\nCopyright 2021 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 enum Visibility {\n Public = \"public\",\n Private = \"private\",\n}\n\nexport enum Preset {\n PrivateChat = \"private_chat\",\n TrustedPrivateChat = \"trusted_private_chat\",\n PublicChat = \"public_chat\",\n}\n\nexport type ResizeMethod = \"crop\" | \"scale\";\n\nexport type IdServerUnbindResult = \"no-support\" | \"success\";\n\n// Knock and private are reserved keywords which are not yet implemented.\nexport enum JoinRule {\n Public = \"public\",\n Invite = \"invite\",\n /**\n * @deprecated Reserved keyword. Should not be used. Not yet implemented.\n */\n Private = \"private\",\n Knock = \"knock\",\n Restricted = \"restricted\",\n}\n\nexport enum RestrictedAllowType {\n RoomMembership = \"m.room_membership\",\n}\n\nexport enum GuestAccess {\n CanJoin = \"can_join\",\n Forbidden = \"forbidden\",\n}\n\nexport enum HistoryVisibility {\n Invited = \"invited\",\n Joined = \"joined\",\n Shared = \"shared\",\n WorldReadable = \"world_readable\",\n}\n\nexport interface IUsageLimit {\n // \"hs_disabled\" is NOT a specced string, but is used in Synapse\n // This is tracked over at https://github.com/matrix-org/synapse/issues/9237\n limit_type: \"monthly_active_user\" | \"hs_disabled\" | string;\n admin_contact?: string;\n}\n\n/**\n * A policy name & url in a specific internationalisation\n * @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms_response-200_internationalised-policy\n */\nexport interface InternationalisedPolicy {\n name: string;\n url: string;\n}\n\n/**\n * A versioned policy with internationalised variants\n * @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms_response-200_policy-object\n */\nexport interface Policy {\n /**\n * The version for the policy.\n * There are no requirements on what this might be and could be “alpha”, semantically versioned, or arbitrary.\n */\n version: string;\n /**\n * The policy information for the specified language.\n * @remarks the type has to include a union with string due to limitations in the type system.\n */\n [lang: string]: InternationalisedPolicy | string;\n}\n\n/**\n * Response from the Terms API for Identity servers\n * @see https://spec.matrix.org/v1.13/identity-service-api/#get_matrixidentityv2terms\n */\nexport interface Terms {\n policies: {\n [policyName: string]: Policy;\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAY,UAAU,0BAAV,UAAU;EAAV,UAAU;EAAV,UAAU;EAAA,OAAV,UAAU;AAAA;AAKtB,WAAY,MAAM,0BAAN,MAAM;EAAN,MAAM;EAAN,MAAM;EAAN,MAAM;EAAA,OAAN,MAAM;AAAA;AAUlB;AACA,WAAY,QAAQ,0BAAR,QAAQ;EAAR,QAAQ;EAAR,QAAQ;EAGhB;AACJ;AACA;EALY,QAAQ;EAAR,QAAQ;EAAR,QAAQ;EAAA,OAAR,QAAQ;AAAA;AAWpB,WAAY,mBAAmB,0BAAnB,mBAAmB;EAAnB,mBAAmB;EAAA,OAAnB,mBAAmB;AAAA;AAI/B,WAAY,WAAW,0BAAX,WAAW;EAAX,WAAW;EAAX,WAAW;EAAA,OAAX,WAAW;AAAA;AAKvB,WAAY,iBAAiB,0BAAjB,iBAAiB;EAAjB,iBAAiB;EAAjB,iBAAiB;EAAjB,iBAAiB;EAAjB,iBAAiB;EAAA,OAAjB,iBAAiB;AAAA;;AAc7B;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA","ignoreList":[]}
{"version":3,"file":"partials.js","names":["Visibility","exports","Preset","JoinRule","RestrictedAllowType","GuestAccess","HistoryVisibility"],"sources":["../../src/@types/partials.ts"],"sourcesContent":["/*\nCopyright 2021 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 IImageInfo {\n size?: number;\n mimetype?: string;\n thumbnail_info?: {\n // eslint-disable-line camelcase\n w?: number;\n h?: number;\n size?: number;\n mimetype?: string;\n };\n w?: number;\n h?: number;\n}\n\nexport enum Visibility {\n Public = \"public\",\n Private = \"private\",\n}\n\nexport enum Preset {\n PrivateChat = \"private_chat\",\n TrustedPrivateChat = \"trusted_private_chat\",\n PublicChat = \"public_chat\",\n}\n\nexport type ResizeMethod = \"crop\" | \"scale\";\n\nexport type IdServerUnbindResult = \"no-support\" | \"success\";\n\n// Knock and private are reserved keywords which are not yet implemented.\nexport enum JoinRule {\n Public = \"public\",\n Invite = \"invite\",\n /**\n * @deprecated Reserved keyword. Should not be used. Not yet implemented.\n */\n Private = \"private\",\n Knock = \"knock\",\n Restricted = \"restricted\",\n}\n\nexport enum RestrictedAllowType {\n RoomMembership = \"m.room_membership\",\n}\n\nexport interface IJoinRuleEventContent {\n join_rule: JoinRule; // eslint-disable-line camelcase\n allow?: {\n type: RestrictedAllowType;\n room_id: string; // eslint-disable-line camelcase\n }[];\n}\n\nexport enum GuestAccess {\n CanJoin = \"can_join\",\n Forbidden = \"forbidden\",\n}\n\nexport enum HistoryVisibility {\n Invited = \"invited\",\n Joined = \"joined\",\n Shared = \"shared\",\n WorldReadable = \"world_readable\",\n}\n\nexport interface IUsageLimit {\n // \"hs_disabled\" is NOT a specced string, but is used in Synapse\n // This is tracked over at https://github.com/matrix-org/synapse/issues/9237\n // eslint-disable-next-line camelcase\n limit_type: \"monthly_active_user\" | \"hs_disabled\" | string;\n // eslint-disable-next-line camelcase\n admin_contact?: string;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IA8BYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAAC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAAA,IAKVE,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAAAD,OAAA,CAAAC,MAAA,GAAAA,MAAA;AAUlB;AAAA,IACYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAAF,OAAA,CAAAE,QAAA,GAAAA,QAAA;AAAA,IAWRC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAAH,OAAA,CAAAG,mBAAA,GAAAA,mBAAA;AAAA,IAYnBC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAAJ,OAAA,CAAAI,WAAA,GAAAA,WAAA;AAAA,IAKXC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAAAL,OAAA,CAAAK,iBAAA,GAAAA,iBAAA"}

View File

@@ -1,6 +1,5 @@
import { type EitherAnd, UnstableValue } from "matrix-events-sdk";
import { type ExtensibleAnyMessageEventContent, type REFERENCE_RELATION, type RelatesToRelationship, type TSNamespace } from "./extensible_events.ts";
import { type EmptyObject } from "./common.ts";
import { EitherAnd, UnstableValue } from "matrix-events-sdk";
import { ExtensibleAnyMessageEventContent, REFERENCE_RELATION, RelatesToRelationship, TSNamespace } from "./extensible_events";
/**
* Identifier for a disclosed poll.
*/
@@ -78,9 +77,9 @@ export declare const M_POLL_END: UnstableValue<"m.poll.end", "org.matrix.msc3381
* The event definition for an m.poll.end event (in content)
*/
export type PollEndEvent = EitherAnd<{
[M_POLL_END.name]: EmptyObject;
[M_POLL_END.name]: {};
}, {
[M_POLL_END.altName]: EmptyObject;
[M_POLL_END.altName]: {};
}>;
/**
* The content for an m.poll.end event

View File

@@ -1 +1 @@
{"version":3,"file":"polls.d.ts","sourceRoot":"","sources":["../../src/@types/polls.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,qBAAqB,wEAA6E,CAAC;AAEhH;;GAEG;AACH,eAAO,MAAM,uBAAuB,4EAAiF,CAAC;AAEtH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,qBAAqB,CAAC,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,GAAG,MAAM,CAAC;AAExH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,qBAAqB,GAAG,OAAO,uBAAuB,CAAC;AAE1F;;GAEG;AACH,eAAO,MAAM,YAAY,gEAAqE,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,IAAI,EAAE,QAAQ,CAAC;IAC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AA2E,CAAC;AAExG;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,CACrC;IAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAA;CAAE,EAC/C;IAAE,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAAE,CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE5G;;GAEG;AACH,eAAO,MAAM,UAAU,4DAAiE,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;IAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;CAAE,EAAE;IAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,CAAA;CAAE,CAAC,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAC1C,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,GAChD,gCAAgC,CAAC"}

View File

@@ -1,3 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.M_POLL_START = exports.M_POLL_RESPONSE = exports.M_POLL_KIND_UNDISCLOSED = exports.M_POLL_KIND_DISCLOSED = exports.M_POLL_END = void 0;
var _matrixEventsSdk = require("matrix-events-sdk");
/*
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C.
@@ -14,16 +21,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { UnstableValue } from "matrix-events-sdk";
/**
* Identifier for a disclosed poll.
*/
export const M_POLL_KIND_DISCLOSED = new UnstableValue("m.poll.disclosed", "org.matrix.msc3381.poll.disclosed");
const M_POLL_KIND_DISCLOSED = new _matrixEventsSdk.UnstableValue("m.poll.disclosed", "org.matrix.msc3381.poll.disclosed");
/**
* Identifier for an undisclosed poll.
*/
export const M_POLL_KIND_UNDISCLOSED = new UnstableValue("m.poll.undisclosed", "org.matrix.msc3381.poll.undisclosed");
exports.M_POLL_KIND_DISCLOSED = M_POLL_KIND_DISCLOSED;
const M_POLL_KIND_UNDISCLOSED = new _matrixEventsSdk.UnstableValue("m.poll.undisclosed", "org.matrix.msc3381.poll.undisclosed");
/**
* Any poll kind.
@@ -32,11 +39,11 @@ export const M_POLL_KIND_UNDISCLOSED = new UnstableValue("m.poll.undisclosed", "
/**
* Known poll kind namespaces.
*/
exports.M_POLL_KIND_UNDISCLOSED = M_POLL_KIND_UNDISCLOSED;
/**
* The namespaced value for m.poll.start
*/
export const M_POLL_START = new UnstableValue("m.poll.start", "org.matrix.msc3381.poll.start");
const M_POLL_START = new _matrixEventsSdk.UnstableValue("m.poll.start", "org.matrix.msc3381.poll.start");
/**
* The m.poll.start type within event content
@@ -53,11 +60,11 @@ export const M_POLL_START = new UnstableValue("m.poll.start", "org.matrix.msc338
/**
* The content for an m.poll.start event
*/
exports.M_POLL_START = M_POLL_START;
/**
* The namespaced value for m.poll.response
*/
export const M_POLL_RESPONSE = new UnstableValue("m.poll.response", "org.matrix.msc3381.poll.response");
const M_POLL_RESPONSE = new _matrixEventsSdk.UnstableValue("m.poll.response", "org.matrix.msc3381.poll.response");
/**
* The m.poll.response type within event content
@@ -70,11 +77,11 @@ export const M_POLL_RESPONSE = new UnstableValue("m.poll.response", "org.matrix.
/**
* The content for an m.poll.response event
*/
exports.M_POLL_RESPONSE = M_POLL_RESPONSE;
/**
* The namespaced value for m.poll.end
*/
export const M_POLL_END = new UnstableValue("m.poll.end", "org.matrix.msc3381.poll.end");
const M_POLL_END = new _matrixEventsSdk.UnstableValue("m.poll.end", "org.matrix.msc3381.poll.end");
/**
* The event definition for an m.poll.end event (in content)
@@ -83,4 +90,5 @@ export const M_POLL_END = new UnstableValue("m.poll.end", "org.matrix.msc3381.po
/**
* The content for an m.poll.end event
*/
exports.M_POLL_END = M_POLL_END;
//# sourceMappingURL=polls.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"polls.js","names":[],"sources":["../../src/@types/polls.ts"],"sourcesContent":["/*\nCopyright 2022 - 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, UnstableValue } from \"matrix-events-sdk\";\n\nimport {\n type ExtensibleAnyMessageEventContent,\n type REFERENCE_RELATION,\n type RelatesToRelationship,\n type TSNamespace,\n} from \"./extensible_events.ts\";\nimport { type EmptyObject } from \"./common.ts\";\n\n/**\n * Identifier for a disclosed poll.\n */\nexport const M_POLL_KIND_DISCLOSED = new UnstableValue(\"m.poll.disclosed\", \"org.matrix.msc3381.poll.disclosed\");\n\n/**\n * Identifier for an undisclosed poll.\n */\nexport const M_POLL_KIND_UNDISCLOSED = new UnstableValue(\"m.poll.undisclosed\", \"org.matrix.msc3381.poll.undisclosed\");\n\n/**\n * Any poll kind.\n */\nexport type PollKind = TSNamespace<typeof M_POLL_KIND_DISCLOSED> | TSNamespace<typeof M_POLL_KIND_UNDISCLOSED> | string;\n\n/**\n * Known poll kind namespaces.\n */\nexport type KnownPollKind = typeof M_POLL_KIND_DISCLOSED | typeof M_POLL_KIND_UNDISCLOSED;\n\n/**\n * The namespaced value for m.poll.start\n */\nexport const M_POLL_START = new UnstableValue(\"m.poll.start\", \"org.matrix.msc3381.poll.start\");\n\n/**\n * The m.poll.start type within event content\n */\nexport type PollStartSubtype = {\n question: ExtensibleAnyMessageEventContent;\n kind: PollKind;\n max_selections?: number; // default 1, always positive\n answers: PollAnswer[];\n};\n\n/**\n * A poll answer.\n */\nexport type PollAnswer = ExtensibleAnyMessageEventContent & { id: string };\n\n/**\n * The event definition for an m.poll.start event (in content)\n */\nexport type PollStartEvent = EitherAnd<\n { [M_POLL_START.name]: PollStartSubtype },\n { [M_POLL_START.altName]: PollStartSubtype }\n>;\n\n/**\n * The content for an m.poll.start event\n */\nexport type PollStartEventContent = PollStartEvent & ExtensibleAnyMessageEventContent;\n\n/**\n * The namespaced value for m.poll.response\n */\nexport const M_POLL_RESPONSE = new UnstableValue(\"m.poll.response\", \"org.matrix.msc3381.poll.response\");\n\n/**\n * The m.poll.response type within event content\n */\nexport type PollResponseSubtype = {\n answers: string[];\n};\n\n/**\n * The event definition for an m.poll.response event (in content)\n */\nexport type PollResponseEvent = EitherAnd<\n { [M_POLL_RESPONSE.name]: PollResponseSubtype },\n { [M_POLL_RESPONSE.altName]: PollResponseSubtype }\n>;\n\n/**\n * The content for an m.poll.response event\n */\nexport type PollResponseEventContent = PollResponseEvent & RelatesToRelationship<typeof REFERENCE_RELATION>;\n\n/**\n * The namespaced value for m.poll.end\n */\nexport const M_POLL_END = new UnstableValue(\"m.poll.end\", \"org.matrix.msc3381.poll.end\");\n\n/**\n * The event definition for an m.poll.end event (in content)\n */\nexport type PollEndEvent = EitherAnd<{ [M_POLL_END.name]: EmptyObject }, { [M_POLL_END.altName]: EmptyObject }>;\n\n/**\n * The content for an m.poll.end event\n */\nexport type PollEndEventContent = PollEndEvent &\n RelatesToRelationship<typeof REFERENCE_RELATION> &\n ExtensibleAnyMessageEventContent;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAyB,aAAa,QAAQ,mBAAmB;AAUjE;AACA;AACA;AACA,OAAO,MAAM,qBAAqB,GAAG,IAAI,aAAa,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;;AAE/G;AACA;AACA;AACA,OAAO,MAAM,uBAAuB,GAAG,IAAI,aAAa,CAAC,oBAAoB,EAAE,qCAAqC,CAAC;;AAErH;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAM,YAAY,GAAG,IAAI,aAAa,CAAC,cAAc,EAAE,+BAA+B,CAAC;;AAE9F;AACA;AACA;;AAQA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAM,eAAe,GAAG,IAAI,aAAa,CAAC,iBAAiB,EAAE,kCAAkC,CAAC;;AAEvG;AACA;AACA;;AAKA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAM,UAAU,GAAG,IAAI,aAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;;AAExF;AACA;AACA;;AAGA;AACA;AACA","ignoreList":[]}
{"version":3,"file":"polls.js","names":["_matrixEventsSdk","require","M_POLL_KIND_DISCLOSED","UnstableValue","exports","M_POLL_KIND_UNDISCLOSED","M_POLL_START","M_POLL_RESPONSE","M_POLL_END"],"sources":["../../src/@types/polls.ts"],"sourcesContent":["/*\nCopyright 2022 - 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 { EitherAnd, UnstableValue } from \"matrix-events-sdk\";\n\nimport {\n ExtensibleAnyMessageEventContent,\n REFERENCE_RELATION,\n RelatesToRelationship,\n TSNamespace,\n} from \"./extensible_events\";\n\n/**\n * Identifier for a disclosed poll.\n */\nexport const M_POLL_KIND_DISCLOSED = new UnstableValue(\"m.poll.disclosed\", \"org.matrix.msc3381.poll.disclosed\");\n\n/**\n * Identifier for an undisclosed poll.\n */\nexport const M_POLL_KIND_UNDISCLOSED = new UnstableValue(\"m.poll.undisclosed\", \"org.matrix.msc3381.poll.undisclosed\");\n\n/**\n * Any poll kind.\n */\nexport type PollKind = TSNamespace<typeof M_POLL_KIND_DISCLOSED> | TSNamespace<typeof M_POLL_KIND_UNDISCLOSED> | string;\n\n/**\n * Known poll kind namespaces.\n */\nexport type KnownPollKind = typeof M_POLL_KIND_DISCLOSED | typeof M_POLL_KIND_UNDISCLOSED;\n\n/**\n * The namespaced value for m.poll.start\n */\nexport const M_POLL_START = new UnstableValue(\"m.poll.start\", \"org.matrix.msc3381.poll.start\");\n\n/**\n * The m.poll.start type within event content\n */\nexport type PollStartSubtype = {\n question: ExtensibleAnyMessageEventContent;\n kind: PollKind;\n max_selections?: number; // default 1, always positive\n answers: PollAnswer[];\n};\n\n/**\n * A poll answer.\n */\nexport type PollAnswer = ExtensibleAnyMessageEventContent & { id: string };\n\n/**\n * The event definition for an m.poll.start event (in content)\n */\nexport type PollStartEvent = EitherAnd<\n { [M_POLL_START.name]: PollStartSubtype },\n { [M_POLL_START.altName]: PollStartSubtype }\n>;\n\n/**\n * The content for an m.poll.start event\n */\nexport type PollStartEventContent = PollStartEvent & ExtensibleAnyMessageEventContent;\n\n/**\n * The namespaced value for m.poll.response\n */\nexport const M_POLL_RESPONSE = new UnstableValue(\"m.poll.response\", \"org.matrix.msc3381.poll.response\");\n\n/**\n * The m.poll.response type within event content\n */\nexport type PollResponseSubtype = {\n answers: string[];\n};\n\n/**\n * The event definition for an m.poll.response event (in content)\n */\nexport type PollResponseEvent = EitherAnd<\n { [M_POLL_RESPONSE.name]: PollResponseSubtype },\n { [M_POLL_RESPONSE.altName]: PollResponseSubtype }\n>;\n\n/**\n * The content for an m.poll.response event\n */\nexport type PollResponseEventContent = PollResponseEvent & RelatesToRelationship<typeof REFERENCE_RELATION>;\n\n/**\n * The namespaced value for m.poll.end\n */\nexport const M_POLL_END = new UnstableValue(\"m.poll.end\", \"org.matrix.msc3381.poll.end\");\n\n/**\n * The event definition for an m.poll.end event (in content)\n */\nexport type PollEndEvent = EitherAnd<{ [M_POLL_END.name]: {} }, { [M_POLL_END.altName]: {} }>;\n\n/**\n * The content for an m.poll.end event\n */\nexport type PollEndEventContent = PollEndEvent &\n RelatesToRelationship<typeof REFERENCE_RELATION> &\n ExtensibleAnyMessageEventContent;\n"],"mappings":";;;;;;AAgBA,IAAAA,gBAAA,GAAAC,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAG,IAAIC,8BAAa,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;;AAE/G;AACA;AACA;AAFAC,OAAA,CAAAF,qBAAA,GAAAA,qBAAA;AAGO,MAAMG,uBAAuB,GAAG,IAAIF,8BAAa,CAAC,oBAAoB,EAAE,qCAAqC,CAAC;;AAErH;AACA;AACA;;AAGA;AACA;AACA;AAFAC,OAAA,CAAAC,uBAAA,GAAAA,uBAAA;AAKA;AACA;AACA;AACO,MAAMC,YAAY,GAAG,IAAIH,8BAAa,CAAC,cAAc,EAAE,+BAA+B,CAAC;;AAE9F;AACA;AACA;;AAQA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAFAC,OAAA,CAAAE,YAAA,GAAAA,YAAA;AAKA;AACA;AACA;AACO,MAAMC,eAAe,GAAG,IAAIJ,8BAAa,CAAC,iBAAiB,EAAE,kCAAkC,CAAC;;AAEvG;AACA;AACA;;AAKA;AACA;AACA;;AAMA;AACA;AACA;AAFAC,OAAA,CAAAG,eAAA,GAAAA,eAAA;AAKA;AACA;AACA;AACO,MAAMC,UAAU,GAAG,IAAIL,8BAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;;AAExF;AACA;AACA;;AAGA;AACA;AACA;AAFAC,OAAA,CAAAI,UAAA,GAAAA,UAAA"}

View File

@@ -1,3 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ReceiptType = exports.MAIN_ROOM_TIMELINE = void 0;
/*
Copyright 2022 Šimon Brandner <simon.bra.ag@gmail.com>
@@ -13,15 +19,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export let ReceiptType = /*#__PURE__*/function (ReceiptType) {
let ReceiptType = /*#__PURE__*/function (ReceiptType) {
ReceiptType["Read"] = "m.read";
ReceiptType["FullyRead"] = "m.fully_read";
ReceiptType["ReadPrivate"] = "m.read.private";
return ReceiptType;
}({});
export const MAIN_ROOM_TIMELINE = "main";
exports.ReceiptType = ReceiptType;
const MAIN_ROOM_TIMELINE = "main";
// We will only hold a synthetic receipt if we do not have a real receipt or the synthetic is newer.
// map: receipt type → user Id → receipt
exports.MAIN_ROOM_TIMELINE = MAIN_ROOM_TIMELINE;
//# sourceMappingURL=read_receipts.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"read_receipts.js","names":[],"sources":["../../src/@types/read_receipts.ts"],"sourcesContent":["/*\nCopyright 2022 Šimon Brandner <simon.bra.ag@gmail.com>\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 enum ReceiptType {\n Read = \"m.read\",\n FullyRead = \"m.fully_read\",\n ReadPrivate = \"m.read.private\",\n}\n\nexport const MAIN_ROOM_TIMELINE = \"main\";\n\nexport interface Receipt {\n ts: number;\n thread_id?: string;\n}\n\nexport interface WrappedReceipt {\n eventId: string;\n data: Receipt;\n}\n\nexport interface CachedReceipt {\n type: ReceiptType;\n userId: string;\n data: Receipt;\n}\n\nexport type ReceiptCache = Map<string, CachedReceipt[]>;\n\nexport interface ReceiptContent {\n [eventId: string]: {\n [key in ReceiptType | string]: {\n [userId: string]: Receipt;\n };\n };\n}\n\n// We will only hold a synthetic receipt if we do not have a real receipt or the synthetic is newer.\n// map: receipt type → user Id → receipt\nexport type Receipts = Map<string, Map<string, [real: WrappedReceipt | null, synthetic: WrappedReceipt | null]>>;\n\nexport type CachedReceiptStructure = {\n eventId: string;\n receiptType: string | ReceiptType;\n userId: string;\n receipt: Receipt;\n synthetic: boolean;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAY,WAAW,0BAAX,WAAW;EAAX,WAAW;EAAX,WAAW;EAAX,WAAW;EAAA,OAAX,WAAW;AAAA;AAMvB,OAAO,MAAM,kBAAkB,GAAG,MAAM;;AA4BxC;AACA","ignoreList":[]}
{"version":3,"file":"read_receipts.js","names":["ReceiptType","exports","MAIN_ROOM_TIMELINE"],"sources":["../../src/@types/read_receipts.ts"],"sourcesContent":["/*\nCopyright 2022 Šimon Brandner <simon.bra.ag@gmail.com>\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 enum ReceiptType {\n Read = \"m.read\",\n FullyRead = \"m.fully_read\",\n ReadPrivate = \"m.read.private\",\n}\n\nexport const MAIN_ROOM_TIMELINE = \"main\";\n\nexport interface Receipt {\n ts: number;\n thread_id?: string;\n}\n\nexport interface WrappedReceipt {\n eventId: string;\n data: Receipt;\n}\n\nexport interface CachedReceipt {\n type: ReceiptType;\n userId: string;\n data: Receipt;\n}\n\nexport type ReceiptCache = Map<string, CachedReceipt[]>;\n\nexport interface ReceiptContent {\n [eventId: string]: {\n [key in ReceiptType | string]: {\n [userId: string]: Receipt;\n };\n };\n}\n\n// We will only hold a synthetic receipt if we do not have a real receipt or the synthetic is newer.\n// map: receipt type → user Id → receipt\nexport type Receipts = Map<string, Map<string, [real: WrappedReceipt | null, synthetic: WrappedReceipt | null]>>;\n\nexport type CachedReceiptStructure = {\n eventId: string;\n receiptType: string | ReceiptType;\n userId: string;\n receipt: Receipt;\n synthetic: boolean;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IAgBYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAAC,OAAA,CAAAD,WAAA,GAAAA,WAAA;AAMhB,MAAME,kBAAkB,GAAG,MAAM;;AA4BxC;AACA;AAAAD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA"}

View File

@@ -1,4 +1,4 @@
import { type AuthDict } from "../interactive-auth.ts";
import { AuthDict } from "../interactive-auth";
/**
* The request body of a call to `POST /_matrix/client/v3/register`.
*
@@ -35,13 +35,21 @@ export interface RegisterRequest {
*/
initial_device_display_name?: string;
/**
* Guest users can also upgrade their account by going through the ordinary register flow,
* but specifying the additional POST parameter guest_access_token containing the guest’s access token.
* They are also required to specify the username parameter to the value of the local part of their username,
* which is otherwise optional.
* @see https://spec.matrix.org/v1.10/client-server-api/#guest-access
* @deprecated missing in the spec
*/
guest_access_token?: string;
/**
* @deprecated missing in the spec
*/
x_show_msisdn?: boolean;
/**
* @deprecated missing in the spec
*/
bind_msisdn?: boolean;
/**
* @deprecated missing in the spec
*/
bind_email?: boolean;
}
/**
* The result of a successful call to `POST /_matrix/client/v3/register`.
@@ -81,5 +89,11 @@ export interface RegisterResponse {
* Omitted if the inhibit_login option is true.
*/
refresh_token?: string;
/**
* The server_name of the homeserver on which the account has been registered.
*
* @deprecated Clients should extract the server_name from user_id (by splitting at the first colon) if they require it.
*/
home_server?: string;
}
//# sourceMappingURL=registration.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../src/@types/registration.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../src/@types/registration.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}

View File

@@ -1,3 +1,6 @@
export {};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=registration.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"registration.js","names":[],"sources":["../../src/@types/registration.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type AuthDict } from \"../interactive-auth.ts\";\n\n/**\n * The request body of a call to `POST /_matrix/client/v3/register`.\n *\n * @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3register\n */\nexport interface RegisterRequest {\n /**\n * Additional authentication information for the user-interactive authentication API.\n * Note that this information is not used to define how the registered user should be authenticated,\n * but is instead used to authenticate the register call itself.\n */\n auth?: AuthDict;\n /**\n * The basis for the localpart of the desired Matrix ID.\n * If omitted, the homeserver MUST generate a Matrix ID local part.\n */\n username?: string;\n /**\n * The desired password for the account.\n */\n password?: string;\n /**\n * If true, the client supports refresh tokens.\n */\n refresh_token?: boolean;\n /**\n * If true, an access_token and device_id should not be returned from this call, therefore preventing an automatic login.\n * Defaults to false.\n */\n inhibit_login?: boolean;\n /**\n * A display name to assign to the newly-created device.\n * Ignored if device_id corresponds to a known device.\n */\n initial_device_display_name?: string;\n /**\n * Guest users can also upgrade their account by going through the ordinary register flow,\n * but specifying the additional POST parameter guest_access_token containing the guest’s access token.\n * They are also required to specify the username parameter to the value of the local part of their username,\n * which is otherwise optional.\n * @see https://spec.matrix.org/v1.10/client-server-api/#guest-access\n */\n guest_access_token?: string;\n}\n\n/**\n * The result of a successful call to `POST /_matrix/client/v3/register`.\n *\n * @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3register\n */\nexport interface RegisterResponse {\n /**\n * The fully-qualified Matrix user ID (MXID) that has been registered.\n */\n user_id: string;\n /**\n * An access token for the account.\n * This access token can then be used to authorize other requests.\n * Required if the inhibit_login option is false.\n */\n access_token?: string;\n /**\n * ID of the registered device.\n * Will be the same as the corresponding parameter in the request, if one was specified.\n * Required if the inhibit_login option is false.\n */\n device_id?: string;\n /**\n * The lifetime of the access token, in milliseconds.\n * Once the access token has expired a new access token can be obtained by using the provided refresh token.\n * If no refresh token is provided, the client will need to re-log in to obtain a new access token.\n * If not given, the client can assume that the access token will not expire.\n *\n * Omitted if the inhibit_login option is true.\n */\n expires_in_ms?: number;\n /**\n * A refresh token for the account.\n * This token can be used to obtain a new access token when it expires by calling the /refresh endpoint.\n *\n * Omitted if the inhibit_login option is true.\n */\n refresh_token?: string;\n}\n"],"mappings":"","ignoreList":[]}
{"version":3,"file":"registration.js","names":[],"sources":["../../src/@types/registration.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { AuthDict } from \"../interactive-auth\";\n\n/**\n * The request body of a call to `POST /_matrix/client/v3/register`.\n *\n * @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3register\n */\nexport interface RegisterRequest {\n /**\n * Additional authentication information for the user-interactive authentication API.\n * Note that this information is not used to define how the registered user should be authenticated,\n * but is instead used to authenticate the register call itself.\n */\n auth?: AuthDict;\n /**\n * The basis for the localpart of the desired Matrix ID.\n * If omitted, the homeserver MUST generate a Matrix ID local part.\n */\n username?: string;\n /**\n * The desired password for the account.\n */\n password?: string;\n /**\n * If true, the client supports refresh tokens.\n */\n refresh_token?: boolean;\n /**\n * If true, an access_token and device_id should not be returned from this call, therefore preventing an automatic login.\n * Defaults to false.\n */\n inhibit_login?: boolean;\n /**\n * A display name to assign to the newly-created device.\n * Ignored if device_id corresponds to a known device.\n */\n initial_device_display_name?: string;\n /**\n * @deprecated missing in the spec\n */\n guest_access_token?: string;\n /**\n * @deprecated missing in the spec\n */\n x_show_msisdn?: boolean;\n /**\n * @deprecated missing in the spec\n */\n bind_msisdn?: boolean;\n /**\n * @deprecated missing in the spec\n */\n bind_email?: boolean;\n}\n\n/**\n * The result of a successful call to `POST /_matrix/client/v3/register`.\n *\n * @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3register\n */\nexport interface RegisterResponse {\n /**\n * The fully-qualified Matrix user ID (MXID) that has been registered.\n */\n user_id: string;\n /**\n * An access token for the account.\n * This access token can then be used to authorize other requests.\n * Required if the inhibit_login option is false.\n */\n access_token?: string;\n /**\n * ID of the registered device.\n * Will be the same as the corresponding parameter in the request, if one was specified.\n * Required if the inhibit_login option is false.\n */\n device_id?: string;\n /**\n * The lifetime of the access token, in milliseconds.\n * Once the access token has expired a new access token can be obtained by using the provided refresh token.\n * If no refresh token is provided, the client will need to re-log in to obtain a new access token.\n * If not given, the client can assume that the access token will not expire.\n *\n * Omitted if the inhibit_login option is true.\n */\n expires_in_ms?: number;\n /**\n * A refresh token for the account.\n * This token can be used to obtain a new access token when it expires by calling the /refresh endpoint.\n *\n * Omitted if the inhibit_login option is true.\n */\n refresh_token?: string;\n /**\n * The server_name of the homeserver on which the account has been registered.\n *\n * @deprecated Clients should extract the server_name from user_id (by splitting at the first colon) if they require it.\n */\n home_server?: string;\n}\n"],"mappings":""}

View File

@@ -1,54 +1,26 @@
import { type IContent, type IEvent } from "../models/event.ts";
import { type Preset, type Visibility } from "./partials.ts";
import { type IEventWithRoomId, type SearchKey } from "./search.ts";
import { type IRoomEventFilter } from "../filter.ts";
import { type Direction } from "../models/event-timeline.ts";
import { type PushRuleAction } from "./PushRules.ts";
import { type MatrixError } from "../matrix.ts";
import { type IRoomEvent } from "../sync-accumulator.ts";
import { type EventType, type RelationType, type RoomType } from "./event.ts";
import { IContent, IEvent } from "../models/event";
import { Preset, Visibility } from "./partials";
import { IEventWithRoomId, SearchKey } from "./search";
import { IRoomEventFilter } from "../filter";
import { Direction } from "../models/event-timeline";
import { PushRuleAction } from "./PushRules";
import { IRoomEvent } from "../sync-accumulator";
import { EventType, RelationType, RoomType } from "./event";
export interface IJoinRoomOpts {
/**
* True to do a room initial sync on the resulting
* room. If false, the <strong>returned Room object will have no current state.
* </strong> Default: true.
*/
syncRoom?: boolean;
/**
* If the caller has a keypair 3pid invite, the signing URL is passed in this parameter.
*/
inviteSignUrl?: string;
/**
* The server names to try and join through in addition to those that are automatically chosen.
* Only the first 3 are actually used in the request, to avoid HTTP 414 Request-URI Too Long responses.
*/
viaServers?: string[];
/**
* Previously, configured whether to accept encrypted history shared by the inviter. This is now always enabled,
* and the setting is only retained to avoid a breaking change to the API. It has no effect.
*
* @deprecated
*/
acceptSharedHistory?: boolean;
}
/** Options object for {@link MatrixClient.invite}. */
export interface InviteOpts {
/**
* The reason for the invite.
*/
reason?: string;
/**
* Previously, configured whether to send encrypted history if the visibility settings allow it.
* This is now always enabled, and the setting is only retained to avoid a breaking change to the API. It has no effect.
*
* @deprecated
*/
shareEncryptedHistory?: boolean;
}
export interface KnockRoomOpts {
/**
* The reason for the knock.
*/
reason?: string;
/**
* The server names to try and knock through in addition to those that are automatically chosen.
* Only the first 3 are actually used in the request, to avoid HTTP 414 Request-URI Too Long responses.
*/
viaServers?: string | string[];
}
export interface IRedactOpts {
reason?: string;
@@ -67,48 +39,6 @@ export interface IRedactOpts {
export interface ISendEventResponse {
event_id: string;
}
export type SendDelayedEventRequestOpts = {
parent_delay_id: string;
} | {
delay: number;
parent_delay_id?: string;
};
export declare function isSendDelayedEventRequestOpts(opts: object): opts is SendDelayedEventRequestOpts;
export type SendDelayedEventResponse = {
delay_id: string;
};
export declare enum UpdateDelayedEventAction {
Cancel = "cancel",
Restart = "restart",
Send = "send"
}
export type UpdateDelayedEventRequestOpts = SendDelayedEventResponse & {
action: UpdateDelayedEventAction;
};
type DelayedPartialTimelineEvent = {
room_id: string;
type: string;
content: IContent;
};
type DelayedPartialStateEvent = DelayedPartialTimelineEvent & {
state_key: string;
};
type DelayedPartialEvent = DelayedPartialTimelineEvent | DelayedPartialStateEvent;
export type DelayedEventInfoItem = DelayedPartialEvent & SendDelayedEventResponse & SendDelayedEventRequestOpts & {
running_since: number;
};
export type DelayedEventInfo = {
scheduled?: DelayedEventInfoItem[];
finalised?: {
delayed_event: DelayedEventInfoItem;
outcome: "send" | "cancel";
reason: "error" | "action" | "delay";
error?: MatrixError["data"];
event_id?: string;
origin_server_ts?: number;
}[];
next_batch?: string;
};
export interface IPresenceOpts {
presence: "online" | "offline" | "unavailable";
status_msg?: string;
@@ -176,20 +106,9 @@ export interface ICreateRoomOpts {
room_version?: string;
}
export interface IRoomDirectoryOptions {
/**
* The remote server to query for the room list.
* Optional. If unspecified, get the local homeserver's public room list.
*/
server?: string;
/**
* Maximum number of entries to return
*/
limit?: number;
/**
* Token to paginate from
*/
since?: string;
/** Filter parameters */
filter?: {
generic_search_term?: string;
room_types?: Array<RoomType | null>;
@@ -211,6 +130,11 @@ export interface IBindThreePidBody {
id_access_token: string | null;
sid: string;
}
export interface IAddThreePidBody {
client_secret: string;
id_server: string;
sid: string;
}
export interface IRelationsRequestOpts {
from?: string;
to?: string;
@@ -224,12 +148,12 @@ export interface IRelationsResponse {
prev_batch?: string;
}
export interface IContextResponse {
end?: string;
start?: string;
state?: IEventWithRoomId[];
events_before?: IEventWithRoomId[];
events_after?: IEventWithRoomId[];
event?: IEventWithRoomId;
end: string;
start: string;
state: IEventWithRoomId[];
events_before: IEventWithRoomId[];
events_after: IEventWithRoomId[];
event: IEventWithRoomId;
}
export interface IEventsResponse {
chunk: IEventWithRoomId[];
@@ -262,5 +186,4 @@ export interface IStatusResponse extends IPresenceOpts {
currently_active?: boolean;
last_active_ago?: number;
}
export {};
//# sourceMappingURL=requests.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -1,37 +1,6 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
"use strict";
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/** Options object for {@link MatrixClient.invite}. */
export function isSendDelayedEventRequestOpts(opts) {
if ("parent_delay_id" in opts && typeof opts.parent_delay_id !== "string") {
// Invalid type, reject
return false;
}
if ("delay" in opts && typeof opts.delay !== "number") {
// Invalid type, reject.
return true;
}
// At least one of these fields must be specified.
return "delay" in opts || "parent_delay_id" in opts;
}
export let UpdateDelayedEventAction = /*#__PURE__*/function (UpdateDelayedEventAction) {
UpdateDelayedEventAction["Cancel"] = "cancel";
UpdateDelayedEventAction["Restart"] = "restart";
UpdateDelayedEventAction["Send"] = "send";
return UpdateDelayedEventAction;
}({});
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=requests.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,15 +0,0 @@
import { UnstableValue } from "../NamespacedValue.ts";
/**
* Event type for a room policy event.
* NOTE: While MSC1763 has not been merged, `m.room.retention` is unfortunately
* already in use in production.
*/
export declare const ROOM_RETENTION_TYPE: UnstableValue<"m.room.retention", "org.matrix.msc1763.retention">;
/**
* The content of a `m.room.retention` state event.
*/
export interface RoomRetentionContent {
max_lifetime?: number;
min_lifetime?: number;
}
//# sourceMappingURL=retention.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"retention.d.ts","sourceRoot":"","sources":["../../src/@types/retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,mEAAwE,CAAC;AAEzG;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}

View File

@@ -1,13 +0,0 @@
import { UnstableValue } from "../NamespacedValue.js";
/**
* Event type for a room policy event.
* NOTE: While MSC1763 has not been merged, `m.room.retention` is unfortunately
* already in use in production.
*/
export const ROOM_RETENTION_TYPE = new UnstableValue("m.room.retention", "org.matrix.msc1763.retention");
/**
* The content of a `m.room.retention` state event.
*/
//# sourceMappingURL=retention.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"retention.js","names":[],"sources":["../../src/@types/retention.ts"],"sourcesContent":["import { UnstableValue } from \"../NamespacedValue.ts\";\n\n/**\n * Event type for a room policy event.\n * NOTE: While MSC1763 has not been merged, `m.room.retention` is unfortunately\n * already in use in production.\n */\nexport const ROOM_RETENTION_TYPE = new UnstableValue(\"m.room.retention\", \"org.matrix.msc1763.retention\");\n\n/**\n * The content of a `m.room.retention` state event.\n */\nexport interface RoomRetentionContent {\n max_lifetime?: number;\n min_lifetime?: number;\n}\n"],"mappings":"AAAA,SAAS,aAAa,QAAQ,uBAAuB;;AAErD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,mBAAmB,GAAG,IAAI,aAAa,CAAC,kBAAkB,EAAE,8BAA8B,CAAC;;AAExG;AACA;AACA","ignoreList":[]}

View File

@@ -1,6 +1,6 @@
import { type IRoomEvent, type IStateEvent } from "../sync-accumulator.ts";
import { type IRoomEventFilter } from "../filter.ts";
import { type SearchResult } from "../models/search-result.ts";
import { IRoomEvent, IStateEvent } from "../sync-accumulator";
import { IRoomEventFilter } from "../filter";
import { SearchResult } from "../models/search-result";
export interface IEventWithRoomId extends IRoomEvent {
room_id: string;
}
@@ -28,9 +28,9 @@ declare enum GroupKey {
Sender = "sender"
}
export interface IResultRoomEvents {
count?: number;
highlights?: string[];
results?: ISearchResult[];
count: number;
highlights: string[];
results: ISearchResult[];
state?: {
[roomId: string]: IStateEventWithRoomId[];
};

View File

@@ -1 +1 @@
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/@types/search.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAChD,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,cAAc,GAAG,cAAc,GAAG,eAAe,CAAC;AAE1E,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;CAChB;AAED,MAAM,WAAW,kBAAkB;IAC/B,iBAAiB,EAAE;QACf,WAAW,EAAE;YACT,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,EAAE,gBAAgB,CAAC;YAC1B,QAAQ,CAAC,EAAE,aAAa,CAAC;YACzB,aAAa,CAAC,EAAE;gBACZ,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,eAAe,CAAC,EAAE,OAAO,CAAC;aAC7B,CAAC;YACF,aAAa,CAAC,EAAE,OAAO,CAAC;YACxB,SAAS,CAAC,EAAE;gBACR,QAAQ,EAAE;oBACN,GAAG,EAAE,QAAQ,CAAC;iBACjB,EAAE,CAAC;aACP,CAAC;SACL,CAAC;KACL,CAAC;CACL;AAED,MAAM,WAAW,eAAe;IAC5B,iBAAiB,EAAE,iBAAiB,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC3B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B"}

View File

@@ -1,3 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SearchOrderBy = void 0;
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
@@ -14,14 +20,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Types relating to the /search API
/* eslint-disable camelcase */
var GroupKey = /*#__PURE__*/function (GroupKey) {
GroupKey["RoomId"] = "room_id";
GroupKey["Sender"] = "sender";
return GroupKey;
}(GroupKey || {});
export let SearchOrderBy = /*#__PURE__*/function (SearchOrderBy) {
let SearchOrderBy = /*#__PURE__*/function (SearchOrderBy) {
SearchOrderBy["Recent"] = "recent";
SearchOrderBy["Rank"] = "rank";
return SearchOrderBy;
}({});
/* eslint-enable camelcase */
exports.SearchOrderBy = SearchOrderBy;
//# sourceMappingURL=search.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"search.js","names":[],"sources":["../../src/@types/search.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types relating to the /search API\n\nimport { type IRoomEvent, type IStateEvent } from \"../sync-accumulator.ts\";\nimport { type IRoomEventFilter } from \"../filter.ts\";\nimport { type SearchResult } from \"../models/search-result.ts\";\n\nexport interface IEventWithRoomId extends IRoomEvent {\n room_id: string;\n}\n\nexport interface IStateEventWithRoomId extends IStateEvent {\n room_id: string;\n}\n\nexport interface IMatrixProfile {\n avatar_url?: string;\n displayname?: string;\n}\n\nexport interface IResultContext {\n events_before: IEventWithRoomId[];\n events_after: IEventWithRoomId[];\n profile_info: Record<string, IMatrixProfile>;\n start?: string;\n end?: string;\n}\n\nexport interface ISearchResult {\n rank: number;\n result: IEventWithRoomId;\n context: IResultContext;\n}\n\nenum GroupKey {\n RoomId = \"room_id\",\n Sender = \"sender\",\n}\n\nexport interface IResultRoomEvents {\n count?: number;\n highlights?: string[];\n results?: ISearchResult[];\n state?: { [roomId: string]: IStateEventWithRoomId[] };\n groups?: {\n [groupKey in GroupKey]: {\n [value: string]: {\n next_batch?: string;\n order: number;\n results: string[];\n };\n };\n };\n next_batch?: string;\n}\n\ninterface IResultCategories {\n room_events: IResultRoomEvents;\n}\n\nexport type SearchKey = \"content.body\" | \"content.name\" | \"content.topic\";\n\nexport enum SearchOrderBy {\n Recent = \"recent\",\n Rank = \"rank\",\n}\n\nexport interface ISearchRequestBody {\n search_categories: {\n room_events: {\n search_term: string;\n keys?: SearchKey[];\n filter?: IRoomEventFilter;\n order_by?: SearchOrderBy;\n event_context?: {\n before_limit?: number;\n after_limit?: number;\n include_profile?: boolean;\n };\n include_state?: boolean;\n groupings?: {\n group_by: {\n key: GroupKey;\n }[];\n };\n };\n };\n}\n\nexport interface ISearchResponse {\n search_categories: IResultCategories;\n}\n\nexport interface ISearchResults {\n _query?: ISearchRequestBody;\n results: SearchResult[];\n highlights: string[];\n count?: number;\n next_batch?: string;\n pendingRequest?: Promise<ISearchResults>;\n abortSignal?: AbortSignal;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA,IAiCK,QAAQ,0BAAR,QAAQ;EAAR,QAAQ;EAAR,QAAQ;EAAA,OAAR,QAAQ;AAAA,EAAR,QAAQ;AA4Bb,WAAY,aAAa,0BAAb,aAAa;EAAb,aAAa;EAAb,aAAa;EAAA,OAAb,aAAa;AAAA","ignoreList":[]}
{"version":3,"file":"search.js","names":["GroupKey","SearchOrderBy","exports"],"sources":["../../src/@types/search.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types relating to the /search API\n\nimport { IRoomEvent, IStateEvent } from \"../sync-accumulator\";\nimport { IRoomEventFilter } from \"../filter\";\nimport { SearchResult } from \"../models/search-result\";\n\n/* eslint-disable camelcase */\nexport interface IEventWithRoomId extends IRoomEvent {\n room_id: string;\n}\n\nexport interface IStateEventWithRoomId extends IStateEvent {\n room_id: string;\n}\n\nexport interface IMatrixProfile {\n avatar_url?: string;\n displayname?: string;\n}\n\nexport interface IResultContext {\n events_before: IEventWithRoomId[];\n events_after: IEventWithRoomId[];\n profile_info: Record<string, IMatrixProfile>;\n start?: string;\n end?: string;\n}\n\nexport interface ISearchResult {\n rank: number;\n result: IEventWithRoomId;\n context: IResultContext;\n}\n\nenum GroupKey {\n RoomId = \"room_id\",\n Sender = \"sender\",\n}\n\nexport interface IResultRoomEvents {\n count: number;\n highlights: string[];\n results: ISearchResult[];\n state?: { [roomId: string]: IStateEventWithRoomId[] };\n groups?: {\n [groupKey in GroupKey]: {\n [value: string]: {\n next_batch?: string;\n order: number;\n results: string[];\n };\n };\n };\n next_batch?: string;\n}\n\ninterface IResultCategories {\n room_events: IResultRoomEvents;\n}\n\nexport type SearchKey = \"content.body\" | \"content.name\" | \"content.topic\";\n\nexport enum SearchOrderBy {\n Recent = \"recent\",\n Rank = \"rank\",\n}\n\nexport interface ISearchRequestBody {\n search_categories: {\n room_events: {\n search_term: string;\n keys?: SearchKey[];\n filter?: IRoomEventFilter;\n order_by?: SearchOrderBy;\n event_context?: {\n before_limit?: number;\n after_limit?: number;\n include_profile?: boolean;\n };\n include_state?: boolean;\n groupings?: {\n group_by: {\n key: GroupKey;\n }[];\n };\n };\n };\n}\n\nexport interface ISearchResponse {\n search_categories: IResultCategories;\n}\n\nexport interface ISearchResults {\n _query?: ISearchRequestBody;\n results: SearchResult[];\n highlights: string[];\n count?: number;\n next_batch?: string;\n pendingRequest?: Promise<ISearchResults>;\n abortSignal?: AbortSignal;\n}\n/* eslint-enable camelcase */\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AAAA,IA4BKA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA,EAARA,QAAQ;AAAA,IA4BDC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAwCzB;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA"}

View File

@@ -1,3 +1,6 @@
export {};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=signed.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"signed.js","names":[],"sources":["../../src/@types/signed.ts"],"sourcesContent":["/*\nCopyright 2021 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 ISignatures {\n [entity: string]: {\n [keyId: string]: string;\n };\n}\n\nexport interface ISigned {\n signatures?: ISignatures;\n}\n"],"mappings":"","ignoreList":[]}
{"version":3,"file":"signed.js","names":[],"sources":["../../src/@types/signed.ts"],"sourcesContent":["/*\nCopyright 2021 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 ISignatures {\n [entity: string]: {\n [keyId: string]: string;\n };\n}\n\nexport interface ISigned {\n signatures?: ISignatures;\n}\n"],"mappings":""}

View File

@@ -1,6 +1,6 @@
import { type IPublicRoomsChunkRoom } from "../client.ts";
import { type RoomType } from "./event.ts";
import { type IStrippedState } from "../sync-accumulator.ts";
import { IPublicRoomsChunkRoom } from "../client";
import { RoomType } from "./event";
import { IStrippedState } from "../sync-accumulator";
export interface IHierarchyRelation extends IStrippedState {
origin_server_ts: number;
content: {

View File

@@ -1 +1 @@
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../src/@types/spaces.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACL;AAED,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACxC"}
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../src/@types/spaces.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACL;AAED,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACxC"}

View File

@@ -1,3 +1,6 @@
export {};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=spaces.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"spaces.js","names":[],"sources":["../../src/@types/spaces.ts"],"sourcesContent":["/*\nCopyright 2021 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 IPublicRoomsChunkRoom } from \"../client.ts\";\nimport { type RoomType } from \"./event.ts\";\nimport { type IStrippedState } from \"../sync-accumulator.ts\";\n\n// Types relating to Rooms of type `m.space` and related APIs\n\nexport interface IHierarchyRelation extends IStrippedState {\n origin_server_ts: number;\n content: {\n order?: string;\n suggested?: boolean;\n via?: string[];\n };\n}\n\nexport interface IHierarchyRoom extends IPublicRoomsChunkRoom {\n room_type?: RoomType | string;\n children_state: IHierarchyRelation[];\n}\n"],"mappings":"","ignoreList":[]}
{"version":3,"file":"spaces.js","names":[],"sources":["../../src/@types/spaces.ts"],"sourcesContent":["/*\nCopyright 2021 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 { IPublicRoomsChunkRoom } from \"../client\";\nimport { RoomType } from \"./event\";\nimport { IStrippedState } from \"../sync-accumulator\";\n\n// Types relating to Rooms of type `m.space` and related APIs\n\n/* eslint-disable camelcase */\nexport interface IHierarchyRelation extends IStrippedState {\n origin_server_ts: number;\n content: {\n order?: string;\n suggested?: boolean;\n via?: string[];\n };\n}\n\nexport interface IHierarchyRoom extends IPublicRoomsChunkRoom {\n room_type?: RoomType | string;\n children_state: IHierarchyRelation[];\n}\n/* eslint-enable camelcase */\n"],"mappings":""}

View File

@@ -1,121 +0,0 @@
import { type RoomType } from "./event.ts";
import { type GuestAccess, type HistoryVisibility, type JoinRule, type RestrictedAllowType } from "./partials.ts";
import { type ImageInfo } from "./media.ts";
import { type PolicyRecommendation } from "../models/invites-ignorer.ts";
export interface RoomCanonicalAliasEventContent {
alias?: string;
alt_aliases?: string[];
}
export interface RoomCreateEventContent {
"creator"?: string;
"m.federate"?: boolean;
"predecessor"?: {
event_id: string;
room_id: string;
};
"room_version"?: string;
"type"?: RoomType;
}
export interface RoomJoinRulesEventContent {
join_rule: JoinRule;
allow?: {
room_id: string;
type: RestrictedAllowType;
}[];
}
export interface RoomMemberEventContent {
avatar_url?: string;
displayname?: string;
is_direct?: boolean;
join_authorised_via_users_server?: string;
membership: "invite" | "join" | "knock" | "leave" | "ban";
reason?: string;
third_party_invite?: {
display_name: string;
signed: {
mxid: string;
token: string;
ts: number;
};
};
}
export interface RoomThirdPartyInviteEventContent {
display_name: string;
key_validity_url: string;
public_key: string;
public_keys: {
key_validity_url?: string;
public_key: string;
}[];
}
export interface RoomPowerLevelsEventContent {
ban?: number;
events?: {
[eventType: string]: number;
};
events_default?: number;
invite?: number;
kick?: number;
notifications?: {
room?: number;
};
redact?: number;
state_default?: number;
users?: {
[userId: string]: number;
};
users_default?: number;
}
export interface RoomNameEventContent {
name: string;
}
export interface RoomTopicEventContent {
topic: string | undefined | null;
}
export interface RoomAvatarEventContent {
url?: string;
info?: Omit<ImageInfo, "thumbnail_file">;
}
export interface RoomPinnedEventsEventContent {
pinned: string[];
}
export interface RoomEncryptionEventContent {
"algorithm": "m.megolm.v1.aes-sha2";
"io.element.msc4362.encrypt_state_events"?: boolean;
"rotation_period_ms"?: number;
"rotation_period_msgs"?: number;
}
export interface RoomHistoryVisibilityEventContent {
history_visibility: HistoryVisibility;
}
export interface RoomGuestAccessEventContent {
guest_access: GuestAccess;
}
export interface RoomServerAclEventContent {
allow?: string[];
allow_ip_literals?: boolean;
deny?: string[];
}
export interface RoomTombstoneEventContent {
body: string;
replacement_room: string;
}
export interface SpaceChildEventContent {
order?: string;
suggested?: boolean;
via?: string[];
}
export interface SpaceParentEventContent {
canonical?: boolean;
via?: string[];
}
export interface PolicyRuleEventContent {
entity: string;
reason: string;
recommendation: PolicyRecommendation;
}
export interface RoomPolicyContent {
via: string;
public_key: string;
}
//# sourceMappingURL=state_events.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"state_events.d.ts","sourceRoot":"","sources":["../../src/@types/state_events.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,MAAM,WAAW,8BAA8B;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;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EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,oBAAoB,CAAC;CACxC;AAED,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB"}

View File

@@ -1,3 +0,0 @@
export {};
export {};
//# sourceMappingURL=state_events.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"state_events.js","names":[],"sources":["../../src/@types/state_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 RoomType } from \"./event.ts\";\nimport { type GuestAccess, type HistoryVisibility, type JoinRule, type RestrictedAllowType } from \"./partials.ts\";\nimport { type ImageInfo } from \"./media.ts\";\nimport { type PolicyRecommendation } from \"../models/invites-ignorer.ts\";\n\nexport interface RoomCanonicalAliasEventContent {\n alias?: string;\n alt_aliases?: string[];\n}\n\nexport interface RoomCreateEventContent {\n \"creator\"?: string;\n \"m.federate\"?: boolean;\n \"predecessor\"?: {\n event_id: string;\n room_id: string;\n };\n \"room_version\"?: string;\n \"type\"?: RoomType;\n}\n\nexport interface RoomJoinRulesEventContent {\n join_rule: JoinRule;\n allow?: {\n room_id: string;\n type: RestrictedAllowType;\n }[];\n}\n\nexport interface RoomMemberEventContent {\n avatar_url?: string;\n displayname?: string;\n is_direct?: boolean;\n join_authorised_via_users_server?: string;\n membership: \"invite\" | \"join\" | \"knock\" | \"leave\" | \"ban\";\n reason?: string;\n third_party_invite?: {\n display_name: string;\n signed: {\n mxid: string;\n token: string;\n ts: number;\n };\n };\n}\n\nexport interface RoomThirdPartyInviteEventContent {\n display_name: string;\n key_validity_url: string;\n public_key: string;\n public_keys: {\n key_validity_url?: string;\n public_key: string;\n }[];\n}\n\nexport interface RoomPowerLevelsEventContent {\n ban?: number;\n events?: { [eventType: string]: number };\n events_default?: number;\n invite?: number;\n kick?: number;\n notifications?: {\n room?: number;\n };\n redact?: number;\n state_default?: number;\n users?: { [userId: string]: number };\n users_default?: number;\n}\n\nexport interface RoomNameEventContent {\n name: string;\n}\n\nexport interface RoomTopicEventContent {\n topic: string | undefined | null;\n}\n\nexport interface RoomAvatarEventContent {\n url?: string;\n // The spec says that an encrypted file can be used for the thumbnail but this isn't true\n // https://github.com/matrix-org/matrix-spec/issues/562 so omit those fields\n info?: Omit<ImageInfo, \"thumbnail_file\">;\n}\n\nexport interface RoomPinnedEventsEventContent {\n pinned: string[];\n}\n\nexport interface RoomEncryptionEventContent {\n \"algorithm\": \"m.megolm.v1.aes-sha2\";\n \"io.element.msc4362.encrypt_state_events\"?: boolean;\n \"rotation_period_ms\"?: number;\n \"rotation_period_msgs\"?: number;\n}\n\nexport interface RoomHistoryVisibilityEventContent {\n history_visibility: HistoryVisibility;\n}\n\nexport interface RoomGuestAccessEventContent {\n guest_access: GuestAccess;\n}\n\nexport interface RoomServerAclEventContent {\n allow?: string[];\n allow_ip_literals?: boolean;\n deny?: string[];\n}\n\nexport interface RoomTombstoneEventContent {\n body: string;\n replacement_room: string;\n}\n\nexport interface SpaceChildEventContent {\n order?: string;\n suggested?: boolean;\n via?: string[];\n}\n\nexport interface SpaceParentEventContent {\n canonical?: boolean;\n via?: string[];\n}\n\nexport interface PolicyRuleEventContent {\n entity: string;\n reason: string;\n recommendation: PolicyRecommendation;\n}\n\nexport interface RoomPolicyContent {\n via: string;\n public_key: string;\n}\n"],"mappings":"","ignoreList":[]}

View File

@@ -1,4 +1,4 @@
import { type IdServerUnbindResult } from "./partials.ts";
import { IdServerUnbindResult } from "./partials";
export interface ISynapseAdminWhoisResponse {
user_id: string;
devices: {

Some files were not shown because too many files have changed in this diff Show More