From af17153a41e8f25c2dfd7913b84e03c1f756c738 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 23 Feb 2026 19:42:44 -0800 Subject: [PATCH] fix: resolve all TypeScript build errors across modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change sql.unsafe() param arrays from unknown[] to any[] (9 modules) - Exclude sw.ts and demo-sync.ts from tsconfig (separate build targets) - Add type stub for @mkkellogg/gaussian-splats-3d (CDN-loaded) - Rename private title → designTitle in folk-swag-designer (HTMLElement conflict) - Fix Hono context typing and instanceof cast in splat module Co-Authored-By: Claude Opus 4.6 --- modules/cal/mod.ts | 8 ++++---- modules/cart/mod.ts | 6 +++--- modules/forum/lib/provisioner.ts | 2 +- modules/inbox/mod.ts | 4 ++-- modules/notes/mod.ts | 6 +++--- modules/providers/mod.ts | 6 +++--- modules/splat/mod.ts | 12 ++++++------ modules/swag/components/folk-swag-designer.ts | 8 ++++---- modules/trips/mod.ts | 2 +- modules/vote/mod.ts | 2 +- modules/work/mod.ts | 2 +- tsconfig.json | 4 ++-- types/gaussian-splats-3d.d.ts | 9 +++++++++ 13 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 types/gaussian-splats-3d.d.ts diff --git a/modules/cal/mod.ts b/modules/cal/mod.ts index 888d6c3..73e8d23 100644 --- a/modules/cal/mod.ts +++ b/modules/cal/mod.ts @@ -138,7 +138,7 @@ routes.get("/api/events", async (c) => { const { start, end, source, search, rTool, rEntityId, upcoming } = c.req.query(); let where = "WHERE 1=1"; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; if (start) { where += ` AND e.start_time >= $${idx}`; params.push(start); idx++; } @@ -211,7 +211,7 @@ routes.patch("/api/events/:id", async (c) => { const body = await c.req.json(); const fields: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; const allowed = ["title", "description", "start_time", "end_time", "all_day", "timezone", "status", "visibility", "location_name", "is_virtual", "virtual_url"]; @@ -248,7 +248,7 @@ routes.delete("/api/events/:id", async (c) => { routes.get("/api/sources", async (c) => { const { is_active, is_visible, source_type } = c.req.query(); let where = "WHERE 1=1"; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; if (is_active !== undefined) { where += ` AND is_active = $${idx}`; params.push(is_active === "true"); idx++; } @@ -279,7 +279,7 @@ routes.post("/api/sources", async (c) => { routes.get("/api/locations", async (c) => { const { granularity, parent, search, root } = c.req.query(); let where = "WHERE 1=1"; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; if (root === "true") { where += " AND parent_id IS NULL"; } diff --git a/modules/cart/mod.ts b/modules/cart/mod.ts index 4c4b319..72f8724 100644 --- a/modules/cart/mod.ts +++ b/modules/cart/mod.ts @@ -89,7 +89,7 @@ routes.get("/api/catalog", async (c) => { const { product_type, capability, tag, source_space, q, limit = "50", offset = "0" } = c.req.query(); const conditions: string[] = ["status = 'active'"]; - const params: unknown[] = []; + const params: any[] = []; let paramIdx = 1; if (product_type) { @@ -246,7 +246,7 @@ routes.get("/api/orders", async (c) => { const { status, provider_id, buyer_id, limit = "50", offset = "0" } = c.req.query(); const conditions: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let paramIdx = 1; if (status) { conditions.push(`o.status = $${paramIdx}`); params.push(status); paramIdx++; } @@ -292,7 +292,7 @@ routes.patch("/api/orders/:id/status", async (c) => { // Use parameterized query for payment info let paymentSet = ""; - const params: unknown[] = [status, c.req.param("id")]; + const params: any[] = [status, c.req.param("id")]; if (status === "paid" && payment_tx) { paymentSet = `, payment_tx = $3, payment_network = $4`; params.push(payment_tx, payment_network || null); diff --git a/modules/forum/lib/provisioner.ts b/modules/forum/lib/provisioner.ts index 1c14ac8..27d22e4 100644 --- a/modules/forum/lib/provisioner.ts +++ b/modules/forum/lib/provisioner.ts @@ -34,7 +34,7 @@ async function logStep( async function updateInstance(instanceId: string, fields: Record) { const sets: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; for (const [key, val] of Object.entries(fields)) { sets.push(`${key} = $${idx}`); diff --git a/modules/inbox/mod.ts b/modules/inbox/mod.ts index e743214..d0ac08d 100644 --- a/modules/inbox/mod.ts +++ b/modules/inbox/mod.ts @@ -115,7 +115,7 @@ routes.get("/api/mailboxes/:slug/threads", async (c) => { if (mailbox.length === 0) return c.json({ error: "Mailbox not found" }, 404); const conditions = ["mailbox_id = $1"]; - const params: unknown[] = [mailbox[0].id]; + const params: any[] = [mailbox[0].id]; let idx = 2; if (status) { @@ -164,7 +164,7 @@ routes.patch("/api/threads/:id", async (c) => { const body = await c.req.json(); const allowed = ["status", "is_read", "is_starred", "tags", "assigned_to"]; const updates: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; for (const key of allowed) { diff --git a/modules/notes/mod.ts b/modules/notes/mod.ts index 3208c5c..f9caaeb 100644 --- a/modules/notes/mod.ts +++ b/modules/notes/mod.ts @@ -197,7 +197,7 @@ routes.put("/api/notebooks/:id", async (c) => { const { title, description, cover_color, is_public } = body; const fields: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; if (title !== undefined) { fields.push(`title = $${idx}`); params.push(title); idx++; } @@ -233,7 +233,7 @@ routes.delete("/api/notebooks/:id", async (c) => { routes.get("/api/notes", async (c) => { const { notebook_id, type, q, limit = "50", offset = "0" } = c.req.query(); const conditions: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; if (notebook_id) { conditions.push(`n.notebook_id = $${idx}`); params.push(notebook_id); idx++; } @@ -324,7 +324,7 @@ routes.put("/api/notes/:id", async (c) => { const { title, content, type, url, language, is_pinned, sort_order } = body; const fields: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let idx = 1; if (title !== undefined) { fields.push(`title = $${idx}`); params.push(title); idx++; } diff --git a/modules/providers/mod.ts b/modules/providers/mod.ts index 66e57ee..def77ce 100644 --- a/modules/providers/mod.ts +++ b/modules/providers/mod.ts @@ -108,7 +108,7 @@ routes.get("/api/providers", async (c) => { const { capability, substrate, community, lat, lng, radius_km, active, limit = "50", offset = "0" } = c.req.query(); const conditions: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let paramIdx = 1; if (active !== "false") { @@ -183,7 +183,7 @@ routes.get("/api/providers/match", async (c) => { const lngNum = parseFloat(lng); const conditions = ["active = TRUE", "capabilities @> $1"]; - const params: unknown[] = [caps, latNum, lngNum]; + const params: any[] = [caps, latNum, lngNum]; let paramIdx = 4; if (substrates) { @@ -274,7 +274,7 @@ routes.put("/api/providers/:id", async (c) => { const body = await c.req.json(); const fields: string[] = []; - const params: unknown[] = []; + const params: any[] = []; let paramIdx = 1; const settable = ["name", "description", "capabilities", "substrates", "communities", "wallet", "active"]; diff --git a/modules/splat/mod.ts b/modules/splat/mod.ts index 140de7f..334086c 100644 --- a/modules/splat/mod.ts +++ b/modules/splat/mod.ts @@ -253,12 +253,12 @@ routes.post("/api/splats", async (c) => { await Bun.write(filepath, buffer); // Insert into DB - const paymentTx = c.get("x402Payment") || null; + const paymentTx = (c as any).get("x402Payment") || null; const rows = await sql.unsafe( `INSERT INTO rsplat.splats (slug, title, description, file_path, file_format, file_size_bytes, tags, space_slug, contributor_id, contributor_name, payment_tx) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING id, slug, title, description, file_format, file_size_bytes, tags, created_at`, - [slug, title, description, filename, format, buffer.length, tags, spaceSlug, claims.sub, claims.username || null, paymentTx] + [slug, title, description, filename, format, buffer.length, tags, spaceSlug, claims.sub, claims.username || null, paymentTx] as any[] ); return c.json(rows[0], 201); @@ -301,8 +301,8 @@ routes.post("/api/splats/from-media", async (c) => { // Collect all files from formdata const files: File[] = []; for (const [key, value] of formData.entries()) { - if (key === "files" && value instanceof File) { - files.push(value); + if (key === "files" && (value as unknown) instanceof File) { + files.push(value as unknown as File); } } @@ -360,12 +360,12 @@ routes.post("/api/splats/from-media", async (c) => { } // Insert splat record (pending processing) - const paymentTx = c.get("x402Payment") || null; + const paymentTx = (c as any).get("x402Payment") || null; const splatRows = await sql.unsafe( `INSERT INTO rsplat.splats (slug, title, description, file_path, file_format, file_size_bytes, tags, space_slug, contributor_id, contributor_name, source, processing_status, source_file_count, payment_tx) VALUES ($1, $2, $3, '', 'ply', 0, $4, $5, $6, $7, 'media', 'pending', $8, $9) RETURNING id, slug, title, description, file_format, tags, processing_status, source_file_count, created_at`, - [slug, title, description, tags, spaceSlug, claims.sub, claims.username || null, files.length, paymentTx] + [slug, title, description, tags, spaceSlug, claims.sub, claims.username || null, files.length, paymentTx] as any[] ); const splatId = splatRows[0].id; diff --git a/modules/swag/components/folk-swag-designer.ts b/modules/swag/components/folk-swag-designer.ts index c97b53c..6230868 100644 --- a/modules/swag/components/folk-swag-designer.ts +++ b/modules/swag/components/folk-swag-designer.ts @@ -9,7 +9,7 @@ class FolkSwagDesigner extends HTMLElement { private selectedProduct = "sticker"; private imageFile: File | null = null; private imagePreview = ""; - private title = ""; + private designTitle = ""; private generating = false; private artifact: any = null; private error = ""; @@ -40,7 +40,7 @@ class FolkSwagDesigner extends HTMLElement { const formData = new FormData(); formData.append("image", this.imageFile); formData.append("product", this.selectedProduct); - formData.append("title", this.title || "Untitled Design"); + formData.append("title", this.designTitle || "Untitled Design"); const res = await fetch(`${this.getApiBase()}/api/artifact`, { method: "POST", @@ -124,7 +124,7 @@ class FolkSwagDesigner extends HTMLElement { - +