diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65b58659..8a88711c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,15 +12,15 @@ go version go1.21.1 darwin/arm64 > if you're not interested in building/contributing to the Go code, you can skip this section -The Go code for Hiddify can be found in the `libcore` folder, as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) and in [core repository](https://github.com/hiddify/hiddify-next-core). The entrypoints for the desktop version are available in the [`libcore/custom`](https://github.com/hiddify/hiddify-next-core/tree/main/custom) folder and for the mobile version they can be found in the [`libcore/mobile`](https://github.com/hiddify/hiddify-next-core/tree/main/mobile) folder. +The Go code for Hiddify can be found in the `hiddify-core` folder, as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) and in [core repository](https://github.com/hiddify/hiddify-next-core). The entrypoints for the desktop version are available in the [`hiddify-core/custom`](https://github.com/hiddify/hiddify-next-core/tree/main/custom) folder and for the mobile version they can be found in the [`hiddify-core/mobile`](https://github.com/hiddify/hiddify-next-core/tree/main/mobile) folder. -For the desktop version, we have to compile the Go code into a C shared library. We are providing a Makefile to generate the C shared libraries for all operating systems. The following Make commands will build libcore and copy the resulting output in [`libcore/bin`](https://github.com/hiddify/hiddify-next-core/tree/main/bin): +For the desktop version, we have to compile the Go code into a C shared library. We are providing a Makefile to generate the C shared libraries for all operating systems. The following Make commands will build hiddify-core and copy the resulting output in [`hiddify-core/bin`](https://github.com/hiddify/hiddify-next-core/tree/main/bin): - `make windows-amd64` - `make linux-amd64` - `make macos-universal` -For the mobile version, we are using the [`gomobile`](https://github.com/golang/go/wiki/Mobile) tools. The following Make commands will build libcore for Android and iOS and copy the resulting output in [`libcore/bin`](https://github.com/hiddify/hiddify-next-core/tree/main/bin): +For the mobile version, we are using the [`gomobile`](https://github.com/golang/go/wiki/Mobile) tools. The following Make commands will build hiddify-core for Android and iOS and copy the resulting output in [`hiddify-core/bin`](https://github.com/hiddify/hiddify-next-core/tree/main/bin): - `make android` - `make ios` diff --git a/Makefile b/Makefile index 4247f7c4..ae3875e5 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,13 @@ GOBUILDSRV=CGO_ENABLED=1 go build -ldflags "-s -w" -trimpath -tags $(TAGS) protos: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest # protoc --go_out=./ --go-grpc_out=./ --proto_path=hiddifyrpc hiddifyrpc/*.proto - for f in $(shell find v2 -name "*.proto"); do \ - protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go_out=./ --go-grpc_out=./ $$f; \ - done - for f in $(shell find extension -name "*.proto"); do \ - protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go_out=./ --go-grpc_out=./ $$f; \ - done + # for f in $(shell find v2 -name "*.proto"); do \ + # protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go_out=./ --go-grpc_out=./ $$f; \ + # done + # for f in $(shell find extension -name "*.proto"); do \ + # protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go_out=./ --go-grpc_out=./ $$f; \ + # done + protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go_out=./ --go-grpc_out=./ $(shell find v2 -name "*.proto") $(shell find extension -name "*.proto") protoc --doc_out=./docs --doc_opt=markdown,hiddifyrpc.md $(shell find v2 -name "*.proto") $(shell find extension -name "*.proto") # protoc --js_out=import_style=commonjs,binary:./extension/html/rpc/ --grpc-web_out=import_style=commonjs,mode=grpcwebtext:./extension/html/rpc/ $(shell find v2 -name "*.proto") $(shell find extension -name "*.proto") # npx browserify extension/html/rpc/extension.js >extension/html/rpc.js @@ -37,7 +38,7 @@ lib_install: npm install headers: - go build -buildmode=c-archive -o $(BINDIR)/$(LIBNAME).h ./platform/desktop + go build -buildmode=c-archive -o $(BINDIR)/ ./platform/desktop android: lib_install gomobile bind -v -androidapi=21 -javapkg=com.hiddify.core -libname=hiddify-core -tags=$(TAGS) -trimpath -target=android -o $(BINDIR)/$(LIBNAME).aar github.com/sagernet/sing-box/experimental/libbox ./platform/mobile diff --git a/build_windows.bat b/build_windows.bat index 153248a2..b038c9fc 100644 --- a/build_windows.bat +++ b/build_windows.bat @@ -4,15 +4,15 @@ set GOARCH=amd64 set CC=x86_64-w64-mingw32-gcc set CGO_ENABLED=1 go run ./cli tunnel exit -del bin\libcore.dll bin\HiddifyCli.exe +del bin\hiddify-core.dll bin\HiddifyCli.exe set CGO_LDFLAGS= -go build -trimpath -tags with_gvisor,with_quic,with_wireguard,with_ech,with_utls,with_clash_api,with_grpc -ldflags="-w -s" -buildmode=c-shared -o bin/libcore.dll ./custom +go build -trimpath -tags with_gvisor,with_quic,with_wireguard,with_ech,with_utls,with_clash_api,with_grpc -ldflags="-w -s" -buildmode=c-shared -o bin/hiddify-core.dll ./custom go get github.com/akavel/rsrc go install github.com/akavel/rsrc rsrc -ico .\assets\hiddify-cli.ico -o cli\bydll\cli.syso -copy bin\libcore.dll . -set CGO_LDFLAGS="libcore.dll" +copy bin\hiddify-core.dll . +set CGO_LDFLAGS="hiddify-core.dll" go build -o bin/HiddifyCli.exe ./cli/bydll/ -del libcore.dll +del hiddify-core.dll diff --git a/cmd/cmd_temp.go b/cmd/cmd_temp.go index d0d0f1e9..ccba459b 100644 --- a/cmd/cmd_temp.go +++ b/cmd/cmd_temp.go @@ -1,32 +1,41 @@ package cmd import ( - "encoding/json" - "fmt" + "context" + "log" + "time" - "github.com/hiddify/hiddify-core/v2/config" + "github.com/hiddify/hiddify-core/v2/hcommon" + hcore "github.com/hiddify/hiddify-core/v2/hcore" + "google.golang.org/grpc" +) - // "github.com/hiddify/hiddify-core/extension_repository/cleanip_scanner" - "github.com/spf13/cobra" +const ( + address = "localhost:17078" + defaultName = "world" ) -var commandTemp = &cobra.Command{ - Use: "temp", - Short: "temp", - Args: cobra.MaximumNArgs(2), - Run: func(cmd *cobra.Command, args []string) { - // fmt.Printf("Ping time: %d ms\n", Ping()) - tmp := map[string][]string{ - "direct-dns-address": {"1.1.1.1"}, - "tls-tricks.enable-fragment": {"true"}, - "tls-tricks.fragment-size": {"2-4"}, +func init() { + conn, err := grpc.Dial(address, grpc.WithInsecure()) + if err != nil { + log.Fatalf("did not connect: %v", err) + } + defer conn.Close() + c := hcore.NewCoreClient(conn) + + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + + // SayHello + stream, err := c.OutboundsInfo(ctx, &hcommon.Empty{}) + + for { + r, err := stream.Recv() + if err != nil { + log.Fatalf("could not receive: %v", err) } - h := config.GetOverridableHiddifyOptions(tmp) - j, _ := json.Marshal(h) - fmt.Println(string(j)) - }, -} + log.Printf("Received1: %s", r.String()) -func init() { - mainCommand.AddCommand(commandTemp) + time.Sleep(1 * time.Second) + } } diff --git a/cmd/internal/build_libcore/main.go b/cmd/internal/build_libcore/main.go index ff5ee481..2b7baaf0 100644 --- a/cmd/internal/build_libcore/main.go +++ b/cmd/internal/build_libcore/main.go @@ -42,7 +42,7 @@ var ( iosTags []string ) -const libName = "libcore" +const libName = "hiddify-core" func init() { sharedFlags = append(sharedFlags, "-trimpath") diff --git a/docs/hiddifyrpc.md b/docs/hiddifyrpc.md index 017bfc1c..f74c2c11 100644 --- a/docs/hiddifyrpc.md +++ b/docs/hiddifyrpc.md @@ -11,8 +11,8 @@ - [GenerateWarpConfigRequest](#hcore-GenerateWarpConfigRequest) - [LogMessage](#hcore-LogMessage) - [OutboundGroup](#hcore-OutboundGroup) - - [OutboundGroupItem](#hcore-OutboundGroupItem) - [OutboundGroupList](#hcore-OutboundGroupList) + - [OutboundInfo](#hcore-OutboundInfo) - [ParseRequest](#hcore-ParseRequest) - [ParseResponse](#hcore-ParseResponse) - [SelectOutboundRequest](#hcore-SelectOutboundRequest) @@ -58,12 +58,6 @@ - [DomainStrategy](#hiddifyoptions-DomainStrategy) -- [v2/common/common.proto](#v2_common_common-proto) - - [Empty](#common-Empty) - - [Response](#common-Response) - - - [ResponseCode](#common-ResponseCode) - - [v2/profile/profile_service.proto](#v2_profile_profile_service-proto) - [AddProfileRequest](#profile-AddProfileRequest) - [MultiProfilesResponse](#profile-MultiProfilesResponse) @@ -77,6 +71,12 @@ - [ProfileOptions](#profile-ProfileOptions) - [SubscriptionInfo](#profile-SubscriptionInfo) +- [v2/hcommon/common.proto](#v2_hcommon_common-proto) + - [Empty](#hcommon-Empty) + - [Response](#hcommon-Response) + + - [ResponseCode](#hcommon-ResponseCode) + - [v2/hello/hello_service.proto](#v2_hello_hello_service-proto) - [Hello](#hello-Hello) @@ -221,40 +221,42 @@ | tag | [string](#string) | | | | type | [string](#string) | | | | selected | [string](#string) | | | -| items | [OutboundGroupItem](#hcore-OutboundGroupItem) | repeated | | +| selectable | [bool](#bool) | | | +| Is_expand | [bool](#bool) | | | +| items | [OutboundInfo](#hcore-OutboundInfo) | repeated | | - + -### OutboundGroupItem +### OutboundGroupList | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| tag | [string](#string) | | | -| type | [string](#string) | | | -| url_test_time | [int64](#int64) | | | -| url_test_delay | [int32](#int32) | | | +| items | [OutboundGroup](#hcore-OutboundGroup) | repeated | | - + -### OutboundGroupList +### OutboundInfo | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| items | [OutboundGroup](#hcore-OutboundGroup) | repeated | | +| tag | [string](#string) | | | +| type | [string](#string) | | | +| url_test_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| url_test_delay | [int32](#int32) | | | @@ -287,7 +289,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| response_code | [common.ResponseCode](#common-ResponseCode) | | | +| response_code | [hcommon.ResponseCode](#hcommon-ResponseCode) | | | | content | [string](#string) | | | | message | [string](#string) | | | @@ -577,22 +579,22 @@ | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| | Start | [StartRequest](#hcore-StartRequest) | [CoreInfoResponse](#hcore-CoreInfoResponse) | | -| CoreInfoListener | [.common.Empty](#common-Empty) | [CoreInfoResponse](#hcore-CoreInfoResponse) stream | | -| OutboundsInfo | [.common.Empty](#common-Empty) | [OutboundGroupList](#hcore-OutboundGroupList) stream | | -| MainOutboundsInfo | [.common.Empty](#common-Empty) | [OutboundGroupList](#hcore-OutboundGroupList) stream | | -| GetSystemInfo | [.common.Empty](#common-Empty) | [SystemInfo](#hcore-SystemInfo) stream | | -| Setup | [SetupRequest](#hcore-SetupRequest) | [.common.Response](#common-Response) | | +| CoreInfoListener | [.hcommon.Empty](#hcommon-Empty) | [CoreInfoResponse](#hcore-CoreInfoResponse) stream | | +| OutboundsInfo | [.hcommon.Empty](#hcommon-Empty) | [OutboundGroupList](#hcore-OutboundGroupList) stream | | +| MainOutboundsInfo | [.hcommon.Empty](#hcommon-Empty) | [OutboundGroupList](#hcore-OutboundGroupList) stream | | +| GetSystemInfo | [.hcommon.Empty](#hcommon-Empty) | [SystemInfo](#hcore-SystemInfo) stream | | +| Setup | [SetupRequest](#hcore-SetupRequest) | [.hcommon.Response](#hcommon-Response) | | | Parse | [ParseRequest](#hcore-ParseRequest) | [ParseResponse](#hcore-ParseResponse) | | | ChangeHiddifySettings | [ChangeHiddifySettingsRequest](#hcore-ChangeHiddifySettingsRequest) | [CoreInfoResponse](#hcore-CoreInfoResponse) | | | StartService | [StartRequest](#hcore-StartRequest) | [CoreInfoResponse](#hcore-CoreInfoResponse) | rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse); | -| Stop | [.common.Empty](#common-Empty) | [CoreInfoResponse](#hcore-CoreInfoResponse) | | +| Stop | [.hcommon.Empty](#hcommon-Empty) | [CoreInfoResponse](#hcore-CoreInfoResponse) | | | Restart | [StartRequest](#hcore-StartRequest) | [CoreInfoResponse](#hcore-CoreInfoResponse) | | -| SelectOutbound | [SelectOutboundRequest](#hcore-SelectOutboundRequest) | [.common.Response](#common-Response) | | -| UrlTest | [UrlTestRequest](#hcore-UrlTestRequest) | [.common.Response](#common-Response) | | +| SelectOutbound | [SelectOutboundRequest](#hcore-SelectOutboundRequest) | [.hcommon.Response](#hcommon-Response) | | +| UrlTest | [UrlTestRequest](#hcore-UrlTestRequest) | [.hcommon.Response](#hcommon-Response) | | | GenerateWarpConfig | [GenerateWarpConfigRequest](#hcore-GenerateWarpConfigRequest) | [WarpGenerationResponse](#hcore-WarpGenerationResponse) | | -| GetSystemProxyStatus | [.common.Empty](#common-Empty) | [SystemProxyStatus](#hcore-SystemProxyStatus) | | -| SetSystemProxyEnabled | [SetSystemProxyEnabledRequest](#hcore-SetSystemProxyEnabledRequest) | [.common.Response](#common-Response) | | -| LogListener | [.common.Empty](#common-Empty) | [LogMessage](#hcore-LogMessage) stream | | +| GetSystemProxyStatus | [.hcommon.Empty](#hcommon-Empty) | [SystemProxyStatus](#hcore-SystemProxyStatus) | | +| SetSystemProxyEnabled | [SetSystemProxyEnabledRequest](#hcore-SetSystemProxyEnabledRequest) | [.hcommon.Response](#hcommon-Response) | | +| LogListener | [.hcommon.Empty](#hcommon-Empty) | [LogMessage](#hcore-LogMessage) stream | | @@ -671,9 +673,9 @@ | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| | Start | [TunnelStartRequest](#tunnelservice-TunnelStartRequest) | [TunnelResponse](#tunnelservice-TunnelResponse) | | -| Stop | [.common.Empty](#common-Empty) | [TunnelResponse](#tunnelservice-TunnelResponse) | | -| Status | [.common.Empty](#common-Empty) | [TunnelResponse](#tunnelservice-TunnelResponse) | | -| Exit | [.common.Empty](#common-Empty) | [TunnelResponse](#tunnelservice-TunnelResponse) | | +| Stop | [.hcommon.Empty](#hcommon-Empty) | [TunnelResponse](#tunnelservice-TunnelResponse) | | +| Status | [.hcommon.Empty](#hcommon-Empty) | [TunnelResponse](#tunnelservice-TunnelResponse) | | +| Exit | [.hcommon.Empty](#hcommon-Empty) | [TunnelResponse](#tunnelservice-TunnelResponse) | | @@ -956,61 +958,6 @@ DomainStrategy defines the strategies for IP address preference when resolving d - -

Top

- -## v2/common/common.proto - - - - - -### Empty - - - - - - - - - -### Response - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| code | [ResponseCode](#common-ResponseCode) | | | -| message | [string](#string) | | | - - - - - - - - - - -### ResponseCode - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| OK | 0 | | -| FAILED | 1 | | -| AUTH_NEED | 2 | | - - - - - - - - - -

Top

