feat: add local auth billing and usage management

This commit is contained in:
inman committed 2026-08-12 12:13:06 +08:00
1 parent f642b5e71f
commit 196fdde83f
119 files changed
+15695 -2650

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { jsonError, jsonOk } from "@/lib/server/api";
import { requireSuperAdminSession } from "@/lib/server/auth/current-user";
import { listBillingPriceRules } from "@/lib/server/billing-store";
import { ensureDefaultBillingPriceRules } from "@/lib/server/billing-catalog";
export const runtime = "nodejs";
export async function GET() {
try {
await requireSuperAdminSession();
await ensureDefaultBillingPriceRules();
return jsonOk({ priceRules: await listBillingPriceRules({ includeDisabled: true }) });
} catch (error) {
return jsonError(error, 500, { source: "api.admin.billing.prices" });
}
}