edgeEvent

edgeEvent

Contains constants and functions for a Generic Edge Event.

The structure for a Generic Edge Event is as follows:

{
  payload: {
    attributes: {
      requestId: <string>,
      source: <string>,
    },
    name: <string>,
    messages: <array>,
    context: <object>,
  },
  type: 'service'
  annotations: <array>,
  clientId: <string>,
  timestamp: <number>,
  uuid: <string>,
}
Source:

Members

(static, constant) group

A grouping for this object

Source:

(static, constant) label

A label that can be used when describing this object

Source:

(static, constant) matcher

Matcher can be used to find matching Generic Edge Event objects.

Source:
See:
  • kit.match

(static, constant) parentDepth

Describes the number of parents this object has based off schema references. When checking for matches for example, we want to use a schema that is more specific over a more generic schema

Source:

(static, constant) path :string

Paths for the keys on a Generic Edge Event

Properties:
Name Type Description
payload string

An object with custom data describing the event.
Path is payload.

attributes string

An object containing metadata about the request.
Path is payload.attributes.

requestId string

The request id that is shared between the different service requests.
Path is payload.attributes.requestId.

eventSource string

The event source.
Path is payload.attributes.source.

name string

The name of the event.
Path is payload.name.

messages string

Messages received from the service.
Path is payload.messages.

context string

Additional context provided by the service.
Path is payload.context.

rootType string

The type of event.
Path is type.

annotations string

Array of Annotation objects.
Path is annotations.

clientId string

A unique id that differentiates clients from one another.
Path is clientId.

timestamp string

When the event occurred.
Path is timestamp.

rootId string

Uniquely identifies each event.
Path is uuid.

Source:

(static, constant) ROOT_TYPE

The value for rootType for a Generic Edge Event.

Path is type.

Source:

Methods

(static) get(alias, data) → {*}

Retrieves a value from the object. You can provide either a path or an alias.

Parameters:
Name Type Description
alias string

Path or alias

data *

Data to search

Source:

(static) getAttributes(source) → {object}

Returns the attributes from the Generic Edge Event. This is the an object containing metadata about the request.

Path is payload,attributes.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:

(static) getAttributesKey(…path, source) → {*}

Returns the data using the specified path from the attributes of the Generic Edge Event.

Parameters:
Name Type Attributes Description
path string <repeatable>

key in object

source object

The Generic Edge Event instance

Source:

(static) getContext(source) → {object}

Returns the context from the Generic Edge Event. This is the additional context provided by the service.

Path is payload,context.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:

(static) getContextKey(…path, source) → {*}

Returns the data using the specified path from the context of the Generic Edge Event.

Parameters:
Name Type Attributes Description
path string <repeatable>

key in object

source object

The Generic Edge Event instance

Source:

(static) getEventSource(source) → {string}

Returns the eventSource from the Generic Edge Event. This is the the event source.

Path is payload,attributes,source.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:

(static) getMessages(source) → {Array}

Returns the messages from the Generic Edge Event. This is the messages received from the service.

Path is payload,messages.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:

(static) getName(source) → {string}

Returns the name from the Generic Edge Event. This is the the name of the event.

Path is payload,name.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:

(static) getRequestId(source) → {string}

Returns the requestId from the Generic Edge Event. This is the the request id that is shared between the different service requests.

Path is payload,attributes,requestId.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:

(static) isMatch(source) → {boolean}

Tests the provided source against the matcher to see if it's Generic Edge Event event.

Parameters:
Name Type Description
source object

The Generic Edge Event instance

Source:
See:
  • kit.isMatch

(static) make(…input) → {object}

Generates a Generic Edge Event with the const values set. Can be useful in testing. Can provide additional data by providing a flat object of paths and values.

Parameters:
Name Type Attributes Description
input function <repeatable>

Overrides

Source:

(static) mock(…input) → {object}

Generates a Generic Edge Event with some default values set. Can be useful in testing. Can override defaults and provide additional data by providing a flat object of paths and values.

Parameters:
Name Type Attributes Description
input function <repeatable>

Overrides

Source: