@ts-rest/express
Advanced tools
Comparing version 3.23.0-beta.0 to 3.23.0
# @ts-rest/express | ||
## 3.23.0-beta.0 | ||
## 3.23.0 | ||
### Minor Changes | ||
- b84b0df: Add middleware directly through ts-rest with type-safe injected route object | ||
- 74bb4a8: Implement strict mode at a contract level. Strict mode ensures that only known responses are allowed by the type system. This applies both on the server and client side. Enable this with `strictStatusCodes: true` when defining a contract. If you would like to have the vanilla client throw an error when the response status is not known then you will need to use `throwOnUnknownStatus` when initializing the client. | ||
- 74e41dc: Add middleware directly through ts-rest with type-safe injected route object | ||
@@ -9,0 +10,0 @@ ## 3.22.0 |
@@ -7,10 +7,2 @@ 'use strict'; | ||
function getValue(data, path, defaultValue) { | ||
const value = path | ||
.split(/[.[\]]/) | ||
.filter(Boolean) | ||
.reduce((value, key) => value === null || value === void 0 ? void 0 : value[key], data); | ||
return value !== undefined ? value : defaultValue; | ||
} | ||
const isAppRouteImplementation = (obj) => { | ||
@@ -205,3 +197,2 @@ return typeof obj === 'function'; | ||
exports.createExpressEndpoints = createExpressEndpoints; | ||
exports.getValue = getValue; | ||
exports.initServer = initServer; |
{ | ||
"name": "@ts-rest/express", | ||
"version": "3.23.0-beta.0", | ||
"version": "3.23.0", | ||
"peerDependencies": { | ||
"express": "^4.0.0", | ||
"zod": "^3.0.0", | ||
"@ts-rest/core": "3.23.0-beta.0" | ||
"@ts-rest/core": "3.23.0" | ||
}, | ||
@@ -9,0 +9,0 @@ "peerDependenciesMeta": { |
@@ -56,2 +56,5 @@ # ts-rest | ||
}, | ||
headers: z.object({ | ||
'x-pagination-page': z.coerce.number().optional(), | ||
}), | ||
}, | ||
@@ -78,2 +81,3 @@ }); | ||
const result = await client.getPosts({ | ||
headers: { 'x-pagination-page': 1 }, | ||
query: { skip: 0, take: 10 }, | ||
@@ -100,4 +104,4 @@ // ^-- Fully typed! | ||
<div align="center" style={{margin: "50px"}}> | ||
<h2>๐ Read more on the official <a href="https://ts-rest.com/docs/quickstart?utm_source=github&utm_medium=documentation&utm_campaign=readme">Quickstart Guide</a>๐</h2> | ||
<div align="center"> | ||
<h3>๐ Read more on the official <a href="https://ts-rest.com/docs/quickstart?utm_source=github&utm_medium=documentation&utm_campaign=readme">Quickstart Guide</a> ๐</h3> | ||
</div> | ||
@@ -125,2 +129,3 @@ | ||
<td align="center" valign="top" width="14.28%"><a href="http://rifaldhiaw.com"><img src="https://avatars.githubusercontent.com/u/7936061?v=4?s=100" width="100px;" alt="Rifaldhi AW"/><br /><sub><b>Rifaldhi AW</b></sub></a><br /><a href="https://github.com/ts-rest/ts-rest/commits?author=rifaldhiaw" title="Documentation">๐</a></td> | ||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Jwcode-uk"><img src="https://avatars.githubusercontent.com/u/30149596?v=4?s=100" width="100px;" alt="Jonathan White "/><br /><sub><b>Jonathan White </b></sub></a><br /><a href="https://github.com/ts-rest/ts-rest/commits?author=Jwcode-uk" title="Code">๐ป</a> <a href="https://github.com/ts-rest/ts-rest/commits?author=Jwcode-uk" title="Documentation">๐</a></td> | ||
</tr> | ||
@@ -127,0 +132,0 @@ </tbody> |
@@ -1,4 +0,3 @@ | ||
export * from './lib/get-value'; | ||
export * from './lib/ts-rest-express'; | ||
export { TsRestRequest, TsRestRequestHandler } from './lib/types'; | ||
export { RequestValidationError } from './lib/request-validation-error'; |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
29700
1
151
10
440