Files
claudemesh/apps/web/src/modules/billing/lib/api.ts
Alejandro Gutiérrez d3163a5bff feat(db): mesh data model — meshes, members, invites, audit log
- pgSchema "mesh" with 4 tables isolating the peer mesh domain
- Enums: visibility, transport, tier, role
- audit_log is metadata-only (E2E encryption enforced at broker/client)
- Cascade on mesh delete, soft-delete via archivedAt/revokedAt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 21:19:32 +01:00

39 lines
803 B
TypeScript

import { handle } from "@turbostarter/api/utils";
import { api } from "~/lib/api/client";
import type { InferRequestType } from "hono/client";
const KEY = "billing";
const queries = {
customer: {
get: {
queryKey: [KEY, "customer"],
queryFn: () => handle(api.billing.customer.$get)(),
},
},
};
const mutations = {
portal: {
get: {
mutationKey: [KEY, "portal"],
mutationFn: (data: InferRequestType<typeof api.billing.portal.$get>) =>
handle(api.billing.portal.$get)(data),
},
},
checkout: {
create: {
mutationKey: [KEY, "checkout"],
mutationFn: (data: InferRequestType<typeof api.billing.checkout.$post>) =>
handle(api.billing.checkout.$post)(data),
},
},
};
export const billing = {
queries,
mutations,
};