Files
Syncpad/api/src/types.ts
2026-05-02 05:49:09 +00:00

53 lines
1.0 KiB
TypeScript

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;
}