feat: Implement comprehensive web request handling with caching, retry, and interceptors

- Added cache strategies: NetworkFirst, CacheFirst, StaleWhileRevalidate, NetworkOnly, and CacheOnly.
- Introduced InterceptorManager for managing request, response, and error interceptors.
- Developed RetryManager for handling request retries with customizable backoff strategies.
- Implemented RequestDeduplicator to prevent simultaneous identical requests.
- Created timeout utilities for handling request timeouts.
- Enhanced WebrequestClient to support global interceptors, caching, and retry logic.
- Added convenience methods for common HTTP methods (GET, POST, PUT, DELETE) with JSON handling.
- Established a fetch-compatible webrequest function for seamless integration.
- Defined core type structures for caching, retry options, interceptors, and web request configurations.
This commit is contained in:
2025-10-20 09:59:24 +00:00
parent e228ed4ba0
commit 54afcc46e2
30 changed files with 18693 additions and 4031 deletions

View File

@@ -1,31 +1,29 @@
{
"name": "@push.rocks/webrequest",
"version": "3.0.37",
"version": "4.0.0",
"private": false,
"description": "A module for making secure web requests from browsers with support for caching and fault tolerance.",
"description": "Modern, fetch-compatible web request library with intelligent HTTP caching, retry strategies, and fault tolerance.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "(tstest test/ --web)",
"test": "(tstest test/ --verbose)",
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@api.global/typedserver": "^3.0.27",
"@git.zone/tsbuild": "^2.1.72",
"@git.zone/tsbuild": "^2.6.8",
"@git.zone/tsbundle": "^2.0.15",
"@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.88",
"@push.rocks/tapbundle": "^5.0.23",
"@git.zone/tstest": "^2.6.2",
"@types/node": "^20.12.7"
},
"dependencies": {
"@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartenv": "^5.0.12",
"@push.rocks/smartjson": "^5.0.19",
"@push.rocks/smartjson": "^5.2.0",
"@push.rocks/smartpromise": "^4.0.3",
"@push.rocks/webstore": "^2.0.13"
},
@@ -57,9 +55,16 @@
"multi-endpoint",
"fetch API"
],
"homepage": "https://code.foss.global/push.rocks/webrequest",
"homepage": "https://code.foss.global/push.rocks/webrequest#readme",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/webrequest.git"
},
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
"bugs": {
"url": "https://code.foss.global/push.rocks/webrequest/issues"
},
"pnpm": {
"overrides": {}
}
}
}