@azure/core-client 1.9.3-alpha.20241120.2 → 1.9.3-alpha.20241127.2
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/package.json
CHANGED
package/dist/core-client.d.ts
DELETED
|
@@ -1,954 +0,0 @@
|
|
|
1
|
-
import type { AbortSignalLike } from '@azure/abort-controller';
|
|
2
|
-
import type { AuthorizeRequestOnChallengeOptions } from '@azure/core-rest-pipeline';
|
|
3
|
-
import type { HttpClient } from '@azure/core-rest-pipeline';
|
|
4
|
-
import type { HttpMethods } from '@azure/core-rest-pipeline';
|
|
5
|
-
import type { InternalPipelineOptions } from '@azure/core-rest-pipeline';
|
|
6
|
-
import type { OperationTracingOptions } from '@azure/core-tracing';
|
|
7
|
-
import type { Pipeline } from '@azure/core-rest-pipeline';
|
|
8
|
-
import type { PipelineOptions } from '@azure/core-rest-pipeline';
|
|
9
|
-
import type { PipelinePolicy } from '@azure/core-rest-pipeline';
|
|
10
|
-
import type { PipelineRequest } from '@azure/core-rest-pipeline';
|
|
11
|
-
import type { PipelineResponse } from '@azure/core-rest-pipeline';
|
|
12
|
-
import type { TokenCredential } from '@azure/core-auth';
|
|
13
|
-
import type { TransferProgressEvent } from '@azure/core-rest-pipeline';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Used to configure additional policies added to the pipeline at construction.
|
|
17
|
-
*/
|
|
18
|
-
export declare interface AdditionalPolicyConfig {
|
|
19
|
-
/**
|
|
20
|
-
* A policy to be added.
|
|
21
|
-
*/
|
|
22
|
-
policy: PipelinePolicy;
|
|
23
|
-
/**
|
|
24
|
-
* Determines if this policy be applied before or after retry logic.
|
|
25
|
-
* Only use `perRetry` if you need to modify the request again
|
|
26
|
-
* each time the operation is retried due to retryable service
|
|
27
|
-
* issues.
|
|
28
|
-
*/
|
|
29
|
-
position: "perCall" | "perRetry";
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* This function can be used as a callback for the `bearerTokenAuthenticationPolicy` of `@azure/core-rest-pipeline`, to support CAE challenges:
|
|
34
|
-
* [Continuous Access Evaluation](https://docs.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation).
|
|
35
|
-
*
|
|
36
|
-
* Call the `bearerTokenAuthenticationPolicy` with the following options:
|
|
37
|
-
*
|
|
38
|
-
* ```ts snippet:authorize_request_on_claim_challenge
|
|
39
|
-
* import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
40
|
-
* import { authorizeRequestOnClaimChallenge } from "@azure/core-client";
|
|
41
|
-
*
|
|
42
|
-
* const policy = bearerTokenAuthenticationPolicy({
|
|
43
|
-
* challengeCallbacks: {
|
|
44
|
-
* authorizeRequestOnChallenge: authorizeRequestOnClaimChallenge,
|
|
45
|
-
* },
|
|
46
|
-
* scopes: ["https://service/.default"],
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* Once provided, the `bearerTokenAuthenticationPolicy` policy will internally handle Continuous Access Evaluation (CAE) challenges.
|
|
51
|
-
* When it can't complete a challenge it will return the 401 (unauthorized) response from ARM.
|
|
52
|
-
*
|
|
53
|
-
* Example challenge with claims:
|
|
54
|
-
*
|
|
55
|
-
* ```
|
|
56
|
-
* Bearer authorization_uri="https://login.windows-ppe.net/", error="invalid_token",
|
|
57
|
-
* error_description="User session has been revoked",
|
|
58
|
-
* claims="eyJhY2Nlc3NfdG9rZW4iOnsibmJmIjp7ImVzc2VudGlhbCI6dHJ1ZSwgInZhbHVlIjoiMTYwMzc0MjgwMCJ9fX0="
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export declare function authorizeRequestOnClaimChallenge(onChallengeOptions: AuthorizeRequestOnChallengeOptions): Promise<boolean>;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Defines a callback to handle auth challenge for Storage APIs.
|
|
65
|
-
* This implements the bearer challenge process described here: https://docs.microsoft.com/rest/api/storageservices/authorize-with-azure-active-directory#bearer-challenge
|
|
66
|
-
* Handling has specific features for storage that departs to the general AAD challenge docs.
|
|
67
|
-
**/
|
|
68
|
-
export declare const authorizeRequestOnTenantChallenge: (challengeOptions: AuthorizeRequestOnChallengeOptions) => Promise<boolean>;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The base definition of a mapper. Can be used for XML and plain JavaScript objects.
|
|
72
|
-
*/
|
|
73
|
-
export declare interface BaseMapper {
|
|
74
|
-
/**
|
|
75
|
-
* Name for the xml element
|
|
76
|
-
*/
|
|
77
|
-
xmlName?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Xml element namespace
|
|
80
|
-
*/
|
|
81
|
-
xmlNamespace?: string;
|
|
82
|
-
/**
|
|
83
|
-
* Xml element namespace prefix
|
|
84
|
-
*/
|
|
85
|
-
xmlNamespacePrefix?: string;
|
|
86
|
-
/**
|
|
87
|
-
* Determines if the current property should be serialized as an attribute of the parent xml element
|
|
88
|
-
*/
|
|
89
|
-
xmlIsAttribute?: boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Determines if the current property should be serialized as the inner content of the xml element
|
|
92
|
-
*/
|
|
93
|
-
xmlIsMsText?: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Name for the xml elements when serializing an array
|
|
96
|
-
*/
|
|
97
|
-
xmlElementName?: string;
|
|
98
|
-
/**
|
|
99
|
-
* Whether or not the current property should have a wrapping XML element
|
|
100
|
-
*/
|
|
101
|
-
xmlIsWrapped?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Whether or not the current property is readonly
|
|
104
|
-
*/
|
|
105
|
-
readOnly?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Whether or not the current property is a constant
|
|
108
|
-
*/
|
|
109
|
-
isConstant?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Whether or not the current property is required
|
|
112
|
-
*/
|
|
113
|
-
required?: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Whether or not the current property allows mull as a value
|
|
116
|
-
*/
|
|
117
|
-
nullable?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* The name to use when serializing
|
|
120
|
-
*/
|
|
121
|
-
serializedName?: string;
|
|
122
|
-
/**
|
|
123
|
-
* Type of the mapper
|
|
124
|
-
*/
|
|
125
|
-
type: MapperType;
|
|
126
|
-
/**
|
|
127
|
-
* Default value when one is not explicitly provided
|
|
128
|
-
*/
|
|
129
|
-
defaultValue?: any;
|
|
130
|
-
/**
|
|
131
|
-
* Constraints to test the current value against
|
|
132
|
-
*/
|
|
133
|
-
constraints?: MapperConstraints;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The common set of options that high level clients are expected to expose.
|
|
138
|
-
*/
|
|
139
|
-
export declare interface CommonClientOptions extends PipelineOptions {
|
|
140
|
-
/**
|
|
141
|
-
* The HttpClient that will be used to send HTTP requests.
|
|
142
|
-
*/
|
|
143
|
-
httpClient?: HttpClient;
|
|
144
|
-
/**
|
|
145
|
-
* Set to true if the request is sent over HTTP instead of HTTPS
|
|
146
|
-
*/
|
|
147
|
-
allowInsecureConnection?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Additional policies to include in the HTTP pipeline.
|
|
150
|
-
*/
|
|
151
|
-
additionalPolicies?: AdditionalPolicyConfig[];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* A mapper composed of other mappers.
|
|
156
|
-
*/
|
|
157
|
-
export declare interface CompositeMapper extends BaseMapper {
|
|
158
|
-
/**
|
|
159
|
-
* The type descriptor of the `CompositeMapper`.
|
|
160
|
-
*/
|
|
161
|
-
type: CompositeMapperType;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Helps build a mapper that describes how to map a set of properties of an object based on other mappers.
|
|
166
|
-
*
|
|
167
|
-
* Only one of the following properties should be present: `className`, `modelProperties` and `additionalProperties`.
|
|
168
|
-
*/
|
|
169
|
-
export declare interface CompositeMapperType {
|
|
170
|
-
/**
|
|
171
|
-
* Name of the composite mapper type.
|
|
172
|
-
*/
|
|
173
|
-
name: "Composite";
|
|
174
|
-
/**
|
|
175
|
-
* Use `className` to reference another type definition.
|
|
176
|
-
*/
|
|
177
|
-
className?: string;
|
|
178
|
-
/**
|
|
179
|
-
* Use `modelProperties` when the reference to the other type has been resolved.
|
|
180
|
-
*/
|
|
181
|
-
modelProperties?: {
|
|
182
|
-
[propertyName: string]: Mapper;
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Used when a model has `additionalProperties: true`. Allows the generic processing of unnamed model properties on the response object.
|
|
186
|
-
*/
|
|
187
|
-
additionalProperties?: Mapper;
|
|
188
|
-
/**
|
|
189
|
-
* The name of the top-most parent scheme, the one that has no parents.
|
|
190
|
-
*/
|
|
191
|
-
uberParent?: string;
|
|
192
|
-
/**
|
|
193
|
-
* A polymorphic discriminator.
|
|
194
|
-
*/
|
|
195
|
-
polymorphicDiscriminator?: PolymorphicDiscriminator;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Creates a new Pipeline for use with a Service Client.
|
|
200
|
-
* Adds in deserializationPolicy by default.
|
|
201
|
-
* Also adds in bearerTokenAuthenticationPolicy if passed a TokenCredential.
|
|
202
|
-
* @param options - Options to customize the created pipeline.
|
|
203
|
-
*/
|
|
204
|
-
export declare function createClientPipeline(options?: InternalClientPipelineOptions): Pipeline;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Method that creates and returns a Serializer.
|
|
208
|
-
* @param modelMappers - Known models to map
|
|
209
|
-
* @param isXML - If XML should be supported
|
|
210
|
-
*/
|
|
211
|
-
export declare function createSerializer(modelMappers?: {
|
|
212
|
-
[key: string]: any;
|
|
213
|
-
}, isXML?: boolean): Serializer;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* The content-types that will indicate that an operation response should be deserialized in a
|
|
217
|
-
* particular way.
|
|
218
|
-
*/
|
|
219
|
-
export declare interface DeserializationContentTypes {
|
|
220
|
-
/**
|
|
221
|
-
* The content-types that indicate that an operation response should be deserialized as JSON.
|
|
222
|
-
* Defaults to [ "application/json", "text/json" ].
|
|
223
|
-
*/
|
|
224
|
-
json?: string[];
|
|
225
|
-
/**
|
|
226
|
-
* The content-types that indicate that an operation response should be deserialized as XML.
|
|
227
|
-
* Defaults to [ "application/xml", "application/atom+xml" ].
|
|
228
|
-
*/
|
|
229
|
-
xml?: string[];
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* This policy handles parsing out responses according to OperationSpecs on the request.
|
|
234
|
-
*/
|
|
235
|
-
export declare function deserializationPolicy(options?: DeserializationPolicyOptions): PipelinePolicy;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* The programmatic identifier of the deserializationPolicy.
|
|
239
|
-
*/
|
|
240
|
-
export declare const deserializationPolicyName = "deserializationPolicy";
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Options to configure API response deserialization.
|
|
244
|
-
*/
|
|
245
|
-
export declare interface DeserializationPolicyOptions {
|
|
246
|
-
/**
|
|
247
|
-
* Configures the expected content types for the deserialization of
|
|
248
|
-
* JSON and XML response bodies.
|
|
249
|
-
*/
|
|
250
|
-
expectedContentTypes?: DeserializationContentTypes;
|
|
251
|
-
/**
|
|
252
|
-
* A function that is able to parse XML. Required for XML support.
|
|
253
|
-
*/
|
|
254
|
-
parseXML?: (str: string, opts?: XmlOptions) => Promise<any>;
|
|
255
|
-
/**
|
|
256
|
-
* Configures behavior of xml parser and builder.
|
|
257
|
-
*/
|
|
258
|
-
serializerOptions?: SerializerOptions;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* A mapper describing plain JavaScript objects used as key/value pairs.
|
|
263
|
-
*/
|
|
264
|
-
export declare interface DictionaryMapper extends BaseMapper {
|
|
265
|
-
/**
|
|
266
|
-
* The type descriptor of the `DictionaryMapper`.
|
|
267
|
-
*/
|
|
268
|
-
type: DictionaryMapperType;
|
|
269
|
-
/**
|
|
270
|
-
* Optionally, a prefix to add to the header collection.
|
|
271
|
-
*/
|
|
272
|
-
headerCollectionPrefix?: string;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Helps build a mapper that describes how to parse a dictionary of mapped values.
|
|
277
|
-
*/
|
|
278
|
-
export declare interface DictionaryMapperType {
|
|
279
|
-
/**
|
|
280
|
-
* Name of the sequence type mapper.
|
|
281
|
-
*/
|
|
282
|
-
name: "Dictionary";
|
|
283
|
-
/**
|
|
284
|
-
* The mapper to use to map the value of each property in the dictionary.
|
|
285
|
-
*/
|
|
286
|
-
value: Mapper;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* A mapper describing an enum value.
|
|
291
|
-
*/
|
|
292
|
-
export declare interface EnumMapper extends BaseMapper {
|
|
293
|
-
/**
|
|
294
|
-
* The type descriptor of the `EnumMapper`.
|
|
295
|
-
*/
|
|
296
|
-
type: EnumMapperType;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Helps build a mapper that describes how to parse an enum value.
|
|
301
|
-
*/
|
|
302
|
-
export declare interface EnumMapperType {
|
|
303
|
-
/**
|
|
304
|
-
* Name of the enum type mapper.
|
|
305
|
-
*/
|
|
306
|
-
name: "Enum";
|
|
307
|
-
/**
|
|
308
|
-
* Values allowed by this mapper.
|
|
309
|
-
*/
|
|
310
|
-
allowedValues: any[];
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Wrapper object for http request and response. Deserialized object is stored in
|
|
315
|
-
* the `parsedBody` property when the response body is received in JSON or XML.
|
|
316
|
-
*/
|
|
317
|
-
export declare interface FullOperationResponse extends PipelineResponse {
|
|
318
|
-
/**
|
|
319
|
-
* The parsed HTTP response headers.
|
|
320
|
-
*/
|
|
321
|
-
parsedHeaders?: {
|
|
322
|
-
[key: string]: unknown;
|
|
323
|
-
};
|
|
324
|
-
/**
|
|
325
|
-
* The response body as parsed JSON or XML.
|
|
326
|
-
*/
|
|
327
|
-
parsedBody?: any;
|
|
328
|
-
/**
|
|
329
|
-
* The request that generated the response.
|
|
330
|
-
*/
|
|
331
|
-
request: OperationRequest;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Options for creating a Pipeline to use with ServiceClient.
|
|
336
|
-
* Mostly for customizing the auth policy (if using token auth) or
|
|
337
|
-
* the deserialization options when using XML.
|
|
338
|
-
*/
|
|
339
|
-
export declare interface InternalClientPipelineOptions extends InternalPipelineOptions {
|
|
340
|
-
/**
|
|
341
|
-
* Options to customize bearerTokenAuthenticationPolicy.
|
|
342
|
-
*/
|
|
343
|
-
credentialOptions?: {
|
|
344
|
-
credentialScopes: string | string[];
|
|
345
|
-
credential: TokenCredential;
|
|
346
|
-
};
|
|
347
|
-
/**
|
|
348
|
-
* Options to customize deserializationPolicy.
|
|
349
|
-
*/
|
|
350
|
-
deserializationOptions?: DeserializationPolicyOptions;
|
|
351
|
-
/**
|
|
352
|
-
* Options to customize serializationPolicy.
|
|
353
|
-
*/
|
|
354
|
-
serializationOptions?: SerializationPolicyOptions;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Mappers are definitions of the data models used in the library.
|
|
359
|
-
* These data models are part of the Operation or Client definitions in the responses or parameters.
|
|
360
|
-
*/
|
|
361
|
-
export declare type Mapper = BaseMapper | CompositeMapper | SequenceMapper | DictionaryMapper | EnumMapper;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Description of various value constraints such as integer ranges and string regex.
|
|
365
|
-
*/
|
|
366
|
-
export declare interface MapperConstraints {
|
|
367
|
-
/**
|
|
368
|
-
* The value should be less than or equal to the `InclusiveMaximum` value.
|
|
369
|
-
*/
|
|
370
|
-
InclusiveMaximum?: number;
|
|
371
|
-
/**
|
|
372
|
-
* The value should be less than the `ExclusiveMaximum` value.
|
|
373
|
-
*/
|
|
374
|
-
ExclusiveMaximum?: number;
|
|
375
|
-
/**
|
|
376
|
-
* The value should be greater than or equal to the `InclusiveMinimum` value.
|
|
377
|
-
*/
|
|
378
|
-
InclusiveMinimum?: number;
|
|
379
|
-
/**
|
|
380
|
-
* The value should be greater than the `InclusiveMinimum` value.
|
|
381
|
-
*/
|
|
382
|
-
ExclusiveMinimum?: number;
|
|
383
|
-
/**
|
|
384
|
-
* The length should be smaller than the `MaxLength`.
|
|
385
|
-
*/
|
|
386
|
-
MaxLength?: number;
|
|
387
|
-
/**
|
|
388
|
-
* The length should be bigger than the `MinLength`.
|
|
389
|
-
*/
|
|
390
|
-
MinLength?: number;
|
|
391
|
-
/**
|
|
392
|
-
* The value must match the pattern.
|
|
393
|
-
*/
|
|
394
|
-
Pattern?: RegExp;
|
|
395
|
-
/**
|
|
396
|
-
* The value must contain fewer items than the MaxItems value.
|
|
397
|
-
*/
|
|
398
|
-
MaxItems?: number;
|
|
399
|
-
/**
|
|
400
|
-
* The value must contain more items than the `MinItems` value.
|
|
401
|
-
*/
|
|
402
|
-
MinItems?: number;
|
|
403
|
-
/**
|
|
404
|
-
* The value must contain only unique items.
|
|
405
|
-
*/
|
|
406
|
-
UniqueItems?: true;
|
|
407
|
-
/**
|
|
408
|
-
* The value should be exactly divisible by the `MultipleOf` value.
|
|
409
|
-
*/
|
|
410
|
-
MultipleOf?: number;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Type of the mapper. Includes known mappers.
|
|
415
|
-
*/
|
|
416
|
-
export declare type MapperType = SimpleMapperType | CompositeMapperType | SequenceMapperType | DictionaryMapperType | EnumMapperType;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Known types of Mappers
|
|
420
|
-
*/
|
|
421
|
-
export declare const MapperTypeNames: {
|
|
422
|
-
readonly Base64Url: "Base64Url";
|
|
423
|
-
readonly Boolean: "Boolean";
|
|
424
|
-
readonly ByteArray: "ByteArray";
|
|
425
|
-
readonly Composite: "Composite";
|
|
426
|
-
readonly Date: "Date";
|
|
427
|
-
readonly DateTime: "DateTime";
|
|
428
|
-
readonly DateTimeRfc1123: "DateTimeRfc1123";
|
|
429
|
-
readonly Dictionary: "Dictionary";
|
|
430
|
-
readonly Enum: "Enum";
|
|
431
|
-
readonly Number: "Number";
|
|
432
|
-
readonly Object: "Object";
|
|
433
|
-
readonly Sequence: "Sequence";
|
|
434
|
-
readonly String: "String";
|
|
435
|
-
readonly Stream: "Stream";
|
|
436
|
-
readonly TimeSpan: "TimeSpan";
|
|
437
|
-
readonly UnixTime: "UnixTime";
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* A collection of properties that apply to a single invocation of an operation.
|
|
442
|
-
*/
|
|
443
|
-
export declare interface OperationArguments {
|
|
444
|
-
/**
|
|
445
|
-
* The parameters that were passed to the operation method.
|
|
446
|
-
*/
|
|
447
|
-
[parameterName: string]: unknown;
|
|
448
|
-
/**
|
|
449
|
-
* The optional arguments that are provided to an operation.
|
|
450
|
-
*/
|
|
451
|
-
options?: OperationOptions;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* The base options type for all operations.
|
|
456
|
-
*/
|
|
457
|
-
export declare interface OperationOptions {
|
|
458
|
-
/**
|
|
459
|
-
* The signal which can be used to abort requests.
|
|
460
|
-
*/
|
|
461
|
-
abortSignal?: AbortSignalLike;
|
|
462
|
-
/**
|
|
463
|
-
* Options used when creating and sending HTTP requests for this operation.
|
|
464
|
-
*/
|
|
465
|
-
requestOptions?: OperationRequestOptions;
|
|
466
|
-
/**
|
|
467
|
-
* Options used when tracing is enabled.
|
|
468
|
-
*/
|
|
469
|
-
tracingOptions?: OperationTracingOptions;
|
|
470
|
-
/**
|
|
471
|
-
* Options to override serialization/de-serialization behavior.
|
|
472
|
-
*/
|
|
473
|
-
serializerOptions?: SerializerOptions;
|
|
474
|
-
/**
|
|
475
|
-
* A function to be called each time a response is received from the server
|
|
476
|
-
* while performing the requested operation.
|
|
477
|
-
* May be called multiple times.
|
|
478
|
-
*/
|
|
479
|
-
onResponse?: RawResponseCallback;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* A common interface that all Operation parameter's extend.
|
|
484
|
-
*/
|
|
485
|
-
export declare interface OperationParameter {
|
|
486
|
-
/**
|
|
487
|
-
* The path to this parameter's value in OperationArguments or the object that contains paths for
|
|
488
|
-
* each property's value in OperationArguments.
|
|
489
|
-
*/
|
|
490
|
-
parameterPath: ParameterPath;
|
|
491
|
-
/**
|
|
492
|
-
* The mapper that defines how to validate and serialize this parameter's value.
|
|
493
|
-
*/
|
|
494
|
-
mapper: Mapper;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* A parameter for an operation that will be added as a query parameter to the operation's HTTP
|
|
499
|
-
* request.
|
|
500
|
-
*/
|
|
501
|
-
export declare interface OperationQueryParameter extends OperationParameter {
|
|
502
|
-
/**
|
|
503
|
-
* Whether or not to skip encoding the query parameter's value before adding it to the URL.
|
|
504
|
-
*/
|
|
505
|
-
skipEncoding?: boolean;
|
|
506
|
-
/**
|
|
507
|
-
* If this query parameter's value is a collection, what type of format should the value be
|
|
508
|
-
* converted to.
|
|
509
|
-
*/
|
|
510
|
-
collectionFormat?: QueryCollectionFormat;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* A type alias for future proofing.
|
|
515
|
-
*/
|
|
516
|
-
export declare type OperationRequest = PipelineRequest;
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Metadata that is used to properly parse a response.
|
|
520
|
-
*/
|
|
521
|
-
export declare interface OperationRequestInfo {
|
|
522
|
-
/**
|
|
523
|
-
* Used to parse the response.
|
|
524
|
-
*/
|
|
525
|
-
operationSpec?: OperationSpec;
|
|
526
|
-
/**
|
|
527
|
-
* Used to encode the request.
|
|
528
|
-
*/
|
|
529
|
-
operationArguments?: OperationArguments;
|
|
530
|
-
/**
|
|
531
|
-
* A function that returns the proper OperationResponseMap for the given OperationSpec and
|
|
532
|
-
* PipelineResponse combination. If this is undefined, then a simple status code lookup will
|
|
533
|
-
* be used.
|
|
534
|
-
*/
|
|
535
|
-
operationResponseGetter?: (operationSpec: OperationSpec, response: PipelineResponse) => undefined | OperationResponseMap;
|
|
536
|
-
/**
|
|
537
|
-
* Whether or not the PipelineResponse should be deserialized. Defaults to true.
|
|
538
|
-
*/
|
|
539
|
-
shouldDeserialize?: boolean | ((response: PipelineResponse) => boolean);
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* Options used when creating and sending HTTP requests for this operation.
|
|
544
|
-
*/
|
|
545
|
-
export declare interface OperationRequestOptions {
|
|
546
|
-
/**
|
|
547
|
-
* User defined custom request headers that
|
|
548
|
-
* will be applied before the request is sent.
|
|
549
|
-
*/
|
|
550
|
-
customHeaders?: {
|
|
551
|
-
[key: string]: string;
|
|
552
|
-
};
|
|
553
|
-
/**
|
|
554
|
-
* The number of milliseconds a request can take before automatically being terminated.
|
|
555
|
-
*/
|
|
556
|
-
timeout?: number;
|
|
557
|
-
/**
|
|
558
|
-
* Callback which fires upon upload progress.
|
|
559
|
-
*/
|
|
560
|
-
onUploadProgress?: (progress: TransferProgressEvent) => void;
|
|
561
|
-
/**
|
|
562
|
-
* Callback which fires upon download progress.
|
|
563
|
-
*/
|
|
564
|
-
onDownloadProgress?: (progress: TransferProgressEvent) => void;
|
|
565
|
-
/**
|
|
566
|
-
* Whether or not the HttpOperationResponse should be deserialized. If this is undefined, then the
|
|
567
|
-
* HttpOperationResponse should be deserialized.
|
|
568
|
-
*/
|
|
569
|
-
shouldDeserialize?: boolean | ((response: PipelineResponse) => boolean);
|
|
570
|
-
/**
|
|
571
|
-
* Set to true if the request is sent over HTTP instead of HTTPS
|
|
572
|
-
*/
|
|
573
|
-
allowInsecureConnection?: boolean;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* An OperationResponse that can be returned from an operation request for a single status code.
|
|
578
|
-
*/
|
|
579
|
-
export declare interface OperationResponseMap {
|
|
580
|
-
/**
|
|
581
|
-
* The mapper that will be used to deserialize the response headers.
|
|
582
|
-
*/
|
|
583
|
-
headersMapper?: Mapper;
|
|
584
|
-
/**
|
|
585
|
-
* The mapper that will be used to deserialize the response body.
|
|
586
|
-
*/
|
|
587
|
-
bodyMapper?: Mapper;
|
|
588
|
-
/**
|
|
589
|
-
* Indicates if this is an error response
|
|
590
|
-
*/
|
|
591
|
-
isError?: boolean;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* A specification that defines an operation.
|
|
596
|
-
*/
|
|
597
|
-
export declare interface OperationSpec {
|
|
598
|
-
/**
|
|
599
|
-
* The serializer to use in this operation.
|
|
600
|
-
*/
|
|
601
|
-
readonly serializer: Serializer;
|
|
602
|
-
/**
|
|
603
|
-
* The HTTP method that should be used by requests for this operation.
|
|
604
|
-
*/
|
|
605
|
-
readonly httpMethod: HttpMethods;
|
|
606
|
-
/**
|
|
607
|
-
* The URL that was provided in the service's specification. This will still have all of the URL
|
|
608
|
-
* template variables in it. If this is not provided when the OperationSpec is created, then it
|
|
609
|
-
* will be populated by a "baseUri" property on the ServiceClient.
|
|
610
|
-
*/
|
|
611
|
-
readonly baseUrl?: string;
|
|
612
|
-
/**
|
|
613
|
-
* The fixed path for this operation's URL. This will still have all of the URL template variables
|
|
614
|
-
* in it.
|
|
615
|
-
*/
|
|
616
|
-
readonly path?: string;
|
|
617
|
-
/**
|
|
618
|
-
* The content type of the request body. This value will be used as the "Content-Type" header if
|
|
619
|
-
* it is provided.
|
|
620
|
-
*/
|
|
621
|
-
readonly contentType?: string;
|
|
622
|
-
/**
|
|
623
|
-
* The media type of the request body.
|
|
624
|
-
* This value can be used to aide in serialization if it is provided.
|
|
625
|
-
*/
|
|
626
|
-
readonly mediaType?: "json" | "xml" | "form" | "binary" | "multipart" | "text" | "unknown" | string;
|
|
627
|
-
/**
|
|
628
|
-
* The parameter that will be used to construct the HTTP request's body.
|
|
629
|
-
*/
|
|
630
|
-
readonly requestBody?: OperationParameter;
|
|
631
|
-
/**
|
|
632
|
-
* Whether or not this operation uses XML request and response bodies.
|
|
633
|
-
*/
|
|
634
|
-
readonly isXML?: boolean;
|
|
635
|
-
/**
|
|
636
|
-
* The parameters to the operation method that will be substituted into the constructed URL.
|
|
637
|
-
*/
|
|
638
|
-
readonly urlParameters?: ReadonlyArray<OperationURLParameter>;
|
|
639
|
-
/**
|
|
640
|
-
* The parameters to the operation method that will be added to the constructed URL's query.
|
|
641
|
-
*/
|
|
642
|
-
readonly queryParameters?: ReadonlyArray<OperationQueryParameter>;
|
|
643
|
-
/**
|
|
644
|
-
* The parameters to the operation method that will be converted to headers on the operation's
|
|
645
|
-
* HTTP request.
|
|
646
|
-
*/
|
|
647
|
-
readonly headerParameters?: ReadonlyArray<OperationParameter>;
|
|
648
|
-
/**
|
|
649
|
-
* The parameters to the operation method that will be used to create a formdata body for the
|
|
650
|
-
* operation's HTTP request.
|
|
651
|
-
*/
|
|
652
|
-
readonly formDataParameters?: ReadonlyArray<OperationParameter>;
|
|
653
|
-
/**
|
|
654
|
-
* The different types of responses that this operation can return based on what status code is
|
|
655
|
-
* returned.
|
|
656
|
-
*/
|
|
657
|
-
readonly responses: {
|
|
658
|
-
[responseCode: string]: OperationResponseMap;
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* A parameter for an operation that will be substituted into the operation's request URL.
|
|
664
|
-
*/
|
|
665
|
-
export declare interface OperationURLParameter extends OperationParameter {
|
|
666
|
-
/**
|
|
667
|
-
* Whether or not to skip encoding the URL parameter's value before adding it to the URL.
|
|
668
|
-
*/
|
|
669
|
-
skipEncoding?: boolean;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Encodes how to reach a particular property on an object.
|
|
674
|
-
*/
|
|
675
|
-
export declare type ParameterPath = string | string[] | {
|
|
676
|
-
[propertyName: string]: ParameterPath;
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* Used to disambiguate discriminated type unions.
|
|
681
|
-
* For example, if response can have many shapes but also includes a 'kind' field (or similar),
|
|
682
|
-
* that field can be used to determine how to deserialize the response to the correct type.
|
|
683
|
-
*/
|
|
684
|
-
export declare interface PolymorphicDiscriminator {
|
|
685
|
-
/**
|
|
686
|
-
* Name of the discriminant property in the original JSON payload, e.g. `@odata.kind`.
|
|
687
|
-
*/
|
|
688
|
-
serializedName: string;
|
|
689
|
-
/**
|
|
690
|
-
* Name to use on the resulting object instead of the original property name.
|
|
691
|
-
* Useful since the JSON property could be difficult to work with.
|
|
692
|
-
* For example: For a field received as `@odata.kind`, the final object could instead include a property simply named `kind`.
|
|
693
|
-
*/
|
|
694
|
-
clientName: string;
|
|
695
|
-
/**
|
|
696
|
-
* It may contain any other property.
|
|
697
|
-
*/
|
|
698
|
-
[key: string]: string;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* The format that will be used to join an array of values together for a query parameter value.
|
|
703
|
-
*/
|
|
704
|
-
export declare type QueryCollectionFormat = "CSV" | "SSV" | "TSV" | "Pipes" | "Multi";
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
* A function to be called each time a response is received from the server
|
|
708
|
-
* while performing the requested operation.
|
|
709
|
-
* May be called multiple times.
|
|
710
|
-
*/
|
|
711
|
-
export declare type RawResponseCallback = (rawResponse: FullOperationResponse, flatResponse: unknown, error?: unknown) => void;
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* A mapper describing arrays.
|
|
715
|
-
*/
|
|
716
|
-
export declare interface SequenceMapper extends BaseMapper {
|
|
717
|
-
/**
|
|
718
|
-
* The type descriptor of the `SequenceMapper`.
|
|
719
|
-
*/
|
|
720
|
-
type: SequenceMapperType;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Helps build a mapper that describes how to parse a sequence of mapped values.
|
|
725
|
-
*/
|
|
726
|
-
export declare interface SequenceMapperType {
|
|
727
|
-
/**
|
|
728
|
-
* Name of the sequence type mapper.
|
|
729
|
-
*/
|
|
730
|
-
name: "Sequence";
|
|
731
|
-
/**
|
|
732
|
-
* The mapper to use to map each one of the properties of the sequence.
|
|
733
|
-
*/
|
|
734
|
-
element: Mapper;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
/**
|
|
738
|
-
* This policy handles assembling the request body and headers using
|
|
739
|
-
* an OperationSpec and OperationArguments on the request.
|
|
740
|
-
*/
|
|
741
|
-
export declare function serializationPolicy(options?: SerializationPolicyOptions): PipelinePolicy;
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* The programmatic identifier of the serializationPolicy.
|
|
745
|
-
*/
|
|
746
|
-
export declare const serializationPolicyName = "serializationPolicy";
|
|
747
|
-
|
|
748
|
-
/**
|
|
749
|
-
* Options to configure API request serialization.
|
|
750
|
-
*/
|
|
751
|
-
export declare interface SerializationPolicyOptions {
|
|
752
|
-
/**
|
|
753
|
-
* A function that is able to write XML. Required for XML support.
|
|
754
|
-
*/
|
|
755
|
-
stringifyXML?: (obj: any, opts?: XmlOptions) => string;
|
|
756
|
-
/**
|
|
757
|
-
* Configures behavior of xml parser and builder.
|
|
758
|
-
*/
|
|
759
|
-
serializerOptions?: SerializerOptions;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
/**
|
|
763
|
-
* Used to map raw response objects to final shapes.
|
|
764
|
-
* Helps packing and unpacking Dates and other encoded types that are not intrinsic to JSON.
|
|
765
|
-
* Also allows pulling values from headers, as well as inserting default values and constants.
|
|
766
|
-
*/
|
|
767
|
-
export declare interface Serializer {
|
|
768
|
-
/**
|
|
769
|
-
* The provided model mapper.
|
|
770
|
-
*/
|
|
771
|
-
readonly modelMappers: {
|
|
772
|
-
[key: string]: any;
|
|
773
|
-
};
|
|
774
|
-
/**
|
|
775
|
-
* Whether the contents are XML or not.
|
|
776
|
-
*/
|
|
777
|
-
readonly isXML: boolean;
|
|
778
|
-
/**
|
|
779
|
-
* Validates constraints, if any. This function will throw if the provided value does not respect those constraints.
|
|
780
|
-
* @param mapper - The definition of data models.
|
|
781
|
-
* @param value - The value.
|
|
782
|
-
* @param objectName - Name of the object. Used in the error messages.
|
|
783
|
-
* @deprecated Removing the constraints validation on client side.
|
|
784
|
-
*/
|
|
785
|
-
validateConstraints(mapper: Mapper, value: any, objectName: string): void;
|
|
786
|
-
/**
|
|
787
|
-
* Serialize the given object based on its metadata defined in the mapper.
|
|
788
|
-
*
|
|
789
|
-
* @param mapper - The mapper which defines the metadata of the serializable object.
|
|
790
|
-
* @param object - A valid Javascript object to be serialized.
|
|
791
|
-
* @param objectName - Name of the serialized object.
|
|
792
|
-
* @param options - additional options to deserialization.
|
|
793
|
-
* @returns A valid serialized Javascript object.
|
|
794
|
-
*/
|
|
795
|
-
serialize(mapper: Mapper, object: any, objectName?: string, options?: SerializerOptions): any;
|
|
796
|
-
/**
|
|
797
|
-
* Deserialize the given object based on its metadata defined in the mapper.
|
|
798
|
-
*
|
|
799
|
-
* @param mapper - The mapper which defines the metadata of the serializable object.
|
|
800
|
-
* @param responseBody - A valid Javascript entity to be deserialized.
|
|
801
|
-
* @param objectName - Name of the deserialized object.
|
|
802
|
-
* @param options - Controls behavior of XML parser and builder.
|
|
803
|
-
* @returns A valid deserialized Javascript object.
|
|
804
|
-
*/
|
|
805
|
-
deserialize(mapper: Mapper, responseBody: any, objectName: string, options?: SerializerOptions): any;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Options to configure serialization/de-serialization behavior.
|
|
810
|
-
*/
|
|
811
|
-
export declare interface SerializerOptions {
|
|
812
|
-
/**
|
|
813
|
-
* Options to configure xml parser/builder behavior.
|
|
814
|
-
*/
|
|
815
|
-
xml: XmlOptions;
|
|
816
|
-
/**
|
|
817
|
-
* Normally additional properties are included in the result object, even if there is no mapper for them.
|
|
818
|
-
* This flag disables this behavior when true. It is used when parsing headers to avoid polluting the result object.
|
|
819
|
-
*/
|
|
820
|
-
ignoreUnknownProperties?: boolean;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* Initializes a new instance of the ServiceClient.
|
|
825
|
-
*/
|
|
826
|
-
export declare class ServiceClient {
|
|
827
|
-
/**
|
|
828
|
-
* If specified, this is the base URI that requests will be made against for this ServiceClient.
|
|
829
|
-
* If it is not specified, then all OperationSpecs must contain a baseUrl property.
|
|
830
|
-
*/
|
|
831
|
-
private readonly _endpoint?;
|
|
832
|
-
/**
|
|
833
|
-
* The default request content type for the service.
|
|
834
|
-
* Used if no requestContentType is present on an OperationSpec.
|
|
835
|
-
*/
|
|
836
|
-
private readonly _requestContentType?;
|
|
837
|
-
/**
|
|
838
|
-
* Set to true if the request is sent over HTTP instead of HTTPS
|
|
839
|
-
*/
|
|
840
|
-
private readonly _allowInsecureConnection?;
|
|
841
|
-
/**
|
|
842
|
-
* The HTTP client that will be used to send requests.
|
|
843
|
-
*/
|
|
844
|
-
private readonly _httpClient;
|
|
845
|
-
/**
|
|
846
|
-
* The pipeline used by this client to make requests
|
|
847
|
-
*/
|
|
848
|
-
readonly pipeline: Pipeline;
|
|
849
|
-
/**
|
|
850
|
-
* The ServiceClient constructor
|
|
851
|
-
* @param options - The service client options that govern the behavior of the client.
|
|
852
|
-
*/
|
|
853
|
-
constructor(options?: ServiceClientOptions);
|
|
854
|
-
/**
|
|
855
|
-
* Send the provided httpRequest.
|
|
856
|
-
*/
|
|
857
|
-
sendRequest(request: PipelineRequest): Promise<PipelineResponse>;
|
|
858
|
-
/**
|
|
859
|
-
* Send an HTTP request that is populated using the provided OperationSpec.
|
|
860
|
-
* @typeParam T - The typed result of the request, based on the OperationSpec.
|
|
861
|
-
* @param operationArguments - The arguments that the HTTP request's templated values will be populated from.
|
|
862
|
-
* @param operationSpec - The OperationSpec to use to populate the httpRequest.
|
|
863
|
-
*/
|
|
864
|
-
sendOperationRequest<T>(operationArguments: OperationArguments, operationSpec: OperationSpec): Promise<T>;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
/**
|
|
868
|
-
* Options to be provided while creating the client.
|
|
869
|
-
*/
|
|
870
|
-
export declare interface ServiceClientOptions extends CommonClientOptions {
|
|
871
|
-
/**
|
|
872
|
-
* If specified, this is the base URI that requests will be made against for this ServiceClient.
|
|
873
|
-
* If it is not specified, then all OperationSpecs must contain a baseUrl property.
|
|
874
|
-
* @deprecated This property is deprecated and will be removed soon, please use endpoint instead
|
|
875
|
-
*/
|
|
876
|
-
baseUri?: string;
|
|
877
|
-
/**
|
|
878
|
-
* If specified, this is the endpoint that requests will be made against for this ServiceClient.
|
|
879
|
-
* If it is not specified, then all OperationSpecs must contain a baseUrl property.
|
|
880
|
-
* to encourage customer to use endpoint, we mark the baseUri as deprecated.
|
|
881
|
-
*/
|
|
882
|
-
endpoint?: string;
|
|
883
|
-
/**
|
|
884
|
-
* If specified, will be used to build the BearerTokenAuthenticationPolicy.
|
|
885
|
-
*/
|
|
886
|
-
credentialScopes?: string | string[];
|
|
887
|
-
/**
|
|
888
|
-
* The default request content type for the service.
|
|
889
|
-
* Used if no requestContentType is present on an OperationSpec.
|
|
890
|
-
*/
|
|
891
|
-
requestContentType?: string;
|
|
892
|
-
/**
|
|
893
|
-
* Credential used to authenticate the request.
|
|
894
|
-
*/
|
|
895
|
-
credential?: TokenCredential;
|
|
896
|
-
/**
|
|
897
|
-
* A customized pipeline to use, otherwise a default one will be created.
|
|
898
|
-
*/
|
|
899
|
-
pipeline?: Pipeline;
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
/**
|
|
903
|
-
* The type of a simple mapper.
|
|
904
|
-
*/
|
|
905
|
-
export declare interface SimpleMapperType {
|
|
906
|
-
/**
|
|
907
|
-
* Name of the type of the property.
|
|
908
|
-
*/
|
|
909
|
-
name: "Base64Url" | "Boolean" | "ByteArray" | "Date" | "DateTime" | "DateTimeRfc1123" | "Object" | "Stream" | "String" | "TimeSpan" | "UnixTime" | "Uuid" | "Number" | "any";
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
* Configuration for creating a new Tracing Span
|
|
914
|
-
*/
|
|
915
|
-
export declare interface SpanConfig {
|
|
916
|
-
/**
|
|
917
|
-
* Package name prefix
|
|
918
|
-
*/
|
|
919
|
-
packagePrefix: string;
|
|
920
|
-
/**
|
|
921
|
-
* Service namespace
|
|
922
|
-
*/
|
|
923
|
-
namespace: string;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
/**
|
|
927
|
-
* Default key used to access the XML attributes.
|
|
928
|
-
*/
|
|
929
|
-
export declare const XML_ATTRKEY = "$";
|
|
930
|
-
|
|
931
|
-
/**
|
|
932
|
-
* Default key used to access the XML value content.
|
|
933
|
-
*/
|
|
934
|
-
export declare const XML_CHARKEY = "_";
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* Options to govern behavior of xml parser and builder.
|
|
938
|
-
*/
|
|
939
|
-
export declare interface XmlOptions {
|
|
940
|
-
/**
|
|
941
|
-
* indicates the name of the root element in the resulting XML when building XML.
|
|
942
|
-
*/
|
|
943
|
-
rootName?: string;
|
|
944
|
-
/**
|
|
945
|
-
* indicates whether the root element is to be included or not in the output when parsing XML.
|
|
946
|
-
*/
|
|
947
|
-
includeRoot?: boolean;
|
|
948
|
-
/**
|
|
949
|
-
* key used to access the XML value content when parsing XML.
|
|
950
|
-
*/
|
|
951
|
-
xmlCharKey?: string;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
export { }
|