From a0cf9ea721489ff3ceacf4ce9a92ca25fd4c51a6 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Thu, 3 Apr 2025 08:33:00 +0000 Subject: [PATCH] feat(backup): implement platform-specific database backup service - Add Capacitor-specific DatabaseBackupService implementation - Update PlatformServiceFactory to correctly load platform services - Fix Filesystem API usage in Capacitor backup service - Add detailed logging throughout backup process - Improve error handling and cleanup of temporary files - Update web platform backup implementation - Add proper TypeScript types and documentation This commit implements a robust platform-specific backup service that: - Uses Capacitor's Filesystem and Share APIs for mobile platforms - Properly handles file paths and URIs - Includes comprehensive logging for debugging - Cleans up temporary files after sharing - Maintains consistent interface across platforms --- .env.mobile | 6 +- .eslintrc.js | 6 +- .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .../buildOutputCleanup/cache.properties | 4 +- android/.gradle/file-system.probe | Bin 8 -> 8 bytes android/app/capacitor.build.gradle | 2 + .../src/main/assets/capacitor.plugins.json | 8 + android/app/src/main/assets/public/index.html | 2 +- android/build.gradle | 2 +- android/capacitor.settings.gradle | 6 + .../gradle/wrapper/gradle-wrapper.properties | 2 +- package-lock.json | 42 +-- package.json | 2 +- src/components/EntityIcon.vue | 12 +- src/db/index.ts | 20 +- src/interfaces/identifier.ts | 14 +- src/interfaces/service.ts | 288 ++++++++++++++++++ .../capacitor/DatabaseBackupService.ts | 69 +++++ src/services/DatabaseBackupService.ts | 81 ++++- src/services/PlatformServiceFactory.ts | 150 ++++++++- src/services/RateLimitsService.ts | 42 +-- .../platforms/mobile/DatabaseBackupService.ts | 6 +- .../platforms/web/DatabaseBackupService.ts | 31 +- src/types/interfaces.ts | 262 +++++++++++++++- src/utils/logger.ts | 53 +++- src/views/AccountViewView.vue | 77 +++-- src/views/ContactGiftingView.vue | 2 +- src/views/HelpView.vue | 4 +- src/views/HomeView.vue | 2 +- src/views/ProjectViewView.vue | 2 +- vite.config.common.mts | 12 +- vite.config.web.mts | 76 ++++- vite.config.web.ts | 27 -- 33 files changed, 1155 insertions(+), 157 deletions(-) create mode 100644 src/interfaces/service.ts create mode 100644 src/platforms/capacitor/DatabaseBackupService.ts delete mode 100644 vite.config.web.ts diff --git a/.env.mobile b/.env.mobile index 33e24dc8..f3831533 100644 --- a/.env.mobile +++ b/.env.mobile @@ -1 +1,5 @@ -PLATFORM=mobile \ No newline at end of file +PLATFORM=mobile +VITE_ENDORSER_API_URL=https://test-api.endorser.ch/api/v2/claim +VITE_PARTNER_API_URL=https://test-api.partner.ch/api/v2 +VITE_IMAGE_API_URL=https://test-api.images.ch/api/v2 +VITE_PUSH_SERVER_URL=https://test-api.push.ch/api/v2 \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 0a908a2e..02ecf15f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,6 +26,10 @@ module.exports = { "no-debugger": process.env.NODE_ENV === "production" ? "error" : "warn", "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-unnecessary-type-constraint": "off" + "@typescript-eslint/no-unnecessary-type-constraint": "off", + "@typescript-eslint/no-unused-vars": ["error", { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + }] }, }; diff --git a/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 6f5da8a4ca559c926011acca45cde951d01726cd..6316cbbee7ac24f09bc3eb60cf2995304962381b 100644 GIT binary patch literal 17 VcmZQ>duy#wxduy#wx( diff --git a/android/.gradle/buildOutputCleanup/cache.properties b/android/.gradle/buildOutputCleanup/cache.properties index 1cb74a9a..e0d365f0 100644 --- a/android/.gradle/buildOutputCleanup/cache.properties +++ b/android/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Fri Mar 21 07:27:50 UTC 2025 -gradle.version=8.2.1 +#Thu Apr 03 08:01:00 UTC 2025 +gradle.version=8.11.1 diff --git a/android/.gradle/file-system.probe b/android/.gradle/file-system.probe index d0da61435c89283dd5c3fdbf3e2a207341b09998..c967c2ff1c95ec17665d25297a358598fcba3ab1 100644 GIT binary patch literal 8 PcmZQzV4V7EOT TimeSafari - +