@aws-sdk/core 3.946.0 → 3.947.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -18,15 +18,15 @@ const state = {
18
18
  warningEmitted: false,
19
19
  };
20
20
  const emitWarningIfUnsupportedVersion = (version) => {
21
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
21
+ if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
22
22
  state.warningEmitted = true;
23
23
  process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
24
- no longer support Node.js 16.x on January 6, 2025.
24
+ no longer support Node.js ${version} in January 2026.
25
25
 
26
26
  To continue receiving updates to AWS services, bug fixes, and security
27
27
  updates please upgrade to a supported Node.js LTS version.
28
28
 
29
- More information can be found at: https://a.co/74kJMmI`);
29
+ More information can be found at: https://a.co/c895JFp`);
30
30
  }
31
31
  };
32
32
 
@@ -2016,12 +2016,11 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
2016
2016
  request.headers["content-type"] = contentType;
2017
2017
  }
2018
2018
  }
2019
- if (request.headers["content-type"] === this.getDefaultContentType()) {
2020
- if (typeof request.body === "string") {
2021
- if (!request.body.startsWith("<?xml ")) {
2022
- request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
2023
- }
2024
- }
2019
+ if (typeof request.body === "string" &&
2020
+ request.headers["content-type"] === this.getDefaultContentType() &&
2021
+ !request.body.startsWith("<?xml ") &&
2022
+ !this.hasUnstructuredPayloadBinding(inputSchema)) {
2023
+ request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
2025
2024
  }
2026
2025
  return request;
2027
2026
  }
@@ -2050,6 +2049,14 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
2050
2049
  getDefaultContentType() {
2051
2050
  return "application/xml";
2052
2051
  }
2052
+ hasUnstructuredPayloadBinding(ns) {
2053
+ for (const [, member] of ns.structIterator()) {
2054
+ if (member.getMergedTraits().httpPayload) {
2055
+ return !(member.isStructSchema() || member.isMapSchema() || member.isListSchema());
2056
+ }
2057
+ }
2058
+ return false;
2059
+ }
2053
2060
  }
2054
2061
 
2055
2062
  exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer;
@@ -4,15 +4,15 @@ const state = {
4
4
  warningEmitted: false,
5
5
  };
6
6
  const emitWarningIfUnsupportedVersion = (version) => {
7
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
7
+ if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
8
8
  state.warningEmitted = true;
9
9
  process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
10
- no longer support Node.js 16.x on January 6, 2025.
10
+ no longer support Node.js ${version} in January 2026.
11
11
 
12
12
  To continue receiving updates to AWS services, bug fixes, and security
13
13
  updates please upgrade to a supported Node.js LTS version.
14
14
 
15
- More information can be found at: https://a.co/74kJMmI`);
15
+ More information can be found at: https://a.co/c895JFp`);
16
16
  }
17
17
  };
18
18
 
@@ -1686,12 +1686,11 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
1686
1686
  request.headers["content-type"] = contentType;
1687
1687
  }
1688
1688
  }
1689
- if (request.headers["content-type"] === this.getDefaultContentType()) {
1690
- if (typeof request.body === "string") {
1691
- if (!request.body.startsWith("<?xml ")) {
1692
- request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
1693
- }
1694
- }
1689
+ if (typeof request.body === "string" &&
1690
+ request.headers["content-type"] === this.getDefaultContentType() &&
1691
+ !request.body.startsWith("<?xml ") &&
1692
+ !this.hasUnstructuredPayloadBinding(inputSchema)) {
1693
+ request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
1695
1694
  }
1696
1695
  return request;
1697
1696
  }
@@ -1720,6 +1719,14 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
1720
1719
  getDefaultContentType() {
1721
1720
  return "application/xml";
1722
1721
  }
1722
+ hasUnstructuredPayloadBinding(ns) {
1723
+ for (const [, member] of ns.structIterator()) {
1724
+ if (member.getMergedTraits().httpPayload) {
1725
+ return !(member.isStructSchema() || member.isMapSchema() || member.isListSchema());
1726
+ }
1727
+ }
1728
+ return false;
1729
+ }
1723
1730
  }
1724
1731
 
1725
1732
  exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol;
@@ -2,14 +2,14 @@ export const state = {
2
2
  warningEmitted: false,
3
3
  };
4
4
  export const emitWarningIfUnsupportedVersion = (version) => {
5
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
5
+ if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
6
6
  state.warningEmitted = true;
7
7
  process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
8
- no longer support Node.js 16.x on January 6, 2025.
8
+ no longer support Node.js ${version} in January 2026.
9
9
 
10
10
  To continue receiving updates to AWS services, bug fixes, and security
11
11
  updates please upgrade to a supported Node.js LTS version.
12
12
 
13
- More information can be found at: https://a.co/74kJMmI`);
13
+ More information can be found at: https://a.co/c895JFp`);
14
14
  }
15
15
  };
@@ -38,12 +38,11 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
38
38
  request.headers["content-type"] = contentType;
39
39
  }
40
40
  }
41
- if (request.headers["content-type"] === this.getDefaultContentType()) {
42
- if (typeof request.body === "string") {
43
- if (!request.body.startsWith("<?xml ")) {
44
- request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
45
- }
46
- }
41
+ if (typeof request.body === "string" &&
42
+ request.headers["content-type"] === this.getDefaultContentType() &&
43
+ !request.body.startsWith("<?xml ") &&
44
+ !this.hasUnstructuredPayloadBinding(inputSchema)) {
45
+ request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
47
46
  }
48
47
  return request;
49
48
  }
@@ -72,4 +71,12 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
72
71
  getDefaultContentType() {
73
72
  return "application/xml";
74
73
  }
74
+ hasUnstructuredPayloadBinding(ns) {
75
+ for (const [, member] of ns.structIterator()) {
76
+ if (member.getMergedTraits().httpPayload) {
77
+ return !(member.isStructSchema() || member.isMapSchema() || member.isListSchema());
78
+ }
79
+ }
80
+ return false;
81
+ }
75
82
  }
@@ -25,4 +25,5 @@ export declare class AwsRestXmlProtocol extends HttpBindingProtocol {
25
25
  * @override
26
26
  */
27
27
  protected getDefaultContentType(): string;
28
+ private hasUnstructuredPayloadBinding;
28
29
  }
@@ -38,4 +38,5 @@ export declare class AwsRestXmlProtocol extends HttpBindingProtocol {
38
38
  metadata: ResponseMetadata
39
39
  ): Promise<never>;
40
40
  protected getDefaultContentType(): string;
41
+ private hasUnstructuredPayloadBinding;
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.946.0",
3
+ "version": "3.947.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "scripts": {
6
6
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",