caca
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user