RPC-like client, contract, and server implementation for a pure REST API
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
AppRouteOptions
and AppRouteImplementation
types. They allow for greater developer flexibility and can be used to split router handlers.Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
The core team has been iterating on the design of the nest lib over the last 6 or so months, little bits and pieces have been renamed, some pieces deprecated - but the underlying DX has still been far below the standards we've set out with the express/next and now fastify libs.
as const
required on status codesTo address all of these problems we've released a new API with two available approaches, single handler and multi handler - each with their pros and cons, but together we've felt like these provide enough variation for teams to pick their own poison (🎶 Recommended to pick one pattern and stick to it to reduce complexity) - the update is 3.26.0 and also contains a whole host of massive upgrades under the hood.
On migration, this is a non breaking update, the old API is still fully supported and likely isn't going anywhere until we finally have a major version (nothing planned on the immediate horizon, the update would just be removing deprecated APIs most likely) - the philosophy behind ts-rest has always been that of; easy adoption, little overhead above existing libraries, and maintainability.
To remain in-line with our philosophy we've made some tooling to update your Nest controllers using ts-rest to the latest standard, whether that be single/multi handler we've made a AST modification script to update you to the latest API design for free https://ts-rest.com/docs/nest/legacy
However, half of the philosophy behind
https://github.com/ts-rest/ts-rest/assets/47489826/1387d79b-3711-4b23-8791-eafb5ebd13ee
SingleHandler
and MultiHandler
API to @ts-rest/nest
pathPrefix
to contract options to allow recursive path prefixing.SingleHandler
and MultiHandler
API to @ts-rest/nest
Published by github-actions[bot] over 1 year ago
SingleHandler
and MultiHandler
API to @ts-rest/nest
pathPrefix
to contract options to allow recursive path prefixing.SingleHandler
and MultiHandler
API to @ts-rest/nest
Published by github-actions[bot] over 1 year ago
SingleHandler
and MultiHandler
API to @ts-rest/nest
pathPrefix
to contract options to allow recursive path prefixing.SingleHandler
and MultiHandler
API to @ts-rest/nest
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
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.If you are using a custom API fetcher, you need to start returning response headers from your fetcher as a Web API Headers interface.
If you are using fetch
, just simply return response.headers
.
If you are using axios
, you can return new Headers(response.headers.toJSON())
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.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.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.Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
@Api
decorator, use @TsRest
insteadPublished by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] almost 2 years ago