Files
Kazier/mobile/services/db/index.ts
T
m 0536fca6c3 feat(mobile): identité user-first — login/password, SecureStore, scoping par compte
- api: DeviceRegistration device-only, login/changePassword/resolveUser, interception 401 (purge) exonérée sur le login ; type User aligné sur le fil (is_admin)
- SecureStore (expo-secure-store v57) : token + profil, jamais en SQLite ; miroir active_user_id
- AuthContext : statut loading/signedOut/signedIn, bootstrap register→restore, signIn/signOut, garde-fou switch de compte
- app/login.tsx + gate de routes dans _layout (Redirect signedOut) ; i18n fr/en
- DB v5 : user_id sur pending_operations + resource_permissions (UNIQUE par user), repos scopés (user_id IS ? OR IS NULL)
- syncOutbox : delta permissions par compte (Map), outbox poussée du compte actif uniquement
- tests: register/login/401/resolve/changePassword, scoping outbox+permissions, migrations v5 ; e2e live revert register→login admin
2026-09-10 21:34:34 +02:00

46 lines
1011 B
TypeScript

export { getDatabase, closeDatabase, withTransaction } from './client';
export { migrateDatabase, type Migration, type MigrationDb } from './migrations';
export * from './repositories';
export type { AccessCheck, AccessSource } from './repositories/permissions';
export {
transitionSyncStatus,
type SyncEvent,
type SyncTransitionResult,
} from './transitions';
export type {
AccessLevel,
NewPendingOperation,
NewResourcePermission,
NewShare,
NewShareLink,
PendingOperation,
PendingOperationRefType,
PendingOperationRow,
PendingOperationStatus,
PendingOperationType,
PushStatus,
Recipient,
RecipientRow,
RecipientType,
ResourcePermission,
ResourceType,
Share,
ShareLink,
ShareLinkRow,
ShareRow,
StoredFile,
StoredFolder,
SyncStatus,
UserPreferences,
FolderRow,
FileRow,
} from './types';
export {
DATABASE_NAME,
DATABASE_VERSION,
DEVICE_USER_ID_KEY,
AUTH_TOKEN_KEY,
ACTIVE_USER_ID_KEY,
PREFERENCES_KEY,
PERMISSION_TTL_MS,
} from './schema';