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.
Files changed (281) hide show
  1. package/README.md +1 -2
  2. package/lib/app/core.d.ts +2 -38
  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 +1 -1
  6. package/lib/app/credential-internal.d.ts +1 -1
  7. package/lib/app/credential-internal.js +48 -17
  8. package/lib/app/credential.d.ts +1 -1
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/error.d.ts +47 -0
  11. package/lib/app/error.js +57 -0
  12. package/lib/app/firebase-app.d.ts +1 -1
  13. package/lib/app/firebase-app.js +28 -12
  14. package/lib/app/index.d.ts +4 -3
  15. package/lib/app/index.js +6 -4
  16. package/lib/app/lifecycle.d.ts +2 -2
  17. package/lib/app/lifecycle.js +46 -21
  18. package/lib/app-check/app-check-api-client-internal.d.ts +2 -16
  19. package/lib/app-check/app-check-api-client-internal.js +71 -47
  20. package/lib/app-check/app-check-api.d.ts +19 -1
  21. package/lib/app-check/app-check-api.js +1 -1
  22. package/lib/app-check/app-check.d.ts +1 -1
  23. package/lib/app-check/app-check.js +7 -3
  24. package/lib/app-check/error.d.ts +47 -0
  25. package/lib/app-check/error.js +65 -0
  26. package/lib/app-check/index.d.ts +2 -1
  27. package/lib/app-check/index.js +5 -2
  28. package/lib/app-check/token-generator.d.ts +1 -1
  29. package/lib/app-check/token-generator.js +43 -13
  30. package/lib/app-check/token-verifier.d.ts +1 -1
  31. package/lib/app-check/token-verifier.js +39 -11
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +16 -16
  34. package/lib/auth/auth-api-request.d.ts +6 -4
  35. package/lib/auth/auth-api-request.js +277 -166
  36. package/lib/auth/auth-config.d.ts +31 -2
  37. package/lib/auth/auth-config.js +103 -103
  38. package/lib/auth/auth.d.ts +1 -1
  39. package/lib/auth/auth.js +1 -1
  40. package/lib/auth/base-auth.d.ts +2 -1
  41. package/lib/auth/base-auth.js +29 -27
  42. package/lib/auth/error.d.ts +137 -0
  43. package/lib/auth/error.js +690 -0
  44. package/lib/auth/identifier.d.ts +1 -1
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +2 -2
  47. package/lib/auth/index.js +4 -4
  48. package/lib/auth/project-config-manager.d.ts +1 -1
  49. package/lib/auth/project-config-manager.js +1 -1
  50. package/lib/auth/project-config.d.ts +1 -1
  51. package/lib/auth/project-config.js +4 -4
  52. package/lib/auth/tenant-manager.d.ts +2 -1
  53. package/lib/auth/tenant-manager.js +13 -10
  54. package/lib/auth/tenant.d.ts +1 -1
  55. package/lib/auth/tenant.js +7 -7
  56. package/lib/auth/token-generator.d.ts +1 -1
  57. package/lib/auth/token-generator.js +13 -13
  58. package/lib/auth/token-verifier.d.ts +1 -1
  59. package/lib/auth/token-verifier.js +22 -22
  60. package/lib/auth/user-import-builder.d.ts +1 -1
  61. package/lib/auth/user-import-builder.js +22 -22
  62. package/lib/auth/user-record.d.ts +1 -1
  63. package/lib/auth/user-record.js +6 -6
  64. package/lib/credential/index.d.ts +1 -1
  65. package/lib/credential/index.js +1 -1
  66. package/lib/data-connect/data-connect-api-client-internal.d.ts +1 -16
  67. package/lib/data-connect/data-connect-api-client-internal.js +122 -65
  68. package/lib/data-connect/data-connect-api.d.ts +1 -1
  69. package/lib/data-connect/data-connect-api.js +1 -1
  70. package/lib/data-connect/data-connect.d.ts +1 -1
  71. package/lib/data-connect/data-connect.js +1 -1
  72. package/lib/data-connect/error.d.ts +47 -0
  73. package/lib/data-connect/error.js +66 -0
  74. package/lib/data-connect/index.d.ts +2 -1
  75. package/lib/data-connect/index.js +5 -2
  76. package/lib/data-connect/validate-admin-args.d.ts +1 -1
  77. package/lib/data-connect/validate-admin-args.js +6 -3
  78. package/lib/database/database.d.ts +1 -1
  79. package/lib/database/database.js +11 -6
  80. package/lib/database/error.d.ts +39 -0
  81. package/lib/database/error.js +49 -0
  82. package/lib/database/index.d.ts +2 -2
  83. package/lib/database/index.js +4 -3
  84. package/lib/esm/app/index.js +2 -1
  85. package/lib/esm/app-check/index.js +2 -0
  86. package/lib/esm/auth/index.js +1 -1
  87. package/lib/esm/data-connect/index.js +2 -0
  88. package/lib/esm/database/index.js +1 -0
  89. package/lib/esm/eventarc/index.js +2 -0
  90. package/lib/esm/extensions/index.js +2 -0
  91. package/lib/esm/firebase-admin/index.js +13 -0
  92. package/lib/esm/firestore/index.js +1 -0
  93. package/lib/esm/functions/index.js +2 -0
  94. package/lib/esm/installations/index.js +1 -1
  95. package/lib/esm/machine-learning/index.js +2 -0
  96. package/lib/esm/messaging/index.js +1 -1
  97. package/lib/esm/phone-number-verification/index.js +2 -0
  98. package/lib/esm/project-management/index.js +1 -0
  99. package/lib/esm/remote-config/index.js +2 -0
  100. package/lib/esm/security-rules/index.js +2 -0
  101. package/lib/esm/storage/index.js +2 -0
  102. package/lib/eventarc/cloudevent.d.ts +1 -1
  103. package/lib/eventarc/cloudevent.js +1 -1
  104. package/lib/eventarc/error.d.ts +38 -0
  105. package/lib/eventarc/error.js +47 -0
  106. package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
  107. package/lib/eventarc/eventarc-client-internal.js +24 -9
  108. package/lib/eventarc/eventarc-utils.d.ts +1 -13
  109. package/lib/eventarc/eventarc-utils.js +36 -26
  110. package/lib/eventarc/eventarc.d.ts +1 -1
  111. package/lib/eventarc/eventarc.js +18 -6
  112. package/lib/eventarc/index.d.ts +2 -1
  113. package/lib/eventarc/index.js +5 -2
  114. package/lib/extensions/error.d.ts +41 -0
  115. package/lib/extensions/error.js +50 -0
  116. package/lib/extensions/extensions-api-client-internal.d.ts +1 -13
  117. package/lib/extensions/extensions-api-client-internal.js +40 -28
  118. package/lib/extensions/extensions-api.d.ts +1 -1
  119. package/lib/extensions/extensions-api.js +1 -1
  120. package/lib/extensions/extensions.d.ts +1 -1
  121. package/lib/extensions/extensions.js +18 -5
  122. package/lib/extensions/index.d.ts +2 -1
  123. package/lib/extensions/index.js +5 -2
  124. package/lib/firestore/error.d.ts +41 -0
  125. package/lib/firestore/error.js +51 -0
  126. package/lib/firestore/firestore-internal.d.ts +2 -1
  127. package/lib/firestore/firestore-internal.js +6 -6
  128. package/lib/firestore/index.d.ts +2 -2
  129. package/lib/firestore/index.js +7 -7
  130. package/lib/functions/error.d.ts +48 -0
  131. package/lib/functions/error.js +67 -0
  132. package/lib/functions/functions-api-client-internal.d.ts +1 -16
  133. package/lib/functions/functions-api-client-internal.js +111 -71
  134. package/lib/functions/functions-api.d.ts +1 -1
  135. package/lib/functions/functions-api.js +1 -1
  136. package/lib/functions/functions.d.ts +1 -1
  137. package/lib/functions/functions.js +14 -4
  138. package/lib/functions/index.d.ts +2 -1
  139. package/lib/functions/index.js +5 -2
  140. package/lib/index.d.ts +13 -8
  141. package/lib/index.js +19 -3
  142. package/lib/installations/error.d.ts +48 -0
  143. package/lib/installations/error.js +73 -0
  144. package/lib/installations/index.d.ts +2 -2
  145. package/lib/installations/index.js +4 -4
  146. package/lib/installations/installations-request-handler.d.ts +1 -1
  147. package/lib/installations/installations-request-handler.js +11 -5
  148. package/lib/installations/installations.d.ts +1 -1
  149. package/lib/installations/installations.js +3 -3
  150. package/lib/machine-learning/error.d.ts +53 -0
  151. package/lib/machine-learning/error.js +84 -0
  152. package/lib/machine-learning/index.d.ts +2 -1
  153. package/lib/machine-learning/index.js +5 -2
  154. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  155. package/lib/machine-learning/machine-learning-api-client.js +61 -24
  156. package/lib/machine-learning/machine-learning.d.ts +1 -1
  157. package/lib/machine-learning/machine-learning.js +21 -9
  158. package/lib/messaging/error.d.ts +63 -0
  159. package/lib/messaging/error.js +286 -0
  160. package/lib/messaging/index.d.ts +3 -3
  161. package/lib/messaging/index.js +4 -4
  162. package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
  163. package/lib/messaging/messaging-api-request-internal.js +1 -1
  164. package/lib/messaging/messaging-api.d.ts +1 -280
  165. package/lib/messaging/messaging-api.js +1 -1
  166. package/lib/messaging/messaging-errors-internal.d.ts +2 -2
  167. package/lib/messaging/messaging-errors-internal.js +11 -8
  168. package/lib/messaging/messaging-internal.d.ts +1 -1
  169. package/lib/messaging/messaging-internal.js +48 -48
  170. package/lib/messaging/messaging.d.ts +1 -1
  171. package/lib/messaging/messaging.js +47 -50
  172. package/lib/phone-number-verification/error.d.ts +43 -0
  173. package/lib/phone-number-verification/error.js +48 -0
  174. package/lib/phone-number-verification/index.d.ts +2 -1
  175. package/lib/phone-number-verification/index.js +5 -2
  176. package/lib/phone-number-verification/phone-number-verification-api-client-internal.d.ts +1 -18
  177. package/lib/phone-number-verification/phone-number-verification-api-client-internal.js +2 -26
  178. package/lib/phone-number-verification/phone-number-verification-api.d.ts +2 -2
  179. package/lib/phone-number-verification/phone-number-verification-api.js +5 -4
  180. package/lib/phone-number-verification/phone-number-verification.d.ts +1 -1
  181. package/lib/phone-number-verification/phone-number-verification.js +1 -1
  182. package/lib/phone-number-verification/token-verifier.d.ts +1 -1
  183. package/lib/phone-number-verification/token-verifier.js +68 -20
  184. package/lib/project-management/android-app.d.ts +1 -1
  185. package/lib/project-management/android-app.js +15 -6
  186. package/lib/project-management/app-metadata.d.ts +1 -1
  187. package/lib/project-management/app-metadata.js +1 -1
  188. package/lib/project-management/error.d.ts +45 -0
  189. package/lib/project-management/error.js +55 -0
  190. package/lib/project-management/index.d.ts +2 -2
  191. package/lib/project-management/index.js +4 -3
  192. package/lib/project-management/ios-app.d.ts +1 -1
  193. package/lib/project-management/ios-app.js +6 -3
  194. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  195. package/lib/project-management/project-management-api-request-internal.js +18 -6
  196. package/lib/project-management/project-management.d.ts +1 -1
  197. package/lib/project-management/project-management.js +13 -7
  198. package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
  199. package/lib/remote-config/condition-evaluator-internal.js +4 -4
  200. package/lib/remote-config/error.d.ts +49 -0
  201. package/lib/remote-config/error.js +70 -0
  202. package/lib/remote-config/index.d.ts +2 -1
  203. package/lib/remote-config/index.js +5 -2
  204. package/lib/remote-config/internal/value-impl.d.ts +1 -1
  205. package/lib/remote-config/internal/value-impl.js +1 -1
  206. package/lib/remote-config/remote-config-api-client-internal.d.ts +2 -13
  207. package/lib/remote-config/remote-config-api-client-internal.js +80 -52
  208. package/lib/remote-config/remote-config-api.d.ts +1 -1
  209. package/lib/remote-config/remote-config-api.js +1 -1
  210. package/lib/remote-config/remote-config.d.ts +1 -1
  211. package/lib/remote-config/remote-config.js +92 -23
  212. package/lib/security-rules/error.d.ts +45 -0
  213. package/lib/security-rules/error.js +54 -0
  214. package/lib/security-rules/index.d.ts +2 -1
  215. package/lib/security-rules/index.js +5 -2
  216. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  217. package/lib/security-rules/security-rules-api-client-internal.js +50 -18
  218. package/lib/security-rules/security-rules.d.ts +1 -1
  219. package/lib/security-rules/security-rules.js +32 -11
  220. package/lib/storage/error.d.ts +41 -0
  221. package/lib/storage/error.js +50 -0
  222. package/lib/storage/index.d.ts +2 -1
  223. package/lib/storage/index.js +8 -5
  224. package/lib/storage/storage.d.ts +1 -1
  225. package/lib/storage/storage.js +12 -12
  226. package/lib/storage/utils.d.ts +1 -1
  227. package/lib/storage/utils.js +1 -1
  228. package/lib/utils/api-request.d.ts +12 -12
  229. package/lib/utils/api-request.js +97 -55
  230. package/lib/utils/crypto-signer.d.ts +1 -1
  231. package/lib/utils/crypto-signer.js +2 -7
  232. package/lib/utils/deep-copy.d.ts +1 -1
  233. package/lib/utils/deep-copy.js +1 -1
  234. package/lib/utils/error.d.ts +75 -570
  235. package/lib/utils/error.js +53 -1047
  236. package/lib/utils/index.d.ts +1 -1
  237. package/lib/utils/index.js +2 -2
  238. package/lib/utils/jwt.d.ts +1 -1
  239. package/lib/utils/jwt.js +1 -2
  240. package/lib/utils/validator.d.ts +1 -1
  241. package/lib/utils/validator.js +1 -1
  242. package/package.json +25 -33
  243. package/lib/app/firebase-namespace.d.ts +0 -163
  244. package/lib/app/firebase-namespace.js +0 -335
  245. package/lib/app-check/app-check-namespace.d.ts +0 -72
  246. package/lib/app-check/app-check-namespace.js +0 -18
  247. package/lib/auth/auth-namespace.d.ts +0 -257
  248. package/lib/auth/auth-namespace.js +0 -18
  249. package/lib/database/database-namespace.d.ts +0 -95
  250. package/lib/database/database-namespace.js +0 -23
  251. package/lib/default-namespace.d.ts +0 -24
  252. package/lib/default-namespace.js +0 -30
  253. package/lib/esm/instance-id/index.js +0 -6
  254. package/lib/firebase-namespace-api.d.ts +0 -91
  255. package/lib/firebase-namespace-api.js +0 -58
  256. package/lib/firestore/firestore-namespace.d.ts +0 -71
  257. package/lib/firestore/firestore-namespace.js +0 -52
  258. package/lib/installations/installations-namespace.d.ts +0 -55
  259. package/lib/installations/installations-namespace.js +0 -18
  260. package/lib/instance-id/index.d.ts +0 -62
  261. package/lib/instance-id/index.js +0 -74
  262. package/lib/instance-id/instance-id-namespace.d.ts +0 -38
  263. package/lib/instance-id/instance-id-namespace.js +0 -3
  264. package/lib/instance-id/instance-id.d.ts +0 -47
  265. package/lib/instance-id/instance-id.js +0 -77
  266. package/lib/machine-learning/machine-learning-namespace.d.ts +0 -81
  267. package/lib/machine-learning/machine-learning-namespace.js +0 -18
  268. package/lib/machine-learning/machine-learning-utils.d.ts +0 -22
  269. package/lib/machine-learning/machine-learning-utils.js +0 -47
  270. package/lib/messaging/messaging-namespace.d.ts +0 -161
  271. package/lib/messaging/messaging-namespace.js +0 -18
  272. package/lib/project-management/project-management-namespace.d.ts +0 -82
  273. package/lib/project-management/project-management-namespace.js +0 -18
  274. package/lib/remote-config/remote-config-namespace.d.ts +0 -141
  275. package/lib/remote-config/remote-config-namespace.js +0 -18
  276. package/lib/security-rules/security-rules-internal.d.ts +0 -21
  277. package/lib/security-rules/security-rules-internal.js +0 -26
  278. package/lib/security-rules/security-rules-namespace.d.ts +0 -69
  279. package/lib/security-rules/security-rules-namespace.js +0 -18
  280. package/lib/storage/storage-namespace.d.ts +0 -45
  281. package/lib/storage/storage-namespace.js +0 -18
