@cdklabs/cdk-construct-connect-datalake 0.0.13 → 0.0.14
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 +9 -9
- package/lib/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +5 -5
- package/node_modules/@aws-sdk/client-connect/package.json +5 -5
- package/node_modules/@aws-sdk/client-glue/dist-cjs/index.js +6 -4
- package/node_modules/@aws-sdk/client-glue/dist-cjs/schemas/schemas_0.js +57 -30
- package/node_modules/@aws-sdk/client-glue/dist-es/models/enums.js +6 -4
- package/node_modules/@aws-sdk/client-glue/dist-es/schemas/schemas_0.js +42 -15
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetTableCommand.d.ts +121 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetTableVersionCommand.d.ts +118 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetTableVersionsCommand.d.ts +118 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetTablesCommand.d.ts +119 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetUnfilteredTableMetadataCommand.d.ts +118 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/SearchTablesCommand.d.ts +118 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/UpdateCrawlerScheduleCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/models/enums.d.ts +14 -12
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_2.d.ts +87 -6
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_3.d.ts +11 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/UpdateCrawlerScheduleCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/enums.d.ts +8 -6
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_2.d.ts +18 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_3.d.ts +3 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-glue/package.json +5 -5
- package/node_modules/@aws-sdk/client-lakeformation/package.json +5 -5
- package/node_modules/@aws-sdk/client-ram/package.json +5 -5
- package/node_modules/@aws-sdk/client-sts/package.json +6 -6
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +47 -2297
- package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/core/dist-types/index.d.ts +5 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +5 -5
- package/node_modules/@aws-sdk/core/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +4 -1
- package/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js +4 -1
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +9 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +7 -6
- package/node_modules/@aws-sdk/token-providers/package.json +5 -5
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-locate-window/package.json +2 -2
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/CHANGELOG.md +8 -0
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/README.md +9 -0
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/package.json +4 -1
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/strnum.js +9 -1
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@nodable/entities/package.json +4 -1
- package/node_modules/@nodable/entities/src/EntityDecoder.js +104 -3
- package/node_modules/@nodable/entities/src/index.d.ts +77 -0
- package/node_modules/@nodable/entities/src/index.js +1 -1
- 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 +26 -27
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +28 -29
- 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-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +18 -17
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +23 -24
- package/node_modules/@smithy/credential-provider-imds/package.json +7 -7
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +6 -8
- package/node_modules/@smithy/fetch-http-handler/package.json +10 -10
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
- package/node_modules/@smithy/node-http-handler/package.json +8 -8
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +27 -29
- package/node_modules/@smithy/signature-v4/package.json +7 -7
- package/node_modules/@smithy/types/dist-cjs/index.js +23 -18
- package/node_modules/@smithy/types/package.json +10 -10
- package/node_modules/anynum/LICENSE +21 -0
- package/node_modules/anynum/README.md +142 -0
- package/node_modules/anynum/anynum.js +135 -0
- package/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/anynum/package.json +42 -0
- package/node_modules/watchpack/README.md +9 -0
- package/node_modules/watchpack/lib/DirectoryWatcher.js +182 -25
- package/node_modules/watchpack/lib/index.js +55 -15
- package/node_modules/watchpack/lib/reducePlan.js +56 -35
- package/node_modules/watchpack/lib/util/globToRegExp.js +142 -0
- package/node_modules/watchpack/lib/watchEventSource.js +18 -10
- package/node_modules/watchpack/package.json +17 -23
- package/node_modules/watchpack/types/DirectoryWatcher.d.ts +2 -0
- package/node_modules/watchpack/types/index.d.ts +121 -113
- package/node_modules/watchpack/types/util/globToRegExp.d.ts +2 -0
- package/node_modules/watchpack/types/watchpack.d.ts +1 -1
- package/package.json +10 -10
- package/node_modules/glob-to-regexp/.travis.yml +0 -4
- package/node_modules/glob-to-regexp/README.md +0 -75
- package/node_modules/glob-to-regexp/index.js +0 -130
- package/node_modules/glob-to-regexp/package.json +0 -23
- package/node_modules/glob-to-regexp/test.js +0 -235
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/LICENSE +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const { CONFIG_PREFIX_SEPARATOR, loadConfig } = require("@smithy/core/config");
|
|
2
|
+
const { toEndpointV1, getSmithyContext, normalizeProvider, isValidHostLabel } = require("@smithy/core/transport");
|
|
3
|
+
exports.isValidHostLabel = isValidHostLabel;
|
|
4
|
+
exports.middlewareEndpointToEndpointV1 = toEndpointV1;
|
|
5
|
+
exports.toEndpointV1 = toEndpointV1;
|
|
6
|
+
const { EndpointURLScheme } = require("@smithy/types");
|
|
7
7
|
|
|
8
8
|
const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
|
|
9
9
|
const CONFIG_ENDPOINT_URL = "endpoint_url";
|
|
@@ -18,12 +18,12 @@ const getEndpointUrlConfig = (serviceId) => ({
|
|
|
18
18
|
return endpointUrl;
|
|
19
19
|
return undefined;
|
|
20
20
|
},
|
|
21
|
-
configFileSelector: (profile, config
|
|
22
|
-
if (config
|
|
23
|
-
const servicesSection = config
|
|
21
|
+
configFileSelector: (profile, config) => {
|
|
22
|
+
if (config && profile.services) {
|
|
23
|
+
const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
|
|
24
24
|
if (servicesSection) {
|
|
25
25
|
const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
|
|
26
|
-
const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(
|
|
26
|
+
const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
|
|
27
27
|
if (endpointUrl)
|
|
28
28
|
return endpointUrl;
|
|
29
29
|
}
|
|
@@ -36,7 +36,7 @@ const getEndpointUrlConfig = (serviceId) => ({
|
|
|
36
36
|
default: undefined,
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const getEndpointFromConfig = async (serviceId) =>
|
|
39
|
+
const getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
|
|
40
40
|
|
|
41
41
|
const resolveParamsForS3 = async (endpointParams) => {
|
|
42
42
|
const bucket = endpointParams?.Bucket || "";
|
|
@@ -136,7 +136,7 @@ function bindGetEndpointFromInstructions(getEndpointFromConfig) {
|
|
|
136
136
|
endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
|
|
137
137
|
}
|
|
138
138
|
if (endpointFromConfig) {
|
|
139
|
-
clientConfig.endpoint = () => Promise.resolve(
|
|
139
|
+
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
|
140
140
|
clientConfig.isCustomEndpoint = true;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -215,7 +215,7 @@ function bindEndpointMiddleware(getEndpointFromConfig) {
|
|
|
215
215
|
if (authScheme) {
|
|
216
216
|
context["signing_region"] = authScheme.signingRegion;
|
|
217
217
|
context["signing_service"] = authScheme.signingName;
|
|
218
|
-
const smithyContext =
|
|
218
|
+
const smithyContext = getSmithyContext(context);
|
|
219
219
|
const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
|
|
220
220
|
if (httpAuthOption) {
|
|
221
221
|
httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
|
|
@@ -260,14 +260,14 @@ function bindResolveEndpointConfig(getEndpointFromConfig) {
|
|
|
260
260
|
return (input) => {
|
|
261
261
|
const tls = input.tls ?? true;
|
|
262
262
|
const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
|
|
263
|
-
const customEndpointProvider = endpoint != null ? async () =>
|
|
263
|
+
const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : undefined;
|
|
264
264
|
const isCustomEndpoint = !!endpoint;
|
|
265
265
|
const resolvedConfig = Object.assign(input, {
|
|
266
266
|
endpoint: customEndpointProvider,
|
|
267
267
|
tls,
|
|
268
268
|
isCustomEndpoint,
|
|
269
|
-
useDualstackEndpoint:
|
|
270
|
-
useFipsEndpoint:
|
|
269
|
+
useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
|
|
270
|
+
useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),
|
|
271
271
|
});
|
|
272
272
|
let configuredEndpointPromise = undefined;
|
|
273
273
|
resolvedConfig.serviceConfiguredEndpoint = async () => {
|
|
@@ -430,8 +430,8 @@ const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\
|
|
|
430
430
|
const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]"));
|
|
431
431
|
|
|
432
432
|
const DEFAULT_PORTS = {
|
|
433
|
-
[
|
|
434
|
-
[
|
|
433
|
+
[EndpointURLScheme.HTTP]: 80,
|
|
434
|
+
[EndpointURLScheme.HTTPS]: 443,
|
|
435
435
|
};
|
|
436
436
|
const parseURL = (value) => {
|
|
437
437
|
const whatwgURL = (() => {
|
|
@@ -463,7 +463,7 @@ const parseURL = (value) => {
|
|
|
463
463
|
return null;
|
|
464
464
|
}
|
|
465
465
|
const scheme = protocol.slice(0, -1);
|
|
466
|
-
if (!Object.values(
|
|
466
|
+
if (!Object.values(EndpointURLScheme).includes(scheme)) {
|
|
467
467
|
return null;
|
|
468
468
|
}
|
|
469
469
|
const isIp = isIpAddress(hostname);
|
|
@@ -512,7 +512,7 @@ const endpointFunctions = {
|
|
|
512
512
|
coalesce,
|
|
513
513
|
getAttr,
|
|
514
514
|
isSet,
|
|
515
|
-
isValidHostLabel
|
|
515
|
+
isValidHostLabel,
|
|
516
516
|
ite,
|
|
517
517
|
not,
|
|
518
518
|
parseURL,
|
|
@@ -842,9 +842,6 @@ const resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);
|
|
|
842
842
|
const endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);
|
|
843
843
|
const getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig);
|
|
844
844
|
|
|
845
|
-
exports.isValidHostLabel = transport.isValidHostLabel;
|
|
846
|
-
exports.middlewareEndpointToEndpointV1 = transport.toEndpointV1;
|
|
847
|
-
exports.toEndpointV1 = transport.toEndpointV1;
|
|
848
845
|
exports.BinaryDecisionDiagram = BinaryDecisionDiagram;
|
|
849
846
|
exports.EndpointCache = EndpointCache;
|
|
850
847
|
exports.EndpointError = EndpointError;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var crc32 = require('@aws-crypto/crc32');
|
|
4
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { Crc32 } = require("@aws-crypto/crc32");
|
|
2
|
+
const { toHex, fromHex, toUtf8, fromUtf8 } = require("@smithy/core/serde");
|
|
5
3
|
|
|
6
4
|
class Int64 {
|
|
7
5
|
bytes;
|
|
@@ -30,7 +28,7 @@ class Int64 {
|
|
|
30
28
|
if (negative) {
|
|
31
29
|
negate(bytes);
|
|
32
30
|
}
|
|
33
|
-
return parseInt(
|
|
31
|
+
return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
|
|
34
32
|
}
|
|
35
33
|
toString() {
|
|
36
34
|
return String(this.valueOf());
|
|
@@ -115,7 +113,7 @@ class HeaderMarshaller {
|
|
|
115
113
|
}
|
|
116
114
|
const uuidBytes = new Uint8Array(17);
|
|
117
115
|
uuidBytes[0] = 9;
|
|
118
|
-
uuidBytes.set(
|
|
116
|
+
uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
|
|
119
117
|
return uuidBytes;
|
|
120
118
|
}
|
|
121
119
|
}
|
|
@@ -196,7 +194,7 @@ class HeaderMarshaller {
|
|
|
196
194
|
position += 16;
|
|
197
195
|
out[name] = {
|
|
198
196
|
type: UUID_TAG,
|
|
199
|
-
value: `${
|
|
197
|
+
value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,
|
|
200
198
|
};
|
|
201
199
|
break;
|
|
202
200
|
default:
|
|
@@ -246,7 +244,7 @@ function splitMessage({ byteLength, byteOffset, buffer }) {
|
|
|
246
244
|
const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);
|
|
247
245
|
const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);
|
|
248
246
|
const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);
|
|
249
|
-
const checksummer = new
|
|
247
|
+
const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
|
|
250
248
|
if (expectedPreludeChecksum !== checksummer.digest()) {
|
|
251
249
|
throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`);
|
|
252
250
|
}
|
|
@@ -305,7 +303,7 @@ class EventStreamCodec {
|
|
|
305
303
|
const length = headers.byteLength + body.byteLength + 16;
|
|
306
304
|
const out = new Uint8Array(length);
|
|
307
305
|
const view = new DataView(out.buffer, out.byteOffset, out.byteLength);
|
|
308
|
-
const checksum = new
|
|
306
|
+
const checksum = new Crc32();
|
|
309
307
|
view.setUint32(0, length, false);
|
|
310
308
|
view.setUint32(4, headers.byteLength, false);
|
|
311
309
|
view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);
|
|
@@ -688,7 +686,7 @@ class EventStreamSerde {
|
|
|
688
686
|
out[name] = body;
|
|
689
687
|
}
|
|
690
688
|
else if (member.isStringSchema()) {
|
|
691
|
-
out[name] = (this.serdeContext?.utf8Encoder ??
|
|
689
|
+
out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);
|
|
692
690
|
}
|
|
693
691
|
else if (member.isStructSchema()) {
|
|
694
692
|
out[name] = await this.deserializer.read(member, body);
|
|
@@ -835,7 +833,7 @@ class EventStreamSerde {
|
|
|
835
833
|
}
|
|
836
834
|
const messageSerialization = serializer.flush() ?? new Uint8Array();
|
|
837
835
|
const body = typeof messageSerialization === "string"
|
|
838
|
-
? (this.serdeContext?.utf8Decoder ??
|
|
836
|
+
? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization)
|
|
839
837
|
: messageSerialization;
|
|
840
838
|
return {
|
|
841
839
|
body,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var serde = require('@smithy/core/serde');
|
|
5
|
-
var node_stream = require('node:stream');
|
|
1
|
+
const { Crc32 } = require("@aws-crypto/crc32");
|
|
2
|
+
const { toHex, fromHex, toUtf8, fromUtf8 } = require("@smithy/core/serde");
|
|
3
|
+
const { Readable } = require("node:stream");
|
|
6
4
|
|
|
7
5
|
class Int64 {
|
|
8
6
|
bytes;
|
|
@@ -31,7 +29,7 @@ class Int64 {
|
|
|
31
29
|
if (negative) {
|
|
32
30
|
negate(bytes);
|
|
33
31
|
}
|
|
34
|
-
return parseInt(
|
|
32
|
+
return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
|
|
35
33
|
}
|
|
36
34
|
toString() {
|
|
37
35
|
return String(this.valueOf());
|
|
@@ -116,7 +114,7 @@ class HeaderMarshaller {
|
|
|
116
114
|
}
|
|
117
115
|
const uuidBytes = new Uint8Array(17);
|
|
118
116
|
uuidBytes[0] = 9;
|
|
119
|
-
uuidBytes.set(
|
|
117
|
+
uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
|
|
120
118
|
return uuidBytes;
|
|
121
119
|
}
|
|
122
120
|
}
|
|
@@ -197,7 +195,7 @@ class HeaderMarshaller {
|
|
|
197
195
|
position += 16;
|
|
198
196
|
out[name] = {
|
|
199
197
|
type: UUID_TAG,
|
|
200
|
-
value: `${
|
|
198
|
+
value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,
|
|
201
199
|
};
|
|
202
200
|
break;
|
|
203
201
|
default:
|
|
@@ -247,7 +245,7 @@ function splitMessage({ byteLength, byteOffset, buffer }) {
|
|
|
247
245
|
const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);
|
|
248
246
|
const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);
|
|
249
247
|
const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);
|
|
250
|
-
const checksummer = new
|
|
248
|
+
const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
|
|
251
249
|
if (expectedPreludeChecksum !== checksummer.digest()) {
|
|
252
250
|
throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`);
|
|
253
251
|
}
|
|
@@ -306,7 +304,7 @@ class EventStreamCodec {
|
|
|
306
304
|
const length = headers.byteLength + body.byteLength + 16;
|
|
307
305
|
const out = new Uint8Array(length);
|
|
308
306
|
const view = new DataView(out.buffer, out.byteOffset, out.byteLength);
|
|
309
|
-
const checksum = new
|
|
307
|
+
const checksum = new Crc32();
|
|
310
308
|
view.setUint32(0, length, false);
|
|
311
309
|
view.setUint32(4, headers.byteLength, false);
|
|
312
310
|
view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);
|
|
@@ -545,7 +543,7 @@ class EventStreamMarshaller {
|
|
|
545
543
|
return this.universalMarshaller.deserialize(bodyIterable, deserializer);
|
|
546
544
|
}
|
|
547
545
|
serialize(input, serializer) {
|
|
548
|
-
return
|
|
546
|
+
return Readable.from(this.universalMarshaller.serialize(input, serializer));
|
|
549
547
|
}
|
|
550
548
|
}
|
|
551
549
|
const eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);
|
|
@@ -713,7 +711,7 @@ class EventStreamSerde {
|
|
|
713
711
|
out[name] = body;
|
|
714
712
|
}
|
|
715
713
|
else if (member.isStringSchema()) {
|
|
716
|
-
out[name] = (this.serdeContext?.utf8Encoder ??
|
|
714
|
+
out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);
|
|
717
715
|
}
|
|
718
716
|
else if (member.isStructSchema()) {
|
|
719
717
|
out[name] = await this.deserializer.read(member, body);
|
|
@@ -860,7 +858,7 @@ class EventStreamSerde {
|
|
|
860
858
|
}
|
|
861
859
|
const messageSerialization = serializer.flush() ?? new Uint8Array();
|
|
862
860
|
const body = typeof messageSerialization === "string"
|
|
863
|
-
? (this.serdeContext?.utf8Decoder ??
|
|
861
|
+
? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization)
|
|
864
862
|
: messageSerialization;
|
|
865
863
|
return {
|
|
866
864
|
body,
|
|
@@ -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;
|