ts-rest

RPC-like client, contract, and server implementation for a pure REST API

MIT License

Downloads
878.9K
Stars
2K
Committers
69

Bot releases are visible (Hide)

ts-rest - v3.28.0

Published by github-actions[bot] about 1 year ago

@ts-rest/[email protected]

Minor Changes

  • a7755ef: Adds support for fetch cache and support for Nextjs App Dir fetch (docs coming soon), see this PR for more info: https://github.com/ts-rest/ts-rest/pull/315
  • 16501dd: tsRestFetchApi should be more flexible when determining application/json content type header

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Minor Changes

  • 207e9c5: We now support the following versions of Nestjs:
    "@nestjs/common": "^9.0.0 || ^10.0.0",
    "@nestjs/core": "^9.0.0 || ^10.0.0",

@ts-rest/[email protected]

Minor Changes

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.27.0

Published by github-actions[bot] about 1 year ago

@ts-rest/[email protected]

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1

@ts-rest/[email protected]

Patch Changes

  • 637142f: Exposed AppRouteOptions and AppRouteImplementation types. They allow for greater developer flexibility and can be used to split router handlers.
  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1

@ts-rest/[email protected]

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1
  • f14ad97: Re-throw errors from route handlers
  • 4444929: Pass the parsed request body from zod to the route handler instead of the original request.

@ts-rest/[email protected]

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1

@ts-rest/[email protected]

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1

@ts-rest/[email protected]

Minor Changes

  • b85118a: Add support for headers (using Zod) in open-api generation, from PR #318

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1

@ts-rest/[email protected]

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1

@ts-rest/[email protected]

Patch Changes

  • 55411ad: Upgrade zod to 3.21.4
    Upgrade @anatine/zod-openapi to 2.0.1
ts-rest - v3.26.4

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Patch Changes

  • 62db9e0: fix: add support for trailing slashes in the nest multi-handler routing

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.26.3

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Patch Changes

  • 5365f2a: Fix multi-handler breaking in Fastify with query parameters

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.26.2

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Patch Changes

  • b3d3868: Remove extra peer dependencies from @ts-rest/nest

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.26.1

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Patch Changes

  • 1afbf08: Add missing ts-rest-nest support for Fastify (thanks btravers for the GH issue)

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.26.0

Published by github-actions[bot] over 1 year ago

Nest Updates

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 codes
  • no autocomplete when writing responses
  • lots of boilerplate (too much even for Nest 🤮)
  • Errors appearing in confusing places in controllers (at the controller level) not method level as we got type safety from implementing a type
  • Easy to mess up and use the wrong types/paths when writing controllers

To 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

@ts-rest/[email protected]

Minor Changes

  • fcf877d: Allow defining non-json response types in the contract
  • 48b138d: Add new SingleHandler and MultiHandler API to @ts-rest/nest
  • 2763208: Added pathPrefix to contract options to allow recursive path prefixing.

@ts-rest/[email protected]

Minor Changes

  • fcf877d: Allow defining non-json response types in the contract

@ts-rest/[email protected]

Minor Changes

  • fcf877d: Allow defining non-json response types in the contract

@ts-rest/[email protected]

Minor Changes

  • fcf877d: Allow defining non-json response types in the contract
  • 48b138d: Add new SingleHandler and MultiHandler API to @ts-rest/nest

@ts-rest/[email protected]

Minor Changes

  • fcf877d: Allow defining non-json response types in the contract

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.26.0-rc3.0

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

Minor Changes

  • e8ea535: Add new SingleHandler and MultiHandler API to @ts-rest/nest
  • 2763208: Added pathPrefix to contract options to allow recursive path prefixing.

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Minor Changes

  • e8ea535: Add new SingleHandler and MultiHandler API to @ts-rest/nest

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.26.0-rc.0

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

Minor Changes

  • e8ea535: Add new SingleHandler and MultiHandler API to @ts-rest/nest
  • 2763208: Added pathPrefix to contract options to allow recursive path prefixing.

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

Minor Changes

  • e8ea535: Add new SingleHandler and MultiHandler API to @ts-rest/nest

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - v3.25.1

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json

@ts-rest/[email protected]

Patch Changes

  • 81560d4: Fix ESM/CJS issues in package.json
ts-rest - v3.25.0

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

Patch Changes

  • bf21a75: Internal refactor of types

@ts-rest/[email protected]

Patch Changes

  • bf21a75: Internal refactor of types

@ts-rest/[email protected]

Minor Changes

  • 871466c: Added support for registering ts-rest as a Fastify plugin

Patch Changes

  • bf21a75: Internal refactor of types

@ts-rest/[email protected]

Patch Changes

  • bf21a75: Internal refactor of types

@ts-rest/[email protected]

Patch Changes

  • bf21a75: Internal refactor of types

@ts-rest/[email protected]

@ts-rest/[email protected]

Patch Changes

  • bf21a75: Internal refactor of types

@ts-rest/[email protected]

Patch Changes

  • bf21a75: Internal refactor of types
ts-rest - v3.23.0

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

Minor Changes

  • 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.
  • df77869: Response headers are now exposed to clients. Users of custom API fetchers should start returning headers.
  • 74e41dc: Add 'metadata' property to routes

⚠️ BREAKING CHANGES FOR APPS USING CUSTOM CLIENTS ⚠️

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())

@ts-rest/[email protected]

Minor Changes

  • 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

@ts-rest/[email protected]

Minor Changes

  • 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.

@ts-rest/[email protected]

Minor Changes

  • 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.

@ts-rest/[email protected]

@ts-rest/[email protected]

Minor Changes

  • df77869: Response headers are now exposed to clients. Users of custom API fetchers should start returning headers.

@ts-rest/[email protected]

Minor Changes

  • df77869: Response headers are now exposed to clients. Users of custom API fetchers should start returning headers.
ts-rest - v3.23.0-beta.0

Published by github-actions[bot] over 1 year ago

@ts-rest/[email protected]

Minor Changes

  • b84b0df: Add 'metadata' property to routes

@ts-rest/[email protected]

Minor Changes

  • b84b0df: Add middleware directly through ts-rest with type-safe injected route object

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

@ts-rest/[email protected]

ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] over 1 year ago

Minor Changes

  • e490cf3: - Added server-side response validation feature
  • Deprecated @Api decorator, use @TsRest instead
ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] over 1 year ago

ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] over 1 year ago

ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • d778e60: Rebuilt without code comments in the compiled JS
ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] over 1 year ago

ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • e0164f6: Publish README
ts-rest - @ts-rest/[email protected]

Published by github-actions[bot] almost 2 years ago

Minor Changes

  • 5a13803: Allow typed query parameters by encoding them as JSON strings (disabled by default)