feat(export): Replace CSV export with standardized JSON format

- Add contactsToExportJson utility function for standardized data export
- Replace CSV export with JSON format in DataExportSection
- Update file extension and MIME type to application/json
- Remove Dexie-specific export logic in favor of unified SQLite/Dexie approach
- Update success notifications to reflect JSON format
- Add TypeScript interfaces for export data structure

This change improves data portability and standardization by:
- Using a consistent JSON format for data export/import
- Supporting both SQLite and Dexie databases
- Including all contact fields in export
- Properly handling contactMethods as stringified JSON
- Maintaining backward compatibility with existing import tools

Security: No sensitive data exposure, maintains existing access controls
This commit is contained in:
Matthew Raymer
2025-06-07 05:02:33 +00:00
parent cfb186a04e
commit b9223d7fe2
9 changed files with 230 additions and 126 deletions

View File

@@ -128,8 +128,6 @@ export class CapacitorPlatformService implements PlatformService {
let result: unknown;
switch (operation.type) {
case "run": {
console.log("[CapacitorPlatformService] running sql:", operation.sql);
console.log("[CapacitorPlatformService] params:", operation.params);
const runResult = await this.db.run(
operation.sql,
operation.params,
@@ -141,8 +139,6 @@ export class CapacitorPlatformService implements PlatformService {
break;
}
case "query": {
console.log("[CapacitorPlatformService] querying sql:", operation.sql);
console.log("[CapacitorPlatformService] params:", operation.params);
const queryResult = await this.db.query(
operation.sql,
operation.params,
@@ -158,15 +154,9 @@ export class CapacitorPlatformService implements PlatformService {
}
operation.resolve(result);
} catch (error) {
// make sure you don't try to log to the DB... infinite loop!
// eslint-disable-next-line no-console
console.error(
logger.error(
"[CapacitorPlatformService] Error while processing SQL queue:",
error,
" ... for sql:",
operation.sql,
" ... with params:",
operation.params,
);
operation.reject(error);
}