@mimik/event-helper
v1.4.6
Published
Helper for setting up and use topic to send events
Downloads
12
Readme
Functions
validate() ⇒ Promise
Topic inititialization and validation
Kind: global function
Returns: Promise - .
Category: async
Throws:
- Promise Will throw an error if the topic is not configured.
Requires: module:@mimik/sumologic-winston-logger
Fulfil: Return null
if config.topic is set to off
.
Fulfil: object Return eventProcessor
is config.topic is set to off
or mock
.
sendEvent(eventType, event, ids, body, correlationId, options) ⇒ Promise
Sending a event to a topic
Kind: global function
Returns: Promise - .
Category: async
Requires: module:@mimik/sumologic-winston-logger
Fulfil: Return null
.
| Param | Type | Description |
| --- | --- | --- |
| eventType | string | Type of event to be sent. |
| event | string | Event to be sent. |
| ids | object | object containing id of the user. |
| body | object | body to add to the event to be sent. |
| correlationId | string | Correlation id associated with the event to be sent. |
| options | object | Options associated with the call. Use to apply metrics
. Can use messageDeduplicationId
, messageGroupId
for fifo sns. |
sendEvents(eventType, event, ids, body, correlationId, options) ⇒ Promise
Sending events to a topic in batch request
Kind: global function
Returns: Promise - .
Category: async
Requires: module:@mimik/sumologic-winston-logger
Fulfil: Return null
.
| Param | Type | Description |
| --- | --- | --- |
| eventType | string | Type of event to be sent. |
| event | string | Event to be sent. |
| ids | object | array of id objects containing id of the users associated with the events. |
| body | object | body to add to the event to be sent. |
| correlationId | string | Correlation id associated with the events to be sent. |
| options | object | Options associated with the call. Use to apply metrics
. Can use messageDeduplicationIds
, messageGroupIds
for fifo sns. |