feat(core): add application interfaces (repositories + services)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import type { Cookie } from "@/entities/models/cookie.js";
|
||||
import type { Session } from "@/entities/models/session.js";
|
||||
import type { User } from "@/entities/models/user.js";
|
||||
|
||||
export interface IAuthenticationService {
|
||||
generateUserId(): string;
|
||||
hashPassword(password: string): Promise<string>;
|
||||
verifyPassword(hash: string, password: string): Promise<boolean>;
|
||||
validateSession(
|
||||
sessionId: string
|
||||
): Promise<{ user: User; session: Session }>;
|
||||
createSession(user: User): Promise<{ session: Session; cookie: Cookie }>;
|
||||
invalidateSession(sessionId: string): Promise<{ blankCookie: Cookie }>;
|
||||
}
|
||||
2
packages/core/src/application/services/index.ts
Normal file
2
packages/core/src/application/services/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export type { IAuthenticationService } from "./auth.service.interface.js";
|
||||
export type { ITelemetryService } from "./telemetry.service.interface.js";
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface ITelemetryService {
|
||||
startSpan<T>(name: string, fn: () => T | Promise<T>): Promise<T>;
|
||||
}
|
||||
Reference in New Issue
Block a user