@cdk8s/awscdk-resolver 0.0.722 → 0.0.724

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 (128) 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-cjs/submodules/client/index.js +26 -13
  6. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +6 -3
  7. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
  8. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
  9. package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
  10. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
  14. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
  16. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +1 -0
  17. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
  18. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  19. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
  20. package/node_modules/@aws-sdk/core/package.json +2 -2
  21. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  22. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  23. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  24. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  25. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  26. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  27. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  28. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  33. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  34. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  35. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -1
  36. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  37. package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
  38. package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
  39. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -16
  40. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -13
  41. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
  42. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
  43. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
  44. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  45. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
  46. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +18 -9
  47. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +18 -9
  48. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +42 -24
  49. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +20 -10
  50. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +24 -12
  51. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
  52. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
  53. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
  54. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
  55. package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  56. package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
  57. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
  58. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
  59. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
  60. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
  61. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
  62. package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
  63. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
  64. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
  65. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
  66. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
  67. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
  68. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
  69. package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
  70. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
  71. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
  72. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
  73. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
  74. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
  75. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +2 -1
  76. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
  77. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
  78. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
  79. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
  80. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
  81. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
  82. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -1
  83. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
  84. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
  85. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
  86. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +6 -3
  87. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
  88. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
  89. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
  90. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
  91. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +6 -3
  92. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
  93. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
  94. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  95. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
  96. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
  97. package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
  98. package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
  99. package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
  100. package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
  101. package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
  102. package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +1 -0
  103. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
  104. package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +1 -0
  105. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
  106. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
  107. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  108. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
  109. package/node_modules/@smithy/core/package.json +1 -1
  110. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +19 -7
  111. package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
  112. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +11 -6
  113. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +6 -0
  114. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  115. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
  116. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
  117. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
  118. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
  119. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
  120. package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
  121. package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
  122. package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
  123. package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
  124. package/node_modules/@smithy/signature-v4/package.json +2 -2
  125. package/package.json +5 -5
  126. /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
  127. /package/node_modules/@smithy/core/dist-types/submodules/{protocols → serde}/writeKey.d.ts +0 -0
  128. /package/node_modules/@smithy/core/dist-types/ts3.4/submodules/{protocols → serde}/writeKey.d.ts +0 -0
package/.jsii CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://aws.amazon.com"
8
8
  },
9
9
  "bundled": {
10
- "@aws-sdk/client-cloudformation": "^3.1158.0"
10
+ "@aws-sdk/client-cloudformation": "^3.1160.0"
11
11
  },
12
12
  "dependencies": {
13
13
  "aws-cdk-lib": "^2.195.0",
@@ -4083,6 +4083,6 @@
4083
4083
  "symbolId": "src/resolve:AwsCdkResolver"
4084
4084
  }
4085
4085
  },
4086
- "version": "0.0.722",
4087
- "fingerprint": "4kKeeId4a9dCvP0DNpaNLA1ScCMh62pmfg0Du02YbOg="
4086
+ "version": "0.0.724",
4087
+ "fingerprint": "TpbgK0iGIhAphdMOYJ/RTIq8Dn4IxP1DjWIB6z8NOzc="
4088
4088
  }
package/lib/resolve.js CHANGED
@@ -39,7 +39,7 @@ const child_process_1 = require("child_process");
39
39
  const path = __importStar(require("path"));
40
40
  const aws_cdk_lib_1 = require("aws-cdk-lib");
