replicas-mcp 0.2.2 → 0.2.3

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 (35) hide show
  1. package/dist/bowser-SUS2LALV.js +2822 -0
  2. package/dist/chunk-2KQN26CJ.js +2094 -0
  3. package/dist/chunk-2TPRCPOE.js +2865 -0
  4. package/dist/chunk-67ORAF4B.js +1490 -0
  5. package/dist/chunk-C6IOMGXW.js +1052 -0
  6. package/dist/chunk-PTKAHAQW.js +576 -0
  7. package/dist/chunk-YPGSID6T.js +436 -0
  8. package/dist/{dist-es-BPXINP6D.js → dist-es-7BMXPGZZ.js} +21 -31
  9. package/dist/{dist-es-SCPV3ZCZ.js → dist-es-7SO54G6Q.js} +25 -23
  10. package/dist/{dist-es-RNSS2U3E.js → dist-es-E6ZIDLCG.js} +27 -32
  11. package/dist/{dist-es-HU5E5HQ2.js → dist-es-IW3K6GSR.js} +9 -10
  12. package/dist/{dist-es-VRURAF5E.js → dist-es-RAHG6NR3.js} +4 -3
  13. package/dist/{dist-es-7T436X7S.js → dist-es-ULKA5ONB.js} +10 -11
  14. package/dist/{dist-es-BSYEGR6D.js → dist-es-UUUR3KKD.js} +47 -51
  15. package/dist/event-streams-3PLTDEYP.js +1377 -0
  16. package/dist/index.js +948 -304
  17. package/dist/{loadSso-XSERNFCM.js → loadSso-EFZHEVVK.js} +84 -61
  18. package/dist/{signin-GATCKLJP.js → signin-VWN2NRES.js} +94 -82
  19. package/dist/{sso-oidc-JF4BALR2.js → sso-oidc-GJQTR2P3.js} +102 -63
  20. package/dist/{sts-UFAVCISZ.js → sts-5SKYP3PH.js} +4964 -5055
  21. package/package.json +1 -1
  22. package/src/index.ts +2 -2
  23. package/dist/chunk-2KQ6OUSY.js +0 -1033
  24. package/dist/chunk-2Y7PD56W.js +0 -164
  25. package/dist/chunk-5VUQ55WW.js +0 -242
  26. package/dist/chunk-AAVVX4U5.js +0 -175
  27. package/dist/chunk-CXFLI7S3.js +0 -5706
  28. package/dist/chunk-ERL3EC7G.js +0 -44
  29. package/dist/chunk-SGITM26Q.js +0 -877
  30. package/dist/chunk-ST5JVROM.js +0 -39
  31. package/dist/chunk-SWX24AGM.js +0 -62
  32. package/dist/chunk-WPAL27HA.js +0 -29
  33. package/dist/chunk-ZDZBYCXV.js +0 -52
  34. package/dist/chunk-ZNARSMJG.js +0 -14
  35. package/dist/event-streams-EHSSWA6E.js +0 -253
