Initial Commit

This commit is contained in:
2026-05-02 05:49:09 +00:00
commit fbe5535087
117 changed files with 18732 additions and 0 deletions

52
api/src/types.ts Normal file
View File

@@ -0,0 +1,52 @@
export interface Note {
id: string;
public_key: string;
encrypted_content: string;
encrypted_title: string;
iv: string;
created_at: number;
updated_at: number;
}
export interface CreateNoteRequest {
id: string;
encrypted_content: string;
encrypted_title: string;
iv: string;
}
export interface UpdateNoteRequest {
encrypted_content: string;
encrypted_title: string;
iv: string;
}
export interface SSEClient {
id: string;
public_key: string;
res: import('express').Response;
}
export interface SSEMessage {
type: 'note_created' | 'note_updated' | 'note_deleted' | 'invitation_received';
data: Note | { id: string } | Invitation;
}
export interface Invitation {
id: string;
from_public_key: string;
to_public_key: string;
encrypted_group_key: string;
iv: string;
note_id?: string;
note_title?: string;
created_at: number;
}
export interface CreateInvitationRequest {
toPublicKey: string;
encryptedGroupKey?: string;
iv?: string;
noteId?: string;
noteTitle?: string;
}