Socket
Socket
Sign inDemoInstall

@ts-rest/nest

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-rest/nest - npm Package Compare versions

Comparing version 3.35.0 to 3.35.1

7

CHANGELOG.md
# @ts-rest/nest
## 3.35.1
### Patch Changes
- b3fde9b: Fix Nest.js interceptor returninng promise when using new Nest.js handlers
- 14f9416: Allow Nest.js handlers to return non-promise responses
## 3.35.0

@@ -4,0 +11,0 @@

2

index.cjs.js

@@ -361,3 +361,3 @@ 'use strict';

}
return next.handle().pipe(rxjs.map(async (impl) => {
return next.handle().pipe(rxjs.mergeMap(async (impl) => {
let result = null;

@@ -364,0 +364,0 @@ try {

import { SetMetadata, Injectable, UseInterceptors, applyDecorators, Put, Patch, Post, Get, Delete, createParamDecorator, BadRequestException, InternalServerErrorException, All, HttpException, NotFoundException } from '@nestjs/common';
import { map } from 'rxjs';
import { map, mergeMap } from 'rxjs';
import { isAppRouteResponse, validateResponse as validateResponse$1, isAppRouteOtherResponse, checkZodSchema, zodErrorResponse, parseJsonQueryObject, isAppRoute } from '@ts-rest/core';

@@ -357,3 +357,3 @@ import { Reflector } from '@nestjs/core';

}
return next.handle().pipe(map(async (impl) => {
return next.handle().pipe(mergeMap(async (impl) => {
let result = null;

@@ -360,0 +360,0 @@ try {

{
"name": "@ts-rest/nest",
"version": "3.35.0",
"version": "3.35.1",
"description": "Nest server integration for @ts-rest",

@@ -5,0 +5,0 @@ "license": "MIT",

import { Reflector } from '@nestjs/core';
import { Observable } from 'rxjs';
import { BadRequestException, CallHandler, ExecutionContext, HttpException, HttpExceptionOptions, InternalServerErrorException, NestInterceptor } from '@nestjs/common';
import { AppRoute, AppRouter, ServerInferResponses } from '@ts-rest/core';
import { AppRoute, AppRouter, ServerInferResponses, Promisable } from '@ts-rest/core';
import { TsRestRequestShape } from './ts-rest-request.decorator';

@@ -21,4 +21,4 @@ import { z } from 'zod';

export declare const TsRestHandler: (appRouterOrRoute: AppRouter | AppRoute, options?: TsRestOptions) => MethodDecorator;
type NestHandlerImplementation<T extends AppRouter | AppRoute> = T extends AppRoute ? (args: TsRestRequestShape<T>) => Promise<ServerInferResponses<T>> : {
[K in keyof T]: T[K] extends AppRoute ? (args: TsRestRequestShape<T[K]>) => Promise<ServerInferResponses<T[K]>> : never;
type NestHandlerImplementation<T extends AppRouter | AppRoute> = T extends AppRoute ? (args: TsRestRequestShape<T>) => Promisable<ServerInferResponses<T>> : {
[K in keyof T]: T[K] extends AppRoute ? (args: TsRestRequestShape<T[K]>) => Promisable<ServerInferResponses<T[K]>> : never;
};

@@ -25,0 +25,0 @@ /**

@@ -1,4 +0,4 @@

import { AppRoute, AppRouter, Without, ServerInferResponses } from '@ts-rest/core';
import { AppRoute, AppRouter, Without, ServerInferResponses, Promisable } from '@ts-rest/core';
import { TsRestRequestShape } from './ts-rest-request.decorator';
type AppRouterMethodShape<T extends AppRoute> = (...args: any[]) => Promise<ServerInferResponses<T>>;
type AppRouterMethodShape<T extends AppRoute> = (...args: any[]) => Promisable<ServerInferResponses<T>>;
type AppRouterControllerShape<T extends AppRouter> = Without<{

@@ -5,0 +5,0 @@ [K in keyof T]: T[K] extends AppRoute ? AppRouterMethodShape<T[K]> : never;

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