Add Session class to provide getUser() on call.session

Wraps SessionData and user into a Session class that handlers can use
via call.session.getUser() instead of accessing services directly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-04 15:22:27 -06:00
parent ad6d405206
commit 74d75d08dd
5 changed files with 64 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ import {
} from "express";
import type { MatchFunction } from "path-to-regexp";
import { z } from "zod";
import type { SessionData } from "./auth/types";
import type { Session } from "./auth/types";
import { type ContentType, contentTypes } from "./content-types";
import { type HttpCode, httpCodes } from "./http-codes";
import {
@@ -40,7 +40,7 @@ export type Call = {
parameters: object;
request: ExpressRequest;
user: MaybeUser;
session: SessionData | null;
session: Session;
};
export type InternalHandler = (req: ExpressRequest) => Promise<Result>;