@cdk8s/awscdk-resolver 0.0.634 → 0.0.636

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.
Files changed (58) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudformation/package.json +3 -3
  5. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.js +182 -0
  6. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/ByteJsonShapeSerializer.js +473 -0
  7. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
  8. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +59 -0
  9. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +14 -0
  10. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +30 -0
  11. package/node_modules/@aws-sdk/core/package.json +2 -1
  12. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  13. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  14. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  15. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  16. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  17. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  18. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  19. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  20. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  21. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  22. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  23. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  24. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  25. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  26. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  27. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +3 -1
  28. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +28 -10
  29. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +34 -11
  30. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +34 -11
  31. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1 -0
  32. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js +8 -1
  33. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js +2 -1
  34. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +11 -9
  35. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.js +8 -0
  36. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js +1 -0
  37. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +34 -11
  38. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -0
  39. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.d.ts +11 -0
  40. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.d.ts +17 -0
  41. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.d.ts +12 -0
  42. package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +10 -2
  43. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.d.ts +11 -0
  44. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.d.ts +17 -0
  45. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.d.ts +12 -0
  46. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +10 -2
  47. package/node_modules/@smithy/core/package.json +91 -91
  48. package/node_modules/@smithy/credential-provider-imds/package.json +34 -34
  49. package/node_modules/@smithy/fetch-http-handler/package.json +30 -30
  50. package/node_modules/@smithy/node-http-handler/package.json +33 -33
  51. package/node_modules/@smithy/signature-v4/package.json +29 -29
  52. package/package.json +4 -4
  53. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +0 -135
  54. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -27
  55. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -17
  56. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/getEndpointUrlConfig.js +0 -21
  57. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/getEndpointUrlConfig.d.ts +0 -12
  58. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/getEndpointUrlConfig.d.ts +0 -12
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-login",
3
- "version": "3.972.66",
3
+ "version": "3.972.67",
4
4
  "description": "AWS credential provider that sources credentials from aws login cached tokens",
5
5
  "keywords": [
6
6
  "aws",
@@ -45,8 +45,8 @@
45
45
  "test:watch": "yarn g:vitest watch"
46
46
  },
