Skip to content

EventModel

EventModel = object

Defined in: packages/schema/src/model.ts:215

An event a resource declares. It fires for a change whose operation is listed and that passes every condition: when on the record after the change, from on the record before it, becomes turning true (false or no record before, true after), one of the changed fields changing, and a code predicate when match is set. See Declaring events.

optional becomes?: string

Defined in: packages/schema/src/model.ts:225

A filter that must turn true with the change: false or no record before, true after.


optional changed?: string[]

Defined in: packages/schema/src/model.ts:227

Fields of which at least one must change.


optional from?: string

Defined in: packages/schema/src/model.ts:223

A filter the record before the change must pass.


optional match?: true

Defined in: packages/schema/src/model.ts:229

A code predicate decides too; it stays in the config.


name: string

Defined in: packages/schema/src/model.ts:217

<resource>.<name>, such as orders.created.


operations: EventOperation[]

Defined in: packages/schema/src/model.ts:219

The operations it fires for.


optional when?: string

Defined in: packages/schema/src/model.ts:221

A filter the record after the change must pass.