@cdk8s/awscdk-resolver 0.0.599 → 0.0.601

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 (119) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/auth/httpAuthSchemeProvider.js +9 -15
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/endpoint/bdd.js +2 -5
  5. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/endpoint/endpointResolver.js +7 -11
  6. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +449 -469
  7. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/models/CloudFormationServiceException.js +4 -8
  8. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/models/errors.js +59 -91
  9. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.browser.js +22 -26
  10. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.js +30 -34
  11. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.native.js +4 -7
  12. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.shared.js +20 -24
  13. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/schemas/schemas_0.js +814 -533
  14. package/node_modules/@aws-sdk/client-cloudformation/package.json +8 -8
  15. package/node_modules/@aws-sdk/core/dist-cjs/index.js +45 -50
  16. package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +2 -4
  17. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +21 -22
  18. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +51 -51
  19. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +21 -22
  20. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +19 -21
  21. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +107 -109
  22. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -4
  23. package/node_modules/@aws-sdk/core/package.json +8 -8
  24. package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +4 -6
  25. package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
  26. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +3 -7
  27. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +12 -16
  28. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +16 -21
  29. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +14 -18
  30. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +1 -5
  31. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +2 -5
  32. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +2 -7
  33. package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
  34. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +47 -41
  35. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js +8 -4
  36. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +14 -10
  37. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  38. package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +31 -33
  39. package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
  40. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +16 -18
  41. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  42. package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +11 -13
  43. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  44. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +22 -24
  45. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BGYXHf8s.js +3 -0
  46. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  47. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +10 -14
  48. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +2 -6
  49. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +3 -27
  50. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  51. package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +0 -1
  52. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +82 -84
  53. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +158 -119
  54. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +80 -82
  55. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +80 -82
  56. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +99 -101
  57. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +4 -1
  58. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +70 -35
  59. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
  60. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +3 -0
  61. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
  62. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +12 -0
  63. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
  64. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +3 -0
  65. package/node_modules/@aws-sdk/nested-clients/package.json +9 -8
  66. package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +4 -6
  67. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
  68. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +26 -28
  69. package/node_modules/@aws-sdk/token-providers/package.json +7 -7
  70. package/node_modules/@aws-sdk/types/dist-cjs/index.js +7 -8
  71. package/node_modules/@aws-sdk/types/package.json +4 -4
  72. package/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js +0 -2
  73. package/node_modules/@aws-sdk/util-locate-window/package.json +4 -4
  74. package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +2 -4
  75. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +4 -7
  76. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +2 -5
  77. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +7 -10
  78. package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
  79. package/node_modules/@smithy/core/dist-cjs/index.js +13 -15
  80. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +29 -31
  81. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +2 -4
  82. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +7 -9
  83. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +3 -5
  84. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +22 -23
  85. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +10 -11
  86. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +38 -39
  87. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +10 -11
  88. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +14 -17
  89. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +20 -23
  90. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +9 -11
  91. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -13
  92. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +59 -60
  93. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +26 -27
  94. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +28 -29
  95. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +5 -7
  96. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -6
  97. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +23 -25
  98. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -6
  99. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +2 -4
  100. package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +1 -1
  101. package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js +1 -1
  102. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -1
  103. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js +1 -1
  104. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +2 -2
  105. package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js +1 -1
  106. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  107. package/node_modules/@smithy/core/package.json +18 -17
  108. package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +23 -24
  109. package/node_modules/@smithy/credential-provider-imds/package.json +7 -7
  110. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +6 -8
  111. package/node_modules/@smithy/fetch-http-handler/package.json +10 -10
  112. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
  113. package/node_modules/@smithy/node-http-handler/package.json +8 -8
  114. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +27 -29
  115. package/node_modules/@smithy/signature-v4/package.json +7 -7
  116. package/node_modules/@smithy/types/dist-cjs/index.js +23 -18
  117. package/node_modules/@smithy/types/package.json +10 -10
  118. package/package.json +5 -5
  119. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js +0 -8
@@ -1,8 +1,6 @@
1
- 'use strict';
2
-
3
- var config = require('@smithy/core/config');
4
- var node_http = require('node:http');
5
- var protocols = require('@smithy/core/protocols');
1
+ const { ProviderError, CredentialsProviderError, loadConfig } = require("@smithy/core/config");
2
+ const node_http = require("node:http");
3
+ const { parseUrl } = require("@smithy/core/protocols");
6
4
 
7
5
  const isImdsCredentials = (arg) => Boolean(arg) &&
8
6
  typeof arg === "object" &&
@@ -30,17 +28,17 @@ function httpRequest(options) {
30
28
  hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1"),
31
29
  });
32
30
  req.on("error", (err) => {
33
- reject(Object.assign(new config.ProviderError("Unable to connect to instance metadata service"), err));
31
+ reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
34
32
  req.destroy();
35
33
  });
36
34
  req.on("timeout", () => {
37
- reject(new config.ProviderError("TimeoutError from instance metadata service"));
35
+ reject(new ProviderError("TimeoutError from instance metadata service"));
38
36
  req.destroy();
39
37
  });
40
38
  req.on("response", (res) => {
41
39
  const { statusCode = 400 } = res;
42
40
  if (statusCode < 200 || 300 <= statusCode) {
43
- reject(Object.assign(new config.ProviderError("Error response received from instance metadata service"), { statusCode }));
41
+ reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode }));
44
42
  req.destroy();
45
43
  }
46
44
  const chunks = [];
@@ -73,7 +71,7 @@ const fromContainerMetadata = (init = {}) => {
73
71
  const requestOptions = await getCmdsUri({ logger: init.logger });
74
72
  const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
75
73
  if (!isImdsCredentials(credsResponse)) {
76
- throw new config.CredentialsProviderError("Invalid response received from instance metadata service.", {
74
+ throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
77
75
  logger: init.logger,
78
76
  });
79
77
  }
@@ -109,16 +107,16 @@ const getCmdsUri = async ({ logger }) => {
109
107
  parsed = new URL(process.env[ENV_CMDS_FULL_URI]);
110
108
  }
111
109
  catch {
112
- throw new config.CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger });
110
+ throw new CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger });
113
111
  }
114
112
  if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) {
115
- throw new config.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
113
+ throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
116
114
  tryNextLink: false,
117
115
  logger,
118
116
  });
119
117
  }
120
118
  if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) {
121
- throw new config.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
119
+ throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
122
120
  tryNextLink: false,
123
121
  logger,
124
122
  });
@@ -130,7 +128,7 @@ const getCmdsUri = async ({ logger }) => {
130
128
  port: parsed.port ? parseInt(parsed.port, 10) : undefined,
131
129
  };
132
130
  }
