Adds createClientUser helper, POST/GET/DELETE /client-invites routes, and mounts the router at /client-invites in authRouter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
import { Hono } from "hono";
|
|
import type { AppConfig } from "../config.js";
|
|
import { MiddlewareManager } from "../middlewares/middleware.js";
|
|
import { getClientInvitesRouter } from "./clientInvites.js";
|
|
import { getNotesRouter } from "./notes.js";
|
|
import { getStripeRouter } from "./stripe.js";
|
|
import { getTabloRouter } from "./tablo.js";
|
|
import { getTabloDataRouter } from "./tablo_data.js";
|
|
import { getUserRouter } from "./user.js";
|
|
|
|
export const getAuthenticatedRouter = (config: AppConfig) => {
|
|
const authRouter = new Hono();
|
|
|
|
const middlewareManager = MiddlewareManager.getInstance();
|
|
|
|
// Apply authentication middleware to all routes in this router
|
|
authRouter.use(middlewareManager.auth);
|
|
|
|
authRouter.route("/users", getUserRouter());
|
|
authRouter.route("/tablos", getTabloRouter(config));
|
|
authRouter.route("/tablo-data", getTabloDataRouter());
|
|
authRouter.route("/notes", getNotesRouter());
|
|
authRouter.route("/client-invites", getClientInvitesRouter());
|
|
// stripe routes
|
|
authRouter.route("/stripe", getStripeRouter(config));
|
|
|
|
return authRouter;
|
|
};
|