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