133
- throw new config.CredentialsProviderError("The container metadata credential provider cannot be used unless" +
131
+ throw new CredentialsProviderError("The container metadata credential provider cannot be used unless" +
134
132
  ` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` +
135
133
  " variable is set", {
136
134
  tryNextLink: false,
@@ -138,7 +136,7 @@ const getCmdsUri = async ({ logger }) => {
138
136
  });
139
137
  };
140
138
 
141
- class InstanceMetadataV1FallbackError extends config.CredentialsProviderError {
139
+ class InstanceMetadataV1FallbackError extends CredentialsProviderError {
142
140
  tryNextLink;
143
141
  name = "InstanceMetadataV1FallbackError";
144
142
  constructor(message, tryNextLink = true) {
@@ -148,11 +146,11 @@ class InstanceMetadataV1FallbackError extends config.CredentialsProviderError {
148
146
  }
149
147
  }
150
148
 
151
- exports.Endpoint = void 0;
149
+ var Endpoint;
152
150
  (function (Endpoint) {
153
151
  Endpoint["IPv4"] = "http://169.254.169.254";
154
152
  Endpoint["IPv6"] = "http://[fd00:ec2::254]";
155
- })(exports.Endpoint || (exports.Endpoint = {}));
153
+ })(Endpoint || (Endpoint = {}));
156
154
 
157
155
  const ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
158
156
  const CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
@@ -176,15 +174,15 @@ const ENDPOINT_MODE_CONFIG_OPTIONS = {
176
174
  default: EndpointMode.IPv4,
177
175
  };
178
176
 
179
- const getInstanceMetadataEndpoint = async () => protocols.parseUrl((await getFromEndpointConfig()) || (await getFromEndpointModeConfig()));
180
- const getFromEndpointConfig = async () => config.loadConfig(ENDPOINT_CONFIG_OPTIONS)();
177
+ const getInstanceMetadataEndpoint = async () => parseUrl((await getFromEndpointConfig()) || (await getFromEndpointModeConfig()));
178
+ const getFromEndpointConfig = async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)();
181
179
  const getFromEndpointModeConfig = async () => {
182
- const endpointMode = await config.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
180
+ const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
183
181
  switch (endpointMode) {
184
182
  case EndpointMode.IPv4:
185
- return exports.Endpoint.IPv4;
183
+ return Endpoint.IPv4;
186
184
  case EndpointMode.IPv6:
187
- return exports.Endpoint.IPv6;
185
+ return Endpoint.IPv6;
188
186
  default:
189
187
  throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode)}`);
190
188
  }
@@ -248,12 +246,12 @@ const getInstanceMetadataProvider = (init = {}) => {
248
246
  if (isImdsV1Fallback) {
249
247
  let fallbackBlockedFromProfile = false;
250
248
  let fallbackBlockedFromProcessEnv = false;
251
- const configValue = await config.loadConfig({
249
+ const configValue = await loadConfig({
252
250
  environmentVariableSelector: (env) => {
253
251
  const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
254
252
  fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
255
253
  if (envValue === undefined) {
256
- throw new config.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });
254
+ throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });
257
255
  }
258
256
  return fallbackBlockedFromProcessEnv;
259
257
  },
@@ -352,7 +350,7 @@ const getCredentialsFromProfile = async (profile, options, init) => {
352
350
  path: IMDS_PATH + profile,
353
351
  })).toString());
354
352
  if (!isImdsCredentials(credentialsResponse)) {
355
- throw new config.CredentialsProviderError("Invalid response received from instance metadata service.", {
353
+ throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
356
354
  logger: init.logger,
357
355
  });
358
356
  }
@@ -364,6 +362,7 @@ exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
364
362
  exports.ENV_CMDS_AUTH_TOKEN = ENV_CMDS_AUTH_TOKEN;
365
363
  exports.ENV_CMDS_FULL_URI = ENV_CMDS_FULL_URI;
366
364
  exports.ENV_CMDS_RELATIVE_URI = ENV_CMDS_RELATIVE_URI;
365
+ exports.Endpoint = Endpoint;
367
366
  exports.fromContainerMetadata = fromContainerMetadata;
368
367
  exports.fromInstanceMetadata = fromInstanceMetadata;
369
368
  exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint;
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@smithy/credential-provider-imds",
3
- "version": "4.3.8",
3
+ "version": "4.4.0",
4
4
  "description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
7
7
  "scripts": {
8
8
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
9
- "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline credential-provider-imds",
10
- "build:types": "yarn g:tsc -p tsconfig.types.json",
9
+ "build:es:cjs": "premove dist-es && yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline",
10
+ "build:types": "premove dist-types && yarn g:tsc -p tsconfig.types.json",
11
11
  "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
12
- "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
12
+ "clean": "premove dist-cjs dist-es dist-types",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
15
15
  "stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
@@ -22,13 +22,13 @@
22
22
  ],
23
23
  "author": {
24
24
  "name": "AWS SDK for JavaScript Team",
25
- "url": "https://aws.amazon.com/javascript/"
25
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@smithy/core": "^3.24.6",
31
- "@smithy/types": "^4.14.3",
30
+ "@smithy/core": "^3.25.0",
31
+ "@smithy/types": "^4.15.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "devDependencies": {
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- var protocols = require('@smithy/core/protocols');
4
- var serde = require('@smithy/core/serde');
1
+ const { buildQueryString, HttpResponse } = require("@smithy/core/protocols");
2
+ const { fromBase64 } = require("@smithy/core/serde");
5
3
 
6
4
  function createRequest(url, requestOptions) {
7
5
  return new Request(url, requestOptions);
@@ -57,7 +55,7 @@ class FetchHttpHandler {
57
55
  return Promise.reject(abortError);
58
56
  }
59
57
  let path = request.path;
60
- const queryString = protocols.buildQueryString(request.query || {});
58
+ const queryString = buildQueryString(request.query || {});
61
59
  if (queryString) {
62
60
  path += `?${queryString}`;
63
61
  }
@@ -106,7 +104,7 @@ class FetchHttpHandler {
106
104
  const hasReadableStream = response.body != undefined;
107
105
  if (!hasReadableStream) {
108
106
  return response.blob().then((body) => ({
109
- response: new protocols.HttpResponse({
107
+ response: new HttpResponse({
110
108
  headers: transformedHeaders,
111
109
  reason: response.statusText,
112
110
  statusCode: response.status,
@@ -115,7 +113,7 @@ class FetchHttpHandler {
115
113
  }));
116
114
  }
117
115
  return {
118
- response: new protocols.HttpResponse({
116
+ response: new HttpResponse({
119
117
  headers: transformedHeaders,
120
118
  reason: response.statusText,
121
119
  statusCode: response.status,
@@ -185,7 +183,7 @@ const streamCollector = async (stream) => {
185
183
  };
186
184
  async function collectBlob(blob) {
187
185
  const base64 = await readToBase64(blob);
188
- const arrayBuffer = serde.fromBase64(base64);
186
+ const arrayBuffer = fromBase64(base64);
189
187
  return new Uint8Array(arrayBuffer);
190
188
  }
191
189
  async function collectStream(stream) {
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.4.6",
3
+ "version": "5.5.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
7
- "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline fetch-http-handler",
8
- "build:types": "yarn g:tsc -p tsconfig.types.json",
7
+ "build:es:cjs": "premove dist-es && yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline",
8
+ "build:types": "premove dist-types && yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
10
- "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
10
+ "clean": "premove dist-cjs dist-es dist-types",
11
11
  "extract:docs": "api-extractor run --local",
12
12
  "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
13
13
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
14
  "stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
15
15
  "test": "yarn g:vitest run && yarn test:browser",
16
+ "test:watch": "yarn g:vitest watch",
16
17
  "test:browser": "yarn g:vitest run -c vitest.config.browser.mts",
17
- "test:browser:watch": "yarn g:vitest watch -c vitest.config.browser.mts",
18
- "test:watch": "yarn g:vitest watch"
18
+ "test:browser:watch": "yarn g:vitest watch -c vitest.config.browser.mts"
19
19
  },
20
20
  "author": {
21
21
  "name": "AWS SDK for JavaScript Team",
22
- "url": "https://aws.amazon.com/javascript/"
22
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "sideEffects": false,
@@ -27,12 +27,12 @@
27
27
  "module": "./dist-es/index.js",
28
28
  "types": "./dist-types/index.d.ts",
29
29
  "dependencies": {
30
- "@smithy/core": "^3.24.6",
31
- "@smithy/types": "^4.14.3",
30
+ "@smithy/core": "^3.25.0",
31
+ "@smithy/types": "^4.15.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "devDependencies": {
35
- "@smithy/abort-controller": "^4.2.16",
35
+ "@smithy/abort-controller": "^4.3.0",
36
36
  "concurrently": "7.0.0",
37
37
  "downlevel-dts": "0.10.1",
38
38
  "premove": "4.0.0",
@@ -1,9 +1,7 @@
1
- 'use strict';
2
-
3
- var protocols = require('@smithy/core/protocols');
4
- var node_https = require('node:https');
5
- var node_stream = require('node:stream');
6
- var http2 = require('node:http2');
1
+ const { buildQueryString, HttpResponse } = require("@smithy/core/protocols");
2
+ const node_https = require("node:https");
3
+ const { Readable, Writable } = require("node:stream");
4
+ const http2 = require("node:http2");
7
5
 
8
6
  function buildAbortError(abortSignal) {
9
7
  const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal
@@ -175,7 +173,7 @@ async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN
175
173
  }
176
174
  }
177
175
  function writeBody(httpRequest, body) {
178
- if (body instanceof node_stream.Readable) {
176
+ if (body instanceof Readable) {
179
177
  body.pipe(httpRequest);
180
178
  return;
181
179
  }
@@ -311,7 +309,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
311
309
  socketWarningTimeoutId = timing.setTimeout(() => {
312
310
  this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger);
313
311
  }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000));
314
- const queryString = request.query ? protocols.buildQueryString(request.query) : "";
312
+ const queryString = request.query ? buildQueryString(request.query) : "";
315
313
  let auth = undefined;
316
314
  if (request.username != null || request.password != null) {
317
315
  const username = request.username ?? "";
@@ -343,7 +341,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
343
341
  };
344
342
  const requestFunc = isSSL ? node_https.request : hRequest;
345
343
  const req = requestFunc(nodeHttpsOptions, (res) => {
346
- const httpResponse = new protocols.HttpResponse({
344
+ const httpResponse = new HttpResponse({
347
345
  statusCode: res.statusCode || -1,
348
346
  reason: res.statusMessage,
349
347
  headers: getTransformedHeaders(res.headers),
@@ -414,7 +412,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
414
412
  socketAcquisitionWarningTimeout,
415
413
  throwOnRequestTimeout,
416
414
  httpAgentProvider: async () => {
417
- const node_http = await import('node:http');
415
+ const node_http = require('node:http');
418
416
  const { Agent, request } = node_http.default ?? node_http;
419
417
  hRequest = request;
420
418
  hAgent = Agent;
@@ -752,7 +750,7 @@ class NodeHttp2Handler {
752
750
  fulfilled = true;
753
751
  reject(err);
754
752
  };
755
- const queryString = query ? protocols.buildQueryString(query) : "";
753
+ const queryString = query ? buildQueryString(query) : "";
756
754
  let path = request.path;
757
755
  if (queryString) {
758
756
  path += `?${queryString}`;
@@ -796,7 +794,7 @@ class NodeHttp2Handler {
796
794
  rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${clientHttp2Stream.rstCode}.`));
