http-cookie-agent
Advanced tools
Comparing version 5.0.4 to 6.0.0
@@ -10,3 +10,2 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const HttpCookieAgent = (0, _create_cookie_agent.createCookieAgent)(_nodeHttp.default.Agent); | ||
exports.HttpCookieAgent = HttpCookieAgent; | ||
const HttpCookieAgent = exports.HttpCookieAgent = (0, _create_cookie_agent.createCookieAgent)(_nodeHttp.default.Agent); |
@@ -10,3 +10,2 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const HttpsCookieAgent = (0, _create_cookie_agent.createCookieAgent)(_nodeHttps.default.Agent); | ||
exports.HttpsCookieAgent = HttpsCookieAgent; | ||
const HttpsCookieAgent = exports.HttpsCookieAgent = (0, _create_cookie_agent.createCookieAgent)(_nodeHttps.default.Agent); |
@@ -63,3 +63,2 @@ "use strict"; | ||
} | ||
const CookieClient = createCookieClient(_undici.Client); | ||
exports.CookieClient = CookieClient; | ||
const CookieClient = exports.CookieClient = createCookieClient(_undici.Client); |
@@ -19,15 +19,19 @@ "use strict"; | ||
} | ||
onResponseStarted = () => { | ||
var _this$kHandlers$onRes, _this$kHandlers; | ||
(_this$kHandlers$onRes = (_this$kHandlers = this[kHandlers]).onResponseStarted) === null || _this$kHandlers$onRes === void 0 || _this$kHandlers$onRes.call(_this$kHandlers); | ||
}; | ||
onConnect = abort => { | ||
var _this$kHandlers$onCon, _this$kHandlers; | ||
(_this$kHandlers$onCon = (_this$kHandlers = this[kHandlers]).onConnect) === null || _this$kHandlers$onCon === void 0 ? void 0 : _this$kHandlers$onCon.call(_this$kHandlers, abort); | ||
var _this$kHandlers$onCon, _this$kHandlers2; | ||
(_this$kHandlers$onCon = (_this$kHandlers2 = this[kHandlers]).onConnect) === null || _this$kHandlers$onCon === void 0 || _this$kHandlers$onCon.call(_this$kHandlers2, abort); | ||
}; | ||
onError = err => { | ||
var _this$kHandlers$onErr, _this$kHandlers2; | ||
(_this$kHandlers$onErr = (_this$kHandlers2 = this[kHandlers]).onError) === null || _this$kHandlers$onErr === void 0 ? void 0 : _this$kHandlers$onErr.call(_this$kHandlers2, err); | ||
var _this$kHandlers$onErr, _this$kHandlers3; | ||
(_this$kHandlers$onErr = (_this$kHandlers3 = this[kHandlers]).onError) === null || _this$kHandlers$onErr === void 0 || _this$kHandlers$onErr.call(_this$kHandlers3, err); | ||
}; | ||
onUpgrade = (statusCode, headers, socket) => { | ||
var _this$kHandlers$onUpg, _this$kHandlers3; | ||
(_this$kHandlers$onUpg = (_this$kHandlers3 = this[kHandlers]).onUpgrade) === null || _this$kHandlers$onUpg === void 0 ? void 0 : _this$kHandlers$onUpg.call(_this$kHandlers3, statusCode, headers, socket); | ||
var _this$kHandlers$onUpg, _this$kHandlers4; | ||
(_this$kHandlers$onUpg = (_this$kHandlers4 = this[kHandlers]).onUpgrade) === null || _this$kHandlers$onUpg === void 0 || _this$kHandlers$onUpg.call(_this$kHandlers4, statusCode, headers, socket); | ||
}; | ||
onHeaders = (statusCode, _headers, resume) => { | ||
onHeaders = (statusCode, _headers, resume, statusText) => { | ||
if (this[kHandlers].onHeaders == null) { | ||
@@ -44,3 +48,3 @@ throw new _undici.errors.InvalidArgumentError('invalid onHeaders method'); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return this[kHandlers].onHeaders(statusCode, _headers, resume); | ||
return this[kHandlers].onHeaders(statusCode, _headers, resume, statusText); | ||
}; | ||
@@ -55,10 +59,10 @@ onData = chunk => { | ||
onComplete = trailers => { | ||
var _this$kHandlers$onCom, _this$kHandlers4; | ||
(_this$kHandlers$onCom = (_this$kHandlers4 = this[kHandlers]).onComplete) === null || _this$kHandlers$onCom === void 0 ? void 0 : _this$kHandlers$onCom.call(_this$kHandlers4, trailers); | ||
var _this$kHandlers$onCom, _this$kHandlers5; | ||
(_this$kHandlers$onCom = (_this$kHandlers5 = this[kHandlers]).onComplete) === null || _this$kHandlers$onCom === void 0 || _this$kHandlers$onCom.call(_this$kHandlers5, trailers); | ||
}; | ||
onBodySent = (chunkSize, totalBytesSent) => { | ||
var _this$kHandlers$onBod, _this$kHandlers5; | ||
(_this$kHandlers$onBod = (_this$kHandlers5 = this[kHandlers]).onBodySent) === null || _this$kHandlers$onBod === void 0 ? void 0 : _this$kHandlers$onBod.call(_this$kHandlers5, chunkSize, totalBytesSent); | ||
var _this$kHandlers$onBod, _this$kHandlers6; | ||
(_this$kHandlers$onBod = (_this$kHandlers6 = this[kHandlers]).onBodySent) === null || _this$kHandlers$onBod === void 0 || _this$kHandlers$onBod.call(_this$kHandlers6, chunkSize, totalBytesSent); | ||
}; | ||
} | ||
exports.CookieHandler = CookieHandler; |
{ | ||
"name": "http-cookie-agent", | ||
"version": "5.0.4", | ||
"version": "6.0.0", | ||
"description": "Allows cookies with every Node.js HTTP clients.", | ||
@@ -68,3 +68,3 @@ "keywords": [ | ||
"resolutions": { | ||
"urllib/undici": "^5.22.1" | ||
"urllib/undici": "6.2.1" | ||
}, | ||
@@ -75,38 +75,38 @@ "dependencies": { | ||
"devDependencies": { | ||
"@3846masa/configs": "github:3846masa/configs#707064cd4db30c36b728d63f5e411cc705c9ccad", | ||
"@babel/cli": "7.22.5", | ||
"@babel/core": "7.22.5", | ||
"@babel/preset-env": "7.22.5", | ||
"@babel/preset-typescript": "7.22.5", | ||
"@3846masa/configs": "github:3846masa/configs#c9c760737d0e57a1b1310d3c516fb3af3ce0fde5", | ||
"@babel/cli": "7.23.4", | ||
"@babel/core": "7.23.7", | ||
"@babel/preset-env": "7.23.7", | ||
"@babel/preset-typescript": "7.23.3", | ||
"@hapi/wreck": "18.0.1", | ||
"@semantic-release/changelog": "6.0.3", | ||
"@semantic-release/git": "10.0.1", | ||
"@types/deasync": "0.1.2", | ||
"@types/needle": "3.2.0", | ||
"@types/node": "14.18.51", | ||
"@types/request": "2.48.8", | ||
"@types/semver": "7.5.0", | ||
"@types/superagent": "4.1.18", | ||
"@types/tough-cookie": "4.0.2", | ||
"agentkeepalive": "4.3.0", | ||
"ava": "5.3.0", | ||
"axios": "1.4.0", | ||
"deasync": "0.1.28", | ||
"@types/deasync": "0.1.5", | ||
"@types/needle": "3.3.0", | ||
"@types/node": "18.19.6", | ||
"@types/request": "2.48.12", | ||
"@types/semver": "7.5.6", | ||
"@types/superagent": "8.1.1", | ||
"@types/tough-cookie": "4.0.5", | ||
"agentkeepalive": "4.5.0", | ||
"ava": "5.3.1", | ||
"axios": "1.6.5", | ||
"deasync": "0.1.29", | ||
"got": "12.6.1", | ||
"http-proxy-agent": "7.0.0", | ||
"needle": "3.2.0", | ||
"node-fetch": "3.3.1", | ||
"needle": "3.3.1", | ||
"node-fetch": "3.3.2", | ||
"npm-run-all": "4.1.5", | ||
"patch-package": "7.0.0", | ||
"patch-package": "8.0.0", | ||
"phin": "3.7.0", | ||
"proxy": "2.1.1", | ||
"request": "2.88.2", | ||
"rimraf": "5.0.1", | ||
"rimraf": "5.0.5", | ||
"semantic-release": "19.0.5", | ||
"semver": "7.5.1", | ||
"superagent": "8.0.9", | ||
"semver": "7.5.4", | ||
"superagent": "8.1.2", | ||
"tough-cookie": "4.1.3", | ||
"typescript": "5.1.3", | ||
"undici": "5.22.1", | ||
"urllib": "3.17.1" | ||
"typescript": "5.3.3", | ||
"undici": "6.2.1", | ||
"urllib": "3.19.1" | ||
}, | ||
@@ -127,4 +127,4 @@ "peerDependencies": { | ||
"engines": { | ||
"node": ">=14.18.0 <15.0.0 || >=16.0.0" | ||
"node": ">=18.0.0" | ||
} | ||
} |
@@ -36,9 +36,27 @@ # HTTP Cookie Agent | ||
See also [examples](./examples) for more details. | ||
### Supported libraries | ||
Node.js global fetch / `undici` / `node:http` / `node:https` / `axios` / `node-fetch` / `got`\*\* / `superagent`\*\* / `request`\*\* / `needle` / `phin` / `@hapi/wreck` / `urllib` etc. | ||
| Library | Supported? | | ||
| -------------------- | ----------------- | | ||
| Node.js global fetch | ✅ | | ||
| `undici` | ✅ | | ||
| `node:http` | ✅ | | ||
| `node:https` | ✅ | | ||
| `axios` | ✅ | | ||
| `node-fetch` | ✅ | | ||
| `got` | ✅ <sup>\*1</sup> | | ||
| `superagent` | ✅ <sup>\*1</sup> | | ||
| `request` | ✅ <sup>\*1</sup> | | ||
| `needle` | ✅ | | ||
| `phin` | ✅ | | ||
| `@hapi/wrech` | ✅ | | ||
| `urllib` | ✅ | | ||
| Bun global fetch | ❌ <sup>\*2</sup> | | ||
| Deno global fetch | ❌ <sup>\*2</sup> | | ||
\*\* The library supports cookies by default. You may not need `http-cookie-agent`. | ||
\*1: This library supports cookies by default. You may not need `http-cookie-agent`. | ||
See also [examples](./examples) for more details. | ||
\*2: There have proprietary fetch implementation and is [not currently supported](https://github.com/3846masa/http-cookie-agent/issues/692). | ||
@@ -45,0 +63,0 @@ #### Node.js global fetch |
33038
538
362