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
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -18,17 +18,19 @@
18
18
  /// <reference types="node" />
19
19
  /// <reference types="node" />
20
20
  /// <reference types="node" />
21
+ /// <reference types="node" />
21
22
  import { FirebaseApp } from '../app/firebase-app';
22
23
  import http = require('http');
24
+ import http2 = require('http2');
23
25
  import { EventEmitter } from 'events';
24
26
  /** Http method type definition. */
25
27
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
26
28
  /** API callback function type definition. */
27
29
  export type ApiCallbackFunction = (data: object) => void;
28
30
  /**
29
- * Configuration for constructing a new HTTP request.
31
+ * Base configuration for constructing a new request.
30
32
  */
31
- export interface HttpRequestConfig {
33
+ export interface BaseRequestConfig {
32
34
  method: HttpMethod;
33
35
  /** Target URL of the request. Should be a well-formed URL including protocol, hostname, port and path. */
34
36
  url: string;
@@ -38,12 +40,24 @@ export interface HttpRequestConfig {
38
40
  data?: string | object | Buffer | null;
39
41
  /** Connect and read timeout (in milliseconds) for the outgoing request. */
40
42
  timeout?: number;
43
+ }
44
+ /**
45
+ * Configuration for constructing a new HTTP request.
46
+ */
47
+ export interface HttpRequestConfig extends BaseRequestConfig {
41
48
  httpAgent?: http.Agent;
42
49
  }
43
50
  /**
44
- * Represents an HTTP response received from a remote server.
51
+ * Configuration for constructing a new HTTP/2 request.
45
52
  */
46
- export interface HttpResponse {
53
+ export interface Http2RequestConfig extends BaseRequestConfig {
54
+ http2SessionHandler: Http2SessionHandler;
55
+ }
56
+ type RequestConfig = HttpRequestConfig | Http2RequestConfig;
57
+ /**
58
+ * Represents an HTTP or HTTP/2 response received from a remote server.
59
+ */
60
+ export interface RequestResponse {
47
61
  readonly status: number;
48
62
  readonly headers: any;
49
63
  /** Response data as a raw string. */
@@ -58,43 +72,97 @@ export interface HttpResponse {
58
72
  */
59
73
  isJson(): boolean;
60
74
  }
61
- export declare class HttpError extends Error {
62
- readonly response: HttpResponse;
63
- constructor(response: HttpResponse);
75
+ interface BaseLowLevelResponse {
76
+ status: number;
77
+ data?: string;
78
+ multipart?: Buffer[];
79
+ }
80
+ interface LowLevelHttpResponse extends BaseLowLevelResponse {
81
+ headers: http.IncomingHttpHeaders;
82
+ request: http.ClientRequest | null;
83
+ config: HttpRequestConfig;
84
+ }
85
+ type IncomingHttp2Headers = http2.IncomingHttpHeaders & http2.IncomingHttpStatusHeader;
86
+ interface LowLevelHttp2Response extends BaseLowLevelResponse {
87
+ headers: IncomingHttp2Headers;
88
+ request: http2.ClientHttp2Stream | null;
89
+ config: Http2RequestConfig;
90
+ }
91
+ type LowLevelResponse = LowLevelHttpResponse | LowLevelHttp2Response;
92
+ interface BaseLowLevelError extends Error {
93
+ code?: string;
94
+ }
95
+ interface LowLevelHttpError extends BaseLowLevelError {
96
+ config: HttpRequestConfig;
97
+ request?: http.ClientRequest;
98
+ response?: LowLevelHttpResponse;
99
+ }
100
+ interface LowLevelHttp2Error extends BaseLowLevelError {
101
+ config: Http2RequestConfig;
102
+ request?: http2.ClientHttp2Stream;
103
+ response?: LowLevelHttp2Response;
104
+ }
105
+ type LowLevelError = LowLevelHttpError | LowLevelHttp2Error;
106
+ export declare class RequestResponseError extends Error {
107
+ readonly response: RequestResponse;
108
+ constructor(response: RequestResponse);
64
109
  }
65
110
  /**
66
- * Specifies how failing HTTP requests should be retried.
111
+ * Specifies how failing HTTP and HTTP/2 requests should be retried.
67
112
  */
68
113
  export interface RetryConfig {
69
114
  /** Maximum number of times to retry a given request. */
70
115
  maxRetries: number;
71
- /** HTTP status codes that should be retried. */
116
+ /** Response status codes that should be retried. */
72
117
  statusCodes?: number[];
73
118
  /** Low-level I/O error codes that should be retried. */
74
119
  ioErrorCodes?: string[];
75
120
  /**
76
121
  * The multiplier for exponential back off. The retry delay is calculated in seconds using the formula
77
- * `(2^n) * backOffFactor`, where n is the number of retries performed so far. When the backOffFactor is set
78
- * to 0, retries are not delayed. When the backOffFactor is 1, retry duration is doubled each iteration.
122
+ * `(2^n) * backOffFactor`, where n is the number of retries performed so far. When the `backOffFactor` is set
123
+ * to 0, retries are not delayed. When the `backOffFactor` is 1, retry duration is doubled each iteration.
79
124
  */
80
125
  backOffFactor?: number;
81
126
  /** Maximum duration to wait before initiating a retry. */
82
127
  maxDelayInMillis: number;
83
128
  }
84
129
  /**
85
- * Default retry configuration for HTTP requests. Retries up to 4 times on connection reset and timeout errors
86
- * as well as HTTP 503 errors. Exposed as a function to ensure that every HttpClient gets its own RetryConfig
130
+ * Default retry configuration for HTTP and HTTP/2 requests. Retries up to 4 times on connection reset and timeout
131
+ * errors as well as 503 errors. Exposed as a function to ensure that every `RequestClient` gets its own `RetryConfig`
87
132
  * instance.
88
133
  */
89
134
  export declare function defaultRetryConfig(): RetryConfig;
90
- export declare class HttpClient {
91
- private readonly retry;
135
+ export declare class RequestClient {
136
+ protected readonly retry: RetryConfig;
137
+ constructor(retry?: RetryConfig | null);
138
+ protected createRequestResponse(resp: LowLevelResponse): RequestResponse;
139
+ protected waitForRetry(delayMillis: number): Promise<void>;
140
+ /**
141
+ * Checks if a failed request is eligible for a retry, and if so returns the duration to wait before initiating
142
+ * the retry.
143
+ *
144
+ * @param retryAttempts - Number of retries completed up to now.
145
+ * @param err - The last encountered error.
146
+ * @returns A 2-tuple where the 1st element is the duration to wait before another retry, and the
147
+ * 2nd element is a boolean indicating whether the request is eligible for a retry or not.
148
+ */
149
+ protected getRetryDelayMillis(retryAttempts: number, err: LowLevelError): [number, boolean];
150
+ protected isRetryEligible(retryAttempts: number, err: LowLevelError): boolean;
151
+ /**???
152
+ * Parses the Retry-After header as a milliseconds value. Return value is negative if the Retry-After header
153
+ * contains an expired timestamp or otherwise malformed.
154
+ */
155
+ protected parseRetryAfterIntoMillis(retryAfter: string): number;
156
+ protected backOffDelayMillis(retryAttempts: number): number;
157
+ }
158
+ export declare class HttpClient extends RequestClient {
92
159
  constructor(retry?: RetryConfig | null);
93
160
  /**
94
161
  * Sends an HTTP request to a remote server. If the server responds with a successful response (2xx), the returned
95
- * promise resolves with an HttpResponse. If the server responds with an error (3xx, 4xx, 5xx), the promise rejects
96
- * with an HttpError. In case of all other errors, the promise rejects with a FirebaseAppError. If a request fails
97
- * due to a low-level network error, transparently retries the request once before rejecting the promise.
162
+ * promise resolves with an `RequestResponse`. If the server responds with an error (3xx, 4xx, 5xx), the promise
163
+ * rejects with an `RequestResponseError`. In case of all other errors, the promise rejects with a `FirebaseAppError`.
164
+ * If a request fails due to a low-level network error, the client transparently retries the request once before
165
+ * rejecting the promise.
98
166
  *
99
167
  * If the request data is specified as an object, it will be serialized into a JSON string. The application/json
100
168
  * content-type header will also be automatically set in this case. For all other payload types, the content-type
@@ -104,55 +172,70 @@ export declare class HttpClient {
104
172
  * @param config - HTTP request to be sent.
105
173
  * @returns A promise that resolves with the response details.
106
174
  */
107
- send(config: HttpRequestConfig): Promise<HttpResponse>;
175
+ send(config: HttpRequestConfig): Promise<RequestResponse>;
108
176
  /**
109
177
  * Sends an HTTP request. In the event of an error, retries the HTTP request according to the
110
- * RetryConfig set on the HttpClient.
178
+ * `RetryConfig` set on the `HttpClient`.
111
179
  *
112
180
  * @param config - HTTP request to be sent.
113
181
  * @param retryAttempts - Number of retries performed up to now.
114
182
  * @returns A promise that resolves with the response details.
115
183
  */
116
184
  private sendWithRetry;
117
- private createHttpResponse;
118
- private waitForRetry;
185
+ }
186
+ export declare class Http2Client extends RequestClient {
187
+ constructor(retry?: RetryConfig | null);
119
188
  /**
120
- * Checks if a failed request is eligible for a retry, and if so returns the duration to wait before initiating
121
- * the retry.
189
+ * Sends an HTTP/2 request to a remote server. If the server responds with a successful response (2xx), the returned
190
+ * promise resolves with an `RequestResponse`. If the server responds with an error (3xx, 4xx, 5xx), the promise
191
+ * rejects with an `RequestResponseError`. In case of all other errors, the promise rejects with a `FirebaseAppError`.
192
+ * If a request fails due to a low-level network error, the client transparently retries the request once before
193
+ * rejecting the promise.
122
194
  *
123
- * @param retryAttempts - Number of retries completed up to now.
124
- * @param err - The last encountered error.
125
- * @returns A 2-tuple where the 1st element is the duration to wait before another retry, and the
126
- * 2nd element is a boolean indicating whether the request is eligible for a retry or not.
195
+ * If the request data is specified as an object, it will be serialized into a JSON string. The application/json
196
+ * content-type header will also be automatically set in this case. For all other payload types, the content-type
197
+ * header should be explicitly set by the caller. To send a JSON leaf value (e.g. "foo", 5), parse it into JSON,
198
+ * and pass as a string or a Buffer along with the appropriate content-type header.
199
+ *
200
+ * @param config - HTTP/2 request to be sent.
201
+ * @returns A promise that resolves with the response details.
127
202
  */
128
- private getRetryDelayMillis;
129
- private isRetryEligible;
203
+ send(config: Http2RequestConfig): Promise<RequestResponse>;
130
204
  /**
131
- * Parses the Retry-After HTTP header as a milliseconds value. Return value is negative if the Retry-After header
132
- * contains an expired timestamp or otherwise malformed.
205
+ * Sends an HTTP/2 request. In the event of an error, retries the HTTP/2 request according to the
206
+ * `RetryConfig` set on the `Http2Client`.
207
+ *
208
+ * @param config - HTTP/2 request to be sent.
209
+ * @param retryAttempts - Number of retries performed up to now.
210
+ * @returns A promise that resolves with the response details.
133
211
  */
134
- private parseRetryAfterIntoMillis;
135
- private backOffDelayMillis;
212
+ private sendWithRetry;
136
213
  }
137
214
  /**
138
- * Parses a full HTTP response message containing both a header and a body.
215
+ * Parses a full HTTP or HTTP/2 response message containing both a header and a body.
139
216
  *
140
- * @param response - The HTTP response to be parsed.
141
- * @param config - The request configuration that resulted in the HTTP response.
142
- * @returns An object containing the parsed HTTP status, headers and the body.
217
+ * @param response - The HTTP or HTTP/2 response to be parsed.
218
+ * @param config - The request configuration that resulted in the HTTP or HTTP/2 response.
219
+ * @returns An object containing the response's parsed status, headers and the body.
143
220
  */
144
- export declare function parseHttpResponse(response: string | Buffer, config: HttpRequestConfig): HttpResponse;
221
+ export declare function parseHttpResponse(response: string | Buffer, config: RequestConfig): RequestResponse;
145
222
  export declare class AuthorizedHttpClient extends HttpClient {
146
223
  private readonly app;
147
224
  constructor(app: FirebaseApp);
148
- send(request: HttpRequestConfig): Promise<HttpResponse>;
225
+ send(request: HttpRequestConfig): Promise<RequestResponse>;
226
+ protected getToken(): Promise<string>;
227
+ }
228
+ export declare class AuthorizedHttp2Client extends Http2Client {
229
+ private readonly app;
230
+ constructor(app: FirebaseApp);
231
+ send(request: Http2RequestConfig): Promise<RequestResponse>;
149
232
  protected getToken(): Promise<string>;
150
233
  }
151
234
  /**
152
235
  * Class that defines all the settings for the backend API endpoint.
153
236
  *
154
237
  * @param endpoint - The Firebase Auth backend endpoint.
155
- * @param httpMethod - The http method for that endpoint.
238
+ * @param httpMethod - The HTTP method for that endpoint.
156
239
  * @constructor
157
240
  */
158
241
  export declare class ApiSettings {
@@ -230,3 +313,12 @@ export declare class ExponentialBackoffPoller<T> extends EventEmitter {
230
313
  private getPollingDelayMillis;
231
314
  private markCompleted;
232
315
  }
316
+ export declare class Http2SessionHandler {
317
+ private http2Session;
318
+ constructor(url: string);
319
+ createSession(url: string): http2.ClientHttp2Session;
320
+ get session(): http2.ClientHttp2Session;
321
+ get isClosed(): boolean;
322
+ close(): void;
323
+ }
324
+ export {};