feat: Fix some typings

This commit is contained in:
Wanjohi
2025-11-04 07:04:00 +03:00
parent 86959f93d9
commit bcb4763532
5 changed files with 33 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ import { Hono } from "hono";
import { cors } from "hono/cors";
import { auth } from "./utils/auth";
import { Log } from "@nestri/core/utils/log";
import { SessionApi } from "./routes/session.js";
import { HTTPException } from "hono/http-exception";
import { VisibleError, ErrorCodes } from "@nestri/core/error";
import { openAPIRouteHandler, validator } from "hono-openapi";
@@ -38,6 +39,7 @@ export const routes = app
.get("/", async (c) => {
return c.text("ok");
})
.route("/session", SessionApi.route)
.onError((error, c) => {
// Handle our custom VisibleError
if (error instanceof VisibleError) {

View File

@@ -4,7 +4,7 @@ import { ErrorResponses } from "../utils/error.js";
import { Session } from "@nestri/core/session/index";
import { describeRoute, resolver, validator } from "hono-openapi";
export namespace SessionRoute {
export namespace SessionApi {
export const route = new Hono()
.use(notPublic)
.get(