@@ -0,0 +1,436 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ HttpResponse,
4
+ buildQueryString
5
+ } from "./chunk-2KQN26CJ.js";
6
+
7
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js
8
+ function buildAbortError(abortSignal) {
9
+ const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0;
10
+ if (reason) {
11
+ if (reason instanceof Error) {
12
+ const abortError3 = new Error("Request aborted");
13
+ abortError3.name = "AbortError";
14
+ abortError3.cause = reason;
15
+ return abortError3;
16
+ }
17
+ const abortError2 = new Error(String(reason));
18
+ abortError2.name = "AbortError";
19
+ return abortError2;
20
+ }
21
+ const abortError = new Error("Request aborted");
22
+ abortError.name = "AbortError";
23
+ return abortError;
24
+ }
25
+
26
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/constants.js
27
+ var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
28
+
29
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js
30
+ var getTransformedHeaders = (headers) => {
31
+ const transformedHeaders = {};
32
+ for (const name in headers) {
33
+ const headerValues = headers[name];
34
+ transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
35
+ }
36
+ return transformedHeaders;
37
+ };
38
+
39
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/node-https.js
40
+ import node_https from "https";
41
+
42
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/timing.js
43
+ var timing = {
44
+ setTimeout: (cb, ms) => setTimeout(cb, ms),
45
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId)
46
+ };
47
+
48
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js
49
+ var DEFER_EVENT_LISTENER_TIME = 1e3;
50
+ var setConnectionTimeout = (request, reject, timeoutInMs = 0) => {
51
+ if (!timeoutInMs) {
52
+ return -1;
53
+ }
54
+ const registerTimeout = (offset) => {
55
+ const timeoutId = timing.setTimeout(() => {
56
+ request.destroy();
57
+ reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), {
58
+ name: "TimeoutError"
59
+ }));
60
+ }, timeoutInMs - offset);
61
+ const doWithSocket = (socket) => {
62
+ if (socket?.connecting) {
63
+ socket.on("connect", () => {
64
+ timing.clearTimeout(timeoutId);
65
+ });
66
+ } else {
67
+ timing.clearTimeout(timeoutId);
68
+ }
69
+ };
70
+ if (request.socket) {
71
+ doWithSocket(request.socket);
72
+ } else {
73
+ request.on("socket", doWithSocket);
74
+ }
75
+ };
76
+ if (timeoutInMs < 2e3) {
77
+ registerTimeout(0);
78
+ return 0;
79
+ }
80
+ return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
81
+ };
82
+
83
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js
84
+ var setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => {
85
+ if (timeoutInMs) {
86
+ return timing.setTimeout(() => {
87
+ let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`;
88
+ if (throwOnRequestTimeout) {
89
+ const error = Object.assign(new Error(msg), {
90
+ name: "TimeoutError",
91
+ code: "ETIMEDOUT"
92
+ });
93
+ req.destroy(error);
94
+ reject(error);
95
+ } else {
96
+ msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`;
97
+ logger?.warn?.(msg);
98
+ }
99
+ }, timeoutInMs);
100
+ }
101
+ return -1;
102
+ };
103
+
104
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js
105
+ var DEFER_EVENT_LISTENER_TIME2 = 3e3;
106
+ var setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => {
107
+ if (keepAlive !== true) {
108
+ return -1;
109
+ }
110
+ const registerListener = () => {
111
+ if (request.socket) {
112
+ request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
113
+ } else {
114
+ request.on("socket", (socket) => {
115
+ socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
116
+ });
117
+ }
118
+ };
119
+ if (deferTimeMs === 0) {
120
+ registerListener();
121
+ return 0;
122
+ }
123
+ return timing.setTimeout(registerListener, deferTimeMs);
124
+ };
125
+
126
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js
127
+ var DEFER_EVENT_LISTENER_TIME3 = 3e3;
128
+ var setSocketTimeout = (request, reject, timeoutInMs = 0) => {
129
+ const registerTimeout = (offset) => {
130
+ const timeout = timeoutInMs - offset;
131
+ const onTimeout = () => {
132
+ request.destroy();
133
+ reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" }));
134
+ };
135
+ if (request.socket) {
136
+ request.socket.setTimeout(timeout, onTimeout);
137
+ request.on("close", () => request.socket?.removeListener("timeout", onTimeout));
138
+ } else {
139
+ request.setTimeout(timeout, onTimeout);
140
+ }
141
+ };
142
+ if (0 < timeoutInMs && timeoutInMs < 6e3) {
143
+ registerTimeout(0);
144
+ return 0;
145
+ }
146
+ return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), DEFER_EVENT_LISTENER_TIME3);
147
+ };
148
+
149
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js
150
+ import { Readable } from "stream";
151
+ var MIN_WAIT_TIME = 6e3;
152
+ async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) {
153
+ const headers = request.headers;
154
+ const expect = headers ? headers.Expect || headers.expect : void 0;
155
+ let timeoutId = -1;
156
+ let sendBody = true;
157
+ if (!externalAgent && expect === "100-continue") {
158
+ sendBody = await Promise.race([
159
+ new Promise((resolve) => {
160
+ timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
161
+ }),
162
+ new Promise((resolve) => {
163
+ httpRequest.on("continue", () => {
164
+ timing.clearTimeout(timeoutId);
165
+ resolve(true);
166
+ });
167
+ httpRequest.on("response", () => {
168
+ timing.clearTimeout(timeoutId);
169
+ resolve(false);
170
+ });
171
+ httpRequest.on("error", () => {
172
+ timing.clearTimeout(timeoutId);
173
+ resolve(false);
174
+ });
175
+ })
176
+ ]);
177
+ }
178
+ if (sendBody) {
179
+ writeBody(httpRequest, request.body);
180
+ }
181
+ }
182
+ function writeBody(httpRequest, body) {
183
+ if (body instanceof Readable) {
184
+ body.pipe(httpRequest);
185
+ return;
186
+ }
187
+ if (body) {
188
+ const isBuffer = Buffer.isBuffer(body);
189
+ const isString = typeof body === "string";
190
+ if (isBuffer || isString) {
191
+ if (isBuffer && body.byteLength === 0) {
192
+ httpRequest.end();
193
+ } else {
194
+ httpRequest.end(body);
195
+ }
196
+ return;
197
+ }
198
+ const uint8 = body;
199
+ if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") {
200
+ httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
201
+ return;
202
+ }
203
+ httpRequest.end(Buffer.from(body));
204
+ return;
205
+ }
206
+ httpRequest.end();
207
+ }
208
+
209
+ // ../node_modules/.bun/@smithy+node-http-handler@4.7.7/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js
210
+ var hAgent = void 0;
211
+ var hRequest = void 0;
212
+ var NodeHttpHandler = class _NodeHttpHandler {
213
+ config;
214
+ configProvider;
215
+ socketWarningTimestamp = 0;
216
+ externalAgent = false;
217
+ metadata = { handlerProtocol: "http/1.1" };
218
+ static create(instanceOrOptions) {
219
+ if (typeof instanceOrOptions?.handle === "function") {
220
+ return instanceOrOptions;
221
+ }
222
+ return new _NodeHttpHandler(instanceOrOptions);
223
+ }
224
+ static checkSocketUsage(agent, socketWarningTimestamp, logger = console) {
225
+ const { sockets, requests, maxSockets } = agent;
226
+ if (typeof maxSockets !== "number" || maxSockets === Infinity) {
227
+ return socketWarningTimestamp;
228
+ }
229
+ const interval = 15e3;
230
+ if (Date.now() - interval < socketWarningTimestamp) {
231
+ return socketWarningTimestamp;
232
+ }
233
+ if (sockets && requests) {
234
+ for (const origin in sockets) {
235
+ const socketsInUse = sockets[origin]?.length ?? 0;
236
+ const requestsEnqueued = requests[origin]?.length ?? 0;
237
+ if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
238
+ logger?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
239
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
240
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
241
+ return Date.now();
242
+ }
243
+ }
244
+ }
245
+ return socketWarningTimestamp;
246
+ }
247
+ constructor(options) {
248
+ this.configProvider = new Promise((resolve, reject) => {
249
+ if (typeof options === "function") {
250
+ options().then((_options) => {
251
+ resolve(this.resolveDefaultConfig(_options));
252
+ }).catch(reject);
253
+ } else {
254
+ resolve(this.resolveDefaultConfig(options));
255
+ }
256
+ });
257
+ }
258
+ destroy() {
259
+ this.config?.httpAgent?.destroy();
260
+ this.config?.httpsAgent?.destroy();
261
+ }
262
+ async handle(request, { abortSignal, requestTimeout } = {}) {
263
+ if (!this.config) {
264
+ this.config = await this.configProvider;
265
+ }
266
+ const config = this.config;
267
+ const isSSL = request.protocol === "https:";
268
+ if (!isSSL && !this.config.httpAgent) {
269
+ this.config.httpAgent = await this.config.httpAgentProvider();
270
+ }
271
+ return new Promise((_resolve, _reject) => {
272
+ let writeRequestBodyPromise = void 0;
273
+ let socketWarningTimeoutId = -1;
274
+ let connectionTimeoutId = -1;
275
+ let requestTimeoutId = -1;
276
+ let socketTimeoutId = -1;
277
+ let keepAliveTimeoutId = -1;
278
+ const clearTimeouts = () => {
279
+ timing.clearTimeout(socketWarningTimeoutId);
280
+ timing.clearTimeout(connectionTimeoutId);
281
+ timing.clearTimeout(requestTimeoutId);
282
+ timing.clearTimeout(socketTimeoutId);
283
+ timing.clearTimeout(keepAliveTimeoutId);
284
+ };
285
+ const resolve = async (arg) => {
286
+ await writeRequestBodyPromise;
287
+ clearTimeouts();
288
+ _resolve(arg);
289
+ };
290
+ const reject = async (arg) => {
291
+ await writeRequestBodyPromise;
292
+ clearTimeouts();
293
+ _reject(arg);
294
+ };
295
+ if (abortSignal?.aborted) {
296
+ const abortError = buildAbortError(abortSignal);
297
+ reject(abortError);
298
+ return;
299
+ }
300
+ const headers = request.headers;
301
+ const expectContinue = headers ? (headers.Expect ?? headers.expect) === "100-continue" : false;
302
+ let agent = isSSL ? config.httpsAgent : config.httpAgent;
303
+ if (expectContinue && !this.externalAgent) {
304
+ agent = new (isSSL ? node_https.Agent : hAgent)({
305
+ keepAlive: false,
306
+ maxSockets: Infinity
307
+ });
308
+ }
309
+ socketWarningTimeoutId = timing.setTimeout(() => {
310
+ this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger);
311
+ }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2e3) + (config.connectionTimeout ?? 1e3));
312
+ const queryString = request.query ? buildQueryString(request.query) : "";
313
+ let auth = void 0;
314
+ if (request.username != null || request.password != null) {
315
+ const username = request.username ?? "";
316
+ const password = request.password ?? "";
317
+ auth = `${username}:${password}`;
318
+ }
319
+ let path = request.path;
320
+ if (queryString) {
321
+ path += `?${queryString}`;
322
+ }
323
+ if (request.fragment) {
324
+ path += `#${request.fragment}`;
325
+ }
326
+ let hostname = request.hostname ?? "";
327
+ if (hostname[0] === "[" && hostname.endsWith("]")) {
328
+ hostname = request.hostname.slice(1, -1);
329
+ } else {
330
+ hostname = request.hostname;
331
+ }
332
+ const nodeHttpsOptions = {
333
+ headers: request.headers,
334
+ host: hostname,
335
+ method: request.method,
336
+ path,
337
+ port: request.port,
338
+ agent,
339
+ auth
340
+ };
341
+ const requestFunc = isSSL ? node_https.request : hRequest;
342
+ const req = requestFunc(nodeHttpsOptions, (res) => {
343
+ const httpResponse = new HttpResponse({
344
+ statusCode: res.statusCode || -1,
345
+ reason: res.statusMessage,
346
+ headers: getTransformedHeaders(res.headers),
347
+ body: res
348
+ });
349
+ resolve({ response: httpResponse });
350
+ });
351
+ req.on("error", (err) => {
352
+ if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
353
+ reject(Object.assign(err, { name: "TimeoutError" }));
354
+ } else {
355
+ reject(err);
356
+ }
357
+ });
358
+ if (abortSignal) {
359
+ const onAbort = () => {
360
+ req.destroy();
361
+ const abortError = buildAbortError(abortSignal);
362
+ reject(abortError);
363
+ };
364
+ if (typeof abortSignal.addEventListener === "function") {
365
+ const signal = abortSignal;
366
+ signal.addEventListener("abort", onAbort, { once: true });
367
+ req.once("close", () => signal.removeEventListener("abort", onAbort));
368
+ } else {
369
+ abortSignal.onabort = onAbort;
370
+ }
371
+ }
372
+ const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout;
373
+ connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout);
374
+ requestTimeoutId = setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console);
375
+ socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout);
376
+ const httpAgent = nodeHttpsOptions.agent;
377
+ if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
378
+ keepAliveTimeoutId = setSocketKeepAlive(req, {
379
+ keepAlive: httpAgent.keepAlive,
380
+ keepAliveMsecs: httpAgent.keepAliveMsecs
381
+ });
382
+ }
383
+ writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => {
384
+ clearTimeouts();
385
+ return _reject(e);
386
+ });
387
+ });
388
+ }
389
+ updateHttpClientConfig(key, value) {
390
+ this.config = void 0;
391
+ this.configProvider = this.configProvider.then((config) => {
392
+ return {
393
+ ...config,
394
+ [key]: value
395
+ };
396
+ });
397
+ }
398
+ httpHandlerConfigs() {
399
+ return this.config ?? {};
400
+ }
401
+ resolveDefaultConfig(options) {
402
+ const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger } = options || {};
403
+ const keepAlive = true;
404
+ const maxSockets = 50;
405
+ return {
406
+ connectionTimeout,
407
+ requestTimeout,
408
+ socketTimeout,
409
+ socketAcquisitionWarningTimeout,
410
+ throwOnRequestTimeout,
411
+ httpAgentProvider: async () => {
412
+ const node_http = await import("http");
413
+ const { Agent, request } = node_http.default ?? node_http;
414
+ hRequest = request;
415
+ hAgent = Agent;
416
+ if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") {
417
+ this.externalAgent = true;
418
+ return httpAgent;
419
+ }
420
+ return new hAgent({ keepAlive, maxSockets, ...httpAgent });
421
+ },
422
+ httpsAgent: (() => {
423
+ if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") {
424
+ this.externalAgent = true;
425
+ return httpsAgent;
426
+ }
427
+ return new node_https.Agent({ keepAlive, maxSockets, ...httpsAgent });
428
+ })(),
429
+ logger
430
+ };
431
+ }
432
+ };
433
+
434
+ export {
435
+ NodeHttpHandler
436
+ };
@@ -1,39 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ setCredentialFeature
4
+ } from "./chunk-2TPRCPOE.js";
5
+ import {
6
+ CredentialsProviderError,
7
+ TokenProviderError,
3
8
  getProfileName,
4
9
  getSSOTokenFilepath,
5
10
  getSSOTokenFromFile,
6
11
  loadSsoSessionData,
7
12
  parseKnownFiles
8
- } from "./chunk-5VUQ55WW.js";
9
- import {
10
- setCredentialFeature
11
- } from "./chunk-ZNARSMJG.js";
12
- import {
13
- CredentialsProviderError,
14
- ProviderError
15
- } from "./chunk-ST5JVROM.js";
13
+ } from "./chunk-2KQN26CJ.js";
14
+ import "./chunk-C6IOMGXW.js";
16
15
  import "./chunk-MO4EEYFW.js";
