import 'reflect-metadata'; /** * Metadata keys for storing API routing information. * These keys are used by both server-side (routing) and client-side (client generation). */ export declare const METADATA_KEYS: { API_PATH: string; ENDPOINTS: string; AUTH_META: string; }; /** * Route metadata stored per-method at runtime. * Used internally by http-routing and http-client as the runtime representation * of a route. Constructed from @ApiPath + @Endpoint metadata by createApiClient * and ApiRoutingFactory. */ export declare class RouteMetadata { httpMethod: string; path: string; methodName: string; controllerClassName?: string; authMeta?: AuthMeta; constructor(httpMethod: string, path: string, methodName: string, controllerClassName?: string, authMeta?: AuthMeta); } /** * Auth metadata attached to a class or method via @Authentication(). * * - authenticated=false → public endpoint (no auth check) * - authenticated=true, no roles → requires authentication * - authenticated=true, roles=['admin'] → requires authentication + specific roles * - authenticated=false + roles → INVALID (caught at decorator time) */ export declare class AuthMeta { authenticated: boolean; roles: string[]; constructor(authenticated: boolean, roles?: string[]); } /** * @ApiPath(basePath) - Class decorator that marks a class as an API definition * and sets the base path for all endpoints. * * Usage: * ```typescript * @Authentication({authenticated: true}) * @ApiPath('/api/save') * abstract class SaveApi { * @Endpoint('/item') * save(request: SaveRequest): Promise { ... } * } * ``` */ export declare function ApiPath(basePath: string): ClassDecorator; /** * @Endpoint(path) - Method decorator that registers a POST endpoint at the given path. * * All endpoints are POST-only (matching gRPC/thrift style). * * Usage: * ```typescript * @Endpoint('/item') * save(request: SaveRequest): Promise { ... } * ``` */ export declare function Endpoint(path: string): MethodDecorator; /** * Authentication config passed to @Authentication() decorator. */ export declare class AuthenticationConfig { authenticated: boolean; roles?: string[]; constructor(authenticated: boolean, roles?: string[]); } /** * @Authentication(config) - Class or method decorator for auth requirements. * * Single decorator replaces @Public/@Authenticated/@Roles: * - @Authentication({authenticated: false}) → public, no auth check * - @Authentication({authenticated: true}) → requires authentication * - @Authentication({authenticated: true, roles: ['admin']}) → requires auth + roles * * Class-level is required. Methods can override class-level. * Throws if authenticated=false but roles are specified (contradictory). */ export declare function Authentication(config: AuthenticationConfig): ClassDecorator & MethodDecorator; /** * Get the base path from @ApiPath decorator. */ export declare function getApiPath(apiClass: Function): string | undefined; /** * Get all endpoints from @Endpoint decorators. * Returns a record of methodName -> endpoint path. */ export declare function getEndpoints(apiClass: Function): Record | undefined; /** * Check if a class has @ApiPath decorator. */ export declare function isApiPath(apiClass: Function): boolean; /** * Get auth metadata for a specific method, falling back to class-level auth. * Method-level auth takes precedence over class-level auth. */ export declare function getAuthMeta(apiClass: Function, methodName?: string): AuthMeta | undefined; /** * Validate that a class/method doesn't have conflicting auth decorators. * @throws Error if multiple @Authentication decorators are found on the same target. */ export declare function validateNoConflictingDecorators(apiClass: Function, methodName: string | undefined): void;