@stackone/transport 2.43.2 → 2.43.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.
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +91 -448
- package/dist/index.d.mts +91 -447
- package/dist/index.mjs +8 -8
- package/package.json +9 -9
- /package/dist/{chunk-BhWHdk3m.mjs → rolldown-runtime-BhWHdk3m.mjs} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
+
import { t as __name } from "./rolldown-runtime-DDTgaCGG.cjs";
|
|
1
2
|
import { ILogger } from "@stackone/logger";
|
|
2
3
|
import http, { AgentOptions } from "node:http";
|
|
3
4
|
import https from "node:https";
|
|
4
5
|
import { AxiosError, AxiosInstance, AxiosInterceptorManager, AxiosInterceptorOptions, AxiosResponse, CreateAxiosDefaults, InternalAxiosRequestConfig } from "axios";
|
|
5
6
|
import * as redis from "redis";
|
|
6
|
-
import * as tls
|
|
7
|
+
import * as tls from "tls";
|
|
7
8
|
import { Readable } from "node:stream";
|
|
8
9
|
import { z } from "@stackone/utils";
|
|
9
10
|
import { AuthorizationServerMetadata, Client, ClientOptions, FetchLike, OAuthProtectedResourceMetadata, OAuthServerInfo, StreamableHTTPClientTransportOptions, Transport } from "@modelcontextprotocol/client";
|
|
10
|
-
|
|
11
|
-
//#region \0rolldown/runtime.js
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/asyncSingleton/index.d.ts
|
|
14
11
|
declare abstract class AsyncSingleton<T, O> {
|
|
15
12
|
private instance;
|
|
16
13
|
private initPromise;
|
|
@@ -29,8 +26,6 @@ declare abstract class AsyncSingleton<T, O> {
|
|
|
29
26
|
private init;
|
|
30
27
|
reset(): void;
|
|
31
28
|
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/cacheClient/types.d.ts
|
|
34
29
|
interface ICacheClient<ClientType = unknown> {
|
|
35
30
|
isAvailable(): boolean;
|
|
36
31
|
getData<T>(key: string): Promise<T | null>;
|
|
@@ -38,11 +33,7 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
38
33
|
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
39
34
|
getGroupSize?(groupKey: string): Promise<number | null>;
|
|
40
35
|
listGroupKeys?(prefix: string): Promise<string[] | null>;
|
|
41
|
-
listData<T>({
|
|
42
|
-
partialKey,
|
|
43
|
-
limit,
|
|
44
|
-
cursor
|
|
45
|
-
}: {
|
|
36
|
+
listData<T>({ partialKey, limit, cursor }: {
|
|
46
37
|
partialKey: string;
|
|
47
38
|
limit?: number;
|
|
48
39
|
cursor?: string;
|
|
@@ -50,13 +41,7 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
50
41
|
items: T[] | null;
|
|
51
42
|
cursor?: string;
|
|
52
43
|
}>;
|
|
53
|
-
setData<T>({
|
|
54
|
-
key,
|
|
55
|
-
value,
|
|
56
|
-
cacheTTL,
|
|
57
|
-
groupKeys,
|
|
58
|
-
groupKeyTTL
|
|
59
|
-
}: {
|
|
44
|
+
setData<T>({ key, value, cacheTTL, groupKeys, groupKeyTTL }: {
|
|
60
45
|
key: string;
|
|
61
46
|
value: T;
|
|
62
47
|
cacheTTL: number;
|
|
@@ -64,11 +49,7 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
64
49
|
groupKeyTTL?: number;
|
|
65
50
|
}): Promise<boolean>;
|
|
66
51
|
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
67
|
-
executeScript?<T>({
|
|
68
|
-
sha1,
|
|
69
|
-
keys,
|
|
70
|
-
args
|
|
71
|
-
}: {
|
|
52
|
+
executeScript?<T>({ sha1, keys, args }: {
|
|
72
53
|
sha1: string;
|
|
73
54
|
keys: string[];
|
|
74
55
|
args: string[];
|
|
@@ -83,11 +64,7 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
83
64
|
getClient?(): ClientType | null;
|
|
84
65
|
deleteData?(key: string, groupKeys?: string[]): Promise<boolean>;
|
|
85
66
|
deleteDataKeyFromGroup(groupKey: string, key: string): Promise<boolean>;
|
|
86
|
-
setHashData<T>({
|
|
87
|
-
key,
|
|
88
|
-
entries,
|
|
89
|
-
cacheTTL
|
|
90
|
-
}: {
|
|
67
|
+
setHashData<T>({ key, entries, cacheTTL }: {
|
|
91
68
|
key: string;
|
|
92
69
|
entries: Record<string, T>;
|
|
93
70
|
cacheTTL: number;
|
|
@@ -97,15 +74,13 @@ interface ICacheClient<ClientType = unknown> {
|
|
|
97
74
|
deleteHashData(key: string, fields: string[]): Promise<number | null>;
|
|
98
75
|
close?(): Promise<void> | void;
|
|
99
76
|
}
|
|
100
|
-
type PubSubListener<ReturnsBuffer extends boolean = false> = <T extends
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/redisClient/types.d.ts
|
|
77
|
+
type PubSubListener<ReturnsBuffer extends boolean = false> = <T extends ReturnsBuffer extends true ? Buffer : string>(message: T, channel: T) => unknown;
|
|
103
78
|
type RedisClientType = redis.RedisClientType;
|
|
104
79
|
interface RedisClientConfig {
|
|
105
80
|
getRedisClient?: typeof redis.createClient;
|
|
106
81
|
host?: string;
|
|
107
82
|
port?: number;
|
|
108
|
-
tls?: boolean | tls
|
|
83
|
+
tls?: boolean | tls.ConnectionOptions;
|
|
109
84
|
keepAlive?: number;
|
|
110
85
|
reconnect?: boolean;
|
|
111
86
|
database?: number;
|
|
@@ -114,35 +89,16 @@ interface RedisClientConfig {
|
|
|
114
89
|
pingInterval?: number;
|
|
115
90
|
}
|
|
116
91
|
type RedisClientBuilder = (config: RedisClientConfig, logger?: ILogger, invoker?: string) => Promise<ICacheClient<RedisClientType> | undefined>;
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/redisClient/index.d.ts
|
|
119
92
|
declare const buildRedisClientInstance: (config: RedisClientConfig, logger?: ILogger, invoker?: string) => Promise<ICacheClient<RedisClientType> | undefined>;
|
|
120
|
-
declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
93
|
+
export declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
121
94
|
#private;
|
|
122
|
-
static build({
|
|
123
|
-
getRedisClient,
|
|
124
|
-
host,
|
|
125
|
-
port,
|
|
126
|
-
tls,
|
|
127
|
-
keepAlive,
|
|
128
|
-
reconnect,
|
|
129
|
-
database,
|
|
130
|
-
connectTimeout,
|
|
131
|
-
initialConnectTimeout,
|
|
132
|
-
pingInterval
|
|
133
|
-
}: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
95
|
+
static build({ getRedisClient, host, port, tls, keepAlive, reconnect, database, connectTimeout, initialConnectTimeout, pingInterval }: RedisClientConfig, logger?: ILogger, invoker?: string): Promise<ICacheClient<RedisClientType> | null>;
|
|
134
96
|
getData<T>(key: string): Promise<T | null>;
|
|
135
97
|
getDataBatch<T>(keys: string[]): Promise<(T | null)[]>;
|
|
136
98
|
getDataKeysFromGroup(groupKey: string): Promise<string[] | null>;
|
|
137
99
|
getGroupSize(groupKey: string): Promise<number | null>;
|
|
138
100
|
listGroupKeys(prefix: string): Promise<string[] | null>;
|
|
139
|
-
setData<T>({
|
|
140
|
-
key,
|
|
141
|
-
value,
|
|
142
|
-
cacheTTL,
|
|
143
|
-
groupKeys,
|
|
144
|
-
groupKeyTTL
|
|
145
|
-
}: {
|
|
101
|
+
setData<T>({ key, value, cacheTTL, groupKeys, groupKeyTTL }: {
|
|
146
102
|
key: string;
|
|
147
103
|
value: T;
|
|
148
104
|
cacheTTL: number;
|
|
@@ -150,11 +106,7 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
150
106
|
groupKeyTTL?: number;
|
|
151
107
|
}): Promise<boolean>;
|
|
152
108
|
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
153
|
-
executeScript<T>({
|
|
154
|
-
sha1,
|
|
155
|
-
keys,
|
|
156
|
-
args
|
|
157
|
-
}: {
|
|
109
|
+
executeScript<T>({ sha1, keys, args }: {
|
|
158
110
|
sha1: string;
|
|
159
111
|
keys: string[];
|
|
160
112
|
args: string[];
|
|
@@ -169,11 +121,7 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
169
121
|
getClient(): RedisClientType | null;
|
|
170
122
|
isAvailable(): boolean;
|
|
171
123
|
close(): Promise<void>;
|
|
172
|
-
listData<T>({
|
|
173
|
-
partialKey,
|
|
174
|
-
limit,
|
|
175
|
-
cursor
|
|
176
|
-
}: {
|
|
124
|
+
listData<T>({ partialKey, limit, cursor }: {
|
|
177
125
|
partialKey: string;
|
|
178
126
|
limit: number;
|
|
179
127
|
cursor?: string;
|
|
@@ -183,11 +131,7 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
183
131
|
}>;
|
|
184
132
|
deleteData(key: string, groupKeys?: string[]): Promise<boolean>;
|
|
185
133
|
deleteDataKeyFromGroup(groupKey: string, key: string): Promise<boolean>;
|
|
186
|
-
setHashData<T>({
|
|
187
|
-
key,
|
|
188
|
-
entries,
|
|
189
|
-
cacheTTL
|
|
190
|
-
}: {
|
|
134
|
+
setHashData<T>({ key, entries, cacheTTL }: {
|
|
191
135
|
key: string;
|
|
192
136
|
entries: Record<string, T>;
|
|
193
137
|
cacheTTL: number;
|
|
@@ -196,8 +140,6 @@ declare class RedisClient implements ICacheClient<RedisClientType> {
|
|
|
196
140
|
getAllHashData<T>(key: string): Promise<Record<string, T> | null>;
|
|
197
141
|
deleteHashData(key: string, fields: string[]): Promise<number | null>;
|
|
198
142
|
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/utils/logThrottle.d.ts
|
|
201
143
|
type ThrottleDecision = {
|
|
202
144
|
suppressed: number;
|
|
203
145
|
};
|
|
@@ -207,8 +149,6 @@ declare class LogThrottle {
|
|
|
207
149
|
consume(key: string, now?: number): ThrottleDecision | null;
|
|
208
150
|
clear(): void;
|
|
209
151
|
}
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/scriptManager/types.d.ts
|
|
212
152
|
type Scripts<T extends string> = Record<T, string>;
|
|
213
153
|
type ScriptManagerOptions<T extends string> = {
|
|
214
154
|
redisClientConfig: RedisClientConfig;
|
|
@@ -218,9 +158,7 @@ type ScriptManagerOptions<T extends string> = {
|
|
|
218
158
|
logger?: ILogger;
|
|
219
159
|
additionalArgs?: unknown[];
|
|
220
160
|
};
|
|
221
|
-
|
|
222
|
-
//#region src/scriptManager/index.d.ts
|
|
223
|
-
declare abstract class ScriptManager<T extends string, S extends ScriptManager<T, S>> extends AsyncSingleton<S, ScriptManagerOptions<T>> {
|
|
161
|
+
export declare abstract class ScriptManager<T extends string, S extends ScriptManager<T, S>> extends AsyncSingleton<S, ScriptManagerOptions<T>> {
|
|
224
162
|
abstract name: string;
|
|
225
163
|
protected redisClientConfig: RedisClientConfig;
|
|
226
164
|
protected scripts: Scripts<T>;
|
|
@@ -233,14 +171,7 @@ declare abstract class ScriptManager<T extends string, S extends ScriptManager<T
|
|
|
233
171
|
protected lastReloadTime: number;
|
|
234
172
|
protected ownsCacheClient: boolean;
|
|
235
173
|
protected unavailableLogThrottle: LogThrottle;
|
|
236
|
-
protected initInstance({
|
|
237
|
-
redisClientConfig,
|
|
238
|
-
cacheClient,
|
|
239
|
-
scripts,
|
|
240
|
-
scriptMap,
|
|
241
|
-
logger,
|
|
242
|
-
additionalArgs
|
|
243
|
-
}: ScriptManagerOptions<T>): Promise<S>;
|
|
174
|
+
protected initInstance({ redisClientConfig, cacheClient, scripts, scriptMap, logger, additionalArgs }: ScriptManagerOptions<T>): Promise<S>;
|
|
244
175
|
protected closeCacheClient(): void;
|
|
245
176
|
protected abstract additionalInitialization(...args: unknown[]): Promise<void>;
|
|
246
177
|
protected releaseAdditionalResources(): void;
|
|
@@ -251,8 +182,6 @@ declare abstract class ScriptManager<T extends string, S extends ScriptManager<T
|
|
|
251
182
|
protected executeScript<U>(method: T, keys: string[], args: string[]): Promise<U | null>;
|
|
252
183
|
protected isRedisReady(): boolean;
|
|
253
184
|
}
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/concurrencyManager/types.d.ts
|
|
256
185
|
type ConcurrencySubPoolConfig = {
|
|
257
186
|
subPoolKey: string;
|
|
258
187
|
urlPattern: RegExp | string;
|
|
@@ -275,16 +204,12 @@ type RequestMetadata = {
|
|
|
275
204
|
joinCondition?: 'optimistic' | 'attempts' | 'failed' | 'no-wait-budget' | 'aborted';
|
|
276
205
|
failureReason?: string;
|
|
277
206
|
};
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region src/concurrencyManager/utils/index.d.ts
|
|
280
207
|
declare enum ConcurrencyMethods {
|
|
281
208
|
tryConcurrency = "tryConcurrency",
|
|
282
209
|
removeFromSet = "removeFromSet",
|
|
283
210
|
publishNextItem = "publishNextItem"
|
|
284
211
|
}
|
|
285
|
-
|
|
286
|
-
//#region src/concurrencyManager/index.d.ts
|
|
287
|
-
declare class ConcurrencyManager extends ScriptManager<ConcurrencyMethods, ConcurrencyManager> {
|
|
212
|
+
export declare class ConcurrencyManager extends ScriptManager<ConcurrencyMethods, ConcurrencyManager> {
|
|
288
213
|
private hasValidRedisConfig;
|
|
289
214
|
private subscriptionManager;
|
|
290
215
|
private queueManager;
|
|
@@ -306,8 +231,6 @@ declare class ConcurrencyManager extends ScriptManager<ConcurrencyMethods, Concu
|
|
|
306
231
|
protected releaseAdditionalResources(): void;
|
|
307
232
|
close(): void;
|
|
308
233
|
}
|
|
309
|
-
//#endregion
|
|
310
|
-
//#region src/rateLimitManager/types.d.ts
|
|
311
234
|
type RateLimitSubPoolConfig = {
|
|
312
235
|
subPoolKey: string;
|
|
313
236
|
urlPattern: RegExp | string;
|
|
@@ -327,14 +250,10 @@ type RateLimitConfig = {
|
|
|
327
250
|
subPools?: RateLimitSubPoolConfig[];
|
|
328
251
|
mappedRateLimitErrors?: MappedRateLimitErrorConfig[];
|
|
329
252
|
};
|
|
330
|
-
//#endregion
|
|
331
|
-
//#region src/rateLimitManager/constants.d.ts
|
|
332
253
|
declare enum RateLimitMethods {
|
|
333
254
|
incr = "incr"
|
|
334
255
|
}
|
|
335
|
-
|
|
336
|
-
//#region src/rateLimitManager/index.d.ts
|
|
337
|
-
declare class RateLimitManager extends ScriptManager<RateLimitMethods, RateLimitManager> {
|
|
256
|
+
export declare class RateLimitManager extends ScriptManager<RateLimitMethods, RateLimitManager> {
|
|
338
257
|
name: string;
|
|
339
258
|
protected additionalInitialization(): Promise<void>;
|
|
340
259
|
getDynamicMaxWaitTime(ratelimitConfig: RateLimitConfig, concurrencyConfig: ConcurrencyConfig, requestUrl?: string, cutoffTime?: number, fudgeFactor?: number, ballparkResponseTime?: number): number;
|
|
@@ -343,8 +262,6 @@ declare class RateLimitManager extends ScriptManager<RateLimitMethods, RateLimit
|
|
|
343
262
|
isReady(): boolean;
|
|
344
263
|
close(): void;
|
|
345
264
|
}
|
|
346
|
-
//#endregion
|
|
347
|
-
//#region src/interceptors/types.d.ts
|
|
348
265
|
type AxiosErrorWithRetryCount = AxiosError & {
|
|
349
266
|
config: InternalAxiosRequestConfig & {
|
|
350
267
|
_retryCount: number;
|
|
@@ -384,11 +301,9 @@ type RequestConfig = {
|
|
|
384
301
|
rateLimits?: RateLimitConfig;
|
|
385
302
|
concurrency?: ConcurrencyConfig;
|
|
386
303
|
};
|
|
387
|
-
|
|
388
|
-
//#region src/parsers/types.d.ts
|
|
389
|
-
declare const RequestParameterLocations: readonly ['query', 'body', 'headers'];
|
|
304
|
+
export declare const RequestParameterLocations: readonly ['query', 'body', 'headers'];
|
|
390
305
|
type RequestParameterLocation = (typeof RequestParameterLocations)[number];
|
|
391
|
-
declare const QueryArrayFormats: readonly ['repeat', 'brackets', 'comma', 'stringify'];
|
|
306
|
+
export declare const QueryArrayFormats: readonly ['repeat', 'brackets', 'comma', 'stringify'];
|
|
392
307
|
type QueryArrayFormat = (typeof QueryArrayFormats)[number];
|
|
393
308
|
type RequestParameter = {
|
|
394
309
|
name: string;
|
|
@@ -398,8 +313,6 @@ type RequestParameter = {
|
|
|
398
313
|
spread?: boolean;
|
|
399
314
|
inline?: boolean;
|
|
400
315
|
};
|
|
401
|
-
//#endregion
|
|
402
|
-
//#region src/httpClient/types.d.ts
|
|
403
316
|
type HttpHeader = string | string[];
|
|
404
317
|
type HttpHeaders = {
|
|
405
318
|
[key: string]: HttpHeader;
|
|
@@ -411,7 +324,7 @@ type HttpQueryParamValue = {
|
|
|
411
324
|
type HttpQueryParams = {
|
|
412
325
|
[key: string]: string | string[] | HttpQueryParamValue;
|
|
413
326
|
};
|
|
414
|
-
declare const HttpMethods: readonly ['get', 'post', 'put', 'delete', 'patch'];
|
|
327
|
+
export declare const HttpMethods: readonly ['get', 'post', 'put', 'delete', 'patch'];
|
|
415
328
|
type HttpMethod = (typeof HttpMethods)[number];
|
|
416
329
|
type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
|
|
417
330
|
type HttpResponse<T = any, P = any> = {
|
|
@@ -437,24 +350,7 @@ type HttpParameters = {
|
|
|
437
350
|
};
|
|
438
351
|
interface IHttpClient {
|
|
439
352
|
readonly egressProxyUrl?: string;
|
|
440
|
-
request<P, T>({
|
|
441
|
-
headers,
|
|
442
|
-
url,
|
|
443
|
-
method,
|
|
444
|
-
queryParams,
|
|
445
|
-
encodeQueryParams,
|
|
446
|
-
maxRedirects,
|
|
447
|
-
responseType,
|
|
448
|
-
cacheTTL,
|
|
449
|
-
context,
|
|
450
|
-
payload,
|
|
451
|
-
httpsAgent,
|
|
452
|
-
httpAgent,
|
|
453
|
-
requestConfig,
|
|
454
|
-
httpsAgentConfig,
|
|
455
|
-
timeoutMs,
|
|
456
|
-
proxyUrl
|
|
457
|
-
}: {
|
|
353
|
+
request<P, T>({ headers, url, method, queryParams, encodeQueryParams, maxRedirects, responseType, cacheTTL, context, payload, httpsAgent, httpAgent, requestConfig, httpsAgentConfig, timeoutMs, proxyUrl }: {
|
|
458
354
|
headers?: HttpHeaders;
|
|
459
355
|
url: string;
|
|
460
356
|
method?: HttpMethod;
|
|
@@ -472,16 +368,7 @@ interface IHttpClient {
|
|
|
472
368
|
timeoutMs?: number;
|
|
473
369
|
proxyUrl?: string;
|
|
474
370
|
}): Promise<HttpResponse<T>>;
|
|
475
|
-
get<T>({
|
|
476
|
-
headers,
|
|
477
|
-
url,
|
|
478
|
-
queryParams,
|
|
479
|
-
maxRedirects,
|
|
480
|
-
cacheTTL,
|
|
481
|
-
context,
|
|
482
|
-
requestConfig,
|
|
483
|
-
proxyUrl
|
|
484
|
-
}: {
|
|
371
|
+
get<T>({ headers, url, queryParams, maxRedirects, cacheTTL, context, requestConfig, proxyUrl }: {
|
|
485
372
|
headers?: HttpHeaders;
|
|
486
373
|
url: string;
|
|
487
374
|
queryParams?: HttpQueryParams;
|
|
@@ -491,16 +378,7 @@ interface IHttpClient {
|
|
|
491
378
|
requestConfig?: RequestConfig;
|
|
492
379
|
proxyUrl?: string;
|
|
493
380
|
}): Promise<HttpResponse<T>>;
|
|
494
|
-
post<P, T>({
|
|
495
|
-
headers,
|
|
496
|
-
url,
|
|
497
|
-
maxRedirects,
|
|
498
|
-
cacheTTL,
|
|
499
|
-
context,
|
|
500
|
-
payload,
|
|
501
|
-
requestConfig,
|
|
502
|
-
proxyUrl
|
|
503
|
-
}: {
|
|
381
|
+
post<P, T>({ headers, url, maxRedirects, cacheTTL, context, payload, requestConfig, proxyUrl }: {
|
|
504
382
|
headers?: HttpHeaders;
|
|
505
383
|
url: string;
|
|
506
384
|
maxRedirects?: number;
|
|
@@ -510,22 +388,7 @@ interface IHttpClient {
|
|
|
510
388
|
requestConfig?: RequestConfig;
|
|
511
389
|
proxyUrl?: string;
|
|
512
390
|
}): Promise<HttpResponse<T>>;
|
|
513
|
-
requestStream({
|
|
514
|
-
headers,
|
|
515
|
-
url,
|
|
516
|
-
method,
|
|
517
|
-
queryParams,
|
|
518
|
-
encodeQueryParams,
|
|
519
|
-
maxRedirects,
|
|
520
|
-
context,
|
|
521
|
-
traceId,
|
|
522
|
-
payload,
|
|
523
|
-
httpsAgent,
|
|
524
|
-
httpAgent,
|
|
525
|
-
requestConfig,
|
|
526
|
-
httpsAgentConfig,
|
|
527
|
-
proxyUrl
|
|
528
|
-
}: {
|
|
391
|
+
requestStream({ headers, url, method, queryParams, encodeQueryParams, maxRedirects, context, traceId, payload, httpsAgent, httpAgent, requestConfig, httpsAgentConfig, proxyUrl }: {
|
|
529
392
|
headers?: HttpHeaders;
|
|
530
393
|
url: string;
|
|
531
394
|
method?: HttpMethod;
|
|
@@ -575,14 +438,7 @@ type RequestContext = {
|
|
|
575
438
|
behaviours?: HttpClientBehaviour[];
|
|
576
439
|
};
|
|
577
440
|
type ErrorMappingFn<TError extends Error = Error> = (error: Error) => TError | undefined;
|
|
578
|
-
type TransportFactory = ({
|
|
579
|
-
logger,
|
|
580
|
-
redisClientConfig,
|
|
581
|
-
context,
|
|
582
|
-
requestConfig,
|
|
583
|
-
httpsAgentConfig,
|
|
584
|
-
egressProxyUrl
|
|
585
|
-
}: {
|
|
441
|
+
type TransportFactory = ({ logger, redisClientConfig, context, requestConfig, httpsAgentConfig, egressProxyUrl }: {
|
|
586
442
|
logger?: ILogger;
|
|
587
443
|
redisClientConfig?: RedisClientConfig;
|
|
588
444
|
context?: RequestContext;
|
|
@@ -590,8 +446,6 @@ type TransportFactory = ({
|
|
|
590
446
|
httpsAgentConfig?: https.AgentOptions;
|
|
591
447
|
egressProxyUrl?: string;
|
|
592
448
|
}) => Promise<AxiosInstance>;
|
|
593
|
-
//#endregion
|
|
594
|
-
//#region src/signing/types.d.ts
|
|
595
449
|
type SigningRequest = {
|
|
596
450
|
method: string;
|
|
597
451
|
url: string;
|
|
@@ -625,8 +479,6 @@ type HmacSigningOptions = {
|
|
|
625
479
|
};
|
|
626
480
|
type SigningOptions = Aws4SigningOptions | HmacSigningOptions;
|
|
627
481
|
type SigningStrategy = (request: SigningRequest, credentials: SigningCredentials, options: SigningOptions) => Record<string, string>;
|
|
628
|
-
//#endregion
|
|
629
|
-
//#region src/authorization/types.d.ts
|
|
630
482
|
type NoAuthorizationParams = {
|
|
631
483
|
type: 'none';
|
|
632
484
|
signing?: SigningOptions;
|
|
@@ -647,83 +499,56 @@ type OAuth2AuthorizationParams = {
|
|
|
647
499
|
token: string;
|
|
648
500
|
includeBearer: boolean;
|
|
649
501
|
};
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
declare const createAuthorizationHeaders: (authenticationParams: NoAuthorizationParams | BasicAuthorizationParams | BearerAuthorizationParams | OAuth2AuthorizationParams) => {};
|
|
653
|
-
//#endregion
|
|
654
|
-
//#region src/customErrors/schemas.d.ts
|
|
655
|
-
declare const CUSTOM_ERROR_CONFIG_SCHEMA: z.ZodObject<{
|
|
502
|
+
export declare const createAuthorizationHeaders: (authenticationParams: NoAuthorizationParams | BasicAuthorizationParams | BearerAuthorizationParams | OAuth2AuthorizationParams) => {};
|
|
503
|
+
export declare const CUSTOM_ERROR_CONFIG_SCHEMA: z.ZodObject<{
|
|
656
504
|
receivedStatus: z.ZodNumber;
|
|
657
505
|
targetStatus: z.ZodNumber;
|
|
658
506
|
message: z.ZodOptional<z.ZodString>;
|
|
659
507
|
condition: z.ZodOptional<z.ZodString>;
|
|
660
508
|
}, z.core.$strict>;
|
|
661
|
-
//#endregion
|
|
662
|
-
//#region src/customErrors/types.d.ts
|
|
663
509
|
type CustomErrorConfig = z.infer<typeof CUSTOM_ERROR_CONFIG_SCHEMA>;
|
|
664
|
-
declare const HttpErrorMessages: Record<number, string>;
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
declare const translateCustomError: (response: HttpResponse, configs?: CustomErrorConfig[], credentials?: Record<string, unknown>) => HttpResponse;
|
|
668
|
-
//#endregion
|
|
669
|
-
//#region src/egressProxy/egressProxyError.d.ts
|
|
670
|
-
declare class EgressProxyError extends Error {
|
|
510
|
+
export declare const HttpErrorMessages: Record<number, string>;
|
|
511
|
+
export declare const translateCustomError: (response: HttpResponse, configs?: CustomErrorConfig[], credentials?: Record<string, unknown>) => HttpResponse;
|
|
512
|
+
export declare class EgressProxyError extends Error {
|
|
671
513
|
readonly status: number;
|
|
672
514
|
readonly proxyStatus?: number;
|
|
673
515
|
readonly proxyReason?: string;
|
|
674
516
|
readonly cause?: unknown;
|
|
675
|
-
constructor(message: string, {
|
|
676
|
-
status,
|
|
677
|
-
proxyStatus,
|
|
678
|
-
proxyReason,
|
|
679
|
-
cause
|
|
680
|
-
}: {
|
|
517
|
+
constructor(message: string, { status, proxyStatus, proxyReason, cause }: {
|
|
681
518
|
status: number;
|
|
682
519
|
proxyStatus?: number;
|
|
683
520
|
proxyReason?: string;
|
|
684
521
|
cause?: unknown;
|
|
685
522
|
});
|
|
686
523
|
}
|
|
687
|
-
declare class ConflictingProxyError extends Error {
|
|
524
|
+
export declare class ConflictingProxyError extends Error {
|
|
688
525
|
name: string;
|
|
689
526
|
}
|
|
690
|
-
declare class UntunnelledTransportError extends Error {
|
|
527
|
+
export declare class UntunnelledTransportError extends Error {
|
|
691
528
|
name: string;
|
|
692
529
|
}
|
|
693
|
-
declare class InvalidEgressProxyUrlError extends Error {
|
|
530
|
+
export declare class InvalidEgressProxyUrlError extends Error {
|
|
694
531
|
name: string;
|
|
695
532
|
}
|
|
696
|
-
declare const isEgressProxyError: (value: unknown) => value is EgressProxyError;
|
|
697
|
-
declare const findEgressProxyError: (error: unknown) => EgressProxyError | undefined;
|
|
698
|
-
|
|
699
|
-
//#region src/egressProxy/egressProxyFetch.d.ts
|
|
700
|
-
declare const createEgressProxyFetch: (egressProxyUrl: string, {
|
|
701
|
-
connectTimeoutMs
|
|
702
|
-
}?: {
|
|
533
|
+
export declare const isEgressProxyError: (value: unknown) => value is EgressProxyError;
|
|
534
|
+
export declare const findEgressProxyError: (error: unknown) => EgressProxyError | undefined;
|
|
535
|
+
export declare const createEgressProxyFetch: (egressProxyUrl: string, { connectTimeoutMs }?: {
|
|
703
536
|
connectTimeoutMs?: number;
|
|
704
537
|
}) => FetchLike;
|
|
705
|
-
|
|
706
|
-
//#region src/errors/httpResponseError.d.ts
|
|
707
|
-
declare class HttpResponseError extends Error {
|
|
538
|
+
export declare class HttpResponseError extends Error {
|
|
708
539
|
readonly response: HttpResponse;
|
|
709
540
|
constructor(response: HttpResponse, message?: string);
|
|
710
541
|
toString(): string;
|
|
711
542
|
}
|
|
712
|
-
//#endregion
|
|
713
|
-
//#region src/errors/requestAbortedError.d.ts
|
|
714
543
|
declare const REQUEST_ABORT_REASONS: readonly ['client_disconnect', 'timeout'];
|
|
715
544
|
type RequestAbortReason = (typeof REQUEST_ABORT_REASONS)[number];
|
|
716
|
-
declare class RequestAbortedError extends Error {
|
|
545
|
+
export declare class RequestAbortedError extends Error {
|
|
717
546
|
readonly reason: RequestAbortReason;
|
|
718
547
|
constructor(reason: RequestAbortReason);
|
|
719
548
|
}
|
|
720
|
-
declare const isRequestAbortedError: (value: unknown) => value is RequestAbortedError;
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
declare const serializeHttpResponseError: (error: unknown) => Record<string, unknown>;
|
|
724
|
-
//#endregion
|
|
725
|
-
//#region src/lockManager/index.d.ts
|
|
726
|
-
declare class LockManager {
|
|
549
|
+
export declare const isRequestAbortedError: (value: unknown) => value is RequestAbortedError;
|
|
550
|
+
export declare const serializeHttpResponseError: (error: unknown) => Record<string, unknown>;
|
|
551
|
+
export declare class LockManager {
|
|
727
552
|
private locks;
|
|
728
553
|
constructor();
|
|
729
554
|
withLock<T>(key: string, operation: () => Promise<T>): Promise<T>;
|
|
@@ -732,8 +557,6 @@ declare class LockManager {
|
|
|
732
557
|
queueLength(key: string): number | undefined;
|
|
733
558
|
close(): void;
|
|
734
559
|
}
|
|
735
|
-
//#endregion
|
|
736
|
-
//#region src/memoryStore/types.d.ts
|
|
737
560
|
interface MemoryStoreConfig<T> {
|
|
738
561
|
instantiator?: string;
|
|
739
562
|
logger?: ILogger;
|
|
@@ -752,8 +575,6 @@ type PruneCount = {
|
|
|
752
575
|
dataStoreSize: number;
|
|
753
576
|
prunedDataStoreSize: number;
|
|
754
577
|
};
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region src/eventClient/types.d.ts
|
|
757
578
|
type PromiseExecutorMethods<T> = {
|
|
758
579
|
resolve?: (value: T) => void;
|
|
759
580
|
reject?: (reason: unknown) => void;
|
|
@@ -763,9 +584,7 @@ type EventClientConfig<T> = {
|
|
|
763
584
|
defaultTimeoutMS?: number;
|
|
764
585
|
timeoutResolveValue?: T;
|
|
765
586
|
};
|
|
766
|
-
|
|
767
|
-
//#region src/eventClient/index.d.ts
|
|
768
|
-
declare class EventClient<T> {
|
|
587
|
+
export declare class EventClient<T> {
|
|
769
588
|
private executorMethodStore;
|
|
770
589
|
private promiseStore;
|
|
771
590
|
private logger;
|
|
@@ -784,19 +603,10 @@ declare class EventClient<T> {
|
|
|
784
603
|
private defaultPendingPromiseDispose;
|
|
785
604
|
private defaultPendingPromiseTypeGuard;
|
|
786
605
|
}
|
|
787
|
-
|
|
788
|
-
//#region src/getTransportInstance/index.d.ts
|
|
789
|
-
declare class TransportManagersUnavailableError extends Error {
|
|
606
|
+
export declare class TransportManagersUnavailableError extends Error {
|
|
790
607
|
name: string;
|
|
791
608
|
}
|
|
792
|
-
declare const getTransportInstance: ({
|
|
793
|
-
logger,
|
|
794
|
-
redisClientConfig,
|
|
795
|
-
context,
|
|
796
|
-
requestConfig,
|
|
797
|
-
httpsAgentConfig,
|
|
798
|
-
egressProxyUrl
|
|
799
|
-
}?: {
|
|
609
|
+
export declare const getTransportInstance: ({ logger, redisClientConfig, context, requestConfig, httpsAgentConfig, egressProxyUrl }?: {
|
|
800
610
|
logger?: ILogger;
|
|
801
611
|
redisClientConfig?: RedisClientConfig;
|
|
802
612
|
context?: RequestContext;
|
|
@@ -804,23 +614,12 @@ declare const getTransportInstance: ({
|
|
|
804
614
|
httpsAgentConfig?: https.AgentOptions;
|
|
805
615
|
egressProxyUrl?: string;
|
|
806
616
|
}) => Promise<AxiosInstance>;
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
declare const getCancelledCallCount: (signal: AbortSignal) => number;
|
|
810
|
-
//#endregion
|
|
811
|
-
//#region src/httpClient/httpClient.d.ts
|
|
812
|
-
declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
617
|
+
export declare const getCancelledCallCount: (signal: AbortSignal) => number;
|
|
618
|
+
export declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
813
619
|
#private;
|
|
814
620
|
name: string;
|
|
815
621
|
readonly egressProxyUrl?: string;
|
|
816
|
-
constructor({
|
|
817
|
-
transportFactory,
|
|
818
|
-
getRedisClient,
|
|
819
|
-
logger,
|
|
820
|
-
redisClientConfig,
|
|
821
|
-
errorMappingFn,
|
|
822
|
-
egressProxyUrl
|
|
823
|
-
}?: {
|
|
622
|
+
constructor({ transportFactory, getRedisClient, logger, redisClientConfig, errorMappingFn, egressProxyUrl }?: {
|
|
824
623
|
transportFactory?: TransportFactory;
|
|
825
624
|
getRedisClient?: RedisClientBuilder;
|
|
826
625
|
logger?: ILogger;
|
|
@@ -828,25 +627,7 @@ declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
|
828
627
|
errorMappingFn?: ErrorMappingFn<TError>;
|
|
829
628
|
egressProxyUrl?: string;
|
|
830
629
|
});
|
|
831
|
-
request<P, T>({
|
|
832
|
-
headers,
|
|
833
|
-
url,
|
|
834
|
-
method,
|
|
835
|
-
queryParams,
|
|
836
|
-
encodeQueryParams,
|
|
837
|
-
maxRedirects,
|
|
838
|
-
responseType,
|
|
839
|
-
cacheTTL,
|
|
840
|
-
context,
|
|
841
|
-
traceId,
|
|
842
|
-
payload,
|
|
843
|
-
httpsAgent,
|
|
844
|
-
httpAgent,
|
|
845
|
-
requestConfig,
|
|
846
|
-
httpsAgentConfig,
|
|
847
|
-
timeoutMs,
|
|
848
|
-
proxyUrl
|
|
849
|
-
}: {
|
|
630
|
+
request<P, T>({ headers, url, method, queryParams, encodeQueryParams, maxRedirects, responseType, cacheTTL, context, traceId, payload, httpsAgent, httpAgent, requestConfig, httpsAgentConfig, timeoutMs, proxyUrl }: {
|
|
850
631
|
headers?: HttpHeaders;
|
|
851
632
|
url: string;
|
|
852
633
|
method?: HttpMethod;
|
|
@@ -865,17 +646,7 @@ declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
|
865
646
|
timeoutMs?: number;
|
|
866
647
|
proxyUrl?: string;
|
|
867
648
|
}): Promise<HttpResponse<T>>;
|
|
868
|
-
get<T>({
|
|
869
|
-
headers,
|
|
870
|
-
url,
|
|
871
|
-
queryParams,
|
|
872
|
-
maxRedirects,
|
|
873
|
-
cacheTTL,
|
|
874
|
-
context,
|
|
875
|
-
traceId,
|
|
876
|
-
requestConfig,
|
|
877
|
-
proxyUrl
|
|
878
|
-
}: {
|
|
649
|
+
get<T>({ headers, url, queryParams, maxRedirects, cacheTTL, context, traceId, requestConfig, proxyUrl }: {
|
|
879
650
|
headers?: HttpHeaders;
|
|
880
651
|
url: string;
|
|
881
652
|
queryParams?: HttpQueryParams;
|
|
@@ -886,17 +657,7 @@ declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
|
886
657
|
requestConfig?: RequestConfig;
|
|
887
658
|
proxyUrl?: string;
|
|
888
659
|
}): Promise<HttpResponse<T>>;
|
|
889
|
-
post<P, T>({
|
|
890
|
-
headers,
|
|
891
|
-
url,
|
|
892
|
-
maxRedirects,
|
|
893
|
-
cacheTTL,
|
|
894
|
-
context,
|
|
895
|
-
traceId,
|
|
896
|
-
payload,
|
|
897
|
-
requestConfig,
|
|
898
|
-
proxyUrl
|
|
899
|
-
}: {
|
|
660
|
+
post<P, T>({ headers, url, maxRedirects, cacheTTL, context, traceId, payload, requestConfig, proxyUrl }: {
|
|
900
661
|
headers?: HttpHeaders;
|
|
901
662
|
url: string;
|
|
902
663
|
maxRedirects?: number;
|
|
@@ -907,22 +668,7 @@ declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
|
907
668
|
requestConfig?: RequestConfig;
|
|
908
669
|
proxyUrl?: string;
|
|
909
670
|
}): Promise<HttpResponse<T>>;
|
|
910
|
-
requestStream({
|
|
911
|
-
headers,
|
|
912
|
-
url,
|
|
913
|
-
method,
|
|
914
|
-
queryParams,
|
|
915
|
-
encodeQueryParams,
|
|
916
|
-
maxRedirects,
|
|
917
|
-
context,
|
|
918
|
-
traceId,
|
|
919
|
-
payload,
|
|
920
|
-
httpsAgent,
|
|
921
|
-
httpAgent,
|
|
922
|
-
requestConfig,
|
|
923
|
-
httpsAgentConfig,
|
|
924
|
-
proxyUrl
|
|
925
|
-
}: {
|
|
671
|
+
requestStream({ headers, url, method, queryParams, encodeQueryParams, maxRedirects, context, traceId, payload, httpsAgent, httpAgent, requestConfig, httpsAgentConfig, proxyUrl }: {
|
|
926
672
|
headers?: HttpHeaders;
|
|
927
673
|
url: string;
|
|
928
674
|
method?: HttpMethod;
|
|
@@ -939,18 +685,10 @@ declare class HttpClient<TError extends Error = Error> implements IHttpClient {
|
|
|
939
685
|
proxyUrl?: string;
|
|
940
686
|
}): Promise<StreamHttpResponse>;
|
|
941
687
|
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
declare const buildHttpClientInstance: <TError extends Error = Error>(redisClientConfig: RedisClientConfig, logger?: ILogger, errorMappingFn?: ErrorMappingFn<TError>, egressProxyUrl?: string) => IHttpClient;
|
|
945
|
-
declare class HttpClientManager {
|
|
688
|
+
export declare const buildHttpClientInstance: <TError extends Error = Error>(redisClientConfig: RedisClientConfig, logger?: ILogger, errorMappingFn?: ErrorMappingFn<TError>, egressProxyUrl?: string) => IHttpClient;
|
|
689
|
+
export declare class HttpClientManager {
|
|
946
690
|
private static httpClientInstances;
|
|
947
|
-
static getInstance<TError extends Error = Error>({
|
|
948
|
-
redisClientConfig,
|
|
949
|
-
logger,
|
|
950
|
-
errorMappingFn,
|
|
951
|
-
getHttpClient,
|
|
952
|
-
egressProxyUrl
|
|
953
|
-
}: {
|
|
691
|
+
static getInstance<TError extends Error = Error>({ redisClientConfig, logger, errorMappingFn, getHttpClient, egressProxyUrl }: {
|
|
954
692
|
redisClientConfig: RedisClientConfig;
|
|
955
693
|
logger?: ILogger;
|
|
956
694
|
errorMappingFn?: ErrorMappingFn<TError>;
|
|
@@ -959,15 +697,11 @@ declare class HttpClientManager {
|
|
|
959
697
|
}): Promise<IHttpClient>;
|
|
960
698
|
static resetInstance(): void;
|
|
961
699
|
}
|
|
962
|
-
//#endregion
|
|
963
|
-
//#region src/httpsAgent/buildHttpsAgent.d.ts
|
|
964
700
|
interface CertificatesInput {
|
|
965
701
|
certs?: string[];
|
|
966
702
|
keys?: string[];
|
|
967
703
|
}
|
|
968
|
-
declare const buildHttpsAgent: (certificates?: CertificatesInput) => https.Agent | undefined;
|
|
969
|
-
//#endregion
|
|
970
|
-
//#region src/httpTransportFactory/types.d.ts
|
|
704
|
+
export declare const buildHttpsAgent: (certificates?: CertificatesInput) => https.Agent | undefined;
|
|
971
705
|
type RequestInterceptorTuple = [RequestInterceptor | null, ErrorInterceptor | null, AxiosInterceptorOptions | undefined];
|
|
972
706
|
type ResponseInterceptorTuple = [ResponseInterceptor | null, ErrorInterceptor | null];
|
|
973
707
|
type InterceptorDependencyInjector<T extends Interceptor> = (dependencies: InterceptorDependencies) => T;
|
|
@@ -999,25 +733,11 @@ interface InterceptorManager<V> extends AxiosInterceptorManager<V> {
|
|
|
999
733
|
forEach(fn: (handler: any) => unknown): void;
|
|
1000
734
|
handlers: [];
|
|
1001
735
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
declare class HttpTransportFactory {
|
|
1005
|
-
static createInstance({
|
|
1006
|
-
interceptors,
|
|
1007
|
-
instanceConfig,
|
|
1008
|
-
httpsAgentConfig,
|
|
1009
|
-
logger,
|
|
1010
|
-
context,
|
|
1011
|
-
requestConfig,
|
|
1012
|
-
concurrencyManager,
|
|
1013
|
-
rateLimitManager,
|
|
1014
|
-
egressProxyUrl
|
|
1015
|
-
}: HttpTransportInstanceConfig): AxiosInstance;
|
|
736
|
+
export declare class HttpTransportFactory {
|
|
737
|
+
static createInstance({ interceptors, instanceConfig, httpsAgentConfig, logger, context, requestConfig, concurrencyManager, rateLimitManager, egressProxyUrl }: HttpTransportInstanceConfig): AxiosInstance;
|
|
1016
738
|
private static applyInterceptors;
|
|
1017
739
|
private static resolveInterceptorInstance;
|
|
1018
740
|
}
|
|
1019
|
-
//#endregion
|
|
1020
|
-
//#region src/queueManager/utils/enums.d.ts
|
|
1021
741
|
declare enum QueueMethods {
|
|
1022
742
|
rPush = "rPush",
|
|
1023
743
|
lPush = "lPush",
|
|
@@ -1025,12 +745,8 @@ declare enum QueueMethods {
|
|
|
1025
745
|
lPop = "lPop",
|
|
1026
746
|
llen = "llen"
|
|
1027
747
|
}
|
|
1028
|
-
//#endregion
|
|
1029
|
-
//#region src/queueManager/types.d.ts
|
|
1030
748
|
type OnTurnFunction<T> = (queueName: string, value: string) => T | Promise<T>;
|
|
1031
|
-
|
|
1032
|
-
//#region src/queueManager/index.d.ts
|
|
1033
|
-
declare class QueueManager extends ScriptManager<QueueMethods, QueueManager> {
|
|
749
|
+
export declare class QueueManager extends ScriptManager<QueueMethods, QueueManager> {
|
|
1034
750
|
private subscriptionManager;
|
|
1035
751
|
private eventClient;
|
|
1036
752
|
name: string;
|
|
@@ -1044,8 +760,6 @@ declare class QueueManager extends ScriptManager<QueueMethods, QueueManager> {
|
|
|
1044
760
|
protected releaseAdditionalResources(): void;
|
|
1045
761
|
close(): void;
|
|
1046
762
|
}
|
|
1047
|
-
//#endregion
|
|
1048
|
-
//#region src/initialization/index.d.ts
|
|
1049
763
|
interface TransportInitializationOptions {
|
|
1050
764
|
redisClientConfig: RedisClientConfig;
|
|
1051
765
|
logger?: ILogger;
|
|
@@ -1058,13 +772,11 @@ interface InitializedTransportManagers {
|
|
|
1058
772
|
queueManager: QueueManager;
|
|
1059
773
|
rateLimitManager: RateLimitManager;
|
|
1060
774
|
}
|
|
1061
|
-
declare const initializeTransportSystem: (options: TransportInitializationOptions) => Promise<InitializedTransportManagers>;
|
|
1062
|
-
declare const shutdownTransportSystem: (logger?: ILogger) => void;
|
|
1063
|
-
declare const isTransportSystemReady: () => boolean;
|
|
1064
|
-
declare const getTransportManagers: () => InitializedTransportManagers | null;
|
|
1065
|
-
|
|
1066
|
-
//#region src/instanceManager/index.d.ts
|
|
1067
|
-
declare class InstanceManager {
|
|
775
|
+
export declare const initializeTransportSystem: (options: TransportInitializationOptions) => Promise<InitializedTransportManagers>;
|
|
776
|
+
export declare const shutdownTransportSystem: (logger?: ILogger) => void;
|
|
777
|
+
export declare const isTransportSystemReady: () => boolean;
|
|
778
|
+
export declare const getTransportManagers: () => InitializedTransportManagers | null;
|
|
779
|
+
export declare class InstanceManager {
|
|
1068
780
|
private static instance;
|
|
1069
781
|
private static logger;
|
|
1070
782
|
private dataStore;
|
|
@@ -1083,9 +795,7 @@ declare class InstanceManager {
|
|
|
1083
795
|
isReady(): boolean;
|
|
1084
796
|
close(): void;
|
|
1085
797
|
}
|
|
1086
|
-
|
|
1087
|
-
//#region src/instanceManager/persistentInstanceManager.d.ts
|
|
1088
|
-
declare class PersistentInstanceManager {
|
|
798
|
+
export declare class PersistentInstanceManager {
|
|
1089
799
|
private static instance;
|
|
1090
800
|
private dataStore;
|
|
1091
801
|
private logger?;
|
|
@@ -1101,14 +811,10 @@ declare class PersistentInstanceManager {
|
|
|
1101
811
|
isReady(): boolean;
|
|
1102
812
|
close(): void;
|
|
1103
813
|
}
|
|
1104
|
-
|
|
1105
|
-
//#region src/interceptors/retryError.interceptor.d.ts
|
|
1106
|
-
declare const convertError: (response?: Partial<AxiosResponse>, _context?: RequestContext, requestConfig?: RequestConfig, _logger?: ILogger) => {
|
|
814
|
+
export declare const convertError: (response?: Partial<AxiosResponse>, _context?: RequestContext, requestConfig?: RequestConfig, _logger?: ILogger) => {
|
|
1107
815
|
status: number | undefined;
|
|
1108
816
|
retryAfter: number | null;
|
|
1109
817
|
};
|
|
1110
|
-
//#endregion
|
|
1111
|
-
//#region src/mcpClient/types.d.ts
|
|
1112
818
|
type McpClientInfo = {
|
|
1113
819
|
name: string;
|
|
1114
820
|
version: string;
|
|
@@ -1165,21 +871,16 @@ interface IMcpClient {
|
|
|
1165
871
|
getServerInfo: () => Promise<McpServerInfo>;
|
|
1166
872
|
close: () => Promise<void>;
|
|
1167
873
|
}
|
|
1168
|
-
//#endregion
|
|
1169
|
-
//#region src/mcpClient/mcpClient.d.ts
|
|
1170
874
|
type McpSdkDependencies = {
|
|
1171
875
|
createClient: (clientInfo: McpClientInfo, options: ClientOptions) => Client;
|
|
1172
876
|
createTransport: (url: URL, options: StreamableHTTPClientTransportOptions) => Transport;
|
|
1173
877
|
};
|
|
1174
|
-
declare class McpClient implements IMcpClient {
|
|
878
|
+
export declare class McpClient implements IMcpClient {
|
|
1175
879
|
private readonly config;
|
|
1176
880
|
private readonly sdk;
|
|
1177
881
|
private connectedClient?;
|
|
1178
882
|
constructor(config: McpClientConfig, sdk?: McpSdkDependencies);
|
|
1179
|
-
callTool({
|
|
1180
|
-
name,
|
|
1181
|
-
arguments: toolArguments
|
|
1182
|
-
}: McpCallToolParams): Promise<McpCallToolResult>;
|
|
883
|
+
callTool({ name, arguments: toolArguments }: McpCallToolParams): Promise<McpCallToolResult>;
|
|
1183
884
|
listTools(params?: McpListToolsParams): Promise<McpListToolsResult>;
|
|
1184
885
|
getServerInfo(): Promise<McpServerInfo>;
|
|
1185
886
|
private resolveIconUrl;
|
|
@@ -1189,12 +890,8 @@ declare class McpClient implements IMcpClient {
|
|
|
1189
890
|
private connect;
|
|
1190
891
|
private buildRequestOptions;
|
|
1191
892
|
}
|
|
1192
|
-
//#endregion
|
|
1193
|
-
//#region src/mcpClient/mcpIcon.d.ts
|
|
1194
893
|
type McpIconFinder = (serverUrl: string, advertisedIconUrl?: string) => Promise<string | undefined>;
|
|
1195
|
-
declare const findMcpIcon: (serverUrl: string, advertisedIconUrl?: string, fetchFn?: typeof fetch) => Promise<string | undefined>;
|
|
1196
|
-
//#endregion
|
|
1197
|
-
//#region src/mcpClient/mcpOAuthDiscovery.d.ts
|
|
894
|
+
export declare const findMcpIcon: (serverUrl: string, advertisedIconUrl?: string, fetchFn?: typeof fetch) => Promise<string | undefined>;
|
|
1198
895
|
type SameSiteIssuerFallback = {
|
|
1199
896
|
expectedIssuer: string;
|
|
1200
897
|
receivedIssuer: string;
|
|
@@ -1212,11 +909,9 @@ type McpOAuthDiscoveryDependencies = {
|
|
|
1212
909
|
fetchFn?: FetchLike;
|
|
1213
910
|
}) => Promise<AuthorizationServerMetadata | undefined>;
|
|
1214
911
|
};
|
|
1215
|
-
declare const isSameSiteIssuer: (expected: string | undefined, received: string | undefined) => boolean;
|
|
1216
|
-
declare const discoverSameSiteAuthorizationServerMetadata: (authorizationServerUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<AuthorizationServerMetadata | undefined>;
|
|
1217
|
-
declare const discoverMcpOAuthServerInfo: (serverUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<OAuthServerInfo>;
|
|
1218
|
-
//#endregion
|
|
1219
|
-
//#region src/mcpClient/probeMcpServer.d.ts
|
|
912
|
+
export declare const isSameSiteIssuer: (expected: string | undefined, received: string | undefined) => boolean;
|
|
913
|
+
export declare const discoverSameSiteAuthorizationServerMetadata: (authorizationServerUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<AuthorizationServerMetadata | undefined>;
|
|
914
|
+
export declare const discoverMcpOAuthServerInfo: (serverUrl: string, options?: McpOAuthDiscoveryOptions, dependencies?: McpOAuthDiscoveryDependencies) => Promise<OAuthServerInfo>;
|
|
1220
915
|
type McpServerProbe = {
|
|
1221
916
|
requiresAuthorization: boolean;
|
|
1222
917
|
oauth?: {
|
|
@@ -1262,11 +957,9 @@ type ProbeDependencies = {
|
|
|
1262
957
|
discoverResourceMetadata: (serverUrl: string, resourceMetadataUrl?: string) => Promise<ResourceMetadata>;
|
|
1263
958
|
discoverAuthorizationServer: (authorizationServerUrl: string) => Promise<AuthorizationServerMetadata$1 | undefined>;
|
|
1264
959
|
};
|
|
1265
|
-
declare const mcpResourceIndicator: (serverUrl: string, advertisedResource?: string) => string;
|
|
1266
|
-
declare const probeMcpServer: (serverUrl: string, dependencies?: ProbeDependencies) => Promise<McpServerProbe>;
|
|
1267
|
-
|
|
1268
|
-
//#region src/memoryStore/index.d.ts
|
|
1269
|
-
declare class MemoryStore<T> implements ICacheClient {
|
|
960
|
+
export declare const mcpResourceIndicator: (serverUrl: string, advertisedResource?: string) => string;
|
|
961
|
+
export declare const probeMcpServer: (serverUrl: string, dependencies?: ProbeDependencies) => Promise<McpServerProbe>;
|
|
962
|
+
export declare class MemoryStore<T> implements ICacheClient {
|
|
1270
963
|
private config;
|
|
1271
964
|
private instantiator;
|
|
1272
965
|
private dataStore;
|
|
@@ -1298,13 +991,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
1298
991
|
listGroupKeys(prefix: string): Promise<string[]>;
|
|
1299
992
|
deleteDataKeyFromGroup(groupKey: string, key: string): Promise<boolean>;
|
|
1300
993
|
private getLiveGroup;
|
|
1301
|
-
setData<U = T>({
|
|
1302
|
-
key,
|
|
1303
|
-
value,
|
|
1304
|
-
cacheTTL,
|
|
1305
|
-
groupKeys,
|
|
1306
|
-
groupKeyTTL
|
|
1307
|
-
}: {
|
|
994
|
+
setData<U = T>({ key, value, cacheTTL, groupKeys, groupKeyTTL }: {
|
|
1308
995
|
key: string;
|
|
1309
996
|
value: U;
|
|
1310
997
|
cacheTTL?: number;
|
|
@@ -1323,11 +1010,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
1323
1010
|
setTTL(key: string, cacheTTL: number): Promise<boolean>;
|
|
1324
1011
|
private pruneExpiredHashes;
|
|
1325
1012
|
private getLiveHash;
|
|
1326
|
-
setHashData<U>({
|
|
1327
|
-
key,
|
|
1328
|
-
entries,
|
|
1329
|
-
cacheTTL
|
|
1330
|
-
}: {
|
|
1013
|
+
setHashData<U>({ key, entries, cacheTTL }: {
|
|
1331
1014
|
key: string;
|
|
1332
1015
|
entries: Record<string, U>;
|
|
1333
1016
|
cacheTTL: number;
|
|
@@ -1336,11 +1019,7 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
1336
1019
|
getAllHashData<U>(key: string): Promise<Record<string, U> | null>;
|
|
1337
1020
|
deleteHashData(key: string, fields: string[]): Promise<number | null>;
|
|
1338
1021
|
close(): Promise<void>;
|
|
1339
|
-
listData<T>({
|
|
1340
|
-
partialKey,
|
|
1341
|
-
cursor,
|
|
1342
|
-
limit
|
|
1343
|
-
}: {
|
|
1022
|
+
listData<T>({ partialKey, cursor, limit }: {
|
|
1344
1023
|
partialKey: string;
|
|
1345
1024
|
cursor?: string;
|
|
1346
1025
|
limit: number;
|
|
@@ -1349,28 +1028,9 @@ declare class MemoryStore<T> implements ICacheClient {
|
|
|
1349
1028
|
cursor?: string;
|
|
1350
1029
|
}>;
|
|
1351
1030
|
}
|
|
1352
|
-
|
|
1353
|
-
//#region src/parsers/requestParameters.d.ts
|
|
1354
|
-
declare const parseRequestParameters: (parameters: RequestParameter[]) => HttpParameters;
|
|
1355
|
-
//#endregion
|
|
1356
|
-
//#region src/requestClient/types.d.ts
|
|
1031
|
+
export declare const parseRequestParameters: (parameters: RequestParameter[]) => HttpParameters;
|
|
1357
1032
|
interface IRequestClient<RequestConfig$1 = RequestConfig> {
|
|
1358
|
-
performRequest: ({
|
|
1359
|
-
httpClient,
|
|
1360
|
-
url,
|
|
1361
|
-
method,
|
|
1362
|
-
headers,
|
|
1363
|
-
queryParams,
|
|
1364
|
-
encodeQueryParams,
|
|
1365
|
-
body,
|
|
1366
|
-
customErrorConfigs,
|
|
1367
|
-
requestConfig,
|
|
1368
|
-
httpsAgent,
|
|
1369
|
-
responseType,
|
|
1370
|
-
context,
|
|
1371
|
-
cacheTTL,
|
|
1372
|
-
timeoutMs
|
|
1373
|
-
}: {
|
|
1033
|
+
performRequest: ({ httpClient, url, method, headers, queryParams, encodeQueryParams, body, customErrorConfigs, requestConfig, httpsAgent, responseType, context, cacheTTL, timeoutMs }: {
|
|
1374
1034
|
httpClient: IHttpClient;
|
|
1375
1035
|
url: string;
|
|
1376
1036
|
method: HttpMethod;
|
|
@@ -1389,17 +1049,11 @@ interface IRequestClient<RequestConfig$1 = RequestConfig> {
|
|
|
1389
1049
|
}) => Promise<HttpResponse>;
|
|
1390
1050
|
}
|
|
1391
1051
|
type RequestClientType = 'rest' | 'soap';
|
|
1392
|
-
|
|
1393
|
-
//#region src/requestClient/requestClientFactory.d.ts
|
|
1394
|
-
declare class RequestClientFactory {
|
|
1052
|
+
export declare class RequestClientFactory {
|
|
1395
1053
|
static build(type?: RequestClientType): IRequestClient;
|
|
1396
1054
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
declare const registerSigningStrategy: (name: string, strategy: SigningStrategy) => void;
|
|
1400
|
-
declare const getSigningStrategy: (name: string) => SigningStrategy | undefined;
|
|
1401
|
-
//#endregion
|
|
1402
|
-
//#region src/subscriptionManager/types.d.ts
|
|
1055
|
+
export declare const registerSigningStrategy: (name: string, strategy: SigningStrategy) => void;
|
|
1056
|
+
export declare const getSigningStrategy: (name: string) => SigningStrategy | undefined;
|
|
1403
1057
|
type SubscriptionManagerOptions = {
|
|
1404
1058
|
config?: RedisClientConfig;
|
|
1405
1059
|
getCacheClient?: typeof buildRedisClientInstance;
|
|
@@ -1410,9 +1064,7 @@ type SubscriptionManagerOptions = {
|
|
|
1410
1064
|
truncateThreshold?: number;
|
|
1411
1065
|
truncationPercentage?: number;
|
|
1412
1066
|
};
|
|
1413
|
-
|
|
1414
|
-
//#region src/subscriptionManager/index.d.ts
|
|
1415
|
-
declare class SubscriptionManager {
|
|
1067
|
+
export declare class SubscriptionManager {
|
|
1416
1068
|
private options;
|
|
1417
1069
|
private subscriptionMap;
|
|
1418
1070
|
private subscriptionClient;
|
|
@@ -1425,25 +1077,16 @@ declare class SubscriptionManager {
|
|
|
1425
1077
|
isReady(): boolean;
|
|
1426
1078
|
close(): void;
|
|
1427
1079
|
}
|
|
1428
|
-
|
|
1429
|
-
//#region src/utils/extractRatelimitHeaders.d.ts
|
|
1430
|
-
declare const superNormalizeHeaders: (headers: AxiosResponse['headers']) => Record<string, number | null>;
|
|
1431
|
-
//#endregion
|
|
1432
|
-
//#region src/utils/retryAfter.d.ts
|
|
1080
|
+
export declare const superNormalizeHeaders: (headers: AxiosResponse['headers']) => Record<string, number | null>;
|
|
1433
1081
|
type RetryAfter = string | number | null;
|
|
1434
|
-
declare const getRetryAfterWaitTime: (retryAfter: RetryAfter, maxWaitTime?: number, defaultWaitTime?: number) => number;
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
declare const
|
|
1438
|
-
declare const isFailedStatusCode: (status: number | undefined) => boolean;
|
|
1439
|
-
declare const isInfoStatusCode: (status: number | undefined) => boolean;
|
|
1440
|
-
//#endregion
|
|
1441
|
-
//#region src/lockManager/types.d.ts
|
|
1082
|
+
export declare const getRetryAfterWaitTime: (retryAfter: RetryAfter, maxWaitTime?: number, defaultWaitTime?: number) => number;
|
|
1083
|
+
export declare const isSuccessStatusCode: (status: number | undefined) => boolean;
|
|
1084
|
+
export declare const isFailedStatusCode: (status: number | undefined) => boolean;
|
|
1085
|
+
export declare const isInfoStatusCode: (status: number | undefined) => boolean;
|
|
1442
1086
|
type Lock = Promise<void>;
|
|
1443
1087
|
type Unlock = () => void;
|
|
1444
1088
|
type LockEntry = {
|
|
1445
1089
|
lock: Lock;
|
|
1446
1090
|
unlock: Unlock;
|
|
1447
1091
|
};
|
|
1448
|
-
|
|
1449
|
-
export { type AuthorizationChallenge, type AxiosErrorWithRequestMetadata, type AxiosErrorWithRetryCount, CUSTOM_ERROR_CONFIG_SCHEMA, type CertificatesInput, type ConcurrencyConfig, ConcurrencyManager, ConflictingProxyError, type CustomErrorConfig, EgressProxyError, type ErrorInterceptor, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeader, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type HttpTransportInstanceConfig, type ICacheClient, type IHttpClient, type IMcpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Interceptor, type InterceptorConfigs, type InterceptorDependencies, type InterceptorDependencyInjector, type InterceptorManager, InvalidEgressProxyUrlError, type Lock, type LockEntry, LockManager, type McpCallToolParams, type McpCallToolResult, McpClient, type McpClientConfig, type McpClientInfo, type McpIconFinder, type McpListToolsParams, type McpListToolsResult, type McpOAuthDiscoveryDependencies, type McpOAuthDiscoveryOptions, type McpSdkDependencies, type McpServerInfo, type McpServerProbe, type McpServerProber, type McpToolContentBlock, type McpToolDefinition, MemoryStore, type MemoryStoreConfig, type OnFulfilledInterceptors, PersistentInstanceManager, type ProbeDependencies, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, type RequestAbortReason, RequestAbortedError, RequestClientFactory, type RequestConfig, type RequestContext, type RequestInterceptor, type RequestInterceptorConfig, type RequestInterceptorTuple, type RequestParameter, RequestParameterLocations, type ResponseInterceptor, type ResponseInterceptorConfig, type ResponseInterceptorTuple, type ResponseType, type SameSiteIssuerFallback, ScriptManager, type SigningCredentials, type SigningOptions, type SigningRequest, type SigningStrategy, type StreamHttpResponse, SubscriptionManager, type TransportInitializationOptions, TransportManagersUnavailableError, type Unlock, UntunnelledTransportError, buildHttpClientInstance, buildHttpsAgent, convertError, createAuthorizationHeaders, createEgressProxyFetch, discoverMcpOAuthServerInfo, discoverSameSiteAuthorizationServerMetadata, findEgressProxyError, findMcpIcon, getCancelledCallCount, getRetryAfterWaitTime, getSigningStrategy, getTransportInstance, getTransportManagers, initializeTransportSystem, isEgressProxyError, isFailedStatusCode, isInfoStatusCode, isRequestAbortedError, isSameSiteIssuer, isSuccessStatusCode, isTransportSystemReady, mcpResourceIndicator, parseRequestParameters, probeMcpServer, registerSigningStrategy, serializeHttpResponseError, shutdownTransportSystem, superNormalizeHeaders, translateCustomError };
|
|
1092
|
+
export type { AuthorizationChallenge, AxiosErrorWithRequestMetadata, AxiosErrorWithRetryCount, CertificatesInput, ConcurrencyConfig, CustomErrorConfig, ErrorInterceptor, ErrorMappingFn, HttpHeader, HttpHeaders, HttpMethod, HttpParameters, HttpQueryParamValue, HttpQueryParams, HttpResponse, HttpTransportInstanceConfig, ICacheClient, IHttpClient, IMcpClient, IRequestClient, InitializedTransportManagers, Interceptor, InterceptorConfigs, InterceptorDependencies, InterceptorDependencyInjector, InterceptorManager, Lock, LockEntry, McpCallToolParams, McpCallToolResult, McpClientConfig, McpClientInfo, McpIconFinder, McpListToolsParams, McpListToolsResult, McpOAuthDiscoveryDependencies, McpOAuthDiscoveryOptions, McpSdkDependencies, McpServerInfo, McpServerProbe, McpServerProber, McpToolContentBlock, McpToolDefinition, MemoryStoreConfig, OnFulfilledInterceptors, ProbeDependencies, PruneCount, PubSubListener, QueryArrayFormat, RateLimitConfig, RedisClientConfig, RedisClientType, RequestAbortReason, RequestConfig, RequestContext, RequestInterceptor, RequestInterceptorConfig, RequestInterceptorTuple, RequestParameter, ResponseInterceptor, ResponseInterceptorConfig, ResponseInterceptorTuple, ResponseType, SameSiteIssuerFallback, SigningCredentials, SigningOptions, SigningRequest, SigningStrategy, StreamHttpResponse, TransportInitializationOptions, Unlock };
|