41
41
  class AwsCdkResolver {
42
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@cdk8s/awscdk-resolver.AwsCdkResolver", version: "0.0.722" };
42
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@cdk8s/awscdk-resolver.AwsCdkResolver", version: "0.0.724" };
43
43
  resolve(context) {
44
44
  if (!aws_cdk_lib_1.Token.isUnresolved(context.value)) {
45
45
  return;
@@ -69,7 +69,7 @@ const commonParams = {
69
69
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
70
70
  };
71
71
 
72
- var version = "3.1157.0";
72
+ var version = "3.1159.0";
73
73
  var packageInfo = {
74
74
  version: version};
75
75
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudformation",
3
- "version": "3.1158.0",
3
+ "version": "3.1160.0",
4
4
  "description": "AWS SDK for JavaScript Cloudformation Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudformation",
6
6
  "license": "Apache-2.0",
@@ -48,8 +48,8 @@
48
48
  "test:index": "tsc -p tsconfig.test.json && node ./test/index-objects.spec.mjs"
49
49
  },
50
50
  "dependencies": {
51
- "@aws-sdk/core": "^3.978.6",
52
- "@aws-sdk/credential-provider-node": "^3.972.89",
51
+ "@aws-sdk/core": "^3.979.0",
52
+ "@aws-sdk/credential-provider-node": "^3.972.91",
53
53
  "@aws-sdk/types": "^3.975.0",
54
54
  "@smithy/core": "^3.37.0",
55
55
  "@smithy/fetch-http-handler": "^5.8.0",
@@ -91,8 +91,9 @@ function resolveHostHeaderConfig(input) {
91
91
  return input;
92
92
  }
93
93
  const hostHeaderMiddleware = (options) => (next) => async (args) => {
94
- if (!HttpRequest.isInstance(args.request))
94
+ if (!HttpRequest.isInstance(args.request)) {
95
95
  return next(args);
96
+ }
96
97
  const { request } = args;
97
98
  const { handlerProtocol = "" } = options.requestHandler.metadata || {};
98
99
  if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
@@ -101,8 +102,9 @@ const hostHeaderMiddleware = (options) => (next) => async (args) => {
101
102
  }
102
103
  else if (!request.headers["host"]) {
103
104
  let host = request.hostname;
104
- if (request.port != null)
105
+ if (request.port != null) {
105
106
  host += `:${request.port}`;
107
+ }
106
108
  request.headers["host"] = host;
107
109
  }
108
110
  return next(args);
@@ -813,27 +815,36 @@ const createUserAgentStringParsingProvider = ({ serviceId, clientVersion }) => a
813
815
 
814
816
  const fallback = {
815
817
  os(ua) {
816
- if (/iPhone|iPad|iPod/.test(ua))
818
+ if (/iPhone|iPad|iPod/.test(ua)) {
817
819
  return "iOS";
818
- if (/Macintosh|Mac OS X/.test(ua))
820
+ }
821
+ if (/Macintosh|Mac OS X/.test(ua)) {
819
822
  return "macOS";
820
- if (/Windows NT/.test(ua))
823
+ }
824
+ if (/Windows NT/.test(ua)) {
821
825
  return "Windows";
822
- if (/Android/.test(ua))
826
+ }
827
+ if (/Android/.test(ua)) {
823
828
  return "Android";
824
- if (/Linux/.test(ua))
829
+ }
830
+ if (/Linux/.test(ua)) {
825
831
  return "Linux";
832
+ }
826
833
  return undefined;
827
834
  },
828
835
  browser(ua) {
829
- if (/EdgiOS|EdgA|Edg\//.test(ua))
836
+ if (/EdgiOS|EdgA|Edg\//.test(ua)) {
830
837
  return "Microsoft Edge";
831
- if (/Firefox\//.test(ua))
838
+ }
839
+ if (/Firefox\//.test(ua)) {
832
840
  return "Firefox";
833
- if (/Chrome\//.test(ua))
841
+ }
842
+ if (/Chrome\//.test(ua)) {
834
843
  return "Chrome";
835
- if (/Safari\//.test(ua))
844
+ }
845
+ if (/Safari\//.test(ua)) {
836
846
  return "Safari";
847
+ }
837
848
  return undefined;
838
849
  },
839
850
  };
@@ -866,11 +877,13 @@ const ARN_DELIMITER = ":";
866
877
  const RESOURCE_DELIMITER = "/";
867
878
  const parseArn = (value) => {
868
879
  const segments = value.split(ARN_DELIMITER);
869
- if (segments.length < 6)
880
+ if (segments.length < 6) {
870
881
  return null;
882
+ }
871
883
  const [arn, partition, service, region, accountId, ...resourcePath] = segments;
872
- if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
884
+ if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") {
873
885
  return null;
886
+ }
874
887
  const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
875
888
  return {
876
889
  partition,
@@ -157,16 +157,19 @@ const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
157
157
  environmentVariableSelector: (env, options) => {
158
158
  if (options?.signingName) {
159
159
  const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
160
- if (bearerTokenKey in env)
160
+ if (bearerTokenKey in env) {
161
161
  return ["httpBearerAuth"];
162
+ }
162
163
  }
163
- if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env))
164
+ if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) {
164
165
  return undefined;
166
+ }
165
167
  return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
166
168
  },
167
169
  configFileSelector: (profile) => {
168
- if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))
170
+ if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) {
169
171
  return undefined;
172
+ }
170
173
  return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
171
174
  },
172
175
  default: [],
@@ -1,7 +1,7 @@
1
1
  const { SmithyRpcV2CborProtocol, loadSmithyRpcV2CborErrorCode } = require("@smithy/core/cbor");
2
2
  const { TypeRegistry, NormalizedSchema, deref } = require("@smithy/core/schema");
3
3
  const { decorateServiceException, getValueFromTextNode } = require("@smithy/core/client");
4
- const { RpcProtocol, JsonCodec2, loadJsonRpcErrorCode, HttpBindingProtocol, HttpInterceptingShapeSerializer, HttpInterceptingShapeDeserializer, loadRestJsonErrorCode, FromStringShapeDeserializer, determineTimestampFormat, extendedEncodeURIComponent, collectBody } = require("@smithy/core/protocols");
4
+ const { RpcProtocol, JsonCodec2, loadJsonRpcErrorCode, HttpBindingProtocol, HttpInterceptingShapeSerializer, HttpInterceptingShapeDeserializer, loadRestJsonErrorCode, SmithyRpcV2JsonProtocol, loadSmithyRpcV2JsonErrorCode, FromStringShapeDeserializer, determineTimestampFormat, extendedEncodeURIComponent, collectBody } = require("@smithy/core/protocols");
5
5
  const { JsonCodec, JsonShapeDeserializer, JsonShapeDeserializer2, JsonShapeSerializer, JsonShapeSerializer2, parseJsonBody, parseJsonErrorBody } = require("@smithy/core/protocols");
6
6
  exports.JsonCodec = JsonCodec;
7
7
  exports.JsonCodec2 = JsonCodec2;
@@ -401,6 +401,55 @@ class AwsRestJsonProtocol extends HttpBindingProtocol {
401
401
  }
402
402
  }
403
403
 
404
+ class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
405
+ awsQueryCompatible;
406
+ mixin;
407
+ constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }) {
408
+ super({ defaultNamespace, errorTypeRegistries });
409
+ this.awsQueryCompatible = !!awsQueryCompatible;
410
+ this.mixin = new ProtocolLib(this.awsQueryCompatible);
411
+ }
412
+ async serializeRequest(operationSchema, input, context) {
413
+ const request = await super.serializeRequest(operationSchema, input, context);
414
+ if (this.awsQueryCompatible) {
415
+ request.headers["x-amzn-query-mode"] = "true";
416
+ }
417
+ return request;
418
+ }
419
+ async handleError(operationSchema, context, response, dataObject, metadata) {
420
+ if (this.awsQueryCompatible) {
421
+ this.mixin.setQueryCompatError(dataObject, response);
422
+ }
423
+ const errorName = (() => {
424
+ const compatHeader = response.headers["x-amzn-query-error"];
425
+ if (compatHeader && this.awsQueryCompatible) {
426
+ return compatHeader.split(";")[0];
427
+ }
428
+ return loadSmithyRpcV2JsonErrorCode(response, dataObject) ?? "Unknown";
429
+ })();
430
+ this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
431
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
432
+ const ns = NormalizedSchema.of(errorSchema);
433
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
434
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
435
+ const exception = new ErrorCtor({});
436
+ const output = {};
437
+ const errorDeserializer = this.getPayloadCodec().createDeserializer();
438
+ for (const [name, member] of ns.structIterator()) {
439
+ if (dataObject[name] != null) {
440
+ output[name] = errorDeserializer.readObject(member, dataObject[name]);
441
+ }
442
+ }
443
+ if (this.awsQueryCompatible) {
444
+ this.mixin.queryCompatOutput(dataObject, output);
445
+ }
446
+ throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
447
+ $fault: ns.getMergedTraits().error,
448
+ message,
449
+ }, output), dataObject);
450
+ }
451
+ }
452
+
404
453
  class SerdeContextConfig {
405
454
  serdeContext;
406
455
  setSerdeContext(serdeContext) {
@@ -1441,6 +1490,7 @@ exports.AwsQueryProtocol = AwsQueryProtocol;
1441
1490
  exports.AwsRestJsonProtocol = AwsRestJsonProtocol;
1442
1491
  exports.AwsRestXmlProtocol = AwsRestXmlProtocol;
1443
1492
  exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol;
1493
+ exports.AwsSmithyRpcV2JsonProtocol = AwsSmithyRpcV2JsonProtocol;
1444
1494
  exports.QueryShapeSerializer = QueryShapeSerializer;
1445
1495
  exports.XmlCodec = XmlCodec;
1446
1496
  exports.XmlShapeDeserializer = XmlShapeDeserializer;
@@ -3,8 +3,9 @@ const { buildQueryString } = require("@smithy/core/protocols");
3
3
  const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
4
4
  const parse = (arn) => {
5
5
  const segments = arn.split(":");
6
- if (segments.length < 6 || segments[0] !== "arn")
6
+ if (segments.length < 6 || segments[0] !== "arn") {
7
7
  throw new Error("Malformed ARN");
8
+ }
8
9
  const [, partition, service, region, accountId, ...resource] = segments;
9
10
  return {
10
11
  partition,
@@ -3,8 +3,9 @@ export function resolveHostHeaderConfig(input) {
3
3
  return input;
4
4
  }
5
5
  export const hostHeaderMiddleware = (options) => (next) => async (args) => {
6
- if (!HttpRequest.isInstance(args.request))
6
+ if (!HttpRequest.isInstance(args.request)) {
7
7
  return next(args);
8
+ }
8
9
  const { request } = args;
9
10
  const { handlerProtocol = "" } = options.requestHandler.metadata || {};
10
11
  if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
@@ -13,8 +14,9 @@ export const hostHeaderMiddleware = (options) => (next) => async (args) => {
13
14
  }
14
15
  else if (!request.headers["host"]) {
15
16
  let host = request.hostname;
16
- if (request.port != null)
17
+ if (request.port != null) {
17
18
  host += `:${request.port}`;
19
+ }
18
20
  request.headers["host"] = host;
19
21
  }
20
22
  return next(args);
@@ -2,11 +2,13 @@ const ARN_DELIMITER = ":";
2
2
  const RESOURCE_DELIMITER = "/";
3
3
  export const parseArn = (value) => {
4
4
  const segments = value.split(ARN_DELIMITER);
5
- if (segments.length < 6)
5
+ if (segments.length < 6) {
6
6
  return null;
7
+ }
7
8
  const [arn, partition, service, region, accountId, ...resourcePath] = segments;
8
- if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
9
+ if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") {
9
10
  return null;
11
+ }
10
12
  const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
11
13
  return {
12
14
  partition,
@@ -26,27 +26,36 @@ export const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) =>
26
26
  };
27
27
  export const fallback = {
28
28
  os(ua) {
29
- if (/iPhone|iPad|iPod/.test(ua))
29
+ if (/iPhone|iPad|iPod/.test(ua)) {
30
30
  return "iOS";
31
- if (/Macintosh|Mac OS X/.test(ua))
31
+ }
32
+ if (/Macintosh|Mac OS X/.test(ua)) {
32
33
  return "macOS";
33
- if (/Windows NT/.test(ua))
34
+ }
35
+ if (/Windows NT/.test(ua)) {
34
36
  return "Windows";
35
- if (/Android/.test(ua))
37
+ }
38
+ if (/Android/.test(ua)) {
36
39
  return "Android";
37
- if (/Linux/.test(ua))
40
+ }
41
+ if (/Linux/.test(ua)) {
38
42
  return "Linux";
43
+ }
39
44
  return undefined;
40
45
  },
41
46
  browser(ua) {
42
- if (/EdgiOS|EdgA|Edg\//.test(ua))
47
+ if (/EdgiOS|EdgA|Edg\//.test(ua)) {
43
48
  return "Microsoft Edge";
44
- if (/Firefox\//.test(ua))
49
+ }
50
+ if (/Firefox\//.test(ua)) {
45
51
  return "Firefox";
46
- if (/Chrome\//.test(ua))
52
+ }
53
+ if (/Chrome\//.test(ua)) {
47
54
  return "Chrome";
48
- if (/Safari\//.test(ua))
55
+ }
56
+ if (/Safari\//.test(ua)) {
49
57
  return "Safari";
58
+ }
50
59
  return undefined;
51
60
  },
52
61
  };
@@ -6,16 +6,19 @@ export const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
6
6
  environmentVariableSelector: (env, options) => {
7
7
  if (options?.signingName) {
8
8
  const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
9
- if (bearerTokenKey in env)
9
+ if (bearerTokenKey in env) {
10
10
  return ["httpBearerAuth"];
11
+ }
11
12
  }
12
- if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env))
13
+ if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) {
13
14
  return undefined;
15
+ }
14
16
  return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
15
17
  },
16
18
  configFileSelector: (profile) => {
17
- if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))
19
+ if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) {
18
20
  return undefined;
21
+ }
19
22
  return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
20
23
  },
21
24
  default: [],
@@ -3,6 +3,7 @@ export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
3
3
  export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
4
4
  export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
5
5
  export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
6
+ export { AwsSmithyRpcV2JsonProtocol } from "./json/AwsSmithyRpcV2JsonProtocol";
6
7
  export { JsonCodec, JsonCodec2, JsonShapeDeserializer, JsonShapeDeserializer2, JsonShapeSerializer, JsonShapeSerializer2, loadJsonRpcErrorCode, loadRestJsonErrorCode, parseJsonBody, parseJsonErrorBody, } from "@smithy/core/protocols";
7
8
  export { AwsEc2QueryProtocol } from "./query/AwsEc2QueryProtocol";
8
9
  export { AwsQueryProtocol } from "./query/AwsQueryProtocol";
@@ -0,0 +1,51 @@
1
+ import { loadSmithyRpcV2JsonErrorCode, SmithyRpcV2JsonProtocol } from "@smithy/core/protocols";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
+ import { ProtocolLib } from "../ProtocolLib";
4
+ export class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
5
+ awsQueryCompatible;
6
+ mixin;
7
+ constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }) {
8
+ super({ defaultNamespace, errorTypeRegistries });
9
+ this.awsQueryCompatible = !!awsQueryCompatible;
10
+ this.mixin = new ProtocolLib(this.awsQueryCompatible);
11
+ }
12
+ async serializeRequest(operationSchema, input, context) {
13
+ const request = await super.serializeRequest(operationSchema, input, context);
14
+ if (this.awsQueryCompatible) {
15
+ request.headers["x-amzn-query-mode"] = "true";
16
+ }
17
+ return request;
18
+ }
19
+ async handleError(operationSchema, context, response, dataObject, metadata) {
20
+ if (this.awsQueryCompatible) {
21
+ this.mixin.setQueryCompatError(dataObject, response);
22
+ }
23
+ const errorName = (() => {
24
+ const compatHeader = response.headers["x-amzn-query-error"];
25
+ if (compatHeader && this.awsQueryCompatible) {
26
+ return compatHeader.split(";")[0];
27
+ }
28
+ return loadSmithyRpcV2JsonErrorCode(response, dataObject) ?? "Unknown";
29
+ })();
30
+ this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
31
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
32
+ const ns = NormalizedSchema.of(errorSchema);
33
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
34
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
35
+ const exception = new ErrorCtor({});
36
+ const output = {};
37
+ const errorDeserializer = this.getPayloadCodec().createDeserializer();
38
+ for (const [name, member] of ns.structIterator()) {
39
+ if (dataObject[name] != null) {
40
+ output[name] = errorDeserializer.readObject(member, dataObject[name]);
41
+ }
42
+ }
43
+ if (this.awsQueryCompatible) {
44
+ this.mixin.queryCompatOutput(dataObject, output);
45
+ }
46
+ throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
47
+ $fault: ns.getMergedTraits().error,
48
+ message,
49
+ }, output), dataObject);
50
+ }
51
+ }
@@ -1,8 +1,9 @@
1
1
  export const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
