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