Skip to content

Commit 90252ca

Browse files
Feiyang1hsubox76
andauthored
Update comments for v9 reference docs (#5111)
* add package desc for AppCheck * update auth doc comments * Update packages-exp/app-check-exp/src/index.ts Co-authored-by: Christina Holland <[email protected]> Co-authored-by: Christina Holland <[email protected]>
1 parent 28c0294 commit 90252ca

File tree

12 files changed

+58
-57
lines changed

12 files changed

+58
-57
lines changed

packages-exp/app-check-exp/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/**
2+
* Firebase App Check
3+
*
4+
* @packageDocumentation
5+
*/
6+
17
/**
28
* @license
3-
* Copyright 2017 Google LLC
9+
* Copyright 2021 Google LLC
410
*
511
* Licensed under the Apache License, Version 2.0 (the "License");
612
* you may not use this file except in compliance with the License.

packages-exp/auth-exp/src/core/auth/emulator.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { _castAuth } from './auth_impl';
2525
*
2626
* @remarks
2727
* This must be called synchronously immediately following the first call to
28-
* {@link @firebase/auth#initializeAuth}. Do not use with production credentials as emulator
28+
* {@link initializeAuth}. Do not use with production credentials as emulator
2929
* traffic is not encrypted.
3030
*
3131
*
@@ -82,9 +82,10 @@ function extractProtocol(url: string): string {
8282
return protocolEnd < 0 ? '' : url.substr(0, protocolEnd + 1);
8383
}
8484

85-
function extractHostAndPort(
86-
url: string
87-
): { host: string; port: number | null } {
85+
function extractHostAndPort(url: string): {
86+
host: string;
87+
port: number | null;
88+
} {
8889
const protocol = extractProtocol(url);
8990
const authority = /(\/\/)?([^?#/]+)/.exec(url.substr(protocol.length)); // Between // and /, ? or #.
9091
if (!authority) {

packages-exp/auth-exp/src/core/credentials/auth_credential.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export class AuthCredential {
4242
* The authentication sign in method for the credential.
4343
*
4444
* @remarks
45-
* For example, {@link SignInMethod.EMAIL_PASSWORD}, or
46-
* {@link SignInMethod.EMAIL_LINK}. This corresponds to the sign-in method
45+
* For example, {@link SignInMethod}.EMAIL_PASSWORD, or
46+
* {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method
4747
* identifier as returned in {@link fetchSignInMethodsForEmail}.
4848
*/
4949
readonly signInMethod: string

packages-exp/auth-exp/src/core/credentials/email.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ import { AuthCredential } from './auth_credential';
3131

3232
/**
3333
* Interface that represents the credentials returned by {@link EmailAuthProvider} for
34-
* {@link ProviderId.PASSWORD}
34+
* {@link ProviderId}.PASSWORD
3535
*
3636
* @remarks
37-
* Covers both {@link SignInMethod.EMAIL_PASSWORD} and
38-
* {@link SignInMethod.EMAIL_LINK}.
37+
* Covers both {@link SignInMethod}.EMAIL_PASSWORD and
38+
* {@link SignInMethod}.EMAIL_LINK.
3939
*
4040
* @public
4141
*/

packages-exp/auth-exp/src/core/providers/email.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ import { _assert } from '../util/assert';
3333
*/
3434
export class EmailAuthProvider implements AuthProvider {
3535
/**
36-
* Always set to {@link ProviderId.PASSWORD}, even for email link.
36+
* Always set to {@link ProviderId}.PASSWORD, even for email link.
3737
*/
3838
static readonly PROVIDER_ID = ProviderId.PASSWORD;
3939
/**
40-
* Always set to {@link SignInMethod.EMAIL_PASSWORD}.
40+
* Always set to {@link SignInMethod}.EMAIL_PASSWORD.
4141
*/
4242
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD = SignInMethod.EMAIL_PASSWORD;
4343
/**
44-
* Always set to {@link SignInMethod.EMAIL_LINK}.
44+
* Always set to {@link SignInMethod}.EMAIL_LINK.
4545
*/
4646
static readonly EMAIL_LINK_SIGN_IN_METHOD = SignInMethod.EMAIL_LINK;
4747
/**
48-
* Always set to {@link ProviderId.PASSWORD}, even for email link.
48+
* Always set to {@link ProviderId}.PASSWORD, even for email link.
4949
*/
5050
readonly providerId = EmailAuthProvider.PROVIDER_ID;
5151

packages-exp/auth-exp/src/core/providers/facebook.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { OAuthCredential } from '../credentials/oauth';
2828
import { BaseOAuthProvider } from './oauth';
2929

3030
/**
31-
* Provider for generating an {@link OAuthCredential} for {@link ProviderId.FACEBOOK}.
31+
* Provider for generating an {@link OAuthCredential} for {@link ProviderId}.FACEBOOK.
3232
*
3333
* @example
3434
* ```javascript
@@ -67,9 +67,9 @@ import { BaseOAuthProvider } from './oauth';
6767
* @public
6868
*/
6969
export class FacebookAuthProvider extends BaseOAuthProvider {
70-
/** Always set to {@link SignInMethod.FACEBOOK}. */
70+
/** Always set to {@link SignInMethod}.FACEBOOK. */
7171
static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK;
72-
/** Always set to {@link ProviderId.FACEBOOK}. */
72+
/** Always set to {@link ProviderId}.FACEBOOK. */
7373
static readonly PROVIDER_ID = ProviderId.FACEBOOK;
7474

7575
constructor() {

packages-exp/auth-exp/src/core/providers/github.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { OAuthCredential } from '../credentials/oauth';
2828
import { BaseOAuthProvider } from './oauth';
2929

3030
/**
31-
* Provider for generating an {@link OAuthCredential} for {@link ProviderId.GITHUB}.
31+
* Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GITHUB.
3232
*
3333
* @remarks
3434
* GitHub requires an OAuth 2.0 redirect, so you can either handle the redirect directly, or use
@@ -70,9 +70,9 @@ import { BaseOAuthProvider } from './oauth';
7070
* @public
7171
*/
7272
export class GithubAuthProvider extends BaseOAuthProvider {
73-
/** Always set to {@link SignInMethod.GITHUB}. */
73+
/** Always set to {@link SignInMethod}.GITHUB. */
7474
static readonly GITHUB_SIGN_IN_METHOD = SignInMethod.GITHUB;
75-
/** Always set to {@link ProviderId.GITHUB}. */
75+
/** Always set to {@link ProviderId}.GITHUB. */
7676
static readonly PROVIDER_ID = ProviderId.GITHUB;
7777

7878
constructor() {

packages-exp/auth-exp/src/core/providers/google.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { OAuthCredential } from '../credentials/oauth';
2929
import { BaseOAuthProvider } from './oauth';
3030

3131
/**
32-
* Provider for generating an an {@link OAuthCredential} for {@link ProviderId.GOOGLE}.
32+
* Provider for generating an an {@link OAuthCredential} for {@link ProviderId}.GOOGLE.
3333
*
3434
* @example
3535
* ```javascript
@@ -70,9 +70,9 @@ import { BaseOAuthProvider } from './oauth';
7070
* @public
7171
*/
7272
export class GoogleAuthProvider extends BaseOAuthProvider {
73-
/** Always set to {@link SignInMethod.GOOGLE}. */
73+
/** Always set to {@link SignInMethod}.GOOGLE. */
7474
static readonly GOOGLE_SIGN_IN_METHOD = SignInMethod.GOOGLE;
75-
/** Always set to {@link ProviderId.GOOGLE}. */
75+
/** Always set to {@link ProviderId}.GOOGLE. */
7676
static readonly PROVIDER_ID = ProviderId.GOOGLE;
7777

7878
constructor() {
@@ -136,10 +136,8 @@ export class GoogleAuthProvider extends BaseOAuthProvider {
136136
return null;
137137
}
138138

139-
const {
140-
oauthIdToken,
141-
oauthAccessToken
142-
} = tokenResponse as SignInWithIdpResponse;
139+
const { oauthIdToken, oauthAccessToken } =
140+
tokenResponse as SignInWithIdpResponse;
143141
if (!oauthIdToken && !oauthAccessToken) {
144142
// This could be an oauth 1 credential or a phone credential
145143
return null;

packages-exp/auth-exp/src/core/providers/twitter.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { OAuthCredential } from '../credentials/oauth';
4646
import { BaseOAuthProvider } from './oauth';
4747

4848
/**
49-
* Provider for generating an {@link OAuthCredential} for {@link ProviderId.TWITTER}.
49+
* Provider for generating an {@link OAuthCredential} for {@link ProviderId}.TWITTER.
5050
*
5151
* @example
5252
* ```javascript
@@ -85,9 +85,9 @@ import { BaseOAuthProvider } from './oauth';
8585
* @public
8686
*/
8787
export class TwitterAuthProvider extends BaseOAuthProvider {
88-
/** Always set to {@link SignInMethod.TWITTER}. */
88+
/** Always set to {@link SignInMethod}.TWITTER. */
8989
static readonly TWITTER_SIGN_IN_METHOD = SignInMethod.TWITTER;
90-
/** Always set to {@link ProviderId.TWITTER}. */
90+
/** Always set to {@link ProviderId}.TWITTER. */
9191
static readonly PROVIDER_ID = ProviderId.TWITTER;
9292

9393
constructor() {
@@ -140,10 +140,8 @@ export class TwitterAuthProvider extends BaseOAuthProvider {
140140
if (!tokenResponse) {
141141
return null;
142142
}
143-
const {
144-
oauthAccessToken,
145-
oauthTokenSecret
146-
} = tokenResponse as SignInWithIdpResponse;
143+
const { oauthAccessToken, oauthTokenSecret } =
144+
tokenResponse as SignInWithIdpResponse;
147145
if (!oauthAccessToken || !oauthTokenSecret) {
148146
return null;
149147
}

packages-exp/auth-exp/src/core/strategies/email.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import { getModularInstance } from '@firebase/util';
3838
* @remarks
3939
* This is useful to differentiate methods of sign-in for the same provider, eg.
4040
* {@link EmailAuthProvider} which has 2 methods of sign-in,
41-
* {@link SignInMethod.EMAIL_PASSWORD} and
42-
* {@link SignInMethod.EMAIL_LINK} .
41+
* {@link SignInMethod}.EMAIL_PASSWORD and
42+
* {@link SignInMethod}.EMAIL_LINK.
4343
*
4444
* @param auth - The Auth instance.
4545
* @param email - The user's email address.

packages-exp/auth-exp/src/model/public_types.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export interface AuthError extends FirebaseError {
177177
* The tenant ID being used for sign-in/linking.
178178
*
179179
* @remarks
180-
* If you use {@link @firebase/auth#signInWithRedirect} to sign in,
180+
* If you use {@link signInWithRedirect} to sign in,
181181
* you have to set the tenant ID on {@link Auth} instance again as the tenant ID is not persisted
182182
* after redirection.
183183
*/
@@ -401,7 +401,7 @@ export interface IdTokenResult {
401401
}
402402

403403
/**
404-
* A response from {@link @firebase/auth#checkActionCode}.
404+
* A response from {@link checkActionCode}.
405405
*
406406
* @public
407407
*/
@@ -410,21 +410,21 @@ export interface ActionCodeInfo {
410410
* The data associated with the action code.
411411
*
412412
* @remarks
413-
* For the {@link ActionCodeOperation.PASSWORD_RESET}, {@link ActionCodeOperation.VERIFY_EMAIL}, and
414-
* {@link ActionCodeOperation.RECOVER_EMAIL} actions, this object contains an email field with the address
413+
* For the {@link ActionCodeOperation}.PASSWORD_RESET, {@link ActionCodeOperation}.VERIFY_EMAIL, and
414+
* {@link ActionCodeOperation}.RECOVER_EMAIL actions, this object contains an email field with the address
415415
* the email was sent to.
416416
*
417-
* For the {@link ActionCodeOperation.RECOVER_EMAIL} action, which allows a user to undo an email address
417+
* For the {@link ActionCodeOperation}.RECOVER_EMAIL action, which allows a user to undo an email address
418418
* change, this object also contains a `previousEmail` field with the user account's current
419419
* email address. After the action completes, the user's email address will revert to the value
420420
* in the `email` field from the value in `previousEmail` field.
421421
*
422-
* For the {@link ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL} action, which allows a user to verify the
422+
* For the {@link ActionCodeOperation}.VERIFY_AND_CHANGE_EMAIL action, which allows a user to verify the
423423
* email before updating it, this object contains a `previousEmail` field with the user account's
424424
* email address before updating. After the action completes, the user's email address will be
425425
* updated to the value in the `email` field from the value in `previousEmail` field.
426426
*
427-
* For the {@link ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION} action, which allows a user to
427+
* For the {@link ActionCodeOperation}.REVERT_SECOND_FACTOR_ADDITION action, which allows a user to
428428
* unenroll a newly added second factor, this object contains a `multiFactorInfo` field with
429429
* the information about the second factor. For phone second factor, the `multiFactorInfo`
430430
* is a {@link MultiFactorInfo} object, which contains the phone number.
@@ -530,7 +530,7 @@ export interface ActionCodeSettings {
530530
* A verifier for domain verification and abuse prevention.
531531
*
532532
* @remarks
533-
* Currently, the only implementation is {@link @firebase/auth#RecaptchaVerifier}.
533+
* Currently, the only implementation is {@link RecaptchaVerifier}.
534534
*
535535
* @public
536536
*/
@@ -951,7 +951,7 @@ export interface User extends UserInfo {
951951
*/
952952
readonly emailVerified: boolean;
953953
/**
954-
* Whether the user is authenticated using the {@link ProviderId.ANONYMOUS} provider.
954+
* Whether the user is authenticated using the {@link ProviderId}.ANONYMOUS provider.
955955
*/
956956
readonly isAnonymous: boolean;
957957
/**
@@ -992,7 +992,7 @@ export interface User extends UserInfo {
992992
* @remarks
993993
* Important: this is a security-sensitive operation that requires the user to have recently
994994
* signed in. If this requirement isn't met, ask the user to authenticate again and then call
995-
* one of the reauthentication methods like {@link @firebase/auth#reauthenticateWithCredential}.
995+
* one of the reauthentication methods like {@link reauthenticateWithCredential}.
996996
*/
997997
delete(): Promise<void>;
998998
/**
@@ -1032,8 +1032,8 @@ export interface User extends UserInfo {
10321032
* and any additional user information that was returned from the identity provider.
10331033
*
10341034
* @remarks
1035-
* `operationType` could be {@link OperationType.SIGN_IN} for a sign-in operation,
1036-
* {@link OperationType.LINK} for a linking operation and {@link OperationType.REAUTHENTICATE} for
1035+
* `operationType` could be {@link OperationType}.SIGN_IN for a sign-in operation,
1036+
* {@link OperationType}.LINK for a linking operation and {@link OperationType}.REAUTHENTICATE for
10371037
* a reauthentication operation.
10381038
*
10391039
* @public
@@ -1133,8 +1133,8 @@ export interface AdditionalUserInfo {
11331133
export type UserProfile = Record<string, unknown>;
11341134

11351135
/**
1136-
* A resolver used for handling DOM specific operations like {@link @firebase/auth#signInWithPopup}
1137-
* or {@link @firebase/auth#signInWithRedirect}.
1136+
* A resolver used for handling DOM specific operations like {@link signInWithPopup}
1137+
* or {@link signInWithRedirect}.
11381138
*
11391139
* @public
11401140
*/

packages-exp/auth-exp/src/platform_browser/providers/phone.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ import { TaggedWithTokenResponse } from '../../model/id_token';
5252
* @public
5353
*/
5454
export class PhoneAuthProvider {
55-
/** Always set to {@link ProviderId.PHONE}. */
55+
/** Always set to {@link ProviderId}.PHONE. */
5656
static readonly PROVIDER_ID = ProviderId.PHONE;
57-
/** Always set to {@link SignInMethod.PHONE}. */
57+
/** Always set to {@link SignInMethod}.PHONE. */
5858
static readonly PHONE_SIGN_IN_METHOD = SignInMethod.PHONE;
5959

60-
/** Always set to {@link ProviderId.PHONE}. */
60+
/** Always set to {@link ProviderId}.PHONE. */
6161
readonly providerId = PhoneAuthProvider.PROVIDER_ID;
6262
private readonly auth: AuthInternal;
6363

@@ -203,10 +203,8 @@ export class PhoneAuthProvider {
203203
if (!tokenResponse) {
204204
return null;
205205
}
206-
const {
207-
phoneNumber,
208-
temporaryProof
209-
} = tokenResponse as SignInWithPhoneNumberResponse;
206+
const { phoneNumber, temporaryProof } =
207+
tokenResponse as SignInWithPhoneNumberResponse;
210208
if (phoneNumber && temporaryProof) {
211209
return PhoneAuthCredential._fromTokenResponse(
212210
phoneNumber,

0 commit comments

Comments
 (0)