Refactor the code

This commit is contained in:
2025-08-25 18:16:47 +03:00
Unverified
parent bddf34de2d
commit 2151a0b4a1
14 changed files with 220 additions and 170 deletions
+23
View File
@@ -5,6 +5,8 @@
* @version 1.0.0
*/
import type { DmEnvelope } from "../chat/dm";
/**
* HTTP headers object type
* @typedef {Object.<string, string>} Headers
@@ -136,6 +138,19 @@ export interface RegisterRequest {
confirm_password: string;
}
export interface UploadPublicKeyRequest {
publicKey: string;
}
export interface SendDMRequest {
recipientId: number;
iv: string;
ciphertext: string;
salt: string;
iv2: string;
wrappedMk: string;
}
// Responses
/**
@@ -149,6 +164,14 @@ export interface LoginResponse {
token: string;
}
export interface BackupBlob {
blob: string;
}
export interface FetchDMResponse {
messages: DmEnvelope[]
}
// ---------------
// WebSocket types
// ---------------