@cdk8s/awscdk-resolver 0.0.600 → 0.0.602
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/.jsii +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/auth/httpAuthSchemeProvider.js +9 -15
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/endpoint/bdd.js +2 -5
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/endpoint/endpointResolver.js +7 -11
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +449 -469
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/models/CloudFormationServiceException.js +4 -8
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/models/errors.js +59 -91
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.browser.js +22 -26
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.js +30 -34
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.native.js +4 -7
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.shared.js +20 -24
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/schemas/schemas_0.js +814 -533
- package/node_modules/@aws-sdk/client-cloudformation/package.json +8 -8
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +45 -50
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +2 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +21 -22
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +51 -51
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +21 -22
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +19 -21
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +107 -109
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -4
- package/node_modules/@aws-sdk/core/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +3 -7
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +12 -16
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +16 -21
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +14 -18
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +1 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +2 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +2 -7
- package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +47 -41
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js +8 -4
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +14 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +31 -33
- package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +16 -18
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +22 -24
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BGYXHf8s.js +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +10 -14
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +2 -6
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +3 -27
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +82 -84
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +158 -119
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +80 -82
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +80 -82
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +99 -101
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +70 -35
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +3 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +12 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +3 -0
- package/node_modules/@aws-sdk/nested-clients/package.json +9 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +26 -28
- package/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/types/dist-cjs/index.js +7 -8
- package/node_modules/@aws-sdk/types/package.json +4 -4
- package/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js +0 -2
- package/node_modules/@aws-sdk/util-locate-window/package.json +4 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +2 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +4 -7
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +2 -5
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +7 -10
- package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/index.js +13 -15
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +29 -31
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +2 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +7 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +3 -5
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +22 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +10 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +38 -39
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +10 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +14 -17
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +20 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +9 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -13
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +59 -60
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +23 -24
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +25 -26
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +5 -7
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -6
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +23 -25
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -6
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +2 -4
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +7 -6
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +23 -24
- package/node_modules/@smithy/credential-provider-imds/package.json +6 -6
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +6 -8
- package/node_modules/@smithy/fetch-http-handler/package.json +7 -7
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
- package/node_modules/@smithy/node-http-handler/package.json +7 -7
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +27 -29
- package/node_modules/@smithy/signature-v4/package.json +6 -6
- package/node_modules/@smithy/types/dist-cjs/index.js +23 -18
- package/node_modules/@smithy/types/package.json +4 -4
- package/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js +0 -8
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const { Uint8ArrayBlobAdapter, sdkStreamMixin, splitEvery, splitHeader, fromBase64, _parseEpochTimestamp, _parseRfc7231DateTime, _parseRfc3339DateTimeWithOffset, LazyJsonString, NumericValue, toUtf8, fromUtf8, generateIdempotencyToken, toBase64, dateToUtcString, quoteHeader } = require("@smithy/core/serde");
|
|
2
|
+
const { TypeRegistry, NormalizedSchema, translateTraits } = require("@smithy/core/schema");
|
|
3
|
+
const { HttpRequest, HttpResponse } = require("@smithy/core/transport");
|
|
4
|
+
const { isValidHostname, parseQueryString, parseUrl } = require("@smithy/core/transport");
|
|
5
|
+
exports.HttpRequest = HttpRequest;
|
|
6
|
+
exports.HttpResponse = HttpResponse;
|
|
7
|
+
exports.isValidHostname = isValidHostname;
|
|
8
|
+
exports.parseQueryString = parseQueryString;
|
|
9
|
+
exports.parseUrl = parseUrl;
|
|
10
|
+
const { FieldPosition } = require("@smithy/types");
|
|
7
11
|
|
|
8
12
|
const collectBody = async (streamBody = new Uint8Array(), context) => {
|
|
9
13
|
if (streamBody instanceof Uint8Array) {
|
|
10
|
-
return
|
|
14
|
+
return Uint8ArrayBlobAdapter.mutate(streamBody);
|
|
11
15
|
}
|
|
12
16
|
if (!streamBody) {
|
|
13
|
-
return
|
|
17
|
+
return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
|
|
14
18
|
}
|
|
15
19
|
const fromContext = context.streamCollector(streamBody);
|
|
16
|
-
return
|
|
20
|
+
return Uint8ArrayBlobAdapter.mutate(await fromContext);
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
function extendedEncodeURIComponent(str) {
|
|
@@ -35,16 +39,16 @@ class HttpProtocol extends SerdeContext {
|
|
|
35
39
|
constructor(options) {
|
|
36
40
|
super();
|
|
37
41
|
this.options = options;
|
|
38
|
-
this.compositeErrorRegistry =
|
|
42
|
+
this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace);
|
|
39
43
|
for (const etr of options.errorTypeRegistries ?? []) {
|
|
40
44
|
this.compositeErrorRegistry.copyFrom(etr);
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
getRequestType() {
|
|
44
|
-
return
|
|
48
|
+
return HttpRequest;
|
|
45
49
|
}
|
|
46
50
|
getResponseType() {
|
|
47
|
-
return
|
|
51
|
+
return HttpResponse;
|
|
48
52
|
}
|
|
49
53
|
setSerdeContext(serdeContext) {
|
|
50
54
|
this.serdeContext = serdeContext;
|
|
@@ -96,8 +100,8 @@ class HttpProtocol extends SerdeContext {
|
|
|
96
100
|
if (this.serdeContext?.disableHostPrefix) {
|
|
97
101
|
return;
|
|
98
102
|
}
|
|
99
|
-
const inputNs =
|
|
100
|
-
const opTraits =
|
|
103
|
+
const inputNs = NormalizedSchema.of(operationSchema.input);
|
|
104
|
+
const opTraits = translateTraits(operationSchema.traits ?? {});
|
|
101
105
|
if (opTraits.endpoint) {
|
|
102
106
|
let hostPrefix = opTraits.endpoint?.[0];
|
|
103
107
|
if (typeof hostPrefix === "string") {
|
|
@@ -140,7 +144,7 @@ class HttpProtocol extends SerdeContext {
|
|
|
140
144
|
});
|
|
141
145
|
}
|
|
142
146
|
async loadEventStreamCapability() {
|
|
143
|
-
const { EventStreamSerde } =
|
|
147
|
+
const { EventStreamSerde } = require('@smithy/core/event-streams');
|
|
144
148
|
return new EventStreamSerde({
|
|
145
149
|
marshaller: this.getEventStreamMarshaller(),
|
|
146
150
|
serializer: this.serializer,
|
|
@@ -171,12 +175,12 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
171
175
|
const query = {};
|
|
172
176
|
const headers = {};
|
|
173
177
|
const endpoint = await context.endpoint();
|
|
174
|
-
const ns =
|
|
178
|
+
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
175
179
|
const payloadMemberNames = [];
|
|
176
180
|
const payloadMemberSchemas = [];
|
|
177
181
|
let hasNonHttpBindingMember = false;
|
|
178
182
|
let payload;
|
|
179
|
-
const request = new
|
|
183
|
+
const request = new HttpRequest({
|
|
180
184
|
protocol: "",
|
|
181
185
|
hostname: "",
|
|
182
186
|
port: undefined,
|
|
@@ -189,7 +193,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
189
193
|
if (endpoint) {
|
|
190
194
|
this.updateServiceEndpoint(request, endpoint);
|
|
191
195
|
this.setHostPrefix(request, operationSchema, input);
|
|
192
|
-
const opTraits =
|
|
196
|
+
const opTraits = translateTraits(operationSchema.traits);
|
|
193
197
|
if (opTraits.http) {
|
|
194
198
|
request.method = opTraits.http[0];
|
|
195
199
|
const [path, search] = opTraits.http[1].split("?");
|
|
@@ -331,7 +335,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
331
335
|
}
|
|
332
336
|
async deserializeResponse(operationSchema, context, response) {
|
|
333
337
|
const deserializer = this.deserializer;
|
|
334
|
-
const ns =
|
|
338
|
+
const ns = NormalizedSchema.of(operationSchema.output);
|
|
335
339
|
const dataObject = {};
|
|
336
340
|
if (response.statusCode >= 300) {
|
|
337
341
|
const bytes = await collectBody(response.body, context);
|
|
@@ -364,7 +368,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
364
368
|
dataObject.$metadata = this.deserializeMetadata(response);
|
|
365
369
|
return dataObject;
|
|
366
370
|
}
|
|
367
|
-
async deserializeHttpMessage(schema
|
|
371
|
+
async deserializeHttpMessage(schema, context, response, arg4, arg5) {
|
|
368
372
|
let dataObject;
|
|
369
373
|
if (arg4 instanceof Set) {
|
|
370
374
|
dataObject = arg5;
|
|
@@ -374,7 +378,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
374
378
|
}
|
|
375
379
|
let discardResponseBody = true;
|
|
376
380
|
const deserializer = this.deserializer;
|
|
377
|
-
const ns =
|
|
381
|
+
const ns = NormalizedSchema.of(schema);
|
|
378
382
|
const nonHttpBindingMembers = [];
|
|
379
383
|
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
380
384
|
const memberTraits = memberSchema.getMemberTraits();
|
|
@@ -390,7 +394,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
390
394
|
});
|
|
391
395
|
}
|
|
392
396
|
else {
|
|
393
|
-
dataObject[memberName] =
|
|
397
|
+
dataObject[memberName] = sdkStreamMixin(response.body);
|
|
394
398
|
}
|
|
395
399
|
}
|
|
396
400
|
else if (response.body) {
|
|
@@ -410,10 +414,10 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
410
414
|
let sections;
|
|
411
415
|
if (headerListValueSchema.isTimestampSchema() &&
|
|
412
416
|
headerListValueSchema.getSchema() === 4) {
|
|
413
|
-
sections =
|
|
417
|
+
sections = splitEvery(value, ",", 2);
|
|
414
418
|
}
|
|
415
419
|
else {
|
|
416
|
-
sections =
|
|
420
|
+
sections = splitHeader(value);
|
|
417
421
|
}
|
|
418
422
|
const list = [];
|
|
419
423
|
for (const section of sections) {
|
|
@@ -455,11 +459,11 @@ class RpcProtocol extends HttpProtocol {
|
|
|
455
459
|
const query = {};
|
|
456
460
|
const headers = {};
|
|
457
461
|
const endpoint = await context.endpoint();
|
|
458
|
-
const ns =
|
|
459
|
-
const schema
|
|
462
|
+
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
463
|
+
const schema = ns.getSchema();
|
|
460
464
|
let payload;
|
|
461
465
|
const input = _input && typeof _input === "object" ? _input : {};
|
|
462
|
-
const request = new
|
|
466
|
+
const request = new HttpRequest({
|
|
463
467
|
protocol: "",
|
|
464
468
|
hostname: "",
|
|
465
469
|
port: undefined,
|
|
@@ -492,7 +496,7 @@ class RpcProtocol extends HttpProtocol {
|
|
|
492
496
|
}
|
|
493
497
|
}
|
|
494
498
|
else {
|
|
495
|
-
serializer.write(schema
|
|
499
|
+
serializer.write(schema, input);
|
|
496
500
|
payload = serializer.flush();
|
|
497
501
|
}
|
|
498
502
|
}
|
|
@@ -504,7 +508,7 @@ class RpcProtocol extends HttpProtocol {
|
|
|
504
508
|
}
|
|
505
509
|
async deserializeResponse(operationSchema, context, response) {
|
|
506
510
|
const deserializer = this.deserializer;
|
|
507
|
-
const ns =
|
|
511
|
+
const ns = NormalizedSchema.of(operationSchema.output);
|
|
508
512
|
const dataObject = {};
|
|
509
513
|
if (response.statusCode >= 300) {
|
|
510
514
|
const bytes = await collectBody(response.body, context);
|
|
@@ -580,7 +584,7 @@ class RequestBuilder {
|
|
|
580
584
|
for (const resolvePath of this.resolvePathStack) {
|
|
581
585
|
resolvePath(this.path);
|
|
582
586
|
}
|
|
583
|
-
return new
|
|
587
|
+
return new HttpRequest({
|
|
584
588
|
protocol,
|
|
585
589
|
hostname: this.hostname || hostname,
|
|
586
590
|
port,
|
|
@@ -652,22 +656,22 @@ class FromStringShapeDeserializer extends SerdeContext {
|
|
|
652
656
|
this.settings = settings;
|
|
653
657
|
}
|
|
654
658
|
read(_schema, data) {
|
|
655
|
-
const ns =
|
|
659
|
+
const ns = NormalizedSchema.of(_schema);
|
|
656
660
|
if (ns.isListSchema()) {
|
|
657
|
-
return
|
|
661
|
+
return splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));
|
|
658
662
|
}
|
|
659
663
|
if (ns.isBlobSchema()) {
|
|
660
|
-
return (this.serdeContext?.base64Decoder ??
|
|
664
|
+
return (this.serdeContext?.base64Decoder ?? fromBase64)(data);
|
|
661
665
|
}
|
|
662
666
|
if (ns.isTimestampSchema()) {
|
|
663
667
|
const format = determineTimestampFormat(ns, this.settings);
|
|
664
668
|
switch (format) {
|
|
665
669
|
case 5:
|
|
666
|
-
return
|
|
670
|
+
return _parseRfc3339DateTimeWithOffset(data);
|
|
667
671
|
case 6:
|
|
668
|
-
return
|
|
672
|
+
return _parseRfc7231DateTime(data);
|
|
669
673
|
case 7:
|
|
670
|
-
return
|
|
674
|
+
return _parseEpochTimestamp(data);
|
|
671
675
|
default:
|
|
672
676
|
console.warn("Missing timestamp format, parsing value with Date constructor:", data);
|
|
673
677
|
return new Date(data);
|
|
@@ -682,7 +686,7 @@ class FromStringShapeDeserializer extends SerdeContext {
|
|
|
682
686
|
}
|
|
683
687
|
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
684
688
|
if (isJson) {
|
|
685
|
-
intermediateValue =
|
|
689
|
+
intermediateValue = LazyJsonString.from(intermediateValue);
|
|
686
690
|
}
|
|
687
691
|
return intermediateValue;
|
|
688
692
|
}
|
|
@@ -694,7 +698,7 @@ class FromStringShapeDeserializer extends SerdeContext {
|
|
|
694
698
|
return BigInt(data);
|
|
695
699
|
}
|
|
696
700
|
if (ns.isBigDecimalSchema()) {
|
|
697
|
-
return new
|
|
701
|
+
return new NumericValue(data, "bigDecimal");
|
|
698
702
|
}
|
|
699
703
|
if (ns.isBooleanSchema()) {
|
|
700
704
|
return String(data).toLowerCase() === "true";
|
|
@@ -702,7 +706,7 @@ class FromStringShapeDeserializer extends SerdeContext {
|
|
|
702
706
|
return data;
|
|
703
707
|
}
|
|
704
708
|
base64ToUtf8(base64String) {
|
|
705
|
-
return (this.serdeContext?.utf8Encoder ??
|
|
709
|
+
return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String));
|
|
706
710
|
}
|
|
707
711
|
}
|
|
708
712
|
|
|
@@ -719,16 +723,16 @@ class HttpInterceptingShapeDeserializer extends SerdeContext {
|
|
|
719
723
|
this.codecDeserializer.setSerdeContext(serdeContext);
|
|
720
724
|
this.serdeContext = serdeContext;
|
|
721
725
|
}
|
|
722
|
-
read(schema
|
|
723
|
-
const ns =
|
|
726
|
+
read(schema, data) {
|
|
727
|
+
const ns = NormalizedSchema.of(schema);
|
|
724
728
|
const traits = ns.getMergedTraits();
|
|
725
|
-
const toString = this.serdeContext?.utf8Encoder ??
|
|
729
|
+
const toString = this.serdeContext?.utf8Encoder ?? toUtf8;
|
|
726
730
|
if (traits.httpHeader || traits.httpResponseCode) {
|
|
727
731
|
return this.stringDeserializer.read(ns, toString(data));
|
|
728
732
|
}
|
|
729
733
|
if (traits.httpPayload) {
|
|
730
734
|
if (ns.isBlobSchema()) {
|
|
731
|
-
const toBytes = this.serdeContext?.utf8Decoder ??
|
|
735
|
+
const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8;
|
|
732
736
|
if (typeof data === "string") {
|
|
733
737
|
return toBytes(data);
|
|
734
738
|
}
|
|
@@ -752,8 +756,8 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
752
756
|
super();
|
|
753
757
|
this.settings = settings;
|
|
754
758
|
}
|
|
755
|
-
write(schema
|
|
756
|
-
const ns =
|
|
759
|
+
write(schema, value) {
|
|
760
|
+
const ns = NormalizedSchema.of(schema);
|
|
757
761
|
switch (typeof value) {
|
|
758
762
|
case "object":
|
|
759
763
|
if (value === null) {
|
|
@@ -770,7 +774,7 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
770
774
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
771
775
|
break;
|
|
772
776
|
case 6:
|
|
773
|
-
this.stringBuffer =
|
|
777
|
+
this.stringBuffer = dateToUtcString(value);
|
|
774
778
|
break;
|
|
775
779
|
case 7:
|
|
776
780
|
this.stringBuffer = String(value.getTime() / 1000);
|
|
@@ -782,7 +786,7 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
782
786
|
return;
|
|
783
787
|
}
|
|
784
788
|
if (ns.isBlobSchema() && "byteLength" in value) {
|
|
785
|
-
this.stringBuffer = (this.serdeContext?.base64Encoder ??
|
|
789
|
+
this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
786
790
|
return;
|
|
787
791
|
}
|
|
788
792
|
if (ns.isListSchema() && Array.isArray(value)) {
|
|
@@ -790,7 +794,7 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
790
794
|
for (const item of value) {
|
|
791
795
|
this.write([ns.getValueSchema(), ns.getMergedTraits()], item);
|
|
792
796
|
const headerItem = this.flush();
|
|
793
|
-
const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem :
|
|
797
|
+
const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem);
|
|
794
798
|
if (buffer !== "") {
|
|
795
799
|
buffer += ", ";
|
|
796
800
|
}
|
|
@@ -807,10 +811,10 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
807
811
|
if (mediaType) {
|
|
808
812
|
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
809
813
|
if (isJson) {
|
|
810
|
-
intermediateValue =
|
|
814
|
+
intermediateValue = LazyJsonString.from(intermediateValue);
|
|
811
815
|
}
|
|
812
816
|
if (ns.getMergedTraits().httpHeader) {
|
|
813
|
-
this.stringBuffer = (this.serdeContext?.base64Encoder ??
|
|
817
|
+
this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString());
|
|
814
818
|
return;
|
|
815
819
|
}
|
|
816
820
|
}
|
|
@@ -818,7 +822,7 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
818
822
|
break;
|
|
819
823
|
default:
|
|
820
824
|
if (ns.isIdempotencyToken()) {
|
|
821
|
-
this.stringBuffer =
|
|
825
|
+
this.stringBuffer = generateIdempotencyToken();
|
|
822
826
|
}
|
|
823
827
|
else {
|
|
824
828
|
this.stringBuffer = String(value);
|
|
@@ -844,8 +848,8 @@ class HttpInterceptingShapeSerializer {
|
|
|
844
848
|
this.codecSerializer.setSerdeContext(serdeContext);
|
|
845
849
|
this.stringSerializer.setSerdeContext(serdeContext);
|
|
846
850
|
}
|
|
847
|
-
write(schema
|
|
848
|
-
const ns =
|
|
851
|
+
write(schema, value) {
|
|
852
|
+
const ns = NormalizedSchema.of(schema);
|
|
849
853
|
const traits = ns.getMergedTraits();
|
|
850
854
|
if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {
|
|
851
855
|
this.stringSerializer.write(ns, value);
|
|
@@ -868,7 +872,7 @@ class Field {
|
|
|
868
872
|
name;
|
|
869
873
|
kind;
|
|
870
874
|
values;
|
|
871
|
-
constructor({ name, kind =
|
|
875
|
+
constructor({ name, kind = FieldPosition.HEADER, values = [] }) {
|
|
872
876
|
this.name = name;
|
|
873
877
|
this.kind = kind;
|
|
874
878
|
this.values = values;
|
|
@@ -937,7 +941,7 @@ const CONTENT_LENGTH_HEADER = "content-length";
|
|
|
937
941
|
function contentLengthMiddleware(bodyLengthChecker) {
|
|
938
942
|
return (next) => async (args) => {
|
|
939
943
|
const request = args.request;
|
|
940
|
-
if (
|
|
944
|
+
if (HttpRequest.isInstance(request)) {
|
|
941
945
|
const { body, headers } = request;
|
|
942
946
|
if (body &&
|
|
943
947
|
Object.keys(headers)
|
|
@@ -998,11 +1002,6 @@ function buildQueryString(query) {
|
|
|
998
1002
|
return parts.join("&");
|
|
999
1003
|
}
|
|
1000
1004
|
|
|
1001
|
-
exports.HttpRequest = transport.HttpRequest;
|
|
1002
|
-
exports.HttpResponse = transport.HttpResponse;
|
|
1003
|
-
exports.isValidHostname = transport.isValidHostname;
|
|
1004
|
-
exports.parseQueryString = transport.parseQueryString;
|
|
1005
|
-
exports.parseUrl = transport.parseUrl;
|
|
1006
1005
|
exports.Field = Field;
|
|
1007
1006
|
exports.Fields = Fields;
|
|
1008
1007
|
exports.FromStringShapeDeserializer = FromStringShapeDeserializer;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var protocols = require('@smithy/core/protocols');
|
|
5
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { NoOpLogger, normalizeProvider } = require("@smithy/core/client");
|
|
2
|
+
const { HttpResponse, HttpRequest } = require("@smithy/core/protocols");
|
|
3
|
+
const { parseRfc7231DateTime, v4 } = require("@smithy/core/serde");
|
|
6
4
|
|
|
7
5
|
const isStreamingPayload = (request) => request?.body instanceof ReadableStream;
|
|
8
6
|
|
|
@@ -90,7 +88,7 @@ const INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
|
|
|
90
88
|
const REQUEST_HEADER = "amz-sdk-request";
|
|
91
89
|
|
|
92
90
|
function parseRetryAfterHeader(response, logger) {
|
|
93
|
-
if (!
|
|
91
|
+
if (!HttpResponse.isInstance(response)) {
|
|
94
92
|
return;
|
|
95
93
|
}
|
|
96
94
|
for (const header of Object.keys(response.headers)) {
|
|
@@ -100,7 +98,7 @@ function parseRetryAfterHeader(response, logger) {
|
|
|
100
98
|
let retryAfterSeconds = NaN;
|
|
101
99
|
if (retryAfter.endsWith("GMT")) {
|
|
102
100
|
try {
|
|
103
|
-
const date =
|
|
101
|
+
const date = parseRfc7231DateTime(retryAfter);
|
|
104
102
|
retryAfterSeconds = (date.getTime() - Date.now()) / 1000;
|
|
105
103
|
}
|
|
106
104
|
catch (e) {
|
|
@@ -158,9 +156,9 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
158
156
|
let attempts = 0;
|
|
159
157
|
let totalRetryDelay = 0;
|
|
160
158
|
const { request } = args;
|
|
161
|
-
const isRequest =
|
|
159
|
+
const isRequest = HttpRequest.isInstance(request);
|
|
162
160
|
if (isRequest) {
|
|
163
|
-
request.headers[INVOCATION_ID_HEADER] =
|
|
161
|
+
request.headers[INVOCATION_ID_HEADER] = v4();
|
|
164
162
|
}
|
|
165
163
|
while (true) {
|
|
166
164
|
try {
|
|
@@ -177,7 +175,7 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
177
175
|
const retryErrorInfo = getRetryErrorInfo(e, options.logger);
|
|
178
176
|
lastError = asSdkError(e);
|
|
179
177
|
if (isRequest && isStreamingPayload(request)) {
|
|
180
|
-
(context.logger instanceof
|
|
178
|
+
(context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
|
|
181
179
|
throw lastError;
|
|
182
180
|
}
|
|
183
181
|
try {
|
|
@@ -420,13 +418,13 @@ class DefaultRetryToken {
|
|
|
420
418
|
}
|
|
421
419
|
}
|
|
422
420
|
|
|
423
|
-
|
|
421
|
+
var RETRY_MODES;
|
|
424
422
|
(function (RETRY_MODES) {
|
|
425
423
|
RETRY_MODES["STANDARD"] = "standard";
|
|
426
424
|
RETRY_MODES["ADAPTIVE"] = "adaptive";
|
|
427
|
-
})(
|
|
425
|
+
})(RETRY_MODES || (RETRY_MODES = {}));
|
|
428
426
|
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
429
|
-
const DEFAULT_RETRY_MODE =
|
|
427
|
+
const DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
|
|
430
428
|
|
|
431
429
|
const refusal = {
|
|
432
430
|
incompatible: 1,
|
|
@@ -434,7 +432,7 @@ const refusal = {
|
|
|
434
432
|
capacity: 3,
|
|
435
433
|
};
|
|
436
434
|
let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
437
|
-
mode =
|
|
435
|
+
mode = RETRY_MODES.STANDARD;
|
|
438
436
|
retryBackoffStrategy;
|
|
439
437
|
capacity = INITIAL_RETRY_TOKENS;
|
|
440
438
|
maxAttemptsProvider;
|
|
@@ -522,7 +520,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
522
520
|
};
|
|
523
521
|
|
|
524
522
|
let AdaptiveRetryStrategy$1 = class AdaptiveRetryStrategy {
|
|
525
|
-
mode =
|
|
523
|
+
mode = RETRY_MODES.ADAPTIVE;
|
|
526
524
|
rateLimiter;
|
|
527
525
|
standardRetryStrategy;
|
|
528
526
|
constructor(maxAttemptsProvider, options) {
|
|
@@ -613,7 +611,7 @@ class StandardRetryStrategy {
|
|
|
613
611
|
retryDecider;
|
|
614
612
|
delayDecider;
|
|
615
613
|
retryQuota;
|
|
616
|
-
mode =
|
|
614
|
+
mode = RETRY_MODES.STANDARD;
|
|
617
615
|
constructor(maxAttemptsProvider, options) {
|
|
618
616
|
this.maxAttemptsProvider = maxAttemptsProvider;
|
|
619
617
|
this.retryDecider = options?.retryDecider ?? defaultRetryDecider;
|
|
@@ -639,12 +637,12 @@ class StandardRetryStrategy {
|
|
|
639
637
|
let totalDelay = 0;
|
|
640
638
|
const maxAttempts = await this.getMaxAttempts();
|
|
641
639
|
const { request } = args;
|
|
642
|
-
if (
|
|
643
|
-
request.headers[INVOCATION_ID_HEADER] =
|
|
640
|
+
if (HttpRequest.isInstance(request)) {
|
|
641
|
+
request.headers[INVOCATION_ID_HEADER] = v4();
|
|
644
642
|
}
|
|
645
643
|
while (true) {
|
|
646
644
|
try {
|
|
647
|
-
if (
|
|
645
|
+
if (HttpRequest.isInstance(request)) {
|
|
648
646
|
request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
|
|
649
647
|
}
|
|
650
648
|
if (options?.beforeRequest) {
|
|
@@ -682,7 +680,7 @@ class StandardRetryStrategy {
|
|
|
682
680
|
}
|
|
683
681
|
}
|
|
684
682
|
const getDelayFromRetryAfterHeader = (response) => {
|
|
685
|
-
if (!
|
|
683
|
+
if (!HttpResponse.isInstance(response))
|
|
686
684
|
return;
|
|
687
685
|
const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
|
|
688
686
|
if (!retryAfterHeaderName)
|
|
@@ -701,7 +699,7 @@ class AdaptiveRetryStrategy extends StandardRetryStrategy {
|
|
|
701
699
|
const { rateLimiter, ...superOptions } = options ?? {};
|
|
702
700
|
super(maxAttemptsProvider, superOptions);
|
|
703
701
|
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
|
|
704
|
-
this.mode =
|
|
702
|
+
this.mode = RETRY_MODES.ADAPTIVE;
|
|
705
703
|
}
|
|
706
704
|
async retry(next, args) {
|
|
707
705
|
return super.retry(next, args, {
|
|
@@ -718,13 +716,13 @@ class AdaptiveRetryStrategy extends StandardRetryStrategy {
|
|
|
718
716
|
const resolveRetryConfig = (input, defaults) => {
|
|
719
717
|
const { retryStrategy, retryMode } = input;
|
|
720
718
|
const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
|
|
721
|
-
const maxAttemptsProvider =
|
|
719
|
+
const maxAttemptsProvider = normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
|
|
722
720
|
let controller = retryStrategy
|
|
723
721
|
? Promise.resolve(retryStrategy)
|
|
724
722
|
: undefined;
|
|
725
723
|
const getDefault = async () => {
|
|
726
724
|
const maxAttempts = await maxAttemptsProvider();
|
|
727
|
-
const adaptive = (await
|
|
725
|
+
const adaptive = (await normalizeProvider(retryMode)()) === RETRY_MODES.ADAPTIVE;
|
|
728
726
|
if (adaptive) {
|
|
729
727
|
return new AdaptiveRetryStrategy$1(maxAttemptsProvider, {
|
|
730
728
|
maxAttempts,
|
|
@@ -744,7 +742,7 @@ const resolveRetryConfig = (input, defaults) => {
|
|
|
744
742
|
|
|
745
743
|
const omitRetryHeadersMiddleware = () => (next) => async (args) => {
|
|
746
744
|
const { request } = args;
|
|
747
|
-
if (
|
|
745
|
+
if (HttpRequest.isInstance(request)) {
|
|
748
746
|
delete request.headers[INVOCATION_ID_HEADER];
|
|
749
747
|
delete request.headers[REQUEST_HEADER];
|
|
750
748
|
}
|
|
@@ -793,6 +791,7 @@ exports.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS;
|
|
|
793
791
|
exports.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT;
|
|
794
792
|
exports.REQUEST_HEADER = REQUEST_HEADER;
|
|
795
793
|
exports.RETRY_COST = RETRY_COST;
|
|
794
|
+
exports.RETRY_MODES = RETRY_MODES;
|
|
796
795
|
exports.Retry = Retry;
|
|
797
796
|
exports.StandardRetryStrategy = StandardRetryStrategy$1;
|
|
798
797
|
exports.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE;
|