@usine/expression/expression-engine
Classes
Section titled “Classes”Environment
Section titled “Environment”The types and root variables an expression is checked and evaluated against.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Environment(…
args):Environment
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlytypes: readonlyObjectType[]
variables
Section titled “variables”
readonlyvariables: readonlyVariable[]
ExpressionCheckError
Section titled “ExpressionCheckError”The expression failed to parse, to type-check, or to produce the expected result type.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ExpressionCheckError(…
args):ExpressionCheckError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlycode:"check_failed"|"parse_error"|"type_error"|"unexpected_result_type"
message
Section titled “message”
readonlymessage:string
position
Section titled “position”
readonlyposition:Option<number>
source
Section titled “source”
readonlysource:string&Brand<"ExpressionSource">
ExpressionEngine
Section titled “ExpressionEngine”Evaluates Loop conditions and prompt expressions against their declared payload context.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:ExpressionEngineService
The service’s operations: what yield* ExpressionEngine returns.
ExpressionEvaluationError
Section titled “ExpressionEvaluationError”Evaluation failed on an expression that had already checked.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ExpressionEvaluationError(…
args):ExpressionEvaluationError
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”message
Section titled “message”
readonlymessage:string
source
Section titled “source”
readonlysource:string&Brand<"ExpressionSource">
ObjectField
Section titled “ObjectField”One named field and its CEL type within an object descriptor.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ObjectField(…
args):ObjectField
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyname:string
readonlytype:string&Brand<"CelTypeReference">
ObjectType
Section titled “ObjectType”A CEL object type. Declare a type before the types that reference it.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ObjectType(…
args):ObjectType
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”fields
Section titled “fields”
readonlyfields: readonlyObjectField[]
readonlyname:string
Variable
Section titled “Variable”A root variable available to CEL expressions in an Environment.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Variable(…
args):Variable
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyname:string
readonlytype:string&Brand<"CelTypeReference">
Interfaces
Section titled “Interfaces”ExpressionEngineService
Section titled “ExpressionEngineService”Checks and evaluates the expressions used to select Items and fill Loop task templates.
Properties
Section titled “Properties”checkBoolean
Section titled “checkBoolean”
readonlycheckBoolean: (source,environment) =>Effect<void,ExpressionCheckError>
Checks whether the expression can select Items, without evaluating a payload.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string & Brand<"ExpressionSource"> |
environment |
Environment |
Returns
Section titled “Returns”Effect<void, ExpressionCheckError>
checkScalar
Section titled “checkScalar”
readonlycheckScalar: (source,environment) =>Effect<void,ExpressionCheckError>
Checks whether the expression can produce one value for prompt interpolation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string & Brand<"ExpressionSource"> |
environment |
Environment |
Returns
Section titled “Returns”Effect<void, ExpressionCheckError>
evaluateBoolean
Section titled “evaluateBoolean”
readonlyevaluateBoolean: (source,environment,context) =>Effect<boolean,ExpressionCheckError|ExpressionEvaluationError>
Checks and evaluates a selection condition; context supplies values for the environment’s root variables.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string & Brand<"ExpressionSource"> |
environment |
Environment |
context |
JsonObject |
Returns
Section titled “Returns”Effect<boolean, ExpressionCheckError | ExpressionEvaluationError>
evaluateScalar
Section titled “evaluateScalar”
readonlyevaluateScalar: (source,environment,context) =>Effect<string|number|bigint|boolean|null,ExpressionCheckError|ExpressionEvaluationError>
Checks and evaluates a prompt interpolation; context supplies values for the environment’s root variables.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string & Brand<"ExpressionSource"> |
environment |
Environment |
context |
JsonObject |
Returns
Section titled “Returns”Effect<string | number | bigint | boolean | null, ExpressionCheckError | ExpressionEvaluationError>
relatedStringLiterals
Section titled “relatedStringLiterals”
readonlyrelatedStringLiterals: (source,memberPath) =>Effect<readonlystring[],ExpressionCheckError>
The string literals the expression compares against the name field of
values reached from memberPath, following macro bindings and collection
transformations. Config validation uses it to spot undeclared labels.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string & Brand<"ExpressionSource"> |
memberPath |
readonly string[] |
Returns
Section titled “Returns”Effect<readonly string[], ExpressionCheckError>
Type Aliases
Section titled “Type Aliases”CheckErrorCode
Section titled “CheckErrorCode”CheckErrorCode = typeof
CheckErrorCode.Type
Whether checking failed during parsing, type resolution, or result-type validation.
ExpressionError
Section titled “ExpressionError”ExpressionError = typeof
ExpressionError.Type
The failures callers can receive when checking or evaluating a CEL expression.
Scalar
Section titled “Scalar”Scalar = typeof
Scalar.Type
Values prompt interpolation can render. CEL ints stay bigint.
Source
Section titled “Source”Source = typeof
Source.Type
Non-blank CEL source text.
TypeReference
Section titled “TypeReference”TypeReference = typeof
TypeReference.Type
A type name in CEL syntax such as string, Issue, or list<Label>.
Variables
Section titled “Variables”CheckErrorCode
Section titled “CheckErrorCode”
constCheckErrorCode:Schema.Literals<readonly ["check_failed","parse_error","type_error","unexpected_result_type"]>
Whether checking failed during parsing, type resolution, or result-type validation.
ExpressionError
Section titled “ExpressionError”
constExpressionError:Schema.Union<readonly [typeofExpressionCheckError, typeofExpressionEvaluationError]>
The failures callers can receive when checking or evaluating a CEL expression.
Scalar
Section titled “Scalar”
constScalar:Schema.Union<readonly [Schema.String,Schema.Number,Schema.BigInt,Schema.Boolean,Schema.Null]>
Values prompt interpolation can render. CEL ints stay bigint.
Source
Section titled “Source”
constSource:Schema.brand<Schema.String,"ExpressionSource">
Non-blank CEL source text.
TypeReference
Section titled “TypeReference”
constTypeReference:Schema.brand<Schema.String,"CelTypeReference">
A type name in CEL syntax such as string, Issue, or list<Label>.