This commit is contained in:
Anaïs Saraiva
2026-03-29 18:45:25 +02:00
parent 0f7d692d12
commit afc839d43d
42 changed files with 3809 additions and 58 deletions
+17
View File
@@ -0,0 +1,17 @@
{
"name": "@internal-mail/shared",
"version": "0.0.1",
"type": "module",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"devDependencies": {
"bun-types": "^1.3.11",
"typescript": "^5.8.3"
}
}
+60
View File
@@ -0,0 +1,60 @@
export type UserRole = "admin" | "user";
export interface SessionUser {
email: string;
displayName: string;
role: UserRole;
avatarUrl: string | null;
totpEnabled: boolean;
}
export interface SessionView {
authenticated: boolean;
csrfToken: string | null;
user: SessionUser | null;
}
export interface ForwardingRule {
enabled: boolean;
target: string | null;
allowedDomains: string[];
}
export interface ProfileSettings {
email: string;
displayName: string;
role: UserRole;
avatarUrl: string | null;
totpEnabled: boolean;
}
export interface MailAttachment {
filename: string;
mimeType: string;
size: number | null;
}
export interface MailMessageSummary {
id: string;
from: string;
subject: string;
preview: string;
receivedAt: string;
hasHtml: boolean;
}
export interface MailMessageDetail extends MailMessageSummary {
to: string[];
textBody: string;
safeHtml: string | null;
attachments: MailAttachment[];
}
export interface LoginResponse {
session: SessionView;
}
export interface TotpSetupResponse {
secret: string;
otpauthUrl: string;
}
+12
View File
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"declaration": true,
"emitDeclarationOnly": true
},
"include": [
"src"
]
}