rezo 1.0.4 → 1.0.6
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/README.md +352 -9
- package/dist/adapters/curl.cjs +796 -0
- package/dist/adapters/curl.js +796 -0
- package/dist/adapters/entries/curl.d.ts +2332 -20
- package/dist/adapters/entries/fetch.d.ts +289 -20
- package/dist/adapters/entries/http.d.ts +289 -20
- package/dist/adapters/entries/http2.d.ts +289 -20
- package/dist/adapters/entries/react-native.d.ts +289 -20
- package/dist/adapters/entries/xhr.d.ts +289 -20
- package/dist/adapters/index.cjs +6 -6
- package/dist/adapters/picker.cjs +2 -2
- package/dist/adapters/picker.js +2 -2
- package/dist/cache/index.cjs +13 -13
- package/dist/core/rezo.cjs +2 -2
- package/dist/core/rezo.js +2 -2
- package/dist/crawler.d.ts +291 -22
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +23 -18
- package/dist/index.d.ts +556 -20
- package/dist/index.js +1 -0
- package/dist/platform/browser.d.ts +289 -20
- package/dist/platform/bun.d.ts +289 -20
- package/dist/platform/deno.d.ts +289 -20
- package/dist/platform/node.d.ts +289 -20
- package/dist/platform/react-native.d.ts +289 -20
- package/dist/platform/worker.d.ts +289 -20
- package/dist/plugin/crawler-options.cjs +1 -1
- package/dist/plugin/crawler-options.js +1 -1
- package/dist/plugin/crawler.cjs +2 -2
- package/dist/plugin/crawler.js +2 -2
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +2 -2
- package/dist/proxy/manager.cjs +14 -1
- package/dist/proxy/manager.js +14 -1
- package/dist/queue/http-queue.cjs +313 -0
- package/dist/queue/http-queue.js +312 -0
- package/dist/queue/index.cjs +8 -0
- package/dist/queue/index.js +6 -0
- package/dist/queue/queue.cjs +346 -0
- package/dist/queue/queue.js +344 -0
- package/dist/queue/types.cjs +17 -0
- package/dist/queue/types.js +17 -0
- package/dist/types/curl-options.cjs +25 -0
- package/dist/types/curl-options.js +25 -0
- package/dist/utils/http-config.cjs +0 -15
- package/dist/utils/http-config.js +0 -15
- package/package.json +1 -2
|
@@ -6,9 +6,6 @@ import { Agent as HttpsAgent } from 'node:https';
|
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
7
|
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
|
-
import PQueue from 'p-queue';
|
|
10
|
-
import { Options as Options$1, QueueAddOptions } from 'p-queue';
|
|
11
|
-
import PriorityQueue from 'p-queue/dist/priority-queue';
|
|
12
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
13
10
|
|
|
14
11
|
export interface RezoHttpHeaders {
|
|
@@ -972,8 +969,17 @@ export interface ProxyCooldownConfig {
|
|
|
972
969
|
* Complete configuration for proxy rotation, filtering, and failure handling
|
|
973
970
|
*/
|
|
974
971
|
export interface ProxyManagerBaseConfig {
|
|
975
|
-
/**
|
|
976
|
-
|
|
972
|
+
/**
|
|
973
|
+
* Array of proxies to manage
|
|
974
|
+
* Accepts ProxyInfo objects or proxy URL strings (parsed via parseProxyString)
|
|
975
|
+
* @example
|
|
976
|
+
* proxies: [
|
|
977
|
+
* { protocol: 'http', host: '127.0.0.1', port: 8080 },
|
|
978
|
+
* 'socks5://user:pass@proxy.example.com:1080',
|
|
979
|
+
* 'http://proxy.example.com:3128'
|
|
980
|
+
* ]
|
|
981
|
+
*/
|
|
982
|
+
proxies: (ProxyInfo | string)[];
|
|
977
983
|
/**
|
|
978
984
|
* Whitelist patterns for URLs that should use proxy
|
|
979
985
|
* - String: exact domain match (e.g., 'api.example.com') or subdomain match (e.g., 'example.com' matches '*.example.com')
|
|
@@ -1983,6 +1989,275 @@ export declare class RezoError<T = any> extends Error {
|
|
|
1983
1989
|
toString(): string;
|
|
1984
1990
|
getFullDetails(): string;
|
|
1985
1991
|
}
|
|
1992
|
+
/**
|
|
1993
|
+
* Queue configuration options
|
|
1994
|
+
*/
|
|
1995
|
+
export interface QueueConfig {
|
|
1996
|
+
/** Maximum concurrent tasks (default: Infinity) */
|
|
1997
|
+
concurrency?: number;
|
|
1998
|
+
/** Auto-start processing when tasks are added (default: true) */
|
|
1999
|
+
autoStart?: boolean;
|
|
2000
|
+
/** Timeout per task in milliseconds (default: none) */
|
|
2001
|
+
timeout?: number;
|
|
2002
|
+
/** Throw on timeout vs silently fail (default: true) */
|
|
2003
|
+
throwOnTimeout?: boolean;
|
|
2004
|
+
/** Interval between task starts in ms for rate limiting */
|
|
2005
|
+
interval?: number;
|
|
2006
|
+
/** Max tasks to start per interval (default: Infinity) */
|
|
2007
|
+
intervalCap?: number;
|
|
2008
|
+
/** Carry over unused interval capacity to next interval */
|
|
2009
|
+
carryoverConcurrencyCount?: boolean;
|
|
2010
|
+
}
|
|
2011
|
+
/**
|
|
2012
|
+
* Task options when adding to queue
|
|
2013
|
+
*/
|
|
2014
|
+
export interface TaskOptions {
|
|
2015
|
+
/** Task priority (higher runs first, default: 0) */
|
|
2016
|
+
priority?: number;
|
|
2017
|
+
/** Task-specific timeout (overrides queue default) */
|
|
2018
|
+
timeout?: number;
|
|
2019
|
+
/** Unique ID for tracking/cancellation */
|
|
2020
|
+
id?: string;
|
|
2021
|
+
/** Signal for external cancellation */
|
|
2022
|
+
signal?: AbortSignal;
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* Current queue state
|
|
2026
|
+
*/
|
|
2027
|
+
export interface QueueState {
|
|
2028
|
+
/** Number of tasks currently running */
|
|
2029
|
+
pending: number;
|
|
2030
|
+
/** Number of tasks waiting in queue */
|
|
2031
|
+
size: number;
|
|
2032
|
+
/** Total tasks (pending + size) */
|
|
2033
|
+
total: number;
|
|
2034
|
+
/** Is queue paused */
|
|
2035
|
+
isPaused: boolean;
|
|
2036
|
+
/** Is queue idle (no tasks) */
|
|
2037
|
+
isIdle: boolean;
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Queue statistics
|
|
2041
|
+
*/
|
|
2042
|
+
export interface QueueStats {
|
|
2043
|
+
/** Total tasks added since creation */
|
|
2044
|
+
added: number;
|
|
2045
|
+
/** Total tasks processed (started) */
|
|
2046
|
+
processed: number;
|
|
2047
|
+
/** Total successful completions */
|
|
2048
|
+
completed: number;
|
|
2049
|
+
/** Total failures */
|
|
2050
|
+
failed: number;
|
|
2051
|
+
/** Total timeouts */
|
|
2052
|
+
timedOut: number;
|
|
2053
|
+
/** Total cancellations */
|
|
2054
|
+
cancelled: number;
|
|
2055
|
+
/** Average task duration (ms) */
|
|
2056
|
+
averageDuration: number;
|
|
2057
|
+
/** Tasks per second (rolling average) */
|
|
2058
|
+
throughput: number;
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* Queue event types
|
|
2062
|
+
*/
|
|
2063
|
+
export interface QueueEvents {
|
|
2064
|
+
/** Task added to queue */
|
|
2065
|
+
add: {
|
|
2066
|
+
id: string;
|
|
2067
|
+
priority: number;
|
|
2068
|
+
};
|
|
2069
|
+
/** Task started executing */
|
|
2070
|
+
start: {
|
|
2071
|
+
id: string;
|
|
2072
|
+
};
|
|
2073
|
+
/** Task completed successfully */
|
|
2074
|
+
completed: {
|
|
2075
|
+
id: string;
|
|
2076
|
+
result: any;
|
|
2077
|
+
duration: number;
|
|
2078
|
+
};
|
|
2079
|
+
/** Task failed with error */
|
|
2080
|
+
error: {
|
|
2081
|
+
id: string;
|
|
2082
|
+
error: Error;
|
|
2083
|
+
};
|
|
2084
|
+
/** Task timed out */
|
|
2085
|
+
timeout: {
|
|
2086
|
+
id: string;
|
|
2087
|
+
};
|
|
2088
|
+
/** Task cancelled */
|
|
2089
|
+
cancelled: {
|
|
2090
|
+
id: string;
|
|
2091
|
+
};
|
|
2092
|
+
/** Queue became active (was idle, now processing) */
|
|
2093
|
+
active: undefined;
|
|
2094
|
+
/** Queue became idle (all tasks done) */
|
|
2095
|
+
idle: undefined;
|
|
2096
|
+
/** Queue was paused */
|
|
2097
|
+
paused: undefined;
|
|
2098
|
+
/** Queue was resumed */
|
|
2099
|
+
resumed: undefined;
|
|
2100
|
+
/** Next task about to run */
|
|
2101
|
+
next: undefined;
|
|
2102
|
+
/** Queue was emptied (no pending tasks) */
|
|
2103
|
+
empty: undefined;
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Event handler type
|
|
2107
|
+
*/
|
|
2108
|
+
export type EventHandler<T> = (data: T) => void;
|
|
2109
|
+
/**
|
|
2110
|
+
* Task function type
|
|
2111
|
+
*/
|
|
2112
|
+
export type TaskFunction<T> = () => Promise<T>;
|
|
2113
|
+
declare class RezoQueue<T = any> {
|
|
2114
|
+
private queue;
|
|
2115
|
+
private pendingCount;
|
|
2116
|
+
private isPausedFlag;
|
|
2117
|
+
private intervalId?;
|
|
2118
|
+
private intervalCount;
|
|
2119
|
+
private intervalStart;
|
|
2120
|
+
private eventHandlers;
|
|
2121
|
+
private statsData;
|
|
2122
|
+
private totalDuration;
|
|
2123
|
+
private throughputWindow;
|
|
2124
|
+
private readonly throughputWindowSize;
|
|
2125
|
+
private idlePromise?;
|
|
2126
|
+
private emptyPromise?;
|
|
2127
|
+
readonly config: Required<QueueConfig>;
|
|
2128
|
+
/**
|
|
2129
|
+
* Create a new RezoQueue
|
|
2130
|
+
* @param config - Queue configuration options
|
|
2131
|
+
*/
|
|
2132
|
+
constructor(config?: QueueConfig);
|
|
2133
|
+
/**
|
|
2134
|
+
* Get current queue state
|
|
2135
|
+
*/
|
|
2136
|
+
get state(): QueueState;
|
|
2137
|
+
/**
|
|
2138
|
+
* Get queue statistics
|
|
2139
|
+
*/
|
|
2140
|
+
get stats(): QueueStats;
|
|
2141
|
+
/**
|
|
2142
|
+
* Get/set concurrency limit
|
|
2143
|
+
*/
|
|
2144
|
+
get concurrency(): number;
|
|
2145
|
+
set concurrency(value: number);
|
|
2146
|
+
/**
|
|
2147
|
+
* Number of pending (running) tasks
|
|
2148
|
+
*/
|
|
2149
|
+
get pending(): number;
|
|
2150
|
+
/**
|
|
2151
|
+
* Number of tasks waiting in queue
|
|
2152
|
+
*/
|
|
2153
|
+
get size(): number;
|
|
2154
|
+
/**
|
|
2155
|
+
* Check if queue is paused
|
|
2156
|
+
*/
|
|
2157
|
+
get isPaused(): boolean;
|
|
2158
|
+
/**
|
|
2159
|
+
* Add a task to the queue
|
|
2160
|
+
* @param fn - Async function to execute
|
|
2161
|
+
* @param options - Task options
|
|
2162
|
+
* @returns Promise resolving to task result
|
|
2163
|
+
*/
|
|
2164
|
+
add<R = T>(fn: TaskFunction<R>, options?: TaskOptions): Promise<R>;
|
|
2165
|
+
/**
|
|
2166
|
+
* Add multiple tasks to the queue
|
|
2167
|
+
* @param fns - Array of async functions
|
|
2168
|
+
* @param options - Task options (applied to all)
|
|
2169
|
+
* @returns Promise resolving to array of results
|
|
2170
|
+
*/
|
|
2171
|
+
addAll<R = T>(fns: TaskFunction<R>[], options?: TaskOptions): Promise<R[]>;
|
|
2172
|
+
/**
|
|
2173
|
+
* Pause queue processing (running tasks continue)
|
|
2174
|
+
*/
|
|
2175
|
+
pause(): void;
|
|
2176
|
+
/**
|
|
2177
|
+
* Resume queue processing
|
|
2178
|
+
*/
|
|
2179
|
+
start(): void;
|
|
2180
|
+
/**
|
|
2181
|
+
* Clear all pending tasks from queue
|
|
2182
|
+
*/
|
|
2183
|
+
clear(): void;
|
|
2184
|
+
/**
|
|
2185
|
+
* Cancel a specific task by ID
|
|
2186
|
+
* @param id - Task ID to cancel
|
|
2187
|
+
* @returns true if task was found and cancelled
|
|
2188
|
+
*/
|
|
2189
|
+
cancel(id: string): boolean;
|
|
2190
|
+
/**
|
|
2191
|
+
* Cancel all tasks matching a predicate
|
|
2192
|
+
* @param predicate - Function to test each task
|
|
2193
|
+
* @returns Number of tasks cancelled
|
|
2194
|
+
*/
|
|
2195
|
+
cancelBy(predicate: (task: {
|
|
2196
|
+
id: string;
|
|
2197
|
+
priority: number;
|
|
2198
|
+
}) => boolean): number;
|
|
2199
|
+
/**
|
|
2200
|
+
* Wait for queue to become idle (no running or pending tasks)
|
|
2201
|
+
*/
|
|
2202
|
+
onIdle(): Promise<void>;
|
|
2203
|
+
/**
|
|
2204
|
+
* Wait for queue to be empty (no pending tasks, but may have running)
|
|
2205
|
+
*/
|
|
2206
|
+
onEmpty(): Promise<void>;
|
|
2207
|
+
/**
|
|
2208
|
+
* Wait for queue size to be less than limit
|
|
2209
|
+
* @param limit - Size threshold
|
|
2210
|
+
*/
|
|
2211
|
+
onSizeLessThan(limit: number): Promise<void>;
|
|
2212
|
+
/**
|
|
2213
|
+
* Register an event handler
|
|
2214
|
+
* @param event - Event name
|
|
2215
|
+
* @param handler - Handler function
|
|
2216
|
+
*/
|
|
2217
|
+
on<E extends keyof QueueEvents>(event: E, handler: EventHandler<QueueEvents[E]>): void;
|
|
2218
|
+
/**
|
|
2219
|
+
* Remove an event handler
|
|
2220
|
+
* @param event - Event name
|
|
2221
|
+
* @param handler - Handler function to remove
|
|
2222
|
+
*/
|
|
2223
|
+
off<E extends keyof QueueEvents>(event: E, handler: EventHandler<QueueEvents[E]>): void;
|
|
2224
|
+
/**
|
|
2225
|
+
* Destroy the queue and cleanup resources
|
|
2226
|
+
*/
|
|
2227
|
+
destroy(): void;
|
|
2228
|
+
/**
|
|
2229
|
+
* Insert task into queue maintaining priority order (highest first)
|
|
2230
|
+
*/
|
|
2231
|
+
private insertByPriority;
|
|
2232
|
+
/**
|
|
2233
|
+
* Try to run next task if capacity available
|
|
2234
|
+
*/
|
|
2235
|
+
private tryRunNext;
|
|
2236
|
+
/**
|
|
2237
|
+
* Execute a task
|
|
2238
|
+
*/
|
|
2239
|
+
private runTask;
|
|
2240
|
+
/**
|
|
2241
|
+
* Record task duration for statistics
|
|
2242
|
+
*/
|
|
2243
|
+
private recordDuration;
|
|
2244
|
+
/**
|
|
2245
|
+
* Start interval-based rate limiting
|
|
2246
|
+
*/
|
|
2247
|
+
private startInterval;
|
|
2248
|
+
/**
|
|
2249
|
+
* Emit an event
|
|
2250
|
+
*/
|
|
2251
|
+
protected emit<E extends keyof QueueEvents>(event: E, data: QueueEvents[E]): void;
|
|
2252
|
+
/**
|
|
2253
|
+
* Check if queue became empty
|
|
2254
|
+
*/
|
|
2255
|
+
private checkEmpty;
|
|
2256
|
+
/**
|
|
2257
|
+
* Check if queue became idle
|
|
2258
|
+
*/
|
|
2259
|
+
private checkIdle;
|
|
2260
|
+
}
|
|
1986
2261
|
type ProxyProtocol$1 = "http" | "https" | "socks4" | "socks5";
|
|
1987
2262
|
/**
|
|
1988
2263
|
* Configuration options for proxy connections
|
|
@@ -2104,7 +2379,7 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2104
2379
|
/**
|
|
2105
2380
|
* Queue to use for request execution
|
|
2106
2381
|
*/
|
|
2107
|
-
queue?:
|
|
2382
|
+
queue?: RezoQueue | null;
|
|
2108
2383
|
/**
|
|
2109
2384
|
* Controls how the response body is parsed and returned in `response.data`.
|
|
2110
2385
|
*
|
|
@@ -2194,10 +2469,6 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2194
2469
|
autoSetOrigin?: boolean;
|
|
2195
2470
|
treat302As303?: boolean;
|
|
2196
2471
|
startNewRequest?: boolean;
|
|
2197
|
-
/** Whether to use HTTP/2 protocol */
|
|
2198
|
-
http2?: boolean;
|
|
2199
|
-
/** Whether to use cURL adapter */
|
|
2200
|
-
curl?: boolean;
|
|
2201
2472
|
/**
|
|
2202
2473
|
* DNS cache configuration for faster repeated requests.
|
|
2203
2474
|
*
|
|
@@ -2301,6 +2572,12 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2301
2572
|
withCredentials?: boolean;
|
|
2302
2573
|
/** Proxy configuration (URL string or detailed options) */
|
|
2303
2574
|
proxy?: string | ProxyOptions;
|
|
2575
|
+
/**
|
|
2576
|
+
* Whether to use ProxyManager for this request
|
|
2577
|
+
* Set to false to bypass ProxyManager even when one is configured
|
|
2578
|
+
* @default true (uses ProxyManager if configured)
|
|
2579
|
+
*/
|
|
2580
|
+
useProxyManager?: boolean;
|
|
2304
2581
|
/** Whether to enable automatic cookie handling */
|
|
2305
2582
|
useCookies?: boolean;
|
|
2306
2583
|
/** Custom cookie jar for managing cookies */
|
|
@@ -2322,8 +2599,6 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2322
2599
|
transformRequest?: Array<(data: any, headers: RezoHeaders) => any>;
|
|
2323
2600
|
/** Array of functions to transform response data */
|
|
2324
2601
|
transformResponse?: Array<(data: any) => any>;
|
|
2325
|
-
/** Adapter to use for the request (name or custom function) */
|
|
2326
|
-
adapter?: string | ((config: RezoRequestConfig) => Promise<any>);
|
|
2327
2602
|
/** AbortSignal to cancel the request */
|
|
2328
2603
|
signal?: AbortSignal;
|
|
2329
2604
|
/** File path to save the response to (for downloads) */
|
|
@@ -2688,7 +2963,7 @@ declare class ProxyManager {
|
|
|
2688
2963
|
private runAfterProxyDisableHooks;
|
|
2689
2964
|
private runAfterProxyEnableHooks;
|
|
2690
2965
|
}
|
|
2691
|
-
export type queueOptions =
|
|
2966
|
+
export type queueOptions = QueueConfig;
|
|
2692
2967
|
export interface CacheConfig {
|
|
2693
2968
|
/** Response cache configuration */
|
|
2694
2969
|
response?: boolean | ResponseCacheConfig;
|
|
@@ -2747,10 +3022,6 @@ export interface RezoDefaultOptions {
|
|
|
2747
3022
|
keepAlive?: boolean;
|
|
2748
3023
|
/** Whether to detect and prevent redirect cycles */
|
|
2749
3024
|
enableRedirectCycleDetection?: boolean;
|
|
2750
|
-
/** Whether to use HTTP/2 protocol */
|
|
2751
|
-
http2?: boolean;
|
|
2752
|
-
/** Whether to use cURL adapter */
|
|
2753
|
-
curl?: boolean;
|
|
2754
3025
|
/** Whether to send cookies and authorization headers with cross-origin requests */
|
|
2755
3026
|
withCredentials?: boolean;
|
|
2756
3027
|
/** Proxy configuration (URL string or detailed options) */
|
|
@@ -2789,8 +3060,6 @@ export interface RezoDefaultOptions {
|
|
|
2789
3060
|
transformRequest?: RezoHttpRequest["transformRequest"];
|
|
2790
3061
|
/** Array of functions to transform response data */
|
|
2791
3062
|
transformResponse?: RezoHttpRequest["transformResponse"];
|
|
2792
|
-
/** Adapter to use for the request (name or custom function) */
|
|
2793
|
-
adapter?: RezoHttpRequest["adapter"];
|
|
2794
3063
|
/** Browser simulation configuration for user agent spoofing */
|
|
2795
3064
|
browser?: RezoHttpRequest["browser"];
|
|
2796
3065
|
/** Enable debug logging for the request */
|
|
@@ -3693,7 +3962,7 @@ export type AdapterFunction<T = any> = (options: RezoRequestConfig, defaultOptio
|
|
|
3693
3962
|
* Main Rezo class - Enterprise-grade HTTP client with advanced features
|
|
3694
3963
|
*/
|
|
3695
3964
|
export declare class Rezo {
|
|
3696
|
-
protected queue:
|
|
3965
|
+
protected queue: RezoQueue | null;
|
|
3697
3966
|
protected isQueueEnabled: boolean;
|
|
3698
3967
|
defaults: RezoDefaultOptions;
|
|
3699
3968
|
hooks: RezoHooks;
|
|
@@ -3839,6 +4108,2048 @@ export interface RezoInstance extends Rezo {
|
|
|
3839
4108
|
/** Spread array arguments to callback function (Axios compatibility) */
|
|
3840
4109
|
spread: <T extends unknown[], R>(callback: (...args: T) => R) => (array: T) => R;
|
|
3841
4110
|
}
|
|
4111
|
+
/**
|
|
4112
|
+
* cURL Options Configuration
|
|
4113
|
+
*
|
|
4114
|
+
* Comprehensive type definitions for 100+ cURL command-line options.
|
|
4115
|
+
* These options are ONLY available when using the cURL adapter via:
|
|
4116
|
+
* `import rezo from 'rezo/adapters/curl'`
|
|
4117
|
+
*
|
|
4118
|
+
* @remarks
|
|
4119
|
+
* - Headers, cookies, and body are handled separately via standard Rezo options
|
|
4120
|
+
* - These options map directly to cURL command-line flags
|
|
4121
|
+
* - All time values are in seconds unless otherwise specified
|
|
4122
|
+
* - Options are applied after internal configuration, allowing safe overrides
|
|
4123
|
+
*
|
|
4124
|
+
* @see https://curl.se/docs/manpage.html for complete cURL documentation
|
|
4125
|
+
* @author Yuniq Solutions Team
|
|
4126
|
+
* @version 2.0.0
|
|
4127
|
+
*/
|
|
4128
|
+
/**
|
|
4129
|
+
* IP version preference for cURL connections
|
|
4130
|
+
* @see --ipv4, --ipv6
|
|
4131
|
+
*/
|
|
4132
|
+
export type CurlIpVersion = "v4" | "v6" | "any";
|
|
4133
|
+
/**
|
|
4134
|
+
* SSL/TLS version options
|
|
4135
|
+
* @see --sslv2, --sslv3, --tlsv1, --tlsv1.0, --tlsv1.1, --tlsv1.2, --tlsv1.3
|
|
4136
|
+
*/
|
|
4137
|
+
export type CurlSslVersion = "default" | "tlsv1" | "tlsv1.0" | "tlsv1.1" | "tlsv1.2" | "tlsv1.3" | "sslv2" | "sslv3";
|
|
4138
|
+
/**
|
|
4139
|
+
* HTTP version options for cURL
|
|
4140
|
+
* @see --http1.0, --http1.1, --http2, --http2-prior-knowledge, --http3, --http3-only
|
|
4141
|
+
*/
|
|
4142
|
+
export type CurlHttpVersion = "1.0" | "1.1" | "2" | "2-prior-knowledge" | "3" | "3-only";
|
|
4143
|
+
/**
|
|
4144
|
+
* Authentication methods supported by cURL
|
|
4145
|
+
* @see --basic, --digest, --ntlm, --negotiate, --anyauth
|
|
4146
|
+
*/
|
|
4147
|
+
export type CurlAuthMethod = "basic" | "digest" | "ntlm" | "negotiate" | "bearer" | "aws-sigv4" | "anyauth";
|
|
4148
|
+
/**
|
|
4149
|
+
* Certificate type for TLS
|
|
4150
|
+
* @see --cert-type
|
|
4151
|
+
*/
|
|
4152
|
+
export type CurlCertType = "PEM" | "DER" | "ENG" | "P12";
|
|
4153
|
+
/**
|
|
4154
|
+
* Key type for TLS
|
|
4155
|
+
* @see --key-type
|
|
4156
|
+
*/
|
|
4157
|
+
export type CurlKeyType = "PEM" | "DER" | "ENG";
|
|
4158
|
+
/**
|
|
4159
|
+
* FTP SSL level
|
|
4160
|
+
* @see --ftp-ssl-ccc-mode
|
|
4161
|
+
*/
|
|
4162
|
+
export type CurlFtpSslCccMode = "active" | "passive";
|
|
4163
|
+
/**
|
|
4164
|
+
* FTP file method
|
|
4165
|
+
* @see --ftp-method
|
|
4166
|
+
*/
|
|
4167
|
+
export type CurlFtpMethod = "multicwd" | "nocwd" | "singlecwd";
|
|
4168
|
+
/**
|
|
4169
|
+
* Kerberos/GSS-API delegation level
|
|
4170
|
+
* @see --delegation
|
|
4171
|
+
*/
|
|
4172
|
+
export type CurlDelegation = "none" | "policy" | "always";
|
|
4173
|
+
/**
|
|
4174
|
+
* Retry configuration for cURL requests
|
|
4175
|
+
*/
|
|
4176
|
+
export interface CurlRetryOptions {
|
|
4177
|
+
/**
|
|
4178
|
+
* Number of retry attempts
|
|
4179
|
+
* Maps to: --retry <num>
|
|
4180
|
+
* @default 0
|
|
4181
|
+
*/
|
|
4182
|
+
attempts?: number;
|
|
4183
|
+
/**
|
|
4184
|
+
* Delay between retries in seconds
|
|
4185
|
+
* Maps to: --retry-delay <seconds>
|
|
4186
|
+
* @default 1
|
|
4187
|
+
*/
|
|
4188
|
+
delay?: number;
|
|
4189
|
+
/**
|
|
4190
|
+
* Maximum time in seconds to spend on retries
|
|
4191
|
+
* Maps to: --retry-max-time <seconds>
|
|
4192
|
+
*/
|
|
4193
|
+
maxTime?: number;
|
|
4194
|
+
/**
|
|
4195
|
+
* Retry on all errors (not just transient ones)
|
|
4196
|
+
* Maps to: --retry-all-errors
|
|
4197
|
+
* @default false
|
|
4198
|
+
*/
|
|
4199
|
+
allErrors?: boolean;
|
|
4200
|
+
/**
|
|
4201
|
+
* Retry on connection refused errors
|
|
4202
|
+
* Maps to: --retry-connrefused
|
|
4203
|
+
* @default false
|
|
4204
|
+
*/
|
|
4205
|
+
connRefused?: boolean;
|
|
4206
|
+
}
|
|
4207
|
+
/**
|
|
4208
|
+
* Local port range configuration
|
|
4209
|
+
*/
|
|
4210
|
+
export interface CurlLocalPortRange {
|
|
4211
|
+
/**
|
|
4212
|
+
* Starting port number
|
|
4213
|
+
*/
|
|
4214
|
+
start: number;
|
|
4215
|
+
/**
|
|
4216
|
+
* Ending port number (optional, uses single port if not specified)
|
|
4217
|
+
*/
|
|
4218
|
+
end?: number;
|
|
4219
|
+
}
|
|
4220
|
+
/**
|
|
4221
|
+
* DNS resolve override entry
|
|
4222
|
+
*
|
|
4223
|
+
* @example
|
|
4224
|
+
* // Resolve example.com:443 to specific IP
|
|
4225
|
+
* { host: 'example.com', port: 443, address: '192.168.1.1' }
|
|
4226
|
+
*/
|
|
4227
|
+
export interface CurlResolveEntry {
|
|
4228
|
+
/**
|
|
4229
|
+
* Hostname to override
|
|
4230
|
+
*/
|
|
4231
|
+
host: string;
|
|
4232
|
+
/**
|
|
4233
|
+
* Port number for the override
|
|
4234
|
+
*/
|
|
4235
|
+
port: number;
|
|
4236
|
+
/**
|
|
4237
|
+
* IP address(es) to resolve to (comma-separated for multiple)
|
|
4238
|
+
*/
|
|
4239
|
+
address: string;
|
|
4240
|
+
}
|
|
4241
|
+
/**
|
|
4242
|
+
* Connect-to override entry for routing connections
|
|
4243
|
+
*
|
|
4244
|
+
* @example
|
|
4245
|
+
* // Connect requests for example.com:443 to other.com:8443
|
|
4246
|
+
* { host: 'example.com', port: 443, connectHost: 'other.com', connectPort: 8443 }
|
|
4247
|
+
*/
|
|
4248
|
+
export interface CurlConnectToEntry {
|
|
4249
|
+
/**
|
|
4250
|
+
* Original hostname in the request
|
|
4251
|
+
*/
|
|
4252
|
+
host: string;
|
|
4253
|
+
/**
|
|
4254
|
+
* Original port in the request
|
|
4255
|
+
*/
|
|
4256
|
+
port: number;
|
|
4257
|
+
/**
|
|
4258
|
+
* Target hostname to connect to
|
|
4259
|
+
*/
|
|
4260
|
+
connectHost: string;
|
|
4261
|
+
/**
|
|
4262
|
+
* Target port to connect to
|
|
4263
|
+
*/
|
|
4264
|
+
connectPort: number;
|
|
4265
|
+
}
|
|
4266
|
+
/**
|
|
4267
|
+
* Speed limit configuration for bandwidth throttling
|
|
4268
|
+
*/
|
|
4269
|
+
export interface CurlSpeedLimit {
|
|
4270
|
+
/**
|
|
4271
|
+
* Minimum speed in bytes per second
|
|
4272
|
+
* If speed drops below this for speedTime seconds, transfer aborts
|
|
4273
|
+
* Maps to: --speed-limit <speed>
|
|
4274
|
+
*/
|
|
4275
|
+
limit: number;
|
|
4276
|
+
/**
|
|
4277
|
+
* Time in seconds the speed must stay below limit to abort
|
|
4278
|
+
* Maps to: --speed-time <seconds>
|
|
4279
|
+
* @default 30
|
|
4280
|
+
*/
|
|
4281
|
+
time?: number;
|
|
4282
|
+
}
|
|
4283
|
+
/**
|
|
4284
|
+
* Proxy header configuration
|
|
4285
|
+
* Headers to send only to the proxy (not the final destination)
|
|
4286
|
+
*/
|
|
4287
|
+
export type CurlProxyHeaders = Record<string, string>;
|
|
4288
|
+
/**
|
|
4289
|
+
* Proxy TLS/SSL configuration
|
|
4290
|
+
*/
|
|
4291
|
+
export interface CurlProxyTlsOptions {
|
|
4292
|
+
/**
|
|
4293
|
+
* TLS version for proxy connection
|
|
4294
|
+
* Maps to: --proxy-tlsv1, --proxy-tlsv1.0, etc.
|
|
4295
|
+
*/
|
|
4296
|
+
version?: CurlSslVersion;
|
|
4297
|
+
/**
|
|
4298
|
+
* Path to client certificate for proxy
|
|
4299
|
+
* Maps to: --proxy-cert <cert>
|
|
4300
|
+
*/
|
|
4301
|
+
cert?: string;
|
|
4302
|
+
/**
|
|
4303
|
+
* Path to client key for proxy
|
|
4304
|
+
* Maps to: --proxy-key <key>
|
|
4305
|
+
*/
|
|
4306
|
+
key?: string;
|
|
4307
|
+
/**
|
|
4308
|
+
* Path to CA certificate for proxy verification
|
|
4309
|
+
* Maps to: --proxy-cacert <file>
|
|
4310
|
+
*/
|
|
4311
|
+
cacert?: string;
|
|
4312
|
+
/**
|
|
4313
|
+
* CA path directory for proxy
|
|
4314
|
+
* Maps to: --proxy-capath <dir>
|
|
4315
|
+
*/
|
|
4316
|
+
capath?: string;
|
|
4317
|
+
/**
|
|
4318
|
+
* Skip proxy certificate verification
|
|
4319
|
+
* Maps to: --proxy-insecure
|
|
4320
|
+
* @default false
|
|
4321
|
+
*/
|
|
4322
|
+
insecure?: boolean;
|
|
4323
|
+
/**
|
|
4324
|
+
* Specify proxy certificate type
|
|
4325
|
+
* Maps to: --proxy-cert-type <type>
|
|
4326
|
+
*/
|
|
4327
|
+
certType?: CurlCertType;
|
|
4328
|
+
/**
|
|
4329
|
+
* Specify proxy key type
|
|
4330
|
+
* Maps to: --proxy-key-type <type>
|
|
4331
|
+
*/
|
|
4332
|
+
keyType?: CurlKeyType;
|
|
4333
|
+
/**
|
|
4334
|
+
* Specify proxy key password
|
|
4335
|
+
* Maps to: --proxy-pass <phrase>
|
|
4336
|
+
*/
|
|
4337
|
+
keyPassword?: string;
|
|
4338
|
+
/**
|
|
4339
|
+
* Ciphers for proxy connection
|
|
4340
|
+
* Maps to: --proxy-ciphers <list>
|
|
4341
|
+
*/
|
|
4342
|
+
ciphers?: string;
|
|
4343
|
+
/**
|
|
4344
|
+
* TLS 1.3 ciphers for proxy
|
|
4345
|
+
* Maps to: --proxy-tls13-ciphers <list>
|
|
4346
|
+
*/
|
|
4347
|
+
tls13Ciphers?: string;
|
|
4348
|
+
/**
|
|
4349
|
+
* Pinned public key for proxy
|
|
4350
|
+
* Maps to: --proxy-pinnedpubkey <hashes>
|
|
4351
|
+
*/
|
|
4352
|
+
pinnedPubKey?: string | string[];
|
|
4353
|
+
/**
|
|
4354
|
+
* CRL file for proxy
|
|
4355
|
+
* Maps to: --proxy-crlfile <file>
|
|
4356
|
+
*/
|
|
4357
|
+
crlfile?: string;
|
|
4358
|
+
/**
|
|
4359
|
+
* Check proxy cert status via OCSP
|
|
4360
|
+
* Maps to: --proxy-ssl-allow-beast
|
|
4361
|
+
*/
|
|
4362
|
+
allowBeast?: boolean;
|
|
4363
|
+
/**
|
|
4364
|
+
* Auto client cert for proxy
|
|
4365
|
+
* Maps to: --proxy-ssl-auto-client-cert
|
|
4366
|
+
*/
|
|
4367
|
+
autoClientCert?: boolean;
|
|
4368
|
+
}
|
|
4369
|
+
/**
|
|
4370
|
+
* HSTS (HTTP Strict Transport Security) configuration
|
|
4371
|
+
*/
|
|
4372
|
+
export interface CurlHstsOptions {
|
|
4373
|
+
/**
|
|
4374
|
+
* Path to HSTS cache file
|
|
4375
|
+
* Maps to: --hsts <filename>
|
|
4376
|
+
*/
|
|
4377
|
+
file?: string;
|
|
4378
|
+
}
|
|
4379
|
+
/**
|
|
4380
|
+
* DNS configuration options
|
|
4381
|
+
*/
|
|
4382
|
+
export interface CurlDnsOptions {
|
|
4383
|
+
/**
|
|
4384
|
+
* DNS servers to use (comma-separated)
|
|
4385
|
+
* Maps to: --dns-servers <addresses>
|
|
4386
|
+
* @example '8.8.8.8,8.8.4.4'
|
|
4387
|
+
*/
|
|
4388
|
+
servers?: string;
|
|
4389
|
+
/**
|
|
4390
|
+
* DNS-over-HTTPS URL
|
|
4391
|
+
* Maps to: --doh-url <URL>
|
|
4392
|
+
* @example 'https://dns.google/dns-query'
|
|
4393
|
+
*/
|
|
4394
|
+
dohUrl?: string;
|
|
4395
|
+
/**
|
|
4396
|
+
* Force DNS-over-HTTPS insecure mode
|
|
4397
|
+
* Maps to: --doh-insecure
|
|
4398
|
+
* @default false
|
|
4399
|
+
*/
|
|
4400
|
+
dohInsecure?: boolean;
|
|
4401
|
+
/**
|
|
4402
|
+
* DNS-over-HTTPS using POST
|
|
4403
|
+
* Maps to: --doh-cert-status
|
|
4404
|
+
*/
|
|
4405
|
+
dohCertStatus?: boolean;
|
|
4406
|
+
/**
|
|
4407
|
+
* DNS interface to use
|
|
4408
|
+
* Maps to: --dns-interface <interface>
|
|
4409
|
+
*/
|
|
4410
|
+
interface?: string;
|
|
4411
|
+
/**
|
|
4412
|
+
* Local IPv4 address for DNS
|
|
4413
|
+
* Maps to: --dns-ipv4-addr <address>
|
|
4414
|
+
*/
|
|
4415
|
+
ipv4Addr?: string;
|
|
4416
|
+
/**
|
|
4417
|
+
* Local IPv6 address for DNS
|
|
4418
|
+
* Maps to: --dns-ipv6-addr <address>
|
|
4419
|
+
*/
|
|
4420
|
+
ipv6Addr?: string;
|
|
4421
|
+
}
|
|
4422
|
+
/**
|
|
4423
|
+
* FTP configuration options
|
|
4424
|
+
*/
|
|
4425
|
+
export interface CurlFtpOptions {
|
|
4426
|
+
/**
|
|
4427
|
+
* FTP account data
|
|
4428
|
+
* Maps to: --ftp-account <data>
|
|
4429
|
+
*/
|
|
4430
|
+
account?: string;
|
|
4431
|
+
/**
|
|
4432
|
+
* FTP alternative user
|
|
4433
|
+
* Maps to: --ftp-alternative-to-user <command>
|
|
4434
|
+
*/
|
|
4435
|
+
alternativeToUser?: string;
|
|
4436
|
+
/**
|
|
4437
|
+
* Create missing remote dirs
|
|
4438
|
+
* Maps to: --ftp-create-dirs
|
|
4439
|
+
*/
|
|
4440
|
+
createDirs?: boolean;
|
|
4441
|
+
/**
|
|
4442
|
+
* FTP method to use
|
|
4443
|
+
* Maps to: --ftp-method <method>
|
|
4444
|
+
*/
|
|
4445
|
+
method?: CurlFtpMethod;
|
|
4446
|
+
/**
|
|
4447
|
+
* FTP passive mode
|
|
4448
|
+
* Maps to: --ftp-pasv
|
|
4449
|
+
*/
|
|
4450
|
+
pasv?: boolean;
|
|
4451
|
+
/**
|
|
4452
|
+
* FTP port command
|
|
4453
|
+
* Maps to: --ftp-port <address>
|
|
4454
|
+
*/
|
|
4455
|
+
port?: string;
|
|
4456
|
+
/**
|
|
4457
|
+
* Send PRET before PASV
|
|
4458
|
+
* Maps to: --ftp-pret
|
|
4459
|
+
*/
|
|
4460
|
+
pret?: boolean;
|
|
4461
|
+
/**
|
|
4462
|
+
* Skip PASV IP address
|
|
4463
|
+
* Maps to: --ftp-skip-pasv-ip
|
|
4464
|
+
*/
|
|
4465
|
+
skipPasvIp?: boolean;
|
|
4466
|
+
/**
|
|
4467
|
+
* FTP SSL clear command channel mode
|
|
4468
|
+
* Maps to: --ftp-ssl-ccc-mode <mode>
|
|
4469
|
+
*/
|
|
4470
|
+
sslCccMode?: CurlFtpSslCccMode;
|
|
4471
|
+
/**
|
|
4472
|
+
* Require SSL for control connection
|
|
4473
|
+
* Maps to: --ftp-ssl-control
|
|
4474
|
+
*/
|
|
4475
|
+
sslControl?: boolean;
|
|
4476
|
+
/**
|
|
4477
|
+
* Enable active mode for FTP
|
|
4478
|
+
* Maps to: --ftp-port -
|
|
4479
|
+
*/
|
|
4480
|
+
activeMode?: boolean;
|
|
4481
|
+
/**
|
|
4482
|
+
* Append to remote file
|
|
4483
|
+
* Maps to: --append
|
|
4484
|
+
*/
|
|
4485
|
+
append?: boolean;
|
|
4486
|
+
/**
|
|
4487
|
+
* Use ASCII transfer
|
|
4488
|
+
* Maps to: --use-ascii
|
|
4489
|
+
*/
|
|
4490
|
+
ascii?: boolean;
|
|
4491
|
+
}
|
|
4492
|
+
/**
|
|
4493
|
+
* SSH configuration options
|
|
4494
|
+
*/
|
|
4495
|
+
export interface CurlSshOptions {
|
|
4496
|
+
/**
|
|
4497
|
+
* SSH private key file
|
|
4498
|
+
* Maps to: --key <file>
|
|
4499
|
+
*/
|
|
4500
|
+
privateKey?: string;
|
|
4501
|
+
/**
|
|
4502
|
+
* SSH private key password
|
|
4503
|
+
* Maps to: --pass <phrase>
|
|
4504
|
+
*/
|
|
4505
|
+
privateKeyPassword?: string;
|
|
4506
|
+
/**
|
|
4507
|
+
* SSH public key file
|
|
4508
|
+
* Maps to: --pubkey <file>
|
|
4509
|
+
*/
|
|
4510
|
+
publicKey?: string;
|
|
4511
|
+
/**
|
|
4512
|
+
* SSH host public key SHA256
|
|
4513
|
+
* Maps to: --hostpubsha256 <sha256>
|
|
4514
|
+
*/
|
|
4515
|
+
hostPubSha256?: string;
|
|
4516
|
+
/**
|
|
4517
|
+
* SSH host public key MD5
|
|
4518
|
+
* Maps to: --hostpubmd5 <md5>
|
|
4519
|
+
*/
|
|
4520
|
+
hostPubMd5?: string;
|
|
4521
|
+
/**
|
|
4522
|
+
* Known hosts file
|
|
4523
|
+
* Maps to: --known-hosts <file>
|
|
4524
|
+
*/
|
|
4525
|
+
knownHosts?: string;
|
|
4526
|
+
/**
|
|
4527
|
+
* Enable SSH compression
|
|
4528
|
+
* Maps to: --compressed-ssh
|
|
4529
|
+
*/
|
|
4530
|
+
compression?: boolean;
|
|
4531
|
+
}
|
|
4532
|
+
/**
|
|
4533
|
+
* TLS/SSL configuration options
|
|
4534
|
+
*/
|
|
4535
|
+
export interface CurlTlsOptions {
|
|
4536
|
+
/**
|
|
4537
|
+
* SSL/TLS version to use
|
|
4538
|
+
* Maps to: --sslv2, --sslv3, --tlsv1, --tlsv1.0, etc.
|
|
4539
|
+
*/
|
|
4540
|
+
version?: CurlSslVersion;
|
|
4541
|
+
/**
|
|
4542
|
+
* Minimum TLS version
|
|
4543
|
+
* Maps to: --tls-min <VERSION>
|
|
4544
|
+
*/
|
|
4545
|
+
min?: CurlSslVersion;
|
|
4546
|
+
/**
|
|
4547
|
+
* Maximum TLS version
|
|
4548
|
+
* Maps to: --tls-max <VERSION>
|
|
4549
|
+
*/
|
|
4550
|
+
max?: CurlSslVersion;
|
|
4551
|
+
/**
|
|
4552
|
+
* TLS 1.3 cipher suites
|
|
4553
|
+
* Maps to: --tls13-ciphers <ciphers>
|
|
4554
|
+
*/
|
|
4555
|
+
tls13Ciphers?: string;
|
|
4556
|
+
/**
|
|
4557
|
+
* TLS 1.2 and below cipher suites
|
|
4558
|
+
* Maps to: --ciphers <ciphers>
|
|
4559
|
+
*/
|
|
4560
|
+
ciphers?: string;
|
|
4561
|
+
/**
|
|
4562
|
+
* Pinned public key(s)
|
|
4563
|
+
* Maps to: --pinnedpubkey <hashes>
|
|
4564
|
+
*/
|
|
4565
|
+
pinnedPubKey?: string | string[];
|
|
4566
|
+
/**
|
|
4567
|
+
* Request OCSP stapling
|
|
4568
|
+
* Maps to: --cert-status
|
|
4569
|
+
*/
|
|
4570
|
+
certStatus?: boolean;
|
|
4571
|
+
/**
|
|
4572
|
+
* Certificate Revocation List file
|
|
4573
|
+
* Maps to: --crlfile <file>
|
|
4574
|
+
*/
|
|
4575
|
+
crlfile?: string;
|
|
4576
|
+
/**
|
|
4577
|
+
* Client certificate file
|
|
4578
|
+
* Maps to: --cert <certificate[:password]>
|
|
4579
|
+
*/
|
|
4580
|
+
cert?: string;
|
|
4581
|
+
/**
|
|
4582
|
+
* Client certificate type
|
|
4583
|
+
* Maps to: --cert-type <type>
|
|
4584
|
+
*/
|
|
4585
|
+
certType?: CurlCertType;
|
|
4586
|
+
/**
|
|
4587
|
+
* Client key file
|
|
4588
|
+
* Maps to: --key <key>
|
|
4589
|
+
*/
|
|
4590
|
+
key?: string;
|
|
4591
|
+
/**
|
|
4592
|
+
* Client key type
|
|
4593
|
+
* Maps to: --key-type <type>
|
|
4594
|
+
*/
|
|
4595
|
+
keyType?: CurlKeyType;
|
|
4596
|
+
/**
|
|
4597
|
+
* Client key password
|
|
4598
|
+
* Maps to: --pass <phrase>
|
|
4599
|
+
*/
|
|
4600
|
+
keyPassword?: string;
|
|
4601
|
+
/**
|
|
4602
|
+
* CA certificate bundle file
|
|
4603
|
+
* Maps to: --cacert <file>
|
|
4604
|
+
*/
|
|
4605
|
+
cacert?: string;
|
|
4606
|
+
/**
|
|
4607
|
+
* CA certificate directory
|
|
4608
|
+
* Maps to: --capath <dir>
|
|
4609
|
+
*/
|
|
4610
|
+
capath?: string;
|
|
4611
|
+
/**
|
|
4612
|
+
* Skip certificate verification
|
|
4613
|
+
* Maps to: --insecure, -k
|
|
4614
|
+
*/
|
|
4615
|
+
insecure?: boolean;
|
|
4616
|
+
/**
|
|
4617
|
+
* Use native CA store
|
|
4618
|
+
* Maps to: --ca-native
|
|
4619
|
+
*/
|
|
4620
|
+
caNative?: boolean;
|
|
4621
|
+
/**
|
|
4622
|
+
* Disable SSL session ID reuse
|
|
4623
|
+
* Maps to: --no-sessionid
|
|
4624
|
+
*/
|
|
4625
|
+
noSessionId?: boolean;
|
|
4626
|
+
/**
|
|
4627
|
+
* SSL engine to use
|
|
4628
|
+
* Maps to: --engine <name>
|
|
4629
|
+
*/
|
|
4630
|
+
engine?: string;
|
|
4631
|
+
/**
|
|
4632
|
+
* Random file for SSL
|
|
4633
|
+
* Maps to: --random-file <file>
|
|
4634
|
+
*/
|
|
4635
|
+
randomFile?: string;
|
|
4636
|
+
/**
|
|
4637
|
+
* EGD socket path
|
|
4638
|
+
* Maps to: --egd-file <file>
|
|
4639
|
+
*/
|
|
4640
|
+
egdFile?: string;
|
|
4641
|
+
/**
|
|
4642
|
+
* SSL allow BEAST attack
|
|
4643
|
+
* Maps to: --ssl-allow-beast
|
|
4644
|
+
*/
|
|
4645
|
+
allowBeast?: boolean;
|
|
4646
|
+
/**
|
|
4647
|
+
* SSL no revoke
|
|
4648
|
+
* Maps to: --ssl-no-revoke
|
|
4649
|
+
*/
|
|
4650
|
+
noRevoke?: boolean;
|
|
4651
|
+
/**
|
|
4652
|
+
* SSL revoke best effort
|
|
4653
|
+
* Maps to: --ssl-revoke-best-effort
|
|
4654
|
+
*/
|
|
4655
|
+
revokeBestEffort?: boolean;
|
|
4656
|
+
/**
|
|
4657
|
+
* Auto client certificate
|
|
4658
|
+
* Maps to: --ssl-auto-client-cert
|
|
4659
|
+
*/
|
|
4660
|
+
autoClientCert?: boolean;
|
|
4661
|
+
/**
|
|
4662
|
+
* Force SSL/TLS
|
|
4663
|
+
* Maps to: --ssl
|
|
4664
|
+
*/
|
|
4665
|
+
forceSsl?: boolean;
|
|
4666
|
+
/**
|
|
4667
|
+
* Require SSL/TLS
|
|
4668
|
+
* Maps to: --ssl-reqd
|
|
4669
|
+
*/
|
|
4670
|
+
sslRequired?: boolean;
|
|
4671
|
+
/**
|
|
4672
|
+
* ALPN protocols to offer
|
|
4673
|
+
* Maps to: --alpn <protocols>
|
|
4674
|
+
*/
|
|
4675
|
+
alpn?: string | string[];
|
|
4676
|
+
/**
|
|
4677
|
+
* Disable ALPN
|
|
4678
|
+
* Maps to: --no-alpn
|
|
4679
|
+
*/
|
|
4680
|
+
noAlpn?: boolean;
|
|
4681
|
+
/**
|
|
4682
|
+
* NPN protocols to offer
|
|
4683
|
+
* Maps to: --no-npn
|
|
4684
|
+
*/
|
|
4685
|
+
noNpn?: boolean;
|
|
4686
|
+
/**
|
|
4687
|
+
* False start for TLS
|
|
4688
|
+
* Maps to: --false-start
|
|
4689
|
+
*/
|
|
4690
|
+
falseStart?: boolean;
|
|
4691
|
+
/**
|
|
4692
|
+
* Curves to use for TLS
|
|
4693
|
+
* Maps to: --curves <list>
|
|
4694
|
+
*/
|
|
4695
|
+
curves?: string;
|
|
4696
|
+
/**
|
|
4697
|
+
* ECH config
|
|
4698
|
+
* Maps to: --ech <config>
|
|
4699
|
+
*/
|
|
4700
|
+
ech?: string;
|
|
4701
|
+
}
|
|
4702
|
+
/**
|
|
4703
|
+
* SMTP/Email configuration options
|
|
4704
|
+
*/
|
|
4705
|
+
export interface CurlSmtpOptions {
|
|
4706
|
+
/**
|
|
4707
|
+
* SMTP mail from address
|
|
4708
|
+
* Maps to: --mail-from <address>
|
|
4709
|
+
*/
|
|
4710
|
+
mailFrom?: string;
|
|
4711
|
+
/**
|
|
4712
|
+
* SMTP mail recipients
|
|
4713
|
+
* Maps to: --mail-rcpt <address>
|
|
4714
|
+
*/
|
|
4715
|
+
mailRcpt?: string | string[];
|
|
4716
|
+
/**
|
|
4717
|
+
* Allow SMTP recipient failures
|
|
4718
|
+
* Maps to: --mail-rcpt-allowfails
|
|
4719
|
+
*/
|
|
4720
|
+
mailRcptAllowFails?: boolean;
|
|
4721
|
+
/**
|
|
4722
|
+
* SMTP authentication
|
|
4723
|
+
* Maps to: --mail-auth <address>
|
|
4724
|
+
*/
|
|
4725
|
+
mailAuth?: string;
|
|
4726
|
+
}
|
|
4727
|
+
/**
|
|
4728
|
+
* Telnet options
|
|
4729
|
+
*/
|
|
4730
|
+
export interface CurlTelnetOptions {
|
|
4731
|
+
/**
|
|
4732
|
+
* Telnet option
|
|
4733
|
+
* Maps to: --telnet-option <opt=val>
|
|
4734
|
+
*/
|
|
4735
|
+
options?: Record<string, string>;
|
|
4736
|
+
}
|
|
4737
|
+
/**
|
|
4738
|
+
* Progress/Output configuration
|
|
4739
|
+
*/
|
|
4740
|
+
export interface CurlOutputOptions {
|
|
4741
|
+
/**
|
|
4742
|
+
* Show verbose output
|
|
4743
|
+
* Maps to: --verbose, -v
|
|
4744
|
+
*/
|
|
4745
|
+
verbose?: boolean;
|
|
4746
|
+
/**
|
|
4747
|
+
* Trace file path
|
|
4748
|
+
* Maps to: --trace <file>
|
|
4749
|
+
*/
|
|
4750
|
+
trace?: string;
|
|
4751
|
+
/**
|
|
4752
|
+
* Trace in ASCII format
|
|
4753
|
+
* Maps to: --trace-ascii <file>
|
|
4754
|
+
*/
|
|
4755
|
+
traceAscii?: string;
|
|
4756
|
+
/**
|
|
4757
|
+
* Include timestamp in trace
|
|
4758
|
+
* Maps to: --trace-time
|
|
4759
|
+
*/
|
|
4760
|
+
traceTime?: boolean;
|
|
4761
|
+
/**
|
|
4762
|
+
* Trace ID strings
|
|
4763
|
+
* Maps to: --trace-ids
|
|
4764
|
+
*/
|
|
4765
|
+
traceIds?: boolean;
|
|
4766
|
+
/**
|
|
4767
|
+
* Trace configuration
|
|
4768
|
+
* Maps to: --trace-config <string>
|
|
4769
|
+
*/
|
|
4770
|
+
traceConfig?: string;
|
|
4771
|
+
/**
|
|
4772
|
+
* Dump headers to stderr
|
|
4773
|
+
* Maps to: --dump-header <filename>
|
|
4774
|
+
*/
|
|
4775
|
+
dumpHeader?: string;
|
|
4776
|
+
/**
|
|
4777
|
+
* Progress meter type
|
|
4778
|
+
* Maps to: --progress-bar (bar), --no-progress-meter (none)
|
|
4779
|
+
*/
|
|
4780
|
+
progressMeter?: "bar" | "none" | "default";
|
|
4781
|
+
/**
|
|
4782
|
+
* Styled output
|
|
4783
|
+
* Maps to: --styled-output
|
|
4784
|
+
*/
|
|
4785
|
+
styledOutput?: boolean;
|
|
4786
|
+
}
|
|
4787
|
+
/**
|
|
4788
|
+
* Write-out variables for custom output format
|
|
4789
|
+
*/
|
|
4790
|
+
export interface CurlWriteOut {
|
|
4791
|
+
/**
|
|
4792
|
+
* Write-out format string
|
|
4793
|
+
* Maps to: --write-out <format>
|
|
4794
|
+
* @example '%{http_code}' or '%{time_total}'
|
|
4795
|
+
*/
|
|
4796
|
+
format?: string;
|
|
4797
|
+
/**
|
|
4798
|
+
* Output to file instead of stdout
|
|
4799
|
+
*/
|
|
4800
|
+
file?: string;
|
|
4801
|
+
}
|
|
4802
|
+
/**
|
|
4803
|
+
* AWS Signature Version 4 authentication
|
|
4804
|
+
*/
|
|
4805
|
+
export interface CurlAwsSigV4 {
|
|
4806
|
+
/**
|
|
4807
|
+
* AWS provider
|
|
4808
|
+
* @example 'aws:amz'
|
|
4809
|
+
*/
|
|
4810
|
+
provider: string;
|
|
4811
|
+
/**
|
|
4812
|
+
* AWS region
|
|
4813
|
+
* @example 'us-east-1'
|
|
4814
|
+
*/
|
|
4815
|
+
region: string;
|
|
4816
|
+
/**
|
|
4817
|
+
* AWS service
|
|
4818
|
+
* @example 's3'
|
|
4819
|
+
*/
|
|
4820
|
+
service: string;
|
|
4821
|
+
}
|
|
4822
|
+
/**
|
|
4823
|
+
* Parallel transfer configuration
|
|
4824
|
+
*/
|
|
4825
|
+
export interface CurlParallelOptions {
|
|
4826
|
+
/**
|
|
4827
|
+
* Enable parallel transfers
|
|
4828
|
+
* Maps to: --parallel
|
|
4829
|
+
*/
|
|
4830
|
+
enabled: boolean;
|
|
4831
|
+
/**
|
|
4832
|
+
* Maximum concurrent transfers
|
|
4833
|
+
* Maps to: --parallel-max <num>
|
|
4834
|
+
* @default 50
|
|
4835
|
+
*/
|
|
4836
|
+
max?: number;
|
|
4837
|
+
/**
|
|
4838
|
+
* Start transfers immediately as added
|
|
4839
|
+
* Maps to: --parallel-immediate
|
|
4840
|
+
*/
|
|
4841
|
+
immediate?: boolean;
|
|
4842
|
+
}
|
|
4843
|
+
/**
|
|
4844
|
+
* Comprehensive cURL options configuration (100+ options)
|
|
4845
|
+
*
|
|
4846
|
+
* @remarks
|
|
4847
|
+
* These options provide fine-grained control over cURL behavior.
|
|
4848
|
+
* They are applied after internal options and can override defaults.
|
|
4849
|
+
*
|
|
4850
|
+
* **IMPORTANT**: These options are ONLY available when using the cURL adapter:
|
|
4851
|
+
* ```typescript
|
|
4852
|
+
* import rezo from 'rezo/adapters/curl';
|
|
4853
|
+
* ```
|
|
4854
|
+
*
|
|
4855
|
+
* Options that are handled internally and should NOT be set here:
|
|
4856
|
+
* - Headers (-H) → Use `headers` option
|
|
4857
|
+
* - Cookies (-b, -c) → Use cookie jar or `cookies` option
|
|
4858
|
+
* - Body/Data (-d, --form) → Use `data` or `body` option
|
|
4859
|
+
* - Output files (-o, -O) → Use `saveTo` option
|
|
4860
|
+
* - Include headers (-i) → Always enabled internally
|
|
4861
|
+
* - Write-out format (-w) → Used for stats parsing
|
|
4862
|
+
*
|
|
4863
|
+
* @example
|
|
4864
|
+
* ```typescript
|
|
4865
|
+
* import rezo from 'rezo/adapters/curl';
|
|
4866
|
+
*
|
|
4867
|
+
* // Simple usage
|
|
4868
|
+
* await rezo.get('https://api.example.com/data', {
|
|
4869
|
+
* curl: {
|
|
4870
|
+
* connectTimeout: 10,
|
|
4871
|
+
* maxTime: 300,
|
|
4872
|
+
* limitRate: '500K',
|
|
4873
|
+
* ipVersion: 'v4',
|
|
4874
|
+
* tcpFastOpen: true
|
|
4875
|
+
* }
|
|
4876
|
+
* });
|
|
4877
|
+
*
|
|
4878
|
+
* // Advanced TLS configuration
|
|
4879
|
+
* await rezo.get('https://secure.example.com/api', {
|
|
4880
|
+
* curl: {
|
|
4881
|
+
* tls: {
|
|
4882
|
+
* min: 'tlsv1.2',
|
|
4883
|
+
* tls13Ciphers: 'TLS_AES_256_GCM_SHA384',
|
|
4884
|
+
* certStatus: true,
|
|
4885
|
+
* pinnedPubKey: 'sha256//base64hash='
|
|
4886
|
+
* }
|
|
4887
|
+
* }
|
|
4888
|
+
* });
|
|
4889
|
+
*
|
|
4890
|
+
* // Retry with exponential backoff
|
|
4891
|
+
* await rezo.get('https://unreliable-api.com/data', {
|
|
4892
|
+
* curl: {
|
|
4893
|
+
* retry: {
|
|
4894
|
+
* attempts: 5,
|
|
4895
|
+
* delay: 2,
|
|
4896
|
+
* maxTime: 60,
|
|
4897
|
+
* allErrors: true
|
|
4898
|
+
* }
|
|
4899
|
+
* }
|
|
4900
|
+
* });
|
|
4901
|
+
*
|
|
4902
|
+
* // Custom DNS resolution
|
|
4903
|
+
* await rezo.get('https://api.example.com/data', {
|
|
4904
|
+
* curl: {
|
|
4905
|
+
* resolve: [{ host: 'api.example.com', port: 443, address: '10.0.0.1' }],
|
|
4906
|
+
* dns: {
|
|
4907
|
+
* servers: '8.8.8.8,8.8.4.4',
|
|
4908
|
+
* dohUrl: 'https://dns.google/dns-query'
|
|
4909
|
+
* }
|
|
4910
|
+
* }
|
|
4911
|
+
* });
|
|
4912
|
+
* ```
|
|
4913
|
+
*/
|
|
4914
|
+
export interface CurlOptions {
|
|
4915
|
+
/**
|
|
4916
|
+
* Maximum time in seconds for the connection phase
|
|
4917
|
+
* Maps to: --connect-timeout <seconds>
|
|
4918
|
+
*
|
|
4919
|
+
* @remarks
|
|
4920
|
+
* This is the time allowed for establishing the TCP connection.
|
|
4921
|
+
* Does not include DNS lookup or TLS handshake if separate.
|
|
4922
|
+
*
|
|
4923
|
+
* @example
|
|
4924
|
+
* connectTimeout: 10 // 10 seconds max for connection
|
|
4925
|
+
*/
|
|
4926
|
+
connectTimeout?: number;
|
|
4927
|
+
/**
|
|
4928
|
+
* Maximum time in seconds for the entire operation
|
|
4929
|
+
* Maps to: --max-time <seconds>
|
|
4930
|
+
*
|
|
4931
|
+
* @remarks
|
|
4932
|
+
* This overrides the standard `timeout` option when using cURL adapter.
|
|
4933
|
+
* Includes all phases: DNS, connect, TLS, transfer.
|
|
4934
|
+
*
|
|
4935
|
+
* @example
|
|
4936
|
+
* maxTime: 300 // 5 minutes max for entire request
|
|
4937
|
+
*/
|
|
4938
|
+
maxTime?: number;
|
|
4939
|
+
/**
|
|
4940
|
+
* Time in seconds to wait for 100-continue response
|
|
4941
|
+
* Maps to: --expect100-timeout <seconds>
|
|
4942
|
+
*
|
|
4943
|
+
* @remarks
|
|
4944
|
+
* When sending a request with Expect: 100-continue header,
|
|
4945
|
+
* this is how long to wait for the server's 100 response.
|
|
4946
|
+
*
|
|
4947
|
+
* @default 1
|
|
4948
|
+
*/
|
|
4949
|
+
expect100Timeout?: number;
|
|
4950
|
+
/**
|
|
4951
|
+
* Time in seconds to wait before sending keepalive probes
|
|
4952
|
+
* Maps to: --keepalive-time <seconds>
|
|
4953
|
+
*
|
|
4954
|
+
* @remarks
|
|
4955
|
+
* Sets the TCP keepalive idle time. The connection will send
|
|
4956
|
+
* keepalive probes after this many seconds of inactivity.
|
|
4957
|
+
*
|
|
4958
|
+
* @example
|
|
4959
|
+
* keepaliveTime: 60 // Send keepalive after 60 seconds idle
|
|
4960
|
+
*/
|
|
4961
|
+
keepaliveTime?: number;
|
|
4962
|
+
/**
|
|
4963
|
+
* Interval between keepalive probes in seconds
|
|
4964
|
+
* Maps to: --keepalive-cnt (via environment)
|
|
4965
|
+
*/
|
|
4966
|
+
keepaliveInterval?: number;
|
|
4967
|
+
/**
|
|
4968
|
+
* Number of keepalive probes before giving up
|
|
4969
|
+
* Maps to: configuration
|
|
4970
|
+
*/
|
|
4971
|
+
keepaliveCnt?: number;
|
|
4972
|
+
/**
|
|
4973
|
+
* Disable keepalive on the connection
|
|
4974
|
+
* Maps to: --no-keepalive
|
|
4975
|
+
*
|
|
4976
|
+
* @default false
|
|
4977
|
+
*/
|
|
4978
|
+
noKeepalive?: boolean;
|
|
4979
|
+
/**
|
|
4980
|
+
* Enable TCP Fast Open
|
|
4981
|
+
* Maps to: --tcp-fastopen
|
|
4982
|
+
*
|
|
4983
|
+
* @remarks
|
|
4984
|
+
* Enables TCP Fast Open (TFO) which can reduce connection latency
|
|
4985
|
+
* by sending data in the SYN packet. Requires OS and server support.
|
|
4986
|
+
*
|
|
4987
|
+
* @default false
|
|
4988
|
+
*/
|
|
4989
|
+
tcpFastOpen?: boolean;
|
|
4990
|
+
/**
|
|
4991
|
+
* Disable TCP Nagle algorithm
|
|
4992
|
+
* Maps to: --tcp-nodelay
|
|
4993
|
+
*
|
|
4994
|
+
* @remarks
|
|
4995
|
+
* Disables Nagle's algorithm which can reduce latency for small packets
|
|
4996
|
+
* at the cost of slightly increased network traffic.
|
|
4997
|
+
*
|
|
4998
|
+
* @default false (Nagle enabled)
|
|
4999
|
+
*/
|
|
5000
|
+
tcpNodelay?: boolean;
|
|
5001
|
+
/**
|
|
5002
|
+
* Connection idle timeout in seconds
|
|
5003
|
+
* Maps to: --keepalive-time for connection reuse
|
|
5004
|
+
*/
|
|
5005
|
+
idleTimeout?: number;
|
|
5006
|
+
/**
|
|
5007
|
+
* Maximum connection time per host
|
|
5008
|
+
* Maps to: --connect-to for routing
|
|
5009
|
+
*/
|
|
5010
|
+
maxHostConnections?: number;
|
|
5011
|
+
/**
|
|
5012
|
+
* Maximum total connections
|
|
5013
|
+
* Maps to: environment configuration
|
|
5014
|
+
*/
|
|
5015
|
+
maxTotalConnections?: number;
|
|
5016
|
+
/**
|
|
5017
|
+
* Maximum transfer rate (bandwidth limit)
|
|
5018
|
+
* Maps to: --limit-rate <speed>
|
|
5019
|
+
*
|
|
5020
|
+
* @remarks
|
|
5021
|
+
* Limits the transfer speed. Can use suffixes:
|
|
5022
|
+
* - K or k: Kilobytes
|
|
5023
|
+
* - M or m: Megabytes
|
|
5024
|
+
* - G or g: Gigabytes
|
|
5025
|
+
*
|
|
5026
|
+
* @example
|
|
5027
|
+
* limitRate: '100K' // Limit to 100 KB/s
|
|
5028
|
+
* limitRate: '1M' // Limit to 1 MB/s
|
|
5029
|
+
* limitRate: '500' // Limit to 500 bytes/s
|
|
5030
|
+
*/
|
|
5031
|
+
limitRate?: string;
|
|
5032
|
+
/**
|
|
5033
|
+
* Speed limit configuration for abort threshold
|
|
5034
|
+
*
|
|
5035
|
+
* @remarks
|
|
5036
|
+
* If transfer speed drops below the limit for the specified time,
|
|
5037
|
+
* the transfer will be aborted. Useful for detecting stalled transfers.
|
|
5038
|
+
*
|
|
5039
|
+
* @example
|
|
5040
|
+
* speedLimit: { limit: 1000, time: 30 } // Abort if <1KB/s for 30 seconds
|
|
5041
|
+
*/
|
|
5042
|
+
speedLimit?: CurlSpeedLimit;
|
|
5043
|
+
/**
|
|
5044
|
+
* Maximum number of redirects to follow
|
|
5045
|
+
* Maps to: --max-redirs <num>
|
|
5046
|
+
*
|
|
5047
|
+
* @default 50
|
|
5048
|
+
*/
|
|
5049
|
+
maxRedirs?: number;
|
|
5050
|
+
/**
|
|
5051
|
+
* Maximum response size in bytes
|
|
5052
|
+
* Maps to: --max-filesize <bytes>
|
|
5053
|
+
*/
|
|
5054
|
+
maxFilesize?: number;
|
|
5055
|
+
/**
|
|
5056
|
+
* Retry configuration for failed requests
|
|
5057
|
+
*
|
|
5058
|
+
* @remarks
|
|
5059
|
+
* By default, cURL only retries on transient errors (timeouts, etc).
|
|
5060
|
+
* Use `allErrors: true` to retry on all errors including HTTP errors.
|
|
5061
|
+
*
|
|
5062
|
+
* @example
|
|
5063
|
+
* retry: { attempts: 3, delay: 2, allErrors: true }
|
|
5064
|
+
*/
|
|
5065
|
+
retry?: CurlRetryOptions;
|
|
5066
|
+
/**
|
|
5067
|
+
* Network interface to use for the request
|
|
5068
|
+
* Maps to: --interface <name>
|
|
5069
|
+
*
|
|
5070
|
+
* @remarks
|
|
5071
|
+
* Specifies which network interface to use. Can be interface name,
|
|
5072
|
+
* IP address, or hostname.
|
|
5073
|
+
*
|
|
5074
|
+
* @example
|
|
5075
|
+
* interface: 'eth0'
|
|
5076
|
+
* interface: '192.168.1.100'
|
|
5077
|
+
*/
|
|
5078
|
+
interface?: string;
|
|
5079
|
+
/**
|
|
5080
|
+
* Local IP address to use for outgoing connection
|
|
5081
|
+
* Maps to: --local-address <address>
|
|
5082
|
+
*
|
|
5083
|
+
* @remarks
|
|
5084
|
+
* Binds the local end of the connection to this IP address.
|
|
5085
|
+
* Useful on multi-homed systems.
|
|
5086
|
+
*
|
|
5087
|
+
* @example
|
|
5088
|
+
* localAddress: '192.168.1.100'
|
|
5089
|
+
*/
|
|
5090
|
+
localAddress?: string;
|
|
5091
|
+
/**
|
|
5092
|
+
* Local port or port range to use
|
|
5093
|
+
* Maps to: --local-port <num>[-num]
|
|
5094
|
+
*
|
|
5095
|
+
* @remarks
|
|
5096
|
+
* Forces cURL to use a specific local port or port range.
|
|
5097
|
+
* Useful for firewall configurations.
|
|
5098
|
+
*
|
|
5099
|
+
* @example
|
|
5100
|
+
* localPort: 45000
|
|
5101
|
+
* localPort: { start: 45000, end: 45100 }
|
|
5102
|
+
*/
|
|
5103
|
+
localPort?: number | CurlLocalPortRange;
|
|
5104
|
+
/**
|
|
5105
|
+
* IP version preference
|
|
5106
|
+
* Maps to: --ipv4 (v4), --ipv6 (v6), or default (any)
|
|
5107
|
+
*
|
|
5108
|
+
* @remarks
|
|
5109
|
+
* Forces cURL to resolve names to IPv4 or IPv6 addresses only.
|
|
5110
|
+
*
|
|
5111
|
+
* @example
|
|
5112
|
+
* ipVersion: 'v4' // Force IPv4 only
|
|
5113
|
+
*/
|
|
5114
|
+
ipVersion?: CurlIpVersion;
|
|
5115
|
+
/**
|
|
5116
|
+
* DNS resolve overrides
|
|
5117
|
+
* Maps to: --resolve <host:port:address>
|
|
5118
|
+
*
|
|
5119
|
+
* @remarks
|
|
5120
|
+
* Provides custom DNS resolution, bypassing the system resolver.
|
|
5121
|
+
* Useful for testing or accessing services on specific IPs.
|
|
5122
|
+
*
|
|
5123
|
+
* @example
|
|
5124
|
+
* resolve: [{ host: 'example.com', port: 443, address: '192.168.1.1' }]
|
|
5125
|
+
* resolve: ['example.com:443:192.168.1.1']
|
|
5126
|
+
*/
|
|
5127
|
+
resolve?: Array<CurlResolveEntry | string>;
|
|
5128
|
+
/**
|
|
5129
|
+
* Connect-to overrides for routing
|
|
5130
|
+
* Maps to: --connect-to <host:port:connect-host:connect-port>
|
|
5131
|
+
*
|
|
5132
|
+
* @remarks
|
|
5133
|
+
* Routes connections to different host:port than specified in URL.
|
|
5134
|
+
* Unlike resolve, this also changes the Host header.
|
|
5135
|
+
*
|
|
5136
|
+
* @example
|
|
5137
|
+
* connectTo: [{ host: 'example.com', port: 443, connectHost: 'backend.local', connectPort: 8443 }]
|
|
5138
|
+
* connectTo: ['example.com:443:backend.local:8443']
|
|
5139
|
+
*/
|
|
5140
|
+
connectTo?: Array<CurlConnectToEntry | string>;
|
|
5141
|
+
/**
|
|
5142
|
+
* Hosts to bypass proxy for
|
|
5143
|
+
* Maps to: --noproxy <hosts>
|
|
5144
|
+
*
|
|
5145
|
+
* @remarks
|
|
5146
|
+
* Comma-separated list of hosts that should not go through proxy.
|
|
5147
|
+
* Supports wildcards like *.example.com
|
|
5148
|
+
*
|
|
5149
|
+
* @example
|
|
5150
|
+
* noProxy: 'localhost,127.0.0.1,*.internal.com'
|
|
5151
|
+
* noProxy: ['localhost', '127.0.0.1', '*.internal.com']
|
|
5152
|
+
*/
|
|
5153
|
+
noProxy?: string | string[];
|
|
5154
|
+
/**
|
|
5155
|
+
* Unix domain socket to use
|
|
5156
|
+
* Maps to: --unix-socket <path>
|
|
5157
|
+
*
|
|
5158
|
+
* @remarks
|
|
5159
|
+
* Connects via Unix domain socket instead of TCP.
|
|
5160
|
+
* Useful for Docker API, local services, etc.
|
|
5161
|
+
*
|
|
5162
|
+
* @example
|
|
5163
|
+
* unixSocket: '/var/run/docker.sock'
|
|
5164
|
+
*/
|
|
5165
|
+
unixSocket?: string;
|
|
5166
|
+
/**
|
|
5167
|
+
* Abstract Unix domain socket (Linux only)
|
|
5168
|
+
* Maps to: --abstract-unix-socket <path>
|
|
5169
|
+
*
|
|
5170
|
+
* @remarks
|
|
5171
|
+
* Like unixSocket but for abstract namespace sockets (prefixed with @)
|
|
5172
|
+
*/
|
|
5173
|
+
abstractUnixSocket?: string;
|
|
5174
|
+
/**
|
|
5175
|
+
* Happy Eyeballs timeout in milliseconds
|
|
5176
|
+
* Maps to: --happy-eyeballs-timeout-ms <ms>
|
|
5177
|
+
*
|
|
5178
|
+
* @remarks
|
|
5179
|
+
* Time to wait for IPv6 before falling back to IPv4.
|
|
5180
|
+
* Set to 0 to disable Happy Eyeballs.
|
|
5181
|
+
*
|
|
5182
|
+
* @default 200
|
|
5183
|
+
*/
|
|
5184
|
+
happyEyeballsTimeout?: number;
|
|
5185
|
+
/**
|
|
5186
|
+
* Network namespace to use (Linux)
|
|
5187
|
+
* Maps to: --netns <name>
|
|
5188
|
+
*/
|
|
5189
|
+
netns?: string;
|
|
5190
|
+
/**
|
|
5191
|
+
* Disable TCP's use of PMTU discovery
|
|
5192
|
+
* Maps to: --disable-epsv
|
|
5193
|
+
*/
|
|
5194
|
+
disablePmtu?: boolean;
|
|
5195
|
+
/**
|
|
5196
|
+
* Force using a new connection
|
|
5197
|
+
* Maps to: --no-connection
|
|
5198
|
+
*/
|
|
5199
|
+
forceNewConnection?: boolean;
|
|
5200
|
+
/**
|
|
5201
|
+
* SOCKSv5 hostname resolution
|
|
5202
|
+
* Maps to: --socks5-hostname
|
|
5203
|
+
*/
|
|
5204
|
+
socks5ResolveLocal?: boolean;
|
|
5205
|
+
/**
|
|
5206
|
+
* Disable session reuse on proxied connections
|
|
5207
|
+
* Maps to: --suppress-connect-headers
|
|
5208
|
+
*/
|
|
5209
|
+
suppressConnectHeaders?: boolean;
|
|
5210
|
+
/**
|
|
5211
|
+
* HTTP version to use
|
|
5212
|
+
* Maps to: --http1.0, --http1.1, --http2, --http2-prior-knowledge, --http3, --http3-only
|
|
5213
|
+
*
|
|
5214
|
+
* @remarks
|
|
5215
|
+
* - '1.0': Force HTTP/1.0
|
|
5216
|
+
* - '1.1': Force HTTP/1.1
|
|
5217
|
+
* - '2': Use HTTP/2 if available (with HTTP/1.1 fallback)
|
|
5218
|
+
* - '2-prior-knowledge': HTTP/2 without upgrade (for known HTTP/2 servers)
|
|
5219
|
+
* - '3': Use HTTP/3 if available
|
|
5220
|
+
* - '3-only': Force HTTP/3 only
|
|
5221
|
+
*
|
|
5222
|
+
* @example
|
|
5223
|
+
* httpVersion: '2' // Prefer HTTP/2
|
|
5224
|
+
*/
|
|
5225
|
+
httpVersion?: CurlHttpVersion;
|
|
5226
|
+
/**
|
|
5227
|
+
* Use HTTP/0.9 if server sends it
|
|
5228
|
+
* Maps to: --http0.9
|
|
5229
|
+
*/
|
|
5230
|
+
http09?: boolean;
|
|
5231
|
+
/**
|
|
5232
|
+
* Path-as-is: don't squash .. and . in URL path
|
|
5233
|
+
* Maps to: --path-as-is
|
|
5234
|
+
*
|
|
5235
|
+
* @remarks
|
|
5236
|
+
* Prevents cURL from normalizing the URL path.
|
|
5237
|
+
* Useful for APIs that require exact paths.
|
|
5238
|
+
*
|
|
5239
|
+
* @default false
|
|
5240
|
+
*/
|
|
5241
|
+
pathAsIs?: boolean;
|
|
5242
|
+
/**
|
|
5243
|
+
* Request target to use instead of path from URL
|
|
5244
|
+
* Maps to: --request-target <target>
|
|
5245
|
+
*
|
|
5246
|
+
* @remarks
|
|
5247
|
+
* Overrides the request target (path) in the request line.
|
|
5248
|
+
* Advanced feature for proxy requests.
|
|
5249
|
+
*/
|
|
5250
|
+
requestTarget?: string;
|
|
5251
|
+
/**
|
|
5252
|
+
* Disable URL globbing
|
|
5253
|
+
* Maps to: --globoff
|
|
5254
|
+
*
|
|
5255
|
+
* @remarks
|
|
5256
|
+
* Prevents cURL from interpreting {}, [] in URLs as glob patterns.
|
|
5257
|
+
*
|
|
5258
|
+
* @default false
|
|
5259
|
+
*/
|
|
5260
|
+
globOff?: boolean;
|
|
5261
|
+
/**
|
|
5262
|
+
* Disable buffering of the output stream
|
|
5263
|
+
* Maps to: --no-buffer
|
|
5264
|
+
*/
|
|
5265
|
+
noBuffer?: boolean;
|
|
5266
|
+
/**
|
|
5267
|
+
* Do not use a username in the URL
|
|
5268
|
+
* Maps to: --disallow-username-in-url
|
|
5269
|
+
*/
|
|
5270
|
+
disallowUsernameInUrl?: boolean;
|
|
5271
|
+
/**
|
|
5272
|
+
* Strip credentials from referrer URL
|
|
5273
|
+
* Maps to: --strip-credentials
|
|
5274
|
+
*/
|
|
5275
|
+
stripCredentials?: boolean;
|
|
5276
|
+
/**
|
|
5277
|
+
* Use GET request after redirect (legacy)
|
|
5278
|
+
* Maps to: --post301, --post302, --post303
|
|
5279
|
+
*/
|
|
5280
|
+
postRedirect?: 301 | 302 | 303 | boolean;
|
|
5281
|
+
/**
|
|
5282
|
+
* Referer URL to use
|
|
5283
|
+
* Maps to: --referer <URL>
|
|
5284
|
+
*/
|
|
5285
|
+
referer?: string;
|
|
5286
|
+
/**
|
|
5287
|
+
* Automatic referer on redirect
|
|
5288
|
+
* Maps to: --referer ";auto"
|
|
5289
|
+
*/
|
|
5290
|
+
autoReferer?: boolean;
|
|
5291
|
+
/**
|
|
5292
|
+
* SSL/TLS version to use
|
|
5293
|
+
* Maps to: --sslv2, --sslv3, --tlsv1, --tlsv1.0, --tlsv1.1, --tlsv1.2, --tlsv1.3
|
|
5294
|
+
*
|
|
5295
|
+
* @deprecated Use `tls.version` instead
|
|
5296
|
+
* @remarks
|
|
5297
|
+
* Forces a specific TLS version. Use with caution as older
|
|
5298
|
+
* versions have security vulnerabilities.
|
|
5299
|
+
*
|
|
5300
|
+
* @example
|
|
5301
|
+
* sslVersion: 'tlsv1.2' // Force TLS 1.2
|
|
5302
|
+
*/
|
|
5303
|
+
sslVersion?: CurlSslVersion;
|
|
5304
|
+
/**
|
|
5305
|
+
* Minimum TLS version
|
|
5306
|
+
* Maps to: --tls-min <VERSION>
|
|
5307
|
+
*
|
|
5308
|
+
* @deprecated Use `tls.min` instead
|
|
5309
|
+
* @remarks
|
|
5310
|
+
* Sets the minimum acceptable TLS version for the connection.
|
|
5311
|
+
* Recommended: 'tlsv1.2' or higher.
|
|
5312
|
+
*
|
|
5313
|
+
* @example
|
|
5314
|
+
* tlsMin: 'tlsv1.2' // Require at least TLS 1.2
|
|
5315
|
+
*/
|
|
5316
|
+
tlsMin?: CurlSslVersion;
|
|
5317
|
+
/**
|
|
5318
|
+
* Maximum TLS version
|
|
5319
|
+
* Maps to: --tls-max <VERSION>
|
|
5320
|
+
*
|
|
5321
|
+
* @deprecated Use `tls.max` instead
|
|
5322
|
+
* @remarks
|
|
5323
|
+
* Sets the maximum TLS version. Rarely needed, mainly for testing.
|
|
5324
|
+
*/
|
|
5325
|
+
tlsMax?: CurlSslVersion;
|
|
5326
|
+
/**
|
|
5327
|
+
* TLS 1.3 cipher suites
|
|
5328
|
+
* Maps to: --tls13-ciphers <ciphers>
|
|
5329
|
+
*
|
|
5330
|
+
* @deprecated Use `tls.tls13Ciphers` instead
|
|
5331
|
+
* @remarks
|
|
5332
|
+
* Colon-separated list of TLS 1.3 cipher suites.
|
|
5333
|
+
*
|
|
5334
|
+
* @example
|
|
5335
|
+
* tls13Ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256'
|
|
5336
|
+
*/
|
|
5337
|
+
tls13Ciphers?: string;
|
|
5338
|
+
/**
|
|
5339
|
+
* TLS 1.2 and below cipher suites
|
|
5340
|
+
* Maps to: --ciphers <ciphers>
|
|
5341
|
+
*
|
|
5342
|
+
* @deprecated Use `tls.ciphers` instead
|
|
5343
|
+
* @remarks
|
|
5344
|
+
* OpenSSL cipher list for TLS 1.2 and earlier.
|
|
5345
|
+
*
|
|
5346
|
+
* @example
|
|
5347
|
+
* ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256'
|
|
5348
|
+
*/
|
|
5349
|
+
ciphers?: string;
|
|
5350
|
+
/**
|
|
5351
|
+
* Pinned public key(s) for certificate validation
|
|
5352
|
+
* Maps to: --pinnedpubkey <hashes>
|
|
5353
|
+
*
|
|
5354
|
+
* @deprecated Use `tls.pinnedPubKey` instead
|
|
5355
|
+
* @remarks
|
|
5356
|
+
* SHA256 hash(es) of the public key to pin against.
|
|
5357
|
+
* Provides additional security against certificate substitution.
|
|
5358
|
+
*
|
|
5359
|
+
* @example
|
|
5360
|
+
* pinnedPubKey: 'sha256//base64hash='
|
|
5361
|
+
* pinnedPubKey: ['sha256//hash1=', 'sha256//hash2=']
|
|
5362
|
+
*/
|
|
5363
|
+
pinnedPubKey?: string | string[];
|
|
5364
|
+
/**
|
|
5365
|
+
* Request OCSP stapling for certificate status
|
|
5366
|
+
* Maps to: --cert-status
|
|
5367
|
+
*
|
|
5368
|
+
* @deprecated Use `tls.certStatus` instead
|
|
5369
|
+
* @remarks
|
|
5370
|
+
* Asks the server to provide OCSP stapling for certificate revocation check.
|
|
5371
|
+
*
|
|
5372
|
+
* @default false
|
|
5373
|
+
*/
|
|
5374
|
+
certStatus?: boolean;
|
|
5375
|
+
/**
|
|
5376
|
+
* Path to Certificate Revocation List file
|
|
5377
|
+
* Maps to: --crlfile <file>
|
|
5378
|
+
*
|
|
5379
|
+
* @deprecated Use `tls.crlfile` instead
|
|
5380
|
+
* @remarks
|
|
5381
|
+
* PEM file containing Certificate Revocation Lists for validation.
|
|
5382
|
+
*/
|
|
5383
|
+
crlfile?: string;
|
|
5384
|
+
/**
|
|
5385
|
+
* ALPN protocols to offer
|
|
5386
|
+
* Maps to: --alpn <protocols>
|
|
5387
|
+
*
|
|
5388
|
+
* @deprecated Use `tls.alpn` instead
|
|
5389
|
+
* @remarks
|
|
5390
|
+
* Application-Layer Protocol Negotiation protocols to offer.
|
|
5391
|
+
* Comma-separated or array of protocol names.
|
|
5392
|
+
*
|
|
5393
|
+
* @example
|
|
5394
|
+
* alpn: ['h2', 'http/1.1']
|
|
5395
|
+
* alpn: 'h2,http/1.1'
|
|
5396
|
+
*/
|
|
5397
|
+
alpn?: string | string[];
|
|
5398
|
+
/**
|
|
5399
|
+
* Disable ALPN negotiation
|
|
5400
|
+
* Maps to: --no-alpn
|
|
5401
|
+
*
|
|
5402
|
+
* @deprecated Use `tls.noAlpn` instead
|
|
5403
|
+
* @default false
|
|
5404
|
+
*/
|
|
5405
|
+
noAlpn?: boolean;
|
|
5406
|
+
/**
|
|
5407
|
+
* SSL session ID reuse control
|
|
5408
|
+
* Maps to: --no-sessionid (when false)
|
|
5409
|
+
*
|
|
5410
|
+
* @deprecated Use `tls.noSessionId` instead
|
|
5411
|
+
* @remarks
|
|
5412
|
+
* Disable SSL session ID caching. Normally sessions are reused
|
|
5413
|
+
* for performance.
|
|
5414
|
+
*
|
|
5415
|
+
* @default true
|
|
5416
|
+
*/
|
|
5417
|
+
sessionId?: boolean;
|
|
5418
|
+
/**
|
|
5419
|
+
* SSL Engine to use
|
|
5420
|
+
* Maps to: --engine <name>
|
|
5421
|
+
*
|
|
5422
|
+
* @deprecated Use `tls.engine` instead
|
|
5423
|
+
* @remarks
|
|
5424
|
+
* Crypto engine to use for SSL operations.
|
|
5425
|
+
*/
|
|
5426
|
+
engine?: string;
|
|
5427
|
+
/**
|
|
5428
|
+
* Custom CA path (directory of certificates)
|
|
5429
|
+
* Maps to: --capath <dir>
|
|
5430
|
+
*
|
|
5431
|
+
* @deprecated Use `tls.capath` instead
|
|
5432
|
+
* @remarks
|
|
5433
|
+
* Directory containing CA certificates in PEM format.
|
|
5434
|
+
* Certificates must be named by their hash values.
|
|
5435
|
+
*/
|
|
5436
|
+
capath?: string;
|
|
5437
|
+
/**
|
|
5438
|
+
* Enable certificate type specification
|
|
5439
|
+
* Maps to: --cert-type <type>
|
|
5440
|
+
*
|
|
5441
|
+
* @deprecated Use `tls.certType` instead
|
|
5442
|
+
* @remarks
|
|
5443
|
+
* Specify certificate type: PEM, DER, ENG, P12.
|
|
5444
|
+
*
|
|
5445
|
+
* @default 'PEM'
|
|
5446
|
+
*/
|
|
5447
|
+
certType?: CurlCertType;
|
|
5448
|
+
/**
|
|
5449
|
+
* Key type specification
|
|
5450
|
+
* Maps to: --key-type <type>
|
|
5451
|
+
*
|
|
5452
|
+
* @deprecated Use `tls.keyType` instead
|
|
5453
|
+
* @remarks
|
|
5454
|
+
* Specify key type: PEM, DER, ENG.
|
|
5455
|
+
*
|
|
5456
|
+
* @default 'PEM'
|
|
5457
|
+
*/
|
|
5458
|
+
keyType?: CurlKeyType;
|
|
5459
|
+
/**
|
|
5460
|
+
* Skip TLS certificate verification (insecure)
|
|
5461
|
+
* Maps to: --insecure, -k
|
|
5462
|
+
*
|
|
5463
|
+
* @remarks
|
|
5464
|
+
* Allows connections to TLS sites without valid certificates.
|
|
5465
|
+
* WARNING: Only use for development/testing. Never in production!
|
|
5466
|
+
*
|
|
5467
|
+
* @default false
|
|
5468
|
+
*/
|
|
5469
|
+
insecure?: boolean;
|
|
5470
|
+
/**
|
|
5471
|
+
* Comprehensive TLS/SSL configuration object
|
|
5472
|
+
*
|
|
5473
|
+
* @remarks
|
|
5474
|
+
* Preferred way to configure TLS settings. Individual TLS properties
|
|
5475
|
+
* on CurlOptions are deprecated in favor of this object.
|
|
5476
|
+
*
|
|
5477
|
+
* @example
|
|
5478
|
+
* tls: {
|
|
5479
|
+
* min: 'tlsv1.2',
|
|
5480
|
+
* tls13Ciphers: 'TLS_AES_256_GCM_SHA384',
|
|
5481
|
+
* certStatus: true,
|
|
5482
|
+
* cert: '/path/to/client.crt',
|
|
5483
|
+
* key: '/path/to/client.key',
|
|
5484
|
+
* cacert: '/path/to/ca-bundle.crt'
|
|
5485
|
+
* }
|
|
5486
|
+
*/
|
|
5487
|
+
tls?: CurlTlsOptions;
|
|
5488
|
+
/**
|
|
5489
|
+
* Headers to send to the proxy only
|
|
5490
|
+
* Maps to: --proxy-header <header>
|
|
5491
|
+
*
|
|
5492
|
+
* @remarks
|
|
5493
|
+
* These headers are sent only to the proxy, not to the final destination.
|
|
5494
|
+
* Useful for proxy authentication or identification.
|
|
5495
|
+
*
|
|
5496
|
+
* @example
|
|
5497
|
+
* proxyHeaders: { 'X-Proxy-Auth': 'token123' }
|
|
5498
|
+
*/
|
|
5499
|
+
proxyHeaders?: CurlProxyHeaders;
|
|
5500
|
+
/**
|
|
5501
|
+
* Proxy TLS/SSL configuration
|
|
5502
|
+
*
|
|
5503
|
+
* @remarks
|
|
5504
|
+
* Separate TLS settings for the connection to the proxy itself.
|
|
5505
|
+
* Useful when proxy requires client certificates or specific TLS version.
|
|
5506
|
+
*
|
|
5507
|
+
* @example
|
|
5508
|
+
* proxyTls: { version: 'tlsv1.2', insecure: false }
|
|
5509
|
+
*/
|
|
5510
|
+
proxyTls?: CurlProxyTlsOptions;
|
|
5511
|
+
/**
|
|
5512
|
+
* Pre-proxy to use
|
|
5513
|
+
* Maps to: --preproxy <[protocol://]host[:port]>
|
|
5514
|
+
*
|
|
5515
|
+
* @remarks
|
|
5516
|
+
* Proxy to use before connecting to the main proxy.
|
|
5517
|
+
* Useful for proxy chains.
|
|
5518
|
+
*/
|
|
5519
|
+
preProxy?: string;
|
|
5520
|
+
/**
|
|
5521
|
+
* SOCKS5 with GSSAPI
|
|
5522
|
+
* Maps to: --socks5-gssapi
|
|
5523
|
+
*/
|
|
5524
|
+
socks5Gssapi?: boolean;
|
|
5525
|
+
/**
|
|
5526
|
+
* SOCKS5 GSSAPI service name
|
|
5527
|
+
* Maps to: --socks5-gssapi-service <name>
|
|
5528
|
+
*/
|
|
5529
|
+
socks5GssapiService?: string;
|
|
5530
|
+
/**
|
|
5531
|
+
* SOCKS5 GSSAPI NEC mode
|
|
5532
|
+
* Maps to: --socks5-gssapi-nec
|
|
5533
|
+
*/
|
|
5534
|
+
socks5GssapiNec?: boolean;
|
|
5535
|
+
/**
|
|
5536
|
+
* Use HTTP/1.0 for CONNECT tunneling
|
|
5537
|
+
* Maps to: --proxy1.0
|
|
5538
|
+
*/
|
|
5539
|
+
proxyHttp10?: boolean;
|
|
5540
|
+
/**
|
|
5541
|
+
* Use HTTP digest auth with proxy
|
|
5542
|
+
* Maps to: --proxy-digest
|
|
5543
|
+
*/
|
|
5544
|
+
proxyDigest?: boolean;
|
|
5545
|
+
/**
|
|
5546
|
+
* Use HTTP basic auth with proxy
|
|
5547
|
+
* Maps to: --proxy-basic
|
|
5548
|
+
*/
|
|
5549
|
+
proxyBasic?: boolean;
|
|
5550
|
+
/**
|
|
5551
|
+
* Use NTLM auth with proxy
|
|
5552
|
+
* Maps to: --proxy-ntlm
|
|
5553
|
+
*/
|
|
5554
|
+
proxyNtlm?: boolean;
|
|
5555
|
+
/**
|
|
5556
|
+
* Use Negotiate auth with proxy
|
|
5557
|
+
* Maps to: --proxy-negotiate
|
|
5558
|
+
*/
|
|
5559
|
+
proxyNegotiate?: boolean;
|
|
5560
|
+
/**
|
|
5561
|
+
* Use any auth with proxy
|
|
5562
|
+
* Maps to: --proxy-anyauth
|
|
5563
|
+
*/
|
|
5564
|
+
proxyAnyAuth?: boolean;
|
|
5565
|
+
/**
|
|
5566
|
+
* Proxy service name
|
|
5567
|
+
* Maps to: --proxy-service-name <name>
|
|
5568
|
+
*/
|
|
5569
|
+
proxyServiceName?: string;
|
|
5570
|
+
/**
|
|
5571
|
+
* Tunnel through HTTP proxy
|
|
5572
|
+
* Maps to: --proxytunnel
|
|
5573
|
+
*/
|
|
5574
|
+
proxyTunnel?: boolean;
|
|
5575
|
+
/**
|
|
5576
|
+
* Haproxy client IP
|
|
5577
|
+
* Maps to: --haproxy-clientip <ip>
|
|
5578
|
+
*/
|
|
5579
|
+
haproxyClientIp?: string;
|
|
5580
|
+
/**
|
|
5581
|
+
* Haproxy protocol
|
|
5582
|
+
* Maps to: --haproxy-protocol
|
|
5583
|
+
*/
|
|
5584
|
+
haproxyProtocol?: boolean;
|
|
5585
|
+
/**
|
|
5586
|
+
* DNS configuration
|
|
5587
|
+
*
|
|
5588
|
+
* @remarks
|
|
5589
|
+
* Advanced DNS settings including custom servers, DNS-over-HTTPS,
|
|
5590
|
+
* and interface bindings.
|
|
5591
|
+
*
|
|
5592
|
+
* @example
|
|
5593
|
+
* dns: {
|
|
5594
|
+
* servers: '8.8.8.8,8.8.4.4',
|
|
5595
|
+
* dohUrl: 'https://dns.google/dns-query'
|
|
5596
|
+
* }
|
|
5597
|
+
*/
|
|
5598
|
+
dns?: CurlDnsOptions;
|
|
5599
|
+
/**
|
|
5600
|
+
* HSTS configuration
|
|
5601
|
+
* Maps to: --hsts <filename>
|
|
5602
|
+
*/
|
|
5603
|
+
hsts?: CurlHstsOptions;
|
|
5604
|
+
/**
|
|
5605
|
+
* Alt-Svc cache file
|
|
5606
|
+
* Maps to: --alt-svc <filename>
|
|
5607
|
+
*
|
|
5608
|
+
* @remarks
|
|
5609
|
+
* File to read/write Alt-Svc cache for HTTP/3 upgrades.
|
|
5610
|
+
*/
|
|
5611
|
+
altSvc?: string;
|
|
5612
|
+
/**
|
|
5613
|
+
* Disable Alt-Svc
|
|
5614
|
+
* Maps to: --no-alt-svc
|
|
5615
|
+
*
|
|
5616
|
+
* @default false
|
|
5617
|
+
*/
|
|
5618
|
+
noAltSvc?: boolean;
|
|
5619
|
+
/**
|
|
5620
|
+
* Trust credentials on redirect
|
|
5621
|
+
* Maps to: --location-trusted
|
|
5622
|
+
*
|
|
5623
|
+
* @remarks
|
|
5624
|
+
* Send authentication credentials to hosts after redirect.
|
|
5625
|
+
* Use with caution for security reasons.
|
|
5626
|
+
*
|
|
5627
|
+
* @default false
|
|
5628
|
+
*/
|
|
5629
|
+
locationTrusted?: boolean;
|
|
5630
|
+
/**
|
|
5631
|
+
* Discard session cookies on redirect
|
|
5632
|
+
* Maps to: --junk-session-cookies
|
|
5633
|
+
*
|
|
5634
|
+
* @default false
|
|
5635
|
+
*/
|
|
5636
|
+
junkSessionCookies?: boolean;
|
|
5637
|
+
/**
|
|
5638
|
+
* Fail silently on HTTP errors
|
|
5639
|
+
* Maps to: --fail
|
|
5640
|
+
*
|
|
5641
|
+
* @remarks
|
|
5642
|
+
* Exit with error code 22 if server returns error (4xx, 5xx).
|
|
5643
|
+
* Suppresses error page output.
|
|
5644
|
+
*
|
|
5645
|
+
* @default false
|
|
5646
|
+
*/
|
|
5647
|
+
fail?: boolean;
|
|
5648
|
+
/**
|
|
5649
|
+
* Fail early on first error
|
|
5650
|
+
* Maps to: --fail-early
|
|
5651
|
+
*/
|
|
5652
|
+
failEarly?: boolean;
|
|
5653
|
+
/**
|
|
5654
|
+
* Fail with body on HTTP errors
|
|
5655
|
+
* Maps to: --fail-with-body
|
|
5656
|
+
*/
|
|
5657
|
+
failWithBody?: boolean;
|
|
5658
|
+
/**
|
|
5659
|
+
* Enable verbose output
|
|
5660
|
+
* Maps to: --verbose, -v
|
|
5661
|
+
*
|
|
5662
|
+
* @remarks
|
|
5663
|
+
* Shows detailed request/response information including headers
|
|
5664
|
+
* and connection details. Useful for debugging.
|
|
5665
|
+
*
|
|
5666
|
+
* @default false
|
|
5667
|
+
*/
|
|
5668
|
+
verbose?: boolean;
|
|
5669
|
+
/**
|
|
5670
|
+
* Trace file path
|
|
5671
|
+
* Maps to: --trace <file>
|
|
5672
|
+
*
|
|
5673
|
+
* @remarks
|
|
5674
|
+
* Write full trace including binary data to file.
|
|
5675
|
+
* More detailed than verbose.
|
|
5676
|
+
*/
|
|
5677
|
+
trace?: string;
|
|
5678
|
+
/**
|
|
5679
|
+
* Trace ASCII file
|
|
5680
|
+
* Maps to: --trace-ascii <file>
|
|
5681
|
+
*
|
|
5682
|
+
* @remarks
|
|
5683
|
+
* Like trace but without hex dump of binary data.
|
|
5684
|
+
*/
|
|
5685
|
+
traceAscii?: string;
|
|
5686
|
+
/**
|
|
5687
|
+
* Include timestamp in trace output
|
|
5688
|
+
* Maps to: --trace-time
|
|
5689
|
+
*
|
|
5690
|
+
* @default false
|
|
5691
|
+
*/
|
|
5692
|
+
traceTime?: boolean;
|
|
5693
|
+
/**
|
|
5694
|
+
* Include transfer IDs in trace
|
|
5695
|
+
* Maps to: --trace-ids
|
|
5696
|
+
*/
|
|
5697
|
+
traceIds?: boolean;
|
|
5698
|
+
/**
|
|
5699
|
+
* Trace configuration
|
|
5700
|
+
* Maps to: --trace-config <string>
|
|
5701
|
+
*/
|
|
5702
|
+
traceConfig?: string;
|
|
5703
|
+
/**
|
|
5704
|
+
* Raw output (disable content decoding)
|
|
5705
|
+
* Maps to: --raw
|
|
5706
|
+
*
|
|
5707
|
+
* @default false
|
|
5708
|
+
*/
|
|
5709
|
+
raw?: boolean;
|
|
5710
|
+
/**
|
|
5711
|
+
* Disable compression for response
|
|
5712
|
+
* Maps to: (internal - removes --compressed)
|
|
5713
|
+
*
|
|
5714
|
+
* @default false
|
|
5715
|
+
*/
|
|
5716
|
+
noCompressed?: boolean;
|
|
5717
|
+
/**
|
|
5718
|
+
* Buffer size for receive
|
|
5719
|
+
* Maps to: --buffer-size <size>
|
|
5720
|
+
*
|
|
5721
|
+
* @remarks
|
|
5722
|
+
* Maximum receive buffer size with suffix (K, M).
|
|
5723
|
+
*
|
|
5724
|
+
* @example
|
|
5725
|
+
* bufferSize: '1M'
|
|
5726
|
+
*/
|
|
5727
|
+
bufferSize?: string;
|
|
5728
|
+
/**
|
|
5729
|
+
* Styled output
|
|
5730
|
+
* Maps to: --styled-output
|
|
5731
|
+
*/
|
|
5732
|
+
styledOutput?: boolean;
|
|
5733
|
+
/**
|
|
5734
|
+
* Dump header to file
|
|
5735
|
+
* Maps to: --dump-header <filename>
|
|
5736
|
+
*/
|
|
5737
|
+
dumpHeader?: string;
|
|
5738
|
+
/**
|
|
5739
|
+
* Progress meter type
|
|
5740
|
+
* Maps to: --progress-bar, --no-progress-meter
|
|
5741
|
+
*/
|
|
5742
|
+
progressMeter?: "bar" | "none" | "default";
|
|
5743
|
+
/**
|
|
5744
|
+
* Write-out format
|
|
5745
|
+
* Maps to: --write-out <format>
|
|
5746
|
+
*/
|
|
5747
|
+
writeOut?: string | CurlWriteOut;
|
|
5748
|
+
/**
|
|
5749
|
+
* Output configuration
|
|
5750
|
+
* Comprehensive output/debugging settings
|
|
5751
|
+
*/
|
|
5752
|
+
output?: CurlOutputOptions;
|
|
5753
|
+
/**
|
|
5754
|
+
* Use netrc file for credentials
|
|
5755
|
+
* Maps to: --netrc, --netrc-optional, --netrc-file <filename>
|
|
5756
|
+
*
|
|
5757
|
+
* @remarks
|
|
5758
|
+
* - true: Use ~/.netrc (fail if not found)
|
|
5759
|
+
* - 'optional': Use ~/.netrc (don't fail if not found)
|
|
5760
|
+
* - string: Path to custom netrc file
|
|
5761
|
+
*/
|
|
5762
|
+
netrc?: boolean | "optional" | string;
|
|
5763
|
+
/**
|
|
5764
|
+
* Delegation level for GSS-API/Kerberos
|
|
5765
|
+
* Maps to: --delegation <level>
|
|
5766
|
+
*
|
|
5767
|
+
* @remarks
|
|
5768
|
+
* Controls credential delegation in GSS-API.
|
|
5769
|
+
* - 'none': No delegation
|
|
5770
|
+
* - 'policy': Delegate if OK according to policy
|
|
5771
|
+
* - 'always': Always delegate
|
|
5772
|
+
*/
|
|
5773
|
+
delegation?: CurlDelegation;
|
|
5774
|
+
/**
|
|
5775
|
+
* Service name for SPNEGO
|
|
5776
|
+
* Maps to: --service-name <name>
|
|
5777
|
+
*
|
|
5778
|
+
* @remarks
|
|
5779
|
+
* Override the default service name for SPNEGO authentication.
|
|
5780
|
+
*/
|
|
5781
|
+
serviceName?: string;
|
|
5782
|
+
/**
|
|
5783
|
+
* Negotiate authentication
|
|
5784
|
+
* Maps to: --negotiate
|
|
5785
|
+
*
|
|
5786
|
+
* @remarks
|
|
5787
|
+
* Enable SPNEGO/Negotiate authentication (Kerberos, NTLM).
|
|
5788
|
+
*
|
|
5789
|
+
* @default false
|
|
5790
|
+
*/
|
|
5791
|
+
negotiate?: boolean;
|
|
5792
|
+
/**
|
|
5793
|
+
* NTLM authentication with winbind
|
|
5794
|
+
* Maps to: --ntlm-wb
|
|
5795
|
+
*/
|
|
5796
|
+
ntlmWb?: boolean;
|
|
5797
|
+
/**
|
|
5798
|
+
* SASL IR (Initial Response)
|
|
5799
|
+
* Maps to: --sasl-ir
|
|
5800
|
+
*
|
|
5801
|
+
* @remarks
|
|
5802
|
+
* Enable SASL initial response for protocols that support it.
|
|
5803
|
+
*
|
|
5804
|
+
* @default false
|
|
5805
|
+
*/
|
|
5806
|
+
saslIr?: boolean;
|
|
5807
|
+
/**
|
|
5808
|
+
* SASL authentication mechanism
|
|
5809
|
+
* Maps to: --sasl-authzid <identity>
|
|
5810
|
+
*/
|
|
5811
|
+
saslAuthzid?: string;
|
|
5812
|
+
/**
|
|
5813
|
+
* AWS Signature Version 4 authentication
|
|
5814
|
+
* Maps to: --aws-sigv4 <provider1[:provider2[:region[:service]]]>
|
|
5815
|
+
*
|
|
5816
|
+
* @example
|
|
5817
|
+
* awsSigv4: { provider: 'aws:amz', region: 'us-east-1', service: 's3' }
|
|
5818
|
+
* awsSigv4: 'aws:amz:us-east-1:s3'
|
|
5819
|
+
*/
|
|
5820
|
+
awsSigv4?: string | CurlAwsSigV4;
|
|
5821
|
+
/**
|
|
5822
|
+
* OAuth 2.0 bearer token
|
|
5823
|
+
* Maps to: --oauth2-bearer <token>
|
|
5824
|
+
*/
|
|
5825
|
+
oauth2Bearer?: string;
|
|
5826
|
+
/**
|
|
5827
|
+
* Login options
|
|
5828
|
+
* Maps to: --login-options <options>
|
|
5829
|
+
*/
|
|
5830
|
+
loginOptions?: string;
|
|
5831
|
+
/**
|
|
5832
|
+
* Kerberos authentication level
|
|
5833
|
+
* Maps to: --krb <level>
|
|
5834
|
+
*/
|
|
5835
|
+
kerberos?: "clear" | "safe" | "confidential" | "private";
|
|
5836
|
+
/**
|
|
5837
|
+
* XOAUTH2 bearer token
|
|
5838
|
+
* Maps to: --xoauth2-bearer <token>
|
|
5839
|
+
*/
|
|
5840
|
+
xoauth2Bearer?: string;
|
|
5841
|
+
/**
|
|
5842
|
+
* Digest authentication
|
|
5843
|
+
* Maps to: --digest
|
|
5844
|
+
*/
|
|
5845
|
+
digest?: boolean;
|
|
5846
|
+
/**
|
|
5847
|
+
* Basic authentication
|
|
5848
|
+
* Maps to: --basic
|
|
5849
|
+
*/
|
|
5850
|
+
basic?: boolean;
|
|
5851
|
+
/**
|
|
5852
|
+
* Any authentication method
|
|
5853
|
+
* Maps to: --anyauth
|
|
5854
|
+
*/
|
|
5855
|
+
anyAuth?: boolean;
|
|
5856
|
+
/**
|
|
5857
|
+
* FTP configuration
|
|
5858
|
+
*
|
|
5859
|
+
* @example
|
|
5860
|
+
* ftp: {
|
|
5861
|
+
* createDirs: true,
|
|
5862
|
+
* pasv: true,
|
|
5863
|
+
* method: 'singlecwd'
|
|
5864
|
+
* }
|
|
5865
|
+
*/
|
|
5866
|
+
ftp?: CurlFtpOptions;
|
|
5867
|
+
/**
|
|
5868
|
+
* Use EPRT command for active mode
|
|
5869
|
+
* Maps to: --disable-eprt
|
|
5870
|
+
*/
|
|
5871
|
+
disableEprt?: boolean;
|
|
5872
|
+
/**
|
|
5873
|
+
* Use EPSV command for passive mode
|
|
5874
|
+
* Maps to: --disable-epsv
|
|
5875
|
+
*/
|
|
5876
|
+
disableEpsv?: boolean;
|
|
5877
|
+
/**
|
|
5878
|
+
* Quote commands
|
|
5879
|
+
* Maps to: --quote <command>
|
|
5880
|
+
*/
|
|
5881
|
+
quote?: string | string[];
|
|
5882
|
+
/**
|
|
5883
|
+
* Pre-transfer quote commands
|
|
5884
|
+
* Maps to: --prequote <command>
|
|
5885
|
+
*/
|
|
5886
|
+
prequote?: string | string[];
|
|
5887
|
+
/**
|
|
5888
|
+
* Post-transfer quote commands
|
|
5889
|
+
* Maps to: --postquote <command>
|
|
5890
|
+
*/
|
|
5891
|
+
postquote?: string | string[];
|
|
5892
|
+
/**
|
|
5893
|
+
* Continue at offset
|
|
5894
|
+
* Maps to: --continue-at <offset>
|
|
5895
|
+
*/
|
|
5896
|
+
continueAt?: number | "-";
|
|
5897
|
+
/**
|
|
5898
|
+
* CRLF conversion
|
|
5899
|
+
* Maps to: --crlf
|
|
5900
|
+
*/
|
|
5901
|
+
crlf?: boolean;
|
|
5902
|
+
/**
|
|
5903
|
+
* Range request
|
|
5904
|
+
* Maps to: --range <range>
|
|
5905
|
+
*/
|
|
5906
|
+
range?: string;
|
|
5907
|
+
/**
|
|
5908
|
+
* Remove file after download
|
|
5909
|
+
* Maps to: --remote-header-name
|
|
5910
|
+
*/
|
|
5911
|
+
remoteHeaderName?: boolean;
|
|
5912
|
+
/**
|
|
5913
|
+
* Request compression
|
|
5914
|
+
* Maps to: --tr-encoding
|
|
5915
|
+
*/
|
|
5916
|
+
trEncoding?: boolean;
|
|
5917
|
+
/**
|
|
5918
|
+
* Ignore content length
|
|
5919
|
+
* Maps to: --ignore-content-length
|
|
5920
|
+
*/
|
|
5921
|
+
ignoreContentLength?: boolean;
|
|
5922
|
+
/**
|
|
5923
|
+
* SSH configuration
|
|
5924
|
+
*
|
|
5925
|
+
* @example
|
|
5926
|
+
* ssh: {
|
|
5927
|
+
* privateKey: '/path/to/key',
|
|
5928
|
+
* knownHosts: '/path/to/known_hosts',
|
|
5929
|
+
* compression: true
|
|
5930
|
+
* }
|
|
5931
|
+
*/
|
|
5932
|
+
ssh?: CurlSshOptions;
|
|
5933
|
+
/**
|
|
5934
|
+
* Enable compressed SSH protocols
|
|
5935
|
+
* Maps to: --compressed-ssh
|
|
5936
|
+
*
|
|
5937
|
+
* @deprecated Use `ssh.compression` instead
|
|
5938
|
+
* @remarks
|
|
5939
|
+
* Enable compression for SSH connections (SCP, SFTP).
|
|
5940
|
+
*
|
|
5941
|
+
* @default false
|
|
5942
|
+
*/
|
|
5943
|
+
compressedSsh?: boolean;
|
|
5944
|
+
/**
|
|
5945
|
+
* SMTP configuration
|
|
5946
|
+
*
|
|
5947
|
+
* @example
|
|
5948
|
+
* smtp: {
|
|
5949
|
+
* mailFrom: 'sender@example.com',
|
|
5950
|
+
* mailRcpt: ['recipient@example.com']
|
|
5951
|
+
* }
|
|
5952
|
+
*/
|
|
5953
|
+
smtp?: CurlSmtpOptions;
|
|
5954
|
+
/**
|
|
5955
|
+
* Telnet configuration
|
|
5956
|
+
*/
|
|
5957
|
+
telnet?: CurlTelnetOptions;
|
|
5958
|
+
/**
|
|
5959
|
+
* TFTP block size
|
|
5960
|
+
* Maps to: --tftp-blksize <value>
|
|
5961
|
+
*/
|
|
5962
|
+
tftpBlksize?: number;
|
|
5963
|
+
/**
|
|
5964
|
+
* TFTP no options
|
|
5965
|
+
* Maps to: --tftp-no-options
|
|
5966
|
+
*/
|
|
5967
|
+
tftpNoOptions?: boolean;
|
|
5968
|
+
/**
|
|
5969
|
+
* Parallel transfer configuration (for multiple URLs)
|
|
5970
|
+
* Maps to: --parallel, --parallel-max, --parallel-immediate
|
|
5971
|
+
*
|
|
5972
|
+
* @remarks
|
|
5973
|
+
* Only applicable when making multiple requests.
|
|
5974
|
+
*/
|
|
5975
|
+
parallel?: CurlParallelOptions;
|
|
5976
|
+
/**
|
|
5977
|
+
* Time condition for request
|
|
5978
|
+
* Maps to: --time-cond <time>
|
|
5979
|
+
*/
|
|
5980
|
+
timeCond?: string | Date;
|
|
5981
|
+
/**
|
|
5982
|
+
* Create required local dirs
|
|
5983
|
+
* Maps to: --create-dirs
|
|
5984
|
+
*/
|
|
5985
|
+
createDirs?: boolean;
|
|
5986
|
+
/**
|
|
5987
|
+
* Create required remote dirs
|
|
5988
|
+
* Maps to: --ftp-create-dirs
|
|
5989
|
+
*/
|
|
5990
|
+
createRemoteDirs?: boolean;
|
|
5991
|
+
/**
|
|
5992
|
+
* Request compressed transfer encoding
|
|
5993
|
+
* Maps to: --compressed
|
|
5994
|
+
*/
|
|
5995
|
+
compressed?: boolean;
|
|
5996
|
+
/**
|
|
5997
|
+
* Use file for config
|
|
5998
|
+
* Maps to: --config <file>
|
|
5999
|
+
*/
|
|
6000
|
+
configFile?: string;
|
|
6001
|
+
/**
|
|
6002
|
+
* Disable config file
|
|
6003
|
+
* Maps to: --disable
|
|
6004
|
+
*/
|
|
6005
|
+
disableConfig?: boolean;
|
|
6006
|
+
/**
|
|
6007
|
+
* Disable environment variable use
|
|
6008
|
+
* Maps to: --disable-env
|
|
6009
|
+
*/
|
|
6010
|
+
disableEnv?: boolean;
|
|
6011
|
+
/**
|
|
6012
|
+
* Engine list
|
|
6013
|
+
* Maps to: --engine list
|
|
6014
|
+
*/
|
|
6015
|
+
engineList?: boolean;
|
|
6016
|
+
/**
|
|
6017
|
+
* Form escape
|
|
6018
|
+
* Maps to: --form-escape
|
|
6019
|
+
*/
|
|
6020
|
+
formEscape?: boolean;
|
|
6021
|
+
/**
|
|
6022
|
+
* Form string
|
|
6023
|
+
* Maps to: --form-string <name=string>
|
|
6024
|
+
*/
|
|
6025
|
+
formString?: Record<string, string>;
|
|
6026
|
+
/**
|
|
6027
|
+
* Globoff for URLs
|
|
6028
|
+
* Maps to: --globoff
|
|
6029
|
+
*/
|
|
6030
|
+
globoff?: boolean;
|
|
6031
|
+
/**
|
|
6032
|
+
* Data binary
|
|
6033
|
+
* Maps to: --data-binary <data>
|
|
6034
|
+
*/
|
|
6035
|
+
dataBinary?: string | Buffer;
|
|
6036
|
+
/**
|
|
6037
|
+
* Data raw
|
|
6038
|
+
* Maps to: --data-raw <data>
|
|
6039
|
+
*/
|
|
6040
|
+
dataRaw?: string;
|
|
6041
|
+
/**
|
|
6042
|
+
* Data URL encode
|
|
6043
|
+
* Maps to: --data-urlencode <data>
|
|
6044
|
+
*/
|
|
6045
|
+
dataUrlencode?: string | Record<string, string>;
|
|
6046
|
+
/**
|
|
6047
|
+
* JSON data
|
|
6048
|
+
* Maps to: --json <data>
|
|
6049
|
+
*/
|
|
6050
|
+
json?: string | Record<string, unknown>;
|
|
6051
|
+
/**
|
|
6052
|
+
* URL encode
|
|
6053
|
+
* Maps to: --url-query <data>
|
|
6054
|
+
*/
|
|
6055
|
+
urlQuery?: string | Record<string, string>;
|
|
6056
|
+
/**
|
|
6057
|
+
* Variable
|
|
6058
|
+
* Maps to: --variable <name=value>
|
|
6059
|
+
*/
|
|
6060
|
+
variable?: Record<string, string>;
|
|
6061
|
+
/**
|
|
6062
|
+
* Expand variables in URL
|
|
6063
|
+
* Maps to: --expand-url
|
|
6064
|
+
*/
|
|
6065
|
+
expandUrl?: boolean;
|
|
6066
|
+
/**
|
|
6067
|
+
* MIME type for content
|
|
6068
|
+
* Maps to: used with multipart
|
|
6069
|
+
*/
|
|
6070
|
+
mimeType?: string;
|
|
6071
|
+
/**
|
|
6072
|
+
* Remote time
|
|
6073
|
+
* Maps to: --remote-time
|
|
6074
|
+
*/
|
|
6075
|
+
remoteTime?: boolean;
|
|
6076
|
+
/**
|
|
6077
|
+
* Output directory
|
|
6078
|
+
* Maps to: --output-dir <dir>
|
|
6079
|
+
*/
|
|
6080
|
+
outputDir?: string;
|
|
6081
|
+
/**
|
|
6082
|
+
* Xattr
|
|
6083
|
+
* Maps to: --xattr
|
|
6084
|
+
*/
|
|
6085
|
+
xattr?: boolean;
|
|
6086
|
+
/**
|
|
6087
|
+
* ECH config list
|
|
6088
|
+
* Maps to: --ech <config>
|
|
6089
|
+
*/
|
|
6090
|
+
ech?: string;
|
|
6091
|
+
}
|
|
6092
|
+
/**
|
|
6093
|
+
* Extended request configuration for cURL adapter
|
|
6094
|
+
*
|
|
6095
|
+
* @remarks
|
|
6096
|
+
* This type extends the base RezoRequestConfig with cURL-specific options.
|
|
6097
|
+
* It is ONLY available when importing from `rezo/adapters/curl`.
|
|
6098
|
+
*
|
|
6099
|
+
* @example
|
|
6100
|
+
* ```typescript
|
|
6101
|
+
* import rezo, { CurlRequestConfig } from 'rezo/adapters/curl';
|
|
6102
|
+
*
|
|
6103
|
+
* const config: CurlRequestConfig = {
|
|
6104
|
+
* url: 'https://api.example.com/data',
|
|
6105
|
+
* method: 'GET',
|
|
6106
|
+
* curl: {
|
|
6107
|
+
* connectTimeout: 10,
|
|
6108
|
+
* limitRate: '500K',
|
|
6109
|
+
* retry: { attempts: 3, allErrors: true }
|
|
6110
|
+
* }
|
|
6111
|
+
* };
|
|
6112
|
+
*
|
|
6113
|
+
* const response = await rezo.request(config);
|
|
6114
|
+
* ```
|
|
6115
|
+
*/
|
|
6116
|
+
export interface CurlRequestConfig extends RezoRequestConfig {
|
|
6117
|
+
/**
|
|
6118
|
+
* cURL-specific options
|
|
6119
|
+
*
|
|
6120
|
+
* @remarks
|
|
6121
|
+
* These options are only available when using the cURL adapter.
|
|
6122
|
+
* They provide fine-grained control over cURL command-line behavior
|
|
6123
|
+
* and will override internal defaults when set.
|
|
6124
|
+
*
|
|
6125
|
+
* Options that are handled internally and should NOT be set here:
|
|
6126
|
+
* - Headers → Use `headers` option
|
|
6127
|
+
* - Cookies → Use cookie jar or `cookies` option
|
|
6128
|
+
* - Body/Data → Use `data` or `body` option
|
|
6129
|
+
* - Output files → Use `saveTo` option
|
|
6130
|
+
*
|
|
6131
|
+
* @example
|
|
6132
|
+
* ```typescript
|
|
6133
|
+
* import rezo from 'rezo/adapters/curl';
|
|
6134
|
+
*
|
|
6135
|
+
* await rezo.get('https://api.example.com/data', {
|
|
6136
|
+
* curl: {
|
|
6137
|
+
* connectTimeout: 10,
|
|
6138
|
+
* limitRate: '500K',
|
|
6139
|
+
* retry: { attempts: 3, allErrors: true },
|
|
6140
|
+
* ipVersion: 'v4',
|
|
6141
|
+
* tcpFastOpen: true,
|
|
6142
|
+
* tls: {
|
|
6143
|
+
* min: 'tlsv1.2',
|
|
6144
|
+
* certStatus: true
|
|
6145
|
+
* },
|
|
6146
|
+
* resolve: [{ host: 'example.com', port: 443, address: '192.168.1.1' }]
|
|
6147
|
+
* }
|
|
6148
|
+
* });
|
|
6149
|
+
* ```
|
|
6150
|
+
*/
|
|
6151
|
+
curl?: CurlOptions;
|
|
6152
|
+
}
|
|
3842
6153
|
export declare const isRezoError: typeof RezoError.isRezoError;
|
|
3843
6154
|
export declare const Cancel: typeof RezoError;
|
|
3844
6155
|
export declare const CancelToken: {
|
|
@@ -3858,6 +6169,7 @@ export declare const VERSION: string;
|
|
|
3858
6169
|
declare const rezo: RezoInstance;
|
|
3859
6170
|
|
|
3860
6171
|
export {
|
|
6172
|
+
CurlRequestConfig as RezoRequestConfig,
|
|
3861
6173
|
ResponseType$1 as ResponseType,
|
|
3862
6174
|
rezo as default,
|
|
3863
6175
|
};
|