@@ -1046,7 +993,7 @@ MultiProfilesResponse is the response message for fetching multi profiles. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | profiles | [ProfileEntity](#profile-ProfileEntity) | repeated | A list of profile entities. | -| response_code | [common.ResponseCode](#common-ResponseCode) | | The response code indicating success or failure. | +| response_code | [hcommon.ResponseCode](#hcommon-ResponseCode) | | The response code indicating success or failure. | | message | [string](#string) | | A message indicating the result or error, if any. | @@ -1081,7 +1028,7 @@ ProfileResponse is the response message for profile service operations. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | profile | [ProfileEntity](#profile-ProfileEntity) | | The profile entity, populated in successful operations. | -| response_code | [common.ResponseCode](#common-ResponseCode) | | The response code indicating success or failure. | +| response_code | [hcommon.ResponseCode](#hcommon-ResponseCode) | | The response code indicating success or failure. | | message | [string](#string) | | A message indicating the result or error, if any. | @@ -1104,11 +1051,11 @@ ProfileService defines the RPC methods available for managing profiles. | ----------- | ------------ | ------------- | ------------| | GetProfile | [ProfileRequest](#profile-ProfileRequest) | [ProfileResponse](#profile-ProfileResponse) | GetProfile fetches a profile by ID, name, or URL. | | UpdateProfile | [ProfileEntity](#profile-ProfileEntity) | [ProfileResponse](#profile-ProfileResponse) | UpdateProfile updates an existing profile. | -| GetAllProfiles | [.common.Empty](#common-Empty) | [MultiProfilesResponse](#profile-MultiProfilesResponse) | GetAllProfiles fetches all profiles. | -| GetActiveProfile | [.common.Empty](#common-Empty) | [ProfileResponse](#profile-ProfileResponse) | GetActiveProfile retrieves the currently active profile. | -| SetActiveProfile | [ProfileRequest](#profile-ProfileRequest) | [.common.Response](#common-Response) | SetActiveProfile sets a profile as active, identified by ID, name, or URL. | +| GetAllProfiles | [.hcommon.Empty](#hcommon-Empty) | [MultiProfilesResponse](#profile-MultiProfilesResponse) | GetAllProfiles fetches all profiles. | +| GetActiveProfile | [.hcommon.Empty](#hcommon-Empty) | [ProfileResponse](#profile-ProfileResponse) | GetActiveProfile retrieves the currently active profile. | +| SetActiveProfile | [ProfileRequest](#profile-ProfileRequest) | [.hcommon.Response](#hcommon-Response) | SetActiveProfile sets a profile as active, identified by ID, name, or URL. | | AddProfile | [AddProfileRequest](#profile-AddProfileRequest) | [ProfileResponse](#profile-ProfileResponse) | AddProfile adds a new profile using either a URL or the raw profile content. | -| DeleteProfile | [ProfileRequest](#profile-ProfileRequest) | [.common.Response](#common-Response) | DeleteProfile deletes a profile identified by ID, name, or URL. | +| DeleteProfile | [ProfileRequest](#profile-ProfileRequest) | [.hcommon.Response](#hcommon-Response) | DeleteProfile deletes a profile identified by ID, name, or URL. | @@ -1188,6 +1135,61 @@ SubscriptionInfo defines subscription-related information. + +

Top

+ +## v2/hcommon/common.proto + + + + + +### Empty + + + + + + + + + +### Response + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| code | [ResponseCode](#hcommon-ResponseCode) | | | +| message | [string](#string) | | | + + + + + + + + + + +### ResponseCode + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| OK | 0 | | +| FAILED | 1 | | +| AUTH_NEED | 2 | | + + + + + + + + + +

Top

@@ -1281,7 +1283,7 @@ SubscriptionInfo defines subscription-related information. | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -| ListExtensions | [.common.Empty](#common-Empty) | [ExtensionList](#extension-ExtensionList) | | +| ListExtensions | [.hcommon.Empty](#hcommon-Empty) | [ExtensionList](#extension-ExtensionList) | | | Connect | [ExtensionRequest](#extension-ExtensionRequest) | [ExtensionResponse](#extension-ExtensionResponse) stream | | | EditExtension | [EditExtensionRequest](#extension-EditExtensionRequest) | [ExtensionActionResult](#extension-ExtensionActionResult) | | | SubmitForm | [SendExtensionDataRequest](#extension-SendExtensionDataRequest) | [ExtensionActionResult](#extension-ExtensionActionResult) | | @@ -1324,7 +1326,7 @@ SubscriptionInfo defines subscription-related information. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | extension_id | [string](#string) | | | -| code | [common.ResponseCode](#common-ResponseCode) | | | +| code | [hcommon.ResponseCode](#hcommon-ResponseCode) | | | | message | [string](#string) | | | diff --git a/extension/extension.pb.go b/extension/extension.pb.go index 72622a88..5650e778 100644 --- a/extension/extension.pb.go +++ b/extension/extension.pb.go @@ -7,7 +7,7 @@ package extension import ( - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -78,9 +78,9 @@ type ExtensionActionResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"` - Code common.ResponseCode `protobuf:"varint,2,opt,name=code,proto3,enum=common.ResponseCode" json:"code,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"` + Code hcommon.ResponseCode `protobuf:"varint,2,opt,name=code,proto3,enum=hcommon.ResponseCode" json:"code,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` } func (x *ExtensionActionResult) Reset() { @@ -122,11 +122,11 @@ func (x *ExtensionActionResult) GetExtensionId() string { return "" } -func (x *ExtensionActionResult) GetCode() common.ResponseCode { +func (x *ExtensionActionResult) GetCode() hcommon.ResponseCode { if x != nil { return x.Code } - return common.ResponseCode(0) + return hcommon.ResponseCode(0) } func (x *ExtensionActionResult) GetMessage() string { @@ -495,74 +495,74 @@ var File_extension_extension_proto protoreflect.FileDescriptor var file_extension_extension_proto_rawDesc = []byte{ 0x0a, 0x19, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x16, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, - 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x48, - 0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x37, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x0a, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x51, 0x0a, 0x14, 0x45, 0x64, 0x69, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x17, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x7f, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x68, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x48, 0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x0a, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x51, 0x0a, 0x14, 0x45, 0x64, + 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x6e, 0x0a, + 0x0c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xa9, 0x01, + 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x6e, 0x0a, 0x0c, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x10, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, - 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, - 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd1, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x6e, 0x64, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd1, 0x01, 0x0a, 0x18, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x74, + 0x74, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x74, 0x74, 0x6f, + 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x74, 0x74, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x85, 0x01, 0x0a, 0x11, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x73, - 0x6f, 0x6e, 0x5f, 0x75, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x73, 0x6f, - 0x6e, 0x55, 0x69, 0x2a, 0x4d, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x4e, 0x4f, 0x54, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x50, 0x44, - 0x41, 0x54, 0x45, 0x5f, 0x55, 0x49, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x48, 0x4f, 0x57, - 0x5f, 0x44, 0x49, 0x41, 0x4c, 0x4f, 0x47, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x4e, 0x44, - 0x10, 0x03, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x85, 0x01, + 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x75, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, + 0x73, 0x6f, 0x6e, 0x55, 0x69, 0x2a, 0x4d, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, + 0x0a, 0x07, 0x4e, 0x4f, 0x54, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x55, + 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x49, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x48, + 0x4f, 0x57, 0x5f, 0x44, 0x49, 0x41, 0x4c, 0x4f, 0x47, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x45, + 0x4e, 0x44, 0x10, 0x03, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, + 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -590,10 +590,10 @@ var file_extension_extension_proto_goTypes = []any{ (*ExtensionResponse)(nil), // 7: extension.ExtensionResponse nil, // 8: extension.ExtensionRequest.DataEntry nil, // 9: extension.SendExtensionDataRequest.DataEntry - (common.ResponseCode)(0), // 10: common.ResponseCode + (hcommon.ResponseCode)(0), // 10: hcommon.ResponseCode } var file_extension_extension_proto_depIdxs = []int32{ - 10, // 0: extension.ExtensionActionResult.code:type_name -> common.ResponseCode + 10, // 0: extension.ExtensionActionResult.code:type_name -> hcommon.ResponseCode 4, // 1: extension.ExtensionList.extensions:type_name -> extension.ExtensionMsg 8, // 2: extension.ExtensionRequest.data:type_name -> extension.ExtensionRequest.DataEntry 9, // 3: extension.SendExtensionDataRequest.data:type_name -> extension.SendExtensionDataRequest.DataEntry diff --git a/extension/extension.proto b/extension/extension.proto index 59911b07..ee145b3a 100644 --- a/extension/extension.proto +++ b/extension/extension.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -import "v2/common/common.proto"; +import "v2/hcommon/common.proto"; package extension; @@ -8,7 +8,7 @@ option go_package = "github.com/hiddify/hiddify-core/extension"; message ExtensionActionResult { string extension_id = 1; - common.ResponseCode code = 2; + hcommon.ResponseCode code = 2; string message = 3; } diff --git a/extension/extension_host.go b/extension/extension_host.go index d847c75c..91c60716 100644 --- a/extension/extension_host.go +++ b/extension/extension_host.go @@ -5,8 +5,8 @@ import ( "fmt" "log" - common "github.com/hiddify/hiddify-core/v2/common" "github.com/hiddify/hiddify-core/v2/db" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "google.golang.org/grpc" ) @@ -14,7 +14,7 @@ type ExtensionHostService struct { UnimplementedExtensionHostServiceServer } -func (ExtensionHostService) ListExtensions(ctx context.Context, empty *common.Empty) (*ExtensionList, error) { +func (ExtensionHostService) ListExtensions(ctx context.Context, empty *hcommon.Empty) (*ExtensionList, error) { extensionList := &ExtensionList{ Extensions: make([]*ExtensionMsg, 0), } @@ -79,7 +79,7 @@ func (e ExtensionHostService) SubmitForm(ctx context.Context, req *SendExtension log.Println(err) return &ExtensionActionResult{ ExtensionId: req.ExtensionId, - Code: common.ResponseCode_FAILED, + Code: hcommon.ResponseCode_FAILED, Message: err.Error(), }, err } @@ -87,7 +87,7 @@ func (e ExtensionHostService) SubmitForm(ctx context.Context, req *SendExtension return &ExtensionActionResult{ ExtensionId: req.ExtensionId, - Code: common.ResponseCode_OK, + Code: hcommon.ResponseCode_OK, Message: "Success", }, nil } @@ -98,7 +98,7 @@ func (e ExtensionHostService) Close(ctx context.Context, req *ExtensionRequest) log.Println(err) return &ExtensionActionResult{ ExtensionId: req.ExtensionId, - Code: common.ResponseCode_FAILED, + Code: hcommon.ResponseCode_FAILED, Message: err.Error(), }, err } @@ -106,7 +106,7 @@ func (e ExtensionHostService) Close(ctx context.Context, req *ExtensionRequest) (*extension).(*Base[any]).doStoreData() return &ExtensionActionResult{ ExtensionId: req.ExtensionId, - Code: common.ResponseCode_OK, + Code: hcommon.ResponseCode_OK, Message: "Success", }, nil } @@ -134,7 +134,7 @@ func (e ExtensionHostService) EditExtension(ctx context.Context, req *EditExtens return &ExtensionActionResult{ ExtensionId: req.ExtensionId, - Code: common.ResponseCode_OK, + Code: hcommon.ResponseCode_OK, Message: "Success", }, nil } diff --git a/extension/extension_service.pb.go b/extension/extension_service.pb.go index b486d824..ee818968 100644 --- a/extension/extension_service.pb.go +++ b/extension/extension_service.pb.go @@ -7,7 +7,7 @@ package extension import ( - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -27,46 +27,46 @@ var file_extension_extension_service_proto_rawDesc = []byte{ 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x76, 0x32, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x32, 0xde, 0x03, 0x0a, 0x14, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, - 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0d, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, - 0x01, 0x12, 0x54, 0x0a, 0x0d, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, - 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x23, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x48, - 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x55, - 0x49, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x32, 0x2f, 0x68, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x32, 0xdf, 0x03, 0x0a, 0x14, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x0e, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x2e, + 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x07, 0x43, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x0d, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x23, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, + 0x12, 0x48, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x05, 0x47, 0x65, + 0x74, 0x55, 0x49, 0x12, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, + 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_extension_extension_service_proto_goTypes = []any{ - (*common.Empty)(nil), // 0: common.Empty + (*hcommon.Empty)(nil), // 0: hcommon.Empty (*ExtensionRequest)(nil), // 1: extension.ExtensionRequest (*EditExtensionRequest)(nil), // 2: extension.EditExtensionRequest (*SendExtensionDataRequest)(nil), // 3: extension.SendExtensionDataRequest @@ -75,7 +75,7 @@ var file_extension_extension_service_proto_goTypes = []any{ (*ExtensionActionResult)(nil), // 6: extension.ExtensionActionResult } var file_extension_extension_service_proto_depIdxs = []int32{ - 0, // 0: extension.ExtensionHostService.ListExtensions:input_type -> common.Empty + 0, // 0: extension.ExtensionHostService.ListExtensions:input_type -> hcommon.Empty 1, // 1: extension.ExtensionHostService.Connect:input_type -> extension.ExtensionRequest 2, // 2: extension.ExtensionHostService.EditExtension:input_type -> extension.EditExtensionRequest 3, // 3: extension.ExtensionHostService.SubmitForm:input_type -> extension.SendExtensionDataRequest diff --git a/extension/extension_service.proto b/extension/extension_service.proto index 0f3f5bca..1e283cf9 100644 --- a/extension/extension_service.proto +++ b/extension/extension_service.proto @@ -3,13 +3,13 @@ syntax = "proto3"; import "extension/extension.proto"; -import "v2/common/common.proto"; +import "v2/hcommon/common.proto"; package extension; option go_package = "github.com/hiddify/hiddify-core/extension"; service ExtensionHostService { - rpc ListExtensions (common.Empty) returns (ExtensionList) {} + rpc ListExtensions (hcommon.Empty) returns (ExtensionList) {} rpc Connect (ExtensionRequest) returns (stream ExtensionResponse) {} rpc EditExtension (EditExtensionRequest) returns (ExtensionActionResult) {} rpc SubmitForm (SendExtensionDataRequest) returns (ExtensionActionResult) {} diff --git a/extension/extension_service_grpc.pb.go b/extension/extension_service_grpc.pb.go index 0f3d8ba8..8012ffca 100644 --- a/extension/extension_service_grpc.pb.go +++ b/extension/extension_service_grpc.pb.go @@ -8,7 +8,7 @@ package extension import ( context "context" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -32,7 +32,7 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ExtensionHostServiceClient interface { - ListExtensions(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*ExtensionList, error) + ListExtensions(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*ExtensionList, error) Connect(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExtensionResponse], error) EditExtension(ctx context.Context, in *EditExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) SubmitForm(ctx context.Context, in *SendExtensionDataRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) @@ -48,7 +48,7 @@ func NewExtensionHostServiceClient(cc grpc.ClientConnInterface) ExtensionHostSer return &extensionHostServiceClient{cc} } -func (c *extensionHostServiceClient) ListExtensions(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*ExtensionList, error) { +func (c *extensionHostServiceClient) ListExtensions(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*ExtensionList, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ExtensionList) err := c.cc.Invoke(ctx, ExtensionHostService_ListExtensions_FullMethodName, in, out, cOpts...) @@ -121,7 +121,7 @@ func (c *extensionHostServiceClient) GetUI(ctx context.Context, in *ExtensionReq // All implementations must embed UnimplementedExtensionHostServiceServer // for forward compatibility. type ExtensionHostServiceServer interface { - ListExtensions(context.Context, *common.Empty) (*ExtensionList, error) + ListExtensions(context.Context, *hcommon.Empty) (*ExtensionList, error) Connect(*ExtensionRequest, grpc.ServerStreamingServer[ExtensionResponse]) error EditExtension(context.Context, *EditExtensionRequest) (*ExtensionActionResult, error) SubmitForm(context.Context, *SendExtensionDataRequest) (*ExtensionActionResult, error) @@ -137,7 +137,7 @@ type ExtensionHostServiceServer interface { // pointer dereference when methods are called. type UnimplementedExtensionHostServiceServer struct{} -func (UnimplementedExtensionHostServiceServer) ListExtensions(context.Context, *common.Empty) (*ExtensionList, error) { +func (UnimplementedExtensionHostServiceServer) ListExtensions(context.Context, *hcommon.Empty) (*ExtensionList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListExtensions not implemented") } func (UnimplementedExtensionHostServiceServer) Connect(*ExtensionRequest, grpc.ServerStreamingServer[ExtensionResponse]) error { @@ -177,7 +177,7 @@ func RegisterExtensionHostServiceServer(s grpc.ServiceRegistrar, srv ExtensionHo } func _ExtensionHostService_ListExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -189,7 +189,7 @@ func _ExtensionHostService_ListExtensions_Handler(srv interface{}, ctx context.C FullMethod: ExtensionHostService_ListExtensions_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExtensionHostServiceServer).ListExtensions(ctx, req.(*common.Empty)) + return srv.(ExtensionHostServiceServer).ListExtensions(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } diff --git a/extension/html/rpc/extension_grpc_web_pb.js b/extension/html/rpc/extension_grpc_web_pb.js deleted file mode 100644 index 16d808c6..00000000 --- a/extension/html/rpc/extension_grpc_web_pb.js +++ /dev/null @@ -1,441 +0,0 @@ -/** - * @fileoverview gRPC-Web generated client stub for hiddifyrpc - * @enhanceable - * @public - */ - -// Code generated by protoc-gen-grpc-web. DO NOT EDIT. -// versions: -// protoc-gen-grpc-web v1.5.0 -// protoc v5.28.0 -// source: extension.proto - - -/* eslint-disable */ -// @ts-nocheck - - - -const grpc = {}; -grpc.web = require('grpc-web'); - - -var base_pb = require('./base_pb.js') -const proto = {}; -proto.hiddifyrpc = require('./extension_pb.js'); - -/** - * @param {string} hostname - * @param {?Object} credentials - * @param {?grpc.web.ClientOptions} options - * @constructor - * @struct - * @final - */ -proto.hiddifyrpc.ExtensionHostServiceClient = - function(hostname, credentials, options) { - if (!options) options = {}; - options.format = 'text'; - - /** - * @private @const {!grpc.web.GrpcWebClientBase} The client - */ - this.client_ = new grpc.web.GrpcWebClientBase(options); - - /** - * @private @const {string} The hostname - */ - this.hostname_ = hostname.replace(/\/+$/, ''); - -}; - - -/** - * @param {string} hostname - * @param {?Object} credentials - * @param {?grpc.web.ClientOptions} options - * @constructor - * @struct - * @final - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient = - function(hostname, credentials, options) { - if (!options) options = {}; - options.format = 'text'; - - /** - * @private @const {!grpc.web.GrpcWebClientBase} The client - */ - this.client_ = new grpc.web.GrpcWebClientBase(options); - - /** - * @private @const {string} The hostname - */ - this.hostname_ = hostname.replace(/\/+$/, ''); - -}; - - -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.Empty, - * !proto.hiddifyrpc.ExtensionList>} - */ -const methodDescriptor_ExtensionHostService_ListExtensions = new grpc.web.MethodDescriptor( - '/hiddifyrpc.ExtensionHostService/ListExtensions', - grpc.web.MethodType.UNARY, - base_pb.Empty, - proto.hiddifyrpc.ExtensionList, - /** - * @param {!proto.hiddifyrpc.Empty} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.hiddifyrpc.ExtensionList.deserializeBinary -); - - -/** - * @param {!proto.hiddifyrpc.Empty} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.hiddifyrpc.ExtensionList)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServiceClient.prototype.listExtensions = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/ListExtensions', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_ListExtensions, - callback); -}; - - -/** - * @param {!proto.hiddifyrpc.Empty} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.listExtensions = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/ListExtensions', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_ListExtensions); -}; - - -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.ExtensionRequest, - * !proto.hiddifyrpc.ExtensionResponse>} - */ -const methodDescriptor_ExtensionHostService_Connect = new grpc.web.MethodDescriptor( - '/hiddifyrpc.ExtensionHostService/Connect', - grpc.web.MethodType.SERVER_STREAMING, - proto.hiddifyrpc.ExtensionRequest, - proto.hiddifyrpc.ExtensionResponse, - /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.hiddifyrpc.ExtensionResponse.deserializeBinary -); - - -/** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!grpc.web.ClientReadableStream} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServiceClient.prototype.connect = - function(request, metadata) { - return this.client_.serverStreaming(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/Connect', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_Connect); -}; - - -/** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!grpc.web.ClientReadableStream} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.connect = - function(request, metadata) { - return this.client_.serverStreaming(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/Connect', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_Connect); -}; - - -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.EditExtensionRequest, - * !proto.hiddifyrpc.ExtensionActionResult>} - */ -const methodDescriptor_ExtensionHostService_EditExtension = new grpc.web.MethodDescriptor( - '/hiddifyrpc.ExtensionHostService/EditExtension', - grpc.web.MethodType.UNARY, - proto.hiddifyrpc.EditExtensionRequest, - proto.hiddifyrpc.ExtensionActionResult, - /** - * @param {!proto.hiddifyrpc.EditExtensionRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.hiddifyrpc.ExtensionActionResult.deserializeBinary -); - - -/** - * @param {!proto.hiddifyrpc.EditExtensionRequest} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.hiddifyrpc.ExtensionActionResult)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServiceClient.prototype.editExtension = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/EditExtension', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_EditExtension, - callback); -}; - - -/** - * @param {!proto.hiddifyrpc.EditExtensionRequest} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.editExtension = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/EditExtension', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_EditExtension); -}; - - -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.SendExtensionDataRequest, - * !proto.hiddifyrpc.ExtensionActionResult>} - */ -const methodDescriptor_ExtensionHostService_SubmitForm = new grpc.web.MethodDescriptor( - '/hiddifyrpc.ExtensionHostService/SubmitForm', - grpc.web.MethodType.UNARY, - proto.hiddifyrpc.SendExtensionDataRequest, - proto.hiddifyrpc.ExtensionActionResult, - /** - * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.hiddifyrpc.ExtensionActionResult.deserializeBinary -); - - -/** - * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.hiddifyrpc.ExtensionActionResult)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServiceClient.prototype.submitForm = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/SubmitForm', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_SubmitForm, - callback); -}; - - -/** - * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.submitForm = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/SubmitForm', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_SubmitForm); -}; - - -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.ExtensionRequest, - * !proto.hiddifyrpc.ExtensionActionResult>} - */ -const methodDescriptor_ExtensionHostService_Close = new grpc.web.MethodDescriptor( - '/hiddifyrpc.ExtensionHostService/Close', - grpc.web.MethodType.UNARY, - proto.hiddifyrpc.ExtensionRequest, - proto.hiddifyrpc.ExtensionActionResult, - /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.hiddifyrpc.ExtensionActionResult.deserializeBinary -); - - -/** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.hiddifyrpc.ExtensionActionResult)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServiceClient.prototype.close = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/Close', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_Close, - callback); -}; - - -/** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.close = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/Close', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_Close); -}; - - -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.ExtensionRequest, - * !proto.hiddifyrpc.ExtensionActionResult>} - */ -const methodDescriptor_ExtensionHostService_GetUI = new grpc.web.MethodDescriptor( - '/hiddifyrpc.ExtensionHostService/GetUI', - grpc.web.MethodType.UNARY, - proto.hiddifyrpc.ExtensionRequest, - proto.hiddifyrpc.ExtensionActionResult, - /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.hiddifyrpc.ExtensionActionResult.deserializeBinary -); - - -/** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.hiddifyrpc.ExtensionActionResult)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.hiddifyrpc.ExtensionHostServiceClient.prototype.getUI = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/GetUI', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_GetUI, - callback); -}; - - -/** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.getUI = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/hiddifyrpc.ExtensionHostService/GetUI', - request, - metadata || {}, - methodDescriptor_ExtensionHostService_GetUI); -}; - - -module.exports = proto.hiddifyrpc; - diff --git a/extension/html/rpc/extension_pb.js b/extension/html/rpc/extension_pb.js deleted file mode 100644 index a0ea9f78..00000000 --- a/extension/html/rpc/extension_pb.js +++ /dev/null @@ -1,1469 +0,0 @@ -// source: extension.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = - (typeof globalThis !== 'undefined' && globalThis) || - (typeof window !== 'undefined' && window) || - (typeof global !== 'undefined' && global) || - (typeof self !== 'undefined' && self) || - (function () { return this; }).call(null) || - Function('return this')(); - -var base_pb = require('./base_pb.js'); -goog.object.extend(proto, base_pb); -goog.exportSymbol('proto.hiddifyrpc.EditExtensionRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.Extension', null, global); -goog.exportSymbol('proto.hiddifyrpc.ExtensionActionResult', null, global); -goog.exportSymbol('proto.hiddifyrpc.ExtensionList', null, global); -goog.exportSymbol('proto.hiddifyrpc.ExtensionRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.ExtensionResponse', null, global); -goog.exportSymbol('proto.hiddifyrpc.ExtensionResponseType', null, global); -goog.exportSymbol('proto.hiddifyrpc.SendExtensionDataRequest', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ExtensionActionResult = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.ExtensionActionResult, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ExtensionActionResult.displayName = 'proto.hiddifyrpc.ExtensionActionResult'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ExtensionList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hiddifyrpc.ExtensionList.repeatedFields_, null); -}; -goog.inherits(proto.hiddifyrpc.ExtensionList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ExtensionList.displayName = 'proto.hiddifyrpc.ExtensionList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.EditExtensionRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.EditExtensionRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.EditExtensionRequest.displayName = 'proto.hiddifyrpc.EditExtensionRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.Extension = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.Extension, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.Extension.displayName = 'proto.hiddifyrpc.Extension'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ExtensionRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.ExtensionRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ExtensionRequest.displayName = 'proto.hiddifyrpc.ExtensionRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.SendExtensionDataRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.SendExtensionDataRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.SendExtensionDataRequest.displayName = 'proto.hiddifyrpc.SendExtensionDataRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ExtensionResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.ExtensionResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ExtensionResponse.displayName = 'proto.hiddifyrpc.ExtensionResponse'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ExtensionActionResult.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ExtensionActionResult} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionActionResult.toObject = function(includeInstance, msg) { - var f, obj = { -extensionId: jspb.Message.getFieldWithDefault(msg, 1, ""), -code: jspb.Message.getFieldWithDefault(msg, 2, 0), -message: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ExtensionActionResult} - */ -proto.hiddifyrpc.ExtensionActionResult.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ExtensionActionResult; - return proto.hiddifyrpc.ExtensionActionResult.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ExtensionActionResult} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ExtensionActionResult} - */ -proto.hiddifyrpc.ExtensionActionResult.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setExtensionId(value); - break; - case 2: - var value = /** @type {!proto.hiddifyrpc.ResponseCode} */ (reader.readEnum()); - msg.setCode(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ExtensionActionResult.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ExtensionActionResult} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionActionResult.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExtensionId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getCode(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string extension_id = 1; - * @return {string} - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.getExtensionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ExtensionActionResult} returns this - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.setExtensionId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional ResponseCode code = 2; - * @return {!proto.hiddifyrpc.ResponseCode} - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.getCode = function() { - return /** @type {!proto.hiddifyrpc.ResponseCode} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.ResponseCode} value - * @return {!proto.hiddifyrpc.ExtensionActionResult} returns this - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.setCode = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional string message = 3; - * @return {string} - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ExtensionActionResult} returns this - */ -proto.hiddifyrpc.ExtensionActionResult.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hiddifyrpc.ExtensionList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ExtensionList.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ExtensionList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ExtensionList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionList.toObject = function(includeInstance, msg) { - var f, obj = { -extensionsList: jspb.Message.toObjectList(msg.getExtensionsList(), - proto.hiddifyrpc.Extension.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ExtensionList} - */ -proto.hiddifyrpc.ExtensionList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ExtensionList; - return proto.hiddifyrpc.ExtensionList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ExtensionList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ExtensionList} - */ -proto.hiddifyrpc.ExtensionList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.hiddifyrpc.Extension; - reader.readMessage(value,proto.hiddifyrpc.Extension.deserializeBinaryFromReader); - msg.addExtensions(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ExtensionList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ExtensionList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ExtensionList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExtensionsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.hiddifyrpc.Extension.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Extension extensions = 1; - * @return {!Array} - */ -proto.hiddifyrpc.ExtensionList.prototype.getExtensionsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hiddifyrpc.Extension, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.hiddifyrpc.ExtensionList} returns this -*/ -proto.hiddifyrpc.ExtensionList.prototype.setExtensionsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.hiddifyrpc.Extension=} opt_value - * @param {number=} opt_index - * @return {!proto.hiddifyrpc.Extension} - */ -proto.hiddifyrpc.ExtensionList.prototype.addExtensions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hiddifyrpc.Extension, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.hiddifyrpc.ExtensionList} returns this - */ -proto.hiddifyrpc.ExtensionList.prototype.clearExtensionsList = function() { - return this.setExtensionsList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.EditExtensionRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.EditExtensionRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.EditExtensionRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.EditExtensionRequest.toObject = function(includeInstance, msg) { - var f, obj = { -extensionId: jspb.Message.getFieldWithDefault(msg, 1, ""), -enable: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.EditExtensionRequest} - */ -proto.hiddifyrpc.EditExtensionRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.EditExtensionRequest; - return proto.hiddifyrpc.EditExtensionRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.EditExtensionRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.EditExtensionRequest} - */ -proto.hiddifyrpc.EditExtensionRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setExtensionId(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEnable(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.EditExtensionRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.EditExtensionRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.EditExtensionRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.EditExtensionRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExtensionId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getEnable(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * optional string extension_id = 1; - * @return {string} - */ -proto.hiddifyrpc.EditExtensionRequest.prototype.getExtensionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.EditExtensionRequest} returns this - */ -proto.hiddifyrpc.EditExtensionRequest.prototype.setExtensionId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional bool enable = 2; - * @return {boolean} - */ -proto.hiddifyrpc.EditExtensionRequest.prototype.getEnable = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.EditExtensionRequest} returns this - */ -proto.hiddifyrpc.EditExtensionRequest.prototype.setEnable = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.Extension.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.Extension.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.Extension} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.Extension.toObject = function(includeInstance, msg) { - var f, obj = { -id: jspb.Message.getFieldWithDefault(msg, 1, ""), -title: jspb.Message.getFieldWithDefault(msg, 2, ""), -description: jspb.Message.getFieldWithDefault(msg, 3, ""), -enable: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.Extension} - */ -proto.hiddifyrpc.Extension.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.Extension; - return proto.hiddifyrpc.Extension.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.Extension} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.Extension} - */ -proto.hiddifyrpc.Extension.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setTitle(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEnable(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.Extension.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.Extension.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.Extension} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.Extension.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getTitle(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getEnable(); - if (f) { - writer.writeBool( - 4, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.hiddifyrpc.Extension.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.Extension} returns this - */ -proto.hiddifyrpc.Extension.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string title = 2; - * @return {string} - */ -proto.hiddifyrpc.Extension.prototype.getTitle = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.Extension} returns this - */ -proto.hiddifyrpc.Extension.prototype.setTitle = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string description = 3; - * @return {string} - */ -proto.hiddifyrpc.Extension.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.Extension} returns this - */ -proto.hiddifyrpc.Extension.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional bool enable = 4; - * @return {boolean} - */ -proto.hiddifyrpc.Extension.prototype.getEnable = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.Extension} returns this - */ -proto.hiddifyrpc.Extension.prototype.setEnable = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ExtensionRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ExtensionRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ExtensionRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionRequest.toObject = function(includeInstance, msg) { - var f, obj = { -extensionId: jspb.Message.getFieldWithDefault(msg, 1, ""), -dataMap: (f = msg.getDataMap()) ? f.toObject(includeInstance, undefined) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ExtensionRequest} - */ -proto.hiddifyrpc.ExtensionRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ExtensionRequest; - return proto.hiddifyrpc.ExtensionRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ExtensionRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ExtensionRequest} - */ -proto.hiddifyrpc.ExtensionRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setExtensionId(value); - break; - case 2: - var value = msg.getDataMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ExtensionRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ExtensionRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ExtensionRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExtensionId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getDataMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional string extension_id = 1; - * @return {string} - */ -proto.hiddifyrpc.ExtensionRequest.prototype.getExtensionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ExtensionRequest} returns this - */ -proto.hiddifyrpc.ExtensionRequest.prototype.setExtensionId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * map data = 2; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.hiddifyrpc.ExtensionRequest.prototype.getDataMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 2, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.hiddifyrpc.ExtensionRequest} returns this - */ -proto.hiddifyrpc.ExtensionRequest.prototype.clearDataMap = function() { - this.getDataMap().clear(); - return this; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.SendExtensionDataRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.SendExtensionDataRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SendExtensionDataRequest.toObject = function(includeInstance, msg) { - var f, obj = { -extensionId: jspb.Message.getFieldWithDefault(msg, 1, ""), -button: jspb.Message.getFieldWithDefault(msg, 2, ""), -dataMap: (f = msg.getDataMap()) ? f.toObject(includeInstance, undefined) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.SendExtensionDataRequest} - */ -proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.SendExtensionDataRequest; - return proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.SendExtensionDataRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.SendExtensionDataRequest} - */ -proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setExtensionId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setButton(value); - break; - case 3: - var value = msg.getDataMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.SendExtensionDataRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.SendExtensionDataRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SendExtensionDataRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExtensionId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getButton(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDataMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional string extension_id = 1; - * @return {string} - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.getExtensionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.setExtensionId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string button = 2; - * @return {string} - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.getButton = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.setButton = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * map data = 3; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.getDataMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 3, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this - */ -proto.hiddifyrpc.SendExtensionDataRequest.prototype.clearDataMap = function() { - this.getDataMap().clear(); - return this; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ExtensionResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ExtensionResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ExtensionResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionResponse.toObject = function(includeInstance, msg) { - var f, obj = { -type: jspb.Message.getFieldWithDefault(msg, 1, 0), -extensionId: jspb.Message.getFieldWithDefault(msg, 2, ""), -jsonUi: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ExtensionResponse} - */ -proto.hiddifyrpc.ExtensionResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ExtensionResponse; - return proto.hiddifyrpc.ExtensionResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ExtensionResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ExtensionResponse} - */ -proto.hiddifyrpc.ExtensionResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.hiddifyrpc.ExtensionResponseType} */ (reader.readEnum()); - msg.setType(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setExtensionId(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setJsonUi(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ExtensionResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ExtensionResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ExtensionResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ExtensionResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getExtensionId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getJsonUi(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional ExtensionResponseType type = 1; - * @return {!proto.hiddifyrpc.ExtensionResponseType} - */ -proto.hiddifyrpc.ExtensionResponse.prototype.getType = function() { - return /** @type {!proto.hiddifyrpc.ExtensionResponseType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.ExtensionResponseType} value - * @return {!proto.hiddifyrpc.ExtensionResponse} returns this - */ -proto.hiddifyrpc.ExtensionResponse.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string extension_id = 2; - * @return {string} - */ -proto.hiddifyrpc.ExtensionResponse.prototype.getExtensionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ExtensionResponse} returns this - */ -proto.hiddifyrpc.ExtensionResponse.prototype.setExtensionId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string json_ui = 3; - * @return {string} - */ -proto.hiddifyrpc.ExtensionResponse.prototype.getJsonUi = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ExtensionResponse} returns this - */ -proto.hiddifyrpc.ExtensionResponse.prototype.setJsonUi = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * @enum {number} - */ -proto.hiddifyrpc.ExtensionResponseType = { - NOTHING: 0, - UPDATE_UI: 1, - SHOW_DIALOG: 2, - END: 3 -}; - -goog.object.extend(exports, proto.hiddifyrpc); diff --git a/extension/html/rpc/hiddify_pb.js b/extension/html/rpc/hiddify_pb.js deleted file mode 100644 index 5532c9bb..00000000 --- a/extension/html/rpc/hiddify_pb.js +++ /dev/null @@ -1,5393 +0,0 @@ -// source: hiddify.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = - (typeof globalThis !== 'undefined' && globalThis) || - (typeof window !== 'undefined' && window) || - (typeof global !== 'undefined' && global) || - (typeof self !== 'undefined' && self) || - (function () { return this; }).call(null) || - Function('return this')(); - -var base_pb = require('./base_pb.js'); -goog.object.extend(proto, base_pb); -goog.exportSymbol('proto.hiddifyrpc.ChangeHiddifySettingsRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.CoreInfoResponse', null, global); -goog.exportSymbol('proto.hiddifyrpc.CoreState', null, global); -goog.exportSymbol('proto.hiddifyrpc.GenerateConfigRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.GenerateConfigResponse', null, global); -goog.exportSymbol('proto.hiddifyrpc.GenerateWarpConfigRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.LogLevel', null, global); -goog.exportSymbol('proto.hiddifyrpc.LogMessage', null, global); -goog.exportSymbol('proto.hiddifyrpc.LogType', null, global); -goog.exportSymbol('proto.hiddifyrpc.MessageType', null, global); -goog.exportSymbol('proto.hiddifyrpc.OutboundGroup', null, global); -goog.exportSymbol('proto.hiddifyrpc.OutboundGroupItem', null, global); -goog.exportSymbol('proto.hiddifyrpc.OutboundGroupList', null, global); -goog.exportSymbol('proto.hiddifyrpc.ParseRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.ParseResponse', null, global); -goog.exportSymbol('proto.hiddifyrpc.Response', null, global); -goog.exportSymbol('proto.hiddifyrpc.SelectOutboundRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.SetSystemProxyEnabledRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.SetupRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.StartRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.StopRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.SystemInfo', null, global); -goog.exportSymbol('proto.hiddifyrpc.SystemProxyStatus', null, global); -goog.exportSymbol('proto.hiddifyrpc.TunnelResponse', null, global); -goog.exportSymbol('proto.hiddifyrpc.TunnelStartRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.UrlTestRequest', null, global); -goog.exportSymbol('proto.hiddifyrpc.WarpAccount', null, global); -goog.exportSymbol('proto.hiddifyrpc.WarpGenerationResponse', null, global); -goog.exportSymbol('proto.hiddifyrpc.WarpWireguardConfig', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.CoreInfoResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.CoreInfoResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.CoreInfoResponse.displayName = 'proto.hiddifyrpc.CoreInfoResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.StartRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.StartRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.StartRequest.displayName = 'proto.hiddifyrpc.StartRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.SetupRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.SetupRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.SetupRequest.displayName = 'proto.hiddifyrpc.SetupRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.Response = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.Response, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.Response.displayName = 'proto.hiddifyrpc.Response'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.SystemInfo = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.SystemInfo, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.SystemInfo.displayName = 'proto.hiddifyrpc.SystemInfo'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.OutboundGroupItem = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.OutboundGroupItem, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.OutboundGroupItem.displayName = 'proto.hiddifyrpc.OutboundGroupItem'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.OutboundGroup = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hiddifyrpc.OutboundGroup.repeatedFields_, null); -}; -goog.inherits(proto.hiddifyrpc.OutboundGroup, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.OutboundGroup.displayName = 'proto.hiddifyrpc.OutboundGroup'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.OutboundGroupList = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hiddifyrpc.OutboundGroupList.repeatedFields_, null); -}; -goog.inherits(proto.hiddifyrpc.OutboundGroupList, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.OutboundGroupList.displayName = 'proto.hiddifyrpc.OutboundGroupList'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.WarpAccount = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.WarpAccount, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.WarpAccount.displayName = 'proto.hiddifyrpc.WarpAccount'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.WarpWireguardConfig = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.WarpWireguardConfig, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.WarpWireguardConfig.displayName = 'proto.hiddifyrpc.WarpWireguardConfig'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.WarpGenerationResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.WarpGenerationResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.WarpGenerationResponse.displayName = 'proto.hiddifyrpc.WarpGenerationResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.SystemProxyStatus = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.SystemProxyStatus, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.SystemProxyStatus.displayName = 'proto.hiddifyrpc.SystemProxyStatus'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ParseRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.ParseRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ParseRequest.displayName = 'proto.hiddifyrpc.ParseRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ParseResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.ParseResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ParseResponse.displayName = 'proto.hiddifyrpc.ParseResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.ChangeHiddifySettingsRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.ChangeHiddifySettingsRequest.displayName = 'proto.hiddifyrpc.ChangeHiddifySettingsRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.GenerateConfigRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.GenerateConfigRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.GenerateConfigRequest.displayName = 'proto.hiddifyrpc.GenerateConfigRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.GenerateConfigResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.GenerateConfigResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.GenerateConfigResponse.displayName = 'proto.hiddifyrpc.GenerateConfigResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.SelectOutboundRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.SelectOutboundRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.SelectOutboundRequest.displayName = 'proto.hiddifyrpc.SelectOutboundRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.UrlTestRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.UrlTestRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.UrlTestRequest.displayName = 'proto.hiddifyrpc.UrlTestRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.GenerateWarpConfigRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.GenerateWarpConfigRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.GenerateWarpConfigRequest.displayName = 'proto.hiddifyrpc.GenerateWarpConfigRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.SetSystemProxyEnabledRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.SetSystemProxyEnabledRequest.displayName = 'proto.hiddifyrpc.SetSystemProxyEnabledRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.LogMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.LogMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.LogMessage.displayName = 'proto.hiddifyrpc.LogMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.StopRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.StopRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.StopRequest.displayName = 'proto.hiddifyrpc.StopRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.TunnelStartRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.TunnelStartRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.TunnelStartRequest.displayName = 'proto.hiddifyrpc.TunnelStartRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hiddifyrpc.TunnelResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hiddifyrpc.TunnelResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hiddifyrpc.TunnelResponse.displayName = 'proto.hiddifyrpc.TunnelResponse'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.CoreInfoResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.CoreInfoResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.CoreInfoResponse.toObject = function(includeInstance, msg) { - var f, obj = { -coreState: jspb.Message.getFieldWithDefault(msg, 1, 0), -messageType: jspb.Message.getFieldWithDefault(msg, 2, 0), -message: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.CoreInfoResponse} - */ -proto.hiddifyrpc.CoreInfoResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.CoreInfoResponse; - return proto.hiddifyrpc.CoreInfoResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.CoreInfoResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.CoreInfoResponse} - */ -proto.hiddifyrpc.CoreInfoResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.hiddifyrpc.CoreState} */ (reader.readEnum()); - msg.setCoreState(value); - break; - case 2: - var value = /** @type {!proto.hiddifyrpc.MessageType} */ (reader.readEnum()); - msg.setMessageType(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.CoreInfoResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.CoreInfoResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.CoreInfoResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCoreState(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getMessageType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional CoreState core_state = 1; - * @return {!proto.hiddifyrpc.CoreState} - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.getCoreState = function() { - return /** @type {!proto.hiddifyrpc.CoreState} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.CoreState} value - * @return {!proto.hiddifyrpc.CoreInfoResponse} returns this - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.setCoreState = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional MessageType message_type = 2; - * @return {!proto.hiddifyrpc.MessageType} - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.getMessageType = function() { - return /** @type {!proto.hiddifyrpc.MessageType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.MessageType} value - * @return {!proto.hiddifyrpc.CoreInfoResponse} returns this - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.setMessageType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional string message = 3; - * @return {string} - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.CoreInfoResponse} returns this - */ -proto.hiddifyrpc.CoreInfoResponse.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.StartRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.StartRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.StartRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.StartRequest.toObject = function(includeInstance, msg) { - var f, obj = { -configPath: jspb.Message.getFieldWithDefault(msg, 1, ""), -configContent: jspb.Message.getFieldWithDefault(msg, 2, ""), -disableMemoryLimit: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), -delayStart: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), -enableOldCommandServer: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), -enableRawConfig: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.StartRequest} - */ -proto.hiddifyrpc.StartRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.StartRequest; - return proto.hiddifyrpc.StartRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.StartRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.StartRequest} - */ -proto.hiddifyrpc.StartRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setConfigPath(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setConfigContent(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDisableMemoryLimit(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDelayStart(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEnableOldCommandServer(value); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEnableRawConfig(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.StartRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.StartRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.StartRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.StartRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getConfigPath(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getConfigContent(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDisableMemoryLimit(); - if (f) { - writer.writeBool( - 3, - f - ); - } - f = message.getDelayStart(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getEnableOldCommandServer(); - if (f) { - writer.writeBool( - 5, - f - ); - } - f = message.getEnableRawConfig(); - if (f) { - writer.writeBool( - 6, - f - ); - } -}; - - -/** - * optional string config_path = 1; - * @return {string} - */ -proto.hiddifyrpc.StartRequest.prototype.getConfigPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.StartRequest} returns this - */ -proto.hiddifyrpc.StartRequest.prototype.setConfigPath = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string config_content = 2; - * @return {string} - */ -proto.hiddifyrpc.StartRequest.prototype.getConfigContent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.StartRequest} returns this - */ -proto.hiddifyrpc.StartRequest.prototype.setConfigContent = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool disable_memory_limit = 3; - * @return {boolean} - */ -proto.hiddifyrpc.StartRequest.prototype.getDisableMemoryLimit = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.StartRequest} returns this - */ -proto.hiddifyrpc.StartRequest.prototype.setDisableMemoryLimit = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -/** - * optional bool delay_start = 4; - * @return {boolean} - */ -proto.hiddifyrpc.StartRequest.prototype.getDelayStart = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.StartRequest} returns this - */ -proto.hiddifyrpc.StartRequest.prototype.setDelayStart = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); -}; - - -/** - * optional bool enable_old_command_server = 5; - * @return {boolean} - */ -proto.hiddifyrpc.StartRequest.prototype.getEnableOldCommandServer = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.StartRequest} returns this - */ -proto.hiddifyrpc.StartRequest.prototype.setEnableOldCommandServer = function(value) { - return jspb.Message.setProto3BooleanField(this, 5, value); -}; - - -/** - * optional bool enable_raw_config = 6; - * @return {boolean} - */ -proto.hiddifyrpc.StartRequest.prototype.getEnableRawConfig = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.StartRequest} returns this - */ -proto.hiddifyrpc.StartRequest.prototype.setEnableRawConfig = function(value) { - return jspb.Message.setProto3BooleanField(this, 6, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.SetupRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.SetupRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.SetupRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SetupRequest.toObject = function(includeInstance, msg) { - var f, obj = { -basePath: jspb.Message.getFieldWithDefault(msg, 1, ""), -workingPath: jspb.Message.getFieldWithDefault(msg, 2, ""), -tempPath: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.SetupRequest} - */ -proto.hiddifyrpc.SetupRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.SetupRequest; - return proto.hiddifyrpc.SetupRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.SetupRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.SetupRequest} - */ -proto.hiddifyrpc.SetupRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setBasePath(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setWorkingPath(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setTempPath(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.SetupRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.SetupRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.SetupRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SetupRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBasePath(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getWorkingPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getTempPath(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string base_path = 1; - * @return {string} - */ -proto.hiddifyrpc.SetupRequest.prototype.getBasePath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SetupRequest} returns this - */ -proto.hiddifyrpc.SetupRequest.prototype.setBasePath = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string working_path = 2; - * @return {string} - */ -proto.hiddifyrpc.SetupRequest.prototype.getWorkingPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SetupRequest} returns this - */ -proto.hiddifyrpc.SetupRequest.prototype.setWorkingPath = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string temp_path = 3; - * @return {string} - */ -proto.hiddifyrpc.SetupRequest.prototype.getTempPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SetupRequest} returns this - */ -proto.hiddifyrpc.SetupRequest.prototype.setTempPath = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.Response.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.Response.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.Response} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.Response.toObject = function(includeInstance, msg) { - var f, obj = { -responseCode: jspb.Message.getFieldWithDefault(msg, 1, 0), -message: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.Response} - */ -proto.hiddifyrpc.Response.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.Response; - return proto.hiddifyrpc.Response.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.Response} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.Response} - */ -proto.hiddifyrpc.Response.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.hiddifyrpc.ResponseCode} */ (reader.readEnum()); - msg.setResponseCode(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.Response.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.Response.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.Response} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.Response.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResponseCode(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional ResponseCode response_code = 1; - * @return {!proto.hiddifyrpc.ResponseCode} - */ -proto.hiddifyrpc.Response.prototype.getResponseCode = function() { - return /** @type {!proto.hiddifyrpc.ResponseCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.ResponseCode} value - * @return {!proto.hiddifyrpc.Response} returns this - */ -proto.hiddifyrpc.Response.prototype.setResponseCode = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string message = 2; - * @return {string} - */ -proto.hiddifyrpc.Response.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.Response} returns this - */ -proto.hiddifyrpc.Response.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.SystemInfo.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.SystemInfo.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.SystemInfo} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SystemInfo.toObject = function(includeInstance, msg) { - var f, obj = { -memory: jspb.Message.getFieldWithDefault(msg, 1, 0), -goroutines: jspb.Message.getFieldWithDefault(msg, 2, 0), -connectionsIn: jspb.Message.getFieldWithDefault(msg, 3, 0), -connectionsOut: jspb.Message.getFieldWithDefault(msg, 4, 0), -trafficAvailable: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), -uplink: jspb.Message.getFieldWithDefault(msg, 6, 0), -downlink: jspb.Message.getFieldWithDefault(msg, 7, 0), -uplinkTotal: jspb.Message.getFieldWithDefault(msg, 8, 0), -downlinkTotal: jspb.Message.getFieldWithDefault(msg, 9, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.SystemInfo} - */ -proto.hiddifyrpc.SystemInfo.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.SystemInfo; - return proto.hiddifyrpc.SystemInfo.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.SystemInfo} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.SystemInfo} - */ -proto.hiddifyrpc.SystemInfo.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setMemory(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setGoroutines(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt32()); - msg.setConnectionsIn(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setConnectionsOut(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setTrafficAvailable(value); - break; - case 6: - var value = /** @type {number} */ (reader.readInt64()); - msg.setUplink(value); - break; - case 7: - var value = /** @type {number} */ (reader.readInt64()); - msg.setDownlink(value); - break; - case 8: - var value = /** @type {number} */ (reader.readInt64()); - msg.setUplinkTotal(value); - break; - case 9: - var value = /** @type {number} */ (reader.readInt64()); - msg.setDownlinkTotal(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.SystemInfo.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.SystemInfo.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.SystemInfo} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SystemInfo.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMemory(); - if (f !== 0) { - writer.writeInt64( - 1, - f - ); - } - f = message.getGoroutines(); - if (f !== 0) { - writer.writeInt32( - 2, - f - ); - } - f = message.getConnectionsIn(); - if (f !== 0) { - writer.writeInt32( - 3, - f - ); - } - f = message.getConnectionsOut(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } - f = message.getTrafficAvailable(); - if (f) { - writer.writeBool( - 5, - f - ); - } - f = message.getUplink(); - if (f !== 0) { - writer.writeInt64( - 6, - f - ); - } - f = message.getDownlink(); - if (f !== 0) { - writer.writeInt64( - 7, - f - ); - } - f = message.getUplinkTotal(); - if (f !== 0) { - writer.writeInt64( - 8, - f - ); - } - f = message.getDownlinkTotal(); - if (f !== 0) { - writer.writeInt64( - 9, - f - ); - } -}; - - -/** - * optional int64 memory = 1; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getMemory = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setMemory = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional int32 goroutines = 2; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getGoroutines = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setGoroutines = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional int32 connections_in = 3; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getConnectionsIn = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setConnectionsIn = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional int32 connections_out = 4; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getConnectionsOut = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setConnectionsOut = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - -/** - * optional bool traffic_available = 5; - * @return {boolean} - */ -proto.hiddifyrpc.SystemInfo.prototype.getTrafficAvailable = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setTrafficAvailable = function(value) { - return jspb.Message.setProto3BooleanField(this, 5, value); -}; - - -/** - * optional int64 uplink = 6; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getUplink = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setUplink = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); -}; - - -/** - * optional int64 downlink = 7; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getDownlink = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setDownlink = function(value) { - return jspb.Message.setProto3IntField(this, 7, value); -}; - - -/** - * optional int64 uplink_total = 8; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getUplinkTotal = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setUplinkTotal = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); -}; - - -/** - * optional int64 downlink_total = 9; - * @return {number} - */ -proto.hiddifyrpc.SystemInfo.prototype.getDownlinkTotal = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.SystemInfo} returns this - */ -proto.hiddifyrpc.SystemInfo.prototype.setDownlinkTotal = function(value) { - return jspb.Message.setProto3IntField(this, 9, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.OutboundGroupItem.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.OutboundGroupItem} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.OutboundGroupItem.toObject = function(includeInstance, msg) { - var f, obj = { -tag: jspb.Message.getFieldWithDefault(msg, 1, ""), -type: jspb.Message.getFieldWithDefault(msg, 2, ""), -urlTestTime: jspb.Message.getFieldWithDefault(msg, 3, 0), -urlTestDelay: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.OutboundGroupItem} - */ -proto.hiddifyrpc.OutboundGroupItem.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.OutboundGroupItem; - return proto.hiddifyrpc.OutboundGroupItem.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.OutboundGroupItem} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.OutboundGroupItem} - */ -proto.hiddifyrpc.OutboundGroupItem.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setTag(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setType(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setUrlTestTime(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setUrlTestDelay(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.OutboundGroupItem.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.OutboundGroupItem} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.OutboundGroupItem.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTag(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getUrlTestTime(); - if (f !== 0) { - writer.writeInt64( - 3, - f - ); - } - f = message.getUrlTestDelay(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } -}; - - -/** - * optional string tag = 1; - * @return {string} - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.getTag = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.OutboundGroupItem} returns this - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.setTag = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string type = 2; - * @return {string} - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.getType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.OutboundGroupItem} returns this - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.setType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional int64 url_test_time = 3; - * @return {number} - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.getUrlTestTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.OutboundGroupItem} returns this - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.setUrlTestTime = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional int32 url_test_delay = 4; - * @return {number} - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.getUrlTestDelay = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.OutboundGroupItem} returns this - */ -proto.hiddifyrpc.OutboundGroupItem.prototype.setUrlTestDelay = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hiddifyrpc.OutboundGroup.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.OutboundGroup.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.OutboundGroup.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.OutboundGroup} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.OutboundGroup.toObject = function(includeInstance, msg) { - var f, obj = { -tag: jspb.Message.getFieldWithDefault(msg, 1, ""), -type: jspb.Message.getFieldWithDefault(msg, 2, ""), -selected: jspb.Message.getFieldWithDefault(msg, 3, ""), -itemsList: jspb.Message.toObjectList(msg.getItemsList(), - proto.hiddifyrpc.OutboundGroupItem.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.OutboundGroup} - */ -proto.hiddifyrpc.OutboundGroup.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.OutboundGroup; - return proto.hiddifyrpc.OutboundGroup.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.OutboundGroup} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.OutboundGroup} - */ -proto.hiddifyrpc.OutboundGroup.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setTag(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setType(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setSelected(value); - break; - case 4: - var value = new proto.hiddifyrpc.OutboundGroupItem; - reader.readMessage(value,proto.hiddifyrpc.OutboundGroupItem.deserializeBinaryFromReader); - msg.addItems(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.OutboundGroup.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.OutboundGroup.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.OutboundGroup} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.OutboundGroup.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTag(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getSelected(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getItemsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.hiddifyrpc.OutboundGroupItem.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string tag = 1; - * @return {string} - */ -proto.hiddifyrpc.OutboundGroup.prototype.getTag = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.OutboundGroup} returns this - */ -proto.hiddifyrpc.OutboundGroup.prototype.setTag = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string type = 2; - * @return {string} - */ -proto.hiddifyrpc.OutboundGroup.prototype.getType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.OutboundGroup} returns this - */ -proto.hiddifyrpc.OutboundGroup.prototype.setType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string selected = 3; - * @return {string} - */ -proto.hiddifyrpc.OutboundGroup.prototype.getSelected = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.OutboundGroup} returns this - */ -proto.hiddifyrpc.OutboundGroup.prototype.setSelected = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * repeated OutboundGroupItem items = 4; - * @return {!Array} - */ -proto.hiddifyrpc.OutboundGroup.prototype.getItemsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hiddifyrpc.OutboundGroupItem, 4)); -}; - - -/** - * @param {!Array} value - * @return {!proto.hiddifyrpc.OutboundGroup} returns this -*/ -proto.hiddifyrpc.OutboundGroup.prototype.setItemsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.hiddifyrpc.OutboundGroupItem=} opt_value - * @param {number=} opt_index - * @return {!proto.hiddifyrpc.OutboundGroupItem} - */ -proto.hiddifyrpc.OutboundGroup.prototype.addItems = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.hiddifyrpc.OutboundGroupItem, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.hiddifyrpc.OutboundGroup} returns this - */ -proto.hiddifyrpc.OutboundGroup.prototype.clearItemsList = function() { - return this.setItemsList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hiddifyrpc.OutboundGroupList.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.OutboundGroupList.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.OutboundGroupList.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.OutboundGroupList} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.OutboundGroupList.toObject = function(includeInstance, msg) { - var f, obj = { -itemsList: jspb.Message.toObjectList(msg.getItemsList(), - proto.hiddifyrpc.OutboundGroup.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.OutboundGroupList} - */ -proto.hiddifyrpc.OutboundGroupList.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.OutboundGroupList; - return proto.hiddifyrpc.OutboundGroupList.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.OutboundGroupList} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.OutboundGroupList} - */ -proto.hiddifyrpc.OutboundGroupList.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.hiddifyrpc.OutboundGroup; - reader.readMessage(value,proto.hiddifyrpc.OutboundGroup.deserializeBinaryFromReader); - msg.addItems(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.OutboundGroupList.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.OutboundGroupList.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.OutboundGroupList} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.OutboundGroupList.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getItemsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.hiddifyrpc.OutboundGroup.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated OutboundGroup items = 1; - * @return {!Array} - */ -proto.hiddifyrpc.OutboundGroupList.prototype.getItemsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hiddifyrpc.OutboundGroup, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.hiddifyrpc.OutboundGroupList} returns this -*/ -proto.hiddifyrpc.OutboundGroupList.prototype.setItemsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.hiddifyrpc.OutboundGroup=} opt_value - * @param {number=} opt_index - * @return {!proto.hiddifyrpc.OutboundGroup} - */ -proto.hiddifyrpc.OutboundGroupList.prototype.addItems = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hiddifyrpc.OutboundGroup, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.hiddifyrpc.OutboundGroupList} returns this - */ -proto.hiddifyrpc.OutboundGroupList.prototype.clearItemsList = function() { - return this.setItemsList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.WarpAccount.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.WarpAccount.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.WarpAccount} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.WarpAccount.toObject = function(includeInstance, msg) { - var f, obj = { -accountId: jspb.Message.getFieldWithDefault(msg, 1, ""), -accessToken: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.WarpAccount} - */ -proto.hiddifyrpc.WarpAccount.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.WarpAccount; - return proto.hiddifyrpc.WarpAccount.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.WarpAccount} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.WarpAccount} - */ -proto.hiddifyrpc.WarpAccount.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setAccountId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setAccessToken(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.WarpAccount.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.WarpAccount.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.WarpAccount} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.WarpAccount.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAccountId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getAccessToken(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string account_id = 1; - * @return {string} - */ -proto.hiddifyrpc.WarpAccount.prototype.getAccountId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpAccount} returns this - */ -proto.hiddifyrpc.WarpAccount.prototype.setAccountId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string access_token = 2; - * @return {string} - */ -proto.hiddifyrpc.WarpAccount.prototype.getAccessToken = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpAccount} returns this - */ -proto.hiddifyrpc.WarpAccount.prototype.setAccessToken = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.WarpWireguardConfig.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.WarpWireguardConfig} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.WarpWireguardConfig.toObject = function(includeInstance, msg) { - var f, obj = { -privateKey: jspb.Message.getFieldWithDefault(msg, 1, ""), -localAddressIpv4: jspb.Message.getFieldWithDefault(msg, 2, ""), -localAddressIpv6: jspb.Message.getFieldWithDefault(msg, 3, ""), -peerPublicKey: jspb.Message.getFieldWithDefault(msg, 4, ""), -clientId: jspb.Message.getFieldWithDefault(msg, 5, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.WarpWireguardConfig} - */ -proto.hiddifyrpc.WarpWireguardConfig.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.WarpWireguardConfig; - return proto.hiddifyrpc.WarpWireguardConfig.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.WarpWireguardConfig} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.WarpWireguardConfig} - */ -proto.hiddifyrpc.WarpWireguardConfig.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPrivateKey(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLocalAddressIpv4(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setLocalAddressIpv6(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setPeerPublicKey(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setClientId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.WarpWireguardConfig.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.WarpWireguardConfig} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.WarpWireguardConfig.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPrivateKey(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getLocalAddressIpv4(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getLocalAddressIpv6(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getPeerPublicKey(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getClientId(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } -}; - - -/** - * optional string private_key = 1; - * @return {string} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.getPrivateKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpWireguardConfig} returns this - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.setPrivateKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string local_address_ipv4 = 2; - * @return {string} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.getLocalAddressIpv4 = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpWireguardConfig} returns this - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.setLocalAddressIpv4 = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string local_address_ipv6 = 3; - * @return {string} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.getLocalAddressIpv6 = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpWireguardConfig} returns this - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.setLocalAddressIpv6 = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string peer_public_key = 4; - * @return {string} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.getPeerPublicKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpWireguardConfig} returns this - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.setPeerPublicKey = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional string client_id = 5; - * @return {string} - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.getClientId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpWireguardConfig} returns this - */ -proto.hiddifyrpc.WarpWireguardConfig.prototype.setClientId = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.WarpGenerationResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.WarpGenerationResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.WarpGenerationResponse.toObject = function(includeInstance, msg) { - var f, obj = { -account: (f = msg.getAccount()) && proto.hiddifyrpc.WarpAccount.toObject(includeInstance, f), -log: jspb.Message.getFieldWithDefault(msg, 2, ""), -config: (f = msg.getConfig()) && proto.hiddifyrpc.WarpWireguardConfig.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.WarpGenerationResponse} - */ -proto.hiddifyrpc.WarpGenerationResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.WarpGenerationResponse; - return proto.hiddifyrpc.WarpGenerationResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.WarpGenerationResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.WarpGenerationResponse} - */ -proto.hiddifyrpc.WarpGenerationResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.hiddifyrpc.WarpAccount; - reader.readMessage(value,proto.hiddifyrpc.WarpAccount.deserializeBinaryFromReader); - msg.setAccount(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLog(value); - break; - case 3: - var value = new proto.hiddifyrpc.WarpWireguardConfig; - reader.readMessage(value,proto.hiddifyrpc.WarpWireguardConfig.deserializeBinaryFromReader); - msg.setConfig(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.WarpGenerationResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.WarpGenerationResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.WarpGenerationResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAccount(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.hiddifyrpc.WarpAccount.serializeBinaryToWriter - ); - } - f = message.getLog(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getConfig(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.hiddifyrpc.WarpWireguardConfig.serializeBinaryToWriter - ); - } -}; - - -/** - * optional WarpAccount account = 1; - * @return {?proto.hiddifyrpc.WarpAccount} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.getAccount = function() { - return /** @type{?proto.hiddifyrpc.WarpAccount} */ ( - jspb.Message.getWrapperField(this, proto.hiddifyrpc.WarpAccount, 1)); -}; - - -/** - * @param {?proto.hiddifyrpc.WarpAccount|undefined} value - * @return {!proto.hiddifyrpc.WarpGenerationResponse} returns this -*/ -proto.hiddifyrpc.WarpGenerationResponse.prototype.setAccount = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.hiddifyrpc.WarpGenerationResponse} returns this - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.clearAccount = function() { - return this.setAccount(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.hasAccount = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string log = 2; - * @return {string} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.getLog = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.WarpGenerationResponse} returns this - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.setLog = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional WarpWireguardConfig config = 3; - * @return {?proto.hiddifyrpc.WarpWireguardConfig} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.getConfig = function() { - return /** @type{?proto.hiddifyrpc.WarpWireguardConfig} */ ( - jspb.Message.getWrapperField(this, proto.hiddifyrpc.WarpWireguardConfig, 3)); -}; - - -/** - * @param {?proto.hiddifyrpc.WarpWireguardConfig|undefined} value - * @return {!proto.hiddifyrpc.WarpGenerationResponse} returns this -*/ -proto.hiddifyrpc.WarpGenerationResponse.prototype.setConfig = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.hiddifyrpc.WarpGenerationResponse} returns this - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.clearConfig = function() { - return this.setConfig(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hiddifyrpc.WarpGenerationResponse.prototype.hasConfig = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.SystemProxyStatus.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.SystemProxyStatus.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.SystemProxyStatus} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SystemProxyStatus.toObject = function(includeInstance, msg) { - var f, obj = { -available: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), -enabled: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.SystemProxyStatus} - */ -proto.hiddifyrpc.SystemProxyStatus.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.SystemProxyStatus; - return proto.hiddifyrpc.SystemProxyStatus.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.SystemProxyStatus} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.SystemProxyStatus} - */ -proto.hiddifyrpc.SystemProxyStatus.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setAvailable(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEnabled(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.SystemProxyStatus.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.SystemProxyStatus.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.SystemProxyStatus} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SystemProxyStatus.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAvailable(); - if (f) { - writer.writeBool( - 1, - f - ); - } - f = message.getEnabled(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * optional bool available = 1; - * @return {boolean} - */ -proto.hiddifyrpc.SystemProxyStatus.prototype.getAvailable = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.SystemProxyStatus} returns this - */ -proto.hiddifyrpc.SystemProxyStatus.prototype.setAvailable = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -/** - * optional bool enabled = 2; - * @return {boolean} - */ -proto.hiddifyrpc.SystemProxyStatus.prototype.getEnabled = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.SystemProxyStatus} returns this - */ -proto.hiddifyrpc.SystemProxyStatus.prototype.setEnabled = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ParseRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ParseRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ParseRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ParseRequest.toObject = function(includeInstance, msg) { - var f, obj = { -content: jspb.Message.getFieldWithDefault(msg, 1, ""), -configPath: jspb.Message.getFieldWithDefault(msg, 2, ""), -tempPath: jspb.Message.getFieldWithDefault(msg, 3, ""), -debug: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ParseRequest} - */ -proto.hiddifyrpc.ParseRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ParseRequest; - return proto.hiddifyrpc.ParseRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ParseRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ParseRequest} - */ -proto.hiddifyrpc.ParseRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setContent(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setConfigPath(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setTempPath(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDebug(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ParseRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ParseRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ParseRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ParseRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContent(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getConfigPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getTempPath(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getDebug(); - if (f) { - writer.writeBool( - 4, - f - ); - } -}; - - -/** - * optional string content = 1; - * @return {string} - */ -proto.hiddifyrpc.ParseRequest.prototype.getContent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ParseRequest} returns this - */ -proto.hiddifyrpc.ParseRequest.prototype.setContent = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string config_path = 2; - * @return {string} - */ -proto.hiddifyrpc.ParseRequest.prototype.getConfigPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ParseRequest} returns this - */ -proto.hiddifyrpc.ParseRequest.prototype.setConfigPath = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string temp_path = 3; - * @return {string} - */ -proto.hiddifyrpc.ParseRequest.prototype.getTempPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ParseRequest} returns this - */ -proto.hiddifyrpc.ParseRequest.prototype.setTempPath = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional bool debug = 4; - * @return {boolean} - */ -proto.hiddifyrpc.ParseRequest.prototype.getDebug = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.ParseRequest} returns this - */ -proto.hiddifyrpc.ParseRequest.prototype.setDebug = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ParseResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ParseResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ParseResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ParseResponse.toObject = function(includeInstance, msg) { - var f, obj = { -responseCode: jspb.Message.getFieldWithDefault(msg, 1, 0), -content: jspb.Message.getFieldWithDefault(msg, 2, ""), -message: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ParseResponse} - */ -proto.hiddifyrpc.ParseResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ParseResponse; - return proto.hiddifyrpc.ParseResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ParseResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ParseResponse} - */ -proto.hiddifyrpc.ParseResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.hiddifyrpc.ResponseCode} */ (reader.readEnum()); - msg.setResponseCode(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setContent(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ParseResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ParseResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ParseResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ParseResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResponseCode(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getContent(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional ResponseCode response_code = 1; - * @return {!proto.hiddifyrpc.ResponseCode} - */ -proto.hiddifyrpc.ParseResponse.prototype.getResponseCode = function() { - return /** @type {!proto.hiddifyrpc.ResponseCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.ResponseCode} value - * @return {!proto.hiddifyrpc.ParseResponse} returns this - */ -proto.hiddifyrpc.ParseResponse.prototype.setResponseCode = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string content = 2; - * @return {string} - */ -proto.hiddifyrpc.ParseResponse.prototype.getContent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ParseResponse} returns this - */ -proto.hiddifyrpc.ParseResponse.prototype.setContent = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string message = 3; - * @return {string} - */ -proto.hiddifyrpc.ParseResponse.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ParseResponse} returns this - */ -proto.hiddifyrpc.ParseResponse.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.ChangeHiddifySettingsRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.toObject = function(includeInstance, msg) { - var f, obj = { -hiddifySettingsJson: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.ChangeHiddifySettingsRequest; - return proto.hiddifyrpc.ChangeHiddifySettingsRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setHiddifySettingsJson(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.ChangeHiddifySettingsRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getHiddifySettingsJson(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string hiddify_settings_json = 1; - * @return {string} - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.getHiddifySettingsJson = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} returns this - */ -proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.setHiddifySettingsJson = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.GenerateConfigRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.GenerateConfigRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.GenerateConfigRequest.toObject = function(includeInstance, msg) { - var f, obj = { -path: jspb.Message.getFieldWithDefault(msg, 1, ""), -tempPath: jspb.Message.getFieldWithDefault(msg, 2, ""), -debug: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.GenerateConfigRequest} - */ -proto.hiddifyrpc.GenerateConfigRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.GenerateConfigRequest; - return proto.hiddifyrpc.GenerateConfigRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.GenerateConfigRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.GenerateConfigRequest} - */ -proto.hiddifyrpc.GenerateConfigRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPath(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setTempPath(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDebug(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.GenerateConfigRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.GenerateConfigRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.GenerateConfigRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPath(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getTempPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDebug(); - if (f) { - writer.writeBool( - 3, - f - ); - } -}; - - -/** - * optional string path = 1; - * @return {string} - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.getPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.GenerateConfigRequest} returns this - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.setPath = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string temp_path = 2; - * @return {string} - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.getTempPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.GenerateConfigRequest} returns this - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.setTempPath = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool debug = 3; - * @return {boolean} - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.getDebug = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.GenerateConfigRequest} returns this - */ -proto.hiddifyrpc.GenerateConfigRequest.prototype.setDebug = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.GenerateConfigResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.GenerateConfigResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.GenerateConfigResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.GenerateConfigResponse.toObject = function(includeInstance, msg) { - var f, obj = { -configContent: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.GenerateConfigResponse} - */ -proto.hiddifyrpc.GenerateConfigResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.GenerateConfigResponse; - return proto.hiddifyrpc.GenerateConfigResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.GenerateConfigResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.GenerateConfigResponse} - */ -proto.hiddifyrpc.GenerateConfigResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setConfigContent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.GenerateConfigResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.GenerateConfigResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.GenerateConfigResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.GenerateConfigResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getConfigContent(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string config_content = 1; - * @return {string} - */ -proto.hiddifyrpc.GenerateConfigResponse.prototype.getConfigContent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.GenerateConfigResponse} returns this - */ -proto.hiddifyrpc.GenerateConfigResponse.prototype.setConfigContent = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.SelectOutboundRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.SelectOutboundRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.SelectOutboundRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SelectOutboundRequest.toObject = function(includeInstance, msg) { - var f, obj = { -groupTag: jspb.Message.getFieldWithDefault(msg, 1, ""), -outboundTag: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.SelectOutboundRequest} - */ -proto.hiddifyrpc.SelectOutboundRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.SelectOutboundRequest; - return proto.hiddifyrpc.SelectOutboundRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.SelectOutboundRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.SelectOutboundRequest} - */ -proto.hiddifyrpc.SelectOutboundRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setGroupTag(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setOutboundTag(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.SelectOutboundRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.SelectOutboundRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.SelectOutboundRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SelectOutboundRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getGroupTag(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getOutboundTag(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string group_tag = 1; - * @return {string} - */ -proto.hiddifyrpc.SelectOutboundRequest.prototype.getGroupTag = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SelectOutboundRequest} returns this - */ -proto.hiddifyrpc.SelectOutboundRequest.prototype.setGroupTag = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string outbound_tag = 2; - * @return {string} - */ -proto.hiddifyrpc.SelectOutboundRequest.prototype.getOutboundTag = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.SelectOutboundRequest} returns this - */ -proto.hiddifyrpc.SelectOutboundRequest.prototype.setOutboundTag = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.UrlTestRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.UrlTestRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.UrlTestRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.UrlTestRequest.toObject = function(includeInstance, msg) { - var f, obj = { -groupTag: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.UrlTestRequest} - */ -proto.hiddifyrpc.UrlTestRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.UrlTestRequest; - return proto.hiddifyrpc.UrlTestRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.UrlTestRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.UrlTestRequest} - */ -proto.hiddifyrpc.UrlTestRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setGroupTag(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.UrlTestRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.UrlTestRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.UrlTestRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.UrlTestRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getGroupTag(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string group_tag = 1; - * @return {string} - */ -proto.hiddifyrpc.UrlTestRequest.prototype.getGroupTag = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.UrlTestRequest} returns this - */ -proto.hiddifyrpc.UrlTestRequest.prototype.setGroupTag = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.GenerateWarpConfigRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.GenerateWarpConfigRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.toObject = function(includeInstance, msg) { - var f, obj = { -licenseKey: jspb.Message.getFieldWithDefault(msg, 1, ""), -accountId: jspb.Message.getFieldWithDefault(msg, 2, ""), -accessToken: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.GenerateWarpConfigRequest} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.GenerateWarpConfigRequest; - return proto.hiddifyrpc.GenerateWarpConfigRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.GenerateWarpConfigRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.GenerateWarpConfigRequest} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setLicenseKey(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setAccountId(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setAccessToken(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.GenerateWarpConfigRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.GenerateWarpConfigRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getLicenseKey(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getAccountId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getAccessToken(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string license_key = 1; - * @return {string} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.getLicenseKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.GenerateWarpConfigRequest} returns this - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.setLicenseKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string account_id = 2; - * @return {string} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.getAccountId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.GenerateWarpConfigRequest} returns this - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.setAccountId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string access_token = 3; - * @return {string} - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.getAccessToken = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.GenerateWarpConfigRequest} returns this - */ -proto.hiddifyrpc.GenerateWarpConfigRequest.prototype.setAccessToken = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.SetSystemProxyEnabledRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.SetSystemProxyEnabledRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.toObject = function(includeInstance, msg) { - var f, obj = { -isEnabled: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.SetSystemProxyEnabledRequest} - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.SetSystemProxyEnabledRequest; - return proto.hiddifyrpc.SetSystemProxyEnabledRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.SetSystemProxyEnabledRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.SetSystemProxyEnabledRequest} - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsEnabled(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.SetSystemProxyEnabledRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.SetSystemProxyEnabledRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIsEnabled(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool is_enabled = 1; - * @return {boolean} - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.prototype.getIsEnabled = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.SetSystemProxyEnabledRequest} returns this - */ -proto.hiddifyrpc.SetSystemProxyEnabledRequest.prototype.setIsEnabled = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.LogMessage.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.LogMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.LogMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.LogMessage.toObject = function(includeInstance, msg) { - var f, obj = { -level: jspb.Message.getFieldWithDefault(msg, 1, 0), -type: jspb.Message.getFieldWithDefault(msg, 2, 0), -message: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.LogMessage} - */ -proto.hiddifyrpc.LogMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.LogMessage; - return proto.hiddifyrpc.LogMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.LogMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.LogMessage} - */ -proto.hiddifyrpc.LogMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.hiddifyrpc.LogLevel} */ (reader.readEnum()); - msg.setLevel(value); - break; - case 2: - var value = /** @type {!proto.hiddifyrpc.LogType} */ (reader.readEnum()); - msg.setType(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.LogMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.LogMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.LogMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.LogMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getLevel(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional LogLevel level = 1; - * @return {!proto.hiddifyrpc.LogLevel} - */ -proto.hiddifyrpc.LogMessage.prototype.getLevel = function() { - return /** @type {!proto.hiddifyrpc.LogLevel} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.LogLevel} value - * @return {!proto.hiddifyrpc.LogMessage} returns this - */ -proto.hiddifyrpc.LogMessage.prototype.setLevel = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional LogType type = 2; - * @return {!proto.hiddifyrpc.LogType} - */ -proto.hiddifyrpc.LogMessage.prototype.getType = function() { - return /** @type {!proto.hiddifyrpc.LogType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.hiddifyrpc.LogType} value - * @return {!proto.hiddifyrpc.LogMessage} returns this - */ -proto.hiddifyrpc.LogMessage.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional string message = 3; - * @return {string} - */ -proto.hiddifyrpc.LogMessage.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.LogMessage} returns this - */ -proto.hiddifyrpc.LogMessage.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.StopRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.StopRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.StopRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.StopRequest.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.StopRequest} - */ -proto.hiddifyrpc.StopRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.StopRequest; - return proto.hiddifyrpc.StopRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.StopRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.StopRequest} - */ -proto.hiddifyrpc.StopRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.StopRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.StopRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.StopRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.StopRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.TunnelStartRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.TunnelStartRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.TunnelStartRequest.toObject = function(includeInstance, msg) { - var f, obj = { -ipv6: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), -serverPort: jspb.Message.getFieldWithDefault(msg, 2, 0), -strictRoute: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), -endpointIndependentNat: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), -stack: jspb.Message.getFieldWithDefault(msg, 5, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.TunnelStartRequest} - */ -proto.hiddifyrpc.TunnelStartRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.TunnelStartRequest; - return proto.hiddifyrpc.TunnelStartRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.TunnelStartRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.TunnelStartRequest} - */ -proto.hiddifyrpc.TunnelStartRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIpv6(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setServerPort(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setStrictRoute(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEndpointIndependentNat(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setStack(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.TunnelStartRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.TunnelStartRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.TunnelStartRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIpv6(); - if (f) { - writer.writeBool( - 1, - f - ); - } - f = message.getServerPort(); - if (f !== 0) { - writer.writeInt32( - 2, - f - ); - } - f = message.getStrictRoute(); - if (f) { - writer.writeBool( - 3, - f - ); - } - f = message.getEndpointIndependentNat(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getStack(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } -}; - - -/** - * optional bool ipv6 = 1; - * @return {boolean} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.getIpv6 = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.TunnelStartRequest} returns this - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.setIpv6 = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -/** - * optional int32 server_port = 2; - * @return {number} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.getServerPort = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hiddifyrpc.TunnelStartRequest} returns this - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.setServerPort = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional bool strict_route = 3; - * @return {boolean} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.getStrictRoute = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.TunnelStartRequest} returns this - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.setStrictRoute = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -/** - * optional bool endpoint_independent_nat = 4; - * @return {boolean} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.getEndpointIndependentNat = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.hiddifyrpc.TunnelStartRequest} returns this - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.setEndpointIndependentNat = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); -}; - - -/** - * optional string stack = 5; - * @return {string} - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.getStack = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.TunnelStartRequest} returns this - */ -proto.hiddifyrpc.TunnelStartRequest.prototype.setStack = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hiddifyrpc.TunnelResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hiddifyrpc.TunnelResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hiddifyrpc.TunnelResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.TunnelResponse.toObject = function(includeInstance, msg) { - var f, obj = { -message: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hiddifyrpc.TunnelResponse} - */ -proto.hiddifyrpc.TunnelResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hiddifyrpc.TunnelResponse; - return proto.hiddifyrpc.TunnelResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hiddifyrpc.TunnelResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hiddifyrpc.TunnelResponse} - */ -proto.hiddifyrpc.TunnelResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hiddifyrpc.TunnelResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hiddifyrpc.TunnelResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hiddifyrpc.TunnelResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hiddifyrpc.TunnelResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string message = 1; - * @return {string} - */ -proto.hiddifyrpc.TunnelResponse.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hiddifyrpc.TunnelResponse} returns this - */ -proto.hiddifyrpc.TunnelResponse.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * @enum {number} - */ -proto.hiddifyrpc.CoreState = { - STOPPED: 0, - STARTING: 1, - STARTED: 2, - STOPPING: 3 -}; - -/** - * @enum {number} - */ -proto.hiddifyrpc.MessageType = { - EMPTY: 0, - EMPTY_CONFIGURATION: 1, - START_COMMAND_SERVER: 2, - CREATE_SERVICE: 3, - START_SERVICE: 4, - UNEXPECTED_ERROR: 5, - ALREADY_STARTED: 6, - ALREADY_STOPPED: 7, - INSTANCE_NOT_FOUND: 8, - INSTANCE_NOT_STOPPED: 9, - INSTANCE_NOT_STARTED: 10, - ERROR_BUILDING_CONFIG: 11, - ERROR_PARSING_CONFIG: 12, - ERROR_READING_CONFIG: 13 -}; - -/** - * @enum {number} - */ -proto.hiddifyrpc.LogLevel = { - DEBUG: 0, - INFO: 1, - WARNING: 2, - ERROR: 3, - FATAL: 4 -}; - -/** - * @enum {number} - */ -proto.hiddifyrpc.LogType = { - CORE: 0, - SERVICE: 1, - CONFIG: 2 -}; - -goog.object.extend(exports, proto.hiddifyrpc); diff --git a/go.mod b/go.mod index 7f9bd87a..bf8e721f 100644 --- a/go.mod +++ b/go.mod @@ -302,7 +302,7 @@ require ( lukechampine.com/blake3 v1.3.0 // indirect ) -replace github.com/sagernet/sing-box => github.com/hiddify/hiddify-sing-box v1.8.9-0.20241019134406-9079d5024936 +replace github.com/sagernet/sing-box => github.com/hiddify/hiddify-sing-box v1.8.9-0.20241020064059-08c71ee5f82f replace github.com/xtls/xray-core => github.com/hiddify/xray-core v0.0.0-20241019134126-3f94892df016 diff --git a/go.sum b/go.sum index 424b1096..793db884 100644 --- a/go.sum +++ b/go.sum @@ -242,8 +242,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= -github.com/hiddify/hiddify-sing-box v1.8.9-0.20241019134406-9079d5024936 h1:VvKwjJVvfkMxRtKtKsnlzPER3kKQNAJEQBCY1sB0aps= -github.com/hiddify/hiddify-sing-box v1.8.9-0.20241019134406-9079d5024936/go.mod h1:6apAGQPqJIb58BIYsr66tu49S5UcCNyuv1lVX+72eQA= +github.com/hiddify/hiddify-sing-box v1.8.9-0.20241020064059-08c71ee5f82f h1:UYYtEiK8bx2sBzUkr1YV9HhAvBMjb+4Dm0Uc0OvnUfY= +github.com/hiddify/hiddify-sing-box v1.8.9-0.20241020064059-08c71ee5f82f/go.mod h1:6apAGQPqJIb58BIYsr66tu49S5UcCNyuv1lVX+72eQA= github.com/hiddify/ray2sing v0.0.0-20240928221833-190b549d5222 h1:+MFxFxoWCA44WhqIixqL/Zkt4DwnqhQvafS0Dm4+dKM= github.com/hiddify/ray2sing v0.0.0-20240928221833-190b549d5222/go.mod h1:cFEg1b0eBgL9kBgIPAD71lHO1Q5g20PZL4dUGhQpAO8= github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d h1:vRGKh9ou+/vQGfVYa8MczhbIVjHxlP52OWwrDWO77RA= diff --git a/v2/common/app_settings.go b/v2/hcommon/app_settings.go similarity index 77% rename from v2/common/app_settings.go rename to v2/hcommon/app_settings.go index 84d1b2f6..3aaec5fd 100644 --- a/v2/common/app_settings.go +++ b/v2/hcommon/app_settings.go @@ -1,4 +1,4 @@ -package common +package hcommon type AppSettings struct { Id string diff --git a/v2/common/common.pb.go b/v2/hcommon/common.pb.go similarity index 53% rename from v2/common/common.pb.go rename to v2/hcommon/common.pb.go index d4d64a75..fd44faed 100644 --- a/v2/common/common.pb.go +++ b/v2/hcommon/common.pb.go @@ -2,9 +2,9 @@ // versions: // protoc-gen-go v1.34.2 // protoc v5.28.0 -// source: v2/common/common.proto +// source: v2/hcommon/common.proto -package common +package hcommon import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -53,11 +53,11 @@ func (x ResponseCode) String() string { } func (ResponseCode) Descriptor() protoreflect.EnumDescriptor { - return file_v2_common_common_proto_enumTypes[0].Descriptor() + return file_v2_hcommon_common_proto_enumTypes[0].Descriptor() } func (ResponseCode) Type() protoreflect.EnumType { - return &file_v2_common_common_proto_enumTypes[0] + return &file_v2_hcommon_common_proto_enumTypes[0] } func (x ResponseCode) Number() protoreflect.EnumNumber { @@ -66,7 +66,7 @@ func (x ResponseCode) Number() protoreflect.EnumNumber { // Deprecated: Use ResponseCode.Descriptor instead. func (ResponseCode) EnumDescriptor() ([]byte, []int) { - return file_v2_common_common_proto_rawDescGZIP(), []int{0} + return file_v2_hcommon_common_proto_rawDescGZIP(), []int{0} } type Empty struct { @@ -78,7 +78,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_v2_common_common_proto_msgTypes[0] + mi := &file_v2_hcommon_common_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -91,7 +91,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_v2_common_common_proto_msgTypes[0] + mi := &file_v2_hcommon_common_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -104,7 +104,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_v2_common_common_proto_rawDescGZIP(), []int{0} + return file_v2_hcommon_common_proto_rawDescGZIP(), []int{0} } type Response struct { @@ -112,14 +112,14 @@ type Response struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=common.ResponseCode" json:"code,omitempty"` + Code ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=hcommon.ResponseCode" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` } func (x *Response) Reset() { *x = Response{} if protoimpl.UnsafeEnabled { - mi := &file_v2_common_common_proto_msgTypes[1] + mi := &file_v2_hcommon_common_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -132,7 +132,7 @@ func (x *Response) String() string { func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_v2_common_common_proto_msgTypes[1] + mi := &file_v2_hcommon_common_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -145,7 +145,7 @@ func (x *Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { - return file_v2_common_common_proto_rawDescGZIP(), []int{1} + return file_v2_hcommon_common_proto_rawDescGZIP(), []int{1} } func (x *Response) GetCode() ResponseCode { @@ -162,47 +162,47 @@ func (x *Response) GetMessage() string { return "" } -var File_v2_common_common_proto protoreflect.FileDescriptor - -var file_v2_common_common_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4e, 0x0a, 0x08, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x31, 0x0a, 0x0c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, - 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, - 0x09, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x4e, 0x45, 0x45, 0x44, 0x10, 0x02, 0x42, 0x2b, 0x5a, 0x29, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, - 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, +var File_v2_hcommon_common_proto protoreflect.FileDescriptor + +var file_v2_hcommon_common_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x68, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4f, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x31, 0x0a, 0x0c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x06, 0x0a, 0x02, + 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x4e, 0x45, 0x45, 0x44, 0x10, 0x02, 0x42, + 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x69, + 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2d, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2_common_common_proto_rawDescOnce sync.Once - file_v2_common_common_proto_rawDescData = file_v2_common_common_proto_rawDesc + file_v2_hcommon_common_proto_rawDescOnce sync.Once + file_v2_hcommon_common_proto_rawDescData = file_v2_hcommon_common_proto_rawDesc ) -func file_v2_common_common_proto_rawDescGZIP() []byte { - file_v2_common_common_proto_rawDescOnce.Do(func() { - file_v2_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2_common_common_proto_rawDescData) +func file_v2_hcommon_common_proto_rawDescGZIP() []byte { + file_v2_hcommon_common_proto_rawDescOnce.Do(func() { + file_v2_hcommon_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2_hcommon_common_proto_rawDescData) }) - return file_v2_common_common_proto_rawDescData + return file_v2_hcommon_common_proto_rawDescData } -var file_v2_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2_common_common_proto_goTypes = []any{ - (ResponseCode)(0), // 0: common.ResponseCode - (*Empty)(nil), // 1: common.Empty - (*Response)(nil), // 2: common.Response +var file_v2_hcommon_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_v2_hcommon_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_v2_hcommon_common_proto_goTypes = []any{ + (ResponseCode)(0), // 0: hcommon.ResponseCode + (*Empty)(nil), // 1: hcommon.Empty + (*Response)(nil), // 2: hcommon.Response } -var file_v2_common_common_proto_depIdxs = []int32{ - 0, // 0: common.Response.code:type_name -> common.ResponseCode +var file_v2_hcommon_common_proto_depIdxs = []int32{ + 0, // 0: hcommon.Response.code:type_name -> hcommon.ResponseCode 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -210,13 +210,13 @@ var file_v2_common_common_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2_common_common_proto_init() } -func file_v2_common_common_proto_init() { - if File_v2_common_common_proto != nil { +func init() { file_v2_hcommon_common_proto_init() } +func file_v2_hcommon_common_proto_init() { + if File_v2_hcommon_common_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_v2_common_common_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_v2_hcommon_common_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Empty); i { case 0: return &v.state @@ -228,7 +228,7 @@ func file_v2_common_common_proto_init() { return nil } } - file_v2_common_common_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_v2_hcommon_common_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Response); i { case 0: return &v.state @@ -245,19 +245,19 @@ func file_v2_common_common_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2_common_common_proto_rawDesc, + RawDescriptor: file_v2_hcommon_common_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2_common_common_proto_goTypes, - DependencyIndexes: file_v2_common_common_proto_depIdxs, - EnumInfos: file_v2_common_common_proto_enumTypes, - MessageInfos: file_v2_common_common_proto_msgTypes, + GoTypes: file_v2_hcommon_common_proto_goTypes, + DependencyIndexes: file_v2_hcommon_common_proto_depIdxs, + EnumInfos: file_v2_hcommon_common_proto_enumTypes, + MessageInfos: file_v2_hcommon_common_proto_msgTypes, }.Build() - File_v2_common_common_proto = out.File - file_v2_common_common_proto_rawDesc = nil - file_v2_common_common_proto_goTypes = nil - file_v2_common_common_proto_depIdxs = nil + File_v2_hcommon_common_proto = out.File + file_v2_hcommon_common_proto_rawDesc = nil + file_v2_hcommon_common_proto_goTypes = nil + file_v2_hcommon_common_proto_depIdxs = nil } diff --git a/v2/common/common.proto b/v2/hcommon/common.proto similarity index 67% rename from v2/common/common.proto rename to v2/hcommon/common.proto index 43bd6f1c..bd6e2b23 100644 --- a/v2/common/common.proto +++ b/v2/hcommon/common.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package common; +package hcommon; -option go_package = "github.com/hiddify/hiddify-core/v2/common"; +option go_package = "github.com/hiddify/hiddify-core/v2/hcommon"; message Empty { } diff --git a/v2/common/constants/constants.go b/v2/hcommon/constants/constants.go similarity index 100% rename from v2/common/constants/constants.go rename to v2/hcommon/constants/constants.go diff --git a/v2/common/request/url_request.go b/v2/hcommon/request/url_request.go similarity index 100% rename from v2/common/request/url_request.go rename to v2/hcommon/request/url_request.go diff --git a/v2/hcore/command_client.go b/v2/hcore/command_client.go index 1b0cffee..9bc4ec8b 100644 --- a/v2/hcore/command_client.go +++ b/v2/hcore/command_client.go @@ -2,11 +2,18 @@ package hcore import ( "github.com/sagernet/sing-box/experimental/libbox" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) var _ libbox.CommandClientHandler = (*CommandClientHandler)(nil) -type CommandClientHandler struct{} +const ( + CommandCli = "core" +) + +type CommandClientHandler struct { + command int32 +} func (cch *CommandClientHandler) Connected() { Log(LogLevel_DEBUG, LogType_CORE, "CONNECTED") @@ -46,22 +53,25 @@ func (cch *CommandClientHandler) WriteGroups(message libbox.OutboundGroupIterato for message.HasNext() { group := message.Next() items := group.GetItems() - groupItems := []*OutboundGroupItem{} + groupItems := []*OutboundInfo{} for items.HasNext() { item := items.Next() groupItems = append(groupItems, - &OutboundGroupItem{ + &OutboundInfo{ Tag: item.Tag, Type: item.Type, - UrlTestTime: item.URLTestTime, + UrlTestTime: ×tamppb.Timestamp{Seconds: item.URLTestTime}, UrlTestDelay: item.URLTestDelay, }, ) } groups.Items = append(groups.Items, &OutboundGroup{Tag: group.Tag, Type: group.Type, Selected: group.Selected, Items: groupItems}) } - outboundsInfoObserver.Emit(&groups) - mainOutboundsInfoObserver.Emit(&groups) + if cch.command == libbox.CommandGroupInfoOnly { + mainOutboundsInfoObserver.Emit(&groups) + } else { + outboundsInfoObserver.Emit(&groups) + } } func (cch *CommandClientHandler) InitializeClashMode(modeList libbox.StringIterator, currentMode string) { diff --git a/v2/hcore/commands.go b/v2/hcore/commands.go index 8bc0197e..c535ea4d 100644 --- a/v2/hcore/commands.go +++ b/v2/hcore/commands.go @@ -2,9 +2,16 @@ package hcore import ( "context" + "time" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" + adapter "github.com/sagernet/sing-box/adapter" + "github.com/sagernet/sing-box/common/urltest" "github.com/sagernet/sing-box/experimental/libbox" + outbound "github.com/sagernet/sing-box/outbound" + common "github.com/sagernet/sing/common" + "github.com/sagernet/sing/common/batch" + E "github.com/sagernet/sing/common/exceptions" "google.golang.org/grpc" ) @@ -20,11 +27,11 @@ var ( groupInfoOnlyClient *libbox.CommandClient ) -func (s *CoreService) GetSystemInfo(req *common.Empty, stream grpc.ServerStreamingServer[SystemInfo]) error { +func (s *CoreService) GetSystemInfo(req *hcommon.Empty, stream grpc.ServerStreamingServer[SystemInfo]) error { if statusClient == nil { statusClient = libbox.NewCommandClient( &CommandClientHandler{ - + command: libbox.CommandStatus, // port: s.port, }, &libbox.CommandClientOptions{ @@ -55,109 +62,199 @@ func (s *CoreService) GetSystemInfo(req *common.Empty, stream grpc.ServerStreami } } -func (s *CoreService) OutboundsInfo(req *common.Empty, stream grpc.ServerStreamingServer[OutboundGroupList]) error { - if groupClient == nil { - groupClient = libbox.NewCommandClient( - &CommandClientHandler{ - // port: s.port, - }, - &libbox.CommandClientOptions{ - Command: libbox.CommandGroup, - StatusInterval: 500000000, // 500ms debounce - }, - ) +// func (s *CoreService) OutboundsInfo(req *hcommon.Empty, stream grpc.ServerStreamingServer[OutboundGroupList]) error { +// if groupClient == nil { +// groupClient = libbox.NewCommandClient( +// &CommandClientHandler{ +// command: libbox.CommandGroup, +// // port: s.port, +// }, +// &libbox.CommandClientOptions{ +// Command: libbox.CommandGroup, +// StatusInterval: 500000000, // 500ms debounce +// }, +// ) - defer func() { - groupClient.Disconnect() - groupClient = nil - }() +// defer func() { +// groupClient.Disconnect() +// groupClient = nil +// }() - groupClient.Connect() - } +// groupClient.Connect() +// } - sub, done, _ := outboundsInfoObserver.Subscribe() +// sub, done, _ := outboundsInfoObserver.Subscribe() - for { - select { - case <-stream.Context().Done(): - return nil - case <-done: - return nil - case info := <-sub: - stream.Send(info) - // case <-time.After(500 * time.Millisecond): - } - } -} +// for { +// select { +// case <-stream.Context().Done(): +// return nil +// case <-done: +// return nil +// case info := <-sub: +// stream.Send(info) +// // case <-time.After(500 * time.Millisecond): +// } +// } +// } -func (s *CoreService) MainOutboundsInfo(req *common.Empty, stream grpc.ServerStreamingServer[OutboundGroupList]) error { - if groupInfoOnlyClient == nil { - groupInfoOnlyClient = libbox.NewCommandClient( - &CommandClientHandler{ - // port: s.port, - }, - &libbox.CommandClientOptions{ - Command: libbox.CommandGroupInfoOnly, - StatusInterval: 500000000, // 500ms debounce - }, - ) +// func (s *CoreService) MainOutboundsInfo(req *hcommon.Empty, stream grpc.ServerStreamingServer[OutboundGroupList]) error { +// if groupInfoOnlyClient == nil { +// groupInfoOnlyClient = libbox.NewCommandClient( +// &CommandClientHandler{ +// command: libbox.CommandGroupInfoOnly, +// // port: s.port, +// }, +// &libbox.CommandClientOptions{ +// Command: libbox.CommandGroupInfoOnly, +// StatusInterval: 500000000, // 500ms debounce +// }, +// ) - defer func() { - groupInfoOnlyClient.Disconnect() - groupInfoOnlyClient = nil - }() - groupInfoOnlyClient.Connect() - } +// defer func() { +// groupInfoOnlyClient.Disconnect() +// groupInfoOnlyClient = nil +// }() +// groupInfoOnlyClient.Connect() +// } - sub, stopch, _ := mainOutboundsInfoObserver.Subscribe() +// sub, stopch, _ := mainOutboundsInfoObserver.Subscribe() - for { - select { - case <-stream.Context().Done(): - return nil - case <-stopch: - return nil - case info := <-sub: - stream.Send(info) - // case <-time.After(500 * time.Millisecond): - } - } -} +// for { +// select { +// case <-stream.Context().Done(): +// return nil +// case <-stopch: +// return nil +// case info := <-sub: +// stream.Send(info) +// // case <-time.After(500 * time.Millisecond): +// } +// } +// } -func (s *CoreService) SelectOutbound(ctx context.Context, in *SelectOutboundRequest) (*common.Response, error) { +func (s *CoreService) SelectOutbound(ctx context.Context, in *SelectOutboundRequest) (*hcommon.Response, error) { return SelectOutbound(in) } -func SelectOutbound(in *SelectOutboundRequest) (*common.Response, error) { - err := libbox.NewStandaloneCommandClient().SelectOutbound(in.GroupTag, in.OutboundTag) - if err != nil { - return &common.Response{ - Code: common.ResponseCode_FAILED, - Message: err.Error(), - }, err +func SelectOutbound(in *SelectOutboundRequest) (*hcommon.Response, error) { + // err := libbox.NewStandaloneCommandClient().SelectOutbound(in.GroupTag, in.OutboundTag) + // if err != nil { + // return &hcommon.Response{ + // Code: hcommon.ResponseCode_FAILED, + // Message: err.Error(), + // }, err + // } + + // return &hcommon.Response{ + // Code: hcommon.ResponseCode_OK, + // Message: "", + // }, nil + Log(LogLevel_DEBUG, LogType_CORE, "select outbound: ", in.GroupTag, " -> ", in.OutboundTag) + outboundGroup, isLoaded := Box.GetInstance().Router().Outbound(in.GroupTag) + if !isLoaded { + return &hcommon.Response{ + Code: hcommon.ResponseCode_FAILED, + Message: E.New("selector not found: ", in.GroupTag).Error(), + }, E.New("selector not found: ", in.GroupTag) + } + selector, isSelector := outboundGroup.(*outbound.Selector) + if !isSelector { + return &hcommon.Response{ + Code: hcommon.ResponseCode_FAILED, + Message: E.New("outbound is not a selector: ", in.GroupTag).Error(), + }, E.New("outbound is not a selector: ", in.GroupTag) + } + if !selector.SelectOutbound(in.OutboundTag) { + return &hcommon.Response{ + Code: hcommon.ResponseCode_FAILED, + Message: E.New("outbound not found in selector:: ", in.GroupTag).Error(), + }, E.New("outbound not found in selector: ", in.GroupTag) } - return &common.Response{ - Code: common.ResponseCode_OK, + Box.UrlTestHistory().Observer().Emit(2) + return &hcommon.Response{ + Code: hcommon.ResponseCode_OK, Message: "", }, nil } -func (s *CoreService) UrlTest(ctx context.Context, in *UrlTestRequest) (*common.Response, error) { +func (s *CoreService) UrlTest(ctx context.Context, in *UrlTestRequest) (*hcommon.Response, error) { return UrlTest(in) } -func UrlTest(in *UrlTestRequest) (*common.Response, error) { - err := libbox.NewStandaloneCommandClient().URLTest(in.GroupTag) - if err != nil { - return &common.Response{ - Code: common.ResponseCode_FAILED, - Message: err.Error(), - }, err +func UrlTest(in *UrlTestRequest) (*hcommon.Response, error) { + // err := libbox.NewStandaloneCommandClient().URLTest(in.GroupTag) + // if err != nil { + // return &hcommon.Response{ + // Code: hcommon.ResponseCode_FAILED, + // Message: err.Error(), + // }, err + // } + + // return &hcommon.Response{ + // Code: hcommon.ResponseCode_OK, + // Message: "", + // }, nil + + groupTag := in.GroupTag + + if Box == nil { + return nil, E.New("service not ready") + } + abstractOutboundGroup, isLoaded := Box.GetInstance().Router().Outbound(groupTag) + if !isLoaded { + return &hcommon.Response{ + Code: hcommon.ResponseCode_FAILED, + Message: E.New("outbound group not found: ", in.GroupTag).Error(), + }, E.New("outbound group not found: ", groupTag) + } + outboundGroup, isOutboundGroup := abstractOutboundGroup.(adapter.OutboundGroup) + if !isOutboundGroup { + return &hcommon.Response{ + Code: hcommon.ResponseCode_FAILED, + Message: E.New("outbound is not a group: ", in.GroupTag).Error(), + }, E.New("outbound is not a group: ", groupTag) + } + + urlTest, isURLTest := abstractOutboundGroup.(*outbound.URLTest) + if isURLTest { + go urlTest.CheckOutbounds() + } else { + historyStorage := Box.UrlTestHistory() + outbounds := common.Filter(common.Map(outboundGroup.All(), func(it string) adapter.Outbound { + itOutbound, _ := Box.GetInstance().Router().Outbound(it) + return itOutbound + }), func(it adapter.Outbound) bool { + if it == nil { + return false + } + _, isGroup := it.(adapter.OutboundGroup) + return !isGroup + }) + b, _ := batch.New(Box.Context(), batch.WithConcurrencyNum[any](10)) + for _, detour := range outbounds { + outboundToTest := detour + outboundTag := outboundToTest.Tag() + b.Go(outboundTag, func() (any, error) { + t, err := urltest.URLTest(Box.Context(), "", outboundToTest) + if err != nil { + // historyStorage.DeleteURLTestHistory(outboundTag) + t = 65535 + } else { + } + historyStorage.StoreURLTestHistory(outboundTag, &urltest.History{ + Time: time.Now(), + Delay: t, + }) + + return nil, nil + }) + } } - return &common.Response{ - Code: common.ResponseCode_OK, + return &hcommon.Response{ + Code: hcommon.ResponseCode_OK, Message: "", }, nil } diff --git a/v2/hcore/config.go b/v2/hcore/config.go index 58c96879..75a87b51 100644 --- a/v2/hcore/config.go +++ b/v2/hcore/config.go @@ -6,9 +6,9 @@ import ( "os" "path/filepath" - common "github.com/hiddify/hiddify-core/v2/common" "github.com/hiddify/hiddify-core/v2/config" "github.com/hiddify/hiddify-core/v2/db" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" hutils "github.com/hiddify/hiddify-core/v2/hutils" C "github.com/sagernet/sing-box/constant" "github.com/sagernet/sing-box/option" @@ -81,7 +81,7 @@ func Parse(in *ParseRequest) (*ParseResponse, error) { config, err := config.ParseConfigContent(content, true, HiddifyOptions, false) if err != nil { return &ParseResponse{ - ResponseCode: common.ResponseCode_FAILED, + ResponseCode: hcommon.ResponseCode_FAILED, Message: err.Error(), }, err } @@ -89,13 +89,13 @@ func Parse(in *ParseRequest) (*ParseResponse, error) { err = os.WriteFile(in.ConfigPath, config, 0o644) if err != nil { return &ParseResponse{ - ResponseCode: common.ResponseCode_FAILED, + ResponseCode: hcommon.ResponseCode_FAILED, Message: err.Error(), }, err } } return &ParseResponse{ - ResponseCode: common.ResponseCode_OK, + ResponseCode: hcommon.ResponseCode_OK, Content: string(config), Message: "", }, err @@ -110,8 +110,8 @@ func ChangeHiddifySettings(in *ChangeHiddifySettingsRequest) (*CoreInfoResponse, if in.HiddifySettingsJson == "" { return &CoreInfoResponse{}, nil } - settings := db.GetTable[common.AppSettings]() - settings.UpdateInsert(&common.AppSettings{ + settings := db.GetTable[hcommon.AppSettings]() + settings.UpdateInsert(&hcommon.AppSettings{ Id: "HiddifySettingsJson", Value: in.HiddifySettingsJson, }) diff --git a/v2/hcore/coreinfo.go b/v2/hcore/coreinfo.go index cb85f5e1..2509c645 100644 --- a/v2/hcore/coreinfo.go +++ b/v2/hcore/coreinfo.go @@ -3,7 +3,7 @@ package hcore import ( "fmt" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "google.golang.org/grpc" ) @@ -29,7 +29,7 @@ func SetCoreStatus(state CoreStates, msgType MessageType, message string) *CoreI return &info } -func (s *CoreService) CoreInfoListener(req *common.Empty, stream grpc.ServerStreamingServer[CoreInfoResponse]) error { +func (s *CoreService) CoreInfoListener(req *hcommon.Empty, stream grpc.ServerStreamingServer[CoreInfoResponse]) error { coreSub, done, err := coreInfoObserver.Subscribe() if err != nil { return err diff --git a/v2/hcore/custom.go b/v2/hcore/custom.go index 3278adec..6ffa943c 100644 --- a/v2/hcore/custom.go +++ b/v2/hcore/custom.go @@ -41,6 +41,6 @@ func Close(mode SetupMode) error { return err } -// func (s *CoreService) Status(ctx context.Context, empty *common.Empty) (*CoreInfoResponse, error) { +// func (s *CoreService) Status(ctx context.Context, empty *hcommon.Empty) (*CoreInfoResponse, error) { // return Status() // } diff --git a/v2/hcore/grpc_server.go b/v2/hcore/grpc_server.go index 5116f815..cb2c3803 100644 --- a/v2/hcore/grpc_server.go +++ b/v2/hcore/grpc_server.go @@ -12,13 +12,12 @@ import ( "log" "net" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "github.com/hiddify/hiddify-core/v2/hello" hutils "github.com/hiddify/hiddify-core/v2/hutils" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "github.com/hiddify/hiddify-core/v2/common" - "github.com/hiddify/hiddify-core/v2/db" ) @@ -74,7 +73,7 @@ func StartGrpcServerByMode(listenAddressG string, mode SetupMode) (*grpc.Server, Log(LogLevel_WARNING, LogType_CORE, "grpcServer already started") return grpcServer[mode], nil } - table := db.GetTable[common.AppSettings]() + table := db.GetTable[hcommon.AppSettings]() grpcServerPrivateKey, err := table.Get("grpc_server_private_key") grpcServerPublicKey, err2 := table.Get("grpc_server_public_key") if err != nil || err2 != nil { @@ -86,8 +85,8 @@ func StartGrpcServerByMode(listenAddressG string, mode SetupMode) (*grpc.Server, return nil, err } table.UpdateInsert( - &common.AppSettings{Id: "grpc_server_public_key", Value: certpair.Certificate}, - &common.AppSettings{Id: "grpc_server_private_key", Value: certpair.PrivateKey}, + &hcommon.AppSettings{Id: "grpc_server_public_key", Value: certpair.Certificate}, + &hcommon.AppSettings{Id: "grpc_server_private_key", Value: certpair.PrivateKey}, ) } else { certpair = &hutils.CertificatePair{ diff --git a/v2/hcore/hcore.pb.go b/v2/hcore/hcore.pb.go index e91e3f24..f18b994d 100644 --- a/v2/hcore/hcore.pb.go +++ b/v2/hcore/hcore.pb.go @@ -7,7 +7,7 @@ package hcore import ( - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -587,19 +587,19 @@ func (x *SystemInfo) GetDownlinkTotal() int64 { return 0 } -type OutboundGroupItem struct { +type OutboundInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - UrlTestTime int64 `protobuf:"varint,3,opt,name=url_test_time,json=urlTestTime,proto3" json:"url_test_time,omitempty"` - UrlTestDelay int32 `protobuf:"varint,4,opt,name=url_test_delay,json=urlTestDelay,proto3" json:"url_test_delay,omitempty"` + Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + UrlTestTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=url_test_time,json=urlTestTime,proto3" json:"url_test_time,omitempty"` + UrlTestDelay int32 `protobuf:"varint,4,opt,name=url_test_delay,json=urlTestDelay,proto3" json:"url_test_delay,omitempty"` } -func (x *OutboundGroupItem) Reset() { - *x = OutboundGroupItem{} +func (x *OutboundInfo) Reset() { + *x = OutboundInfo{} if protoimpl.UnsafeEnabled { mi := &file_v2_hcore_hcore_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -607,13 +607,13 @@ func (x *OutboundGroupItem) Reset() { } } -func (x *OutboundGroupItem) String() string { +func (x *OutboundInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*OutboundGroupItem) ProtoMessage() {} +func (*OutboundInfo) ProtoMessage() {} -func (x *OutboundGroupItem) ProtoReflect() protoreflect.Message { +func (x *OutboundInfo) ProtoReflect() protoreflect.Message { mi := &file_v2_hcore_hcore_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -625,33 +625,33 @@ func (x *OutboundGroupItem) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use OutboundGroupItem.ProtoReflect.Descriptor instead. -func (*OutboundGroupItem) Descriptor() ([]byte, []int) { +// Deprecated: Use OutboundInfo.ProtoReflect.Descriptor instead. +func (*OutboundInfo) Descriptor() ([]byte, []int) { return file_v2_hcore_hcore_proto_rawDescGZIP(), []int{4} } -func (x *OutboundGroupItem) GetTag() string { +func (x *OutboundInfo) GetTag() string { if x != nil { return x.Tag } return "" } -func (x *OutboundGroupItem) GetType() string { +func (x *OutboundInfo) GetType() string { if x != nil { return x.Type } return "" } -func (x *OutboundGroupItem) GetUrlTestTime() int64 { +func (x *OutboundInfo) GetUrlTestTime() *timestamppb.Timestamp { if x != nil { return x.UrlTestTime } - return 0 + return nil } -func (x *OutboundGroupItem) GetUrlTestDelay() int32 { +func (x *OutboundInfo) GetUrlTestDelay() int32 { if x != nil { return x.UrlTestDelay } @@ -663,10 +663,12 @@ type OutboundGroup struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Selected string `protobuf:"bytes,3,opt,name=selected,proto3" json:"selected,omitempty"` - Items []*OutboundGroupItem `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` + Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Selected string `protobuf:"bytes,3,opt,name=selected,proto3" json:"selected,omitempty"` + Selectable bool `protobuf:"varint,4,opt,name=selectable,proto3" json:"selectable,omitempty"` + IsExpand bool `protobuf:"varint,5,opt,name=Is_expand,json=IsExpand,proto3" json:"Is_expand,omitempty"` + Items []*OutboundInfo `protobuf:"bytes,6,rep,name=items,proto3" json:"items,omitempty"` } func (x *OutboundGroup) Reset() { @@ -722,7 +724,21 @@ func (x *OutboundGroup) GetSelected() string { return "" } -func (x *OutboundGroup) GetItems() []*OutboundGroupItem { +func (x *OutboundGroup) GetSelectable() bool { + if x != nil { + return x.Selectable + } + return false +} + +func (x *OutboundGroup) GetIsExpand() bool { + if x != nil { + return x.IsExpand + } + return false +} + +func (x *OutboundGroup) GetItems() []*OutboundInfo { if x != nil { return x.Items } @@ -1104,9 +1120,9 @@ type ParseResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ResponseCode common.ResponseCode `protobuf:"varint,1,opt,name=response_code,json=responseCode,proto3,enum=common.ResponseCode" json:"response_code,omitempty"` - Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + ResponseCode hcommon.ResponseCode `protobuf:"varint,1,opt,name=response_code,json=responseCode,proto3,enum=hcommon.ResponseCode" json:"response_code,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` } func (x *ParseResponse) Reset() { @@ -1141,11 +1157,11 @@ func (*ParseResponse) Descriptor() ([]byte, []int) { return file_v2_hcore_hcore_proto_rawDescGZIP(), []int{12} } -func (x *ParseResponse) GetResponseCode() common.ResponseCode { +func (x *ParseResponse) GetResponseCode() hcommon.ResponseCode { if x != nil { return x.ResponseCode } - return common.ResponseCode(0) + return hcommon.ResponseCode(0) } func (x *ParseResponse) GetContent() string { @@ -1644,81 +1660,86 @@ var File_v2_hcore_hcore_proto protoreflect.FileDescriptor var file_v2_hcore_hcore_proto_rawDesc = []byte{ 0x0a, 0x14, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x16, 0x76, - 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x72, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0a, 0x63, - 0x6f, 0x72, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x73, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, - 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x90, - 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, - 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x64, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x39, 0x0a, 0x19, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6c, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x72, 0x61, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x22, 0x6b, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x73, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x21, - 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x50, 0x61, 0x74, 0x68, 0x22, 0xbf, - 0x02, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, - 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x72, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x6f, 0x72, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x6e, 0x12, 0x27, 0x0a, 0x0f, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6f, 0x75, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, - 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f, - 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x6f, - 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, - 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x75, 0x70, - 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x6f, 0x77, - 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, - 0x22, 0x83, 0x01, 0x0a, 0x11, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, - 0x75, 0x72, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0b, 0x75, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x72, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x75, 0x72, 0x6c, 0x54, 0x65, 0x73, - 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x4f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x3f, 0x0a, 0x11, 0x4f, 0x75, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x17, 0x76, + 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x72, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0a, + 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x73, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x35, + 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, + 0x90, 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, + 0x6c, 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x39, 0x0a, 0x19, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6c, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x22, 0x6b, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x73, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, + 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x50, 0x61, 0x74, 0x68, 0x22, + 0xbf, 0x02, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x72, 0x6f, 0x75, 0x74, + 0x69, 0x6e, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x6f, 0x72, 0x6f, + 0x75, 0x74, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x6e, 0x12, 0x27, 0x0a, + 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6f, 0x75, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x63, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x10, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x64, + 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, + 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x69, 0x6e, + 0x6b, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x75, + 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x6f, + 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x75, 0x72, 0x6c, 0x5f, + 0x74, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x75, 0x72, 0x6c, + 0x54, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x72, 0x6c, 0x5f, + 0x74, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x75, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0xb9, + 0x01, 0x0a, 0x0d, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, + 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x49, 0x73, 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x12, + 0x29, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x3f, 0x0a, 0x11, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, @@ -1763,99 +1784,99 @@ var file_v2_hcore_hcore_proto_rawDesc = []byte{ 0x67, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x50, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x7e, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0d, 0x72, 0x65, 0x73, + 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x7f, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x52, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x68, 0x69, 0x64, 0x64, - 0x69, 0x66, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x6a, 0x73, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0x5e, 0x0a, 0x15, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6d, - 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, - 0x6d, 0x70, 0x50, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x3f, 0x0a, 0x16, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x57, 0x0a, - 0x15, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, - 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x54, 0x61, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, - 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x22, 0x2d, 0x0a, 0x0e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x54, 0x61, 0x67, 0x22, 0x7e, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, - 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3d, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x22, 0xa1, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2a, 0x42, 0x0a, 0x0a, 0x43, 0x6f, 0x72, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, - 0x08, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x2a, 0xe2, 0x02, 0x0a, 0x0b, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, - 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, - 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, - 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, - 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x11, 0x0a, - 0x0d, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x04, - 0x12, 0x14, 0x0a, 0x10, 0x55, 0x4e, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x45, 0x44, 0x5f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, - 0x59, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x41, - 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x07, - 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x54, - 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, 0x54, - 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, - 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, - 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12, 0x19, 0x0a, 0x15, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x43, - 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0b, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x5f, 0x50, 0x41, 0x52, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, - 0x0c, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x49, - 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0d, 0x12, 0x13, 0x0a, 0x0f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x0e, - 0x2a, 0x42, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, - 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, - 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x09, - 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, 0x54, - 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x2c, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, - 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, - 0x10, 0x02, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x32, 0x15, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x52, 0x0a, 0x1c, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x68, 0x69, 0x64, + 0x64, 0x69, 0x66, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x6a, 0x73, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, + 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0x5e, 0x0a, + 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, + 0x6d, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x65, 0x6d, 0x70, 0x50, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x3f, 0x0a, + 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x57, + 0x0a, 0x15, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x54, 0x61, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x5f, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, + 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x22, 0x2d, 0x0a, 0x0e, 0x55, 0x72, 0x6c, 0x54, 0x65, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x54, 0x61, 0x67, 0x22, 0x7e, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, + 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3d, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xa1, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x74, 0x6f, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2a, 0x42, 0x0a, 0x0a, 0x43, 0x6f, 0x72, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x2a, 0xe2, 0x02, 0x0a, + 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, + 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4d, 0x50, 0x54, 0x59, + 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, + 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, + 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x52, + 0x45, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x11, + 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, + 0x04, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x4e, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x45, 0x44, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x4c, 0x52, 0x45, 0x41, + 0x44, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, + 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, + 0x07, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, + 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, + 0x44, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12, 0x19, 0x0a, + 0x15, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x49, 0x4e, 0x47, 0x5f, + 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0b, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, + 0x10, 0x0c, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0d, 0x12, 0x13, 0x0a, 0x0f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x10, + 0x0e, 0x2a, 0x42, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, + 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, + 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, + 0x54, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x2c, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49, + 0x47, 0x10, 0x02, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1881,7 +1902,7 @@ var file_v2_hcore_hcore_proto_goTypes = []any{ (*StartRequest)(nil), // 5: hcore.StartRequest (*SetupRequest)(nil), // 6: hcore.SetupRequest (*SystemInfo)(nil), // 7: hcore.SystemInfo - (*OutboundGroupItem)(nil), // 8: hcore.OutboundGroupItem + (*OutboundInfo)(nil), // 8: hcore.OutboundInfo (*OutboundGroup)(nil), // 9: hcore.OutboundGroup (*OutboundGroupList)(nil), // 10: hcore.OutboundGroupList (*WarpAccount)(nil), // 11: hcore.WarpAccount @@ -1899,25 +1920,26 @@ var file_v2_hcore_hcore_proto_goTypes = []any{ (*SetSystemProxyEnabledRequest)(nil), // 23: hcore.SetSystemProxyEnabledRequest (*LogMessage)(nil), // 24: hcore.LogMessage (*StopRequest)(nil), // 25: hcore.StopRequest - (common.ResponseCode)(0), // 26: common.ResponseCode - (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (hcommon.ResponseCode)(0), // 27: hcommon.ResponseCode } var file_v2_hcore_hcore_proto_depIdxs = []int32{ 0, // 0: hcore.CoreInfoResponse.core_state:type_name -> hcore.CoreStates 1, // 1: hcore.CoreInfoResponse.message_type:type_name -> hcore.MessageType - 8, // 2: hcore.OutboundGroup.items:type_name -> hcore.OutboundGroupItem - 9, // 3: hcore.OutboundGroupList.items:type_name -> hcore.OutboundGroup - 11, // 4: hcore.WarpGenerationResponse.account:type_name -> hcore.WarpAccount - 12, // 5: hcore.WarpGenerationResponse.config:type_name -> hcore.WarpWireguardConfig - 26, // 6: hcore.ParseResponse.response_code:type_name -> common.ResponseCode - 2, // 7: hcore.LogMessage.level:type_name -> hcore.LogLevel - 3, // 8: hcore.LogMessage.type:type_name -> hcore.LogType - 27, // 9: hcore.LogMessage.time:type_name -> google.protobuf.Timestamp - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 26, // 2: hcore.OutboundInfo.url_test_time:type_name -> google.protobuf.Timestamp + 8, // 3: hcore.OutboundGroup.items:type_name -> hcore.OutboundInfo + 9, // 4: hcore.OutboundGroupList.items:type_name -> hcore.OutboundGroup + 11, // 5: hcore.WarpGenerationResponse.account:type_name -> hcore.WarpAccount + 12, // 6: hcore.WarpGenerationResponse.config:type_name -> hcore.WarpWireguardConfig + 27, // 7: hcore.ParseResponse.response_code:type_name -> hcommon.ResponseCode + 2, // 8: hcore.LogMessage.level:type_name -> hcore.LogLevel + 3, // 9: hcore.LogMessage.type:type_name -> hcore.LogType + 26, // 10: hcore.LogMessage.time:type_name -> google.protobuf.Timestamp + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_v2_hcore_hcore_proto_init() } @@ -1975,7 +1997,7 @@ func file_v2_hcore_hcore_proto_init() { } } file_v2_hcore_hcore_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*OutboundGroupItem); i { + switch v := v.(*OutboundInfo); i { case 0: return &v.state case 1: diff --git a/v2/hcore/hcore.proto b/v2/hcore/hcore.proto index dbf8b86f..42d62268 100644 --- a/v2/hcore/hcore.proto +++ b/v2/hcore/hcore.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "v2/common/common.proto"; +import "v2/hcommon/common.proto"; import "google/protobuf/timestamp.proto"; package hcore; @@ -65,10 +65,10 @@ message SystemInfo { int64 downlink_total = 9; } -message OutboundGroupItem { +message OutboundInfo { string tag = 1; string type = 2; - int64 url_test_time = 3; + google.protobuf.Timestamp url_test_time = 3; int32 url_test_delay = 4; } @@ -76,7 +76,9 @@ message OutboundGroup { string tag = 1; string type = 2; string selected=3; - repeated OutboundGroupItem items = 4; + bool selectable=4; + bool Is_expand=5; + repeated OutboundInfo items = 6; } message OutboundGroupList{ @@ -115,7 +117,7 @@ message ParseRequest { } message ParseResponse { - common. ResponseCode response_code = 1; + hcommon.ResponseCode response_code = 1; string content = 2; string message = 3; } diff --git a/v2/hcore/hcore_service.pb.go b/v2/hcore/hcore_service.pb.go index c226ef05..1d4ba951 100644 --- a/v2/hcore/hcore_service.pb.go +++ b/v2/hcore/hcore_service.pb.go @@ -7,7 +7,7 @@ package hcore import ( - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -25,84 +25,85 @@ var File_v2_hcore_hcore_service_proto protoreflect.FileDescriptor var file_v2_hcore_hcore_service_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, - 0x68, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x16, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x76, - 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x32, 0x9f, 0x08, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x35, 0x0a, 0x05, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, + 0x68, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x17, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, + 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xaa, 0x08, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x35, 0x0a, + 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x10, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x30, 0x01, 0x12, 0x3b, 0x0a, 0x0d, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x30, 0x01, + 0x12, 0x3f, 0x0a, 0x11, 0x4d, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x30, + 0x01, 0x12, 0x34, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x30, 0x01, 0x12, 0x2f, 0x0a, 0x05, 0x53, 0x65, 0x74, 0x75, 0x70, + 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, + 0x65, 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, + 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x15, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x10, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x4c, - 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, - 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, - 0x01, 0x12, 0x3a, 0x0a, 0x0d, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x30, 0x01, 0x12, 0x3e, 0x0a, - 0x11, 0x4d, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x30, 0x01, 0x12, 0x33, 0x0a, - 0x0d, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0d, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x11, 0x2e, - 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, - 0x30, 0x01, 0x12, 0x2e, 0x0a, 0x05, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x13, 0x2e, 0x68, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12, 0x13, 0x2e, 0x68, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x14, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x23, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, - 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, - 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x13, 0x2e, + 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x53, - 0x74, 0x6f, 0x70, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x52, - 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, - 0x74, 0x12, 0x15, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x20, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x61, 0x72, 0x70, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3f, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x4e, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x2e, 0x68, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x31, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, - 0x72, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x30, 0x01, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, - 0x69, 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1c, 0x2e, + 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, + 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x68, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, + 0x0a, 0x07, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x68, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x57, + 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x68, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x61, 0x72, 0x70, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x14, 0x47, 0x65, + 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x15, + 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x2e, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, + 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x0b, 0x4c, 0x6f, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x68, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x68, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, + 0x01, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2d, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_v2_hcore_hcore_service_proto_goTypes = []any{ (*StartRequest)(nil), // 0: hcore.StartRequest - (*common.Empty)(nil), // 1: common.Empty + (*hcommon.Empty)(nil), // 1: hcommon.Empty (*SetupRequest)(nil), // 2: hcore.SetupRequest (*ParseRequest)(nil), // 3: hcore.ParseRequest (*ChangeHiddifySettingsRequest)(nil), // 4: hcore.ChangeHiddifySettingsRequest @@ -113,7 +114,7 @@ var file_v2_hcore_hcore_service_proto_goTypes = []any{ (*CoreInfoResponse)(nil), // 9: hcore.CoreInfoResponse (*OutboundGroupList)(nil), // 10: hcore.OutboundGroupList (*SystemInfo)(nil), // 11: hcore.SystemInfo - (*common.Response)(nil), // 12: common.Response + (*hcommon.Response)(nil), // 12: hcommon.Response (*ParseResponse)(nil), // 13: hcore.ParseResponse (*WarpGenerationResponse)(nil), // 14: hcore.WarpGenerationResponse (*SystemProxyStatus)(nil), // 15: hcore.SystemProxyStatus @@ -121,38 +122,38 @@ var file_v2_hcore_hcore_service_proto_goTypes = []any{ } var file_v2_hcore_hcore_service_proto_depIdxs = []int32{ 0, // 0: hcore.Core.Start:input_type -> hcore.StartRequest - 1, // 1: hcore.Core.CoreInfoListener:input_type -> common.Empty - 1, // 2: hcore.Core.OutboundsInfo:input_type -> common.Empty - 1, // 3: hcore.Core.MainOutboundsInfo:input_type -> common.Empty - 1, // 4: hcore.Core.GetSystemInfo:input_type -> common.Empty + 1, // 1: hcore.Core.CoreInfoListener:input_type -> hcommon.Empty + 1, // 2: hcore.Core.OutboundsInfo:input_type -> hcommon.Empty + 1, // 3: hcore.Core.MainOutboundsInfo:input_type -> hcommon.Empty + 1, // 4: hcore.Core.GetSystemInfo:input_type -> hcommon.Empty 2, // 5: hcore.Core.Setup:input_type -> hcore.SetupRequest 3, // 6: hcore.Core.Parse:input_type -> hcore.ParseRequest 4, // 7: hcore.Core.ChangeHiddifySettings:input_type -> hcore.ChangeHiddifySettingsRequest 0, // 8: hcore.Core.StartService:input_type -> hcore.StartRequest - 1, // 9: hcore.Core.Stop:input_type -> common.Empty + 1, // 9: hcore.Core.Stop:input_type -> hcommon.Empty 0, // 10: hcore.Core.Restart:input_type -> hcore.StartRequest 5, // 11: hcore.Core.SelectOutbound:input_type -> hcore.SelectOutboundRequest 6, // 12: hcore.Core.UrlTest:input_type -> hcore.UrlTestRequest 7, // 13: hcore.Core.GenerateWarpConfig:input_type -> hcore.GenerateWarpConfigRequest - 1, // 14: hcore.Core.GetSystemProxyStatus:input_type -> common.Empty + 1, // 14: hcore.Core.GetSystemProxyStatus:input_type -> hcommon.Empty 8, // 15: hcore.Core.SetSystemProxyEnabled:input_type -> hcore.SetSystemProxyEnabledRequest - 1, // 16: hcore.Core.LogListener:input_type -> common.Empty + 1, // 16: hcore.Core.LogListener:input_type -> hcommon.Empty 9, // 17: hcore.Core.Start:output_type -> hcore.CoreInfoResponse 9, // 18: hcore.Core.CoreInfoListener:output_type -> hcore.CoreInfoResponse 10, // 19: hcore.Core.OutboundsInfo:output_type -> hcore.OutboundGroupList 10, // 20: hcore.Core.MainOutboundsInfo:output_type -> hcore.OutboundGroupList 11, // 21: hcore.Core.GetSystemInfo:output_type -> hcore.SystemInfo - 12, // 22: hcore.Core.Setup:output_type -> common.Response + 12, // 22: hcore.Core.Setup:output_type -> hcommon.Response 13, // 23: hcore.Core.Parse:output_type -> hcore.ParseResponse 9, // 24: hcore.Core.ChangeHiddifySettings:output_type -> hcore.CoreInfoResponse 9, // 25: hcore.Core.StartService:output_type -> hcore.CoreInfoResponse 9, // 26: hcore.Core.Stop:output_type -> hcore.CoreInfoResponse 9, // 27: hcore.Core.Restart:output_type -> hcore.CoreInfoResponse - 12, // 28: hcore.Core.SelectOutbound:output_type -> common.Response - 12, // 29: hcore.Core.UrlTest:output_type -> common.Response + 12, // 28: hcore.Core.SelectOutbound:output_type -> hcommon.Response + 12, // 29: hcore.Core.UrlTest:output_type -> hcommon.Response 14, // 30: hcore.Core.GenerateWarpConfig:output_type -> hcore.WarpGenerationResponse 15, // 31: hcore.Core.GetSystemProxyStatus:output_type -> hcore.SystemProxyStatus - 12, // 32: hcore.Core.SetSystemProxyEnabled:output_type -> common.Response + 12, // 32: hcore.Core.SetSystemProxyEnabled:output_type -> hcommon.Response 16, // 33: hcore.Core.LogListener:output_type -> hcore.LogMessage 17, // [17:34] is the sub-list for method output_type 0, // [0:17] is the sub-list for method input_type diff --git a/v2/hcore/hcore_service.proto b/v2/hcore/hcore_service.proto index c4ad2b47..df09e132 100644 --- a/v2/hcore/hcore_service.proto +++ b/v2/hcore/hcore_service.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "v2/common/common.proto"; +import "v2/hcommon/common.proto"; package hcore; option go_package = "github.com/hiddify/hiddify-core/v2/hcore"; @@ -7,23 +7,23 @@ import "v2/hcore/hcore.proto"; service Core { rpc Start (StartRequest) returns (CoreInfoResponse); - rpc CoreInfoListener (common.Empty) returns (stream CoreInfoResponse); - rpc OutboundsInfo (common.Empty) returns (stream OutboundGroupList); - rpc MainOutboundsInfo (common.Empty) returns (stream OutboundGroupList); - rpc GetSystemInfo (common.Empty) returns (stream SystemInfo); - rpc Setup (SetupRequest) returns (common.Response); + rpc CoreInfoListener (hcommon.Empty) returns (stream CoreInfoResponse); + rpc OutboundsInfo (hcommon.Empty) returns (stream OutboundGroupList); + rpc MainOutboundsInfo (hcommon.Empty) returns (stream OutboundGroupList); + rpc GetSystemInfo (hcommon.Empty) returns (stream SystemInfo); + rpc Setup (SetupRequest) returns (hcommon.Response); rpc Parse (ParseRequest) returns (ParseResponse); rpc ChangeHiddifySettings (ChangeHiddifySettingsRequest) returns (CoreInfoResponse); //rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse); rpc StartService (StartRequest) returns (CoreInfoResponse); - rpc Stop (common.Empty) returns (CoreInfoResponse); + rpc Stop (hcommon.Empty) returns (CoreInfoResponse); rpc Restart (StartRequest) returns (CoreInfoResponse); - rpc SelectOutbound (SelectOutboundRequest) returns (common.Response); - rpc UrlTest (UrlTestRequest) returns (common.Response); + rpc SelectOutbound (SelectOutboundRequest) returns (hcommon.Response); + rpc UrlTest (UrlTestRequest) returns (hcommon.Response); rpc GenerateWarpConfig (GenerateWarpConfigRequest) returns (WarpGenerationResponse); - rpc GetSystemProxyStatus (common.Empty) returns (SystemProxyStatus); - rpc SetSystemProxyEnabled (SetSystemProxyEnabledRequest) returns (common.Response); - rpc LogListener (common.Empty) returns (stream LogMessage); + rpc GetSystemProxyStatus (hcommon.Empty) returns (SystemProxyStatus); + rpc SetSystemProxyEnabled (SetSystemProxyEnabledRequest) returns (hcommon.Response); + rpc LogListener (hcommon.Empty) returns (stream LogMessage); } diff --git a/v2/hcore/hcore_service_grpc.pb.go b/v2/hcore/hcore_service_grpc.pb.go index 9357477f..5dc0a4d7 100644 --- a/v2/hcore/hcore_service_grpc.pb.go +++ b/v2/hcore/hcore_service_grpc.pb.go @@ -8,7 +8,7 @@ package hcore import ( context "context" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -44,23 +44,23 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type CoreClient interface { Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) - CoreInfoListener(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CoreInfoResponse], error) - OutboundsInfo(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) - MainOutboundsInfo(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) - GetSystemInfo(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SystemInfo], error) - Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*common.Response, error) + CoreInfoListener(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CoreInfoResponse], error) + OutboundsInfo(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) + MainOutboundsInfo(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) + GetSystemInfo(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SystemInfo], error) + Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*hcommon.Response, error) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error) ChangeHiddifySettings(ctx context.Context, in *ChangeHiddifySettingsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) // rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse); StartService(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) - Stop(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error) + Stop(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error) Restart(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) - SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*common.Response, error) - UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*common.Response, error) + SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*hcommon.Response, error) + UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*hcommon.Response, error) GenerateWarpConfig(ctx context.Context, in *GenerateWarpConfigRequest, opts ...grpc.CallOption) (*WarpGenerationResponse, error) - GetSystemProxyStatus(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error) - SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*common.Response, error) - LogListener(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LogMessage], error) + GetSystemProxyStatus(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error) + SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*hcommon.Response, error) + LogListener(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LogMessage], error) } type coreClient struct { @@ -81,13 +81,13 @@ func (c *coreClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.C return out, nil } -func (c *coreClient) CoreInfoListener(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CoreInfoResponse], error) { +func (c *coreClient) CoreInfoListener(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CoreInfoResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[0], Core_CoreInfoListener_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[common.Empty, CoreInfoResponse]{ClientStream: stream} + x := &grpc.GenericClientStream[hcommon.Empty, CoreInfoResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -100,13 +100,13 @@ func (c *coreClient) CoreInfoListener(ctx context.Context, in *common.Empty, opt // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_CoreInfoListenerClient = grpc.ServerStreamingClient[CoreInfoResponse] -func (c *coreClient) OutboundsInfo(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) { +func (c *coreClient) OutboundsInfo(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[1], Core_OutboundsInfo_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[common.Empty, OutboundGroupList]{ClientStream: stream} + x := &grpc.GenericClientStream[hcommon.Empty, OutboundGroupList]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -119,13 +119,13 @@ func (c *coreClient) OutboundsInfo(ctx context.Context, in *common.Empty, opts . // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_OutboundsInfoClient = grpc.ServerStreamingClient[OutboundGroupList] -func (c *coreClient) MainOutboundsInfo(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) { +func (c *coreClient) MainOutboundsInfo(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[2], Core_MainOutboundsInfo_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[common.Empty, OutboundGroupList]{ClientStream: stream} + x := &grpc.GenericClientStream[hcommon.Empty, OutboundGroupList]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -138,13 +138,13 @@ func (c *coreClient) MainOutboundsInfo(ctx context.Context, in *common.Empty, op // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_MainOutboundsInfoClient = grpc.ServerStreamingClient[OutboundGroupList] -func (c *coreClient) GetSystemInfo(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SystemInfo], error) { +func (c *coreClient) GetSystemInfo(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SystemInfo], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[3], Core_GetSystemInfo_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[common.Empty, SystemInfo]{ClientStream: stream} + x := &grpc.GenericClientStream[hcommon.Empty, SystemInfo]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -157,9 +157,9 @@ func (c *coreClient) GetSystemInfo(ctx context.Context, in *common.Empty, opts . // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_GetSystemInfoClient = grpc.ServerStreamingClient[SystemInfo] -func (c *coreClient) Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*common.Response, error) { +func (c *coreClient) Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*hcommon.Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(common.Response) + out := new(hcommon.Response) err := c.cc.Invoke(ctx, Core_Setup_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -197,7 +197,7 @@ func (c *coreClient) StartService(ctx context.Context, in *StartRequest, opts .. return out, nil } -func (c *coreClient) Stop(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error) { +func (c *coreClient) Stop(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CoreInfoResponse) err := c.cc.Invoke(ctx, Core_Stop_FullMethodName, in, out, cOpts...) @@ -217,9 +217,9 @@ func (c *coreClient) Restart(ctx context.Context, in *StartRequest, opts ...grpc return out, nil } -func (c *coreClient) SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*common.Response, error) { +func (c *coreClient) SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*hcommon.Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(common.Response) + out := new(hcommon.Response) err := c.cc.Invoke(ctx, Core_SelectOutbound_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -227,9 +227,9 @@ func (c *coreClient) SelectOutbound(ctx context.Context, in *SelectOutboundReque return out, nil } -func (c *coreClient) UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*common.Response, error) { +func (c *coreClient) UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*hcommon.Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(common.Response) + out := new(hcommon.Response) err := c.cc.Invoke(ctx, Core_UrlTest_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -247,7 +247,7 @@ func (c *coreClient) GenerateWarpConfig(ctx context.Context, in *GenerateWarpCon return out, nil } -func (c *coreClient) GetSystemProxyStatus(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error) { +func (c *coreClient) GetSystemProxyStatus(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SystemProxyStatus) err := c.cc.Invoke(ctx, Core_GetSystemProxyStatus_FullMethodName, in, out, cOpts...) @@ -257,9 +257,9 @@ func (c *coreClient) GetSystemProxyStatus(ctx context.Context, in *common.Empty, return out, nil } -func (c *coreClient) SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*common.Response, error) { +func (c *coreClient) SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*hcommon.Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(common.Response) + out := new(hcommon.Response) err := c.cc.Invoke(ctx, Core_SetSystemProxyEnabled_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -267,13 +267,13 @@ func (c *coreClient) SetSystemProxyEnabled(ctx context.Context, in *SetSystemPro return out, nil } -func (c *coreClient) LogListener(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LogMessage], error) { +func (c *coreClient) LogListener(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LogMessage], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[4], Core_LogListener_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[common.Empty, LogMessage]{ClientStream: stream} + x := &grpc.GenericClientStream[hcommon.Empty, LogMessage]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -291,23 +291,23 @@ type Core_LogListenerClient = grpc.ServerStreamingClient[LogMessage] // for forward compatibility. type CoreServer interface { Start(context.Context, *StartRequest) (*CoreInfoResponse, error) - CoreInfoListener(*common.Empty, grpc.ServerStreamingServer[CoreInfoResponse]) error - OutboundsInfo(*common.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error - MainOutboundsInfo(*common.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error - GetSystemInfo(*common.Empty, grpc.ServerStreamingServer[SystemInfo]) error - Setup(context.Context, *SetupRequest) (*common.Response, error) + CoreInfoListener(*hcommon.Empty, grpc.ServerStreamingServer[CoreInfoResponse]) error + OutboundsInfo(*hcommon.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error + MainOutboundsInfo(*hcommon.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error + GetSystemInfo(*hcommon.Empty, grpc.ServerStreamingServer[SystemInfo]) error + Setup(context.Context, *SetupRequest) (*hcommon.Response, error) Parse(context.Context, *ParseRequest) (*ParseResponse, error) ChangeHiddifySettings(context.Context, *ChangeHiddifySettingsRequest) (*CoreInfoResponse, error) // rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse); StartService(context.Context, *StartRequest) (*CoreInfoResponse, error) - Stop(context.Context, *common.Empty) (*CoreInfoResponse, error) + Stop(context.Context, *hcommon.Empty) (*CoreInfoResponse, error) Restart(context.Context, *StartRequest) (*CoreInfoResponse, error) - SelectOutbound(context.Context, *SelectOutboundRequest) (*common.Response, error) - UrlTest(context.Context, *UrlTestRequest) (*common.Response, error) + SelectOutbound(context.Context, *SelectOutboundRequest) (*hcommon.Response, error) + UrlTest(context.Context, *UrlTestRequest) (*hcommon.Response, error) GenerateWarpConfig(context.Context, *GenerateWarpConfigRequest) (*WarpGenerationResponse, error) - GetSystemProxyStatus(context.Context, *common.Empty) (*SystemProxyStatus, error) - SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*common.Response, error) - LogListener(*common.Empty, grpc.ServerStreamingServer[LogMessage]) error + GetSystemProxyStatus(context.Context, *hcommon.Empty) (*SystemProxyStatus, error) + SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*hcommon.Response, error) + LogListener(*hcommon.Empty, grpc.ServerStreamingServer[LogMessage]) error mustEmbedUnimplementedCoreServer() } @@ -321,19 +321,19 @@ type UnimplementedCoreServer struct{} func (UnimplementedCoreServer) Start(context.Context, *StartRequest) (*CoreInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } -func (UnimplementedCoreServer) CoreInfoListener(*common.Empty, grpc.ServerStreamingServer[CoreInfoResponse]) error { +func (UnimplementedCoreServer) CoreInfoListener(*hcommon.Empty, grpc.ServerStreamingServer[CoreInfoResponse]) error { return status.Errorf(codes.Unimplemented, "method CoreInfoListener not implemented") } -func (UnimplementedCoreServer) OutboundsInfo(*common.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error { +func (UnimplementedCoreServer) OutboundsInfo(*hcommon.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error { return status.Errorf(codes.Unimplemented, "method OutboundsInfo not implemented") } -func (UnimplementedCoreServer) MainOutboundsInfo(*common.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error { +func (UnimplementedCoreServer) MainOutboundsInfo(*hcommon.Empty, grpc.ServerStreamingServer[OutboundGroupList]) error { return status.Errorf(codes.Unimplemented, "method MainOutboundsInfo not implemented") } -func (UnimplementedCoreServer) GetSystemInfo(*common.Empty, grpc.ServerStreamingServer[SystemInfo]) error { +func (UnimplementedCoreServer) GetSystemInfo(*hcommon.Empty, grpc.ServerStreamingServer[SystemInfo]) error { return status.Errorf(codes.Unimplemented, "method GetSystemInfo not implemented") } -func (UnimplementedCoreServer) Setup(context.Context, *SetupRequest) (*common.Response, error) { +func (UnimplementedCoreServer) Setup(context.Context, *SetupRequest) (*hcommon.Response, error) { return nil, status.Errorf(codes.Unimplemented, "method Setup not implemented") } func (UnimplementedCoreServer) Parse(context.Context, *ParseRequest) (*ParseResponse, error) { @@ -345,28 +345,28 @@ func (UnimplementedCoreServer) ChangeHiddifySettings(context.Context, *ChangeHid func (UnimplementedCoreServer) StartService(context.Context, *StartRequest) (*CoreInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StartService not implemented") } -func (UnimplementedCoreServer) Stop(context.Context, *common.Empty) (*CoreInfoResponse, error) { +func (UnimplementedCoreServer) Stop(context.Context, *hcommon.Empty) (*CoreInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } func (UnimplementedCoreServer) Restart(context.Context, *StartRequest) (*CoreInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Restart not implemented") } -func (UnimplementedCoreServer) SelectOutbound(context.Context, *SelectOutboundRequest) (*common.Response, error) { +func (UnimplementedCoreServer) SelectOutbound(context.Context, *SelectOutboundRequest) (*hcommon.Response, error) { return nil, status.Errorf(codes.Unimplemented, "method SelectOutbound not implemented") } -func (UnimplementedCoreServer) UrlTest(context.Context, *UrlTestRequest) (*common.Response, error) { +func (UnimplementedCoreServer) UrlTest(context.Context, *UrlTestRequest) (*hcommon.Response, error) { return nil, status.Errorf(codes.Unimplemented, "method UrlTest not implemented") } func (UnimplementedCoreServer) GenerateWarpConfig(context.Context, *GenerateWarpConfigRequest) (*WarpGenerationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GenerateWarpConfig not implemented") } -func (UnimplementedCoreServer) GetSystemProxyStatus(context.Context, *common.Empty) (*SystemProxyStatus, error) { +func (UnimplementedCoreServer) GetSystemProxyStatus(context.Context, *hcommon.Empty) (*SystemProxyStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSystemProxyStatus not implemented") } -func (UnimplementedCoreServer) SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*common.Response, error) { +func (UnimplementedCoreServer) SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*hcommon.Response, error) { return nil, status.Errorf(codes.Unimplemented, "method SetSystemProxyEnabled not implemented") } -func (UnimplementedCoreServer) LogListener(*common.Empty, grpc.ServerStreamingServer[LogMessage]) error { +func (UnimplementedCoreServer) LogListener(*hcommon.Empty, grpc.ServerStreamingServer[LogMessage]) error { return status.Errorf(codes.Unimplemented, "method LogListener not implemented") } func (UnimplementedCoreServer) mustEmbedUnimplementedCoreServer() {} @@ -409,44 +409,44 @@ func _Core_Start_Handler(srv interface{}, ctx context.Context, dec func(interfac } func _Core_CoreInfoListener_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(common.Empty) + m := new(hcommon.Empty) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(CoreServer).CoreInfoListener(m, &grpc.GenericServerStream[common.Empty, CoreInfoResponse]{ServerStream: stream}) + return srv.(CoreServer).CoreInfoListener(m, &grpc.GenericServerStream[hcommon.Empty, CoreInfoResponse]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_CoreInfoListenerServer = grpc.ServerStreamingServer[CoreInfoResponse] func _Core_OutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(common.Empty) + m := new(hcommon.Empty) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(CoreServer).OutboundsInfo(m, &grpc.GenericServerStream[common.Empty, OutboundGroupList]{ServerStream: stream}) + return srv.(CoreServer).OutboundsInfo(m, &grpc.GenericServerStream[hcommon.Empty, OutboundGroupList]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_OutboundsInfoServer = grpc.ServerStreamingServer[OutboundGroupList] func _Core_MainOutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(common.Empty) + m := new(hcommon.Empty) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(CoreServer).MainOutboundsInfo(m, &grpc.GenericServerStream[common.Empty, OutboundGroupList]{ServerStream: stream}) + return srv.(CoreServer).MainOutboundsInfo(m, &grpc.GenericServerStream[hcommon.Empty, OutboundGroupList]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type Core_MainOutboundsInfoServer = grpc.ServerStreamingServer[OutboundGroupList] func _Core_GetSystemInfo_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(common.Empty) + m := new(hcommon.Empty) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(CoreServer).GetSystemInfo(m, &grpc.GenericServerStream[common.Empty, SystemInfo]{ServerStream: stream}) + return srv.(CoreServer).GetSystemInfo(m, &grpc.GenericServerStream[hcommon.Empty, SystemInfo]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. @@ -525,7 +525,7 @@ func _Core_StartService_Handler(srv interface{}, ctx context.Context, dec func(i } func _Core_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -537,7 +537,7 @@ func _Core_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface FullMethod: Core_Stop_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CoreServer).Stop(ctx, req.(*common.Empty)) + return srv.(CoreServer).Stop(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } @@ -615,7 +615,7 @@ func _Core_GenerateWarpConfig_Handler(srv interface{}, ctx context.Context, dec } func _Core_GetSystemProxyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -627,7 +627,7 @@ func _Core_GetSystemProxyStatus_Handler(srv interface{}, ctx context.Context, de FullMethod: Core_GetSystemProxyStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CoreServer).GetSystemProxyStatus(ctx, req.(*common.Empty)) + return srv.(CoreServer).GetSystemProxyStatus(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } @@ -651,11 +651,11 @@ func _Core_SetSystemProxyEnabled_Handler(srv interface{}, ctx context.Context, d } func _Core_LogListener_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(common.Empty) + m := new(hcommon.Empty) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(CoreServer).LogListener(m, &grpc.GenericServerStream[common.Empty, LogMessage]{ServerStream: stream}) + return srv.(CoreServer).LogListener(m, &grpc.GenericServerStream[hcommon.Empty, LogMessage]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. diff --git a/v2/hcore/logproto.go b/v2/hcore/logproto.go index e1553802..95249386 100644 --- a/v2/hcore/logproto.go +++ b/v2/hcore/logproto.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "github.com/sagernet/sing/common/observable" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/timestamppb" @@ -28,7 +28,7 @@ func Log(level LogLevel, typ LogType, message ...any) { }) } -func (s *CoreService) LogListener(req *common.Empty, stream grpc.ServerStreamingServer[LogMessage]) error { +func (s *CoreService) LogListener(req *hcommon.Empty, stream grpc.ServerStreamingServer[LogMessage]) error { logSub, stopch, _ := logObserver.Subscribe() defer logObserver.UnSubscribe(logSub) diff --git a/v2/hcore/proxy_info.go b/v2/hcore/proxy_info.go new file mode 100644 index 00000000..afa98936 --- /dev/null +++ b/v2/hcore/proxy_info.go @@ -0,0 +1,109 @@ +package hcore + +import ( + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" + "github.com/sagernet/sing-box/adapter" + "github.com/sagernet/sing-box/outbound" + "github.com/sagernet/sing/service" + "google.golang.org/grpc" + + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +func GetProxyInfo(detour adapter.Outbound) *OutboundInfo { + if Box == nil { + return nil + } + out := &OutboundInfo{ + Tag: detour.Tag(), + Type: detour.Type(), + } + url_test_history := Box.UrlTestHistory().LoadURLTestHistory(adapter.OutboundTag(detour)) + if url_test_history != nil { + out.UrlTestTime = timestamppb.New(url_test_history.Time) + out.UrlTestDelay = int32(url_test_history.Delay) + } + + return out +} + +func GetAllProxiesInfo(onlyGroupitems bool) *OutboundGroupList { + if Box == nil { + return nil + } + + cacheFile := service.FromContext[adapter.CacheFile](Box.Context()) + outbounds := Box.GetInstance().Router().Outbounds() + var iGroups []adapter.OutboundGroup + for _, it := range outbounds { + if group, isGroup := it.(adapter.OutboundGroup); isGroup { + iGroups = append(iGroups, group) + } + } + var groups OutboundGroupList + for _, iGroup := range iGroups { + var group OutboundGroup + group.Tag = iGroup.Tag() + group.Type = iGroup.Type() + _, group.Selectable = iGroup.(*outbound.Selector) + group.Selected = iGroup.Now() + if cacheFile != nil { + if isExpand, loaded := cacheFile.LoadGroupExpand(group.Tag); loaded { + group.IsExpand = isExpand + } + } + + for _, itemTag := range iGroup.All() { + itemOutbound, isLoaded := Box.GetInstance().Router().Outbound(itemTag) + if !isLoaded { + continue + } + if onlyGroupitems && itemTag != group.Selected { + continue + } + + group.Items = append(group.Items, GetProxyInfo(itemOutbound)) + } + if len(group.Items) == 0 { + continue + } + groups.Items = append(groups.Items, &group) + } + + return &groups +} + +func (s *CoreService) OutboundsInfo(req *hcommon.Empty, stream grpc.ServerStreamingServer[OutboundGroupList]) error { + return AllProxiesInfoStream(stream, false) +} + +func (s *CoreService) MainOutboundsInfo(req *hcommon.Empty, stream grpc.ServerStreamingServer[OutboundGroupList]) error { + return AllProxiesInfoStream(stream, true) +} + +func AllProxiesInfoStream(stream grpc.ServerStreamingServer[OutboundGroupList], onlyMain bool) error { + urltestch, done, err := Box.UrlTestHistory().Observer().Subscribe() + defer Box.UrlTestHistory().Observer().UnSubscribe(urltestch) + if err != nil { + return err + } + for { + select { + case <-stream.Context().Done(): + return nil + case <-done: + return nil + case <-urltestch: + debounce: + for { + select { + case <-urltestch: + default: + break debounce + } + } + stream.Send(GetAllProxiesInfo(onlyMain)) + // case <-time.After(500 * time.Millisecond): + } + } +} diff --git a/v2/hcore/service.go b/v2/hcore/service.go index d2c5333b..f70e8dcf 100644 --- a/v2/hcore/service.go +++ b/v2/hcore/service.go @@ -9,9 +9,9 @@ import ( runtimeDebug "runtime/debug" "time" - common "github.com/hiddify/hiddify-core/v2/common" "github.com/hiddify/hiddify-core/v2/config" "github.com/hiddify/hiddify-core/v2/db" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "github.com/hiddify/hiddify-core/v2/service_manager" B "github.com/sagernet/sing-box" @@ -103,7 +103,7 @@ func Setup(params SetupParameters) error { return err } } - settings := db.GetTable[common.AppSettings]() + settings := db.GetTable[hcommon.AppSettings]() val, err := settings.Get("HiddifySettingsJson") if val == nil || err != nil { _, err := ChangeHiddifySettings(&ChangeHiddifySettingsRequest{HiddifySettingsJson: ""}) diff --git a/v2/hcore/stop.go b/v2/hcore/stop.go index cafcb9fc..f4206d93 100644 --- a/v2/hcore/stop.go +++ b/v2/hcore/stop.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - common "github.com/hiddify/hiddify-core/v2/common" "github.com/hiddify/hiddify-core/v2/config" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" ) -func (s *CoreService) Stop(ctx context.Context, empty *common.Empty) (*CoreInfoResponse, error) { +func (s *CoreService) Stop(ctx context.Context, empty *hcommon.Empty) (*CoreInfoResponse, error) { return Stop() } diff --git a/v2/hcore/system_proxy.go b/v2/hcore/system_proxy.go index 588461a7..df8c8f51 100644 --- a/v2/hcore/system_proxy.go +++ b/v2/hcore/system_proxy.go @@ -3,15 +3,15 @@ package hcore import ( "context" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "github.com/sagernet/sing-box/experimental/libbox" ) -func (s *CoreService) GetSystemProxyStatus(ctx context.Context, empty *common.Empty) (*SystemProxyStatus, error) { +func (s *CoreService) GetSystemProxyStatus(ctx context.Context, empty *hcommon.Empty) (*SystemProxyStatus, error) { return GetSystemProxyStatus(ctx, empty) } -func GetSystemProxyStatus(ctx context.Context, empty *common.Empty) (*SystemProxyStatus, error) { +func GetSystemProxyStatus(ctx context.Context, empty *hcommon.Empty) (*SystemProxyStatus, error) { status, err := libbox.NewStandaloneCommandClient().GetSystemProxyStatus() if err != nil { return nil, err @@ -23,21 +23,21 @@ func GetSystemProxyStatus(ctx context.Context, empty *common.Empty) (*SystemProx }, nil } -func (s *CoreService) SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest) (*common.Response, error) { +func (s *CoreService) SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest) (*hcommon.Response, error) { return SetSystemProxyEnabled(ctx, in) } -func SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest) (*common.Response, error) { +func SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest) (*hcommon.Response, error) { err := libbox.NewStandaloneCommandClient().SetSystemProxyEnabled(in.IsEnabled) if err != nil { - return &common.Response{ - Code: common.ResponseCode_FAILED, + return &hcommon.Response{ + Code: hcommon.ResponseCode_FAILED, Message: err.Error(), }, err } - return &common.Response{ - Code: common.ResponseCode_OK, + return &hcommon.Response{ + Code: hcommon.ResponseCode_OK, Message: "", }, nil } diff --git a/v2/hcore/tunnelservice/admin_service_commander.go b/v2/hcore/tunnelservice/admin_service_commander.go index 3a65abfc..9cd3dfa0 100644 --- a/v2/hcore/tunnelservice/admin_service_commander.go +++ b/v2/hcore/tunnelservice/admin_service_commander.go @@ -9,7 +9,7 @@ import ( "runtime" "time" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" hutils "github.com/hiddify/hiddify-core/v2/hutils" grpc "google.golang.org/grpc" ) @@ -71,7 +71,7 @@ func startTunnelRequest(opt *TunnelStartRequest, installService bool) (bool, err c := NewTunnelServiceClient(conn) ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() - _, _ = c.Stop(ctx, &common.Empty{}) + _, _ = c.Stop(ctx, &hcommon.Empty{}) res, err := c.Start(ctx, opt) if err != nil { log.Printf("could not greet: %+v %+v", res, err) @@ -97,10 +97,10 @@ func stopTunnelRequest() error { ctx, cancel := context.WithTimeout(context.Background(), time.Second*20) defer cancel() - res, err := c.Stop(ctx, &common.Empty{}) + res, err := c.Stop(ctx, &hcommon.Empty{}) if err != nil { log.Printf("did not Stopped: %v %v", res, err) - _, _ = c.Stop(ctx, &common.Empty{}) + _, _ = c.Stop(ctx, &hcommon.Empty{}) return err } @@ -118,7 +118,7 @@ func ExitTunnelService() (bool, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*1) defer cancel() - res, err := c.Exit(ctx, &common.Empty{}) + res, err := c.Exit(ctx, &hcommon.Empty{}) if res != nil { log.Printf("did not exit: %v %v", res, err) return false, err diff --git a/v2/hcore/tunnelservice/tunnel_service.go b/v2/hcore/tunnelservice/tunnel_service.go index dbe9962e..b3d678e9 100644 --- a/v2/hcore/tunnelservice/tunnel_service.go +++ b/v2/hcore/tunnelservice/tunnel_service.go @@ -10,7 +10,7 @@ import ( "github.com/sagernet/sing-box/experimental/libbox" "github.com/sagernet/sing-box/option" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" "github.com/hiddify/hiddify-core/v2/hcore" ) @@ -103,7 +103,7 @@ func makeTunnelConfig(in *TunnelStartRequest) option.Options { } } -func (s *TunnelService) Stop(ctx context.Context, _ *common.Empty) (*TunnelResponse, error) { +func (s *TunnelService) Stop(ctx context.Context, _ *hcommon.Empty) (*TunnelResponse, error) { if s.box == nil { return &TunnelResponse{ Message: "Not Started", @@ -121,13 +121,13 @@ func (s *TunnelService) Stop(ctx context.Context, _ *common.Empty) (*TunnelRespo }, err } -func (s *TunnelService) Status(ctx context.Context, _ *common.Empty) (*TunnelResponse, error) { +func (s *TunnelService) Status(ctx context.Context, _ *hcommon.Empty) (*TunnelResponse, error) { return &TunnelResponse{ Message: "Not Implemented", }, nil } -func (s *TunnelService) Exit(ctx context.Context, _ *common.Empty) (*TunnelResponse, error) { +func (s *TunnelService) Exit(ctx context.Context, _ *hcommon.Empty) (*TunnelResponse, error) { if s.box != nil { s.box.Close() } diff --git a/v2/hcore/tunnelservice/tunnel_service.pb.go b/v2/hcore/tunnelservice/tunnel_service.pb.go index 1fe11bbd..8e3dabbc 100644 --- a/v2/hcore/tunnelservice/tunnel_service.pb.go +++ b/v2/hcore/tunnelservice/tunnel_service.pb.go @@ -7,7 +7,7 @@ package tunnelservice import ( - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -26,43 +26,43 @@ var file_v2_hcore_tunnelservice_tunnel_service_proto_rawDesc = []byte{ 0x0a, 0x2b, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x74, - 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x16, 0x76, 0x32, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, - 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x75, 0x6e, - 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xfe, 0x01, 0x0a, 0x0d, 0x54, 0x75, - 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x05, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x12, 0x21, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x0d, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, - 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, - 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x45, 0x78, 0x69, 0x74, 0x12, 0x0d, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x74, 0x75, - 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, - 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, - 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x17, 0x76, 0x32, + 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, + 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x81, 0x02, 0x0a, 0x0d, 0x54, + 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x05, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x21, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, + 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x1d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, + 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x45, 0x78, 0x69, 0x74, 0x12, + 0x0e, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x1d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, + 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, + 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, + 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_v2_hcore_tunnelservice_tunnel_service_proto_goTypes = []any{ (*TunnelStartRequest)(nil), // 0: tunnelservice.TunnelStartRequest - (*common.Empty)(nil), // 1: common.Empty + (*hcommon.Empty)(nil), // 1: hcommon.Empty (*TunnelResponse)(nil), // 2: tunnelservice.TunnelResponse } var file_v2_hcore_tunnelservice_tunnel_service_proto_depIdxs = []int32{ 0, // 0: tunnelservice.TunnelService.Start:input_type -> tunnelservice.TunnelStartRequest - 1, // 1: tunnelservice.TunnelService.Stop:input_type -> common.Empty - 1, // 2: tunnelservice.TunnelService.Status:input_type -> common.Empty - 1, // 3: tunnelservice.TunnelService.Exit:input_type -> common.Empty + 1, // 1: tunnelservice.TunnelService.Stop:input_type -> hcommon.Empty + 1, // 2: tunnelservice.TunnelService.Status:input_type -> hcommon.Empty + 1, // 3: tunnelservice.TunnelService.Exit:input_type -> hcommon.Empty 2, // 4: tunnelservice.TunnelService.Start:output_type -> tunnelservice.TunnelResponse 2, // 5: tunnelservice.TunnelService.Stop:output_type -> tunnelservice.TunnelResponse 2, // 6: tunnelservice.TunnelService.Status:output_type -> tunnelservice.TunnelResponse diff --git a/v2/hcore/tunnelservice/tunnel_service.proto b/v2/hcore/tunnelservice/tunnel_service.proto index 164a3287..390e7682 100644 --- a/v2/hcore/tunnelservice/tunnel_service.proto +++ b/v2/hcore/tunnelservice/tunnel_service.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "v2/common/common.proto"; +import "v2/hcommon/common.proto"; package tunnelservice; option go_package = "github.com/hiddify/hiddify-core/v2/hcore/tunnelservice"; @@ -7,7 +7,7 @@ import "v2/hcore/tunnelservice/tunnel.proto"; service TunnelService { rpc Start(TunnelStartRequest) returns (TunnelResponse); - rpc Stop(common.Empty) returns (TunnelResponse); - rpc Status(common.Empty) returns (TunnelResponse); - rpc Exit(common.Empty) returns (TunnelResponse); + rpc Stop(hcommon.Empty) returns (TunnelResponse); + rpc Status(hcommon.Empty) returns (TunnelResponse); + rpc Exit(hcommon.Empty) returns (TunnelResponse); } \ No newline at end of file diff --git a/v2/hcore/tunnelservice/tunnel_service_grpc.pb.go b/v2/hcore/tunnelservice/tunnel_service_grpc.pb.go index c5a3afb3..cf006433 100644 --- a/v2/hcore/tunnelservice/tunnel_service_grpc.pb.go +++ b/v2/hcore/tunnelservice/tunnel_service_grpc.pb.go @@ -8,7 +8,7 @@ package tunnelservice import ( context "context" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -31,9 +31,9 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TunnelServiceClient interface { Start(ctx context.Context, in *TunnelStartRequest, opts ...grpc.CallOption) (*TunnelResponse, error) - Stop(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) - Status(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) - Exit(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) + Stop(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) + Status(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) + Exit(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) } type tunnelServiceClient struct { @@ -54,7 +54,7 @@ func (c *tunnelServiceClient) Start(ctx context.Context, in *TunnelStartRequest, return out, nil } -func (c *tunnelServiceClient) Stop(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) { +func (c *tunnelServiceClient) Stop(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TunnelResponse) err := c.cc.Invoke(ctx, TunnelService_Stop_FullMethodName, in, out, cOpts...) @@ -64,7 +64,7 @@ func (c *tunnelServiceClient) Stop(ctx context.Context, in *common.Empty, opts . return out, nil } -func (c *tunnelServiceClient) Status(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) { +func (c *tunnelServiceClient) Status(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TunnelResponse) err := c.cc.Invoke(ctx, TunnelService_Status_FullMethodName, in, out, cOpts...) @@ -74,7 +74,7 @@ func (c *tunnelServiceClient) Status(ctx context.Context, in *common.Empty, opts return out, nil } -func (c *tunnelServiceClient) Exit(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) { +func (c *tunnelServiceClient) Exit(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*TunnelResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TunnelResponse) err := c.cc.Invoke(ctx, TunnelService_Exit_FullMethodName, in, out, cOpts...) @@ -89,9 +89,9 @@ func (c *tunnelServiceClient) Exit(ctx context.Context, in *common.Empty, opts . // for forward compatibility. type TunnelServiceServer interface { Start(context.Context, *TunnelStartRequest) (*TunnelResponse, error) - Stop(context.Context, *common.Empty) (*TunnelResponse, error) - Status(context.Context, *common.Empty) (*TunnelResponse, error) - Exit(context.Context, *common.Empty) (*TunnelResponse, error) + Stop(context.Context, *hcommon.Empty) (*TunnelResponse, error) + Status(context.Context, *hcommon.Empty) (*TunnelResponse, error) + Exit(context.Context, *hcommon.Empty) (*TunnelResponse, error) mustEmbedUnimplementedTunnelServiceServer() } @@ -105,13 +105,13 @@ type UnimplementedTunnelServiceServer struct{} func (UnimplementedTunnelServiceServer) Start(context.Context, *TunnelStartRequest) (*TunnelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } -func (UnimplementedTunnelServiceServer) Stop(context.Context, *common.Empty) (*TunnelResponse, error) { +func (UnimplementedTunnelServiceServer) Stop(context.Context, *hcommon.Empty) (*TunnelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } -func (UnimplementedTunnelServiceServer) Status(context.Context, *common.Empty) (*TunnelResponse, error) { +func (UnimplementedTunnelServiceServer) Status(context.Context, *hcommon.Empty) (*TunnelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } -func (UnimplementedTunnelServiceServer) Exit(context.Context, *common.Empty) (*TunnelResponse, error) { +func (UnimplementedTunnelServiceServer) Exit(context.Context, *hcommon.Empty) (*TunnelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Exit not implemented") } func (UnimplementedTunnelServiceServer) mustEmbedUnimplementedTunnelServiceServer() {} @@ -154,7 +154,7 @@ func _TunnelService_Start_Handler(srv interface{}, ctx context.Context, dec func } func _TunnelService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -166,13 +166,13 @@ func _TunnelService_Stop_Handler(srv interface{}, ctx context.Context, dec func( FullMethod: TunnelService_Stop_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TunnelServiceServer).Stop(ctx, req.(*common.Empty)) + return srv.(TunnelServiceServer).Stop(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } func _TunnelService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -184,13 +184,13 @@ func _TunnelService_Status_Handler(srv interface{}, ctx context.Context, dec fun FullMethod: TunnelService_Status_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TunnelServiceServer).Status(ctx, req.(*common.Empty)) + return srv.(TunnelServiceServer).Status(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } func _TunnelService_Exit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -202,7 +202,7 @@ func _TunnelService_Exit_Handler(srv interface{}, ctx context.Context, dec func( FullMethod: TunnelService_Exit_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TunnelServiceServer).Exit(ctx, req.(*common.Empty)) + return srv.(TunnelServiceServer).Exit(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } diff --git a/v2/profile/profile_repository.go b/v2/profile/profile_repository.go index 8bd6d2b8..d3e61191 100644 --- a/v2/profile/profile_repository.go +++ b/v2/profile/profile_repository.go @@ -6,10 +6,10 @@ import ( "os" "time" - "github.com/hiddify/hiddify-core/v2/common" - "github.com/hiddify/hiddify-core/v2/common/request" "github.com/hiddify/hiddify-core/v2/config" "github.com/hiddify/hiddify-core/v2/db" + "github.com/hiddify/hiddify-core/v2/hcommon" + "github.com/hiddify/hiddify-core/v2/hcommon/request" hcore "github.com/hiddify/hiddify-core/v2/hcore" "github.com/sagernet/sing-box/option" ) @@ -65,29 +65,29 @@ func (s *ProfileRepositoryServer) AddProfile(ctx context.Context, req *AddProfil return &ProfileResponse{Profile: profile}, nil } -func (s *ProfileRepositoryServer) DeleteProfile(ctx context.Context, req *ProfileRequest) (*common.Response, error) { +func (s *ProfileRepositoryServer) DeleteProfile(ctx context.Context, req *ProfileRequest) (*hcommon.Response, error) { var err error switch { case req.Id != "": err = DeleteById(req.Id) default: - profile, err := s.GetProfile(ctx, req) + profile, err1 := s.GetProfile(ctx, req) if profile.Profile == nil { - err = fmt.Errorf("error deleting profile: %v", err) + err = fmt.Errorf("error deleting profile: %v", err1) } else { err = DeleteById(profile.Profile.Id) } } if err != nil { - return &common.Response{Message: err.Error(), Code: common.ResponseCode_FAILED}, fmt.Errorf("error deleting profile: %v", err) + return &hcommon.Response{Message: err.Error(), Code: hcommon.ResponseCode_FAILED}, fmt.Errorf("error deleting profile: %v", err) } - return &common.Response{Code: common.ResponseCode_OK}, nil + return &hcommon.Response{Code: hcommon.ResponseCode_OK}, nil } -func (s *ProfileRepositoryServer) SetActiveProfile(ctx context.Context, req *ProfileRequest) (*common.Response, error) { +func (s *ProfileRepositoryServer) SetActiveProfile(ctx context.Context, req *ProfileRequest) (*hcommon.Response, error) { var err error switch { case req.Id != "": @@ -110,26 +110,26 @@ func (s *ProfileRepositoryServer) SetActiveProfile(ctx context.Context, req *Pro } if err != nil { - return &common.Response{Message: err.Error(), Code: common.ResponseCode_FAILED}, fmt.Errorf("error setting profile as active: %v", err) + return &hcommon.Response{Message: err.Error(), Code: hcommon.ResponseCode_FAILED}, fmt.Errorf("error setting profile as active: %v", err) } - return &common.Response{Code: common.ResponseCode_OK}, nil + return &hcommon.Response{Code: hcommon.ResponseCode_OK}, nil } -func (s *ProfileRepositoryServer) GetProfiles(ctx context.Context, req *common.Empty) (*MultiProfilesResponse, error) { +func (s *ProfileRepositoryServer) GetProfiles(ctx context.Context, req *hcommon.Empty) (*MultiProfilesResponse, error) { profiles, err := GetAll() if err != nil { - return &MultiProfilesResponse{ResponseCode: common.ResponseCode_FAILED, Message: err.Error()}, fmt.Errorf("error fetching profiles: %v", err) + return &MultiProfilesResponse{ResponseCode: hcommon.ResponseCode_FAILED, Message: err.Error()}, fmt.Errorf("error fetching profiles: %v", err) } return &MultiProfilesResponse{Profiles: profiles}, nil } -func (s *ProfileRepositoryServer) UpdateProfile(ctx context.Context, req *ProfileEntity) (*common.Response, error) { +func (s *ProfileRepositoryServer) UpdateProfile(ctx context.Context, req *ProfileEntity) (*hcommon.Response, error) { err := UpdateProfile(req) if err != nil { - return &common.Response{Message: err.Error(), Code: common.ResponseCode_FAILED}, fmt.Errorf("error updating profile: %v", err) + return &hcommon.Response{Message: err.Error(), Code: hcommon.ResponseCode_FAILED}, fmt.Errorf("error updating profile: %v", err) } - return &common.Response{Code: common.ResponseCode_OK}, nil + return &hcommon.Response{Code: hcommon.ResponseCode_OK}, nil } func GetAll() ([]*ProfileEntity, error) { @@ -138,16 +138,16 @@ func GetAll() ([]*ProfileEntity, error) { return allEntities, err } -func (s *ProfileRepositoryServer) GetActiveProfile(ctx context.Context, req *common.Empty) (*ProfileResponse, error) { +func (s *ProfileRepositoryServer) GetActiveProfile(ctx context.Context, req *hcommon.Empty) (*ProfileResponse, error) { profile, err := GetActiveProfile() if err != nil { - return &ProfileResponse{ResponseCode: common.ResponseCode_FAILED, Message: err.Error()}, fmt.Errorf("error fetching active profile: %v", err) + return &ProfileResponse{ResponseCode: hcommon.ResponseCode_FAILED, Message: err.Error()}, fmt.Errorf("error fetching active profile: %v", err) } return &ProfileResponse{Profile: profile}, nil } func GetActiveProfile() (*ProfileEntity, error) { - table := db.GetTable[common.AppSettings]() + table := db.GetTable[hcommon.AppSettings]() active, err := table.Get("active_profile") if err != nil { return nil, err @@ -160,8 +160,8 @@ func GetActiveProfile() (*ProfileEntity, error) { } func SetActiveProfile(entity *ProfileEntity) error { - table := db.GetTable[common.AppSettings]() - return table.UpdateInsert(&common.AppSettings{ + table := db.GetTable[hcommon.AppSettings]() + return table.UpdateInsert(&hcommon.AppSettings{ Id: "active_profile", Value: entity.Id, }) diff --git a/v2/profile/profile_service.pb.go b/v2/profile/profile_service.pb.go index 3945723a..1309e3be 100644 --- a/v2/profile/profile_service.pb.go +++ b/v2/profile/profile_service.pb.go @@ -7,7 +7,7 @@ package profile import ( - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -168,9 +168,9 @@ type ProfileResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Profile *ProfileEntity `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` // The profile entity, populated in successful operations. - ResponseCode common.ResponseCode `protobuf:"varint,2,opt,name=response_code,json=responseCode,proto3,enum=common.ResponseCode" json:"response_code,omitempty"` // The response code indicating success or failure. - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // A message indicating the result or error, if any. + Profile *ProfileEntity `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` // The profile entity, populated in successful operations. + ResponseCode hcommon.ResponseCode `protobuf:"varint,2,opt,name=response_code,json=responseCode,proto3,enum=hcommon.ResponseCode" json:"response_code,omitempty"` // The response code indicating success or failure. + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // A message indicating the result or error, if any. } func (x *ProfileResponse) Reset() { @@ -212,11 +212,11 @@ func (x *ProfileResponse) GetProfile() *ProfileEntity { return nil } -func (x *ProfileResponse) GetResponseCode() common.ResponseCode { +func (x *ProfileResponse) GetResponseCode() hcommon.ResponseCode { if x != nil { return x.ResponseCode } - return common.ResponseCode(0) + return hcommon.ResponseCode(0) } func (x *ProfileResponse) GetMessage() string { @@ -233,9 +233,9 @@ type MultiProfilesResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Profiles []*ProfileEntity `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` // A list of profile entities. - ResponseCode common.ResponseCode `protobuf:"varint,2,opt,name=response_code,json=responseCode,proto3,enum=common.ResponseCode" json:"response_code,omitempty"` // The response code indicating success or failure. - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // A message indicating the result or error, if any. + Profiles []*ProfileEntity `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` // A list of profile entities. + ResponseCode hcommon.ResponseCode `protobuf:"varint,2,opt,name=response_code,json=responseCode,proto3,enum=hcommon.ResponseCode" json:"response_code,omitempty"` // The response code indicating success or failure. + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // A message indicating the result or error, if any. } func (x *MultiProfilesResponse) Reset() { @@ -277,11 +277,11 @@ func (x *MultiProfilesResponse) GetProfiles() []*ProfileEntity { return nil } -func (x *MultiProfilesResponse) GetResponseCode() common.ResponseCode { +func (x *MultiProfilesResponse) GetResponseCode() hcommon.ResponseCode { if x != nil { return x.ResponseCode } - return common.ResponseCode(0) + return hcommon.ResponseCode(0) } func (x *MultiProfilesResponse) GetMessage() string { @@ -298,73 +298,73 @@ var file_v2_profile_profile_service_proto_rawDesc = []byte{ 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0x18, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x46, 0x0a, - 0x0e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x79, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, - 0x72, 0x6b, 0x5f, 0x61, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x61, 0x72, 0x6b, 0x41, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x07, 0x70, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x15, - 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0d, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0xd1, - 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, - 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x70, 0x72, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x32, 0x2f, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x46, + 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x79, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6d, + 0x61, 0x72, 0x6b, 0x5f, 0x61, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x61, 0x72, 0x6b, 0x41, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa1, 0x01, + 0x0a, 0x15, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0d, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x32, 0xd5, 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x18, + 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, + 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x0e, 0x2e, 0x68, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x0e, + 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, + 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0d, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x68, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2f, + 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -386,19 +386,19 @@ var file_v2_profile_profile_service_proto_goTypes = []any{ (*ProfileResponse)(nil), // 2: profile.ProfileResponse (*MultiProfilesResponse)(nil), // 3: profile.MultiProfilesResponse (*ProfileEntity)(nil), // 4: profile.ProfileEntity - (common.ResponseCode)(0), // 5: common.ResponseCode - (*common.Empty)(nil), // 6: common.Empty - (*common.Response)(nil), // 7: common.Response + (hcommon.ResponseCode)(0), // 5: hcommon.ResponseCode + (*hcommon.Empty)(nil), // 6: hcommon.Empty + (*hcommon.Response)(nil), // 7: hcommon.Response } var file_v2_profile_profile_service_proto_depIdxs = []int32{ 4, // 0: profile.ProfileResponse.profile:type_name -> profile.ProfileEntity - 5, // 1: profile.ProfileResponse.response_code:type_name -> common.ResponseCode + 5, // 1: profile.ProfileResponse.response_code:type_name -> hcommon.ResponseCode 4, // 2: profile.MultiProfilesResponse.profiles:type_name -> profile.ProfileEntity - 5, // 3: profile.MultiProfilesResponse.response_code:type_name -> common.ResponseCode + 5, // 3: profile.MultiProfilesResponse.response_code:type_name -> hcommon.ResponseCode 0, // 4: profile.ProfileService.GetProfile:input_type -> profile.ProfileRequest 4, // 5: profile.ProfileService.UpdateProfile:input_type -> profile.ProfileEntity - 6, // 6: profile.ProfileService.GetAllProfiles:input_type -> common.Empty - 6, // 7: profile.ProfileService.GetActiveProfile:input_type -> common.Empty + 6, // 6: profile.ProfileService.GetAllProfiles:input_type -> hcommon.Empty + 6, // 7: profile.ProfileService.GetActiveProfile:input_type -> hcommon.Empty 0, // 8: profile.ProfileService.SetActiveProfile:input_type -> profile.ProfileRequest 1, // 9: profile.ProfileService.AddProfile:input_type -> profile.AddProfileRequest 0, // 10: profile.ProfileService.DeleteProfile:input_type -> profile.ProfileRequest @@ -406,9 +406,9 @@ var file_v2_profile_profile_service_proto_depIdxs = []int32{ 2, // 12: profile.ProfileService.UpdateProfile:output_type -> profile.ProfileResponse 3, // 13: profile.ProfileService.GetAllProfiles:output_type -> profile.MultiProfilesResponse 2, // 14: profile.ProfileService.GetActiveProfile:output_type -> profile.ProfileResponse - 7, // 15: profile.ProfileService.SetActiveProfile:output_type -> common.Response + 7, // 15: profile.ProfileService.SetActiveProfile:output_type -> hcommon.Response 2, // 16: profile.ProfileService.AddProfile:output_type -> profile.ProfileResponse - 7, // 17: profile.ProfileService.DeleteProfile:output_type -> common.Response + 7, // 17: profile.ProfileService.DeleteProfile:output_type -> hcommon.Response 11, // [11:18] is the sub-list for method output_type 4, // [4:11] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name diff --git a/v2/profile/profile_service.proto b/v2/profile/profile_service.proto index 01a0e80a..c7065813 100644 --- a/v2/profile/profile_service.proto +++ b/v2/profile/profile_service.proto @@ -10,7 +10,7 @@ option go_package = "github.com/hiddify/hiddify-core/v2/profile"; // Import dependencies import "v2/profile/profile.proto"; // Import the ProfileEntity message from another proto file. -import "v2/common/common.proto"; // Import the common response codes and messages. +import "v2/hcommon/common.proto"; // Import the common response codes and messages. /** * ProfileRequest is the request message for fetching or identifying @@ -38,7 +38,7 @@ message AddProfileRequest { */ message ProfileResponse { ProfileEntity profile = 1; // The profile entity, populated in successful operations. - common.ResponseCode response_code = 2; // The response code indicating success or failure. + hcommon.ResponseCode response_code = 2; // The response code indicating success or failure. string message = 3; // A message indicating the result or error, if any. } @@ -47,7 +47,7 @@ message ProfileResponse { */ message MultiProfilesResponse { repeated ProfileEntity profiles = 1; // A list of profile entities. - common.ResponseCode response_code = 2; // The response code indicating success or failure. + hcommon.ResponseCode response_code = 2; // The response code indicating success or failure. string message = 3; // A message indicating the result or error, if any. } @@ -69,17 +69,17 @@ service ProfileService { /** * GetAllProfiles fetches all profiles. */ - rpc GetAllProfiles(common.Empty) returns (MultiProfilesResponse); + rpc GetAllProfiles(hcommon.Empty) returns (MultiProfilesResponse); /** * GetActiveProfile retrieves the currently active profile. */ - rpc GetActiveProfile(common.Empty) returns (ProfileResponse); + rpc GetActiveProfile(hcommon.Empty) returns (ProfileResponse); /** * SetActiveProfile sets a profile as active, identified by ID, name, or URL. */ - rpc SetActiveProfile(ProfileRequest) returns (common.Response); + rpc SetActiveProfile(ProfileRequest) returns (hcommon.Response); /** * AddProfile adds a new profile using either a URL or the raw profile content. @@ -89,5 +89,5 @@ service ProfileService { /** * DeleteProfile deletes a profile identified by ID, name, or URL. */ - rpc DeleteProfile(ProfileRequest) returns (common.Response); + rpc DeleteProfile(ProfileRequest) returns (hcommon.Response); } \ No newline at end of file diff --git a/v2/profile/profile_service_grpc.pb.go b/v2/profile/profile_service_grpc.pb.go index 738392e9..63fbc135 100644 --- a/v2/profile/profile_service_grpc.pb.go +++ b/v2/profile/profile_service_grpc.pb.go @@ -8,7 +8,7 @@ package profile import ( context "context" - common "github.com/hiddify/hiddify-core/v2/common" + hcommon "github.com/hiddify/hiddify-core/v2/hcommon" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -44,19 +44,19 @@ type ProfileServiceClient interface { UpdateProfile(ctx context.Context, in *ProfileEntity, opts ...grpc.CallOption) (*ProfileResponse, error) // * // GetAllProfiles fetches all profiles. - GetAllProfiles(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*MultiProfilesResponse, error) + GetAllProfiles(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*MultiProfilesResponse, error) // * // GetActiveProfile retrieves the currently active profile. - GetActiveProfile(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*ProfileResponse, error) + GetActiveProfile(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*ProfileResponse, error) // * // SetActiveProfile sets a profile as active, identified by ID, name, or URL. - SetActiveProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*common.Response, error) + SetActiveProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*hcommon.Response, error) // * // AddProfile adds a new profile using either a URL or the raw profile content. AddProfile(ctx context.Context, in *AddProfileRequest, opts ...grpc.CallOption) (*ProfileResponse, error) // * // DeleteProfile deletes a profile identified by ID, name, or URL. - DeleteProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*common.Response, error) + DeleteProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*hcommon.Response, error) } type profileServiceClient struct { @@ -87,7 +87,7 @@ func (c *profileServiceClient) UpdateProfile(ctx context.Context, in *ProfileEnt return out, nil } -func (c *profileServiceClient) GetAllProfiles(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*MultiProfilesResponse, error) { +func (c *profileServiceClient) GetAllProfiles(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*MultiProfilesResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MultiProfilesResponse) err := c.cc.Invoke(ctx, ProfileService_GetAllProfiles_FullMethodName, in, out, cOpts...) @@ -97,7 +97,7 @@ func (c *profileServiceClient) GetAllProfiles(ctx context.Context, in *common.Em return out, nil } -func (c *profileServiceClient) GetActiveProfile(ctx context.Context, in *common.Empty, opts ...grpc.CallOption) (*ProfileResponse, error) { +func (c *profileServiceClient) GetActiveProfile(ctx context.Context, in *hcommon.Empty, opts ...grpc.CallOption) (*ProfileResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ProfileResponse) err := c.cc.Invoke(ctx, ProfileService_GetActiveProfile_FullMethodName, in, out, cOpts...) @@ -107,9 +107,9 @@ func (c *profileServiceClient) GetActiveProfile(ctx context.Context, in *common. return out, nil } -func (c *profileServiceClient) SetActiveProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*common.Response, error) { +func (c *profileServiceClient) SetActiveProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*hcommon.Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(common.Response) + out := new(hcommon.Response) err := c.cc.Invoke(ctx, ProfileService_SetActiveProfile_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -127,9 +127,9 @@ func (c *profileServiceClient) AddProfile(ctx context.Context, in *AddProfileReq return out, nil } -func (c *profileServiceClient) DeleteProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*common.Response, error) { +func (c *profileServiceClient) DeleteProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*hcommon.Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(common.Response) + out := new(hcommon.Response) err := c.cc.Invoke(ctx, ProfileService_DeleteProfile_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -152,19 +152,19 @@ type ProfileServiceServer interface { UpdateProfile(context.Context, *ProfileEntity) (*ProfileResponse, error) // * // GetAllProfiles fetches all profiles. - GetAllProfiles(context.Context, *common.Empty) (*MultiProfilesResponse, error) + GetAllProfiles(context.Context, *hcommon.Empty) (*MultiProfilesResponse, error) // * // GetActiveProfile retrieves the currently active profile. - GetActiveProfile(context.Context, *common.Empty) (*ProfileResponse, error) + GetActiveProfile(context.Context, *hcommon.Empty) (*ProfileResponse, error) // * // SetActiveProfile sets a profile as active, identified by ID, name, or URL. - SetActiveProfile(context.Context, *ProfileRequest) (*common.Response, error) + SetActiveProfile(context.Context, *ProfileRequest) (*hcommon.Response, error) // * // AddProfile adds a new profile using either a URL or the raw profile content. AddProfile(context.Context, *AddProfileRequest) (*ProfileResponse, error) // * // DeleteProfile deletes a profile identified by ID, name, or URL. - DeleteProfile(context.Context, *ProfileRequest) (*common.Response, error) + DeleteProfile(context.Context, *ProfileRequest) (*hcommon.Response, error) mustEmbedUnimplementedProfileServiceServer() } @@ -181,19 +181,19 @@ func (UnimplementedProfileServiceServer) GetProfile(context.Context, *ProfileReq func (UnimplementedProfileServiceServer) UpdateProfile(context.Context, *ProfileEntity) (*ProfileResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateProfile not implemented") } -func (UnimplementedProfileServiceServer) GetAllProfiles(context.Context, *common.Empty) (*MultiProfilesResponse, error) { +func (UnimplementedProfileServiceServer) GetAllProfiles(context.Context, *hcommon.Empty) (*MultiProfilesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllProfiles not implemented") } -func (UnimplementedProfileServiceServer) GetActiveProfile(context.Context, *common.Empty) (*ProfileResponse, error) { +func (UnimplementedProfileServiceServer) GetActiveProfile(context.Context, *hcommon.Empty) (*ProfileResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetActiveProfile not implemented") } -func (UnimplementedProfileServiceServer) SetActiveProfile(context.Context, *ProfileRequest) (*common.Response, error) { +func (UnimplementedProfileServiceServer) SetActiveProfile(context.Context, *ProfileRequest) (*hcommon.Response, error) { return nil, status.Errorf(codes.Unimplemented, "method SetActiveProfile not implemented") } func (UnimplementedProfileServiceServer) AddProfile(context.Context, *AddProfileRequest) (*ProfileResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddProfile not implemented") } -func (UnimplementedProfileServiceServer) DeleteProfile(context.Context, *ProfileRequest) (*common.Response, error) { +func (UnimplementedProfileServiceServer) DeleteProfile(context.Context, *ProfileRequest) (*hcommon.Response, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteProfile not implemented") } func (UnimplementedProfileServiceServer) mustEmbedUnimplementedProfileServiceServer() {} @@ -254,7 +254,7 @@ func _ProfileService_UpdateProfile_Handler(srv interface{}, ctx context.Context, } func _ProfileService_GetAllProfiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -266,13 +266,13 @@ func _ProfileService_GetAllProfiles_Handler(srv interface{}, ctx context.Context FullMethod: ProfileService_GetAllProfiles_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileServiceServer).GetAllProfiles(ctx, req.(*common.Empty)) + return srv.(ProfileServiceServer).GetAllProfiles(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) } func _ProfileService_GetActiveProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(common.Empty) + in := new(hcommon.Empty) if err := dec(in); err != nil { return nil, err } @@ -284,7 +284,7 @@ func _ProfileService_GetActiveProfile_Handler(srv interface{}, ctx context.Conte FullMethod: ProfileService_GetActiveProfile_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileServiceServer).GetActiveProfile(ctx, req.(*common.Empty)) + return srv.(ProfileServiceServer).GetActiveProfile(ctx, req.(*hcommon.Empty)) } return interceptor(ctx, in, info, handler) }