17
16
 
18
- // ../node_modules/.bun/@smithy+property-provider@4.2.14/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js
19
- var TokenProviderError = class _TokenProviderError extends ProviderError {
20
- name = "TokenProviderError";
21
- constructor(message, options = true) {
22
- super(message, options);
23
- Object.setPrototypeOf(this, _TokenProviderError.prototype);
24
- }
25
- };
26
-
27
- // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.38/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
17
+ // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.49/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
28
18
  var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
29
19
 
30
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/constants.js
20
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/constants.js
31
21
  var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
32
22
  var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
33
23
 
34
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
24
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
35
25
  var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
36
- const { SSOOIDCClient } = await import("./sso-oidc-JF4BALR2.js");
26
+ const { SSOOIDCClient } = await import("./sso-oidc-GJQTR2P3.js");
37
27
  const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
38
28
  const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
39
29
  region: ssoRegion ?? init.clientConfig?.region,
@@ -43,9 +33,9 @@ var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
43
33
  return ssoOidcClient;
44
34
  };
45
35
 
46
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
36
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
47
37
  var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
48
- const { CreateTokenCommand } = await import("./sso-oidc-JF4BALR2.js");
38
+ const { CreateTokenCommand } = await import("./sso-oidc-GJQTR2P3.js");
49
39
  const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
