From fcb4e5af4c37dd6be46ff0083efaef09ba620e84 Mon Sep 17 00:00:00 2001 From: Karol Konkol Date: Thu, 7 Nov 2024 17:23:01 +0100 Subject: [PATCH 1/3] Add publish fishjam protos action --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e861344 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Deployment + +permissions: + contents: read + +on: + push: + tags: + - /v.*/ + +jobs: + publish: + runs-on: ubuntu-latest + name: hex_publish + steps: + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: "27" + elixir-version: "1.17" + + - name: Checkout the code + uses: actions/checkout@v3 + + - name: Install dependencies + run: mix deps.get + working-directory: fishjam_protos + + - name: Publish package + env: + HEX_API_KEY: ${{ secrets.MIX_HEX_KEY }} + run: mix hex.publish --yes + working-directory: fishjam_protos \ No newline at end of file From 24d0a06ef80f10b5f8bfd5da121375161d4822a2 Mon Sep 17 00:00:00 2001 From: Karol Konkol Date: Fri, 8 Nov 2024 11:33:44 +0100 Subject: [PATCH 2/3] Check if fishjam_protos are up to date --- .github/workflows/ci.yml | 37 +++ fishjam_protos/.formatter.exs | 3 +- fishjam_protos/compile_proto.sh | 3 + .../lib/fishjam/media_events/peer/peer.pb.ex | 81 +++---- .../fishjam/media_events/server/server.pb.ex | 135 +++++------ .../lib/fishjam/media_events/shared.pb.ex | 30 +-- .../lib/fishjam/peer_notifications.pb.ex | 48 ++-- .../lib/fishjam/server_notifications.pb.ex | 215 ++++++++---------- 8 files changed, 278 insertions(+), 274 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b15f61..084ad83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,3 +45,40 @@ jobs: working-directory: fishjam_protos if: ${{ !cancelled() && steps.compile.outcome == 'success' }} run: mix format --check-formatted + + check-protobufs-update: + runs-on: ubuntu-latest + name: Fishjam protos update + strategy: + matrix: + otp: ['27'] + elixir: ['1.17'] + steps: + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.elixir}} + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install protobuf compiler (protoc) if needed + run: | + sudo apt update + sudo apt install -y protobuf-compiler + PATH=~/.mix/escripts:$PATH + mix deps.get + mix escript.install hex protobuf --force + working-directory: fishjam_protos + + - name: Run compile_proto.sh + run: bash compile_proto.sh + working-directory: fishjam_protos + + - name: Check for changes in protobuf files + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "Generated protobuf files are not up to date. Please regenerate them and commit the changes." + git diff + exit 1 + fi \ No newline at end of file diff --git a/fishjam_protos/.formatter.exs b/fishjam_protos/.formatter.exs index d2cda26..ee19977 100644 --- a/fishjam_protos/.formatter.exs +++ b/fishjam_protos/.formatter.exs @@ -1,4 +1,5 @@ # Used by "mix format" [ - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], + locals_without_parens: [field: 1, field: 2, field: 3, field: 4, oneof: 1, oneof: 2] ] diff --git a/fishjam_protos/compile_proto.sh b/fishjam_protos/compile_proto.sh index b4b5e1c..ee85b47 100755 --- a/fishjam_protos/compile_proto.sh +++ b/fishjam_protos/compile_proto.sh @@ -17,3 +17,6 @@ for file in $files; do printf "DONE\n" count=$(($count + 1)) done + +cd fishjam_protos +mix format "lib/**/*.ex" diff --git a/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex b/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex index 357d717..ce2b0d7 100644 --- a/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex +++ b/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex @@ -1,146 +1,137 @@ defmodule Fishjam.MediaEvents.Peer.MediaEvent.VariantBitrate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:variant, 1, type: Fishjam.MediaEvents.Variant, enum: true) - field(:bitrate, 2, type: :int32) + field :variant, 1, type: Fishjam.MediaEvents.Variant, enum: true + field :bitrate, 2, type: :int32 end defmodule Fishjam.MediaEvents.Peer.MediaEvent.TrackIdToMetadata do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:track_id, 1, type: :string, json_name: "trackId") - field(:metadata, 2, type: Fishjam.MediaEvents.Metadata) + field :track_id, 1, type: :string, json_name: "trackId" + field :metadata, 2, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Peer.MediaEvent.TrackIdToBitrates do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:tracks, 0) + oneof :tracks, 0 - field(:track_bitrate, 1, + field :track_bitrate, 1, type: Fishjam.MediaEvents.Peer.MediaEvent.TrackBitrate, json_name: "trackBitrate", oneof: 0 - ) end defmodule Fishjam.MediaEvents.Peer.MediaEvent.Connect do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:metadata, 1, type: Fishjam.MediaEvents.Metadata) + field :metadata, 1, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Peer.MediaEvent.Disconnect do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Fishjam.MediaEvents.Peer.MediaEvent.UpdateEndpointMetadata do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:metadata, 1, type: Fishjam.MediaEvents.Metadata) + field :metadata, 1, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Peer.MediaEvent.UpdateTrackMetadata do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:track_id, 1, type: :string, json_name: "trackId") - field(:metadata, 2, type: Fishjam.MediaEvents.Metadata) + field :track_id, 1, type: :string, json_name: "trackId" + field :metadata, 2, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Peer.MediaEvent.RenegotiateTracks do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Fishjam.MediaEvents.Peer.MediaEvent.SdpOffer do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:sdp_offer, 1, type: :string, json_name: "sdpOffer") + field :sdp_offer, 1, type: :string, json_name: "sdpOffer" - field(:track_id_to_metadata, 2, + field :track_id_to_metadata, 2, repeated: true, type: Fishjam.MediaEvents.Peer.MediaEvent.TrackIdToMetadata, json_name: "trackIdToMetadata" - ) - field(:track_id_to_bitrates, 3, + field :track_id_to_bitrates, 3, repeated: true, type: Fishjam.MediaEvents.Peer.MediaEvent.TrackIdToBitrates, json_name: "trackIdToBitrates" - ) - field(:mid_to_track_id, 4, + field :mid_to_track_id, 4, repeated: true, type: Fishjam.MediaEvents.MidToTrackId, json_name: "midToTrackId" - ) end defmodule Fishjam.MediaEvents.Peer.MediaEvent.TrackBitrate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:track_id, 1, type: :string, json_name: "trackId") - field(:bitrate, 2, type: :int32) + field :track_id, 1, type: :string, json_name: "trackId" + field :bitrate, 2, type: :int32 end defmodule Fishjam.MediaEvents.Peer.MediaEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:content, 0) + oneof :content, 0 - field(:connect, 1, type: Fishjam.MediaEvents.Peer.MediaEvent.Connect, oneof: 0) - field(:disconnect, 2, type: Fishjam.MediaEvents.Peer.MediaEvent.Disconnect, oneof: 0) + field :connect, 1, type: Fishjam.MediaEvents.Peer.MediaEvent.Connect, oneof: 0 + field :disconnect, 2, type: Fishjam.MediaEvents.Peer.MediaEvent.Disconnect, oneof: 0 - field(:update_endpoint_metadata, 3, + field :update_endpoint_metadata, 3, type: Fishjam.MediaEvents.Peer.MediaEvent.UpdateEndpointMetadata, json_name: "updateEndpointMetadata", oneof: 0 - ) - field(:update_track_metadata, 4, + field :update_track_metadata, 4, type: Fishjam.MediaEvents.Peer.MediaEvent.UpdateTrackMetadata, json_name: "updateTrackMetadata", oneof: 0 - ) - field(:renegotiate_tracks, 5, + field :renegotiate_tracks, 5, type: Fishjam.MediaEvents.Peer.MediaEvent.RenegotiateTracks, json_name: "renegotiateTracks", oneof: 0 - ) - field(:candidate, 6, type: Fishjam.MediaEvents.Candidate, oneof: 0) + field :candidate, 6, type: Fishjam.MediaEvents.Candidate, oneof: 0 - field(:sdp_offer, 7, + field :sdp_offer, 7, type: Fishjam.MediaEvents.Peer.MediaEvent.SdpOffer, json_name: "sdpOffer", oneof: 0 - ) - field(:track_bitrate, 8, + field :track_bitrate, 8, type: Fishjam.MediaEvents.Peer.MediaEvent.TrackBitrate, json_name: "trackBitrate", oneof: 0 - ) end diff --git a/fishjam_protos/lib/fishjam/media_events/server/server.pb.ex b/fishjam_protos/lib/fishjam/media_events/server/server.pb.ex index b523583..5cd7b12 100644 --- a/fishjam_protos/lib/fishjam/media_events/server/server.pb.ex +++ b/fishjam_protos/lib/fishjam/media_events/server/server.pb.ex @@ -1,214 +1,199 @@ defmodule Fishjam.MediaEvents.Server.MediaEvent.VadNotification.Status do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:STATUS_UNSPECIFIED, 0) - field(:STATUS_SILENCE, 1) - field(:STATUS_SPEECH, 2) + field :STATUS_UNSPECIFIED, 0 + field :STATUS_SILENCE, 1 + field :STATUS_SPEECH, 2 end defmodule Fishjam.MediaEvents.Server.MediaEvent.Track do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:track_id, 1, type: :string, json_name: "trackId") - field(:metadata, 2, type: Fishjam.MediaEvents.Metadata) + field :track_id, 1, type: :string, json_name: "trackId" + field :metadata, 2, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Server.MediaEvent.Endpoint do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:endpoint_type, 2, type: :string, json_name: "endpointType") - field(:metadata, 3, type: Fishjam.MediaEvents.Metadata) - field(:tracks, 4, repeated: true, type: Fishjam.MediaEvents.Server.MediaEvent.Track) + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :endpoint_type, 2, type: :string, json_name: "endpointType" + field :metadata, 3, type: Fishjam.MediaEvents.Metadata + field :tracks, 4, repeated: true, type: Fishjam.MediaEvents.Server.MediaEvent.Track end defmodule Fishjam.MediaEvents.Server.MediaEvent.EndpointUpdated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:metadata, 2, type: Fishjam.MediaEvents.Metadata) + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :metadata, 2, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Server.MediaEvent.TrackUpdated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:track_id, 2, type: :string, json_name: "trackId") - field(:metadata, 3, type: Fishjam.MediaEvents.Metadata) + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :track_id, 2, type: :string, json_name: "trackId" + field :metadata, 3, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Server.MediaEvent.TracksAdded do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:tracks, 2, repeated: true, type: Fishjam.MediaEvents.Server.MediaEvent.Track) + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :tracks, 2, repeated: true, type: Fishjam.MediaEvents.Server.MediaEvent.Track end defmodule Fishjam.MediaEvents.Server.MediaEvent.TracksRemoved do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:track_ids, 2, repeated: true, type: :string, json_name: "trackIds") + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :track_ids, 2, repeated: true, type: :string, json_name: "trackIds" end defmodule Fishjam.MediaEvents.Server.MediaEvent.EndpointAdded do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:metadata, 2, type: Fishjam.MediaEvents.Metadata) + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :metadata, 2, type: Fishjam.MediaEvents.Metadata end defmodule Fishjam.MediaEvents.Server.MediaEvent.Connected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") - field(:endpoints, 2, repeated: true, type: Fishjam.MediaEvents.Server.MediaEvent.Endpoint) + field :endpoint_id, 1, type: :string, json_name: "endpointId" + field :endpoints, 2, repeated: true, type: Fishjam.MediaEvents.Server.MediaEvent.Endpoint end defmodule Fishjam.MediaEvents.Server.MediaEvent.EndpointRemoved do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:endpoint_id, 1, type: :string, json_name: "endpointId") + field :endpoint_id, 1, type: :string, json_name: "endpointId" end defmodule Fishjam.MediaEvents.Server.MediaEvent.Error do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:message, 1, type: :string) + field :message, 1, type: :string end defmodule Fishjam.MediaEvents.Server.MediaEvent.OfferData.TrackTypes do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:audio, 1, type: :int32) - field(:video, 2, type: :int32) + field :audio, 1, type: :int32 + field :video, 2, type: :int32 end defmodule Fishjam.MediaEvents.Server.MediaEvent.OfferData do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:tracks_types, 1, + field :tracks_types, 1, type: Fishjam.MediaEvents.Server.MediaEvent.OfferData.TrackTypes, json_name: "tracksTypes" - ) end defmodule Fishjam.MediaEvents.Server.MediaEvent.SdpAnswer do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:sdp_answer, 1, type: :string, json_name: "sdpAnswer") + field :sdp_answer, 1, type: :string, json_name: "sdpAnswer" - field(:mid_to_track_id, 2, + field :mid_to_track_id, 2, repeated: true, type: Fishjam.MediaEvents.MidToTrackId, json_name: "midToTrackId" - ) end defmodule Fishjam.MediaEvents.Server.MediaEvent.VadNotification do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:track_id, 1, type: :string, json_name: "trackId") - - field(:status, 2, - type: Fishjam.MediaEvents.Server.MediaEvent.VadNotification.Status, - enum: true - ) + field :track_id, 1, type: :string, json_name: "trackId" + field :status, 2, type: Fishjam.MediaEvents.Server.MediaEvent.VadNotification.Status, enum: true end defmodule Fishjam.MediaEvents.Server.MediaEvent do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:content, 0) + oneof :content, 0 - field(:endpoint_updated, 1, + field :endpoint_updated, 1, type: Fishjam.MediaEvents.Server.MediaEvent.EndpointUpdated, json_name: "endpointUpdated", oneof: 0 - ) - field(:track_updated, 2, + field :track_updated, 2, type: Fishjam.MediaEvents.Server.MediaEvent.TrackUpdated, json_name: "trackUpdated", oneof: 0 - ) - field(:tracks_added, 3, + field :tracks_added, 3, type: Fishjam.MediaEvents.Server.MediaEvent.TracksAdded, json_name: "tracksAdded", oneof: 0 - ) - field(:tracks_removed, 4, + field :tracks_removed, 4, type: Fishjam.MediaEvents.Server.MediaEvent.TracksRemoved, json_name: "tracksRemoved", oneof: 0 - ) - field(:endpoint_added, 5, + field :endpoint_added, 5, type: Fishjam.MediaEvents.Server.MediaEvent.EndpointAdded, json_name: "endpointAdded", oneof: 0 - ) - field(:endpoint_removed, 6, + field :endpoint_removed, 6, type: Fishjam.MediaEvents.Server.MediaEvent.EndpointRemoved, json_name: "endpointRemoved", oneof: 0 - ) - field(:connected, 7, type: Fishjam.MediaEvents.Server.MediaEvent.Connected, oneof: 0) - field(:error, 8, type: Fishjam.MediaEvents.Server.MediaEvent.Error, oneof: 0) + field :connected, 7, type: Fishjam.MediaEvents.Server.MediaEvent.Connected, oneof: 0 + field :error, 8, type: Fishjam.MediaEvents.Server.MediaEvent.Error, oneof: 0 - field(:offer_data, 9, + field :offer_data, 9, type: Fishjam.MediaEvents.Server.MediaEvent.OfferData, json_name: "offerData", oneof: 0 - ) - field(:candidate, 10, type: Fishjam.MediaEvents.Candidate, oneof: 0) + field :candidate, 10, type: Fishjam.MediaEvents.Candidate, oneof: 0 - field(:sdp_answer, 11, + field :sdp_answer, 11, type: Fishjam.MediaEvents.Server.MediaEvent.SdpAnswer, json_name: "sdpAnswer", oneof: 0 - ) - field(:vad_notification, 12, + field :vad_notification, 12, type: Fishjam.MediaEvents.Server.MediaEvent.VadNotification, json_name: "vadNotification", oneof: 0 - ) end diff --git a/fishjam_protos/lib/fishjam/media_events/shared.pb.ex b/fishjam_protos/lib/fishjam/media_events/shared.pb.ex index e15d4c5..f0e222d 100644 --- a/fishjam_protos/lib/fishjam/media_events/shared.pb.ex +++ b/fishjam_protos/lib/fishjam/media_events/shared.pb.ex @@ -1,38 +1,38 @@ defmodule Fishjam.MediaEvents.Variant do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:VARIANT_UNSPECIFIED, 0) - field(:VARIANT_LOW, 1) - field(:VARIANT_MEDIUM, 2) - field(:VARIANT_HIGH, 3) + field :VARIANT_UNSPECIFIED, 0 + field :VARIANT_LOW, 1 + field :VARIANT_MEDIUM, 2 + field :VARIANT_HIGH, 3 end defmodule Fishjam.MediaEvents.Metadata do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:json, 1, type: :string) + field :json, 1, type: :string end defmodule Fishjam.MediaEvents.MidToTrackId do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:mid, 1, type: :string) - field(:track_id, 2, type: :string, json_name: "trackId") + field :mid, 1, type: :string + field :track_id, 2, type: :string, json_name: "trackId" end defmodule Fishjam.MediaEvents.Candidate do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:candidate, 1, type: :string) - field(:sdp_m_line_index, 2, type: :int32, json_name: "sdpMLineIndex") - field(:sdp_mid, 3, type: :string, json_name: "sdpMid") - field(:username_fragment, 4, type: :string, json_name: "usernameFragment") + field :candidate, 1, type: :string + field :sdp_m_line_index, 2, type: :int32, json_name: "sdpMLineIndex" + field :sdp_mid, 3, type: :string, json_name: "sdpMid" + field :username_fragment, 4, type: :string, json_name: "usernameFragment" end diff --git a/fishjam_protos/lib/fishjam/peer_notifications.pb.ex b/fishjam_protos/lib/fishjam/peer_notifications.pb.ex index 373df3f..0322c9d 100644 --- a/fishjam_protos/lib/fishjam/peer_notifications.pb.ex +++ b/fishjam_protos/lib/fishjam/peer_notifications.pb.ex @@ -1,56 +1,62 @@ defmodule Fishjam.PeerMessage.Authenticated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Fishjam.PeerMessage.AuthRequest do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:token, 1, type: :string) - field(:sdk_version, 2, type: :string, json_name: "sdkVersion") + field :token, 1, type: :string + field :sdk_version, 2, type: :string, json_name: "sdkVersion" end defmodule Fishjam.PeerMessage.RTCStatsReport do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:data, 1, type: :string) + field :data, 1, type: :string +end + +defmodule Fishjam.PeerMessage.MediaEvent do + @moduledoc false + + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" + + field :data, 1, type: :string end defmodule Fishjam.PeerMessage do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:content, 0) + oneof :content, 0 - field(:authenticated, 1, type: Fishjam.PeerMessage.Authenticated, oneof: 0) + field :authenticated, 1, type: Fishjam.PeerMessage.Authenticated, oneof: 0 - field(:auth_request, 2, + field :auth_request, 2, type: Fishjam.PeerMessage.AuthRequest, json_name: "authRequest", oneof: 0 - ) - field(:peer_media_event, 3, + field :media_event, 3, type: Fishjam.PeerMessage.MediaEvent, json_name: "mediaEvent", oneof: 0 + + field :rtc_stats_report, 4, + type: Fishjam.PeerMessage.RTCStatsReport, + json_name: "rtcStatsReport", + oneof: 0 + + field :peer_media_event, 5, type: Fishjam.MediaEvents.Peer.MediaEvent, json_name: "peerMediaEvent", oneof: 0 - ) - field(:server_media_event, 4, + field :server_media_event, 6, type: Fishjam.MediaEvents.Server.MediaEvent, json_name: "serverMediaEvent", oneof: 0 - ) - - field(:rtc_stats_report, 5, - type: Fishjam.PeerMessage.RTCStatsReport, - json_name: "rtcStatsReport", - oneof: 0 - ) end diff --git a/fishjam_protos/lib/fishjam/server_notifications.pb.ex b/fishjam_protos/lib/fishjam/server_notifications.pb.ex index a599f0c..8ad573d 100644 --- a/fishjam_protos/lib/fishjam/server_notifications.pb.ex +++ b/fishjam_protos/lib/fishjam/server_notifications.pb.ex @@ -1,346 +1,327 @@ defmodule Fishjam.ServerMessage.EventType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:EVENT_TYPE_UNSPECIFIED, 0) - field(:EVENT_TYPE_SERVER_NOTIFICATION, 1) - field(:EVENT_TYPE_METRICS, 2) + field :EVENT_TYPE_UNSPECIFIED, 0 + field :EVENT_TYPE_SERVER_NOTIFICATION, 1 + field :EVENT_TYPE_METRICS, 2 end defmodule Fishjam.ServerMessage.TrackType do @moduledoc false - use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:TRACK_TYPE_UNSPECIFIED, 0) - field(:TRACK_TYPE_VIDEO, 1) - field(:TRACK_TYPE_AUDIO, 2) + field :TRACK_TYPE_UNSPECIFIED, 0 + field :TRACK_TYPE_VIDEO, 1 + field :TRACK_TYPE_AUDIO, 2 end defmodule Fishjam.ServerMessage.RoomCrashed do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") + field :room_id, 1, type: :string, json_name: "roomId" end defmodule Fishjam.ServerMessage.PeerAdded do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId") + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId" end defmodule Fishjam.ServerMessage.PeerDeleted do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId") + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId" end defmodule Fishjam.ServerMessage.PeerConnected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId") + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId" end defmodule Fishjam.ServerMessage.PeerDisconnected do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId") + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId" end defmodule Fishjam.ServerMessage.PeerCrashed do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId") - field(:reason, 3, type: :string) + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId" + field :reason, 3, type: :string end defmodule Fishjam.ServerMessage.ComponentCrashed do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:component_id, 2, type: :string, json_name: "componentId") + field :room_id, 1, type: :string, json_name: "roomId" + field :component_id, 2, type: :string, json_name: "componentId" end defmodule Fishjam.ServerMessage.Authenticated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" end defmodule Fishjam.ServerMessage.AuthRequest do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:token, 1, type: :string) + field :token, 1, type: :string end defmodule Fishjam.ServerMessage.SubscribeRequest do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:event_type, 1, type: Fishjam.ServerMessage.EventType, json_name: "eventType", enum: true) + field :event_type, 1, type: Fishjam.ServerMessage.EventType, json_name: "eventType", enum: true end defmodule Fishjam.ServerMessage.SubscribeResponse do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:event_type, 1, type: Fishjam.ServerMessage.EventType, json_name: "eventType", enum: true) + field :event_type, 1, type: Fishjam.ServerMessage.EventType, json_name: "eventType", enum: true end defmodule Fishjam.ServerMessage.RoomCreated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") + field :room_id, 1, type: :string, json_name: "roomId" end defmodule Fishjam.ServerMessage.RoomDeleted do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") + field :room_id, 1, type: :string, json_name: "roomId" end defmodule Fishjam.ServerMessage.MetricsReport do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:metrics, 1, type: :string) + field :metrics, 1, type: :string end defmodule Fishjam.ServerMessage.HlsPlayable do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:component_id, 2, type: :string, json_name: "componentId") + field :room_id, 1, type: :string, json_name: "roomId" + field :component_id, 2, type: :string, json_name: "componentId" end defmodule Fishjam.ServerMessage.HlsUploaded do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") + field :room_id, 1, type: :string, json_name: "roomId" end defmodule Fishjam.ServerMessage.HlsUploadCrashed do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") + field :room_id, 1, type: :string, json_name: "roomId" end defmodule Fishjam.ServerMessage.PeerMetadataUpdated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId") - field(:metadata, 3, type: :string) + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId" + field :metadata, 3, type: :string end defmodule Fishjam.ServerMessage.Track do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - field(:id, 1, type: :string) - field(:type, 2, type: Fishjam.ServerMessage.TrackType, enum: true) - field(:metadata, 3, type: :string) + field :id, 1, type: :string + field :type, 2, type: Fishjam.ServerMessage.TrackType, enum: true + field :metadata, 3, type: :string end defmodule Fishjam.ServerMessage.TrackAdded do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:endpoint_info, 0) + oneof :endpoint_info, 0 - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId", oneof: 0) - field(:component_id, 3, type: :string, json_name: "componentId", oneof: 0) - field(:track, 4, type: Fishjam.ServerMessage.Track) + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId", oneof: 0 + field :component_id, 3, type: :string, json_name: "componentId", oneof: 0 + field :track, 4, type: Fishjam.ServerMessage.Track end defmodule Fishjam.ServerMessage.TrackRemoved do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:endpoint_info, 0) + oneof :endpoint_info, 0 - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId", oneof: 0) - field(:component_id, 3, type: :string, json_name: "componentId", oneof: 0) - field(:track, 4, type: Fishjam.ServerMessage.Track) + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId", oneof: 0 + field :component_id, 3, type: :string, json_name: "componentId", oneof: 0 + field :track, 4, type: Fishjam.ServerMessage.Track end defmodule Fishjam.ServerMessage.TrackMetadataUpdated do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:endpoint_info, 0) + oneof :endpoint_info, 0 - field(:room_id, 1, type: :string, json_name: "roomId") - field(:peer_id, 2, type: :string, json_name: "peerId", oneof: 0) - field(:component_id, 3, type: :string, json_name: "componentId", oneof: 0) - field(:track, 4, type: Fishjam.ServerMessage.Track) + field :room_id, 1, type: :string, json_name: "roomId" + field :peer_id, 2, type: :string, json_name: "peerId", oneof: 0 + field :component_id, 3, type: :string, json_name: "componentId", oneof: 0 + field :track, 4, type: Fishjam.ServerMessage.Track end defmodule Fishjam.ServerMessage do @moduledoc false - use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.12.0" + use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" - oneof(:content, 0) + oneof :content, 0 - field(:room_crashed, 1, + field :room_crashed, 1, type: Fishjam.ServerMessage.RoomCrashed, json_name: "roomCrashed", oneof: 0 - ) - field(:peer_connected, 2, + field :peer_connected, 2, type: Fishjam.ServerMessage.PeerConnected, json_name: "peerConnected", oneof: 0 - ) - field(:peer_disconnected, 3, + field :peer_disconnected, 3, type: Fishjam.ServerMessage.PeerDisconnected, json_name: "peerDisconnected", oneof: 0 - ) - field(:peer_crashed, 4, + field :peer_crashed, 4, type: Fishjam.ServerMessage.PeerCrashed, json_name: "peerCrashed", oneof: 0 - ) - field(:component_crashed, 5, + field :component_crashed, 5, type: Fishjam.ServerMessage.ComponentCrashed, json_name: "componentCrashed", oneof: 0 - ) - field(:authenticated, 6, type: Fishjam.ServerMessage.Authenticated, oneof: 0) + field :authenticated, 6, type: Fishjam.ServerMessage.Authenticated, oneof: 0 - field(:auth_request, 7, + field :auth_request, 7, type: Fishjam.ServerMessage.AuthRequest, json_name: "authRequest", oneof: 0 - ) - field(:subscribe_request, 8, + field :subscribe_request, 8, type: Fishjam.ServerMessage.SubscribeRequest, json_name: "subscribeRequest", oneof: 0 - ) - field(:subscribe_response, 9, + field :subscribe_response, 9, type: Fishjam.ServerMessage.SubscribeResponse, json_name: "subscribeResponse", oneof: 0 - ) - field(:room_created, 10, + field :room_created, 10, type: Fishjam.ServerMessage.RoomCreated, json_name: "roomCreated", oneof: 0 - ) - field(:room_deleted, 11, + field :room_deleted, 11, type: Fishjam.ServerMessage.RoomDeleted, json_name: "roomDeleted", oneof: 0 - ) - field(:metrics_report, 12, + field :metrics_report, 12, type: Fishjam.ServerMessage.MetricsReport, json_name: "metricsReport", oneof: 0 - ) - field(:hls_playable, 13, + field :hls_playable, 13, type: Fishjam.ServerMessage.HlsPlayable, json_name: "hlsPlayable", oneof: 0 - ) - field(:hls_uploaded, 14, + field :hls_uploaded, 14, type: Fishjam.ServerMessage.HlsUploaded, json_name: "hlsUploaded", oneof: 0 - ) - field(:hls_upload_crashed, 15, + field :hls_upload_crashed, 15, type: Fishjam.ServerMessage.HlsUploadCrashed, json_name: "hlsUploadCrashed", oneof: 0 - ) - field(:peer_metadata_updated, 16, + field :peer_metadata_updated, 16, type: Fishjam.ServerMessage.PeerMetadataUpdated, json_name: "peerMetadataUpdated", oneof: 0 - ) - field(:track_added, 17, + field :track_added, 17, type: Fishjam.ServerMessage.TrackAdded, json_name: "trackAdded", oneof: 0 - ) - field(:track_removed, 18, + field :track_removed, 18, type: Fishjam.ServerMessage.TrackRemoved, json_name: "trackRemoved", oneof: 0 - ) - field(:track_metadata_updated, 19, + field :track_metadata_updated, 19, type: Fishjam.ServerMessage.TrackMetadataUpdated, json_name: "trackMetadataUpdated", oneof: 0 - ) - field(:peer_added, 20, type: Fishjam.ServerMessage.PeerAdded, json_name: "peerAdded", oneof: 0) + field :peer_added, 20, type: Fishjam.ServerMessage.PeerAdded, json_name: "peerAdded", oneof: 0 - field(:peer_deleted, 21, + field :peer_deleted, 21, type: Fishjam.ServerMessage.PeerDeleted, json_name: "peerDeleted", oneof: 0 - ) end From ff2af3345f6b5ccb1c22834f579c3a7043c5081c Mon Sep 17 00:00:00 2001 From: Karol Konkol Date: Fri, 8 Nov 2024 14:58:44 +0100 Subject: [PATCH 3/3] Requested changes --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 2 +- fishjam_protos/.formatter.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 084ad83..f4c3316 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,4 +81,4 @@ jobs: echo "Generated protobuf files are not up to date. Please regenerate them and commit the changes." git diff exit 1 - fi \ No newline at end of file + fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e861344..bf3bf1f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,4 +30,4 @@ jobs: env: HEX_API_KEY: ${{ secrets.MIX_HEX_KEY }} run: mix hex.publish --yes - working-directory: fishjam_protos \ No newline at end of file + working-directory: fishjam_protos diff --git a/fishjam_protos/.formatter.exs b/fishjam_protos/.formatter.exs index ee19977..9858ada 100644 --- a/fishjam_protos/.formatter.exs +++ b/fishjam_protos/.formatter.exs @@ -1,5 +1,5 @@ # Used by "mix format" [ inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], - locals_without_parens: [field: 1, field: 2, field: 3, field: 4, oneof: 1, oneof: 2] + import_deps: [:protobuf] ]