added encryption

This commit is contained in:
2026-03-09 10:54:07 +05:30
parent 6e184dc590
commit 6720e28d08
27 changed files with 2093 additions and 709 deletions

View File

@@ -84,12 +84,20 @@ export async function updateUserProfile(
// ENTRY ENDPOINTS
// ============================================
export interface EncryptionMetadata {
encrypted: boolean
ciphertext?: string // Base64-encoded encrypted content
nonce?: string // Base64-encoded nonce
algorithm?: string // e.g., "XSalsa20-Poly1305"
}
export interface JournalEntryCreate {
title: string
content: string
title?: string // Optional if encrypted
content?: string // Optional if encrypted
mood?: string
tags?: string[]
isPublic?: boolean
encryption?: EncryptionMetadata
}
export interface JournalEntry extends JournalEntryCreate {
@@ -97,6 +105,8 @@ export interface JournalEntry extends JournalEntryCreate {
userId: string
createdAt: string
updatedAt: string
entryDate?: string
encryption?: EncryptionMetadata
}
export async function createEntry(