@aws-sdk/core 3.974.10 → 3.974.12

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 (162) hide show
  1. package/dist-cjs/index.js +14 -16
  2. package/dist-cjs/submodules/client/index.browser.js +595 -0
  3. package/dist-cjs/submodules/client/index.js +715 -0
  4. package/dist-cjs/submodules/client/index.native.js +588 -0
  5. package/dist-cjs/submodules/protocols/index.js +10 -10
  6. package/dist-es/index.js +3 -3
  7. package/dist-es/submodules/client/index.browser.js +36 -0
  8. package/dist-es/submodules/client/index.js +26 -4
  9. package/dist-es/submodules/client/index.native.js +37 -0
  10. package/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +33 -0
  11. package/dist-es/submodules/client/middleware-logger/loggerMiddleware.js +42 -0
  12. package/dist-es/submodules/client/middleware-recursion-detection/configuration.js +7 -0
  13. package/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.js +3 -0
  14. package/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js +7 -0
  15. package/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.js +1 -0
  16. package/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js +29 -0
  17. package/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.js +1 -0
  18. package/dist-es/submodules/client/middleware-user-agent/check-features.js +49 -0
  19. package/dist-es/submodules/client/middleware-user-agent/configurations.js +28 -0
  20. package/dist-es/submodules/client/middleware-user-agent/constants.js +7 -0
  21. package/dist-es/submodules/client/middleware-user-agent/encode-features.js +18 -0
  22. package/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js +82 -0
  23. package/dist-es/submodules/client/region-config-resolver/awsRegionConfig.js +2 -0
  24. package/dist-es/submodules/client/region-config-resolver/extensions.js +15 -0
  25. package/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.js +3 -0
  26. package/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js +15 -0
  27. package/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.js +3 -0
  28. package/dist-es/submodules/client/util-endpoints/aws.js +10 -0
  29. package/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js +25 -0
  30. package/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +18 -0
  31. package/dist-es/submodules/client/util-endpoints/lib/aws/partition.js +41 -0
  32. package/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +1 -0
  33. package/dist-es/submodules/client/util-endpoints/lib/isIpAddress.js +1 -0
  34. package/dist-es/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.js +21 -0
  35. package/dist-es/submodules/client/util-endpoints/resolveEndpoint.js +1 -0
  36. package/dist-es/submodules/client/util-endpoints/types/EndpointError.js +1 -0
  37. package/dist-es/submodules/client/util-endpoints/types/EndpointRuleObject.js +1 -0
  38. package/dist-es/submodules/client/util-endpoints/types/ErrorRuleObject.js +1 -0
  39. package/dist-es/submodules/client/util-endpoints/types/RuleSetObject.js +1 -0
  40. package/dist-es/submodules/client/util-endpoints/types/TreeRuleObject.js +1 -0
  41. package/dist-es/submodules/client/util-endpoints/types/shared.js +1 -0
  42. package/dist-es/submodules/client/util-user-agent-browser/configurations.js +1 -0
  43. package/dist-es/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.js +20 -0
  44. package/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.browser.js +1 -0
  45. package/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +53 -0
  46. package/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.native.js +18 -0
  47. package/dist-es/submodules/client/util-user-agent-node/crt-availability.js +3 -0
  48. package/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js +36 -0
  49. package/dist-es/submodules/client/util-user-agent-node/getNodeModulesParentDirs.js +15 -0
  50. package/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js +10 -0
  51. package/dist-es/submodules/client/util-user-agent-node/getSanitizedDevTypeScriptVersion.js +14 -0
  52. package/dist-es/submodules/client/util-user-agent-node/getSanitizedTypeScriptVersion.js +9 -0
  53. package/dist-es/submodules/client/util-user-agent-node/getTypeScriptUserAgentPair.js +75 -0
  54. package/dist-es/submodules/client/util-user-agent-node/is-crt-available.js +7 -0
  55. package/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js +9 -0
  56. package/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
  57. package/dist-es/submodules/protocols/json/parseJsonBody.js +9 -9
  58. package/dist-types/api-extractor-type-index.d.ts +3 -2
  59. package/dist-types/index.d.ts +12 -14
  60. package/dist-types/submodules/client/index.browser.d.ts +47 -0
  61. package/dist-types/submodules/client/index.d.ts +38 -4
  62. package/dist-types/submodules/client/index.native.d.ts +48 -0
  63. package/dist-types/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +35 -0
  64. package/dist-types/submodules/client/middleware-logger/loggerMiddleware.d.ts +4 -0
  65. package/dist-types/submodules/client/middleware-recursion-detection/configuration.d.ts +5 -0
  66. package/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +5 -0
  67. package/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -0
  68. package/dist-types/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +6 -0
  69. package/dist-types/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +6 -0
  70. package/dist-types/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +6 -0
  71. package/dist-types/submodules/client/middleware-user-agent/check-features.d.ts +20 -0
  72. package/dist-types/submodules/client/middleware-user-agent/configurations.d.ts +44 -0
  73. package/dist-types/submodules/client/middleware-user-agent/constants.d.ts +7 -0
  74. package/dist-types/submodules/client/middleware-user-agent/encode-features.d.ts +5 -0
  75. package/dist-types/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -0
  76. package/dist-types/submodules/client/region-config-resolver/awsRegionConfig.d.ts +15 -0
  77. package/dist-types/submodules/client/region-config-resolver/extensions.d.ts +16 -0
  78. package/dist-types/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +4 -0
  79. package/dist-types/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +14 -0
  80. package/dist-types/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +4 -0
  81. package/dist-types/submodules/client/util-endpoints/aws.d.ts +2 -0
  82. package/dist-types/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -0
  83. package/dist-types/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +7 -0
  84. package/dist-types/submodules/client/util-endpoints/lib/aws/partition.d.ts +38 -0
  85. package/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -0
  86. package/dist-types/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -0
  87. package/dist-types/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -0
  88. package/dist-types/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -0
  89. package/dist-types/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -0
  90. package/dist-types/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +1 -0
  91. package/dist-types/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -0
  92. package/dist-types/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -0
  93. package/dist-types/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -0
  94. package/dist-types/submodules/client/util-endpoints/types/shared.d.ts +1 -0
  95. package/dist-types/submodules/client/util-user-agent-browser/configurations.d.ts +7 -0
  96. package/dist-types/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +14 -0
  97. package/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
  98. package/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +27 -0
  99. package/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +18 -0
  100. package/dist-types/submodules/client/util-user-agent-node/crt-availability.d.ts +8 -0
  101. package/dist-types/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +28 -0
  102. package/dist-types/submodules/client/util-user-agent-node/getNodeModulesParentDirs.d.ts +10 -0
  103. package/dist-types/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +6 -0
  104. package/dist-types/submodules/client/util-user-agent-node/getSanitizedDevTypeScriptVersion.d.ts +8 -0
  105. package/dist-types/submodules/client/util-user-agent-node/getSanitizedTypeScriptVersion.d.ts +8 -0
  106. package/dist-types/submodules/client/util-user-agent-node/getTypeScriptUserAgentPair.d.ts +6 -0
  107. package/dist-types/submodules/client/util-user-agent-node/is-crt-available.d.ts +5 -0
  108. package/dist-types/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +13 -0
  109. package/dist-types/submodules/protocols/json/parseJsonBody.d.ts +1 -1
  110. package/dist-types/ts3.4/api-extractor-type-index.d.ts +0 -2
  111. package/dist-types/ts3.4/index.d.ts +65 -3
  112. package/dist-types/ts3.4/submodules/client/index.browser.d.ts +116 -0
  113. package/dist-types/ts3.4/submodules/client/index.d.ts +123 -4
  114. package/dist-types/ts3.4/submodules/client/index.native.d.ts +116 -0
  115. package/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +29 -0
  116. package/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +17 -0
  117. package/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +3 -0
  118. package/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +4 -0
  119. package/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +4 -0
  120. package/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +5 -0
  121. package/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +5 -0
  122. package/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +5 -0
  123. package/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +20 -0
  124. package/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +21 -0
  125. package/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -0
  126. package/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +2 -0
  127. package/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +21 -0
  128. package/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +8 -0
  129. package/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +14 -0
  130. package/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +1 -0
  131. package/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +7 -0
  132. package/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +1 -0
  133. package/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -0
  134. package/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +4 -0
  135. package/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +2 -0
  136. package/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +28 -0
  137. package/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -0
  138. package/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -0
  139. package/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +35 -0
  140. package/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -0
  141. package/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -0
  142. package/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +6 -0
  143. package/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -0
  144. package/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +5 -0
  145. package/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -0
  146. package/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +12 -0
  147. package/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +4 -0
  148. package/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +9 -0
  149. package/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
  150. package/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +22 -0
  151. package/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +17 -0
  152. package/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +3 -0
  153. package/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +21 -0
  154. package/dist-types/ts3.4/submodules/client/util-user-agent-node/getNodeModulesParentDirs.d.ts +1 -0
  155. package/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +2 -0
  156. package/dist-types/ts3.4/submodules/client/util-user-agent-node/getSanitizedDevTypeScriptVersion.d.ts +3 -0
  157. package/dist-types/ts3.4/submodules/client/util-user-agent-node/getSanitizedTypeScriptVersion.d.ts +3 -0
  158. package/dist-types/ts3.4/submodules/client/util-user-agent-node/getTypeScriptUserAgentPair.d.ts +4 -0
  159. package/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +2 -0
  160. package/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +6 -0
  161. package/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -1
  162. package/package.json +26 -7
