import { NextContextBase } from "../../NextContext"; import { NextRole, UserRoleStrategy } from "../../structure/NextRole"; import { NextUser } from "../../structure/NextUser"; import { RetrieveUserDelegate } from "../RetrieveUserDelegate"; export type EncodePasswordOptions = { algorithm: 'sha256' | 'sha512' | 'md5' | 'bcrypt'; iterations?: number; bcryptSaltRounds?: number; }; interface RetrieveUserOptions { db: any; userTable: string; userNameField: string; passwordField: string; encryption?: EncodePasswordOptions; statusField?: string; desiredStatus?: any; idField?: string; emailField?: string; phoneField?: string; firstNameField?: string; lastNameField?: string; additionalFields?: string[]; isDeletedField?: string; isDeletedValue?: any; conditions?: (ctx: NextContextBase, username: string, password: string) => Promise; userTypeField?: string; userPassword?: { verifyByUserTypeField: { [userType: string]: (ctx: NextContextBase, user: NextUser, password: string) => Promise; }; }; role?: { strategy?: UserRoleStrategy; roleId?: { /** role table name */ roleTable: string; /** the field in the role table that contains the role id */ roleIdField: string; /** the field in the role table that contains the role name */ roleNameField?: string; /** the field in the role table that contains the role description */ roleDescriptionField?: string; /** the field in the role table that contains the role permissions */ rolePermissionsField?: string; /** the field in the user table that contains the role id */ relationField: string; }; roleJoin?: { /** role table name */ roleTable: string; /** the field in the role table that contains the role id */ roleIdField: string; /** the join table name */ joinTable: string; /** the field in the join table that contains the user id */ joinUserIdField: string; /** the field in the join table that contains the role id */ joinRoleIdField: string; /** the field in the role table that contains the role name */ joinRoleNameField?: string; /** the field in the role table that contains the role description */ joinRoleDescriptionField?: string; /** the field in the role table that contains the role permissions */ joinRolePermissionsField?: string; /** the field in the join table that defines if the role is deleted or not */ isDeletedField?: string; /** the value that defines if the role is deleted or not */ isDeletedValue?: any; }; permission?: { /** permission table name */ permissionTable: string; /** the field in the permission table that contains the permission id */ permissionIdField: string; /** the field in the permission table that contains the permission name */ permissionNameField: string; }; rolePermission?: { /** role permission table name */ rolePermissionTable: string; /** the field in the role permission table that contains the role id */ rolePermissionRoleIdField: string; /** the field in the role permission table that contains the permission id */ rolePermissionPermissionIdField: string; /** the field in the role permission table that defines if the permission is deleted or not */ isDeletedField?: string; /** the value that defines if the permission is deleted or not */ isDeletedValue?: any; }; custom?: (ctx: NextContextBase, user: NextUser) => Promise; }; } export declare function EncodePassword(password: string, options: EncodePasswordOptions, iterations?: number): Promise; export declare function VerifyPassword(plainPassword: string, hashedPassword: string, options: EncodePasswordOptions): Promise; export declare class RetrieveUserBuilder { static Build(options: RetrieveUserOptions): RetrieveUserDelegate; } export {}; //# sourceMappingURL=RetrieveUserBuilder.d.ts.map