@@ -0,0 +1,41 @@
1
+ /*! firebase-admin v14.0.0 */
2
+ /*!
3
+ * Copyright 2026 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseError, ErrorInfo } from '../utils/error';
18
+ /**
19
+ * The constant mapping for valid Storage client error codes.
20
+ */
21
+ export declare const StorageErrorCode: {
22
+ readonly INVALID_ARGUMENT: "invalid-argument";
23
+ readonly INVALID_EMULATOR_HOST: "invalid-emulator-host";
24
+ readonly MISSING_DEPENDENCIES: "missing-dependencies";
25
+ readonly INVALID_CREDENTIAL: "invalid-credential";
26
+ readonly NO_DOWNLOAD_TOKEN: "no-download-token";
27
+ };
28
+ /**
29
+ * The type definition for valid Storage client error codes.
30
+ */
31
+ export type StorageErrorCode = typeof StorageErrorCode[keyof typeof StorageErrorCode];
32
+ /**
33
+ * Firebase Storage error code structure. This extends `FirebaseError`.
34
+ */
35
+ export declare class FirebaseStorageError extends FirebaseError {
36
+ /**
37
+ * @param info - The error code info.
38
+ * @param message - The error message. If provided, this will override the default message.
39
+ */
40
+ constructor(info: ErrorInfo, message?: string);
41
+ }
@@ -0,0 +1,50 @@
1
+ /*! firebase-admin v14.0.0 */
2
+ "use strict";
3
+ /*!
4
+ * Copyright 2026 Google LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.FirebaseStorageError = exports.StorageErrorCode = void 0;
20
+ const error_1 = require("../utils/error");
21
+ /**
22
+ * The constant mapping for valid Storage client error codes.
23
+ */
24
+ exports.StorageErrorCode = {
25
+ INVALID_ARGUMENT: 'invalid-argument',
26
+ INVALID_EMULATOR_HOST: 'invalid-emulator-host',
27
+ MISSING_DEPENDENCIES: 'missing-dependencies',
28
+ INVALID_CREDENTIAL: 'invalid-credential',
29
+ NO_DOWNLOAD_TOKEN: 'no-download-token',
30
+ };
31
+ /**
32
+ * Firebase Storage error code structure. This extends `FirebaseError`.
33
+ */
34
+ class FirebaseStorageError extends error_1.FirebaseError {
35
+ /**
36
+ * @param info - The error code info.
37
+ * @param message - The error message. If provided, this will override the default message.
38
+ */
39
+ constructor(info, message) {
40
+ super({
41
+ code: `storage/${info.code}`,
42
+ message: message || info.message,
43
+ httpResponse: info.httpResponse,
44
+ cause: info.cause,
45
+ });
46
+ /** @internal */
47
+ this.codePrefix = 'storage';
48
+ }
49
+ }
50
+ exports.FirebaseStorageError = FirebaseStorageError;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google LLC
4
4
  *
