firebase-admin 13.10.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/lib/app/core.d.ts +2 -38
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -1
- package/lib/app/credential-factory.js +1 -1
- package/lib/app/credential-internal.d.ts +1 -1
- package/lib/app/credential-internal.js +45 -14
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/error.d.ts +47 -0
- package/lib/app/error.js +57 -0
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +28 -12
- package/lib/app/index.d.ts +4 -3
- package/lib/app/index.js +6 -4
- package/lib/app/lifecycle.d.ts +2 -2
- package/lib/app/lifecycle.js +46 -21
- package/lib/app-check/app-check-api-client-internal.d.ts +2 -16
- package/lib/app-check/app-check-api-client-internal.js +57 -48
- package/lib/app-check/app-check-api.d.ts +1 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +6 -2
- package/lib/app-check/error.d.ts +47 -0
- package/lib/app-check/error.js +65 -0
- package/lib/app-check/index.d.ts +2 -1
- package/lib/app-check/index.js +5 -2
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +43 -13
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +39 -11
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +16 -16
- package/lib/auth/auth-api-request.d.ts +6 -4
- package/lib/auth/auth-api-request.js +277 -166
- package/lib/auth/auth-config.d.ts +31 -2
- package/lib/auth/auth-config.js +103 -103
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +2 -1
- package/lib/auth/base-auth.js +29 -27
- package/lib/auth/error.d.ts +137 -0
- package/lib/auth/error.js +690 -0
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +2 -2
- package/lib/auth/index.js +4 -4
- package/lib/auth/project-config-manager.d.ts +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +1 -1
- package/lib/auth/project-config.js +4 -4
- package/lib/auth/tenant-manager.d.ts +2 -1
- package/lib/auth/tenant-manager.js +13 -10
- package/lib/auth/tenant.d.ts +1 -1
- package/lib/auth/tenant.js +7 -7
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +13 -13
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +22 -22
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +22 -22
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +6 -6
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/data-connect/data-connect-api-client-internal.d.ts +1 -16
- package/lib/data-connect/data-connect-api-client-internal.js +122 -65
- package/lib/data-connect/data-connect-api.d.ts +1 -1
- package/lib/data-connect/data-connect-api.js +1 -1
- package/lib/data-connect/data-connect.d.ts +1 -1
- package/lib/data-connect/data-connect.js +1 -1
- package/lib/data-connect/error.d.ts +47 -0
- package/lib/data-connect/error.js +66 -0
- package/lib/data-connect/index.d.ts +2 -1
- package/lib/data-connect/index.js +5 -2
- package/lib/data-connect/validate-admin-args.d.ts +1 -1
- package/lib/data-connect/validate-admin-args.js +6 -3
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +11 -6
- package/lib/database/error.d.ts +39 -0
- package/lib/database/error.js +49 -0
- package/lib/database/index.d.ts +2 -2
- package/lib/database/index.js +4 -3
- package/lib/esm/app/index.js +2 -1
- package/lib/esm/app-check/index.js +2 -0
- package/lib/esm/auth/index.js +1 -1
- package/lib/esm/data-connect/index.js +2 -0
- package/lib/esm/database/index.js +1 -0
- package/lib/esm/eventarc/index.js +2 -0
- package/lib/esm/extensions/index.js +2 -0
- package/lib/esm/firebase-admin/index.js +13 -0
- package/lib/esm/firestore/index.js +1 -0
- package/lib/esm/functions/index.js +2 -0
- package/lib/esm/installations/index.js +1 -1
- package/lib/esm/machine-learning/index.js +2 -0
- package/lib/esm/messaging/index.js +1 -1
- package/lib/esm/phone-number-verification/index.js +2 -0
- package/lib/esm/project-management/index.js +1 -0
- package/lib/esm/remote-config/index.js +2 -0
- package/lib/esm/security-rules/index.js +2 -0
- package/lib/esm/storage/index.js +2 -0
- package/lib/eventarc/cloudevent.d.ts +1 -1
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/error.d.ts +38 -0
- package/lib/eventarc/error.js +47 -0
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +24 -9
- package/lib/eventarc/eventarc-utils.d.ts +1 -13
- package/lib/eventarc/eventarc-utils.js +34 -24
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +18 -6
- package/lib/eventarc/index.d.ts +2 -1
- package/lib/eventarc/index.js +5 -2
- package/lib/extensions/error.d.ts +41 -0
- package/lib/extensions/error.js +50 -0
- package/lib/extensions/extensions-api-client-internal.d.ts +1 -13
- package/lib/extensions/extensions-api-client-internal.js +40 -28
- package/lib/extensions/extensions-api.d.ts +1 -1
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +18 -5
- package/lib/extensions/index.d.ts +2 -1
- package/lib/extensions/index.js +5 -2
- package/lib/firestore/error.d.ts +41 -0
- package/lib/firestore/error.js +51 -0
- package/lib/firestore/firestore-internal.d.ts +2 -1
- package/lib/firestore/firestore-internal.js +6 -6
- package/lib/firestore/index.d.ts +2 -2
- package/lib/firestore/index.js +7 -7
- package/lib/functions/error.d.ts +48 -0
- package/lib/functions/error.js +67 -0
- package/lib/functions/functions-api-client-internal.d.ts +1 -16
- package/lib/functions/functions-api-client-internal.js +111 -71
- package/lib/functions/functions-api.d.ts +1 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +14 -4
- package/lib/functions/index.d.ts +2 -1
- package/lib/functions/index.js +5 -2
- package/lib/index.d.ts +13 -8
- package/lib/index.js +19 -3
- package/lib/installations/error.d.ts +48 -0
- package/lib/installations/error.js +73 -0
- package/lib/installations/index.d.ts +2 -2
- package/lib/installations/index.js +4 -4
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +11 -5
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +3 -3
- package/lib/machine-learning/error.d.ts +53 -0
- package/lib/machine-learning/error.js +84 -0
- package/lib/machine-learning/index.d.ts +2 -1
- package/lib/machine-learning/index.js +5 -2
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +61 -24
- package/lib/machine-learning/machine-learning.d.ts +1 -1
- package/lib/machine-learning/machine-learning.js +21 -9
- package/lib/messaging/error.d.ts +63 -0
- package/lib/messaging/error.js +286 -0
- package/lib/messaging/index.d.ts +3 -3
- package/lib/messaging/index.js +4 -4
- package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
- package/lib/messaging/messaging-api-request-internal.js +1 -1
- package/lib/messaging/messaging-api.d.ts +1 -280
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +2 -2
- package/lib/messaging/messaging-errors-internal.js +11 -8
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +48 -48
- package/lib/messaging/messaging.d.ts +1 -1
- package/lib/messaging/messaging.js +47 -50
- package/lib/phone-number-verification/error.d.ts +43 -0
- package/lib/phone-number-verification/error.js +48 -0
- package/lib/phone-number-verification/index.d.ts +2 -1
- package/lib/phone-number-verification/index.js +5 -2
- package/lib/phone-number-verification/phone-number-verification-api-client-internal.d.ts +1 -18
- package/lib/phone-number-verification/phone-number-verification-api-client-internal.js +2 -26
- package/lib/phone-number-verification/phone-number-verification-api.d.ts +2 -2
- package/lib/phone-number-verification/phone-number-verification-api.js +5 -4
- package/lib/phone-number-verification/phone-number-verification.d.ts +1 -1
- package/lib/phone-number-verification/phone-number-verification.js +1 -1
- package/lib/phone-number-verification/token-verifier.d.ts +1 -1
- package/lib/phone-number-verification/token-verifier.js +68 -20
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +15 -6
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/error.d.ts +45 -0
- package/lib/project-management/error.js +55 -0
- package/lib/project-management/index.d.ts +2 -2
- package/lib/project-management/index.js +4 -3
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +6 -3
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +18 -6
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +13 -7
- package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
- package/lib/remote-config/condition-evaluator-internal.js +2 -2
- package/lib/remote-config/error.d.ts +49 -0
- package/lib/remote-config/error.js +70 -0
- package/lib/remote-config/index.d.ts +2 -1
- package/lib/remote-config/index.js +5 -2
- package/lib/remote-config/internal/value-impl.d.ts +1 -1
- package/lib/remote-config/internal/value-impl.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +2 -13
- package/lib/remote-config/remote-config-api-client-internal.js +80 -52
- package/lib/remote-config/remote-config-api.d.ts +1 -1
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +92 -23
- package/lib/security-rules/error.d.ts +45 -0
- package/lib/security-rules/error.js +54 -0
- package/lib/security-rules/index.d.ts +2 -1
- package/lib/security-rules/index.js +5 -2
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +50 -18
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +32 -11
- package/lib/storage/error.d.ts +41 -0
- package/lib/storage/error.js +50 -0
- package/lib/storage/index.d.ts +2 -1
- package/lib/storage/index.js +8 -5
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +12 -12
- package/lib/storage/utils.d.ts +1 -1
- package/lib/storage/utils.js +1 -1
- package/lib/utils/api-request.d.ts +12 -12
- package/lib/utils/api-request.js +97 -55
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +2 -7
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +75 -570
- package/lib/utils/error.js +53 -1047
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +2 -2
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/jwt.js +1 -2
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +24 -29
- package/lib/app/firebase-namespace.d.ts +0 -163
- package/lib/app/firebase-namespace.js +0 -335
- package/lib/app-check/app-check-namespace.d.ts +0 -72
- package/lib/app-check/app-check-namespace.js +0 -18
- package/lib/auth/auth-namespace.d.ts +0 -257
- package/lib/auth/auth-namespace.js +0 -18
- package/lib/database/database-namespace.d.ts +0 -95
- package/lib/database/database-namespace.js +0 -23
- package/lib/default-namespace.d.ts +0 -24
- package/lib/default-namespace.js +0 -30
- package/lib/esm/instance-id/index.js +0 -6
- package/lib/firebase-namespace-api.d.ts +0 -91
- package/lib/firebase-namespace-api.js +0 -58
- package/lib/firestore/firestore-namespace.d.ts +0 -71
- package/lib/firestore/firestore-namespace.js +0 -52
- package/lib/installations/installations-namespace.d.ts +0 -55
- package/lib/installations/installations-namespace.js +0 -18
- package/lib/instance-id/index.d.ts +0 -62
- package/lib/instance-id/index.js +0 -74
- package/lib/instance-id/instance-id-namespace.d.ts +0 -38
- package/lib/instance-id/instance-id-namespace.js +0 -3
- package/lib/instance-id/instance-id.d.ts +0 -47
- package/lib/instance-id/instance-id.js +0 -77
- package/lib/machine-learning/machine-learning-namespace.d.ts +0 -81
- package/lib/machine-learning/machine-learning-namespace.js +0 -18
- package/lib/machine-learning/machine-learning-utils.d.ts +0 -22
- package/lib/machine-learning/machine-learning-utils.js +0 -47
- package/lib/messaging/messaging-namespace.d.ts +0 -161
- package/lib/messaging/messaging-namespace.js +0 -18
- package/lib/project-management/project-management-namespace.d.ts +0 -82
- package/lib/project-management/project-management-namespace.js +0 -18
- package/lib/remote-config/remote-config-namespace.d.ts +0 -141
- package/lib/remote-config/remote-config-namespace.js +0 -18
- package/lib/security-rules/security-rules-internal.d.ts +0 -21
- package/lib/security-rules/security-rules-internal.js +0 -26
- package/lib/security-rules/security-rules-namespace.d.ts +0 -69
- package/lib/security-rules/security-rules-namespace.js +0 -18
- package/lib/storage/storage-namespace.d.ts +0 -45
- package/lib/storage/storage-namespace.js +0 -18
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
|
+
"use strict";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright 2026 Google LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.FirebaseAuthError = exports.authClientErrorCode = exports.AuthErrorCode = void 0;
|
|
20
|
+
const error_1 = require("../utils/error");
|
|
21
|
+
const deep_copy_1 = require("../utils/deep-copy");
|
|
22
|
+
/**
|
|
23
|
+
* The constant mapping for valid Auth client error codes.
|
|
24
|
+
*/
|
|
25
|
+
exports.AuthErrorCode = {
|
|
26
|
+
AUTH_BLOCKING_TOKEN_EXPIRED: 'auth-blocking-token-expired',
|
|
27
|
+
BILLING_NOT_ENABLED: 'billing-not-enabled',
|
|
28
|
+
CLAIMS_TOO_LARGE: 'claims-too-large',
|
|
29
|
+
CONFIGURATION_EXISTS: 'configuration-exists',
|
|
30
|
+
CONFIGURATION_NOT_FOUND: 'configuration-not-found',
|
|
31
|
+
ID_TOKEN_EXPIRED: 'id-token-expired',
|
|
32
|
+
INVALID_ARGUMENT: 'argument-error',
|
|
33
|
+
INVALID_CONFIG: 'invalid-config',
|
|
34
|
+
EMAIL_ALREADY_EXISTS: 'email-already-exists',
|
|
35
|
+
EMAIL_NOT_FOUND: 'email-not-found',
|
|
36
|
+
FORBIDDEN_CLAIM: 'reserved-claim',
|
|
37
|
+
INVALID_ID_TOKEN: 'invalid-id-token',
|
|
38
|
+
ID_TOKEN_REVOKED: 'id-token-revoked',
|
|
39
|
+
INTERNAL_ERROR: 'internal-error',
|
|
40
|
+
INVALID_CLAIMS: 'invalid-claims',
|
|
41
|
+
INVALID_CONTINUE_URI: 'invalid-continue-uri',
|
|
42
|
+
INVALID_CREATION_TIME: 'invalid-creation-time',
|
|
43
|
+
INVALID_CREDENTIAL: 'invalid-credential',
|
|
44
|
+
INVALID_DISABLED_FIELD: 'invalid-disabled-field',
|
|
45
|
+
INVALID_DISPLAY_NAME: 'invalid-display-name',
|
|
46
|
+
INVALID_DYNAMIC_LINK_DOMAIN: 'invalid-dynamic-link-domain',
|
|
47
|
+
INVALID_HOSTING_LINK_DOMAIN: 'invalid-hosting-link-domain',
|
|
48
|
+
INVALID_EMAIL_VERIFIED: 'invalid-email-verified',
|
|
49
|
+
INVALID_EMAIL: 'invalid-email',
|
|
50
|
+
INVALID_NEW_EMAIL: 'invalid-new-email',
|
|
51
|
+
INVALID_ENROLLED_FACTORS: 'invalid-enrolled-factors',
|
|
52
|
+
INVALID_ENROLLMENT_TIME: 'invalid-enrollment-time',
|
|
53
|
+
INVALID_HASH_ALGORITHM: 'invalid-hash-algorithm',
|
|
54
|
+
INVALID_HASH_BLOCK_SIZE: 'invalid-hash-block-size',
|
|
55
|
+
INVALID_HASH_DERIVED_KEY_LENGTH: 'invalid-hash-derived-key-length',
|
|
56
|
+
INVALID_HASH_KEY: 'invalid-hash-key',
|
|
57
|
+
INVALID_HASH_MEMORY_COST: 'invalid-hash-memory-cost',
|
|
58
|
+
INVALID_HASH_PARALLELIZATION: 'invalid-hash-parallelization',
|
|
59
|
+
INVALID_HASH_ROUNDS: 'invalid-hash-rounds',
|
|
60
|
+
INVALID_HASH_SALT_SEPARATOR: 'invalid-hash-salt-separator',
|
|
61
|
+
INVALID_LAST_SIGN_IN_TIME: 'invalid-last-sign-in-time',
|
|
62
|
+
INVALID_NAME: 'invalid-name',
|
|
63
|
+
INVALID_OAUTH_CLIENT_ID: 'invalid-oauth-client-id',
|
|
64
|
+
INVALID_PAGE_TOKEN: 'invalid-page-token',
|
|
65
|
+
INVALID_PASSWORD: 'invalid-password',
|
|
66
|
+
INVALID_PASSWORD_HASH: 'invalid-password-hash',
|
|
67
|
+
INVALID_PASSWORD_SALT: 'invalid-password-salt',
|
|
68
|
+
INVALID_PHONE_NUMBER: 'invalid-phone-number',
|
|
69
|
+
INVALID_PHOTO_URL: 'invalid-photo-url',
|
|
70
|
+
INVALID_PROJECT_ID: 'invalid-project-id',
|
|
71
|
+
INVALID_PROVIDER_DATA: 'invalid-provider-data',
|
|
72
|
+
INVALID_PROVIDER_ID: 'invalid-provider-id',
|
|
73
|
+
INVALID_PROVIDER_UID: 'invalid-provider-uid',
|
|
74
|
+
INVALID_OAUTH_RESPONSETYPE: 'invalid-oauth-responsetype',
|
|
75
|
+
INVALID_SESSION_COOKIE_DURATION: 'invalid-session-cookie-duration',
|
|
76
|
+
INVALID_TENANT_ID: 'invalid-tenant-id',
|
|
77
|
+
INVALID_TENANT_TYPE: 'invalid-tenant-type',
|
|
78
|
+
INVALID_TESTING_PHONE_NUMBER: 'invalid-testing-phone-number',
|
|
79
|
+
INVALID_UID: 'invalid-uid',
|
|
80
|
+
INVALID_USER_IMPORT: 'invalid-user-import',
|
|
81
|
+
INVALID_TOKENS_VALID_AFTER_TIME: 'invalid-tokens-valid-after-time',
|
|
82
|
+
MISMATCHING_TENANT_ID: 'mismatching-tenant-id',
|
|
83
|
+
MISSING_ANDROID_PACKAGE_NAME: 'missing-android-package-name',
|
|
84
|
+
MISSING_CONFIG: 'missing-config',
|
|
85
|
+
MISSING_CONTINUE_URI: 'missing-continue-uri',
|
|
86
|
+
MISSING_DISPLAY_NAME: 'missing-display-name',
|
|
87
|
+
MISSING_EMAIL: 'missing-email',
|
|
88
|
+
MISSING_IOS_BUNDLE_ID: 'missing-ios-bundle-id',
|
|
89
|
+
MISSING_ISSUER: 'missing-issuer',
|
|
90
|
+
MISSING_HASH_ALGORITHM: 'missing-hash-algorithm',
|
|
91
|
+
MISSING_OAUTH_CLIENT_ID: 'missing-oauth-client-id',
|
|
92
|
+
MISSING_OAUTH_CLIENT_SECRET: 'missing-oauth-client-secret',
|
|
93
|
+
MISSING_PROVIDER_ID: 'missing-provider-id',
|
|
94
|
+
MISSING_SAML_RELYING_PARTY_CONFIG: 'missing-saml-relying-party-config',
|
|
95
|
+
MAXIMUM_TEST_PHONE_NUMBER_EXCEEDED: 'test-phone-number-limit-exceeded',
|
|
96
|
+
MAXIMUM_USER_COUNT_EXCEEDED: 'maximum-user-count-exceeded',
|
|
97
|
+
MISSING_UID: 'missing-uid',
|
|
98
|
+
OPERATION_NOT_ALLOWED: 'operation-not-allowed',
|
|
99
|
+
PHONE_NUMBER_ALREADY_EXISTS: 'phone-number-already-exists',
|
|
100
|
+
PROJECT_NOT_FOUND: 'project-not-found',
|
|
101
|
+
INSUFFICIENT_PERMISSION: 'insufficient-permission',
|
|
102
|
+
QUOTA_EXCEEDED: 'quota-exceeded',
|
|
103
|
+
SECOND_FACTOR_LIMIT_EXCEEDED: 'second-factor-limit-exceeded',
|
|
104
|
+
SECOND_FACTOR_UID_ALREADY_EXISTS: 'second-factor-uid-already-exists',
|
|
105
|
+
SESSION_COOKIE_EXPIRED: 'session-cookie-expired',
|
|
106
|
+
SESSION_COOKIE_REVOKED: 'session-cookie-revoked',
|
|
107
|
+
TENANT_NOT_FOUND: 'tenant-not-found',
|
|
108
|
+
UID_ALREADY_EXISTS: 'uid-already-exists',
|
|
109
|
+
UNAUTHORIZED_DOMAIN: 'unauthorized-continue-uri',
|
|
110
|
+
UNSUPPORTED_FIRST_FACTOR: 'unsupported-first-factor',
|
|
111
|
+
UNSUPPORTED_SECOND_FACTOR: 'unsupported-second-factor',
|
|
112
|
+
UNSUPPORTED_TENANT_OPERATION: 'unsupported-tenant-operation',
|
|
113
|
+
UNVERIFIED_EMAIL: 'unverified-email',
|
|
114
|
+
USER_NOT_FOUND: 'user-not-found',
|
|
115
|
+
NOT_FOUND: 'not-found',
|
|
116
|
+
USER_DISABLED: 'user-disabled',
|
|
117
|
+
USER_NOT_DISABLED: 'user-not-disabled',
|
|
118
|
+
INVALID_RECAPTCHA_ACTION: 'invalid-recaptcha-action',
|
|
119
|
+
INVALID_RECAPTCHA_ENFORCEMENT_STATE: 'invalid-recaptcha-enforcement-state',
|
|
120
|
+
RECAPTCHA_NOT_ENABLED: 'recaptcha-not-enabled',
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Internal Auth client error code mapping used to construct ErrorInfo.
|
|
124
|
+
*/
|
|
125
|
+
exports.authClientErrorCode = {
|
|
126
|
+
AUTH_BLOCKING_TOKEN_EXPIRED: {
|
|
127
|
+
code: exports.AuthErrorCode.AUTH_BLOCKING_TOKEN_EXPIRED,
|
|
128
|
+
message: 'The provided Firebase Auth Blocking token is expired.',
|
|
129
|
+
},
|
|
130
|
+
BILLING_NOT_ENABLED: {
|
|
131
|
+
code: exports.AuthErrorCode.BILLING_NOT_ENABLED,
|
|
132
|
+
message: 'Feature requires billing to be enabled.',
|
|
133
|
+
},
|
|
134
|
+
CLAIMS_TOO_LARGE: {
|
|
135
|
+
code: exports.AuthErrorCode.CLAIMS_TOO_LARGE,
|
|
136
|
+
message: 'Developer claims maximum payload size exceeded.',
|
|
137
|
+
},
|
|
138
|
+
CONFIGURATION_EXISTS: {
|
|
139
|
+
code: exports.AuthErrorCode.CONFIGURATION_EXISTS,
|
|
140
|
+
message: 'A configuration already exists with the provided identifier.',
|
|
141
|
+
},
|
|
142
|
+
CONFIGURATION_NOT_FOUND: {
|
|
143
|
+
code: exports.AuthErrorCode.CONFIGURATION_NOT_FOUND,
|
|
144
|
+
message: 'There is no configuration corresponding to the provided identifier.',
|
|
145
|
+
},
|
|
146
|
+
ID_TOKEN_EXPIRED: {
|
|
147
|
+
code: exports.AuthErrorCode.ID_TOKEN_EXPIRED,
|
|
148
|
+
message: 'The provided Firebase ID token is expired.',
|
|
149
|
+
},
|
|
150
|
+
INVALID_ARGUMENT: {
|
|
151
|
+
code: exports.AuthErrorCode.INVALID_ARGUMENT,
|
|
152
|
+
message: 'Invalid argument provided.',
|
|
153
|
+
},
|
|
154
|
+
INVALID_CONFIG: {
|
|
155
|
+
code: exports.AuthErrorCode.INVALID_CONFIG,
|
|
156
|
+
message: 'The provided configuration is invalid.',
|
|
157
|
+
},
|
|
158
|
+
EMAIL_ALREADY_EXISTS: {
|
|
159
|
+
code: exports.AuthErrorCode.EMAIL_ALREADY_EXISTS,
|
|
160
|
+
message: 'The email address is already in use by another account.',
|
|
161
|
+
},
|
|
162
|
+
EMAIL_NOT_FOUND: {
|
|
163
|
+
code: exports.AuthErrorCode.EMAIL_NOT_FOUND,
|
|
164
|
+
message: 'There is no user record corresponding to the provided email.',
|
|
165
|
+
},
|
|
166
|
+
FORBIDDEN_CLAIM: {
|
|
167
|
+
code: exports.AuthErrorCode.FORBIDDEN_CLAIM,
|
|
168
|
+
message: 'The specified developer claim is reserved and cannot be specified.',
|
|
169
|
+
},
|
|
170
|
+
INVALID_ID_TOKEN: {
|
|
171
|
+
code: exports.AuthErrorCode.INVALID_ID_TOKEN,
|
|
172
|
+
message: 'The provided ID token is not a valid Firebase ID token.',
|
|
173
|
+
},
|
|
174
|
+
ID_TOKEN_REVOKED: {
|
|
175
|
+
code: exports.AuthErrorCode.ID_TOKEN_REVOKED,
|
|
176
|
+
message: 'The Firebase ID token has been revoked.',
|
|
177
|
+
},
|
|
178
|
+
INTERNAL_ERROR: {
|
|
179
|
+
code: exports.AuthErrorCode.INTERNAL_ERROR,
|
|
180
|
+
message: 'An internal error has occurred.',
|
|
181
|
+
},
|
|
182
|
+
INVALID_CLAIMS: {
|
|
183
|
+
code: exports.AuthErrorCode.INVALID_CLAIMS,
|
|
184
|
+
message: 'The provided custom claim attributes are invalid.',
|
|
185
|
+
},
|
|
186
|
+
INVALID_CONTINUE_URI: {
|
|
187
|
+
code: exports.AuthErrorCode.INVALID_CONTINUE_URI,
|
|
188
|
+
message: 'The continue URL must be a valid URL string.',
|
|
189
|
+
},
|
|
190
|
+
INVALID_CREATION_TIME: {
|
|
191
|
+
code: exports.AuthErrorCode.INVALID_CREATION_TIME,
|
|
192
|
+
message: 'The creation time must be a valid UTC date string.',
|
|
193
|
+
},
|
|
194
|
+
INVALID_CREDENTIAL: {
|
|
195
|
+
code: exports.AuthErrorCode.INVALID_CREDENTIAL,
|
|
196
|
+
message: 'Invalid credential object provided.',
|
|
197
|
+
},
|
|
198
|
+
INVALID_DISABLED_FIELD: {
|
|
199
|
+
code: exports.AuthErrorCode.INVALID_DISABLED_FIELD,
|
|
200
|
+
message: 'The disabled field must be a boolean.',
|
|
201
|
+
},
|
|
202
|
+
INVALID_DISPLAY_NAME: {
|
|
203
|
+
code: exports.AuthErrorCode.INVALID_DISPLAY_NAME,
|
|
204
|
+
message: 'The displayName field must be a valid string.',
|
|
205
|
+
},
|
|
206
|
+
INVALID_DYNAMIC_LINK_DOMAIN: {
|
|
207
|
+
code: exports.AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN,
|
|
208
|
+
message: 'The provided dynamic link domain is not configured or authorized for the current project.',
|
|
209
|
+
},
|
|
210
|
+
INVALID_HOSTING_LINK_DOMAIN: {
|
|
211
|
+
code: exports.AuthErrorCode.INVALID_HOSTING_LINK_DOMAIN,
|
|
212
|
+
message: 'The provided hosting link domain is not configured in Firebase Hosting or ' +
|
|
213
|
+
'is not owned by the current project.',
|
|
214
|
+
},
|
|
215
|
+
INVALID_EMAIL_VERIFIED: {
|
|
216
|
+
code: exports.AuthErrorCode.INVALID_EMAIL_VERIFIED,
|
|
217
|
+
message: 'The emailVerified field must be a boolean.',
|
|
218
|
+
},
|
|
219
|
+
INVALID_EMAIL: {
|
|
220
|
+
code: exports.AuthErrorCode.INVALID_EMAIL,
|
|
221
|
+
message: 'The email address is improperly formatted.',
|
|
222
|
+
},
|
|
223
|
+
INVALID_NEW_EMAIL: {
|
|
224
|
+
code: exports.AuthErrorCode.INVALID_NEW_EMAIL,
|
|
225
|
+
message: 'The new email address is improperly formatted.',
|
|
226
|
+
},
|
|
227
|
+
INVALID_ENROLLED_FACTORS: {
|
|
228
|
+
code: exports.AuthErrorCode.INVALID_ENROLLED_FACTORS,
|
|
229
|
+
message: 'The enrolled factors must be a valid array of MultiFactorInfo objects.',
|
|
230
|
+
},
|
|
231
|
+
INVALID_ENROLLMENT_TIME: {
|
|
232
|
+
code: exports.AuthErrorCode.INVALID_ENROLLMENT_TIME,
|
|
233
|
+
message: 'The second factor enrollment time must be a valid UTC date string.',
|
|
234
|
+
},
|
|
235
|
+
INVALID_HASH_ALGORITHM: {
|
|
236
|
+
code: exports.AuthErrorCode.INVALID_HASH_ALGORITHM,
|
|
237
|
+
message: 'The hash algorithm must match one of the strings in the list of supported algorithms.',
|
|
238
|
+
},
|
|
239
|
+
INVALID_HASH_BLOCK_SIZE: {
|
|
240
|
+
code: exports.AuthErrorCode.INVALID_HASH_BLOCK_SIZE,
|
|
241
|
+
message: 'The hash block size must be a valid number.',
|
|
242
|
+
},
|
|
243
|
+
INVALID_HASH_DERIVED_KEY_LENGTH: {
|
|
244
|
+
code: exports.AuthErrorCode.INVALID_HASH_DERIVED_KEY_LENGTH,
|
|
245
|
+
message: 'The hash derived key length must be a valid number.',
|
|
246
|
+
},
|
|
247
|
+
INVALID_HASH_KEY: {
|
|
248
|
+
code: exports.AuthErrorCode.INVALID_HASH_KEY,
|
|
249
|
+
message: 'The hash key must a valid byte buffer.',
|
|
250
|
+
},
|
|
251
|
+
INVALID_HASH_MEMORY_COST: {
|
|
252
|
+
code: exports.AuthErrorCode.INVALID_HASH_MEMORY_COST,
|
|
253
|
+
message: 'The hash memory cost must be a valid number.',
|
|
254
|
+
},
|
|
255
|
+
INVALID_HASH_PARALLELIZATION: {
|
|
256
|
+
code: exports.AuthErrorCode.INVALID_HASH_PARALLELIZATION,
|
|
257
|
+
message: 'The hash parallelization must be a valid number.',
|
|
258
|
+
},
|
|
259
|
+
INVALID_HASH_ROUNDS: {
|
|
260
|
+
code: exports.AuthErrorCode.INVALID_HASH_ROUNDS,
|
|
261
|
+
message: 'The hash rounds must be a valid number.',
|
|
262
|
+
},
|
|
263
|
+
INVALID_HASH_SALT_SEPARATOR: {
|
|
264
|
+
code: exports.AuthErrorCode.INVALID_HASH_SALT_SEPARATOR,
|
|
265
|
+
message: 'The hashing algorithm salt separator field must be a valid byte buffer.',
|
|
266
|
+
},
|
|
267
|
+
INVALID_LAST_SIGN_IN_TIME: {
|
|
268
|
+
code: exports.AuthErrorCode.INVALID_LAST_SIGN_IN_TIME,
|
|
269
|
+
message: 'The last sign-in time must be a valid UTC date string.',
|
|
270
|
+
},
|
|
271
|
+
INVALID_NAME: {
|
|
272
|
+
code: exports.AuthErrorCode.INVALID_NAME,
|
|
273
|
+
message: 'The resource name provided is invalid.',
|
|
274
|
+
},
|
|
275
|
+
INVALID_OAUTH_CLIENT_ID: {
|
|
276
|
+
code: exports.AuthErrorCode.INVALID_OAUTH_CLIENT_ID,
|
|
277
|
+
message: 'The provided OAuth client ID is invalid.',
|
|
278
|
+
},
|
|
279
|
+
INVALID_PAGE_TOKEN: {
|
|
280
|
+
code: exports.AuthErrorCode.INVALID_PAGE_TOKEN,
|
|
281
|
+
message: 'The page token must be a valid non-empty string.',
|
|
282
|
+
},
|
|
283
|
+
INVALID_PASSWORD: {
|
|
284
|
+
code: exports.AuthErrorCode.INVALID_PASSWORD,
|
|
285
|
+
message: 'The password must be a string with at least 6 characters.',
|
|
286
|
+
},
|
|
287
|
+
INVALID_PASSWORD_HASH: {
|
|
288
|
+
code: exports.AuthErrorCode.INVALID_PASSWORD_HASH,
|
|
289
|
+
message: 'The password hash must be a valid byte buffer.',
|
|
290
|
+
},
|
|
291
|
+
INVALID_PASSWORD_SALT: {
|
|
292
|
+
code: exports.AuthErrorCode.INVALID_PASSWORD_SALT,
|
|
293
|
+
message: 'The password salt must be a valid byte buffer.',
|
|
294
|
+
},
|
|
295
|
+
INVALID_PHONE_NUMBER: {
|
|
296
|
+
code: exports.AuthErrorCode.INVALID_PHONE_NUMBER,
|
|
297
|
+
message: 'The phone number must be a non-empty E.164 standard compliant identifier string.',
|
|
298
|
+
},
|
|
299
|
+
INVALID_PHOTO_URL: {
|
|
300
|
+
code: exports.AuthErrorCode.INVALID_PHOTO_URL,
|
|
301
|
+
message: 'The photoURL field must be a valid URL.',
|
|
302
|
+
},
|
|
303
|
+
INVALID_PROJECT_ID: {
|
|
304
|
+
code: exports.AuthErrorCode.INVALID_PROJECT_ID,
|
|
305
|
+
message: 'Invalid parent project. Either parent project doesn\'t exist or didn\'t enable multi-tenancy.',
|
|
306
|
+
},
|
|
307
|
+
INVALID_PROVIDER_DATA: {
|
|
308
|
+
code: exports.AuthErrorCode.INVALID_PROVIDER_DATA,
|
|
309
|
+
message: 'The providerData must be a valid array of UserInfo objects.',
|
|
310
|
+
},
|
|
311
|
+
INVALID_PROVIDER_ID: {
|
|
312
|
+
code: exports.AuthErrorCode.INVALID_PROVIDER_ID,
|
|
313
|
+
message: 'The providerId must be a valid supported provider identifier string.',
|
|
314
|
+
},
|
|
315
|
+
INVALID_PROVIDER_UID: {
|
|
316
|
+
code: exports.AuthErrorCode.INVALID_PROVIDER_UID,
|
|
317
|
+
message: 'The providerUid must be a valid provider uid string.',
|
|
318
|
+
},
|
|
319
|
+
INVALID_OAUTH_RESPONSETYPE: {
|
|
320
|
+
code: exports.AuthErrorCode.INVALID_OAUTH_RESPONSETYPE,
|
|
321
|
+
message: 'Only exactly one OAuth responseType should be set to true.',
|
|
322
|
+
},
|
|
323
|
+
INVALID_SESSION_COOKIE_DURATION: {
|
|
324
|
+
code: exports.AuthErrorCode.INVALID_SESSION_COOKIE_DURATION,
|
|
325
|
+
message: 'The session cookie duration must be a valid number in milliseconds between 5 minutes and 2 weeks.',
|
|
326
|
+
},
|
|
327
|
+
INVALID_TENANT_ID: {
|
|
328
|
+
code: exports.AuthErrorCode.INVALID_TENANT_ID,
|
|
329
|
+
message: 'The tenant ID must be a valid non-empty string.',
|
|
330
|
+
},
|
|
331
|
+
INVALID_TENANT_TYPE: {
|
|
332
|
+
code: exports.AuthErrorCode.INVALID_TENANT_TYPE,
|
|
333
|
+
message: 'Tenant type must be either "full_service" or "lightweight".',
|
|
334
|
+
},
|
|
335
|
+
INVALID_TESTING_PHONE_NUMBER: {
|
|
336
|
+
code: exports.AuthErrorCode.INVALID_TESTING_PHONE_NUMBER,
|
|
337
|
+
message: 'Invalid testing phone number or invalid test code provided.',
|
|
338
|
+
},
|
|
339
|
+
INVALID_UID: {
|
|
340
|
+
code: exports.AuthErrorCode.INVALID_UID,
|
|
341
|
+
message: 'The uid must be a non-empty string with at most 128 characters.',
|
|
342
|
+
},
|
|
343
|
+
INVALID_USER_IMPORT: {
|
|
344
|
+
code: exports.AuthErrorCode.INVALID_USER_IMPORT,
|
|
345
|
+
message: 'The user record to import is invalid.',
|
|
346
|
+
},
|
|
347
|
+
INVALID_TOKENS_VALID_AFTER_TIME: {
|
|
348
|
+
code: exports.AuthErrorCode.INVALID_TOKENS_VALID_AFTER_TIME,
|
|
349
|
+
message: 'The tokensValidAfterTime must be a valid UTC number in seconds.',
|
|
350
|
+
},
|
|
351
|
+
MISMATCHING_TENANT_ID: {
|
|
352
|
+
code: exports.AuthErrorCode.MISMATCHING_TENANT_ID,
|
|
353
|
+
message: 'User tenant ID does not match with the current TenantAwareAuth tenant ID.',
|
|
354
|
+
},
|
|
355
|
+
MISSING_ANDROID_PACKAGE_NAME: {
|
|
356
|
+
code: exports.AuthErrorCode.MISSING_ANDROID_PACKAGE_NAME,
|
|
357
|
+
message: 'An Android Package Name must be provided if the Android App is required to be installed.',
|
|
358
|
+
},
|
|
359
|
+
MISSING_CONFIG: {
|
|
360
|
+
code: exports.AuthErrorCode.MISSING_CONFIG,
|
|
361
|
+
message: 'The provided configuration is missing required attributes.',
|
|
362
|
+
},
|
|
363
|
+
MISSING_CONTINUE_URI: {
|
|
364
|
+
code: exports.AuthErrorCode.MISSING_CONTINUE_URI,
|
|
365
|
+
message: 'A valid continue URL must be provided in the request.',
|
|
366
|
+
},
|
|
367
|
+
MISSING_DISPLAY_NAME: {
|
|
368
|
+
code: exports.AuthErrorCode.MISSING_DISPLAY_NAME,
|
|
369
|
+
message: 'The resource being created or edited is missing a valid display name.',
|
|
370
|
+
},
|
|
371
|
+
MISSING_EMAIL: {
|
|
372
|
+
code: exports.AuthErrorCode.MISSING_EMAIL,
|
|
373
|
+
message: 'The email is required for the specified action. For example, a multi-factor ' +
|
|
374
|
+
'user requires a verified email.',
|
|
375
|
+
},
|
|
376
|
+
MISSING_IOS_BUNDLE_ID: {
|
|
377
|
+
code: exports.AuthErrorCode.MISSING_IOS_BUNDLE_ID,
|
|
378
|
+
message: 'The request is missing an iOS Bundle ID.',
|
|
379
|
+
},
|
|
380
|
+
MISSING_ISSUER: {
|
|
381
|
+
code: exports.AuthErrorCode.MISSING_ISSUER,
|
|
382
|
+
message: 'The OAuth/OIDC configuration issuer must not be empty.',
|
|
383
|
+
},
|
|
384
|
+
MISSING_HASH_ALGORITHM: {
|
|
385
|
+
code: exports.AuthErrorCode.MISSING_HASH_ALGORITHM,
|
|
386
|
+
message: 'Importing users with password hashes requires that the hashing algorithm and its parameters be provided.',
|
|
387
|
+
},
|
|
388
|
+
MISSING_OAUTH_CLIENT_ID: {
|
|
389
|
+
code: exports.AuthErrorCode.MISSING_OAUTH_CLIENT_ID,
|
|
390
|
+
message: 'The OAuth/OIDC configuration client ID must not be empty.',
|
|
391
|
+
},
|
|
392
|
+
MISSING_OAUTH_CLIENT_SECRET: {
|
|
393
|
+
code: exports.AuthErrorCode.MISSING_OAUTH_CLIENT_SECRET,
|
|
394
|
+
message: 'The OAuth configuration client secret is required to enable OIDC code flow.',
|
|
395
|
+
},
|
|
396
|
+
MISSING_PROVIDER_ID: {
|
|
397
|
+
code: exports.AuthErrorCode.MISSING_PROVIDER_ID,
|
|
398
|
+
message: 'A valid provider ID must be provided in the request.',
|
|
399
|
+
},
|
|
400
|
+
MISSING_SAML_RELYING_PARTY_CONFIG: {
|
|
401
|
+
code: exports.AuthErrorCode.MISSING_SAML_RELYING_PARTY_CONFIG,
|
|
402
|
+
message: 'The SAML configuration provided is missing a relying party configuration.',
|
|
403
|
+
},
|
|
404
|
+
MAXIMUM_TEST_PHONE_NUMBER_EXCEEDED: {
|
|
405
|
+
code: exports.AuthErrorCode.MAXIMUM_TEST_PHONE_NUMBER_EXCEEDED,
|
|
406
|
+
message: 'The maximum allowed number of test phone number / code pairs has been exceeded.',
|
|
407
|
+
},
|
|
408
|
+
MAXIMUM_USER_COUNT_EXCEEDED: {
|
|
409
|
+
code: exports.AuthErrorCode.MAXIMUM_USER_COUNT_EXCEEDED,
|
|
410
|
+
message: 'The maximum allowed number of users to import has been exceeded.',
|
|
411
|
+
},
|
|
412
|
+
MISSING_UID: {
|
|
413
|
+
code: exports.AuthErrorCode.MISSING_UID,
|
|
414
|
+
message: 'A uid identifier is required for the current operation.',
|
|
415
|
+
},
|
|
416
|
+
OPERATION_NOT_ALLOWED: {
|
|
417
|
+
code: exports.AuthErrorCode.OPERATION_NOT_ALLOWED,
|
|
418
|
+
message: 'The given sign-in provider is disabled for this Firebase project. Enable it in the ' +
|
|
419
|
+
'Firebase console, under the sign-in method tab of the Auth section.',
|
|
420
|
+
},
|
|
421
|
+
PHONE_NUMBER_ALREADY_EXISTS: {
|
|
422
|
+
code: exports.AuthErrorCode.PHONE_NUMBER_ALREADY_EXISTS,
|
|
423
|
+
message: 'The user with the provided phone number already exists.',
|
|
424
|
+
},
|
|
425
|
+
PROJECT_NOT_FOUND: {
|
|
426
|
+
code: exports.AuthErrorCode.PROJECT_NOT_FOUND,
|
|
427
|
+
message: 'No Firebase project was found for the provided credential.',
|
|
428
|
+
},
|
|
429
|
+
INSUFFICIENT_PERMISSION: {
|
|
430
|
+
code: exports.AuthErrorCode.INSUFFICIENT_PERMISSION,
|
|
431
|
+
message: 'Credential implementation provided to initializeApp() via the "credential" property has insufficient permission to access the requested resource. See https://firebase.google.com/docs/admin/setup for details on how to authenticate this SDK with appropriate permissions.',
|
|
432
|
+
},
|
|
433
|
+
QUOTA_EXCEEDED: {
|
|
434
|
+
code: exports.AuthErrorCode.QUOTA_EXCEEDED,
|
|
435
|
+
message: 'The project quota for the specified operation has been exceeded.',
|
|
436
|
+
},
|
|
437
|
+
SECOND_FACTOR_LIMIT_EXCEEDED: {
|
|
438
|
+
code: exports.AuthErrorCode.SECOND_FACTOR_LIMIT_EXCEEDED,
|
|
439
|
+
message: 'The maximum number of allowed second factors on a user has been exceeded.',
|
|
440
|
+
},
|
|
441
|
+
SECOND_FACTOR_UID_ALREADY_EXISTS: {
|
|
442
|
+
code: exports.AuthErrorCode.SECOND_FACTOR_UID_ALREADY_EXISTS,
|
|
443
|
+
message: 'The specified second factor "uid" already exists.',
|
|
444
|
+
},
|
|
445
|
+
SESSION_COOKIE_EXPIRED: {
|
|
446
|
+
code: exports.AuthErrorCode.SESSION_COOKIE_EXPIRED,
|
|
447
|
+
message: 'The Firebase session cookie is expired.',
|
|
448
|
+
},
|
|
449
|
+
SESSION_COOKIE_REVOKED: {
|
|
450
|
+
code: exports.AuthErrorCode.SESSION_COOKIE_REVOKED,
|
|
451
|
+
message: 'The Firebase session cookie has been revoked.',
|
|
452
|
+
},
|
|
453
|
+
TENANT_NOT_FOUND: {
|
|
454
|
+
code: exports.AuthErrorCode.TENANT_NOT_FOUND,
|
|
455
|
+
message: 'There is no tenant corresponding to the provided identifier.',
|
|
456
|
+
},
|
|
457
|
+
UID_ALREADY_EXISTS: {
|
|
458
|
+
code: exports.AuthErrorCode.UID_ALREADY_EXISTS,
|
|
459
|
+
message: 'The user with the provided uid already exists.',
|
|
460
|
+
},
|
|
461
|
+
UNAUTHORIZED_DOMAIN: {
|
|
462
|
+
code: exports.AuthErrorCode.UNAUTHORIZED_DOMAIN,
|
|
463
|
+
message: 'The domain of the continue URL is not whitelisted. Whitelist the domain in the Firebase console.',
|
|
464
|
+
},
|
|
465
|
+
UNSUPPORTED_FIRST_FACTOR: {
|
|
466
|
+
code: exports.AuthErrorCode.UNSUPPORTED_FIRST_FACTOR,
|
|
467
|
+
message: 'A multi-factor user requires a supported first factor.',
|
|
468
|
+
},
|
|
469
|
+
UNSUPPORTED_SECOND_FACTOR: {
|
|
470
|
+
code: exports.AuthErrorCode.UNSUPPORTED_SECOND_FACTOR,
|
|
471
|
+
message: 'The request specified an unsupported type of second factor.',
|
|
472
|
+
},
|
|
473
|
+
UNSUPPORTED_TENANT_OPERATION: {
|
|
474
|
+
code: exports.AuthErrorCode.UNSUPPORTED_TENANT_OPERATION,
|
|
475
|
+
message: 'This operation is not supported in a multi-tenant context.',
|
|
476
|
+
},
|
|
477
|
+
UNVERIFIED_EMAIL: {
|
|
478
|
+
code: exports.AuthErrorCode.UNVERIFIED_EMAIL,
|
|
479
|
+
message: 'A verified email is required for the specified action. For example, a ' +
|
|
480
|
+
'multi-factor user requires a verified email.',
|
|
481
|
+
},
|
|
482
|
+
USER_NOT_FOUND: {
|
|
483
|
+
code: exports.AuthErrorCode.USER_NOT_FOUND,
|
|
484
|
+
message: 'There is no user record corresponding to the provided identifier.',
|
|
485
|
+
},
|
|
486
|
+
NOT_FOUND: {
|
|
487
|
+
code: exports.AuthErrorCode.NOT_FOUND,
|
|
488
|
+
message: 'The requested resource was not found.',
|
|
489
|
+
},
|
|
490
|
+
USER_DISABLED: {
|
|
491
|
+
code: exports.AuthErrorCode.USER_DISABLED,
|
|
492
|
+
message: 'The user record is disabled.',
|
|
493
|
+
},
|
|
494
|
+
USER_NOT_DISABLED: {
|
|
495
|
+
code: exports.AuthErrorCode.USER_NOT_DISABLED,
|
|
496
|
+
message: 'The user must be disabled in order to bulk delete it (or you must pass force=true).',
|
|
497
|
+
},
|
|
498
|
+
INVALID_RECAPTCHA_ACTION: {
|
|
499
|
+
code: exports.AuthErrorCode.INVALID_RECAPTCHA_ACTION,
|
|
500
|
+
message: 'reCAPTCHA action must be "BLOCK".',
|
|
501
|
+
},
|
|
502
|
+
INVALID_RECAPTCHA_ENFORCEMENT_STATE: {
|
|
503
|
+
code: exports.AuthErrorCode.INVALID_RECAPTCHA_ENFORCEMENT_STATE,
|
|
504
|
+
message: 'reCAPTCHA enforcement state must be either "OFF", "AUDIT" or "ENFORCE".',
|
|
505
|
+
},
|
|
506
|
+
RECAPTCHA_NOT_ENABLED: {
|
|
507
|
+
code: exports.AuthErrorCode.RECAPTCHA_NOT_ENABLED,
|
|
508
|
+
message: 'reCAPTCHA enterprise is not enabled.',
|
|
509
|
+
},
|
|
510
|
+
};
|
|
511
|
+
/** @const {Record<string, keyof typeof AuthErrorCode>} Auth server to client enum error codes. */
|
|
512
|
+
const AUTH_SERVER_TO_CLIENT_CODE = {
|
|
513
|
+
// Feature being configured or used requires a billing account.
|
|
514
|
+
BILLING_NOT_ENABLED: 'BILLING_NOT_ENABLED',
|
|
515
|
+
// Claims payload is too large.
|
|
516
|
+
CLAIMS_TOO_LARGE: 'CLAIMS_TOO_LARGE',
|
|
517
|
+
// Configuration being added already exists.
|
|
518
|
+
CONFIGURATION_EXISTS: 'CONFIGURATION_EXISTS',
|
|
519
|
+
// Configuration not found.
|
|
520
|
+
CONFIGURATION_NOT_FOUND: 'CONFIGURATION_NOT_FOUND',
|
|
521
|
+
// Provided credential has insufficient permissions.
|
|
522
|
+
INSUFFICIENT_PERMISSION: 'INSUFFICIENT_PERMISSION',
|
|
523
|
+
// Provided configuration has invalid fields.
|
|
524
|
+
INVALID_CONFIG: 'INVALID_CONFIG',
|
|
525
|
+
// Provided configuration identifier is invalid.
|
|
526
|
+
INVALID_CONFIG_ID: 'INVALID_PROVIDER_ID',
|
|
527
|
+
// ActionCodeSettings missing continue URL.
|
|
528
|
+
INVALID_CONTINUE_URI: 'INVALID_CONTINUE_URI',
|
|
529
|
+
// Dynamic link domain in provided ActionCodeSettings is not authorized.
|
|
530
|
+
INVALID_DYNAMIC_LINK_DOMAIN: 'INVALID_DYNAMIC_LINK_DOMAIN',
|
|
531
|
+
// Hosting link domain in provided ActionCodeSettings is not owned by the current project.
|
|
532
|
+
INVALID_HOSTING_LINK_DOMAIN: 'INVALID_HOSTING_LINK_DOMAIN',
|
|
533
|
+
// uploadAccount provides an email that already exists.
|
|
534
|
+
DUPLICATE_EMAIL: 'EMAIL_ALREADY_EXISTS',
|
|
535
|
+
// uploadAccount provides a localId that already exists.
|
|
536
|
+
DUPLICATE_LOCAL_ID: 'UID_ALREADY_EXISTS',
|
|
537
|
+
// Request specified a multi-factor enrollment ID that already exists.
|
|
538
|
+
DUPLICATE_MFA_ENROLLMENT_ID: 'SECOND_FACTOR_UID_ALREADY_EXISTS',
|
|
539
|
+
// setAccountInfo email already exists.
|
|
540
|
+
EMAIL_EXISTS: 'EMAIL_ALREADY_EXISTS',
|
|
541
|
+
// /accounts:sendOobCode for password reset when user is not found.
|
|
542
|
+
EMAIL_NOT_FOUND: 'EMAIL_NOT_FOUND',
|
|
543
|
+
// Reserved claim name.
|
|
544
|
+
FORBIDDEN_CLAIM: 'FORBIDDEN_CLAIM',
|
|
545
|
+
// Invalid claims provided.
|
|
546
|
+
INVALID_CLAIMS: 'INVALID_CLAIMS',
|
|
547
|
+
// Invalid session cookie duration.
|
|
548
|
+
INVALID_DURATION: 'INVALID_SESSION_COOKIE_DURATION',
|
|
549
|
+
// Invalid email provided.
|
|
550
|
+
INVALID_EMAIL: 'INVALID_EMAIL',
|
|
551
|
+
// Invalid new email provided.
|
|
552
|
+
INVALID_NEW_EMAIL: 'INVALID_NEW_EMAIL',
|
|
553
|
+
// Invalid tenant display name. This can be thrown on CreateTenant and UpdateTenant.
|
|
554
|
+
INVALID_DISPLAY_NAME: 'INVALID_DISPLAY_NAME',
|
|
555
|
+
// Invalid ID token provided.
|
|
556
|
+
INVALID_ID_TOKEN: 'INVALID_ID_TOKEN',
|
|
557
|
+
// Invalid tenant/parent resource name.
|
|
558
|
+
INVALID_NAME: 'INVALID_NAME',
|
|
559
|
+
// OIDC configuration has an invalid OAuth client ID.
|
|
560
|
+
INVALID_OAUTH_CLIENT_ID: 'INVALID_OAUTH_CLIENT_ID',
|
|
561
|
+
// Invalid page token.
|
|
562
|
+
INVALID_PAGE_SELECTION: 'INVALID_PAGE_TOKEN',
|
|
563
|
+
// Invalid phone number.
|
|
564
|
+
INVALID_PHONE_NUMBER: 'INVALID_PHONE_NUMBER',
|
|
565
|
+
// Invalid agent project. Either agent project doesn't exist or didn't enable multi-tenancy.
|
|
566
|
+
INVALID_PROJECT_ID: 'INVALID_PROJECT_ID',
|
|
567
|
+
// Invalid provider ID.
|
|
568
|
+
INVALID_PROVIDER_ID: 'INVALID_PROVIDER_ID',
|
|
569
|
+
// Invalid service account.
|
|
570
|
+
INVALID_SERVICE_ACCOUNT: 'INVALID_CREDENTIAL',
|
|
571
|
+
// Invalid testing phone number.
|
|
572
|
+
INVALID_TESTING_PHONE_NUMBER: 'INVALID_TESTING_PHONE_NUMBER',
|
|
573
|
+
// Invalid tenant type.
|
|
574
|
+
INVALID_TENANT_TYPE: 'INVALID_TENANT_TYPE',
|
|
575
|
+
// Missing Android package name.
|
|
576
|
+
MISSING_ANDROID_PACKAGE_NAME: 'MISSING_ANDROID_PACKAGE_NAME',
|
|
577
|
+
// Missing configuration.
|
|
578
|
+
MISSING_CONFIG: 'MISSING_CONFIG',
|
|
579
|
+
// Missing configuration identifier.
|
|
580
|
+
MISSING_CONFIG_ID: 'MISSING_PROVIDER_ID',
|
|
581
|
+
// Missing tenant display name: This can be thrown on CreateTenant and UpdateTenant.
|
|
582
|
+
MISSING_DISPLAY_NAME: 'MISSING_DISPLAY_NAME',
|
|
583
|
+
// Email is required for the specified action. For example a multi-factor user requires
|
|
584
|
+
// a verified email.
|
|
585
|
+
MISSING_EMAIL: 'MISSING_EMAIL',
|
|
586
|
+
// Missing iOS bundle ID.
|
|
587
|
+
MISSING_IOS_BUNDLE_ID: 'MISSING_IOS_BUNDLE_ID',
|
|
588
|
+
// Missing OIDC issuer.
|
|
589
|
+
MISSING_ISSUER: 'MISSING_ISSUER',
|
|
590
|
+
// No localId provided (deleteAccount missing localId).
|
|
591
|
+
MISSING_LOCAL_ID: 'MISSING_UID',
|
|
592
|
+
// OIDC configuration is missing an OAuth client ID.
|
|
593
|
+
MISSING_OAUTH_CLIENT_ID: 'MISSING_OAUTH_CLIENT_ID',
|
|
594
|
+
// Missing provider ID.
|
|
595
|
+
MISSING_PROVIDER_ID: 'MISSING_PROVIDER_ID',
|
|
596
|
+
// Missing SAML RP config.
|
|
597
|
+
MISSING_SAML_RELYING_PARTY_CONFIG: 'MISSING_SAML_RELYING_PARTY_CONFIG',
|
|
598
|
+
// Empty user list in uploadAccount.
|
|
599
|
+
MISSING_USER_ACCOUNT: 'MISSING_UID',
|
|
600
|
+
// Password auth disabled in console.
|
|
601
|
+
OPERATION_NOT_ALLOWED: 'OPERATION_NOT_ALLOWED',
|
|
602
|
+
// Provided credential has insufficient permissions.
|
|
603
|
+
PERMISSION_DENIED: 'INSUFFICIENT_PERMISSION',
|
|
604
|
+
// Phone number already exists.
|
|
605
|
+
PHONE_NUMBER_EXISTS: 'PHONE_NUMBER_ALREADY_EXISTS',
|
|
606
|
+
// Project not found.
|
|
607
|
+
PROJECT_NOT_FOUND: 'PROJECT_NOT_FOUND',
|
|
608
|
+
// In multi-tenancy context: project creation quota exceeded.
|
|
609
|
+
QUOTA_EXCEEDED: 'QUOTA_EXCEEDED',
|
|
610
|
+
// Currently only 5 second factors can be set on the same user.
|
|
611
|
+
SECOND_FACTOR_LIMIT_EXCEEDED: 'SECOND_FACTOR_LIMIT_EXCEEDED',
|
|
612
|
+
// Tenant not found.
|
|
613
|
+
TENANT_NOT_FOUND: 'TENANT_NOT_FOUND',
|
|
614
|
+
// Tenant ID mismatch.
|
|
615
|
+
TENANT_ID_MISMATCH: 'MISMATCHING_TENANT_ID',
|
|
616
|
+
// Token expired error.
|
|
617
|
+
TOKEN_EXPIRED: 'ID_TOKEN_EXPIRED',
|
|
618
|
+
// Continue URL provided in ActionCodeSettings has a domain that is not whitelisted.
|
|
619
|
+
UNAUTHORIZED_DOMAIN: 'UNAUTHORIZED_DOMAIN',
|
|
620
|
+
// A multi-factor user requires a supported first factor.
|
|
621
|
+
UNSUPPORTED_FIRST_FACTOR: 'UNSUPPORTED_FIRST_FACTOR',
|
|
622
|
+
// The request specified an unsupported type of second factor.
|
|
623
|
+
UNSUPPORTED_SECOND_FACTOR: 'UNSUPPORTED_SECOND_FACTOR',
|
|
624
|
+
// Operation is not supported in a multi-tenant context.
|
|
625
|
+
UNSUPPORTED_TENANT_OPERATION: 'UNSUPPORTED_TENANT_OPERATION',
|
|
626
|
+
// A verified email is required for the specified action. For example a multi-factor user
|
|
627
|
+
// requires a verified email.
|
|
628
|
+
UNVERIFIED_EMAIL: 'UNVERIFIED_EMAIL',
|
|
629
|
+
// User on which action is to be performed is not found.
|
|
630
|
+
USER_NOT_FOUND: 'USER_NOT_FOUND',
|
|
631
|
+
// User record is disabled.
|
|
632
|
+
USER_DISABLED: 'USER_DISABLED',
|
|
633
|
+
// Password provided is too weak.
|
|
634
|
+
WEAK_PASSWORD: 'INVALID_PASSWORD',
|
|
635
|
+
// Unrecognized reCAPTCHA action.
|
|
636
|
+
INVALID_RECAPTCHA_ACTION: 'INVALID_RECAPTCHA_ACTION',
|
|
637
|
+
// Unrecognized reCAPTCHA enforcement state.
|
|
638
|
+
INVALID_RECAPTCHA_ENFORCEMENT_STATE: 'INVALID_RECAPTCHA_ENFORCEMENT_STATE',
|
|
639
|
+
// reCAPTCHA is not enabled for account defender.
|
|
640
|
+
RECAPTCHA_NOT_ENABLED: 'RECAPTCHA_NOT_ENABLED'
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Firebase Auth error code structure. This extends `FirebaseError`.
|
|
644
|
+
*/
|
|
645
|
+
class FirebaseAuthError extends error_1.FirebaseError {
|
|
646
|
+
/**
|
|
647
|
+
* Creates the developer-facing error corresponding to the backend error code.
|
|
648
|
+
*
|
|
649
|
+
* @param serverErrorCode - The server error code.
|
|
650
|
+
* @param [message] The error message. The default message is used
|
|
651
|
+
* if not provided.
|
|
652
|
+
* @param [serverError] The error's raw server response.
|
|
653
|
+
* @returns The corresponding developer-facing error.
|
|
654
|
+
* @internal
|
|
655
|
+
*/
|
|
656
|
+
static fromServerError(serverErrorCode, message, serverError) {
|
|
657
|
+
// serverErrorCode could contain additional details:
|
|
658
|
+
// ERROR_CODE : Detailed message which can also contain colons
|
|
659
|
+
const colonSeparator = (serverErrorCode || '').indexOf(':');
|
|
660
|
+
let customMessage = null;
|
|
661
|
+
if (colonSeparator !== -1) {
|
|
662
|
+
customMessage = serverErrorCode.substring(colonSeparator + 1).trim();
|
|
663
|
+
serverErrorCode = serverErrorCode.substring(0, colonSeparator).trim();
|
|
664
|
+
}
|
|
665
|
+
// If not found, default to internal error.
|
|
666
|
+
const clientCodeKey = AUTH_SERVER_TO_CLIENT_CODE[serverErrorCode] || 'INTERNAL_ERROR';
|
|
667
|
+
const error = (0, deep_copy_1.deepCopy)(exports.authClientErrorCode[clientCodeKey]);
|
|
668
|
+
// Server detailed message should have highest priority.
|
|
669
|
+
error.message = customMessage || message || error.message;
|
|
670
|
+
error.cause = serverError;
|
|
671
|
+
error.httpResponse = serverError?.response ? (0, error_1.toHttpResponse)(serverError.response) : undefined;
|
|
672
|
+
return new FirebaseAuthError(error);
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* @param info - The error code info.
|
|
676
|
+
* @param message - The error message. This will override the default message if provided.
|
|
677
|
+
*/
|
|
678
|
+
constructor(info, message) {
|
|
679
|
+
// Override default message if custom message provided.
|
|
680
|
+
super({
|
|
681
|
+
code: `auth/${info.code}`,
|
|
682
|
+
message: message || info.message,
|
|
683
|
+
httpResponse: info.httpResponse,
|
|
684
|
+
cause: info.cause,
|
|
685
|
+
});
|
|
686
|
+
/** @internal */
|
|
687
|
+
this.codePrefix = 'auth';
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
exports.FirebaseAuthError = FirebaseAuthError;
|