Files
GMW/services/frontend/src/lib/api/recordings.ts
T
asepharyana 726a8e116b fix(build): make oRPC/tRPC dist runnable under node ESM (deploy crashloop)
flake.nix only rewrote @/ aliases but left extensionless relative imports
(./router) in compiled dist/. node dist/index.js (how prod runs) cannot
resolve extensionless ESM specifiers -> ERR_MODULE_NOT_FOUND -> backend
crashlooped (444 restarts, port 4001 dead). Extract the fixer into a shared
scripts/fix-imports.mjs that appends .js to extensionless relative imports and
rewrites @/ aliases, and wire it into backend + discord-gateway build phases.

Verified: fresh tsc + fixer -> node dist/index.js boots; oRPC over /trpc
serves both HTTP POST and WebSocket (config/dashboard/voice/moderation/
media/chatbot/analysis) end-to-end against Postgres + Redis. next build
passes with the oRPC client + partysocket.
2026-08-16 14:45:02 +07:00

21 lines
474 B
TypeScript

import { orpc } from "@/lib/orpc/client";
import type { PaginatedRecordings } from "@/lib/types";
export const recordingsApi = {
list: (
limit?: number,
channelId?: string,
userId?: string,
cursor?: string,
) =>
orpc.recordings.list({
limit,
channelId,
userId,
cursor,
}) as unknown as Promise<PaginatedRecordings>,
delete: (id: string) =>
orpc.recordings.delete({ id }) as unknown as Promise<{ ok: boolean }>,
};