mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-17 11:02:06 +00:00
7786d46078
- An export now pauses a revoked integration only if its row is unchanged since the export read it, using the trigger-maintained updatedAt column as the row version. If the user reconnected in the meantime, the stale failure no longer disables the fresh credentials or asks the user to reconnect again. updateExportStatus now reports whether a row was written. - The backup status store ignores a response overtaken by a newer refresh, or by the status being flagged, cleared or set directly, so a slow response can't overwrite newer state. - Unit tests cover the whole integration repository, the guarded pause and stale status responses. Coverage thresholds are raised to the new baseline.
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
export type ExportProvider = 'google_drive' | 'dropbox';
|
|
|
|
export interface PokedexExportIntegration {
|
|
_id: string;
|
|
userId: string;
|
|
pokedexId: string | null;
|
|
provider: ExportProvider;
|
|
enabled: boolean;
|
|
fileName: string | null;
|
|
folderId: string | null;
|
|
path: string | null;
|
|
accessToken: string;
|
|
refreshToken: string | null;
|
|
accessTokenExpiresAt: string | null;
|
|
metadata: Record<string, unknown> | null;
|
|
lastExportedAt: string | null;
|
|
lastError: string | null;
|
|
/** Set by a database trigger on every write, so it doubles as the row's version. */
|
|
updatedAt: string | null;
|
|
}
|
|
|
|
export interface PokedexExportIntegrationDB {
|
|
id: string;
|
|
userId: string;
|
|
pokedexId: string | null;
|
|
provider: ExportProvider;
|
|
enabled: boolean;
|
|
fileName: string | null;
|
|
folderId: string | null;
|
|
path: string | null;
|
|
accessToken: string;
|
|
refreshToken: string | null;
|
|
accessTokenExpiresAt: string | null;
|
|
metadata: Record<string, unknown> | null;
|
|
lastExportedAt: string | null;
|
|
lastError: string | null;
|
|
updatedAt: string | null;
|
|
}
|