Add new FileSystem related messages to LivebookProto (#2172)

This commit is contained in:
Alexandre de Souza 2023-08-22 18:25:14 -03:00 committed by GitHub
parent 928181cefe
commit c06712fa67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 90 additions and 17 deletions

View file

@ -3,9 +3,12 @@ defmodule LivebookProto do
alias LivebookProto.{
Event,
FileSystemCreated,
FileSystemDeleted,
FileSystemUpdated,
SecretCreated,
SecretUpdated,
SecretDeleted,
SecretUpdated,
UserSynchronized
}
@ -15,9 +18,12 @@ defmodule LivebookProto do
end)
@type event_proto ::
SecretCreated.t()
| SecretUpdated.t()
FileSystemCreated.t()
| FileSystemDeleted.t()
| FileSystemUpdated.t()
| SecretCreated.t()
| SecretDeleted.t()
| SecretUpdated.t()
| UserSynchronized.t()
@doc """

View file

@ -1,6 +1,5 @@
defmodule LivebookProto.Error do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :details, 1, type: :string
end

View file

@ -1,6 +1,5 @@
defmodule LivebookProto.Event do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
oneof :type, 0
@ -23,4 +22,19 @@ defmodule LivebookProto.Event do
type: LivebookProto.UserConnected,
json_name: "userConnected",
oneof: 0
field :file_system_created, 5,
type: LivebookProto.FileSystemCreated,
json_name: "fileSystemCreated",
oneof: 0
field :file_system_updated, 6,
type: LivebookProto.FileSystemUpdated,
json_name: "fileSystemUpdated",
oneof: 0
field :file_system_deleted, 7,
type: LivebookProto.FileSystemDeleted,
json_name: "fileSystemDeleted",
oneof: 0
end

View file

@ -0,0 +1,8 @@
defmodule LivebookProto.FileSystem do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :id, 1, type: :string
field :name, 2, type: :string
field :type, 3, type: :string
field :value, 4, type: :string
end

View file

@ -0,0 +1,8 @@
defmodule LivebookProto.FileSystemCreated do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :id, 1, type: :string
field :name, 2, type: :string
field :type, 3, type: :string
field :value, 4, type: :string
end

View file

@ -0,0 +1,5 @@
defmodule LivebookProto.FileSystemDeleted do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :id, 1, type: :string
end

View file

@ -0,0 +1,8 @@
defmodule LivebookProto.FileSystemUpdated do
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :id, 1, type: :string
field :name, 2, type: :string
field :type, 3, type: :string
field :value, 4, type: :string
end

View file

@ -1,6 +1,5 @@
defmodule LivebookProto.Secret do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,6 +1,5 @@
defmodule LivebookProto.SecretCreated do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,6 +1,5 @@
defmodule LivebookProto.SecretDeleted do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :name, 1, type: :string
end

View file

@ -1,6 +1,5 @@
defmodule LivebookProto.SecretUpdated do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :name, 1, type: :string
field :value, 2, type: :string

View file

@ -1,7 +1,7 @@
defmodule LivebookProto.UserConnected do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0"
field :name, 1, type: :string
field :secrets, 2, repeated: true, type: LivebookProto.Secret
field :file_systems, 3, repeated: true, type: LivebookProto.FileSystem, json_name: "fileSystems"
end

View file

@ -23,9 +23,35 @@ message SecretDeleted {
string name = 1;
}
message FileSystem {
string id = 1;
string name = 2;
string type = 3;
string value = 4;
}
message FileSystemCreated {
string id = 1;
string name = 2;
string type = 3;
string value = 4;
}
message FileSystemUpdated {
string id = 1;
string name = 2;
string type = 3;
string value = 4;
}
message FileSystemDeleted {
string id = 1;
}
message UserConnected {
string name = 1;
repeated Secret secrets = 2;
repeated FileSystem file_systems = 3;
}
message Event {
@ -34,5 +60,8 @@ message Event {
SecretUpdated secret_updated = 2;
SecretDeleted secret_deleted = 3;
UserConnected user_connected = 4;
FileSystemCreated file_system_created = 5;
FileSystemUpdated file_system_updated = 6;
FileSystemDeleted file_system_deleted = 7;
}
}