@nestjs-mod/two-factor
Version:
Two factor module with an error filter, guard, controller, database migrations and rest-sdk for work with module from other nodejs appliaction
29 lines (28 loc) • 1.22 kB
TypeScript
import { ValidationError as CvTwoFactorError } from 'class-validator';
export declare enum TwoFactorErrorEnum {
COMMON = "TWO_FACTOR-000",
TwoFactorCodeNotSet = "TWO-FACTOR-001",
TwoFactorCodeWrongCode = "TWO-FACTOR-002",
TwoFactorCodeIsOutdated = "TWO-FACTOR-003",
TwoFactorCodePleaseWait30Seconds = "TWO-FACTOR-004",
TwoFactorCodeIsUsed = "TWO-FACTOR-005"
}
export declare const TWO_FACTOR_ERROR_ENUM_TITLES: Record<TwoFactorErrorEnum, string>;
export declare class TwoFactorErrorMetadataConstraint {
name: string;
description: string;
constructor(options?: TwoFactorErrorMetadataConstraint);
}
export declare class TwoFactorErrorMetadata {
property: string;
constraints: TwoFactorErrorMetadataConstraint[];
children?: TwoFactorErrorMetadata[];
constructor(options?: TwoFactorErrorMetadata);
static fromClassValidatorTwoFactorErrors(errors?: CvTwoFactorError[]): TwoFactorErrorMetadata[] | undefined;
}
export declare class TwoFactorError extends Error {
message: string;
code: TwoFactorErrorEnum;
metadata?: TwoFactorErrorMetadata[];
constructor(message?: string | TwoFactorErrorEnum, code?: TwoFactorErrorEnum, metadata?: CvTwoFactorError[]);
}