120 lines
3.5 KiB
TypeScript
120 lines
3.5 KiB
TypeScript
import type { ColumnType, Generated } from 'kysely'
|
|
|
|
export interface UsersTable {
|
|
id: Generated<string>
|
|
created: ColumnType<Date, string | undefined, string>
|
|
updated: ColumnType<Date, string | undefined, string>
|
|
email: string
|
|
display_name: string
|
|
avatar: Generated<string>
|
|
password: ColumnType<string | null, string | null | undefined, string | null>
|
|
verified: Generated<boolean>
|
|
roles: Generated<string[]>
|
|
token_key: Generated<string>
|
|
token_expires_at: ColumnType<Date | null, Date | string | null | undefined, Date | string | null>
|
|
pending_email: string | null
|
|
email_change_token: string | null
|
|
}
|
|
|
|
export interface SiteSettingsTable {
|
|
key: string
|
|
value: ColumnType<unknown, unknown, unknown>
|
|
updated: ColumnType<Date, string | undefined, string>
|
|
}
|
|
|
|
export interface PasswordResetRequestsTable {
|
|
id: Generated<string>
|
|
created: ColumnType<Date, Date | string | undefined, Date | string>
|
|
expires: ColumnType<Date, Date | string, Date | string>
|
|
user_id: string
|
|
token: string
|
|
used: Generated<boolean>
|
|
}
|
|
|
|
export interface ActivityLogsTable {
|
|
id: Generated<string>
|
|
timestamp: ColumnType<Date, Date | string | undefined, Date | string>
|
|
event_type: string
|
|
table_name: string | null
|
|
record_id: string | null
|
|
user_id: string | null
|
|
user_agent: string | null
|
|
metadata: Generated<Record<string, any>>
|
|
}
|
|
|
|
export type PageTheme = 'default' | 'green'
|
|
|
|
export interface PagesTable {
|
|
id: Generated<string>
|
|
slug: string
|
|
category_id: string | null
|
|
menu_order: Generated<number>
|
|
custom_css: string | null
|
|
theme: Generated<PageTheme>
|
|
created: ColumnType<Date, Date | string | undefined, Date | string>
|
|
updated: ColumnType<Date, Date | string | undefined, Date | string>
|
|
}
|
|
|
|
export interface CategoriesTable {
|
|
id: Generated<string>
|
|
slug: string
|
|
parent_id: string | null
|
|
menu_order: Generated<number>
|
|
created: ColumnType<Date, Date | string | undefined, Date | string>
|
|
updated: ColumnType<Date, Date | string | undefined, Date | string>
|
|
}
|
|
|
|
export interface CategoryTranslationsTable {
|
|
id: Generated<string>
|
|
category_id: string
|
|
locale: string
|
|
name: string
|
|
updated: ColumnType<Date, Date | string | undefined, Date | string>
|
|
}
|
|
|
|
export interface PageTranslationsTable {
|
|
id: Generated<string>
|
|
page_id: string
|
|
locale: string
|
|
title: string
|
|
body_json: Generated<Record<string, any>>
|
|
excerpt: string | null
|
|
featured_image: string | null
|
|
meta_title: string | null
|
|
meta_description: string | null
|
|
og_image: string | null
|
|
status: Generated<'draft' | 'published'>
|
|
updated: ColumnType<Date, Date | string | undefined, Date | string>
|
|
}
|
|
|
|
export type PageTranslationVersionSource = 'admin-ui' | 'mcp' | 'deepl'
|
|
|
|
export interface PageTranslationVersionsTable {
|
|
id: Generated<string>
|
|
page_id: string
|
|
locale: string
|
|
title: string
|
|
body_json: Generated<Record<string, any>>
|
|
excerpt: string | null
|
|
featured_image: string | null
|
|
meta_title: string | null
|
|
meta_description: string | null
|
|
og_image: string | null
|
|
status: 'draft' | 'published'
|
|
created_by_user_id: string | null
|
|
source: Generated<PageTranslationVersionSource>
|
|
user_agent: string | null
|
|
created: ColumnType<Date, Date | string | undefined, Date | string>
|
|
}
|
|
|
|
export interface Database {
|
|
users: UsersTable
|
|
site_settings: SiteSettingsTable
|
|
password_reset_requests: PasswordResetRequestsTable
|
|
activity_logs: ActivityLogsTable
|
|
pages: PagesTable
|
|
page_translations: PageTranslationsTable
|
|
page_translation_versions: PageTranslationVersionsTable
|
|
categories: CategoriesTable
|
|
category_translations: CategoryTranslationsTable
|
|
}
|