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

@@ -139,10 +139,8 @@ export default class IdentitySwitcherView extends Vue {
this.apiServerInput = settings.apiServer || "";
const accounts = await retrieveAllAccountsMetadata();
console.log("[IdentitySwitcherView] accounts: ", JSON.stringify(accounts, null, 2));
for (let n = 0; n < accounts.length; n++) {
const acct = accounts[n];
console.log("[IdentitySwitcherView] acct: ", JSON.stringify(acct, null, 2));
this.otherIdentities.push({
id: (acct.id ?? 0).toString(),
did: acct.did,
@@ -152,7 +150,6 @@ export default class IdentitySwitcherView extends Vue {
}
}
} catch (err) {
console.log("[IdentitySwitcherView] error: ", JSON.stringify(err, null, 2));
this.$notify(
{
group: "alert",
@@ -164,7 +161,6 @@ export default class IdentitySwitcherView extends Vue {
);
logger.error("Telling user to clear cache at page create because:", err);
}
console.log("[IdentitySwitcherView] end");
}
async switchAccount(did?: string) {