@flavoai/fastfold
Version:
Flavo frontend package
26 lines • 897 B
TypeScript
/**
* The user object shape coming from Flavo validation (set on req.user).
*/
interface FlavoUserData {
id: string;
email: string;
displayName: string;
avatar: string;
authProvider: string;
role: string;
meta?: Record<string, any>;
}
/**
* Sync a Flavo-authenticated user to the app's local database.
*
* - Looks up by `email` column (required on the table)
* - If not found: INSERT
* - If found: UPDATE with latest profile data
* - Returns the local row's `id` (or undefined if sync failed/skipped)
*
* This function never throws — errors are logged and swallowed so that
* auth middleware never blocks a request due to a sync failure.
*/
export declare function syncFlavoUserToDb(db: any, schema: Record<string, any>, userTableName: string, user: FlavoUserData): Promise<number | string | undefined>;
export {};
//# sourceMappingURL=flavo-sync.d.ts.map