50
40
  return ssoOidcClient.send(new CreateTokenCommand({
51
41
  clientId: ssoToken.clientId,
@@ -55,21 +45,21 @@ var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConf
55
45
  }));
56
46
  };
57
47
 
58
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
48
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
59
49
  var validateTokenExpiry = (token) => {
60
50
  if (token.expiration && token.expiration.getTime() < Date.now()) {
61
51
  throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
62
52
  }
63
53
  };
64
54
 
65
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
55
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
66
56
  var validateTokenKey = (key, value, forRefresh = false) => {
67
57
  if (typeof value === "undefined") {
68
58
  throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
69
59
  }
70
60
  };
71
61
 
72
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
62
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
73
63
  import { promises as fsPromises } from "fs";
74
64
  var { writeFile } = fsPromises;
75
65
  var writeSSOTokenToFile = (id, ssoToken) => {
@@ -78,7 +68,7 @@ var writeSSOTokenToFile = (id, ssoToken) => {
78
68
  return writeFile(tokenFilepath, tokenString);
79
69
  };
80
70
 
81
- // ../node_modules/.bun/@aws-sdk+token-providers@3.1041.0/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
71
+ // ../node_modules/.bun/@aws-sdk+token-providers@3.1063.0/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
82
72
  var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
83
73
  var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
84
74
  init.logger?.debug("@aws-sdk/token-providers - fromSso");
@@ -150,7 +140,7 @@ var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
150
140
  }
