/** * NestJS Guard for Enriched Context Headers * Sets up enriched headers context before route handlers execute */ import { CanActivate, ExecutionContext } from '@nestjs/common'; import type { EnrichedHeadersGuardOptions } from '@plyaz/types/api'; /** * NestJS guard that collects enriched context headers * Sets up AsyncLocalStorage context for service functions * * @example * ```typescript * import { Controller, Get, UseGuards } from '@nestjs/common'; * import { EnrichedHeadersGuard } from '@plyaz/api/network/frameworks/nestjs'; * import { fetchUsers } from '@plyaz/api/services'; * * @Controller('users') * @UseGuards(new EnrichedHeadersGuard({ * preset: 'standard', * requiredCompliance: ['GDPR'] * })) * export class UsersController { * @Get() * async getUsers() { * // Service function automatically has enriched headers * return await fetchUsers({ page: 1 }); * } * } * ``` */ export declare class EnrichedHeadersGuard implements CanActivate { private readonly options; /** * Check if all required headers are present */ private checkRequiredHeaders; /** * Check if required compliance is met */ private checkRequiredCompliance; /** * Build enriched headers for request */ private buildHeadersForRequest; /** * Perform validation checks on headers */ private validateHeaders; /** * Handle successful header processing */ private handleSuccess; /** * Handle error during header building */ private handleBuildError; constructor(options?: EnrichedHeadersGuardOptions); canActivate(context: ExecutionContext): Promise; } /** * Create enriched headers guard with specific options * * @param options - Guard configuration * @returns Configured guard instance * * @example * ```typescript * @UseGuards(createEnrichedHeadersGuard({ * preset: 'compliance-strict', * requiredCompliance: ['GDPR'], * debug: true * })) * export class EuComplianceController { * // All methods require GDPR compliance * } * ``` */ export declare function createEnrichedHeadersGuard(options?: EnrichedHeadersGuardOptions): EnrichedHeadersGuard; export declare function RequireEnrichedHeaders(options?: EnrichedHeadersGuardOptions): (target: object, propertyKey?: string, descriptor?: PropertyDescriptor) => void; //# sourceMappingURL=enrichedHeadersGuard.d.ts.map