/
t3
/
web-ui
Обзор
Документация
Войти
/
t3
/
web-ui
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
src/api/types.ts
207 строк
4 KB
Ivan
hide role restore button
24 июл 2026, 16:41
24 июл 2026, 16:41
9108ed9
Код
Авторство
О чём код?
// ===== Gateway DTO ===== export interface LoginRequest { access_key: string; access_secret: string; } export interface LoginResponse { token: string; user: UserInfo; } export interface UserInfo { id: string; display_name: string; } export interface MeResponse { user: UserInfo; } export interface BucketResponse { name: string; owner: string; creation_date: string; } export interface CreateBucketRequest { name: string; } export interface ObjectResponse { key: string; size: number; last_modified: string; etag: string; } export interface PresignResponse { url: string; method: string; } // Gateway error shape export interface GatewayErrorResponse { error: string; message?: string; request_id?: string; } // ===== IAM DTO (from OpenAPI) ===== // Error export interface IAMErrorBody { code: string; message: string; fields?: { field: string; issue: string }[]; request_id?: string; } export interface IAMErrorResponse { error: IAMErrorBody; } // User export interface CreateUserRequest { display_name: string; } export interface UserResponse { id: string; display_name: string; version: number; created_at: string; } export interface CreateUserResponse extends UserResponse { access_key: string; access_secret: string; } export interface UpdateUserRequest { display_name: string; } export interface PermissionItem { effect: "Allow" | "Deny"; action: string; resource: string; } export interface RoleWithPermissions { role: RoleResponse; permissions: PermissionItem[]; } export interface InspectUserResponse extends UserResponse { keys: AccessKeyResponse[]; roles: RoleWithPermissions[]; } export interface UserPermissionsResponse { version: number; permissions: PermissionItem[]; } // Access Keys export interface CreateAccessKeyRequest { expires_at?: string; } export interface CreateAccessKeyResponse { id: string; access_key: string; access_secret: string; status: string; expires_at?: string; created_at: string; } export interface AccessKeyResponse { id: string; access_key: string; status: "Active" | "Inactive"; created_at: string; updated_at: string; expires_at?: string; last_used_at?: string; last_used_ip?: string; } export interface UpdateAccessKeyRequest { status: "Active" | "Inactive"; } export interface RotateAccessKeyRequest { deactivate_key_id?: string; expires_at?: string; } // Roles export interface CreateRoleRequest { name: string; description?: string; } export interface UpdateRoleRequest { name: string; description?: string; } export interface RoleResponse { id: string; name: string; description?: string; version: number; created_at: string; deleted_at?: string; } export interface UserRolesResponse { version: number; roles: RoleResponse[]; } export interface AssignRolesRequest { role_ids: string[]; } export interface SetPermissionsRequest { permissions: PermissionItem[]; } export interface RolePermissionsResponse { version: number; permissions: PermissionItem[]; } // Audit export interface AuditEntryResponse { id: string; timestamp: string; request_id: string; actor_type: string; actor_id: string; actor_ip: string; action: string; resource_type: string; resource_id: string; outcome: string; detail?: string; } export interface ListAuditResponse { entries: AuditEntryResponse[]; } export interface AuditFilters { limit?: number; offset?: number; action?: string; resource_type?: string; resource_id?: string; request_id?: string; from?: string; to?: string; }