153 lines
2.8 KiB
TypeScript
153 lines
2.8 KiB
TypeScript
export type AdminUserStatus = "active" | "disabled" | "invited"
|
|
|
|
export type AdminUserRole = "admin" | "user" | "guest" | "suspended"
|
|
|
|
export type AdminUser = {
|
|
id: string
|
|
external_id: string
|
|
email: string
|
|
name: string
|
|
status: AdminUserStatus
|
|
platform_admin: boolean
|
|
role: AdminUserRole
|
|
storage?: AdminUserStorage
|
|
invited_at?: string | null
|
|
disabled_at?: string | null
|
|
created_at: string
|
|
updated_at: string
|
|
}
|
|
|
|
export type AdminServiceQuota = {
|
|
count?: number
|
|
used_storage_bytes: number
|
|
max_storage_bytes: number
|
|
}
|
|
|
|
export type AdminUserQuota = {
|
|
mail: AdminServiceQuota
|
|
drive: AdminServiceQuota
|
|
photos: AdminServiceQuota
|
|
}
|
|
|
|
export type AdminUserDetail = AdminUser & {
|
|
quota?: AdminUserQuota
|
|
}
|
|
|
|
export type AdminPagination = {
|
|
page: number
|
|
page_size: number
|
|
total: number
|
|
}
|
|
|
|
export type AdminUsersListResponse = {
|
|
users: AdminUser[]
|
|
pagination: AdminPagination
|
|
}
|
|
|
|
export type AdminAuditLog = {
|
|
id: string
|
|
actor: string
|
|
action: string
|
|
details: unknown
|
|
created_at: string
|
|
}
|
|
|
|
export type AdminAuditListResponse = {
|
|
logs: AdminAuditLog[]
|
|
pagination: AdminPagination
|
|
}
|
|
|
|
export type AdminStatsTopActor = {
|
|
actor: string
|
|
count: number
|
|
}
|
|
|
|
export type AdminStorageServiceStats = {
|
|
used_bytes: number
|
|
allocated_bytes: number
|
|
tracked?: boolean
|
|
}
|
|
|
|
export type AdminStatsResponse = {
|
|
users: {
|
|
total: number
|
|
active: number
|
|
disabled: number
|
|
invited: number
|
|
}
|
|
services: {
|
|
mail_accounts_total: number
|
|
messages_total: number
|
|
audit_events_24h: number
|
|
}
|
|
quotas: {
|
|
users_near_mail_quota_90pct: number
|
|
}
|
|
storage?: {
|
|
mail: AdminStorageServiceStats
|
|
drive: AdminStorageServiceStats
|
|
photos: AdminStorageServiceStats
|
|
}
|
|
audit: {
|
|
top_actors_7d: AdminStatsTopActor[]
|
|
}
|
|
}
|
|
|
|
export type AdminUserStorage = {
|
|
mail_used_bytes: number
|
|
drive_used_bytes: number
|
|
}
|
|
|
|
export type AdminSetQuotaRequest = {
|
|
mail_max_storage_bytes?: number
|
|
drive_max_storage_bytes?: number
|
|
photos_max_storage_bytes?: number
|
|
}
|
|
|
|
export type AdminCreateUserRequest = {
|
|
external_id: string
|
|
email: string
|
|
name?: string
|
|
}
|
|
|
|
export type AdminInviteUserRequest = {
|
|
email: string
|
|
name?: string
|
|
}
|
|
|
|
export type AdminUpdateUserRequest = {
|
|
email?: string
|
|
name?: string
|
|
}
|
|
|
|
export type AdminSetUserRoleRequest = {
|
|
role: AdminUserRole
|
|
}
|
|
|
|
export type AdminPublicShare = {
|
|
id: string
|
|
token: string
|
|
path: string
|
|
item_type: string
|
|
access_mode: string
|
|
share_type: number
|
|
permissions: number
|
|
url: string
|
|
expires_at?: string
|
|
created_at?: string
|
|
owner_nc_user_id: string
|
|
owner_email: string
|
|
owner_display_name?: string
|
|
share_with?: string
|
|
share_with_display_name?: string
|
|
has_password?: boolean
|
|
label?: string
|
|
last_access_at?: string | null
|
|
access_count: number
|
|
}
|
|
|
|
export type AdminPublicSharesListResponse = {
|
|
shares: AdminPublicShare[]
|
|
pagination: AdminPagination
|
|
}
|