Add script to estimate total channel file size

This commit is contained in:
Cadence Ember
2026-02-27 18:35:48 +13:00
parent 780154fd09
commit e275d4c928
3 changed files with 73 additions and 2 deletions

View File

@@ -136,7 +136,7 @@ async function getEventForTimestamp(roomID, ts) {
*/
async function getEvents(roomID, dir, pagination = {}, filter) {
filter = filter && JSON.stringify(filter)
/** @type {Ty.Pagination<Ty.Event.Outer<any>>} */
/** @type {Ty.MessagesPagination<Ty.Event.Outer<any>>} */
const root = await mreq.mreq("GET", path(`/client/v3/rooms/${roomID}/messages`, null, {...pagination, dir, filter}))
return root
}

8
src/types.d.ts vendored
View File

@@ -498,7 +498,13 @@ export type Membership = "invite" | "knock" | "join" | "leave" | "ban"
export type Pagination<T> = {
chunk: T[]
next_batch?: string
prev_match?: string
prev_batch?: string
}
export type MessagesPagination<T> = {
chunk: T[]
start: string
end?: string
}
export type HierarchyPagination<T> = {