diff --git a/src/providers/auth.ts b/src/providers/auth.ts index 3261597..c29068a 100644 --- a/src/providers/auth.ts +++ b/src/providers/auth.ts @@ -22,10 +22,19 @@ import { auth } from 'firebase-functions'; +type PartialWithoutToJSON = Partial>; +type PartialUserRecord = Omit< + PartialWithoutToJSON, + 'metadata' | 'providerData' +> & { + metadata?: PartialWithoutToJSON; + providerData?: Array>; +}; + /** Create a UserRecord. */ export function makeUserRecord( /** Fields of AuthRecord that you'd like to specify. */ - fields: { [key: string]: string | boolean } + fields: PartialUserRecord ): auth.UserRecord { return auth.userRecordConstructor(Object.assign({ uid: '' }, fields)); }