Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions proto/agynio/api/notifications/v1/notifications.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
syntax = "proto3";

package agynio.api.notifications.v1;

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

// NotificationsService v1 (minimal)
// - Publish: producers send events to rooms
// - Subscribe: gateway receives a live stream of envelopes
service NotificationsService {
rpc Publish(PublishRequest) returns (PublishResponse);
rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);
}

// Envelope emitted to subscribers and used as the canonical notification.
message NotificationEnvelope {
string id = 1; // server-generated UUID v4
google.protobuf.Timestamp ts = 2; // server-generated acceptance time
string source = 3; // origin (e.g., "platform-server")
string event = 4; // stable event name
repeated string rooms = 5; // target rooms (non-empty)
google.protobuf.Struct payload = 6; // JSON payload (event-specific schema)
}

message PublishRequest {
string event = 1;
repeated string rooms = 2;
google.protobuf.Struct payload = 3;
string source = 4;
}

message PublishResponse {
string id = 1;
google.protobuf.Timestamp ts = 2;
}

message SubscribeRequest {}

message SubscribeResponse {
NotificationEnvelope envelope = 1;
}