Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ts-rest/core

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-rest/core - npm Package Compare versions

Comparing version 3.18.1 to 3.19.0

src/lib/infer-types.d.ts

5

index.js

@@ -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 };

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc