@aws-sdk/core 3.974.8 → 3.974.9

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 (53) hide show
  1. package/dist-cjs/index.js +65 -51
  2. package/dist-cjs/submodules/account-id-endpoint/index.js +2 -2
  3. package/dist-cjs/submodules/client/index.js +2 -2
  4. package/dist-cjs/submodules/httpAuthSchemes/index.js +7 -7
  5. package/dist-cjs/submodules/protocols/index.js +56 -41
  6. package/dist-cjs/submodules/util/index.js +59 -0
  7. package/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.js +1 -1
  8. package/dist-es/submodules/client/setFeature.js +1 -1
  9. package/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +1 -1
  10. package/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +1 -1
  11. package/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js +1 -1
  12. package/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -1
  13. package/dist-es/submodules/protocols/ProtocolLib.js +1 -1
  14. package/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +1 -1
  15. package/dist-es/submodules/protocols/common.js +2 -2
  16. package/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +7 -6
  17. package/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
  18. package/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +1 -1
  19. package/dist-es/submodules/protocols/json/JsonShapeSerializer.js +1 -2
  20. package/dist-es/submodules/protocols/json/awsExpectUnion.js +1 -1
  21. package/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +1 -2
  22. package/dist-es/submodules/protocols/json/parseJsonBody.js +28 -13
  23. package/dist-es/submodules/protocols/query/AwsQueryProtocol.js +1 -1
  24. package/dist-es/submodules/protocols/query/QueryShapeSerializer.js +2 -3
  25. package/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +1 -1
  26. package/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +2 -2
  27. package/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +2 -3
  28. package/dist-es/submodules/protocols/xml/parseXmlBody.js +1 -1
  29. package/dist-es/submodules/util/index.js +2 -0
  30. package/dist-es/submodules/util/util-arn-parser/arn.js +21 -0
  31. package/dist-es/submodules/util/util-format-url/format-url.js +29 -0
  32. package/dist-types/api-extractor-type-index.d.ts +1 -0
  33. package/dist-types/index.d.ts +1 -0
  34. package/dist-types/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +1 -1
  35. package/dist-types/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +1 -1
  36. package/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
  37. package/dist-types/submodules/protocols/ProtocolLib.d.ts +1 -1
  38. package/dist-types/submodules/protocols/json/parseJsonBody.d.ts +4 -0
  39. package/dist-types/submodules/util/index.d.ts +2 -0
  40. package/dist-types/submodules/util/util-arn-parser/arn.d.ts +32 -0
  41. package/dist-types/submodules/util/util-format-url/format-url.d.ts +2 -0
  42. package/dist-types/ts3.4/api-extractor-type-index.d.ts +1 -0
  43. package/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +1 -1
  44. package/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +1 -1
  45. package/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
  46. package/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +1 -1
  47. package/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +6 -0
  48. package/dist-types/ts3.4/submodules/util/index.d.ts +2 -0
  49. package/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +14 -0
  50. package/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +4 -0
  51. package/package.json +16 -13
  52. package/util.d.ts +7 -0
  53. package/util.js +5 -0
package/dist-cjs/index.js CHANGED
@@ -1,18 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var utilRetry = require('@smithy/util-retry');
4
- var protocolHttp = require('@smithy/protocol-http');
3
+ var retry = require('@smithy/core/retry');
4
+ var protocols = require('@smithy/core/protocols');
5
5
  var core = require('@smithy/core');
6
- var propertyProvider = require('@smithy/property-provider');
6
+ var config = require('@smithy/core/config');
7
7
  var client = require('@aws-sdk/core/client');
8
8
  var signatureV4 = require('@smithy/signature-v4');
9
9
  var cbor = require('@smithy/core/cbor');
10
10
  var schema = require('@smithy/core/schema');
11
- var smithyClient = require('@smithy/smithy-client');
12
- var protocols = require('@smithy/core/protocols');
11
+ var client$1 = require('@smithy/core/client');
13
12
  var serde = require('@smithy/core/serde');
14
- var utilBase64 = require('@smithy/util-base64');
15
- var utilUtf8 = require('@smithy/util-utf8');
16
13
  var xmlBuilder = require('@aws-sdk/xml-builder');
17
14
 
18
15
  const state = {
@@ -64,7 +61,7 @@ function setCredentialFeature(credentials, feature, value) {
64
61
  return credentials;
65
62
  }
66
63
 
67
- utilRetry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
64
+ retry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
68
65
  function setFeature(context, feature, value) {
69
66
  if (!context.__aws_sdk_context) {
70
67
  context.__aws_sdk_context = {
@@ -85,7 +82,7 @@ function setTokenFeature(token, feature, value) {
85
82
  return token;
86
83
  }
87
84
 
88
- const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
85
+ const getDateHeader = (response) => protocols.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
89
86
 
90
87
  const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
91
88
 
@@ -124,7 +121,7 @@ const validateSigningProperties = async (signingProperties) => {
124
121
  };
125
122
  class AwsSdkSigV4Signer {
126
123
  async sign(httpRequest, identity, signingProperties) {
127
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
124
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
128
125
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
129
126
  }
130
127
  const validatedProps = await validateSigningProperties(signingProperties);
@@ -172,7 +169,7 @@ const AWSSDKSigV4Signer = AwsSdkSigV4Signer;
172
169
 
173
170
  class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
174
171
  async sign(httpRequest, identity, signingProperties) {
175
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
172
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
176
173
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
177
174
  }
178
175
  const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
@@ -222,7 +219,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
222
219
  if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
223
220
  return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
224
221
  }
225
- throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
222
+ throw new config.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
226
223
  tryNextLink: true,
227
224
  });
228
225
  },
@@ -230,7 +227,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
230
227
  if (profile.sigv4a_signing_region_set) {
231
228
  return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
232
229
  }
233
- throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", {
230
+ throw new config.ProviderError("sigv4a_signing_region_set not set in profile.", {
234
231
  tryNextLink: true,
235
232
  });
236
233
  },
@@ -457,7 +454,7 @@ class ProtocolLib {
457
454
  decorateServiceException(exception, additions = {}) {
458
455
  if (this.queryCompat) {
459
456
  const msg = exception.Message ?? additions.Message;
460
- const error = smithyClient.decorateServiceException(exception, additions);
457
+ const error = client$1.decorateServiceException(exception, additions);
461
458
  if (msg) {
462
459
  error.message = msg;
463
460
  }
@@ -472,7 +469,7 @@ class ProtocolLib {
472
469
  }
473
470
  return error;
474
471
  }
475
- return smithyClient.decorateServiceException(exception, additions);
472
+ return client$1.decorateServiceException(exception, additions);
476
473
  }
477
474
  setQueryCompatError(output, response) {
478
475
  const queryErrorHeader = response.headers?.["x-amzn-query-error"];
@@ -545,7 +542,7 @@ class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol {
545
542
  const ns = schema.NormalizedSchema.of(errorSchema);
546
543
  const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
547
544
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
548
- const exception = new ErrorCtor(message);
545
+ const exception = new ErrorCtor({});
549
546
  const output = {};
550
547
  for (const [name, member] of ns.structIterator()) {
551
548
  if (dataObject[name] != null) {
@@ -664,7 +661,7 @@ function jsonReviver(key, value, context) {
664
661
  return value;
665
662
  }
666
663
 
667
- const collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body));
664
+ const collectBodyString = (streamBody, context) => protocols.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? serde.toUtf8)(body));
668
665
 
669
666
  const parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
670
667
  if (encoded.length) {
@@ -688,7 +685,7 @@ const parseJsonErrorBody = async (errorBody, context) => {
688
685
  return value;
689
686
  };
690
687
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
691
- const sanitizeErrorCode = (rawValue) => {
688
+ const sanitizeErrorCode = (rawValue, removeNamespace = true) => {
692
689
  let cleanValue = rawValue;
693
690
  if (typeof cleanValue === "number") {
694
691
  cleanValue = cleanValue.toString();
@@ -699,23 +696,38 @@ const sanitizeErrorCode = (rawValue) => {
699
696
  if (cleanValue.indexOf(":") >= 0) {
700
697
  cleanValue = cleanValue.split(":")[0];
701
698
  }
702
- if (cleanValue.indexOf("#") >= 0) {
699
+ if (removeNamespace && cleanValue.indexOf("#") >= 0) {
703
700
  cleanValue = cleanValue.split("#")[1];
704
701
  }
705
702
  return cleanValue;
706
703
  };
707
704
  const loadRestJsonErrorCode = (output, data) => {
708
- const headerKey = findKey(output.headers, "x-amzn-errortype");
709
- if (headerKey !== undefined) {
710
- return sanitizeErrorCode(output.headers[headerKey]);
711
- }
712
- if (data && typeof data === "object") {
713
- const codeKey = findKey(data, "code");
714
- if (codeKey && data[codeKey] !== undefined) {
715
- return sanitizeErrorCode(data[codeKey]);
716
- }
717
- if (data["__type"] !== undefined) {
718
- return sanitizeErrorCode(data["__type"]);
705
+ return loadErrorCode(output, data, true, ["header", "code", "type"]);
706
+ };
707
+ const loadJsonRpcErrorCode = (output, data, removeNamespace, queryCompat = false) => {
708
+ return loadErrorCode(output, data, removeNamespace, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
709
+ };
710
+ const loadErrorCode = ({ headers }, data, removeNamespace, order) => {
711
+ while (order.length > 0) {
712
+ const location = order.shift();
713
+ switch (location) {
714
+ case "header":
715
+ const headerKey = findKey(headers ?? {}, "x-amzn-errortype");
716
+ if (headerKey !== undefined) {
717
+ return sanitizeErrorCode(headers[headerKey], removeNamespace);
718
+ }
719
+ break;
720
+ case "code":
721
+ const codeKey = findKey(data ?? {}, "code");
722
+ if (codeKey && data[codeKey] !== undefined) {
723
+ return sanitizeErrorCode(data[codeKey], removeNamespace);
724
+ }
725
+ break;
726
+ case "type":
727
+ if (data?.__type !== undefined) {
728
+ return sanitizeErrorCode(data.__type, removeNamespace);
729
+ }
730
+ break;
719
731
  }
720
732
  }
721
733
  };
@@ -794,7 +806,7 @@ class JsonShapeDeserializer extends SerdeContextConfig {
794
806
  }
795
807
  }
796
808
  if (ns.isBlobSchema() && typeof value === "string") {
797
- return utilBase64.fromBase64(value);
809
+ return serde.fromBase64(value);
798
810
  }
799
811
  const mediaType = ns.getMergedTraits().mediaType;
800
812
  if (ns.isStringSchema() && typeof value === "string" && mediaType) {
@@ -1012,7 +1024,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
1012
1024
  if (ns === this.rootSchema) {
1013
1025
  return value;
1014
1026
  }
1015
- return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
1027
+ return (this.serdeContext?.base64Encoder ?? serde.toBase64)(value);
1016
1028
  }
1017
1029
  if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
1018
1030
  const format = protocols.determineTimestampFormat(ns, this.settings);
@@ -1058,7 +1070,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
1058
1070
  if (ns === this.rootSchema) {
1059
1071
  return value;
1060
1072
  }
1061
- return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
1073
+ return (this.serdeContext?.base64Encoder ?? serde.toBase64)(value);
1062
1074
  }
1063
1075
  if (typeof value === "bigint") {
1064
1076
  this.useReplacer = true;
@@ -1150,16 +1162,17 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
1150
1162
  return this.codec;
1151
1163
  }
1152
1164
  async handleError(operationSchema, context, response, dataObject, metadata) {
1153
- if (this.awsQueryCompatible) {
1165
+ const { awsQueryCompatible } = this;
1166
+ if (awsQueryCompatible) {
1154
1167
  this.mixin.setQueryCompatError(dataObject, response);
1155
1168
  }
1156
- const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
1169
+ const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, this.getJsonRpcVersion() === "1.1", awsQueryCompatible) ?? "Unknown";
1157
1170
  this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1158
- const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
1171
+ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
1159
1172
  const ns = schema.NormalizedSchema.of(errorSchema);
1160
1173
  const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1161
1174
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1162
- const exception = new ErrorCtor(message);
1175
+ const exception = new ErrorCtor({});
1163
1176
  const output = {};
1164
1177
  const errorDeserializer = this.codec.createDeserializer();
1165
1178
  for (const [name, member] of ns.structIterator()) {
@@ -1167,7 +1180,7 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
1167
1180
  output[name] = errorDeserializer.readObject(member, dataObject[name]);
1168
1181
  }
1169
1182
  }
1170
- if (this.awsQueryCompatible) {
1183
+ if (awsQueryCompatible) {
1171
1184
  this.mixin.queryCompatOutput(dataObject, output);
1172
1185
  }
1173
1186
  throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
@@ -1282,7 +1295,7 @@ class AwsRestJsonProtocol extends protocols.HttpBindingProtocol {
1282
1295
  const ns = schema.NormalizedSchema.of(errorSchema);
1283
1296
  const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
1284
1297
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1285
- const exception = new ErrorCtor(message);
1298
+ const exception = new ErrorCtor({});
1286
1299
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
1287
1300
  const output = {};
1288
1301
  const errorDeserializer = this.codec.createDeserializer();
@@ -1307,7 +1320,7 @@ const awsExpectUnion = (value) => {
1307
1320
  if (typeof value === "object" && "__type" in value) {
1308
1321
  delete value.__type;
1309
1322
  }
1310
- return smithyClient.expectUnion(value);
1323
+ return serde.expectUnion(value);
1311
1324
  };
1312
1325
 
1313
1326
  class XmlShapeDeserializer extends SerdeContextConfig {
@@ -1342,7 +1355,7 @@ class XmlShapeDeserializer extends SerdeContextConfig {
1342
1355
  }
1343
1356
  return output;
1344
1357
  }
1345
- const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes);
1358
+ const xmlString = (this.serdeContext?.utf8Encoder ?? serde.toUtf8)(bytes);
1346
1359
  const parsedObject = this.parseXml(xmlString);
1347
1360
  return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject);
1348
1361
  }
@@ -1451,7 +1464,7 @@ class XmlShapeDeserializer extends SerdeContextConfig {
1451
1464
  parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
1452
1465
  delete parsedObjToReturn[textNodeName];
1453
1466
  }
1454
- return smithyClient.getValueFromTextNode(parsedObjToReturn);
1467
+ return client$1.getValueFromTextNode(parsedObjToReturn);
1455
1468
  }
1456
1469
  return {};
1457
1470
  }
@@ -1475,7 +1488,7 @@ class QueryShapeSerializer extends SerdeContextConfig {
1475
1488
  if (ns.isBlobSchema()) {
1476
1489
  if (typeof value === "string" || value instanceof Uint8Array) {
1477
1490
  this.writeKey(prefix);
1478
- this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value));
1491
+ this.writeValue((this.serdeContext?.base64Encoder ?? serde.toBase64)(value));
1479
1492
  }
1480
1493
  }
1481
1494
  else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) {
@@ -1509,7 +1522,7 @@ class QueryShapeSerializer extends SerdeContextConfig {
1509
1522
  this.writeValue(value.toISOString().replace(".000Z", "Z"));
1510
1523
  break;
1511
1524
  case 6:
1512
- this.writeValue(smithyClient.dateToUtcString(value));
1525
+ this.writeValue(serde.dateToUtcString(value));
1513
1526
  break;
1514
1527
  case 7:
1515
1528
  this.writeValue(String(value.getTime() / 1000));
@@ -1733,7 +1746,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1733
1746
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
1734
1747
  const ns = schema.NormalizedSchema.of(errorSchema);
1735
1748
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1736
- const exception = new ErrorCtor(message);
1749
+ const exception = new ErrorCtor({});
1737
1750
  const output = {
1738
1751
  Type: errorData.Error.Type,
1739
1752
  Code: errorData.Error.Code,
@@ -1812,7 +1825,7 @@ const parseXmlBody = (streamBody, context) => collectBodyString(streamBody, cont
1812
1825
  parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
1813
1826
  delete parsedObjToReturn[textNodeName];
1814
1827
  }
1815
- return smithyClient.getValueFromTextNode(parsedObjToReturn);
1828
+ return client$1.getValueFromTextNode(parsedObjToReturn);
1816
1829
  }
1817
1830
  return {};
1818
1831
  });
@@ -1853,7 +1866,7 @@ class XmlShapeSerializer extends SerdeContextConfig {
1853
1866
  this.byteBuffer =
1854
1867
  "byteLength" in value
1855
1868
  ? value
1856
- : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);
1869
+ : (this.serdeContext?.base64Decoder ?? serde.fromBase64)(value);
1857
1870
  }
1858
1871
  else {
1859
1872
  this.buffer = this.writeStruct(ns, value, undefined);
@@ -2057,7 +2070,7 @@ class XmlShapeSerializer extends SerdeContextConfig {
2057
2070
  let nodeContents = null;
2058
2071
  if (value && typeof value === "object") {
2059
2072
  if (ns.isBlobSchema()) {
2060
- nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
2073
+ nodeContents = (this.serdeContext?.base64Encoder ?? serde.toBase64)(value);
2061
2074
  }
2062
2075
  else if (ns.isTimestampSchema() && value instanceof Date) {
2063
2076
  const format = protocols.determineTimestampFormat(ns, this.settings);
@@ -2066,14 +2079,14 @@ class XmlShapeSerializer extends SerdeContextConfig {
2066
2079
  nodeContents = value.toISOString().replace(".000Z", "Z");
2067
2080
  break;
2068
2081
  case 6:
2069
- nodeContents = smithyClient.dateToUtcString(value);
2082
+ nodeContents = serde.dateToUtcString(value);
2070
2083
  break;
2071
2084
  case 7:
2072
2085
  nodeContents = String(value.getTime() / 1000);
2073
2086
  break;
2074
2087
  default:
2075
2088
  console.warn("Missing timestamp format, using http date", value);
2076
- nodeContents = smithyClient.dateToUtcString(value);
2089
+ nodeContents = serde.dateToUtcString(value);
2077
2090
  break;
2078
2091
  }
2079
2092
  }
@@ -2212,7 +2225,7 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
2212
2225
  dataObject.Message ??
2213
2226
  "UnknownError";
2214
2227
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
2215
- const exception = new ErrorCtor(message);
2228
+ const exception = new ErrorCtor({});
2216
2229
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
2217
2230
  const output = {};
2218
2231
  const errorDeserializer = this.codec.createDeserializer();
@@ -2266,6 +2279,7 @@ exports.awsExpectUnion = awsExpectUnion;
2266
2279
  exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;
2267
2280
  exports.getBearerTokenEnvKey = getBearerTokenEnvKey;
2268
2281
  exports.getLongPollPlugin = getLongPollPlugin;
2282
+ exports.loadJsonRpcErrorCode = loadJsonRpcErrorCode;
2269
2283
  exports.loadRestJsonErrorCode = loadRestJsonErrorCode;
2270
2284
  exports.loadRestXmlErrorCode = loadRestXmlErrorCode;
2271
2285
  exports.parseJsonBody = parseJsonBody;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var utilMiddleware = require('@smithy/util-middleware');
3
+ var client = require('@smithy/core/client');
4
4
 
5
5
  const DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
6
6
  const ACCOUNT_ID_ENDPOINT_MODE_VALUES = ["disabled", "preferred", "required"];
@@ -10,7 +10,7 @@ function validateAccountIdEndpointMode(value) {
10
10
 
11
11
  const resolveAccountIdEndpointModeConfig = (input) => {
12
12
  const { accountIdEndpointMode } = input;
13
- const accountIdEndpointModeProvider = utilMiddleware.normalizeProvider(accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE);
13
+ const accountIdEndpointModeProvider = client.normalizeProvider(accountIdEndpointMode ?? DEFAULT_ACCOUNT_ID_ENDPOINT_MODE);
14
14
  return Object.assign(input, {
15
15
  accountIdEndpointMode: async () => {
16
16
  const accIdMode = await accountIdEndpointModeProvider();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var utilRetry = require('@smithy/util-retry');
3
+ var retry = require('@smithy/core/retry');
4
4
 
5
5
  const state = {
6
6
  warningEmitted: false,
@@ -51,7 +51,7 @@ function setCredentialFeature(credentials, feature, value) {
51
51
  return credentials;
52
52
  }
53
53
 
54
- utilRetry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
54
+ retry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
55
55
  function setFeature(context, feature, value) {
56
56
  if (!context.__aws_sdk_context) {
57
57
  context.__aws_sdk_context = {
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var protocolHttp = require('@smithy/protocol-http');
3
+ var protocols = require('@smithy/core/protocols');
4
4
  var core = require('@smithy/core');
5
- var propertyProvider = require('@smithy/property-provider');
5
+ var config = require('@smithy/core/config');
6
6
  var client = require('@aws-sdk/core/client');
7
7
  var signatureV4 = require('@smithy/signature-v4');
8
8
 
9
- const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
9
+ const getDateHeader = (response) => protocols.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
10
10
 
11
11
  const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
12
12
 
@@ -45,7 +45,7 @@ const validateSigningProperties = async (signingProperties) => {
45
45
  };
46
46
  class AwsSdkSigV4Signer {
47
47
  async sign(httpRequest, identity, signingProperties) {
48
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
48
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
49
49
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
50
50
  }
51
51
  const validatedProps = await validateSigningProperties(signingProperties);
@@ -93,7 +93,7 @@ const AWSSDKSigV4Signer = AwsSdkSigV4Signer;
93
93
 
94
94
  class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
95
95
  async sign(httpRequest, identity, signingProperties) {
96
- if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
96
+ if (!protocols.HttpRequest.isInstance(httpRequest)) {
97
97
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
98
98
  }
99
99
  const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
@@ -143,7 +143,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
143
143
  if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
144
144
  return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
145
145
  }
146
- throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
146
+ throw new config.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
147
147
  tryNextLink: true,
148
148
  });
149
149
  },
@@ -151,7 +151,7 @@ const NODE_SIGV4A_CONFIG_OPTIONS = {
151
151
  if (profile.sigv4a_signing_region_set) {
152
152
  return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
153
153
  }
154
- throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", {
154
+ throw new config.ProviderError("sigv4a_signing_region_set not set in profile.", {
155
155
  tryNextLink: true,
156
156
  });
157
157
  },