aboutsummaryrefslogtreecommitdiff
path: root/buf/mi/mi.proto
diff options
context:
space:
mode:
Diffstat (limited to 'buf/mi/mi.proto')
-rw-r--r--buf/mi/mi.proto94
1 files changed, 94 insertions, 0 deletions
diff --git a/buf/mi/mi.proto b/buf/mi/mi.proto
new file mode 100644
index 0000000..6f544d3
--- /dev/null
+++ b/buf/mi/mi.proto
@@ -0,0 +1,94 @@
+syntax = "proto3";
+package within.website.x.mi;
+option go_package = "within.website/x/buf/mi";
+
+import "google/protobuf/empty.proto";
+import "google/protobuf/timestamp.proto";
+
+service SwitchTracker {
+ rpc Members(google.protobuf.Empty) returns (MembersResp);
+ rpc WhoIsFront(google.protobuf.Empty) returns (FrontChange);
+ rpc Switch(SwitchReq) returns (SwitchResp);
+ rpc GetSwitch(GetSwitchReq) returns (FrontChange);
+ rpc ListSwitches(ListSwitchesReq) returns (ListSwitchesResp);
+}
+
+message MembersResp {
+ repeated Member members = 1; // required
+}
+
+message Member {
+ int32 id = 1; // required
+ string name = 2; // required
+ string avatar_url = 3; // required
+}
+
+message Switch {
+ string id = 1; // required
+ int32 member_id = 2; // required
+ string started_at = 3; // RFC 3339, required
+ string ended_at = 4; // RFC 3339, optional if switch is current
+}
+
+message SwitchReq {
+ string member_name = 1; // required
+}
+
+message SwitchResp {
+ Switch old = 1; // required
+ Switch current = 2; // required
+}
+
+message GetSwitchReq {
+ string id = 1; // required
+}
+
+message FrontChange {
+ Switch switch = 1; // required
+ Member member = 2; // required
+}
+
+message ListSwitchesReq {
+ int32 count = 1; // required
+ int32 page = 2; // required
+}
+
+message ListSwitchesResp { repeated FrontChange switches = 1; }
+
+service POSSE {
+ rpc RefreshBlog(google.protobuf.Empty) returns (google.protobuf.Empty);
+}
+
+// Event represents an event that Xe will be attending.
+message Event {
+ // The name of the event
+ string name = 1;
+ // The URL for the event
+ string url = 2;
+ // The day the event starts
+ google.protobuf.Timestamp start_date = 3;
+ // The day the event ends
+ google.protobuf.Timestamp end_date = 4;
+ // The location of the event (human-readable)
+ string location = 5;
+ // Id of the event
+ int32 id = 6;
+ // The description of the event
+ string description = 7;
+ // If the event is syndicated to Flyght Tracker
+ bool syndicate = 8;
+}
+
+// A feed of events, result from mi query.
+message EventFeed {
+ // The events in the feed
+ repeated Event events = 1;
+}
+
+// Events lets users fetch the current feed of events that Xe will be attending.
+service Events {
+ // Get fetches the current feed of upcoming events.
+ rpc Get(google.protobuf.Empty) returns (EventFeed);
+ // Add adds an event to the feed.
+ rpc Add(Event) returns (google.protobuf.Empty);
+} \ No newline at end of file