fix maxviews add extension, added some settings, add multi method route support, register timezone, start of upload route, change Unauthorized to 401, change date types to string

This commit is contained in:
creations 2025-03-08 13:30:58 -05:00
parent 94ba46cc2d
commit 458fbc80f5
Signed by: creations
GPG key ID: 8F553AA4320FC711
14 changed files with 345 additions and 40 deletions

1
types/bun.d.ts vendored
View file

@ -11,5 +11,6 @@ declare global {
query: Query;
params: Params;
session: UserSession | ApiUserSession | null;
actualContentType: string | null;
}
}

1
types/char.d.ts vendored
View file

@ -9,3 +9,4 @@ type DurationObject = {
};
type UUID = `${string}-${string}-${string}-${string}-${string}`;
type PartialExcept<T, K extends keyof T> = Partial<T> & Pick<T, K>;

17
types/file.d.ts vendored
View file

@ -1,4 +1,4 @@
type File = {
type FileEntry = {
id: UUID;
owner: UUID;
folder?: UUID | null;
@ -6,20 +6,23 @@ type File = {
name: string;
original_name?: string | null;
mime_type: string;
extension?: string | null;
size: number;
views: number;
max_views: number;
max_views: number | null;
password?: string | null;
favorite: boolean;
tags: string[];
thumbnail: boolean;
created_at: Date;
updated_at: Date;
expires_at?: Date | null;
created_at: string;
updated_at: string;
expires_at?: string | null;
};
type FileUpload = Partial<FileEntry>;
type Folder = {
id: UUID;
owner: UUID;
@ -28,6 +31,6 @@ type Folder = {
public: boolean;
allow_uploads: boolean;
created_at: Date;
updated_at: Date;
created_at: string;
updated_at: string;
};

4
types/routes.d.ts vendored
View file

@ -1,6 +1,6 @@
type RouteDef = {
method: string;
accepts: string | null;
method: string | string[];
accepts: string | null | string[];
returns: string;
needsBody?: "multipart" | "json";
};