firebase-admin 13.9.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 +48 -17
- 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 +71 -47
- package/lib/app-check/app-check-api.d.ts +19 -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 +7 -3
- 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 +36 -26
- 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 +4 -4
- 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 +25 -33
- 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
package/lib/utils/error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -17,1070 +17,76 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
|
|
20
|
+
exports.FirebaseError = void 0;
|
|
21
|
+
exports.toHttpResponse = toHttpResponse;
|
|
22
|
+
/**
|
|
23
|
+
* Maps a RequestResponse to a clean HttpResponse, preserving raw text if not JSON.
|
|
24
|
+
*
|
|
25
|
+
* @param resp - The RequestResponse to map.
|
|
26
|
+
* @returns A clean HttpResponse object.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
function toHttpResponse(resp) {
|
|
30
|
+
return {
|
|
31
|
+
status: resp.status,
|
|
32
|
+
headers: resp.headers,
|
|
33
|
+
data: resp.isJson() ? resp.data : resp.text,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
22
36
|
/**
|
|
23
37
|
* Firebase error code structure. This extends Error.
|
|
24
38
|
*/
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
|
25
40
|
class FirebaseError extends Error {
|
|
26
41
|
/**
|
|
27
42
|
* @param errorInfo - The error information (code and message).
|
|
28
|
-
* @constructor
|
|
29
|
-
* @internal
|
|
30
43
|
*/
|
|
31
44
|
constructor(errorInfo) {
|
|
32
45
|
super(errorInfo.message);
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
37
|
-
/* tslint:enable:max-line-length */
|
|
38
|
-
this.__proto__ = FirebaseError.prototype;
|
|
39
|
-
}
|
|
40
|
-
/** @returns The error code. */
|
|
41
|
-
get code() {
|
|
42
|
-
return this.errorInfo?.code;
|
|
43
|
-
}
|
|
44
|
-
/** @returns The error message. */
|
|
45
|
-
get message() {
|
|
46
|
-
return this.errorInfo?.message;
|
|
47
|
-
}
|
|
48
|
-
/** @returns The object representation of the error. */
|
|
49
|
-
toJSON() {
|
|
50
|
-
return {
|
|
51
|
-
code: this.code,
|
|
52
|
-
message: this.message,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.FirebaseError = FirebaseError;
|
|
57
|
-
/**
|
|
58
|
-
* A FirebaseError with a prefix in front of the error code.
|
|
59
|
-
*/
|
|
60
|
-
class PrefixedFirebaseError extends FirebaseError {
|
|
61
|
-
/**
|
|
62
|
-
* @param codePrefix - The prefix to apply to the error code.
|
|
63
|
-
* @param code - The error code.
|
|
64
|
-
* @param message - The error message.
|
|
65
|
-
* @constructor
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
constructor(codePrefix, code, message) {
|
|
69
|
-
super({
|
|
70
|
-
code: `${codePrefix}/${code}`,
|
|
71
|
-
message,
|
|
72
|
-
});
|
|
73
|
-
this.codePrefix = codePrefix;
|
|
74
|
-
/* tslint:disable:max-line-length */
|
|
75
|
-
// Set the prototype explicitly. See the following link for more details:
|
|
76
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
77
|
-
/* tslint:enable:max-line-length */
|
|
78
|
-
this.__proto__ = PrefixedFirebaseError.prototype;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Allows the error type to be checked without needing to know implementation details
|
|
82
|
-
* of the code prefixing.
|
|
83
|
-
*
|
|
84
|
-
* @param code - The non-prefixed error code to test against.
|
|
85
|
-
* @returns True if the code matches, false otherwise.
|
|
86
|
-
*/
|
|
87
|
-
hasCode(code) {
|
|
88
|
-
return `${this.codePrefix}/${code}` === this.code;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.PrefixedFirebaseError = PrefixedFirebaseError;
|
|
92
|
-
/**
|
|
93
|
-
* Firebase App error code structure. This extends PrefixedFirebaseError.
|
|
94
|
-
*/
|
|
95
|
-
class FirebaseAppError extends PrefixedFirebaseError {
|
|
96
|
-
/**
|
|
97
|
-
* @param code - The error code.
|
|
98
|
-
* @param message - The error message.
|
|
99
|
-
* @constructor
|
|
100
|
-
* @internal
|
|
101
|
-
*/
|
|
102
|
-
constructor(code, message) {
|
|
103
|
-
super('app', code, message);
|
|
104
|
-
/* tslint:disable:max-line-length */
|
|
105
|
-
// Set the prototype explicitly. See the following link for more details:
|
|
106
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
107
|
-
/* tslint:enable:max-line-length */
|
|
108
|
-
this.__proto__ = FirebaseAppError.prototype;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.FirebaseAppError = FirebaseAppError;
|
|
112
|
-
/**
|
|
113
|
-
* Firebase Auth error code structure. This extends PrefixedFirebaseError.
|
|
114
|
-
*/
|
|
115
|
-
class FirebaseAuthError extends PrefixedFirebaseError {
|
|
116
|
-
/**
|
|
117
|
-
* Creates the developer-facing error corresponding to the backend error code.
|
|
118
|
-
*
|
|
119
|
-
* @param serverErrorCode - The server error code.
|
|
120
|
-
* @param [message] The error message. The default message is used
|
|
121
|
-
* if not provided.
|
|
122
|
-
* @param [rawServerResponse] The error's raw server response.
|
|
123
|
-
* @returns The corresponding developer-facing error.
|
|
124
|
-
* @internal
|
|
125
|
-
*/
|
|
126
|
-
static fromServerError(serverErrorCode, message, rawServerResponse) {
|
|
127
|
-
// serverErrorCode could contain additional details:
|
|
128
|
-
// ERROR_CODE : Detailed message which can also contain colons
|
|
129
|
-
const colonSeparator = (serverErrorCode || '').indexOf(':');
|
|
130
|
-
let customMessage = null;
|
|
131
|
-
if (colonSeparator !== -1) {
|
|
132
|
-
customMessage = serverErrorCode.substring(colonSeparator + 1).trim();
|
|
133
|
-
serverErrorCode = serverErrorCode.substring(0, colonSeparator).trim();
|
|
134
|
-
}
|
|
135
|
-
// If not found, default to internal error.
|
|
136
|
-
const clientCodeKey = AUTH_SERVER_TO_CLIENT_CODE[serverErrorCode] || 'INTERNAL_ERROR';
|
|
137
|
-
const error = (0, deep_copy_1.deepCopy)(AuthClientErrorCode[clientCodeKey]);
|
|
138
|
-
// Server detailed message should have highest priority.
|
|
139
|
-
error.message = customMessage || message || error.message;
|
|
140
|
-
if (clientCodeKey === 'INTERNAL_ERROR' && typeof rawServerResponse !== 'undefined') {
|
|
141
|
-
try {
|
|
142
|
-
error.message += ` Raw server response: "${JSON.stringify(rawServerResponse)}"`;
|
|
143
|
-
}
|
|
144
|
-
catch (e) {
|
|
145
|
-
// Ignore JSON parsing error.
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return new FirebaseAuthError(error);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* @param info - The error code info.
|
|
152
|
-
* @param message - The error message. This will override the default message if provided.
|
|
153
|
-
* @constructor
|
|
154
|
-
* @internal
|
|
155
|
-
*/
|
|
156
|
-
constructor(info, message) {
|
|
157
|
-
// Override default message if custom message provided.
|
|
158
|
-
super('auth', info.code, message || info.message);
|
|
159
|
-
/* tslint:disable:max-line-length */
|
|
160
|
-
// Set the prototype explicitly. See the following link for more details:
|
|
161
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
162
|
-
/* tslint:enable:max-line-length */
|
|
163
|
-
this.__proto__ = FirebaseAuthError.prototype;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
exports.FirebaseAuthError = FirebaseAuthError;
|
|
167
|
-
/**
|
|
168
|
-
* Firebase Database error code structure. This extends FirebaseError.
|
|
169
|
-
*/
|
|
170
|
-
class FirebaseDatabaseError extends FirebaseError {
|
|
171
|
-
/**
|
|
172
|
-
* @param info - The error code info.
|
|
173
|
-
* @param message - The error message. This will override the default
|
|
174
|
-
* message if provided.
|
|
175
|
-
* @constructor
|
|
176
|
-
* @internal
|
|
177
|
-
*/
|
|
178
|
-
constructor(info, message) {
|
|
179
|
-
// Override default message if custom message provided.
|
|
180
|
-
super({ code: 'database/' + info.code, message: message || info.message });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
exports.FirebaseDatabaseError = FirebaseDatabaseError;
|
|
184
|
-
/**
|
|
185
|
-
* Firebase Firestore error code structure. This extends FirebaseError.
|
|
186
|
-
*/
|
|
187
|
-
class FirebaseFirestoreError extends FirebaseError {
|
|
188
|
-
/**
|
|
189
|
-
* @param info - The error code info.
|
|
190
|
-
* @param message - The error message. This will override the default
|
|
191
|
-
* message if provided.
|
|
192
|
-
* @constructor
|
|
193
|
-
* @internal
|
|
194
|
-
*/
|
|
195
|
-
constructor(info, message) {
|
|
196
|
-
// Override default message if custom message provided.
|
|
197
|
-
super({ code: 'firestore/' + info.code, message: message || info.message });
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
exports.FirebaseFirestoreError = FirebaseFirestoreError;
|
|
201
|
-
/**
|
|
202
|
-
* Firebase instance ID error code structure. This extends FirebaseError.
|
|
203
|
-
*/
|
|
204
|
-
class FirebaseInstanceIdError extends FirebaseError {
|
|
205
|
-
/**
|
|
206
|
-
*
|
|
207
|
-
* @param info - The error code info.
|
|
208
|
-
* @param message - The error message. This will override the default
|
|
209
|
-
* message if provided.
|
|
210
|
-
* @constructor
|
|
211
|
-
* @internal
|
|
212
|
-
*/
|
|
213
|
-
constructor(info, message) {
|
|
214
|
-
// Override default message if custom message provided.
|
|
215
|
-
super({ code: 'instance-id/' + info.code, message: message || info.message });
|
|
216
|
-
this.__proto__ = FirebaseInstanceIdError.prototype;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
exports.FirebaseInstanceIdError = FirebaseInstanceIdError;
|
|
220
|
-
/**
|
|
221
|
-
* Firebase Installations service error code structure. This extends `FirebaseError`.
|
|
222
|
-
*/
|
|
223
|
-
class FirebaseInstallationsError extends FirebaseError {
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
* @param info - The error code info.
|
|
227
|
-
* @param message - The error message. This will override the default
|
|
228
|
-
* message if provided.
|
|
229
|
-
* @constructor
|
|
230
|
-
* @internal
|
|
231
|
-
*/
|
|
232
|
-
constructor(info, message) {
|
|
233
|
-
// Override default message if custom message provided.
|
|
234
|
-
super({ code: 'installations/' + info.code, message: message || info.message });
|
|
235
|
-
this.__proto__ = FirebaseInstallationsError.prototype;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
exports.FirebaseInstallationsError = FirebaseInstallationsError;
|
|
239
|
-
/**
|
|
240
|
-
* Firebase Messaging error code structure. This extends PrefixedFirebaseError.
|
|
241
|
-
*/
|
|
242
|
-
class FirebaseMessagingError extends PrefixedFirebaseError {
|
|
243
|
-
/**
|
|
244
|
-
* Creates the developer-facing error corresponding to the backend error code.
|
|
245
|
-
*
|
|
246
|
-
* @param serverErrorCode - The server error code.
|
|
247
|
-
* @param [message] The error message. The default message is used
|
|
248
|
-
* if not provided.
|
|
249
|
-
* @param [rawServerResponse] The error's raw server response.
|
|
250
|
-
* @returns The corresponding developer-facing error.
|
|
251
|
-
* @internal
|
|
252
|
-
*/
|
|
253
|
-
static fromServerError(serverErrorCode, message, rawServerResponse) {
|
|
254
|
-
// If not found, default to unknown error.
|
|
255
|
-
let clientCodeKey = 'UNKNOWN_ERROR';
|
|
256
|
-
if (serverErrorCode && serverErrorCode in MESSAGING_SERVER_TO_CLIENT_CODE) {
|
|
257
|
-
clientCodeKey = MESSAGING_SERVER_TO_CLIENT_CODE[serverErrorCode];
|
|
46
|
+
this.code = errorInfo.code;
|
|
47
|
+
if (errorInfo.cause !== undefined) {
|
|
48
|
+
this.cause = errorInfo.cause;
|
|
258
49
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (clientCodeKey === 'UNKNOWN_ERROR' && typeof rawServerResponse !== 'undefined') {
|
|
262
|
-
try {
|
|
263
|
-
error.message += ` Raw server response: "${JSON.stringify(rawServerResponse)}"`;
|
|
264
|
-
}
|
|
265
|
-
catch (e) {
|
|
266
|
-
// Ignore JSON parsing error.
|
|
267
|
-
}
|
|
50
|
+
if (errorInfo.httpResponse !== undefined) {
|
|
51
|
+
this.httpResponse = errorInfo.httpResponse;
|
|
268
52
|
}
|
|
269
|
-
return new FirebaseMessagingError(error);
|
|
270
53
|
}
|
|
271
|
-
/**
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// If not found, default to unknown error.
|
|
276
|
-
const clientCodeKey = TOPIC_MGT_SERVER_TO_CLIENT_CODE[serverErrorCode] || 'UNKNOWN_ERROR';
|
|
277
|
-
const error = (0, deep_copy_1.deepCopy)(MessagingClientErrorCode[clientCodeKey]);
|
|
278
|
-
error.message = message || error.message;
|
|
279
|
-
if (clientCodeKey === 'UNKNOWN_ERROR' && typeof rawServerResponse !== 'undefined') {
|
|
280
|
-
try {
|
|
281
|
-
error.message += ` Raw server response: "${JSON.stringify(rawServerResponse)}"`;
|
|
282
|
-
}
|
|
283
|
-
catch (e) {
|
|
284
|
-
// Ignore JSON parsing error.
|
|
285
|
-
}
|
|
54
|
+
/** {@inheritDoc FirebaseError.hasCode} */
|
|
55
|
+
hasCode(code) {
|
|
56
|
+
if (this.code === code) {
|
|
57
|
+
return true;
|
|
286
58
|
}
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
*
|
|
291
|
-
* @param info - The error code info.
|
|
292
|
-
* @param message - The error message. This will override the default message if provided.
|
|
293
|
-
* @constructor
|
|
294
|
-
* @internal
|
|
295
|
-
*/
|
|
296
|
-
constructor(info, message) {
|
|
297
|
-
// Override default message if custom message provided.
|
|
298
|
-
super('messaging', info.code, message || info.message);
|
|
299
|
-
/* tslint:disable:max-line-length */
|
|
300
|
-
// Set the prototype explicitly. See the following link for more details:
|
|
301
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
302
|
-
/* tslint:enable:max-line-length */
|
|
303
|
-
this.__proto__ = FirebaseMessagingError.prototype;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
exports.FirebaseMessagingError = FirebaseMessagingError;
|
|
307
|
-
class FirebaseMessagingSessionError extends FirebaseMessagingError {
|
|
308
|
-
/**
|
|
309
|
-
*
|
|
310
|
-
* @param info - The error code info.
|
|
311
|
-
* @param message - The error message. This will override the default message if provided.
|
|
312
|
-
* @param pendingBatchResponse - BatchResponse for pending messages when session error occured.
|
|
313
|
-
* @constructor
|
|
314
|
-
* @internal
|
|
315
|
-
*/
|
|
316
|
-
constructor(info, message, pendingBatchResponse) {
|
|
317
|
-
// Override default message if custom message provided.
|
|
318
|
-
super(info, message || info.message);
|
|
319
|
-
this.pendingBatchResponse = pendingBatchResponse;
|
|
320
|
-
/* tslint:disable:max-line-length */
|
|
321
|
-
// Set the prototype explicitly. See the following link for more details:
|
|
322
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
323
|
-
/* tslint:enable:max-line-length */
|
|
324
|
-
this.__proto__ = FirebaseMessagingSessionError.prototype;
|
|
59
|
+
return this.codePrefix != null && this.code === `${this.codePrefix}/${code}`;
|
|
325
60
|
}
|
|
326
61
|
/** @returns The object representation of the error. */
|
|
327
62
|
toJSON() {
|
|
328
|
-
|
|
63
|
+
const json = {
|
|
329
64
|
code: this.code,
|
|
330
65
|
message: this.message,
|
|
331
|
-
pendingBatchResponse: this.pendingBatchResponse,
|
|
332
66
|
};
|
|
67
|
+
if (this.httpResponse) {
|
|
68
|
+
json.httpResponse = {
|
|
69
|
+
status: this.httpResponse.status,
|
|
70
|
+
headers: this.httpResponse.headers,
|
|
71
|
+
data: this.httpResponse.data,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (this.cause) {
|
|
75
|
+
json.cause = {
|
|
76
|
+
name: this.cause.name || 'Error',
|
|
77
|
+
message: this.cause.message || String(this.cause),
|
|
78
|
+
stack: this.cause.stack
|
|
79
|
+
};
|
|
80
|
+
if ('errors' in this.cause && Array.isArray(this.cause.errors)) {
|
|
81
|
+
json.cause.errors = this.cause.errors.map((e) => {
|
|
82
|
+
if (e instanceof Error) {
|
|
83
|
+
return { name: e.name, message: e.message, stack: e.stack };
|
|
84
|
+
}
|
|
85
|
+
return String(e);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return json;
|
|
333
90
|
}
|
|
334
91
|
}
|
|
335
|
-
exports.
|
|
336
|
-
/**
|
|
337
|
-
* Firebase project management error code structure. This extends PrefixedFirebaseError.
|
|
338
|
-
*/
|
|
339
|
-
class FirebaseProjectManagementError extends PrefixedFirebaseError {
|
|
340
|
-
/**
|
|
341
|
-
* @param code - The error code.
|
|
342
|
-
* @param message - The error message.
|
|
343
|
-
* @constructor
|
|
344
|
-
* @internal
|
|
345
|
-
*/
|
|
346
|
-
constructor(code, message) {
|
|
347
|
-
super('project-management', code, message);
|
|
348
|
-
/* tslint:disable:max-line-length */
|
|
349
|
-
// Set the prototype explicitly. See the following link for more details:
|
|
350
|
-
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
351
|
-
/* tslint:enable:max-line-length */
|
|
352
|
-
this.__proto__ = FirebaseProjectManagementError.prototype;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
exports.FirebaseProjectManagementError = FirebaseProjectManagementError;
|
|
356
|
-
/**
|
|
357
|
-
* App client error codes and their default messages.
|
|
358
|
-
*/
|
|
359
|
-
class AppErrorCodes {
|
|
360
|
-
}
|
|
361
|
-
exports.AppErrorCodes = AppErrorCodes;
|
|
362
|
-
AppErrorCodes.APP_DELETED = 'app-deleted';
|
|
363
|
-
AppErrorCodes.DUPLICATE_APP = 'duplicate-app';
|
|
364
|
-
AppErrorCodes.INVALID_ARGUMENT = 'invalid-argument';
|
|
365
|
-
AppErrorCodes.INTERNAL_ERROR = 'internal-error';
|
|
366
|
-
AppErrorCodes.INVALID_APP_NAME = 'invalid-app-name';
|
|
367
|
-
AppErrorCodes.INVALID_APP_OPTIONS = 'invalid-app-options';
|
|
368
|
-
AppErrorCodes.INVALID_CREDENTIAL = 'invalid-credential';
|
|
369
|
-
AppErrorCodes.NETWORK_ERROR = 'network-error';
|
|
370
|
-
AppErrorCodes.NETWORK_TIMEOUT = 'network-timeout';
|
|
371
|
-
AppErrorCodes.NO_APP = 'no-app';
|
|
372
|
-
AppErrorCodes.UNABLE_TO_PARSE_RESPONSE = 'unable-to-parse-response';
|
|
373
|
-
/**
|
|
374
|
-
* Auth client error codes and their default messages.
|
|
375
|
-
*/
|
|
376
|
-
class AuthClientErrorCode {
|
|
377
|
-
}
|
|
378
|
-
exports.AuthClientErrorCode = AuthClientErrorCode;
|
|
379
|
-
AuthClientErrorCode.AUTH_BLOCKING_TOKEN_EXPIRED = {
|
|
380
|
-
code: 'auth-blocking-token-expired',
|
|
381
|
-
message: 'The provided Firebase Auth Blocking token is expired.',
|
|
382
|
-
};
|
|
383
|
-
AuthClientErrorCode.BILLING_NOT_ENABLED = {
|
|
384
|
-
code: 'billing-not-enabled',
|
|
385
|
-
message: 'Feature requires billing to be enabled.',
|
|
386
|
-
};
|
|
387
|
-
AuthClientErrorCode.CLAIMS_TOO_LARGE = {
|
|
388
|
-
code: 'claims-too-large',
|
|
389
|
-
message: 'Developer claims maximum payload size exceeded.',
|
|
390
|
-
};
|
|
391
|
-
AuthClientErrorCode.CONFIGURATION_EXISTS = {
|
|
392
|
-
code: 'configuration-exists',
|
|
393
|
-
message: 'A configuration already exists with the provided identifier.',
|
|
394
|
-
};
|
|
395
|
-
AuthClientErrorCode.CONFIGURATION_NOT_FOUND = {
|
|
396
|
-
code: 'configuration-not-found',
|
|
397
|
-
message: 'There is no configuration corresponding to the provided identifier.',
|
|
398
|
-
};
|
|
399
|
-
AuthClientErrorCode.ID_TOKEN_EXPIRED = {
|
|
400
|
-
code: 'id-token-expired',
|
|
401
|
-
message: 'The provided Firebase ID token is expired.',
|
|
402
|
-
};
|
|
403
|
-
AuthClientErrorCode.INVALID_ARGUMENT = {
|
|
404
|
-
code: 'argument-error',
|
|
405
|
-
message: 'Invalid argument provided.',
|
|
406
|
-
};
|
|
407
|
-
AuthClientErrorCode.INVALID_CONFIG = {
|
|
408
|
-
code: 'invalid-config',
|
|
409
|
-
message: 'The provided configuration is invalid.',
|
|
410
|
-
};
|
|
411
|
-
AuthClientErrorCode.EMAIL_ALREADY_EXISTS = {
|
|
412
|
-
code: 'email-already-exists',
|
|
413
|
-
message: 'The email address is already in use by another account.',
|
|
414
|
-
};
|
|
415
|
-
AuthClientErrorCode.EMAIL_NOT_FOUND = {
|
|
416
|
-
code: 'email-not-found',
|
|
417
|
-
message: 'There is no user record corresponding to the provided email.',
|
|
418
|
-
};
|
|
419
|
-
AuthClientErrorCode.FORBIDDEN_CLAIM = {
|
|
420
|
-
code: 'reserved-claim',
|
|
421
|
-
message: 'The specified developer claim is reserved and cannot be specified.',
|
|
422
|
-
};
|
|
423
|
-
AuthClientErrorCode.INVALID_ID_TOKEN = {
|
|
424
|
-
code: 'invalid-id-token',
|
|
425
|
-
message: 'The provided ID token is not a valid Firebase ID token.',
|
|
426
|
-
};
|
|
427
|
-
AuthClientErrorCode.ID_TOKEN_REVOKED = {
|
|
428
|
-
code: 'id-token-revoked',
|
|
429
|
-
message: 'The Firebase ID token has been revoked.',
|
|
430
|
-
};
|
|
431
|
-
AuthClientErrorCode.INTERNAL_ERROR = {
|
|
432
|
-
code: 'internal-error',
|
|
433
|
-
message: 'An internal error has occurred.',
|
|
434
|
-
};
|
|
435
|
-
AuthClientErrorCode.INVALID_CLAIMS = {
|
|
436
|
-
code: 'invalid-claims',
|
|
437
|
-
message: 'The provided custom claim attributes are invalid.',
|
|
438
|
-
};
|
|
439
|
-
AuthClientErrorCode.INVALID_CONTINUE_URI = {
|
|
440
|
-
code: 'invalid-continue-uri',
|
|
441
|
-
message: 'The continue URL must be a valid URL string.',
|
|
442
|
-
};
|
|
443
|
-
AuthClientErrorCode.INVALID_CREATION_TIME = {
|
|
444
|
-
code: 'invalid-creation-time',
|
|
445
|
-
message: 'The creation time must be a valid UTC date string.',
|
|
446
|
-
};
|
|
447
|
-
AuthClientErrorCode.INVALID_CREDENTIAL = {
|
|
448
|
-
code: 'invalid-credential',
|
|
449
|
-
message: 'Invalid credential object provided.',
|
|
450
|
-
};
|
|
451
|
-
AuthClientErrorCode.INVALID_DISABLED_FIELD = {
|
|
452
|
-
code: 'invalid-disabled-field',
|
|
453
|
-
message: 'The disabled field must be a boolean.',
|
|
454
|
-
};
|
|
455
|
-
AuthClientErrorCode.INVALID_DISPLAY_NAME = {
|
|
456
|
-
code: 'invalid-display-name',
|
|
457
|
-
message: 'The displayName field must be a valid string.',
|
|
458
|
-
};
|
|
459
|
-
AuthClientErrorCode.INVALID_DYNAMIC_LINK_DOMAIN = {
|
|
460
|
-
code: 'invalid-dynamic-link-domain',
|
|
461
|
-
message: 'The provided dynamic link domain is not configured or authorized ' +
|
|
462
|
-
'for the current project.',
|
|
463
|
-
};
|
|
464
|
-
AuthClientErrorCode.INVALID_HOSTING_LINK_DOMAIN = {
|
|
465
|
-
code: 'invalid-hosting-link-domain',
|
|
466
|
-
message: 'The provided hosting link domain is not configured in Firebase ' +
|
|
467
|
-
'Hosting or is not owned by the current project.',
|
|
468
|
-
};
|
|
469
|
-
AuthClientErrorCode.INVALID_EMAIL_VERIFIED = {
|
|
470
|
-
code: 'invalid-email-verified',
|
|
471
|
-
message: 'The emailVerified field must be a boolean.',
|
|
472
|
-
};
|
|
473
|
-
AuthClientErrorCode.INVALID_EMAIL = {
|
|
474
|
-
code: 'invalid-email',
|
|
475
|
-
message: 'The email address is improperly formatted.',
|
|
476
|
-
};
|
|
477
|
-
AuthClientErrorCode.INVALID_NEW_EMAIL = {
|
|
478
|
-
code: 'invalid-new-email',
|
|
479
|
-
message: 'The new email address is improperly formatted.',
|
|
480
|
-
};
|
|
481
|
-
AuthClientErrorCode.INVALID_ENROLLED_FACTORS = {
|
|
482
|
-
code: 'invalid-enrolled-factors',
|
|
483
|
-
message: 'The enrolled factors must be a valid array of MultiFactorInfo objects.',
|
|
484
|
-
};
|
|
485
|
-
AuthClientErrorCode.INVALID_ENROLLMENT_TIME = {
|
|
486
|
-
code: 'invalid-enrollment-time',
|
|
487
|
-
message: 'The second factor enrollment time must be a valid UTC date string.',
|
|
488
|
-
};
|
|
489
|
-
AuthClientErrorCode.INVALID_HASH_ALGORITHM = {
|
|
490
|
-
code: 'invalid-hash-algorithm',
|
|
491
|
-
message: 'The hash algorithm must match one of the strings in the list of ' +
|
|
492
|
-
'supported algorithms.',
|
|
493
|
-
};
|
|
494
|
-
AuthClientErrorCode.INVALID_HASH_BLOCK_SIZE = {
|
|
495
|
-
code: 'invalid-hash-block-size',
|
|
496
|
-
message: 'The hash block size must be a valid number.',
|
|
497
|
-
};
|
|
498
|
-
AuthClientErrorCode.INVALID_HASH_DERIVED_KEY_LENGTH = {
|
|
499
|
-
code: 'invalid-hash-derived-key-length',
|
|
500
|
-
message: 'The hash derived key length must be a valid number.',
|
|
501
|
-
};
|
|
502
|
-
AuthClientErrorCode.INVALID_HASH_KEY = {
|
|
503
|
-
code: 'invalid-hash-key',
|
|
504
|
-
message: 'The hash key must a valid byte buffer.',
|
|
505
|
-
};
|
|
506
|
-
AuthClientErrorCode.INVALID_HASH_MEMORY_COST = {
|
|
507
|
-
code: 'invalid-hash-memory-cost',
|
|
508
|
-
message: 'The hash memory cost must be a valid number.',
|
|
509
|
-
};
|
|
510
|
-
AuthClientErrorCode.INVALID_HASH_PARALLELIZATION = {
|
|
511
|
-
code: 'invalid-hash-parallelization',
|
|
512
|
-
message: 'The hash parallelization must be a valid number.',
|
|
513
|
-
};
|
|
514
|
-
AuthClientErrorCode.INVALID_HASH_ROUNDS = {
|
|
515
|
-
code: 'invalid-hash-rounds',
|
|
516
|
-
message: 'The hash rounds must be a valid number.',
|
|
517
|
-
};
|
|
518
|
-
AuthClientErrorCode.INVALID_HASH_SALT_SEPARATOR = {
|
|
519
|
-
code: 'invalid-hash-salt-separator',
|
|
520
|
-
message: 'The hashing algorithm salt separator field must be a valid byte buffer.',
|
|
521
|
-
};
|
|
522
|
-
AuthClientErrorCode.INVALID_LAST_SIGN_IN_TIME = {
|
|
523
|
-
code: 'invalid-last-sign-in-time',
|
|
524
|
-
message: 'The last sign-in time must be a valid UTC date string.',
|
|
525
|
-
};
|
|
526
|
-
AuthClientErrorCode.INVALID_NAME = {
|
|
527
|
-
code: 'invalid-name',
|
|
528
|
-
message: 'The resource name provided is invalid.',
|
|
529
|
-
};
|
|
530
|
-
AuthClientErrorCode.INVALID_OAUTH_CLIENT_ID = {
|
|
531
|
-
code: 'invalid-oauth-client-id',
|
|
532
|
-
message: 'The provided OAuth client ID is invalid.',
|
|
533
|
-
};
|
|
534
|
-
AuthClientErrorCode.INVALID_PAGE_TOKEN = {
|
|
535
|
-
code: 'invalid-page-token',
|
|
536
|
-
message: 'The page token must be a valid non-empty string.',
|
|
537
|
-
};
|
|
538
|
-
AuthClientErrorCode.INVALID_PASSWORD = {
|
|
539
|
-
code: 'invalid-password',
|
|
540
|
-
message: 'The password must be a string with at least 6 characters.',
|
|
541
|
-
};
|
|
542
|
-
AuthClientErrorCode.INVALID_PASSWORD_HASH = {
|
|
543
|
-
code: 'invalid-password-hash',
|
|
544
|
-
message: 'The password hash must be a valid byte buffer.',
|
|
545
|
-
};
|
|
546
|
-
AuthClientErrorCode.INVALID_PASSWORD_SALT = {
|
|
547
|
-
code: 'invalid-password-salt',
|
|
548
|
-
message: 'The password salt must be a valid byte buffer.',
|
|
549
|
-
};
|
|
550
|
-
AuthClientErrorCode.INVALID_PHONE_NUMBER = {
|
|
551
|
-
code: 'invalid-phone-number',
|
|
552
|
-
message: 'The phone number must be a non-empty E.164 standard compliant identifier ' +
|
|
553
|
-
'string.',
|
|
554
|
-
};
|
|
555
|
-
AuthClientErrorCode.INVALID_PHOTO_URL = {
|
|
556
|
-
code: 'invalid-photo-url',
|
|
557
|
-
message: 'The photoURL field must be a valid URL.',
|
|
558
|
-
};
|
|
559
|
-
AuthClientErrorCode.INVALID_PROJECT_ID = {
|
|
560
|
-
code: 'invalid-project-id',
|
|
561
|
-
message: 'Invalid parent project. Either parent project doesn\'t exist or didn\'t enable multi-tenancy.',
|
|
562
|
-
};
|
|
563
|
-
AuthClientErrorCode.INVALID_PROVIDER_DATA = {
|
|
564
|
-
code: 'invalid-provider-data',
|
|
565
|
-
message: 'The providerData must be a valid array of UserInfo objects.',
|
|
566
|
-
};
|
|
567
|
-
AuthClientErrorCode.INVALID_PROVIDER_ID = {
|
|
568
|
-
code: 'invalid-provider-id',
|
|
569
|
-
message: 'The providerId must be a valid supported provider identifier string.',
|
|
570
|
-
};
|
|
571
|
-
AuthClientErrorCode.INVALID_PROVIDER_UID = {
|
|
572
|
-
code: 'invalid-provider-uid',
|
|
573
|
-
message: 'The providerUid must be a valid provider uid string.',
|
|
574
|
-
};
|
|
575
|
-
AuthClientErrorCode.INVALID_OAUTH_RESPONSETYPE = {
|
|
576
|
-
code: 'invalid-oauth-responsetype',
|
|
577
|
-
message: 'Only exactly one OAuth responseType should be set to true.',
|
|
578
|
-
};
|
|
579
|
-
AuthClientErrorCode.INVALID_SESSION_COOKIE_DURATION = {
|
|
580
|
-
code: 'invalid-session-cookie-duration',
|
|
581
|
-
message: 'The session cookie duration must be a valid number in milliseconds ' +
|
|
582
|
-
'between 5 minutes and 2 weeks.',
|
|
583
|
-
};
|
|
584
|
-
AuthClientErrorCode.INVALID_TENANT_ID = {
|
|
585
|
-
code: 'invalid-tenant-id',
|
|
586
|
-
message: 'The tenant ID must be a valid non-empty string.',
|
|
587
|
-
};
|
|
588
|
-
AuthClientErrorCode.INVALID_TENANT_TYPE = {
|
|
589
|
-
code: 'invalid-tenant-type',
|
|
590
|
-
message: 'Tenant type must be either "full_service" or "lightweight".',
|
|
591
|
-
};
|
|
592
|
-
AuthClientErrorCode.INVALID_TESTING_PHONE_NUMBER = {
|
|
593
|
-
code: 'invalid-testing-phone-number',
|
|
594
|
-
message: 'Invalid testing phone number or invalid test code provided.',
|
|
595
|
-
};
|
|
596
|
-
AuthClientErrorCode.INVALID_UID = {
|
|
597
|
-
code: 'invalid-uid',
|
|
598
|
-
message: 'The uid must be a non-empty string with at most 128 characters.',
|
|
599
|
-
};
|
|
600
|
-
AuthClientErrorCode.INVALID_USER_IMPORT = {
|
|
601
|
-
code: 'invalid-user-import',
|
|
602
|
-
message: 'The user record to import is invalid.',
|
|
603
|
-
};
|
|
604
|
-
AuthClientErrorCode.INVALID_TOKENS_VALID_AFTER_TIME = {
|
|
605
|
-
code: 'invalid-tokens-valid-after-time',
|
|
606
|
-
message: 'The tokensValidAfterTime must be a valid UTC number in seconds.',
|
|
607
|
-
};
|
|
608
|
-
AuthClientErrorCode.MISMATCHING_TENANT_ID = {
|
|
609
|
-
code: 'mismatching-tenant-id',
|
|
610
|
-
message: 'User tenant ID does not match with the current TenantAwareAuth tenant ID.',
|
|
611
|
-
};
|
|
612
|
-
AuthClientErrorCode.MISSING_ANDROID_PACKAGE_NAME = {
|
|
613
|
-
code: 'missing-android-pkg-name',
|
|
614
|
-
message: 'An Android Package Name must be provided if the Android App is ' +
|
|
615
|
-
'required to be installed.',
|
|
616
|
-
};
|
|
617
|
-
AuthClientErrorCode.MISSING_CONFIG = {
|
|
618
|
-
code: 'missing-config',
|
|
619
|
-
message: 'The provided configuration is missing required attributes.',
|
|
620
|
-
};
|
|
621
|
-
AuthClientErrorCode.MISSING_CONTINUE_URI = {
|
|
622
|
-
code: 'missing-continue-uri',
|
|
623
|
-
message: 'A valid continue URL must be provided in the request.',
|
|
624
|
-
};
|
|
625
|
-
AuthClientErrorCode.MISSING_DISPLAY_NAME = {
|
|
626
|
-
code: 'missing-display-name',
|
|
627
|
-
message: 'The resource being created or edited is missing a valid display name.',
|
|
628
|
-
};
|
|
629
|
-
AuthClientErrorCode.MISSING_EMAIL = {
|
|
630
|
-
code: 'missing-email',
|
|
631
|
-
message: 'The email is required for the specified action. For example, a multi-factor user ' +
|
|
632
|
-
'requires a verified email.',
|
|
633
|
-
};
|
|
634
|
-
AuthClientErrorCode.MISSING_IOS_BUNDLE_ID = {
|
|
635
|
-
code: 'missing-ios-bundle-id',
|
|
636
|
-
message: 'The request is missing an iOS Bundle ID.',
|
|
637
|
-
};
|
|
638
|
-
AuthClientErrorCode.MISSING_ISSUER = {
|
|
639
|
-
code: 'missing-issuer',
|
|
640
|
-
message: 'The OAuth/OIDC configuration issuer must not be empty.',
|
|
641
|
-
};
|
|
642
|
-
AuthClientErrorCode.MISSING_HASH_ALGORITHM = {
|
|
643
|
-
code: 'missing-hash-algorithm',
|
|
644
|
-
message: 'Importing users with password hashes requires that the hashing ' +
|
|
645
|
-
'algorithm and its parameters be provided.',
|
|
646
|
-
};
|
|
647
|
-
AuthClientErrorCode.MISSING_OAUTH_CLIENT_ID = {
|
|
648
|
-
code: 'missing-oauth-client-id',
|
|
649
|
-
message: 'The OAuth/OIDC configuration client ID must not be empty.',
|
|
650
|
-
};
|
|
651
|
-
AuthClientErrorCode.MISSING_OAUTH_CLIENT_SECRET = {
|
|
652
|
-
code: 'missing-oauth-client-secret',
|
|
653
|
-
message: 'The OAuth configuration client secret is required to enable OIDC code flow.',
|
|
654
|
-
};
|
|
655
|
-
AuthClientErrorCode.MISSING_PROVIDER_ID = {
|
|
656
|
-
code: 'missing-provider-id',
|
|
657
|
-
message: 'A valid provider ID must be provided in the request.',
|
|
658
|
-
};
|
|
659
|
-
AuthClientErrorCode.MISSING_SAML_RELYING_PARTY_CONFIG = {
|
|
660
|
-
code: 'missing-saml-relying-party-config',
|
|
661
|
-
message: 'The SAML configuration provided is missing a relying party configuration.',
|
|
662
|
-
};
|
|
663
|
-
AuthClientErrorCode.MAXIMUM_TEST_PHONE_NUMBER_EXCEEDED = {
|
|
664
|
-
code: 'test-phone-number-limit-exceeded',
|
|
665
|
-
message: 'The maximum allowed number of test phone number / code pairs has been exceeded.',
|
|
666
|
-
};
|
|
667
|
-
AuthClientErrorCode.MAXIMUM_USER_COUNT_EXCEEDED = {
|
|
668
|
-
code: 'maximum-user-count-exceeded',
|
|
669
|
-
message: 'The maximum allowed number of users to import has been exceeded.',
|
|
670
|
-
};
|
|
671
|
-
AuthClientErrorCode.MISSING_UID = {
|
|
672
|
-
code: 'missing-uid',
|
|
673
|
-
message: 'A uid identifier is required for the current operation.',
|
|
674
|
-
};
|
|
675
|
-
AuthClientErrorCode.OPERATION_NOT_ALLOWED = {
|
|
676
|
-
code: 'operation-not-allowed',
|
|
677
|
-
message: 'The given sign-in provider is disabled for this Firebase project. ' +
|
|
678
|
-
'Enable it in the Firebase console, under the sign-in method tab of the ' +
|
|
679
|
-
'Auth section.',
|
|
680
|
-
};
|
|
681
|
-
AuthClientErrorCode.PHONE_NUMBER_ALREADY_EXISTS = {
|
|
682
|
-
code: 'phone-number-already-exists',
|
|
683
|
-
message: 'The user with the provided phone number already exists.',
|
|
684
|
-
};
|
|
685
|
-
AuthClientErrorCode.PROJECT_NOT_FOUND = {
|
|
686
|
-
code: 'project-not-found',
|
|
687
|
-
message: 'No Firebase project was found for the provided credential.',
|
|
688
|
-
};
|
|
689
|
-
AuthClientErrorCode.INSUFFICIENT_PERMISSION = {
|
|
690
|
-
code: 'insufficient-permission',
|
|
691
|
-
message: 'Credential implementation provided to initializeApp() via the "credential" property ' +
|
|
692
|
-
'has insufficient permission to access the requested resource. See ' +
|
|
693
|
-
'https://firebase.google.com/docs/admin/setup for details on how to authenticate this SDK ' +
|
|
694
|
-
'with appropriate permissions.',
|
|
695
|
-
};
|
|
696
|
-
AuthClientErrorCode.QUOTA_EXCEEDED = {
|
|
697
|
-
code: 'quota-exceeded',
|
|
698
|
-
message: 'The project quota for the specified operation has been exceeded.',
|
|
699
|
-
};
|
|
700
|
-
AuthClientErrorCode.SECOND_FACTOR_LIMIT_EXCEEDED = {
|
|
701
|
-
code: 'second-factor-limit-exceeded',
|
|
702
|
-
message: 'The maximum number of allowed second factors on a user has been exceeded.',
|
|
703
|
-
};
|
|
704
|
-
AuthClientErrorCode.SECOND_FACTOR_UID_ALREADY_EXISTS = {
|
|
705
|
-
code: 'second-factor-uid-already-exists',
|
|
706
|
-
message: 'The specified second factor "uid" already exists.',
|
|
707
|
-
};
|
|
708
|
-
AuthClientErrorCode.SESSION_COOKIE_EXPIRED = {
|
|
709
|
-
code: 'session-cookie-expired',
|
|
710
|
-
message: 'The Firebase session cookie is expired.',
|
|
711
|
-
};
|
|
712
|
-
AuthClientErrorCode.SESSION_COOKIE_REVOKED = {
|
|
713
|
-
code: 'session-cookie-revoked',
|
|
714
|
-
message: 'The Firebase session cookie has been revoked.',
|
|
715
|
-
};
|
|
716
|
-
AuthClientErrorCode.TENANT_NOT_FOUND = {
|
|
717
|
-
code: 'tenant-not-found',
|
|
718
|
-
message: 'There is no tenant corresponding to the provided identifier.',
|
|
719
|
-
};
|
|
720
|
-
AuthClientErrorCode.UID_ALREADY_EXISTS = {
|
|
721
|
-
code: 'uid-already-exists',
|
|
722
|
-
message: 'The user with the provided uid already exists.',
|
|
723
|
-
};
|
|
724
|
-
AuthClientErrorCode.UNAUTHORIZED_DOMAIN = {
|
|
725
|
-
code: 'unauthorized-continue-uri',
|
|
726
|
-
message: 'The domain of the continue URL is not whitelisted. Whitelist the domain in the ' +
|
|
727
|
-
'Firebase console.',
|
|
728
|
-
};
|
|
729
|
-
AuthClientErrorCode.UNSUPPORTED_FIRST_FACTOR = {
|
|
730
|
-
code: 'unsupported-first-factor',
|
|
731
|
-
message: 'A multi-factor user requires a supported first factor.',
|
|
732
|
-
};
|
|
733
|
-
AuthClientErrorCode.UNSUPPORTED_SECOND_FACTOR = {
|
|
734
|
-
code: 'unsupported-second-factor',
|
|
735
|
-
message: 'The request specified an unsupported type of second factor.',
|
|
736
|
-
};
|
|
737
|
-
AuthClientErrorCode.UNSUPPORTED_TENANT_OPERATION = {
|
|
738
|
-
code: 'unsupported-tenant-operation',
|
|
739
|
-
message: 'This operation is not supported in a multi-tenant context.',
|
|
740
|
-
};
|
|
741
|
-
AuthClientErrorCode.UNVERIFIED_EMAIL = {
|
|
742
|
-
code: 'unverified-email',
|
|
743
|
-
message: 'A verified email is required for the specified action. For example, a multi-factor user ' +
|
|
744
|
-
'requires a verified email.',
|
|
745
|
-
};
|
|
746
|
-
AuthClientErrorCode.USER_NOT_FOUND = {
|
|
747
|
-
code: 'user-not-found',
|
|
748
|
-
message: 'There is no user record corresponding to the provided identifier.',
|
|
749
|
-
};
|
|
750
|
-
AuthClientErrorCode.NOT_FOUND = {
|
|
751
|
-
code: 'not-found',
|
|
752
|
-
message: 'The requested resource was not found.',
|
|
753
|
-
};
|
|
754
|
-
AuthClientErrorCode.USER_DISABLED = {
|
|
755
|
-
code: 'user-disabled',
|
|
756
|
-
message: 'The user record is disabled.',
|
|
757
|
-
};
|
|
758
|
-
AuthClientErrorCode.USER_NOT_DISABLED = {
|
|
759
|
-
code: 'user-not-disabled',
|
|
760
|
-
message: 'The user must be disabled in order to bulk delete it (or you must pass force=true).',
|
|
761
|
-
};
|
|
762
|
-
AuthClientErrorCode.INVALID_RECAPTCHA_ACTION = {
|
|
763
|
-
code: 'invalid-recaptcha-action',
|
|
764
|
-
message: 'reCAPTCHA action must be "BLOCK".'
|
|
765
|
-
};
|
|
766
|
-
AuthClientErrorCode.INVALID_RECAPTCHA_ENFORCEMENT_STATE = {
|
|
767
|
-
code: 'invalid-recaptcha-enforcement-state',
|
|
768
|
-
message: 'reCAPTCHA enforcement state must be either "OFF", "AUDIT" or "ENFORCE".'
|
|
769
|
-
};
|
|
770
|
-
AuthClientErrorCode.RECAPTCHA_NOT_ENABLED = {
|
|
771
|
-
code: 'racaptcha-not-enabled',
|
|
772
|
-
message: 'reCAPTCHA enterprise is not enabled.'
|
|
773
|
-
};
|
|
774
|
-
/**
|
|
775
|
-
* Messaging client error codes and their default messages.
|
|
776
|
-
*/
|
|
777
|
-
class MessagingClientErrorCode {
|
|
778
|
-
}
|
|
779
|
-
exports.MessagingClientErrorCode = MessagingClientErrorCode;
|
|
780
|
-
MessagingClientErrorCode.INVALID_ARGUMENT = {
|
|
781
|
-
code: 'invalid-argument',
|
|
782
|
-
message: 'Invalid argument provided.',
|
|
783
|
-
};
|
|
784
|
-
MessagingClientErrorCode.INVALID_RECIPIENT = {
|
|
785
|
-
code: 'invalid-recipient',
|
|
786
|
-
message: 'Invalid message recipient provided.',
|
|
787
|
-
};
|
|
788
|
-
MessagingClientErrorCode.INVALID_PAYLOAD = {
|
|
789
|
-
code: 'invalid-payload',
|
|
790
|
-
message: 'Invalid message payload provided.',
|
|
791
|
-
};
|
|
792
|
-
MessagingClientErrorCode.INVALID_DATA_PAYLOAD_KEY = {
|
|
793
|
-
code: 'invalid-data-payload-key',
|
|
794
|
-
message: 'The data message payload contains an invalid key. See the reference documentation ' +
|
|
795
|
-
'for the DataMessagePayload type for restricted keys.',
|
|
796
|
-
};
|
|
797
|
-
MessagingClientErrorCode.PAYLOAD_SIZE_LIMIT_EXCEEDED = {
|
|
798
|
-
code: 'payload-size-limit-exceeded',
|
|
799
|
-
message: 'The provided message payload exceeds the FCM size limits. See the error documentation ' +
|
|
800
|
-
'for more details.',
|
|
801
|
-
};
|
|
802
|
-
MessagingClientErrorCode.INVALID_OPTIONS = {
|
|
803
|
-
code: 'invalid-options',
|
|
804
|
-
message: 'Invalid message options provided.',
|
|
805
|
-
};
|
|
806
|
-
MessagingClientErrorCode.INVALID_REGISTRATION_TOKEN = {
|
|
807
|
-
code: 'invalid-registration-token',
|
|
808
|
-
message: 'Invalid registration token provided. Make sure it matches the registration token ' +
|
|
809
|
-
'the client app receives from registering with FCM.',
|
|
810
|
-
};
|
|
811
|
-
MessagingClientErrorCode.REGISTRATION_TOKEN_NOT_REGISTERED = {
|
|
812
|
-
code: 'registration-token-not-registered',
|
|
813
|
-
message: 'The provided registration token is not registered. A previously valid registration ' +
|
|
814
|
-
'token can be unregistered for a variety of reasons. See the error documentation for more ' +
|
|
815
|
-
'details. Remove this registration token and stop using it to send messages.',
|
|
816
|
-
};
|
|
817
|
-
MessagingClientErrorCode.MISMATCHED_CREDENTIAL = {
|
|
818
|
-
code: 'mismatched-credential',
|
|
819
|
-
message: 'The credential used to authenticate this SDK does not have permission to send ' +
|
|
820
|
-
'messages to the device corresponding to the provided registration token. Make sure the ' +
|
|
821
|
-
'credential and registration token both belong to the same Firebase project.',
|
|
822
|
-
};
|
|
823
|
-
MessagingClientErrorCode.INVALID_PACKAGE_NAME = {
|
|
824
|
-
code: 'invalid-package-name',
|
|
825
|
-
message: 'The message was addressed to a registration token whose package name does not match ' +
|
|
826
|
-
'the provided "restrictedPackageName" option.',
|
|
827
|
-
};
|
|
828
|
-
MessagingClientErrorCode.DEVICE_MESSAGE_RATE_EXCEEDED = {
|
|
829
|
-
code: 'device-message-rate-exceeded',
|
|
830
|
-
message: 'The rate of messages to a particular device is too high. Reduce the number of ' +
|
|
831
|
-
'messages sent to this device and do not immediately retry sending to this device.',
|
|
832
|
-
};
|
|
833
|
-
MessagingClientErrorCode.TOPICS_MESSAGE_RATE_EXCEEDED = {
|
|
834
|
-
code: 'topics-message-rate-exceeded',
|
|
835
|
-
message: 'The rate of messages to subscribers to a particular topic is too high. Reduce the ' +
|
|
836
|
-
'number of messages sent for this topic, and do not immediately retry sending to this topic.',
|
|
837
|
-
};
|
|
838
|
-
MessagingClientErrorCode.MESSAGE_RATE_EXCEEDED = {
|
|
839
|
-
code: 'message-rate-exceeded',
|
|
840
|
-
message: 'Sending limit exceeded for the message target.',
|
|
841
|
-
};
|
|
842
|
-
MessagingClientErrorCode.THIRD_PARTY_AUTH_ERROR = {
|
|
843
|
-
code: 'third-party-auth-error',
|
|
844
|
-
message: 'A message targeted to an iOS device could not be sent because the required APNs ' +
|
|
845
|
-
'SSL certificate was not uploaded or has expired. Check the validity of your development ' +
|
|
846
|
-
'and production certificates.',
|
|
847
|
-
};
|
|
848
|
-
MessagingClientErrorCode.TOO_MANY_TOPICS = {
|
|
849
|
-
code: 'too-many-topics',
|
|
850
|
-
message: 'The maximum number of topics the provided registration token can be subscribed to ' +
|
|
851
|
-
'has been exceeded.',
|
|
852
|
-
};
|
|
853
|
-
MessagingClientErrorCode.AUTHENTICATION_ERROR = {
|
|
854
|
-
code: 'authentication-error',
|
|
855
|
-
message: 'An error occurred when trying to authenticate to the FCM servers. Make sure the ' +
|
|
856
|
-
'credential used to authenticate this SDK has the proper permissions. See ' +
|
|
857
|
-
'https://firebase.google.com/docs/admin/setup for setup instructions.',
|
|
858
|
-
};
|
|
859
|
-
MessagingClientErrorCode.SERVER_UNAVAILABLE = {
|
|
860
|
-
code: 'server-unavailable',
|
|
861
|
-
message: 'The FCM server could not process the request in time. See the error documentation ' +
|
|
862
|
-
'for more details.',
|
|
863
|
-
};
|
|
864
|
-
MessagingClientErrorCode.INTERNAL_ERROR = {
|
|
865
|
-
code: 'internal-error',
|
|
866
|
-
message: 'An internal error has occurred. Please retry the request.',
|
|
867
|
-
};
|
|
868
|
-
MessagingClientErrorCode.UNKNOWN_ERROR = {
|
|
869
|
-
code: 'unknown-error',
|
|
870
|
-
message: 'An unknown server error was returned.',
|
|
871
|
-
};
|
|
872
|
-
class InstallationsClientErrorCode {
|
|
873
|
-
}
|
|
874
|
-
exports.InstallationsClientErrorCode = InstallationsClientErrorCode;
|
|
875
|
-
InstallationsClientErrorCode.INVALID_ARGUMENT = {
|
|
876
|
-
code: 'invalid-argument',
|
|
877
|
-
message: 'Invalid argument provided.',
|
|
878
|
-
};
|
|
879
|
-
InstallationsClientErrorCode.INVALID_PROJECT_ID = {
|
|
880
|
-
code: 'invalid-project-id',
|
|
881
|
-
message: 'Invalid project ID provided.',
|
|
882
|
-
};
|
|
883
|
-
InstallationsClientErrorCode.INVALID_INSTALLATION_ID = {
|
|
884
|
-
code: 'invalid-installation-id',
|
|
885
|
-
message: 'Invalid installation ID provided.',
|
|
886
|
-
};
|
|
887
|
-
InstallationsClientErrorCode.API_ERROR = {
|
|
888
|
-
code: 'api-error',
|
|
889
|
-
message: 'Installation ID API call failed.',
|
|
890
|
-
};
|
|
891
|
-
class InstanceIdClientErrorCode extends InstallationsClientErrorCode {
|
|
892
|
-
}
|
|
893
|
-
exports.InstanceIdClientErrorCode = InstanceIdClientErrorCode;
|
|
894
|
-
InstanceIdClientErrorCode.INVALID_INSTANCE_ID = {
|
|
895
|
-
code: 'invalid-instance-id',
|
|
896
|
-
message: 'Invalid instance ID provided.',
|
|
897
|
-
};
|
|
898
|
-
/** @const {ServerToClientCode} Auth server to client enum error codes. */
|
|
899
|
-
const AUTH_SERVER_TO_CLIENT_CODE = {
|
|
900
|
-
// Feature being configured or used requires a billing account.
|
|
901
|
-
BILLING_NOT_ENABLED: 'BILLING_NOT_ENABLED',
|
|
902
|
-
// Claims payload is too large.
|
|
903
|
-
CLAIMS_TOO_LARGE: 'CLAIMS_TOO_LARGE',
|
|
904
|
-
// Configuration being added already exists.
|
|
905
|
-
CONFIGURATION_EXISTS: 'CONFIGURATION_EXISTS',
|
|
906
|
-
// Configuration not found.
|
|
907
|
-
CONFIGURATION_NOT_FOUND: 'CONFIGURATION_NOT_FOUND',
|
|
908
|
-
// Provided credential has insufficient permissions.
|
|
909
|
-
INSUFFICIENT_PERMISSION: 'INSUFFICIENT_PERMISSION',
|
|
910
|
-
// Provided configuration has invalid fields.
|
|
911
|
-
INVALID_CONFIG: 'INVALID_CONFIG',
|
|
912
|
-
// Provided configuration identifier is invalid.
|
|
913
|
-
INVALID_CONFIG_ID: 'INVALID_PROVIDER_ID',
|
|
914
|
-
// ActionCodeSettings missing continue URL.
|
|
915
|
-
INVALID_CONTINUE_URI: 'INVALID_CONTINUE_URI',
|
|
916
|
-
// Dynamic link domain in provided ActionCodeSettings is not authorized.
|
|
917
|
-
INVALID_DYNAMIC_LINK_DOMAIN: 'INVALID_DYNAMIC_LINK_DOMAIN',
|
|
918
|
-
// Hosting link domain in provided ActionCodeSettings is not owned by the current project.
|
|
919
|
-
INVALID_HOSTING_LINK_DOMAIN: 'INVALID_HOSTING_LINK_DOMAIN',
|
|
920
|
-
// uploadAccount provides an email that already exists.
|
|
921
|
-
DUPLICATE_EMAIL: 'EMAIL_ALREADY_EXISTS',
|
|
922
|
-
// uploadAccount provides a localId that already exists.
|
|
923
|
-
DUPLICATE_LOCAL_ID: 'UID_ALREADY_EXISTS',
|
|
924
|
-
// Request specified a multi-factor enrollment ID that already exists.
|
|
925
|
-
DUPLICATE_MFA_ENROLLMENT_ID: 'SECOND_FACTOR_UID_ALREADY_EXISTS',
|
|
926
|
-
// setAccountInfo email already exists.
|
|
927
|
-
EMAIL_EXISTS: 'EMAIL_ALREADY_EXISTS',
|
|
928
|
-
// /accounts:sendOobCode for password reset when user is not found.
|
|
929
|
-
EMAIL_NOT_FOUND: 'EMAIL_NOT_FOUND',
|
|
930
|
-
// Reserved claim name.
|
|
931
|
-
FORBIDDEN_CLAIM: 'FORBIDDEN_CLAIM',
|
|
932
|
-
// Invalid claims provided.
|
|
933
|
-
INVALID_CLAIMS: 'INVALID_CLAIMS',
|
|
934
|
-
// Invalid session cookie duration.
|
|
935
|
-
INVALID_DURATION: 'INVALID_SESSION_COOKIE_DURATION',
|
|
936
|
-
// Invalid email provided.
|
|
937
|
-
INVALID_EMAIL: 'INVALID_EMAIL',
|
|
938
|
-
// Invalid new email provided.
|
|
939
|
-
INVALID_NEW_EMAIL: 'INVALID_NEW_EMAIL',
|
|
940
|
-
// Invalid tenant display name. This can be thrown on CreateTenant and UpdateTenant.
|
|
941
|
-
INVALID_DISPLAY_NAME: 'INVALID_DISPLAY_NAME',
|
|
942
|
-
// Invalid ID token provided.
|
|
943
|
-
INVALID_ID_TOKEN: 'INVALID_ID_TOKEN',
|
|
944
|
-
// Invalid tenant/parent resource name.
|
|
945
|
-
INVALID_NAME: 'INVALID_NAME',
|
|
946
|
-
// OIDC configuration has an invalid OAuth client ID.
|
|
947
|
-
INVALID_OAUTH_CLIENT_ID: 'INVALID_OAUTH_CLIENT_ID',
|
|
948
|
-
// Invalid page token.
|
|
949
|
-
INVALID_PAGE_SELECTION: 'INVALID_PAGE_TOKEN',
|
|
950
|
-
// Invalid phone number.
|
|
951
|
-
INVALID_PHONE_NUMBER: 'INVALID_PHONE_NUMBER',
|
|
952
|
-
// Invalid agent project. Either agent project doesn't exist or didn't enable multi-tenancy.
|
|
953
|
-
INVALID_PROJECT_ID: 'INVALID_PROJECT_ID',
|
|
954
|
-
// Invalid provider ID.
|
|
955
|
-
INVALID_PROVIDER_ID: 'INVALID_PROVIDER_ID',
|
|
956
|
-
// Invalid service account.
|
|
957
|
-
INVALID_SERVICE_ACCOUNT: 'INVALID_SERVICE_ACCOUNT',
|
|
958
|
-
// Invalid testing phone number.
|
|
959
|
-
INVALID_TESTING_PHONE_NUMBER: 'INVALID_TESTING_PHONE_NUMBER',
|
|
960
|
-
// Invalid tenant type.
|
|
961
|
-
INVALID_TENANT_TYPE: 'INVALID_TENANT_TYPE',
|
|
962
|
-
// Missing Android package name.
|
|
963
|
-
MISSING_ANDROID_PACKAGE_NAME: 'MISSING_ANDROID_PACKAGE_NAME',
|
|
964
|
-
// Missing configuration.
|
|
965
|
-
MISSING_CONFIG: 'MISSING_CONFIG',
|
|
966
|
-
// Missing configuration identifier.
|
|
967
|
-
MISSING_CONFIG_ID: 'MISSING_PROVIDER_ID',
|
|
968
|
-
// Missing tenant display name: This can be thrown on CreateTenant and UpdateTenant.
|
|
969
|
-
MISSING_DISPLAY_NAME: 'MISSING_DISPLAY_NAME',
|
|
970
|
-
// Email is required for the specified action. For example a multi-factor user requires
|
|
971
|
-
// a verified email.
|
|
972
|
-
MISSING_EMAIL: 'MISSING_EMAIL',
|
|
973
|
-
// Missing iOS bundle ID.
|
|
974
|
-
MISSING_IOS_BUNDLE_ID: 'MISSING_IOS_BUNDLE_ID',
|
|
975
|
-
// Missing OIDC issuer.
|
|
976
|
-
MISSING_ISSUER: 'MISSING_ISSUER',
|
|
977
|
-
// No localId provided (deleteAccount missing localId).
|
|
978
|
-
MISSING_LOCAL_ID: 'MISSING_UID',
|
|
979
|
-
// OIDC configuration is missing an OAuth client ID.
|
|
980
|
-
MISSING_OAUTH_CLIENT_ID: 'MISSING_OAUTH_CLIENT_ID',
|
|
981
|
-
// Missing provider ID.
|
|
982
|
-
MISSING_PROVIDER_ID: 'MISSING_PROVIDER_ID',
|
|
983
|
-
// Missing SAML RP config.
|
|
984
|
-
MISSING_SAML_RELYING_PARTY_CONFIG: 'MISSING_SAML_RELYING_PARTY_CONFIG',
|
|
985
|
-
// Empty user list in uploadAccount.
|
|
986
|
-
MISSING_USER_ACCOUNT: 'MISSING_UID',
|
|
987
|
-
// Password auth disabled in console.
|
|
988
|
-
OPERATION_NOT_ALLOWED: 'OPERATION_NOT_ALLOWED',
|
|
989
|
-
// Provided credential has insufficient permissions.
|
|
990
|
-
PERMISSION_DENIED: 'INSUFFICIENT_PERMISSION',
|
|
991
|
-
// Phone number already exists.
|
|
992
|
-
PHONE_NUMBER_EXISTS: 'PHONE_NUMBER_ALREADY_EXISTS',
|
|
993
|
-
// Project not found.
|
|
994
|
-
PROJECT_NOT_FOUND: 'PROJECT_NOT_FOUND',
|
|
995
|
-
// In multi-tenancy context: project creation quota exceeded.
|
|
996
|
-
QUOTA_EXCEEDED: 'QUOTA_EXCEEDED',
|
|
997
|
-
// Currently only 5 second factors can be set on the same user.
|
|
998
|
-
SECOND_FACTOR_LIMIT_EXCEEDED: 'SECOND_FACTOR_LIMIT_EXCEEDED',
|
|
999
|
-
// Tenant not found.
|
|
1000
|
-
TENANT_NOT_FOUND: 'TENANT_NOT_FOUND',
|
|
1001
|
-
// Tenant ID mismatch.
|
|
1002
|
-
TENANT_ID_MISMATCH: 'MISMATCHING_TENANT_ID',
|
|
1003
|
-
// Token expired error.
|
|
1004
|
-
TOKEN_EXPIRED: 'ID_TOKEN_EXPIRED',
|
|
1005
|
-
// Continue URL provided in ActionCodeSettings has a domain that is not whitelisted.
|
|
1006
|
-
UNAUTHORIZED_DOMAIN: 'UNAUTHORIZED_DOMAIN',
|
|
1007
|
-
// A multi-factor user requires a supported first factor.
|
|
1008
|
-
UNSUPPORTED_FIRST_FACTOR: 'UNSUPPORTED_FIRST_FACTOR',
|
|
1009
|
-
// The request specified an unsupported type of second factor.
|
|
1010
|
-
UNSUPPORTED_SECOND_FACTOR: 'UNSUPPORTED_SECOND_FACTOR',
|
|
1011
|
-
// Operation is not supported in a multi-tenant context.
|
|
1012
|
-
UNSUPPORTED_TENANT_OPERATION: 'UNSUPPORTED_TENANT_OPERATION',
|
|
1013
|
-
// A verified email is required for the specified action. For example a multi-factor user
|
|
1014
|
-
// requires a verified email.
|
|
1015
|
-
UNVERIFIED_EMAIL: 'UNVERIFIED_EMAIL',
|
|
1016
|
-
// User on which action is to be performed is not found.
|
|
1017
|
-
USER_NOT_FOUND: 'USER_NOT_FOUND',
|
|
1018
|
-
// User record is disabled.
|
|
1019
|
-
USER_DISABLED: 'USER_DISABLED',
|
|
1020
|
-
// Password provided is too weak.
|
|
1021
|
-
WEAK_PASSWORD: 'INVALID_PASSWORD',
|
|
1022
|
-
// Unrecognized reCAPTCHA action.
|
|
1023
|
-
INVALID_RECAPTCHA_ACTION: 'INVALID_RECAPTCHA_ACTION',
|
|
1024
|
-
// Unrecognized reCAPTCHA enforcement state.
|
|
1025
|
-
INVALID_RECAPTCHA_ENFORCEMENT_STATE: 'INVALID_RECAPTCHA_ENFORCEMENT_STATE',
|
|
1026
|
-
// reCAPTCHA is not enabled for account defender.
|
|
1027
|
-
RECAPTCHA_NOT_ENABLED: 'RECAPTCHA_NOT_ENABLED'
|
|
1028
|
-
};
|
|
1029
|
-
/** @const {ServerToClientCode} Messaging server to client enum error codes. */
|
|
1030
|
-
const MESSAGING_SERVER_TO_CLIENT_CODE = {
|
|
1031
|
-
/* GENERIC ERRORS */
|
|
1032
|
-
// Generic invalid message parameter provided.
|
|
1033
|
-
InvalidParameters: 'INVALID_ARGUMENT',
|
|
1034
|
-
// Mismatched sender ID.
|
|
1035
|
-
MismatchSenderId: 'MISMATCHED_CREDENTIAL',
|
|
1036
|
-
// FCM server unavailable.
|
|
1037
|
-
Unavailable: 'SERVER_UNAVAILABLE',
|
|
1038
|
-
// FCM server internal error.
|
|
1039
|
-
InternalServerError: 'INTERNAL_ERROR',
|
|
1040
|
-
/* SEND ERRORS */
|
|
1041
|
-
// Invalid registration token format.
|
|
1042
|
-
InvalidRegistration: 'INVALID_REGISTRATION_TOKEN',
|
|
1043
|
-
// Registration token is not registered.
|
|
1044
|
-
NotRegistered: 'REGISTRATION_TOKEN_NOT_REGISTERED',
|
|
1045
|
-
// Registration token does not match restricted package name.
|
|
1046
|
-
InvalidPackageName: 'INVALID_PACKAGE_NAME',
|
|
1047
|
-
// Message payload size limit exceeded.
|
|
1048
|
-
MessageTooBig: 'PAYLOAD_SIZE_LIMIT_EXCEEDED',
|
|
1049
|
-
// Invalid key in the data message payload.
|
|
1050
|
-
InvalidDataKey: 'INVALID_DATA_PAYLOAD_KEY',
|
|
1051
|
-
// Invalid time to live option.
|
|
1052
|
-
InvalidTtl: 'INVALID_OPTIONS',
|
|
1053
|
-
// Device message rate exceeded.
|
|
1054
|
-
DeviceMessageRateExceeded: 'DEVICE_MESSAGE_RATE_EXCEEDED',
|
|
1055
|
-
// Topics message rate exceeded.
|
|
1056
|
-
TopicsMessageRateExceeded: 'TOPICS_MESSAGE_RATE_EXCEEDED',
|
|
1057
|
-
// Invalid APNs credentials.
|
|
1058
|
-
InvalidApnsCredential: 'THIRD_PARTY_AUTH_ERROR',
|
|
1059
|
-
/* FCM v1 canonical error codes */
|
|
1060
|
-
NOT_FOUND: 'REGISTRATION_TOKEN_NOT_REGISTERED',
|
|
1061
|
-
PERMISSION_DENIED: 'MISMATCHED_CREDENTIAL',
|
|
1062
|
-
RESOURCE_EXHAUSTED: 'MESSAGE_RATE_EXCEEDED',
|
|
1063
|
-
UNAUTHENTICATED: 'THIRD_PARTY_AUTH_ERROR',
|
|
1064
|
-
/* FCM v1 new error codes */
|
|
1065
|
-
APNS_AUTH_ERROR: 'THIRD_PARTY_AUTH_ERROR',
|
|
1066
|
-
INTERNAL: 'INTERNAL_ERROR',
|
|
1067
|
-
INVALID_ARGUMENT: 'INVALID_ARGUMENT',
|
|
1068
|
-
QUOTA_EXCEEDED: 'MESSAGE_RATE_EXCEEDED',
|
|
1069
|
-
SENDER_ID_MISMATCH: 'MISMATCHED_CREDENTIAL',
|
|
1070
|
-
THIRD_PARTY_AUTH_ERROR: 'THIRD_PARTY_AUTH_ERROR',
|
|
1071
|
-
UNAVAILABLE: 'SERVER_UNAVAILABLE',
|
|
1072
|
-
UNREGISTERED: 'REGISTRATION_TOKEN_NOT_REGISTERED',
|
|
1073
|
-
UNSPECIFIED_ERROR: 'UNKNOWN_ERROR',
|
|
1074
|
-
};
|
|
1075
|
-
/** @const {ServerToClientCode} Topic management (IID) server to client enum error codes. */
|
|
1076
|
-
const TOPIC_MGT_SERVER_TO_CLIENT_CODE = {
|
|
1077
|
-
/* TOPIC SUBSCRIPTION MANAGEMENT ERRORS */
|
|
1078
|
-
NOT_FOUND: 'REGISTRATION_TOKEN_NOT_REGISTERED',
|
|
1079
|
-
INVALID_ARGUMENT: 'INVALID_REGISTRATION_TOKEN',
|
|
1080
|
-
TOO_MANY_TOPICS: 'TOO_MANY_TOPICS',
|
|
1081
|
-
RESOURCE_EXHAUSTED: 'TOO_MANY_TOPICS',
|
|
1082
|
-
PERMISSION_DENIED: 'AUTHENTICATION_ERROR',
|
|
1083
|
-
DEADLINE_EXCEEDED: 'SERVER_UNAVAILABLE',
|
|
1084
|
-
INTERNAL: 'INTERNAL_ERROR',
|
|
1085
|
-
UNKNOWN: 'UNKNOWN_ERROR',
|
|
1086
|
-
};
|
|
92
|
+
exports.FirebaseError = FirebaseError;
|