diff --git a/src/content/docs/components/omega/endpoints.md b/src/content/docs/components/omega/endpoints.md index 62a54c3..b138897 100644 --- a/src/content/docs/components/omega/endpoints.md +++ b/src/content/docs/components/omega/endpoints.md @@ -55,3 +55,19 @@ Any message to the `Omega` will be ignored until Identification. } } ``` + +### Push Notification + +Sends a push notification to a user. The receiver ID can be specified either in the `receiver` field of the message or in the data payload. + +##### `REQ:` + +```json +{ + "type": "push_notification", + "data": { + "receiver_id": "", // Optional, if not in receiver field + "sender_id": "" + } +} +``` diff --git a/src/content/docs/components/omega/tauri.md b/src/content/docs/components/omega/tauri.md new file mode 100644 index 0000000..43d3e93 --- /dev/null +++ b/src/content/docs/components/omega/tauri.md @@ -0,0 +1,159 @@ + # Tauri System + +The Tauri system provides push notification capabilities for mobile clients via a secure QUIC connection. + +### Connection + +Tauri clients connect to the Omega server on port 9189 using QUIC with client certificate authentication. + +### Identification + +Any message to the Tauri server will be ignored until Identification. + +##### `REQ:` + +```json +{ + "type": "tauri_identification", + "data": { + "user_id": "" + } +} +``` + +##### `RES:` + +```json +{ + "type": "success", + "id": "" +} +``` + +### Ping & Pong + +Tauri clients must respond to ping messages to maintain their connection. + +#### `REQ:` + +```json +{ + "type": "ping", + "data": { + "last_ping": long + } +} +``` + +#### `RES:` + +```json +{ + "type": "pong", + "data": { + "last_ping": long + } +} +``` + +### Push Notifications + +When a user is offline (no active Iota connection), messages generate push notifications that are sent to Tauri clients. + +#### `REQ:` + +```json +{ + "type": "push_notification", + "data": { + "sender_id": "" + } +} +``` + +### Read Notifications + +When a user reads a message on any device, a read notification is sent to clear the push notification badge on Tauri clients. + +#### `REQ:` + +```json +{ + "type": "read_notification", + "data": { + "sender_id": "" + } +} +``` + +### Tauri Client Responsibilities + +1. Establish QUIC connection to Omega:9189 +2. Send `tauri_identification` with user_id +3. Respond to ping messages with pong +4. Display notifications when receiving `push_notification` messages +5. Clear notification badges when receiving `read_notification` messages +6. Maintain connection heartbeat (respond to pings within 30 seconds) + +## Omega Server Endpoints (HTTPS) + +The Omega server provides an HTTPS API for administrative and data retrieval functions, which Tauri clients can use to synchronize notification state. + +### Get User Data + +Retrieve user profile information including online status. + +#### `GET: /api/get/user/{user_id}` + +##### `RES:` + +```json +{ + "status": "success", + "user_id": long, + "username": "", + "display": "", + "public_key": "", + "iota_id": long, + "online_status": "", // user_online, user_offline, user_invisible, etc. + "sub_level": long, + "sub_end": long, + "about": "?", + "avatar": "?", + "status_message": "?" +} +``` + +### Get User Notifications + +Retrieve pending push notifications for a user. + +#### `GET: /api/get/notifications/{user_id}` + +##### `RES:` + +```json +{ + "status": "success", + "notifications": [ + { + "sender_id": long, + "amount": long + } + ] +} +``` + +### Mark Notification as Read + +Clear a specific notification. + +#### `DELETE: /api/delete/notifications/{user_id}/{sender_id}` + +##### `RES:` + +```json +{ + "status": "success" +} +```