Skip to main content

ActionOptions

@webda/core


Interface: ActionOptions

Defined in: packages/core/src/models/decorator.ts:13

Options accepted by @Action() and @Operation().

The compiler scans for these decorators by name to populate model and Behavior metadata. The runtime decorator itself is a no-op pass-through — its only job is to make @Action() a valid runtime call so the source compiles. All actual action wiring is metadata-driven (see compiler/src/metadata/actions.ts and metadata/behaviors.ts).

Properties​

description?​

optional description?: string

Defined in: packages/core/src/models/decorator.ts:40

Free-form description forwarded into operation metadata.


featureFlag?​

optional featureFlag?: string | true

Defined in: packages/core/src/models/decorator.ts:53

Feature flag gating the operation. When the flag is off for the caller the operation answers NotFound and is left out of listings. true uses the operation id as flag name.


global?​

optional global?: boolean

Defined in: packages/core/src/models/decorator.ts:21

Mark the action as global (class-level) rather than instance-level.


maxMfaAge?​

optional maxMfaAge?: string | number

Defined in: packages/core/src/models/decorator.ts:47

Require the second factor to be verified within this duration (Duration syntax: 600, "10m"), see OperationDefinition.maxMfaAge. Read by the compiler: use a string or number literal


methods?​

optional methods?: string[]

Defined in: packages/core/src/models/decorator.ts:19

HTTP methods accepted by the action; defaults to ["PUT"].


name?​

optional name?: string

Defined in: packages/core/src/models/decorator.ts:15

Override the registered action name (defaults to the method name).


openapi?​

optional openapi?: any

Defined in: packages/core/src/models/decorator.ts:17

OpenAPI overrides for the registered route.


rest?​

optional rest?: object

Defined in: packages/core/src/models/decorator.ts:31

REST URI template and HTTP verb. Instance actions implicitly include the model primary key.

  • route: "." ⇒ /<plural>/{uuid}/<attribute> (no extra segment)
  • route: "url" ⇒ /<plural>/{uuid}/<attribute>/url
  • route: "{hash}" ⇒ /<plural>/{uuid}/<attribute>/{hash}

method overrides the HTTP verb; defaults to "PUT" when omitted.

body?​

optional body?: string

Use the whole JSON body as this method parameter.

method?​

optional method?: string

path?​

optional path?: string

URI template relative to the model collection (or behavior attribute).

route?​

optional route?: string


summary?​

optional summary?: string

Defined in: packages/core/src/models/decorator.ts:42

Free-form summary forwarded into operation metadata.