Module: @ts-rest/nest
Classes
- RequestValidationError
- ResponseValidationError
- TsRestException
- TsRestHandlerInterceptor
- TsRestInterceptor
- TsRestModule
Type Aliases
NestControllerContract
Ƭ NestControllerContract<T
>: Pick
<T
, { [K in keyof T]-?: T[K] extends AppRoute ? K : never }[keyof T
]>
Type parameters
Name | Type |
---|---|
T | extends AppRouter |
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest.ts:49
NestControllerInterface
Ƭ NestControllerInterface<T
>: AppRouterControllerShape
<T
>
Type parameters
Name | Type |
---|---|
T | extends AppRouter |
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest.ts:55
NestRequestShapes
Ƭ NestRequestShapes<T
>: AppRouterRequestShapes
<T
>
Type parameters
Name | Type |
---|---|
T | extends AppRouter |
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest.ts:57
NestResponseShapes
Ƭ NestResponseShapes<T
>: AppRouterResponseShapes
<T
>
Type parameters
Name | Type |
---|---|
T | extends AppRouter |
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest.ts:58
TsRestOptions
Ƭ TsRestOptions: Object
Type declaration
Name | Type |
---|---|
jsonQuery? | boolean |
validateRequestBody? | boolean |
validateRequestHeaders? | boolean |
validateRequestQuery? | boolean |
validateResponses? | boolean |
Defined in
libs/ts-rest/nest/src/lib/ts-rest-options.ts:4
TsRestRequestShape
Ƭ TsRestRequestShape<TRoute
>: ServerInferRequest
<TRoute
, Request
["headers"
]>
Type parameters
Name | Type |
---|---|
TRoute | extends AppRoute |
Defined in
libs/ts-rest/nest/src/lib/ts-rest-request.decorator.ts:24
Variables
RequestValidationErrorSchema
• Const
RequestValidationErrorSchema: ZodObject
<{ bodyResult
: ZodNullable
<ZodObject
<{ issues
: ZodArray
<ZodObject
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, "strip"
, ZodAny
, objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>, objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>>, "many"
> ; name
: ZodLiteral
<"ZodError"
> }, "strip"
, ZodTypeAny
, { issues
: objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}, { issues
: objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}>> ; headersResult
: ZodNullable
<ZodObject
<{ issues
: ZodArray
<ZodObject
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, "strip"
, ZodAny
, objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>, objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>>, "many"
> ; name
: ZodLiteral
<"ZodError"
> }, "strip"
, ZodTypeAny
, { issues
: objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}, { issues
: objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}>> ; paramsResult
: ZodNullable
<ZodObject
<{ issues
: ZodArray
<ZodObject
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, "strip"
, ZodAny
, objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>, objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>>, "many"
> ; name
: ZodLiteral
<"ZodError"
> }, "strip"
, ZodTypeAny
, { issues
: objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}, { issues
: objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}>> ; queryResult
: ZodNullable
<ZodObject
<{ issues
: ZodArray
<ZodObject
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, "strip"
, ZodAny
, objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>, objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>>, "many"
> ; name
: ZodLiteral
<"ZodError"
> }, "strip"
, ZodTypeAny
, { issues
: objectOutputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}, { issues
: objectInputType
<{ code
: ZodNativeEnum
<{ custom
: "custom"
; invalid_arguments
: "invalid_arguments"
; invalid_date
: "invalid_date"
; invalid_enum_value
: "invalid_enum_value"
; invalid_intersection_types
: "invalid_intersection_types"
; invalid_literal
: "invalid_literal"
; invalid_return_type
: "invalid_return_type"
; invalid_string
: "invalid_string"
; invalid_type
: "invalid_type"
; invalid_union
: "invalid_union"
; invalid_union_discriminator
: "invalid_union_discriminator"
; not_finite
: "not_finite"
; not_multiple_of
: "not_multiple_of"
; too_big
: "too_big"
; too_small
: "too_small"
; unrecognized_keys
: "unrecognized_keys"
}> ; message
: ZodOptional
<ZodString
> ; path
: ZodArray
<ZodUnion
<[ZodString
, ZodNumber
]>, "many"
> }, ZodAny
, "strip"
>[] ; name
: "ZodError"
}>> }, "strip"
, ZodTypeAny
, { bodyResult
: null
| { name: "ZodError"; issues: objectOutputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } ; headersResult
: null
| { name: "ZodError"; issues: objectOutputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } ; paramsResult
: null
| { name: "ZodError"; issues: objectOutputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } ; queryResult
: null
| { name: "ZodError"; issues: objectOutputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } }, { bodyResult
: null
| { name: "ZodError"; issues: objectInputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } ; headersResult
: null
| { name: "ZodError"; issues: objectInputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } ; paramsResult
: null
| { name: "ZodError"; issues: objectInputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } ; queryResult
: null
| { name: "ZodError"; issues: objectInputType<{ path: ZodArray<ZodUnion<[ZodString, ZodNumber]>, "many">; message: ZodOptional<ZodString>; code: ZodNativeEnum<...>; }, ZodAny, "strip">[]; } }>
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:67
TsRestAppRouteMetadataKey
• Const
TsRestAppRouteMetadataKey: typeof TsRestAppRouteMetadataKey
Defined in
libs/ts-rest/nest/src/lib/constants.ts:1
TsRestOptionsMetadataKey
• Const
TsRestOptionsMetadataKey: typeof TsRestOptionsMetadataKey
Defined in
libs/ts-rest/nest/src/lib/constants.ts:2
Functions
Api
▸ Api(appRoute
): MethodDecorator
Parameters
Name | Type |
---|---|
appRoute | AppRoute |
Returns
MethodDecorator
Deprecated
Use TsRest decorator instead
Defined in
libs/ts-rest/nest/src/lib/ts-rest.decorator.ts:73
ApiDecorator
▸ ApiDecorator(): ParameterDecorator
Returns
ParameterDecorator
Deprecated
Use TsRestRequest
instead
Defined in
libs/ts-rest/nest/src/lib/ts-rest-request.decorator.ts:99
TsRest
▸ TsRest(appRoute
, options?
): MethodDecorator
As a class decorator, you can configure ts-rest options. As a method decorator, you can assign the route and also configure options
Parameters
Name | Type | Description |
---|---|---|
appRoute | AppRoute | - |
options? | TsRestOptions | For a method decorator, this is the options |
Returns
MethodDecorator
Defined in
libs/ts-rest/nest/src/lib/ts-rest.decorator.ts:20
▸ TsRest(options
): ClassDecorator
As a class decorator, you can configure ts-rest options. As a method decorator, you can assign the route and also configure options
Parameters
Name | Type | Description |
---|---|---|
options | TsRestOptions | For a method decorator, this is the options |
Returns
ClassDecorator
Defined in
libs/ts-rest/nest/src/lib/ts-rest.decorator.ts:21
TsRestHandler
▸ TsRestHandler(appRouterOrRoute
, options?
): MethodDecorator
Parameters
Name | Type |
---|---|
appRouterOrRoute | AppRoute | AppRouter |
options? | TsRestOptions |
Returns
MethodDecorator
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:85
TsRestRequest
▸ TsRestRequest(): ParameterDecorator
Parameter decorator used to parse, validate and return the typed request object
Returns
ParameterDecorator
Defined in
libs/ts-rest/nest/src/lib/ts-rest-request.decorator.ts:99
doesUrlMatchContractPath
▸ doesUrlMatchContractPath(contractPath
, url
): boolean
Parameters
Name | Type | Description |
---|---|---|
contractPath | string | Example ts '/posts/:id' |
url | string | Example ts '/posts/1' |
Returns
boolean
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:174
initNestServer
▸ initNestServer<T
>(router
): Object
Type parameters
Name | Type |
---|---|
T | extends AppRouter |
Parameters
Name | Type |
---|---|
router | T |
Returns
Object
Name | Type |
---|---|
controllerShape | AppRouterControllerShape <T > |
responseShapes | AppRouterResponseShapes <T > |
route | T |
routeShapes | AppRouterRequestShapes <T > |
Deprecated
Use nestControllerContract
, NestControllerInterface
, NestRequestShapes
, and NestResponseShapes
instead
See
docs for more info.
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest.ts:40
nestControllerContract
▸ nestControllerContract<T
>(router
): NestControllerContract
<T
>
Returns the contract containing only non-nested routes required by a NestJS controller
Type parameters
Name | Type |
---|---|
T | extends AppRouter |
Parameters
Name | Type |
---|---|
router | T |
Returns
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest.ts:64
tsRestHandler
▸ tsRestHandler<T
>(contract
, implementation
): NestHandlerImplementation
<T
>
Type parameters
Name | Type |
---|---|
T | extends AppRoute | AppRouter |
Parameters
Name | Type | Description |
---|---|---|
contract | T | The contract or route to implement |
implementation | NestHandlerImplementation <T > | Implementation of the route or entire contract as an object |
Returns
NestHandlerImplementation
<T
>
Defined in
libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:156