mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-05 22:54:25 +01:00
Add public timeline, fix limit param
This commit is contained in:
@@ -78,9 +78,12 @@ async function parseBody(req: Request): Promise<unknown> {
|
||||
|
||||
const paginationSchema = z.object({
|
||||
since: z.coerce.number().optional().catch(undefined),
|
||||
until: z.coerce.number().optional().catch(undefined),
|
||||
until: z.coerce.number().catch(nostrNow()),
|
||||
limit: z.coerce.number().min(0).max(40).catch(20),
|
||||
});
|
||||
|
||||
type PaginationParams = z.infer<typeof paginationSchema>;
|
||||
|
||||
function buildLinkHeader(url: string, events: Event[]): string | undefined {
|
||||
if (!events.length) return;
|
||||
const firstEvent = events[0];
|
||||
@@ -103,6 +106,7 @@ export {
|
||||
lookupAccount,
|
||||
type Nip05,
|
||||
nostrNow,
|
||||
type PaginationParams,
|
||||
paginationSchema,
|
||||
parseBody,
|
||||
parseNip05,
|
||||
|
||||
Reference in New Issue
Block a user