generated from bastian/boilerplate
Initial commit
This commit is contained in:
154
packages/api-client/src/models.ts
Normal file
154
packages/api-client/src/models.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
// Generated from the backend OpenAPI contract. Do not edit manually.
|
||||
export type Permission =
|
||||
| 'items.read'
|
||||
| 'items.create'
|
||||
| 'items.update'
|
||||
| 'items.delete'
|
||||
| 'users.read'
|
||||
| 'users.manage'
|
||||
| 'roles.read'
|
||||
| 'roles.manage'
|
||||
| 'audit.read'
|
||||
| 'sessions.readOwn'
|
||||
| 'sessions.revokeOwn'
|
||||
| 'sessions.manage'
|
||||
| 'notifications.readOwn'
|
||||
| 'notifications.updateOwn'
|
||||
| 'notifications.manage';
|
||||
|
||||
export interface ApiErrorBody {
|
||||
status: number;
|
||||
code: string;
|
||||
message: string;
|
||||
requestId: string;
|
||||
validation?: { field: string; messages: string[] }[];
|
||||
}
|
||||
|
||||
export interface PageDto<T> {
|
||||
items: T[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export interface UserDto {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string | null;
|
||||
active: boolean;
|
||||
lastLoginAt: string | null;
|
||||
roles: RoleDto[];
|
||||
settings: { tablePageSize: number; sidebarExpanded: boolean };
|
||||
}
|
||||
|
||||
export interface AdminRoleSummaryDto {
|
||||
id: string;
|
||||
name: string;
|
||||
system: boolean;
|
||||
}
|
||||
|
||||
export interface AdminSessionDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
lastActivityAt: string;
|
||||
userAgent: string | null;
|
||||
approximateIp: string | null;
|
||||
current: boolean;
|
||||
expiresAt: string;
|
||||
revokedAt: string | null;
|
||||
}
|
||||
|
||||
export interface AdminUserListItemDto {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string | null;
|
||||
active: boolean;
|
||||
roles: AdminRoleSummaryDto[];
|
||||
lastLoginAt: string | null;
|
||||
createdAt: string;
|
||||
activeSessionCount: number;
|
||||
}
|
||||
|
||||
export interface AdminUserDetailDto extends AdminUserListItemDto {
|
||||
effectivePermissions: Permission[];
|
||||
sessions: AdminSessionDto[];
|
||||
}
|
||||
|
||||
export interface RoleDto {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
system: boolean;
|
||||
protected: boolean;
|
||||
permissions: { id: Permission; description: string }[];
|
||||
userCount?: number;
|
||||
users?: UserDto[];
|
||||
}
|
||||
|
||||
export interface ItemDto {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
status: 'draft' | 'active' | 'archived';
|
||||
version: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
deletedAt: string | null;
|
||||
}
|
||||
|
||||
export interface SaveItemDto {
|
||||
name: string;
|
||||
description?: string;
|
||||
status: ItemDto['status'];
|
||||
version?: number;
|
||||
}
|
||||
|
||||
export interface SessionDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
lastActivityAt: string;
|
||||
userAgent: string | null;
|
||||
approximateIp: string | null;
|
||||
current: boolean;
|
||||
revokedAt: string | null;
|
||||
}
|
||||
|
||||
export interface AuditLogDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
actorUserId: string | null;
|
||||
action: string;
|
||||
targetType: string;
|
||||
targetId: string;
|
||||
metadata: Record<string, string | number | boolean | null> | null;
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export type NotificationType = 'system' | 'item.created' | 'item.updated' | 'user.role-changed';
|
||||
|
||||
export type NotificationStatusFilter = 'all' | 'read' | 'unread';
|
||||
|
||||
export interface NotificationDto {
|
||||
id: string;
|
||||
type: NotificationType;
|
||||
title: string;
|
||||
message: string;
|
||||
link: string | null;
|
||||
metadata: Record<string, string | number | boolean | null> | null;
|
||||
read: boolean;
|
||||
readAt: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface NotificationPageDto extends PageDto<NotificationDto> {
|
||||
unreadCount: number;
|
||||
}
|
||||
|
||||
export interface CreateNotificationDto {
|
||||
userId: string;
|
||||
type: NotificationType;
|
||||
title: string;
|
||||
message: string;
|
||||
link?: string;
|
||||
metadata?: Record<string, string | number | boolean | null>;
|
||||
}
|
||||
Reference in New Issue
Block a user