109 lines
4.0 KiB
TypeScript
109 lines
4.0 KiB
TypeScript
import { UserRole } from '@prisma/client';
|
|
import type { RegisterInput } from './auth.schemas';
|
|
export interface TokenPair {
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
}
|
|
type UserForToken = {
|
|
id: string;
|
|
email: string;
|
|
role: UserRole;
|
|
roles?: unknown;
|
|
};
|
|
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;
|
|
pronouns: string | null;
|
|
role: import(".prisma/client").$Enums.UserRole;
|
|
roles: import("@prisma/client/runtime/library").JsonValue;
|
|
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<{
|
|
user: {
|
|
status: import(".prisma/client").$Enums.UserStatus;
|
|
id: string;
|
|
email: string;
|
|
name: string | null;
|
|
phone: string | null;
|
|
pronouns: string | null;
|
|
role: import(".prisma/client").$Enums.UserRole;
|
|
roles: import("@prisma/client/runtime/library").JsonValue;
|
|
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;
|
|
};
|
|
requiresVerification: boolean;
|
|
message: string;
|
|
} | {
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: {
|
|
status: import(".prisma/client").$Enums.UserStatus;
|
|
id: string;
|
|
email: string;
|
|
name: string | null;
|
|
phone: string | null;
|
|
pronouns: string | null;
|
|
role: import(".prisma/client").$Enums.UserRole;
|
|
roles: import("@prisma/client/runtime/library").JsonValue;
|
|
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;
|
|
};
|
|
requiresVerification?: undefined;
|
|
message?: undefined;
|
|
}>;
|
|
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;
|
|
pronouns: string | null;
|
|
role: import(".prisma/client").$Enums.UserRole;
|
|
roles: import("@prisma/client/runtime/library").JsonValue;
|
|
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: UserForToken): string;
|
|
generateRefreshToken(user: UserForToken): Promise<string>;
|
|
generateTokenPair(user: UserForToken): Promise<TokenPair>;
|
|
};
|
|
export {};
|
|
//# sourceMappingURL=auth.service.d.ts.map
|