Home Reference Source Test
public class | source

Event

Represents a single event

Static Method Summary

Static Public Methods
public static

fromRaw(rawEvent: null | undefined): Event

Returns a new instance of Event from protobuf result

Constructor Summary

Public Constructor
public

Creates an instance of Event.

Member Summary

Public Members
public set

Setter for event correlationId

public get

Getter for event correlationId

public get

data: SOMEUNKNOWN | string

Getter for event data

public set

data: SOMEUNKNOWN | string

Sets data

public

event number in stream

public set

Setter for event id

public get

Getter for event id

public get

metadata: SOMEUNKNOWN | null | string

Getter for event metadata

public set

metadata: SOMEUNKNOWN | null | string

Setter for event metadata

public set

Setter for name

public get

Getter for event name

public

raw buffer representation of data

public

raw buffer representation of metadata

public

streamId

Protected Members
protected

flag if data is type of json

protected

unique event uuid4

protected

event type = name of event

protected

indicates if event was written to eventstore

protected

indicates if its an event or a link which must be resolved

protected

flag if metadata is type of json

protected

events correlation uuid4

protected

creation date as timestamp

protected

creation date as timestamp

protected

objectData: SOMEUNKNOWN | null

js object representation of data

protected

objectMetadata: SOMEUNKNOWN | null

js object representation of metadata

Method Summary

Public Methods
public

causesEvent(eventType: , data: , metadata: ): Event

Returns a new new instance of Event with correlation id set to currents events correlation id or id

public

freeze(): void

Freezes event instance.

public

Returns true if event is a link and not a full resolved event

public

Returns true if event is not stored at eventstore and false if event was written to eventstore

public

toRaw(): SOMEUNKNOWN

Returns protobuf representation of this event

Protected Methods
protected

throwIfNotNewEvent(fieldName: ): void

Helper function to throw while changing an event which is already stored in eventstore

Static Public Methods

public static fromRaw(rawEvent: null | undefined): Event source

Returns a new instance of Event from protobuf result

Params:

NameTypeAttributeDescription
rawEvent null | undefined

Public Constructors

public constructor() source

Creates an instance of Event.

Public Members

public set correlationId: string | null source

Setter for event correlationId

public get correlationId: string | null source

Getter for event correlationId

public get data: SOMEUNKNOWN | string source

Getter for event data

public set data: SOMEUNKNOWN | string source

Sets data

public eventNumber: Long | number | null source

event number in stream

public set id: string source

Setter for event id

public get id: string source

Getter for event id

public get metadata: SOMEUNKNOWN | null | string source

Getter for event metadata

public set metadata: SOMEUNKNOWN | null | string source

Setter for event metadata

public set name: string source

Setter for name

public get name: string source

Getter for event name

public rawData: Uint8Array | null source

raw buffer representation of data

public rawMetadata: Uint8Array | null source

raw buffer representation of metadata

public streamId: string | null source

streamId

Protected Members

protected dataContentType: number source

flag if data is type of json

protected eventId: string source

unique event uuid4

protected eventType: string source

event type = name of event

protected frozen: boolean source

indicates if event was written to eventstore

protected isResolved: * source

indicates if its an event or a link which must be resolved

protected metadataContentType: number source

flag if metadata is type of json

protected objectCorrelationId: string | null source

events correlation uuid4

protected objectCreated: number | Long | null source

creation date as timestamp

protected objectCreatedEpoch: number | Long | null source

creation date as timestamp

protected objectData: SOMEUNKNOWN | null source

js object representation of data

protected objectMetadata: SOMEUNKNOWN | null source

js object representation of metadata

Public Methods

public causesEvent(eventType: , data: , metadata: ): Event source

Returns a new new instance of Event with correlation id set to currents events correlation id or id

Params:

NameTypeAttributeDescription
eventType
data
metadata

public freeze(): void source

Freezes event instance. Done when this event is already stored at eventstore.

Returns true if event is a link and not a full resolved event

public isNew(): boolean source

Returns true if event is not stored at eventstore and false if event was written to eventstore

public toRaw(): SOMEUNKNOWN source

Returns protobuf representation of this event

Protected Methods

protected throwIfNotNewEvent(fieldName: ): void source

Helper function to throw while changing an event which is already stored in eventstore

Params:

NameTypeAttributeDescription
fieldName