151
141
  };
152
142
 
153
- // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.38/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
143
+ // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.49/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
154
144
  var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
155
145
  var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => {
156
146
  let token;
@@ -190,7 +180,7 @@ var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoR
190
180
  });
191
181
  }
192
182
  const { accessToken } = token;
193
- const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-XSERNFCM.js");
183
+ const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-EFZHEVVK.js");
194
184
  const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, {
195
185
  logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,
196
186
  region: clientConfig?.region ?? ssoRegion,
@@ -232,7 +222,7 @@ var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoR
232
222
  return credentials;
233
223
  };
234
224
 
235
- // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.38/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
225
+ // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.49/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
236
226
  var validateSsoProfile = (profile, logger) => {
237
227
  const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
238
228
  if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
@@ -242,7 +232,7 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht
242
232
  return profile;
243
233
  };
244
234
 
245
- // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.38/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
235
+ // ../node_modules/.bun/@aws-sdk+credential-provider-sso@3.972.49/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
246
236
  var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
247
237
  init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
248
238
  const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
@@ -1,27 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- sdkStreamMixin
4
- } from "./chunk-AAVVX4U5.js";
3
+ NodeHttpHandler
4
+ } from "./chunk-YPGSID6T.js";
5
5
  import {
6
- NodeHttpHandler,
7
- parseRfc3339DateTime
8
- } from "./chunk-SGITM26Q.js";
6
+ setCredentialFeature
7
+ } from "./chunk-2TPRCPOE.js";
9
8
  import {
9
+ CredentialsProviderError,
10
10
  HttpRequest
11
- } from "./chunk-SWX24AGM.js";
12
- import "./chunk-ERL3EC7G.js";
11
+ } from "./chunk-2KQN26CJ.js";
13
12
  import {
14
- setCredentialFeature
15
- } from "./chunk-ZNARSMJG.js";
16
- import {
17
- CredentialsProviderError
18
- } from "./chunk-ST5JVROM.js";
13
+ parseRfc3339DateTime,
14
+ sdkStreamMixin
15
+ } from "./chunk-C6IOMGXW.js";
19
16
  import "./chunk-MO4EEYFW.js";
