@cdk8s/awscdk-resolver 0.0.63 → 0.0.64

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/dist-cjs/runtimeConfig.browser.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.js +1 -1
  5. package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeConfig.browser.js +1 -1
  6. package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeConfig.js +1 -1
  7. package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormationClient.d.ts +4 -4
  8. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.browser.d.ts +1 -4
  9. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.d.ts +1 -4
  10. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.native.d.ts +1 -4
  11. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/CloudFormationClient.d.ts +3 -3
  12. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
  13. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
  14. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
  15. package/node_modules/@aws-sdk/client-cloudformation/package.json +35 -35
  16. package/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.browser.js +1 -1
  17. package/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js +1 -1
  18. package/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.browser.js +1 -1
  19. package/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js +1 -1
  20. package/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts +4 -4
  21. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts +1 -4
  22. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts +1 -4
  23. package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts +1 -4
  24. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts +3 -3
  25. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
  26. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
  27. package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
  28. package/node_modules/@aws-sdk/client-sso/package.json +32 -32
  29. package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js +1 -1
  30. package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js +1 -1
  31. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js +1 -1
  32. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js +1 -1
  33. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts +4 -4
  34. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts +1 -4
  35. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts +1 -4
  36. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts +1 -4
  37. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts +3 -3
  38. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
  39. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
  40. package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
  41. package/node_modules/@aws-sdk/client-sso-oidc/package.json +34 -34
  42. package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js +1 -1
  43. package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js +1 -1
  44. package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js +1 -1
  45. package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js +1 -1
  46. package/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts +4 -4
  47. package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts +1 -4
  48. package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts +1 -4
  49. package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts +1 -4
  50. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts +3 -3
  51. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
  52. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
  53. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
  54. package/node_modules/@aws-sdk/client-sts/package.json +33 -33
  55. package/node_modules/@aws-sdk/core/CHANGELOG.md +11 -0
  56. package/node_modules/@aws-sdk/core/integ/request-handlers/request-handlers.integ.spec.ts +158 -0
  57. package/node_modules/@aws-sdk/core/jest.config.integ.js +4 -0
  58. package/node_modules/@aws-sdk/core/package.json +7 -6
  59. package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +1 -1
  60. package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +1 -1
  61. package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +1 -1
  62. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  63. package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -8
  64. package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
  65. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  66. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  67. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  68. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  69. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  70. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  71. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  72. package/node_modules/@aws-sdk/middleware-user-agent/package.json +5 -5
  73. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  74. package/node_modules/@aws-sdk/token-providers/package.json +4 -4
  75. package/node_modules/@aws-sdk/types/package.json +2 -2
  76. package/node_modules/@aws-sdk/util-endpoints/package.json +4 -4
  77. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  78. package/node_modules/@aws-sdk/util-user-agent-node/package.json +4 -4
  79. package/node_modules/@smithy/abort-controller/dist-cjs/index.js +1 -4
  80. package/node_modules/@smithy/abort-controller/package.json +2 -2
  81. package/node_modules/@smithy/config-resolver/dist-cjs/index.js +10 -10
  82. package/node_modules/@smithy/config-resolver/package.json +4 -4
  83. package/node_modules/@smithy/core/package.json +8 -8
  84. package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +5 -5
  85. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  86. package/node_modules/@smithy/eventstream-codec/package.json +2 -2
  87. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +1 -1
  88. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  89. package/node_modules/@smithy/hash-node/package.json +2 -2
  90. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  91. package/node_modules/@smithy/middleware-content-length/package.json +4 -4
  92. package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +4 -4
  93. package/node_modules/@smithy/middleware-endpoint/package.json +7 -7
  94. package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +10 -10
  95. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  96. package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +2 -2
  97. package/node_modules/@smithy/middleware-serde/package.json +3 -3
  98. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  99. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  100. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +54 -4
  101. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +41 -3
  102. package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +12 -0
  103. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +11 -0
  104. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  105. package/node_modules/@smithy/property-provider/package.json +2 -2
  106. package/node_modules/@smithy/protocol-http/dist-cjs/index.js +3 -3
  107. package/node_modules/@smithy/protocol-http/dist-types/httpHandler.d.ts +22 -3
  108. package/node_modules/@smithy/protocol-http/dist-types/ts3.4/httpHandler.d.ts +20 -1
  109. package/node_modules/@smithy/protocol-http/package.json +2 -2
  110. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  111. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  112. package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +3 -3
  113. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  114. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +6 -6
  115. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  116. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +5 -5
  117. package/node_modules/@smithy/signature-v4/package.json +5 -5
  118. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +38 -38
  119. package/node_modules/@smithy/smithy-client/dist-types/client.d.ts +6 -3
  120. package/node_modules/@smithy/smithy-client/dist-types/ts3.4/client.d.ts +6 -3
  121. package/node_modules/@smithy/smithy-client/package.json +6 -6
  122. package/node_modules/@smithy/types/dist-cjs/index.js +7 -7
  123. package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +18 -4
  124. package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +18 -4
  125. package/node_modules/@smithy/types/package.json +1 -1
  126. package/node_modules/@smithy/url-parser/package.json +3 -3
  127. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  128. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  129. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +3 -3
  130. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  131. package/node_modules/@smithy/util-middleware/package.json +2 -2
  132. package/node_modules/@smithy/util-retry/dist-cjs/index.js +10 -10
  133. package/node_modules/@smithy/util-retry/package.json +3 -3
  134. package/node_modules/@smithy/util-stream/package.json +5 -5
  135. package/node_modules/@smithy/util-waiter/dist-cjs/index.js +3 -3
  136. package/node_modules/@smithy/util-waiter/package.json +3 -3
  137. package/package.json +5 -5
@@ -144,6 +144,7 @@ __name(writeBody, "writeBody");
144
144
  var DEFAULT_REQUEST_TIMEOUT = 0;
145
145
  var _NodeHttpHandler = class _NodeHttpHandler {
146
146
  constructor(options) {
147
+ this.socketWarningTimestamp = 0;
147
148
  // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286
148
149
  this.metadata = { handlerProtocol: "http/1.1" };
149
150
  this.configProvider = new Promise((resolve, reject) => {
@@ -166,6 +167,39 @@ var _NodeHttpHandler = class _NodeHttpHandler {
166
167
  }
167
168
  return new _NodeHttpHandler(instanceOrOptions);
168
169
  }
170
+ /**
171
+ * @internal
172
+ *
173
+ * @param agent - http(s) agent in use by the NodeHttpHandler instance.
174
+ * @returns timestamp of last emitted warning.
175
+ */
176
+ static checkSocketUsage(agent, socketWarningTimestamp) {
177
+ var _a, _b;
178
+ const { sockets, requests, maxSockets } = agent;
179
+ if (typeof maxSockets !== "number" || maxSockets === Infinity) {
180
+ return socketWarningTimestamp;
181
+ }
182
+ const interval = 15e3;
183
+ if (Date.now() - interval < socketWarningTimestamp) {
184
+ return socketWarningTimestamp;
185
+ }
186
+ if (sockets && requests) {
187
+ for (const origin in sockets) {
188
+ const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0;
189
+ const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0;
190
+ if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
191
+ console.warn(
192
+ "@smithy/node-http-handler:WARN",
193
+ `socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.`,
194
+ "See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html",
195
+ "or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config."
196
+ );
197
+ return Date.now();
198
+ }
199
+ }
200
+ }
201
+ return socketWarningTimestamp;
202
+ }
169
203
  resolveDefaultConfig(options) {
170
204
  const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {};
171
205
  const keepAlive = true;
@@ -173,8 +207,18 @@ var _NodeHttpHandler = class _NodeHttpHandler {
173
207
  return {
174
208
  connectionTimeout,
175
209
  requestTimeout: requestTimeout ?? socketTimeout,
176
- httpAgent: httpAgent || new import_http.Agent({ keepAlive, maxSockets }),
177
- httpsAgent: httpsAgent || new import_https.Agent({ keepAlive, maxSockets })
210
+ httpAgent: (() => {
211
+ if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function") {
212
+ return httpAgent;
213
+ }
214
+ return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent });
215
+ })(),
216
+ httpsAgent: (() => {
217
+ if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function") {
218
+ return httpsAgent;
219
+ }
220
+ return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent });
221
+ })()
178
222
  };
179
223
  }