47
47
  "dependencies": {
48
- "@aws-sdk/core": "^3.975.3",
49
- "@aws-sdk/nested-clients": "^3.997.33",
48
+ "@aws-sdk/core": "^3.976.0",
49
+ "@aws-sdk/nested-clients": "^3.997.34",
50
50
  "@aws-sdk/types": "^3.974.2",
51
51
  "@smithy/core": "^3.29.4",
52
52
  "@smithy/types": "^4.16.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-node",
3
- "version": "3.972.70",
3
+ "version": "3.972.71",
4
4
  "description": "AWS credential provider that sources credentials from a Node.JS environment. ",
5
5
  "keywords": [
6
6
  "aws",
@@ -45,12 +45,12 @@
45
45
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
46
46
  },
47
47
  "dependencies": {
48
- "@aws-sdk/credential-provider-env": "^3.972.59",
49
- "@aws-sdk/credential-provider-http": "^3.972.61",
50
- "@aws-sdk/credential-provider-ini": "^3.973.4",
51
- "@aws-sdk/credential-provider-process": "^3.972.59",
52
- "@aws-sdk/credential-provider-sso": "^3.973.3",
53
- "@aws-sdk/credential-provider-web-identity": "^3.972.65",
48
+ "@aws-sdk/credential-provider-env": "^3.972.60",
49
+ "@aws-sdk/credential-provider-http": "^3.972.62",
50
+ "@aws-sdk/credential-provider-ini": "^3.973.5",
51
+ "@aws-sdk/credential-provider-process": "^3.972.60",
52
+ "@aws-sdk/credential-provider-sso": "^3.973.4",
53
+ "@aws-sdk/credential-provider-web-identity": "^3.972.66",
54
54
  "@aws-sdk/types": "^3.974.2",
55
55
  "@smithy/core": "^3.29.4",
56
56
  "@smithy/credential-provider-imds": "^4.4.9",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-process",
3
- "version": "3.972.59",
3
+ "version": "3.972.60",
4
4
  "description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config",
5
5
  "keywords": [
6
6
  "aws",
@@ -43,7 +43,7 @@
43
43
  "test:watch": "yarn g:vitest watch"
44
44
  },
45
45
  "dependencies": {
46
- "@aws-sdk/core": "^3.975.3",
46
+ "@aws-sdk/core": "^3.976.0",
47
47
  "@aws-sdk/types": "^3.974.2",
48
48
  "@smithy/core": "^3.29.4",
49
49
  "@smithy/types": "^4.16.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-sso",
3
- "version": "3.973.3",
3
+ "version": "3.973.4",
4
4
  "description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
5
5
  "keywords": [
6
6
  "aws",
@@ -45,9 +45,9 @@
45
45
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
46
46
  },
47
47
  "dependencies": {
48
- "@aws-sdk/core": "^3.975.3",
49
- "@aws-sdk/nested-clients": "^3.997.33",
50
- "@aws-sdk/token-providers": "3.1088.0",
48
+ "@aws-sdk/core": "^3.976.0",
49
+ "@aws-sdk/nested-clients": "^3.997.34",
50
+ "@aws-sdk/token-providers": "3.1092.0",
51
51
  "@aws-sdk/types": "^3.974.2",
52
52
  "@smithy/core": "^3.29.4",
53
53
  "@smithy/types": "^4.16.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-web-identity",
3
- "version": "3.972.65",
3
+ "version": "3.972.66",
4
4
  "description": "AWS credential provider that calls STS assumeRole for temporary AWS credentials",
5
5
  "keywords": [
6
6
  "aws",
@@ -50,8 +50,8 @@
50
50
  "test:watch": "yarn g:vitest watch"
51
51
  },
52
52
  "dependencies": {
53
- "@aws-sdk/core": "^3.975.3",
54
- "@aws-sdk/nested-clients": "^3.997.33",
53
+ "@aws-sdk/core": "^3.976.0",
54
+ "@aws-sdk/nested-clients": "^3.997.34",
55
55
  "@aws-sdk/types": "^3.974.2",
56
56
  "@smithy/core": "^3.29.4",
57
57
  "@smithy/types": "^4.16.1",
@@ -83,7 +83,7 @@ const commonParams = {
83
83
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
84
84
  };
85
85
 
86
- var version = "3.997.32";
86
+ var version = "3.997.33";
87
87
  var packageInfo = {
88
88
  version: version};
89
89
 
@@ -78,7 +78,7 @@ const commonParams = {
78
78
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
79
79
  };
80
80
 
81
- var version = "3.997.32";
81
+ var version = "3.997.33";
82
82
  var packageInfo = {
83
83
  version: version};
84
84
 
@@ -78,7 +78,7 @@ const commonParams = {
78
78
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
79
79
  };
80
80
 
81
- var version = "3.997.32";
81
+ var version = "3.997.33";
82
82
  var packageInfo = {
83
83
  version: version};
84
84
 
@@ -78,7 +78,7 @@ const commonParams = {
78
78
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
79
79
  };
80
80
 
81
- var version = "3.997.32";
81
+ var version = "3.997.33";
82
82
  var packageInfo = {
83
83
  version: version};
84
84
 
@@ -258,7 +258,7 @@ const commonParams = {
258
258
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
259
259
  };
260
260
 
261
- var version = "3.997.32";
261
+ var version = "3.997.33";
262
262
  var packageInfo = {
263
263
  version: version};
264
264
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/nested-clients",
3
- "version": "3.997.33",
3
+ "version": "3.997.34",
4
4
  "description": "Nested clients for AWS SDK packages.",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
6
6
  "license": "Apache-2.0",
@@ -100,7 +100,7 @@
100
100
  "test:watch": "yarn g:vitest watch"
101
101
  },
102
102
  "dependencies": {
103
- "@aws-sdk/core": "^3.975.3",
103
+ "@aws-sdk/core": "^3.976.0",
104
104
  "@aws-sdk/signature-v4-multi-region": "^3.996.41",
105
105
  "@aws-sdk/types": "^3.974.2",
106
106
  "@smithy/core": "^3.29.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/token-providers",
3
- "version": "3.1088.0",
3
+ "version": "3.1092.0",
4
4
  "description": "A collection of token providers",
5
5
  "keywords": [
6
6
  "aws",
@@ -48,8 +48,8 @@
48
48
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
49
49
  },
50
50
  "dependencies": {
51
- "@aws-sdk/core": "^3.975.3",
52
- "@aws-sdk/nested-clients": "^3.997.33",
51
+ "@aws-sdk/core": "^3.976.0",
52
+ "@aws-sdk/nested-clients": "^3.997.34",
53
53
  "@aws-sdk/types": "^3.974.2",
54
54
  "@smithy/core": "^3.29.4",
55
55
  "@smithy/types": "^4.16.1",
@@ -95,7 +95,7 @@ const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config,
95
95
 
96
96
  function bindGetEndpointFromInstructions(getEndpointFromConfig) {
97
97
  return async (commandInput, instructionsSupplier, clientConfig, context) => {
98
- if (!clientConfig.isCustomEndpoint) {
98
+ if (!clientConfig.isCustomEndpoint && !clientConfig.ignoreConfiguredEndpointUrls) {
99
99
  let endpointFromConfig;
100
100
  if (clientConfig.serviceConfiguredEndpoint) {
101
101
  endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
@@ -106,6 +106,7 @@ function bindGetEndpointFromInstructions(getEndpointFromConfig) {
106
106
  if (endpointFromConfig) {
107
107
  clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
108
108
  clientConfig.isCustomEndpoint = true;
109
+ context?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${endpointFromConfig}`);
109
110
  }
110
111
  }
111
112
  const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
@@ -236,6 +237,7 @@ function bindResolveEndpointConfig(getEndpointFromConfig) {
236
237
  isCustomEndpoint,
237
238
  useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
238
239
  useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),
240
+ ignoreConfiguredEndpointUrls: !!input.ignoreConfiguredEndpointUrls,
239
241
  });
240
242
  let configuredEndpointPromise = undefined;
241
243
  resolvedConfig.serviceConfiguredEndpoint = async () => {
@@ -1,4 +1,4 @@
1
- const { CONFIG_PREFIX_SEPARATOR, loadConfig } = require("@smithy/core/config");
1
+ const { CONFIG_PREFIX_SEPARATOR, booleanSelector, SelectorType, loadConfig } = require("@smithy/core/config");
2
2
  const { toEndpointV1, getSmithyContext, normalizeProvider, isValidHostLabel } = require("@smithy/core/transport");
3
3
  exports.isValidHostLabel = isValidHostLabel;
4
4
  exports.middlewareEndpointToEndpointV1 = toEndpointV1;
@@ -19,14 +19,16 @@ const getEndpointUrlConfig = (serviceId) => ({
19
19
  return undefined;
20
20
  },
21
21
  configFileSelector: (profile, config) => {
22
- if (config && profile.services) {
23
- const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
24
- if (servicesSection) {
25
- const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
26
- const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
27
- if (endpointUrl)
28
- return endpointUrl;
22
+ if (profile.services) {
23
+ const servicesSectionKey = ["services", profile.services].join(CONFIG_PREFIX_SEPARATOR);
24
+ if (!config || !config[servicesSectionKey]) {
25
+ throw new Error(`The services section "${profile.services}" specified in the profile is not present in the shared configuration file.`);
29
26
  }
27
+ const servicesSection = config[servicesSectionKey];
28
+ const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
29
+ const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
30
+ if (endpointUrl)
31
+ return endpointUrl;
30
32
  }
31
33
  const endpointUrl = profile[CONFIG_ENDPOINT_URL];
32
34
  if (endpointUrl)
@@ -36,7 +38,21 @@ const getEndpointUrlConfig = (serviceId) => ({
36
38
  default: undefined,
37
39
  });
38
40
 
39
- const getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
41
+ const ENV_IGNORE_CONFIGURED_ENDPOINT_URLS = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS";
42
+ const CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS = "ignore_configured_endpoint_urls";
43
+ const ignoreConfiguredEndpointUrlsConfigSelectors = {
44
+ environmentVariableSelector: (env) => booleanSelector(env, ENV_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.ENV),
45
+ configFileSelector: (profile) => booleanSelector(profile, CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.CONFIG),
46
+ default: false,
47
+ };
48
+
49
+ const getEndpointFromConfig = async (serviceId) => {
50
+ const ignore = await loadConfig(ignoreConfiguredEndpointUrlsConfigSelectors)();
51
+ if (ignore) {
52
+ return undefined;
53
+ }
54
+ return loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
55
+ };
40
56
 
41
57
  const resolveParamsForS3 = async (endpointParams) => {
42
58
  const bucket = endpointParams?.Bucket || "";
@@ -127,7 +143,7 @@ const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config,
127
143
 
128
144
  function bindGetEndpointFromInstructions(getEndpointFromConfig) {
129
145
  return async (commandInput, instructionsSupplier, clientConfig, context) => {
130
- if (!clientConfig.isCustomEndpoint) {
146
+ if (!clientConfig.isCustomEndpoint && !clientConfig.ignoreConfiguredEndpointUrls) {
131
147
  let endpointFromConfig;
132
148
  if (clientConfig.serviceConfiguredEndpoint) {
133
149
  endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
@@ -138,6 +154,7 @@ function bindGetEndpointFromInstructions(getEndpointFromConfig) {
138
154
  if (endpointFromConfig) {
139
155
  clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
140
156
  clientConfig.isCustomEndpoint = true;
157
+ context?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${endpointFromConfig}`);
141
158
  }
142
159
  }
143
160
  const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
@@ -268,6 +285,7 @@ function bindResolveEndpointConfig(getEndpointFromConfig) {
268
285
  isCustomEndpoint,
269
286
  useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
270
287
  useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),
288
+ ignoreConfiguredEndpointUrls: !!input.ignoreConfiguredEndpointUrls,
271
289
  });
272
290
  let configuredEndpointPromise = undefined;
273
291
  resolvedConfig.serviceConfiguredEndpoint = async () => {
@@ -1,5 +1,6 @@
1
1
  const { Crc32 } = require("@smithy/core/checksum");
2
2
  const { toHex, fromHex, toUtf8, fromUtf8 } = require("@smithy/core/serde");
3
+ const { TypeRegistry } = require("@smithy/core/schema");
3
4
 
4
5
  class Int64 {
5
6
  bytes;
@@ -591,12 +592,14 @@ class EventStreamSerde {
591
592
  deserializer;
592
593
  serdeContext;
593
594
  defaultContentType;
594
- constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }) {
595
+ compositeErrorRegistry;
596
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {
595
597
  this.marshaller = marshaller;
596
598
  this.serializer = serializer;
597
599
  this.deserializer = deserializer;
598
600
  this.serdeContext = serdeContext;
599
601
  this.defaultContentType = defaultContentType;
602
+ this.compositeErrorRegistry = compositeErrorRegistry;
600
603
  }
601
604
  async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
602
605
  const marshaller = this.marshaller;
@@ -712,16 +715,9 @@ class EventStreamSerde {
712
715
  }
713
716
  }
714
717
  }
715
- if (hasBindings) {
716
- return {
717
- [unionMember]: out,
718
- };
719
- }
720
- if (body.byteLength === 0) {
721
- return {
722
- [unionMember]: {},
723
- };
724
- }
718
+ return {
719
+ [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),
720
+ };
725
721
  }
726
722
  return {
727
723
  [unionMember]: await this.deserializer.read(eventStreamSchema, body),
@@ -761,6 +757,33 @@ class EventStreamSerde {
761
757
  },
762
758
  };
763
759
  }
760
+ async readEventMember(eventStreamSchema, body, hasBindings, out) {
761
+ let ErrCtor;
762
+ const staticStructuralSchema = eventStreamSchema.getSchema();
763
+ if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {
764
+ const namespace = staticStructuralSchema[1];
765
+ const nsRegistry = TypeRegistry.for(namespace);
766
+ this.compositeErrorRegistry?.copyFrom(nsRegistry);
767
+ ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);
768
+ }
769
+ const dataObject = hasBindings
770
+ ? out
771
+ : body.byteLength === 0
772
+ ? {}
773
+ : await this.deserializer.read(eventStreamSchema, body);
774
+ if (ErrCtor) {
775
+ const message = dataObject.message ?? dataObject.Message ?? "Unknown";
776
+ const metadata = {};
777
+ const $fault = eventStreamSchema.getMergedTraits().error;
778
+ if ($fault) {
779
+ metadata.$fault = $fault;
780
+ }
781
+ return Object.assign(new ErrCtor({}), metadata, {
782
+ message,
783
+ }, dataObject);
784
+ }
785
+ return dataObject;
786
+ }
764
787
  writeEventBody(unionMember, unionSchema, event) {
765
788
  const serializer = this.serializer;
766
789
  let eventType = unionMember;
@@ -1,6 +1,7 @@
1
1
  const { Crc32 } = require("@smithy/core/checksum");
2
2
  const { toHex, fromHex, toUtf8, fromUtf8 } = require("@smithy/core/serde");
3
3
  const { Readable } = require("node:stream");
4
+ const { TypeRegistry } = require("@smithy/core/schema");
4
5
 
5
6
  class Int64 {
6
7
  bytes;
@@ -616,12 +617,14 @@ class EventStreamSerde {
616
617
  deserializer;
617
618
  serdeContext;
618
619
  defaultContentType;
619
- constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }) {
620
+ compositeErrorRegistry;
621
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {
620
622
  this.marshaller = marshaller;
621
623
  this.serializer = serializer;
622
624
  this.deserializer = deserializer;
623
625
  this.serdeContext = serdeContext;
624
626
  this.defaultContentType = defaultContentType;
627
+ this.compositeErrorRegistry = compositeErrorRegistry;
625
628
  }
626
629
  async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
627
630
  const marshaller = this.marshaller;
@@ -737,16 +740,9 @@ class EventStreamSerde {
737
740
  }
738
741
  }
739
742
  }
740
- if (hasBindings) {
741
- return {
742
- [unionMember]: out,
743
- };
744
- }
745
- if (body.byteLength === 0) {
746
- return {
747
- [unionMember]: {},
748
- };
749
- }
743
+ return {
744
+ [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),
745
+ };
750
746
  }
751
747
  return {
752
748
  [unionMember]: await this.deserializer.read(eventStreamSchema, body),
@@ -786,6 +782,33 @@ class EventStreamSerde {
786
782
  },
787
783
  };
788
784
  }
785
+ async readEventMember(eventStreamSchema, body, hasBindings, out) {
786
+ let ErrCtor;
787
+ const staticStructuralSchema = eventStreamSchema.getSchema();
788
+ if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {
789
+ const namespace = staticStructuralSchema[1];
790
+ const nsRegistry = TypeRegistry.for(namespace);
791
+ this.compositeErrorRegistry?.copyFrom(nsRegistry);
792
+ ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);
793
+ }
794
+ const dataObject = hasBindings
795
+ ? out
796
+ : body.byteLength === 0
797
+ ? {}
798
+ : await this.deserializer.read(eventStreamSchema, body);
799
+ if (ErrCtor) {
800
+ const message = dataObject.message ?? dataObject.Message ?? "Unknown";
801
+ const metadata = {};
802
+ const $fault = eventStreamSchema.getMergedTraits().error;
803
+ if ($fault) {
804
+ metadata.$fault = $fault;
805
+ }
806
+ return Object.assign(new ErrCtor({}), metadata, {
807
+ message,
808
+ }, dataObject);
809
+ }
810
+ return dataObject;
811
+ }
789
812
  writeEventBody(unionMember, unionSchema, event) {
790
813
  const serializer = this.serializer;
791
814
  let eventType = unionMember;
@@ -155,6 +155,7 @@ class HttpProtocol extends SerdeContext {
155
155
  deserializer: this.deserializer,
156
156
  serdeContext: this.serdeContext,
157
157
  defaultContentType: this.getDefaultContentType(),
158
+ compositeErrorRegistry: this.compositeErrorRegistry,
158
159
  });
159
160
  }
160
161
  resolveEventStreamMarshaller(importedProvider) {
@@ -1,3 +1,10 @@
1
1
  import { loadConfig } from "@smithy/core/config";
2
2
  import { getEndpointUrlConfig } from "./getEndpointUrlConfig";
3
- export const getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
3
+ import { ignoreConfiguredEndpointUrlsConfigSelectors } from "./getIgnoreConfiguredEndpointUrls";
4
+ export const getEndpointFromConfig = async (serviceId) => {
5
+ const ignore = await loadConfig(ignoreConfiguredEndpointUrlsConfigSelectors)();
6
+ if (ignore) {
7
+ return undefined;
8
+ }
9
+ return loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
10
+ };
@@ -3,7 +3,7 @@ import { createConfigValueProvider } from "./createConfigValueProvider";
3
3
  import { toEndpointV1 } from "./toEndpointV1";
4
4
  export function bindGetEndpointFromInstructions(getEndpointFromConfig) {
5
5
  return async (commandInput, instructionsSupplier, clientConfig, context) => {
6
- if (!clientConfig.isCustomEndpoint) {
6
+ if (!clientConfig.isCustomEndpoint && !clientConfig.ignoreConfiguredEndpointUrls) {
7
7
  let endpointFromConfig;
8
8
  if (clientConfig.serviceConfiguredEndpoint) {
9
9
  endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
@@ -14,6 +14,7 @@ export function bindGetEndpointFromInstructions(getEndpointFromConfig) {
14
14
  if (endpointFromConfig) {
15
15
  clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
16
16
  clientConfig.isCustomEndpoint = true;
17
+ context?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${endpointFromConfig}`);
17
18
  }
18
19
  }
19
20
  const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
@@ -1,6 +1,6 @@
1
1
  import { CONFIG_PREFIX_SEPARATOR } from "@smithy/core/config";
2
- const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
3
- const CONFIG_ENDPOINT_URL = "endpoint_url";
2
+ export const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
3
+ export const CONFIG_ENDPOINT_URL = "endpoint_url";
4
4
  export const getEndpointUrlConfig = (serviceId) => ({
5
5
  environmentVariableSelector: (env) => {
6
6
  const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
@@ -13,14 +13,16 @@ export const getEndpointUrlConfig = (serviceId) => ({
13
13
  return undefined;
14
14
  },
15
15
  configFileSelector: (profile, config) => {
16
- if (config && profile.services) {
17
- const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
18
- if (servicesSection) {
19
- const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
20
- const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
21
- if (endpointUrl)
22
- return endpointUrl;
16
+ if (profile.services) {
17
+ const servicesSectionKey = ["services", profile.services].join(CONFIG_PREFIX_SEPARATOR);
18
+ if (!config || !config[servicesSectionKey]) {
19
+ throw new Error(`The services section "${profile.services}" specified in the profile is not present in the shared configuration file.`);
23
20
  }
21
+ const servicesSection = config[servicesSectionKey];
22
+ const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
23
+ const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
24
+ if (endpointUrl)
25
+ return endpointUrl;
24
26
  }
25
27
  const endpointUrl = profile[CONFIG_ENDPOINT_URL];
26
28
  if (endpointUrl)
@@ -0,0 +1,8 @@
1
+ import { booleanSelector, SelectorType } from "@smithy/core/config";
2
+ export const ENV_IGNORE_CONFIGURED_ENDPOINT_URLS = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS";
3
+ export const CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS = "ignore_configured_endpoint_urls";
4
+ export const ignoreConfiguredEndpointUrlsConfigSelectors = {
5
+ environmentVariableSelector: (env) => booleanSelector(env, ENV_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.ENV),
6
+ configFileSelector: (profile) => booleanSelector(profile, CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.CONFIG),
7
+ default: false,
8
+ };
@@ -12,6 +12,7 @@ export function bindResolveEndpointConfig(getEndpointFromConfig) {
12
12
  isCustomEndpoint,
13
13
  useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
14
14
  useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),
15
+ ignoreConfiguredEndpointUrls: !!input.ignoreConfiguredEndpointUrls,
15
16
  });
16
17
  let configuredEndpointPromise = undefined;
17
18
  resolvedConfig.serviceConfiguredEndpoint = async () => {
@@ -1,3 +1,4 @@
1
+ import { TypeRegistry } from "@smithy/core/schema";
1
2
  import { fromUtf8, toUtf8 } from "@smithy/core/serde";
2
3
  export class EventStreamSerde {
3
4
  marshaller;
@@ -5,12 +6,14 @@ export class EventStreamSerde {
5
6
  deserializer;
6
7
  serdeContext;
7
8
  defaultContentType;
8
- constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }) {
9
+ compositeErrorRegistry;
10
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {
9
11
  this.marshaller = marshaller;
10
12
  this.serializer = serializer;
11
13
  this.deserializer = deserializer;
12
14
  this.serdeContext = serdeContext;
13
15
  this.defaultContentType = defaultContentType;
16
+ this.compositeErrorRegistry = compositeErrorRegistry;
14
17
  }
15
18
  async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
16
19
  const marshaller = this.marshaller;
@@ -126,16 +129,9 @@ export class EventStreamSerde {
126
129
  }
127
130
  }
128
131
  }
129
- if (hasBindings) {
130
- return {
131
- [unionMember]: out,
132
- };
133
- }
134
- if (body.byteLength === 0) {
135
- return {
136
- [unionMember]: {},
137
- };
138
- }
132
+ return {
133
+ [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),
134
+ };
139
135
  }
140
136
  return {
141
137
  [unionMember]: await this.deserializer.read(eventStreamSchema, body),
@@ -175,6 +171,33 @@ export class EventStreamSerde {
175
171
  },
176
172
  };
177
173
  }
174
+ async readEventMember(eventStreamSchema, body, hasBindings, out) {
175
+ let ErrCtor;
176
+ const staticStructuralSchema = eventStreamSchema.getSchema();
177
+ if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {
178
+ const namespace = staticStructuralSchema[1];
179
+ const nsRegistry = TypeRegistry.for(namespace);
180
+ this.compositeErrorRegistry?.copyFrom(nsRegistry);
181
+ ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);
182
+ }
183
+ const dataObject = hasBindings
184
+ ? out
185
+ : body.byteLength === 0
186
+ ? {}
187
+ : await this.deserializer.read(eventStreamSchema, body);
188
+ if (ErrCtor) {
189
+ const message = dataObject.message ?? dataObject.Message ?? "Unknown";
190
+ const metadata = {};
191
+ const $fault = eventStreamSchema.getMergedTraits().error;
192
+ if ($fault) {
193
+ metadata.$fault = $fault;
194
+ }
195
+ return Object.assign(new ErrCtor({}), metadata, {
196
+ message,
197
+ }, dataObject);
198
+ }
199
+ return dataObject;
200
+ }
178
201
  writeEventBody(unionMember, unionSchema, event) {
179
202
  const serializer = this.serializer;
180
203
  let eventType = unionMember;
@@ -123,6 +123,7 @@ export class HttpProtocol extends SerdeContext {
123
123
  deserializer: this.deserializer,
124
124
  serdeContext: this.serdeContext,
125
125
  defaultContentType: this.getDefaultContentType(),
126
+ compositeErrorRegistry: this.compositeErrorRegistry,
126
127
  });
127
128
  }
128
129
  resolveEventStreamMarshaller(importedProvider) {
@@ -1,2 +1,13 @@
1
1
  import { type LoadedConfigSelectors } from "@smithy/core/config";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare const CONFIG_ENDPOINT_URL = "endpoint_url";
10
+ /**
11
+ * @internal
12
+ */
2
13
  export declare const getEndpointUrlConfig: (serviceId: string) => LoadedConfigSelectors<string | undefined>;