codemp/proto/workspace.proto
frelodev 3738f7beb4 Cleanup of proto
Co-authored-by: alemi.dev <me@alemi.dev>
2024-02-06 00:09:35 +01:00

56 lines
1.3 KiB
Protocol Buffer

syntax = "proto2";
package workspace;
import "files.proto";
import "auth.proto";
import "common.proto";
service Workspace {
rpc CreateWorkspace (workspace.WorkspaceId) returns (common.Empty);
rpc RequestAccess (workspace.BufferPath) returns (auth.Token);
rpc LeaveWorkspace (workspace.WorkspaceId) returns (common.Empty);
rpc CreateBuffer (workspace.BufferPath) returns (common.Empty);
rpc ListBuffers (common.Empty) returns (files.BufferTree);
rpc ListUsers (common.Empty) returns (common.UserList);
rpc ListBufferUsers (workspace.BufferPath) returns (common.UserList); //TODO discuss
rpc Attach (common.Empty) returns (stream workspace.WorkspaceEvent);
rpc Delete (workspace.BufferPath) returns (common.Empty); //deletes buffer
}
message WorkspaceEvent {
message UserJoin {
required common.UserIdentity id = 1;
}
message UserLeave {
required common.UserIdentity id = 1;
}
message FileCreate {
required string path = 1;
}
message FileRename {
required string before = 1;
required string after = 2;
}
message FileDelete {
required string path = 1;
}
oneof event {
UserJoin join = 1;
UserLeave leave = 2;
FileCreate create = 3;
FileRename rename = 4;
FileDelete delete = 5;
}
}
message BufferPath {
// buffer path to operate onto
required string path = 1;
}
message WorkspaceId {
required string id = 1;
}