import { Hono } from "hono";
import { describeRoute, resolver } from "hono-openapi";
import { Session } from "@nestri/core/session/index";

export namespace SessionRoute {
  export const route = new Hono().get(
    "/",
    describeRoute({
      tags: ["Session"],
      operationId: "session.list",
      summary: "List all active sessions",
      description: "List all the current user's active sessions",
      responses: {
        200: {
          description: "List of sessions",
          content: {
            "application/json": {
              schema: resolver(Session.Info.array()),
            },
          },
        },
      },
    }),
  );
}
