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.20.0 to 3.21.0

index.mjs

34

index.js

@@ -0,1 +1,5 @@

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const isZodType = (obj) => {

@@ -202,3 +206,3 @@ return typeof (obj === null || obj === void 0 ? void 0 : obj.safeParse) === 'function';

};
const fetchApi = ({ path, clientArgs, route, body, extraInputArgs, headers, }) => {
const fetchApi = ({ path, clientArgs, route, body, query, extraInputArgs, headers, }) => {
const apiFetcher = clientArgs.api || tsRestFetchApi;

@@ -222,2 +226,3 @@ const combinedHeaders = {

rawBody: body,
rawQuery: query,
contentType: 'multipart/form-data',

@@ -237,2 +242,3 @@ ...extraInputArgs,

rawBody: body,
rawQuery: query,
contentType: route.method !== 'GET' ? 'application/json' : undefined,

@@ -259,2 +265,3 @@ ...extraInputArgs,

body,
query,
extraInputArgs,

@@ -308,2 +315,25 @@ headers: {

export { ResponseValidationError, checkZodSchema, convertQueryParamsToUrlString, encodeQueryParams, encodeQueryParamsJson, extractZodObjectShape, fetchApi, getCompleteUrl, getRouteQuery, getRouteResponses, initClient, initContract, initTsRest, insertParamsIntoPath, isAppRoute, isAppRouteResponse, isZodObject, isZodObjectStrict, isZodType, parseJsonQueryObject, tsRestFetchApi, validateResponse, zodErrorResponse, zodMerge };
exports.ResponseValidationError = ResponseValidationError;
exports.checkZodSchema = checkZodSchema;
exports.convertQueryParamsToUrlString = convertQueryParamsToUrlString;
exports.encodeQueryParams = encodeQueryParams;
exports.encodeQueryParamsJson = encodeQueryParamsJson;
exports.extractZodObjectShape = extractZodObjectShape;
exports.fetchApi = fetchApi;
exports.getCompleteUrl = getCompleteUrl;
exports.getRouteQuery = getRouteQuery;
exports.getRouteResponses = getRouteResponses;
exports.initClient = initClient;
exports.initContract = initContract;
exports.initTsRest = initTsRest;
exports.insertParamsIntoPath = insertParamsIntoPath;
exports.isAppRoute = isAppRoute;
exports.isAppRouteResponse = isAppRouteResponse;
exports.isZodObject = isZodObject;
exports.isZodObjectStrict = isZodObjectStrict;
exports.isZodType = isZodType;
exports.parseJsonQueryObject = parseJsonQueryObject;
exports.tsRestFetchApi = tsRestFetchApi;
exports.validateResponse = validateResponse;
exports.zodErrorResponse = zodErrorResponse;
exports.zodMerge = zodMerge;

11

package.json
{
"name": "@ts-rest/core",
"version": "3.20.0",
"version": "3.21.0",
"description": "RPC-like experience over a regular REST API, with type safe server implementations 🪄",

@@ -33,5 +33,4 @@ "license": "MIT",

},
"module": "./index.js",
"main": "./index.cjs",
"type": "module",
"module": "./index.mjs",
"main": "./index.js",
"types": "./src/index.d.ts",

@@ -41,6 +40,6 @@ "exports": {

"types": "./src/index.d.ts",
"import": "./index.js",
"require": "./index.cjs"
"import": "./index.mjs",
"require": "./index.js"
}
}
}

@@ -28,3 +28,3 @@ import { AppRoute, AppRouteMutation, AppRouter } from './dsl';

extraHeaders?: {
[K in NonNullable<keyof THeaders>]: never;
[K in NonNullable<keyof THeaders>]?: never;
} & Record<string, string | undefined>;

@@ -67,2 +67,3 @@ } & ExtractExtraParametersFromClientArgs<TClientArgs>;

rawBody: unknown;
rawQuery: unknown;
contentType: AppRouteMutation['contentType'];

@@ -83,6 +84,7 @@ credentials?: RequestCredentials;

export declare const tsRestFetchApi: ApiFetcher;
export declare const fetchApi: ({ path, clientArgs, route, body, extraInputArgs, headers, }: {
export declare const fetchApi: ({ path, clientArgs, route, body, query, extraInputArgs, headers, }: {
path: string;
clientArgs: ClientArgs;
route: AppRoute;
query: unknown;
body: unknown;

@@ -89,0 +91,0 @@ extraInputArgs: Record<string, unknown>;

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