2
2
  export const parse = (arn) => {
3
3
  const segments = arn.split(":");
4
- if (segments.length < 6 || segments[0] !== "arn")
4
+ if (segments.length < 6 || segments[0] !== "arn") {
5
5
  throw new Error("Malformed ARN");
6
+ }
6
7
  const [, partition, service, region, accountId, ...resource] = segments;
7
8
  return {
8
9
  partition,
@@ -3,6 +3,7 @@ export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
3
3
  export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
4
4
  export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
5
5
  export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
6
+ export { AwsSmithyRpcV2JsonProtocol } from "./json/AwsSmithyRpcV2JsonProtocol";
6
7
  export { JsonCodec, JsonCodec2, JsonShapeDeserializer, JsonShapeDeserializer2, JsonShapeSerializer, JsonShapeSerializer2, loadJsonRpcErrorCode, loadRestJsonErrorCode, parseJsonBody, parseJsonErrorBody, } from "@smithy/core/protocols";
7
8
  export type { JsonSettings } from "@smithy/core/protocols";
8
9
  export { AwsEc2QueryProtocol } from "./query/AwsEc2QueryProtocol";
@@ -0,0 +1,25 @@
1
+ import { SmithyRpcV2JsonProtocol } from "@smithy/core/protocols";
2
+ import type { TypeRegistry } from "@smithy/core/schema";
3
+ import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
4
+ /**
5
+ * Extends the Smithy implementation to add AwsQueryCompatibility support.
6
+ *
7
+ * @public
8
+ */
9
+ export declare class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
10
+ private readonly awsQueryCompatible;
11
+ private readonly mixin;
12
+ constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }: {
13
+ defaultNamespace: string;
14
+ errorTypeRegistries?: TypeRegistry[];
15
+ awsQueryCompatible?: boolean;
16
+ });
17
+ /**
18
+ * @override
19
+ */
20
+ serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
21
+ /**
22
+ * @override
23
+ */
24
+ protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
25
+ }
@@ -3,6 +3,7 @@ export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
3
3
  export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
