SDK for NestJS
Before Integration
The SDK helps prepare action definitions, but does not replace backend authorization checks.
Use The SDK For NestJS
For the app, agent_tool, and automation_step contexts, you can add the extension with ready-made decorators from @senlerio/api:
import { Get } from "@nestjs/common";
import { AppAction } from "@senlerio/api/app-actions/nest";
@Get("orders")
@AppAction({
name: "list_orders",
description: "Returns orders for the current project.",
readOnly: true,
destructive: false,
idempotent: true,
response: { status: 200, type: OrdersResponseDto },
})
listOrders() {
// The project comes from the verified management session.
}
Use AgentToolConfigurator and AutomationStepConfigurator for configurators; they set the required context and result kind. Shared types and the framework-neutral metadata builder are exported from @senlerio/api/app-actions.
After generating OpenAPI, validate a local file or URL:
npx senler-app validate-openapi ./openapi.json
Validation finds invalid names and contexts, duplicates, unsupported parameters and request bodies, missing response schemas, and incorrect configuration or branch paths. Add it to the application backend's CI.
Entry Points and Contract Validation
The package provides separate entry points for application actions. Shared types, the metadata builder, and OpenAPI validation are available from @senlerio/api/app-actions, while NestJS decorators are exported from @senlerio/api/app-actions/nest. NestJS remains an optional peer dependency and is not loaded by the main SDK client.
Use the installed package version both for metadata generation and OpenAPI validation. NestJS remains an optional peer dependency of the main client.
In version 0.4.0, the decorators and validation support app, agent_tool, and automation_step. Describe the funnel context directly in OpenAPI: funnel reports.
The senler-app validate-openapi command returns a nonzero exit code for an invalid x-senler-app-action contract and is suitable for CI.