@kitstack/nest-powertools
Version:
A comprehensive collection of NestJS powertools, decorators, and utilities to supercharge your backend development
19 lines (18 loc) • 1.7 kB
TypeScript
import type { ValidationOptions, CacheOptions, RateLimitOptions, LoggingOptions, AuthConfig, ApiResponseConfig } from '../types';
import { DefaultRoles } from '../types';
export declare function SecureEndpoint(authConfig?: AuthConfig & {
validation?: ValidationOptions;
logging?: LoggingOptions;
description?: string;
responses?: ApiResponseConfig[];
}): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
export declare function PublicCachedEndpoint(options?: {
cache?: CacheOptions;
rateLimit?: RateLimitOptions;
validation?: ValidationOptions;
description?: string;
}): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
export declare function AdminOnly(description?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
export declare function UserEndpoint(description?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
export declare function RequireRoles(roles: (string | DefaultRoles)[], description?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
export declare function RequirePermissions(permissions: string[], description?: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;