Skip to content

Documentation / @agentick/nestjs / MethodDefinition

Interface: MethodDefinition<TSchema>

Defined in: gateway/dist/types.d.ts:287

Method definition with symbol marker (returned by method())

Extends

Type Parameters

TSchema

TSchema extends ZodLikeSchema = ZodLikeSchema

Properties

[METHOD_DEFINITION]

[METHOD_DEFINITION]: true

Defined in: gateway/dist/types.d.ts:288


description?

optional description: string

Defined in: gateway/dist/types.d.ts:282

Method description for discovery

Inherited from

MethodDefinitionInput.description


guard()?

optional guard: (ctx) => boolean | Promise<boolean>

Defined in: gateway/dist/types.d.ts:280

Custom guard function

Parameters

ctx

KernelContext

Returns

boolean | Promise<boolean>

Inherited from

MethodDefinitionInput.guard


handler

handler: SimpleMethodHandler<ReturnType<TSchema["parse"]>, unknown> | StreamingMethodHandler<ReturnType<TSchema["parse"]>, unknown>

Defined in: gateway/dist/types.d.ts:276

Handler function - receives validated & typed params

Inherited from

MethodDefinitionInput.handler


response?

optional response: ZodLikeSchema

Defined in: gateway/dist/types.d.ts:274

Zod schema for response (used by schema discovery only)

Inherited from

MethodDefinitionInput.response


roles?

optional roles: string[]

Defined in: gateway/dist/types.d.ts:278

Required roles - checked before handler

Inherited from

MethodDefinitionInput.roles


schema?

optional schema: TSchema

Defined in: gateway/dist/types.d.ts:272

Zod schema for params validation + TypeScript inference

Inherited from

MethodDefinitionInput.schema

Released under the ISC License.