@cdk8s/awscdk-resolver 0.0.101 → 0.0.102

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 (137) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/package.json +5 -5
  4. package/node_modules/@aws-sdk/client-sso/package.json +2 -2
  5. package/node_modules/@aws-sdk/client-sso-oidc/package.json +4 -4
  6. package/node_modules/@aws-sdk/client-sts/package.json +4 -4
  7. package/node_modules/@aws-sdk/core/README.md +35 -1
  8. package/node_modules/@aws-sdk/core/client.js +5 -0
  9. package/node_modules/@aws-sdk/core/dist-cjs/index.js +5 -437
  10. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +38 -0
  11. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +226 -0
  12. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +228 -0
  13. package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
  14. package/node_modules/@aws-sdk/core/dist-types/index.d.ts +22 -3
  15. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +3 -3
  16. package/node_modules/@aws-sdk/core/httpAuthSchemes.js +5 -0
  17. package/node_modules/@aws-sdk/core/package.json +39 -2
  18. package/node_modules/@aws-sdk/core/protocols.js +5 -0
  19. package/node_modules/@aws-sdk/credential-provider-ini/package.json +3 -3
  20. package/node_modules/@aws-sdk/credential-provider-node/package.json +3 -3
  21. package/node_modules/@aws-sdk/credential-provider-sso/package.json +2 -2
  22. package/node_modules/@smithy/core/package.json +3 -3
  23. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +10 -3
  24. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +10 -3
  25. package/node_modules/@smithy/fetch-http-handler/package.json +1 -1
  26. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  27. package/node_modules/@smithy/smithy-client/package.json +2 -2
  28. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  29. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  30. package/node_modules/@smithy/util-stream/package.json +2 -2
  31. package/package.json +4 -4
  32. package/node_modules/@aws-sdk/core/CHANGELOG.md +0 -323
  33. package/node_modules/@aws-sdk/core/api-extractor.json +0 -4
  34. package/node_modules/@aws-sdk/core/dist-cjs/client/emitWarningIfUnsupportedVersion.js +0 -1
  35. package/node_modules/@aws-sdk/core/dist-cjs/client/index.js +0 -1
  36. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +0 -1
  37. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws_sdk/index.js +0 -1
  38. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +0 -1
  39. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/index.js +0 -1
  40. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getDateHeader.js +0 -1
  41. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getSkewCorrectedDate.js +0 -1
  42. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +0 -1
  43. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/index.js +0 -1
  44. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/isClockSkewed.js +0 -1
  45. package/node_modules/@aws-sdk/core/dist-cjs/protocols/coercing-serializers.js +0 -1
  46. package/node_modules/@aws-sdk/core/dist-cjs/protocols/common.js +0 -1
  47. package/node_modules/@aws-sdk/core/dist-cjs/protocols/index.js +0 -1
  48. package/node_modules/@aws-sdk/core/dist-cjs/protocols/json/awsExpectUnion.js +0 -1
  49. package/node_modules/@aws-sdk/core/dist-cjs/protocols/json/parseJsonBody.js +0 -1
  50. package/node_modules/@aws-sdk/core/dist-cjs/protocols/xml/parseXmlBody.js +0 -1
  51. package/node_modules/@aws-sdk/core/integ/request-handlers/request-handlers.integ.spec.ts +0 -158
  52. package/node_modules/@aws-sdk/core/jest.config.integ.js +0 -4
  53. package/node_modules/@aws-sdk/core/jest.config.js +0 -6
  54. package/node_modules/@aws-sdk/core/scripts/lint.js +0 -24
  55. package/node_modules/@aws-sdk/core/src/client/emitWarningIfUnsupportedVersion.spec.ts +0 -70
  56. package/node_modules/@aws-sdk/core/src/client/emitWarningIfUnsupportedVersion.ts +0 -26
  57. package/node_modules/@aws-sdk/core/src/client/index.ts +0 -1
  58. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.spec.ts +0 -30
  59. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts +0 -134
  60. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/index.ts +0 -2
  61. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +0 -244
  62. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/index.ts +0 -1
  63. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getDateHeader.ts +0 -7
  64. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getSkewCorrectedDate.spec.ts +0 -17
  65. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getSkewCorrectedDate.ts +0 -8
  66. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.spec.ts +0 -37
  67. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts +0 -18
  68. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/index.ts +0 -3
  69. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/isClockSkewed.spec.ts +0 -32
  70. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/isClockSkewed.ts +0 -12
  71. package/node_modules/@aws-sdk/core/src/index.ts +0 -3
  72. package/node_modules/@aws-sdk/core/src/protocols/coercing-serializers.spec.ts +0 -76
  73. package/node_modules/@aws-sdk/core/src/protocols/coercing-serializers.ts +0 -72
  74. package/node_modules/@aws-sdk/core/src/protocols/common.ts +0 -5
  75. package/node_modules/@aws-sdk/core/src/protocols/index.ts +0 -4
  76. package/node_modules/@aws-sdk/core/src/protocols/json/awsExpectUnion.spec.ts +0 -30
  77. package/node_modules/@aws-sdk/core/src/protocols/json/awsExpectUnion.ts +0 -17
  78. package/node_modules/@aws-sdk/core/src/protocols/json/parseJsonBody.ts +0 -60
  79. package/node_modules/@aws-sdk/core/src/protocols/xml/parseXmlBody.spec.ts +0 -60
  80. package/node_modules/@aws-sdk/core/src/protocols/xml/parseXmlBody.ts +0 -64
  81. package/node_modules/@aws-sdk/core/tsconfig.cjs.json +0 -9
  82. package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +0 -1
  83. package/node_modules/@aws-sdk/core/tsconfig.es.json +0 -9
  84. package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +0 -1
  85. package/node_modules/@aws-sdk/core/tsconfig.types.json +0 -9
  86. package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +0 -1
  87. /package/node_modules/@aws-sdk/core/dist-es/{client → submodules/client}/emitWarningIfUnsupportedVersion.js +0 -0
  88. /package/node_modules/@aws-sdk/core/dist-es/{client → submodules/client}/index.js +0 -0
  89. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/AwsSdkSigV4Signer.js +0 -0
  90. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/index.js +0 -0
  91. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/resolveAwsSdkSigV4Config.js +0 -0
  92. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/index.js +0 -0
  93. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getDateHeader.js +0 -0
  94. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getSkewCorrectedDate.js +0 -0
  95. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getUpdatedSystemClockOffset.js +0 -0
  96. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/index.js +0 -0
  97. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/isClockSkewed.js +0 -0
  98. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/coercing-serializers.js +0 -0
  99. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/common.js +0 -0
  100. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/index.js +0 -0
  101. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/json/awsExpectUnion.js +0 -0
  102. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/json/parseJsonBody.js +0 -0
  103. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/xml/parseXmlBody.js +0 -0
  104. /package/node_modules/@aws-sdk/core/dist-types/{client → submodules/client}/emitWarningIfUnsupportedVersion.d.ts +0 -0
  105. /package/node_modules/@aws-sdk/core/dist-types/{client → submodules/client}/index.d.ts +0 -0
  106. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/AwsSdkSigV4Signer.d.ts +0 -0
  107. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/index.d.ts +0 -0
  108. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/resolveAwsSdkSigV4Config.d.ts +0 -0
  109. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/index.d.ts +0 -0
  110. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getDateHeader.d.ts +0 -0
  111. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getSkewCorrectedDate.d.ts +0 -0
  112. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getUpdatedSystemClockOffset.d.ts +0 -0
  113. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/index.d.ts +0 -0
  114. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/isClockSkewed.d.ts +0 -0
  115. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/coercing-serializers.d.ts +0 -0
  116. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/common.d.ts +0 -0
  117. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/index.d.ts +0 -0
  118. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/json/awsExpectUnion.d.ts +0 -0
  119. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/json/parseJsonBody.d.ts +0 -0
  120. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/xml/parseXmlBody.d.ts +0 -0
  121. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{client → submodules/client}/emitWarningIfUnsupportedVersion.d.ts +0 -0
  122. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{client → submodules/client}/index.d.ts +0 -0
  123. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/AwsSdkSigV4Signer.d.ts +0 -0
  124. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/index.d.ts +0 -0
  125. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/resolveAwsSdkSigV4Config.d.ts +0 -0
  126. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/index.d.ts +0 -0
  127. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getDateHeader.d.ts +0 -0
  128. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getSkewCorrectedDate.d.ts +0 -0
  129. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getUpdatedSystemClockOffset.d.ts +0 -0
  130. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/index.d.ts +0 -0
  131. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/isClockSkewed.d.ts +0 -0
  132. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/coercing-serializers.d.ts +0 -0
  133. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/common.d.ts +0 -0
  134. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/index.d.ts +0 -0
  135. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/json/awsExpectUnion.d.ts +0 -0
  136. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/json/parseJsonBody.d.ts +0 -0
  137. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/xml/parseXmlBody.d.ts +0 -0
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/submodules/httpAuthSchemes/index.ts
22
+ var httpAuthSchemes_exports = {};
23
+ __export(httpAuthSchemes_exports, {
24
+ AWSSDKSigV4Signer: () => AWSSDKSigV4Signer,
25
+ AwsSdkSigV4Signer: () => AwsSdkSigV4Signer,
26
+ resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config,
27
+ resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config
28
+ });
29
+ module.exports = __toCommonJS(httpAuthSchemes_exports);
30
+
31
+ // src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts
32
+ var import_protocol_http2 = require("@smithy/protocol-http");
33
+
34
+ // src/submodules/httpAuthSchemes/utils/getDateHeader.ts
35
+ var import_protocol_http = require("@smithy/protocol-http");
36
+ var getDateHeader = /* @__PURE__ */ __name((response) => {
37
+ var _a, _b;
38
+ return import_protocol_http.HttpResponse.isInstance(response) ? ((_a = response.headers) == null ? void 0 : _a.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date) : void 0;
39
+ }, "getDateHeader");
40
+
41
+ // src/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.ts
42
+ var getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate");
43
+
44
+ // src/submodules/httpAuthSchemes/utils/isClockSkewed.ts
45
+ var isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed");
46
+
47
+ // src/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts
48
+ var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => {
49
+ const clockTimeInMs = Date.parse(clockTime);
50
+ if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
51
+ return clockTimeInMs - Date.now();
52
+ }
53
+ return currentSystemClockOffset;
54
+ }, "getUpdatedSystemClockOffset");
55
+
56
+ // src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts
57
+ var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => {
58
+ if (!property) {
59
+ throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
60
+ }
61
+ return property;
62
+ }, "throwSigningPropertyError");
63
+ var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
64
+ var _a, _b, _c;
65
+ const context = throwSigningPropertyError(
66
+ "context",
67
+ signingProperties.context
68
+ );
69
+ const config = throwSigningPropertyError("config", signingProperties.config);
70
+ const authScheme = (_c = (_b = (_a = context.endpointV2) == null ? void 0 : _a.properties) == null ? void 0 : _b.authSchemes) == null ? void 0 : _c[0];
71
+ const signerFunction = throwSigningPropertyError(
72
+ "signer",
73
+ config.signer
74
+ );
75
+ const signer = await signerFunction(authScheme);
76
+ const signingRegion = signingProperties == null ? void 0 : signingProperties.signingRegion;
77
+ const signingName = signingProperties == null ? void 0 : signingProperties.signingName;
78
+ return {
79
+ config,
80
+ signer,
81
+ signingRegion,
82
+ signingName
83
+ };
84
+ }, "validateSigningProperties");
85
+ var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
86
+ async sign(httpRequest, identity, signingProperties) {
87
+ if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
88
+ throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
89
+ }
90
+ const { config, signer, signingRegion, signingName } = await validateSigningProperties(signingProperties);
91
+ const signedRequest = await signer.sign(httpRequest, {
92
+ signingDate: getSkewCorrectedDate(config.systemClockOffset),
93
+ signingRegion,
94
+ signingService: signingName
95
+ });
96
+ return signedRequest;
97
+ }
98
+ errorHandler(signingProperties) {
99
+ return (error) => {
100
+ const serverTime = error.ServerTime ?? getDateHeader(error.$response);
101
+ if (serverTime) {
102
+ const config = throwSigningPropertyError("config", signingProperties.config);
103
+ const initialSystemClockOffset = config.systemClockOffset;
104
+ config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
105
+ const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
106
+ if (clockSkewCorrected && error.$metadata) {
107
+ error.$metadata.clockSkewCorrected = true;
108
+ }
109
+ }
110
+ throw error;
111
+ };
112
+ }
113
+ successHandler(httpResponse, signingProperties) {
114
+ const dateHeader = getDateHeader(httpResponse);
115
+ if (dateHeader) {
116
+ const config = throwSigningPropertyError("config", signingProperties.config);
117
+ config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
118
+ }
119
+ }
120
+ };
121
+ __name(_AwsSdkSigV4Signer, "AwsSdkSigV4Signer");
122
+ var AwsSdkSigV4Signer = _AwsSdkSigV4Signer;
123
+ var AWSSDKSigV4Signer = AwsSdkSigV4Signer;
124
+
125
+ // src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts
126
+ var import_core = require("@smithy/core");
127
+ var import_signature_v4 = require("@smithy/signature-v4");
128
+ var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
129
+ let normalizedCreds;
130
+ if (config.credentials) {
131
+ normalizedCreds = (0, import_core.memoizeIdentityProvider)(config.credentials, import_core.isIdentityExpired, import_core.doesIdentityRequireRefresh);
132
+ }
133
+ if (!normalizedCreds) {
134
+ if (config.credentialDefaultProvider) {
135
+ normalizedCreds = (0, import_core.normalizeProvider)(
136
+ config.credentialDefaultProvider(
137
+ Object.assign({}, config, {
138
+ parentClientConfig: config
139
+ })
140
+ )
141
+ );
142
+ } else {
143
+ normalizedCreds = /* @__PURE__ */ __name(async () => {
144
+ throw new Error("`credentials` is missing");
145
+ }, "normalizedCreds");
146
+ }
147
+ }
148
+ const {
149
+ // Default for signingEscapePath
150
+ signingEscapePath = true,
151
+ // Default for systemClockOffset
152
+ systemClockOffset = config.systemClockOffset || 0,
153
+ // No default for sha256 since it is platform dependent
154
+ sha256
155
+ } = config;
156
+ let signer;
157
+ if (config.signer) {
158
+ signer = (0, import_core.normalizeProvider)(config.signer);
159
+ } else if (config.regionInfoProvider) {
160
+ signer = /* @__PURE__ */ __name(() => (0, import_core.normalizeProvider)(config.region)().then(
161
+ async (region) => [
162
+ await config.regionInfoProvider(region, {
163
+ useFipsEndpoint: await config.useFipsEndpoint(),
164
+ useDualstackEndpoint: await config.useDualstackEndpoint()
165
+ }) || {},
166
+ region
167
+ ]
168
+ ).then(([regionInfo, region]) => {
169
+ const { signingRegion, signingService } = regionInfo;
170
+ config.signingRegion = config.signingRegion || signingRegion || region;
171
+ config.signingName = config.signingName || signingService || config.serviceId;
172
+ const params = {
173
+ ...config,
174
+ credentials: normalizedCreds,
175
+ region: config.signingRegion,
176
+ service: config.signingName,
177
+ sha256,
178
+ uriEscapePath: signingEscapePath
179
+ };
180
+ const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
181
+ return new SignerCtor(params);
182
+ }), "signer");
183
+ } else {
184
+ signer = /* @__PURE__ */ __name(async (authScheme) => {
185
+ authScheme = Object.assign(
186
+ {},
187
+ {
188
+ name: "sigv4",
189
+ signingName: config.signingName || config.defaultSigningName,
190
+ signingRegion: await (0, import_core.normalizeProvider)(config.region)(),
191
+ properties: {}
192
+ },
193
+ authScheme
194
+ );
195
+ const signingRegion = authScheme.signingRegion;
196
+ const signingService = authScheme.signingName;
197
+ config.signingRegion = config.signingRegion || signingRegion;
198
+ config.signingName = config.signingName || signingService || config.serviceId;
199
+ const params = {
200
+ ...config,
201
+ credentials: normalizedCreds,
202
+ region: config.signingRegion,
203
+ service: config.signingName,
204
+ sha256,
205
+ uriEscapePath: signingEscapePath
206
+ };
207
+ const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
208
+ return new SignerCtor(params);
209
+ }, "signer");
210
+ }
211
+ return {
212
+ ...config,
213
+ systemClockOffset,
214
+ signingEscapePath,
215
+ credentials: normalizedCreds,
216
+ signer
217
+ };
218
+ }, "resolveAwsSdkSigV4Config");
219
+ var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
220
+ // Annotate the CommonJS export names for ESM import in node:
221
+ 0 && (module.exports = {
222
+ AWSSDKSigV4Signer,
223
+ AwsSdkSigV4Signer,
224
+ resolveAWSSDKSigV4Config,
225
+ resolveAwsSdkSigV4Config
226
+ });
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/submodules/protocols/index.ts
22
+ var protocols_exports = {};
23
+ __export(protocols_exports, {
24
+ _toBool: () => _toBool,
25
+ _toNum: () => _toNum,
26
+ _toStr: () => _toStr,
27
+ awsExpectUnion: () => awsExpectUnion,
28
+ loadRestJsonErrorCode: () => loadRestJsonErrorCode,
29
+ loadRestXmlErrorCode: () => loadRestXmlErrorCode,
30
+ parseJsonBody: () => parseJsonBody,
31
+ parseJsonErrorBody: () => parseJsonErrorBody,
32
+ parseXmlBody: () => parseXmlBody,
33
+ parseXmlErrorBody: () => parseXmlErrorBody
34
+ });
35
+ module.exports = __toCommonJS(protocols_exports);
36
+
37
+ // src/submodules/protocols/coercing-serializers.ts
38
+ var _toStr = /* @__PURE__ */ __name((val) => {
39
+ if (val == null) {
40
+ return val;
41
+ }
42
+ if (typeof val === "number" || typeof val === "bigint") {
43
+ const warning = new Error(`Received number ${val} where a string was expected.`);
44
+ warning.name = "Warning";
45
+ console.warn(warning);
46
+ return String(val);
47
+ }
48
+ if (typeof val === "boolean") {
49
+ const warning = new Error(`Received boolean ${val} where a string was expected.`);
50
+ warning.name = "Warning";
51
+ console.warn(warning);
52
+ return String(val);
53
+ }
54
+ return val;
55
+ }, "_toStr");
56
+ var _toBool = /* @__PURE__ */ __name((val) => {
57
+ if (val == null) {
58
+ return val;
59
+ }
60
+ if (typeof val === "number") {
61
+ }
62
+ if (typeof val === "string") {
63
+ const lowercase = val.toLowerCase();
64
+ if (val !== "" && lowercase !== "false" && lowercase !== "true") {
65
+ const warning = new Error(`Received string "${val}" where a boolean was expected.`);
66
+ warning.name = "Warning";
67
+ console.warn(warning);
68
+ }
69
+ return val !== "" && lowercase !== "false";
70
+ }
71
+ return val;
72
+ }, "_toBool");
73
+ var _toNum = /* @__PURE__ */ __name((val) => {
74
+ if (val == null) {
75
+ return val;
76
+ }
77
+ if (typeof val === "boolean") {
78
+ }
79
+ if (typeof val === "string") {
80
+ const num = Number(val);
81
+ if (num.toString() !== val) {
82
+ const warning = new Error(`Received string "${val}" where a number was expected.`);
83
+ warning.name = "Warning";
84
+ console.warn(warning);
85
+ return val;
86
+ }
87
+ return num;
88
+ }
89
+ return val;
90
+ }, "_toNum");
91
+
92
+ // src/submodules/protocols/json/awsExpectUnion.ts
93
+ var import_smithy_client = require("@smithy/smithy-client");
94
+ var awsExpectUnion = /* @__PURE__ */ __name((value) => {
95
+ if (value == null) {
96
+ return void 0;
97
+ }
98
+ if (typeof value === "object" && "__type" in value) {
99
+ delete value.__type;
100
+ }
101
+ return (0, import_smithy_client.expectUnion)(value);
102
+ }, "awsExpectUnion");
103
+
104
+ // src/submodules/protocols/common.ts
105
+ var import_smithy_client2 = require("@smithy/smithy-client");
106
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client2.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
107
+
108
+ // src/submodules/protocols/json/parseJsonBody.ts
109
+ var parseJsonBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
110
+ if (encoded.length) {
111
+ try {
112
+ return JSON.parse(encoded);
113
+ } catch (e) {
114
+ if ((e == null ? void 0 : e.name) === "SyntaxError") {
115
+ Object.defineProperty(e, "$responseBodyText", {
116
+ value: encoded
117
+ });
118
+ }
119
+ throw e;
120
+ }
121
+ }
122
+ return {};
123
+ }), "parseJsonBody");
124
+ var parseJsonErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
125
+ const value = await parseJsonBody(errorBody, context);
126
+ value.message = value.message ?? value.Message;
127
+ return value;
128
+ }, "parseJsonErrorBody");
129
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
130
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
131
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
132
+ let cleanValue = rawValue;
133
+ if (typeof cleanValue === "number") {
134
+ cleanValue = cleanValue.toString();
135
+ }
136
+ if (cleanValue.indexOf(",") >= 0) {
137
+ cleanValue = cleanValue.split(",")[0];
138
+ }
139
+ if (cleanValue.indexOf(":") >= 0) {
140
+ cleanValue = cleanValue.split(":")[0];
141
+ }
142
+ if (cleanValue.indexOf("#") >= 0) {
143
+ cleanValue = cleanValue.split("#")[1];
144
+ }
145
+ return cleanValue;
146
+ }, "sanitizeErrorCode");
147
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
148
+ if (headerKey !== void 0) {
149
+ return sanitizeErrorCode(output.headers[headerKey]);
150
+ }
151
+ if (data.code !== void 0) {
152
+ return sanitizeErrorCode(data.code);
153
+ }
154
+ if (data["__type"] !== void 0) {
155
+ return sanitizeErrorCode(data["__type"]);
156
+ }
157
+ }, "loadRestJsonErrorCode");
158
+
159
+ // src/submodules/protocols/xml/parseXmlBody.ts
160
+ var import_smithy_client3 = require("@smithy/smithy-client");
161
+ var import_fast_xml_parser = require("fast-xml-parser");
162
+ var parseXmlBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
163
+ if (encoded.length) {
164
+ const parser = new import_fast_xml_parser.XMLParser({
165
+ attributeNamePrefix: "",
166
+ htmlEntities: true,
167
+ ignoreAttributes: false,
168
+ ignoreDeclaration: true,
169
+ parseTagValue: false,
170
+ trimValues: false,
171
+ tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0
172
+ });
173
+ parser.addEntity("#xD", "\r");
174
+ parser.addEntity("#10", "\n");
175
+ let parsedObj;
176
+ try {
177
+ parsedObj = parser.parse(encoded, true);
178
+ } catch (e) {
179
+ if (e && typeof e === "object") {
180
+ Object.defineProperty(e, "$responseBodyText", {
181
+ value: encoded
182
+ });
183
+ }
184
+ throw e;
185
+ }
186
+ const textNodeName = "#text";
187
+ const key = Object.keys(parsedObj)[0];
188
+ const parsedObjToReturn = parsedObj[key];
189
+ if (parsedObjToReturn[textNodeName]) {
190
+ parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
191
+ delete parsedObjToReturn[textNodeName];
192
+ }
193
+ return (0, import_smithy_client3.getValueFromTextNode)(parsedObjToReturn);
194
+ }
195
+ return {};
196
+ }), "parseXmlBody");
197
+ var parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
198
+ const value = await parseXmlBody(errorBody, context);
199
+ if (value.Error) {
200
+ value.Error.message = value.Error.message ?? value.Error.Message;
201
+ }
202
+ return value;
203
+ }, "parseXmlErrorBody");
204
+ var loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => {
205
+ var _a;
206
+ if (((_a = data == null ? void 0 : data.Error) == null ? void 0 : _a.Code) !== void 0) {
207
+ return data.Error.Code;
208
+ }
209
+ if ((data == null ? void 0 : data.Code) !== void 0) {
210
+ return data.Code;
211
+ }
212
+ if (output.statusCode == 404) {
213
+ return "NotFound";
214
+ }
215
+ }, "loadRestXmlErrorCode");
216
+ // Annotate the CommonJS export names for ESM import in node:
217
+ 0 && (module.exports = {
218
+ _toBool,
219
+ _toNum,
220
+ _toStr,
221
+ awsExpectUnion,
222
+ loadRestJsonErrorCode,
223
+ loadRestXmlErrorCode,
224
+ parseJsonBody,
225
+ parseJsonErrorBody,
226
+ parseXmlBody,
227
+ parseXmlErrorBody
228
+ });
@@ -1,3 +1,3 @@
1
- export * from "./client/index";
2
- export * from "./httpAuthSchemes/index";
3
- export * from "./protocols/index";
1
+ export * from "./submodules/client/index";
2
+ export * from "./submodules/httpAuthSchemes/index";
3
+ export * from "./submodules/protocols/index";
@@ -1,3 +1,22 @@
1
- export * from "./client/index";
2
- export * from "./httpAuthSchemes/index";
3
- export * from "./protocols/index";
1
+ /**
2
+ * Submodules annotated with "Legacy" are from prior to the submodule system.
3
+ * They are exported from the package's root index to preserve backwards compatibility.
4
+ *
5
+ * New development should go in a proper submodule and not be exported from the root index.
6
+ */
7
+ /**
8
+ * Legacy submodule.
9
+ */
10
+ export * from "./submodules/client/index";
11
+ /**
12
+ * Legacy submodule.
13
+ */
14
+ export * from "./submodules/httpAuthSchemes/index";
15
+ /**
16
+ * Legacy submodule.
17
+ */
18
+ export * from "./submodules/protocols/index";
19
+ /**
20
+ * Warning: do not export any additional submodules from the root of this package. See readme.md for
21
+ * guide on developing submodules.
22
+ */
@@ -1,3 +1,3 @@
1
- export * from "./client/index";
2
- export * from "./httpAuthSchemes/index";
3
- export * from "./protocols/index";
1
+ export * from "./submodules/client/index";
2
+ export * from "./submodules/httpAuthSchemes/index";
3
+ export * from "./submodules/protocols/index";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit:
3
+ * This is a compatibility redirect for contexts that do not understand package.json exports field.
4
+ */
5
+ module.exports = require("./dist-cjs/submodules/httpAuthSchemes/index.js");
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.575.0",
3
+ "version": "3.576.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients",
5
5
  "scripts": {
6
- "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
+ "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline core",
8
8
  "build:es": "tsc -p tsconfig.es.json",
9
9
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
@@ -18,6 +18,43 @@
18
18
  "main": "./dist-cjs/index.js",
19
19
  "module": "./dist-es/index.js",
20
20
  "types": "./dist-types/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "node": "./dist-cjs/index.js",
24
+ "import": "./dist-es/index.js",
25
+ "require": "./dist-cjs/index.js",
26
+ "types": "./dist-types/index.d.ts"
27
+ },
28
+ "./package.json": {
29
+ "node": "./package.json",
30
+ "import": "./package.json",
31
+ "require": "./package.json"
32
+ },
33
+ "./client": {
34
+ "node": "./dist-cjs/submodules/client/index.js",
35
+ "import": "./dist-es/submodules/client/index.js",
36
+ "require": "./dist-cjs/submodules/client/index.js",
37
+ "types": "./dist-types/submodules/client/index.d.ts"
38
+ },
39
+ "./httpAuthSchemes": {
40
+ "node": "./dist-cjs/submodules/httpAuthSchemes/index.js",
41
+ "import": "./dist-es/submodules/httpAuthSchemes/index.js",
42
+ "require": "./dist-cjs/submodules/httpAuthSchemes/index.js",
43
+ "types": "./dist-types/submodules/httpAuthSchemes/index.d.ts"
44
+ },
45
+ "./protocols": {
46
+ "node": "./dist-cjs/submodules/protocols/index.js",
47
+ "import": "./dist-es/submodules/protocols/index.js",
48
+ "require": "./dist-cjs/submodules/protocols/index.js",
49
+ "types": "./dist-types/submodules/protocols/index.d.ts"
50
+ }
51
+ },
52
+ "files": [
53
+ "dist-*/**",
54
+ "./client.js",
55
+ "./httpAuthSchemes.js",
56
+ "./protocols.js"
57
+ ],
21
58
  "sideEffects": false,