797
795
  });
798
796
  clientHttp2Stream.on("response", (headers) => {
799
- const httpResponse = new protocols.HttpResponse({
797
+ const httpResponse = new HttpResponse({
800
798
  statusCode: headers[":status"] ?? -1,
801
799
  headers: getTransformedHeaders(headers),
802
800
  body: clientHttp2Stream,
@@ -835,7 +833,7 @@ class NodeHttp2Handler {
835
833
  }
836
834
  }
837
835
 
838
- class Collector extends node_stream.Writable {
836
+ class Collector extends Writable {
839
837
  bufferedBytes = [];
840
838
  _write(chunk, encoding, callback) {
841
839
  this.bufferedBytes.push(chunk);
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.7.7",
3
+ "version": "4.8.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
7
- "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline node-http-handler",
8
- "build:types": "yarn g:tsc -p tsconfig.types.json",
7
+ "build:es:cjs": "premove dist-es && yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline",
8
+ "build:types": "premove dist-types && yarn g:tsc -p tsconfig.types.json",
9
9
  "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
10
- "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
10
+ "clean": "premove dist-cjs dist-es dist-types",
11
11
  "extract:docs": "api-extractor run --local",
12
12
  "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
13
13
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
@@ -18,7 +18,7 @@
18
18
  "author": {
19
19
  "name": "AWS SDK for JavaScript Team",
20
20
  "email": "",
21
- "url": "https://aws.amazon.com/javascript/"
21
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "sideEffects": false,
@@ -26,12 +26,12 @@
26
26
  "module": "./dist-es/index.js",
27
27
  "types": "./dist-types/index.d.ts",
28
28
  "dependencies": {
29
- "@smithy/core": "^3.24.6",
30
- "@smithy/types": "^4.14.3",
29
+ "@smithy/core": "^3.25.0",
30
+ "@smithy/types": "^4.15.0",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@smithy/abort-controller": "^4.2.16",
34
+ "@smithy/abort-controller": "^4.3.0",
35
35
  "@types/node": "^18.11.9",
36
36
  "concurrently": "7.0.0",
37
37
  "downlevel-dts": "0.10.1",
@@ -1,14 +1,12 @@
1
- 'use strict';
2
-
3
- var serde = require('@smithy/core/serde');
4
- var client = require('@smithy/core/client');
5
- var protocols = require('@smithy/core/protocols');
1
+ const { fromUtf8, fromHex, toHex, toUint8Array, isArrayBuffer } = require("@smithy/core/serde");
2
+ const { normalizeProvider } = require("@smithy/core/client");
3
+ const { escapeUri, HttpRequest } = require("@smithy/core/protocols");
6
4
 
7
5
  class HeaderFormatter {
8
6
  format(headers) {
9
7
  const chunks = [];
10
8
  for (const headerName of Object.keys(headers)) {
11
- const bytes = serde.fromUtf8(headerName);
9
+ const bytes = fromUtf8(headerName);
12
10
  chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
13
11
  }
14
12
  const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
@@ -48,7 +46,7 @@ class HeaderFormatter {
48
46
  binBytes.set(header.value, 3);
49
47
  return binBytes;
50
48
  case "string":
51
- const utf8Bytes = serde.fromUtf8(header.value);
49
+ const utf8Bytes = fromUtf8(header.value);
52
50
  const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
53
51
  strView.setUint8(0, 7);
54
52
  strView.setUint16(1, utf8Bytes.byteLength, false);
@@ -66,7 +64,7 @@ class HeaderFormatter {
66
64
  }
67
65
  const uuidBytes = new Uint8Array(17);
68
66
  uuidBytes[0] = 9;
69
- uuidBytes.set(serde.fromHex(header.value.replace(/\-/g, "")), 1);
67
+ uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
70
68
  return uuidBytes;
71
69
  }
72
70
  }
@@ -112,7 +110,7 @@ class Int64 {
112
110
  if (negative) {
113
111
  negate(bytes);
114
112
  }
115
- return parseInt(serde.toHex(bytes), 16) * (negative ? -1 : 1);
113
+ return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
116
114
  }
117
115
  toString() {
118
116
  return String(this.valueOf());
@@ -180,16 +178,16 @@ const getCanonicalQuery = ({ query = {} }) => {
180
178
  if (key.toLowerCase() === SIGNATURE_HEADER) {
181
179
  continue;
182
180
  }
183
- const encodedKey = protocols.escapeUri(key);
181
+ const encodedKey = escapeUri(key);
184
182
  keys.push(encodedKey);
185
183
  const value = query[key];
186
184
  if (typeof value === "string") {
187
- serialized[encodedKey] = `${encodedKey}=${protocols.escapeUri(value)}`;
185
+ serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
188
186
  }
189
187
  else if (Array.isArray(value)) {
190
188
  serialized[encodedKey] = value
191
189
  .slice(0)
192
- .reduce((encoded, value) => encoded.concat([`${encodedKey}=${protocols.escapeUri(value)}`]), [])
190
+ .reduce((encoded, value) => encoded.concat([`${encodedKey}=${escapeUri(value)}`]), [])
193
191
  .sort()
194
192
  .join("&");
195
193
  }
@@ -229,8 +227,8 @@ class SignatureV4Base {
229
227
  this.sha256 = sha256;
230
228
  this.uriEscapePath = uriEscapePath;
231
229
  this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
232
- this.regionProvider = client.normalizeProvider(region);
233
- this.credentialProvider = client.normalizeProvider(credentials);
230
+ this.regionProvider = normalizeProvider(region);
231
+ this.credentialProvider = normalizeProvider(credentials);
234
232
  }
235
233
  createCanonicalRequest(request, canonicalHeaders, payloadHash) {
236
234
  const sortedHeaders = Object.keys(canonicalHeaders).sort();
@@ -244,12 +242,12 @@ ${payloadHash}`;
244
242
  }
245
243
  async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) {
246
244
  const hash = new this.sha256();
247
- hash.update(serde.toUint8Array(canonicalRequest));
245
+ hash.update(toUint8Array(canonicalRequest));
248
246
  const hashedRequest = await hash.digest();
249
247
  return `${algorithmIdentifier}
250
248
  ${longDate}
251
249
  ${credentialScope}
252
- ${serde.toHex(hashedRequest)}`;
250
+ ${toHex(hashedRequest)}`;
253
251
  }
254
252
  getCanonicalPath({ path }) {
255
253
  if (this.uriEscapePath) {
@@ -267,7 +265,7 @@ ${serde.toHex(hashedRequest)}`;
267
265
  }
268
266
  }
269
267
  const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`;
270
- const doubleEncoded = protocols.escapeUri(normalizedPath);
268
+ const doubleEncoded = escapeUri(normalizedPath);
271
269
  return doubleEncoded.replace(/%2F/g, "/");
272
270
  }
273
271
  return path;
@@ -296,7 +294,7 @@ const cacheQueue = [];
296
294
  const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;
297
295
  const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => {
298
296
  const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
299
- const cacheKey = `${shortDate}:${region}:${service}:${serde.toHex(credsHash)}:${credentials.sessionToken}`;
297
+ const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;
300
298
  if (cacheKey in signingKeyCache) {
301
299
  return signingKeyCache[cacheKey];
302
300
  }
@@ -318,7 +316,7 @@ const clearCredentialCache = () => {
318
316
  };
319
317
  const hmac = (ctor, secret, data) => {
320
318
  const hash = new ctor(secret);
321
- hash.update(serde.toUint8Array(data));
319
+ hash.update(toUint8Array(data));
322
320
  return hash.digest();
323
321
  };
324
322
 
@@ -351,10 +349,10 @@ const getPayloadHash = async ({ headers, body }, hashConstructor) => {
351
349
  if (body == undefined) {
352
350
  return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
353
351
  }
354
- else if (typeof body === "string" || ArrayBuffer.isView(body) || serde.isArrayBuffer(body)) {
352
+ else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {
355
353
  const hashCtor = new hashConstructor();
356
- hashCtor.update(serde.toUint8Array(body));
357
- return serde.toHex(await hashCtor.digest());
354
+ hashCtor.update(toUint8Array(body));
355
+ return toHex(await hashCtor.digest());
358
356
  }
359
357
  return UNSIGNED_PAYLOAD;
360
358
  };
@@ -370,7 +368,7 @@ const hasHeader = (soughtHeader, headers) => {
370
368
  };
371
369
 
372
370
  const moveHeadersToQuery = (request, options = {}) => {
373
- const { headers, query = {} } = protocols.HttpRequest.clone(request);
371
+ const { headers, query = {} } = HttpRequest.clone(request);
374
372
  for (const name of Object.keys(headers)) {
375
373
  const lname = name.toLowerCase();
376
374
  if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) ||
@@ -387,7 +385,7 @@ const moveHeadersToQuery = (request, options = {}) => {
387
385
  };
388
386
 
389
387
  const prepareRequest = (request) => {
390
- request = protocols.HttpRequest.clone(request);
388
+ request = HttpRequest.clone(request);
391
389
  for (const headerName of Object.keys(request.headers)) {
392
390
  if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
393
391
  delete request.headers[headerName];
@@ -452,7 +450,7 @@ class SignatureV4 extends SignatureV4Base {
452
450
  const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);
453
451
  const hash = new this.sha256();
454
452
  hash.update(headers);
455
- const hashedHeaders = serde.toHex(await hash.digest());
453
+ const hashedHeaders = toHex(await hash.digest());
456
454
  const stringToSign = [
457
455
  EVENT_ALGORITHM_IDENTIFIER,
458
456
  longDate,
@@ -489,8 +487,8 @@ class SignatureV4 extends SignatureV4Base {
489
487
  const region = signingRegion ?? (await this.regionProvider());
490
488
  const { shortDate } = this.formatDate(signingDate);
491
489
  const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
492
- hash.update(serde.toUint8Array(stringToSign));
493
- return serde.toHex(await hash.digest());
490
+ hash.update(toUint8Array(stringToSign));
491
+ return toHex(await hash.digest());
494
492
  }
495
493
  async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) {
496
494
  const credentials = await this.credentialProvider();
@@ -519,8 +517,8 @@ class SignatureV4 extends SignatureV4Base {
519
517
  async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
520
518
  const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER);
521
519
  const hash = new this.sha256(await keyPromise);
522
- hash.update(serde.toUint8Array(stringToSign));
523
- return serde.toHex(await hash.digest());
520
+ hash.update(toUint8Array(stringToSign));
521
+ return toHex(await hash.digest());
524
522
  }
525
523
  getSigningKey(credentials, region, shortDate, service) {
526
524
  return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@smithy/signature-v4",
3
- "version": "5.4.6",
3
+ "version": "5.5.0",
4
4
  "description": "A standalone implementation of the AWS Signature V4 request signing algorithm",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
7
7
  "types": "./dist-types/index.d.ts",
8
8
  "scripts": {
9
9
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
10
- "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline signature-v4",
11
- "build:types": "yarn g:tsc -p tsconfig.types.json",
10
+ "build:es:cjs": "premove dist-es && yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline",
11
+ "build:types": "premove dist-types && yarn g:tsc -p tsconfig.types.json",
12
12
  "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
13
- "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
13
+ "clean": "premove dist-cjs dist-es dist-types",
14
14
  "extract:docs": "api-extractor run --local",
15
15
  "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
16
16
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
@@ -20,13 +20,13 @@
20
20
  },
21
21
  "author": {
22
22
  "name": "AWS SDK for JavaScript Team",
23
- "url": "https://aws.amazon.com/javascript/"
23
+ "url": "https://aws.amazon.com/sdk-for-javascript/"
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@smithy/core": "^3.24.6",
29
- "@smithy/types": "^4.14.3",
28
+ "@smithy/core": "^3.25.0",
29
+ "@smithy/types": "^4.15.0",
30
30
  "tslib": "^2.6.2"
31
31
  },
32
32
  "devDependencies": {