firebase-admin
Version:
Firebase admin SDK for Node.js
138 lines (137 loc) • 7.21 kB
TypeScript
/*! firebase-admin v14.0.0 */
/*!
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseError, ErrorInfo } from '../utils/error';
/**
* The constant mapping for valid Auth client error codes.
*/
export declare const AuthErrorCode: {
readonly AUTH_BLOCKING_TOKEN_EXPIRED: "auth-blocking-token-expired";
readonly BILLING_NOT_ENABLED: "billing-not-enabled";
readonly CLAIMS_TOO_LARGE: "claims-too-large";
readonly CONFIGURATION_EXISTS: "configuration-exists";
readonly CONFIGURATION_NOT_FOUND: "configuration-not-found";
readonly ID_TOKEN_EXPIRED: "id-token-expired";
readonly INVALID_ARGUMENT: "argument-error";
readonly INVALID_CONFIG: "invalid-config";
readonly EMAIL_ALREADY_EXISTS: "email-already-exists";
readonly EMAIL_NOT_FOUND: "email-not-found";
readonly FORBIDDEN_CLAIM: "reserved-claim";
readonly INVALID_ID_TOKEN: "invalid-id-token";
readonly ID_TOKEN_REVOKED: "id-token-revoked";
readonly INTERNAL_ERROR: "internal-error";
readonly INVALID_CLAIMS: "invalid-claims";
readonly INVALID_CONTINUE_URI: "invalid-continue-uri";
readonly INVALID_CREATION_TIME: "invalid-creation-time";
readonly INVALID_CREDENTIAL: "invalid-credential";
readonly INVALID_DISABLED_FIELD: "invalid-disabled-field";
readonly INVALID_DISPLAY_NAME: "invalid-display-name";
readonly INVALID_DYNAMIC_LINK_DOMAIN: "invalid-dynamic-link-domain";
readonly INVALID_HOSTING_LINK_DOMAIN: "invalid-hosting-link-domain";
readonly INVALID_EMAIL_VERIFIED: "invalid-email-verified";
readonly INVALID_EMAIL: "invalid-email";
readonly INVALID_NEW_EMAIL: "invalid-new-email";
readonly INVALID_ENROLLED_FACTORS: "invalid-enrolled-factors";
readonly INVALID_ENROLLMENT_TIME: "invalid-enrollment-time";
readonly INVALID_HASH_ALGORITHM: "invalid-hash-algorithm";
readonly INVALID_HASH_BLOCK_SIZE: "invalid-hash-block-size";
readonly INVALID_HASH_DERIVED_KEY_LENGTH: "invalid-hash-derived-key-length";
readonly INVALID_HASH_KEY: "invalid-hash-key";
readonly INVALID_HASH_MEMORY_COST: "invalid-hash-memory-cost";
readonly INVALID_HASH_PARALLELIZATION: "invalid-hash-parallelization";
readonly INVALID_HASH_ROUNDS: "invalid-hash-rounds";
readonly INVALID_HASH_SALT_SEPARATOR: "invalid-hash-salt-separator";
readonly INVALID_LAST_SIGN_IN_TIME: "invalid-last-sign-in-time";
readonly INVALID_NAME: "invalid-name";
readonly INVALID_OAUTH_CLIENT_ID: "invalid-oauth-client-id";
readonly INVALID_PAGE_TOKEN: "invalid-page-token";
readonly INVALID_PASSWORD: "invalid-password";
readonly INVALID_PASSWORD_HASH: "invalid-password-hash";
readonly INVALID_PASSWORD_SALT: "invalid-password-salt";
readonly INVALID_PHONE_NUMBER: "invalid-phone-number";
readonly INVALID_PHOTO_URL: "invalid-photo-url";
readonly INVALID_PROJECT_ID: "invalid-project-id";
readonly INVALID_PROVIDER_DATA: "invalid-provider-data";
readonly INVALID_PROVIDER_ID: "invalid-provider-id";
readonly INVALID_PROVIDER_UID: "invalid-provider-uid";
readonly INVALID_OAUTH_RESPONSETYPE: "invalid-oauth-responsetype";
readonly INVALID_SESSION_COOKIE_DURATION: "invalid-session-cookie-duration";
readonly INVALID_TENANT_ID: "invalid-tenant-id";
readonly INVALID_TENANT_TYPE: "invalid-tenant-type";
readonly INVALID_TESTING_PHONE_NUMBER: "invalid-testing-phone-number";
readonly INVALID_UID: "invalid-uid";
readonly INVALID_USER_IMPORT: "invalid-user-import";
readonly INVALID_TOKENS_VALID_AFTER_TIME: "invalid-tokens-valid-after-time";
readonly MISMATCHING_TENANT_ID: "mismatching-tenant-id";
readonly MISSING_ANDROID_PACKAGE_NAME: "missing-android-package-name";
readonly MISSING_CONFIG: "missing-config";
readonly MISSING_CONTINUE_URI: "missing-continue-uri";
readonly MISSING_DISPLAY_NAME: "missing-display-name";
readonly MISSING_EMAIL: "missing-email";
readonly MISSING_IOS_BUNDLE_ID: "missing-ios-bundle-id";
readonly MISSING_ISSUER: "missing-issuer";
readonly MISSING_HASH_ALGORITHM: "missing-hash-algorithm";
readonly MISSING_OAUTH_CLIENT_ID: "missing-oauth-client-id";
readonly MISSING_OAUTH_CLIENT_SECRET: "missing-oauth-client-secret";
readonly MISSING_PROVIDER_ID: "missing-provider-id";
readonly MISSING_SAML_RELYING_PARTY_CONFIG: "missing-saml-relying-party-config";
readonly MAXIMUM_TEST_PHONE_NUMBER_EXCEEDED: "test-phone-number-limit-exceeded";
readonly MAXIMUM_USER_COUNT_EXCEEDED: "maximum-user-count-exceeded";
readonly MISSING_UID: "missing-uid";
readonly OPERATION_NOT_ALLOWED: "operation-not-allowed";
readonly PHONE_NUMBER_ALREADY_EXISTS: "phone-number-already-exists";
readonly PROJECT_NOT_FOUND: "project-not-found";
readonly INSUFFICIENT_PERMISSION: "insufficient-permission";
readonly QUOTA_EXCEEDED: "quota-exceeded";
readonly SECOND_FACTOR_LIMIT_EXCEEDED: "second-factor-limit-exceeded";
readonly SECOND_FACTOR_UID_ALREADY_EXISTS: "second-factor-uid-already-exists";
readonly SESSION_COOKIE_EXPIRED: "session-cookie-expired";
readonly SESSION_COOKIE_REVOKED: "session-cookie-revoked";
readonly TENANT_NOT_FOUND: "tenant-not-found";
readonly UID_ALREADY_EXISTS: "uid-already-exists";
readonly UNAUTHORIZED_DOMAIN: "unauthorized-continue-uri";
readonly UNSUPPORTED_FIRST_FACTOR: "unsupported-first-factor";
readonly UNSUPPORTED_SECOND_FACTOR: "unsupported-second-factor";
readonly UNSUPPORTED_TENANT_OPERATION: "unsupported-tenant-operation";
readonly UNVERIFIED_EMAIL: "unverified-email";
readonly USER_NOT_FOUND: "user-not-found";
readonly NOT_FOUND: "not-found";
readonly USER_DISABLED: "user-disabled";
readonly USER_NOT_DISABLED: "user-not-disabled";
readonly INVALID_RECAPTCHA_ACTION: "invalid-recaptcha-action";
readonly INVALID_RECAPTCHA_ENFORCEMENT_STATE: "invalid-recaptcha-enforcement-state";
readonly RECAPTCHA_NOT_ENABLED: "recaptcha-not-enabled";
};
/**
* The type definition for valid Auth client error codes.
*/
export type AuthErrorCode = typeof AuthErrorCode[keyof typeof AuthErrorCode];
/**
* Internal Auth client error code mapping used to construct ErrorInfo.
*/
export declare const authClientErrorCode: {
readonly [K in keyof typeof AuthErrorCode]: ErrorInfo;
};
/**
* Firebase Auth error code structure. This extends `FirebaseError`.
*/
export declare class FirebaseAuthError extends FirebaseError {
/**
* @param info - The error code info.
* @param message - The error message. This will override the default message if provided.
*/
constructor(info: ErrorInfo, message?: string);
}