22
59
  "author": {
23
60
  "name": "AWS SDK for JavaScript Team",
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit:
3
+ * This is a compatibility redirect for contexts that do not understand package.json exports field.
4
+ */
5
+ module.exports = require("./dist-cjs/submodules/protocols/index.js");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-ini",
3
- "version": "3.575.0",
3
+ "version": "3.576.0",
4
4
  "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@aws-sdk/credential-provider-env": "3.575.0",
28
28
  "@aws-sdk/credential-provider-process": "3.575.0",
29
- "@aws-sdk/credential-provider-sso": "3.575.0",
29
+ "@aws-sdk/credential-provider-sso": "3.576.0",
30
30
  "@aws-sdk/credential-provider-web-identity": "3.575.0",
31
31
  "@aws-sdk/types": "3.575.0",
32
32
  "@smithy/credential-provider-imds": "^3.0.0",
@@ -44,7 +44,7 @@
44
44
  "typescript": "~4.9.5"
45
45
  },
46
46
  "peerDependencies": {
47
- "@aws-sdk/client-sts": "3.575.0"
47
+ "@aws-sdk/client-sts": "3.576.0"
48
48
  },
49
49
  "types": "./dist-types/index.d.ts",
50
50
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-node",
3
- "version": "3.575.0",
3
+ "version": "3.576.0",
4
4
  "description": "AWS credential provider that sources credentials from a Node.JS environment. ",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
