Files
O96u 737235acff release: v1.4.0 — 标签系统、操作日志扩展与文档截图更新
- 每用户标签与彩色打标,图库 OR/AND 筛选与批量打标
- 操作日志记录登录、删除、设置与标签操作
- API 标签/打标接口;README 与文档站截图同步
2026-09-09 14:46:52 +08:00

95 lines
1.7 KiB
TypeScript

export type ErrorCode
= | 'UNAUTHORIZED'
| 'FORBIDDEN'
| 'CONFLICT'
| 'INVALID_REQUEST'
| 'TOO_MANY_FILES'
| 'FILE_TOO_LARGE'
| 'UNSUPPORTED_FILE_TYPE'
| 'INVALID_FILE_SIGNATURE'
| 'INVALID_IMAGE_KEY'
| 'IMAGE_NOT_FOUND'
| 'UPLOAD_FAILED'
| 'DELETE_FAILED'
export interface ApiError {
code: ErrorCode
message: string
}
export interface ApiErrorResponse {
success: false
error: ApiError
}
export interface ImageItem {
key: string
url: string
originalName: string
contentType: string
size: number
uploadedAt: string
markdown: string
html: string
/** 管理员列表可见:上传者信息 */
owner?: {
userId: number | null
username: string
}
/** 图片所在存储后端(统计/管理列表) */
storage?: {
id: string
name: string
type: 'local' | 's3'
}
/** 上传来源:网页或 API(来自活动日志) */
uploadSource?: 'web' | 'api'
/** 图片标签 */
tags?: ImageTag[]
}
export interface ImageTag {
id: number
name: string
color: string
imageCount?: number
createdAt?: string
lastUsedAt?: string | null
}
export interface UploadErrorItem {
name: string
error: ApiError
}
export interface UploadResponse {
success: boolean
items: ImageItem[]
errors: UploadErrorItem[]
}
export interface ImageListResponse {
items: ImageItem[]
total: number
page: number
pageSize: number
totalPages: number
}
export interface DeleteResponse {
success: boolean
}
export interface BatchDeleteResponse {
success: boolean
deleted: string[]
failed: Array<{ key: string, error: ApiError }>
}
export interface UploadProgressItem {
name: string
status: 'pending' | 'uploading' | 'success' | 'error'
progress: number
error?: string
}