firebase-admin 12.2.0 → 12.3.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 (209) hide show
  1. package/lib/app/core.d.ts +1 -1
  2. package/lib/app/core.js +1 -1
  3. package/lib/app/credential-factory.d.ts +1 -1
  4. package/lib/app/credential-factory.js +1 -1
  5. package/lib/app/credential-internal.d.ts +1 -1
  6. package/lib/app/credential-internal.js +4 -4
  7. package/lib/app/credential.d.ts +1 -1
  8. package/lib/app/credential.js +1 -1
  9. package/lib/app/firebase-app.d.ts +1 -1
  10. package/lib/app/firebase-app.js +1 -1
  11. package/lib/app/firebase-namespace.d.ts +1 -1
  12. package/lib/app/firebase-namespace.js +1 -1
  13. package/lib/app/index.d.ts +1 -1
  14. package/lib/app/index.js +1 -1
  15. package/lib/app/lifecycle.d.ts +1 -1
  16. package/lib/app/lifecycle.js +1 -1
  17. package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
  18. package/lib/app-check/app-check-api-client-internal.js +1 -1
  19. package/lib/app-check/app-check-api.d.ts +1 -1
  20. package/lib/app-check/app-check-api.js +1 -1
  21. package/lib/app-check/app-check-namespace.d.ts +1 -1
  22. package/lib/app-check/app-check-namespace.js +1 -1
  23. package/lib/app-check/app-check.d.ts +1 -1
  24. package/lib/app-check/app-check.js +1 -1
  25. package/lib/app-check/index.d.ts +1 -1
  26. package/lib/app-check/index.js +1 -1
  27. package/lib/app-check/token-generator.d.ts +1 -1
  28. package/lib/app-check/token-generator.js +1 -1
  29. package/lib/app-check/token-verifier.d.ts +1 -1
  30. package/lib/app-check/token-verifier.js +1 -1
  31. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  32. package/lib/auth/action-code-settings-builder.js +1 -1
  33. package/lib/auth/auth-api-request.d.ts +1 -1
  34. package/lib/auth/auth-api-request.js +2 -2
  35. package/lib/auth/auth-config.d.ts +1 -1
  36. package/lib/auth/auth-config.js +1 -1
  37. package/lib/auth/auth-namespace.d.ts +1 -1
  38. package/lib/auth/auth-namespace.js +1 -1
  39. package/lib/auth/auth.d.ts +1 -1
  40. package/lib/auth/auth.js +1 -1
  41. package/lib/auth/base-auth.d.ts +1 -1
  42. package/lib/auth/base-auth.js +1 -1
  43. package/lib/auth/identifier.d.ts +1 -1
  44. package/lib/auth/identifier.js +1 -1
  45. package/lib/auth/index.d.ts +1 -1
  46. package/lib/auth/index.js +1 -1
  47. package/lib/auth/project-config-manager.d.ts +1 -1
  48. package/lib/auth/project-config-manager.js +1 -1
  49. package/lib/auth/project-config.d.ts +1 -1
  50. package/lib/auth/project-config.js +1 -1
  51. package/lib/auth/tenant-manager.d.ts +1 -1
  52. package/lib/auth/tenant-manager.js +1 -1
  53. package/lib/auth/tenant.d.ts +1 -1
  54. package/lib/auth/tenant.js +1 -1
  55. package/lib/auth/token-generator.d.ts +1 -1
  56. package/lib/auth/token-generator.js +1 -1
  57. package/lib/auth/token-verifier.d.ts +1 -1
  58. package/lib/auth/token-verifier.js +1 -1
  59. package/lib/auth/user-import-builder.d.ts +1 -1
  60. package/lib/auth/user-import-builder.js +1 -1
  61. package/lib/auth/user-record.d.ts +1 -1
  62. package/lib/auth/user-record.js +1 -1
  63. package/lib/credential/index.d.ts +1 -1
  64. package/lib/credential/index.js +1 -1
  65. package/lib/database/database-namespace.d.ts +1 -1
  66. package/lib/database/database-namespace.js +1 -1
  67. package/lib/database/database.d.ts +1 -1
  68. package/lib/database/database.js +2 -2
  69. package/lib/database/index.d.ts +1 -1
  70. package/lib/database/index.js +1 -1
  71. package/lib/default-namespace.d.ts +1 -1
  72. package/lib/default-namespace.js +1 -1
  73. package/lib/eventarc/cloudevent.d.ts +1 -1
  74. package/lib/eventarc/cloudevent.js +1 -1
  75. package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
  76. package/lib/eventarc/eventarc-client-internal.js +1 -1
  77. package/lib/eventarc/eventarc-utils.d.ts +1 -1
  78. package/lib/eventarc/eventarc-utils.js +1 -1
  79. package/lib/eventarc/eventarc.d.ts +1 -1
  80. package/lib/eventarc/eventarc.js +1 -1
  81. package/lib/eventarc/index.d.ts +1 -1
  82. package/lib/eventarc/index.js +1 -1
  83. package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
  84. package/lib/extensions/extensions-api-client-internal.js +1 -1
  85. package/lib/extensions/extensions-api.d.ts +1 -1
  86. package/lib/extensions/extensions-api.js +1 -1
  87. package/lib/extensions/extensions.d.ts +1 -1
  88. package/lib/extensions/extensions.js +1 -1
  89. package/lib/extensions/index.d.ts +1 -1
  90. package/lib/extensions/index.js +1 -1
  91. package/lib/firebase-namespace-api.d.ts +1 -1
  92. package/lib/firebase-namespace-api.js +1 -1
  93. package/lib/firestore/firestore-internal.d.ts +1 -1
  94. package/lib/firestore/firestore-internal.js +1 -1
  95. package/lib/firestore/firestore-namespace.d.ts +1 -1
  96. package/lib/firestore/firestore-namespace.js +1 -1
  97. package/lib/firestore/index.d.ts +1 -1
  98. package/lib/firestore/index.js +1 -1
  99. package/lib/functions/functions-api-client-internal.d.ts +1 -1
  100. package/lib/functions/functions-api-client-internal.js +3 -3
  101. package/lib/functions/functions-api.d.ts +1 -1
  102. package/lib/functions/functions-api.js +1 -1
  103. package/lib/functions/functions.d.ts +1 -1
  104. package/lib/functions/functions.js +1 -1
  105. package/lib/functions/index.d.ts +1 -1
  106. package/lib/functions/index.js +1 -1
  107. package/lib/index.d.ts +1 -1
  108. package/lib/index.js +1 -1
  109. package/lib/installations/index.d.ts +1 -1
  110. package/lib/installations/index.js +1 -1
  111. package/lib/installations/installations-namespace.d.ts +1 -1
  112. package/lib/installations/installations-namespace.js +1 -1
  113. package/lib/installations/installations-request-handler.d.ts +1 -1
  114. package/lib/installations/installations-request-handler.js +2 -2
  115. package/lib/installations/installations.d.ts +1 -1
  116. package/lib/installations/installations.js +1 -1
  117. package/lib/instance-id/index.d.ts +1 -1
  118. package/lib/instance-id/index.js +1 -1
  119. package/lib/instance-id/instance-id-namespace.d.ts +1 -1
  120. package/lib/instance-id/instance-id-namespace.js +1 -1
  121. package/lib/instance-id/instance-id.d.ts +1 -1
  122. package/lib/instance-id/instance-id.js +1 -1
  123. package/lib/machine-learning/index.d.ts +1 -1
  124. package/lib/machine-learning/index.js +1 -1
  125. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  126. package/lib/machine-learning/machine-learning-api-client.js +1 -1
  127. package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
  128. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  129. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  130. package/lib/machine-learning/machine-learning-utils.js +1 -1
  131. package/lib/machine-learning/machine-learning.d.ts +1 -1
  132. package/lib/machine-learning/machine-learning.js +1 -1
  133. package/lib/messaging/batch-request-internal.d.ts +4 -4
  134. package/lib/messaging/batch-request-internal.js +2 -2
  135. package/lib/messaging/index.d.ts +1 -1
  136. package/lib/messaging/index.js +1 -1
  137. package/lib/messaging/messaging-api-request-internal.d.ts +15 -4
  138. package/lib/messaging/messaging-api-request-internal.js +39 -10
  139. package/lib/messaging/messaging-api.d.ts +1 -1
  140. package/lib/messaging/messaging-api.js +1 -1
  141. package/lib/messaging/messaging-errors-internal.d.ts +6 -6
  142. package/lib/messaging/messaging-errors-internal.js +4 -4
  143. package/lib/messaging/messaging-internal.d.ts +1 -1
  144. package/lib/messaging/messaging-internal.js +1 -1
  145. package/lib/messaging/messaging-namespace.d.ts +1 -1
  146. package/lib/messaging/messaging-namespace.js +1 -1
  147. package/lib/messaging/messaging.d.ts +16 -1
  148. package/lib/messaging/messaging.js +37 -9
  149. package/lib/project-management/android-app.d.ts +1 -1
  150. package/lib/project-management/android-app.js +1 -1
  151. package/lib/project-management/app-metadata.d.ts +1 -1
  152. package/lib/project-management/app-metadata.js +1 -1
  153. package/lib/project-management/index.d.ts +1 -1
  154. package/lib/project-management/index.js +1 -1
  155. package/lib/project-management/ios-app.d.ts +1 -1
  156. package/lib/project-management/ios-app.js +1 -1
  157. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  158. package/lib/project-management/project-management-api-request-internal.js +3 -3
  159. package/lib/project-management/project-management-namespace.d.ts +1 -1
  160. package/lib/project-management/project-management-namespace.js +1 -1
  161. package/lib/project-management/project-management.d.ts +1 -1
  162. package/lib/project-management/project-management.js +1 -1
  163. package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
  164. package/lib/remote-config/condition-evaluator-internal.js +20 -14
  165. package/lib/remote-config/index.d.ts +1 -1
  166. package/lib/remote-config/index.js +1 -1
  167. package/lib/remote-config/internal/value-impl.d.ts +1 -1
  168. package/lib/remote-config/internal/value-impl.js +1 -1
  169. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  170. package/lib/remote-config/remote-config-api-client-internal.js +1 -1
  171. package/lib/remote-config/remote-config-api.d.ts +1 -1
  172. package/lib/remote-config/remote-config-api.js +1 -1
  173. package/lib/remote-config/remote-config-namespace.d.ts +1 -1
  174. package/lib/remote-config/remote-config-namespace.js +1 -1
  175. package/lib/remote-config/remote-config.d.ts +1 -1
  176. package/lib/remote-config/remote-config.js +1 -1
  177. package/lib/security-rules/index.d.ts +1 -1
  178. package/lib/security-rules/index.js +1 -1
  179. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  180. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  181. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  182. package/lib/security-rules/security-rules-internal.js +1 -1
  183. package/lib/security-rules/security-rules-namespace.d.ts +1 -1
  184. package/lib/security-rules/security-rules-namespace.js +1 -1
  185. package/lib/security-rules/security-rules.d.ts +1 -1
  186. package/lib/security-rules/security-rules.js +1 -1
  187. package/lib/storage/index.d.ts +1 -1
  188. package/lib/storage/index.js +1 -1
  189. package/lib/storage/storage-namespace.d.ts +1 -1
  190. package/lib/storage/storage-namespace.js +1 -1
  191. package/lib/storage/storage.d.ts +1 -1
  192. package/lib/storage/storage.js +1 -1
  193. package/lib/storage/utils.d.ts +1 -1
  194. package/lib/storage/utils.js +1 -1
  195. package/lib/utils/api-request.d.ts +134 -42
  196. package/lib/utils/api-request.js +430 -186
  197. package/lib/utils/crypto-signer.d.ts +1 -1
  198. package/lib/utils/crypto-signer.js +2 -2
  199. package/lib/utils/deep-copy.d.ts +1 -1
  200. package/lib/utils/deep-copy.js +1 -1
  201. package/lib/utils/error.d.ts +1 -1
  202. package/lib/utils/error.js +1 -1
  203. package/lib/utils/index.d.ts +1 -1
  204. package/lib/utils/index.js +1 -1
  205. package/lib/utils/jwt.d.ts +1 -1
  206. package/lib/utils/jwt.js +3 -3
  207. package/lib/utils/validator.d.ts +1 -1
  208. package/lib/utils/validator.js +1 -1
  209. package/package.json +4 -5
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2022 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2022 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2022 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -84,7 +84,7 @@ class FunctionsApiClient {
84
84
  await this.httpClient.send(request);
85
85
  }