20
17
 
21
- // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.36/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
18
+ // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.46/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
22
19
  import fs from "fs/promises";
23
20
 
24
- // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.36/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js
21
+ // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.46/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js
25
22
  var ECS_CONTAINER_HOST = "169.254.170.2";
26
23
  var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
27
24
  var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
@@ -55,7 +52,7 @@ var checkUrl = (url, logger) => {
55
52
  - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger });
56
53
  };
57
54
 
58
- // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.36/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js
55
+ // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.46/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js
59
56
  function createGetRequest(url) {
60
57
  return new HttpRequest({
61
58
  protocol: url.protocol,
@@ -98,7 +95,7 @@ async function getCredentials(response, logger) {
98
95
  throw new CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger });
99
96
  }
100
97
 
101
- // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.36/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js
98
+ // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.46/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js
102
99
  var retryWrapper = (toRetry, maxRetries, delayMs) => {
103
100
  return async () => {
104
101
  for (let i = 0; i < maxRetries; ++i) {
@@ -112,7 +109,7 @@ var retryWrapper = (toRetry, maxRetries, delayMs) => {
112
109
  };
113
110
  };
114
111
 
115
- // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.36/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
112
+ // ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.46/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
116
113
  var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
117
114
  var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
118
115
  var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
@@ -144,11 +141,9 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
144
141
  }
145
142
  const url = new URL(host);
146
143
  checkUrl(url, options.logger);
147
- const requestHandler = NodeHttpHandler.create({
148
- requestTimeout: options.timeout ?? 1e3,
149
- connectionTimeout: options.timeout ?? 1e3
150
- });
151
- return retryWrapper(async () => {
144
+ const requestHandler = NodeHttpHandler.create({ connectionTimeout: options.timeout ?? 1e3 });
145
+ const requestTimeout = options.timeout ?? 1e3;
146
+ const provider = retryWrapper(async () => {
152
147
  const request = createGetRequest(url);
153
148
  if (token) {
154
149
  request.headers.Authorization = token;
@@ -156,12 +151,19 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
156
151
  request.headers.Authorization = (await fs.readFile(tokenFile)).toString();
157
152
  }
158
153
  try {
159
- const result = await requestHandler.handle(request);
154
+ const result = await requestHandler.handle(request, { requestTimeout });
160
155
  return getCredentials(result.response).then((creds) => setCredentialFeature(creds, "CREDENTIALS_HTTP", "z"));
161
156
  } catch (e) {
162
157
  throw new CredentialsProviderError(String(e), { logger: options.logger });
163
158
  }
164
159
  }, options.maxRetries ?? 3, options.timeout ?? 1e3);
160
+ return async () => {
161
+ try {
162
+ return await provider();
163
+ } finally {
164
+ requestHandler.destroy?.();
165
+ }
166
+ };
165
167
  };
166
168
  export {
167
169
  fromHttp