replicas-mcp 0.2.2 → 0.2.4
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.
- package/dist/bowser-QNXG5MCF.js +2822 -0
- package/dist/chunk-3X3IL2A6.js +2094 -0
- package/dist/chunk-C6IOMGXW.js +1052 -0
- package/dist/chunk-FIMT2XWG.js +576 -0
- package/dist/chunk-KEOQGGM5.js +1490 -0
- package/dist/chunk-NWBPSHNL.js +2865 -0
- package/dist/{chunk-MO4EEYFW.js → chunk-Q6JESX2O.js} +5 -1
- package/dist/chunk-QIOBV22I.js +436 -0
- package/dist/{dist-es-SCPV3ZCZ.js → dist-es-3DLRX4SC.js} +26 -24
- package/dist/{dist-es-HU5E5HQ2.js → dist-es-7DMTLQRJ.js} +10 -11
- package/dist/{dist-es-VRURAF5E.js → dist-es-B6XNMCQ4.js} +5 -4
- package/dist/{dist-es-7T436X7S.js → dist-es-KLEKEXIP.js} +11 -12
- package/dist/{dist-es-BSYEGR6D.js → dist-es-MAMFGWZS.js} +48 -52
- package/dist/{dist-es-BPXINP6D.js → dist-es-V7ZJXG3C.js} +22 -32
- package/dist/{dist-es-RNSS2U3E.js → dist-es-VBWSM7AX.js} +28 -33
- package/dist/event-streams-D47TMH7D.js +1377 -0
- package/dist/index.js +1063 -314
- package/dist/{loadSso-XSERNFCM.js → loadSso-4NJATGLO.js} +85 -62
- package/dist/{signin-GATCKLJP.js → signin-HB5KQSHQ.js} +95 -83
- package/dist/{sso-oidc-JF4BALR2.js → sso-oidc-7AKRONOU.js} +103 -64
- package/dist/{sts-UFAVCISZ.js → sts-WSDR725H.js} +4965 -5056
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/dist/chunk-2KQ6OUSY.js +0 -1033
- package/dist/chunk-2Y7PD56W.js +0 -164
- package/dist/chunk-5VUQ55WW.js +0 -242
- package/dist/chunk-AAVVX4U5.js +0 -175
- package/dist/chunk-CXFLI7S3.js +0 -5706
- package/dist/chunk-ERL3EC7G.js +0 -44
- package/dist/chunk-SGITM26Q.js +0 -877
- package/dist/chunk-ST5JVROM.js +0 -39
- package/dist/chunk-SWX24AGM.js +0 -62
- package/dist/chunk-WPAL27HA.js +0 -29
- package/dist/chunk-ZDZBYCXV.js +0 -52
- package/dist/chunk-ZNARSMJG.js +0 -14
- package/dist/event-streams-EHSSWA6E.js +0 -253
|
@@ -12,7 +12,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
12
12
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
13
|
});
|
|
14
14
|
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
-
|
|
15
|
+
try {
|
|
16
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw mod = 0, e;
|
|
19
|
+
}
|
|
16
20
|
};
|
|
17
21
|
var __copyProps = (to, from, except, desc) => {
|
|
18
22
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HttpResponse,
|
|
4
|
+
buildQueryString
|
|
5
|
+
} from "./chunk-3X3IL2A6.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,27 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
NodeHttpHandler
|
|
4
|
+
} from "./chunk-QIOBV22I.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./chunk-SGITM26Q.js";
|
|
6
|
+
setCredentialFeature
|
|
7
|
+
} from "./chunk-NWBPSHNL.js";
|
|
9
8
|
import {
|
|
9
|
+
CredentialsProviderError,
|
|
10
10
|
HttpRequest
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-ERL3EC7G.js";
|
|
11
|
+
} from "./chunk-3X3IL2A6.js";
|
|
13
12
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from "./chunk-ST5JVROM.js";
|
|
19
|
-
import "./chunk-MO4EEYFW.js";
|
|
13
|
+
parseRfc3339DateTime,
|
|
14
|
+
sdkStreamMixin
|
|
15
|
+
} from "./chunk-C6IOMGXW.js";
|
|
16
|
+
import "./chunk-Q6JESX2O.js";
|
|
20
17
|
|
|
21
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
149
|
-
|
|
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
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
externalDataInterceptor
|
|
4
|
-
} from "./chunk-5VUQ55WW.js";
|
|
5
2
|
import {
|
|
6
3
|
setCredentialFeature
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NWBPSHNL.js";
|
|
8
5
|
import {
|
|
9
|
-
CredentialsProviderError
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
CredentialsProviderError,
|
|
7
|
+
externalDataInterceptor
|
|
8
|
+
} from "./chunk-3X3IL2A6.js";
|
|
9
|
+
import "./chunk-C6IOMGXW.js";
|
|
10
|
+
import "./chunk-Q6JESX2O.js";
|
|
12
11
|
|
|
13
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.
|
|
12
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.49/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
|
|
14
13
|
import { readFileSync } from "fs";
|
|
15
14
|
|
|
16
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.
|
|
15
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.49/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
|
|
17
16
|
var fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
18
17
|
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
|
|
19
18
|
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
20
19
|
let { roleAssumerWithWebIdentity } = init;
|
|
21
20
|
if (!roleAssumerWithWebIdentity) {
|
|
22
|
-
const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-
|
|
21
|
+
const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-WSDR725H.js");
|
|
23
22
|
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
24
23
|
...init.clientConfig,
|
|
25
24
|
credentialProviderLogger: init.logger,
|
|
@@ -40,7 +39,7 @@ var fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
|
40
39
|
});
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.
|
|
42
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.49/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
|
|
44
43
|
var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
|
|
45
44
|
var ENV_ROLE_ARN = "AWS_ROLE_ARN";
|
|
46
45
|
var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NWBPSHNL.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-3X3IL2A6.js";
|
|
8
|
+
import "./chunk-C6IOMGXW.js";
|
|
9
|
+
import "./chunk-Q6JESX2O.js";
|
|
9
10
|
|
|
10
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-env@3.972.
|
|
11
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-env@3.972.44/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
|
|
11
12
|
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
12
13
|
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
13
14
|
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
setCredentialFeature
|
|
4
|
+
} from "./chunk-NWBPSHNL.js";
|
|
5
|
+
import {
|
|
6
|
+
CredentialsProviderError,
|
|
3
7
|
externalDataInterceptor,
|
|
4
8
|
getProfileName,
|
|
5
9
|
parseKnownFiles
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
} from "./chunk-ZNARSMJG.js";
|
|
10
|
-
import {
|
|
11
|
-
CredentialsProviderError
|
|
12
|
-
} from "./chunk-ST5JVROM.js";
|
|
13
|
-
import "./chunk-MO4EEYFW.js";
|
|
10
|
+
} from "./chunk-3X3IL2A6.js";
|
|
11
|
+
import "./chunk-C6IOMGXW.js";
|
|
12
|
+
import "./chunk-Q6JESX2O.js";
|
|
14
13
|
|
|
15
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.
|
|
14
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.44/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
|
|
16
15
|
import { exec } from "child_process";
|
|
17
16
|
import { promisify } from "util";
|
|
18
17
|
|
|
19
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.
|
|
18
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.44/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
|
|
20
19
|
var getValidatedProcessCredentials = (profileName, data, profiles) => {
|
|
21
20
|
if (data.Version !== 1) {
|
|
22
21
|
throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
|
|
@@ -47,7 +46,7 @@ var getValidatedProcessCredentials = (profileName, data, profiles) => {
|
|
|
47
46
|
return credentials;
|
|
48
47
|
};
|
|
49
48
|
|
|
50
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.
|
|
49
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.44/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
|
|
51
50
|
var resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
52
51
|
const profile = profiles[profileName];
|
|
53
52
|
if (profiles[profileName]) {
|
|
@@ -76,7 +75,7 @@ var resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
|
76
75
|
}
|
|
77
76
|
};
|
|
78
77
|
|
|
79
|
-
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.
|
|
78
|
+
// ../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.44/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
|
|
80
79
|
var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
81
80
|
init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
|
|
82
81
|
const profiles = await parseKnownFiles(init);
|