Optional
realtime: RealtimeCreates a new event.
Event object with mandantory fragments.
Response wrapped in [[IResult]]
Example
const mandantoryObject: IEvent = {
source: device,
text: 'I am an Event!',
time: '2018-05-02T10:08:00Z',
type: 'device-type-here',
};
(async () => {
const {data, res} = await eventService.create(mandantoryObject);
})();
Removes an event with given id.
entity or id of the event.
Example
const eventId: number = 1;
(async () => {
const {data, res} = await eventService.delete(eventId);
// data will be null
})();
Response wrapped in [[IResult]]
Gets the details of a specific event.
Entity or Id of the entity.
Response wrapped in [[IResult]]
Example
const eventId: number = 1;
(async () => {
const {data, res} = await eventService.detail(eventId);
})();
Gets the list of events filtered by parameters.
Object containing filters for querying events.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await eventService.list(filter);
})();
Response wrapped in [[IResultList]]
Updates event data.
Event is partially updatable.
Response wrapped in [[IResult]]
Example
const partialUpdateObject: Partial<IEvent> = {
source: device,
text: 'Changed Event!'
};
(async () => {
const {data, res} = await eventService.update(partialUpdateObject);
})();
This class allows managing for events.