@@ -55,3 +55,4 @@ export declare function getStorage(app?: App): Storage;
55
55
  * ```
56
56
  */
57
57
  export declare function getDownloadURL(file: File): Promise<string>;
58
+ export { FirebaseStorageError, StorageErrorCode, } from './error';
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google LLC
@@ -16,12 +16,12 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.Storage = void 0;
19
+ exports.StorageErrorCode = exports.FirebaseStorageError = exports.Storage = void 0;
20
20
  exports.getStorage = getStorage;
21
21
  exports.getDownloadURL = getDownloadURL;
22
22
  const app_1 = require("../app");
23
23
  const storage_1 = require("./storage");
24
- const error_1 = require("../utils/error");
24
+ const error_1 = require("./error");
25
25
  const utils_1 = require("./utils");
26
26
  var storage_2 = require("./storage");
27
27
  Object.defineProperty(exports, "Storage", { enumerable: true, get: function () { return storage_2.Storage; } });
@@ -67,11 +67,14 @@ async function getDownloadURL(file) {
67
67
  'https://firebasestorage.googleapis.com') + '/v0';
68
68
  const { downloadTokens } = await (0, utils_1.getFirebaseMetadata)(endpoint, file);
69
69
  if (!downloadTokens) {
70
- throw new error_1.FirebaseError({
71
- code: 'storage/no-download-token',
70
+ throw new error_1.FirebaseStorageError({
71
+ code: 'no-download-token',
72
72
  message: 'No download token available. Please create one in the Firebase Console.',
73
73
  });
74
74
  }
75
75
  const [token] = downloadTokens.split(',');
76
76
  return `${endpoint}/b/${file.bucket.name}/o/${encodeURIComponent(file.name)}?alt=media&token=${token}`;
77
77
  }
78
+ var error_2 = require("./error");
79
+ Object.defineProperty(exports, "FirebaseStorageError", { enumerable: true, get: function () { return error_2.FirebaseStorageError; } });
80
+ Object.defineProperty(exports, "StorageErrorCode", { enumerable: true, get: function () { return error_2.StorageErrorCode; } });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -18,7 +18,7 @@
18
18
  */
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.Storage = void 0;
21
- const error_1 = require("../utils/error");
21
+ const error_1 = require("./error");
22
22
  const credential_internal_1 = require("../app/credential-internal");
23
23
  const utils = require("../utils/index");
24
24
  const validator = require("../utils/validator");
@@ -35,16 +35,16 @@ class Storage {
35
35
  */
36
36
  constructor(app) {
37
37
  if (!validator.isNonNullObject(app) || !('options' in app)) {
38
- throw new error_1.FirebaseError({
39
- code: 'storage/invalid-argument',
38
+ throw new error_1.FirebaseStorageError({
39
+ code: 'invalid-argument',
40
40
  message: 'First argument passed to admin.storage() must be a valid Firebase app instance.',
41
41
  });
42
42
  }
43
43
  if (!process.env.STORAGE_EMULATOR_HOST && process.env.FIREBASE_STORAGE_EMULATOR_HOST) {
44
44
  const firebaseStorageEmulatorHost = process.env.FIREBASE_STORAGE_EMULATOR_HOST;
45
45
  if (firebaseStorageEmulatorHost.match(/https?:\/\//)) {
46
- throw new error_1.FirebaseError({
47
- code: 'storage/invalid-emulator-host',
46
+ throw new error_1.FirebaseStorageError({
47
+ code: 'invalid-emulator-host',
48
48
  message: 'FIREBASE_STORAGE_EMULATOR_HOST should not contain a protocol (http or https).',
49
49
  });
50
50
  }
@@ -55,8 +55,8 @@ class Storage {
55
55
  storage = require('@google-cloud/storage').Storage;
56
56
  }
57
57
  catch (err) {
58
- throw new error_1.FirebaseError({
59
- code: 'storage/missing-dependencies',
58
+ throw new error_1.FirebaseStorageError({
59
+ code: 'missing-dependencies',
60
60
  message: 'Failed to import the Cloud Storage client library for Node.js. '
61
61
  + 'Make sure to install the "@google-cloud/storage" npm package. '
62
62
  + `Original error: ${err}`,
@@ -80,8 +80,8 @@ class Storage {
80
80
  this.storageClient = new storage();
81
81
  }
82
82
  else {
83
- throw new error_1.FirebaseError({
84
- code: 'storage/invalid-credential',
83
+ throw new error_1.FirebaseStorageError({
84
+ code: 'invalid-credential',
85
85
  message: 'Failed to initialize Google Cloud Storage client with the available credential. ' +
86
86
  'Must initialize the SDK with a certificate credential or application default credentials ' +
87
87
  'to use Cloud Storage API.',
@@ -103,8 +103,8 @@ class Storage {
103
103
  if (validator.isNonEmptyString(bucketName)) {
104
104
  return this.storageClient.bucket(bucketName);
105
105
  }
106
- throw new error_1.FirebaseError({
107
- code: 'storage/invalid-argument',
106
+ throw new error_1.FirebaseStorageError({
107
+ code: 'invalid-argument',
108
108
  message: 'Bucket name not specified or invalid. Specify a valid bucket name via the ' +
109
109
  'storageBucket option when initializing the app, or specify the bucket name ' +
110
110
  'explicitly when calling the getBucket() method.',
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  import { File } from '@google-cloud/storage';
3
3
  export interface FirebaseMetadata {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.getFirebaseMetadata = getFirebaseMetadata;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
@@ -21,8 +21,10 @@ import http2 = require('http2');
21
21
  import { EventEmitter } from 'events';
22
22
  /** Http method type definition. */
23
23
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
24
- /** API callback function type definition. */
25
- export type ApiCallbackFunction = (data: object) => void;
24
+ /** API request callback function type definition. */
25
+ export type ApiRequestCallback = (data: any) => void;
26
+ /** API response callback function type definition. */
27
+ export type ApiResponseCallback = (response: RequestResponse) => void;
26
28
  /**
27
29
  * Base configuration for constructing a new request.
28
30
  */
@@ -248,16 +250,16 @@ export declare class ApiSettings {
248
250
  * @param requestValidator - The request validator.
249
251
  * @returns The current API settings instance.
250
252
  */
251
- setRequestValidator(requestValidator: ApiCallbackFunction | null): ApiSettings;
253
+ setRequestValidator(requestValidator: ApiRequestCallback | null): ApiSettings;
252
254
  /** @returns The request validator. */
253
- getRequestValidator(): ApiCallbackFunction;
255
+ getRequestValidator(): ApiRequestCallback;
254
256
  /**
255
257
  * @param responseValidator - The response validator.
256
258
  * @returns The current API settings instance.
257
259
  */
258
- setResponseValidator(responseValidator: ApiCallbackFunction | null): ApiSettings;
260
+ setResponseValidator(responseValidator: ApiResponseCallback | null): ApiSettings;
259
261
  /** @returns The response validator. */
260
- getResponseValidator(): ApiCallbackFunction;
262
+ getResponseValidator(): ApiResponseCallback;
261
263
  }
262
264
  /**
263
265
  * Class used for polling an endpoint with exponential backoff.
@@ -311,14 +313,12 @@ export declare class ExponentialBackoffPoller<T> extends EventEmitter {
311
313
  }
312
314
  export declare class Http2SessionHandler {
313
315
  private http2Session;
314
- protected promise: Promise<void>;
315
- protected resolve: () => void;
316
- protected reject: (_: any) => void;
316
+ private sessionErrors;
317
317
  constructor(url: string);
318
318
  createSession(url: string): http2.ClientHttp2Session;
319
- invoke(): Promise<void>;
319
+ getErrors(): Error[];
320
320
  get session(): http2.ClientHttp2Session;
321
- get isClosed(): boolean;
321
+ get isCurrentSessionClosed(): boolean;
322
322
  close(): void;
323
323
  }
324
324
  export {};
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -21,11 +21,11 @@ exports.Http2SessionHandler = exports.ExponentialBackoffPoller = exports.ApiSett
21
21
  exports.defaultRetryConfig = defaultRetryConfig;
22
22
  exports.parseHttpResponse = parseHttpResponse;
23
23
  const error_1 = require("./error");
24
+ const error_2 = require("../app/error");
24
25
  const validator = require("./validator");
25
26
  const http = require("http");
26
27
  const https = require("https");
27
28
  const http2 = require("http2");
28
- const url = require("url");
29
29
  const events_1 = require("events");
30
30
  const credential_internal_1 = require("../app/credential-internal");
31
31
  const index_1 = require("../utils/index");
@@ -39,7 +39,7 @@ class DefaultRequestResponse {
39
39
  this.text = resp.data;
40
40
  try {
41
41
  if (!resp.data) {
42
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INTERNAL_ERROR, 'HTTP response missing data.');
42
+ throw new error_2.FirebaseAppError({ code: error_2.AppErrorCode.INTERNAL_ERROR, message: 'HTTP response missing data.' });
43
43
  }
44
44
  this.parsedData = JSON.parse(resp.data);
45
45
  }
@@ -47,15 +47,17 @@ class DefaultRequestResponse {
47
47
  this.parsedData = undefined;
48
48
  this.parseError = err;
49
49
  }
50
- this.request = `${resp.config.method} ${resp.config.url}`;
51
50
  }
52
51
  get data() {
53
52
  if (this.isJson()) {
54
53
  return this.parsedData;
55
54
  }
56
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.UNABLE_TO_PARSE_RESPONSE, `Error while parsing response data: "${this.parseError.toString()}". Raw server ` +
57
- `response: "${this.text}". Status code: "${this.status}". Outgoing ` +
58
- `request: "${this.request}."`);
55
+ throw new error_2.FirebaseAppError({
56
+ code: error_2.AppErrorCode.UNABLE_TO_PARSE_RESPONSE,
57
+ message: 'Error while parsing response data',
58
+ cause: this.parseError,
59
+ httpResponse: (0, error_1.toHttpResponse)(this)
60
+ });
59
61
  }
60
62
  isJson() {
61
63
  return typeof this.parsedData !== 'undefined';
@@ -72,10 +74,16 @@ class MultipartRequestResponse {
72
74
  this.multipart = resp.multipart;
73
75
  }
74
76
  get text() {
75
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.UNABLE_TO_PARSE_RESPONSE, 'Unable to parse multipart payload as text');
77
+ throw new error_2.FirebaseAppError({
78
+ code: error_2.AppErrorCode.UNABLE_TO_PARSE_RESPONSE,
79
+ message: 'Unable to parse multipart payload as text'
80
+ });
76
81
  }
77
82
  get data() {
78
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.UNABLE_TO_PARSE_RESPONSE, 'Unable to parse multipart payload as JSON');
83
+ throw new error_2.FirebaseAppError({
84
+ code: error_2.AppErrorCode.UNABLE_TO_PARSE_RESPONSE,
85
+ message: 'Unable to parse multipart payload as JSON'
86
+ });
79
87
  }
80
88
  isJson() {
81
89
  return false;
@@ -112,21 +120,30 @@ function defaultRetryConfig() {
112
120
  */
113
121
  function validateRetryConfig(retry) {
114
122
  if (!validator.isNumber(retry.maxRetries) || retry.maxRetries < 0) {
115
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_ARGUMENT, 'maxRetries must be a non-negative integer');
123
+ throw new error_2.FirebaseAppError({
124
+ code: error_2.AppErrorCode.INVALID_ARGUMENT,
125
+ message: 'maxRetries must be a non-negative integer'
126
+ });
116
127
  }
117
128
  if (typeof retry.backOffFactor !== 'undefined') {
118
129
  if (!validator.isNumber(retry.backOffFactor) || retry.backOffFactor < 0) {
119
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_ARGUMENT, 'backOffFactor must be a non-negative number');
130
+ throw new error_2.FirebaseAppError({
131
+ code: error_2.AppErrorCode.INVALID_ARGUMENT,
132
+ message: 'backOffFactor must be a non-negative number'
133
+ });
120
134
  }
121
135
  }
122
136
  if (!validator.isNumber(retry.maxDelayInMillis) || retry.maxDelayInMillis < 0) {
123
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_ARGUMENT, 'maxDelayInMillis must be a non-negative integer');
137
+ throw new error_2.FirebaseAppError({
138
+ code: error_2.AppErrorCode.INVALID_ARGUMENT,
139
+ message: 'maxDelayInMillis must be a non-negative integer'
140
+ });
124
141
  }
125
142
  if (typeof retry.statusCodes !== 'undefined' && !validator.isArray(retry.statusCodes)) {
126
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_ARGUMENT, 'statusCodes must be an array');
143
+ throw new error_2.FirebaseAppError({ code: error_2.AppErrorCode.INVALID_ARGUMENT, message: 'statusCodes must be an array' });
127
144
  }
128
145
  if (typeof retry.ioErrorCodes !== 'undefined' && !validator.isArray(retry.ioErrorCodes)) {
129
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_ARGUMENT, 'ioErrorCodes must be an array');
146
+ throw new error_2.FirebaseAppError({ code: error_2.AppErrorCode.INVALID_ARGUMENT, message: 'ioErrorCodes must be an array' });
130
147
  }
131
148
  }
132
149
  class RequestClient {
@@ -209,7 +226,7 @@ class RequestClient {
209
226
  return 0;
210
227
  }
211
228
  if (!this.retry) {
212
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INTERNAL_ERROR, 'Expected this.retry to exist.');
229
+ throw new error_2.FirebaseAppError({ code: error_2.AppErrorCode.INTERNAL_ERROR, message: 'Expected this.retry to exist.' });
213
230
  }
214
231
  const backOffFactor = this.retry.backOffFactor || 0;
215
232
  const delayInSeconds = (2 ** retryAttempts) * backOffFactor;
@@ -263,9 +280,17 @@ class HttpClient extends RequestClient {
263
280
  throw new RequestResponseError(this.createRequestResponse(err.response));
264
281
  }
265
282
  if (err.code === 'ETIMEDOUT') {
266
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_TIMEOUT, `Error while making request: ${err.message}.`);
283
+ throw new error_2.FirebaseAppError({
284
+ code: error_2.AppErrorCode.NETWORK_TIMEOUT,
285
+ message: `Error while making request: ${err.message}.`,
286
+ cause: err
287
+ });
267
288
  }
268
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_ERROR, `Error while making request: ${err.message}. Error code: ${err.code}`);
289
+ throw new error_2.FirebaseAppError({
290
+ code: error_2.AppErrorCode.NETWORK_ERROR,
291
+ message: `Error while making request: ${err.message}. Error code: ${err.code}`,
292
+ cause: err
293
+ });
269
294
  });
270
295
  }
271
296
  }
@@ -316,9 +341,17 @@ class Http2Client extends RequestClient {
316
341
  throw new RequestResponseError(this.createRequestResponse(err.response));
317
342
  }
318
343
  if (err.code === 'ETIMEDOUT') {
319
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_TIMEOUT, `Error while making request: ${err.message}.`);
344
+ throw new error_2.FirebaseAppError({
345
+ code: error_2.AppErrorCode.NETWORK_TIMEOUT,
346
+ message: `Error while making request: ${err.message}.`,
347
+ cause: err
348
+ });
320
349
  }
321
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_ERROR, `Error while making request: ${err.message}. Error code: ${err.code}`);
350
+ throw new error_2.FirebaseAppError({
351
+ code: error_2.AppErrorCode.NETWORK_ERROR,
352
+ message: `Error while making request: ${err.message}. Error code: ${err.code}`,
353
+ cause: err
354
+ });
322
355
  });
323
356
  }
324
357
  }
@@ -359,7 +392,7 @@ function parseHttpResponse(response, config) {
359
392
  request: null,
360
393
  };
361
394
  if (!validator.isNumber(lowLevelResponse.status)) {
362
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INTERNAL_ERROR, 'Malformed HTTP status line.');
395
+ throw new error_2.FirebaseAppError({ code: error_2.AppErrorCode.INTERNAL_ERROR, message: 'Malformed HTTP status line.' });
363
396
  }
364
397
  return new DefaultRequestResponse(lowLevelResponse);
365
398
  }
@@ -399,7 +432,7 @@ class AsyncRequestCall {
399
432
  return headerParams.boundary;
400
433
  }
401
434
  handleMultipartResponse(response, respStream, boundary) {
402
- const busboy = require('@fastify/busboy'); // eslint-disable-line @typescript-eslint/no-var-requires
435
+ const busboy = require('@fastify/busboy');
403
436
  const multipartParser = new busboy.Dicer({ boundary });
404
437
  const responseBuffer = [];
405
438
  multipartParser.on('part', (part) => {
@@ -533,7 +566,10 @@ class AsyncHttpCall extends AsyncRequestCall {
533
566
  return;
534
567
  }
535
568
  if (!res.statusCode) {
536
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INTERNAL_ERROR, 'Expected a statusCode on the response from a ClientRequest');
569
+ throw new error_2.FirebaseAppError({
570
+ code: error_2.AppErrorCode.INTERNAL_ERROR,
571
+ message: 'Expected a statusCode on the response from a ClientRequest'
572
+ });
537
573
  }
538
574
  const response = {
539
575
  status: res.statusCode,
@@ -557,7 +593,7 @@ class AsyncHttpCall extends AsyncRequestCall {
557
593
  const encodings = ['gzip', 'compress', 'deflate'];
558
594
  if (res.headers['content-encoding'] && encodings.indexOf(res.headers['content-encoding']) !== -1) {
559
595
  // Add the unzipper to the body stream processing pipeline.
560
- const zlib = require('zlib'); // eslint-disable-line @typescript-eslint/no-var-requires
596
+ const zlib = require('zlib');
561
597
  respStream = respStream.pipe(zlib.createUnzip());
562
598
  // Remove the content-encoding in order to not confuse downstream operations.
563
599
  delete res.headers['content-encoding'];
@@ -625,7 +661,10 @@ class AsyncHttp2Call extends AsyncRequestCall {
625
661
  return;
626
662
  }
627
663
  if (!headers[':status']) {
628
- throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INTERNAL_ERROR, 'Expected a statusCode on the response from a ClientRequest');
664
+ throw new error_2.FirebaseAppError({
665
+ code: error_2.AppErrorCode.INTERNAL_ERROR,
666
+ message: 'Expected a statusCode on the response from a ClientRequest'
667
+ });
629
668
  }
630
669
  const response = {
631
670
  status: headers[':status'],
@@ -649,7 +688,7 @@ class AsyncHttp2Call extends AsyncRequestCall {
649
688
  const encodings = ['gzip', 'compress', 'deflate'];
650
689
  if (headers['content-encoding'] && encodings.indexOf(headers['content-encoding']) !== -1) {
651
690
  // Add the unzipper to the body stream processing pipeline.
652
- const zlib = require('zlib'); // eslint-disable-line @typescript-eslint/no-var-requires
691
+ const zlib = require('zlib');
653
692
  respStream = respStream.pipe(zlib.createUnzip());
654
693
  // Remove the content-encoding in order to not confuse downstream operations.
655
694
  delete headers['content-encoding'];
@@ -706,21 +745,21 @@ class BaseRequestConfigImpl {
706
745
  }
707
746
  buildUrl() {
708
747
  const fullUrl = this.urlWithProtocol();
748
+ const parsedUrl = new URL(fullUrl);
709
749
  if (!this.hasEntity() || this.isEntityEnclosingRequest()) {
710
- return url.parse(fullUrl);
750
+ return parsedUrl;
711
751
  }
712
752
  if (!validator.isObject(this.data)) {
713
753
  throw new Error(`${this.method} requests cannot have a body`);
714
754
  }
715
- // Parse URL and append data to query string.
716
- const parsedUrl = new url.URL(fullUrl);
755
+ // Append data to query string.
717
756
  const dataObj = this.data;
718
757
  for (const key in dataObj) {
719
758
  if (Object.prototype.hasOwnProperty.call(dataObj, key)) {
720
759
  parsedUrl.searchParams.append(key, dataObj[key]);
721
760
  }
722
761
  }
723
- return url.parse(parsedUrl.toString());
762
+ return parsedUrl;
724
763
  }
725
764
  urlWithProtocol() {
726
765
  const fullUrl = this.url;
@@ -760,7 +799,7 @@ class HttpRequestConfigImpl extends BaseRequestConfigImpl {
760
799
  protocol,
761
800
  hostname: parsed.hostname,
762
801
  port,
763
- path: parsed.path,
802
+ path: `${parsed.pathname}${parsed.search}`,
764
803
  method: this.method,
765
804
  agent: this.httpAgent,
766
805
  headers: Object.assign({}, this.headers),
@@ -784,7 +823,7 @@ class Http2RequestConfigImpl extends BaseRequestConfigImpl {
784
823
  const protocol = parsed.protocol;
785
824
  return {
786
825
  protocol,
787
- path: parsed.path,
826
+ path: `${parsed.pathname}${parsed.search}`,
788
827
  method: this.method,
789
828
  headers: Object.assign({}, this.headers),
790
829
  };
@@ -1006,53 +1045,56 @@ class ExponentialBackoffPoller extends events_1.EventEmitter {
1006
1045
  exports.ExponentialBackoffPoller = ExponentialBackoffPoller;
1007
1046
  class Http2SessionHandler {
1008
1047
  constructor(url) {
1009
- this.promise = new Promise((resolve, reject) => {
1010
- this.resolve = resolve;
1011
- this.reject = reject;
1012
- this.http2Session = this.createSession(url);
1013
- });
1048
+ this.sessionErrors = [];
1049
+ this.createSession(url);
1014
1050
  }
1015
1051
  createSession(url) {
1016
- if (!this.http2Session || this.isClosed) {
1052
+ if (!this.http2Session || this.isCurrentSessionClosed) {
1053
+ this.sessionErrors = [];
1017
1054
  const opts = {
1018
1055
  // Set local max concurrent stream limit to respect backend limit
1019
1056
  peerMaxConcurrentStreams: 100,
1020
1057
  ALPNProtocols: ['h2']
1021
1058
  };
1022
- const http2Session = http2.connect(url, opts);
1023
- http2Session.on('goaway', (errorCode, _, opaqueData) => {
1024
- this.reject(new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_ERROR, `Error while making requests: GOAWAY - ${opaqueData?.toString()}, Error code: ${errorCode}`));
1059
+ this.http2Session = http2.connect(url, opts);
1060
+ this.http2Session.on('goaway', (errorCode, _, opaqueData) => {
1061
+ const error = new error_2.FirebaseAppError({
1062
+ code: error_2.AppErrorCode.NETWORK_ERROR,
1063
+ message: `Error while making requests: GOAWAY - ${opaqueData?.toString()}, Error code: ${errorCode}`
1064
+ });
1065
+ this.sessionErrors.push(error);
1025
1066
  });
1026
- http2Session.on('error', (error) => {
1067
+ this.http2Session.on('error', (error) => {
1068
+ const codePart = error?.code ? `${error.code} - ` : '';
1027
1069
  let errorMessage;
1028
- if (error.name == 'AggregateError' && error.errors) {
1029
- errorMessage = `Session error while making requests: ${error.code} - ${error.name}: ` +
1070
+ if ((error instanceof AggregateError || error?.name === 'AggregateError') && Array.isArray(error.errors)) {
1071
+ errorMessage = `Session error while making requests: ${codePart}${error.name}: ` +
1030
1072
  `[${error.errors.map((e) => e.message).join(', ')}]`;
1031
1073
  }
1032
1074
  else {
1033
- errorMessage = `Session error while making requests: ${error.code} - ${error.message} `;
1075
+ errorMessage = `Session error while making requests: ${codePart}${error?.message || 'Unknown error'}`;
1034
1076
  }
1035
- this.reject(new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_ERROR, errorMessage));
1036
- });
1037
- http2Session.on('close', () => {
1038
- // Resolve current promise
1039
- this.resolve();
1077
+ const appError = new error_2.FirebaseAppError({
1078
+ code: error_2.AppErrorCode.NETWORK_ERROR,
1079
+ message: errorMessage,
1080
+ cause: error,
1081
+ });
1082
+ this.sessionErrors.push(appError);
1040
1083
  });
1041
- return http2Session;
1042
1084
  }
1043
1085
  return this.http2Session;
1044
1086
  }
1045
- invoke() {
1046
- return this.promise;
1087
+ getErrors() {
1088
+ return this.sessionErrors;
1047
1089
  }
1048
1090
  get session() {
1049
1091
  return this.http2Session;
1050
1092
  }
1051
- get isClosed() {
1052
- return this.http2Session.closed;
1093
+ get isCurrentSessionClosed() {
1094
+ return !!this.http2Session?.closed;
1053
1095
  }
1054
1096
  close() {
1055
- this.http2Session.close();
1097
+ this.http2Session?.close();
1056
1098
  }
1057
1099
  }
1058
1100
  exports.Http2SessionHandler = Http2SessionHandler;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google LLC
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v13.9.0 */
1
+ /*! firebase-admin v14.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -48,7 +48,7 @@ class ServiceAccountSigner {
48
48
  * @inheritDoc
49
49
  */
50
50
  sign(buffer) {
51
- const crypto = require('crypto'); // eslint-disable-line @typescript-eslint/no-var-requires
51
+ const crypto = require('node:crypto');
52
52
  const sign = crypto.createSign('RSA-SHA256');
53
53
  sign.update(buffer);
54
54
  return Promise.resolve(sign.sign(this.credential.privateKey));
@@ -178,11 +178,6 @@ class CryptoSignerError extends Error {
178
178
  constructor(errorInfo) {
179
179
  super(errorInfo.message);
180
180
  this.errorInfo = errorInfo;
181
- /* tslint:disable:max-line-length */
182
- // Set the prototype explicitly. See the following link for more details:
183
- // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
184
- /* tslint:enable:max-line-length */
185
- this.__proto__ = CryptoSignerError.prototype;
186
181
  }
187
182
  /** @returns The error code. */
188
183
  get code() {