Comparing version 1.0.4 to 1.0.5
export { Zodios } from "./zodios"; | ||
export type { AnyEndpointDescription } from "./zodios.types"; | ||
export type { ZodiosEndpointDescription } from "./zodios.types"; |
import { AxiosInstance } from "axios"; | ||
import { AnyEndpointDescription, ApiClientRequestOptions, Body, Method, Paths, Response, TokenProvider } from "./zodios.types"; | ||
import { ZodiosEndpointDescription, ZodiosRequestOptions, Body, Method, Paths, Response, TokenProvider } from "./zodios.types"; | ||
import { ReadonlyDeep } from "./utils.types"; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export declare class Zodios<Api extends ReadonlyDeep<AnyEndpointDescription<any>[]>> { | ||
export declare class Zodios<Api extends ReadonlyDeep<ZodiosEndpointDescription<any>[]>> { | ||
private api; | ||
@@ -36,3 +36,3 @@ private provider?; | ||
*/ | ||
request<M extends Method, Path extends Paths<Api, M>>(method: M, url: Path, data?: Body<Api, M, Path>, config?: ApiClientRequestOptions<Api, M, Path>): Promise<Response<Api, M, Path>>; | ||
request<M extends Method, Path extends Paths<Api, M>>(method: M, url: Path, data?: Body<Api, M, Path>, config?: ZodiosRequestOptions<Api, M, Path>): Promise<Response<Api, M, Path>>; | ||
/** | ||
@@ -44,3 +44,3 @@ * make a get request to the api | ||
*/ | ||
get<Path extends Paths<Api, "get">>(url: Path, config?: ApiClientRequestOptions<Api, "get", Path>): Promise<Response<Api, "get", Path>>; | ||
get<Path extends Paths<Api, "get">>(url: Path, config?: ZodiosRequestOptions<Api, "get", Path>): Promise<Response<Api, "get", Path>>; | ||
/** | ||
@@ -53,3 +53,3 @@ * make a post request to the api | ||
*/ | ||
post<Path extends Paths<Api, "post">>(url: Path, data?: Body<Api, "post", Path>, config?: ApiClientRequestOptions<Api, "post", Path>): Promise<Response<Api, "post", Path>>; | ||
post<Path extends Paths<Api, "post">>(url: Path, data?: Body<Api, "post", Path>, config?: ZodiosRequestOptions<Api, "post", Path>): Promise<Response<Api, "post", Path>>; | ||
/** | ||
@@ -62,3 +62,3 @@ * make a put request to the api | ||
*/ | ||
put<Path extends Paths<Api, "put">>(url: Path, data?: Body<Api, "put", Path>, config?: ApiClientRequestOptions<Api, "put", Path>): Promise<Response<Api, "put", Path>>; | ||
put<Path extends Paths<Api, "put">>(url: Path, data?: Body<Api, "put", Path>, config?: ZodiosRequestOptions<Api, "put", Path>): Promise<Response<Api, "put", Path>>; | ||
/** | ||
@@ -71,3 +71,3 @@ * make a patch request to the api | ||
*/ | ||
patch<Path extends Paths<Api, "patch">>(url: Path, data?: Body<Api, "patch", Path>, config?: ApiClientRequestOptions<Api, "patch", Path>): Promise<Response<Api, "patch", Path>>; | ||
patch<Path extends Paths<Api, "patch">>(url: Path, data?: Body<Api, "patch", Path>, config?: ZodiosRequestOptions<Api, "patch", Path>): Promise<Response<Api, "patch", Path>>; | ||
/** | ||
@@ -79,3 +79,3 @@ * make a delete request to the api | ||
*/ | ||
delete<Path extends Paths<Api, "delete">>(url: Path, config?: ApiClientRequestOptions<Api, "delete", Path>): Promise<Response<Api, "delete", Path>>; | ||
delete<Path extends Paths<Api, "delete">>(url: Path, config?: ZodiosRequestOptions<Api, "delete", Path>): Promise<Response<Api, "delete", Path>>; | ||
} |
@@ -26,3 +26,3 @@ import { AxiosRequestConfig } from "axios"; | ||
}>>>>>; | ||
export declare type AnyApiClientRequestOptions = { | ||
export declare type AnyZodiosRequestOptions = { | ||
params?: Record<string, unknown>; | ||
@@ -32,3 +32,3 @@ queries?: Record<string, unknown>; | ||
} & Omit<AxiosRequestConfig, "params" | "headers" | "baseURL" | "data" | "method">; | ||
export declare type ApiClientRequestOptions<Api, M extends Method, Path> = PickDefined<{ | ||
export declare type ZodiosRequestOptions<Api, M extends Method, Path> = PickDefined<{ | ||
params: PathParams<Api, M, Path>; | ||
@@ -51,3 +51,3 @@ queries: QueryParams<Api, M, Path>; | ||
*/ | ||
export declare type AnyEndpointDescription<R> = { | ||
export declare type ZodiosEndpointDescription<R> = { | ||
method: Method; | ||
@@ -54,0 +54,0 @@ path: string; |
{ | ||
"name": "zodios", | ||
"description": "Typescript API client with autocompletion and zod validations", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "lib/index.d.ts", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
55590