From 4158be94f2a5b927039118b0a08ed045027cf471 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 13:39:03 +0200 Subject: [PATCH 01/16] feat: add missing rpc routes --- proto/session.proto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proto/session.proto b/proto/session.proto index 2f97fcf..ea2b315 100644 --- a/proto/session.proto +++ b/proto/session.proto @@ -10,16 +10,22 @@ service Session { rpc Attach (common.Empty) returns (stream SessionEvent); // Handle a workspace access request and return a workspace token. rpc AccessWorkspace (WorkspaceRequest) returns (common.Token); + // Quit a workspace. + rpc QuitWorkspace (WorkspaceRequest) returns (common.Empty); // Create a workspace. rpc CreateWorkspace (OwnedWorkspaceRequest) returns (common.WorkspaceInfo); // Delete a workspace. rpc DeleteWorkspace (OwnedWorkspaceRequest) returns (common.Empty); // List all workspaces the user has been invited to. rpc FetchInvitedWorkspaces (common.Empty) returns (WorkspacesInvitedList); - //List all workspaces the user owns. + // List all workspaces the user owns. rpc FetchOwnedWorkspaces (common.Empty) returns (WorkspacesOwnedList); // Handle a workspace invite request. rpc InviteToWorkspace (InviteRequest) returns (common.Empty); + // Accept a pending invite to a workspace. + rpc AcceptInvite (WorkspaceRequest) returns (common.Empty); + // Reject a pending invite to a workspace. + rpc RejectInvite (WorkspaceRequest) returns (common.Empty); } // A message representing a request for an owned workspace. From 4949f0f356120c2a4c7ae73864f19bb8837291b1 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 13:58:56 +0200 Subject: [PATCH 02/16] feat: send multiple cursor positions without repeating buffer (#15) --- proto/cursor.proto | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/proto/cursor.proto b/proto/cursor.proto index a9c72a7..775260e 100644 --- a/proto/cursor.proto +++ b/proto/cursor.proto @@ -9,7 +9,7 @@ service Cursor { // Retrieves all current cursor positions. rpc List(common.Empty) returns (CursorEventList); // Subscribe to a workspace's cursor events. - rpc Attach (stream cursor.CursorPosition) returns (stream cursor.CursorEvent); + rpc Attach (stream CursorUpdate) returns (stream CursorEvent); } // A message representing a list of cursor events. @@ -26,14 +26,20 @@ message RowCol { required int32 col = 2; } -// A message representing cursor position. +// A message representing a cursor position. message CursorPosition { - // The buffer where the cursor is located. - required files.BufferNode buffer = 1; // The cursor's start position. - required RowCol start = 2; + required RowCol start = 1; // The cursor's end position. - required RowCol end = 3; + required RowCol end = 2; +} + +// A message representing an update to the cursor position. +message CursorUpdate { + // The buffer where the cursor is located. + required files.BufferNode buffer = 1; + // A vector of cursor positions. + repeated CursorPosition = 2; } // A message representing a cursor event. @@ -41,5 +47,5 @@ message CursorEvent { // The user moving the cursor. required common.Identifier user = 1; // The new cursor position. - repeated CursorPosition position = 2; + repeated CursorUpdate position = 2; } From 2c15063e98193dce143710a21ce8c1ae1083cd93 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 14:04:21 +0200 Subject: [PATCH 03/16] fix: cursor updates dont need the ephemeral flag --- proto/cursor.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cursor.proto b/proto/cursor.proto index 775260e..17fb893 100644 --- a/proto/cursor.proto +++ b/proto/cursor.proto @@ -37,7 +37,7 @@ message CursorPosition { // A message representing an update to the cursor position. message CursorUpdate { // The buffer where the cursor is located. - required files.BufferNode buffer = 1; + required string buffer = 1; // A vector of cursor positions. repeated CursorPosition = 2; } From 2fda40e37d7f0ec078bcdf66954a34945af11737 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 14:04:36 +0200 Subject: [PATCH 04/16] fix: AccessBuffer doesn't need the ephemeral flag --- proto/workspace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/workspace.proto b/proto/workspace.proto index 33e3fd4..10e07c1 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -12,7 +12,7 @@ service Workspace { // Create a buffer within the workspace. rpc CreateBuffer (files.BufferNode) returns (common.Empty); // Access a buffer within the workspace and returns a buffer token for it. - rpc AccessBuffer (files.BufferNode) returns (common.Token); + rpc AccessBuffer (files.BufferRequest) returns (common.Token); // Transforms an ephemeral buffer in a persistent one. rpc PinBuffer (files.BufferRequest) returns (common.Empty); // Delete a buffer. From c06c187934aed7afeaf3c07409fc5553d5930a66 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 14:10:34 +0200 Subject: [PATCH 05/16] fix: missing field name --- Cargo.lock | 1 - proto/cursor.proto | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24f8811..9980fab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,7 +97,6 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "codemp-proto" version = "0.8.0" - dependencies = [ "prost", "tonic", diff --git a/proto/cursor.proto b/proto/cursor.proto index 17fb893..5015c37 100644 --- a/proto/cursor.proto +++ b/proto/cursor.proto @@ -39,7 +39,7 @@ message CursorUpdate { // The buffer where the cursor is located. required string buffer = 1; // A vector of cursor positions. - repeated CursorPosition = 2; + repeated CursorPosition cursors = 2; } // A message representing a cursor event. From e732daac4037936c2f2db770397f1624b1b4fa89 Mon Sep 17 00:00:00 2001 From: frelodev Date: Sat, 2 Aug 2025 14:22:18 +0200 Subject: [PATCH 06/16] chore: changed Invite Request message (workspace uuid to workspace name) --- proto/session.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/session.proto b/proto/session.proto index ea2b315..ed2d739 100644 --- a/proto/session.proto +++ b/proto/session.proto @@ -55,8 +55,8 @@ message WorkspacesOwnedList { message InviteRequest { // The user the invitation is for. required string user = 1; - // The workspace the invitation is for. - required common.Identifier workspace = 2; + // The workspace name the invitation is for. + required string workspace = 2; } // A message representing a session event. From 3fd2b543b66f175f473a8de672d43e544a75bd36 Mon Sep 17 00:00:00 2001 From: frelodev Date: Sat, 2 Aug 2025 15:46:30 +0200 Subject: [PATCH 07/16] feat: moved KickAll from Buffer to Workspace --- proto/buffer.proto | 2 -- proto/workspace.proto | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/buffer.proto b/proto/buffer.proto index 475f0d2..d980986 100644 --- a/proto/buffer.proto +++ b/proto/buffer.proto @@ -8,8 +8,6 @@ package buffer; service Buffer { // Attach to a buffer and receive operations. rpc Attach (stream Operation) returns (stream BufferEvent); - // Kicks all active users from the buffer. - rpc KickAll (common.Empty) returns (common.Empty); } // Message representing an operation that has occurred. diff --git a/proto/workspace.proto b/proto/workspace.proto index 10e07c1..036b57b 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -9,6 +9,8 @@ import "files.proto"; service Workspace { // Attach to a workspace. rpc Attach (common.Empty) returns (stream WorkspaceEvent); + // Kicks all active users from the workspace. + rpc KickAll (common.Empty) returns (common.Empty); // Create a buffer within the workspace. rpc CreateBuffer (files.BufferNode) returns (common.Empty); // Access a buffer within the workspace and returns a buffer token for it. From 23d2740db2bf017bcec2ad1f0e043af6f5a0426b Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 16:17:38 +0200 Subject: [PATCH 08/16] feat: convert back to fetch, add buffer join/leave events --- proto/buffer.proto | 4 ++-- proto/cursor.proto | 2 +- proto/session.proto | 1 + proto/workspace.proto | 42 ++++++++++++++++++++++++++++++++---------- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/proto/buffer.proto b/proto/buffer.proto index d980986..db80e99 100644 --- a/proto/buffer.proto +++ b/proto/buffer.proto @@ -1,9 +1,9 @@ syntax = "proto2"; -import "common.proto"; - package buffer; +import "common.proto"; + // Handles buffer changes and keeps users in sync. service Buffer { // Attach to a buffer and receive operations. diff --git a/proto/cursor.proto b/proto/cursor.proto index 5015c37..7591360 100644 --- a/proto/cursor.proto +++ b/proto/cursor.proto @@ -1,8 +1,8 @@ syntax = "proto2"; package cursor; + import "common.proto"; -import "files.proto"; // Handles cursor events and broadcasts them to all users. service Cursor { diff --git a/proto/session.proto b/proto/session.proto index ed2d739..a1e9eda 100644 --- a/proto/session.proto +++ b/proto/session.proto @@ -36,6 +36,7 @@ message OwnedWorkspaceRequest { // A message representing a request for a specific workspace. message WorkspaceRequest { + // The workspace's identifier. required common.Identifier id = 1; } diff --git a/proto/workspace.proto b/proto/workspace.proto index 036b57b..3f06f23 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -19,12 +19,12 @@ service Workspace { rpc PinBuffer (files.BufferRequest) returns (common.Empty); // Delete a buffer. rpc DeleteBuffer (files.BufferRequest) returns (common.Empty); - // List buffers in the workspace that are children of the given path. - rpc ListBuffers (files.BufferRequest) returns (files.BufferTree); - // List users in the workspace. - rpc ListUsers (common.Empty) returns (UserList); - // List users within a given buffer. - rpc ListBufferUsers (files.BufferRequest) returns (UserList); + // Retrieves the buffers in the workspace that are children of the given path. + rpc FetchBuffers (files.BufferRequest) returns (files.BufferTree); + // Retrieves the users in the workspace. + rpc FetchUsers (common.Empty) returns (UserList); + // Retrives the users within a given buffer. + rpc FetchBufferUsers (files.BufferRequest) returns (UserList); // Revokes all invites and kicks all active users. rpc KickAll (common.Empty) returns (common.Empty); } @@ -38,15 +38,17 @@ message UserList { // A message representing a workspace event. message WorkspaceEvent { // Event that occurs when a user joins a workspace. - message UserJoin { + message UserJoinWorkspace { // The user that joined. required common.User user = 1; } + // Event that occurs when a user leaves a workspace. - message UserLeave { + message UserLeaveWorkspace { // The user that left. required common.User user = 1; } + // Event that occurs when a file is created in a workspace. message FileCreate { // The path of the created file. @@ -54,6 +56,7 @@ message WorkspaceEvent { // Whether the buffer is ephemeral. required bool ephemeral = 2; } + // Event that occurs when a file is renamed in a workspace. message FileRename { // The old path of the file. @@ -61,18 +64,37 @@ message WorkspaceEvent { // The new path of the file. required string after = 2; } + // Event that occurs when a file is deleted in a workspace. message FileDelete { // The path of the deleted file required string path = 1; } + // Event that occurs when a user joins a buffer. + message UserJoinBuffer { + // The user that joined. + required common.User user = 1; + // The buffer the event happened on. + required string buffer = 2; + } + + // Event that occurs when a user leaves a buffer. + message UserLeaveBuffer { + // The user that left. + required common.User user = 1; + // The buffer the event happened on. + required string buffer = 2; + } + // The union containing actual event. oneof event { - UserJoin join = 1; - UserLeave leave = 2; + UserWorkspaceLeave workspace_join = 1; + UserLeaveWorkspace workspace_leave = 2; FileCreate create = 3; FileRename rename = 4; FileDelete delete = 5; + UserJoinBuffer buffer_join = 6; + UserLeaveBuffer buffer_leave = 7; } } From e4309d8449d6ceb6135aaf12ecae6ccec944cf72 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 16:20:21 +0200 Subject: [PATCH 09/16] chore: access into getToken --- proto/session.proto | 4 ++-- proto/workspace.proto | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/proto/session.proto b/proto/session.proto index a1e9eda..9a413f9 100644 --- a/proto/session.proto +++ b/proto/session.proto @@ -8,8 +8,8 @@ import "common.proto"; service Session { // Attach to a session and receive events. rpc Attach (common.Empty) returns (stream SessionEvent); - // Handle a workspace access request and return a workspace token. - rpc AccessWorkspace (WorkspaceRequest) returns (common.Token); + // Handle a workspace access request and return a workspace token for it. + rpc GetWorkspaceToken (WorkspaceRequest) returns (common.Token); // Quit a workspace. rpc QuitWorkspace (WorkspaceRequest) returns (common.Empty); // Create a workspace. diff --git a/proto/workspace.proto b/proto/workspace.proto index 3f06f23..5f0fe67 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -9,12 +9,10 @@ import "files.proto"; service Workspace { // Attach to a workspace. rpc Attach (common.Empty) returns (stream WorkspaceEvent); - // Kicks all active users from the workspace. - rpc KickAll (common.Empty) returns (common.Empty); // Create a buffer within the workspace. rpc CreateBuffer (files.BufferNode) returns (common.Empty); - // Access a buffer within the workspace and returns a buffer token for it. - rpc AccessBuffer (files.BufferRequest) returns (common.Token); + // Handle a buffer access request and return a buffer token for it. + rpc GetBufferToken (files.BufferRequest) returns (common.Token); // Transforms an ephemeral buffer in a persistent one. rpc PinBuffer (files.BufferRequest) returns (common.Empty); // Delete a buffer. @@ -25,8 +23,6 @@ service Workspace { rpc FetchUsers (common.Empty) returns (UserList); // Retrives the users within a given buffer. rpc FetchBufferUsers (files.BufferRequest) returns (UserList); - // Revokes all invites and kicks all active users. - rpc KickAll (common.Empty) returns (common.Empty); } // A message representing a list of users. From 98bebe580fccc6a66840636a07d98ba7911d4fed Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 16:21:48 +0200 Subject: [PATCH 10/16] fix: incorrect variant --- proto/workspace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/workspace.proto b/proto/workspace.proto index 5f0fe67..925b344 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -85,7 +85,7 @@ message WorkspaceEvent { // The union containing actual event. oneof event { - UserWorkspaceLeave workspace_join = 1; + UserJoinWorkspace workspace_join = 1; UserLeaveWorkspace workspace_leave = 2; FileCreate create = 3; FileRename rename = 4; From 8e395f3484a2f56c8150f6c46763b48b109ec0df Mon Sep 17 00:00:00 2001 From: frelodev Date: Sat, 2 Aug 2025 16:24:50 +0200 Subject: [PATCH 11/16] feat: refresh token RPC inside Buffer --- proto/buffer.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto/buffer.proto b/proto/buffer.proto index db80e99..c70cc97 100644 --- a/proto/buffer.proto +++ b/proto/buffer.proto @@ -8,6 +8,8 @@ import "common.proto"; service Buffer { // Attach to a buffer and receive operations. rpc Attach (stream Operation) returns (stream BufferEvent); + // Refresh token + rpc Refresh (common.Empty) returns (common.Empty); } // Message representing an operation that has occurred. From b4badc9d3b6bec91328b30fb66df1bbc3c770a6d Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 16:30:06 +0200 Subject: [PATCH 12/16] feat: unpin --- proto/auth.proto | 1 - proto/workspace.proto | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/proto/auth.proto b/proto/auth.proto index 1f79acc..909cf80 100644 --- a/proto/auth.proto +++ b/proto/auth.proto @@ -8,7 +8,6 @@ import "common.proto"; service Auth { // Send credentials, returns valid session token. rpc Login (LoginRequest) returns (LoginResponse); - // If the given token has recently expired, get a new valid one. rpc Refresh (common.Token) returns (common.Token); } diff --git a/proto/workspace.proto b/proto/workspace.proto index 925b344..19c1553 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -14,7 +14,9 @@ service Workspace { // Handle a buffer access request and return a buffer token for it. rpc GetBufferToken (files.BufferRequest) returns (common.Token); // Transforms an ephemeral buffer in a persistent one. - rpc PinBuffer (files.BufferRequest) returns (common.Empty); + rpc PinBuffer (files.BufferRequest) returns (common.Token); + // Transforms a persistent buffer in an ephemeral one. + rpc UnPinBuffer (files.BufferRequest) returns (common.Token); // Delete a buffer. rpc DeleteBuffer (files.BufferRequest) returns (common.Empty); // Retrieves the buffers in the workspace that are children of the given path. From 8fe13fa607be6738b93b5c5df6115e34c1d6c9b8 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 2 Aug 2025 16:48:01 +0200 Subject: [PATCH 13/16] feat: add keepalive rpc --- proto/buffer.proto | 4 ++-- proto/cursor.proto | 4 +++- proto/workspace.proto | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/proto/buffer.proto b/proto/buffer.proto index c70cc97..c73dd52 100644 --- a/proto/buffer.proto +++ b/proto/buffer.proto @@ -8,8 +8,8 @@ import "common.proto"; service Buffer { // Attach to a buffer and receive operations. rpc Attach (stream Operation) returns (stream BufferEvent); - // Refresh token - rpc Refresh (common.Empty) returns (common.Empty); + // Send the keep alive signal and renew the token. + rpc KeepAlive (common.Empty) returns (common.Empty); } // Message representing an operation that has occurred. diff --git a/proto/cursor.proto b/proto/cursor.proto index 7591360..1027ca6 100644 --- a/proto/cursor.proto +++ b/proto/cursor.proto @@ -6,10 +6,12 @@ import "common.proto"; // Handles cursor events and broadcasts them to all users. service Cursor { - // Retrieves all current cursor positions. + // Retrieves all current cursor positions. rpc List(common.Empty) returns (CursorEventList); // Subscribe to a workspace's cursor events. rpc Attach (stream CursorUpdate) returns (stream CursorEvent); + // Send the keep alive signal and renew the token. + rpc KeepAlive (common.Empty) returns (common.Empty); } // A message representing a list of cursor events. diff --git a/proto/workspace.proto b/proto/workspace.proto index 19c1553..12dbf29 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -25,6 +25,8 @@ service Workspace { rpc FetchUsers (common.Empty) returns (UserList); // Retrives the users within a given buffer. rpc FetchBufferUsers (files.BufferRequest) returns (UserList); + // Send the keep alive signal and renew the token. + rpc KeepAlive (common.Empty) returns (common.Empty); } // A message representing a list of users. From 8c34f81123c787470a6c9ea6862b7b39f4cd8c6b Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 2 Aug 2025 17:57:18 +0200 Subject: [PATCH 14/16] fix: one cursor update per event --- proto/cursor.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cursor.proto b/proto/cursor.proto index 1027ca6..2490478 100644 --- a/proto/cursor.proto +++ b/proto/cursor.proto @@ -49,5 +49,5 @@ message CursorEvent { // The user moving the cursor. required common.Identifier user = 1; // The new cursor position. - repeated CursorUpdate position = 2; + required CursorUpdate position = 2; } From 23012c1ddd2c488a923d4c71f1d8a1a7a61f7412 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 2 Aug 2025 18:58:39 +0200 Subject: [PATCH 15/16] fix: for my sanity, only one way to update tokens --- proto/workspace.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/workspace.proto b/proto/workspace.proto index 12dbf29..0df226b 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -14,9 +14,9 @@ service Workspace { // Handle a buffer access request and return a buffer token for it. rpc GetBufferToken (files.BufferRequest) returns (common.Token); // Transforms an ephemeral buffer in a persistent one. - rpc PinBuffer (files.BufferRequest) returns (common.Token); + rpc PinBuffer (files.BufferRequest) returns (common.Empty); // Transforms a persistent buffer in an ephemeral one. - rpc UnPinBuffer (files.BufferRequest) returns (common.Token); + rpc UnPinBuffer (files.BufferRequest) returns (common.Empty); // Delete a buffer. rpc DeleteBuffer (files.BufferRequest) returns (common.Empty); // Retrieves the buffers in the workspace that are children of the given path. From 4c14b163c6e89505cdaa2f355bece0afc15a7f91 Mon Sep 17 00:00:00 2001 From: frelodev Date: Sun, 3 Aug 2025 21:09:47 +0200 Subject: [PATCH 16/16] feat: use uuid instead of name/path in most session and workspace rpc --- proto/session.proto | 30 ++++++++++++------------------ proto/workspace.proto | 16 ++++++++-------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/proto/session.proto b/proto/session.proto index 9a413f9..d6f56e7 100644 --- a/proto/session.proto +++ b/proto/session.proto @@ -8,24 +8,24 @@ import "common.proto"; service Session { // Attach to a session and receive events. rpc Attach (common.Empty) returns (stream SessionEvent); - // Handle a workspace access request and return a workspace token for it. - rpc GetWorkspaceToken (WorkspaceRequest) returns (common.Token); - // Quit a workspace. - rpc QuitWorkspace (WorkspaceRequest) returns (common.Empty); + // Handle a workspace access request and return a workspace token for it given it's UUID. + rpc GetWorkspaceToken (common.Identifier) returns (common.Token); + // Quit a workspace given it's UUID. + rpc QuitWorkspace (common.Identifier) returns (common.Empty); // Create a workspace. rpc CreateWorkspace (OwnedWorkspaceRequest) returns (common.WorkspaceInfo); - // Delete a workspace. - rpc DeleteWorkspace (OwnedWorkspaceRequest) returns (common.Empty); + // Delete a workspace given it's UUID. + rpc DeleteWorkspace (common.Identifier) returns (common.Empty); // List all workspaces the user has been invited to. rpc FetchInvitedWorkspaces (common.Empty) returns (WorkspacesInvitedList); // List all workspaces the user owns. rpc FetchOwnedWorkspaces (common.Empty) returns (WorkspacesOwnedList); // Handle a workspace invite request. rpc InviteToWorkspace (InviteRequest) returns (common.Empty); - // Accept a pending invite to a workspace. - rpc AcceptInvite (WorkspaceRequest) returns (common.Empty); - // Reject a pending invite to a workspace. - rpc RejectInvite (WorkspaceRequest) returns (common.Empty); + // Accept a pending invite to a workspace given it's UUID. + rpc AcceptInvite (common.Identifier) returns (common.Empty); + // Reject a pending invite to a workspace given it's UUID. + rpc RejectInvite (common.Identifier) returns (common.Empty); } // A message representing a request for an owned workspace. @@ -34,12 +34,6 @@ message OwnedWorkspaceRequest { required string name = 1; } -// A message representing a request for a specific workspace. -message WorkspaceRequest { - // The workspace's identifier. - required common.Identifier id = 1; -} - // A message representing a list of workspaces. message WorkspacesInvitedList { // A vector of workspaces the user is invited to. @@ -56,8 +50,8 @@ message WorkspacesOwnedList { message InviteRequest { // The user the invitation is for. required string user = 1; - // The workspace name the invitation is for. - required string workspace = 2; + // The workspace's uuid the invitation is for. + required common.Identifier workspace = 2; } // A message representing a session event. diff --git a/proto/workspace.proto b/proto/workspace.proto index 0df226b..a84f217 100644 --- a/proto/workspace.proto +++ b/proto/workspace.proto @@ -11,14 +11,14 @@ service Workspace { rpc Attach (common.Empty) returns (stream WorkspaceEvent); // Create a buffer within the workspace. rpc CreateBuffer (files.BufferNode) returns (common.Empty); - // Handle a buffer access request and return a buffer token for it. - rpc GetBufferToken (files.BufferRequest) returns (common.Token); - // Transforms an ephemeral buffer in a persistent one. - rpc PinBuffer (files.BufferRequest) returns (common.Empty); - // Transforms a persistent buffer in an ephemeral one. - rpc UnPinBuffer (files.BufferRequest) returns (common.Empty); - // Delete a buffer. - rpc DeleteBuffer (files.BufferRequest) returns (common.Empty); + // Handle a buffer access request and return a buffer token for it given it's UUID. + rpc GetBufferToken (common.Identifier) returns (common.Token); + // Transforms an ephemeral buffer in a persistent one given it's UUID. + rpc PinBuffer (common.Identifier) returns (common.Empty); + // Transforms a persistent buffer in an ephemeral one given it's UUID. + rpc UnPinBuffer (common.Identifier) returns (common.Empty); + // Delete a buffer given it's UUID. + rpc DeleteBuffer (common.Identifier) returns (common.Empty); // Retrieves the buffers in the workspace that are children of the given path. rpc FetchBuffers (files.BufferRequest) returns (files.BufferTree); // Retrieves the users in the workspace.