File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3- -
3+ - [ fixed ] Fixed optional fields in UserRecord types to be optional.
44
55# v6.4.0
66
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export class UserRecord {
186186 if ( typeof response . validSince !== 'undefined' ) {
187187 validAfterTime = parseDate ( response . validSince * 1000 ) ;
188188 }
189- utils . addReadonlyGetter ( this , 'tokensValidAfterTime' , validAfterTime ) ;
189+ utils . addReadonlyGetter ( this , 'tokensValidAfterTime' , validAfterTime || undefined ) ;
190190 }
191191
192192 /** @return {object } The plain object representation of the user record. */
Original file line number Diff line number Diff line change @@ -104,11 +104,11 @@ declare namespace admin.auth {
104104
105105 interface UserRecord {
106106 uid : string ;
107- email : string ;
107+ email ? : string ;
108108 emailVerified : boolean ;
109- displayName : string ;
110- phoneNumber : string ;
111- photoURL : string ;
109+ displayName ? : string ;
110+ phoneNumber ? : string ;
111+ photoURL ? : string ;
112112 disabled : boolean ;
113113 metadata : admin . auth . UserMetadata ;
114114 providerData : admin . auth . UserInfo [ ] ;
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ describe('Auth', () => {
456456 const noValidSinceExpectedUserRecord =
457457 getValidUserRecord ( noValidSinceGetAccountInfoResponse ) ;
458458 // Confirm null tokensValidAfterTime on user.
459- expect ( noValidSinceExpectedUserRecord . tokensValidAfterTime ) . to . be . null ;
459+ expect ( noValidSinceExpectedUserRecord . tokensValidAfterTime ) . to . be . undefined ;
460460 // Simulate getUser returns the expected user with no validSince.
461461 const getUserStub = sinon . stub ( Auth . prototype , 'getUser' )
462462 . returns ( Promise . resolve ( noValidSinceExpectedUserRecord ) ) ;
@@ -660,7 +660,7 @@ describe('Auth', () => {
660660 const noValidSinceExpectedUserRecord =
661661 getValidUserRecord ( noValidSinceGetAccountInfoResponse ) ;
662662 // Confirm null tokensValidAfterTime on user.
663- expect ( noValidSinceExpectedUserRecord . tokensValidAfterTime ) . to . be . null ;
663+ expect ( noValidSinceExpectedUserRecord . tokensValidAfterTime ) . to . be . undefined ;
664664 // Simulate getUser returns the expected user with no validSince.
665665 const getUserStub = sinon . stub ( Auth . prototype , 'getUser' )
666666 . returns ( Promise . resolve ( noValidSinceExpectedUserRecord ) ) ;
Original file line number Diff line number Diff line change @@ -546,8 +546,8 @@ describe('UserRecord', () => {
546546 } ) . to . throw ( Error ) ;
547547 } ) ;
548548
549- it ( 'should return null tokensValidAfterTime when not available' , ( ) => {
550- expect ( userRecordNoValidSince . tokensValidAfterTime ) . to . be . null ;
549+ it ( 'should return undefined tokensValidAfterTime when not available' , ( ) => {
550+ expect ( userRecordNoValidSince . tokensValidAfterTime ) . to . be . undefined ;
551551 } ) ;
552552
553553 it ( 'should return expected metadata' , ( ) => {
@@ -637,8 +637,8 @@ describe('UserRecord', () => {
637637 expect ( userRecord . toJSON ( ) ) . to . deep . equal ( getUserJSON ( ) ) ;
638638 } ) ;
639639
640- it ( 'should return null tokensValidAfterTime when not available' , ( ) => {
641- expect ( ( userRecordNoValidSince . toJSON ( ) as any ) . tokensValidAfterTime ) . to . be . null ;
640+ it ( 'should return undefined tokensValidAfterTime when not available' , ( ) => {
641+ expect ( ( userRecordNoValidSince . toJSON ( ) as any ) . tokensValidAfterTime ) . to . be . undefined ;
642642 } ) ;
643643 } ) ;
644644} ) ;
You can’t perform that action at this time.
0 commit comments