Deserializes events encoded in the Cloud Events 1.0 schema.
the JSON encoded representation of either a single event or an array of events, encoded in the Cloud Events 1.0 Schema.
Deserializes events encoded in the Cloud Events 1.0 schema.
an object representing a single event, encoded in the Cloud Events 1.0 schema.
Deserializes events encoded in the Event Grid schema.
the JSON encoded representation of either a single event or an array of events, encoded in the Event Grid Schema.
Deserializes events encoded in the Event Grid schema.
an object representing a single event, encoded in the Event Grid schema.
Generated using TypeDoc
EventGridConsumer is used to aid in processing events delivered by EventGrid. It can deserialize a JSON encoded payload of either a single event or batch of events as well as be used to convert the result of
JSON.parse
into anEventGridEvent
orCloudEvent
like object.Unlike normal JSON deseralization, EventGridConsumer does some additional conversions:
Date
object, for ease of use.Uint8Array
type.data
payload from system events is converted to match the interfaces this library defines.When constructing an
EventGridConsumer
, a map of event types to custom deserializers may be provided. When deserializing, if a custom deserializer has been registered for a given event type, it will be called with the data object. The object this deserializer returns will replace the existing data object.