From 2db99fb5c5374896589da5957a715ca14b9a05e5 Mon Sep 17 00:00:00 2001 From: MuZhou233 Date: Sun, 22 Sep 2024 18:43:59 +0800 Subject: [PATCH] feat: update `FeatureSummary` --- proto/librarian/porter/v1/porter.proto | 15 +-------------- proto/librarian/sephirah/v1/sephirah.proto | 10 +--------- proto/librarian/sephirah/v1/tiphereth.proto | 4 +++- proto/librarian/v1/wellknown.proto | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/proto/librarian/porter/v1/porter.proto b/proto/librarian/porter/v1/porter.proto index bb6df57..a0a8711 100644 --- a/proto/librarian/porter/v1/porter.proto +++ b/proto/librarian/porter/v1/porter.proto @@ -56,7 +56,7 @@ message GetPorterInformationResponse { // Leave empty to use default region. string region = 3; // Supported features. - PorterFeatureSummary feature_summary = 4; + librarian.v1.FeatureSummary feature_summary = 4; // JSON schema for `FeatureRequest.context_json`. // Leave empty if not needed. // If needed, all feature requests should deliver `context_json`. @@ -64,19 +64,6 @@ message GetPorterInformationResponse { optional string context_json_schema = 5; } -message PorterFeatureSummary { - repeated librarian.v1.FeatureFlag account_platforms = 1; - repeated librarian.v1.FeatureFlag app_info_sources = 2; - // WellKnownFeedSource - repeated librarian.v1.FeatureFlag feed_sources = 3; - // WellKnownNotifyDestination - repeated librarian.v1.FeatureFlag notify_destinations = 4; - // WellKnownFeedItemAction - repeated librarian.v1.FeatureFlag feed_item_actions = 5; - repeated librarian.v1.FeatureFlag feed_setters = 6; - repeated librarian.v1.FeatureFlag feed_getters = 7; -} - message EnablePorterRequest { // Identifier of sephirah. can be randomly generated. // porter can only be enabled by one sephirah. diff --git a/proto/librarian/sephirah/v1/sephirah.proto b/proto/librarian/sephirah/v1/sephirah.proto index 9001dec..f811572 100644 --- a/proto/librarian/sephirah/v1/sephirah.proto +++ b/proto/librarian/sephirah/v1/sephirah.proto @@ -328,7 +328,7 @@ message GetServerInformationResponse { // note that there is a transmission delay between server and client. google.protobuf.Timestamp current_time = 3; // Valid when accessToken is provided. - optional ServerFeatureSummary feature_summary = 4; + optional librarian.v1.FeatureSummary feature_summary = 4; // For showing to user, customizable by server owner. ServerInstanceSummary server_instance_summary = 5; // Plain text status report for manual inspection. @@ -356,14 +356,6 @@ message ServerProtocolSummary { string version = 1; } -message ServerFeatureSummary { - repeated librarian.v1.FeatureFlag account_platforms = 1; - repeated librarian.v1.FeatureFlag app_info_sources = 2; - repeated librarian.v1.FeatureFlag feed_sources = 3; - repeated librarian.v1.FeatureFlag notify_destinations = 4; - repeated librarian.v1.FeatureFlag feed_item_actions = 5; -} - message ServerInstanceSummary { string name = 1; string description = 2; diff --git a/proto/librarian/sephirah/v1/tiphereth.proto b/proto/librarian/sephirah/v1/tiphereth.proto index 7708087..595f216 100644 --- a/proto/librarian/sephirah/v1/tiphereth.proto +++ b/proto/librarian/sephirah/v1/tiphereth.proto @@ -4,6 +4,7 @@ package librarian.sephirah.v1; import "google/protobuf/timestamp.proto"; import "librarian/v1/common.proto"; +import "librarian/v1/wellknown.proto"; option csharp_namespace = "TuiHub.Protos.Librarian.Sephirah.V1"; option go_package = "github.com/tuihub/protos/pkg/librarian/sephirah/v1;v1"; @@ -241,7 +242,7 @@ message Porter { librarian.v1.PorterBinarySummary binary_summary = 2; string global_name = 3; string region = 4; - string feature_summary = 5; + librarian.v1.FeatureSummary feature_summary = 5; UserStatus status = 6; // Only used in response PorterConnectionStatus connection_status = 7; @@ -302,4 +303,5 @@ message PorterGroup { string global_name = 2; repeated string regions = 3; optional string context_json_schema = 4; + librarian.v1.FeatureSummary feature_summary = 5; } diff --git a/proto/librarian/v1/wellknown.proto b/proto/librarian/v1/wellknown.proto index b3fe233..3601ce7 100644 --- a/proto/librarian/v1/wellknown.proto +++ b/proto/librarian/v1/wellknown.proto @@ -40,6 +40,21 @@ message FeatureRequest { optional InternalID context_id = 4; } +message FeatureSummary { + // WellKnownAccountPlatform + repeated librarian.v1.FeatureFlag account_platforms = 1; + // WellKnownAppInfoSource + repeated librarian.v1.FeatureFlag app_info_sources = 2; + // WellKnownFeedSource + repeated librarian.v1.FeatureFlag feed_sources = 3; + // WellKnownNotifyDestination + repeated librarian.v1.FeatureFlag notify_destinations = 4; + // WellKnownFeedItemAction + repeated librarian.v1.FeatureFlag feed_item_actions = 5; + repeated librarian.v1.FeatureFlag feed_setters = 6; + repeated librarian.v1.FeatureFlag feed_getters = 7; +} + enum WellKnownAccountPlatform { WELL_KNOWN_ACCOUNT_PLATFORM_UNSPECIFIED = 0 [(to_string) = ""]; WELL_KNOWN_ACCOUNT_PLATFORM_STEAM = 1 [(to_string) = "steam"];