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