New RPC returns notebook metadata, all pages, and all strokes for a given server-side notebook ID. Enables desktop and other clients to download notebooks from the server (pull sync). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
111 lines
2.6 KiB
Protocol Buffer
111 lines
2.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
package engpad.v1;
|
|
|
|
option go_package = "git.wntrmute.dev/kyle/eng-pad-server/gen/engpad/v1;engpadv1";
|
|
option java_package = "net.metacircular.engpad.proto.v1";
|
|
option java_multiple_files = true;
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
service EngPadSyncService {
|
|
rpc SyncNotebook(SyncNotebookRequest) returns (SyncNotebookResponse);
|
|
rpc GetNotebook(GetNotebookRequest) returns (GetNotebookResponse);
|
|
rpc DeleteNotebook(DeleteNotebookRequest) returns (DeleteNotebookResponse);
|
|
rpc ListNotebooks(ListNotebooksRequest) returns (ListNotebooksResponse);
|
|
rpc CreateShareLink(CreateShareLinkRequest) returns (CreateShareLinkResponse);
|
|
rpc RevokeShareLink(RevokeShareLinkRequest) returns (RevokeShareLinkResponse);
|
|
rpc ListShareLinks(ListShareLinksRequest) returns (ListShareLinksResponse);
|
|
}
|
|
|
|
message SyncNotebookRequest {
|
|
int64 notebook_id = 1;
|
|
string title = 2;
|
|
string page_size = 3;
|
|
repeated PageData pages = 4;
|
|
}
|
|
|
|
message PageData {
|
|
int64 page_id = 1;
|
|
int32 page_number = 2;
|
|
repeated StrokeData strokes = 3;
|
|
}
|
|
|
|
message StrokeData {
|
|
float pen_size = 1;
|
|
int32 color = 2;
|
|
string style = 3;
|
|
bytes point_data = 4;
|
|
int32 stroke_order = 5;
|
|
}
|
|
|
|
message SyncNotebookResponse {
|
|
int64 server_notebook_id = 1;
|
|
google.protobuf.Timestamp synced_at = 2;
|
|
}
|
|
|
|
message GetNotebookRequest {
|
|
int64 notebook_id = 1; // Server-side notebook ID
|
|
}
|
|
|
|
message GetNotebookResponse {
|
|
int64 server_notebook_id = 1;
|
|
int64 remote_id = 2;
|
|
string title = 3;
|
|
string page_size = 4;
|
|
repeated PageData pages = 5;
|
|
google.protobuf.Timestamp synced_at = 6;
|
|
}
|
|
|
|
message DeleteNotebookRequest {
|
|
int64 notebook_id = 1;
|
|
}
|
|
|
|
message DeleteNotebookResponse {}
|
|
|
|
message ListNotebooksRequest {}
|
|
|
|
message ListNotebooksResponse {
|
|
repeated NotebookSummary notebooks = 1;
|
|
}
|
|
|
|
message NotebookSummary {
|
|
int64 server_id = 1;
|
|
int64 remote_id = 2;
|
|
string title = 3;
|
|
string page_size = 4;
|
|
int32 page_count = 5;
|
|
google.protobuf.Timestamp synced_at = 6;
|
|
}
|
|
|
|
message CreateShareLinkRequest {
|
|
int64 notebook_id = 1;
|
|
int64 expires_in_seconds = 2;
|
|
}
|
|
|
|
message CreateShareLinkResponse {
|
|
string token = 1;
|
|
string url = 2;
|
|
google.protobuf.Timestamp expires_at = 3;
|
|
}
|
|
|
|
message RevokeShareLinkRequest {
|
|
string token = 1;
|
|
}
|
|
|
|
message RevokeShareLinkResponse {}
|
|
|
|
message ListShareLinksRequest {
|
|
int64 notebook_id = 1;
|
|
}
|
|
|
|
message ListShareLinksResponse {
|
|
repeated ShareLinkInfo links = 1;
|
|
}
|
|
|
|
message ShareLinkInfo {
|
|
string token = 1;
|
|
string url = 2;
|
|
google.protobuf.Timestamp created_at = 3;
|
|
google.protobuf.Timestamp expires_at = 4;
|
|
}
|