Import source: backend/src/types

Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
arsam
2026-09-18 23:13:36 +03:30
parent f3a4d0a80f
commit abc8ef218c
+60
View File
@@ -0,0 +1,60 @@
export type Plan = 'free' | 'pro' | 'team';
export type FileStatus = 'uploaded' | 'deleted' | 'expired';
export interface UserRecord {
id: string;
email: string;
passwordHash: string;
plan: Plan;
verified: boolean;
createdAt: string;
updatedAt: string;
}
export interface FileRecord {
id: string;
linkId: string;
/** Google Drive file ID, used to construct download/view/delete URLs */
gdriveId: string;
/** Session cookie value of the uploader — scopes dashboard/delete access */
sessionId: string;
/** @deprecated legacy rclone path — only present on old records */
gdrivePath?: string;
originalName: string;
mimeType: string;
sizeBytes: number;
status: FileStatus;
uploader: string;
expiresAt: string;
deletedAt?: string;
createdAt: string;
views: number;
downloads: number;
}
export interface RefreshTokenRecord {
id: string;
userId: string;
tokenHash: string;
expiresAt: string;
revokedAt?: string;
createdAt: string;
}
export interface EventRecord {
id: string;
linkId: string;
type: 'view' | 'download';
createdAt: string;
ip?: string;
userAgent?: string;
referrer?: string;
}
export interface DatabaseShape {
users: UserRecord[];
refreshTokens: RefreshTokenRecord[];
files: FileRecord[];
events: EventRecord[];
}