Skip to content

Type Alias: ActionParamRule

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Actions / ActionParamRule

Type Alias: ActionParamRule

ActionParamRule = { param: string; rule: "non_empty_string"; } | { max: number; min: number; param: string; rule: "int_range"; } | { max: number; min: number; param: string; rule: "real_range"; } | { allowed: string[]; param: string; rule: "one_of"; }

Defined in: src/types/actions.ts:44

A validation rule over an action’s parameters.

Type Declaration

{ param: string; rule: "non_empty_string"; }

param

param: string

Parameter the rule applies to.

rule

rule: "non_empty_string"

String parameter, when present, must be non-empty.

{ max: number; min: number; param: string; rule: "int_range"; }

max

max: number

Inclusive upper bound.

min

min: number

Inclusive lower bound.

param

param: string

Parameter the rule applies to.

rule

rule: "int_range"

Integer parameter, when present, in [min, max].

{ max: number; min: number; param: string; rule: "real_range"; }

max

max: number

Inclusive upper bound.

min

min: number

Inclusive lower bound.

param

param: string

Parameter the rule applies to.

rule

rule: "real_range"

Real parameter, when present, in [min, max].

{ allowed: string[]; param: string; rule: "one_of"; }

allowed

allowed: string[]

Permitted values.

param

param: string

Parameter the rule applies to.

rule

rule: "one_of"

String parameter, when present, must be one of allowed.

Remarks

Tagged discriminated union with rule as the discriminant. The wire shape (ActionParamRuleDto) is externally tagged by rule name (non_empty_string, int_range, real_range, one_of).