replicas-engine 0.1.279 → 0.1.281

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 (34) hide show
  1. package/dist/src/bowser-UXBOYYAJ.js +2821 -0
  2. package/dist/src/chunk-3YYBZ6D5.js +576 -0
  3. package/dist/src/chunk-ATF5CAZW.js +2094 -0
  4. package/dist/src/chunk-B5KEKENG.js +436 -0
  5. package/dist/src/chunk-C6IOMGXW.js +1052 -0
  6. package/dist/src/chunk-MHJJJ2VP.js +2865 -0
  7. package/dist/src/chunk-YY2DS5UJ.js +1490 -0
  8. package/dist/src/{dist-es-GGHPJZ3K.js → dist-es-37YNNMWK.js} +47 -51
  9. package/dist/src/{dist-es-F6RG3S4O.js → dist-es-7IBRAXHQ.js} +25 -23
  10. package/dist/src/{dist-es-JIV2SPEM.js → dist-es-AYVDCHRQ.js} +9 -10
  11. package/dist/src/{dist-es-BUG4C6LP.js → dist-es-JSZE2H6Y.js} +21 -31
  12. package/dist/src/{dist-es-Q3YZVSCP.js → dist-es-M4ZCYBRD.js} +10 -11
  13. package/dist/src/{dist-es-YKS4LXBO.js → dist-es-MNGVDEEO.js} +4 -3
  14. package/dist/src/{dist-es-GZBSW2H3.js → dist-es-YA3RZ3J2.js} +27 -32
  15. package/dist/src/event-streams-7ZLUNSFX.js +1376 -0
  16. package/dist/src/index.js +71 -2
  17. package/dist/src/{loadSso-3WFGTQV7.js → loadSso-2A75N7C3.js} +84 -61
  18. package/dist/src/{signin-RSKKVVIS.js → signin-FXO7O6JB.js} +94 -82
  19. package/dist/src/{sso-oidc-LBVW2ORP.js → sso-oidc-4IFMUO6A.js} +102 -63
  20. package/dist/src/{sts-DKGAU6YE.js → sts-IAUEUXEW.js} +4964 -5055
  21. package/package.json +2 -2
  22. package/dist/src/chunk-2Y7PD56W.js +0 -164
  23. package/dist/src/chunk-5VUQ55WW.js +0 -242
  24. package/dist/src/chunk-AAVVX4U5.js +0 -175
  25. package/dist/src/chunk-BUG7ZAQW.js +0 -1033
  26. package/dist/src/chunk-ERL3EC7G.js +0 -44
  27. package/dist/src/chunk-SGITM26Q.js +0 -877
  28. package/dist/src/chunk-ST5JVROM.js +0 -39
  29. package/dist/src/chunk-SWX24AGM.js +0 -62
  30. package/dist/src/chunk-TU2SAX7Z.js +0 -5706
  31. package/dist/src/chunk-WPAL27HA.js +0 -29
  32. package/dist/src/chunk-ZDZBYCXV.js +0 -52
  33. package/dist/src/chunk-ZNARSMJG.js +0 -14
  34. package/dist/src/event-streams-XS4D2DFO.js +0 -252
@@ -0,0 +1,436 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ HttpResponse,
4
+ buildQueryString
5
+ } from "./chunk-ATF5CAZW.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
+ };