@ts-rest/core
Advanced tools
Comparing version 3.49.4 to 3.50.0
# @ts-rest/core | ||
## 3.50.0 | ||
### Minor Changes | ||
- 83f6675: Do not require `body` to be defined for DELETE endpoints in contracts | ||
## 3.49.4 | ||
@@ -4,0 +10,0 @@ |
@@ -396,3 +396,3 @@ 'use strict'; | ||
if (route.method !== 'GET') { | ||
if (route.contentType === 'multipart/form-data') { | ||
if ('contentType' in route && route.contentType === 'multipart/form-data') { | ||
fetcherArgs = { | ||
@@ -404,3 +404,4 @@ ...fetcherArgs, | ||
} | ||
else if (route.contentType === 'application/x-www-form-urlencoded') { | ||
else if ('contentType' in route && | ||
route.contentType === 'application/x-www-form-urlencoded') { | ||
fetcherArgs = { | ||
@@ -407,0 +408,0 @@ ...fetcherArgs, |
{ | ||
"name": "@ts-rest/core", | ||
"version": "3.49.4", | ||
"version": "3.50.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "RPC-like experience over a regular REST API, with type safe server implementations 🪄", |
@@ -54,2 +54,9 @@ import { Merge, Opaque, Prettify, WithoutUnknown } from './type-utils'; | ||
}; | ||
/** | ||
* A mutation endpoint. In REST terms, one using POST, PUT, | ||
* PATCH, or DELETE. | ||
*/ | ||
export type AppRouteDeleteNoBody = AppRouteCommon & { | ||
method: 'DELETE'; | ||
}; | ||
type ValidatedHeaders<T extends AppRoute, TOptions extends RouterOptions, TOptionsApplied = ApplyOptions<T, TOptions>> = 'headers' extends keyof TOptionsApplied ? TOptionsApplied['headers'] extends MixedZodError<infer A, infer B> ? { | ||
@@ -82,3 +89,3 @@ _error: 'Cannot mix plain object types with Zod objects for headers'; | ||
*/ | ||
export type AppRoute = AppRouteQuery | AppRouteMutation; | ||
export type AppRoute = AppRouteQuery | AppRouteMutation | AppRouteDeleteNoBody; | ||
export type AppRouteStrictStatusCodes = Omit<AppRoute, 'strictStatusCodes'> & { | ||
@@ -85,0 +92,0 @@ strictStatusCodes: true; |
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
107162
1934