@@ -63,18 +63,19 @@ const EVENT_MAPPING: Record<string, string> = {
63
63
} ;
64
64
65
65
/**
66
- * The UserRecord passed to Cloud Functions is the same UserRecord that is returned by the Firebase Admin
67
- * SDK.
66
+ * The `UserRecord` passed to Cloud Functions is the same
67
+ * {@link https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.userrecord | UserRecord}
68
+ * that is returned by the Firebase Admin SDK.
68
69
*/
69
70
export type UserRecord = auth . UserRecord ;
70
71
71
72
/**
72
- * UserInfo that is part of the UserRecord
73
+ * ` UserInfo` that is part of the ` UserRecord`.
73
74
*/
74
75
export type UserInfo = auth . UserInfo ;
75
76
76
77
/**
77
- * Helper class to create the user metadata in a UserRecord object
78
+ * Helper class to create the user metadata in a ` UserRecord` object.
78
79
*/
79
80
export class UserRecordMetadata implements auth . UserMetadata {
80
81
constructor ( public creationTime : string , public lastSignInTime : string ) { }
@@ -89,9 +90,9 @@ export class UserRecordMetadata implements auth.UserMetadata {
89
90
}
90
91
91
92
/**
92
- * Helper function that creates a UserRecord Class from data sent over the wire.
93
+ * Helper function that creates a ` UserRecord` class from data sent over the wire.
93
94
* @param wireData data sent over the wire
94
- * @returns an instance of UserRecord with correct toJSON functions
95
+ * @returns an instance of ` UserRecord` with correct toJSON functions
95
96
*/
96
97
export function userRecordConstructor ( wireData : Record < string , unknown > ) : UserRecord {
97
98
// Falsey values from the wire format proto get lost when converted to JSON, this adds them back.
@@ -157,7 +158,7 @@ export function userRecordConstructor(wireData: Record<string, unknown>): UserRe
157
158
}
158
159
159
160
/**
160
- * User info that is part of the AuthUserRecord
161
+ * User info that is part of the ` AuthUserRecord`.
161
162
*/
162
163
export interface AuthUserInfo {
163
164
/**
@@ -237,7 +238,7 @@ export interface AuthMultiFactorSettings {
237
238
}
238
239
239
240
/**
240
- * The UserRecord passed to auth blocking Cloud Functions from the identity platform.
241
+ * The ` UserRecord` passed to auth blocking functions from the identity platform.
241
242
*/
242
243
export interface AuthUserRecord {
243
244
/**
@@ -334,7 +335,7 @@ export interface AuthEventContext extends EventContext {
334
335
credential ?: Credential ;
335
336
}
336
337
337
- /** Defines the auth event for v2 blocking events */
338
+ /** Defines the auth event for 2nd gen blocking events */
338
339
export interface AuthBlockingEvent extends AuthEventContext {
339
340
data : AuthUserRecord ;
340
341
}
@@ -344,7 +345,7 @@ export interface AuthBlockingEvent extends AuthEventContext {
344
345
*/
345
346
export type RecaptchaActionOptions = "ALLOW" | "BLOCK" ;
346
347
347
- /** The handler response type for beforeCreate blocking events */
348
+ /** The handler response type for ` beforeCreate` blocking events */
348
349
export interface BeforeCreateResponse {
349
350
displayName ?: string ;
350
351
disabled ?: boolean ;
@@ -354,7 +355,7 @@ export interface BeforeCreateResponse {
354
355
recaptchaActionOverride ?: RecaptchaActionOptions ;
355
356
}
356
357
357
- /** The handler response type for beforeSignIn blocking events */
358
+ /** The handler response type for ` beforeSignIn` blocking events */
358
359
export interface BeforeSignInResponse extends BeforeCreateResponse {
359
360
sessionClaims ?: object ;
360
361
}
@@ -472,7 +473,7 @@ type HandlerV2 = (
472
473
| Promise < void > ;
473
474
474
475
/**
475
- * Checks for a valid identity platform web request, otherwise throws an HttpsError
476
+ * Checks for a valid identity platform web request, otherwise throws an HttpsError.
476
477
* @internal
477
478
*/
478
479
export function isValidRequest ( req : express . Request ) : boolean {
@@ -508,7 +509,7 @@ function unsafeDecodeAuthBlockingToken(token: string): DecodedPayload {
508
509
}
509
510
510
511
/**
511
- * Helper function to parse the decoded metadata object into a UserMetaData object
512
+ * Helper function to parse the decoded metadata object into a ` UserMetaData` object
512
513
* @internal
513
514
*/
514
515
export function parseMetadata ( metadata : DecodedPayloadUserRecordMetadata ) : AuthUserMetadata {
@@ -525,7 +526,7 @@ export function parseMetadata(metadata: DecodedPayloadUserRecordMetadata): AuthU
525
526
}
526
527
527
528
/**
528
- * Helper function to parse the decoded user info array into an AuthUserInfo array
529
+ * Helper function to parse the decoded user info array into an ` AuthUserInfo` array.
529
530
* @internal
530
531
*/
531
532
export function parseProviderData (
@@ -546,7 +547,7 @@ export function parseProviderData(
546
547
}
547
548
548
549
/**
549
- * Helper function to parse the date into a UTC string
550
+ * Helper function to parse the date into a UTC string.
550
551
* @internal
551
552
*/
552
553
export function parseDate ( tokensValidAfterTime ?: number ) : string | null {
@@ -639,7 +640,7 @@ export function parseAuthUserRecord(
639
640
} ;
640
641
}
641
642
642
- /** Helper to get the AdditionalUserInfo from the decoded jwt */
643
+ /** Helper to get the ` AdditionalUserInfo` from the decoded JWT */
643
644
function parseAdditionalUserInfo ( decodedJWT : DecodedPayload ) : AdditionalUserInfo {
644
645
let profile ;
645
646
let username ;
@@ -697,7 +698,7 @@ export function generateResponsePayload(
697
698
return result ;
698
699
}
699
700
700
- /** Helper to get the Credential from the decoded jwt */
701
+ /** Helper to get the Credential from the decoded JWT */
701
702
function parseAuthCredential ( decodedJWT : DecodedPayload , time : number ) : Credential {
702
703
if (
703
704
! decodedJWT . sign_in_attributes &&
0 commit comments