mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(share): record and display share activity (#549)
* feat(share): record and display share activity * style(share): remove activity entry borders * docs(share): explain share link activity
This commit is contained in:
@@ -16,6 +16,8 @@ export interface ShareLinkInfo {
|
||||
rootFolderId: string
|
||||
projectId: string
|
||||
isExpired: boolean
|
||||
views: number
|
||||
lastViewedAt: string | null
|
||||
watermarkConfigId?: string | null
|
||||
watermarkStatus?: 'disabled' | 'processing' | 'ready' | 'failed'
|
||||
watermarkConfig?: {
|
||||
@@ -28,6 +30,22 @@ export interface ShareLinkInfo {
|
||||
creator?: { id: string; name: string; image?: string | null } | null
|
||||
}
|
||||
|
||||
export type ShareActivityKind =
|
||||
'share_viewed' | 'asset_viewed' | 'asset_downloaded' | 'comment_created'
|
||||
|
||||
export interface ShareActivityInfo {
|
||||
id: string
|
||||
kind: ShareActivityKind
|
||||
createdAt: string
|
||||
user: { name: string; image?: string } | null
|
||||
asset: { id: string; name: string | null } | null
|
||||
}
|
||||
|
||||
export const recordShareViewRequestSchema = z.object({
|
||||
assetId: z.string().min(1).optional(),
|
||||
isShareEntry: z.boolean().optional(),
|
||||
})
|
||||
|
||||
export const createShareLinkRequestSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
expireAt: z.string().datetime().optional(),
|
||||
|
||||
Reference in New Issue
Block a user