import type { TokenObject } from '@pylonts/core'; import type { NonceStore } from './common/auth/NonceStore.js'; /** * Application configuration passed to createApp(). */ export interface AppConfig { auth?: { /** Token-based auth chain (replaces the retired HMAC + JWT pair). */ token?: TokenAuthConfig; }; /** Optional context path prefix, e.g. "/myapp" ⇒ all routes become /myapp/api/... */ contextPath?: string; /** Optional Swagger / OpenAPI documentation. */ swagger?: SwaggerConfig; /** Optional static file serving configuration. */ static?: StaticConfig; port?: number; host?: string; } export interface TokenAuthConfig { /** * Restore the flat token object by Redis key `${appName}.${token}`. * Return null when the token is missing/expired (401, code=login). */ resolveToken: (appName: string, token: string) => Promise; /** App-level bootstrap secrets for login entries (token-less): appName → secret. */ bootstrapSecrets?: Record; /** Salt for refreshToken-derived signing keys (refresh login entries). */ refreshKeySalt?: string; /** Allowed timestamp drift in milliseconds. Default: 5 minutes. */ timestampWindowMs?: number; /** Replay protection (timestamp + nonce). Default: in-memory. */ nonceStore?: NonceStore; } export interface SwaggerConfig { /** API title. Default: package name. */ title?: string; /** API description. */ description?: string; /** API version. Default: package version. */ version?: string; /** Route prefix for Swagger UI. Default: /docs. */ uiPrefix?: string; } export interface StaticConfig { /** Directory to serve static files from, relative to project root. */ root: string; /** URL prefix for static files, e.g. "/admin". */ prefix: string; } //# sourceMappingURL=types.d.ts.map