@ts-rest/express
Advanced tools
Comparing version 3.10.2 to 3.11.0
# @ts-rest/express | ||
## 3.11.0 | ||
## 3.10.2 | ||
@@ -4,0 +6,0 @@ |
{ | ||
"name": "@ts-rest/express", | ||
"version": "3.10.2", | ||
"version": "3.11.0", | ||
"peerDependenciesMeta": { | ||
@@ -15,3 +15,3 @@ "zod": { | ||
"zod": "3.x.x", | ||
"@ts-rest/core": "3.10.2", | ||
"@ts-rest/core": "3.11.0", | ||
"@swc/helpers": "0.4.11" | ||
@@ -18,0 +18,0 @@ }, |
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
import { AppRoute, AppRouteMutation, AppRouteQuery, AppRouter, PathParamsWithCustomValidators, Without, ZodInferOrType } from '@ts-rest/core'; | ||
export declare type ApiRouteResponse<T> = { | ||
export type ApiRouteResponse<T> = { | ||
[K in keyof T]: { | ||
@@ -12,3 +12,3 @@ status: K; | ||
}[keyof T]; | ||
declare type AppRouteQueryImplementation<T extends AppRouteQuery> = (input: Without<{ | ||
type AppRouteQueryImplementation<T extends AppRouteQuery> = (input: Without<{ | ||
params: PathParamsWithCustomValidators<T>; | ||
@@ -19,4 +19,4 @@ query: ZodInferOrType<T['query']>; | ||
}, never>) => Promise<ApiRouteResponse<T['responses']>>; | ||
declare type WithoutFileIfMultiPart<T extends AppRouteMutation> = T['contentType'] extends 'multipart/form-data' ? Without<ZodInferOrType<T['body']>, File> : ZodInferOrType<T['body']>; | ||
declare type AppRouteMutationImplementation<T extends AppRouteMutation> = (input: Without<{ | ||
type WithoutFileIfMultiPart<T extends AppRouteMutation> = T['contentType'] extends 'multipart/form-data' ? Without<ZodInferOrType<T['body']>, File> : ZodInferOrType<T['body']>; | ||
type AppRouteMutationImplementation<T extends AppRouteMutation> = (input: Without<{ | ||
params: PathParamsWithCustomValidators<T>; | ||
@@ -30,4 +30,4 @@ query: ZodInferOrType<T['query']>; | ||
}, never>) => Promise<ApiRouteResponse<T['responses']>>; | ||
declare type AppRouteImplementation<T extends AppRoute> = T extends AppRouteMutation ? AppRouteMutationImplementation<T> : T extends AppRouteQuery ? AppRouteQueryImplementation<T> : never; | ||
declare type RecursiveRouterObj<T extends AppRouter> = { | ||
type AppRouteImplementation<T extends AppRoute> = T extends AppRouteMutation ? AppRouteMutationImplementation<T> : T extends AppRouteQuery ? AppRouteQueryImplementation<T> : never; | ||
type RecursiveRouterObj<T extends AppRouter> = { | ||
[TKey in keyof T]: T[TKey] extends AppRouter ? RecursiveRouterObj<T[TKey]> : T[TKey] extends AppRoute ? AppRouteImplementation<T[TKey]> : never; | ||
@@ -34,0 +34,0 @@ }; |
22087