Skip to content

Commit 4c14b16

Browse files
committed
feat: use uuid instead of name/path in most session and workspace rpc
1 parent 23012c1 commit 4c14b16

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

proto/session.proto

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ import "common.proto";
88
service Session {
99
// Attach to a session and receive events.
1010
rpc Attach (common.Empty) returns (stream SessionEvent);
11-
// Handle a workspace access request and return a workspace token for it.
12-
rpc GetWorkspaceToken (WorkspaceRequest) returns (common.Token);
13-
// Quit a workspace.
14-
rpc QuitWorkspace (WorkspaceRequest) returns (common.Empty);
11+
// Handle a workspace access request and return a workspace token for it given it's UUID.
12+
rpc GetWorkspaceToken (common.Identifier) returns (common.Token);
13+
// Quit a workspace given it's UUID.
14+
rpc QuitWorkspace (common.Identifier) returns (common.Empty);
1515
// Create a workspace.
1616
rpc CreateWorkspace (OwnedWorkspaceRequest) returns (common.WorkspaceInfo);
17-
// Delete a workspace.
18-
rpc DeleteWorkspace (OwnedWorkspaceRequest) returns (common.Empty);
17+
// Delete a workspace given it's UUID.
18+
rpc DeleteWorkspace (common.Identifier) returns (common.Empty);
1919
// List all workspaces the user has been invited to.
2020
rpc FetchInvitedWorkspaces (common.Empty) returns (WorkspacesInvitedList);
2121
// List all workspaces the user owns.
2222
rpc FetchOwnedWorkspaces (common.Empty) returns (WorkspacesOwnedList);
2323
// Handle a workspace invite request.
2424
rpc InviteToWorkspace (InviteRequest) returns (common.Empty);
25-
// Accept a pending invite to a workspace.
26-
rpc AcceptInvite (WorkspaceRequest) returns (common.Empty);
27-
// Reject a pending invite to a workspace.
28-
rpc RejectInvite (WorkspaceRequest) returns (common.Empty);
25+
// Accept a pending invite to a workspace given it's UUID.
26+
rpc AcceptInvite (common.Identifier) returns (common.Empty);
27+
// Reject a pending invite to a workspace given it's UUID.
28+
rpc RejectInvite (common.Identifier) returns (common.Empty);
2929
}
3030

3131
// A message representing a request for an owned workspace.
@@ -34,12 +34,6 @@ message OwnedWorkspaceRequest {
3434
required string name = 1;
3535
}
3636

37-
// A message representing a request for a specific workspace.
38-
message WorkspaceRequest {
39-
// The workspace's identifier.
40-
required common.Identifier id = 1;
41-
}
42-
4337
// A message representing a list of workspaces.
4438
message WorkspacesInvitedList {
4539
// A vector of workspaces the user is invited to.
@@ -56,8 +50,8 @@ message WorkspacesOwnedList {
5650
message InviteRequest {
5751
// The user the invitation is for.
5852
required string user = 1;
59-
// The workspace name the invitation is for.
60-
required string workspace = 2;
53+
// The workspace's uuid the invitation is for.
54+
required common.Identifier workspace = 2;
6155
}
6256

6357
// A message representing a session event.

proto/workspace.proto

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ service Workspace {
1111
rpc Attach (common.Empty) returns (stream WorkspaceEvent);
1212
// Create a buffer within the workspace.
1313
rpc CreateBuffer (files.BufferNode) returns (common.Empty);
14-
// Handle a buffer access request and return a buffer token for it.
15-
rpc GetBufferToken (files.BufferRequest) returns (common.Token);
16-
// Transforms an ephemeral buffer in a persistent one.
17-
rpc PinBuffer (files.BufferRequest) returns (common.Empty);
18-
// Transforms a persistent buffer in an ephemeral one.
19-
rpc UnPinBuffer (files.BufferRequest) returns (common.Empty);
20-
// Delete a buffer.
21-
rpc DeleteBuffer (files.BufferRequest) returns (common.Empty);
14+
// Handle a buffer access request and return a buffer token for it given it's UUID.
15+
rpc GetBufferToken (common.Identifier) returns (common.Token);
16+
// Transforms an ephemeral buffer in a persistent one given it's UUID.
17+
rpc PinBuffer (common.Identifier) returns (common.Empty);
18+
// Transforms a persistent buffer in an ephemeral one given it's UUID.
19+
rpc UnPinBuffer (common.Identifier) returns (common.Empty);
20+
// Delete a buffer given it's UUID.
21+
rpc DeleteBuffer (common.Identifier) returns (common.Empty);
2222
// Retrieves the buffers in the workspace that are children of the given path.
2323
rpc FetchBuffers (files.BufferRequest) returns (files.BufferTree);
2424
// Retrieves the users in the workspace.

0 commit comments

Comments
 (0)