From 793009b37dee5cedd392f88feea7177923ca600c Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Fri, 1 Oct 2021 17:30:15 -0700 Subject: [PATCH 1/4] chore: Enabled tsdoc error checking --- api-extractor.json | 4 +- .../app-check-api-client-internal.ts | 12 +- src/app-check/app-check-namespace.ts | 2 +- src/app-check/app-check.ts | 10 +- src/app-check/index.ts | 2 +- src/app-check/token-generator.ts | 8 +- src/app-check/token-verifier.ts | 8 +- src/app/core.ts | 4 +- src/app/credential-factory.ts | 10 +- src/app/credential-internal.ts | 22 +-- src/app/credential.ts | 3 +- src/app/firebase-app.ts | 4 +- src/app/firebase-namespace.ts | 12 +- src/auth/auth-api-request.ts | 132 +++++++++--------- src/auth/auth-config.ts | 56 ++++---- src/auth/auth-namespace.ts | 6 +- src/auth/auth.ts | 2 +- src/auth/base-auth.ts | 92 ++++++------ src/auth/index.ts | 6 +- src/auth/tenant-manager.ts | 22 +-- src/auth/tenant.ts | 12 +- src/auth/token-generator.ts | 10 +- src/auth/token-verifier.ts | 20 +-- src/auth/user-import-builder.ts | 10 +- src/auth/user-record.ts | 22 +-- src/credential/index.ts | 13 +- src/database/database-namespace.ts | 2 +- src/database/database.ts | 2 +- src/database/index.ts | 4 +- src/firebase-namespace-api.ts | 9 +- src/firestore/index.ts | 2 +- src/installations/index.ts | 2 +- src/installations/installations-namespace.ts | 8 +- .../installations-request-handler.ts | 4 +- src/installations/installations.ts | 4 +- src/instance-id/index.ts | 4 +- src/instance-id/instance-id-namespace.ts | 2 +- src/instance-id/instance-id.ts | 6 +- src/machine-learning/index.ts | 4 +- .../machine-learning-api-client.ts | 6 +- .../machine-learning-namespace.ts | 2 +- src/machine-learning/machine-learning.ts | 22 +-- src/messaging/batch-request-internal.ts | 10 +- src/messaging/index.ts | 2 +- .../messaging-api-request-internal.ts | 10 +- src/messaging/messaging-api.ts | 2 +- src/messaging/messaging-errors-internal.ts | 6 +- src/messaging/messaging-internal.ts | 2 +- src/messaging/messaging-namespace.ts | 2 +- src/messaging/messaging.ts | 90 ++++++------ src/project-management/android-app.ts | 10 +- src/project-management/index.ts | 2 +- src/project-management/ios-app.ts | 2 +- ...project-management-api-request-internal.ts | 24 ++-- .../project-management-namespace.ts | 2 +- src/project-management/project-management.ts | 18 +-- src/remote-config/index.ts | 2 +- src/remote-config/remote-config-namespace.ts | 2 +- src/remote-config/remote-config.ts | 16 +-- src/security-rules/index.ts | 4 +- .../security-rules-namespace.ts | 54 +++---- src/security-rules/security-rules.ts | 30 ++-- src/storage/storage.ts | 6 +- src/utils/api-request.ts | 26 ++-- src/utils/crypto-signer.ts | 8 +- src/utils/deep-copy.ts | 6 +- src/utils/error.ts | 36 ++--- src/utils/index.ts | 30 ++-- src/utils/jwt.ts | 14 +- src/utils/validator.ts | 36 ++--- 70 files changed, 518 insertions(+), 521 deletions(-) diff --git a/api-extractor.json b/api-extractor.json index 43ef780464..fede69a665 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -34,12 +34,12 @@ }, "ae-unresolved-link": { - "logLevel": "none" + "logLevel": "error" } }, "tsdocMessageReporting": { "default": { - "logLevel": "none" + "logLevel": "error" } } } diff --git a/src/app-check/app-check-api-client-internal.ts b/src/app-check/app-check-api-client-internal.ts index e7427f838a..e9ba97ab97 100644 --- a/src/app-check/app-check-api-client-internal.ts +++ b/src/app-check/app-check-api-client-internal.ts @@ -53,8 +53,8 @@ export class AppCheckApiClient { /** * Exchange a signed custom token to App Check token * - * @param customToken The custom token to be exchanged. - * @param appId The mobile App ID. + * @param customToken - The custom token to be exchanged. + * @param appId - The mobile App ID. * @returns A promise that fulfills with a `AppCheckToken`. */ public exchangeToken(customToken: string, appId: string): Promise { @@ -140,7 +140,7 @@ export class AppCheckApiClient { /** * Creates an AppCheckToken from the API response. * - * @param resp API response object. + * @param resp - API response object. * @returns An AppCheckToken instance. */ private toAppCheckToken(resp: HttpResponse): AppCheckToken { @@ -157,7 +157,7 @@ export class AppCheckApiClient { /** * Converts a duration string with the suffix `s` to milliseconds. * - * @param duration The duration as a string with the suffix "s" preceded by the + * @param duration - The duration as a string with the suffix "s" preceded by the * number of seconds, with fractional seconds. For example, 3 seconds with 0 nanoseconds * is expressed as "3s", while 3 seconds and 1 nanosecond is expressed as "3.000000001s", * and 3 seconds and 1 microsecond is expressed as "3.000001s". @@ -209,8 +209,8 @@ export type AppCheckErrorCode = /** * Firebase App Check error code structure. This extends PrefixedFirebaseError. * - * @param code The error code. - * @param message The error message. + * @param code - The error code. + * @param message - The error message. * @constructor */ export class FirebaseAppCheckError extends PrefixedFirebaseError { diff --git a/src/app-check/app-check-namespace.ts b/src/app-check/app-check-namespace.ts index 128cedd474..070fb7a751 100644 --- a/src/app-check/app-check-namespace.ts +++ b/src/app-check/app-check-namespace.ts @@ -42,7 +42,7 @@ import { AppCheck as TAppCheck } from './app-check'; * var otherAppCheck = admin.appCheck(otherApp); * ``` * - * @param app Optional app for which to return the `AppCheck` service. + * @param app - Optional app for which to return the `AppCheck` service. * If not provided, the default `AppCheck` service is returned. * * @returns The default `AppCheck` service if no diff --git a/src/app-check/app-check.ts b/src/app-check/app-check.ts index 97fc24f933..0785fd6621 100644 --- a/src/app-check/app-check.ts +++ b/src/app-check/app-check.ts @@ -39,7 +39,7 @@ export class AppCheck { private readonly appCheckTokenVerifier: AppCheckTokenVerifier; /** - * @param app The app for this AppCheck service. + * @param app - The app for this AppCheck service. * @constructor * @internal */ @@ -54,11 +54,11 @@ export class AppCheck { } /** - * Creates a new {@link appCheck.AppCheckToken `AppCheckToken`} that can be sent + * Creates a new {@link AppCheckToken} that can be sent * back to a client. * - * @param appId The app ID to use as the JWT app_id. - * @param options Optional options object when creating a new App Check Token. + * @param appId - The app ID to use as the JWT app_id. + * @param options - Optional options object when creating a new App Check Token. * * @returns A promise that fulfills with a `AppCheckToken`. */ @@ -74,7 +74,7 @@ export class AppCheck { * fulfilled with the token's decoded claims; otherwise, the promise is * rejected. * - * @param appCheckToken The App Check token to verify. + * @param appCheckToken - The App Check token to verify. * * @returns A promise fulfilled with the token's decoded claims * if the App Check token is valid; otherwise, a rejected promise. diff --git a/src/app-check/index.ts b/src/app-check/index.ts index 3ff1ae302d..72f4d54b00 100644 --- a/src/app-check/index.ts +++ b/src/app-check/index.ts @@ -52,7 +52,7 @@ export { AppCheck } from './app-check'; * const otherAppCheck = getAppCheck(otherApp); * ``` * - * @param app Optional app for which to return the `AppCheck` service. + * @param app - Optional app for which to return the `AppCheck` service. * If not provided, the default `AppCheck` service is returned. * * @returns The default `AppCheck` service if no diff --git a/src/app-check/token-generator.ts b/src/app-check/token-generator.ts index adc6898786..50db1fa081 100644 --- a/src/app-check/token-generator.ts +++ b/src/app-check/token-generator.ts @@ -45,7 +45,7 @@ export class AppCheckTokenGenerator { /** * The AppCheckTokenGenerator class constructor. * - * @param signer The CryptoSigner instance for this token generator. + * @param signer - The CryptoSigner instance for this token generator. * @constructor */ constructor(signer: CryptoSigner) { @@ -60,7 +60,7 @@ export class AppCheckTokenGenerator { /** * Creates a new custom token that can be exchanged to an App Check token. * - * @param appId The Application ID to use for the generated token. + * @param appId - The Application ID to use for the generated token. * * @returns A Promise fulfilled with a custom token signed with a service account key * that can be exchanged to an App Check token. @@ -110,7 +110,7 @@ export class AppCheckTokenGenerator { * Checks if a given `AppCheckTokenOptions` object is valid. If successful, returns an object with * custom properties. * - * @param options An options object to be validated. + * @param options - An options object to be validated. * @returns A custom object with ttl converted to protobuf Duration string format. */ private validateTokenOptions(options: AppCheckTokenOptions): {[key: string]: any} { @@ -140,7 +140,7 @@ export class AppCheckTokenGenerator { * Creates a new FirebaseAppCheckError by extracting the error code, message and other relevant * details from a CryptoSignerError. * - * @param err The Error to convert into a FirebaseAppCheckError error + * @param err - The Error to convert into a FirebaseAppCheckError error * @returns A Firebase App Check error that can be returned to the user. */ export function appCheckErrorFromCryptoSignerError(err: Error): Error { diff --git a/src/app-check/token-verifier.ts b/src/app-check/token-verifier.ts index 661b805597..2a588dfd23 100644 --- a/src/app-check/token-verifier.ts +++ b/src/app-check/token-verifier.ts @@ -43,7 +43,7 @@ export class AppCheckTokenVerifier { /** * Verifies the format and signature of a Firebase App Check token. * - * @param token The Firebase Auth JWT token to verify. + * @param token - The Firebase Auth JWT token to verify. * @returns A promise fulfilled with the decoded claims of the Firebase App Check token. */ public verifyToken(token: string): Promise { @@ -101,8 +101,8 @@ export class AppCheckTokenVerifier { /** * Verifies the content of a Firebase App Check JWT. * - * @param fullDecodedToken The decoded JWT. - * @param projectId The Firebase Project Id. + * @param fullDecodedToken - The decoded JWT. + * @param projectId - The Firebase Project Id. */ private verifyContent(fullDecodedToken: DecodedToken, projectId: string | null): void { const header = fullDecodedToken.header; @@ -142,7 +142,7 @@ export class AppCheckTokenVerifier { /** * Maps JwtError to FirebaseAppCheckError * - * @param error JwtError to be mapped. + * @param error - JwtError to be mapped. * @returns FirebaseAppCheckError instance. */ private mapJwtErrorToAppCheckError(error: JwtError): FirebaseAppCheckError { diff --git a/src/app/core.ts b/src/app/core.ts index 9434ab6244..c703cd14c0 100644 --- a/src/app/core.ts +++ b/src/app/core.ts @@ -25,7 +25,7 @@ import { Credential } from './credential'; export interface AppOptions { /** - * A {@link Credential `Credential`} object used to + * A {@link firebase-admin.app#Credential} object used to * authenticate the Admin SDK. * * See {@link https://firebase.google.com/docs/admin/setup#initialize_the_sdk | Initialize the SDK} @@ -156,7 +156,7 @@ export interface FirebaseError { * occurred. * * This information can be useful to you and can be sent to - * {@link https://firebase.google.com/support/ Firebase Support} to help + * {@link https://firebase.google.com/support | Firebase Support} to help * explain the cause of an error. */ stack?: string; diff --git a/src/app/credential-factory.ts b/src/app/credential-factory.ts index 4ad5ea5cf9..9bb32a8869 100644 --- a/src/app/credential-factory.ts +++ b/src/app/credential-factory.ts @@ -48,7 +48,7 @@ const globalRefreshTokenCreds: { [key: string]: RefreshTokenCredential } = {}; * }); * ``` * - * @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} + * @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} * to be used when retrieving access tokens from Google token servers. * * @returns A credential authenticated via Google @@ -93,9 +93,9 @@ export function applicationDefault(httpAgent?: Agent): Credential { * }); * ``` * - * @param serviceAccountPathOrObject The path to a service + * @param serviceAccountPathOrObject - The path to a service * account key JSON file or an object representing a service account key. - * @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} + * @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} * to be used when retrieving access tokens from Google token servers. * * @returns A credential authenticated via the @@ -129,10 +129,10 @@ export function cert(serviceAccountPathOrObject: string | ServiceAccount, httpAg * }); * ``` * - * @param refreshTokenPathOrObject The path to a Google + * @param refreshTokenPathOrObject - The path to a Google * OAuth2 refresh token JSON file or an object representing a Google OAuth2 * refresh token. - * @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} + * @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} * to be used when retrieving access tokens from Google token servers. * * @returns A credential authenticated via the diff --git a/src/app/credential-internal.ts b/src/app/credential-internal.ts index 28dcf7f6b6..4d78f77c86 100644 --- a/src/app/credential-internal.ts +++ b/src/app/credential-internal.ts @@ -68,9 +68,9 @@ export class ServiceAccountCredential implements Credential { /** * Creates a new ServiceAccountCredential from the given parameters. * - * @param serviceAccountPathOrObject Service account json object or path to a service account json file. - * @param httpAgent Optional http.Agent to use when calling the remote token server. - * @param implicit An optinal boolean indicating whether this credential was implicitly discovered from the + * @param serviceAccountPathOrObject - Service account json object or path to a service account json file. + * @param httpAgent - Optional http.Agent to use when calling the remote token server. + * @param implicit - An optinal boolean indicating whether this credential was implicitly discovered from the * environment, as opposed to being explicitly specified by the developer. * * @constructor @@ -248,9 +248,9 @@ export class RefreshTokenCredential implements Credential { /** * Creates a new RefreshTokenCredential from the given parameters. * - * @param refreshTokenPathOrObject Refresh token json object or path to a refresh token (user credentials) json file. - * @param httpAgent Optional http.Agent to use when calling the remote token server. - * @param implicit An optinal boolean indicating whether this credential was implicitly discovered from the + * @param refreshTokenPathOrObject - Refresh token json object or path to a refresh token (user credentials) json file. + * @param httpAgent - Optional http.Agent to use when calling the remote token server. + * @param implicit - An optinal boolean indicating whether this credential was implicitly discovered from the * environment, as opposed to being explicitly specified by the developer. * * @constructor @@ -338,7 +338,7 @@ class RefreshToken { * instances that were loaded from well-known files or environment variables, rather than being explicitly * instantiated. * - * @param credential The credential instance to check. + * @param credential - The credential instance to check. */ export function isApplicationDefault(credential?: Credential): boolean { return credential instanceof ComputeEngineCredential || @@ -368,10 +368,10 @@ export function getApplicationDefault(httpAgent?: Agent): Credential { * If no property exists by the given "key", looks for a property identified by "alt", and copies it instead. * This can be used to implement behaviors such as "copy property myKey or my_key". * - * @param to Target object to copy the property into. - * @param from Source object to copy the property from. - * @param key Name of the property to copy. - * @param alt Alternative name of the property to copy. + * @param to - Target object to copy the property into. + * @param from - Source object to copy the property from. + * @param key - Name of the property to copy. + * @param alt - Alternative name of the property to copy. */ function copyAttr(to: {[key: string]: any}, from: {[key: string]: any}, key: string, alt: string): void { const tmp = from[key] || from[alt]; diff --git a/src/app/credential.ts b/src/app/credential.ts index 2453a97242..b5857903f8 100644 --- a/src/app/credential.ts +++ b/src/app/credential.ts @@ -34,8 +34,7 @@ export interface GoogleOAuthAccessToken { * with Firebase services. * * In most cases, you will not need to implement this yourself and can instead - * use the default implementations provided by - * {@link credential `admin.credential`}. + * use the default implementations provided by the `firebase-admin/app` module. */ export interface Credential { /** diff --git a/src/app/firebase-app.ts b/src/app/firebase-app.ts index 42ce2fd6dc..8763ef0dbf 100644 --- a/src/app/firebase-app.ts +++ b/src/app/firebase-app.ts @@ -117,7 +117,7 @@ export class FirebaseAppInternals { /** * Adds a listener that is called each time a token changes. * - * @param listener The listener that will be called with each new token. + * @param listener - The listener that will be called with each new token. */ public addAuthTokenListener(listener: (token: string) => void): void { this.tokenListeners_.push(listener); @@ -129,7 +129,7 @@ export class FirebaseAppInternals { /** * Removes a token listener. * - * @param listener The listener to remove. + * @param listener - The listener to remove. */ public removeAuthTokenListener(listener: (token: string) => void): void { this.tokenListeners_ = this.tokenListeners_.filter((other) => other !== listener); diff --git a/src/app/firebase-namespace.ts b/src/app/firebase-namespace.ts index 642d5ad23c..ef5e17f0eb 100644 --- a/src/app/firebase-namespace.ts +++ b/src/app/firebase-namespace.ts @@ -53,11 +53,11 @@ export class FirebaseNamespaceInternals { /** * Initializes the App instance. * - * @param options Optional options for the App instance. If none present will try to initialize + * @param options - Optional options for the App instance. If none present will try to initialize * from the FIREBASE_CONFIG environment variable. If the environment variable contains a string * that starts with '{' it will be parsed as JSON, otherwise it will be assumed to be pointing * to a file. - * @param appName Optional name of the FirebaseApp instance. + * @param appName - Optional name of the FirebaseApp instance. * * @returns A new App instance. */ @@ -70,7 +70,7 @@ export class FirebaseNamespaceInternals { * Returns the App instance with the provided name (or the default App instance * if no name is provided). * - * @param appName Optional name of the FirebaseApp instance to return. + * @param appName - Optional name of the FirebaseApp instance to return. * @returns The App instance which has the provided name. */ public app(appName?: string): App { @@ -284,11 +284,11 @@ export class FirebaseNamespace { /** * Initializes the FirebaseApp instance. * - * @param options Optional options for the FirebaseApp instance. + * @param options - Optional options for the FirebaseApp instance. * If none present will try to initialize from the FIREBASE_CONFIG environment variable. * If the environment variable contains a string that starts with '{' it will be parsed as JSON, * otherwise it will be assumed to be pointing to a file. - * @param appName Optional name of the FirebaseApp instance. + * @param appName - Optional name of the FirebaseApp instance. * * @returns A new FirebaseApp instance. */ @@ -300,7 +300,7 @@ export class FirebaseNamespace { * Returns the FirebaseApp instance with the provided name (or the default FirebaseApp instance * if no name is provided). * - * @param appName Optional name of the FirebaseApp instance to return. + * @param appName - Optional name of the FirebaseApp instance to return. * @returns The FirebaseApp instance which has the provided name. */ public app(appName?: string): App { diff --git a/src/auth/auth-api-request.ts b/src/auth/auth-api-request.ts index e331b648cc..7ea6916a42 100644 --- a/src/auth/auth-api-request.ts +++ b/src/auth/auth-api-request.ts @@ -126,8 +126,8 @@ class AuthResourceUrlBuilder { /** * The resource URL builder constructor. * - * @param projectId The resource project ID. - * @param version The endpoint API version. + * @param projectId - The resource project ID. + * @param version - The endpoint API version. * @constructor */ constructor(protected app: App, protected version: string = 'v1') { @@ -143,8 +143,8 @@ class AuthResourceUrlBuilder { /** * Returns the resource URL corresponding to the provided parameters. * - * @param api The backend API name. - * @param params The optional additional parameters to substitute in the + * @param api - The backend API name. + * @param params - The optional additional parameters to substitute in the * URL path. * @returns The corresponding resource URL. */ @@ -190,9 +190,9 @@ class TenantAwareAuthResourceUrlBuilder extends AuthResourceUrlBuilder { /** * The tenant aware resource URL builder constructor. * - * @param projectId The resource project ID. - * @param version The endpoint API version. - * @param tenantId The tenant ID. + * @param projectId - The resource project ID. + * @param version - The endpoint API version. + * @param tenantId - The tenant ID. * @constructor */ constructor(protected app: App, protected version: string, protected tenantId: string) { @@ -209,8 +209,8 @@ class TenantAwareAuthResourceUrlBuilder extends AuthResourceUrlBuilder { /** * Returns the resource URL corresponding to the provided parameters. * - * @param api The backend API name. - * @param params The optional additional parameters to substitute in the + * @param api - The backend API name. + * @param params - The optional additional parameters to substitute in the * URL path. * @returns The corresponding resource URL. */ @@ -243,7 +243,7 @@ class AuthHttpClient extends AuthorizedHttpClient { * are removed from the original request. If an invalid field is passed * an error is thrown. * - * @param request The AuthFactorInfo request object. + * @param request - The AuthFactorInfo request object. */ function validateAuthFactorInfo(request: AuthFactorInfo): void { const validKeys = { @@ -308,7 +308,7 @@ function validateAuthFactorInfo(request: AuthFactorInfo): void { * are removed from the original request. If an invalid field is passed * an error is thrown. * - * @param request The providerUserInfo request object. + * @param request - The providerUserInfo request object. */ function validateProviderUserInfo(request: any): void { const validKeys = { @@ -367,8 +367,8 @@ function validateProviderUserInfo(request: any): void { * are removed from the original request. If an invalid field is passed * an error is thrown. * - * @param request The create/edit request object. - * @param writeOperationType The write operation type. + * @param request - The create/edit request object. + * @param writeOperationType - The write operation type. */ function validateCreateEditRequest(request: any, writeOperationType: WriteOperationType): void { const uploadAccountRequest = writeOperationType === WriteOperationType.Upload; @@ -1012,7 +1012,7 @@ export abstract class AbstractAuthRequestHandler { private projectConfigUrlBuilder: AuthResourceUrlBuilder; /** - * @param response The response to check for errors. + * @param response - The response to check for errors. * @returns The error code if present; null otherwise. */ private static getErrorCode(response: any): string | null { @@ -1061,7 +1061,7 @@ export abstract class AbstractAuthRequestHandler { } /** - * @param app The app used to fetch access tokens to sign API requests. + * @param app - The app used to fetch access tokens to sign API requests. * @constructor */ constructor(protected readonly app: App) { @@ -1080,8 +1080,8 @@ export abstract class AbstractAuthRequestHandler { * session management (set as a server side session cookie with custom cookie policy). * The session cookie JWT will have the same payload claims as the provided ID token. * - * @param idToken The Firebase ID token to exchange for a session cookie. - * @param expiresIn The session cookie duration in milliseconds. + * @param idToken - The Firebase ID token to exchange for a session cookie. + * @param expiresIn - The session cookie duration in milliseconds. * * @returns A promise that resolves on success with the created session cookie. */ @@ -1098,7 +1098,7 @@ export abstract class AbstractAuthRequestHandler { /** * Looks up a user by uid. * - * @param uid The uid of the user to lookup. + * @param uid - The uid of the user to lookup. * @returns A promise that resolves with the user information. */ public getAccountInfoByUid(uid: string): Promise { @@ -1115,7 +1115,7 @@ export abstract class AbstractAuthRequestHandler { /** * Looks up a user by email. * - * @param email The email of the user to lookup. + * @param email - The email of the user to lookup. * @returns A promise that resolves with the user information. */ public getAccountInfoByEmail(email: string): Promise { @@ -1132,7 +1132,7 @@ export abstract class AbstractAuthRequestHandler { /** * Looks up a user by phone number. * - * @param phoneNumber The phone number of the user to lookup. + * @param phoneNumber - The phone number of the user to lookup. * @returns A promise that resolves with the user information. */ public getAccountInfoByPhoneNumber(phoneNumber: string): Promise { @@ -1164,9 +1164,9 @@ export abstract class AbstractAuthRequestHandler { /** * Looks up multiple users by their identifiers (uid, email, etc). * - * @param identifiers The identifiers indicating the users + * @param identifiers - The identifiers indicating the users * to be looked up. Must have <= 100 entries. - * @param A promise that resolves with the set of successfully + * @param A - promise that resolves with the set of successfully * looked up users. Possibly empty if no users were looked up. */ public getAccountInfoByIdentifiers(identifiers: UserIdentifier[]): Promise { @@ -1203,9 +1203,9 @@ export abstract class AbstractAuthRequestHandler { * Exports the users (single batch only) with a size of maxResults and starting from * the offset as specified by pageToken. * - * @param maxResults The page size, 1000 if undefined. This is also the maximum + * @param maxResults - The page size, 1000 if undefined. This is also the maximum * allowed limit. - * @param pageToken The next page token. If not specified, returns users starting + * @param pageToken - The next page token. If not specified, returns users starting * without any offset. Users are returned in the order they were created from oldest to * newest, relative to the page token offset. * @returns A promise that resolves with the current batch of downloaded @@ -1240,8 +1240,8 @@ export abstract class AbstractAuthRequestHandler { * At most, 1000 users are allowed to be imported one at a time. * When importing a list of password users, UserImportOptions are required to be specified. * - * @param users The list of user records to import to Firebase Auth. - * @param options The user import options, required when the users provided + * @param users - The list of user records to import to Firebase Auth. + * @param options - The user import options, required when the users provided * include password credentials. * @returns A promise that resolves when the operation completes * with the result of the import. This includes the number of successful imports, the number @@ -1282,7 +1282,7 @@ export abstract class AbstractAuthRequestHandler { /** * Deletes an account identified by a uid. * - * @param uid The uid of the user to delete. + * @param uid - The uid of the user to delete. * @returns A promise that resolves when the user is deleted. */ public deleteAccount(uid: string): Promise { @@ -1323,8 +1323,8 @@ export abstract class AbstractAuthRequestHandler { /** * Sets additional developer claims on an existing user identified by provided UID. * - * @param uid The user to edit. - * @param customUserClaims The developer claims to set. + * @param uid - The user to edit. + * @param customUserClaims - The developer claims to set. * @returns A promise that resolves when the operation completes * with the user id that was edited. */ @@ -1358,8 +1358,8 @@ export abstract class AbstractAuthRequestHandler { /** * Edits an existing user. * - * @param uid The user to edit. - * @param properties The properties to set on the user. + * @param uid - The user to edit. + * @param properties - The properties to set on the user. * @returns A promise that resolves when the operation completes * with the user id that was edited. */ @@ -1502,7 +1502,7 @@ export abstract class AbstractAuthRequestHandler { * the same second as the revocation will still be valid. If there is a chance that a token * was minted in the last second, delay for 1 second before revoking. * - * @param uid The user whose tokens are to be revoked. + * @param uid - The user whose tokens are to be revoked. * @returns A promise that resolves when the operation completes * successfully with the user id of the corresponding user. */ @@ -1525,7 +1525,7 @@ export abstract class AbstractAuthRequestHandler { /** * Create a new user with the properties supplied. * - * @param properties The properties to set on the user. + * @param properties - The properties to set on the user. * @returns A promise that resolves when the operation completes * with the user id that was created. */ @@ -1593,10 +1593,10 @@ export abstract class AbstractAuthRequestHandler { * Generates the out of band email action link for the email specified using the action code settings provided. * Returns a promise that resolves with the generated link. * - * @param requestType The request type. This could be either used for password reset, + * @param requestType - The request type. This could be either used for password reset, * email verification, email link sign-in. - * @param email The email of the user the link is being sent to. - * @param actionCodeSettings The optional action code setings which defines whether + * @param email - The email of the user the link is being sent to. + * @param actionCodeSettings - The optional action code setings which defines whether * the link is to be handled by a mobile app and the additional state information to be passed in the * deep link, etc. Required when requestType == 'EMAIL_SIGNIN' * @returns A promise that resolves with the email action link. @@ -1633,7 +1633,7 @@ export abstract class AbstractAuthRequestHandler { /** * Looks up an OIDC provider configuration by provider ID. * - * @param providerId The provider identifier of the configuration to lookup. + * @param providerId - The provider identifier of the configuration to lookup. * @returns A promise that resolves with the provider configuration information. */ public getOAuthIdpConfig(providerId: string): Promise { @@ -1647,9 +1647,9 @@ export abstract class AbstractAuthRequestHandler { * Lists the OIDC configurations (single batch only) with a size of maxResults and starting from * the offset as specified by pageToken. * - * @param maxResults The page size, 100 if undefined. This is also the maximum + * @param maxResults - The page size, 100 if undefined. This is also the maximum * allowed limit. - * @param pageToken The next page token. If not specified, returns OIDC configurations + * @param pageToken - The next page token. If not specified, returns OIDC configurations * without any offset. Configurations are returned in the order they were created from oldest to * newest, relative to the page token offset. * @returns A promise that resolves with the current batch of downloaded @@ -1679,7 +1679,7 @@ export abstract class AbstractAuthRequestHandler { /** * Deletes an OIDC configuration identified by a providerId. * - * @param providerId The identifier of the OIDC configuration to delete. + * @param providerId - The identifier of the OIDC configuration to delete. * @returns A promise that resolves when the OIDC provider is deleted. */ public deleteOAuthIdpConfig(providerId: string): Promise { @@ -1695,7 +1695,7 @@ export abstract class AbstractAuthRequestHandler { /** * Creates a new OIDC provider configuration with the properties provided. * - * @param options The properties to set on the new OIDC provider configuration to be created. + * @param options - The properties to set on the new OIDC provider configuration to be created. * @returns A promise that resolves with the newly created OIDC * configuration. */ @@ -1723,8 +1723,8 @@ export abstract class AbstractAuthRequestHandler { /** * Updates an existing OIDC provider configuration with the properties provided. * - * @param providerId The provider identifier of the OIDC configuration to update. - * @param options The properties to update on the existing configuration. + * @param providerId - The provider identifier of the OIDC configuration to update. + * @param options - The properties to update on the existing configuration. * @returns A promise that resolves with the modified provider * configuration. */ @@ -1756,7 +1756,7 @@ export abstract class AbstractAuthRequestHandler { /** * Looks up an SAML provider configuration by provider ID. * - * @param providerId The provider identifier of the configuration to lookup. + * @param providerId - The provider identifier of the configuration to lookup. * @returns A promise that resolves with the provider configuration information. */ public getInboundSamlConfig(providerId: string): Promise { @@ -1770,9 +1770,9 @@ export abstract class AbstractAuthRequestHandler { * Lists the SAML configurations (single batch only) with a size of maxResults and starting from * the offset as specified by pageToken. * - * @param maxResults The page size, 100 if undefined. This is also the maximum + * @param maxResults - The page size, 100 if undefined. This is also the maximum * allowed limit. - * @param pageToken The next page token. If not specified, returns SAML configurations starting + * @param pageToken - The next page token. If not specified, returns SAML configurations starting * without any offset. Configurations are returned in the order they were created from oldest to * newest, relative to the page token offset. * @returns A promise that resolves with the current batch of downloaded @@ -1802,7 +1802,7 @@ export abstract class AbstractAuthRequestHandler { /** * Deletes a SAML configuration identified by a providerId. * - * @param providerId The identifier of the SAML configuration to delete. + * @param providerId - The identifier of the SAML configuration to delete. * @returns A promise that resolves when the SAML provider is deleted. */ public deleteInboundSamlConfig(providerId: string): Promise { @@ -1818,7 +1818,7 @@ export abstract class AbstractAuthRequestHandler { /** * Creates a new SAML provider configuration with the properties provided. * - * @param options The properties to set on the new SAML provider configuration to be created. + * @param options - The properties to set on the new SAML provider configuration to be created. * @returns A promise that resolves with the newly created SAML * configuration. */ @@ -1846,8 +1846,8 @@ export abstract class AbstractAuthRequestHandler { /** * Updates an existing SAML provider configuration with the properties provided. * - * @param providerId The provider identifier of the SAML configuration to update. - * @param options The properties to update on the existing configuration. + * @param providerId - The provider identifier of the SAML configuration to update. + * @param options - The properties to update on the existing configuration. * @returns A promise that resolves with the modified provider * configuration. */ @@ -1879,10 +1879,10 @@ export abstract class AbstractAuthRequestHandler { /** * Invokes the request handler based on the API settings object passed. * - * @param urlBuilder The URL builder for Auth endpoints. - * @param apiSettings The API endpoint settings to apply to request and response. - * @param requestData The request data. - * @param additionalResourceParams Additional resource related params if needed. + * @param urlBuilder - The URL builder for Auth endpoints. + * @param apiSettings - The API endpoint settings to apply to request and response. + * @param requestData - The request data. + * @param additionalResourceParams - Additional resource related params if needed. * @returns A promise that resolves with the response. */ protected invokeRequestHandler( @@ -2038,7 +2038,7 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler { /** * The FirebaseAuthRequestHandler constructor used to initialize an instance using a FirebaseApp. * - * @param app The app used to fetch access tokens to sign API requests. + * @param app - The app used to fetch access tokens to sign API requests. * @constructor. */ constructor(app: App) { @@ -2063,7 +2063,7 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler { /** * Looks up a tenant by tenant ID. * - * @param tenantId The tenant identifier of the tenant to lookup. + * @param tenantId - The tenant identifier of the tenant to lookup. * @returns A promise that resolves with the tenant information. */ public getTenant(tenantId: string): Promise { @@ -2080,9 +2080,9 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler { * Exports the tenants (single batch only) with a size of maxResults and starting from * the offset as specified by pageToken. * - * @param maxResults The page size, 1000 if undefined. This is also the maximum + * @param maxResults - The page size, 1000 if undefined. This is also the maximum * allowed limit. - * @param pageToken The next page token. If not specified, returns tenants starting + * @param pageToken - The next page token. If not specified, returns tenants starting * without any offset. Tenants are returned in the order they were created from oldest to * newest, relative to the page token offset. * @returns A promise that resolves with the current batch of downloaded @@ -2113,7 +2113,7 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler { /** * Deletes a tenant identified by a tenantId. * - * @param tenantId The identifier of the tenant to delete. + * @param tenantId - The identifier of the tenant to delete. * @returns A promise that resolves when the tenant is deleted. */ public deleteTenant(tenantId: string): Promise { @@ -2129,7 +2129,7 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler { /** * Creates a new tenant with the properties provided. * - * @param tenantOptions The properties to set on the new tenant to be created. + * @param tenantOptions - The properties to set on the new tenant to be created. * @returns A promise that resolves with the newly created tenant object. */ public createTenant(tenantOptions: CreateTenantRequest): Promise { @@ -2148,8 +2148,8 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler { /** * Updates an existing tenant with the properties provided. * - * @param tenantId The tenant identifier of the tenant to update. - * @param tenantOptions The properties to update on the existing tenant. + * @param tenantId - The tenant identifier of the tenant to update. + * @param tenantOptions - The properties to update on the existing tenant. * @returns A promise that resolves with the modified tenant object. */ public updateTenant(tenantId: string, tenantOptions: UpdateTenantRequest): Promise { @@ -2183,8 +2183,8 @@ export class TenantAwareAuthRequestHandler extends AbstractAuthRequestHandler { * The FirebaseTenantRequestHandler constructor used to initialize an instance using a * FirebaseApp and a tenant ID. * - * @param app The app used to fetch access tokens to sign API requests. - * @param tenantId The request handler's tenant ID. + * @param app - The app used to fetch access tokens to sign API requests. + * @param tenantId - The request handler's tenant ID. * @constructor */ constructor(app: App, private readonly tenantId: string) { @@ -2214,8 +2214,8 @@ export class TenantAwareAuthRequestHandler extends AbstractAuthRequestHandler { * Overrides the superclass methods by adding an additional check to match tenant IDs of * imported user records if present. * - * @param users The list of user records to import to Firebase Auth. - * @param options The user import options, required when the users provided + * @param users - The list of user records to import to Firebase Auth. + * @param options - The user import options, required when the users provided * include password credentials. * @returns A promise that resolves when the operation completes * with the result of the import. This includes the number of successful imports, the number diff --git a/src/auth/auth-config.ts b/src/auth/auth-config.ts index 12909ffb40..ce45713f97 100644 --- a/src/auth/auth-config.ts +++ b/src/auth/auth-config.ts @@ -247,7 +247,7 @@ export interface CreateRequest extends UpdateRequest { /** * The response interface for listing provider configs. This is only available * when listing all identity providers' configurations via - * {@link auth.Auth.listProviderConfigs `listProviderConfigs()`}. + * {@link BaseAuth.listProviderConfigs}. */ export interface ListProviderConfigResults { @@ -265,7 +265,7 @@ export interface ListProviderConfigResults { /** * The filter interface used for listing provider configurations. This is used * when specifying how to list configured identity providers via - * {@link auth.Auth.listProviderConfigs `listProviderConfigs()`}. + * {@link BaseAuth.listProviderConfigs}. */ export interface AuthProviderConfigFilter { @@ -292,7 +292,7 @@ export interface AuthProviderConfigFilter { /** * The request interface for updating a SAML Auth provider. This is used * when updating a SAML provider's configuration via - * {@link auth.Auth.updateProviderConfig `updateProviderConfig()`}. + * {@link BaseAuth.updateProviderConfig}. */ export interface SAMLUpdateAuthProviderRequest { @@ -342,7 +342,7 @@ export interface SAMLUpdateAuthProviderRequest { /** * The request interface for updating an OIDC Auth provider. This is used * when updating an OIDC provider's configuration via - * {@link auth.Auth.updateProviderConfig `updateProviderConfig()`}. + * {@link BaseAuth.updateProviderConfig}. */ export interface OIDCUpdateAuthProviderRequest { @@ -521,7 +521,7 @@ export class MultiFactorAuthConfig implements MultiFactorConfig { * Static method to convert a client side request to a MultiFactorAuthServerConfig. * Throws an error if validation fails. * - * @param options The options object to convert to a server request. + * @param options - The options object to convert to a server request. * @returns The resulting server request. * @internal */ @@ -549,7 +549,7 @@ export class MultiFactorAuthConfig implements MultiFactorConfig { /** * Validates the MultiFactorConfig options object. Throws an error on failure. * - * @param options The options object to validate. + * @param options - The options object to validate. */ private static validate(options: MultiFactorConfig): void { const validKeys = { @@ -604,7 +604,7 @@ export class MultiFactorAuthConfig implements MultiFactorConfig { /** * The MultiFactorAuthConfig constructor. * - * @param response The server side response used to initialize the + * @param response - The server side response used to initialize the * MultiFactorAuthConfig object. * @constructor * @internal @@ -638,7 +638,7 @@ export class MultiFactorAuthConfig implements MultiFactorConfig { /** * Validates the provided map of test phone number / code pairs. - * @param testPhoneNumbers The phone number / code pairs to validate. + * @param testPhoneNumbers - The phone number / code pairs to validate. */ export function validateTestPhoneNumbers( testPhoneNumbers: {[phoneNumber: string]: string}, @@ -703,7 +703,7 @@ export class EmailSignInConfig implements EmailSignInProviderConfig { * Static method to convert a client side request to a EmailSignInConfigServerRequest. * Throws an error if validation fails. * - * @param options The options object to convert to a server request. + * @param options - The options object to convert to a server request. * @returns The resulting server request. * @internal */ @@ -722,7 +722,7 @@ export class EmailSignInConfig implements EmailSignInProviderConfig { /** * Validates the EmailSignInConfig options object. Throws an error on failure. * - * @param options The options object to validate. + * @param options - The options object to validate. */ private static validate(options: EmailSignInProviderConfig): void { // TODO: Validate the request. @@ -765,7 +765,7 @@ export class EmailSignInConfig implements EmailSignInProviderConfig { /** * The EmailSignInConfig constructor. * - * @param response The server side response used to initialize the + * @param response - The server side response used to initialize the * EmailSignInConfig object. * @constructor */ @@ -817,7 +817,7 @@ export interface BaseAuthProviderConfig { * The * [SAML](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html) * Auth provider configuration interface. A SAML provider can be created via - * {@link auth.Auth.createProviderConfig `createProviderConfig()`}. + * {@link BaseAuth.createProviderConfig}. */ export interface SAMLAuthProviderConfig extends BaseAuthProviderConfig { @@ -883,7 +883,7 @@ export interface OAuthResponseType { /** * The [OIDC](https://openid.net/specs/openid-connect-core-1_0-final.html) Auth * provider configuration interface. An OIDC provider can be created via - * {@link auth.Auth.createProviderConfig `createProviderConfig()`}. + * {@link BaseAuth.createProviderConfig}. */ export interface OIDCAuthProviderConfig extends BaseAuthProviderConfig { @@ -926,7 +926,7 @@ export interface OIDCAuthProviderConfig extends BaseAuthProviderConfig { /** * The Auth provider configuration type. - * {@link auth.Auth.createProviderConfig `createProviderConfig()`}. + * {@link BaseAuth.createProviderConfig}. */ export type AuthProviderConfig = SAMLAuthProviderConfig | OIDCAuthProviderConfig; @@ -953,8 +953,8 @@ export class SAMLConfig implements SAMLAuthProviderConfig { * Throws an error if validation fails. If the request is not a SAMLConfig request, * returns null. * - * @param options The options object to convert to a server request. - * @param ignoreMissingFields Whether to ignore missing fields. + * @param options - The options object to convert to a server request. + * @param ignoreMissingFields - Whether to ignore missing fields. * @returns The resulting server request or null if not valid. */ public static buildServerRequest( @@ -997,7 +997,7 @@ export class SAMLConfig implements SAMLAuthProviderConfig { /** * Returns the provider ID corresponding to the resource name if available. * - * @param resourceName The server side resource name. + * @param resourceName - The server side resource name. * @returns The provider ID corresponding to the resource, null otherwise. */ public static getProviderIdFromResourceName(resourceName: string): string | null { @@ -1010,7 +1010,7 @@ export class SAMLConfig implements SAMLAuthProviderConfig { } /** - * @param providerId The provider ID to check. + * @param providerId - The provider ID to check. * @returns Whether the provider ID corresponds to a SAML provider. */ public static isProviderId(providerId: any): providerId is string { @@ -1020,8 +1020,8 @@ export class SAMLConfig implements SAMLAuthProviderConfig { /** * Validates the SAMLConfig options object. Throws an error on failure. * - * @param options The options object to validate. - * @param ignoreMissingFields Whether to ignore missing fields. + * @param options - The options object to validate. + * @param ignoreMissingFields - Whether to ignore missing fields. */ public static validate(options: Partial, ignoreMissingFields = false): void { const validKeys = { @@ -1135,7 +1135,7 @@ export class SAMLConfig implements SAMLAuthProviderConfig { /** * The SAMLConfig constructor. * - * @param response The server side response used to initialize the SAMLConfig object. + * @param response - The server side response used to initialize the SAMLConfig object. * @constructor */ constructor(response: SAMLConfigServerResponse) { @@ -1217,8 +1217,8 @@ export class OIDCConfig implements OIDCAuthProviderConfig { * Throws an error if validation fails. If the request is not a OIDCConfig request, * returns null. * - * @param options The options object to convert to a server request. - * @param ignoreMissingFields Whether to ignore missing fields. + * @param options - The options object to convert to a server request. + * @param ignoreMissingFields - Whether to ignore missing fields. * @returns The resulting server request or null if not valid. */ public static buildServerRequest( @@ -1248,7 +1248,7 @@ export class OIDCConfig implements OIDCAuthProviderConfig { /** * Returns the provider ID corresponding to the resource name if available. * - * @param resourceName The server side resource name + * @param resourceName - The server side resource name * @returns The provider ID corresponding to the resource, null otherwise. */ public static getProviderIdFromResourceName(resourceName: string): string | null { @@ -1261,7 +1261,7 @@ export class OIDCConfig implements OIDCAuthProviderConfig { } /** - * @param providerId The provider ID to check. + * @param providerId - The provider ID to check. * @returns Whether the provider ID corresponds to an OIDC provider. */ public static isProviderId(providerId: any): providerId is string { @@ -1271,8 +1271,8 @@ export class OIDCConfig implements OIDCAuthProviderConfig { /** * Validates the OIDCConfig options object. Throws an error on failure. * - * @param options The options object to validate. - * @param ignoreMissingFields Whether to ignore missing fields. + * @param options - The options object to validate. + * @param ignoreMissingFields - Whether to ignore missing fields. */ public static validate(options: Partial, ignoreMissingFields = false): void { const validKeys = { @@ -1401,7 +1401,7 @@ export class OIDCConfig implements OIDCAuthProviderConfig { /** * The OIDCConfig constructor. * - * @param response The server side response used to initialize the OIDCConfig object. + * @param response - The server side response used to initialize the OIDCConfig object. * @constructor */ constructor(response: OIDCConfigServerResponse) { diff --git a/src/auth/auth-namespace.ts b/src/auth/auth-namespace.ts index adf3834a56..f126ae62f2 100644 --- a/src/auth/auth-namespace.ts +++ b/src/auth/auth-namespace.ts @@ -94,12 +94,12 @@ import { } from './user-record'; /** - * Gets the {@link auth.Auth `Auth`} service for the default app or a + * Gets the {@link firebase-admin.auth#Auth} service for the default app or a * given app. * * `admin.auth()` can be called with no arguments to access the default app's - * {@link auth.Auth `Auth`} service or as `admin.auth(app)` to access the - * {@link auth.Auth `Auth`} service associated with a specific app. + * {@link firebase-admin.auth#Auth} service or as `admin.auth(app)` to access the + * {@link firebase-admin.auth#Auth} service associated with a specific app. * * @example * ```javascript diff --git a/src/auth/auth.ts b/src/auth/auth.ts index 4ad29f6d20..d9b5aa7978 100644 --- a/src/auth/auth.ts +++ b/src/auth/auth.ts @@ -30,7 +30,7 @@ export class Auth extends BaseAuth { private readonly app_: App; /** - * @param app The app for this Auth service. + * @param app - The app for this Auth service. * @constructor * @internal */ diff --git a/src/auth/base-auth.ts b/src/auth/base-auth.ts index 0bd67e2b65..a8b5a6f39e 100644 --- a/src/auth/base-auth.ts +++ b/src/auth/base-auth.ts @@ -53,13 +53,13 @@ export interface GetUsersResult { /** * Interface representing the object returned from a - * {@link auth.Auth.listUsers `listUsers()`} operation. Contains the list + * {@link BaseAuth.listUsers} operation. Contains the list * of users for the current batch and the next page token if available. */ export interface ListUsersResult { /** - * The list of {@link auth.UserRecord `UserRecord`} objects for the + * The list of {@link UserRecord} objects for the * current downloaded batch. */ users: UserRecord[]; @@ -136,9 +136,9 @@ export abstract class BaseAuth { /** * The BaseAuth class constructor. * - * @param app The FirebaseApp to associate with this Auth instance. - * @param authRequestHandler The RPC request handler for this instance. - * @param tokenGenerator Optional token generator. If not specified, a + * @param app - The FirebaseApp to associate with this Auth instance. + * @param authRequestHandler - The RPC request handler for this instance. + * @param tokenGenerator - Optional token generator. If not specified, a * (non-tenant-aware) instance will be created. Use this paramter to * specify a tenant-aware tokenGenerator. * @constructor @@ -167,8 +167,8 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/create-custom-tokens | Create Custom Tokens} * for code samples and detailed documentation. * - * @param uid The `uid` to use as the custom token's subject. - * @param developerClaims Optional additional claims to include + * @param uid - The `uid` to use as the custom token's subject. + * @param developerClaims - Optional additional claims to include * in the custom token's payload. * * @returns A promise fulfilled with a custom token for the @@ -192,8 +192,8 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/verify-id-tokens | Verify ID Tokens} * for code samples and detailed documentation. * - * @param idToken The ID token to verify. - * @param checkRevoked Whether to check if the ID token was revoked. + * @param idToken - The ID token to verify. + * @param checkRevoked - Whether to check if the ID token was revoked. * This requires an extra request to the Firebase Auth backend to check * the `tokensValidAfterTime` time for the corresponding user. * When not specified, this additional check is not applied. @@ -222,7 +222,7 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data} * for code samples and detailed documentation. * - * @param uid The `uid` corresponding to the user whose data to fetch. + * @param uid - The `uid` corresponding to the user whose data to fetch. * * @returns A promise fulfilled with the user * data corresponding to the provided `uid`. @@ -241,7 +241,7 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data} * for code samples and detailed documentation. * - * @param email The email corresponding to the user whose data to + * @param email - The email corresponding to the user whose data to * fetch. * * @returns A promise fulfilled with the user @@ -262,7 +262,7 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data} * for code samples and detailed documentation. * - * @param phoneNumber The phone number corresponding to the user whose + * @param phoneNumber - The phone number corresponding to the user whose * data to fetch. * * @returns A promise fulfilled with the user @@ -282,9 +282,9 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data} * for code samples and detailed documentation. * - * @param providerId The provider ID, for example, "google.com" for the + * @param providerId - The provider ID, for example, "google.com" for the * Google provider. - * @param uid The user identifier for the given provider. + * @param uid - The user identifier for the given provider. * * @returns A promise fulfilled with the user data corresponding to the * given provider id. @@ -315,8 +315,8 @@ export abstract class BaseAuth { * Only a maximum of 100 identifiers may be supplied. If more than 100 identifiers are supplied, * this method throws a FirebaseAuthError. * - * @param identifiers The identifiers used to indicate which user records should be returned. - * Must have <= 100 entries. + * @param identifiers - The identifiers used to indicate which user records should be returned. + * Must not have more than 100 entries. * @returns A promise that resolves to the corresponding user records. * @throws FirebaseAuthError If any of the identifiers are invalid or if more than 100 * identifiers are specified. @@ -369,9 +369,9 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#list_all_users | List all users} * for code samples and detailed documentation. * - * @param maxResults The page size, 1000 if undefined. This is also + * @param maxResults - The page size, 1000 if undefined. This is also * the maximum allowed limit. - * @param pageToken The next page token. If not specified, returns + * @param pageToken - The next page token. If not specified, returns * users starting without any offset. * @returns A promise that resolves with * the current batch of downloaded users and the next page token. @@ -404,7 +404,7 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#create_a_user | Create a user} * for code samples and detailed documentation. * - * @param properties The properties to set on the + * @param properties - The properties to set on the * new user record to be created. * * @returns A promise fulfilled with the user @@ -433,7 +433,7 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-users#delete_a_user | Delete a user} * for code samples and detailed documentation. * - * @param uid The `uid` corresponding to the user to delete. + * @param uid - The `uid` corresponding to the user to delete. * * @returns An empty promise fulfilled once the user has been * deleted. @@ -461,7 +461,7 @@ export abstract class BaseAuth { * delete more than 1000 users, you may need to add a delay to ensure you * don't go over this limit. * - * @param uids The `uids` corresponding to the users to delete. + * @param uids - The `uids` corresponding to the users to delete. * * @returns A Promise that resolves to the total number of successful/failed * deletions, as well as the array of errors that corresponds to the @@ -517,8 +517,8 @@ export abstract class BaseAuth { * See {@link https://firebsae.google.com/docs/auth/admin/manage-users#update_a_user | Update a user} * for code samples and detailed documentation. * - * @param uid The `uid` corresponding to the user to update. - * @param properties The properties to update on + * @param uid - The `uid` corresponding to the user to update. + * @param properties - The properties to update on * the provided user. * * @returns A promise fulfilled with the @@ -589,8 +589,8 @@ export abstract class BaseAuth { * Defining user roles and access levels} * for code samples and detailed documentation. * - * @param uid The `uid` of the user to edit. - * @param customUserClaims The developer claims to set. If null is + * @param uid - The `uid` of the user to edit. + * @param customUserClaims - The developer claims to set. If null is * passed, existing custom claims are deleted. Passing a custom claims payload * larger than 1000 bytes will throw an error. Custom claims are added to the * user's ID token which is transmitted on every authenticated request. @@ -619,7 +619,7 @@ export abstract class BaseAuth { * ID tokens are revoked, use {@link BaseAuth.verifyIdToken} * where `checkRevoked` is set to true. * - * @param uid The `uid` corresponding to the user whose refresh tokens + * @param uid - The `uid` corresponding to the user whose refresh tokens * are to be revoked. * * @returns An empty promise fulfilled once the user's refresh @@ -641,8 +641,8 @@ export abstract class BaseAuth { * This operation is optimized for bulk imports and will ignore checks on `uid`, * `email` and other identifier uniqueness which could result in duplications. * - * @param users The list of user records to import to Firebase Auth. - * @param options The user import options, required when the users provided include + * @param users - The list of user records to import to Firebase Auth. + * @param options - The user import options, required when the users provided include * password credentials. * @returns A promise that resolves when * the operation completes with the result of the import. This includes the @@ -663,9 +663,9 @@ export abstract class BaseAuth { * See {@link https://firebase.google.com/docs/auth/admin/manage-cookies | Manage Session Cookies} * for code samples and detailed documentation. * - * @param idToken The Firebase ID token to exchange for a session + * @param idToken - The Firebase ID token to exchange for a session * cookie. - * @param sessionCookieOptions The session + * @param sessionCookieOptions - The session * cookie options which includes custom session duration. * * @returns A promise that resolves on success with the @@ -697,8 +697,8 @@ export abstract class BaseAuth { * Verify Session Cookies} * for code samples and detailed documentation * - * @param sessionCookie The session cookie to verify. - * @param checkForRevocation Whether to check if the session cookie was + * @param sessionCookie - The session cookie to verify. + * @param checkForRevocation - Whether to check if the session cookie was * revoked. This requires an extra request to the Firebase Auth backend to * check the `tokensValidAfterTime` time for the corresponding user. * When not specified, this additional check is not performed. @@ -754,9 +754,9 @@ export abstract class BaseAuth { * }); * ``` * - * @param email The email address of the user whose password is to be + * @param email - The email address of the user whose password is to be * reset. - * @param actionCodeSettings The action + * @param actionCodeSettings - The action * code settings. If specified, the state/continue URL is set as the * "continueUrl" parameter in the password reset link. The default password * reset landing page will use this to display a link to go back to the app @@ -807,8 +807,8 @@ export abstract class BaseAuth { * }); * ``` * - * @param email The email account to verify. - * @param actionCodeSettings The action + * @param email - The email account to verify. + * @param actionCodeSettings - The action * code settings. If specified, the state/continue URL is set as the * "continueUrl" parameter in the email verification link. The default email * verification landing page will use this to display a link to go back to @@ -859,8 +859,8 @@ export abstract class BaseAuth { * }); * ``` * - * @param email The email account to verify. - * @param actionCodeSettings The action + * @param email - The email account to verify. + * @param actionCodeSettings - The action * code settings. If specified, the state/continue URL is set as the * "continueUrl" parameter in the email verification link. The default email * verification landing page will use this to display a link to go back to @@ -887,7 +887,7 @@ export abstract class BaseAuth { * (GCIP). To learn more about GCIP, including pricing and features, * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}. * - * @param options The provider config filter to apply. + * @param options - The provider config filter to apply. * @returns A promise that resolves with the list of provider configs meeting the * filter requirements. */ @@ -944,7 +944,7 @@ export abstract class BaseAuth { * (GCIP). To learn more about GCIP, including pricing and features, * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}. * - * @param providerId The provider ID corresponding to the provider + * @param providerId - The provider ID corresponding to the provider * config to return. * @returns A promise that resolves * with the configuration corresponding to the provided ID. @@ -973,7 +973,7 @@ export abstract class BaseAuth { * (GCIP). To learn more about GCIP, including pricing and features, * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}. * - * @param providerId The provider ID corresponding to the provider + * @param providerId - The provider ID corresponding to the provider * config to delete. * @returns A promise that resolves on completion. */ @@ -996,9 +996,9 @@ export abstract class BaseAuth { * (GCIP). To learn more about GCIP, including pricing and features, * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}. * - * @param providerId The provider ID corresponding to the provider + * @param providerId - The provider ID corresponding to the provider * config to update. - * @param updatedConfig The updated configuration. + * @param updatedConfig - The updated configuration. * @returns A promise that resolves with the updated provider configuration. */ public updateProviderConfig( @@ -1031,7 +1031,7 @@ export abstract class BaseAuth { * (GCIP). To learn more about GCIP, including pricing and features, * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}. * - * @param config The provider configuration to create. + * @param config - The provider configuration to create. * @returns A promise that resolves with the created provider configuration. */ public createProviderConfig(config: AuthProviderConfig): Promise { @@ -1060,8 +1060,8 @@ export abstract class BaseAuth { * resolves with the decoded claims on success. Rejects the promise with revocation error if revoked * or user disabled. * - * @param decodedIdToken The JWT's decoded claims. - * @param revocationErrorInfo The revocation error info to throw on revocation + * @param decodedIdToken - The JWT's decoded claims. + * @param revocationErrorInfo - The revocation error info to throw on revocation * detection. * @returns A promise that will be fulfilled after a successful verification. */ diff --git a/src/auth/index.ts b/src/auth/index.ts index b189e1ac56..0b92a796cf 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -25,12 +25,12 @@ import { FirebaseApp } from '../app/firebase-app'; import { Auth } from './auth'; /** - * Gets the {@link auth.Auth `Auth`} service for the default app or a + * Gets the {@link Auth} service for the default app or a * given app. * * `getAuth()` can be called with no arguments to access the default app's - * {@link auth.Auth `Auth`} service or as `getAuth(app)` to access the - * {@link auth.Auth `Auth`} service associated with a specific app. + * {@link Auth} service or as `getAuth(app)` to access the + * {@link Auth} service associated with a specific app. * * @example * ```javascript diff --git a/src/auth/tenant-manager.ts b/src/auth/tenant-manager.ts index 571f237d9b..71a505ecc7 100644 --- a/src/auth/tenant-manager.ts +++ b/src/auth/tenant-manager.ts @@ -74,8 +74,8 @@ export class TenantAwareAuth extends BaseAuth { /** * The TenantAwareAuth class constructor. * - * @param app The app that created this tenant. - * @param tenantId The corresponding tenant ID. + * @param app - The app that created this tenant. + * @param tenantId - The corresponding tenant ID. * @constructor * @internal */ @@ -152,7 +152,7 @@ export class TenantManager { /** * Initializes a TenantManager instance for a specified FirebaseApp. * - * @param app The app for this TenantManager instance. + * @param app - The app for this TenantManager instance. * * @constructor * @internal @@ -165,7 +165,7 @@ export class TenantManager { /** * Returns a `TenantAwareAuth` instance bound to the given tenant ID. * - * @param tenantId The tenant ID whose `TenantAwareAuth` instance is to be returned. + * @param tenantId - The tenant ID whose `TenantAwareAuth` instance is to be returned. * * @returns The `TenantAwareAuth` instance corresponding to this tenant identifier. */ @@ -182,7 +182,7 @@ export class TenantManager { /** * Gets the tenant configuration for the tenant corresponding to a given `tenantId`. * - * @param tenantId The tenant identifier corresponding to the tenant whose data to fetch. + * @param tenantId - The tenant identifier corresponding to the tenant whose data to fetch. * * @returns A promise fulfilled with the tenant configuration to the provided `tenantId`. */ @@ -198,9 +198,9 @@ export class TenantManager { * starting from the offset as specified by `pageToken`. This is used to * retrieve all the tenants of a specified project in batches. * - * @param maxResults The page size, 1000 if undefined. This is also + * @param maxResults - The page size, 1000 if undefined. This is also * the maximum allowed limit. - * @param pageToken The next page token. If not specified, returns + * @param pageToken - The next page token. If not specified, returns * tenants starting without any offset. * * @returns A promise that resolves with @@ -233,7 +233,7 @@ export class TenantManager { /** * Deletes an existing tenant. * - * @param tenantId The `tenantId` corresponding to the tenant to delete. + * @param tenantId - The `tenantId` corresponding to the tenant to delete. * * @returns An empty promise fulfilled once the tenant has been deleted. */ @@ -246,7 +246,7 @@ export class TenantManager { * When creating new tenants, tenants that use separate billing and quota will require their * own project and must be defined as `full_service`. * - * @param tenantOptions The properties to set on the new tenant configuration to be created. + * @param tenantOptions - The properties to set on the new tenant configuration to be created. * * @returns A promise fulfilled with the tenant configuration corresponding to the newly * created tenant. @@ -261,8 +261,8 @@ export class TenantManager { /** * Updates an existing tenant configuration. * - * @param tenantId The `tenantId` corresponding to the tenant to delete. - * @param tenantOptions The properties to update on the provided tenant. + * @param tenantId - The `tenantId` corresponding to the tenant to delete. + * @param tenantOptions - The properties to update on the provided tenant. * * @returns A promise fulfilled with the update tenant data. */ diff --git a/src/auth/tenant.ts b/src/auth/tenant.ts index 6c5577bda2..e489fa3b09 100644 --- a/src/auth/tenant.ts +++ b/src/auth/tenant.ts @@ -126,8 +126,8 @@ export class Tenant { /** * Builds the corresponding server request for a TenantOptions object. * - * @param tenantOptions The properties to convert to a server request. - * @param createRequest Whether this is a create request. + * @param tenantOptions - The properties to convert to a server request. + * @param createRequest - Whether this is a create request. * @returns The equivalent server request. * * @internal @@ -158,7 +158,7 @@ export class Tenant { /** * Returns the tenant ID corresponding to the resource name if available. * - * @param resourceName The server side resource name + * @param resourceName - The server side resource name * @returns The tenant ID corresponding to the resource, null otherwise. * * @internal @@ -175,8 +175,8 @@ export class Tenant { /** * Validates a tenant options object. Throws an error on failure. * - * @param {any} request The tenant options object to validate. - * @param {boolean} createRequest Whether this is a create request. + * @param request - The tenant options object to validate. + * @param createRequest - Whether this is a create request. */ private static validate(request: any, createRequest: boolean): void { const validKeys = { @@ -236,7 +236,7 @@ export class Tenant { /** * The Tenant object constructor. * - * @param response The server side response used to initialize the Tenant object. + * @param response - The server side response used to initialize the Tenant object. * @constructor * @internal */ diff --git a/src/auth/token-generator.ts b/src/auth/token-generator.ts index 7e930916ab..a0b97680f0 100644 --- a/src/auth/token-generator.ts +++ b/src/auth/token-generator.ts @@ -92,7 +92,7 @@ export class FirebaseTokenGenerator { private readonly signer: CryptoSigner; /** - * @param tenantId The tenant ID to use for the generated Firebase Auth + * @param tenantId - The tenant ID to use for the generated Firebase Auth * Custom token. If absent, then no tenant ID claim will be set in the * resulting JWT. */ @@ -114,8 +114,8 @@ export class FirebaseTokenGenerator { /** * Creates a new Firebase Auth Custom token. * - * @param uid The user ID to use for the generated Firebase Auth Custom token. - * @param developerClaims Optional developer claims to include in the generated Firebase + * @param uid - The user ID to use for the generated Firebase Auth Custom token. + * @param developerClaims - Optional developer claims to include in the generated Firebase * Auth Custom token. * @returns A Promise fulfilled with a Firebase Auth Custom token signed with a * service account key and containing the provided payload. @@ -189,7 +189,7 @@ export class FirebaseTokenGenerator { /** * Returns whether or not the provided developer claims are valid. * - * @param developerClaims Optional developer claims to validate. + * @param developerClaims - Optional developer claims to validate. * @returns True if the provided claims are valid; otherwise, false. */ private isDeveloperClaimsValid_(developerClaims?: object): boolean { @@ -204,7 +204,7 @@ export class FirebaseTokenGenerator { * Creates a new FirebaseAuthError by extracting the error code, message and other relevant * details from a CryptoSignerError. * - * @param err The Error to convert into a FirebaseAuthError error + * @param err - The Error to convert into a FirebaseAuthError error * @returns A Firebase Auth error that can be returned to the user. */ export function handleCryptoSignerError(err: Error): Error { diff --git a/src/auth/token-verifier.ts b/src/auth/token-verifier.ts index 12c7e72a29..d38cb7bd96 100644 --- a/src/auth/token-verifier.ts +++ b/src/auth/token-verifier.ts @@ -25,7 +25,7 @@ import { App } from '../app/index'; /** * Interface representing a decoded Firebase ID token, returned from the - * {@link auth.Auth.verifyIdToken `verifyIdToken()`} method. + * {@link BaseAuth.verifyIdToken} method. * * Firebase ID tokens are OpenID Connect spec-compliant JSON Web Tokens (JWTs). * See the @@ -95,7 +95,7 @@ export interface DecodedIdToken { * The ID of the provider used to sign in the user. * One of `"anonymous"`, `"password"`, `"facebook.com"`, `"github.com"`, * `"google.com"`, `"twitter.com"`, `"apple.com"`, `"microsoft.com"`, - * "yahoo.com"`, `"phone"`, `"playgames.google.com"`, `"gc.apple.com"`, + * `"yahoo.com"`, `"phone"`, `"playgames.google.com"`, `"gc.apple.com"`, * or `"custom"`. * * Additional Identity Platform provider IDs include `"linkedin.com"`, @@ -297,8 +297,8 @@ export class FirebaseTokenVerifier { /** * Verifies the format and signature of a Firebase Auth JWT token. * - * @param jwtToken The Firebase Auth JWT token to verify. - * @param isEmulator Whether to accept Auth Emulator tokens. + * @param jwtToken - The Firebase Auth JWT token to verify. + * @param isEmulator - Whether to accept Auth Emulator tokens. * @returns A promise fulfilled with the decoded claims of the Firebase Auth ID token. */ public verifyJWT(jwtToken: string, isEmulator = false): Promise { @@ -362,9 +362,9 @@ export class FirebaseTokenVerifier { /** * Verifies the content of a Firebase Auth JWT. * - * @param fullDecodedToken The decoded JWT. - * @param projectId The Firebase Project Id. - * @param isEmulator Whether the token is an Emulator token. + * @param fullDecodedToken - The decoded JWT. + * @param projectId - The Firebase Project Id. + * @param isEmulator - Whether the token is an Emulator token. */ private verifyContent( fullDecodedToken: DecodedToken, @@ -430,7 +430,7 @@ export class FirebaseTokenVerifier { /** * Maps JwtError to FirebaseAuthError * - * @param error JwtError to be mapped. + * @param error - JwtError to be mapped. * @returns FirebaseAuthError or Error instance. */ private mapJwtErrorToAuthError(error: JwtError): Error { @@ -458,7 +458,7 @@ export class FirebaseTokenVerifier { * Creates a new FirebaseTokenVerifier to verify Firebase ID tokens. * * @internal - * @param app Firebase app instance. + * @param app - Firebase app instance. * @returns FirebaseTokenVerifier */ export function createIdTokenVerifier(app: App): FirebaseTokenVerifier { @@ -474,7 +474,7 @@ export function createIdTokenVerifier(app: App): FirebaseTokenVerifier { * Creates a new FirebaseTokenVerifier to verify Firebase session cookies. * * @internal - * @param app Firebase app instance. + * @param app - Firebase app instance. * @returns FirebaseTokenVerifier */ export function createSessionCookieVerifier(app: App): FirebaseTokenVerifier { diff --git a/src/auth/user-import-builder.ts b/src/auth/user-import-builder.ts index 811e7c9963..23e4e5aba3 100644 --- a/src/auth/user-import-builder.ts +++ b/src/auth/user-import-builder.ts @@ -29,7 +29,7 @@ export type HashAlgorithmType = 'SCRYPT' | 'STANDARD_SCRYPT' | 'HMAC_SHA512' | /** * Interface representing the user import options needed for - * {@link auth.Auth.importUsers `importUsers()`} method. This is used to + * {@link BaseAuth.importUsers} method. This is used to * provide the password hashing algorithm information. */ export interface UserImportOptions { @@ -95,7 +95,7 @@ export interface UserImportOptions { /** * Interface representing a user to import to Firebase Auth via the - * {@link auth.Auth.importUsers `importUsers()`} method. + * {@link BaseAuth.importUsers} method. */ export interface UserImportRecord { @@ -154,7 +154,7 @@ export interface UserImportRecord { /** * The buffer of bytes representing the user's hashed password. * When a user is to be imported with a password hash, - * {@link auth.UserImportOptions `UserImportOptions`} are required to be + * {@link UserImportOptions} are required to be * specified to identify the hashing algorithm used to generate this hash. */ passwordHash?: Buffer; @@ -233,7 +233,7 @@ export interface UserProviderRequest { /** * Interface representing the response from the - * {@link auth.Auth.importUsers `importUsers()`} method for batch + * {@link BaseAuth.importUsers} method for batch * importing users to Firebase Auth. */ export interface UserImportResult { @@ -318,7 +318,7 @@ export type ValidatorFunction = (data: UploadAccountUser) => void; /** * Converts a client format second factor object to server format. - * @param multiFactorInfo The client format second factor. + * @param multiFactorInfo - The client format second factor. * @returns The corresponding AuthFactorInfo server request format. */ export function convertMultiFactorInfoToServerFormat(multiFactorInfo: UpdateMultiFactorInfoRequest): AuthFactorInfo { diff --git a/src/auth/user-record.ts b/src/auth/user-record.ts index 7b49618be5..dfaaf94340 100644 --- a/src/auth/user-record.ts +++ b/src/auth/user-record.ts @@ -28,7 +28,7 @@ const B64_REDACTED = Buffer.from('REDACTED').toString('base64'); /** * Parses a time stamp string or number and returns the corresponding date if valid. * - * @param time The unix timestamp string or number in milliseconds. + * @param time - The unix timestamp string or number in milliseconds. * @returns The corresponding date as a UTC string, if valid. Otherwise, null. */ function parseDate(time: any): string | null { @@ -115,7 +115,7 @@ export abstract class MultiFactorInfo { * Initializes the MultiFactorInfo associated subclass using the server side. * If no MultiFactorInfo is associated with the response, null is returned. * - * @param response The server side response. + * @param response - The server side response. * @internal */ public static initMultiFactorInfo(response: MultiFactorInfoResponse): MultiFactorInfo | null { @@ -132,7 +132,7 @@ export abstract class MultiFactorInfo { /** * Initializes the MultiFactorInfo object using the server side response. * - * @param response The server side response. + * @param response - The server side response. * @constructor * @internal */ @@ -157,7 +157,7 @@ export abstract class MultiFactorInfo { /** * Returns the factor ID based on the response provided. * - * @param response The server side response. + * @param response - The server side response. * @returns The multi-factor ID associated with the provided response. If the response is * not associated with any known multi-factor ID, null is returned. * @@ -168,7 +168,7 @@ export abstract class MultiFactorInfo { /** * Initializes the MultiFactorInfo object using the provided server response. * - * @param response The server side response. + * @param response - The server side response. */ private initFromServerResponse(response: MultiFactorInfoResponse): void { const factorId = response && this.getFactorId(response); @@ -206,7 +206,7 @@ export class PhoneMultiFactorInfo extends MultiFactorInfo { /** * Initializes the PhoneMultiFactorInfo object using the server side response. * - * @param response The server side response. + * @param response - The server side response. * @constructor * @internal */ @@ -229,7 +229,7 @@ export class PhoneMultiFactorInfo extends MultiFactorInfo { /** * Returns the factor ID based on the response provided. * - * @param response The server side response. + * @param response - The server side response. * @returns The multi-factor ID associated with the provided response. If the response is * not associated with any known multi-factor ID, null is returned. * @@ -254,7 +254,7 @@ export class MultiFactorSettings { /** * Initializes the MultiFactor object using the server side or JWT format response. * - * @param response The server side response. + * @param response - The server side response. * @constructor * @internal */ @@ -312,7 +312,7 @@ export class UserMetadata { public readonly lastRefreshTime?: string | null; /** - * @param response The server side response returned from the getAccountInfo + * @param response - The server side response returned from the getAccountInfo * endpoint. * @constructor * @internal @@ -379,7 +379,7 @@ export class UserInfo { /** - * @param response The server side response returned from the getAccountInfo + * @param response - The server side response returned from the getAccountInfo * endpoint. * @constructor * @internal @@ -514,7 +514,7 @@ export class UserRecord { public readonly multiFactor?: MultiFactorSettings; /** - * @param response The server side response returned from the getAccountInfo + * @param response - The server side response returned from the getAccountInfo * endpoint. * @constructor * @internal diff --git a/src/credential/index.ts b/src/credential/index.ts index 7cc49758e8..f83adcc148 100644 --- a/src/credential/index.ts +++ b/src/credential/index.ts @@ -30,8 +30,7 @@ export namespace credential { * with Firebase services. * * In most cases, you will not need to implement this yourself and can instead - * use the default implementations provided by - * {@link credential `admin.credential`}. + * use the default implementations provided by the `admin.credential` namespace. */ export type Credential = TCredential; @@ -57,7 +56,7 @@ export namespace credential { * }); * ``` * - * @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} + * @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} * to be used when retrieving access tokens from Google token servers. * * @returns A credential authenticated via Google @@ -97,9 +96,9 @@ export namespace credential { * }); * ``` * - * @param serviceAccountPathOrObject The path to a service + * @param serviceAccountPathOrObject - The path to a service * account key JSON file or an object representing a service account key. - * @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} + * @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} * to be used when retrieving access tokens from Google token servers. * * @returns A credential authenticated via the @@ -126,10 +125,10 @@ export namespace credential { * }); * ``` * - * @param refreshTokenPathOrObject The path to a Google + * @param refreshTokenPathOrObject - The path to a Google * OAuth2 refresh token JSON file or an object representing a Google OAuth2 * refresh token. - * @param httpAgent Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} + * @param httpAgent - Optional {@link https://nodejs.org/api/http.html#http_class_http_agent | HTTP Agent} * to be used when retrieving access tokens from Google token servers. * * @returns A credential authenticated via the diff --git a/src/database/database-namespace.ts b/src/database/database-namespace.ts index cc2a1111fa..15b2b3d0ce 100644 --- a/src/database/database-namespace.ts +++ b/src/database/database-namespace.ts @@ -41,7 +41,7 @@ import { Database as TDatabase } from './database'; * var otherDatabase = admin.database(app); * ``` * - * @param App whose `Database` service to + * @param App - whose `Database` service to * return. If not provided, the default `Database` service will be returned. * * @returns The default `Database` service if no app diff --git a/src/database/database.ts b/src/database/database.ts index dc17419d5e..8c79925637 100644 --- a/src/database/database.ts +++ b/src/database/database.ts @@ -53,7 +53,7 @@ export interface Database extends FirebaseDatabase { * Sets the specified rules on the Firebase Realtime Database instance. If the rules source is * specified as a string or a Buffer, it may include comments. * - * @param source Source of the rules to apply. Must not be `null` or empty. + * @param source - Source of the rules to apply. Must not be `null` or empty. * @returns Resolves when the rules are set on the Realtime Database. */ setRules(source: string | Buffer | object): Promise; diff --git a/src/database/index.ts b/src/database/index.ts index 53a72f5fe4..4949756247 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -74,7 +74,7 @@ export const ServerValue: rtdb.ServerValue = serverValueConst; * const otherDatabase = getDatabase(app); * ``` * - * @param App whose `Database` service to + * @param App - whose `Database` service to * return. If not provided, the default `Database` service will be returned. * * @returns The default `Database` service if no app @@ -104,7 +104,7 @@ export function getDatabase(app?: App): Database { * const otherDatabase = getDatabaseWithUrl('https://example.firebaseio.com', app); * ``` * - * @param App whose `Database` service to + * @param App - whose `Database` service to * return. If not provided, the default `Database` service will be returned. * * @returns The default `Database` service if no app diff --git a/src/firebase-namespace-api.ts b/src/firebase-namespace-api.ts index 185fbfd53f..5358e5bd2c 100644 --- a/src/firebase-namespace-api.ts +++ b/src/firebase-namespace-api.ts @@ -38,10 +38,7 @@ export namespace app { * services. * * Do not call this constructor directly. Instead, use - * {@link - * https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp - * `admin.initializeApp()`} - * to create an app. + * {@link firebase-admin.app#initializeApp} to create an app. */ export interface App extends AppCore { appCheck(): appCheck.AppCheck; @@ -49,7 +46,9 @@ export namespace app { database(url?: string): database.Database; firestore(): firestore.Firestore; installations(): installations.Installations; - /** @deprecated */ + /** + * @deprecated Use {@link firebase-admin.installations#Installations} instead. + */ instanceId(): instanceId.InstanceId; machineLearning(): machineLearning.MachineLearning; messaging(): messaging.Messaging; diff --git a/src/firestore/index.ts b/src/firestore/index.ts index bc52480a44..b7904f388c 100644 --- a/src/firestore/index.ts +++ b/src/firestore/index.ts @@ -76,7 +76,7 @@ export { * const otherFirestore = getFirestore(app); * ``` * - * @param App whose `Firestore` service to + * @param App - whose `Firestore` service to * return. If not provided, the default `Firestore` service will be returned. * * @returns The default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore} diff --git a/src/installations/index.ts b/src/installations/index.ts index 83efccae9c..c790c2c8ce 100644 --- a/src/installations/index.ts +++ b/src/installations/index.ts @@ -45,7 +45,7 @@ export { Installations }; * const otherInstallations = getInstallations(otherApp); *``` * - * @param app Optional app whose `Installations` service to + * @param app - Optional app whose `Installations` service to * return. If not provided, the default `Installations` service will be * returned. * diff --git a/src/installations/installations-namespace.ts b/src/installations/installations-namespace.ts index 8a2495c788..1bdca2fbce 100644 --- a/src/installations/installations-namespace.ts +++ b/src/installations/installations-namespace.ts @@ -18,13 +18,13 @@ import { App } from '../app/index'; import { Installations as TInstallations } from './installations'; /** - * Gets the {@link installations.Installations `Installations`} service for the + * Gets the {@link firebase-admin.installations#Installations} service for the * default app or a given app. * * `admin.installations()` can be called with no arguments to access the default - * app's {@link installations.Installations `Installations`} service or as + * app's {@link firebase-admin.installations#Installations} service or as * `admin.installations(app)` to access the - * {@link installations.Installations `Installations`} service associated with a + * {@link firebase-admin.installations#Installations} service associated with a * specific app. * * @example @@ -39,7 +39,7 @@ import { Installations as TInstallations } from './installations'; * var otherInstallations = admin.installations(otherApp); *``` * - * @param app Optional app whose `Installations` service to + * @param app - Optional app whose `Installations` service to * return. If not provided, the default `Installations` service is * returned. * diff --git a/src/installations/installations-request-handler.ts b/src/installations/installations-request-handler.ts index 44d17e41d4..f6043c46d0 100644 --- a/src/installations/installations-request-handler.ts +++ b/src/installations/installations-request-handler.ts @@ -55,7 +55,7 @@ export class FirebaseInstallationsRequestHandler { private path: string; /** - * @param app The app used to fetch access tokens to sign API requests. + * @param app - The app used to fetch access tokens to sign API requests. * * @constructor */ @@ -76,7 +76,7 @@ export class FirebaseInstallationsRequestHandler { /** * Invokes the request handler based on the API settings object passed. * - * @param apiSettings The API endpoint settings to apply to request and response. + * @param apiSettings - The API endpoint settings to apply to request and response. * @returns A promise that resolves when the request is complete. */ private invokeRequestHandler(apiSettings: ApiSettings): Promise { diff --git a/src/installations/installations.ts b/src/installations/installations.ts index 98ab0f0ceb..c5408299da 100644 --- a/src/installations/installations.ts +++ b/src/installations/installations.ts @@ -28,7 +28,7 @@ export class Installations { private requestHandler: FirebaseInstallationsRequestHandler; /** - * @param app The app for this Installations service. + * @param app - The app for this Installations service. * @constructor * @internal */ @@ -47,7 +47,7 @@ export class Installations { /** * Deletes the specified installation ID and the associated data from Firebase. * - * @param fid The Firebase installation ID to be deleted. + * @param fid - The Firebase installation ID to be deleted. * * @returns A promise fulfilled when the installation ID is deleted. */ diff --git a/src/instance-id/index.ts b/src/instance-id/index.ts index 22fff0a89a..6d014aeebb 100644 --- a/src/instance-id/index.ts +++ b/src/instance-id/index.ts @@ -52,7 +52,7 @@ export { InstanceId }; * This API is deprecated. Developers are advised to use the `admin.installations()` * API to delete their instance IDs and Firebase installation IDs. * - * @param app Optional app whose `InstanceId` service to + * @param app - Optional app whose `InstanceId` service to * return. If not provided, the default `InstanceId` service will be * returned. * @@ -60,7 +60,7 @@ export { InstanceId }; * no app is provided or the `InstanceId` service associated with the * provided app. * - * @deprecated + * @deprecated Use {@link firebase-admin.installations#getInstallations} instead. */ export function getInstanceId(app?: App): InstanceId { if (typeof app === 'undefined') { diff --git a/src/instance-id/instance-id-namespace.ts b/src/instance-id/instance-id-namespace.ts index 9d05874a7b..285828e472 100644 --- a/src/instance-id/instance-id-namespace.ts +++ b/src/instance-id/instance-id-namespace.ts @@ -21,7 +21,7 @@ import { InstanceId as TInstanceId } from './instance-id'; * var otherInstanceId = admin.instanceId(otherApp); *``` * - * @param app Optional app whose `InstanceId` service to + * @param app - Optional app whose `InstanceId` service to * return. If not provided, the default `InstanceId` service will be * returned. * diff --git a/src/instance-id/instance-id.ts b/src/instance-id/instance-id.ts index 6bd92d991d..e5dc2102b0 100644 --- a/src/instance-id/instance-id.ts +++ b/src/instance-id/instance-id.ts @@ -26,14 +26,14 @@ import * as validator from '../utils/validator'; * The `InstanceId` service enables deleting the Firebase instance IDs * associated with Firebase client app instances. * - * @deprecated + * @deprecated Use {@link firebase-admin.installations#Installations} instead. */ export class InstanceId { private app_: App; /** - * @param app The app for this InstanceId service. + * @param app - The app for this InstanceId service. * @constructor * @internal */ @@ -58,7 +58,7 @@ export class InstanceId { * Delete an Instance ID} * for more information. * - * @param instanceId The instance ID to be deleted. + * @param instanceId - The instance ID to be deleted. * * @returns A promise fulfilled when the instance ID is deleted. */ diff --git a/src/machine-learning/index.ts b/src/machine-learning/index.ts index a3bf1d8f8a..e541d82b35 100644 --- a/src/machine-learning/index.ts +++ b/src/machine-learning/index.ts @@ -42,7 +42,7 @@ export { * Gets the {@link MachineLearning} service for the default app or a given app. * * `getMachineLearning()` can be called with no arguments to access the - * default app's {`MachineLearning` service or as `getMachineLearning(app)` to access + * default app's `MachineLearning` service or as `getMachineLearning(app)` to access * the `MachineLearning` service associated with a specific app. * * @example @@ -57,7 +57,7 @@ export { * const otherMachineLearning = getMachineLearning(otherApp); * ``` * - * @param app Optional app whose `MachineLearning` service to + * @param app - Optional app whose `MachineLearning` service to * return. If not provided, the default `MachineLearning` service * will be returned. * diff --git a/src/machine-learning/machine-learning-api-client.ts b/src/machine-learning/machine-learning-api-client.ts index d2923a3143..dc5271069f 100644 --- a/src/machine-learning/machine-learning-api-client.ts +++ b/src/machine-learning/machine-learning-api-client.ts @@ -258,8 +258,8 @@ export class MachineLearningApiClient { /** * Handles a Long Running Operation coming back from the server. * - * @param op The operation to handle - * @param options The options for polling + * @param op - The operation to handle + * @param options - The options for polling */ public handleOperation( op: OperationResponse, @@ -354,7 +354,7 @@ export class MachineLearningApiClient { /** * Gets the specified resource from the ML API. Resource names must be the full names including project * number prefix. - * @param fullName Full resource name of the resource to get. e.g. projects/123465/operations/987654 + * @param fullName - Full resource name of the resource to get. e.g. projects/123465/operations/987654 * @returns {Promise} A promise that fulfulls with the resource. */ private getResourceWithFullName(fullName: string): Promise { diff --git a/src/machine-learning/machine-learning-namespace.ts b/src/machine-learning/machine-learning-namespace.ts index 96a867fed2..1e48887db8 100644 --- a/src/machine-learning/machine-learning-namespace.ts +++ b/src/machine-learning/machine-learning-namespace.ts @@ -49,7 +49,7 @@ import { * var otherMachineLearning = admin.machineLearning(otherApp); * ``` * - * @param app Optional app whose `MachineLearning` service to + * @param app - Optional app whose `MachineLearning` service to * return. If not provided, the default `MachineLearning` service * will be returned. * diff --git a/src/machine-learning/machine-learning.ts b/src/machine-learning/machine-learning.ts index 849aad7546..947f4f7de4 100644 --- a/src/machine-learning/machine-learning.ts +++ b/src/machine-learning/machine-learning.ts @@ -66,7 +66,7 @@ export class MachineLearning { private readonly appInternal: App; /** - * @param app The app for this ML service. + * @param app - The app for this ML service. * @constructor * @internal */ @@ -94,7 +94,7 @@ export class MachineLearning { /** * Creates a model in the current Firebase project. * - * @param model The model to create. + * @param model - The model to create. * * @returns A Promise fulfilled with the created model. */ @@ -108,8 +108,8 @@ export class MachineLearning { /** * Updates a model's metadata or model file. * - * @param modelId The ID of the model to update. - * @param model The model fields to update. + * @param modelId - The ID of the model to update. + * @param model - The model fields to update. * * @returns A Promise fulfilled with the updated model. */ @@ -126,7 +126,7 @@ export class MachineLearning { * * A published model can be downloaded to client apps. * - * @param modelId The ID of the model to publish. + * @param modelId - The ID of the model to publish. * * @returns A Promise fulfilled with the published model. */ @@ -137,7 +137,7 @@ export class MachineLearning { /** * Unpublishes a Firebase ML model. * - * @param modelId The ID of the model to unpublish. + * @param modelId - The ID of the model to unpublish. * * @returns A Promise fulfilled with the unpublished model. */ @@ -148,7 +148,7 @@ export class MachineLearning { /** * Gets the model specified by the given ID. * - * @param modelId The ID of the model to get. + * @param modelId - The ID of the model to get. * * @returns A Promise fulfilled with the model object. */ @@ -160,7 +160,7 @@ export class MachineLearning { /** * Lists the current project's models. * - * @param options The listing options. + * @param options - The listing options. * * @returns A promise that * resolves with the current (filtered) list of models and the next page @@ -190,7 +190,7 @@ export class MachineLearning { /** * Deletes a model from the current project. * - * @param modelId The ID of the model to delete. + * @param modelId - The ID of the model to delete. */ public deleteModel(modelId: string): Promise { return this.client.deleteModel(modelId); @@ -323,7 +323,7 @@ export class Model { /** * True if the model is locked by a server-side operation. You can't make - * changes to a locked model. See {@link waitForUnlocked `waitForUnlocked()`}. + * changes to a locked model. See {@link Model.waitForUnlocked}. */ public get locked(): boolean { return (this.model.activeOperations?.length ?? 0) > 0; @@ -366,7 +366,7 @@ export class Model { /** * Wait for the model to be unlocked. * - * @param maxTimeMillis The maximum time in milliseconds to wait. + * @param maxTimeMillis - The maximum time in milliseconds to wait. * If not specified, a default maximum of 2 minutes is used. * * @returns A promise that resolves when the model is unlocked diff --git a/src/messaging/batch-request-internal.ts b/src/messaging/batch-request-internal.ts index 0e79af4c79..8244edf215 100644 --- a/src/messaging/batch-request-internal.ts +++ b/src/messaging/batch-request-internal.ts @@ -56,7 +56,7 @@ export class BatchRequestClient { * Sends the given array of sub requests as a single batch, and parses the results into an array * of HttpResponse objects. * - * @param requests An array of sub requests to send. + * @param requests - An array of sub requests to send. * @returns A promise that resolves when the send operation is complete. */ public send(requests: SubRequest[]): Promise { @@ -100,9 +100,9 @@ export class BatchRequestClient { * API, sets the content-type header to application/http, and the content-transfer-encoding to * binary. * - * @param request A sub request that will be used to populate the part. - * @param boundary Multipart boundary string. - * @param idx An index number that is used to set the content-id header. + * @param request - A sub request that will be used to populate the part. + * @param boundary - Multipart boundary string. + * @param idx - An index number that is used to set the content-id header. * @returns The part as a string that can be included in the HTTP body. */ function createPart(request: SubRequest, boundary: string, idx: number): string { @@ -122,7 +122,7 @@ function createPart(request: SubRequest, boundary: string, idx: number): string * format of the string is the wire format of a typical HTTP request, consisting of a header and a * body. * - * @param request The sub request to be serialized. + * @param request - The sub request to be serialized. * @returns String representation of the SubRequest. */ function serializeSubRequest(request: SubRequest): string { diff --git a/src/messaging/index.ts b/src/messaging/index.ts index 233bf98988..2371004e33 100644 --- a/src/messaging/index.ts +++ b/src/messaging/index.ts @@ -85,7 +85,7 @@ export { * const otherMessaging = getMessaging(otherApp); * ``` * - * @param app Optional app whose `Messaging` service to + * @param app - Optional app whose `Messaging` service to * return. If not provided, the default `Messaging` service will be returned. * * @returns The default `Messaging` service if no diff --git a/src/messaging/messaging-api-request-internal.ts b/src/messaging/messaging-api-request-internal.ts index 59f67ba3c1..b24154ba0c 100644 --- a/src/messaging/messaging-api-request-internal.ts +++ b/src/messaging/messaging-api-request-internal.ts @@ -47,7 +47,7 @@ export class FirebaseMessagingRequestHandler { private readonly batchClient: BatchRequestClient; /** - * @param app The app used to fetch access tokens to sign API requests. + * @param app - The app used to fetch access tokens to sign API requests. * @constructor */ constructor(app: App) { @@ -59,9 +59,9 @@ export class FirebaseMessagingRequestHandler { /** * Invokes the request handler with the provided request data. * - * @param host The host to which to send the request. - * @param path The path to which to send the request. - * @param requestData The request data. + * @param host - The host to which to send the request. + * @param path - The path to which to send the request. + * @param requestData - The request data. * @returns A promise that resolves with the response. */ public invokeRequestHandler(host: string, path: string, requestData: object): Promise { @@ -100,7 +100,7 @@ export class FirebaseMessagingRequestHandler { * Sends the given array of sub requests as a single batch to FCM, and parses the result into * a BatchResponse object. * - * @param requests An array of sub requests to send. + * @param requests - An array of sub requests to send. * @returns A promise that resolves when the send operation is complete. */ public sendBatchRequest(requests: SubRequest[]): Promise { diff --git a/src/messaging/messaging-api.ts b/src/messaging/messaging-api.ts index cdde578c2b..d41e6a61c2 100644 --- a/src/messaging/messaging-api.ts +++ b/src/messaging/messaging-api.ts @@ -405,7 +405,7 @@ export interface AndroidConfig { /** * A collection of data fields to be included in the message. All values must * be strings. When provided, overrides any data fields set on the top-level - * `admin.messaging.Message`.} + * {@link Message}. */ data?: { [key: string]: string }; diff --git a/src/messaging/messaging-errors-internal.ts b/src/messaging/messaging-errors-internal.ts index e87f635d55..a9dd8794af 100644 --- a/src/messaging/messaging-errors-internal.ts +++ b/src/messaging/messaging-errors-internal.ts @@ -22,7 +22,7 @@ import * as validator from '../utils/validator'; * Creates a new FirebaseMessagingError by extracting the error code, message and other relevant * details from an HTTP error response. * - * @param err The HttpError to convert into a Firebase error + * @param err - The HttpError to convert into a Firebase error * @returns A Firebase error that can be returned to the user. */ export function createFirebaseError(err: HttpError): FirebaseMessagingError { @@ -62,7 +62,7 @@ export function createFirebaseError(err: HttpError): FirebaseMessagingError { } /** - * @param response The response to check for errors. + * @param response - The response to check for errors. * @returns The error code if present; null otherwise. */ export function getErrorCode(response: any): string | null { @@ -92,7 +92,7 @@ export function getErrorCode(response: any): string | null { /** * Extracts error message from the given response object. * - * @param response The response to check for errors. + * @param response - The response to check for errors. * @returns The error message if present; null otherwise. */ function getErrorMessage(response: any): string | null { diff --git a/src/messaging/messaging-internal.ts b/src/messaging/messaging-internal.ts index 178ca0a0d7..c0379fac70 100644 --- a/src/messaging/messaging-internal.ts +++ b/src/messaging/messaging-internal.ts @@ -372,7 +372,7 @@ function validateApsAlert(alert: string | ApsAlert | undefined): void { * and notification fields. If successful, transforms the input object by renaming keys to valid * Android keys. Also transforms the ttl value to the format expected by FCM service. * - * @param config An object to be validated. + * @param config - An object to be validated. */ function validateAndroidConfig(config: AndroidConfig | undefined): void { if (typeof config === 'undefined') { diff --git a/src/messaging/messaging-namespace.ts b/src/messaging/messaging-namespace.ts index abfd432bfd..8171e9c212 100644 --- a/src/messaging/messaging-namespace.ts +++ b/src/messaging/messaging-namespace.ts @@ -73,7 +73,7 @@ import { * var otherMessaging = admin.messaging(otherApp); * ``` * - * @param app Optional app whose `Messaging` service to + * @param app - Optional app whose `Messaging` service to * return. If not provided, the default `Messaging` service will be returned. * * @returns The default `Messaging` service if no diff --git a/src/messaging/messaging.ts b/src/messaging/messaging.ts index 688ec08fdb..776eb1ec83 100644 --- a/src/messaging/messaging.ts +++ b/src/messaging/messaging.ts @@ -107,7 +107,7 @@ const MESSAGING_CONDITION_RESPONSE_KEYS_MAP = { /** * Maps a raw FCM server response to a MessagingDevicesResponse object. * - * @param response The raw FCM server response to map. + * @param response - The raw FCM server response to map. * * @returns The mapped MessagingDevicesResponse object. */ @@ -134,7 +134,7 @@ function mapRawResponseToDevicesResponse(response: object): MessagingDevicesResp /** * Maps a raw FCM server response to a MessagingDeviceGroupResponse object. * - * @param response The raw FCM server response to map. + * @param response - The raw FCM server response to map. * * @returns The mapped MessagingDeviceGroupResponse object. */ @@ -226,8 +226,8 @@ export class Messaging { /** * Sends the given message via FCM. * - * @param message The message payload. - * @param dryRun Whether to send the message in the dry-run + * @param message - The message payload. + * @param dryRun - Whether to send the message in the dry-run * (validation only) mode. * @returns A promise fulfilled with a unique message ID * string after the message has been successfully handed off to the FCM @@ -265,9 +265,9 @@ export class Messaging { * the list could be sent. Partial failures are indicated by a `BatchResponse` * return value. * - * @param messages A non-empty array + * @param messages - A non-empty array * containing up to 500 messages. - * @param dryRun Whether to send the messages in the dry-run + * @param dryRun - Whether to send the messages in the dry-run * (validation only) mode. * @returns A Promise fulfilled with an object representing the result of the * send operation. @@ -323,9 +323,9 @@ export class Messaging { * not sent to any of the tokens in the list. Partial failures are indicated by * a `BatchResponse` return value. * - * @param message A multicast message + * @param message - A multicast message * containing up to 500 tokens. - * @param dryRun Whether to send the message in the dry-run + * @param dryRun - Whether to send the message in the dry-run * (validation only) mode. * @returns A Promise fulfilled with an object representing the result of the * send operation. @@ -371,10 +371,10 @@ export class Messaging { * `registrationTokens` parameter containing an array of tokens to send * to multiple devices. * - * @param registrationToken A device registration token or an array of + * @param registrationToken - A device registration token or an array of * device registration tokens to which the message should be sent. - * @param payload The message payload. - * @param options Optional options to + * @param payload - The message payload. + * @param options - Optional options to * alter the message. * * @returns A promise fulfilled with the server's response after the message @@ -440,10 +440,10 @@ export class Messaging { * See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_device_group | * Send to a device group} for code samples and detailed documentation. * - * @param notificationKey The notification key for the device group to + * @param notificationKey - The notification key for the device group to * which to send the message. - * @param payload The message payload. - * @param options Optional options to + * @param payload - The message payload. + * @param options - Optional options to * alter the message. * * @returns A promise fulfilled with the server's response after the message @@ -523,9 +523,9 @@ export class Messaging { * See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_topic | * Send to a topic} for code samples and detailed documentation. * - * @param topic The topic to which to send the message. - * @param payload The message payload. - * @param options Optional options to + * @param topic - The topic to which to send the message. + * @param payload - The message payload. + * @param options - Optional options to * alter the message. * * @returns A promise fulfilled with the server's response after the message @@ -573,10 +573,10 @@ export class Messaging { * Send to a condition} * for code samples and detailed documentation. * - * @param condition The condition determining to which topics to send + * @param condition - The condition determining to which topics to send * the message. - * @param payload The message payload. - * @param options Optional options to + * @param payload - The message payload. + * @param options - Optional options to * alter the message. * * @returns A promise fulfilled with the server's response after the message @@ -632,9 +632,9 @@ export class Messaging { * for code samples and detailed documentation. Optionally, you can provide an * array of tokens to subscribe multiple devices. * - * @param registrationTokens A token or array of registration tokens + * @param registrationTokens - A token or array of registration tokens * for the devices to subscribe to the topic. - * @param topic The topic to which to subscribe. + * @param topic - The topic to which to subscribe. * * @returns A promise fulfilled with the server's response after the device has been * subscribed to the topic. @@ -659,9 +659,9 @@ export class Messaging { * for code samples and detailed documentation. Optionally, you can provide an * array of tokens to unsubscribe multiple devices. * - * @param registrationTokens A device registration token or an array of + * @param registrationTokens - A device registration token or an array of * device registration tokens to unsubscribe from the topic. - * @param topic The topic from which to unsubscribe. + * @param topic - The topic from which to unsubscribe. * * @returns A promise fulfilled with the server's response after the device has been * unsubscribed from the topic. @@ -703,11 +703,11 @@ export class Messaging { /** * Helper method which sends and handles topic subscription management requests. * - * @param registrationTokenOrTokens The registration token or an array of + * @param registrationTokenOrTokens - The registration token or an array of * registration tokens to unsubscribe from the topic. - * @param topic The topic to which to subscribe. - * @param methodName The name of the original method called. - * @param path The endpoint path to use for the request. + * @param topic - The topic to which to subscribe. + * @param methodName - The name of the original method called. + * @param path - The endpoint path to use for the request. * * @returns A Promise fulfilled with the parsed server * response. @@ -754,8 +754,8 @@ export class Messaging { /** * Validates the types of the messaging payload and options. If invalid, an error will be thrown. * - * @param payload The messaging payload to validate. - * @param options The messaging options to validate. + * @param payload - The messaging payload to validate. + * @param options - The messaging options to validate. */ private validateMessagingPayloadAndOptionsTypes( payload: MessagingPayload, @@ -781,7 +781,7 @@ export class Messaging { /** * Validates the messaging payload. If invalid, an error will be thrown. * - * @param payload The messaging payload to validate. + * @param payload - The messaging payload to validate. * * @returns A copy of the provided payload with whitelisted properties switched * from camelCase to underscore_case. @@ -872,7 +872,7 @@ export class Messaging { /** * Validates the messaging options. If invalid, an error will be thrown. * - * @param options The messaging options to validate. + * @param options - The messaging options to validate. * * @returns A copy of the provided options with whitelisted properties switched * from camelCase to underscore_case. @@ -951,9 +951,9 @@ export class Messaging { /** * Validates the type of the provided registration token(s). If invalid, an error will be thrown. * - * @param registrationTokenOrTokens The registration token(s) to validate. - * @param method The method name to use in error messages. - * @param errorInfo The error info to use if the registration tokens are invalid. + * @param registrationTokenOrTokens - The registration token(s) to validate. + * @param method - The method name to use in error messages. + * @param errorInfo - The error info to use if the registration tokens are invalid. */ private validateRegistrationTokensType( registrationTokenOrTokens: string | string[], @@ -973,10 +973,10 @@ export class Messaging { /** * Validates the provided registration tokens. If invalid, an error will be thrown. * - * @param registrationTokenOrTokens The registration token or an array of + * @param registrationTokenOrTokens - The registration token or an array of * registration tokens to validate. - * @param method The method name to use in error messages. - * @param errorInfo The error info to use if the registration tokens are invalid. + * @param method - The method name to use in error messages. + * @param errorInfo - The error info to use if the registration tokens are invalid. */ private validateRegistrationTokens( registrationTokenOrTokens: string | string[], @@ -1009,9 +1009,9 @@ export class Messaging { /** * Validates the type of the provided topic. If invalid, an error will be thrown. * - * @param topic The topic to validate. - * @param method The method name to use in error messages. - * @param errorInfo The error info to use if the topic is invalid. + * @param topic - The topic to validate. + * @param method - The method name to use in error messages. + * @param errorInfo - The error info to use if the topic is invalid. */ private validateTopicType( topic: string | string[], @@ -1030,9 +1030,9 @@ export class Messaging { /** * Validates the provided topic. If invalid, an error will be thrown. * - * @param topic The topic to validate. - * @param method The method name to use in error messages. - * @param errorInfo The error info to use if the topic is invalid. + * @param topic - The topic to validate. + * @param method - The method name to use in error messages. + * @param errorInfo - The error info to use if the topic is invalid. */ private validateTopic( topic: string, @@ -1051,7 +1051,7 @@ export class Messaging { /** * Normalizes the provided topic name by prepending it with '/topics/', if necessary. * - * @param topic The topic name to normalize. + * @param topic - The topic name to normalize. * * @returns The normalized topic name. */ diff --git a/src/project-management/android-app.ts b/src/project-management/android-app.ts index dc63b47da9..667b8be4d6 100644 --- a/src/project-management/android-app.ts +++ b/src/project-management/android-app.ts @@ -98,7 +98,7 @@ export class AndroidApp { /** * Sets the optional user-assigned display name of the app. * - * @param newDisplayName The new display name to set. + * @param newDisplayName - The new display name to set. * * @returns A promise that resolves when the display name has been set. */ @@ -148,7 +148,7 @@ export class AndroidApp { /** * Adds the given SHA certificate to this Android app. * - * @param certificateToAdd The SHA certificate to add. + * @param certificateToAdd - The SHA certificate to add. * * @returns A promise that resolves when the given certificate * has been added to the Android app. @@ -160,7 +160,7 @@ export class AndroidApp { /** * Deletes the specified SHA certificate from this Android app. * - * @param certificateToDelete The SHA certificate to delete. + * @param certificateToDelete - The SHA certificate to delete. * * @returns A promise that resolves when the specified * certificate has been removed from the Android app. @@ -223,12 +223,12 @@ export class ShaCertificate { * Creates a ShaCertificate using the given hash. The ShaCertificate's type (eg. 'sha256') is * automatically determined from the hash itself. * - * @param shaHash The sha256 or sha1 hash for this certificate. + * @param shaHash - The sha256 or sha1 hash for this certificate. * @example * ```javascript * var shaHash = shaCertificate.shaHash; * ``` - * @param resourceName The Firebase resource name for this certificate. This does not need to be + * @param resourceName - The Firebase resource name for this certificate. This does not need to be * set when creating a new certificate. * @example * ```javascript diff --git a/src/project-management/index.ts b/src/project-management/index.ts index 1bdff385f9..3a1f8490e1 100644 --- a/src/project-management/index.ts +++ b/src/project-management/index.ts @@ -48,7 +48,7 @@ export { IosApp, IosAppMetadata } from './ios-app'; * const otherProjectManagement = getProjectManagement(otherApp); * ``` * - * @param app Optional app whose `ProjectManagement` service + * @param app - Optional app whose `ProjectManagement` service * to return. If not provided, the default `ProjectManagement` service will * be returned. * * @returns The default `ProjectManagement` service if no app is provided or the diff --git a/src/project-management/ios-app.ts b/src/project-management/ios-app.ts index dc1ff3a23c..0789265f29 100644 --- a/src/project-management/ios-app.ts +++ b/src/project-management/ios-app.ts @@ -96,7 +96,7 @@ export class IosApp { /** * Sets the optional user-assigned display name of the app. * - * @param newDisplayName The new display name to set. + * @param newDisplayName - The new display name to set. * * @returns A promise that resolves when the display name has * been set. diff --git a/src/project-management/project-management-api-request-internal.ts b/src/project-management/project-management-api-request-internal.ts index 7c9651e50a..4f9a70705e 100644 --- a/src/project-management/project-management-api-request-internal.ts +++ b/src/project-management/project-management-api-request-internal.ts @@ -114,7 +114,7 @@ export class ProjectManagementRequestHandler { } /** - * @param app The app used to fetch access tokens to sign API requests. + * @param app - The app used to fetch access tokens to sign API requests. * @constructor */ constructor(app: App) { @@ -122,7 +122,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the project whose Android + * @param parentResourceName - Fully-qualified resource name of the project whose Android * apps you want to list. */ public listAndroidApps(parentResourceName: string): Promise { @@ -134,7 +134,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the project whose iOS apps + * @param parentResourceName - Fully-qualified resource name of the project whose iOS apps * you want to list. */ public listIosApps(parentResourceName: string): Promise { @@ -146,7 +146,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the project whose iOS apps + * @param parentResourceName - Fully-qualified resource name of the project whose iOS apps * you want to list. */ public listAppMetadata(parentResourceName: string): Promise { @@ -158,7 +158,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the project that you want + * @param parentResourceName - Fully-qualified resource name of the project that you want * to create the Android app within. */ public createAndroidApp( @@ -185,7 +185,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the project that you want + * @param parentResourceName - Fully-qualified resource name of the project that you want * to create the iOS app within. */ public createIosApp( @@ -212,7 +212,7 @@ export class ProjectManagementRequestHandler { } /** - * @param resourceName Fully-qualified resource name of the entity whose display name you + * @param resourceName - Fully-qualified resource name of the entity whose display name you * want to set. */ public setDisplayName(resourceName: string, newDisplayName: string): Promise { @@ -226,7 +226,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the Android app whose SHA + * @param parentResourceName - Fully-qualified resource name of the Android app whose SHA * certificates you want to get. */ public getAndroidShaCertificates(parentResourceName: string): Promise { @@ -235,7 +235,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the Android app that you + * @param parentResourceName - Fully-qualified resource name of the Android app that you * want to add the given SHA certificate to. */ public addAndroidShaCertificate( @@ -250,7 +250,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the app whose config you + * @param parentResourceName - Fully-qualified resource name of the app whose config you * want to get. */ public getConfig(parentResourceName: string): Promise { @@ -259,7 +259,7 @@ export class ProjectManagementRequestHandler { } /** - * @param parentResourceName Fully-qualified resource name of the entity that you want to + * @param parentResourceName - Fully-qualified resource name of the entity that you want to * get. */ public getResource(parentResourceName: string): Promise { @@ -267,7 +267,7 @@ export class ProjectManagementRequestHandler { } /** - * @param resourceName Fully-qualified resource name of the entity that you want to + * @param resourceName - Fully-qualified resource name of the entity that you want to * delete. */ public deleteResource(resourceName: string): Promise { diff --git a/src/project-management/project-management-namespace.ts b/src/project-management/project-management-namespace.ts index 60bfd34f8f..f3d48d1fe7 100644 --- a/src/project-management/project-management-namespace.ts +++ b/src/project-management/project-management-namespace.ts @@ -50,7 +50,7 @@ import { * var otherProjectManagement = admin.projectManagement(otherApp); * ``` * - * @param app Optional app whose `ProjectManagement` service + * @param app - Optional app whose `ProjectManagement` service * to return. If not provided, the default `ProjectManagement` service will * be returned. * * @returns The default `ProjectManagement` service if no app is provided or the diff --git a/src/project-management/project-management.ts b/src/project-management/project-management.ts index ff7a5089bb..ac74004555 100644 --- a/src/project-management/project-management.ts +++ b/src/project-management/project-management.ts @@ -32,7 +32,7 @@ export class ProjectManagement { private projectId: string; /** - * @param app The app for this ProjectManagement service. + * @param app - The app for this ProjectManagement service. * @constructor * @internal */ @@ -71,7 +71,7 @@ export class ProjectManagement { * * This method does not perform an RPC. * - * @param appId The `appId` of the Android app to reference. + * @param appId - The `appId` of the Android app to reference. * * @returns An `AndroidApp` object that references the specified Firebase Android app. */ @@ -85,7 +85,7 @@ export class ProjectManagement { * * This method does not perform an RPC. * - * @param appId The `appId` of the iOS app to reference. + * @param appId - The `appId` of the iOS app to reference. * * @returns An `iOSApp` object that references the specified Firebase iOS app. */ @@ -98,7 +98,7 @@ export class ProjectManagement { * * This method does not perform an RPC. * - * @param shaHash The SHA-1 or SHA-256 hash for this certificate. + * @param shaHash - The SHA-1 or SHA-256 hash for this certificate. * * @returns A `ShaCertificate` object contains the specified SHA hash. */ @@ -109,9 +109,9 @@ export class ProjectManagement { /** * Creates a new Firebase Android app associated with this Firebase project. * - * @param packageName The canonical package name of the Android App, + * @param packageName - The canonical package name of the Android App, * as would appear in the Google Play Developer Console. - * @param displayName An optional user-assigned display name for this + * @param displayName - An optional user-assigned display name for this * new app. * * @returns A promise that resolves to the newly created Android app. @@ -138,8 +138,8 @@ export class ProjectManagement { /** * Creates a new Firebase iOS app associated with this Firebase project. * - * @param bundleId The iOS app bundle ID to use for this new app. - * @param displayName An optional user-assigned display name for this + * @param bundleId - The iOS app bundle ID to use for this new app. + * @param displayName - An optional user-assigned display name for this * new app. * * @returns A promise that resolves to the newly created iOS app. @@ -184,7 +184,7 @@ export class ProjectManagement { /** * Update the display name of this Firebase project. * - * @param newDisplayName The new display name to be updated. + * @param newDisplayName - The new display name to be updated. * * @returns A promise that resolves when the project display name has been updated. */ diff --git a/src/remote-config/index.ts b/src/remote-config/index.ts index 1797298da5..e4719b2e43 100644 --- a/src/remote-config/index.ts +++ b/src/remote-config/index.ts @@ -60,7 +60,7 @@ export { RemoteConfig } from './remote-config'; * const otherRemoteConfig = getRemoteConfig(otherApp); * ``` * - * @param app Optional app for which to return the `RemoteConfig` service. + * @param app - Optional app for which to return the `RemoteConfig` service. * If not provided, the default `RemoteConfig` service is returned. * * @returns The default `RemoteConfig` service if no diff --git a/src/remote-config/remote-config-namespace.ts b/src/remote-config/remote-config-namespace.ts index 40b2698f66..4efb3baee1 100644 --- a/src/remote-config/remote-config-namespace.ts +++ b/src/remote-config/remote-config-namespace.ts @@ -52,7 +52,7 @@ import { RemoteConfig as TRemoteConfig } from './remote-config'; * var otherRemoteConfig = admin.remoteConfig(otherApp); * ``` * - * @param app Optional app for which to return the `RemoteConfig` service. + * @param app - Optional app for which to return the `RemoteConfig` service. * If not provided, the default `RemoteConfig` service is returned. * * @returns The default `RemoteConfig` service if no diff --git a/src/remote-config/remote-config.ts b/src/remote-config/remote-config.ts index 2b35a216a2..27cbd05793 100644 --- a/src/remote-config/remote-config.ts +++ b/src/remote-config/remote-config.ts @@ -36,7 +36,7 @@ export class RemoteConfig { private readonly client: RemoteConfigApiClient; /** - * @param app The app for this RemoteConfig service. + * @param app - The app for this RemoteConfig service. * @constructor * @internal */ @@ -59,7 +59,7 @@ export class RemoteConfig { /** * Gets the requested version of the {@link RemoteConfigTemplate} of the project. * - * @param versionNumber Version number of the Remote Config template to look up. + * @param versionNumber - Version number of the Remote Config template to look up. * * @returns A promise that fulfills with a `RemoteConfigTemplate`. */ @@ -73,7 +73,7 @@ export class RemoteConfig { /** * Validates a {@link RemoteConfigTemplate}. * - * @param template The Remote Config template to be validated. + * @param template - The Remote Config template to be validated. * @returns A promise that fulfills with the validated `RemoteConfigTemplate`. */ public validateTemplate(template: RemoteConfigTemplate): Promise { @@ -86,8 +86,8 @@ export class RemoteConfig { /** * Publishes a Remote Config template. * - * @param template The Remote Config template to be published. - * @param options Optional options object when publishing a Remote Config template: + * @param template - The Remote Config template to be published. + * @param options - Optional options object when publishing a Remote Config template: * - `force`: Setting this to `true` forces the Remote Config template to * be updated and circumvent the ETag. This approach is not recommended * because it risks causing the loss of updates to your Remote Config @@ -109,7 +109,7 @@ export class RemoteConfig { * A rollback is equivalent to getting a previously published Remote Config * template and re-publishing it using a force update. * - * @param versionNumber The version number of the Remote Config template to roll back to. + * @param versionNumber - The version number of the Remote Config template to roll back to. * The specified version number must be lower than the current version number, and not have * been deleted due to staleness. Only the last 300 versions are stored. * All versions that correspond to non-active Remote Config templates (that is, all except the @@ -129,7 +129,7 @@ export class RemoteConfig { * All versions that correspond to non-active Remote Config templates (i.e., all except the * template that is being fetched by clients) are also deleted if they are older than 90 days. * - * @param options Optional options object for getting a list of versions. + * @param options - Optional options object for getting a list of versions. * @returns A promise that fulfills with a `ListVersionsResult`. */ public listVersions(options?: ListVersionsOptions): Promise { @@ -145,7 +145,7 @@ export class RemoteConfig { /** * Creates and returns a new Remote Config template from a JSON string. * - * @param json The JSON string to populate a Remote Config template. + * @param json - The JSON string to populate a Remote Config template. * * @returns A new template instance. */ diff --git a/src/security-rules/index.ts b/src/security-rules/index.ts index 0f8c846b7e..b3b78a265a 100644 --- a/src/security-rules/index.ts +++ b/src/security-rules/index.ts @@ -46,12 +46,12 @@ export { * ``` * * @example - * ```javascript + * ```javascript * // Get the SecurityRules service for a given app * const otherSecurityRules = getSecurityRules(otherApp); * ``` * - * @param app Optional app to return the `SecurityRules` service + * @param app - Optional app to return the `SecurityRules` service * for. If not provided, the default `SecurityRules` service * is returned. * @returns The default `SecurityRules` service if no app is provided, or the diff --git a/src/security-rules/security-rules-namespace.ts b/src/security-rules/security-rules-namespace.ts index f418fcc883..52ffc592a7 100644 --- a/src/security-rules/security-rules-namespace.ts +++ b/src/security-rules/security-rules-namespace.ts @@ -24,33 +24,33 @@ import { } from './security-rules'; /** - * Gets the {@link securityRules.SecurityRules - * `SecurityRules`} service for the default app or a given app. - * - * `admin.securityRules()` can be called with no arguments to access the - * default app's {@link securityRules.SecurityRules - * `SecurityRules`} service, or as `admin.securityRules(app)` to access - * the {@link securityRules.SecurityRules `SecurityRules`} - * service associated with a specific app. - * - * @example - * ```javascript - * // Get the SecurityRules service for the default app - * var defaultSecurityRules = admin.securityRules(); - * ``` - * - * @example - * ```javascript - * // Get the SecurityRules service for a given app - * var otherSecurityRules = admin.securityRules(otherApp); - * ``` - * - * @param app Optional app to return the `SecurityRules` service - * for. If not provided, the default `SecurityRules` service - * is returned. - * @returns The default `SecurityRules` service if no app is provided, or the - * `SecurityRules` service associated with the provided app. - */ + * Gets the {@link firebase-admin.security-rules#SecurityRules} service for the default + * app or a given app. + * + * `admin.securityRules()` can be called with no arguments to access the + * default app's {@link firebase-admin.security-rules#SecurityRules} + * service, or as `admin.securityRules(app)` to access + * the {@link firebase-admin.security-rules#SecurityRules} + * service associated with a specific app. + * + * @example + * ```javascript + * // Get the SecurityRules service for the default app + * var defaultSecurityRules = admin.securityRules(); + * ``` + * + * @example + * ```javascript + * // Get the SecurityRules service for a given app + * var otherSecurityRules = admin.securityRules(otherApp); + * ``` + * + * @param app - Optional app to return the `SecurityRules` service + * for. If not provided, the default `SecurityRules` service + * is returned. + * @returns The default `SecurityRules` service if no app is provided, or the + * `SecurityRules` service associated with the provided app. + */ export declare function securityRules(app?: App): securityRules.SecurityRules; /* eslint-disable @typescript-eslint/no-namespace */ diff --git a/src/security-rules/security-rules.ts b/src/security-rules/security-rules.ts index 6a5eafa3d9..0f134e3073 100644 --- a/src/security-rules/security-rules.ts +++ b/src/security-rules/security-rules.ts @@ -131,7 +131,7 @@ export class SecurityRules { private readonly client: SecurityRulesApiClient; /** - * @param app The app for this SecurityRules service. + * @param app - The app for this SecurityRules service. * @constructor * @internal */ @@ -146,7 +146,7 @@ export class SecurityRules { * pass the short name "my-ruleset". Rejects with a `not-found` error if the * specified `Ruleset` cannot be found. * - * @param name Name of the `Ruleset` to retrieve. + * @param name - Name of the `Ruleset` to retrieve. * @returns A promise that fulfills with the specified `Ruleset`. */ public getRuleset(name: string): Promise { @@ -171,7 +171,7 @@ export class SecurityRules { * Creates a new {@link Ruleset} from the given * source, and applies it to Cloud Firestore. * - * @param source Rules source to apply. + * @param source - Rules source to apply. * @returns A promise that fulfills when the ruleset is created and released. */ public releaseFirestoreRulesetFromSource(source: string | Buffer): Promise { @@ -192,7 +192,7 @@ export class SecurityRules { * Applies the specified {@link Ruleset} ruleset * to Cloud Firestore. * - * @param ruleset Name of the ruleset to apply or a `RulesetMetadata` object + * @param ruleset - Name of the ruleset to apply or a `RulesetMetadata` object * containing the name. * @returns A promise that fulfills when the ruleset is released. */ @@ -205,7 +205,7 @@ export class SecurityRules { * Cloud Storage bucket. Rejects with a `not-found` error if no ruleset is applied * on the bucket. * - * @param bucket Optional name of the Cloud Storage bucket to be retrieved. If not + * @param bucket - Optional name of the Cloud Storage bucket to be retrieved. If not * specified, retrieves the ruleset applied on the default bucket configured via * `AppOptions`. * @returns A promise that fulfills with the Cloud Storage ruleset. @@ -224,8 +224,8 @@ export class SecurityRules { * Creates a new {@link Ruleset} from the given * source, and applies it to a Cloud Storage bucket. * - * @param source Rules source to apply. - * @param bucket Optional name of the Cloud Storage bucket to apply the rules on. If + * @param source - Rules source to apply. + * @param bucket - Optional name of the Cloud Storage bucket to apply the rules on. If * not specified, applies the ruleset on the default bucket configured via * {@link firebase-admin.app#AppOptions}. * @returns A promise that fulfills when the ruleset is created and released. @@ -251,9 +251,9 @@ export class SecurityRules { * Applies the specified {@link Ruleset} ruleset * to a Cloud Storage bucket. * - * @param ruleset Name of the ruleset to apply or a `RulesetMetadata` object + * @param ruleset - Name of the ruleset to apply or a `RulesetMetadata` object * containing the name. - * @param bucket Optional name of the Cloud Storage bucket to apply the rules on. If + * @param bucket - Optional name of the Cloud Storage bucket to apply the rules on. If * not specified, applies the ruleset on the default bucket configured via * {@link firebase-admin.app#AppOptions}. * @returns A promise that fulfills when the ruleset is released. @@ -280,9 +280,9 @@ export class SecurityRules { * 'firestore.rules', source); * ``` * - * @param name Name to assign to the rules file. This is usually a short file name that + * @param name - Name to assign to the rules file. This is usually a short file name that * helps identify the file in a ruleset. - * @param source Contents of the rules file. + * @param source - Contents of the rules file. * @returns A new rules file instance. */ public createRulesFileFromSource(name: string, source: string | Buffer): RulesFile { @@ -310,7 +310,7 @@ export class SecurityRules { /** * Creates a new {@link Ruleset} from the given {@link RulesFile}. * - * @param file Rules file to include in the new `Ruleset`. + * @param file - Rules file to include in the new `Ruleset`. * @returns A promise that fulfills with the newly created `Ruleset`. */ public createRuleset(file: RulesFile): Promise { @@ -333,7 +333,7 @@ export class SecurityRules { * pass the short name "my-ruleset". Rejects with a `not-found` error if the * specified `Ruleset` cannot be found. * - * @param name Name of the `Ruleset` to delete. + * @param name - Name of the `Ruleset` to delete. * @returns A promise that fulfills when the `Ruleset` is deleted. */ public deleteRuleset(name: string): Promise { @@ -343,9 +343,9 @@ export class SecurityRules { /** * Retrieves a page of ruleset metadata. * - * @param pageSize The page size, 100 if undefined. This is also the maximum allowed + * @param pageSize - The page size, 100 if undefined. This is also the maximum allowed * limit. - * @param nextPageToken The next page token. If not specified, returns rulesets + * @param nextPageToken - The next page token. If not specified, returns rulesets * starting without any offset. * @returns A promise that fulfills with a page of rulesets. */ diff --git a/src/storage/storage.ts b/src/storage/storage.ts index 3c7994fb27..b75e5739b1 100644 --- a/src/storage/storage.ts +++ b/src/storage/storage.ts @@ -33,7 +33,7 @@ export class Storage { private readonly storageClient: StorageClient; /** - * @param app The app for this Storage service. + * @param app - The app for this Storage service. * @constructor * @internal */ @@ -57,7 +57,7 @@ export class Storage { process.env.STORAGE_EMULATOR_HOST = `http://${process.env.FIREBASE_STORAGE_EMULATOR_HOST}`; } - + let storage: typeof StorageClient; try { storage = require('@google-cloud/storage').Storage; @@ -99,7 +99,7 @@ export class Storage { /** * Gets a reference to a Cloud Storage bucket. * - * @param name Optional name of the bucket to be retrieved. If name is not specified, + * @param name - Optional name of the bucket to be retrieved. If name is not specified, * retrieves a reference to the default bucket. * @returns A {@link https://cloud.google.com/nodejs/docs/reference/storage/latest/Bucket | Bucket} * instance as defined in the `@google-cloud/storage` package. diff --git a/src/utils/api-request.ts b/src/utils/api-request.ts index 129f2f5c83..9132fcaeb8 100644 --- a/src/utils/api-request.ts +++ b/src/utils/api-request.ts @@ -212,7 +212,7 @@ export function defaultRetryConfig(): RetryConfig { /** * Ensures that the given RetryConfig object is valid. * - * @param retry The configuration to be validated. + * @param retry - The configuration to be validated. */ function validateRetryConfig(retry: RetryConfig): void { if (!validator.isNumber(retry.maxRetries) || retry.maxRetries < 0) { @@ -260,7 +260,7 @@ export class HttpClient { * header should be explicitly set by the caller. To send a JSON leaf value (e.g. "foo", 5), parse it into JSON, * and pass as a string or a Buffer along with the appropriate content-type header. * - * @param config HTTP request to be sent. + * @param config - HTTP request to be sent. * @returns A promise that resolves with the response details. */ public send(config: HttpRequestConfig): Promise { @@ -271,8 +271,8 @@ export class HttpClient { * Sends an HTTP request. In the event of an error, retries the HTTP request according to the * RetryConfig set on the HttpClient. * - * @param config HTTP request to be sent. - * @param retryAttempts Number of retries performed up to now. + * @param config - HTTP request to be sent. + * @param retryAttempts - Number of retries performed up to now. * @returns A promise that resolves with the response details. */ private sendWithRetry(config: HttpRequestConfig, retryAttempts = 0): Promise { @@ -323,8 +323,8 @@ export class HttpClient { * Checks if a failed request is eligible for a retry, and if so returns the duration to wait before initiating * the retry. * - * @param retryAttempts Number of retries completed up to now. - * @param err The last encountered error. + * @param retryAttempts - Number of retries completed up to now. + * @param err - The last encountered error. * @returns A 2-tuple where the 1st element is the duration to wait before another retry, and the * 2nd element is a boolean indicating whether the request is eligible for a retry or not. */ @@ -401,8 +401,8 @@ export class HttpClient { /** * Parses a full HTTP response message containing both a header and a body. * - * @param response The HTTP response to be parsed. - * @param config The request configuration that resulted in the HTTP response. + * @param response - The HTTP response to be parsed. + * @param config - The request configuration that resulted in the HTTP response. * @returns An object containing the parsed HTTP status, headers and the body. */ export function parseHttpResponse( @@ -839,8 +839,8 @@ export class AuthorizedHttpClient extends HttpClient { /** * Class that defines all the settings for the backend API endpoint. * - * @param endpoint The Firebase Auth backend endpoint. - * @param httpMethod The http method for that endpoint. + * @param endpoint - The Firebase Auth backend endpoint. + * @param httpMethod - The http method for that endpoint. * @constructor */ export class ApiSettings { @@ -863,7 +863,7 @@ export class ApiSettings { } /** - * @param requestValidator The request validator. + * @param requestValidator - The request validator. * @returns The current API settings instance. */ public setRequestValidator(requestValidator: ApiCallbackFunction | null): ApiSettings { @@ -878,7 +878,7 @@ export class ApiSettings { } /** - * @param responseValidator The response validator. + * @param responseValidator - The response validator. * @returns The current API settings instance. */ public setResponseValidator(responseValidator: ApiCallbackFunction | null): ApiSettings { @@ -938,7 +938,7 @@ export class ExponentialBackoffPoller extends EventEmitter { /** * Poll the provided callback with exponential backoff. * - * @param callback The callback to be called for each poll. If the + * @param callback - The callback to be called for each poll. If the * callback resolves to a falsey value, polling will continue. Otherwise, the truthy * resolution will be used to resolve the promise returned by this method. * @returns A Promise which resolves to the truthy value returned by the provided diff --git a/src/utils/crypto-signer.ts b/src/utils/crypto-signer.ts index 789e2c81f3..ec33a3a714 100644 --- a/src/utils/crypto-signer.ts +++ b/src/utils/crypto-signer.ts @@ -39,7 +39,7 @@ export interface CryptoSigner { /** * Cryptographically signs a buffer of data. * - * @param buffer The data to be signed. + * @param buffer - The data to be signed. * @returns A promise that resolves with the raw bytes of a signature. */ sign(buffer: Buffer): Promise; @@ -63,7 +63,7 @@ export class ServiceAccountSigner implements CryptoSigner { /** * Creates a new CryptoSigner instance from the given service account credential. * - * @param credential A service account credential. + * @param credential - A service account credential. */ constructor(private readonly credential: ServiceAccountCredential) { if (!credential) { @@ -188,7 +188,7 @@ export class IAMSigner implements CryptoSigner { * Creates a new CryptoSigner instance for the given app. If the app has been initialized with a * service account credential, creates a ServiceAccountSigner. * - * @param app A FirebaseApp instance. + * @param app - A FirebaseApp instance. * @returns A CryptoSigner instance. */ export function cryptoSignerFromApp(app: App): CryptoSigner { @@ -210,7 +210,7 @@ export interface ExtendedErrorInfo extends ErrorInfo { /** * CryptoSigner error code structure. * - * @param errorInfo The error information (code and message). + * @param errorInfo - The error information (code and message). * @constructor */ export class CryptoSignerError extends Error { diff --git a/src/utils/deep-copy.ts b/src/utils/deep-copy.ts index 4b73e7da8f..1dde902c03 100644 --- a/src/utils/deep-copy.ts +++ b/src/utils/deep-copy.ts @@ -18,7 +18,7 @@ /** * Returns a deep copy of an object or array. * - * @param value The object or array to deep copy. + * @param value - The object or array to deep copy. * @returns A deep copy of the provided object or array. */ export function deepCopy(value: T): T { @@ -37,8 +37,8 @@ export function deepCopy(value: T): T { * Note that the target can be a function, in which case the properties in the source object are * copied onto it as static properties of the function. * - * @param target The value which is being extended. - * @param source The value whose properties are extending the target. + * @param target - The value which is being extended. + * @param source - The value whose properties are extending the target. * @returns The target value. */ export function deepExtend(target: any, source: any): any { diff --git a/src/utils/error.ts b/src/utils/error.ts index cde0d24335..881bad6d06 100644 --- a/src/utils/error.ts +++ b/src/utils/error.ts @@ -36,7 +36,7 @@ interface ServerToClientCode { /** * Firebase error code structure. This extends Error. * - * @param errorInfo The error information (code and message). + * @param errorInfo - The error information (code and message). * @constructor */ export class FirebaseError extends Error implements FirebaseErrorInterface { @@ -72,9 +72,9 @@ export class FirebaseError extends Error implements FirebaseErrorInterface { /** * A FirebaseError with a prefix in front of the error code. * - * @param codePrefix The prefix to apply to the error code. - * @param code The error code. - * @param message The error message. + * @param codePrefix - The prefix to apply to the error code. + * @param code - The error code. + * @param message - The error message. * @constructor */ export class PrefixedFirebaseError extends FirebaseError { @@ -95,7 +95,7 @@ export class PrefixedFirebaseError extends FirebaseError { * Allows the error type to be checked without needing to know implementation details * of the code prefixing. * - * @param code The non-prefixed error code to test against. + * @param code - The non-prefixed error code to test against. * @returns True if the code matches, false otherwise. */ public hasCode(code: string): boolean { @@ -106,8 +106,8 @@ export class PrefixedFirebaseError extends FirebaseError { /** * Firebase App error code structure. This extends PrefixedFirebaseError. * - * @param code The error code. - * @param message The error message. + * @param code - The error code. + * @param message - The error message. * @constructor */ export class FirebaseAppError extends PrefixedFirebaseError { @@ -125,7 +125,7 @@ export class FirebaseAppError extends PrefixedFirebaseError { /** * Firebase Auth error code structure. This extends PrefixedFirebaseError. * - * @param info The error code info. + * @param info - The error code info. * @param [message] The error message. This will override the default * message if provided. * @constructor @@ -134,7 +134,7 @@ export class FirebaseAuthError extends PrefixedFirebaseError { /** * Creates the developer-facing error corresponding to the backend error code. * - * @param serverErrorCode The server error code. + * @param serverErrorCode - The server error code. * @param [message] The error message. The default message is used * if not provided. * @param [rawServerResponse] The error's raw server response. @@ -185,7 +185,7 @@ export class FirebaseAuthError extends PrefixedFirebaseError { /** * Firebase Database error code structure. This extends FirebaseError. * - * @param info The error code info. + * @param info - The error code info. * @param [message] The error message. This will override the default * message if provided. * @constructor @@ -200,7 +200,7 @@ export class FirebaseDatabaseError extends FirebaseError { /** * Firebase Firestore error code structure. This extends FirebaseError. * - * @param info The error code info. + * @param info - The error code info. * @param [message] The error message. This will override the default * message if provided. * @constructor @@ -215,7 +215,7 @@ export class FirebaseFirestoreError extends FirebaseError { /** * Firebase instance ID error code structure. This extends FirebaseError. * - * @param info The error code info. + * @param info - The error code info. * @param [message] The error message. This will override the default * message if provided. * @constructor @@ -231,8 +231,8 @@ export class FirebaseInstanceIdError extends FirebaseError { /** * Firebase Installations service error code structure. This extends `FirebaseError`. * - * @param info The error code info. - * @param message The error message. This will override the default + * @param info - The error code info. + * @param message - The error message. This will override the default * message if provided. * @constructor */ @@ -248,7 +248,7 @@ export class FirebaseInstallationsError extends FirebaseError { /** * Firebase Messaging error code structure. This extends PrefixedFirebaseError. * - * @param info The error code info. + * @param info - The error code info. * @param [message] The error message. This will override the default message if provided. * @constructor */ @@ -256,7 +256,7 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { /** * Creates the developer-facing error corresponding to the backend error code. * - * @param serverErrorCode The server error code. + * @param serverErrorCode - The server error code. * @param [message] The error message. The default message is used * if not provided. * @param [rawServerResponse] The error's raw server response. @@ -322,8 +322,8 @@ export class FirebaseMessagingError extends PrefixedFirebaseError { /** * Firebase project management error code structure. This extends PrefixedFirebaseError. * - * @param code The error code. - * @param message The error message. + * @param code - The error code. + * @param message - The error message. * @constructor */ export class FirebaseProjectManagementError extends PrefixedFirebaseError { diff --git a/src/utils/index.ts b/src/utils/index.ts index a3b1b45bfc..ed9b2bc80e 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -37,8 +37,8 @@ export function getSdkVersion(): string { * * For example, this can be used to map underscore_cased properties to camelCase. * - * @param obj The object whose properties to rename. - * @param keyMap The mapping from old to new property names. + * @param obj - The object whose properties to rename. + * @param keyMap - The mapping from old to new property names. */ export function renameProperties(obj: {[key: string]: any}, keyMap: { [key: string]: string }): void { Object.keys(keyMap).forEach((oldKey) => { @@ -54,9 +54,9 @@ export function renameProperties(obj: {[key: string]: any}, keyMap: { [key: stri /** * Defines a new read-only property directly on an object and returns the object. * - * @param obj The object on which to define the property. - * @param prop The name of the property to be defined or modified. - * @param value The value associated with the property. + * @param obj - The object on which to define the property. + * @param prop - The name of the property to be defined or modified. + * @param value - The value associated with the property. */ export function addReadonlyGetter(obj: object, prop: string, value: any): void { Object.defineProperty(obj, prop, { @@ -73,7 +73,7 @@ export function addReadonlyGetter(obj: object, prop: string, value: any): void { * specified in either the Firebase app options, credentials or the local environment. * Otherwise returns null. * - * @param app A Firebase app to get the project ID from. + * @param app - A Firebase app to get the project ID from. * * @returns A project ID string or null. */ @@ -102,7 +102,7 @@ export function getExplicitProjectId(app: App): string | null { * configured, but the SDK has been initialized with ComputeEngineCredentials, this * method attempts to discover the project ID from the local metadata service. * - * @param app A Firebase app to get the project ID from. + * @param app - A Firebase app to get the project ID from. * * @returns A project ID string or null. */ @@ -123,7 +123,7 @@ export function findProjectId(app: App): Promise { /** * Encodes data using web-safe-base64. * - * @param data The raw data byte input. + * @param data - The raw data byte input. * @returns The base64-encoded result. */ export function toWebSafeBase64(data: Buffer): string { @@ -135,9 +135,9 @@ export function toWebSafeBase64(data: Buffer): string { * with corresponding arguments {projectId: '1234', api: 'resource'} * and returns output: 'project/1234/resource'. * - * @param str The original string where the param need to be + * @param str - The original string where the param need to be * replaced. - * @param params The optional parameters to replace in the + * @param params - The optional parameters to replace in the * string. * @returns The resulting formatted string. */ @@ -155,11 +155,11 @@ export function formatString(str: string, params?: object): string { * Generates the update mask for the provided object. * Note this will ignore the last key with value undefined. * - * @param obj The object to generate the update mask for. - * @param terminalPaths The optional map of keys for maximum paths to traverse. + * @param obj - The object to generate the update mask for. + * @param terminalPaths - The optional map of keys for maximum paths to traverse. * Nested objects beyond that path will be ignored. This is useful for * keys with variable object values. - * @param root The path so far. + * @param root - The path so far. * @returns The computed update mask list. */ export function generateUpdateMask( @@ -195,10 +195,10 @@ export function generateUpdateMask( /** * Transforms milliseconds to a protobuf Duration type string. * Returns the duration in seconds with up to nine fractional - * digits, terminated by 's'. Example: "3 seconds 0 nano seconds as 3s, + * digits, terminated by 's'. Example: "3 seconds 0 nano seconds as 3s, * 3 seconds 1 nano seconds as 3.000000001s". * - * @param milliseconds The duration in milliseconds. + * @param milliseconds - The duration in milliseconds. * @returns The resulting formatted string in seconds with up to nine fractional * digits, terminated by 's'. */ diff --git a/src/utils/jwt.ts b/src/utils/jwt.ts index ec54193b32..6e28fcb455 100644 --- a/src/utils/jwt.ts +++ b/src/utils/jwt.ts @@ -251,7 +251,7 @@ export class EmulatorSignatureVerifier implements SignatureVerifier { /** * Provides a callback to fetch public keys. * - * @param fetcher KeyFetcher to fetch the keys from. + * @param fetcher - KeyFetcher to fetch the keys from. * @returns A callback function that can be used to get keys in `jsonwebtoken`. */ function getKeyCallback(fetcher: KeyFetcher): jwt.GetPublicKeyOrSecret { @@ -277,9 +277,9 @@ function getKeyCallback(fetcher: KeyFetcher): jwt.GetPublicKeyOrSecret { * Verifies the signature of a JWT using the provided secret or a function to fetch * the secret or public key. * - * @param token The JWT to be verified. - * @param secretOrPublicKey The secret or a function to fetch the secret or public key. - * @param options JWT verification options. + * @param token - The JWT to be verified. + * @param secretOrPublicKey - The secret or a function to fetch the secret or public key. + * @param options - JWT verification options. * @returns A Promise resolving for a token with a valid signature. */ export function verifyJwtSignature(token: string, secretOrPublicKey: jwt.Secret | jwt.GetPublicKeyOrSecret, @@ -319,7 +319,7 @@ export function verifyJwtSignature(token: string, secretOrPublicKey: jwt.Secret /** * Decodes general purpose Firebase JWTs. * - * @param jwtToken JWT token to be decoded. + * @param jwtToken - JWT token to be decoded. * @returns Decoded token containing the header and payload. */ export function decodeJwt(jwtToken: string): Promise { @@ -345,8 +345,8 @@ export function decodeJwt(jwtToken: string): Promise { /** * Jwt error code structure. * - * @param code The error code. - * @param message The error message. + * @param code - The error code. + * @param message - The error message. * @constructor */ export class JwtError extends Error { diff --git a/src/utils/validator.ts b/src/utils/validator.ts index 523f91f33c..642437c2de 100644 --- a/src/utils/validator.ts +++ b/src/utils/validator.ts @@ -20,7 +20,7 @@ import url = require('url'); /** * Validates that a value is a byte buffer. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is byte buffer or not. */ export function isBuffer(value: any): value is Buffer { @@ -30,7 +30,7 @@ export function isBuffer(value: any): value is Buffer { /** * Validates that a value is an array. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is an array or not. */ export function isArray(value: any): value is T[] { @@ -40,7 +40,7 @@ export function isArray(value: any): value is T[] { /** * Validates that a value is a non-empty array. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a non-empty array or not. */ export function isNonEmptyArray(value: any): value is T[] { @@ -51,7 +51,7 @@ export function isNonEmptyArray(value: any): value is T[] { /** * Validates that a value is a boolean. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a boolean or not. */ export function isBoolean(value: any): boolean { @@ -62,7 +62,7 @@ export function isBoolean(value: any): boolean { /** * Validates that a value is a number. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a number or not. */ export function isNumber(value: any): boolean { @@ -73,7 +73,7 @@ export function isNumber(value: any): boolean { /** * Validates that a value is a string. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a string or not. */ export function isString(value: any): value is string { @@ -84,7 +84,7 @@ export function isString(value: any): value is string { /** * Validates that a value is a base64 string. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a base64 string or not. */ export function isBase64String(value: any): boolean { @@ -98,7 +98,7 @@ export function isBase64String(value: any): boolean { /** * Validates that a value is a non-empty string. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a non-empty string or not. */ export function isNonEmptyString(value: any): value is string { @@ -109,7 +109,7 @@ export function isNonEmptyString(value: any): value is string { /** * Validates that a value is a nullable object. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is an object or not. */ export function isObject(value: any): boolean { @@ -120,7 +120,7 @@ export function isObject(value: any): boolean { /** * Validates that a value is a non-null object. * - * @param value The value to validate. + * @param value - The value to validate. * @returns Whether the value is a non-null object or not. */ export function isNonNullObject(value: T | null | undefined): value is T { @@ -131,7 +131,7 @@ export function isNonNullObject(value: T | null | undefined): value is T { /** * Validates that a string is a valid Firebase Auth uid. * - * @param uid The string to validate. + * @param uid - The string to validate. * @returns Whether the string is a valid Firebase Auth uid. */ export function isUid(uid: any): boolean { @@ -142,7 +142,7 @@ export function isUid(uid: any): boolean { /** * Validates that a string is a valid Firebase Auth password. * - * @param password The password string to validate. + * @param password - The password string to validate. * @returns Whether the string is a valid Firebase Auth password. */ export function isPassword(password: any): boolean { @@ -154,7 +154,7 @@ export function isPassword(password: any): boolean { /** * Validates that a string is a valid email. * - * @param email The string to validate. + * @param email - The string to validate. * @returns Whether the string is valid email or not. */ export function isEmail(email: any): boolean { @@ -170,7 +170,7 @@ export function isEmail(email: any): boolean { /** * Validates that a string is a valid phone number. * - * @param phoneNumber The string to validate. + * @param phoneNumber - The string to validate. * @returns Whether the string is a valid phone number or not. */ export function isPhoneNumber(phoneNumber: any): boolean { @@ -189,7 +189,7 @@ export function isPhoneNumber(phoneNumber: any): boolean { /** * Validates that a string is a valid ISO date string. * - * @param dateString The string to validate. + * @param dateString - The string to validate. * @returns Whether the string is a valid ISO date string. */ export function isISODateString(dateString: any): boolean { @@ -205,7 +205,7 @@ export function isISODateString(dateString: any): boolean { /** * Validates that a string is a valid UTC date string. * - * @param dateString The string to validate. + * @param dateString - The string to validate. * @returns Whether the string is a valid UTC date string. */ export function isUTCDateString(dateString: any): boolean { @@ -221,7 +221,7 @@ export function isUTCDateString(dateString: any): boolean { /** * Validates that a string is a valid web URL. * - * @param urlStr The string to validate. + * @param urlStr - The string to validate. * @returns Whether the string is valid web URL or not. */ export function isURL(urlStr: any): boolean { @@ -267,7 +267,7 @@ export function isURL(urlStr: any): boolean { /** * Validates that the provided topic is a valid FCM topic name. * - * @param topic The topic to validate. + * @param topic - The topic to validate. * @returns Whether the provided topic is a valid FCM topic name. */ export function isTopic(topic: any): boolean { From f8583fc434d99bf5fb2d52f4015895763a777d35 Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Wed, 13 Oct 2021 10:31:32 -0700 Subject: [PATCH 2/4] fix: Fixing a lint error --- src/app/credential-internal.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/credential-internal.ts b/src/app/credential-internal.ts index 4d78f77c86..b1ecf6ca52 100644 --- a/src/app/credential-internal.ts +++ b/src/app/credential-internal.ts @@ -248,10 +248,11 @@ export class RefreshTokenCredential implements Credential { /** * Creates a new RefreshTokenCredential from the given parameters. * - * @param refreshTokenPathOrObject - Refresh token json object or path to a refresh token (user credentials) json file. + * @param refreshTokenPathOrObject - Refresh token json object or path to a refresh token + * (user credentials) json file. * @param httpAgent - Optional http.Agent to use when calling the remote token server. - * @param implicit - An optinal boolean indicating whether this credential was implicitly discovered from the - * environment, as opposed to being explicitly specified by the developer. + * @param implicit - An optinal boolean indicating whether this credential was implicitly + * discovered from the environment, as opposed to being explicitly specified by the developer. * * @constructor */ From 158e838dad26e81ed76b0038706ff014180dfe9f Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Wed, 13 Oct 2021 15:18:54 -0700 Subject: [PATCH 3/4] fix: Minor internal doc comment updates --- src/app-check/token-generator.ts | 6 +++--- src/app/core.ts | 2 +- src/auth/user-record.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app-check/token-generator.ts b/src/app-check/token-generator.ts index 50db1fa081..09f7106816 100644 --- a/src/app-check/token-generator.ts +++ b/src/app-check/token-generator.ts @@ -137,10 +137,10 @@ export class AppCheckTokenGenerator { } /** - * Creates a new FirebaseAppCheckError by extracting the error code, message and other relevant - * details from a CryptoSignerError. + * Creates a new `FirebaseAppCheckError` by extracting the error code, message and other relevant + * details from a `CryptoSignerError`. * - * @param err - The Error to convert into a FirebaseAppCheckError error + * @param err - The Error to convert into a `FirebaseAppCheckError` error * @returns A Firebase App Check error that can be returned to the user. */ export function appCheckErrorFromCryptoSignerError(err: Error): Error { diff --git a/src/app/core.ts b/src/app/core.ts index c703cd14c0..cf3372a0f9 100644 --- a/src/app/core.ts +++ b/src/app/core.ts @@ -155,7 +155,7 @@ export interface FirebaseError { * A string value containing the execution backtrace when the error originally * occurred. * - * This information can be useful to you and can be sent to + * This information can be useful for troubleshooting the cause of the error with * {@link https://firebase.google.com/support | Firebase Support} to help * explain the cause of an error. */ diff --git a/src/auth/user-record.ts b/src/auth/user-record.ts index dfaaf94340..6a825abe1c 100644 --- a/src/auth/user-record.ts +++ b/src/auth/user-record.ts @@ -379,7 +379,7 @@ export class UserInfo { /** - * @param response - The server side response returned from the getAccountInfo + * @param response - The server side response returned from the `getAccountInfo` * endpoint. * @constructor * @internal From 7ba28bc0a556840a8cdf068eb450b87f37b5060d Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Thu, 14 Oct 2021 10:10:42 -0700 Subject: [PATCH 4/4] fix: Updating doc comment --- src/app/core.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/core.ts b/src/app/core.ts index cf3372a0f9..f37e3c112c 100644 --- a/src/app/core.ts +++ b/src/app/core.ts @@ -156,8 +156,7 @@ export interface FirebaseError { * occurred. * * This information can be useful for troubleshooting the cause of the error with - * {@link https://firebase.google.com/support | Firebase Support} to help - * explain the cause of an error. + * {@link https://firebase.google.com/support | Firebase Support}. */ stack?: string;