180
224
  destroy() {
@@ -186,10 +230,12 @@ var _NodeHttpHandler = class _NodeHttpHandler {
186
230
  if (!this.config) {
187
231
  this.config = await this.configProvider;
188
232
  }
233
+ let socketCheckTimeoutId;
189
234
  return new Promise((_resolve, _reject) => {
190
235
  let writeRequestBodyPromise = void 0;
191
236
  const resolve = /* @__PURE__ */ __name(async (arg) => {
192
237
  await writeRequestBodyPromise;
238
+ clearTimeout(socketCheckTimeoutId);
193
239
  _resolve(arg);
194
240
  }, "resolve");
195
241
  const reject = /* @__PURE__ */ __name(async (arg) => {
@@ -206,6 +252,10 @@ var _NodeHttpHandler = class _NodeHttpHandler {
206
252
  return;
207
253
  }
208
254
  const isSSL = request.protocol === "https:";
255
+ const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
256
+ socketCheckTimeoutId = setTimeout(() => {
257
+ this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp);
258
+ }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3));
209
259
  const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {});
210
260
  let auth = void 0;
211
261
  if (request.username != null || request.password != null) {
@@ -226,7 +276,7 @@ var _NodeHttpHandler = class _NodeHttpHandler {
226
276
  method: request.method,
227
277
  path,
228
278
  port: request.port,
229
- agent: isSSL ? this.config.httpsAgent : this.config.httpAgent,
279
+ agent,
230
280
  auth
231
281
  };
232
282
  const requestFunc = isSSL ? import_https.request : import_http.request;
@@ -619,8 +669,8 @@ var streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, r
619
669
 
620
670
  0 && (module.exports = {
621
671
  DEFAULT_REQUEST_TIMEOUT,
622
- NodeHttp2Handler,
623
672
  NodeHttpHandler,
673
+ NodeHttp2Handler,
624
674
  streamCollector
625
675
  });
626
676
 
@@ -16,7 +16,29 @@ export class NodeHttpHandler {
16
16
  }
17
17
  return new NodeHttpHandler(instanceOrOptions);
18
18
  }
19
+ static checkSocketUsage(agent, socketWarningTimestamp) {
20
+ const { sockets, requests, maxSockets } = agent;
21
+ if (typeof maxSockets !== "number" || maxSockets === Infinity) {
22
+ return socketWarningTimestamp;
23
+ }
24
+ const interval = 15000;
25
+ if (Date.now() - interval < socketWarningTimestamp) {
26
+ return socketWarningTimestamp;
27
+ }
28
+ if (sockets && requests) {
29
+ for (const origin in sockets) {
30
+ const socketsInUse = sockets[origin]?.length ?? 0;
31
+ const requestsEnqueued = requests[origin]?.length ?? 0;
32
+ if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
33
+ console.warn("@smithy/node-http-handler:WARN", `socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.`, "See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html", "or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.");
34
+ return Date.now();
35
+ }
36
+ }
37
+ }
38
+ return socketWarningTimestamp;
39
+ }
19
40
  constructor(options) {
41
+ this.socketWarningTimestamp = 0;
20
42
  this.metadata = { handlerProtocol: "http/1.1" };
21
43
  this.configProvider = new Promise((resolve, reject) => {
22
44
  if (typeof options === "function") {
@@ -38,8 +60,18 @@ export class NodeHttpHandler {
38
60
  return {
39
61
  connectionTimeout,
40
62
  requestTimeout: requestTimeout ?? socketTimeout,
41
- httpAgent: httpAgent || new hAgent({ keepAlive, maxSockets }),
42
- httpsAgent: httpsAgent || new hsAgent({ keepAlive, maxSockets }),
63
+ httpAgent: (() => {
64
+ if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") {
65
+ return httpAgent;
66
+ }
67
+ return new hAgent({ keepAlive, maxSockets, ...httpAgent });
68
+ })(),
69
+ httpsAgent: (() => {
70
+ if (httpsAgent instanceof hsAgent || typeof httpsAgent?.destroy === "function") {
71
+ return httpsAgent;
72
+ }
73
+ return new hsAgent({ keepAlive, maxSockets, ...httpsAgent });
74
+ })(),
43
75
  };
44
76
  }
45
77
  destroy() {
@@ -50,10 +82,12 @@ export class NodeHttpHandler {
50
82
  if (!this.config) {
51
83
  this.config = await this.configProvider;
52
84
  }
85
+ let socketCheckTimeoutId;
53
86
  return new Promise((_resolve, _reject) => {
54
87
  let writeRequestBodyPromise = undefined;
55
88
  const resolve = async (arg) => {
56
89
  await writeRequestBodyPromise;
90
+ clearTimeout(socketCheckTimeoutId);
57
91
  _resolve(arg);
58
92
  };
59
93
  const reject = async (arg) => {
@@ -70,6 +104,10 @@ export class NodeHttpHandler {
70
104
  return;
71
105
  }
72
106
  const isSSL = request.protocol === "https:";
107
+ const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
108
+ socketCheckTimeoutId = setTimeout(() => {
109
+ this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp);
110
+ }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2000) + (this.config.connectionTimeout ?? 1000));
73
111
  const queryString = buildQueryString(request.query || {});
74
112
  let auth = undefined;
75
113
  if (request.username != null || request.password != null) {
@@ -90,7 +128,7 @@ export class NodeHttpHandler {
90
128
  method: request.method,
91
129
  path,
92
130
  port: request.port,
93
- agent: isSSL ? this.config.httpsAgent : this.config.httpAgent,
131
+ agent,
94
132
  auth,
95
133
  };
96
134
  const requestFunc = isSSL ? hsRequest : hRequest;
@@ -1,11 +1,16 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
2
4
  import type { NodeHttpHandlerOptions } from "@smithy/types";
3
5
  import { HttpHandlerOptions, Provider } from "@smithy/types";
6
+ import { Agent as hAgent } from "http";
7
+ import { Agent as hsAgent } from "https";
4
8
  export { NodeHttpHandlerOptions };
5
9
  export declare const DEFAULT_REQUEST_TIMEOUT = 0;
6
10
  export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
7
11
  private config?;
8
12
  private configProvider;
13
+ private socketWarningTimestamp;
9
14
  readonly metadata: {
10
15
  handlerProtocol: string;
11
16
  };
@@ -14,6 +19,13 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
14
19
  * or instantiates a new instance of this handler.
15
20
  */
16
21
  static create(instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>): NodeHttpHandler | HttpHandler<any>;
22
+ /**
23
+ * @internal
24
+ *
25
+ * @param agent - http(s) agent in use by the NodeHttpHandler instance.
26
+ * @returns timestamp of last emitted warning.
27
+ */
28
+ static checkSocketUsage(agent: hAgent | hsAgent, socketWarningTimestamp: number): number;
17
29
  constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
18
30
  private resolveDefaultConfig;
19
31
  destroy(): void;
@@ -1,11 +1,15 @@
1
+ /// <reference types="node" />
1
2
  import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
2
3
  import { NodeHttpHandlerOptions } from "@smithy/types";
3
4
  import { HttpHandlerOptions, Provider } from "@smithy/types";
5
+ import { Agent as hAgent } from "http";
6
+ import { Agent as hsAgent } from "https";
4
7
  export { NodeHttpHandlerOptions };
5
8
  export declare const DEFAULT_REQUEST_TIMEOUT = 0;
6
9
  export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
7
10
  private config?;
8
11
  private configProvider;
12
+ private socketWarningTimestamp;
9
13
  readonly metadata: {
10
14
  handlerProtocol: string;
11
15
  };
@@ -14,6 +18,13 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
14
18
  * or instantiates a new instance of this handler.
15
19
  */
16
20
  static create(instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>): NodeHttpHandler | HttpHandler<any>;
21
+ /**
22
+ * @internal
23
+ *
24
+ * @param agent - http(s) agent in use by the NodeHttpHandler instance.
25
+ * @returns timestamp of last emitted warning.
26
+ */
27
+ static checkSocketUsage(agent: hAgent | hsAgent, socketWarningTimestamp: number): number;
17
28
  constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
18
29
  private resolveDefaultConfig;
19
30
  destroy(): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
@@ -25,10 +25,10 @@
25
25
  "module": "./dist-es/index.js",
26
26
  "types": "./dist-types/index.d.ts",
27
27
  "dependencies": {
28
- "@smithy/abort-controller": "^2.1.1",
29
- "@smithy/protocol-http": "^3.1.1",
30
- "@smithy/querystring-builder": "^2.1.1",
31
- "@smithy/types": "^2.9.1",
28
+ "@smithy/abort-controller": "^2.1.2",
29
+ "@smithy/protocol-http": "^3.2.0",
30
+ "@smithy/querystring-builder": "^2.1.2",
31
+ "@smithy/types": "^2.10.0",
32
32
  "tslib": "^2.5.0"
33
33
  },
34
34
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/property-provider",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
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 property-provider",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@smithy/types": "^2.9.1",
25
+ "@smithy/types": "^2.10.0",
26
26
  "tslib": "^2.5.0"
27
27
  },
28
28
  "engines": {
@@ -226,12 +226,12 @@ __name(isValidHostname, "isValidHostname");
226
226
  // Annotate the CommonJS export names for ESM import in node:
227
227
 
228
228
  0 && (module.exports = {
229
+ getHttpHandlerExtensionConfiguration,
230
+ resolveHttpHandlerRuntimeConfig,
229
231
  Field,
230
232
  Fields,
231
233
  HttpRequest,
232
234
  HttpResponse,
233
- getHttpHandlerExtensionConfiguration,
234
- isValidHostname,
235
- resolveHttpHandlerRuntimeConfig
235
+ isValidHostname
236
236
  });
237
237
 
@@ -1,6 +1,6 @@
1
- import { HttpHandlerOptions, RequestHandler } from "@smithy/types";
2
- import { HttpRequest } from "./httpRequest";
3
- import { HttpResponse } from "./httpResponse";
1
+ import type { FetchHttpHandlerOptions, HttpHandlerOptions, NodeHttpHandlerOptions, RequestHandler } from "@smithy/types";
2
+ import type { HttpRequest } from "./httpRequest";
3
+ import type { HttpResponse } from "./httpResponse";
4
4
  /**
5
5
  * @internal
6
6
  */
@@ -16,3 +16,22 @@ export type HttpHandler<HttpHandlerConfig extends object = {}> = RequestHandler<
16
16
  */
17
17
  httpHandlerConfigs(): HttpHandlerConfig;
18
18
  };
19
+ /**
20
+ * @public
21
+ *
22
+ * A type representing the accepted user inputs for the `requestHandler` field
23
+ * of a client's constructor object.
24
+ *
25
+ * You may provide an instance of an HttpHandler, or alternatively
26
+ * provide the constructor arguments as an object which will be passed
27
+ * to the constructor of the default request handler.
28
+ *
29
+ * The default class constructor to which your arguments will be passed
30
+ * varies. The Node.js default is the NodeHttpHandler and the browser/react-native
31
+ * default is the FetchHttpHandler. In rarer cases specific clients may be
32
+ * configured to use other default implementations such as Websocket or HTTP2.
33
+ *
34
+ * The fallback type Record<string, unknown> is part of the union to allow
35
+ * passing constructor params to an unknown requestHandler type.
36
+ */
37
+ export type HttpHandlerUserInput = HttpHandler | NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { HttpHandlerOptions, RequestHandler } from "@smithy/types";
1
+ import { FetchHttpHandlerOptions, HttpHandlerOptions, NodeHttpHandlerOptions, RequestHandler } from "@smithy/types";
2
2
  import { HttpRequest } from "./httpRequest";
3
3
  import { HttpResponse } from "./httpResponse";
4
4
  /**
@@ -16,3 +16,22 @@ export type HttpHandler<HttpHandlerConfig extends object = {}> = RequestHandler<
16
16
  */
17
17
  httpHandlerConfigs(): HttpHandlerConfig;
18
18
  };
19
+ /**
20
+ * @public
21
+ *
22
+ * A type representing the accepted user inputs for the `requestHandler` field
23
+ * of a client's constructor object.
24
+ *
25
+ * You may provide an instance of an HttpHandler, or alternatively
26
+ * provide the constructor arguments as an object which will be passed
27
+ * to the constructor of the default request handler.
28
+ *
29
+ * The default class constructor to which your arguments will be passed
30
+ * varies. The Node.js default is the NodeHttpHandler and the browser/react-native
31
+ * default is the FetchHttpHandler. In rarer cases specific clients may be
32
+ * configured to use other default implementations such as Websocket or HTTP2.
33
+ *
34
+ * The fallback type Record<string, unknown> is part of the union to allow
35
+ * passing constructor params to an unknown requestHandler type.
36
+ */
37
+ export type HttpHandlerUserInput = HttpHandler | NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/protocol-http",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
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 protocol-http",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@smithy/types": "^2.9.1",
26
+ "@smithy/types": "^2.10.0",
27
27
  "tslib": "^2.5.0"
28
28
  },
29
29
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/querystring-builder",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
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 querystring-builder",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@smithy/types": "^2.9.1",
25
+ "@smithy/types": "^2.10.0",
26
26
  "@smithy/util-uri-escape": "^2.1.1",
27
27
  "tslib": "^2.5.0"
28
28
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/querystring-parser",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
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 querystring-parser",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@smithy/types": "^2.9.1",
25
+ "@smithy/types": "^2.10.0",
26
26
  "tslib": "^2.5.0"
27
27
  },
28
28
  "engines": {
@@ -83,10 +83,10 @@ var isServerError = /* @__PURE__ */ __name((error) => {
83
83
  // Annotate the CommonJS export names for ESM import in node:
84
84
 
85
85
  0 && (module.exports = {
86
- isClockSkewError,
87
86
  isRetryableByTrait,
88
- isServerError,
87
+ isClockSkewError,
89
88
  isThrottlingError,
90
- isTransientError
89
+ isTransientError,
90
+ isServerError
91
91
  });
92
92
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/service-error-classification",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
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 service-error-classification",
@@ -54,6 +54,6 @@
54
54
  "directory": ".release/package"
55
55
  },
56
56
  "dependencies": {
57
- "@smithy/types": "^2.9.1"
57
+ "@smithy/types": "^2.10.0"
58
58
  }
59
59
  }
@@ -176,15 +176,15 @@ var parseKnownFiles = /* @__PURE__ */ __name(async (init) => {
176
176
  // Annotate the CommonJS export names for ESM import in node:
177
177
 
178
178
  0 && (module.exports = {
179
- CONFIG_PREFIX_SEPARATOR,
180
- DEFAULT_PROFILE,
179
+ getHomeDir,
181
180
  ENV_PROFILE,
181
+ DEFAULT_PROFILE,
182
182
  getProfileName,
183
+ getSSOTokenFilepath,
184
+ getSSOTokenFromFile,
185
+ CONFIG_PREFIX_SEPARATOR,
183
186
  loadSharedConfigFiles,
184
187
  loadSsoSessionData,
185
- parseKnownFiles,
186
- getHomeDir,
187
- getSSOTokenFilepath,
188
- getSSOTokenFromFile
188
+ parseKnownFiles
189
189
  });
190
190
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@smithy/shared-ini-file-loader",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "dependencies": {
5
- "@smithy/types": "^2.9.1",
5
+ "@smithy/types": "^2.10.0",
6
6
  "tslib": "^2.5.0"
7
7
  },
8
8
  "devDependencies": {
@@ -454,14 +454,14 @@ var getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(hea
454
454
  // Annotate the CommonJS export names for ESM import in node:
455
455
 
456
456
  0 && (module.exports = {
457
- SignatureV4,
458
- clearCredentialCache,
459
- createScope,
460
457
  getCanonicalHeaders,
461
458
  getCanonicalQuery,
462
459
  getPayloadHash,
463
- getSigningKey,
464
460
  moveHeadersToQuery,
465
- prepareRequest
461
+ prepareRequest,
462
+ SignatureV4,
463
+ createScope,
464
+ getSigningKey,
465
+ clearCredentialCache
466
466
  });
467
467
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/signature-v4",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
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",
@@ -24,18 +24,18 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@smithy/eventstream-codec": "^2.1.1",
27
+ "@smithy/eventstream-codec": "^2.1.2",
28
28
  "@smithy/is-array-buffer": "^2.1.1",
29
- "@smithy/types": "^2.9.1",
29
+ "@smithy/types": "^2.10.0",
30
30
  "@smithy/util-hex-encoding": "^2.1.1",
31
- "@smithy/util-middleware": "^2.1.1",
31
+ "@smithy/util-middleware": "^2.1.2",
32
32
  "@smithy/util-uri-escape": "^2.1.1",
33
33
  "@smithy/util-utf8": "^2.1.1",
34
34
  "tslib": "^2.5.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@aws-crypto/sha256-js": "3.0.0",
38
- "@smithy/protocol-http": "^3.1.1",
38
+ "@smithy/protocol-http": "^3.2.0",
39
39
  "@tsconfig/recommended": "1.0.1",
40
40
  "concurrently": "7.0.0",
41
41
  "downlevel-dts": "0.10.1",
@@ -1194,63 +1194,63 @@ __name(splitEvery, "splitEvery");
1194
1194
  // Annotate the CommonJS export names for ESM import in node:
1195
1195
 
1196
1196
  0 && (module.exports = {
1197
+ NoOpLogger,
1197
1198
  Client,
1199
+ collectBody,
1198
1200
  Command,
1199
- LazyJsonString,
1200
- NoOpLogger,
1201
1201
  SENSITIVE_STRING,
1202
- ServiceException,
1203
- StringWrapper,
1204
- _json,
1205
- collectBody,
1206
- convertMap,
1207
1202
  createAggregatedClient,
1208
1203
  dateToUtcString,
1209
- decorateServiceException,
1204
+ parseRfc3339DateTime,
1205
+ parseRfc3339DateTimeWithOffset,
1206
+ parseRfc7231DateTime,
1207
+ parseEpochTimestamp,
1208
+ throwDefaultError,
1209
+ withBaseException,
1210
+ loadConfigsForDefaultMode,
1210
1211
  emitWarningIfUnsupportedVersion,
1212
+ getDefaultExtensionConfiguration,
1213
+ getDefaultClientConfiguration,
1214
+ resolveDefaultRuntimeConfig,
1215
+ ServiceException,
1216
+ decorateServiceException,
1217
+ extendedEncodeURIComponent,
1218
+ getArrayIfSingleItem,
1219
+ getValueFromTextNode,
1220
+ StringWrapper,
1221
+ LazyJsonString,
1222
+ map,
1223
+ convertMap,
1224
+ take,
1225
+ parseBoolean,
1211
1226
  expectBoolean,
1212
- expectByte,
1227
+ expectNumber,
1213
1228
  expectFloat32,
1229
+ expectLong,
1214
1230
  expectInt,
1215
1231
  expectInt32,
1216
- expectLong,
1232
+ expectShort,
1233
+ expectByte,
1217
1234
  expectNonNull,
1218
- expectNumber,
1219
1235
  expectObject,
1220
- expectShort,
1221
1236
  expectString,
1222
1237
  expectUnion,
1223
- extendedEncodeURIComponent,
1224
- getArrayIfSingleItem,
1225
- getDefaultClientConfiguration,
1226
- getDefaultExtensionConfiguration,
1227
- getValueFromTextNode,
1228
- handleFloat,
1229
- limitedParseDouble,
1230
- limitedParseFloat,
1231
- limitedParseFloat32,
1232
- loadConfigsForDefaultMode,
1233
- logger,
1234
- map,
1235
- parseBoolean,
1236
- parseEpochTimestamp,
1237
- parseRfc3339DateTime,
1238
- parseRfc3339DateTimeWithOffset,
1239
- parseRfc7231DateTime,
1240
- resolveDefaultRuntimeConfig,
1241
- resolvedPath,
1242
- serializeFloat,
1243
- splitEvery,
1244
- strictParseByte,
1245
1238
  strictParseDouble,
1246
1239
  strictParseFloat,
1247
1240
  strictParseFloat32,
1241
+ limitedParseDouble,
1242
+ handleFloat,
1243
+ limitedParseFloat,
1244
+ limitedParseFloat32,
1245
+ strictParseLong,
1248
1246
  strictParseInt,
1249
1247
  strictParseInt32,
1250
- strictParseLong,
1251
1248
  strictParseShort,
1252
- take,
1253
- throwDefaultError,
1254
- withBaseException
1249
+ strictParseByte,
1250
+ logger,
1251
+ resolvedPath,
1252
+ serializeFloat,
1253
+ _json,
1254
+ splitEvery
1255
1255
  });
1256
1256