🌳
pt0/gamesapp/serverF/gamesDbF.d.ts
1/**
2 * Kysely type definitions for gamesapp database.
3 * Based on migrations in pt0/gamesapp/bin/migrationsF/
4 */
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 {
17 playerAction: string;
18 sessId?: string;
19 actionAtMs?: number;
20 pregenFncRet?: unknown;
21 [key: string]: unknown;
24export interface GameStateJson {
25 gameActionHistA?: GameActionH[];
26 [key: string]: unknown;
29export interface Dbgames {
30 id: Generated<string>;
31 game_id: 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>;
42 name: string | null;
43 batch: number | null;
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;
60 email: string | null;
61 data: JsonObject;
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>;
74 room_label: string;
75 owner_userid: string | null;
76 is_gameactive: Generated<boolean>;
77 jdata: RoomJdata;
78 created_at: Timestamp | null;
79 updated_at: Timestamp | null;
82export interface GamesDB {
83 dbgames: Dbgames;
84 gamerooms: Gamerooms;
85 users: Users;
86 knex_migrations: KnexMigrations;
87 knex_migrations_lock: KnexMigrationsLock;
90export interface GqlContext {
91 sessId: string;
92 gqUserTok: string;
93 ip_address?: string;