@@ -0,0 +1,588 @@
1
+ 'use strict';
2
+
3
+ var retry = require('@smithy/core/retry');
4
+ var protocols = require('@smithy/core/protocols');
5
+ var core = require('@smithy/core');
6
+ var endpoints = require('@smithy/core/endpoints');
7
+ var config = require('@smithy/core/config');
8
+
9
+ const longPollMiddleware = () => (next, context) => async (args) => {
10
+ context.__retryLongPoll = true;
11
+ return next(args);
12
+ };
13
+ const longPollMiddlewareOptions = {
14
+ name: "longPollMiddleware",
15
+ tags: ["RETRY"],
16
+ step: "initialize",
17
+ override: true,
18
+ };
19
+ const getLongPollPlugin = (options) => ({
20
+ applyToStack: (clientStack) => {
21
+ clientStack.add(longPollMiddleware(), longPollMiddlewareOptions);
22
+ },
23
+ });
24
+
25
+ function setCredentialFeature(credentials, feature, value) {
26
+ if (!credentials.$source) {
27
+ credentials.$source = {};
28
+ }
29
+ credentials.$source[feature] = value;
30
+ return credentials;
31
+ }
32
+
33
+ retry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true";
34
+ function setFeature(context, feature, value) {
35
+ if (!context.__aws_sdk_context) {
36
+ context.__aws_sdk_context = {
37
+ features: {},
38
+ };
39
+ }
40
+ else if (!context.__aws_sdk_context.features) {
41
+ context.__aws_sdk_context.features = {};
42
+ }
43
+ context.__aws_sdk_context.features[feature] = value;
44
+ }
45
+
46
+ function setTokenFeature(token, feature, value) {
47
+ if (!token.$source) {
48
+ token.$source = {};
49
+ }
50
+ token.$source[feature] = value;
51
+ return token;
52
+ }
53
+
54
+ function resolveHostHeaderConfig(input) {
55
+ return input;
56
+ }
57
+ const hostHeaderMiddleware = (options) => (next) => async (args) => {
58
+ if (!protocols.HttpRequest.isInstance(args.request))
59
+ return next(args);
60
+ const { request } = args;
61
+ const { handlerProtocol = "" } = options.requestHandler.metadata || {};
62
+ if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
63
+ delete request.headers["host"];
64
+ request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
65
+ }
66
+ else if (!request.headers["host"]) {
67
+ let host = request.hostname;
68
+ if (request.port != null)
69
+ host += `:${request.port}`;
70
+ request.headers["host"] = host;
71
+ }
72
+ return next(args);
73
+ };
74
+ const hostHeaderMiddlewareOptions = {
75
+ name: "hostHeaderMiddleware",
76
+ step: "build",
77
+ priority: "low",
78
+ tags: ["HOST"],
79
+ override: true,
80
+ };
81
+ const getHostHeaderPlugin = (options) => ({
82
+ applyToStack: (clientStack) => {
83
+ clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
84
+ },
85
+ });
86
+
87
+ const loggerMiddleware = () => (next, context) => async (args) => {
88
+ try {
89
+ const response = await next(args);
90
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
91
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
92
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
93
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
94
+ const { $metadata, ...outputWithoutMetadata } = response.output;
95
+ logger?.info?.({
96
+ clientName,
97
+ commandName,
98
+ input: inputFilterSensitiveLog(args.input),
99
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
100
+ metadata: $metadata,
101
+ });
102
+ return response;
103
+ }
104
+ catch (error) {
105
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
106
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
107
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
108
+ logger?.error?.({
109
+ clientName,
110
+ commandName,
111
+ input: inputFilterSensitiveLog(args.input),
112
+ error,
113
+ metadata: error.$metadata,
114
+ });
115
+ throw error;
116
+ }
117
+ };
118
+ const loggerMiddlewareOptions = {
119
+ name: "loggerMiddleware",
120
+ tags: ["LOGGER"],
121
+ step: "initialize",
122
+ override: true,
123
+ };
124
+ const getLoggerPlugin = (options) => ({
125
+ applyToStack: (clientStack) => {
126
+ clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
127
+ },
128
+ });
129
+
130
+ const recursionDetectionMiddlewareOptions = {
131
+ step: "build",
132
+ tags: ["RECURSION_DETECTION"],
133
+ name: "recursionDetectionMiddleware",
134
+ override: true,
135
+ priority: "low",
136
+ };
137
+
138
+ const getRecursionDetectionPlugin = (options) => ({
139
+ applyToStack: (clientStack) => { },
140
+ });
141
+
142
+ const recursionDetectionMiddleware = () => (next) => async (args) => next(args);
143
+
144
+ const DEFAULT_UA_APP_ID = undefined;
145
+ function isValidUserAgentAppId(appId) {
146
+ if (appId === undefined) {
147
+ return true;
148
+ }
149
+ return typeof appId === "string" && appId.length <= 50;
150
+ }
151
+ function resolveUserAgentConfig(input) {
152
+ const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
153
+ const { customUserAgent } = input;
154
+ return Object.assign(input, {
155
+ customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
156
+ userAgentAppId: async () => {
157
+ const appId = await normalizedAppIdProvider();
158
+ if (!isValidUserAgentAppId(appId)) {
159
+ const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
160
+ if (typeof appId !== "string") {
161
+ logger?.warn("userAgentAppId must be a string or undefined.");
162
+ }
163
+ else if (appId.length > 50) {
164
+ logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
165
+ }
166
+ }
167
+ return appId;
168
+ },
169
+ });
170
+ }
171
+
172
+ const partitionsInfo = { "partitions": [{ "id": "aws", "outputs": { "dnsSuffix": "amazonaws.com", "dualStackDnsSuffix": "api.aws", "implicitGlobalRegion": "us-east-1", "name": "aws", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", "regions": { "af-south-1": { "description": "Africa (Cape Town)" }, "ap-east-1": { "description": "Asia Pacific (Hong Kong)" }, "ap-east-2": { "description": "Asia Pacific (Taipei)" }, "ap-northeast-1": { "description": "Asia Pacific (Tokyo)" }, "ap-northeast-2": { "description": "Asia Pacific (Seoul)" }, "ap-northeast-3": { "description": "Asia Pacific (Osaka)" }, "ap-south-1": { "description": "Asia Pacific (Mumbai)" }, "ap-south-2": { "description": "Asia Pacific (Hyderabad)" }, "ap-southeast-1": { "description": "Asia Pacific (Singapore)" }, "ap-southeast-2": { "description": "Asia Pacific (Sydney)" }, "ap-southeast-3": { "description": "Asia Pacific (Jakarta)" }, "ap-southeast-4": { "description": "Asia Pacific (Melbourne)" }, "ap-southeast-5": { "description": "Asia Pacific (Malaysia)" }, "ap-southeast-6": { "description": "Asia Pacific (New Zealand)" }, "ap-southeast-7": { "description": "Asia Pacific (Thailand)" }, "aws-global": { "description": "aws global region" }, "ca-central-1": { "description": "Canada (Central)" }, "ca-west-1": { "description": "Canada West (Calgary)" }, "eu-central-1": { "description": "Europe (Frankfurt)" }, "eu-central-2": { "description": "Europe (Zurich)" }, "eu-north-1": { "description": "Europe (Stockholm)" }, "eu-south-1": { "description": "Europe (Milan)" }, "eu-south-2": { "description": "Europe (Spain)" }, "eu-west-1": { "description": "Europe (Ireland)" }, "eu-west-2": { "description": "Europe (London)" }, "eu-west-3": { "description": "Europe (Paris)" }, "il-central-1": { "description": "Israel (Tel Aviv)" }, "me-central-1": { "description": "Middle East (UAE)" }, "me-south-1": { "description": "Middle East (Bahrain)" }, "mx-central-1": { "description": "Mexico (Central)" }, "sa-east-1": { "description": "South America (Sao Paulo)" }, "us-east-1": { "description": "US East (N. Virginia)" }, "us-east-2": { "description": "US East (Ohio)" }, "us-west-1": { "description": "US West (N. California)" }, "us-west-2": { "description": "US West (Oregon)" } } }, { "id": "aws-cn", "outputs": { "dnsSuffix": "amazonaws.com.cn", "dualStackDnsSuffix": "api.amazonwebservices.com.cn", "implicitGlobalRegion": "cn-northwest-1", "name": "aws-cn", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^cn\\-\\w+\\-\\d+$", "regions": { "aws-cn-global": { "description": "aws-cn global region" }, "cn-north-1": { "description": "China (Beijing)" }, "cn-northwest-1": { "description": "China (Ningxia)" } } }, { "id": "aws-eusc", "outputs": { "dnsSuffix": "amazonaws.eu", "dualStackDnsSuffix": "api.amazonwebservices.eu", "implicitGlobalRegion": "eusc-de-east-1", "name": "aws-eusc", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^eusc\\-(de)\\-\\w+\\-\\d+$", "regions": { "eusc-de-east-1": { "description": "AWS European Sovereign Cloud (Germany)" } } }, { "id": "aws-iso", "outputs": { "dnsSuffix": "c2s.ic.gov", "dualStackDnsSuffix": "api.aws.ic.gov", "implicitGlobalRegion": "us-iso-east-1", "name": "aws-iso", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$", "regions": { "aws-iso-global": { "description": "aws-iso global region" }, "us-iso-east-1": { "description": "US ISO East" }, "us-iso-west-1": { "description": "US ISO WEST" } } }, { "id": "aws-iso-b", "outputs": { "dnsSuffix": "sc2s.sgov.gov", "dualStackDnsSuffix": "api.aws.scloud", "implicitGlobalRegion": "us-isob-east-1", "name": "aws-iso-b", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^us\\-isob\\-\\w+\\-\\d+$", "regions": { "aws-iso-b-global": { "description": "aws-iso-b global region" }, "us-isob-east-1": { "description": "US ISOB East (Ohio)" }, "us-isob-west-1": { "description": "US ISOB West" } } }, { "id": "aws-iso-e", "outputs": { "dnsSuffix": "cloud.adc-e.uk", "dualStackDnsSuffix": "api.cloud-aws.adc-e.uk", "implicitGlobalRegion": "eu-isoe-west-1", "name": "aws-iso-e", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^eu\\-isoe\\-\\w+\\-\\d+$", "regions": { "aws-iso-e-global": { "description": "aws-iso-e global region" }, "eu-isoe-west-1": { "description": "EU ISOE West" } } }, { "id": "aws-iso-f", "outputs": { "dnsSuffix": "csp.hci.ic.gov", "dualStackDnsSuffix": "api.aws.hci.ic.gov", "implicitGlobalRegion": "us-isof-south-1", "name": "aws-iso-f", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^us\\-isof\\-\\w+\\-\\d+$", "regions": { "aws-iso-f-global": { "description": "aws-iso-f global region" }, "us-isof-east-1": { "description": "US ISOF EAST" }, "us-isof-south-1": { "description": "US ISOF SOUTH" } } }, { "id": "aws-us-gov", "outputs": { "dnsSuffix": "amazonaws.com", "dualStackDnsSuffix": "api.aws", "implicitGlobalRegion": "us-gov-west-1", "name": "aws-us-gov", "supportsDualStack": true, "supportsFIPS": true }, "regionRegex": "^us\\-gov\\-\\w+\\-\\d+$", "regions": { "aws-us-gov-global": { "description": "aws-us-gov global region" }, "us-gov-east-1": { "description": "AWS GovCloud (US-East)" }, "us-gov-west-1": { "description": "AWS GovCloud (US-West)" } } }], "version": "1.1" };
173
+
174
+ let selectedPartitionsInfo = partitionsInfo;
175
+ let selectedUserAgentPrefix = "";
176
+ const partition = (value) => {
177
+ const { partitions } = selectedPartitionsInfo;
178
+ for (const partition of partitions) {
179
+ const { regions, outputs } = partition;
180
+ for (const [region, regionData] of Object.entries(regions)) {
181
+ if (region === value) {
182
+ return {
183
+ ...outputs,
184
+ ...regionData,
185
+ };
186
+ }
187
+ }
188
+ }
189
+ for (const partition of partitions) {
190
+ const { regionRegex, outputs } = partition;
191
+ if (new RegExp(regionRegex).test(value)) {
192
+ return {
193
+ ...outputs,
194
+ };
195
+ }
196
+ }
197
+ const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws");
198
+ if (!DEFAULT_PARTITION) {
199
+ throw new Error("Provided region was not found in the partition array or regex," +
200
+ " and default partition with id 'aws' doesn't exist.");
201
+ }
202
+ return {
203
+ ...DEFAULT_PARTITION.outputs,
204
+ };
205
+ };
206
+ const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => {
207
+ selectedPartitionsInfo = partitionsInfo;
208
+ selectedUserAgentPrefix = userAgentPrefix;
209
+ };
210
+ const useDefaultPartitionInfo = () => {
211
+ setPartitionInfo(partitionsInfo, "");
212
+ };
213
+ const getUserAgentPrefix = () => selectedUserAgentPrefix;
214
+
215
+ const ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
216
+ async function checkFeatures(context, config, args) {
217
+ const request = args.request;
218
+ if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
219
+ setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
220
+ }
221
+ if (typeof config.retryStrategy === "function") {
222
+ const retryStrategy = await config.retryStrategy();
223
+ if (typeof retryStrategy.mode === "string") {
224
+ switch (retryStrategy.mode) {
225
+ case retry.RETRY_MODES.ADAPTIVE:
226
+ setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
227
+ break;
228
+ case retry.RETRY_MODES.STANDARD:
229
+ setFeature(context, "RETRY_MODE_STANDARD", "E");
230
+ break;
231
+ }
232
+ }
233
+ }
234
+ if (typeof config.accountIdEndpointMode === "function") {
235
+ const endpointV2 = context.endpointV2;
236
+ if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
237
+ setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
238
+ }
239
+ switch (await config.accountIdEndpointMode?.()) {
240
+ case "disabled":
241
+ setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
242
+ break;
243
+ case "preferred":
244
+ setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
245
+ break;
246
+ case "required":
247
+ setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
248
+ break;
249
+ }
250
+ }
251
+ const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
252
+ if (identity?.$source) {
253
+ const credentials = identity;
254
+ if (credentials.accountId) {
255
+ setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
256
+ }
257
+ for (const [key, value] of Object.entries(credentials.$source ?? {})) {
258
+ setFeature(context, key, value);
259
+ }
260
+ }
261
+ }
262
+
263
+ const USER_AGENT = "user-agent";
264
+ const X_AMZ_USER_AGENT = "x-amz-user-agent";
265
+ const SPACE = " ";
266
+ const UA_NAME_SEPARATOR = "/";
267
+ const UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g;
268
+ const UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g;
269
+ const UA_ESCAPE_CHAR = "-";
270
+
271
+ const BYTE_LIMIT = 1024;
272
+ function encodeFeatures(features) {
273
+ let buffer = "";
274
+ for (const key in features) {
275
+ const val = features[key];
276
+ if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
277
+ if (buffer.length) {
278
+ buffer += "," + val;
279
+ }
280
+ else {
281
+ buffer += val;
282
+ }
283
+ continue;
284
+ }
285
+ break;
286
+ }
287
+ return buffer;
288
+ }
289
+
290
+ const userAgentMiddleware = (options) => (next, context) => async (args) => {
291
+ const { request } = args;
292
+ if (!protocols.HttpRequest.isInstance(request)) {
293
+ return next(args);
294
+ }
295
+ const { headers } = request;
296
+ const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
297
+ const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
298
+ await checkFeatures(context, options, args);
299
+ const awsContext = context;
300
+ defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
301
+ const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
302
+ const appId = await options.userAgentAppId();
303
+ if (appId) {
304
+ defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`]));
305
+ }
306
+ const prefix = getUserAgentPrefix();
307
+ const sdkUserAgentValue = (prefix ? [prefix] : [])
308
+ .concat([...defaultUserAgent, ...userAgent, ...customUserAgent])
309
+ .join(SPACE);
310
+ const normalUAValue = [
311
+ ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
312
+ ...customUserAgent,
313
+ ].join(SPACE);
314
+ if (options.runtime !== "browser") {
315
+ if (normalUAValue) {
316
+ headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT]
317
+ ? `${headers[USER_AGENT]} ${normalUAValue}`
318
+ : normalUAValue;
319
+ }
320
+ headers[USER_AGENT] = sdkUserAgentValue;
321
+ }
322
+ else {
323
+ headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
324
+ }
325
+ return next({
326
+ ...args,
327
+ request,
328
+ });
329
+ };
330
+ const escapeUserAgent = (userAgentPair) => {
331
+ const name = userAgentPair[0]
332
+ .split(UA_NAME_SEPARATOR)
333
+ .map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR))
334
+ .join(UA_NAME_SEPARATOR);
335
+ const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
336
+ const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
337
+ const prefix = name.substring(0, prefixSeparatorIndex);
338
+ let uaName = name.substring(prefixSeparatorIndex + 1);
339
+ if (prefix === "api") {
340
+ uaName = uaName.toLowerCase();
341
+ }
342
+ return [prefix, uaName, version]
343
+ .filter((item) => item && item.length > 0)
344
+ .reduce((acc, item, index) => {
345
+ switch (index) {
346
+ case 0:
347
+ return item;
348
+ case 1:
349
+ return `${acc}/${item}`;
350
+ default:
351
+ return `${acc}#${item}`;
352
+ }
353
+ }, "");
354
+ };
355
+ const getUserAgentMiddlewareOptions = {
356
+ name: "getUserAgentMiddleware",
357
+ step: "build",
358
+ priority: "low",
359
+ tags: ["SET_USER_AGENT", "USER_AGENT"],
360
+ override: true,
361
+ };
362
+ const getUserAgentPlugin = (config) => ({
363
+ applyToStack: (clientStack) => {
364
+ clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
365
+ },
366
+ });
367
+
368
+ const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => async (config) => {
369
+ const sections = [
370
+ ["aws-sdk-js", clientVersion],
371
+ ["ua", "2.1"],
372
+ ["os/other"],
373
+ ["lang/js"],
374
+ ["md/rn"],
375
+ ];
376
+ if (serviceId) {
377
+ sections.push([`api/${serviceId}`, clientVersion]);
378
+ }
379
+ const appId = await config?.userAgentAppId?.();
380
+ if (appId) {
381
+ sections.push([`app/${appId}`]);
382
+ }
383
+ return sections;
384
+ };
385
+ const defaultUserAgent = createDefaultUserAgentProvider;
386
+
387
+ const createUserAgentStringParsingProvider = ({ serviceId, clientVersion }) => async (config) => {
388
+ const module = await import('bowser');
389
+ const parse = module.parse ?? module.default.parse ?? (() => "");
390
+ const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent ? parse(window.navigator.userAgent) : undefined;
391
+ const sections = [
392
+ ["aws-sdk-js", clientVersion],
393
+ ["ua", "2.1"],
394
+ [`os/${parsedUA?.os?.name || "other"}`, parsedUA?.os?.version],
395
+ ["lang/js"],
396
+ ["md/browser", `${parsedUA?.browser?.name ?? "unknown"}_${parsedUA?.browser?.version ?? "unknown"}`],
397
+ ];
398
+ if (serviceId) {
399
+ sections.push([`api/${serviceId}`, clientVersion]);
400
+ }
401
+ const appId = await config?.userAgentAppId?.();
402
+ if (appId) {
403
+ sections.push([`app/${appId}`]);
404
+ }
405
+ return sections;
406
+ };
407
+
408
+ const fallback = {
409
+ os(ua) {
410
+ if (/iPhone|iPad|iPod/.test(ua))
411
+ return "iOS";
412
+ if (/Macintosh|Mac OS X/.test(ua))
413
+ return "macOS";
414
+ if (/Windows NT/.test(ua))
415
+ return "Windows";
416
+ if (/Android/.test(ua))
417
+ return "Android";
418
+ if (/Linux/.test(ua))
419
+ return "Linux";
420
+ return undefined;
421
+ },
422
+ browser(ua) {
423
+ if (/EdgiOS|EdgA|Edg\//.test(ua))
424
+ return "Microsoft Edge";
425
+ if (/Firefox\//.test(ua))
426
+ return "Firefox";
427
+ if (/Chrome\//.test(ua))
428
+ return "Chrome";
429
+ if (/Safari\//.test(ua))
430
+ return "Safari";
431
+ return undefined;
432
+ },
433
+ };
434
+
435
+ const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
436
+ if (allowSubDomains) {
437
+ for (const label of value.split(".")) {
438
+ if (!isVirtualHostableS3Bucket(label)) {
439
+ return false;
440
+ }
441
+ }
442
+ return true;
443
+ }
444
+ if (!endpoints.isValidHostLabel(value)) {
445
+ return false;
446
+ }
447
+ if (value.length < 3 || value.length > 63) {
448
+ return false;
449
+ }
450
+ if (value !== value.toLowerCase()) {
451
+ return false;
452
+ }
453
+ if (endpoints.isIpAddress(value)) {
454
+ return false;
455
+ }
456
+ return true;
457
+ };
458
+
459
+ const ARN_DELIMITER = ":";
460
+ const RESOURCE_DELIMITER = "/";
461
+ const parseArn = (value) => {
462
+ const segments = value.split(ARN_DELIMITER);
463
+ if (segments.length < 6)
464
+ return null;
465
+ const [arn, partition, service, region, accountId, ...resourcePath] = segments;
466
+ if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
467
+ return null;
468
+ const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
469
+ return {
470
+ partition,
471
+ service,
472
+ region,
473
+ accountId,
474
+ resourceId,
475
+ };
476
+ };
477
+
478
+ const awsEndpointFunctions = {
479
+ isVirtualHostableS3Bucket: isVirtualHostableS3Bucket,
480
+ parseArn: parseArn,
481
+ partition: partition,
482
+ };
483
+ endpoints.customEndpointFunctions.aws = awsEndpointFunctions;
484
+
485
+ const resolveDefaultAwsRegionalEndpointsConfig = (input) => {
486
+ if (typeof input.endpointProvider !== "function") {
487
+ throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");
488
+ }
489
+ const { endpoint } = input;
490
+ if (endpoint === undefined) {
491
+ input.endpoint = async () => {
492
+ return toEndpointV1(input.endpointProvider({
493
+ Region: typeof input.region === "function" ? await input.region() : input.region,
494
+ UseDualStack: typeof input.useDualstackEndpoint === "function"
495
+ ? await input.useDualstackEndpoint()
496
+ : input.useDualstackEndpoint,
497
+ UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint,
498
+ Endpoint: undefined,
499
+ }, { logger: input.logger }));
500
+ };
501
+ }
502
+ return input;
503
+ };
504
+ const toEndpointV1 = (endpoint) => protocols.parseUrl(endpoint.url);
505
+
506
+ function stsRegionDefaultResolver() {
507
+ return async () => "us-east-1";
508
+ }
509
+
510
+ const getAwsRegionExtensionConfiguration = (runtimeConfig) => {
511
+ return {
512
+ setRegion(region) {
513
+ runtimeConfig.region = region;
514
+ },
515
+ region() {
516
+ return runtimeConfig.region;
517
+ },
518
+ };
519
+ };
520
+ const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
521
+ return {
522
+ region: awsRegionExtensionConfiguration.region(),
523
+ };
524
+ };
525
+
526
+ const no = Symbol.for("node-only");
527
+ const emitWarningIfUnsupportedVersion = no;
528
+ const state = no;
529
+ const crtAvailability = no;
530
+ const NODE_APP_ID_CONFIG_OPTIONS = no;
531
+ const UA_APP_ID_ENV_NAME = no;
532
+ const UA_APP_ID_INI_NAME = no;
533
+ const REGION_ENV_NAME = no;
534
+ const REGION_INI_NAME = no;
535
+ const NODE_REGION_CONFIG_OPTIONS = no;
536
+ const NODE_REGION_CONFIG_FILE_OPTIONS = no;
537
+ const stsRegionWarning = no;
538
+
539
+ exports.EndpointError = endpoints.EndpointError;
540
+ exports.isIpAddress = endpoints.isIpAddress;
541
+ exports.resolveEndpoint = endpoints.resolveEndpoint;
542
+ exports.resolveRegionConfig = config.resolveRegionConfig;
543
+ exports.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID;
544
+ exports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS;
545
+ exports.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS;
546
+ exports.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS;
547
+ exports.REGION_ENV_NAME = REGION_ENV_NAME;
548
+ exports.REGION_INI_NAME = REGION_INI_NAME;
549
+ exports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME;
550
+ exports.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME;
551
+ exports.awsEndpointFunctions = awsEndpointFunctions;
552
+ exports.createDefaultUserAgentProvider = createDefaultUserAgentProvider;
553
+ exports.createUserAgentStringParsingProvider = createUserAgentStringParsingProvider;
554
+ exports.crtAvailability = crtAvailability;
555
+ exports.defaultUserAgent = defaultUserAgent;
556
+ exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;
557
+ exports.fallback = fallback;
558
+ exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration;
559
+ exports.getHostHeaderPlugin = getHostHeaderPlugin;
560
+ exports.getLoggerPlugin = getLoggerPlugin;
561
+ exports.getLongPollPlugin = getLongPollPlugin;
562
+ exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin;
563
+ exports.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions;
564
+ exports.getUserAgentPlugin = getUserAgentPlugin;
565
+ exports.getUserAgentPrefix = getUserAgentPrefix;
566
+ exports.hostHeaderMiddleware = hostHeaderMiddleware;
567
+ exports.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions;
568
+ exports.isVirtualHostableS3Bucket = isVirtualHostableS3Bucket;
569
+ exports.loggerMiddleware = loggerMiddleware;
570
+ exports.loggerMiddlewareOptions = loggerMiddlewareOptions;
571
+ exports.parseArn = parseArn;
572
+ exports.partition = partition;
573
+ exports.recursionDetectionMiddleware = recursionDetectionMiddleware;
574
+ exports.recursionDetectionMiddlewareOptions = recursionDetectionMiddlewareOptions;
575
+ exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration;
576
+ exports.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig;
577
+ exports.resolveHostHeaderConfig = resolveHostHeaderConfig;
578
+ exports.resolveUserAgentConfig = resolveUserAgentConfig;
579
+ exports.setCredentialFeature = setCredentialFeature;
580
+ exports.setFeature = setFeature;
581
+ exports.setPartitionInfo = setPartitionInfo;
582
+ exports.setTokenFeature = setTokenFeature;
583
+ exports.state = state;
584
+ exports.stsRegionDefaultResolver = stsRegionDefaultResolver;
585
+ exports.stsRegionWarning = stsRegionWarning;
586
+ exports.toEndpointV1 = toEndpointV1;
587
+ exports.useDefaultPartitionInfo = useDefaultPartitionInfo;
588
+ exports.userAgentMiddleware = userAgentMiddleware;
@@ -321,7 +321,7 @@ const parseJsonErrorBody = async (errorBody, context) => {
321
321
  return value;
322
322
  };
323
323
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
324
- const sanitizeErrorCode = (rawValue, removeNamespace = true) => {
324
+ const sanitizeErrorCode = (rawValue) => {
325
325
  let cleanValue = rawValue;
326
326
  if (typeof cleanValue === "number") {
327
327
  cleanValue = cleanValue.toString();
@@ -332,36 +332,36 @@ const sanitizeErrorCode = (rawValue, removeNamespace = true) => {
332
332
  if (cleanValue.indexOf(":") >= 0) {
333
333
  cleanValue = cleanValue.split(":")[0];
334
334
  }
335
- if (removeNamespace && cleanValue.indexOf("#") >= 0) {
335
+ if (cleanValue.indexOf("#") >= 0) {
336
336
  cleanValue = cleanValue.split("#")[1];
337
337
  }
338
338
  return cleanValue;
339
339
  };
340
340
  const loadRestJsonErrorCode = (output, data) => {
341
- return loadErrorCode(output, data, true, ["header", "code", "type"]);
341
+ return loadErrorCode(output, data, ["header", "code", "type"]);
342
342
  };
343
- const loadJsonRpcErrorCode = (output, data, removeNamespace, queryCompat = false) => {
344
- return loadErrorCode(output, data, removeNamespace, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
343
+ const loadJsonRpcErrorCode = (output, data, queryCompat = false) => {
344
+ return loadErrorCode(output, data, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
345
345
  };
346
- const loadErrorCode = ({ headers }, data, removeNamespace, order) => {
346
+ const loadErrorCode = ({ headers }, data, order) => {
347
347
  while (order.length > 0) {
348
348
  const location = order.shift();
349
349
  switch (location) {
350
350
  case "header":
351
351
  const headerKey = findKey(headers ?? {}, "x-amzn-errortype");
352
352
  if (headerKey !== undefined) {
353
- return sanitizeErrorCode(headers[headerKey], removeNamespace);
353
+ return sanitizeErrorCode(headers[headerKey]);
354
354
  }
355
355
  break;
356
356
  case "code":
357
357
  const codeKey = findKey(data ?? {}, "code");
358
358
  if (codeKey && data[codeKey] !== undefined) {
359
- return sanitizeErrorCode(data[codeKey], removeNamespace);
359
+ return sanitizeErrorCode(data[codeKey]);
360
360
  }
361
361
  break;
362
362
  case "type":
363
363
  if (data?.__type !== undefined) {
364
- return sanitizeErrorCode(data.__type, removeNamespace);
364
+ return sanitizeErrorCode(data.__type);
365
365
  }
366
366
  break;
367
367
  }
@@ -802,7 +802,7 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
802
802
  if (awsQueryCompatible) {
803
803
  this.mixin.setQueryCompatError(dataObject, response);
804
804
  }
805
- const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, this.getJsonRpcVersion() === "1.1", awsQueryCompatible) ?? "Unknown";
805
+ const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, awsQueryCompatible) ?? "Unknown";
806
806
  this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
807
807
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
808
808
  const ns = schema.NormalizedSchema.of(errorSchema);
package/dist-es/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./submodules/client/index";
2
- export * from "./submodules/httpAuthSchemes/index";
3
- export * from "./submodules/protocols/index";
1
+ export { emitWarningIfUnsupportedVersion, getLongPollPlugin, setCredentialFeature, setFeature, setTokenFeature, state, } from "./submodules/client/index";
2
+ export { AwsSdkSigV4ASigner, AwsSdkSigV4Signer, AwsSdkSigV4Signer as AWSSDKSigV4Signer, getBearerTokenEnvKey, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS, resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config, resolveAwsSdkSigV4Config as resolveAWSSDKSigV4Config, validateSigningProperties, } from "./submodules/httpAuthSchemes/index";
3
+ export { _toBool, _toNum, _toStr, awsExpectUnion, AwsEc2QueryProtocol, AwsJson1_0Protocol, AwsJson1_1Protocol, AwsJsonRpcProtocol, AwsQueryProtocol, AwsRestJsonProtocol, AwsRestXmlProtocol, AwsSmithyRpcV2CborProtocol, JsonCodec, JsonShapeDeserializer, JsonShapeSerializer, loadJsonRpcErrorCode, loadRestJsonErrorCode, loadRestXmlErrorCode, parseJsonBody, parseJsonErrorBody, parseXmlBody, parseXmlErrorBody, QueryShapeSerializer, XmlCodec, XmlShapeDeserializer, XmlShapeSerializer, } from "./submodules/protocols/index";