@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,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var client = require('@smithy/core/client');
|
|
6
|
-
var schema = require('@smithy/core/schema');
|
|
1
|
+
const { nv, toUtf8, fromUtf8, NumericValue, calculateBodyLength, _parseEpochTimestamp, fromBase64, generateIdempotencyToken } = require("@smithy/core/serde");
|
|
2
|
+
const { HttpRequest, collectBody, SerdeContext, RpcProtocol } = require("@smithy/core/protocols");
|
|
3
|
+
const { NormalizedSchema, deref, TypeRegistry } = require("@smithy/core/schema");
|
|
4
|
+
const { getSmithyContext } = require("@smithy/core/transport");
|
|
7
5
|
|
|
8
6
|
const majorUint64 = 0;
|
|
9
7
|
const majorNegativeInt64 = 1;
|
|
@@ -133,7 +131,7 @@ function decode(at, to) {
|
|
|
133
131
|
}
|
|
134
132
|
numericString = sign + numericString;
|
|
135
133
|
_offset = offset + _offset;
|
|
136
|
-
return
|
|
134
|
+
return nv(numericString);
|
|
137
135
|
}
|
|
138
136
|
else {
|
|
139
137
|
const value = decode(at + offset, to);
|
|
@@ -181,7 +179,7 @@ function bytesToUtf8(bytes, at, to) {
|
|
|
181
179
|
if (textDecoder) {
|
|
182
180
|
return textDecoder.decode(bytes.subarray(at, to));
|
|
183
181
|
}
|
|
184
|
-
return
|
|
182
|
+
return toUtf8(bytes.subarray(at, to));
|
|
185
183
|
}
|
|
186
184
|
function demote(bigInteger) {
|
|
187
185
|
const num = Number(bigInteger);
|
|
@@ -525,7 +523,7 @@ function encode(_input) {
|
|
|
525
523
|
cursor += data.write(input, cursor);
|
|
526
524
|
}
|
|
527
525
|
else {
|
|
528
|
-
const bytes =
|
|
526
|
+
const bytes = fromUtf8(input);
|
|
529
527
|
encodeHeader(majorUtf8String, bytes.byteLength);
|
|
530
528
|
data.set(bytes, cursor);
|
|
531
529
|
cursor += bytes.byteLength;
|
|
@@ -641,7 +639,7 @@ function encode(_input) {
|
|
|
641
639
|
continue;
|
|
642
640
|
}
|
|
643
641
|
else if (typeof input === "object") {
|
|
644
|
-
if (input instanceof
|
|
642
|
+
if (input instanceof NumericValue) {
|
|
645
643
|
const decimalIndex = input.string.indexOf(".");
|
|
646
644
|
const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;
|
|
647
645
|
const mantissa = BigInt(input.string.replace(".", ""));
|
|
@@ -695,7 +693,7 @@ const cbor = {
|
|
|
695
693
|
};
|
|
696
694
|
|
|
697
695
|
const parseCborBody = (streamBody, context) => {
|
|
698
|
-
return
|
|
696
|
+
return collectBody(streamBody, context).then(async (bytes) => {
|
|
699
697
|
if (bytes.length) {
|
|
700
698
|
try {
|
|
701
699
|
return cbor.deserialize(bytes);
|
|
@@ -781,14 +779,14 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
|
|
|
781
779
|
if (body !== undefined) {
|
|
782
780
|
contents.body = body;
|
|
783
781
|
try {
|
|
784
|
-
contents.headers["content-length"] = String(
|
|
782
|
+
contents.headers["content-length"] = String(calculateBodyLength(body));
|
|
785
783
|
}
|
|
786
784
|
catch (e) { }
|
|
787
785
|
}
|
|
788
|
-
return new
|
|
786
|
+
return new HttpRequest(contents);
|
|
789
787
|
};
|
|
790
788
|
|
|
791
|
-
class CborCodec extends
|
|
789
|
+
class CborCodec extends SerdeContext {
|
|
792
790
|
createSerializer() {
|
|
793
791
|
const serializer = new CborShapeSerializer();
|
|
794
792
|
serializer.setSerdeContext(this.serdeContext);
|
|
@@ -800,22 +798,22 @@ class CborCodec extends protocols.SerdeContext {
|
|
|
800
798
|
return deserializer;
|
|
801
799
|
}
|
|
802
800
|
}
|
|
803
|
-
class CborShapeSerializer extends
|
|
801
|
+
class CborShapeSerializer extends SerdeContext {
|
|
804
802
|
value;
|
|
805
803
|
write(schema, value) {
|
|
806
804
|
this.value = this.serialize(schema, value);
|
|
807
805
|
}
|
|
808
|
-
serialize(schema
|
|
809
|
-
const ns =
|
|
806
|
+
serialize(schema, source) {
|
|
807
|
+
const ns = NormalizedSchema.of(schema);
|
|
810
808
|
if (source == null) {
|
|
811
809
|
if (ns.isIdempotencyToken()) {
|
|
812
|
-
return
|
|
810
|
+
return generateIdempotencyToken();
|
|
813
811
|
}
|
|
814
812
|
return source;
|
|
815
813
|
}
|
|
816
814
|
if (ns.isBlobSchema()) {
|
|
817
815
|
if (typeof source === "string") {
|
|
818
|
-
return (this.serdeContext?.base64Decoder ??
|
|
816
|
+
return (this.serdeContext?.base64Decoder ?? fromBase64)(source);
|
|
819
817
|
}
|
|
820
818
|
return source;
|
|
821
819
|
}
|
|
@@ -890,26 +888,26 @@ class CborShapeSerializer extends protocols.SerdeContext {
|
|
|
890
888
|
return buffer;
|
|
891
889
|
}
|
|
892
890
|
}
|
|
893
|
-
class CborShapeDeserializer extends
|
|
891
|
+
class CborShapeDeserializer extends SerdeContext {
|
|
894
892
|
read(schema, bytes) {
|
|
895
893
|
const data = cbor.deserialize(bytes);
|
|
896
894
|
return this.readValue(schema, data);
|
|
897
895
|
}
|
|
898
896
|
readValue(_schema, value) {
|
|
899
|
-
const ns =
|
|
897
|
+
const ns = NormalizedSchema.of(_schema);
|
|
900
898
|
if (ns.isTimestampSchema()) {
|
|
901
899
|
if (typeof value === "number") {
|
|
902
|
-
return
|
|
900
|
+
return _parseEpochTimestamp(value);
|
|
903
901
|
}
|
|
904
902
|
if (typeof value === "object") {
|
|
905
903
|
if (value.tag === 1 && "value" in value) {
|
|
906
|
-
return
|
|
904
|
+
return _parseEpochTimestamp(value.value);
|
|
907
905
|
}
|
|
908
906
|
}
|
|
909
907
|
}
|
|
910
908
|
if (ns.isBlobSchema()) {
|
|
911
909
|
if (typeof value === "string") {
|
|
912
|
-
return (this.serdeContext?.base64Decoder ??
|
|
910
|
+
return (this.serdeContext?.base64Decoder ?? fromBase64)(value);
|
|
913
911
|
}
|
|
914
912
|
return value;
|
|
915
913
|
}
|
|
@@ -989,7 +987,7 @@ class CborShapeDeserializer extends protocols.SerdeContext {
|
|
|
989
987
|
}
|
|
990
988
|
}
|
|
991
989
|
}
|
|
992
|
-
else if (value instanceof
|
|
990
|
+
else if (value instanceof NumericValue) {
|
|
993
991
|
return value;
|
|
994
992
|
}
|
|
995
993
|
return newObject;
|
|
@@ -1000,7 +998,7 @@ class CborShapeDeserializer extends protocols.SerdeContext {
|
|
|
1000
998
|
}
|
|
1001
999
|
}
|
|
1002
1000
|
|
|
1003
|
-
class SmithyRpcV2CborProtocol extends
|
|
1001
|
+
class SmithyRpcV2CborProtocol extends RpcProtocol {
|
|
1004
1002
|
codec = new CborCodec();
|
|
1005
1003
|
serializer = this.codec.createSerializer();
|
|
1006
1004
|
deserializer = this.codec.createDeserializer();
|
|
@@ -1020,7 +1018,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1020
1018
|
"smithy-protocol": "rpc-v2-cbor",
|
|
1021
1019
|
accept: this.getDefaultContentType(),
|
|
1022
1020
|
});
|
|
1023
|
-
if (
|
|
1021
|
+
if (deref(operationSchema.input) === "unit") {
|
|
1024
1022
|
delete request.body;
|
|
1025
1023
|
delete request.headers["content-type"];
|
|
1026
1024
|
}
|
|
@@ -1034,7 +1032,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1034
1032
|
}
|
|
1035
1033
|
catch (e) { }
|
|
1036
1034
|
}
|
|
1037
|
-
const { service, operation } =
|
|
1035
|
+
const { service, operation } = getSmithyContext(context);
|
|
1038
1036
|
const path = `/service/${service}/operation/${operation}`;
|
|
1039
1037
|
if (request.path.endsWith("/")) {
|
|
1040
1038
|
request.path += path.slice(1);
|
|
@@ -1058,7 +1056,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1058
1056
|
[namespace] = errorName.split("#");
|
|
1059
1057
|
}
|
|
1060
1058
|
const registry = this.compositeErrorRegistry;
|
|
1061
|
-
const nsRegistry =
|
|
1059
|
+
const nsRegistry = TypeRegistry.for(namespace);
|
|
1062
1060
|
registry.copyFrom(nsRegistry);
|
|
1063
1061
|
let errorSchema;
|
|
1064
1062
|
try {
|
|
@@ -1068,7 +1066,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1068
1066
|
if (dataObject.Message) {
|
|
1069
1067
|
dataObject.message = dataObject.Message;
|
|
1070
1068
|
}
|
|
1071
|
-
const syntheticRegistry =
|
|
1069
|
+
const syntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
|
|
1072
1070
|
registry.copyFrom(syntheticRegistry);
|
|
1073
1071
|
const baseExceptionSchema = registry.getBaseException();
|
|
1074
1072
|
if (baseExceptionSchema) {
|
|
@@ -1077,7 +1075,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1077
1075
|
}
|
|
1078
1076
|
throw Object.assign(new Error(errorName), errorMetadata, dataObject);
|
|
1079
1077
|
}
|
|
1080
|
-
const ns =
|
|
1078
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
1081
1079
|
const ErrorCtor = registry.getErrorCtor(errorSchema);
|
|
1082
1080
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
1083
1081
|
const exception = new ErrorCtor({});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { fromUtf8 } = require("@smithy/core/serde");
|
|
4
2
|
|
|
5
3
|
async function blobReader(blob, onChunk, chunkSize = 1024 * 1024) {
|
|
6
4
|
const size = blob.size;
|
|
@@ -183,7 +181,7 @@ function isEmptyData(data) {
|
|
|
183
181
|
}
|
|
184
182
|
function convertToBuffer(data) {
|
|
185
183
|
if (typeof data === "string") {
|
|
186
|
-
return
|
|
184
|
+
return fromUtf8(data);
|
|
187
185
|
}
|
|
188
186
|
if (ArrayBuffer.isView(data)) {
|
|
189
187
|
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var node_stream = require('node:stream');
|
|
5
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { createReadStream } = require("node:fs");
|
|
2
|
+
const { Writable } = require("node:stream");
|
|
3
|
+
const { toUint8Array, fromUtf8 } = require("@smithy/core/serde");
|
|
6
4
|
|
|
7
5
|
async function blobReader(blob, onChunk, chunkSize = 1024 * 1024) {
|
|
8
6
|
const size = blob.size;
|
|
@@ -22,7 +20,7 @@ const blobHasher = async function blobHasher(hashCtor, blob) {
|
|
|
22
20
|
return hash.digest();
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
class HashCalculator extends
|
|
23
|
+
class HashCalculator extends Writable {
|
|
26
24
|
hash;
|
|
27
25
|
constructor(hash, options) {
|
|
28
26
|
super(options);
|
|
@@ -30,7 +28,7 @@ class HashCalculator extends node_stream.Writable {
|
|
|
30
28
|
}
|
|
31
29
|
_write(chunk, encoding, callback) {
|
|
32
30
|
try {
|
|
33
|
-
this.hash.update(
|
|
31
|
+
this.hash.update(toUint8Array(chunk));
|
|
34
32
|
}
|
|
35
33
|
catch (err) {
|
|
36
34
|
return callback(err);
|
|
@@ -44,7 +42,7 @@ const fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve, reject)
|
|
|
44
42
|
reject(new Error("Unable to calculate hash for non-file streams."));
|
|
45
43
|
return;
|
|
46
44
|
}
|
|
47
|
-
const fileStreamTee =
|
|
45
|
+
const fileStreamTee = createReadStream(fileStream.path, {
|
|
48
46
|
start: fileStream.start,
|
|
49
47
|
end: fileStream.end,
|
|
50
48
|
});
|
|
@@ -244,7 +242,7 @@ function isEmptyData(data) {
|
|
|
244
242
|
}
|
|
245
243
|
function convertToBuffer(data) {
|
|
246
244
|
if (typeof data === "string") {
|
|
247
|
-
return
|
|
245
|
+
return fromUtf8(data);
|
|
248
246
|
}
|
|
249
247
|
if (ArrayBuffer.isView(data)) {
|
|
250
248
|
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { fromUtf8, fromBase64 } = require("@smithy/core/serde");
|
|
4
2
|
|
|
5
3
|
async function blobReader$1(blob, onChunk, chunkSize = 1024 * 1024) {
|
|
6
4
|
const size = blob.size;
|
|
@@ -183,7 +181,7 @@ function isEmptyData(data) {
|
|
|
183
181
|
}
|
|
184
182
|
function convertToBuffer(data) {
|
|
185
183
|
if (typeof data === "string") {
|
|
186
|
-
return
|
|
184
|
+
return fromUtf8(data);
|
|
187
185
|
}
|
|
188
186
|
if (ArrayBuffer.isView(data)) {
|
|
189
187
|
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
@@ -209,7 +207,7 @@ function blobReader(blob, onChunk, chunkSize = 1024 * 1024) {
|
|
|
209
207
|
const result = event.target.result;
|
|
210
208
|
const dataOffset = result.indexOf(",") + 1;
|
|
211
209
|
const data = result.substring(dataOffset);
|
|
212
|
-
const decoded =
|
|
210
|
+
const decoded = fromBase64(data);
|
|
213
211
|
onChunk(decoded);
|
|
214
212
|
totalBytesRead += decoded.byteLength;
|
|
215
213
|
read();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const { getSmithyContext, normalizeProvider } = require("@smithy/core/transport");
|
|
2
|
+
exports.getSmithyContext = getSmithyContext;
|
|
3
|
+
exports.normalizeProvider = normalizeProvider;
|
|
4
|
+
const { SMITHY_CONTEXT_KEY, AlgorithmId } = require("@smithy/types");
|
|
5
|
+
exports.AlgorithmId = AlgorithmId;
|
|
6
|
+
const { NormalizedSchema } = require("@smithy/core/schema");
|
|
6
7
|
|
|
7
8
|
const getAllAliases = (name, aliases) => {
|
|
8
9
|
const _aliases = [];
|
|
@@ -313,16 +314,16 @@ const waiterServiceDefaults = {
|
|
|
313
314
|
minDelay: 2,
|
|
314
315
|
maxDelay: 120,
|
|
315
316
|
};
|
|
316
|
-
|
|
317
|
+
var WaiterState;
|
|
317
318
|
(function (WaiterState) {
|
|
318
319
|
WaiterState["ABORTED"] = "ABORTED";
|
|
319
320
|
WaiterState["FAILURE"] = "FAILURE";
|
|
320
321
|
WaiterState["SUCCESS"] = "SUCCESS";
|
|
321
322
|
WaiterState["RETRY"] = "RETRY";
|
|
322
323
|
WaiterState["TIMEOUT"] = "TIMEOUT";
|
|
323
|
-
})(
|
|
324
|
+
})(WaiterState || (WaiterState = {}));
|
|
324
325
|
const checkExceptions = (result) => {
|
|
325
|
-
if (result.state ===
|
|
326
|
+
if (result.state === WaiterState.ABORTED) {
|
|
326
327
|
const abortError = new Error(`${JSON.stringify({
|
|
327
328
|
...result,
|
|
328
329
|
reason: "Request was aborted",
|
|
@@ -330,7 +331,7 @@ const checkExceptions = (result) => {
|
|
|
330
331
|
abortError.name = "AbortError";
|
|
331
332
|
throw abortError;
|
|
332
333
|
}
|
|
333
|
-
else if (result.state ===
|
|
334
|
+
else if (result.state === WaiterState.TIMEOUT) {
|
|
334
335
|
const timeoutError = new Error(`${JSON.stringify({
|
|
335
336
|
...result,
|
|
336
337
|
reason: "Waiter has timed out",
|
|
@@ -338,7 +339,7 @@ const checkExceptions = (result) => {
|
|
|
338
339
|
timeoutError.name = "TimeoutError";
|
|
339
340
|
throw timeoutError;
|
|
340
341
|
}
|
|
341
|
-
else if (result.state !==
|
|
342
|
+
else if (result.state !== WaiterState.SUCCESS) {
|
|
342
343
|
throw new Error(`${JSON.stringify(result, getCircularReplacer())}`);
|
|
343
344
|
}
|
|
344
345
|
return result;
|
|
@@ -358,10 +359,10 @@ const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, cl
|
|
|
358
359
|
const message = "AbortController signal aborted.";
|
|
359
360
|
observedResponses[message] |= 0;
|
|
360
361
|
observedResponses[message] += 1;
|
|
361
|
-
return { state:
|
|
362
|
+
return { state: WaiterState.ABORTED, observedResponses };
|
|
362
363
|
}
|
|
363
364
|
if (Date.now() + delayMs > waitUntil) {
|
|
364
|
-
return { state:
|
|
365
|
+
return { state: WaiterState.TIMEOUT, observedResponses };
|
|
365
366
|
}
|
|
366
367
|
await sleep(delayMs / 1_000);
|
|
367
368
|
}
|
|
@@ -371,7 +372,7 @@ const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, cl
|
|
|
371
372
|
observedResponses[message] |= 0;
|
|
372
373
|
observedResponses[message] += 1;
|
|
373
374
|
}
|
|
374
|
-
if (state !==
|
|
375
|
+
if (state !== WaiterState.RETRY) {
|
|
375
376
|
return { state, reason, final: reason, observedResponses };
|
|
376
377
|
}
|
|
377
378
|
currentAttempt += 1;
|
|
@@ -448,7 +449,7 @@ const validateWaiterOptions = (options) => {
|
|
|
448
449
|
const abortTimeout = (abortSignal) => {
|
|
449
450
|
let onAbort;
|
|
450
451
|
const promise = new Promise((resolve) => {
|
|
451
|
-
onAbort = () => resolve({ state:
|
|
452
|
+
onAbort = () => resolve({ state: WaiterState.ABORTED });
|
|
452
453
|
if (typeof abortSignal.addEventListener === "function") {
|
|
453
454
|
abortSignal.addEventListener("abort", onAbort);
|
|
454
455
|
}
|
|
@@ -543,11 +544,11 @@ class Client {
|
|
|
543
544
|
}
|
|
544
545
|
|
|
545
546
|
const SENSITIVE_STRING$1 = "***SensitiveInformation***";
|
|
546
|
-
function schemaLogFilter(schema
|
|
547
|
+
function schemaLogFilter(schema, data) {
|
|
547
548
|
if (data == null) {
|
|
548
549
|
return data;
|
|
549
550
|
}
|
|
550
|
-
const ns =
|
|
551
|
+
const ns = NormalizedSchema.of(schema);
|
|
551
552
|
if (ns.getMergedTraits().sensitive) {
|
|
552
553
|
return SENSITIVE_STRING$1;
|
|
553
554
|
}
|
|
@@ -594,7 +595,7 @@ class Command {
|
|
|
594
595
|
commandName,
|
|
595
596
|
inputFilterSensitiveLog,
|
|
596
597
|
outputFilterSensitiveLog,
|
|
597
|
-
[
|
|
598
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
598
599
|
commandInstance: this,
|
|
599
600
|
...smithyContext,
|
|
600
601
|
},
|
|
@@ -862,11 +863,11 @@ const emitWarningIfUnsupportedVersion = (version) => {
|
|
|
862
863
|
}
|
|
863
864
|
};
|
|
864
865
|
|
|
865
|
-
const knownAlgorithms = Object.values(
|
|
866
|
+
const knownAlgorithms = Object.values(AlgorithmId);
|
|
866
867
|
const getChecksumConfiguration = (runtimeConfig) => {
|
|
867
868
|
const checksumAlgorithms = [];
|
|
868
|
-
for (const id in
|
|
869
|
-
const algorithmId =
|
|
869
|
+
for (const id in AlgorithmId) {
|
|
870
|
+
const algorithmId = AlgorithmId[id];
|
|
870
871
|
if (runtimeConfig[algorithmId] === undefined) {
|
|
871
872
|
continue;
|
|
872
873
|
}
|
|
@@ -1089,14 +1090,12 @@ const _json = (obj) => {
|
|
|
1089
1090
|
return obj;
|
|
1090
1091
|
};
|
|
1091
1092
|
|
|
1092
|
-
exports.getSmithyContext = transport.getSmithyContext;
|
|
1093
|
-
exports.normalizeProvider = transport.normalizeProvider;
|
|
1094
|
-
exports.AlgorithmId = types.AlgorithmId;
|
|
1095
1093
|
exports.Client = Client;
|
|
1096
1094
|
exports.Command = Command;
|
|
1097
1095
|
exports.NoOpLogger = NoOpLogger;
|
|
1098
1096
|
exports.SENSITIVE_STRING = SENSITIVE_STRING;
|
|
1099
1097
|
exports.ServiceException = ServiceException;
|
|
1098
|
+
exports.WaiterState = WaiterState;
|
|
1100
1099
|
exports._json = _json;
|
|
1101
1100
|
exports.checkExceptions = checkExceptions;
|
|
1102
1101
|
exports.constructStack = constructStack;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var client = require('@smithy/core/client');
|
|
4
|
-
var transport = require('@smithy/core/transport');
|
|
1
|
+
const { normalizeProvider } = require("@smithy/core/client");
|
|
2
|
+
const { isValidHostLabel } = require("@smithy/core/transport");
|
|
5
3
|
|
|
6
4
|
class ProviderError extends Error {
|
|
7
5
|
name = "ProviderError";
|
|
@@ -132,19 +130,19 @@ const numberSelector = (obj, key, type) => {
|
|
|
132
130
|
return numberValue;
|
|
133
131
|
};
|
|
134
132
|
|
|
135
|
-
|
|
133
|
+
var SelectorType;
|
|
136
134
|
(function (SelectorType) {
|
|
137
135
|
SelectorType["ENV"] = "env";
|
|
138
136
|
SelectorType["CONFIG"] = "shared config entry";
|
|
139
|
-
})(
|
|
137
|
+
})(SelectorType || (SelectorType = {}));
|
|
140
138
|
|
|
141
139
|
const resolveCustomEndpointsConfig = (input) => {
|
|
142
140
|
const { tls, endpoint, urlParser, useDualstackEndpoint } = input;
|
|
143
141
|
return Object.assign(input, {
|
|
144
142
|
tls: tls ?? true,
|
|
145
|
-
endpoint:
|
|
143
|
+
endpoint: normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint),
|
|
146
144
|
isCustomEndpoint: true,
|
|
147
|
-
useDualstackEndpoint:
|
|
145
|
+
useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
|
|
148
146
|
});
|
|
149
147
|
};
|
|
150
148
|
|
|
@@ -165,12 +163,12 @@ const getEndpointFromRegion = async (input) => {
|
|
|
165
163
|
};
|
|
166
164
|
|
|
167
165
|
const resolveEndpointsConfig = (input) => {
|
|
168
|
-
const useDualstackEndpoint =
|
|
166
|
+
const useDualstackEndpoint = normalizeProvider(input.useDualstackEndpoint ?? false);
|
|
169
167
|
const { endpoint, useFipsEndpoint, urlParser, tls } = input;
|
|
170
168
|
return Object.assign(input, {
|
|
171
169
|
tls: tls ?? true,
|
|
172
170
|
endpoint: endpoint
|
|
173
|
-
?
|
|
171
|
+
? normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint)
|
|
174
172
|
: () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }),
|
|
175
173
|
isCustomEndpoint: !!endpoint,
|
|
176
174
|
useDualstackEndpoint,
|
|
@@ -178,7 +176,7 @@ const resolveEndpointsConfig = (input) => {
|
|
|
178
176
|
};
|
|
179
177
|
|
|
180
178
|
const validRegions = new Set();
|
|
181
|
-
const checkRegion = (region, check =
|
|
179
|
+
const checkRegion = (region, check = isValidHostLabel) => {
|
|
182
180
|
if (!validRegions.has(region) && !check(region)) {
|
|
183
181
|
if (region === "*") {
|
|
184
182
|
console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`);
|
|
@@ -349,6 +347,7 @@ exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OP
|
|
|
349
347
|
exports.ProviderError = ProviderError;
|
|
350
348
|
exports.REGION_ENV_NAME = REGION_ENV_NAME;
|
|
351
349
|
exports.REGION_INI_NAME = REGION_INI_NAME;
|
|
350
|
+
exports.SelectorType = SelectorType;
|
|
352
351
|
exports.TokenProviderError = TokenProviderError;
|
|
353
352
|
exports.booleanSelector = booleanSelector;
|
|
354
353
|
exports.chain = chain;
|