@azure/core-rest-pipeline 1.18.0-alpha.20241125.6 → 1.18.1
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/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.js +3 -3
- package/dist/browser/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js +3 -3
- package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.js +3 -3
- package/dist/esm/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js +3 -3
- package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
- package/package.json +4 -4
- package/dist/core-rest-pipeline.d.ts +0 -1328
|
@@ -1,1328 +0,0 @@
|
|
|
1
|
-
import type { AbortSignalLike } from '@azure/abort-controller';
|
|
2
|
-
import type { AccessToken } from '@azure/core-auth';
|
|
3
|
-
import { AzureLogger } from '@azure/logger';
|
|
4
|
-
import type { Debugger } from '@azure/logger';
|
|
5
|
-
import type { GetTokenOptions } from '@azure/core-auth';
|
|
6
|
-
import { HttpMethods } from '@azure/core-util';
|
|
7
|
-
import type { OperationTracingOptions } from '@azure/core-tracing';
|
|
8
|
-
import type { TokenCredential } from '@azure/core-auth';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Options when adding a policy to the pipeline.
|
|
12
|
-
* Used to express dependencies on other policies.
|
|
13
|
-
*/
|
|
14
|
-
export declare interface AddPipelineOptions {
|
|
15
|
-
/**
|
|
16
|
-
* Policies that this policy must come before.
|
|
17
|
-
*/
|
|
18
|
-
beforePolicies?: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Policies that this policy must come after.
|
|
21
|
-
*/
|
|
22
|
-
afterPolicies?: string[];
|
|
23
|
-
/**
|
|
24
|
-
* The phase that this policy must come after.
|
|
25
|
-
*/
|
|
26
|
-
afterPhase?: PipelinePhase;
|
|
27
|
-
/**
|
|
28
|
-
* The phase this policy belongs to.
|
|
29
|
-
*/
|
|
30
|
-
phase?: PipelinePhase;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* An interface compatible with NodeJS's `http.Agent`.
|
|
35
|
-
* We want to avoid publicly re-exporting the actual interface,
|
|
36
|
-
* since it might vary across runtime versions.
|
|
37
|
-
*/
|
|
38
|
-
export declare interface Agent {
|
|
39
|
-
/**
|
|
40
|
-
* Destroy any sockets that are currently in use by the agent.
|
|
41
|
-
*/
|
|
42
|
-
destroy(): void;
|
|
43
|
-
/**
|
|
44
|
-
* For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.
|
|
45
|
-
*/
|
|
46
|
-
maxFreeSockets: number;
|
|
47
|
-
/**
|
|
48
|
-
* Determines how many concurrent sockets the agent can have open per origin.
|
|
49
|
-
*/
|
|
50
|
-
maxSockets: number;
|
|
51
|
-
/**
|
|
52
|
-
* An object which contains queues of requests that have not yet been assigned to sockets.
|
|
53
|
-
*/
|
|
54
|
-
requests: unknown;
|
|
55
|
-
/**
|
|
56
|
-
* An object which contains arrays of sockets currently in use by the agent.
|
|
57
|
-
*/
|
|
58
|
-
sockets: unknown;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Options sent to the authorizeRequestOnChallenge callback
|
|
63
|
-
*/
|
|
64
|
-
export declare interface AuthorizeRequestOnChallengeOptions {
|
|
65
|
-
/**
|
|
66
|
-
* The scopes for which the bearer token applies.
|
|
67
|
-
*/
|
|
68
|
-
scopes: string[];
|
|
69
|
-
/**
|
|
70
|
-
* Function that retrieves either a cached access token or a new access token.
|
|
71
|
-
*/
|
|
72
|
-
getAccessToken: (scopes: string[], options: GetTokenOptions) => Promise<AccessToken | null>;
|
|
73
|
-
/**
|
|
74
|
-
* Request that the policy is trying to fulfill.
|
|
75
|
-
*/
|
|
76
|
-
request: PipelineRequest;
|
|
77
|
-
/**
|
|
78
|
-
* Response containing the challenge.
|
|
79
|
-
*/
|
|
80
|
-
response: PipelineResponse;
|
|
81
|
-
/**
|
|
82
|
-
* A logger, if one was sent through the HTTP pipeline.
|
|
83
|
-
*/
|
|
84
|
-
logger?: AzureLogger;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Options sent to the authorizeRequest callback
|
|
89
|
-
*/
|
|
90
|
-
export declare interface AuthorizeRequestOptions {
|
|
91
|
-
/**
|
|
92
|
-
* The scopes for which the bearer token applies.
|
|
93
|
-
*/
|
|
94
|
-
scopes: string[];
|
|
95
|
-
/**
|
|
96
|
-
* Function that retrieves either a cached access token or a new access token.
|
|
97
|
-
*/
|
|
98
|
-
getAccessToken: (scopes: string[], options: GetTokenOptions) => Promise<AccessToken | null>;
|
|
99
|
-
/**
|
|
100
|
-
* Request that the policy is trying to fulfill.
|
|
101
|
-
*/
|
|
102
|
-
request: PipelineRequest;
|
|
103
|
-
/**
|
|
104
|
-
* A logger, if one was sent through the HTTP pipeline.
|
|
105
|
-
*/
|
|
106
|
-
logger?: AzureLogger;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* A policy for external tokens to `x-ms-authorization-auxiliary` header.
|
|
111
|
-
* This header will be used when creating a cross-tenant application we may need to handle authentication requests
|
|
112
|
-
* for resources that are in different tenants.
|
|
113
|
-
* You could see [ARM docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant) for a rundown of how this feature works
|
|
114
|
-
*/
|
|
115
|
-
export declare function auxiliaryAuthenticationHeaderPolicy(options: AuxiliaryAuthenticationHeaderPolicyOptions): PipelinePolicy;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* The programmatic identifier of the auxiliaryAuthenticationHeaderPolicy.
|
|
119
|
-
*/
|
|
120
|
-
export declare const auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy";
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Options to configure the auxiliaryAuthenticationHeaderPolicy
|
|
124
|
-
*/
|
|
125
|
-
export declare interface AuxiliaryAuthenticationHeaderPolicyOptions {
|
|
126
|
-
/**
|
|
127
|
-
* TokenCredential list used to get token from auxiliary tenants and
|
|
128
|
-
* one credential for each tenant the client may need to access
|
|
129
|
-
*/
|
|
130
|
-
credentials?: TokenCredential[];
|
|
131
|
-
/**
|
|
132
|
-
* Scopes depend on the cloud your application runs in
|
|
133
|
-
*/
|
|
134
|
-
scopes: string | string[];
|
|
135
|
-
/**
|
|
136
|
-
* A logger can be sent for debugging purposes.
|
|
137
|
-
*/
|
|
138
|
-
logger?: AzureLogger;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* A policy that can request a token from a TokenCredential implementation and
|
|
143
|
-
* then apply it to the Authorization header of a request as a Bearer token.
|
|
144
|
-
*/
|
|
145
|
-
export declare function bearerTokenAuthenticationPolicy(options: BearerTokenAuthenticationPolicyOptions): PipelinePolicy;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* The programmatic identifier of the bearerTokenAuthenticationPolicy.
|
|
149
|
-
*/
|
|
150
|
-
export declare const bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy";
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Options to configure the bearerTokenAuthenticationPolicy
|
|
154
|
-
*/
|
|
155
|
-
export declare interface BearerTokenAuthenticationPolicyOptions {
|
|
156
|
-
/**
|
|
157
|
-
* The TokenCredential implementation that can supply the bearer token.
|
|
158
|
-
*/
|
|
159
|
-
credential?: TokenCredential;
|
|
160
|
-
/**
|
|
161
|
-
* The scopes for which the bearer token applies.
|
|
162
|
-
*/
|
|
163
|
-
scopes: string | string[];
|
|
164
|
-
/**
|
|
165
|
-
* Allows for the processing of [Continuous Access Evaluation](https://docs.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation) challenges.
|
|
166
|
-
* If provided, it must contain at least the `authorizeRequestOnChallenge` method.
|
|
167
|
-
* If provided, after a request is sent, if it has a challenge, it can be processed to re-send the original request with the relevant challenge information.
|
|
168
|
-
*/
|
|
169
|
-
challengeCallbacks?: ChallengeCallbacks;
|
|
170
|
-
/**
|
|
171
|
-
* A logger can be sent for debugging purposes.
|
|
172
|
-
*/
|
|
173
|
-
logger?: AzureLogger;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* A part of the request body in a multipart request.
|
|
178
|
-
*/
|
|
179
|
-
export declare interface BodyPart {
|
|
180
|
-
/**
|
|
181
|
-
* The headers for this part of the multipart request.
|
|
182
|
-
*/
|
|
183
|
-
headers: HttpHeaders;
|
|
184
|
-
/**
|
|
185
|
-
* The body of this part of the multipart request.
|
|
186
|
-
*/
|
|
187
|
-
body: ((() => ReadableStream<Uint8Array>) | (() => NodeJS.ReadableStream)) | ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Options to override the processing of [Continuous Access Evaluation](https://docs.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation) challenges.
|
|
192
|
-
*/
|
|
193
|
-
export declare interface ChallengeCallbacks {
|
|
194
|
-
/**
|
|
195
|
-
* Allows for the authorization of the main request of this policy before it's sent.
|
|
196
|
-
*/
|
|
197
|
-
authorizeRequest?(options: AuthorizeRequestOptions): Promise<void>;
|
|
198
|
-
/**
|
|
199
|
-
* Allows to handle authentication challenges and to re-authorize the request.
|
|
200
|
-
* The response containing the challenge is `options.response`.
|
|
201
|
-
* If this method returns true, the underlying request will be sent once again.
|
|
202
|
-
* The request may be modified before being sent.
|
|
203
|
-
*/
|
|
204
|
-
authorizeRequestOnChallenge?(options: AuthorizeRequestOnChallengeOptions): Promise<boolean>;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Create the correct HttpClient for the current environment.
|
|
209
|
-
*/
|
|
210
|
-
export declare function createDefaultHttpClient(): HttpClient;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Creates a totally empty pipeline.
|
|
214
|
-
* Useful for testing or creating a custom one.
|
|
215
|
-
*/
|
|
216
|
-
export declare function createEmptyPipeline(): Pipeline;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Create an object that implements the File interface. This object is intended to be
|
|
220
|
-
* passed into RequestBodyType.formData, and is not guaranteed to work as expected in
|
|
221
|
-
* other situations.
|
|
222
|
-
*
|
|
223
|
-
* Use this function create a File object for use in RequestBodyType.formData in environments where the global File object is unavailable.
|
|
224
|
-
*
|
|
225
|
-
* @param content - the content of the file as a Uint8Array in memory.
|
|
226
|
-
* @param name - the name of the file.
|
|
227
|
-
* @param options - optional metadata about the file, e.g. file name, file size, MIME type.
|
|
228
|
-
*/
|
|
229
|
-
export declare function createFile(content: Uint8Array, name: string, options?: CreateFileOptions): File;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Create an object that implements the File interface. This object is intended to be
|
|
233
|
-
* passed into RequestBodyType.formData, and is not guaranteed to work as expected in
|
|
234
|
-
* other situations.
|
|
235
|
-
*
|
|
236
|
-
* Use this function to:
|
|
237
|
-
* - Create a File object for use in RequestBodyType.formData in environments where the
|
|
238
|
-
* global File object is unavailable.
|
|
239
|
-
* - Create a File-like object from a readable stream without reading the stream into memory.
|
|
240
|
-
*
|
|
241
|
-
* @param stream - the content of the file as a callback returning a stream. When a File object made using createFile is
|
|
242
|
-
* passed in a request's form data map, the stream will not be read into memory
|
|
243
|
-
* and instead will be streamed when the request is made. In the event of a retry, the
|
|
244
|
-
* stream needs to be read again, so this callback SHOULD return a fresh stream if possible.
|
|
245
|
-
* @param name - the name of the file.
|
|
246
|
-
* @param options - optional metadata about the file, e.g. file name, file size, MIME type.
|
|
247
|
-
*/
|
|
248
|
-
export declare function createFileFromStream(stream: () => ReadableStream<Uint8Array> | NodeJS.ReadableStream, name: string, options?: CreateFileFromStreamOptions): File;
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Extra options for createFile when a stream is being passed in.
|
|
252
|
-
*/
|
|
253
|
-
export declare interface CreateFileFromStreamOptions extends CreateFileOptions {
|
|
254
|
-
/**
|
|
255
|
-
* Size of the file represented by the stream in bytes.
|
|
256
|
-
*
|
|
257
|
-
* This will be used by the pipeline when calculating the Content-Length header
|
|
258
|
-
* for the overall request.
|
|
259
|
-
*/
|
|
260
|
-
size?: number;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Options passed into createFile specifying metadata about the file.
|
|
265
|
-
*/
|
|
266
|
-
export declare interface CreateFileOptions {
|
|
267
|
-
/**
|
|
268
|
-
* The MIME type of the file.
|
|
269
|
-
*/
|
|
270
|
-
type?: string;
|
|
271
|
-
/**
|
|
272
|
-
* Last modified time of the file as a UNIX timestamp.
|
|
273
|
-
* This will default to the current date.
|
|
274
|
-
*/
|
|
275
|
-
lastModified?: number;
|
|
276
|
-
/**
|
|
277
|
-
* relative path of this file when uploading a directory.
|
|
278
|
-
*/
|
|
279
|
-
webkitRelativePath?: string;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Creates an object that satisfies the `HttpHeaders` interface.
|
|
284
|
-
* @param rawHeaders - A simple object representing initial headers
|
|
285
|
-
*/
|
|
286
|
-
export declare function createHttpHeaders(rawHeaders?: RawHttpHeadersInput): HttpHeaders;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Create a new pipeline with a default set of customizable policies.
|
|
290
|
-
* @param options - Options to configure a custom pipeline.
|
|
291
|
-
*/
|
|
292
|
-
export declare function createPipelineFromOptions(options: InternalPipelineOptions): Pipeline;
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Creates a new pipeline request with the given options.
|
|
296
|
-
* This method is to allow for the easy setting of default values and not required.
|
|
297
|
-
* @param options - The options to create the request with.
|
|
298
|
-
*/
|
|
299
|
-
export declare function createPipelineRequest(options: PipelineRequestOptions): PipelineRequest;
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* A policy to enable response decompression according to Accept-Encoding header
|
|
303
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
|
|
304
|
-
*/
|
|
305
|
-
export declare function decompressResponsePolicy(): PipelinePolicy;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* The programmatic identifier of the decompressResponsePolicy.
|
|
309
|
-
*/
|
|
310
|
-
export declare const decompressResponsePolicyName = "decompressResponsePolicy";
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* A policy that retries according to three strategies:
|
|
314
|
-
* - When the server sends a 429 response with a Retry-After header.
|
|
315
|
-
* - When there are errors in the underlying transport layer (e.g. DNS lookup failures).
|
|
316
|
-
* - Or otherwise if the outgoing request fails, it will retry with an exponentially increasing delay.
|
|
317
|
-
*/
|
|
318
|
-
export declare function defaultRetryPolicy(options?: DefaultRetryPolicyOptions): PipelinePolicy;
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Options that control how to retry failed requests.
|
|
322
|
-
*/
|
|
323
|
-
export declare interface DefaultRetryPolicyOptions extends PipelineRetryOptions {
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* A policy that attempts to retry requests while introducing an exponentially increasing delay.
|
|
328
|
-
* @param options - Options that configure retry logic.
|
|
329
|
-
*/
|
|
330
|
-
export declare function exponentialRetryPolicy(options?: ExponentialRetryPolicyOptions): PipelinePolicy;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* The programmatic identifier of the exponentialRetryPolicy.
|
|
334
|
-
*/
|
|
335
|
-
export declare const exponentialRetryPolicyName = "exponentialRetryPolicy";
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Options that control how to retry failed requests.
|
|
339
|
-
*/
|
|
340
|
-
export declare interface ExponentialRetryPolicyOptions {
|
|
341
|
-
/**
|
|
342
|
-
* The maximum number of retry attempts. Defaults to 3.
|
|
343
|
-
*/
|
|
344
|
-
maxRetries?: number;
|
|
345
|
-
/**
|
|
346
|
-
* The amount of delay in milliseconds between retry attempts. Defaults to 1000
|
|
347
|
-
* (1 second.) The delay increases exponentially with each retry up to a maximum
|
|
348
|
-
* specified by maxRetryDelayInMs.
|
|
349
|
-
*/
|
|
350
|
-
retryDelayInMs?: number;
|
|
351
|
-
/**
|
|
352
|
-
* The maximum delay in milliseconds allowed before retrying an operation. Defaults
|
|
353
|
-
* to 64000 (64 seconds).
|
|
354
|
-
*/
|
|
355
|
-
maxRetryDelayInMs?: number;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* A simple object that provides form data, as if from a browser form.
|
|
360
|
-
*/
|
|
361
|
-
export declare type FormDataMap = {
|
|
362
|
-
[key: string]: FormDataValue | FormDataValue[];
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* A policy that encodes FormData on the request into the body.
|
|
367
|
-
*/
|
|
368
|
-
export declare function formDataPolicy(): PipelinePolicy;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* The programmatic identifier of the formDataPolicy.
|
|
372
|
-
*/
|
|
373
|
-
export declare const formDataPolicyName = "formDataPolicy";
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Each form data entry can be a string, Blob, or a File. If you wish to pass a file with a name but do not have
|
|
377
|
-
* access to the File class, you can use the createFile helper to create one.
|
|
378
|
-
*/
|
|
379
|
-
export declare type FormDataValue = string | Blob | File;
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* This method converts a proxy url into `ProxySettings` for use with ProxyPolicy.
|
|
383
|
-
* If no argument is given, it attempts to parse a proxy URL from the environment
|
|
384
|
-
* variables `HTTPS_PROXY` or `HTTP_PROXY`.
|
|
385
|
-
* @param proxyUrl - The url of the proxy to use. May contain authentication information.
|
|
386
|
-
* @deprecated - Internally this method is no longer necessary when setting proxy information.
|
|
387
|
-
*/
|
|
388
|
-
export declare function getDefaultProxySettings(proxyUrl?: string): ProxySettings | undefined;
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* The required interface for a client that makes HTTP requests
|
|
392
|
-
* on behalf of a pipeline.
|
|
393
|
-
*/
|
|
394
|
-
export declare interface HttpClient {
|
|
395
|
-
/**
|
|
396
|
-
* The method that makes the request and returns a response.
|
|
397
|
-
*/
|
|
398
|
-
sendRequest: SendRequest;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Represents a set of HTTP headers on a request/response.
|
|
403
|
-
* Header names are treated as case insensitive.
|
|
404
|
-
*/
|
|
405
|
-
export declare interface HttpHeaders extends Iterable<[string, string]> {
|
|
406
|
-
/**
|
|
407
|
-
* Returns the value of a specific header or undefined if not set.
|
|
408
|
-
* @param name - The name of the header to retrieve.
|
|
409
|
-
*/
|
|
410
|
-
get(name: string): string | undefined;
|
|
411
|
-
/**
|
|
412
|
-
* Returns true if the specified header exists.
|
|
413
|
-
* @param name - The name of the header to check.
|
|
414
|
-
*/
|
|
415
|
-
has(name: string): boolean;
|
|
416
|
-
/**
|
|
417
|
-
* Sets a specific header with a given value.
|
|
418
|
-
* @param name - The name of the header to set.
|
|
419
|
-
* @param value - The value to use for the header.
|
|
420
|
-
*/
|
|
421
|
-
set(name: string, value: string | number | boolean): void;
|
|
422
|
-
/**
|
|
423
|
-
* Removes a specific header from the collection.
|
|
424
|
-
* @param name - The name of the header to delete.
|
|
425
|
-
*/
|
|
426
|
-
delete(name: string): void;
|
|
427
|
-
/**
|
|
428
|
-
* Accesses a raw JS object that acts as a simple map
|
|
429
|
-
* of header names to values.
|
|
430
|
-
*/
|
|
431
|
-
toJSON(options?: {
|
|
432
|
-
preserveCase?: boolean;
|
|
433
|
-
}): RawHttpHeaders;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export { HttpMethods }
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Defines options that are used to configure internal options of
|
|
440
|
-
* the HTTP pipeline for an SDK client.
|
|
441
|
-
*/
|
|
442
|
-
export declare interface InternalPipelineOptions extends PipelineOptions {
|
|
443
|
-
/**
|
|
444
|
-
* Options to configure request/response logging.
|
|
445
|
-
*/
|
|
446
|
-
loggingOptions?: LogPolicyOptions;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Typeguard for RestError
|
|
451
|
-
* @param e - Something caught by a catch clause.
|
|
452
|
-
*/
|
|
453
|
-
export declare function isRestError(e: unknown): e is RestError;
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* An interface compatible with NodeJS's `tls.KeyObject`.
|
|
457
|
-
* We want to avoid publicly re-exporting the actual interface,
|
|
458
|
-
* since it might vary across runtime versions.
|
|
459
|
-
*/
|
|
460
|
-
export declare interface KeyObject {
|
|
461
|
-
/**
|
|
462
|
-
* Private keys in PEM format.
|
|
463
|
-
*/
|
|
464
|
-
pem: string | Buffer;
|
|
465
|
-
/**
|
|
466
|
-
* Optional passphrase.
|
|
467
|
-
*/
|
|
468
|
-
passphrase?: string | undefined;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* A policy that logs all requests and responses.
|
|
473
|
-
* @param options - Options to configure logPolicy.
|
|
474
|
-
*/
|
|
475
|
-
export declare function logPolicy(options?: LogPolicyOptions): PipelinePolicy;
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* The programmatic identifier of the logPolicy.
|
|
479
|
-
*/
|
|
480
|
-
export declare const logPolicyName = "logPolicy";
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Options to configure the logPolicy.
|
|
484
|
-
*/
|
|
485
|
-
export declare interface LogPolicyOptions {
|
|
486
|
-
/**
|
|
487
|
-
* Header names whose values will be logged when logging is enabled.
|
|
488
|
-
* Defaults include a list of well-known safe headers. Any headers
|
|
489
|
-
* specified in this field will be added to that list. Any other values will
|
|
490
|
-
* be written to logs as "REDACTED".
|
|
491
|
-
*/
|
|
492
|
-
additionalAllowedHeaderNames?: string[];
|
|
493
|
-
/**
|
|
494
|
-
* Query string names whose values will be logged when logging is enabled. By default no
|
|
495
|
-
* query string values are logged.
|
|
496
|
-
*/
|
|
497
|
-
additionalAllowedQueryParameters?: string[];
|
|
498
|
-
/**
|
|
499
|
-
* The log function to use for writing pipeline logs.
|
|
500
|
-
* Defaults to core-http's built-in logger.
|
|
501
|
-
* Compatible with the `debug` library.
|
|
502
|
-
*/
|
|
503
|
-
logger?: Debugger;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Pipeline policy for multipart requests
|
|
508
|
-
*/
|
|
509
|
-
export declare function multipartPolicy(): PipelinePolicy;
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Name of multipart policy
|
|
513
|
-
*/
|
|
514
|
-
export declare const multipartPolicyName = "multipartPolicy";
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* A request body consisting of multiple parts.
|
|
518
|
-
*/
|
|
519
|
-
export declare interface MultipartRequestBody {
|
|
520
|
-
/**
|
|
521
|
-
* The parts of the request body.
|
|
522
|
-
*/
|
|
523
|
-
parts: BodyPart[];
|
|
524
|
-
/**
|
|
525
|
-
* The boundary separating each part of the request body.
|
|
526
|
-
* If not specified, a random boundary will be generated.
|
|
527
|
-
*
|
|
528
|
-
* When specified, '--' will be prepended to the boundary in the request to ensure the boundary follows the specification.
|
|
529
|
-
*/
|
|
530
|
-
boundary?: string;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* ndJsonPolicy is a policy used to control keep alive settings for every request.
|
|
535
|
-
*/
|
|
536
|
-
export declare function ndJsonPolicy(): PipelinePolicy;
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* The programmatic identifier of the ndJsonPolicy.
|
|
540
|
-
*/
|
|
541
|
-
export declare const ndJsonPolicyName = "ndJsonPolicy";
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Represents a pipeline for making a HTTP request to a URL.
|
|
545
|
-
* Pipelines can have multiple policies to manage manipulating each request
|
|
546
|
-
* before and after it is made to the server.
|
|
547
|
-
*/
|
|
548
|
-
export declare interface Pipeline {
|
|
549
|
-
/**
|
|
550
|
-
* Add a new policy to the pipeline.
|
|
551
|
-
* @param policy - A policy that manipulates a request.
|
|
552
|
-
* @param options - A set of options for when the policy should run.
|
|
553
|
-
*/
|
|
554
|
-
addPolicy(policy: PipelinePolicy, options?: AddPipelineOptions): void;
|
|
555
|
-
/**
|
|
556
|
-
* Remove a policy from the pipeline.
|
|
557
|
-
* @param options - Options that let you specify which policies to remove.
|
|
558
|
-
*/
|
|
559
|
-
removePolicy(options: {
|
|
560
|
-
name?: string;
|
|
561
|
-
phase?: PipelinePhase;
|
|
562
|
-
}): PipelinePolicy[];
|
|
563
|
-
/**
|
|
564
|
-
* Uses the pipeline to make a HTTP request.
|
|
565
|
-
* @param httpClient - The HttpClient that actually performs the request.
|
|
566
|
-
* @param request - The request to be made.
|
|
567
|
-
*/
|
|
568
|
-
sendRequest(httpClient: HttpClient, request: PipelineRequest): Promise<PipelineResponse>;
|
|
569
|
-
/**
|
|
570
|
-
* Returns the current set of policies in the pipeline in the order in which
|
|
571
|
-
* they will be applied to the request. Later in the list is closer to when
|
|
572
|
-
* the request is performed.
|
|
573
|
-
*/
|
|
574
|
-
getOrderedPolicies(): PipelinePolicy[];
|
|
575
|
-
/**
|
|
576
|
-
* Duplicates this pipeline to allow for modifying an existing one without mutating it.
|
|
577
|
-
*/
|
|
578
|
-
clone(): Pipeline;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Defines options that are used to configure the HTTP pipeline for
|
|
583
|
-
* an SDK client.
|
|
584
|
-
*/
|
|
585
|
-
export declare interface PipelineOptions {
|
|
586
|
-
/**
|
|
587
|
-
* Options that control how to retry failed requests.
|
|
588
|
-
*/
|
|
589
|
-
retryOptions?: PipelineRetryOptions;
|
|
590
|
-
/**
|
|
591
|
-
* Options to configure a proxy for outgoing requests.
|
|
592
|
-
*/
|
|
593
|
-
proxyOptions?: ProxySettings;
|
|
594
|
-
/** Options for configuring TLS authentication */
|
|
595
|
-
tlsOptions?: TlsSettings;
|
|
596
|
-
/**
|
|
597
|
-
* Options for how redirect responses are handled.
|
|
598
|
-
*/
|
|
599
|
-
redirectOptions?: RedirectPolicyOptions;
|
|
600
|
-
/**
|
|
601
|
-
* Options for adding user agent details to outgoing requests.
|
|
602
|
-
*/
|
|
603
|
-
userAgentOptions?: UserAgentPolicyOptions;
|
|
604
|
-
/**
|
|
605
|
-
* Options for setting common telemetry and tracing info to outgoing requests.
|
|
606
|
-
*/
|
|
607
|
-
telemetryOptions?: TelemetryOptions;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* Policies are executed in phases.
|
|
612
|
-
* The execution order is:
|
|
613
|
-
* 1. Serialize Phase
|
|
614
|
-
* 2. Policies not in a phase
|
|
615
|
-
* 3. Deserialize Phase
|
|
616
|
-
* 4. Retry Phase
|
|
617
|
-
* 5. Sign Phase
|
|
618
|
-
*/
|
|
619
|
-
export declare type PipelinePhase = "Deserialize" | "Serialize" | "Retry" | "Sign";
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* A pipeline policy manipulates a request as it travels through the pipeline.
|
|
623
|
-
* It is conceptually a middleware that is allowed to modify the request before
|
|
624
|
-
* it is made as well as the response when it is received.
|
|
625
|
-
*/
|
|
626
|
-
export declare interface PipelinePolicy {
|
|
627
|
-
/**
|
|
628
|
-
* The policy name. Must be a unique string in the pipeline.
|
|
629
|
-
*/
|
|
630
|
-
name: string;
|
|
631
|
-
/**
|
|
632
|
-
* The main method to implement that manipulates a request/response.
|
|
633
|
-
* @param request - The request being performed.
|
|
634
|
-
* @param next - The next policy in the pipeline. Must be called to continue the pipeline.
|
|
635
|
-
*/
|
|
636
|
-
sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse>;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Metadata about a request being made by the pipeline.
|
|
641
|
-
*/
|
|
642
|
-
export declare interface PipelineRequest {
|
|
643
|
-
/**
|
|
644
|
-
* The URL to make the request to.
|
|
645
|
-
*/
|
|
646
|
-
url: string;
|
|
647
|
-
/**
|
|
648
|
-
* The HTTP method to use when making the request.
|
|
649
|
-
*/
|
|
650
|
-
method: HttpMethods;
|
|
651
|
-
/**
|
|
652
|
-
* The HTTP headers to use when making the request.
|
|
653
|
-
*/
|
|
654
|
-
headers: HttpHeaders;
|
|
655
|
-
/**
|
|
656
|
-
* The number of milliseconds a request can take before automatically being terminated.
|
|
657
|
-
* If the request is terminated, an `AbortError` is thrown.
|
|
658
|
-
* Defaults to 0, which disables the timeout.
|
|
659
|
-
*/
|
|
660
|
-
timeout: number;
|
|
661
|
-
/**
|
|
662
|
-
* Indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.
|
|
663
|
-
* Defaults to false.
|
|
664
|
-
*/
|
|
665
|
-
withCredentials: boolean;
|
|
666
|
-
/**
|
|
667
|
-
* A unique identifier for the request. Used for logging and tracing.
|
|
668
|
-
*/
|
|
669
|
-
requestId: string;
|
|
670
|
-
/**
|
|
671
|
-
* The HTTP body content (if any)
|
|
672
|
-
*/
|
|
673
|
-
body?: RequestBodyType;
|
|
674
|
-
/**
|
|
675
|
-
* Body for a multipart request.
|
|
676
|
-
*/
|
|
677
|
-
multipartBody?: MultipartRequestBody;
|
|
678
|
-
/**
|
|
679
|
-
* To simulate a browser form post
|
|
680
|
-
*/
|
|
681
|
-
formData?: FormDataMap;
|
|
682
|
-
/**
|
|
683
|
-
* A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.
|
|
684
|
-
* When streamResponseStatusCodes contains the value Number.POSITIVE_INFINITY any status would be treated as a stream.
|
|
685
|
-
*/
|
|
686
|
-
streamResponseStatusCodes?: Set<number>;
|
|
687
|
-
/**
|
|
688
|
-
* Proxy configuration.
|
|
689
|
-
*/
|
|
690
|
-
proxySettings?: ProxySettings;
|
|
691
|
-
/**
|
|
692
|
-
* If the connection should not be reused.
|
|
693
|
-
*/
|
|
694
|
-
disableKeepAlive?: boolean;
|
|
695
|
-
/**
|
|
696
|
-
* Used to abort the request later.
|
|
697
|
-
*/
|
|
698
|
-
abortSignal?: AbortSignalLike;
|
|
699
|
-
/**
|
|
700
|
-
* Tracing options to use for any created Spans.
|
|
701
|
-
*/
|
|
702
|
-
tracingOptions?: OperationTracingOptions;
|
|
703
|
-
/**
|
|
704
|
-
* Callback which fires upon upload progress.
|
|
705
|
-
*/
|
|
706
|
-
onUploadProgress?: (progress: TransferProgressEvent) => void;
|
|
707
|
-
/** Callback which fires upon download progress. */
|
|
708
|
-
onDownloadProgress?: (progress: TransferProgressEvent) => void;
|
|
709
|
-
/** Set to true if the request is sent over HTTP instead of HTTPS */
|
|
710
|
-
allowInsecureConnection?: boolean;
|
|
711
|
-
/**
|
|
712
|
-
* NODEJS ONLY
|
|
713
|
-
*
|
|
714
|
-
* A Node-only option to provide a custom `http.Agent`/`https.Agent`.
|
|
715
|
-
* Does nothing when running in the browser.
|
|
716
|
-
*/
|
|
717
|
-
agent?: Agent;
|
|
718
|
-
/**
|
|
719
|
-
* BROWSER ONLY
|
|
720
|
-
*
|
|
721
|
-
* A browser only option to enable browser Streams. If this option is set and a response is a stream
|
|
722
|
-
* the response will have a property `browserStream` instead of `blobBody` which will be undefined.
|
|
723
|
-
*
|
|
724
|
-
* Default value is false
|
|
725
|
-
*/
|
|
726
|
-
enableBrowserStreams?: boolean;
|
|
727
|
-
/** Settings for configuring TLS authentication */
|
|
728
|
-
tlsSettings?: TlsSettings;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Settings to initialize a request.
|
|
733
|
-
* Almost equivalent to Partial<PipelineRequest>, but url is mandatory.
|
|
734
|
-
*/
|
|
735
|
-
export declare interface PipelineRequestOptions {
|
|
736
|
-
/**
|
|
737
|
-
* The URL to make the request to.
|
|
738
|
-
*/
|
|
739
|
-
url: string;
|
|
740
|
-
/**
|
|
741
|
-
* The HTTP method to use when making the request.
|
|
742
|
-
*/
|
|
743
|
-
method?: HttpMethods;
|
|
744
|
-
/**
|
|
745
|
-
* The HTTP headers to use when making the request.
|
|
746
|
-
*/
|
|
747
|
-
headers?: HttpHeaders;
|
|
748
|
-
/**
|
|
749
|
-
* The number of milliseconds a request can take before automatically being terminated.
|
|
750
|
-
* If the request is terminated, an `AbortError` is thrown.
|
|
751
|
-
* Defaults to 0, which disables the timeout.
|
|
752
|
-
*/
|
|
753
|
-
timeout?: number;
|
|
754
|
-
/**
|
|
755
|
-
* If credentials (cookies) should be sent along during an XHR.
|
|
756
|
-
* Defaults to false.
|
|
757
|
-
*/
|
|
758
|
-
withCredentials?: boolean;
|
|
759
|
-
/**
|
|
760
|
-
* A unique identifier for the request. Used for logging and tracing.
|
|
761
|
-
*/
|
|
762
|
-
requestId?: string;
|
|
763
|
-
/**
|
|
764
|
-
* The HTTP body content (if any)
|
|
765
|
-
*/
|
|
766
|
-
body?: RequestBodyType;
|
|
767
|
-
/**
|
|
768
|
-
* Body for a multipart request.
|
|
769
|
-
*/
|
|
770
|
-
multipartBody?: MultipartRequestBody;
|
|
771
|
-
/**
|
|
772
|
-
* To simulate a browser form post
|
|
773
|
-
*/
|
|
774
|
-
formData?: FormDataMap;
|
|
775
|
-
/**
|
|
776
|
-
* A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.
|
|
777
|
-
*/
|
|
778
|
-
streamResponseStatusCodes?: Set<number>;
|
|
779
|
-
/**
|
|
780
|
-
* BROWSER ONLY
|
|
781
|
-
*
|
|
782
|
-
* A browser only option to enable use of the Streams API. If this option is set and streaming is used
|
|
783
|
-
* (see `streamResponseStatusCodes`), the response will have a property `browserStream` instead of
|
|
784
|
-
* `blobBody` which will be undefined.
|
|
785
|
-
*
|
|
786
|
-
* Default value is false
|
|
787
|
-
*/
|
|
788
|
-
enableBrowserStreams?: boolean;
|
|
789
|
-
/**
|
|
790
|
-
* Proxy configuration.
|
|
791
|
-
*/
|
|
792
|
-
proxySettings?: ProxySettings;
|
|
793
|
-
/**
|
|
794
|
-
* If the connection should not be reused.
|
|
795
|
-
*/
|
|
796
|
-
disableKeepAlive?: boolean;
|
|
797
|
-
/**
|
|
798
|
-
* Used to abort the request later.
|
|
799
|
-
*/
|
|
800
|
-
abortSignal?: AbortSignalLike;
|
|
801
|
-
/**
|
|
802
|
-
* Options used to create a span when tracing is enabled.
|
|
803
|
-
*/
|
|
804
|
-
tracingOptions?: OperationTracingOptions;
|
|
805
|
-
/**
|
|
806
|
-
* Callback which fires upon upload progress.
|
|
807
|
-
*/
|
|
808
|
-
onUploadProgress?: (progress: TransferProgressEvent) => void;
|
|
809
|
-
/** Callback which fires upon download progress. */
|
|
810
|
-
onDownloadProgress?: (progress: TransferProgressEvent) => void;
|
|
811
|
-
/** Set to true if the request is sent over HTTP instead of HTTPS */
|
|
812
|
-
allowInsecureConnection?: boolean;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
/**
|
|
816
|
-
* Metadata about a response received by the pipeline.
|
|
817
|
-
*/
|
|
818
|
-
export declare interface PipelineResponse {
|
|
819
|
-
/**
|
|
820
|
-
* The request that generated this response.
|
|
821
|
-
*/
|
|
822
|
-
request: PipelineRequest;
|
|
823
|
-
/**
|
|
824
|
-
* The HTTP status code of the response.
|
|
825
|
-
*/
|
|
826
|
-
status: number;
|
|
827
|
-
/**
|
|
828
|
-
* The HTTP response headers.
|
|
829
|
-
*/
|
|
830
|
-
headers: HttpHeaders;
|
|
831
|
-
/**
|
|
832
|
-
* The response body as text (string format)
|
|
833
|
-
*/
|
|
834
|
-
bodyAsText?: string | null;
|
|
835
|
-
/**
|
|
836
|
-
* BROWSER ONLY
|
|
837
|
-
*
|
|
838
|
-
* The response body as a browser Blob.
|
|
839
|
-
* Always undefined in node.js.
|
|
840
|
-
*/
|
|
841
|
-
blobBody?: Promise<Blob>;
|
|
842
|
-
/**
|
|
843
|
-
* BROWSER ONLY
|
|
844
|
-
*
|
|
845
|
-
* The response body as a browser ReadableStream.
|
|
846
|
-
* Always undefined in node.js.
|
|
847
|
-
*/
|
|
848
|
-
browserStreamBody?: ReadableStream<Uint8Array>;
|
|
849
|
-
/**
|
|
850
|
-
* NODEJS ONLY
|
|
851
|
-
*
|
|
852
|
-
* The response body as a node.js Readable stream.
|
|
853
|
-
* Always undefined in the browser.
|
|
854
|
-
*/
|
|
855
|
-
readableStreamBody?: NodeJS.ReadableStream;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* Options that control how to retry failed requests.
|
|
860
|
-
*/
|
|
861
|
-
export declare interface PipelineRetryOptions {
|
|
862
|
-
/**
|
|
863
|
-
* The maximum number of retry attempts. Defaults to 3.
|
|
864
|
-
*/
|
|
865
|
-
maxRetries?: number;
|
|
866
|
-
/**
|
|
867
|
-
* The amount of delay in milliseconds between retry attempts. Defaults to 1000
|
|
868
|
-
* (1 second). The delay increases exponentially with each retry up to a maximum
|
|
869
|
-
* specified by maxRetryDelayInMs.
|
|
870
|
-
*/
|
|
871
|
-
retryDelayInMs?: number;
|
|
872
|
-
/**
|
|
873
|
-
* The maximum delay in milliseconds allowed before retrying an operation. Defaults
|
|
874
|
-
* to 64000 (64 seconds).
|
|
875
|
-
*/
|
|
876
|
-
maxRetryDelayInMs?: number;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* A policy that allows one to apply proxy settings to all requests.
|
|
881
|
-
* If not passed static settings, they will be retrieved from the HTTPS_PROXY
|
|
882
|
-
* or HTTP_PROXY environment variables.
|
|
883
|
-
* @param proxySettings - ProxySettings to use on each request.
|
|
884
|
-
* @param options - additional settings, for example, custom NO_PROXY patterns
|
|
885
|
-
*/
|
|
886
|
-
export declare function proxyPolicy(proxySettings?: ProxySettings, options?: {
|
|
887
|
-
/** a list of patterns to override those loaded from NO_PROXY environment variable. */
|
|
888
|
-
customNoProxyList?: string[];
|
|
889
|
-
}): PipelinePolicy;
|
|
890
|
-
|
|
891
|
-
/**
|
|
892
|
-
* The programmatic identifier of the proxyPolicy.
|
|
893
|
-
*/
|
|
894
|
-
export declare const proxyPolicyName = "proxyPolicy";
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* Options to configure a proxy for outgoing requests (Node.js only).
|
|
898
|
-
*/
|
|
899
|
-
export declare interface ProxySettings {
|
|
900
|
-
/**
|
|
901
|
-
* The proxy's host address.
|
|
902
|
-
*/
|
|
903
|
-
host: string;
|
|
904
|
-
/**
|
|
905
|
-
* The proxy host's port.
|
|
906
|
-
*/
|
|
907
|
-
port: number;
|
|
908
|
-
/**
|
|
909
|
-
* The user name to authenticate with the proxy, if required.
|
|
910
|
-
*/
|
|
911
|
-
username?: string;
|
|
912
|
-
/**
|
|
913
|
-
* The password to authenticate with the proxy, if required.
|
|
914
|
-
*/
|
|
915
|
-
password?: string;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* An interface compatible with NodeJS's `tls.PxfObject`.
|
|
920
|
-
* We want to avoid publicly re-exporting the actual interface,
|
|
921
|
-
* since it might vary across runtime versions.
|
|
922
|
-
*/
|
|
923
|
-
export declare interface PxfObject {
|
|
924
|
-
/**
|
|
925
|
-
* PFX or PKCS12 encoded private key and certificate chain.
|
|
926
|
-
*/
|
|
927
|
-
buf: string | Buffer;
|
|
928
|
-
/**
|
|
929
|
-
* Optional passphrase.
|
|
930
|
-
*/
|
|
931
|
-
passphrase?: string | undefined;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
/**
|
|
935
|
-
* A HttpHeaders collection represented as a simple JSON object.
|
|
936
|
-
*/
|
|
937
|
-
export declare type RawHttpHeaders = {
|
|
938
|
-
[headerName: string]: string;
|
|
939
|
-
};
|
|
940
|
-
|
|
941
|
-
/**
|
|
942
|
-
* A HttpHeaders collection for input, represented as a simple JSON object.
|
|
943
|
-
*/
|
|
944
|
-
export declare type RawHttpHeadersInput = Record<string, string | number | boolean>;
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* A policy to follow Location headers from the server in order
|
|
948
|
-
* to support server-side redirection.
|
|
949
|
-
* In the browser, this policy is not used.
|
|
950
|
-
* @param options - Options to control policy behavior.
|
|
951
|
-
*/
|
|
952
|
-
export declare function redirectPolicy(options?: RedirectPolicyOptions): PipelinePolicy;
|
|
953
|
-
|
|
954
|
-
/**
|
|
955
|
-
* The programmatic identifier of the redirectPolicy.
|
|
956
|
-
*/
|
|
957
|
-
export declare const redirectPolicyName = "redirectPolicy";
|
|
958
|
-
|
|
959
|
-
/**
|
|
960
|
-
* Options for how redirect responses are handled.
|
|
961
|
-
*/
|
|
962
|
-
export declare interface RedirectPolicyOptions {
|
|
963
|
-
/**
|
|
964
|
-
* The maximum number of times the redirect URL will be tried before
|
|
965
|
-
* failing. Defaults to 20.
|
|
966
|
-
*/
|
|
967
|
-
maxRetries?: number;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
/**
|
|
971
|
-
* Types of bodies supported on the request.
|
|
972
|
-
* NodeJS.ReadableStream and () =\> NodeJS.ReadableStream is Node only.
|
|
973
|
-
* Blob, ReadableStream<Uint8Array>, and () =\> ReadableStream<Uint8Array> are browser only.
|
|
974
|
-
*/
|
|
975
|
-
export declare type RequestBodyType = NodeJS.ReadableStream | (() => NodeJS.ReadableStream) | ReadableStream<Uint8Array> | (() => ReadableStream<Uint8Array>) | Blob | ArrayBuffer | ArrayBufferView | FormData | string | null;
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* A custom error type for failed pipeline requests.
|
|
979
|
-
*/
|
|
980
|
-
export declare class RestError extends Error {
|
|
981
|
-
/**
|
|
982
|
-
* Something went wrong when making the request.
|
|
983
|
-
* This means the actual request failed for some reason,
|
|
984
|
-
* such as a DNS issue or the connection being lost.
|
|
985
|
-
*/
|
|
986
|
-
static readonly REQUEST_SEND_ERROR: string;
|
|
987
|
-
/**
|
|
988
|
-
* This means that parsing the response from the server failed.
|
|
989
|
-
* It may have been malformed.
|
|
990
|
-
*/
|
|
991
|
-
static readonly PARSE_ERROR: string;
|
|
992
|
-
/**
|
|
993
|
-
* The code of the error itself (use statics on RestError if possible.)
|
|
994
|
-
*/
|
|
995
|
-
code?: string;
|
|
996
|
-
/**
|
|
997
|
-
* The HTTP status code of the request (if applicable.)
|
|
998
|
-
*/
|
|
999
|
-
statusCode?: number;
|
|
1000
|
-
/**
|
|
1001
|
-
* The request that was made.
|
|
1002
|
-
* This property is non-enumerable.
|
|
1003
|
-
*/
|
|
1004
|
-
request?: PipelineRequest;
|
|
1005
|
-
/**
|
|
1006
|
-
* The response received (if any.)
|
|
1007
|
-
* This property is non-enumerable.
|
|
1008
|
-
*/
|
|
1009
|
-
response?: PipelineResponse;
|
|
1010
|
-
/**
|
|
1011
|
-
* Bonus property set by the throw site.
|
|
1012
|
-
*/
|
|
1013
|
-
details?: unknown;
|
|
1014
|
-
constructor(message: string, options?: RestErrorOptions);
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
/**
|
|
1018
|
-
* The options supported by RestError.
|
|
1019
|
-
*/
|
|
1020
|
-
export declare interface RestErrorOptions {
|
|
1021
|
-
/**
|
|
1022
|
-
* The code of the error itself (use statics on RestError if possible.)
|
|
1023
|
-
*/
|
|
1024
|
-
code?: string;
|
|
1025
|
-
/**
|
|
1026
|
-
* The HTTP status code of the request (if applicable.)
|
|
1027
|
-
*/
|
|
1028
|
-
statusCode?: number;
|
|
1029
|
-
/**
|
|
1030
|
-
* The request that was made.
|
|
1031
|
-
*/
|
|
1032
|
-
request?: PipelineRequest;
|
|
1033
|
-
/**
|
|
1034
|
-
* The response received (if any.)
|
|
1035
|
-
*/
|
|
1036
|
-
response?: PipelineResponse;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* Information provided to the retry strategy about the current progress of the retry policy.
|
|
1041
|
-
*/
|
|
1042
|
-
export declare interface RetryInformation {
|
|
1043
|
-
/**
|
|
1044
|
-
* A {@link PipelineResponse}, if the last retry attempt succeeded.
|
|
1045
|
-
*/
|
|
1046
|
-
response?: PipelineResponse;
|
|
1047
|
-
/**
|
|
1048
|
-
* A {@link RestError}, if the last retry attempt failed.
|
|
1049
|
-
*/
|
|
1050
|
-
responseError?: RestError;
|
|
1051
|
-
/**
|
|
1052
|
-
* Total number of retries so far.
|
|
1053
|
-
*/
|
|
1054
|
-
retryCount: number;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
/**
|
|
1058
|
-
* Properties that can modify the behavior of the retry policy.
|
|
1059
|
-
*/
|
|
1060
|
-
export declare interface RetryModifiers {
|
|
1061
|
-
/**
|
|
1062
|
-
* If true, allows skipping the current strategy from running on the retry policy.
|
|
1063
|
-
*/
|
|
1064
|
-
skipStrategy?: boolean;
|
|
1065
|
-
/**
|
|
1066
|
-
* Indicates to retry against this URL.
|
|
1067
|
-
*/
|
|
1068
|
-
redirectTo?: string;
|
|
1069
|
-
/**
|
|
1070
|
-
* Controls whether to retry in a given number of milliseconds.
|
|
1071
|
-
* If provided, a new retry will be attempted.
|
|
1072
|
-
*/
|
|
1073
|
-
retryAfterInMs?: number;
|
|
1074
|
-
/**
|
|
1075
|
-
* Indicates to throw this error instead of retrying.
|
|
1076
|
-
*/
|
|
1077
|
-
errorToThrow?: RestError;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
/**
|
|
1081
|
-
* retryPolicy is a generic policy to enable retrying requests when certain conditions are met
|
|
1082
|
-
*/
|
|
1083
|
-
export declare function retryPolicy(strategies: RetryStrategy[], options?: RetryPolicyOptions): PipelinePolicy;
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
* Options to the {@link retryPolicy}
|
|
1087
|
-
*/
|
|
1088
|
-
export declare interface RetryPolicyOptions {
|
|
1089
|
-
/**
|
|
1090
|
-
* Maximum number of retries. If not specified, it will limit to 3 retries.
|
|
1091
|
-
*/
|
|
1092
|
-
maxRetries?: number;
|
|
1093
|
-
/**
|
|
1094
|
-
* Logger. If it's not provided, a default logger is used.
|
|
1095
|
-
*/
|
|
1096
|
-
logger?: AzureLogger;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* A retry strategy is intended to define whether to retry or not, and how to retry.
|
|
1101
|
-
*/
|
|
1102
|
-
export declare interface RetryStrategy {
|
|
1103
|
-
/**
|
|
1104
|
-
* Name of the retry strategy. Used for logging.
|
|
1105
|
-
*/
|
|
1106
|
-
name: string;
|
|
1107
|
-
/**
|
|
1108
|
-
* Logger. If it's not provided, a default logger for all retry strategies is used.
|
|
1109
|
-
*/
|
|
1110
|
-
logger?: AzureLogger;
|
|
1111
|
-
/**
|
|
1112
|
-
* Function that determines how to proceed with the subsequent requests.
|
|
1113
|
-
* @param state - Retry state
|
|
1114
|
-
*/
|
|
1115
|
-
retry(state: RetryInformation): RetryModifiers;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
/**
|
|
1119
|
-
* A simple interface for making a pipeline request and receiving a response.
|
|
1120
|
-
*/
|
|
1121
|
-
export declare type SendRequest = (request: PipelineRequest) => Promise<PipelineResponse>;
|
|
1122
|
-
|
|
1123
|
-
/**
|
|
1124
|
-
* Each PipelineRequest gets a unique id upon creation.
|
|
1125
|
-
* This policy passes that unique id along via an HTTP header to enable better
|
|
1126
|
-
* telemetry and tracing.
|
|
1127
|
-
* @param requestIdHeaderName - The name of the header to pass the request ID to.
|
|
1128
|
-
*/
|
|
1129
|
-
export declare function setClientRequestIdPolicy(requestIdHeaderName?: string): PipelinePolicy;
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* The programmatic identifier of the setClientRequestIdPolicy.
|
|
1133
|
-
*/
|
|
1134
|
-
export declare const setClientRequestIdPolicyName = "setClientRequestIdPolicy";
|
|
1135
|
-
|
|
1136
|
-
/**
|
|
1137
|
-
* A retry policy that specifically seeks to handle errors in the
|
|
1138
|
-
* underlying transport layer (e.g. DNS lookup failures) rather than
|
|
1139
|
-
* retryable error codes from the server itself.
|
|
1140
|
-
* @param options - Options that customize the policy.
|
|
1141
|
-
*/
|
|
1142
|
-
export declare function systemErrorRetryPolicy(options?: SystemErrorRetryPolicyOptions): PipelinePolicy;
|
|
1143
|
-
|
|
1144
|
-
/**
|
|
1145
|
-
* Name of the {@link systemErrorRetryPolicy}
|
|
1146
|
-
*/
|
|
1147
|
-
export declare const systemErrorRetryPolicyName = "systemErrorRetryPolicy";
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* Options that control how to retry failed requests.
|
|
1151
|
-
*/
|
|
1152
|
-
export declare interface SystemErrorRetryPolicyOptions {
|
|
1153
|
-
/**
|
|
1154
|
-
* The maximum number of retry attempts. Defaults to 3.
|
|
1155
|
-
*/
|
|
1156
|
-
maxRetries?: number;
|
|
1157
|
-
/**
|
|
1158
|
-
* The amount of delay in milliseconds between retry attempts. Defaults to 1000
|
|
1159
|
-
* (1 second.) The delay increases exponentially with each retry up to a maximum
|
|
1160
|
-
* specified by maxRetryDelayInMs.
|
|
1161
|
-
*/
|
|
1162
|
-
retryDelayInMs?: number;
|
|
1163
|
-
/**
|
|
1164
|
-
* The maximum delay in milliseconds allowed before retrying an operation. Defaults
|
|
1165
|
-
* to 64000 (64 seconds).
|
|
1166
|
-
*/
|
|
1167
|
-
maxRetryDelayInMs?: number;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1171
|
-
* Defines options that are used to configure common telemetry and tracing info
|
|
1172
|
-
*/
|
|
1173
|
-
export declare interface TelemetryOptions {
|
|
1174
|
-
/**
|
|
1175
|
-
* The name of the header to pass the request ID to.
|
|
1176
|
-
*/
|
|
1177
|
-
clientRequestIdHeaderName?: string;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
/**
|
|
1181
|
-
* A policy that retries when the server sends a 429 response with a Retry-After header.
|
|
1182
|
-
*
|
|
1183
|
-
* To learn more, please refer to
|
|
1184
|
-
* https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits,
|
|
1185
|
-
* https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and
|
|
1186
|
-
* https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors
|
|
1187
|
-
*
|
|
1188
|
-
* @param options - Options that configure retry logic.
|
|
1189
|
-
*/
|
|
1190
|
-
export declare function throttlingRetryPolicy(options?: ThrottlingRetryPolicyOptions): PipelinePolicy;
|
|
1191
|
-
|
|
1192
|
-
/**
|
|
1193
|
-
* Name of the {@link throttlingRetryPolicy}
|
|
1194
|
-
*/
|
|
1195
|
-
export declare const throttlingRetryPolicyName = "throttlingRetryPolicy";
|
|
1196
|
-
|
|
1197
|
-
/**
|
|
1198
|
-
* Options that control how to retry failed requests.
|
|
1199
|
-
*/
|
|
1200
|
-
export declare interface ThrottlingRetryPolicyOptions {
|
|
1201
|
-
/**
|
|
1202
|
-
* The maximum number of retry attempts. Defaults to 3.
|
|
1203
|
-
*/
|
|
1204
|
-
maxRetries?: number;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
/**
|
|
1208
|
-
* Gets a pipeline policy that adds the client certificate to the HttpClient agent for authentication.
|
|
1209
|
-
*/
|
|
1210
|
-
export declare function tlsPolicy(tlsSettings?: TlsSettings): PipelinePolicy;
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* Name of the TLS Policy
|
|
1214
|
-
*/
|
|
1215
|
-
export declare const tlsPolicyName = "tlsPolicy";
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
* Represents a certificate for TLS authentication.
|
|
1219
|
-
*/
|
|
1220
|
-
export declare interface TlsSettings {
|
|
1221
|
-
/**
|
|
1222
|
-
* Optionally override the trusted CA certificates. Default is to trust
|
|
1223
|
-
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
1224
|
-
* replaced when CAs are explicitly specified using this option.
|
|
1225
|
-
*/
|
|
1226
|
-
ca?: string | Buffer | Array<string | Buffer> | undefined;
|
|
1227
|
-
/**
|
|
1228
|
-
* Cert chains in PEM format. One cert chain should be provided per
|
|
1229
|
-
* private key. Each cert chain should consist of the PEM formatted
|
|
1230
|
-
* certificate for a provided private key, followed by the PEM
|
|
1231
|
-
* formatted intermediate certificates (if any), in order, and not
|
|
1232
|
-
* including the root CA (the root CA must be pre-known to the peer,
|
|
1233
|
-
* see ca). When providing multiple cert chains, they do not have to
|
|
1234
|
-
* be in the same order as their private keys in key. If the
|
|
1235
|
-
* intermediate certificates are not provided, the peer will not be
|
|
1236
|
-
* able to validate the certificate, and the handshake will fail.
|
|
1237
|
-
*/
|
|
1238
|
-
cert?: string | Buffer | Array<string | Buffer> | undefined;
|
|
1239
|
-
/**
|
|
1240
|
-
* Private keys in PEM format. PEM allows the option of private keys
|
|
1241
|
-
* being encrypted. Encrypted keys will be decrypted with
|
|
1242
|
-
* options.passphrase. Multiple keys using different algorithms can be
|
|
1243
|
-
* provided either as an array of unencrypted key strings or buffers,
|
|
1244
|
-
* or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.
|
|
1245
|
-
* The object form can only occur in an array.object.passphrase is optional.
|
|
1246
|
-
* Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.
|
|
1247
|
-
*/
|
|
1248
|
-
key?: string | Buffer | Array<Buffer | KeyObject> | undefined;
|
|
1249
|
-
/**
|
|
1250
|
-
* Shared passphrase used for a single private key and/or a PFX.
|
|
1251
|
-
*/
|
|
1252
|
-
passphrase?: string | undefined;
|
|
1253
|
-
/**
|
|
1254
|
-
* PFX or PKCS12 encoded private key and certificate chain. pfx is an
|
|
1255
|
-
* alternative to providing key and cert individually. PFX is usually
|
|
1256
|
-
* encrypted, if it is, passphrase will be used to decrypt it. Multiple
|
|
1257
|
-
* PFX can be provided either as an array of unencrypted PFX buffers,
|
|
1258
|
-
* or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.
|
|
1259
|
-
* The object form can only occur in an array.object.passphrase is optional.
|
|
1260
|
-
* Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.
|
|
1261
|
-
*/
|
|
1262
|
-
pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* A simple policy to create OpenTelemetry Spans for each request made by the pipeline
|
|
1267
|
-
* that has SpanOptions with a parent.
|
|
1268
|
-
* Requests made without a parent Span will not be recorded.
|
|
1269
|
-
* @param options - Options to configure the telemetry logged by the tracing policy.
|
|
1270
|
-
*/
|
|
1271
|
-
export declare function tracingPolicy(options?: TracingPolicyOptions): PipelinePolicy;
|
|
1272
|
-
|
|
1273
|
-
/**
|
|
1274
|
-
* The programmatic identifier of the tracingPolicy.
|
|
1275
|
-
*/
|
|
1276
|
-
export declare const tracingPolicyName = "tracingPolicy";
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* Options to configure the tracing policy.
|
|
1280
|
-
*/
|
|
1281
|
-
export declare interface TracingPolicyOptions {
|
|
1282
|
-
/**
|
|
1283
|
-
* String prefix to add to the user agent logged as metadata
|
|
1284
|
-
* on the generated Span.
|
|
1285
|
-
* Defaults to an empty string.
|
|
1286
|
-
*/
|
|
1287
|
-
userAgentPrefix?: string;
|
|
1288
|
-
/**
|
|
1289
|
-
* Query string names whose values will be logged when logging is enabled. By default no
|
|
1290
|
-
* query string values are logged.
|
|
1291
|
-
*/
|
|
1292
|
-
additionalAllowedQueryParameters?: string[];
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
/**
|
|
1296
|
-
* Fired in response to upload or download progress.
|
|
1297
|
-
*/
|
|
1298
|
-
export declare type TransferProgressEvent = {
|
|
1299
|
-
/**
|
|
1300
|
-
* The number of bytes loaded so far.
|
|
1301
|
-
*/
|
|
1302
|
-
loadedBytes: number;
|
|
1303
|
-
};
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
* A policy that sets the User-Agent header (or equivalent) to reflect
|
|
1307
|
-
* the library version.
|
|
1308
|
-
* @param options - Options to customize the user agent value.
|
|
1309
|
-
*/
|
|
1310
|
-
export declare function userAgentPolicy(options?: UserAgentPolicyOptions): PipelinePolicy;
|
|
1311
|
-
|
|
1312
|
-
/**
|
|
1313
|
-
* The programmatic identifier of the userAgentPolicy.
|
|
1314
|
-
*/
|
|
1315
|
-
export declare const userAgentPolicyName = "userAgentPolicy";
|
|
1316
|
-
|
|
1317
|
-
/**
|
|
1318
|
-
* Options for adding user agent details to outgoing requests.
|
|
1319
|
-
*/
|
|
1320
|
-
export declare interface UserAgentPolicyOptions {
|
|
1321
|
-
/**
|
|
1322
|
-
* String prefix to add to the user agent for outgoing requests.
|
|
1323
|
-
* Defaults to an empty string.
|
|
1324
|
-
*/
|
|
1325
|
-
userAgentPrefix?: string;
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
export { }
|