4
4
  export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
5
5
  export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
6
+ export { AwsSmithyRpcV2JsonProtocol } from "./json/AwsSmithyRpcV2JsonProtocol";
6
7
  export {
7
8
  JsonCodec,
8
9
  JsonCodec2,
@@ -0,0 +1,36 @@
1
+ import { SmithyRpcV2JsonProtocol } from "@smithy/core/protocols";
2
+ import { TypeRegistry } from "@smithy/core/schema";
3
+ import {
4
+ EndpointBearer,
5
+ HandlerExecutionContext,
6
+ HttpRequest,
7
+ HttpResponse,
8
+ OperationSchema,
9
+ ResponseMetadata,
10
+ SerdeFunctions,
11
+ } from "@smithy/types";
12
+ export declare class AwsSmithyRpcV2JsonProtocol extends SmithyRpcV2JsonProtocol {
13
+ private readonly awsQueryCompatible;
14
+ private readonly mixin;
15
+ constructor({
16
+ defaultNamespace,
17
+ errorTypeRegistries,
18
+ awsQueryCompatible,
19
+ }: {
20
+ defaultNamespace: string;
21
+ errorTypeRegistries?: TypeRegistry[];
22
+ awsQueryCompatible?: boolean;
23
+ });
24
+ serializeRequest<Input extends object>(
25
+ operationSchema: OperationSchema,
26
+ input: Input,
27
+ context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
28
+ ): Promise<HttpRequest>;
29
+ protected handleError(
30
+ operationSchema: OperationSchema,
31
+ context: HandlerExecutionContext & SerdeFunctions,
32
+ response: HttpResponse,
33
+ dataObject: any,
34
+ metadata: ResponseMetadata,
35
+ ): Promise<never>;
36
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.978.6",
3
+ "version": "3.979.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/core",
6
6
  "license": "Apache-2.0",
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "dependencies": {
127
127
  "@aws-sdk/types": "^3.975.0",
128
- "@aws-sdk/xml-builder": "^3.972.41",
128
+ "@aws-sdk/xml-builder": "^3.972.42",
129
129
  "@aws/lambda-invoke-store": "^0.3.0",
130
130
  "@smithy/core": "^3.37.0",
131
131
  "@smithy/signature-v4": "^5.7.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-env",
3
- "version": "3.972.77",
3
+ "version": "3.972.79",
4
4
  "description": "AWS credential provider that sources credentials from known environment variables",
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.978.6",
46
+ "@aws-sdk/core": "^3.979.0",
47
47
  "@aws-sdk/types": "^3.975.0",
48
48
  "@smithy/core": "^3.37.0",
49
49
  "@smithy/types": "^4.19.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-http",
3
- "version": "3.972.79",
3
+ "version": "3.972.81",
4
4
  "description": "AWS credential provider for containers and HTTP sources",
5
5
  "keywords": [
6
6
  "aws",
@@ -53,7 +53,7 @@
53
53
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
54
54
  },
55
55
  "dependencies": {
56
- "@aws-sdk/core": "^3.978.6",
56
+ "@aws-sdk/core": "^3.979.0",
57
57
  "@aws-sdk/types": "^3.975.0",
58
58
  "@smithy/core": "^3.37.0",
59
59
  "@smithy/fetch-http-handler": "^5.8.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-ini",
3
- "version": "3.973.22",
3
+ "version": "3.973.24",
4
4
  "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
5
5
  "keywords": [
6
6
  "aws",
@@ -45,14 +45,14 @@
45
45
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
46
46
  },
47
47
  "dependencies": {
48
- "@aws-sdk/core": "^3.978.6",
49
- "@aws-sdk/credential-provider-env": "^3.972.77",
50
- "@aws-sdk/credential-provider-http": "^3.972.79",
51
- "@aws-sdk/credential-provider-login": "^3.972.84",
52
- "@aws-sdk/credential-provider-process": "^3.972.77",
53
- "@aws-sdk/credential-provider-sso": "^3.973.21",
54
- "@aws-sdk/credential-provider-web-identity": "^3.972.83",
55
- "@aws-sdk/nested-clients": "^3.997.51",
48
+ "@aws-sdk/core": "^3.979.0",
49
+ "@aws-sdk/credential-provider-env": "^3.972.79",
50
+ "@aws-sdk/credential-provider-http": "^3.972.81",
51
+ "@aws-sdk/credential-provider-login": "^3.972.86",
52
+ "@aws-sdk/credential-provider-process": "^3.972.79",
53
+ "@aws-sdk/credential-provider-sso": "^3.973.23",
54
+ "@aws-sdk/credential-provider-web-identity": "^3.972.85",
55
+ "@aws-sdk/nested-clients": "^3.997.53",
56
56
  "@aws-sdk/types": "^3.975.0",
57
57
  "@smithy/core": "^3.37.0",
58
58
  "@smithy/credential-provider-imds": "^4.5.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-login",
3
- "version": "3.972.84",
3
+ "version": "3.972.86",
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.978.6",
49
- "@aws-sdk/nested-clients": "^3.997.51",
48
+ "@aws-sdk/core": "^3.979.0",
49
+ "@aws-sdk/nested-clients": "^3.997.53",
50
50
  "@aws-sdk/types": "^3.975.0",
51
51
  "@smithy/core": "^3.37.0",
52
52
  "@smithy/types": "^4.19.0",