2 * Kysely type definitions for gamesapp database. 3 * Based on migrations in pt0/gamesapp/bin/migrationsF/ 6import type { ColumnType, Generated } from "kysely"; 8export type Json = JsonValue; 9export type JsonArray = JsonValue[]; 10export type JsonObject = { [x: string]: JsonValue | undefined }; 11export type JsonPrimitive = boolean | number | string | null; 12export type JsonValue = JsonArray | JsonObject | JsonPrimitive; 14export type Timestamp = ColumnType<Date, Date | string, Date | string>; 16export interface GameActionH { 20 pregenFncRet?: unknown; 21 [key: string]: unknown; 24export interface GameStateJson { 25 gameActionHistA?: GameActionH[]; 26 [key: string]: unknown; 29export interface Dbgames { 30 id: Generated<string>; 32 game_state: GameStateJson; 33 created_at: Timestamp | null; 34 updated_at: Timestamp | null; 35 room_id: string | null; 36 is_finished: Generated<boolean>; 37 active_player_count: Generated<number>; 40export interface KnexMigrations { 41 id: Generated<number>; 44 migration_time: Timestamp | null; 47export interface KnexMigrationsLock { 48 index: Generated<number>; 49 is_locked: number | null; 52export interface FaucetIps { 53 [ip: string]: number; // timestamp when used 56export interface Users { 57 id: Generated<string>; 58 secret_token: string | null; 59 username: string | null; 62 faucet_ips: FaucetIps; 63 created_at: Timestamp | null; 64 updated_at: Timestamp | null; 67export interface RoomJdata { 68 isPublicRoom?: boolean; 69 blockedIps?: string[]; 72export interface Gamerooms { 73 id: Generated<string>; 75 owner_userid: string | null; 76 is_gameactive: Generated<boolean>; 78 created_at: Timestamp | null; 79 updated_at: Timestamp | null; 82export interface GamesDB { 86 knex_migrations: KnexMigrations; 87 knex_migrations_lock: KnexMigrationsLock; 90export interface GqlContext {