syntax = "proto2";

package KismetEventBus;

option optimize_for = LITE_RUNTIME;

// Eventbus subscription interface, subscribe to events published from the kismet core
// components, and limited support for publishing events from the remote endpoints.

// Added to the external interface 2020-07

// An eventbus event is sent as a serialized JSON object containing the complete content
// of the original event.  The content map is defined by the event, and can be arbitrary.
message EventbusEvent {
    // Complete event as JSON
    required string event_json = 1;
}

// Registering event listeners causes the eventbus to send an event record each time a 
// matching type is sent.  A type of '*' receives all events.
message EventbusRegisterListener {
    repeated string event = 1;
}

// Publish an event; remotely pubished events must not overlap internal events and must be
// limited to pure-json data; the content of a remote published event will not be translated
// to a complex C++ object.
// event_content_json will be published in the kismet event as event_content["kismet.eventbus.event_json"]
message EventbusPublishEvent {
    required string event_type = 1;
    required string event_content_json = 2;
}

