Contains constants and functions for a Generic Event.
The structure for a Generic Event is as follows:
{
annotations: <array>,
clientId: <string>,
payload: <object>,
timestamp: <number>,
type: <enum(blob, client, control, generic, log, status)>,
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 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 Event
Properties:
Name | Type | Description |
---|---|---|
annotations |
string |
Array of Annotation objects. |
clientId |
string |
A unique id that differentiates clients from one another. |
payload |
string |
An object with custom data describing the event. |
timestamp |
string |
When the event occurred. |
rootType |
string |
The type of event. |
rootId |
string |
Uniquely identifies each event. |
- 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) getAnnotations(source) → {Array}
Returns the annotations
from the Generic Event.
This is the array of Annotation objects.
Path is annotations
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
(static) getClientId(source) → {string}
Returns the clientId
from the Generic Event.
This is the a unique id that differentiates clients from one another.
Path is clientId
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
(static) getPayload(source) → {object}
Returns the payload
from the Generic Event.
This is the an object with custom data describing the event.
Path is payload
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
(static) getPayloadKey(…path, source) → {*}
Returns the data using the specified path from the payload of the Generic Event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string |
<repeatable> |
key in object |
source |
object |
The Generic Event instance |
- Source:
(static) getRootId(source) → {string}
Returns the rootId
from the Generic Event.
This is the uniquely identifies each event.
Path is uuid
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
(static) getRootType(source) → {string}
Returns the rootType
from the Generic Event.
This is the the type of event.
Path is type
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
(static) getTimestamp(source) → {number}
Returns the timestamp
from the Generic Event.
This is the when the event occurred.
Path is timestamp
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
(static) isMatch(source) → {boolean}
Tests the provided source against the matcher to see if it's Generic Event event.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Generic Event instance |
- Source:
- See:
-
- kit.isMatch
(static) make(…input) → {object}
Generates a Generic 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) makeClientFilter(clients) → {object}
Makes a event filter using the provided client ids.
Parameters:
Name | Type | Description |
---|---|---|
clients |
Array.<string> |
Array of clientIds to filter by |
- Source:
(static) makeHiddenFilter(clearTSopt) → {object}
Makes a hidden event filter based on the provided clear timestamp. If null, we'll filter all
events with a hidden annotation set. If provided, we'll also hide everything before that timestamp
unless the hidden annotation is explicitly set to false
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
clearTS |
number |
<optional> |
Hide events before this timestamp |
- Source:
(static) mock(…input) → {object}
Generates a Generic 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: