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.
- package/lib/app/core.d.ts +1 -1
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -1
- package/lib/app/credential-factory.js +1 -1
- package/lib/app/credential-internal.d.ts +1 -1
- package/lib/app/credential-internal.js +4 -4
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +1 -1
- package/lib/app/firebase-namespace.d.ts +1 -1
- package/lib/app/firebase-namespace.js +1 -1
- package/lib/app/index.d.ts +1 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +1 -1
- package/lib/app/lifecycle.js +1 -1
- package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
- package/lib/app-check/app-check-api-client-internal.js +1 -1
- package/lib/app-check/app-check-api.d.ts +1 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check-namespace.d.ts +1 -1
- package/lib/app-check/app-check-namespace.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +1 -1
- package/lib/app-check/index.d.ts +1 -1
- package/lib/app-check/index.js +1 -1
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +1 -1
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +1 -1
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +1 -1
- package/lib/auth/auth-api-request.d.ts +1 -1
- package/lib/auth/auth-api-request.js +2 -2
- package/lib/auth/auth-config.d.ts +1 -1
- package/lib/auth/auth-config.js +1 -1
- package/lib/auth/auth-namespace.d.ts +1 -1
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +1 -1
- package/lib/auth/base-auth.js +1 -1
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +1 -1
- package/lib/auth/index.js +1 -1
- package/lib/auth/project-config-manager.d.ts +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +1 -1
- package/lib/auth/project-config.js +1 -1
- package/lib/auth/tenant-manager.d.ts +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.d.ts +1 -1
- package/lib/auth/tenant.js +1 -1
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +1 -1
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +1 -1
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +1 -1
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +1 -1
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/database/database-namespace.d.ts +1 -1
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +2 -2
- package/lib/database/index.d.ts +1 -1
- package/lib/database/index.js +1 -1
- package/lib/default-namespace.d.ts +1 -1
- package/lib/default-namespace.js +1 -1
- package/lib/eventarc/cloudevent.d.ts +1 -1
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +1 -1
- package/lib/eventarc/eventarc-utils.d.ts +1 -1
- package/lib/eventarc/eventarc-utils.js +1 -1
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +1 -1
- package/lib/eventarc/index.d.ts +1 -1
- package/lib/eventarc/index.js +1 -1
- package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
- package/lib/extensions/extensions-api-client-internal.js +1 -1
- package/lib/extensions/extensions-api.d.ts +1 -1
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +1 -1
- package/lib/extensions/index.d.ts +1 -1
- package/lib/extensions/index.js +1 -1
- package/lib/firebase-namespace-api.d.ts +1 -1
- package/lib/firebase-namespace-api.js +1 -1
- package/lib/firestore/firestore-internal.d.ts +1 -1
- package/lib/firestore/firestore-internal.js +1 -1
- package/lib/firestore/firestore-namespace.d.ts +1 -1
- package/lib/firestore/firestore-namespace.js +1 -1
- package/lib/firestore/index.d.ts +1 -1
- package/lib/firestore/index.js +1 -1
- package/lib/functions/functions-api-client-internal.d.ts +1 -1
- package/lib/functions/functions-api-client-internal.js +3 -3
- package/lib/functions/functions-api.d.ts +1 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +1 -1
- package/lib/functions/index.d.ts +1 -1
- package/lib/functions/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +1 -1
- package/lib/installations/index.js +1 -1
- package/lib/installations/installations-namespace.d.ts +1 -1
- package/lib/installations/installations-namespace.js +1 -1
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +2 -2
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +1 -1
- package/lib/instance-id/index.d.ts +1 -1
- package/lib/instance-id/index.js +1 -1
- package/lib/instance-id/instance-id-namespace.d.ts +1 -1
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +1 -1
- package/lib/instance-id/instance-id.js +1 -1
- package/lib/machine-learning/index.d.ts +1 -1
- package/lib/machine-learning/index.js +1 -1
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +1 -1
- package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
- package/lib/machine-learning/machine-learning-namespace.js +1 -1
- package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +1 -1
- package/lib/machine-learning/machine-learning.js +1 -1
- package/lib/messaging/batch-request-internal.d.ts +4 -4
- package/lib/messaging/batch-request-internal.js +2 -2
- package/lib/messaging/index.d.ts +1 -1
- package/lib/messaging/index.js +1 -1
- package/lib/messaging/messaging-api-request-internal.d.ts +15 -4
- package/lib/messaging/messaging-api-request-internal.js +39 -10
- package/lib/messaging/messaging-api.d.ts +1 -1
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +6 -6
- package/lib/messaging/messaging-errors-internal.js +4 -4
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +1 -1
- package/lib/messaging/messaging-namespace.d.ts +1 -1
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +16 -1
- package/lib/messaging/messaging.js +37 -9
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +1 -1
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/index.d.ts +1 -1
- package/lib/project-management/index.js +1 -1
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +1 -1
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +3 -3
- package/lib/project-management/project-management-namespace.d.ts +1 -1
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +1 -1
- package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
- package/lib/remote-config/condition-evaluator-internal.js +20 -14
- package/lib/remote-config/index.d.ts +1 -1
- package/lib/remote-config/index.js +1 -1
- package/lib/remote-config/internal/value-impl.d.ts +1 -1
- package/lib/remote-config/internal/value-impl.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +1 -1
- package/lib/remote-config/remote-config-api.d.ts +1 -1
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +1 -1
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +1 -1
- package/lib/security-rules/index.d.ts +1 -1
- package/lib/security-rules/index.js +1 -1
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +1 -1
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +1 -1
- package/lib/storage/index.d.ts +1 -1
- package/lib/storage/index.js +1 -1
- package/lib/storage/storage-namespace.d.ts +1 -1
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +1 -1
- package/lib/storage/utils.d.ts +1 -1
- package/lib/storage/utils.js +1 -1
- package/lib/utils/api-request.d.ts +134 -42
- package/lib/utils/api-request.js +430 -186
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +2 -2
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +1 -1
- package/lib/utils/error.js +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/jwt.js +3 -3
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +4 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v12.
|
|
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
|
-
*
|
|
31
|
+
* Base configuration for constructing a new request.
|
|
30
32
|
*/
|
|
31
|
-
export interface
|
|
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
|
-
*
|
|
51
|
+
* Configuration for constructing a new HTTP/2 request.
|
|
45
52
|
*/
|
|
46
|
-
export interface
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
/**
|
|
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
|
|
86
|
-
* as well as
|
|
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
|
|
91
|
-
|
|
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
|
|
96
|
-
* with an
|
|
97
|
-
* due to a low-level network error, transparently retries the request once before
|
|
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<
|
|
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
|
-
|
|
118
|
-
|
|
185
|
+
}
|
|
186
|
+
export declare class Http2Client extends RequestClient {
|
|
187
|
+
constructor(retry?: RetryConfig | null);
|
|
119
188
|
/**
|
|
120
|
-
*
|
|
121
|
-
* the
|
|
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
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
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
|
-
|
|
129
|
-
private isRetryEligible;
|
|
203
|
+
send(config: Http2RequestConfig): Promise<RequestResponse>;
|
|
130
204
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
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
|
|
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
|
|
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:
|
|
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<
|
|
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
|
|
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 {};
|