native-update 2.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +28 -14
- package/android/manifest-additions.xml +28 -0
- package/android/src/main/AndroidManifest.xml +3 -7
- package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundNotificationManager.kt +21 -13
- package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +196 -29
- package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +21 -36
- package/cli/AGENTS.md +15 -1
- package/cli/CLAUDE.md +15 -1
- package/cli/commands/backend-create.js +56 -15
- package/cli/commands/bundle-create.js +39 -7
- package/cli/commands/monitor.js +72 -51
- package/cli/index.js +10 -24
- package/cli/package.json +11 -3
- package/dist/esm/app-review/app-review-manager.js +0 -1
- package/dist/esm/app-review/index.js +0 -1
- package/dist/esm/app-review/platform-review-handler.js +0 -1
- package/dist/esm/app-review/review-conditions-checker.js +0 -1
- package/dist/esm/app-review/review-rate-limiter.js +0 -1
- package/dist/esm/app-review/types.js +0 -1
- package/dist/esm/app-update/app-update-checker.js +0 -1
- package/dist/esm/app-update/app-update-installer.d.ts +1 -0
- package/dist/esm/app-update/app-update-installer.js +19 -8
- package/dist/esm/app-update/app-update-manager.js +0 -1
- package/dist/esm/app-update/app-update-notifier.js +0 -1
- package/dist/esm/app-update/index.js +0 -1
- package/dist/esm/app-update/platform-app-update.js +12 -3
- package/dist/esm/app-update/types.js +0 -1
- package/dist/esm/background-update/background-scheduler.js +0 -1
- package/dist/esm/background-update/index.js +0 -1
- package/dist/esm/background-update/notification-manager.js +0 -1
- package/dist/esm/config/support.js +0 -1
- package/dist/esm/core/analytics.d.ts +13 -0
- package/dist/esm/core/analytics.js +15 -1
- package/dist/esm/core/cache-manager.js +0 -1
- package/dist/esm/core/config.d.ts +0 -15
- package/dist/esm/core/config.js +0 -4
- package/dist/esm/core/errors.d.ts +1 -0
- package/dist/esm/core/errors.js +1 -1
- package/dist/esm/core/event-emitter.d.ts +0 -3
- package/dist/esm/core/event-emitter.js +8 -3
- package/dist/esm/core/logger.js +0 -1
- package/dist/esm/core/performance.js +0 -1
- package/dist/esm/core/plugin-manager.js +3 -1
- package/dist/esm/core/security.d.ts +11 -0
- package/dist/esm/core/security.js +27 -1
- package/dist/esm/definitions.d.ts +0 -11
- package/dist/esm/definitions.js +0 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/live-update/bundle-manager.d.ts +8 -0
- package/dist/esm/live-update/bundle-manager.js +20 -1
- package/dist/esm/live-update/certificate-pinning.js +0 -1
- package/dist/esm/live-update/delta-processor.d.ts +1 -1
- package/dist/esm/live-update/delta-processor.js +3 -1
- package/dist/esm/live-update/download-manager.js +9 -2
- package/dist/esm/live-update/rollout-checker.d.ts +1 -1
- package/dist/esm/live-update/rollout-checker.js +5 -6
- package/dist/esm/live-update/update-manager.js +0 -1
- package/dist/esm/live-update/version-manager.d.ts +0 -12
- package/dist/esm/live-update/version-manager.js +0 -68
- package/dist/esm/plugin.js +69 -43
- package/dist/esm/security/crypto.js +11 -7
- package/dist/esm/security/validator.js +0 -1
- package/dist/esm/types/rollout.d.ts +85 -0
- package/dist/esm/types/rollout.js +25 -0
- package/dist/esm/web.d.ts +8 -0
- package/dist/esm/web.js +148 -54
- package/dist/plugin.cjs.js +1 -2
- package/dist/plugin.esm.js +1 -2
- package/dist/plugin.js +2 -3
- package/docs/CHANGELOG.md +124 -0
- package/docs/CLAUDE.md +1 -1
- package/docs/MANUAL-TASKS.md +17 -0
- package/docs/MARKETING_WEBSITE_TRACKER.md +18 -2
- package/docs/MIGRATION.md +83 -0
- package/docs/PACKAGES.md +167 -0
- package/docs/PERFORMANCE.md +110 -0
- package/docs/PROJECT_COMPLETION_TRACKER.md +4 -35
- package/docs/README.md +0 -1
- package/docs/REMAINING_FEATURES.md +123 -76
- package/docs/ROADMAP.md +200 -120
- package/docs/SECURITY-IF-REPO-PUBLIC.md +232 -0
- package/docs/TESTING_REQUIREMENTS.md +1 -112
- package/docs/ai-knowledge-base/00-project-profile.md +38 -0
- package/docs/ai-knowledge-base/01-features.md +46 -0
- package/docs/ai-knowledge-base/02-routes.md +72 -0
- package/docs/ai-knowledge-base/03-tech-stack.md +57 -0
- package/docs/ai-knowledge-base/README.md +23 -0
- package/docs/analytics-tracking.md +37 -0
- package/docs/capacitor-official-plugins.md +46 -0
- package/docs/capawesome-plugins.md +29 -0
- package/docs/deployment/HOSTINGER_DEPLOY.md +75 -34
- package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +184 -0
- package/docs/docs-site/plan.md +201 -0
- package/docs/docs-site/scope.md +127 -0
- package/docs/docs-site/tracker.json +235 -0
- package/docs/error-handling-tracking.md +37 -0
- package/docs/guides/testing-guide.md +15 -41
- package/docs/package-audit.md +41 -0
- package/docs/play-store/ASO-METADATA.md +5 -0
- package/docs/play-store/DATA-SAFETY.md +5 -0
- package/docs/play-store/DECLARATIONS.md +5 -0
- package/docs/play-store/README.md +27 -0
- package/docs/play-store/RELEASE-NOTES.md +99 -0
- package/docs/play-store/RELEASE-STEPS.md +6 -0
- package/docs/play-store/STORE-LISTING.md +7 -0
- package/docs/play-store/SUBMISSION-CHECKLIST.md +5 -0
- package/docs/production-readiness.md +1 -1
- package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +123 -0
- package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +227 -0
- package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +144 -0
- package/docs/project-audit/2026-05-16/sessions/batch-01.md +42 -0
- package/docs/project-audit/2026-05-16/sessions/batch-02.md +74 -0
- package/docs/project-audit/2026-05-16/sessions/batch-03.md +71 -0
- package/docs/project-audit/2026-05-16/sessions/batch-04.md +88 -0
- package/docs/project-audit/2026-05-16/sessions/batch-05.md +63 -0
- package/docs/project-audit/2026-05-16/sessions/batch-06.md +103 -0
- package/docs/project-audit/2026-05-16/sessions/batch-07.md +61 -0
- package/docs/project-audit/2026-05-16/sessions/batch-08.md +101 -0
- package/docs/project-audit/2026-05-16/sessions/batch-09.md +105 -0
- package/docs/project-audit/2026-05-16/sessions/batch-10.md +102 -0
- package/docs/project-audit/AUDIT-HISTORY.md +74 -0
- package/docs/project-audit/BATCH-PLAN.md +168 -0
- package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +73 -0
- package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +275 -0
- package/docs/project-finalization/00-tracker.json +60 -0
- package/docs/project-knowledge-base/01-system-overview.md +39 -30
- package/docs/project-knowledge-base/02-routes-pages-forms-users.md +87 -81
- package/docs/project-knowledge-base/03-tech-stack-modules-services.md +140 -108
- package/docs/project-knowledge-base/04-data-models-integrations.md +191 -254
- package/docs/project-knowledge-base/05-docs-corpus-inventory.md +83 -20
- package/docs/project-knowledge-base/06-operations-testing-legal-content.md +67 -29
- package/docs/project-knowledge-base/README.md +27 -14
- package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +81 -0
- package/docs/rules-tracker.md +102 -0
- package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +116 -0
- package/docs/social-media-marketing/README.md +81 -0
- package/docs/social-media-marketing/posts-batch-01.md +613 -0
- package/docs/social-media-marketing/posts-batch-02.md +528 -0
- package/docs/social-media-marketing/whatsapp-messages-batch-01.md +458 -0
- package/docs/social-media-marketing/whatsapp-status-batch-01.md +355 -0
- package/docs/tracking/finalization-2026-05-16-tracker.json +346 -0
- package/docs/tracking/full-audit-tracker.json +121 -0
- package/docs/tracking/production-readiness-audit-tracker.json +429 -0
- package/ios/Plugin/BackgroundUpdate/BackgroundUpdatePlugin.swift +16 -3
- package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +71 -47
- package/ios/Plugin/NativeUpdatePlugin.swift +14 -9
- package/package.json +29 -29
- package/cli/node_modules/.yarn-integrity +0 -16
- package/cli/node_modules/commander/LICENSE +0 -22
- package/cli/node_modules/commander/Readme.md +0 -1148
- package/cli/node_modules/commander/esm.mjs +0 -16
- package/cli/node_modules/commander/index.js +0 -26
- package/cli/node_modules/commander/lib/argument.js +0 -145
- package/cli/node_modules/commander/lib/command.js +0 -2179
- package/cli/node_modules/commander/lib/error.js +0 -43
- package/cli/node_modules/commander/lib/help.js +0 -462
- package/cli/node_modules/commander/lib/option.js +0 -329
- package/cli/node_modules/commander/lib/suggestSimilar.js +0 -100
- package/cli/node_modules/commander/package-support.json +0 -16
- package/cli/node_modules/commander/package.json +0 -80
- package/cli/node_modules/commander/typings/esm.d.mts +0 -3
- package/cli/node_modules/commander/typings/index.d.ts +0 -884
- package/cli/yarn.lock +0 -8
- package/dist/esm/__tests__/bundle-manager.test.d.ts +0 -1
- package/dist/esm/__tests__/bundle-manager.test.js +0 -151
- package/dist/esm/__tests__/bundle-manager.test.js.map +0 -1
- package/dist/esm/__tests__/config.test.d.ts +0 -1
- package/dist/esm/__tests__/config.test.js +0 -70
- package/dist/esm/__tests__/config.test.js.map +0 -1
- package/dist/esm/__tests__/delta-processor.test.d.ts +0 -1
- package/dist/esm/__tests__/delta-processor.test.js +0 -77
- package/dist/esm/__tests__/delta-processor.test.js.map +0 -1
- package/dist/esm/__tests__/firestore-schema.test.d.ts +0 -1
- package/dist/esm/__tests__/firestore-schema.test.js +0 -74
- package/dist/esm/__tests__/firestore-schema.test.js.map +0 -1
- package/dist/esm/__tests__/integration.test.d.ts +0 -1
- package/dist/esm/__tests__/integration.test.js +0 -78
- package/dist/esm/__tests__/integration.test.js.map +0 -1
- package/dist/esm/__tests__/manifest-reader.test.d.ts +0 -1
- package/dist/esm/__tests__/manifest-reader.test.js +0 -271
- package/dist/esm/__tests__/manifest-reader.test.js.map +0 -1
- package/dist/esm/__tests__/rollout-checker.test.d.ts +0 -1
- package/dist/esm/__tests__/rollout-checker.test.js +0 -210
- package/dist/esm/__tests__/rollout-checker.test.js.map +0 -1
- package/dist/esm/__tests__/security-enforcement.test.d.ts +0 -1
- package/dist/esm/__tests__/security-enforcement.test.js +0 -95
- package/dist/esm/__tests__/security-enforcement.test.js.map +0 -1
- package/dist/esm/__tests__/security.test.d.ts +0 -1
- package/dist/esm/__tests__/security.test.js +0 -54
- package/dist/esm/__tests__/security.test.js.map +0 -1
- package/dist/esm/__tests__/version-manager.test.d.ts +0 -1
- package/dist/esm/__tests__/version-manager.test.js +0 -45
- package/dist/esm/__tests__/version-manager.test.js.map +0 -1
- package/dist/esm/app-review/app-review-manager.js.map +0 -1
- package/dist/esm/app-review/index.js.map +0 -1
- package/dist/esm/app-review/platform-review-handler.js.map +0 -1
- package/dist/esm/app-review/review-conditions-checker.js.map +0 -1
- package/dist/esm/app-review/review-rate-limiter.js.map +0 -1
- package/dist/esm/app-review/types.js.map +0 -1
- package/dist/esm/app-update/app-update-checker.js.map +0 -1
- package/dist/esm/app-update/app-update-installer.js.map +0 -1
- package/dist/esm/app-update/app-update-manager.js.map +0 -1
- package/dist/esm/app-update/app-update-notifier.js.map +0 -1
- package/dist/esm/app-update/index.js.map +0 -1
- package/dist/esm/app-update/platform-app-update.js.map +0 -1
- package/dist/esm/app-update/types.js.map +0 -1
- package/dist/esm/background-update/background-scheduler.js.map +0 -1
- package/dist/esm/background-update/index.js.map +0 -1
- package/dist/esm/background-update/notification-manager.js.map +0 -1
- package/dist/esm/config/support.js.map +0 -1
- package/dist/esm/core/analytics.js.map +0 -1
- package/dist/esm/core/cache-manager.js.map +0 -1
- package/dist/esm/core/config.js.map +0 -1
- package/dist/esm/core/errors.js.map +0 -1
- package/dist/esm/core/event-emitter.js.map +0 -1
- package/dist/esm/core/logger.js.map +0 -1
- package/dist/esm/core/performance.js.map +0 -1
- package/dist/esm/core/plugin-manager.js.map +0 -1
- package/dist/esm/core/security.js.map +0 -1
- package/dist/esm/definitions.js.map +0 -1
- package/dist/esm/firestore/firestore-client.d.ts +0 -109
- package/dist/esm/firestore/firestore-client.js +0 -264
- package/dist/esm/firestore/firestore-client.js.map +0 -1
- package/dist/esm/firestore/index.d.ts +0 -11
- package/dist/esm/firestore/index.js +0 -11
- package/dist/esm/firestore/index.js.map +0 -1
- package/dist/esm/firestore/manifest-reader.d.ts +0 -87
- package/dist/esm/firestore/manifest-reader.js +0 -294
- package/dist/esm/firestore/manifest-reader.js.map +0 -1
- package/dist/esm/firestore/schema.d.ts +0 -507
- package/dist/esm/firestore/schema.js +0 -73
- package/dist/esm/firestore/schema.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/live-update/bundle-manager.js.map +0 -1
- package/dist/esm/live-update/certificate-pinning.js.map +0 -1
- package/dist/esm/live-update/delta-processor.js.map +0 -1
- package/dist/esm/live-update/download-manager.js.map +0 -1
- package/dist/esm/live-update/rollout-checker.js.map +0 -1
- package/dist/esm/live-update/update-manager.js.map +0 -1
- package/dist/esm/live-update/version-manager.js.map +0 -1
- package/dist/esm/plugin.js.map +0 -1
- package/dist/esm/security/crypto.js.map +0 -1
- package/dist/esm/security/validator.js.map +0 -1
- package/dist/esm/web.js.map +0 -1
- package/dist/plugin.cjs.js.map +0 -1
- package/dist/plugin.esm.js.map +0 -1
- package/dist/plugin.js.map +0 -1
- package/docs/FIREBASE_INTEGRATION_TRACKER.md +0 -321
- package/docs/FIREBASE_QUERIES_AND_INDEXES_AUDIT.md +0 -221
- package/docs/examples/firebase-backend-example.md +0 -27
- package/docs/features/laravel-nova-backend/credentials.ignore.md +0 -34
- package/docs/guides/no-cost-backend-implementation-plan.md +0 -77
- package/docs/guides/no-cost-firestore-google-drive-backend.md +0 -60
- package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-16.md +0 -454
- package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-24.md +0 -66
- package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md +0 -67
- /package/docs/{MARKETING_WEBSITE_PLAN.md → archive/MARKETING_WEBSITE_PLAN.md} +0 -0
|
@@ -2,142 +2,141 @@
|
|
|
2
2
|
|
|
3
3
|
## Metadata
|
|
4
4
|
|
|
5
|
-
- **Reference Date:** 2026-
|
|
6
|
-
- **Last Updated:** 2026-
|
|
5
|
+
- **Reference Date:** 2026-05-18
|
|
6
|
+
- **Last Updated:** 2026-05-18
|
|
7
7
|
|
|
8
8
|
## Main Integration Surfaces
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- Google Drive API
|
|
10
|
+
- Google OAuth via Laravel Socialite (auth provider)
|
|
11
|
+
- Laravel Sanctum (token plane for the SPA)
|
|
12
|
+
- `spatie/laravel-permission` (RBAC inside MySQL)
|
|
13
|
+
- Google Drive API (server-side OAuth; bundle storage)
|
|
14
|
+
- FilesHub (`https://fileshub.zaions.com`) for miscellaneous user-uploaded assets
|
|
15
|
+
- PayPal (webhook for subscription events)
|
|
14
16
|
- Capacitor runtime APIs
|
|
15
|
-
- Android native APIs
|
|
16
|
-
- iOS native APIs
|
|
17
|
+
- Android native APIs (Play Core update, Play Review, WorkManager)
|
|
18
|
+
- iOS native APIs (StoreKit SKStoreReviewController, BGTaskScheduler)
|
|
17
19
|
|
|
18
20
|
## Authentication Model
|
|
19
21
|
|
|
20
22
|
### Sign-In Method
|
|
21
23
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Key fields visible in types and auth flow:
|
|
29
|
-
|
|
30
|
-
- `uid`
|
|
31
|
-
- `email`
|
|
32
|
-
- `displayName`
|
|
33
|
-
- `photoURL`
|
|
34
|
-
- `provider`
|
|
35
|
-
- `emailVerified`
|
|
36
|
-
- `createdAt`
|
|
37
|
-
- `lastLogin`
|
|
38
|
-
- `driveConnected`
|
|
39
|
-
- `driveEmail`
|
|
40
|
-
- `driveConnectedAt`
|
|
41
|
-
- `plan`
|
|
42
|
-
- `planStartDate`
|
|
43
|
-
- `planEndDate`
|
|
44
|
-
- `appsCount`
|
|
45
|
-
- `buildsCount`
|
|
46
|
-
- `storageUsed`
|
|
47
|
-
- `preferences`
|
|
48
|
-
- `isAdmin`
|
|
49
|
-
- `updatedAt`
|
|
50
|
-
|
|
51
|
-
### User Preferences
|
|
52
|
-
|
|
53
|
-
- `emailNotifications`
|
|
54
|
-
- `updateNotifications`
|
|
55
|
-
- `theme`
|
|
56
|
-
- `language`
|
|
57
|
-
|
|
58
|
-
## App Model
|
|
59
|
-
|
|
60
|
-
### App Document (`apps/{appId}`)
|
|
61
|
-
|
|
62
|
-
- `userId`
|
|
63
|
-
- `name`
|
|
64
|
-
- `packageId`
|
|
65
|
-
- `icon`
|
|
66
|
-
- `description`
|
|
67
|
-
- `platforms`
|
|
68
|
-
- `channels`
|
|
69
|
-
- `apiKey`
|
|
70
|
-
- `totalBuilds`
|
|
71
|
-
- `activeUsers`
|
|
72
|
-
- `lastBuildDate`
|
|
73
|
-
- `createdAt`
|
|
74
|
-
- `updatedAt`
|
|
24
|
+
- Only auth flow is Google OAuth via Laravel Socialite
|
|
25
|
+
- SPA navigates to `${VITE_API_URL}/auth/google/redirect`
|
|
26
|
+
- Laravel's `OAuthController` redirects to Google, receives the callback, exchanges the code, and creates/updates the `users` row keyed by `google_id`
|
|
27
|
+
- On success, Laravel issues a Sanctum personal access token and redirects to `${FRONTEND_URL}/auth/callback?token=…`
|
|
28
|
+
- SPA's `CallbackPage` stores the plain-text token (shown once) via `setAuthToken()` and navigates to `/dashboard`
|
|
75
29
|
|
|
76
|
-
###
|
|
30
|
+
### Role Assignment
|
|
77
31
|
|
|
78
|
-
|
|
32
|
+
- First sign-in → assigns the `user` role (default)
|
|
33
|
+
- Emails in `ADMIN_EMAILS` env → auto-assigned `super-admin`
|
|
34
|
+
- Manual: `php artisan native-update:role-assign <email> <role>` (revokes existing tokens to force re-login with new role)
|
|
35
|
+
- Seeder: `php artisan db:seed --class=RolesPermissionsSeeder` (idempotent)
|
|
79
36
|
|
|
80
|
-
|
|
81
|
-
- `autoUpdate`
|
|
82
|
-
- `updateStrategy`
|
|
83
|
-
- `requireUserConsent`
|
|
84
|
-
- `minVersion`
|
|
37
|
+
### Token Lifecycle
|
|
85
38
|
|
|
86
|
-
Default
|
|
39
|
+
- Default TTL: 7 days (configurable via `SANCTUM_TOKEN_EXPIRATION`)
|
|
40
|
+
- Stored as `Bearer` header on every `/api/dashboard/*` and `/api/admin/*` request
|
|
41
|
+
- 401 from any endpoint → axios interceptor clears the token, broadcasts a logout event, redirects to `/login`
|
|
42
|
+
- Logout: `DELETE /api/dashboard/me/token` revokes the current token; on multi-device logout, all of the user's tokens are revoked
|
|
87
43
|
|
|
88
|
-
|
|
89
|
-
- staging enabled
|
|
90
|
-
- development enabled and auto-update true
|
|
44
|
+
## MySQL Schema (Laravel migrations)
|
|
91
45
|
|
|
92
|
-
|
|
46
|
+
Migrations live in `backend/database/migrations/`. The following tables exist:
|
|
93
47
|
|
|
94
|
-
###
|
|
48
|
+
### `users`
|
|
95
49
|
|
|
96
|
-
|
|
50
|
+
- Standard Laravel fields plus:
|
|
51
|
+
- `google_id` (unique; primary identity key)
|
|
52
|
+
- `name`, `email`, `avatar_url`
|
|
53
|
+
- `google_drive_access_token`, `google_drive_refresh_token`, `google_drive_token_expires_at` (encrypted via Laravel encrypter)
|
|
54
|
+
- `google_drive_email`, `google_drive_connected_at`
|
|
55
|
+
- `preferences` (JSON: email notifications, update notifications, theme, language, accent color, etc.)
|
|
56
|
+
- admin-control flags (block, suspend, notes)
|
|
57
|
+
- `apps_count`, `builds_count`, `storage_used` (denormalized counters)
|
|
58
|
+
- standard timestamps + soft-delete
|
|
97
59
|
|
|
98
|
-
|
|
99
|
-
- `packageId`
|
|
100
|
-
- `userId`
|
|
101
|
-
- `createdAt`
|
|
60
|
+
### `apps`
|
|
102
61
|
|
|
103
|
-
|
|
62
|
+
- `user_id` (foreign key to `users`)
|
|
63
|
+
- `name`, `package_id` (unique per user), `description`, `icon_url`
|
|
64
|
+
- `platforms` (JSON array: android/ios/web)
|
|
65
|
+
- `channels` (JSON config)
|
|
66
|
+
- `total_builds`, `active_users`, `last_build_at`
|
|
67
|
+
- standard timestamps + soft-delete
|
|
104
68
|
|
|
105
|
-
|
|
69
|
+
### `api_keys`
|
|
106
70
|
|
|
107
|
-
|
|
71
|
+
- `app_id` (foreign key)
|
|
72
|
+
- `key` (random token; used for mobile `/api/v1/*` plane)
|
|
73
|
+
- `name`, `is_active`, `last_used_at`
|
|
74
|
+
- standard timestamps
|
|
108
75
|
|
|
109
|
-
|
|
76
|
+
### `signing_keys`
|
|
110
77
|
|
|
111
|
-
- `
|
|
112
|
-
- `
|
|
113
|
-
- `
|
|
114
|
-
- `
|
|
115
|
-
- `
|
|
116
|
-
- `
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
- `mimeType`
|
|
121
|
-
- `checksum`
|
|
122
|
-
- `signature`
|
|
123
|
-
- `driveFileId`
|
|
124
|
-
- `driveFileUrl`
|
|
125
|
-
- `driveFolderId`
|
|
126
|
-
- `fileManifest`
|
|
127
|
-
- `manifestDriveId`
|
|
128
|
-
- `releaseNotes`
|
|
129
|
-
- `releaseType`
|
|
130
|
-
- `isPreRelease`
|
|
131
|
-
- `minNativeVersion`
|
|
132
|
-
- `uploadedAt`
|
|
133
|
-
- `uploadedBy`
|
|
134
|
-
- `uploadDuration`
|
|
135
|
-
- `status`
|
|
136
|
-
- `processingSteps`
|
|
137
|
-
- `analytics`
|
|
138
|
-
- `updatedAt`
|
|
78
|
+
- `app_id` (foreign key)
|
|
79
|
+
- `name`
|
|
80
|
+
- `algorithm` (RSA-2048 / RSA-4096 / EC P-256 / EC P-384)
|
|
81
|
+
- `public_key` (PEM)
|
|
82
|
+
- `private_key` (encrypted; backend-side only — never sent to the SPA)
|
|
83
|
+
- `is_active`, `rotated_at`
|
|
84
|
+
- standard timestamps
|
|
85
|
+
|
|
86
|
+
### `builds`
|
|
139
87
|
|
|
140
|
-
|
|
88
|
+
- `id`
|
|
89
|
+
- `user_id`, `app_id`
|
|
90
|
+
- `version`, `build_number`
|
|
91
|
+
- `channel`, `platform`
|
|
92
|
+
- `file_name`, `file_size`, `mime_type`
|
|
93
|
+
- `checksum` (SHA-256)
|
|
94
|
+
- `signature` (RSA-SHA256 base64)
|
|
95
|
+
- `drive_file_id`, `drive_file_url`, `drive_folder_id`
|
|
96
|
+
- `fileshub_object_id` (when FilesHub used instead of Drive)
|
|
97
|
+
- `file_manifest` (JSON: per-entry checksums for delta hints)
|
|
98
|
+
- `release_notes`, `release_type`, `is_pre_release`
|
|
99
|
+
- `min_native_version`
|
|
100
|
+
- `uploaded_at`, `uploaded_by`, `upload_duration`
|
|
101
|
+
- `status` (uploading / processing / active / archived / failed)
|
|
102
|
+
- `processing_steps` (JSON; multi-step state)
|
|
103
|
+
- `analytics` (JSON snapshot)
|
|
104
|
+
- rollout config inline:
|
|
105
|
+
- `rollout_enabled`
|
|
106
|
+
- `rollout_percentage`
|
|
107
|
+
- `rollout_start_time`, `rollout_end_time`
|
|
108
|
+
- `target_segments` (JSON; optional)
|
|
109
|
+
- standard timestamps + soft-delete
|
|
110
|
+
|
|
111
|
+
### `subscriptions` + `subscription_items`
|
|
112
|
+
|
|
113
|
+
- billing model (Stripe-style + PayPal provider added 2026-04-18)
|
|
114
|
+
- `provider` (stripe / paypal), `provider_id`
|
|
115
|
+
- `status`, `current_period_start`, `current_period_end`
|
|
116
|
+
- per-item quantities + plan refs
|
|
117
|
+
|
|
118
|
+
### `device_activities`
|
|
119
|
+
|
|
120
|
+
- mobile-side telemetry (one row per active device)
|
|
121
|
+
- last-seen, version installed, channel, platform metadata
|
|
122
|
+
|
|
123
|
+
### `analytics_events`
|
|
124
|
+
|
|
125
|
+
- per-event analytics (update checks, downloads, installs, rollbacks, errors)
|
|
126
|
+
- `app_id`, `channel`, `platform`, `event_type`, `payload` (JSON)
|
|
127
|
+
- aggregated by `AnalyticsDashboardController` for the dashboard
|
|
128
|
+
|
|
129
|
+
### `personal_access_tokens` (Sanctum)
|
|
130
|
+
|
|
131
|
+
- Sanctum's default token table
|
|
132
|
+
- `tokenable_type`, `tokenable_id`, `name`, `token` (hashed), `abilities`, `last_used_at`, `expires_at`
|
|
133
|
+
|
|
134
|
+
### Spatie permission tables
|
|
135
|
+
|
|
136
|
+
- `roles`, `permissions`, `model_has_roles`, `model_has_permissions`, `role_has_permissions`
|
|
137
|
+
- guard name: `sanctum`
|
|
138
|
+
|
|
139
|
+
## Build Status Values
|
|
141
140
|
|
|
142
141
|
- `uploading`
|
|
143
142
|
- `processing`
|
|
@@ -145,163 +144,101 @@ Observed/typed fields include:
|
|
|
145
144
|
- `archived`
|
|
146
145
|
- `failed`
|
|
147
146
|
|
|
148
|
-
## Manifest
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
## Delta Model
|
|
195
|
-
|
|
196
|
-
### Delta Document
|
|
197
|
-
|
|
198
|
-
Used for pre-computed patch information:
|
|
147
|
+
## Manifest Shape (returned by `/api/v1/updates/check`)
|
|
148
|
+
|
|
149
|
+
Returned for each `appId + channel` combination, derived from the active Build row:
|
|
150
|
+
|
|
151
|
+
```jsonc
|
|
152
|
+
{
|
|
153
|
+
"appId": "com.example.myapp",
|
|
154
|
+
"channel": "production",
|
|
155
|
+
"current": {
|
|
156
|
+
"version": "1.2.0",
|
|
157
|
+
"bundleId": "<build uuid>",
|
|
158
|
+
"bundleUrl": "https://<signed-drive-or-fileshub-url>",
|
|
159
|
+
"manifestUrl": "<self-link>",
|
|
160
|
+
"checksum": "sha256-…",
|
|
161
|
+
"signature": "<base64 RSA-SHA256>",
|
|
162
|
+
"size": 1234567,
|
|
163
|
+
"releaseNotes": "…",
|
|
164
|
+
"releaseDate": "ISO-8601",
|
|
165
|
+
"mandatory": false,
|
|
166
|
+
"minNativeVersion": "1.0.0"
|
|
167
|
+
},
|
|
168
|
+
"deltas": [],
|
|
169
|
+
"rollout": {
|
|
170
|
+
"enabled": true,
|
|
171
|
+
"percentage": 25,
|
|
172
|
+
"startTime": "ISO-8601",
|
|
173
|
+
"endTime": null,
|
|
174
|
+
"targetSegments": null
|
|
175
|
+
},
|
|
176
|
+
"previousVersions": [],
|
|
177
|
+
"updatedAt": "ISO-8601",
|
|
178
|
+
"updatedBy": "<user id>"
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Rollout Config
|
|
183
|
+
|
|
184
|
+
- `enabled` (boolean)
|
|
185
|
+
- `percentage` (0–100)
|
|
186
|
+
- `startTime` / `endTime` (ISO-8601; optional bounds)
|
|
187
|
+
- `targetSegments` (optional JSON; reserved for future segmentation)
|
|
188
|
+
- `schedule` strategy (immediate / gradual / scheduled)
|
|
189
|
+
|
|
190
|
+
## Delta Shape
|
|
191
|
+
|
|
192
|
+
Used when the plugin asks for an incremental patch between two known versions:
|
|
199
193
|
|
|
200
194
|
- `appId`
|
|
201
|
-
- `fromVersion`
|
|
202
|
-
- `toVersion`
|
|
195
|
+
- `fromVersion`, `toVersion`
|
|
203
196
|
- `channel`
|
|
204
|
-
- `
|
|
205
|
-
- `
|
|
206
|
-
- `
|
|
207
|
-
- `patchChecksum`
|
|
208
|
-
- `sourceChecksum`
|
|
209
|
-
- `targetChecksum`
|
|
210
|
-
- `generatedAt`
|
|
211
|
-
- `generationDuration`
|
|
212
|
-
- `algorithm`
|
|
213
|
-
- `compressionRatio`
|
|
197
|
+
- `patchUrl`, `patchSize`, `patchChecksum`
|
|
198
|
+
- `sourceChecksum`, `targetChecksum`
|
|
199
|
+
- `algorithm`, `compressionRatio`
|
|
214
200
|
- `status`
|
|
215
201
|
|
|
216
|
-
##
|
|
217
|
-
|
|
218
|
-
### Analytics Batch Document (`analytics_batch/{batchId}`)
|
|
219
|
-
|
|
220
|
-
- `appId`
|
|
221
|
-
- `channel`
|
|
222
|
-
- `windowStart`
|
|
223
|
-
- `windowEnd`
|
|
224
|
-
- `events`
|
|
225
|
-
- `versionStats`
|
|
226
|
-
- `platformStats`
|
|
227
|
-
- `errorSamples`
|
|
228
|
-
- `createdAt`
|
|
229
|
-
|
|
230
|
-
### Events Aggregated
|
|
231
|
-
|
|
232
|
-
- update checks
|
|
233
|
-
- downloads
|
|
234
|
-
- installs
|
|
235
|
-
- rollbacks
|
|
236
|
-
- errors
|
|
237
|
-
|
|
238
|
-
## Drive Token Model
|
|
239
|
-
|
|
240
|
-
### Drive Token Document (`drive_tokens/{userId}`)
|
|
241
|
-
|
|
242
|
-
Observed fields include:
|
|
243
|
-
|
|
244
|
-
- `userId`
|
|
245
|
-
- `accessToken`
|
|
246
|
-
- `refreshToken`
|
|
247
|
-
- `tokenType`
|
|
248
|
-
- `scope`
|
|
249
|
-
- `expiresAt`
|
|
250
|
-
- Google account metadata such as email/name/picture/id/locale
|
|
251
|
-
- `encryptionMethod`
|
|
252
|
-
- `iv`
|
|
253
|
-
- `authTag`
|
|
254
|
-
- `createdAt`
|
|
255
|
-
- `updatedAt`
|
|
256
|
-
|
|
257
|
-
## Google Drive Integration Flow
|
|
202
|
+
## Google Drive Integration Flow (server-side)
|
|
258
203
|
|
|
259
204
|
### Connect Flow
|
|
260
205
|
|
|
261
|
-
1.
|
|
262
|
-
2.
|
|
263
|
-
3.
|
|
264
|
-
4.
|
|
265
|
-
5.
|
|
266
|
-
6.
|
|
267
|
-
|
|
268
|
-
### Upload Flow
|
|
269
|
-
|
|
270
|
-
1. User selects ZIP
|
|
271
|
-
2. Validate file
|
|
272
|
-
3. Calculate SHA-256 checksum
|
|
273
|
-
4. Generate file manifest from ZIP contents
|
|
274
|
-
5. Upload ZIP to Drive
|
|
275
|
-
6. Upload manifest JSON to Drive
|
|
276
|
-
7. Make Drive files publicly retrievable as needed
|
|
277
|
-
8. Write build record in Firestore
|
|
278
|
-
9. Update channel manifest document
|
|
279
|
-
|
|
280
|
-
## No-Cost Backend Operating Model
|
|
281
|
-
|
|
282
|
-
The intended website publishing model is:
|
|
206
|
+
1. User clicks "Connect Google Drive" on `/dashboard/drive`
|
|
207
|
+
2. SPA calls `GET /api/dashboard/google-drive/auth-url` → backend returns Google OAuth URL with Drive scope
|
|
208
|
+
3. Browser does full-window redirect to Google
|
|
209
|
+
4. Google redirects to `${FRONTEND_URL}/oauth/google-drive/callback?code=…`
|
|
210
|
+
5. SPA `DriveCallbackPage` POSTs the code to `POST /api/dashboard/google-drive/callback`
|
|
211
|
+
6. Backend exchanges the code, encrypts access + refresh tokens, persists on the `users` row
|
|
212
|
+
7. Backend writes `google_drive_email` + `google_drive_connected_at` for UI display
|
|
283
213
|
|
|
284
|
-
|
|
285
|
-
- Google Drive for bundle storage
|
|
286
|
-
- Firestore for metadata and app-facing manifests
|
|
287
|
-
- no paid compute required for core publish/check/download flow
|
|
214
|
+
### Upload Flow (Laravel-driven)
|
|
288
215
|
|
|
289
|
-
|
|
216
|
+
1. User selects ZIP on `/dashboard/upload`
|
|
217
|
+
2. SPA multipart-POSTs to `POST /api/dashboard/apps/{app}/builds`
|
|
218
|
+
3. `UpdateBuildRequest` FormRequest validates app ownership, version, build_number, file presence, file size, Drive-connected precondition
|
|
219
|
+
4. Laravel computes SHA-256 of the uploaded ZIP
|
|
220
|
+
5. Laravel signs the checksum with the app's active signing key (RSA-SHA256)
|
|
221
|
+
6. Laravel uploads the ZIP to the user's Drive folder via encrypted tokens
|
|
222
|
+
7. Laravel inserts the Build row in MySQL with `status='active'`
|
|
223
|
+
8. Laravel returns the Build resource to the SPA
|
|
224
|
+
9. TanStack Query invalidates the relevant cache keys → UploadPage navigates to app detail
|
|
290
225
|
|
|
291
|
-
## App-Facing Manifest Paths
|
|
226
|
+
## App-Facing Manifest Paths
|
|
292
227
|
|
|
293
|
-
-
|
|
294
|
-
-
|
|
228
|
+
- `GET /api/v1/updates/check?appId=…&channel=…&apiKey=…` → returns the active manifest
|
|
229
|
+
- `GET /api/v1/bundles/{build}/download` → returns a short-lived signed URL to the bundle (default 30 min)
|
|
295
230
|
|
|
296
231
|
## Security-Relevant Data Points
|
|
297
232
|
|
|
298
|
-
- checksums are stored and
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
233
|
+
- SHA-256 checksums are stored on every Build and verified on every download
|
|
234
|
+
- RSA-SHA256 signatures are stored alongside checksums; plugin verifies against the configured public key (or array of public keys during a key rotation window)
|
|
235
|
+
- Signing-key private keys never leave the Laravel host
|
|
236
|
+
- Drive OAuth tokens are encrypted at rest using Laravel's encrypter (per-row, not per-app)
|
|
237
|
+
- Sanctum token strings are hashed in the DB; the plain-text token is shown to the SPA exactly once at issuance
|
|
302
238
|
|
|
303
239
|
## Data Ownership Notes
|
|
304
240
|
|
|
305
|
-
- The website messaging emphasizes that user build files are stored in the user
|
|
306
|
-
-
|
|
307
|
-
- deletion
|
|
241
|
+
- The website messaging emphasizes that user build files are stored in the user's Google Drive
|
|
242
|
+
- All other data (account, app metadata, builds, analytics, signing keys, subscriptions) lives in the Laravel MySQL database
|
|
243
|
+
- Account deletion soft-deletes the User row, revokes all Sanctum tokens, clears encrypted Drive tokens, cascades to apps/builds, and surfaces a confirmation page documenting what was removed
|
|
244
|
+
- Privacy policy + data-deletion page reflect this exact architecture
|