@rytass/member-base-nestjs-module
Version:
Rytass Member System NestJS Base Module
137 lines (136 loc) • 4.73 kB
TypeScript
import type { MemberBaseModuleOptionsDTO } from './member-base-module-options.dto';
import type { Enforcer } from 'casbin';
import type { AuthTokenPayloadBase } from './auth-token-payload';
import type { ReflectableDecorator } from '@nestjs/core';
import type { Subject, Action } from '../decorators/action.decorator';
import type { Repository } from 'typeorm';
import type { BaseMemberEntity } from '../models/base-member.entity';
import type { OAuth2Provider } from './oauth2-provider.interface';
import type { CasbinPermissionChecker } from './casbin-permission';
export declare const MEMBER_BASE_MODULE_OPTIONS: symbol & {
__type: MemberBaseModuleOptionsDTO;
};
export declare const LOGIN_FAILED_BAN_THRESHOLD: symbol & {
__type: number;
};
export declare const RESET_PASSWORD_TOKEN_EXPIRATION: symbol & {
__type: number;
};
export declare const RESET_PASSWORD_TOKEN_SECRET: symbol & {
__type: string;
};
export declare const CASBIN_ENFORCER: symbol & {
__type: Enforcer | null;
};
export declare const CASBIN_PERMISSION_DECORATOR: symbol & {
__type: ReflectableDecorator<[Subject, Action][]>;
};
export declare const CASBIN_PERMISSION_CHECKER: symbol & {
__type: CasbinPermissionChecker<AuthTokenPayloadBase>;
};
export declare const ACCESS_TOKEN_SECRET: symbol & {
__type: string;
};
export declare const ACCESS_TOKEN_EXPIRATION: symbol & {
__type: number;
};
export declare const REFRESH_TOKEN_SECRET: symbol & {
__type: string;
};
export declare const REFRESH_TOKEN_EXPIRATION: symbol & {
__type: number;
};
export declare const ENABLE_GLOBAL_GUARD: symbol & {
__type: boolean;
};
export declare const ONLY_RESET_REFRESH_TOKEN_EXPIRATION_BY_PASSWORD: symbol & {
__type: boolean;
};
export declare const COOKIE_MODE: symbol & {
__type: boolean;
};
export declare const LOGIN_FAILED_AUTO_UNLOCK_SECONDS: symbol & {
__type: number;
};
export declare const ACCESS_TOKEN_COOKIE_NAME: symbol & {
__type: string;
};
export declare const REFRESH_TOKEN_COOKIE_NAME: symbol & {
__type: string;
};
export declare const PROVIDE_MEMBER_ENTITY: symbol & {
__type: new () => BaseMemberEntity;
};
export declare const RESOLVED_MEMBER_REPO: symbol & {
__type: Repository<BaseMemberEntity>;
};
export declare const PASSWORD_SHOULD_INCLUDE_UPPERCASE: symbol & {
__type: boolean;
};
export declare const PASSWORD_SHOULD_INCLUDE_LOWERCASE: symbol & {
__type: boolean;
};
export declare const PASSWORD_SHOULD_INCLUDE_DIGIT: symbol & {
__type: boolean;
};
export declare const PASSWORD_SHOULD_INCLUDE_SPECIAL_CHARACTER: symbol & {
__type: boolean;
};
export declare const PASSWORD_MIN_LENGTH: symbol & {
__type: number;
};
export declare const PASSWORD_POLICY_REGEXP: symbol & {
__type: RegExp;
};
export declare const PASSWORD_HISTORY_LIMIT: symbol & {
__type: number;
};
export declare const PASSWORD_AGE_LIMIT_IN_DAYS: symbol & {
__type: number;
};
export declare const FORCE_REJECT_LOGIN_ON_PASSWORD_EXPIRED: symbol & {
__type: boolean;
};
export declare const CUSTOMIZED_JWT_PAYLOAD: symbol & {
__type: Function;
};
export declare const OAUTH2_PROVIDERS: symbol & {
__type: OAuth2Provider[];
};
export declare const OAUTH2_CLIENT_DEST_URL: symbol & {
__type: string;
};
export interface MemberBaseProviders {
MEMBER_BASE_MODULE_OPTIONS: MemberBaseModuleOptionsDTO;
LOGIN_FAILED_BAN_THRESHOLD: number;
RESET_PASSWORD_TOKEN_EXPIRATION: number;
RESET_PASSWORD_TOKEN_SECRET: string;
CASBIN_ENFORCER: Enforcer;
CASBIN_PERMISSION_DECORATOR: ReflectableDecorator<[Subject, Action][]>;
CASBIN_PERMISSION_CHECKER: Function;
ACCESS_TOKEN_SECRET: string;
ACCESS_TOKEN_EXPIRATION: number;
REFRESH_TOKEN_SECRET: string;
REFRESH_TOKEN_EXPIRATION: number;
ENABLE_GLOBAL_GUARD: boolean;
ONLY_RESET_REFRESH_TOKEN_EXPIRATION_BY_PASSWORD: boolean;
COOKIE_MODE: boolean;
LOGIN_FAILED_AUTO_UNLOCK_SECONDS: number;
ACCESS_TOKEN_COOKIE_NAME: string;
REFRESH_TOKEN_COOKIE_NAME: string;
PROVIDE_MEMBER_ENTITY: new () => BaseMemberEntity;
RESOLVED_MEMBER_REPO: Repository<BaseMemberEntity>;
PASSWORD_SHOULD_INCLUDE_UPPERCASE: boolean;
PASSWORD_SHOULD_INCLUDE_LOWERCASE: boolean;
PASSWORD_SHOULD_INCLUDE_DIGIT: boolean;
PASSWORD_SHOULD_INCLUDE_SPECIAL_CHARACTER: boolean;
PASSWORD_MIN_LENGTH: number;
PASSWORD_POLICY_REGEXP: RegExp;
PASSWORD_HISTORY_LIMIT: number;
PASSWORD_AGE_LIMIT_IN_DAYS: number;
FORCE_REJECT_LOGIN_ON_PASSWORD_EXPIRED: boolean;
CUSTOMIZED_JWT_PAYLOAD: Function;
OAUTH2_PROVIDERS: OAuth2Provider[];
OAUTH2_CLIENT_DEST_URL: string;
}
export type MemberBaseProviderToken = keyof MemberBaseProviders;