File
Blob: src/worker/types.ts
| 1 | import type { Context } from "hono"; |
| 2 | |
| 3 | export interface HostInfo { |
| 4 | kind: "control" | "subject" | "unknown"; |
| 5 | originalHost: string; |
| 6 | normalizedHost: string; |
| 7 | controlPlaneHost: string; |
| 8 | subjectHostSuffix: string; |
| 9 | hostLabel?: string; |
| 10 | } |
| 11 | |
| 12 | export type AppVariables = { |
| 13 | requestId: string; |
| 14 | hostInfo: HostInfo; |
| 15 | session?: AuthenticatedSession; |
| 16 | }; |
| 17 | |
| 18 | export interface AuthenticatedSession { |
| 19 | subjectId: string; |
| 20 | storageId: string; |
| 21 | sessionId: string; |
| 22 | } |
| 23 | |
| 24 | export type AppEnv = { |
| 25 | Bindings: Env; |
| 26 | Variables: AppVariables; |
| 27 | }; |
| 28 | |
| 29 | export type AppContext = Context<AppEnv>; |