Add script to estimate total channel file size
This commit is contained in:
@@ -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
8
src/types.d.ts
vendored
@@ -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> = {
|
||||
|
||||
Reference in New Issue
Block a user