@eveble/eveble
Hierarchy
↳ Entity
Entity
Controller
↳ EventSourceable
Implemented by
Index
Properties
Methods
- [ROLLBACK_STATE_METHOD_KEY]
- [SAVE_STATE_METHOD_KEY]
- assignMetadata
- ensureHandleability
- equals
- eventProps
- getCommands
- getEvents
- getHandleableTypes
- getHandled
- getHandledTypes
- getHandler
- getHandlerOrThrow
- getHandlers
- getId
- getLegacyTransformer
- getLegacyTransformers
- getPropTypes
- getPropertyInitializers
- getSchemaVersion
- getSelectableStates
- getSelectableStatuses
- getState
- getStatus
- getTypeName
- getVersion
- handle
- handles
- hasHandler
- hasLegacyTransformer
- hasState
- hasStatus
- incrementVersion
- initialize
- isHandleabe
- isInOneOfStates
- isInOneOfStatuses
- isInState
- isInStatus
- isStateSaved
- on
- overrideHandler
- overrideLegacyTransformer
- record
- registerHandler
- registerLegacyTransformer
- removeHandler
- replay
- replayHistory
- schedule
- setHandleableTypes
- setState
- setStatus
- subscribes
- toPlainObject
- toString
- transformLegacyProps
- unschedule
- validateProps
- validateState
- validateStatus
Properties
state
• state: State
Overrides void
status
• status: Status
Inherited from Statusful.status
Overrides void
Methods
[ROLLBACK_STATE_METHOD_KEY]
▸ [ROLLBACK_STATE_METHOD_KEY](): void
Inherited from Entity.[ROLLBACK_STATE_METHOD_KEY]
Overrides void
Returns: void
[SAVE_STATE_METHOD_KEY]
▸ [SAVE_STATE_METHOD_KEY](): void
Inherited from Entity.[SAVE_STATE_METHOD_KEY]
Overrides void
Returns: void
assignMetadata
▸ assignMetadata(metadata
: Record‹string, any›): void
Parameters:
Name | Type |
---|---|
metadata | Record‹string, any› |
Returns: void
▸ assignMetadata(metadata
: Record‹string, any›): void
Parameters:
Name | Type |
---|---|
metadata | Record‹string, any› |
Returns: void
ensureHandleability
▸ ensureHandleability(messageType
: MessageType‹Message›, handleableTypes
: MessageType‹Message› | MessageType‹Message›[]): boolean
Inherited from Controller.ensureHandleability
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handleableTypes | MessageType‹Message› | MessageType‹Message›[] |
Returns: boolean
equals
▸ equals(other
: any): boolean
Inherited from Definable.equals
Overrides void
Parameters:
Name | Type |
---|---|
other | any |
Returns: boolean
eventProps
▸ eventProps(): Record‹keyof any, any›
Returns: Record‹keyof any, any›
▸ eventProps(): Record‹keyof any, any›
Returns: Record‹keyof any, any›
getCommands
▸ getCommands(): Command[]
Returns: Command[]
▸ getCommands(): Command[]
Returns: Command[]
getEvents
▸ getEvents(): Event[]
Returns: Event[]
▸ getEvents(): Event[]
Returns: Event[]
getHandleableTypes
▸ getHandleableTypes(): MessageType‹Message›[]
Inherited from Controller.getHandleableTypes
Overrides void
Returns: MessageType‹Message›[]
getHandled
▸ getHandled(messageType
: MessageType‹Message›): MessageType‹Message›[]
Inherited from Controller.getHandled
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: MessageType‹Message›[]
getHandledTypes
▸ getHandledTypes(): MessageType‹Message›[]
Inherited from Controller.getHandledTypes
Overrides void
Returns: MessageType‹Message›[]
getHandler
▸ getHandler(messageType
: MessageType‹Message›): Handler | Handler[] | undefined
Inherited from Controller.getHandler
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: Handler | Handler[] | undefined
getHandlerOrThrow
▸ getHandlerOrThrow(messageType
: MessageType‹Message›): Handler | Handler[]
Inherited from Controller.getHandlerOrThrow
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
getHandlers
▸ getHandlers(): Map‹MessageType‹Message›, Handler | Handler[]›
Inherited from Controller.getHandlers
Overrides void
Returns: Map‹MessageType‹Message›, Handler | Handler[]›
getId
▸ getId(): string | Stringifiable
Inherited from Identifiable.getId
Overrides void
Returns: string | Stringifiable
getLegacyTransformer
▸ getLegacyTransformer(schemaVersion
: number): Hook
Inherited from Versionable.getLegacyTransformer
Overrides void
Parameters:
Name | Type |
---|---|
schemaVersion | number |
Returns: Hook
getLegacyTransformers
▸ getLegacyTransformers(): LegacyTransformers
Inherited from Versionable.getLegacyTransformers
Overrides void
Returns: LegacyTransformers
getPropTypes
▸ getPropTypes(): Record‹keyof any, any›
Inherited from Definable.getPropTypes
Overrides void
Returns: Record‹keyof any, any›
getPropertyInitializers
▸ getPropertyInitializers(): Props
Inherited from Definable.getPropertyInitializers
Overrides void
Returns: Props
getSchemaVersion
▸ getSchemaVersion(): number | undefined
Inherited from Versionable.getSchemaVersion
Overrides void
Returns: number | undefined
getSelectableStates
▸ getSelectableStates(): Record‹string, State›
Inherited from Stateful.getSelectableStates
Overrides void
Returns: Record‹string, State›
getSelectableStatuses
▸ getSelectableStatuses(): Record‹string, Status›
Inherited from Statusful.getSelectableStatuses
Overrides void
Returns: Record‹string, Status›
getState
▸ getState(): State
Inherited from Stateful.getState
Overrides void
Returns: State
getStatus
▸ getStatus(): Status
Inherited from Statusful.getStatus
Overrides void
Returns: Status
getTypeName
▸ getTypeName(): TypeName
Inherited from Serializable.getTypeName
Overrides void
Returns: TypeName
getVersion
▸ getVersion(): number
Returns: number
▸ getVersion(): number
Returns: number
handle
▸ handle(message
: Message): any
Overrides Controller.handle
Parameters:
Name | Type |
---|---|
message | Message |
Returns: any
▸ handle(message
: Message): any
Parameters:
Name | Type |
---|---|
message | Message |
Returns: any
handles
▸ handles(): Map‹MessageType‹Command›, Handler›
Inherited from Controller.handles
Overrides void
Returns: Map‹MessageType‹Command›, Handler›
hasHandler
▸ hasHandler(messageType
: MessageType‹Message›): boolean
Inherited from Controller.hasHandler
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: boolean
hasLegacyTransformer
▸ hasLegacyTransformer(schemaVersion
: number): boolean
Inherited from Versionable.hasLegacyTransformer
Overrides void
Parameters:
Name | Type |
---|---|
schemaVersion | number |
Returns: boolean
hasState
▸ hasState(): boolean
Inherited from Stateful.hasState
Overrides void
Returns: boolean
hasStatus
▸ hasStatus(): boolean
Inherited from Statusful.hasStatus
Overrides void
Returns: boolean
incrementVersion
▸ incrementVersion(): void
Returns: void
▸ incrementVersion(): void
Returns: void
initialize
▸ initialize(): void
Inherited from Controller.initialize
Overrides void
Returns: void
isHandleabe
▸ isHandleabe(messageType
: MessageType‹Message›): boolean
Inherited from Controller.isHandleabe
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: boolean
isInOneOfStates
▸ isInOneOfStates(states
: State | State[]): boolean
Inherited from Stateful.isInOneOfStates
Overrides void
Parameters:
Name | Type |
---|---|
states | State | State[] |
Returns: boolean
isInOneOfStatuses
▸ isInOneOfStatuses(status
: Status | Status[]): boolean
Inherited from Statusful.isInOneOfStatuses
Overrides void
Parameters:
Name | Type |
---|---|
status | Status | Status[] |
Returns: boolean
isInState
▸ isInState(state
: State | State[]): boolean
Inherited from Stateful.isInState
Overrides void
Parameters:
Name | Type |
---|---|
state | State | State[] |
Returns: boolean
isInStatus
▸ isInStatus(status
: Status | Status[]): boolean
Inherited from Statusful.isInStatus
Overrides void
Parameters:
Name | Type |
---|---|
status | Status | Status[] |
Returns: boolean
isStateSaved
▸ isStateSaved(): boolean
Inherited from Entity.isStateSaved
Overrides void
Returns: boolean
on
▸ on(action
: string | Stringifiable): any
Overrides void
Parameters:
Name | Type |
---|---|
action | string | Stringifiable |
Returns: any
overrideHandler
▸ overrideHandler(messageType
: MessageType‹Message›, handler
: Handler): void
Inherited from Controller.overrideHandler
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handler | Handler |
Returns: void
overrideLegacyTransformer
▸ overrideLegacyTransformer(schemaVersion
: number, transformer
: Hook): void
Inherited from Versionable.overrideLegacyTransformer
Overrides void
Parameters:
Name | Type |
---|---|
schemaVersion | number |
transformer | Hook |
Returns: void
record
▸ record(event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: void
▸ record(event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: void
registerHandler
▸ registerHandler(messageType
: MessageType‹Message›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from Controller.registerHandler
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
registerLegacyTransformer
▸ registerLegacyTransformer(schemaVersion
: number, transformer
: Hook, shouldOverride
: boolean): void
Inherited from Versionable.registerLegacyTransformer
Overrides void
Parameters:
Name | Type |
---|---|
schemaVersion | number |
transformer | Hook |
shouldOverride | boolean |
Returns: void
removeHandler
▸ removeHandler(messageType
: MessageType‹Message›): void
Inherited from Controller.removeHandler
Overrides void
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: void
replay
▸ replay(event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: void
▸ replay(event
: Event): void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: void
replayHistory
▸ replayHistory(history
: Event[]): void
Parameters:
Name | Type |
---|---|
history | Event[] |
Returns: void
▸ replayHistory(history
: Event[]): void
Parameters:
Name | Type |
---|---|
history | Event[] |
Returns: void
schedule
▸ schedule(command
: Command, deliverAt
: Date, assignmentId?
: string | Stringifiable): void
Parameters:
Name | Type |
---|---|
command | Command |
deliverAt | Date |
assignmentId? | string | Stringifiable |
Returns: void
▸ schedule(command
: Command, deliverAt
: Date, assignmentId?
: string | Stringifiable): void
Parameters:
Name | Type |
---|---|
command | Command |
deliverAt | Date |
assignmentId? | string | Stringifiable |
Returns: void
setHandleableTypes
▸ setHandleableTypes(handleableTypes
: MessageType‹Message› | MessageType‹Message›[]): void
Inherited from Controller.setHandleableTypes
Overrides void
Parameters:
Name | Type |
---|---|
handleableTypes | MessageType‹Message› | MessageType‹Message›[] |
Returns: void
setState
▸ setState(state
: State): void
Inherited from Stateful.setState
Overrides void
Parameters:
Name | Type |
---|---|
state | State |
Returns: void
setStatus
▸ setStatus(status
: Status): void
Inherited from Statusful.setStatus
Overrides void
Parameters:
Name | Type |
---|---|
status | Status |
Returns: void
subscribes
▸ subscribes(): Map‹MessageType‹Event›, Handler›
Inherited from Controller.subscribes
Overrides void
Returns: Map‹MessageType‹Event›, Handler›
toPlainObject
▸ toPlainObject(): Props
Inherited from Definable.toPlainObject
Overrides void
Returns: Props
toString
▸ toString(): TypeName | string
Inherited from Serializable.toString
Overrides void
Returns: TypeName | string
transformLegacyProps
▸ transformLegacyProps(props
: Props): Props
Inherited from Versionable.transformLegacyProps
Overrides void
Parameters:
Name | Type |
---|---|
props | Props |
Returns: Props
unschedule
▸ unschedule(assignmentId
: string | Stringifiable, commandType
: MessageType‹Command›): void
Parameters:
Name | Type |
---|---|
assignmentId | string | Stringifiable |
commandType | MessageType‹Command› |
Returns: void
▸ unschedule(assignmentId
: string | Stringifiable, commandType
: MessageType‹Command›): void
Parameters:
Name | Type |
---|---|
assignmentId | string | Stringifiable |
commandType | MessageType‹Command› |
Returns: void
validateProps
▸ validateProps(props
: Props, propTypes
: PropTypes, isStrict?
: boolean): boolean
Inherited from Definable.validateProps
Overrides void
Parameters:
Name | Type |
---|---|
props | Props |
propTypes | PropTypes |
isStrict? | boolean |
Returns: boolean
validateState
▸ validateState(stateOrStates
: State | State[], error?
: Error): boolean
Inherited from Stateful.validateState
Overrides void
Parameters:
Name | Type |
---|---|
stateOrStates | State | State[] |
error? | Error |
Returns: boolean
validateStatus
▸ validateStatus(statusOrStatuses
: Status | Status[], error?
: Error): boolean
Inherited from Statusful.validateStatus
Overrides void
Parameters:
Name | Type |
---|---|
statusOrStatuses | Status | Status[] |
error? | Error |
Returns: boolean