2026-08-19 19:00:29 +07:00
|
|
|
import { initTRPC } from "@trpc/server";
|
|
|
|
|
import { db } from "@mcpedia/db";
|
|
|
|
|
|
|
|
|
|
export interface Context {
|
|
|
|
|
db: typeof db;
|
2026-08-20 09:53:33 +07:00
|
|
|
// Raw `x-webhook-secret` header from the incoming request, if present.
|
|
|
|
|
// State-changing tRPC mutations (restoreRevision) require it to match
|
|
|
|
|
// WEBHOOK_SECRET; read-only procedures ignore it.
|
|
|
|
|
webhookSecret?: string;
|
2026-08-19 19:00:29 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const t = initTRPC.context<Context>().create();
|
|
|
|
|
|
|
|
|
|
export const router = t.router;
|
|
|
|
|
export const publicProcedure = t.procedure;
|