Archived
1
0
This repository has been archived on 2025-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
Files
app/packages/shared-types/index.ts

104 lines
1.8 KiB
TypeScript

export type Visibility = 'public' | 'link';
export interface User {
id: string;
email: string;
name: string;
image: string | null;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
}
export interface Save {
id: number;
name: string;
type: string;
description: string;
tags: string[];
visibility: Visibility;
shareUrl?: string;
userId: string;
url: string;
s3Key: string;
fileSize: number;
mimeType: string;
createdAt: Date;
updatedAt: Date;
}
export interface SaveListItem extends Omit<Save, 'userId' | 's3Key' | 'fileSize' | 'mimeType'> {}
export interface ApiResponse<T> {
success: boolean;
data?: T;
error?: string;
}
export interface PaginatedResponse<T> {
items: T[];
total: number;
page: number;
limit: number;
}
export interface SignUpResponse {
token: string | null;
user: User;
}
export interface SignInResponse {
redirect: boolean;
token: string;
url: null;
user: User;
}
export interface SignOutResponse {
success: boolean;
}
export interface SaveResponse {
id: number;
name: string;
type: string;
url: string;
visibility: Visibility;
shareUrl?: string;
createdAt: string;
}
export interface SaveDetailResponse extends Save {}
export interface SaveUpdateResponse {
id: number;
name: string;
type: string;
description: string;
tags: string[];
visibility: Visibility;
shareUrl?: string;
updatedAt: string;
}
export interface DeleteSaveResponse {
success: boolean;
message: string;
}
export interface CreateSaveFromUrlRequest {
url: string;
name?: string;
description?: string;
tags?: string[];
visibility?: Visibility;
}
export interface UpdateSaveRequest {
name?: string;
description?: string;
tags?: string[];
visibility?: Visibility;
}