86
86
  catch (err) {
87
- if (err instanceof api_request_1.HttpError) {
87
+ if (err instanceof api_request_1.RequestResponseError) {
88
88
  if (err.response.status === 404) {
89
89
  // if no task with the provided ID exists, then ignore the delete.
90
90
  return;
@@ -138,7 +138,7 @@ class FunctionsApiClient {
138
138
  await this.httpClient.send(request);
139
139
  }
140
140
  catch (err) {
141
- if (err instanceof api_request_1.HttpError) {
141
+ if (err instanceof api_request_1.RequestResponseError) {
142
142
  if (err.response.status === 409) {
143
143
  throw new FirebaseFunctionsError('task-already-exists', `A task with ID ${opts?.id} already exists`);
144
144
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -80,7 +80,7 @@ class FirebaseInstallationsRequestHandler {
80
80
  // return nothing on success
81
81
  })
82
82
  .catch((err) => {
83
- if (err instanceof api_request_1.HttpError) {
83
+ if (err instanceof api_request_1.RequestResponseError) {
84
84
  const response = err.response;
85
85
  const errorMessage = (response.isJson() && 'error' in response.data) ?
86
86
  response.data.error : response.text;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  import { App } from '../app/index';
3
3
  import { InstanceId as TInstanceId } from './instance-id';
4
4
  /**
@@ -1,3 +1,3 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { HttpClient, HttpResponse } from '../utils/api-request';
17
+ import { HttpClient, RequestResponse } from '../utils/api-request';
18
18
  /**
19
19
  * Represents a request that can be sent as part of an HTTP batch request.
20
20
  */
@@ -45,11 +45,11 @@ export declare class BatchRequestClient {
45
45
  constructor(httpClient: HttpClient, batchUrl: string, commonHeaders?: object | undefined);
46
46
  /**
47
47
  * Sends the given array of sub requests as a single batch, and parses the results into an array
48
- * of HttpResponse objects.
48
+ * of `RequestResponse` objects.
49
49
  *
50
50
  * @param requests - An array of sub requests to send.
51
51
  * @returns A promise that resolves when the send operation is complete.
52
52
  */
53
- send(requests: SubRequest[]): Promise<HttpResponse[]>;
53
+ send(requests: SubRequest[]): Promise<RequestResponse[]>;
54
54
  private getMultipartPayload;
55
55
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -42,7 +42,7 @@ class BatchRequestClient {
42
42
  }
43
43
  /**
44
44
  * Sends the given array of sub requests as a single batch, and parses the results into an array
45
- * of HttpResponse objects.
45
+ * of `RequestResponse` objects.
46
46
  *
47
47
  * @param requests - An array of sub requests to send.
48
48
  * @returns A promise that resolves when the send operation is complete.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -16,6 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  import { App } from '../app';
19
+ import { Http2SessionHandler } from '../utils/api-request';
19
20
  import { SubRequest } from './batch-request-internal';
20
21
  import { SendResponse, BatchResponse } from './messaging-api';
21
22
  /**
@@ -23,6 +24,7 @@ import { SendResponse, BatchResponse } from './messaging-api';
23
24
  */
24
25
  export declare class FirebaseMessagingRequestHandler {
25
26
  private readonly httpClient;
27
+ private readonly http2Client;
26
28
  private readonly batchClient;
27
29
  /**
28
30
  * @param app - The app used to fetch access tokens to sign API requests.
@@ -39,17 +41,26 @@ export declare class FirebaseMessagingRequestHandler {
39
41
  */
40
42
  invokeRequestHandler(host: string, path: string, requestData: object): Promise<object>;
41
43
  /**
42
- * Invokes the request handler with the provided request data.
44
+ * Invokes the HTTP/1.1 request handler with the provided request data.
45
+ *
46
+ * @param host - The host to which to send the request.
47
+ * @param path - The path to which to send the request.
48
+ * @param requestData - The request data.
49
+ * @returns A promise that resolves with the {@link SendResponse}.
50
+ */
51
+ invokeHttpRequestHandlerForSendResponse(host: string, path: string, requestData: object): Promise<SendResponse>;
52
+ /**
53
+ * Invokes the HTTP/2 request handler with the provided request data.
43
54
  *
44
55
  * @param host - The host to which to send the request.
45
56
  * @param path - The path to which to send the request.
46
57
  * @param requestData - The request data.
47
58
  * @returns A promise that resolves with the {@link SendResponse}.
48
59
  */
49
- invokeRequestHandlerForSendResponse(host: string, path: string, requestData: object): Promise<SendResponse>;
60
+ invokeHttp2RequestHandlerForSendResponse(host: string, path: string, requestData: object, http2SessionHandler: Http2SessionHandler): Promise<SendResponse>;
50
61
  /**
51
62
  * Sends the given array of sub requests as a single batch to FCM, and parses the result into
52
- * a BatchResponse object.
63
+ * a `BatchResponse` object.
53
64
  *
54
65
  * @param requests - An array of sub requests to send.
55
66
  * @returns A promise that resolves when the send operation is complete.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -43,6 +43,7 @@ class FirebaseMessagingRequestHandler {
43
43
  */
44
44
  constructor(app) {
45
45
  this.httpClient = new api_request_1.AuthorizedHttpClient(app);
46
+ this.http2Client = new api_request_1.AuthorizedHttp2Client(app);
46
47
  this.batchClient = new batch_request_internal_1.BatchRequestClient(this.httpClient, FIREBASE_MESSAGING_BATCH_URL, FIREBASE_MESSAGING_HEADERS);
47
48
  }
48
49
  /**
@@ -64,18 +65,18 @@ class FirebaseMessagingRequestHandler {
64
65
  return this.httpClient.send(request).then((response) => {
65
66
  // Send non-JSON responses to the catch() below where they will be treated as errors.
66
67
  if (!response.isJson()) {
67
- throw new api_request_1.HttpError(response);
68
+ throw new api_request_1.RequestResponseError(response);
68
69
  }
69
70
  // Check for backend errors in the response.
70
71
  const errorCode = (0, messaging_errors_internal_1.getErrorCode)(response.data);
71
72
  if (errorCode) {
72
- throw new api_request_1.HttpError(response);
73
+ throw new api_request_1.RequestResponseError(response);
73
74
  }
74
75
  // Return entire response.
75
76
  return response.data;
76
77
  })
77
78
  .catch((err) => {
78
- if (err instanceof api_request_1.HttpError) {
79
+ if (err instanceof api_request_1.RequestResponseError) {
79
80
  throw (0, messaging_errors_internal_1.createFirebaseError)(err);
80
81
  }
81
82
  // Re-throw the error if it already has the proper format.
@@ -83,14 +84,14 @@ class FirebaseMessagingRequestHandler {
83
84
  });
84
85
  }
85
86
  /**
86
- * Invokes the request handler with the provided request data.
87
+ * Invokes the HTTP/1.1 request handler with the provided request data.
87
88
  *
88
89
  * @param host - The host to which to send the request.
89
90
  * @param path - The path to which to send the request.
90
91
  * @param requestData - The request data.
91
92
  * @returns A promise that resolves with the {@link SendResponse}.
92
93
  */
93
- invokeRequestHandlerForSendResponse(host, path, requestData) {
94
+ invokeHttpRequestHandlerForSendResponse(host, path, requestData) {
94
95
  const request = {
95
96
  method: FIREBASE_MESSAGING_HTTP_METHOD,
96
97
  url: `https://${host}${path}`,
@@ -102,7 +103,35 @@ class FirebaseMessagingRequestHandler {
102
103
  return this.buildSendResponse(response);
103
104
  })
104
105
  .catch((err) => {
105
- if (err instanceof api_request_1.HttpError) {
106
+ if (err instanceof api_request_1.RequestResponseError) {
107
+ return this.buildSendResponseFromError(err);
108
+ }
109
+ // Re-throw the error if it already has the proper format.
110
+ throw err;
111
+ });
112
+ }
113
+ /**
114
+ * Invokes the HTTP/2 request handler with the provided request data.
115
+ *
116
+ * @param host - The host to which to send the request.
117
+ * @param path - The path to which to send the request.
118
+ * @param requestData - The request data.
119
+ * @returns A promise that resolves with the {@link SendResponse}.
120
+ */
121
+ invokeHttp2RequestHandlerForSendResponse(host, path, requestData, http2SessionHandler) {
122
+ const request = {
123
+ method: FIREBASE_MESSAGING_HTTP_METHOD,
124
+ url: `https://${host}${path}`,
125
+ data: requestData,
126
+ headers: LEGACY_FIREBASE_MESSAGING_HEADERS,
127
+ timeout: FIREBASE_MESSAGING_TIMEOUT,
128
+ http2SessionHandler: http2SessionHandler
129
+ };
130
+ return this.http2Client.send(request).then((response) => {
131
+ return this.buildSendResponse(response);
132
+ })
133
+ .catch((err) => {
134
+ if (err instanceof api_request_1.RequestResponseError) {
106
135
  return this.buildSendResponseFromError(err);
107
136
  }
108
137
  // Re-throw the error if it already has the proper format.
@@ -111,7 +140,7 @@ class FirebaseMessagingRequestHandler {
111
140
  }
112
141
  /**
113
142
  * Sends the given array of sub requests as a single batch to FCM, and parses the result into
114
- * a BatchResponse object.
143
+ * a `BatchResponse` object.
115
144
  *
116
145
  * @param requests - An array of sub requests to send.
117
146
  * @returns A promise that resolves when the send operation is complete.
@@ -130,7 +159,7 @@ class FirebaseMessagingRequestHandler {
130
159
  failureCount: responses.length - successCount,
131
160
  };
132
161
  }).catch((err) => {
133
- if (err instanceof api_request_1.HttpError) {
162
+ if (err instanceof api_request_1.RequestResponseError) {
134
163
  throw (0, messaging_errors_internal_1.createFirebaseError)(err);
135
164
  }
136
165
  // Re-throw the error if it already has the proper format.
@@ -145,7 +174,7 @@ class FirebaseMessagingRequestHandler {
145
174
  result.messageId = response.data.name;
146
175
  }
147
176
  else {
148
- result.error = (0, messaging_errors_internal_1.createFirebaseError)(new api_request_1.HttpError(response));
177
+ result.error = (0, messaging_errors_internal_1.createFirebaseError)(new api_request_1.RequestResponseError(response));
149
178
  }
150
179
  return result;
151
180
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.2.0 */
1
+ /*! firebase-admin v12.3.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license