UNPKG

@kitstack/nest-powertools

Version:

A comprehensive collection of NestJS powertools, decorators, and utilities to supercharge your backend development

39 lines (38 loc) 2.41 kB
import type { AuditAction, ResilientHttpConfig } from '../types/hooks'; export declare function UseAndGuards(...guards: any[]): MethodDecorator & ClassDecorator; export declare function UseOrGuards(...guards: any[]): MethodDecorator & ClassDecorator; export declare function UseNotGuard(guard: any): MethodDecorator & ClassDecorator; export declare function AuditableEndpoint(action: AuditAction | string, options?: { resource?: string; includeRequestBody?: boolean; includeResponseBody?: boolean; excludeFields?: string[]; }): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void; export declare function AuditCreate(resource?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void; export declare function AuditRead(resource?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void; export declare function AuditUpdate(resource?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void; export declare function AuditDelete(resource?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void; export declare function PowerEndpoint(options: { guards?: any[]; guardLogic?: 'AND' | 'OR'; audit?: { action: AuditAction | string; resource?: string; includeRequestBody?: boolean; excludeFields?: string[]; }; resilientHttp?: ResilientHttpConfig; }): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void; export declare function UltimatePowerEndpoint(options: { adminOnly?: boolean; roles?: string[]; permissions?: string[]; auditAction?: AuditAction | string; auditResource?: string; timeout?: number; retries?: number; circuitBreaker?: boolean; validateRequest?: boolean; cache?: boolean; cacheTtl?: number; }): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;