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