rdkcentral / mock-firebolt

An advanced, controllable mock Firebolt OS implementation, which can also act as a reverse proxy to a real Firebolt OS running on a real device
Apache License 2.0
4 stars 21 forks source link

Support any JsonRPC structure for events - Part 1 (Do Not Merge) #126

Closed ksentak closed 1 year ago

ksentak commented 1 year ago

MF has the ability to trigger events either manually through the API/CLI or automatically through triggers.

In order to send and format these events, MF must keep track of which incoming users are listening. This formatting/searching/etc is currently hard-coded for the FB format. We must open up the existing event functionality to support any JsonRPC structure for events.

We need to convert the existing hard-coded logic into something that's configurable. This is part 1 of this implementation and includes implementation of the "registrationMessage" and "unRegistrationMessage" configuration elements.

Message Metadata When a new event registration/unregistration is detected, the message should be saved as additional metadata for the user/method being registered/unregistered. This will be used later on to format ack messages using Handlebars.js.

The registration message object should be saved as "registration" The event message object should be saved as "event" The unRegistration message object should be saved as "unRegistration"