2023-05-04 20:25:00 +00:00
|
|
|
export type AppServiceRegistrationConfig = {
|
|
|
|
id: string
|
|
|
|
as_token: string
|
|
|
|
hs_token: string
|
|
|
|
url: string
|
|
|
|
sender_localpart: string
|
2023-07-03 05:20:24 +00:00
|
|
|
namespaces: {
|
|
|
|
users: {
|
|
|
|
exclusive: boolean
|
|
|
|
regex: string
|
|
|
|
}[]
|
|
|
|
aliases: {
|
|
|
|
exclusive: boolean
|
|
|
|
regex: string
|
|
|
|
}[]
|
|
|
|
}
|
2023-05-04 20:25:00 +00:00
|
|
|
protocols: [string]
|
|
|
|
rate_limited: boolean
|
2023-07-13 05:11:24 +00:00
|
|
|
ooye: {
|
|
|
|
namespace_prefix: string
|
2023-07-13 05:36:20 +00:00
|
|
|
max_file_size: number
|
2023-08-23 00:45:19 +00:00
|
|
|
server_name: string
|
2023-09-12 08:43:56 +00:00
|
|
|
server_origin: string
|
2024-01-20 04:03:03 +00:00
|
|
|
content_length_workaround: boolean
|
2024-07-21 02:56:58 +00:00
|
|
|
include_user_id_in_mxid: boolean
|
2023-09-12 11:08:33 +00:00
|
|
|
invite: string[]
|
2023-07-13 05:11:24 +00:00
|
|
|
}
|
2023-09-03 13:38:30 +00:00
|
|
|
old_bridge?: {
|
|
|
|
as_token: string
|
|
|
|
database: string
|
|
|
|
}
|
2023-05-04 20:25:00 +00:00
|
|
|
}
|
|
|
|
|
2024-09-05 03:36:43 +00:00
|
|
|
export type InitialAppServiceRegistrationConfig = {
|
|
|
|
id: string
|
|
|
|
as_token: string
|
|
|
|
hs_token: string
|
|
|
|
sender_localpart: string
|
|
|
|
namespaces: {
|
|
|
|
users: {
|
|
|
|
exclusive: boolean
|
|
|
|
regex: string
|
|
|
|
}[]
|
|
|
|
aliases: {
|
|
|
|
exclusive: boolean
|
|
|
|
regex: string
|
|
|
|
}[]
|
|
|
|
}
|
|
|
|
protocols: [string]
|
|
|
|
rate_limited: boolean
|
|
|
|
ooye: {
|
|
|
|
namespace_prefix: string
|
|
|
|
max_file_size: number,
|
|
|
|
content_length_workaround: boolean,
|
|
|
|
invite: string[],
|
|
|
|
include_user_id_in_mxid: boolean
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-30 03:15:34 +00:00
|
|
|
export type WebhookCreds = {
|
|
|
|
id: string
|
|
|
|
token: string
|
|
|
|
}
|
|
|
|
|
2024-01-22 09:30:31 +00:00
|
|
|
export type PkSystem = {
|
|
|
|
id: string
|
|
|
|
uuid: string
|
|
|
|
name: string | null
|
|
|
|
description: string | null
|
|
|
|
tag: string | null
|
|
|
|
pronouns: string | null
|
|
|
|
avatar_url: string | null
|
|
|
|
banner: string | null
|
|
|
|
color: string | null
|
|
|
|
created: string | null
|
|
|
|
}
|
|
|
|
|
2024-01-20 11:54:18 +00:00
|
|
|
export type PkMember = {
|
|
|
|
id: string
|
|
|
|
uuid: string
|
|
|
|
name: string
|
|
|
|
display_name: string | null
|
|
|
|
color: string | null
|
|
|
|
birthday: string | null
|
|
|
|
pronouns: string | null
|
|
|
|
avatar_url: string | null
|
|
|
|
webhook_avatar_url: string | null
|
|
|
|
banner: string | null
|
|
|
|
description: string | null
|
|
|
|
created: string | null
|
|
|
|
keep_proxy: boolean
|
|
|
|
tts: boolean
|
|
|
|
autoproxy_enabled: boolean | null
|
|
|
|
message_count: number | null
|
|
|
|
last_message_timestamp: string
|
|
|
|
}
|
|
|
|
|
2024-01-22 09:30:31 +00:00
|
|
|
export type PkMessage = {
|
|
|
|
system: PkSystem
|
|
|
|
member: PkMember
|
2024-01-31 00:09:39 +00:00
|
|
|
sender: string
|
2024-01-22 09:30:31 +00:00
|
|
|
}
|
|
|
|
|
2023-08-23 00:45:19 +00:00
|
|
|
export namespace Event {
|
2023-07-02 13:06:05 +00:00
|
|
|
export type Outer<T> = {
|
|
|
|
type: string
|
|
|
|
room_id: string
|
|
|
|
sender: string
|
|
|
|
content: T
|
|
|
|
origin_server_ts: number
|
|
|
|
unsigned: any
|
|
|
|
event_id: string
|
|
|
|
}
|
|
|
|
|
2023-08-23 00:39:37 +00:00
|
|
|
export type StateOuter<T> = Outer<T> & {
|
|
|
|
state_key: string
|
|
|
|
}
|
|
|
|
|
2023-08-16 05:03:05 +00:00
|
|
|
export type ReplacementContent<T> = T & {
|
|
|
|
"m.new_content": T
|
|
|
|
"m.relates_to": {
|
|
|
|
rel_type: string // "m.replace"
|
|
|
|
event_id: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-05 13:25:15 +00:00
|
|
|
export type BaseStateEvent = {
|
|
|
|
type: string
|
|
|
|
room_id: string
|
|
|
|
sender: string
|
|
|
|
content: any
|
|
|
|
state_key: string
|
|
|
|
origin_server_ts: number
|
|
|
|
unsigned: any
|
|
|
|
event_id: string
|
|
|
|
user_id: string
|
|
|
|
age: number
|
|
|
|
replaces_state: string
|
|
|
|
prev_content?: any
|
|
|
|
}
|
|
|
|
|
|
|
|
export type M_Room_Message = {
|
2023-08-25 13:43:17 +00:00
|
|
|
msgtype: "m.text" | "m.emote"
|
2023-05-05 13:25:15 +00:00
|
|
|
body: string
|
2023-08-25 11:27:44 +00:00
|
|
|
format?: "org.matrix.custom.html"
|
2023-08-26 06:58:41 +00:00
|
|
|
formatted_body?: string,
|
|
|
|
"m.relates_to"?: {
|
|
|
|
"m.in_reply_to": {
|
|
|
|
event_id: string
|
|
|
|
}
|
2023-08-27 13:30:07 +00:00
|
|
|
rel_type?: "m.replace"
|
|
|
|
event_id?: string
|
2023-08-26 06:58:41 +00:00
|
|
|
}
|
2023-05-05 13:25:15 +00:00
|
|
|
}
|
2023-05-04 20:25:00 +00:00
|
|
|
|
2023-09-03 03:40:25 +00:00
|
|
|
export type Outer_M_Room_Message = Outer<M_Room_Message> & {type: "m.room.message"}
|
2023-09-02 11:28:41 +00:00
|
|
|
|
|
|
|
export type M_Room_Message_File = {
|
|
|
|
msgtype: "m.file" | "m.image" | "m.video" | "m.audio"
|
|
|
|
body: string
|
2024-01-06 06:42:13 +00:00
|
|
|
filename?: string
|
2023-09-02 11:28:41 +00:00
|
|
|
url: string
|
|
|
|
info?: any
|
|
|
|
"m.relates_to"?: {
|
|
|
|
"m.in_reply_to": {
|
|
|
|
event_id: string
|
|
|
|
}
|
|
|
|
rel_type?: "m.replace"
|
|
|
|
event_id?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-03 03:40:25 +00:00
|
|
|
export type Outer_M_Room_Message_File = Outer<M_Room_Message_File> & {type: "m.room.message"}
|
|
|
|
|
|
|
|
export type M_Room_Message_Encrypted_File = {
|
|
|
|
msgtype: "m.file" | "m.image" | "m.video" | "m.audio"
|
|
|
|
body: string
|
2024-01-06 06:42:13 +00:00
|
|
|
filename?: string
|
2023-09-03 03:40:25 +00:00
|
|
|
file: {
|
|
|
|
url: string
|
|
|
|
iv: string
|
|
|
|
hashes: {
|
|
|
|
sha256: string
|
|
|
|
}
|
|
|
|
v: "v2"
|
|
|
|
key: {
|
|
|
|
/** :3 */
|
|
|
|
kty: "oct"
|
|
|
|
/** must include at least "encrypt" and "decrypt" */
|
|
|
|
key_ops: string[]
|
|
|
|
alg: "A256CTR"
|
|
|
|
k: string
|
|
|
|
ext: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
info?: any
|
|
|
|
"m.relates_to"?: {
|
|
|
|
"m.in_reply_to": {
|
|
|
|
event_id: string
|
|
|
|
}
|
|
|
|
rel_type?: "m.replace"
|
|
|
|
event_id?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Outer_M_Room_Message_Encrypted_File = Outer<M_Room_Message_Encrypted_File> & {type: "m.room.message"}
|
2023-09-02 11:28:41 +00:00
|
|
|
|
|
|
|
export type M_Sticker = {
|
|
|
|
body: string
|
|
|
|
url: string
|
2023-09-30 03:21:07 +00:00
|
|
|
info?: {
|
|
|
|
mimetype?: string
|
2023-09-02 11:28:41 +00:00
|
|
|
w?: number
|
|
|
|
h?: number
|
|
|
|
size?: number
|
|
|
|
thumbnail_info?: any
|
|
|
|
thumbnail_url?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-03 03:40:25 +00:00
|
|
|
export type Outer_M_Sticker = Outer<M_Sticker> & {type: "m.sticker"}
|
2023-09-02 11:28:41 +00:00
|
|
|
|
2023-05-05 13:25:15 +00:00
|
|
|
export type M_Room_Member = {
|
|
|
|
membership: string
|
2023-08-26 10:50:54 +00:00
|
|
|
displayname?: string
|
2023-05-05 13:25:15 +00:00
|
|
|
avatar_url?: string
|
|
|
|
}
|
2023-07-04 05:19:17 +00:00
|
|
|
|
2023-08-23 00:39:37 +00:00
|
|
|
export type M_Room_Avatar = {
|
|
|
|
discord_path?: string
|
|
|
|
url?: string
|
|
|
|
}
|
|
|
|
|
2023-08-26 06:58:41 +00:00
|
|
|
export type M_Room_Name = {
|
|
|
|
name?: string
|
|
|
|
}
|
|
|
|
|
2024-08-25 13:34:46 +00:00
|
|
|
export type M_Power_Levels = {
|
|
|
|
/** The level required to ban a user. Defaults to 50 if unspecified. */
|
|
|
|
ban?: number,
|
|
|
|
/** The level required to send specific event types. This is a mapping from event type to power level required. */
|
|
|
|
events?: {
|
|
|
|
[event_id: string]: number
|
|
|
|
},
|
|
|
|
/** The default level required to send message events. Can be overridden by the `events` key. Defaults to 0 if unspecified. */
|
|
|
|
events_default?: number,
|
|
|
|
/** The level required to invite a user. Defaults to 0 if unspecified. */
|
|
|
|
invite?: number,
|
|
|
|
/** The level required to kick a user. Defaults to 50 if unspecified. */
|
|
|
|
kick?: number,
|
|
|
|
/** The power level requirements for specific notification types. This is a mapping from `key` to power level for that notifications key. */
|
|
|
|
notifications?: {
|
|
|
|
room: number,
|
|
|
|
[key: string]: number
|
|
|
|
},
|
|
|
|
/** The level required to redact an event sent by another user. Defaults to 50 if unspecified. */
|
|
|
|
redact?: number,
|
|
|
|
/** The default level required to send state events. Can be overridden by the `events` key. Defaults to 50 if unspecified. */
|
|
|
|
state_default?: number,
|
|
|
|
/** The power levels for specific users. This is a mapping from `user_id` to power level for that user. */
|
|
|
|
users?: {
|
|
|
|
[mxid: string]: number
|
|
|
|
},
|
|
|
|
/**The power level for users in the room whose `user_id` is not mentioned in the `users` key. Defaults to 0 if unspecified. */
|
|
|
|
users_default?: number
|
|
|
|
}
|
|
|
|
|
2023-07-04 05:19:17 +00:00
|
|
|
export type M_Reaction = {
|
|
|
|
"m.relates_to": {
|
|
|
|
rel_type: "m.annotation"
|
|
|
|
event_id: string // the event that was reacted to
|
|
|
|
key: string // the unicode emoji, mxc uri, or reaction text
|
2023-09-25 07:18:57 +00:00
|
|
|
},
|
|
|
|
"shortcode"?: string // starts and ends with colons
|
2023-07-04 05:19:17 +00:00
|
|
|
}
|
2023-09-25 03:26:48 +00:00
|
|
|
|
|
|
|
export type Outer_M_Room_Redaction = Outer<{
|
|
|
|
reason?: string
|
|
|
|
}> & {
|
|
|
|
redacts: string
|
|
|
|
}
|
2023-05-04 20:25:00 +00:00
|
|
|
}
|
|
|
|
|
2023-08-23 00:45:19 +00:00
|
|
|
export namespace R {
|
2023-05-05 13:25:15 +00:00
|
|
|
export type RoomCreated = {
|
|
|
|
room_id: string
|
|
|
|
}
|
|
|
|
|
2023-05-08 12:58:46 +00:00
|
|
|
export type RoomJoined = {
|
|
|
|
room_id: string
|
|
|
|
}
|
|
|
|
|
2023-07-11 04:51:30 +00:00
|
|
|
export type RoomMember = {
|
|
|
|
avatar_url: string
|
2023-09-03 13:43:12 +00:00
|
|
|
displayname: string
|
2023-07-11 04:51:30 +00:00
|
|
|
}
|
|
|
|
|
2023-05-05 13:25:15 +00:00
|
|
|
export type FileUploaded = {
|
|
|
|
content_uri: string
|
|
|
|
}
|
2023-05-07 20:27:42 +00:00
|
|
|
|
|
|
|
export type Registered = {
|
|
|
|
/** "@localpart:domain.tld" */
|
|
|
|
user_id: string
|
|
|
|
home_server: string
|
|
|
|
access_token: string
|
|
|
|
device_id: string
|
|
|
|
}
|
2023-05-08 11:37:51 +00:00
|
|
|
|
|
|
|
export type EventSent = {
|
|
|
|
event_id: string
|
|
|
|
}
|
2023-08-17 04:41:28 +00:00
|
|
|
|
|
|
|
export type EventRedacted = {
|
|
|
|
event_id: string
|
|
|
|
}
|
2024-03-25 12:10:29 +00:00
|
|
|
|
|
|
|
export type Hierarchy = {
|
|
|
|
avatar_url?: string
|
|
|
|
canonical_alias?: string
|
|
|
|
children_state: {}
|
|
|
|
guest_can_join: boolean
|
|
|
|
join_rule?: string
|
|
|
|
name?: string
|
|
|
|
num_joined_members: number
|
|
|
|
room_id: string
|
|
|
|
room_type?: string
|
|
|
|
}
|
2023-05-04 20:25:00 +00:00
|
|
|
}
|
2023-09-25 04:36:27 +00:00
|
|
|
|
2023-09-30 03:21:07 +00:00
|
|
|
export type Pagination<T> = {
|
2023-09-25 04:36:27 +00:00
|
|
|
chunk: T[]
|
|
|
|
next_batch?: string
|
|
|
|
prev_match?: string
|
|
|
|
}
|
2024-03-25 12:10:29 +00:00
|
|
|
|
|
|
|
export type HierarchyPagination<T> = {
|
|
|
|
rooms: T[]
|
|
|
|
next_batch?: string
|
|
|
|
}
|