restore(mobile): restore mobile/ directory to pre-d2217531 state

Restored mobile/ from d22175310a711e7ebdd8062ae29a54f0136dc3f6^
(parent commit d94e9ca4bc).

Commit d22175310a (google-labs-jules[bot], 2026-03-23T14:45:22Z) introduced
an SSRF security fix for IMAP connections but unintentionally deleted or
truncated a large number of files across the repository, including 24 files
under mobile/.

This commit targets only the mobile/ directory and restores the following
files to their pre-d2217531 state:

- mobile/README.md
- mobile/app.json
- mobile/app/(tabs)/_layout.tsx
- mobile/app/(tabs)/file-detail.tsx  (re-added)
- mobile/app/+not-found.tsx          (re-added)
- mobile/app/_layout.tsx
- mobile/eslint.config.js            (re-added)
- mobile/package-lock.json
- mobile/package.json
- mobile/src/context/ShareContext.tsx
- mobile/src/i18n/de.json            (re-added)
- mobile/src/i18n/en.json            (re-added)
- mobile/src/i18n/es.json            (re-added)
- mobile/src/i18n/fr.json            (re-added)
- mobile/src/i18n/index.ts           (re-added)
- mobile/src/i18n/it.json            (re-added)
- mobile/src/screens/FileDetailScreen.tsx (re-added)
- mobile/src/screens/FilesScreen.tsx
- mobile/src/screens/LoginScreen.tsx
- mobile/src/screens/ProfileScreen.tsx
- mobile/src/screens/UploadScreen.tsx
- mobile/src/screens/WelcomeScreen.tsx
- mobile/src/services/api.ts
- mobile/src/utils/mimeTypes.ts      (re-added)
- mobile/src/utils/normalizeUri.ts   (re-added)

Security fixes introduced by d2217531 that are unrelated to mobile/
(IMAP SSRF fix in app/utils/network.py and app/tasks/imap_tasks.py)
are preserved — this restore targets only files under mobile/.
This commit is contained in:
copilot-swe-agent[bot]
2026-03-24 12:12:05 +00:00
parent aca12858c1
commit 2f3c22000c
25 changed files with 2354 additions and 646 deletions
+44 -1
View File
@@ -26,6 +26,7 @@ export interface WhoAmIResponse {
email: string | null;
avatar_url: string | null;
is_admin: boolean;
preferred_language: string | null;
}
export interface GenerateTokenResponse {
@@ -66,10 +67,42 @@ export interface FileRecord {
}
export interface UploadResponse {
task_id: string;
task_id?: string;
status: string;
original_filename: string;
stored_filename: string;
duplicate_of?: {
duplicate_type: string;
original_file_id: number;
original_filename: string;
message: string;
};
}
export interface ProcessingLog {
id: number;
task_id: string;
step_name: string;
status: string;
message: string;
timestamp: string;
}
export interface FileDetail {
file: {
id: number;
filehash: string;
original_filename: string;
local_filename: string;
file_size: number;
mime_type: string;
created_at: string;
};
processing_status: ProcessingStatus;
logs: ProcessingLog[];
files_on_disk: {
original: boolean;
};
}
// ---------------------------------------------------------------------------
@@ -177,6 +210,11 @@ class DocuElevateAPI {
return this.request<WhoAmIResponse>("GET", "/api/mobile/whoami");
}
/** Sync the user's preferred UI language to the server. */
async setServerLanguage(lang: string): Promise<void> {
await this.request("POST", "/api/i18n/language", { body: { language: lang } });
}
// -------------------------------------------------------------------------
// Push notifications
// -------------------------------------------------------------------------
@@ -223,6 +261,11 @@ class DocuElevateAPI {
);
return data.processing_status;
}
/** Get full file details including processing logs. */
async getFileDetail(fileId: number): Promise<FileDetail> {
return this.request<FileDetail>("GET", `/api/files/${fileId}`);
}
}
export const api = new DocuElevateAPI();