Skip to content

Commit 94dd7c3

Browse files
authored
chore: Enabled tsdoc error checking (#1459)
* chore: Enabled tsdoc error checking * fix: Fixing a lint error * fix: Minor internal doc comment updates * fix: Updating doc comment
1 parent 83fbb6d commit 94dd7c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+523
-526
lines changed

Diff for: api-extractor.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
},
3535

3636
"ae-unresolved-link": {
37-
"logLevel": "none"
37+
"logLevel": "error"
3838
}
3939
},
4040
"tsdocMessageReporting": {
4141
"default": {
42-
"logLevel": "none"
42+
"logLevel": "error"
4343
}
4444
}
4545
}

Diff for: src/app-check/app-check-api-client-internal.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export class AppCheckApiClient {
5353
/**
5454
* Exchange a signed custom token to App Check token
5555
*
56-
* @param customToken The custom token to be exchanged.
57-
* @param appId The mobile App ID.
56+
* @param customToken - The custom token to be exchanged.
57+
* @param appId - The mobile App ID.
5858
* @returns A promise that fulfills with a `AppCheckToken`.
5959
*/
6060
public exchangeToken(customToken: string, appId: string): Promise<AppCheckToken> {
@@ -140,7 +140,7 @@ export class AppCheckApiClient {
140140
/**
141141
* Creates an AppCheckToken from the API response.
142142
*
143-
* @param resp API response object.
143+
* @param resp - API response object.
144144
* @returns An AppCheckToken instance.
145145
*/
146146
private toAppCheckToken(resp: HttpResponse): AppCheckToken {
@@ -157,7 +157,7 @@ export class AppCheckApiClient {
157157
/**
158158
* Converts a duration string with the suffix `s` to milliseconds.
159159
*
160-
* @param duration The duration as a string with the suffix "s" preceded by the
160+
* @param duration - The duration as a string with the suffix "s" preceded by the
161161
* number of seconds, with fractional seconds. For example, 3 seconds with 0 nanoseconds
162162
* is expressed as "3s", while 3 seconds and 1 nanosecond is expressed as "3.000000001s",
163163
* and 3 seconds and 1 microsecond is expressed as "3.000001s".
@@ -209,8 +209,8 @@ export type AppCheckErrorCode =
209209
/**
210210
* Firebase App Check error code structure. This extends PrefixedFirebaseError.
211211
*
212-
* @param code The error code.
213-
* @param message The error message.
212+
* @param code - The error code.
213+
* @param message - The error message.
214214
* @constructor
215215
*/
216216
export class FirebaseAppCheckError extends PrefixedFirebaseError {

Diff for: src/app-check/app-check-namespace.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { AppCheck as TAppCheck } from './app-check';
4242
* var otherAppCheck = admin.appCheck(otherApp);
4343
* ```
4444
*
45-
* @param app Optional app for which to return the `AppCheck` service.
45+
* @param app - Optional app for which to return the `AppCheck` service.
4646
* If not provided, the default `AppCheck` service is returned.
4747
*
4848
* @returns The default `AppCheck` service if no

Diff for: src/app-check/app-check.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class AppCheck {
3939
private readonly appCheckTokenVerifier: AppCheckTokenVerifier;
4040

4141
/**
42-
* @param app The app for this AppCheck service.
42+
* @param app - The app for this AppCheck service.
4343
* @constructor
4444
* @internal
4545
*/
@@ -54,11 +54,11 @@ export class AppCheck {
5454
}
5555

5656
/**
57-
* Creates a new {@link appCheck.AppCheckToken `AppCheckToken`} that can be sent
57+
* Creates a new {@link AppCheckToken} that can be sent
5858
* back to a client.
5959
*
60-
* @param appId The app ID to use as the JWT app_id.
61-
* @param options Optional options object when creating a new App Check Token.
60+
* @param appId - The app ID to use as the JWT app_id.
61+
* @param options - Optional options object when creating a new App Check Token.
6262
*
6363
* @returns A promise that fulfills with a `AppCheckToken`.
6464
*/
@@ -74,7 +74,7 @@ export class AppCheck {
7474
* fulfilled with the token's decoded claims; otherwise, the promise is
7575
* rejected.
7676
*
77-
* @param appCheckToken The App Check token to verify.
77+
* @param appCheckToken - The App Check token to verify.
7878
*
7979
* @returns A promise fulfilled with the token's decoded claims
8080
* if the App Check token is valid; otherwise, a rejected promise.

Diff for: src/app-check/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export { AppCheck } from './app-check';
5252
* const otherAppCheck = getAppCheck(otherApp);
5353
* ```
5454
*
55-
* @param app Optional app for which to return the `AppCheck` service.
55+
* @param app - Optional app for which to return the `AppCheck` service.
5656
* If not provided, the default `AppCheck` service is returned.
5757
*
5858
* @returns The default `AppCheck` service if no

Diff for: src/app-check/token-generator.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class AppCheckTokenGenerator {
4545
/**
4646
* The AppCheckTokenGenerator class constructor.
4747
*
48-
* @param signer The CryptoSigner instance for this token generator.
48+
* @param signer - The CryptoSigner instance for this token generator.
4949
* @constructor
5050
*/
5151
constructor(signer: CryptoSigner) {
@@ -60,7 +60,7 @@ export class AppCheckTokenGenerator {
6060
/**
6161
* Creates a new custom token that can be exchanged to an App Check token.
6262
*
63-
* @param appId The Application ID to use for the generated token.
63+
* @param appId - The Application ID to use for the generated token.
6464
*
6565
* @returns A Promise fulfilled with a custom token signed with a service account key
6666
* that can be exchanged to an App Check token.
@@ -110,7 +110,7 @@ export class AppCheckTokenGenerator {
110110
* Checks if a given `AppCheckTokenOptions` object is valid. If successful, returns an object with
111111
* custom properties.
112112
*
113-
* @param options An options object to be validated.
113+
* @param options - An options object to be validated.
114114
* @returns A custom object with ttl converted to protobuf Duration string format.
115115
*/
116116
private validateTokenOptions(options: AppCheckTokenOptions): {[key: string]: any} {
@@ -137,10 +137,10 @@ export class AppCheckTokenGenerator {
137137
}
138138

139139
/**
140-
* Creates a new FirebaseAppCheckError by extracting the error code, message and other relevant
141-
* details from a CryptoSignerError.
140+
* Creates a new `FirebaseAppCheckError` by extracting the error code, message and other relevant
141+
* details from a `CryptoSignerError`.
142142
*
143-
* @param err The Error to convert into a FirebaseAppCheckError error
143+
* @param err - The Error to convert into a `FirebaseAppCheckError` error
144144
* @returns A Firebase App Check error that can be returned to the user.
145145
*/
146146
export function appCheckErrorFromCryptoSignerError(err: Error): Error {

Diff for: src/app-check/token-verifier.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class AppCheckTokenVerifier {
4343
/**
4444
* Verifies the format and signature of a Firebase App Check token.
4545
*
46-
* @param token The Firebase Auth JWT token to verify.
46+
* @param token - The Firebase Auth JWT token to verify.
4747
* @returns A promise fulfilled with the decoded claims of the Firebase App Check token.
4848
*/
4949
public verifyToken(token: string): Promise<DecodedAppCheckToken> {
@@ -101,8 +101,8 @@ export class AppCheckTokenVerifier {
101101
/**
102102
* Verifies the content of a Firebase App Check JWT.
103103
*
104-
* @param fullDecodedToken The decoded JWT.
105-
* @param projectId The Firebase Project Id.
104+
* @param fullDecodedToken - The decoded JWT.
105+
* @param projectId - The Firebase Project Id.
106106
*/
107107
private verifyContent(fullDecodedToken: DecodedToken, projectId: string | null): void {
108108
const header = fullDecodedToken.header;
@@ -142,7 +142,7 @@ export class AppCheckTokenVerifier {
142142
/**
143143
* Maps JwtError to FirebaseAppCheckError
144144
*
145-
* @param error JwtError to be mapped.
145+
* @param error - JwtError to be mapped.
146146
* @returns FirebaseAppCheckError instance.
147147
*/
148148
private mapJwtErrorToAppCheckError(error: JwtError): FirebaseAppCheckError {

Diff for: src/app/core.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { Credential } from './credential';
2525
export interface AppOptions {
2626

2727
/**
28-
* A {@link Credential `Credential`} object used to
28+
* A {@link firebase-admin.app#Credential} object used to
2929
* authenticate the Admin SDK.
3030
*
3131
* See {@link https://firebase.google.com/docs/admin/setup#initialize_the_sdk | Initialize the SDK}
@@ -155,9 +155,8 @@ export interface FirebaseError {
155155
* A string value containing the execution backtrace when the error originally
156156
* occurred.
157157
*
158-
* This information can be useful to you and can be sent to
159-
* {@link https://firebase.google.com/support/ Firebase Support} to help
160-
* explain the cause of an error.
158+
* This information can be useful for troubleshooting the cause of the error with
159+
* {@link https://firebase.google.com/support | Firebase Support}.
161160
*/
162161
stack?: string;
163162

Diff for: src/app/credential-factory.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const globalRefreshTokenCreds: { [key: string]: RefreshTokenCredential } = {};
4848
* });
4949
* ```
5050
*
51-
* @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
51+
* @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
5252
* to be used when retrieving access tokens from Google token servers.
5353
*
5454
* @returns A credential authenticated via Google
@@ -93,9 +93,9 @@ export function applicationDefault(httpAgent?: Agent): Credential {
9393
* });
9494
* ```
9595
*
96-
* @param serviceAccountPathOrObject The path to a service
96+
* @param serviceAccountPathOrObject - The path to a service
9797
* account key JSON file or an object representing a service account key.
98-
* @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
98+
* @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
9999
* to be used when retrieving access tokens from Google token servers.
100100
*
101101
* @returns A credential authenticated via the
@@ -129,10 +129,10 @@ export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAg
129129
* });
130130
* ```
131131
*
132-
* @param refreshTokenPathOrObject The path to a Google
132+
* @param refreshTokenPathOrObject - The path to a Google
133133
* OAuth2 refresh token JSON file or an object representing a Google OAuth2
134134
* refresh token.
135-
* @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
135+
* @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent}
136136
* to be used when retrieving access tokens from Google token servers.
137137
*
138138
* @returns A credential authenticated via the

Diff for: src/app/credential-internal.ts

+13-12
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export class ServiceAccountCredential implements Credential {
6868
/**
6969
* Creates a new ServiceAccountCredential from the given parameters.
7070
*
71-
* @param serviceAccountPathOrObject Service account json object or path to a service account json file.
72-
* @param httpAgent Optional http.Agent to use when calling the remote token server.
73-
* @param implicit An optinal boolean indicating whether this credential was implicitly discovered from the
71+
* @param serviceAccountPathOrObject - Service account json object or path to a service account json file.
72+
* @param httpAgent - Optional http.Agent to use when calling the remote token server.
73+
* @param implicit - An optinal boolean indicating whether this credential was implicitly discovered from the
7474
* environment, as opposed to being explicitly specified by the developer.
7575
*
7676
* @constructor
@@ -248,10 +248,11 @@ export class RefreshTokenCredential implements Credential {
248248
/**
249249
* Creates a new RefreshTokenCredential from the given parameters.
250250
*
251-
* @param refreshTokenPathOrObject Refresh token json object or path to a refresh token (user credentials) json file.
252-
* @param httpAgent Optional http.Agent to use when calling the remote token server.
253-
* @param implicit An optinal boolean indicating whether this credential was implicitly discovered from the
254-
* environment, as opposed to being explicitly specified by the developer.
251+
* @param refreshTokenPathOrObject - Refresh token json object or path to a refresh token
252+
* (user credentials) json file.
253+
* @param httpAgent - Optional http.Agent to use when calling the remote token server.
254+
* @param implicit - An optinal boolean indicating whether this credential was implicitly
255+
* discovered from the environment, as opposed to being explicitly specified by the developer.
255256
*
256257
* @constructor
257258
*/
@@ -338,7 +339,7 @@ class RefreshToken {
338339
* instances that were loaded from well-known files or environment variables, rather than being explicitly
339340
* instantiated.
340341
*
341-
* @param credential The credential instance to check.
342+
* @param credential - The credential instance to check.
342343
*/
343344
export function isApplicationDefault(credential?: Credential): boolean {
344345
return credential instanceof ComputeEngineCredential ||
@@ -368,10 +369,10 @@ export function getApplicationDefault(httpAgent?: Agent): Credential {
368369
* If no property exists by the given "key", looks for a property identified by "alt", and copies it instead.
369370
* This can be used to implement behaviors such as "copy property myKey or my_key".
370371
*
371-
* @param to Target object to copy the property into.
372-
* @param from Source object to copy the property from.
373-
* @param key Name of the property to copy.
374-
* @param alt Alternative name of the property to copy.
372+
* @param to - Target object to copy the property into.
373+
* @param from - Source object to copy the property from.
374+
* @param key - Name of the property to copy.
375+
* @param alt - Alternative name of the property to copy.
375376
*/
376377
function copyAttr(to: {[key: string]: any}, from: {[key: string]: any}, key: string, alt: string): void {
377378
const tmp = from[key] || from[alt];

Diff for: src/app/credential.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ export interface GoogleOAuthAccessToken {
3434
* with Firebase services.
3535
*
3636
* In most cases, you will not need to implement this yourself and can instead
37-
* use the default implementations provided by
38-
* {@link credential `admin.credential`}.
37+
* use the default implementations provided by the `firebase-admin/app` module.
3938
*/
4039
export interface Credential {
4140
/**

Diff for: src/app/firebase-app.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class FirebaseAppInternals {
117117
/**
118118
* Adds a listener that is called each time a token changes.
119119
*
120-
* @param listener The listener that will be called with each new token.
120+
* @param listener - The listener that will be called with each new token.
121121
*/
122122
public addAuthTokenListener(listener: (token: string) => void): void {
123123
this.tokenListeners_.push(listener);
@@ -129,7 +129,7 @@ export class FirebaseAppInternals {
129129
/**
130130
* Removes a token listener.
131131
*
132-
* @param listener The listener to remove.
132+
* @param listener - The listener to remove.
133133
*/
134134
public removeAuthTokenListener(listener: (token: string) => void): void {
135135
this.tokenListeners_ = this.tokenListeners_.filter((other) => other !== listener);

Diff for: src/app/firebase-namespace.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ export class FirebaseNamespaceInternals {
5353
/**
5454
* Initializes the App instance.
5555
*
56-
* @param options Optional options for the App instance. If none present will try to initialize
56+
* @param options - Optional options for the App instance. If none present will try to initialize
5757
* from the FIREBASE_CONFIG environment variable. If the environment variable contains a string
5858
* that starts with '{' it will be parsed as JSON, otherwise it will be assumed to be pointing
5959
* to a file.
60-
* @param appName Optional name of the FirebaseApp instance.
60+
* @param appName - Optional name of the FirebaseApp instance.
6161
*
6262
* @returns A new App instance.
6363
*/
@@ -70,7 +70,7 @@ export class FirebaseNamespaceInternals {
7070
* Returns the App instance with the provided name (or the default App instance
7171
* if no name is provided).
7272
*
73-
* @param appName Optional name of the FirebaseApp instance to return.
73+
* @param appName - Optional name of the FirebaseApp instance to return.
7474
* @returns The App instance which has the provided name.
7575
*/
7676
public app(appName?: string): App {
@@ -284,11 +284,11 @@ export class FirebaseNamespace {
284284
/**
285285
* Initializes the FirebaseApp instance.
286286
*
287-
* @param options Optional options for the FirebaseApp instance.
287+
* @param options - Optional options for the FirebaseApp instance.
288288
* If none present will try to initialize from the FIREBASE_CONFIG environment variable.
289289
* If the environment variable contains a string that starts with '{' it will be parsed as JSON,
290290
* otherwise it will be assumed to be pointing to a file.
291-
* @param appName Optional name of the FirebaseApp instance.
291+
* @param appName - Optional name of the FirebaseApp instance.
292292
*
293293
* @returns A new FirebaseApp instance.
294294
*/
@@ -300,7 +300,7 @@ export class FirebaseNamespace {
300300
* Returns the FirebaseApp instance with the provided name (or the default FirebaseApp instance
301301
* if no name is provided).
302302
*
303-
* @param appName Optional name of the FirebaseApp instance to return.
303+
* @param appName - Optional name of the FirebaseApp instance to return.
304304
* @returns The FirebaseApp instance which has the provided name.
305305
*/
306306
public app(appName?: string): App {

0 commit comments

Comments
 (0)