@alwatr/fetch
Advanced tools
Comparing version 4.1.7 to 4.2.0
@@ -6,2 +6,12 @@ # Change Log | ||
## [4.2.0](https://github.com/Alwatr/nanolib/compare/@alwatr/fetch@4.1.7...@alwatr/fetch@4.2.0) (2024-10-28) | ||
### Features | ||
* **fetch:** use @alwatr/http-primer for types and http codes ([6fe993a](https://github.com/Alwatr/nanolib/commit/6fe993ac0f395a4c0c6ad3b2caa48a2986cc850f)) by @AliMD | ||
### Code Refactoring | ||
* **fetch:** update HTTP headers content-type to use MimeTypes constant ([c3862fc](https://github.com/Alwatr/nanolib/commit/c3862fc6a643da97dacbd15bcf5d3351caaaf269)) by @AliMD | ||
## [4.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/fetch@4.1.6...@alwatr/fetch@4.1.7) (2024-10-25) | ||
@@ -8,0 +18,0 @@ |
@@ -0,7 +1,4 @@ | ||
import type { HttpMethod, HttpRequestHeaders, HttpStatusCode } from '@alwatr/http-primer'; | ||
import type { Duration } from '@alwatr/parse-duration'; | ||
/** | ||
* Represents the available HTTP methods. | ||
*/ | ||
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'CONNECT' | 'TRACE'; | ||
/** | ||
* Represents a dictionary of query parameters. | ||
@@ -47,3 +44,3 @@ * The keys are strings and the values can be strings, numbers, or booleans. | ||
*/ | ||
headers?: DictionaryReq<string>; | ||
headers?: Record<string, string> & HttpRequestHeaders; | ||
/** | ||
@@ -124,7 +121,7 @@ * A timeout for the fetch request. | ||
ok: true; | ||
statusCode: number; | ||
statusCode: HttpStatusCode; | ||
}; | ||
export type ResponseError = { | ||
ok: false; | ||
statusCode: number; | ||
statusCode: HttpStatusCode; | ||
errorCode: string; | ||
@@ -131,0 +128,0 @@ errorMessage: string; |
{ | ||
"name": "@alwatr/fetch", | ||
"version": "4.1.7", | ||
"version": "4.2.0", | ||
"description": "Enhanced fetch API with cache strategy, retry pattern, timeout, helper methods and enhanced types.", | ||
@@ -77,2 +77,3 @@ "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>", | ||
"@alwatr/global-this": "^1.0.2", | ||
"@alwatr/http-primer": "^1.0.0", | ||
"@alwatr/logger": "^4.0.7", | ||
@@ -90,3 +91,3 @@ "@alwatr/package-tracer": "^1.0.7", | ||
}, | ||
"gitHead": "a1e430a02f9a5711fc43f19012091bcd8806c4f9" | ||
"gitHead": "9b57df2f58636ddb4c064959950e707cf2422ecf" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110794
721
6
+ Added@alwatr/http-primer@^1.0.0
+ Added@alwatr/http-primer@1.0.1(transitive)