@navios/navios-zod
Advanced tools
Comparing version 0.4.0-alpha.1 to 0.4.0-alpha.2
@@ -54,3 +54,3 @@ import * as navios from 'navios'; | ||
type Endpoint<Config extends EndpointConfig | EndpointWithDataConfig> = UrlHasParams<Config['url']> extends true ? RequiredRequestEndpoint<Config> : Config extends EndpointWithDataConfig ? RequiredRequestEndpoint<Config> : Config['querySchema'] extends AnyZodObject ? RequiredRequestEndpoint<Config> : OptionalRequestEndpoint<Config>; | ||
type DataEndpointType<RequestSchema extends AnyZodObject, ResponseSchema extends AnyZodObject | ZodDiscriminatedUnion<any, any>, QuerySchema extends AnyZodObject | undefined = undefined> = Endpoint<{ | ||
type DataEndpointType<RequestSchema extends AnyZodObject, ResponseSchema extends AnyZodObject | ZodDiscriminatedUnion<any, any>, QuerySchema extends AnyZodObject | undefined = undefined> = QuerySchema extends undefined ? Endpoint<{ | ||
method: 'POST' | 'PUT' | 'PATCH'; | ||
@@ -60,8 +60,17 @@ requestSchema: RequestSchema; | ||
url: string; | ||
}> : Endpoint<{ | ||
method: 'POST' | 'PUT' | 'PATCH'; | ||
requestSchema: RequestSchema; | ||
responseSchema: ResponseSchema; | ||
url: string; | ||
querySchema: QuerySchema; | ||
}>; | ||
type EndpointType<ResponseSchema extends AnyZodObject | ZodDiscriminatedUnion<any, any>, QuerySchema extends AnyZodObject | undefined = undefined> = Endpoint<{ | ||
type EndpointType<ResponseSchema extends AnyZodObject | ZodDiscriminatedUnion<any, any>, QuerySchema extends AnyZodObject | undefined = undefined> = QuerySchema extends undefined ? Endpoint<{ | ||
method: HttpMethod; | ||
responseSchema: ResponseSchema; | ||
url: string; | ||
}> : Endpoint<{ | ||
method: HttpMethod; | ||
responseSchema: ResponseSchema; | ||
url: string; | ||
querySchema: QuerySchema; | ||
@@ -68,0 +77,0 @@ }>; |
{ | ||
"name": "@navios/navios-zod", | ||
"version": "0.4.0-alpha.1", | ||
"version": "0.4.0-alpha.2", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Oleksandr Hanzha", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53476
374