syntax = "proto3"; package river; import "google/protobuf/empty.proto"; message ChannelMessage { message Reaction { string ref_event_id = 1; string reaction = 2; } message Edit { string ref_event_id = 1; Post post = 2; } message Redaction { string ref_event_id = 1; optional string reason = 2; } message Post { message Mention { string user_id = 1; string display_name = 2; oneof mentionBehavior { google.protobuf.Empty at_channel = 100; RoleMention at_role = 101; } } message RoleMention { int32 role_id = 1; } message Attachment { oneof content { Content.Image image = 101; ChunkedMedia chunkedMedia = 103; Content.EmbeddedMessage embeddedMessage = 104; Content.UnfurledURL unfurledUrl = 105; Content.Ticker ticker = 106; Content.Miniapp miniapp = 107; } } message Content { message Text { string body = 1; repeated Mention mentions = 2; repeated Attachment attachments = 3; } message Image { message Info { string url = 1; string mimetype = 2; optional int32 size = 3; optional int32 width = 4; optional int32 height = 5; } string title = 1; Info info = 2; optional Info thumbnail = 3; } message GM { string type_url = 1; optional bytes value = 2; } message EmbeddedMessage { message Info { string userId = 1; int64 createdAtEpochMs = 2; string spaceId = 3; string channelId = 4; string messageId = 5; optional string replyId = 6; } message StaticInfo { optional string userName = 1; optional string displayName = 2; optional string channelName = 3; optional string spaceName = 4; optional string ensName = 5; } string url = 1; ChannelMessage.Post post = 2; Info info = 3; StaticInfo staticInfo = 4; } message UnfurledURL { message Image { int32 height = 1; int32 width = 2; string url = 3; } string url = 1; string description = 2; string title = 3; optional UnfurledURL.Image image = 4; } message Ticker { string address = 1; string chain_id = 2; } message Miniapp { string url = 1; } } optional string thread_id = 1; optional string thread_preview = 2; optional string reply_id = 3; optional string reply_preview = 4; oneof content { Content.Text text = 101; Content.Image image = 102; Content.GM gm = 103; } } oneof payload { Post post = 1; Reaction reaction = 2; Edit edit = 3; Redaction redaction = 4; } } message ChannelProperties { string name = 1; string topic = 2; } message UserMetadataProperties { optional string username = 1; optional string display_name = 2; } message FullyReadMarkers { message Content { string channel_id = 1; optional string thread_parent_id = 2; string event_id = 3; // id of the first unread event in the stream int64 event_num = 4; // event number of the first unread event in the stream int64 begin_unread_window = 5; // begining of the unread window, on marking as read, number is set to end+1 int64 end_unread_window = 6; // latest event seen by the code bool is_unread = 7; int64 markedReadAtTs = 8; // timestamp when the event was marked as read int32 mentions = 9; } // map of ThreadId to Content map markers = 1; } /** * UserInboxMessage payload for group session key sharing. */ message SessionKeys { repeated string keys = 1; } message HybridGroupSessionKey { bytes session_id = 1; bytes stream_id = 2; bytes key = 3; int64 miniblock_num = 4; bytes miniblock_hash = 5; } message MediaInfo { string mimetype = 1; int64 sizeBytes = 2; int32 widthPixels = 3; int32 heightPixels = 4; string filename = 5; } message EmbeddedMedia { MediaInfo info = 1; bytes content = 2; } message ChunkedMedia { message AESGCM { bytes iv = 1; bytes secretKey = 2; } MediaInfo info = 1; string streamId = 2; EmbeddedMedia thumbnail = 3; oneof encryption { AESGCM aesgcm = 101; } } message UserBio { string bio = 1; optional uint64 updated_at_epoch_ms = 2; } // a client created with an bearer token cannot make blockchain transactions, but can add events to the river nodes message BearerToken { string delegate_private_key = 1; bytes delegate_sig = 2; int64 expiry_epoch_ms = 3; } message ExportedDevice { message GroupSession { string session_id = 1; string stream_id = 2; string session = 3; } message HybridGroupSession { string session_id = 1; string stream_id = 2; bytes session_key = 3; int64 miniblock_num = 4; } string pickleKey = 1; string pickledAccount = 2; repeated GroupSession outboundSessions = 3; repeated GroupSession inboundSessions = 4; repeated HybridGroupSession hybridGroupSessions = 5; } message AppPrivateData { string private_key = 1; ExportedDevice encryption_device = 2; string env = 3; // alpha, gamma, delta, omega bytes app_address = 4; }