@stryke/http 0.12.2 → 0.12.10
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/CHANGELOG.md +385 -0
- package/README.md +18 -10
- package/dist/agent-Cc4PYJ-j.d.cts +40 -0
- package/dist/agent-Cc4PYJ-j.d.cts.map +1 -0
- package/dist/agent-DKevd8Ll.cjs +2 -0
- package/dist/agent-DXIpD4O5.d.mts +40 -0
- package/dist/agent-DXIpD4O5.d.mts.map +1 -0
- package/dist/agent-DrFvt4od.mjs +3 -0
- package/dist/agent-DrFvt4od.mjs.map +1 -0
- package/dist/agent.cjs +1 -84
- package/dist/agent.d.cts +2 -0
- package/dist/agent.d.mts +2 -0
- package/dist/agent.mjs +1 -2
- package/dist/chunk-Bmb41Sf3.cjs +1 -0
- package/dist/fetch-BYPFJG9Y.d.cts +24 -0
- package/dist/fetch-BYPFJG9Y.d.cts.map +1 -0
- package/dist/fetch-D3masEhH.d.mts +24 -0
- package/dist/fetch-D3masEhH.d.mts.map +1 -0
- package/dist/fetch-DXVSCX2B.cjs +1 -0
- package/dist/fetch-DgPaAZTB.mjs +2 -0
- package/dist/fetch-DgPaAZTB.mjs.map +1 -0
- package/dist/fetch.cjs +1 -24
- package/dist/fetch.d.cts +2 -0
- package/dist/fetch.d.mts +2 -0
- package/dist/fetch.mjs +1 -1
- package/dist/{format-data-uri.d.ts → format-data-uri-B-rw3THu.d.cts} +14 -10
- package/dist/format-data-uri-B-rw3THu.d.cts.map +1 -0
- package/dist/format-data-uri-C59EgrXn.cjs +1 -0
- package/dist/format-data-uri-D864kwXt.d.mts +50 -0
- package/dist/format-data-uri-D864kwXt.d.mts.map +1 -0
- package/dist/format-data-uri-WSwfftd0.mjs +2 -0
- package/dist/format-data-uri-WSwfftd0.mjs.map +1 -0
- package/dist/format-data-uri.cjs +1 -30
- package/dist/format-data-uri.d.cts +2 -0
- package/dist/format-data-uri.d.mts +2 -0
- package/dist/format-data-uri.mjs +1 -1
- package/dist/{get-free-port.d.ts → get-free-port-Bf-x1nt8.d.cts} +5 -1
- package/dist/get-free-port-Bf-x1nt8.d.cts.map +1 -0
- package/dist/get-free-port-BwvXPXFs.d.mts +10 -0
- package/dist/get-free-port-BwvXPXFs.d.mts.map +1 -0
- package/dist/get-free-port-D9hjek4b.cjs +1 -0
- package/dist/get-free-port-DvWNGhhy.mjs +2 -0
- package/dist/get-free-port-DvWNGhhy.mjs.map +1 -0
- package/dist/get-free-port.cjs +1 -16
- package/dist/get-free-port.d.cts +2 -0
- package/dist/get-free-port.d.mts +2 -0
- package/dist/get-free-port.mjs +1 -1
- package/dist/http-proxy-CJqbqeZN.cjs +3 -0
- package/dist/http-proxy-ChUYEQ71.mjs +4 -0
- package/dist/http-proxy-ChUYEQ71.mjs.map +1 -0
- package/dist/http-proxy-CzvOBKWd.d.cts +40 -0
- package/dist/http-proxy-CzvOBKWd.d.cts.map +1 -0
- package/dist/http-proxy-DuPPyvFw.d.mts +40 -0
- package/dist/http-proxy-DuPPyvFw.d.mts.map +1 -0
- package/dist/http-proxy.cjs +1 -71
- package/dist/http-proxy.d.cts +2 -0
- package/dist/http-proxy.d.mts +2 -0
- package/dist/http-proxy.mjs +1 -3
- package/dist/https-proxy-B8w-jm17.d.cts +43 -0
- package/dist/https-proxy-B8w-jm17.d.cts.map +1 -0
- package/dist/https-proxy-f4-C_EL8.d.mts +43 -0
- package/dist/https-proxy-f4-C_EL8.d.mts.map +1 -0
- package/dist/https-proxy-k0GW_xX8.cjs +1 -0
- package/dist/https-proxy-rNc_8MiC.mjs +2 -0
- package/dist/https-proxy-rNc_8MiC.mjs.map +1 -0
- package/dist/https-proxy.cjs +1 -88
- package/dist/https-proxy.d.cts +2 -0
- package/dist/https-proxy.d.mts +2 -0
- package/dist/https-proxy.mjs +1 -4
- package/dist/index.cjs +1 -93
- package/dist/index.d.cts +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +1 -1
- package/dist/parse-response-BRlQF_8K.cjs +4 -0
- package/dist/parse-response-CGkjN9j0.mjs +5 -0
- package/dist/parse-response-CGkjN9j0.mjs.map +1 -0
- package/dist/parse-response-CS657Hki.d.cts +23 -0
- package/dist/parse-response-CS657Hki.d.cts.map +1 -0
- package/dist/parse-response-ujHVHmwG.d.mts +23 -0
- package/dist/parse-response-ujHVHmwG.d.mts.map +1 -0
- package/dist/parse-response.cjs +1 -63
- package/dist/parse-response.d.cts +2 -0
- package/dist/parse-response.d.mts +2 -0
- package/dist/parse-response.mjs +1 -4
- package/dist/proxy-agent-BrxQeFy2.d.mts +13 -0
- package/dist/proxy-agent-BrxQeFy2.d.mts.map +1 -0
- package/dist/proxy-agent-CnWrJ59l.d.cts +13 -0
- package/dist/proxy-agent-CnWrJ59l.d.cts.map +1 -0
- package/dist/proxy-agent-DMsOloiQ.cjs +1 -0
- package/dist/proxy-agent-uGI03t_I.mjs +2 -0
- package/dist/proxy-agent-uGI03t_I.mjs.map +1 -0
- package/dist/proxy-agent.cjs +1 -14
- package/dist/proxy-agent.d.cts +2 -0
- package/dist/proxy-agent.d.mts +2 -0
- package/dist/proxy-agent.mjs +1 -1
- package/package.json +38 -165
- package/dist/agent.d.ts +0 -36
- package/dist/fetch.d.ts +0 -18
- package/dist/http-proxy.d.ts +0 -38
- package/dist/https-proxy.d.ts +0 -42
- package/dist/index.d.ts +0 -8
- package/dist/parse-response.d.ts +0 -18
- package/dist/proxy-agent.d.ts +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Agent } from "node:https";
|
|
2
|
+
|
|
3
|
+
//#region src/proxy-agent.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* If the http(s)_proxy environment variables is set, return a proxy agent.
|
|
7
|
+
*
|
|
8
|
+
* @returns The proxy agent or undefined if no proxy is set.
|
|
9
|
+
*/
|
|
10
|
+
declare function getProxyAgent(): Agent | undefined;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getProxyAgent as t };
|
|
13
|
+
//# sourceMappingURL=proxy-agent-BrxQeFy2.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-agent-BrxQeFy2.d.mts","names":[],"sources":["../src/proxy-agent.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;iBAAgB,aAAA,CAAA,GAAiB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Agent } from "node:https";
|
|
2
|
+
|
|
3
|
+
//#region src/proxy-agent.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* If the http(s)_proxy environment variables is set, return a proxy agent.
|
|
7
|
+
*
|
|
8
|
+
* @returns The proxy agent or undefined if no proxy is set.
|
|
9
|
+
*/
|
|
10
|
+
declare function getProxyAgent(): Agent | undefined;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getProxyAgent as t };
|
|
13
|
+
//# sourceMappingURL=proxy-agent-CnWrJ59l.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-agent-CnWrJ59l.d.cts","names":[],"sources":["../src/proxy-agent.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;iBAAgB,aAAA,CAAA,GAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./http-proxy-CJqbqeZN.cjs`),t=require(`./https-proxy-k0GW_xX8.cjs`);function n(){let n=process.env.https_proxy||process.env.HTTPS_PROXY;if(n)return new t.t(n);let r=process.env.http_proxy||process.env.HTTP_PROXY;if(r)return new e.t(r)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./http-proxy-ChUYEQ71.mjs";import{t}from"./https-proxy-rNc_8MiC.mjs";function n(){let n=process.env.https_proxy||process.env.HTTPS_PROXY;if(n)return new t(n);let r=process.env.http_proxy||process.env.HTTP_PROXY;if(r)return new e(r)}export{n as t};
|
|
2
|
+
//# sourceMappingURL=proxy-agent-uGI03t_I.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-agent-uGI03t_I.mjs","names":[],"sources":["../src/proxy-agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Agent } from \"node:https\";\nimport { HttpProxyAgent } from \"./http-proxy\";\nimport { HttpsProxyAgent } from \"./https-proxy\";\n\n/**\n * If the http(s)_proxy environment variables is set, return a proxy agent.\n *\n * @returns The proxy agent or undefined if no proxy is set.\n */\nexport function getProxyAgent(): Agent | undefined {\n const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;\n if (httpsProxy) {\n return new HttpsProxyAgent(httpsProxy);\n }\n\n const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;\n if (httpProxy) {\n return new HttpProxyAgent(httpProxy);\n }\n\n return undefined;\n}\n"],"mappings":"wFA2BA,SAAgB,GAAmC,CACjD,IAAM,EAAa,QAAQ,IAAI,aAAe,QAAQ,IAAI,YAC1D,GAAI,EACF,OAAO,IAAI,EAAgB,EAAW,CAGxC,IAAM,EAAY,QAAQ,IAAI,YAAc,QAAQ,IAAI,WACxD,GAAI,EACF,OAAO,IAAI,EAAe,EAAU"}
|
package/dist/proxy-agent.cjs
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getProxyAgent = getProxyAgent;
|
|
7
|
-
var _httpProxy = require("./http-proxy.cjs");
|
|
8
|
-
var _httpsProxy = require("./https-proxy.cjs");
|
|
9
|
-
function getProxyAgent() {
|
|
10
|
-
const t = process.env.https_proxy || process.env.HTTPS_PROXY;
|
|
11
|
-
if (t) return new _httpsProxy.HttpsProxyAgent(t);
|
|
12
|
-
const e = process.env.http_proxy || process.env.HTTP_PROXY;
|
|
13
|
-
if (e) return new _httpProxy.HttpProxyAgent(e);
|
|
14
|
-
}
|
|
1
|
+
require(`./agent-DKevd8Ll.cjs`),require(`./http-proxy-CJqbqeZN.cjs`),require(`./https-proxy-k0GW_xX8.cjs`);const e=require(`./proxy-agent-DMsOloiQ.cjs`);exports.getProxyAgent=e.t;
|
package/dist/proxy-agent.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./agent-DrFvt4od.mjs";import"./http-proxy-ChUYEQ71.mjs";import"./https-proxy-rNc_8MiC.mjs";import{t as e}from"./proxy-agent-uGI03t_I.mjs";export{e as getProxyAgent};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/http",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing HTTP communication utilities used by Storm Software.",
|
|
6
6
|
"repository": {
|
|
@@ -9,177 +9,50 @@
|
|
|
9
9
|
"directory": "packages/http"
|
|
10
10
|
},
|
|
11
11
|
"private": false,
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"@stryke/url": "^0.3.3",
|
|
15
|
-
"defu": "^6.1.4",
|
|
16
|
-
"undici": "^7.16.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": { "@types/node": "^24.10.1", "undici-types": "^7.16.0" },
|
|
19
|
-
"publishConfig": { "access": "public" },
|
|
20
|
-
"sideEffects": false,
|
|
21
|
-
"files": ["dist/**/*"],
|
|
22
|
-
"homepage": "https://stormsoftware.com",
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://stormsoftware.com/support",
|
|
25
|
-
"email": "support@stormsoftware.com"
|
|
26
|
-
},
|
|
27
|
-
"license": "Apache-2.0",
|
|
28
|
-
"keywords": [
|
|
29
|
-
"stryke",
|
|
30
|
-
"typescript",
|
|
31
|
-
"utilities",
|
|
32
|
-
"storm-software",
|
|
33
|
-
"storm",
|
|
34
|
-
"storm-ops",
|
|
35
|
-
"cyclone-ui",
|
|
36
|
-
"sullivanpj",
|
|
37
|
-
"monorepo"
|
|
38
|
-
],
|
|
39
|
-
"funding": {
|
|
40
|
-
"type": "github",
|
|
41
|
-
"url": "https://github.com/sponsors/storm-software"
|
|
42
|
-
},
|
|
43
|
-
"author": {
|
|
44
|
-
"name": "Storm Software",
|
|
45
|
-
"email": "contact@stormsoftware.com",
|
|
46
|
-
"url": "https://stormsoftware.com"
|
|
47
|
-
},
|
|
48
|
-
"maintainers": [
|
|
49
|
-
{
|
|
50
|
-
"name": "Storm Software",
|
|
51
|
-
"email": "contact@stormsoftware.com",
|
|
52
|
-
"url": "https://stormsoftware.com"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"contributors": [
|
|
56
|
-
{
|
|
57
|
-
"name": "Storm Software",
|
|
58
|
-
"email": "contact@stormsoftware.com",
|
|
59
|
-
"url": "https://stormsoftware.com"
|
|
60
|
-
}
|
|
61
|
-
],
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
62
14
|
"exports": {
|
|
63
|
-
"./
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"types": "./dist/proxy-agent.d.ts",
|
|
70
|
-
"default": "./dist/proxy-agent.cjs"
|
|
71
|
-
},
|
|
72
|
-
"default": {
|
|
73
|
-
"types": "./dist/proxy-agent.d.ts",
|
|
74
|
-
"default": "./dist/proxy-agent.mjs"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"./parse-response": {
|
|
78
|
-
"import": {
|
|
79
|
-
"types": "./dist/parse-response.d.ts",
|
|
80
|
-
"default": "./dist/parse-response.mjs"
|
|
81
|
-
},
|
|
82
|
-
"require": {
|
|
83
|
-
"types": "./dist/parse-response.d.ts",
|
|
84
|
-
"default": "./dist/parse-response.cjs"
|
|
85
|
-
},
|
|
86
|
-
"default": {
|
|
87
|
-
"types": "./dist/parse-response.d.ts",
|
|
88
|
-
"default": "./dist/parse-response.mjs"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"./index": {
|
|
92
|
-
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
93
|
-
"require": {
|
|
94
|
-
"types": "./dist/index.d.ts",
|
|
95
|
-
"default": "./dist/index.cjs"
|
|
96
|
-
},
|
|
97
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
98
|
-
},
|
|
99
|
-
"./https-proxy": {
|
|
100
|
-
"import": {
|
|
101
|
-
"types": "./dist/https-proxy.d.ts",
|
|
102
|
-
"default": "./dist/https-proxy.mjs"
|
|
103
|
-
},
|
|
104
|
-
"require": {
|
|
105
|
-
"types": "./dist/https-proxy.d.ts",
|
|
106
|
-
"default": "./dist/https-proxy.cjs"
|
|
107
|
-
},
|
|
108
|
-
"default": {
|
|
109
|
-
"types": "./dist/https-proxy.d.ts",
|
|
110
|
-
"default": "./dist/https-proxy.mjs"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"./http-proxy": {
|
|
114
|
-
"import": {
|
|
115
|
-
"types": "./dist/http-proxy.d.ts",
|
|
116
|
-
"default": "./dist/http-proxy.mjs"
|
|
117
|
-
},
|
|
118
|
-
"require": {
|
|
119
|
-
"types": "./dist/http-proxy.d.ts",
|
|
120
|
-
"default": "./dist/http-proxy.cjs"
|
|
121
|
-
},
|
|
122
|
-
"default": {
|
|
123
|
-
"types": "./dist/http-proxy.d.ts",
|
|
124
|
-
"default": "./dist/http-proxy.mjs"
|
|
125
|
-
}
|
|
15
|
+
".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
|
|
16
|
+
"./agent": { "require": "./dist/agent.cjs", "import": "./dist/agent.mjs" },
|
|
17
|
+
"./fetch": { "require": "./dist/fetch.cjs", "import": "./dist/fetch.mjs" },
|
|
18
|
+
"./format-data-uri": {
|
|
19
|
+
"require": "./dist/format-data-uri.cjs",
|
|
20
|
+
"import": "./dist/format-data-uri.mjs"
|
|
126
21
|
},
|
|
127
22
|
"./get-free-port": {
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
"default": "./dist/get-free-port.mjs"
|
|
131
|
-
},
|
|
132
|
-
"require": {
|
|
133
|
-
"types": "./dist/get-free-port.d.ts",
|
|
134
|
-
"default": "./dist/get-free-port.cjs"
|
|
135
|
-
},
|
|
136
|
-
"default": {
|
|
137
|
-
"types": "./dist/get-free-port.d.ts",
|
|
138
|
-
"default": "./dist/get-free-port.mjs"
|
|
139
|
-
}
|
|
23
|
+
"require": "./dist/get-free-port.cjs",
|
|
24
|
+
"import": "./dist/get-free-port.mjs"
|
|
140
25
|
},
|
|
141
|
-
"./
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
"default": "./dist/format-data-uri.mjs"
|
|
145
|
-
},
|
|
146
|
-
"require": {
|
|
147
|
-
"types": "./dist/format-data-uri.d.ts",
|
|
148
|
-
"default": "./dist/format-data-uri.cjs"
|
|
149
|
-
},
|
|
150
|
-
"default": {
|
|
151
|
-
"types": "./dist/format-data-uri.d.ts",
|
|
152
|
-
"default": "./dist/format-data-uri.mjs"
|
|
153
|
-
}
|
|
26
|
+
"./http-proxy": {
|
|
27
|
+
"require": "./dist/http-proxy.cjs",
|
|
28
|
+
"import": "./dist/http-proxy.mjs"
|
|
154
29
|
},
|
|
155
|
-
"./
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"types": "./dist/fetch.d.ts",
|
|
159
|
-
"default": "./dist/fetch.cjs"
|
|
160
|
-
},
|
|
161
|
-
"default": { "types": "./dist/fetch.d.ts", "default": "./dist/fetch.mjs" }
|
|
30
|
+
"./https-proxy": {
|
|
31
|
+
"require": "./dist/https-proxy.cjs",
|
|
32
|
+
"import": "./dist/https-proxy.mjs"
|
|
162
33
|
},
|
|
163
|
-
"./
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"types": "./dist/agent.d.ts",
|
|
167
|
-
"default": "./dist/agent.cjs"
|
|
168
|
-
},
|
|
169
|
-
"default": { "types": "./dist/agent.d.ts", "default": "./dist/agent.mjs" }
|
|
34
|
+
"./parse-response": {
|
|
35
|
+
"require": "./dist/parse-response.cjs",
|
|
36
|
+
"import": "./dist/parse-response.mjs"
|
|
170
37
|
},
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"types": "./dist/index.d.ts",
|
|
175
|
-
"default": "./dist/index.cjs"
|
|
176
|
-
},
|
|
177
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
38
|
+
"./proxy-agent": {
|
|
39
|
+
"require": "./dist/proxy-agent.cjs",
|
|
40
|
+
"import": "./dist/proxy-agent.mjs"
|
|
178
41
|
},
|
|
179
|
-
"
|
|
42
|
+
"./*": "./*"
|
|
180
43
|
},
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
|
|
184
|
-
|
|
44
|
+
"types": "./dist/index.d.cts",
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@stryke/type-checks": "^0.5.5",
|
|
47
|
+
"@stryke/url": "^0.3.11",
|
|
48
|
+
"defu": "^6.1.4",
|
|
49
|
+
"undici": "^7.16.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^24.10.1",
|
|
53
|
+
"tsdown": "^0.17.1",
|
|
54
|
+
"undici-types": "^7.16.0"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": { "access": "public" },
|
|
57
|
+
"gitHead": "5c645896466d1f6a26fb9cf9748ba226dd4d1f07"
|
|
185
58
|
}
|
package/dist/agent.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as http from "node:http";
|
|
2
|
-
import * as net from "node:net";
|
|
3
|
-
import type { Duplex } from "node:stream";
|
|
4
|
-
import type * as tls from "node:tls";
|
|
5
|
-
interface HttpConnectOpts extends net.TcpNetConnectOpts {
|
|
6
|
-
secureEndpoint: false;
|
|
7
|
-
protocol?: string;
|
|
8
|
-
}
|
|
9
|
-
interface HttpsConnectOpts extends tls.ConnectionOptions {
|
|
10
|
-
secureEndpoint: true;
|
|
11
|
-
protocol?: string;
|
|
12
|
-
port: number;
|
|
13
|
-
}
|
|
14
|
-
export type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;
|
|
15
|
-
declare const SYMBOL_INTERNAL: unique symbol;
|
|
16
|
-
export declare abstract class Agent extends http.Agent {
|
|
17
|
-
private [SYMBOL_INTERNAL];
|
|
18
|
-
options: Partial<net.TcpNetConnectOpts & tls.ConnectionOptions>;
|
|
19
|
-
keepAlive: boolean;
|
|
20
|
-
constructor(opts?: http.AgentOptions);
|
|
21
|
-
abstract connect(req: http.ClientRequest, options: AgentConnectOpts): Promise<Duplex | http.Agent> | Duplex | http.Agent;
|
|
22
|
-
/**
|
|
23
|
-
* Determine whether this is an `http` or `https` request.
|
|
24
|
-
*/
|
|
25
|
-
isSecureEndpoint(options?: AgentConnectOpts): boolean;
|
|
26
|
-
private incrementSockets;
|
|
27
|
-
private decrementSockets;
|
|
28
|
-
getName(options?: AgentConnectOpts): string;
|
|
29
|
-
createSocket(req: http.ClientRequest, options: AgentConnectOpts, cb: (err: Error | null, s?: Duplex) => void): void;
|
|
30
|
-
createConnection(): Duplex;
|
|
31
|
-
get defaultPort(): number;
|
|
32
|
-
set defaultPort(v: number);
|
|
33
|
-
get protocol(): string;
|
|
34
|
-
set protocol(v: string);
|
|
35
|
-
}
|
|
36
|
-
export {};
|
package/dist/fetch.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { RequestInfo } from "undici";
|
|
2
|
-
export type FetchRequestOptions = RequestInit & {
|
|
3
|
-
/**
|
|
4
|
-
* Timeout in milliseconds
|
|
5
|
-
*
|
|
6
|
-
* @defaultValue 5000
|
|
7
|
-
*/
|
|
8
|
-
timeout?: number;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Fetches a resource from a URL.
|
|
12
|
-
*
|
|
13
|
-
* @param input - The URL to fetch.
|
|
14
|
-
* @param options - Additional fetch options.
|
|
15
|
-
* @returns The fetched response.
|
|
16
|
-
*/
|
|
17
|
-
export declare function fetchRequest(input: RequestInfo, options?: FetchRequestOptions): Promise<import("undici").Response>;
|
|
18
|
-
export declare const fetch: typeof fetchRequest;
|
package/dist/http-proxy.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { AgentConnectOpts } from "agent-base";
|
|
2
|
-
import type { AgentOptions, ClientRequest, OutgoingHttpHeaders } from "node:http";
|
|
3
|
-
import * as net from "node:net";
|
|
4
|
-
import * as tls from "node:tls";
|
|
5
|
-
import { URL } from "node:url";
|
|
6
|
-
import { Agent } from "./agent";
|
|
7
|
-
type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
|
|
8
|
-
interface ConnectOptsMap {
|
|
9
|
-
http: Omit<net.TcpNetConnectOpts, "host" | "port">;
|
|
10
|
-
https: Omit<tls.ConnectionOptions, "host" | "port">;
|
|
11
|
-
}
|
|
12
|
-
type ConnectOpts<T> = {
|
|
13
|
-
[P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
|
|
14
|
-
}[keyof ConnectOptsMap];
|
|
15
|
-
export type HttpProxyAgentOptions<T> = ConnectOpts<T> & AgentOptions & {
|
|
16
|
-
headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
17
|
-
};
|
|
18
|
-
interface HttpProxyAgentClientRequest extends ClientRequest {
|
|
19
|
-
outputData?: {
|
|
20
|
-
data: string;
|
|
21
|
-
}[];
|
|
22
|
-
_header?: string | null;
|
|
23
|
-
_implicitHeader: () => void;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The `HttpProxyAgent` implements an HTTP Agent subclass that connects to the specified "HTTP proxy server" in order to proxy HTTP requests.
|
|
27
|
-
*/
|
|
28
|
-
export declare class HttpProxyAgent<Uri extends string> extends Agent {
|
|
29
|
-
static protocols: readonly ["http", "https"];
|
|
30
|
-
readonly proxy: URL;
|
|
31
|
-
proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
32
|
-
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
|
|
33
|
-
constructor(proxy: Uri | URL, opts?: HttpProxyAgentOptions<Uri>);
|
|
34
|
-
addRequest(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void;
|
|
35
|
-
setRequestProps(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void;
|
|
36
|
-
connect(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
package/dist/https-proxy.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { AgentConnectOpts } from "agent-base";
|
|
2
|
-
import { Agent } from "agent-base";
|
|
3
|
-
import type * as http from "node:http";
|
|
4
|
-
import type { OutgoingHttpHeaders } from "node:http";
|
|
5
|
-
import * as net from "node:net";
|
|
6
|
-
import * as tls from "node:tls";
|
|
7
|
-
import { URL } from "node:url";
|
|
8
|
-
type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
|
|
9
|
-
interface ConnectOptsMap {
|
|
10
|
-
http: Omit<net.TcpNetConnectOpts, "host" | "port">;
|
|
11
|
-
https: Omit<tls.ConnectionOptions, "host" | "port">;
|
|
12
|
-
}
|
|
13
|
-
type ConnectOpts<T> = {
|
|
14
|
-
[P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
|
|
15
|
-
}[keyof ConnectOptsMap];
|
|
16
|
-
export type HttpsProxyAgentOptions<T> = ConnectOpts<T> & http.AgentOptions & {
|
|
17
|
-
headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
21
|
-
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
22
|
-
*
|
|
23
|
-
* Outgoing HTTP requests are first tunneled through the proxy server using the
|
|
24
|
-
* `CONNECT` HTTP request method to establish a connection to the proxy server,
|
|
25
|
-
* and then the proxy server connects to the destination target and issues the
|
|
26
|
-
* HTTP request from the proxy server.
|
|
27
|
-
*
|
|
28
|
-
* `https:` requests have their socket connection upgraded to TLS once
|
|
29
|
-
* the connection to the proxy server has been established.
|
|
30
|
-
*/
|
|
31
|
-
export declare class HttpsProxyAgent<Uri extends string> extends Agent {
|
|
32
|
-
static protocols: readonly ["http", "https"];
|
|
33
|
-
readonly proxy: URL;
|
|
34
|
-
proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
35
|
-
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
|
|
36
|
-
constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>);
|
|
37
|
-
/**
|
|
38
|
-
* Called when the node-core HTTP client library is creating a new HTTP request.
|
|
39
|
-
*/
|
|
40
|
-
connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
|
|
41
|
-
}
|
|
42
|
-
export {};
|
package/dist/index.d.ts
DELETED
package/dist/parse-response.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Buffer } from "node:buffer";
|
|
2
|
-
import type { IncomingHttpHeaders } from "node:http";
|
|
3
|
-
import type { Readable } from "node:stream";
|
|
4
|
-
export interface ConnectResponse {
|
|
5
|
-
statusCode: number;
|
|
6
|
-
statusText: string;
|
|
7
|
-
headers: IncomingHttpHeaders;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Parses the proxy CONNECT response from the given socket.
|
|
11
|
-
*
|
|
12
|
-
* @param socket - The socket to read the response from.
|
|
13
|
-
* @returns A promise that resolves to the CONNECT response and any buffered data.
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseProxyResponse(socket: Readable): Promise<{
|
|
16
|
-
connect: ConnectResponse;
|
|
17
|
-
buffered: Buffer;
|
|
18
|
-
}>;
|
package/dist/proxy-agent.d.ts
DELETED