@@ -30,9 +30,9 @@
30
30
  "dependencies": {
31
31
  "@aws-sdk/credential-provider-env": "3.575.0",
32
32
  "@aws-sdk/credential-provider-http": "3.575.0",
33
- "@aws-sdk/credential-provider-ini": "3.575.0",
33
+ "@aws-sdk/credential-provider-ini": "3.576.0",
34
34
  "@aws-sdk/credential-provider-process": "3.575.0",
35
- "@aws-sdk/credential-provider-sso": "3.575.0",
35
+ "@aws-sdk/credential-provider-sso": "3.576.0",
36
36
  "@aws-sdk/credential-provider-web-identity": "3.575.0",
37
37
  "@aws-sdk/types": "3.575.0",
38
38
  "@smithy/credential-provider-imds": "^3.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-sso",
3
- "version": "3.575.0",
3
+ "version": "3.576.0",
4
4
  "description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/client-sso": "3.575.0",
27
+ "@aws-sdk/client-sso": "3.576.0",
28
28
  "@aws-sdk/token-providers": "3.575.0",
29
29
  "@aws-sdk/types": "3.575.0",
30
30
  "@smithy/property-provider": "^3.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline core",
@@ -24,10 +24,10 @@
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
26
  "@smithy/middleware-endpoint": "^3.0.0",
27
- "@smithy/middleware-retry": "^3.0.0",
27
+ "@smithy/middleware-retry": "^3.0.1",
28
28
  "@smithy/middleware-serde": "^3.0.0",
29
29
  "@smithy/protocol-http": "^4.0.0",
30
- "@smithy/smithy-client": "^3.0.0",
30
+ "@smithy/smithy-client": "^3.0.1",
31
31
  "@smithy/types": "^3.0.0",
32
32
  "@smithy/util-middleware": "^3.0.0",
33
33
  "tslib": "^2.6.2"
@@ -97,12 +97,19 @@ var _FetchHttpHandler = class _FetchHttpHandler {
97
97
  const { port, method } = request;
98
98
  const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
99
99
  const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
100
- const requestOptions = { body, headers: new Headers(request.headers), method };
100
+ const requestOptions = {
101
+ body,
102
+ headers: new Headers(request.headers),
103
+ method
104
+ };
105
+ if (body) {
106
+ requestOptions.duplex = "half";
107
+ }
101
108
  if (typeof AbortController !== "undefined") {
102
- requestOptions["signal"] = abortSignal;
109
+ requestOptions.signal = abortSignal;
103
110
  }
104
111
  if (keepAliveSupport.supported) {
105
- requestOptions["keepalive"] = keepAlive;
112
+ requestOptions.keepalive = keepAlive;
106
113
  }
107
114
  const fetchRequest = new Request(url, requestOptions);
108
115
  const raceOfPromises = [