changemaker.lite/api/dist/modules/auth/auth.service.d.ts

86 lines
2.9 KiB
TypeScript

import { UserRole } from '@prisma/client';
import type { RegisterInput } from './auth.schemas';
interface TokenPair {
accessToken: string;
refreshToken: string;
}
export declare const authService: {
login(email: string, password: string): Promise<{
accessToken: string;
refreshToken: string;
user: {
status: import(".prisma/client").$Enums.UserStatus;
id: string;
email: string;
name: string | null;
phone: string | null;
role: import(".prisma/client").$Enums.UserRole;
permissions: import("@prisma/client/runtime/library").JsonValue | null;
createdVia: import(".prisma/client").$Enums.UserCreatedVia;
expiresAt: Date | null;
expireDays: number | null;
lastLoginAt: Date | null;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
};
}>;
register(data: RegisterInput): Promise<{
accessToken: string;
refreshToken: string;
user: {
status: import(".prisma/client").$Enums.UserStatus;
id: string;
email: string;
name: string | null;
phone: string | null;
role: import(".prisma/client").$Enums.UserRole;
permissions: import("@prisma/client/runtime/library").JsonValue | null;
createdVia: import(".prisma/client").$Enums.UserCreatedVia;
expiresAt: Date | null;
expireDays: number | null;
lastLoginAt: Date | null;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
};
}>;
refreshTokens(refreshToken: string): Promise<{
accessToken: string;
refreshToken: string;
user: {
status: import(".prisma/client").$Enums.UserStatus;
id: string;
email: string;
name: string | null;
phone: string | null;
role: import(".prisma/client").$Enums.UserRole;
permissions: import("@prisma/client/runtime/library").JsonValue | null;
createdVia: import(".prisma/client").$Enums.UserCreatedVia;
expiresAt: Date | null;
expireDays: number | null;
lastLoginAt: Date | null;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
};
}>;
logout(refreshToken: string): Promise<void>;
generateAccessToken(user: {
id: string;
email: string;
role: UserRole;
}): string;
generateRefreshToken(user: {
id: string;
email: string;
role: UserRole;
}): Promise<string>;
generateTokenPair(user: {
id: string;
email: string;
role: UserRole;
}): Promise<TokenPair>;
};
export {};
//# sourceMappingURL=auth.service.d.ts.map