@mimik/event-helper
v2.0.2
Published
Helper for setting up and use topic to send events
Readme
event-helper
Example
import eventManager from '@mimik/event-helper';event-helper~validate() ⇒ Promise
Topic inititialization and validation
Kind: inner method of event-helper
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.
event-helper~sendEvent(eventType, event, ids, body, correlationId, options) ⇒ Promise
Sending a event to a topic
Kind: inner method of event-helper
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. |
event-helper~sendEvents(eventType, event, ids, body, correlationId, options) ⇒ Promise
Sending events to a topic in batch request
Kind: inner method of event-helper
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. |
