types: restore Supabase row typing, fix parseInput inference (586→76 tsc errors)
The installed supabase-js (2.99, 5 generics) is incompatible with @supabase/[email protected] (calls it with 3), collapsing the server client's schema to `never` — the root cause of ~450 of the 586 hidden type errors (next.config typescript.ignoreBuildErrors masks them all). - lib/supabase/server.ts: annotate the factory as SupabaseClient<Database> and bridge the ssr/js impedance mismatch at the one documented boundary; type the setAll cookie params. - lib/supabase/proxy.ts, proxy.ts: type the setAll cookie params. - lib/auth-helpers.ts: parseInput now infers its result from the schema via z.infer (was a fragile ZodSchema<T> that widened outputs to {}). - lib/validations.ts: annotate flexibleDateTime's output type. - types/database.ts: add class_signup_tx / class_cancel_tx RPC signatures (called but absent; pending full regeneration). - tsconfig.json: target ES2020 (door-log-logic uses BigInt literals). - vitest.setup.ts: import beforeAll/afterAll instead of relying on globals. No runtime behavior change; 639 tests still green. ignoreBuildErrors stays on until the remaining errors reach zero. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9ac0c2486c
commit
1766780bca
@@ -1702,6 +1702,16 @@ export type Database = {
|
||||
Args: { sid: string; perm: string }
|
||||
Returns: { member_id: string }[]
|
||||
}
|
||||
// Hand-added to match scripts/045_class_signup_concurrency.sql until this
|
||||
// file is regenerated from the live schema (`supabase gen types typescript`).
|
||||
class_signup_tx: {
|
||||
Args: { p_session_id: string; p_space_id: string; p_member_id: string }
|
||||
Returns: { signup_id: string | null; signup_status: string | null; err: string | null }[]
|
||||
}
|
||||
class_cancel_tx: {
|
||||
Args: { p_session_id: string; p_space_id: string; p_member_id: string }
|
||||
Returns: { cancelled_id: string | null; promoted_id: string | null; err: string | null }[]
|
||||
}
|
||||
}
|
||||
Enums: {
|
||||
area_lead_status: "active" | "vacant" | "handoff"
|
||||
|
||||
Reference in New Issue
Block a user