@ts-rest/core
Advanced tools
Comparing version 3.18.1 to 3.19.0
@@ -94,2 +94,5 @@ const isAppRoute = (obj) => { | ||
function getRouteResponses(router) { | ||
return {}; | ||
} | ||
const tsRestFetchApi = async ({ path, method, headers, body, credentials, }) => { | ||
@@ -247,2 +250,2 @@ const result = await fetch(path, { method, headers, body, credentials }); | ||
export { ResponseValidationError, checkZodSchema, convertQueryParamsToUrlString, encodeQueryParams, encodeQueryParamsJson, fetchApi, getCompleteUrl, getRouteQuery, initClient, initContract, initTsRest, insertParamsIntoPath, isAppRoute, isAppRouteResponse, isZodObject, parseJsonQueryObject, tsRestFetchApi, validateResponse, zodErrorResponse }; | ||
export { ResponseValidationError, checkZodSchema, convertQueryParamsToUrlString, encodeQueryParams, encodeQueryParamsJson, fetchApi, getCompleteUrl, getRouteQuery, getRouteResponses, initClient, initContract, initTsRest, insertParamsIntoPath, isAppRoute, isAppRouteResponse, isZodObject, parseJsonQueryObject, tsRestFetchApi, validateResponse, zodErrorResponse }; |
{ | ||
"name": "@ts-rest/core", | ||
"version": "3.18.1", | ||
"version": "3.19.0", | ||
"description": "RPC-like experience over a regular REST API, with type safe server implementations 🪄", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -10,1 +10,2 @@ export * from './lib/client'; | ||
export * from './lib/response-validation-error'; | ||
export * from './lib/infer-types'; |
@@ -16,3 +16,3 @@ import { AppRoute, AppRouteMutation, AppRouter } from './dsl'; | ||
*/ | ||
export type PathParamsWithCustomValidators<T extends AppRoute> = T['pathParams'] extends undefined ? PathParamsFromUrl<T> : Merge<PathParamsFromUrl<T>, ZodInferOrType<T['pathParams']>>; | ||
export type PathParamsWithCustomValidators<T extends AppRoute, TClientOrServer extends 'client' | 'server' = 'server'> = T['pathParams'] extends undefined ? PathParamsFromUrl<T> : Merge<PathParamsFromUrl<T>, TClientOrServer extends 'server' ? ZodInferOrType<T['pathParams']> : ZodInputOrType<T['pathParams']>>; | ||
type AppRouteBodyOrFormData<T extends AppRouteMutation> = T['contentType'] extends 'multipart/form-data' ? FormData | AppRouteMutationType<T['body']> : AppRouteMutationType<T['body']>; | ||
@@ -45,2 +45,10 @@ /** | ||
/** | ||
* @deprecated Only safe to use on the client-side. Use `ServerInferResponses`/`ClientInferResponses` instead. | ||
*/ | ||
export type ApiResponseForRoute<T extends AppRoute> = ApiRouteResponse<T['responses']>; | ||
/** | ||
* @deprecated Only safe to use on the client-side. Use `ServerInferResponses`/`ClientInferResponses` instead. | ||
*/ | ||
export declare function getRouteResponses<T extends AppRouter>(router: T): { [K in keyof T]: T[K] extends AppRoute ? ApiResponseForRoute<T[K]> : "not a route"; }; | ||
/** | ||
* Returned from a mutation or query call | ||
@@ -47,0 +55,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
43571
17
892