openapi-fetch
Advanced tools
Comparing version 0.12.4 to 0.12.5
# openapi-fetch | ||
## 0.12.5 | ||
### Patch Changes | ||
- [#1937](https://github.com/openapi-ts/openapi-typescript/pull/1937) [`06163a2`](https://github.com/openapi-ts/openapi-typescript/commit/06163a2030eaf8d0579f624d86481e1205aef396) Thanks [@DjordyKoert](https://github.com/DjordyKoert)! - client data & error now return a union of possible types | ||
- Updated dependencies [[`06163a2`](https://github.com/openapi-ts/openapi-typescript/commit/06163a2030eaf8d0579f624d86481e1205aef396)]: | ||
- openapi-typescript-helpers@0.0.15 | ||
## 0.12.4 | ||
@@ -4,0 +13,0 @@ |
@@ -101,3 +101,3 @@ import type { | ||
export type FetchResponse<T, Options, Media extends MediaType> = | ||
export type FetchResponse<T extends Record<string | number, any>, Options, Media extends MediaType> = | ||
| { | ||
@@ -191,3 +191,3 @@ data: ParseAsResponse<SuccessResponse<ResponseObjectMap<T>, Media>, Options>; | ||
export type ClientForPath<PathInfo, Media extends MediaType> = { | ||
export type ClientForPath<PathInfo extends Record<string | number, any>, Media extends MediaType> = { | ||
[Method in keyof PathInfo as Uppercase<string & Method>]: <Init extends MaybeOptionalInit<PathInfo, Method>>( | ||
@@ -239,3 +239,3 @@ ...init: InitParam<Init> | ||
export type PathBasedClient<Paths, Media extends MediaType = MediaType> = { | ||
export type PathBasedClient<Paths extends Record<string | number, any>, Media extends MediaType = MediaType> = { | ||
[Path in keyof Paths]: ClientForPath<Paths[Path], Media>; | ||
@@ -242,0 +242,0 @@ }; |
@@ -101,3 +101,3 @@ import type { | ||
export type FetchResponse<T, Options, Media extends MediaType> = | ||
export type FetchResponse<T extends Record<string | number, any>, Options, Media extends MediaType> = | ||
| { | ||
@@ -191,3 +191,3 @@ data: ParseAsResponse<SuccessResponse<ResponseObjectMap<T>, Media>, Options>; | ||
export type ClientForPath<PathInfo, Media extends MediaType> = { | ||
export type ClientForPath<PathInfo extends Record<string | number, any>, Media extends MediaType> = { | ||
[Method in keyof PathInfo as Uppercase<string & Method>]: <Init extends MaybeOptionalInit<PathInfo, Method>>( | ||
@@ -239,3 +239,3 @@ ...init: InitParam<Init> | ||
export type PathBasedClient<Paths, Media extends MediaType = MediaType> = { | ||
export type PathBasedClient<Paths extends Record<string | number, any>, Media extends MediaType = MediaType> = { | ||
[Path in keyof Paths]: ClientForPath<Paths[Path], Media>; | ||
@@ -242,0 +242,0 @@ }; |
{ | ||
"name": "openapi-fetch", | ||
"description": "Fast, type-safe fetch client for your OpenAPI schema. Only 6 kb (min). Works with React, Vue, Svelte, or vanilla JS.", | ||
"version": "0.12.4", | ||
"version": "0.12.5", | ||
"author": { | ||
@@ -50,3 +50,3 @@ "name": "Drew Powers", | ||
"dependencies": { | ||
"openapi-typescript-helpers": "^0.0.14" | ||
"openapi-typescript-helpers": "^0.0.15" | ||
}, | ||
@@ -53,0 +53,0 @@ "devDependencies": { |
@@ -101,3 +101,3 @@ import type { | ||
export type FetchResponse<T, Options, Media extends MediaType> = | ||
export type FetchResponse<T extends Record<string | number, any>, Options, Media extends MediaType> = | ||
| { | ||
@@ -191,3 +191,3 @@ data: ParseAsResponse<SuccessResponse<ResponseObjectMap<T>, Media>, Options>; | ||
export type ClientForPath<PathInfo, Media extends MediaType> = { | ||
export type ClientForPath<PathInfo extends Record<string | number, any>, Media extends MediaType> = { | ||
[Method in keyof PathInfo as Uppercase<string & Method>]: <Init extends MaybeOptionalInit<PathInfo, Method>>( | ||
@@ -239,3 +239,3 @@ ...init: InitParam<Init> | ||
export type PathBasedClient<Paths, Media extends MediaType = MediaType> = { | ||
export type PathBasedClient<Paths extends Record<string | number, any>, Media extends MediaType = MediaType> = { | ||
[Path in keyof Paths]: ClientForPath<Paths[Path], Media>; | ||
@@ -242,0 +242,0 @@ }; |
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
136436
+ Addedopenapi-typescript-helpers@0.0.15(transitive)
- Removedopenapi-typescript-helpers@0.0.14(transitive)