From bac4b90c1deb2e9e35e032fc91417614b90aa4d4 Mon Sep 17 00:00:00 2001 From: Romain LE JEUNE Date: Thu, 29 Jun 2023 17:04:54 +0200 Subject: [PATCH] feat(GODT-2712): Feed config_status with user action while pending. --- internal/bridge/bug_report.go | 7 + internal/bridge/config_status.go | 46 ++ internal/configstatus/config_status.go | 33 ++ internal/configstatus/config_status_test.go | 46 ++ internal/focus/proto/focus.pb.go | 2 +- internal/focus/proto/focus_grpc.pb.go | 2 +- .../bridge-gui/bridge-gui/QMLBackend.cpp | 26 + .../bridge-gui/bridge-gui/QMLBackend.h | 3 + .../bridge-gui/bridge-gui/qml/HelpView.qml | 5 +- .../qml/Notifications/Notifications.qml | 3 +- .../bridge-gui/bridge-gui/qml/SetupGuide.qml | 4 +- .../bridgepp/bridgepp/GRPC/GRPCClient.cpp | 20 + .../bridgepp/bridgepp/GRPC/GRPCClient.h | 5 + .../bridgepp/bridgepp/GRPC/bridge.grpc.pb.cc | 132 ++++- .../bridgepp/bridgepp/GRPC/bridge.grpc.pb.h | 516 +++++++++++++++++- .../bridgepp/bridgepp/GRPC/bridge.pb.cc | 21 +- internal/frontend/grpc/bridge.pb.go | 170 +++--- internal/frontend/grpc/bridge.proto | 5 + internal/frontend/grpc/bridge_grpc.pb.go | 112 +++- internal/frontend/grpc/service_telemetry.go | 40 ++ internal/user/config_status.go | 55 ++ 21 files changed, 1140 insertions(+), 113 deletions(-) create mode 100644 internal/bridge/config_status.go create mode 100644 internal/frontend/grpc/service_telemetry.go diff --git a/internal/bridge/bug_report.go b/internal/bridge/bug_report.go index 10fb30e0..c6ff0c2b 100644 --- a/internal/bridge/bug_report.go +++ b/internal/bridge/bug_report.go @@ -29,6 +29,7 @@ import ( "github.com/ProtonMail/go-proton-api" "github.com/ProtonMail/proton-bridge/v3/internal/constants" "github.com/ProtonMail/proton-bridge/v3/internal/logging" + "github.com/ProtonMail/proton-bridge/v3/internal/safe" "github.com/ProtonMail/proton-bridge/v3/internal/vault" ) @@ -105,6 +106,12 @@ func (bridge *Bridge) ReportBug(ctx context.Context, osType, osVersion, descript }) } + safe.Lock(func() { + for _, user := range bridge.users { + user.ReportBugSent() + } + }, bridge.usersLock) + return bridge.api.ReportBug(ctx, proton.ReportBugReq{ OS: osType, OSVersion: osVersion, diff --git a/internal/bridge/config_status.go b/internal/bridge/config_status.go new file mode 100644 index 00000000..05b801e0 --- /dev/null +++ b/internal/bridge/config_status.go @@ -0,0 +1,46 @@ +// Copyright (c) 2023 Proton AG +// +// This file is part of Proton Mail Bridge. +// +// Proton Mail Bridge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Proton Mail Bridge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Proton Mail Bridge. If not, see . + +package bridge + +import ( + "github.com/ProtonMail/proton-bridge/v3/internal/safe" +) + +func (bridge *Bridge) ReportBugClicked() { + safe.Lock(func() { + for _, user := range bridge.users { + user.ReportBugSent() + } + }, bridge.usersLock) +} + +func (bridge *Bridge) AutoconfigUsed(client string) { + safe.Lock(func() { + for _, user := range bridge.users { + user.AutoconfigUsed(client) + } + }, bridge.usersLock) +} + +func (bridge *Bridge) KBArticleOpened(article string) { + safe.Lock(func() { + for _, user := range bridge.users { + user.KBArticleOpened(article) + } + }, bridge.usersLock) +} diff --git a/internal/configstatus/config_status.go b/internal/configstatus/config_status.go index fb3d37fd..1d4df6b4 100644 --- a/internal/configstatus/config_status.go +++ b/internal/configstatus/config_status.go @@ -137,6 +137,39 @@ func (status *ConfigurationStatus) RecordLinkClicked(link uint) error { return nil } +func (status *ConfigurationStatus) ReportClicked() error { + status.DataLock.Lock() + defer status.DataLock.Unlock() + + if !status.Data.DataV1.ReportClick { + status.Data.DataV1.ReportClick = true + return status.Save() + } + return nil +} + +func (status *ConfigurationStatus) ReportSent() error { + status.DataLock.Lock() + defer status.DataLock.Unlock() + + if !status.Data.DataV1.ReportSent { + status.Data.DataV1.ReportSent = true + return status.Save() + } + return nil +} + +func (status *ConfigurationStatus) AutoconfigUsed(client string) error { + status.DataLock.Lock() + defer status.DataLock.Unlock() + + if client != status.Data.DataV1.Autoconf { + status.Data.DataV1.Autoconf = client + return status.Save() + } + return nil +} + func (data *ConfigurationStatusData) init() { data.Metadata = Metadata{ Version: version, diff --git a/internal/configstatus/config_status_test.go b/internal/configstatus/config_status_test.go index 743618c2..8466c5f2 100644 --- a/internal/configstatus/config_status_test.go +++ b/internal/configstatus/config_status_test.go @@ -195,6 +195,52 @@ func TestConfigStatus_RecordLinkClicked(t *testing.T) { require.Equal(t, "", config2.Data.DataV1.FailureDetails) } +func TestConfigStatus_ReportClicked(t *testing.T) { + dir := t.TempDir() + file := filepath.Join(dir, "dummy.json") + config, err := configstatus.LoadConfigurationStatus(file) + require.NoError(t, err) + + require.Equal(t, false, config.Data.DataV1.ReportClick) + require.NoError(t, config.ReportClicked()) + require.Equal(t, true, config.Data.DataV1.ReportClick) + + config2, err := configstatus.LoadConfigurationStatus(file) + require.NoError(t, err) + + require.Equal(t, "1.0.0", config2.Data.Metadata.Version) + require.Equal(t, false, config2.Data.DataV1.PendingSince.IsZero()) + require.Equal(t, true, config2.Data.DataV1.LastProgress.IsZero()) + require.Equal(t, "", config2.Data.DataV1.Autoconf) + require.Equal(t, uint64(0), config2.Data.DataV1.ClickedLink) + require.Equal(t, false, config2.Data.DataV1.ReportSent) + require.Equal(t, true, config2.Data.DataV1.ReportClick) + require.Equal(t, "", config2.Data.DataV1.FailureDetails) +} + +func TestConfigStatus_ReportSent(t *testing.T) { + dir := t.TempDir() + file := filepath.Join(dir, "dummy.json") + config, err := configstatus.LoadConfigurationStatus(file) + require.NoError(t, err) + + require.Equal(t, false, config.Data.DataV1.ReportSent) + require.NoError(t, config.ReportSent()) + require.Equal(t, true, config.Data.DataV1.ReportSent) + + config2, err := configstatus.LoadConfigurationStatus(file) + require.NoError(t, err) + + require.Equal(t, "1.0.0", config2.Data.Metadata.Version) + require.Equal(t, false, config2.Data.DataV1.PendingSince.IsZero()) + require.Equal(t, true, config2.Data.DataV1.LastProgress.IsZero()) + require.Equal(t, "", config2.Data.DataV1.Autoconf) + require.Equal(t, uint64(0), config2.Data.DataV1.ClickedLink) + require.Equal(t, true, config2.Data.DataV1.ReportSent) + require.Equal(t, false, config2.Data.DataV1.ReportClick) + require.Equal(t, "", config2.Data.DataV1.FailureDetails) +} + func dumpConfigStatusInFile(data *configstatus.ConfigurationStatusData, file string) error { f, err := os.Create(file) if err != nil { diff --git a/internal/focus/proto/focus.pb.go b/internal/focus/proto/focus.pb.go index 4e59c6c6..23388cd8 100644 --- a/internal/focus/proto/focus.pb.go +++ b/internal/focus/proto/focus.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.21.3 +// protoc v3.21.12 // source: focus.proto package proto diff --git a/internal/focus/proto/focus_grpc.pb.go b/internal/focus/proto/focus_grpc.pb.go index 2c1a00f8..0ea4860c 100644 --- a/internal/focus/proto/focus_grpc.pb.go +++ b/internal/focus/proto/focus_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.3 +// - protoc v3.21.12 // source: focus.proto package proto diff --git a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp index f6471239..de22f7b7 100644 --- a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp +++ b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp @@ -879,6 +879,32 @@ void QMLBackend::sendBadEventUserFeedback(QString const &userID, bool doResync) ) } +//**************************************************************************************************************************************************** +/// +//**************************************************************************************************************************************************** +void QMLBackend::notifyReportBugClicked() const { + HANDLE_EXCEPTION( + app().grpc().reportBugClicked(); + ) +} +//**************************************************************************************************************************************************** +/// \param[in] client The selected Mail client for autoconfig. +//**************************************************************************************************************************************************** +void QMLBackend::notifyAutoconfigClicked(QString const &client) const { + HANDLE_EXCEPTION( + app().grpc().autoconfigClicked(client); + ) +} + +//**************************************************************************************************************************************************** +/// \param[in] article The url of the KB article. +//**************************************************************************************************************************************************** +void QMLBackend::notifyKBArticleClicked(QString const &article) const { + HANDLE_EXCEPTION( + app().grpc().KBArticleClicked(article); + ) +} + //**************************************************************************************************************************************************** // diff --git a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h index c5b5c9c5..a6778712 100644 --- a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h +++ b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h @@ -183,6 +183,9 @@ public slots: // slot for signals received from QML -> To be forwarded to Bridge void onVersionChanged(); ///< Slot for the version change signal. void setMailServerSettings(int imapPort, int smtpPort, bool useSSLForIMAP, bool useSSLForSMTP) const; ///< Forwards a connection mode change request from QML to gRPC void sendBadEventUserFeedback(QString const &userID, bool doResync); ///< Slot the providing user feedback for a bad event. + void notifyReportBugClicked() const; ///< Slot for the ReportBugClicked gRPC event. + void notifyAutoconfigClicked(QString const &client) const; ///< Slot for gAutoconfigClicked gRPC event. + void notifyKBArticleClicked(QString const &article) const; ///< Slot for KBArticleClicked gRPC event. public slots: // slots for functions that need to be processed locally. void setNormalTrayIcon(); ///< Set the tray icon to normal. diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml b/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml index 3c11b1f3..beac6533 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml @@ -41,7 +41,9 @@ SettingsView { actionIcon: "/qml/icons/ic-external-link.svg" description: qsTr("Get help setting up your client with our instructions and FAQs.") type: SettingsItem.PrimaryButton - onClicked: {Qt.openUrlExternally("https://proton.me/support/bridge")} + onClicked: { + Backend.notifyKBArticleClicked("https://proton.me/support/bridge"); + Qt.openUrlExternally("https://proton.me/support/bridge")} Layout.fillWidth: true } @@ -87,6 +89,7 @@ SettingsView { type: SettingsItem.Button onClicked: { Backend.updateCurrentMailClient() + Backend.notifyReportBugClicked() root.parent.showBugReport() } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml index 96f13669..ac05169d 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Notifications/Notifications.qml @@ -891,7 +891,7 @@ QtObject { action: [ Action { id: allMail_change - text: root.changeAllMailVisibility.isVisibleNow ? + text: root.changeAllMailVisibility.isVisibleNow ? qsTr("Hide All Mail folder") : qsTr("Show All Mail folder") onTriggered: { @@ -1005,6 +1005,7 @@ QtObject { text: qsTr("Open the support page") onTriggered: { + Backend.notifyKBArticleClicked(root.rebuildKeychain.supportLink); Qt.openUrlExternally(root.rebuildKeychain.supportLink) Backend.quit() } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupGuide.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupGuide.qml index f0d4e6b5..972a7f70 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupGuide.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupGuide.qml @@ -288,7 +288,8 @@ Item { if (user) { switch (clientID) { case 0: - root.user.configureAppleMail(root.address) + root.user.configureAppleMail(root.address) + Backend.notifyAutoconfigClicked("AppleMail"); break; } } @@ -298,6 +299,7 @@ Item { var clientObj = clients.get(clientID) if (clientObj != undefined && clientObj.link != "" ) { Qt.openUrlExternally(clientObj.link) + Backend.notifyKBArticleClicked(clientObj.link); } else { console.log("unexpected client index", actionID, clientID) } diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp index 34038c49..a2a70869 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.cpp @@ -1486,5 +1486,25 @@ UPClientContext GRPCClient::clientContext() const { return ctx; } +//**************************************************************************************************************************************************** +/// \param[in] userID The user ID. +/// \param[in] address The email address. +/// \return the status for the gRPC call. +//**************************************************************************************************************************************************** +grpc::Status GRPCClient::reportBugClicked() { + return this->logGRPCCallStatus(stub_->ReportBugClicked(this->clientContext().get(), empty, &empty), __FUNCTION__); +} + +grpc::Status GRPCClient::autoconfigClicked(QString const &client) { + StringValue s; + s.set_value(client.toStdString()); + return this->logGRPCCallStatus(stub_->AutoconfigClicked(this->clientContext().get(), s, &empty), __FUNCTION__); +} + +grpc::Status GRPCClient::KBArticleClicked(QString const &article) { + StringValue s; + s.set_value(article.toStdString()); + return this->logGRPCCallStatus(stub_->KBArticleClicked(this->clientContext().get(), s, &empty), __FUNCTION__); +} } // namespace bridgepp diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h index 6485ce80..ccb2aa98 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCClient.h @@ -189,6 +189,11 @@ signals: void syncFinished(QString const &userID); void syncProgress(QString const &userID, double progress, qint64 elapsedMs, qint64 remainingMs); +public: // telemetry related calls + grpc::Status reportBugClicked(); ///< Performs the 'reportBugClicked' call. + grpc::Status autoconfigClicked(QString const &userID); ///< Performs the 'AutoconfigClicked' call. + grpc::Status KBArticleClicked(QString const &userID); ///< Performs the 'KBArticleClicked' call. + public: // keychain related calls grpc::Status availableKeychains(QStringList &outKeychains); grpc::Status currentKeychain(QString &outKeychain); diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.cc b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.cc index a032ba05..1482025e 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.cc +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.cc @@ -77,6 +77,9 @@ static const char* Bridge_method_names[] = { "/grpc.Bridge/LogoutUser", "/grpc.Bridge/RemoveUser", "/grpc.Bridge/ConfigureUserAppleMail", + "/grpc.Bridge/ReportBugClicked", + "/grpc.Bridge/AutoconfigClicked", + "/grpc.Bridge/KBArticleClicked", "/grpc.Bridge/RunEventStream", "/grpc.Bridge/StopEventStream", }; @@ -143,8 +146,11 @@ Bridge::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, co , rpcmethod_LogoutUser_(Bridge_method_names[52], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_RemoveUser_(Bridge_method_names[53], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_ConfigureUserAppleMail_(Bridge_method_names[54], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RunEventStream_(Bridge_method_names[55], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - , rpcmethod_StopEventStream_(Bridge_method_names[56], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_ReportBugClicked_(Bridge_method_names[55], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_AutoconfigClicked_(Bridge_method_names[56], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_KBArticleClicked_(Bridge_method_names[57], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_RunEventStream_(Bridge_method_names[58], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_StopEventStream_(Bridge_method_names[59], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) {} ::grpc::Status Bridge::Stub::CheckTokens(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::StringValue* response) { @@ -1412,6 +1418,75 @@ void Bridge::Stub::async::ConfigureUserAppleMail(::grpc::ClientContext* context, return result; } +::grpc::Status Bridge::Stub::ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Empty* response) { + return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ReportBugClicked_, context, request, response); +} + +void Bridge::Stub::async::ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ReportBugClicked_, context, request, response, std::move(f)); +} + +void Bridge::Stub::async::ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ReportBugClicked_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncReportBugClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_ReportBugClicked_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncReportBugClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncReportBugClickedRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status Bridge::Stub::AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) { + return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_AutoconfigClicked_, context, request, response); +} + +void Bridge::Stub::async::AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_AutoconfigClicked_, context, request, response, std::move(f)); +} + +void Bridge::Stub::async::AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_AutoconfigClicked_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncAutoconfigClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_AutoconfigClicked_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncAutoconfigClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncAutoconfigClickedRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status Bridge::Stub::KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) { + return ::grpc::internal::BlockingUnaryCall< ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_KBArticleClicked_, context, request, response); +} + +void Bridge::Stub::async::KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_KBArticleClicked_, context, request, response, std::move(f)); +} + +void Bridge::Stub::async::KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_KBArticleClicked_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::PrepareAsyncKBArticleClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::google::protobuf::Empty, ::google::protobuf::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_KBArticleClicked_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* Bridge::Stub::AsyncKBArticleClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncKBArticleClickedRaw(context, request, cq); + result->StartCall(); + return result; +} + ::grpc::ClientReader< ::grpc::StreamEvent>* Bridge::Stub::RunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request) { return ::grpc::internal::ClientReaderFactory< ::grpc::StreamEvent>::Create(channel_.get(), rpcmethod_RunEventStream_, context, request); } @@ -2004,6 +2079,36 @@ Bridge::Service::Service() { }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( Bridge_method_names[55], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](Bridge::Service* service, + ::grpc::ServerContext* ctx, + const ::google::protobuf::Empty* req, + ::google::protobuf::Empty* resp) { + return service->ReportBugClicked(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + Bridge_method_names[56], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](Bridge::Service* service, + ::grpc::ServerContext* ctx, + const ::google::protobuf::StringValue* req, + ::google::protobuf::Empty* resp) { + return service->AutoconfigClicked(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + Bridge_method_names[57], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::StringValue, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](Bridge::Service* service, + ::grpc::ServerContext* ctx, + const ::google::protobuf::StringValue* req, + ::google::protobuf::Empty* resp) { + return service->KBArticleClicked(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + Bridge_method_names[58], ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< Bridge::Service, ::grpc::EventStreamRequest, ::grpc::StreamEvent>( [](Bridge::Service* service, @@ -2013,7 +2118,7 @@ Bridge::Service::Service() { return service->RunEventStream(ctx, req, writer); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - Bridge_method_names[56], + Bridge_method_names[59], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< Bridge::Service, ::google::protobuf::Empty, ::google::protobuf::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](Bridge::Service* service, @@ -2412,6 +2517,27 @@ Bridge::Service::~Service() { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } +::grpc::Status Bridge::Service::ReportBugClicked(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status Bridge::Service::AutoconfigClicked(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status Bridge::Service::KBArticleClicked(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + ::grpc::Status Bridge::Service::RunEventStream(::grpc::ServerContext* context, const ::grpc::EventStreamRequest* request, ::grpc::ServerWriter< ::grpc::StreamEvent>* writer) { (void) context; (void) request; diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.h b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.h index 092e37b5..33cffc53 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.h +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.grpc.pb.h @@ -449,6 +449,28 @@ class Bridge final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncConfigureUserAppleMail(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(PrepareAsyncConfigureUserAppleMailRaw(context, request, cq)); } + // Telemetry + virtual ::grpc::Status ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Empty* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> AsyncReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(AsyncReportBugClickedRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(PrepareAsyncReportBugClickedRaw(context, request, cq)); + } + virtual ::grpc::Status AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> AsyncAutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(AsyncAutoconfigClickedRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncAutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(PrepareAsyncAutoconfigClickedRaw(context, request, cq)); + } + virtual ::grpc::Status KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> AsyncKBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(AsyncKBArticleClickedRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>> PrepareAsyncKBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>>(PrepareAsyncKBArticleClickedRaw(context, request, cq)); + } // Server -> Client event stream std::unique_ptr< ::grpc::ClientReaderInterface< ::grpc::StreamEvent>> RunEventStream(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request) { return std::unique_ptr< ::grpc::ClientReaderInterface< ::grpc::StreamEvent>>(RunEventStreamRaw(context, request)); @@ -588,6 +610,13 @@ class Bridge final { virtual void RemoveUser(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void ConfigureUserAppleMail(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest* request, ::google::protobuf::Empty* response, std::function) = 0; virtual void ConfigureUserAppleMail(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; + // Telemetry + virtual void ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function) = 0; + virtual void ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function) = 0; + virtual void AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function) = 0; + virtual void KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; // Server -> Client event stream virtual void RunEventStream(::grpc::ClientContext* context, const ::grpc::EventStreamRequest* request, ::grpc::ClientReadReactor< ::grpc::StreamEvent>* reactor) = 0; // Keep streaming until StopEventStream is called. @@ -708,6 +737,12 @@ class Bridge final { virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncRemoveUserRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncConfigureUserAppleMailRaw(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncConfigureUserAppleMailRaw(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncReportBugClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncReportBugClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncAutoconfigClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncAutoconfigClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* AsyncKBArticleClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::protobuf::Empty>* PrepareAsyncKBArticleClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientReaderInterface< ::grpc::StreamEvent>* RunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::grpc::StreamEvent>* AsyncRunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::grpc::StreamEvent>* PrepareAsyncRunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -1102,6 +1137,27 @@ class Bridge final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncConfigureUserAppleMail(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(PrepareAsyncConfigureUserAppleMailRaw(context, request, cq)); } + ::grpc::Status ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::google::protobuf::Empty* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> AsyncReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(AsyncReportBugClickedRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(PrepareAsyncReportBugClickedRaw(context, request, cq)); + } + ::grpc::Status AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> AsyncAutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(AsyncAutoconfigClickedRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncAutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(PrepareAsyncAutoconfigClickedRaw(context, request, cq)); + } + ::grpc::Status KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::google::protobuf::Empty* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> AsyncKBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(AsyncKBArticleClickedRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>> PrepareAsyncKBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>>(PrepareAsyncKBArticleClickedRaw(context, request, cq)); + } std::unique_ptr< ::grpc::ClientReader< ::grpc::StreamEvent>> RunEventStream(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request) { return std::unique_ptr< ::grpc::ClientReader< ::grpc::StreamEvent>>(RunEventStreamRaw(context, request)); } @@ -1231,6 +1287,12 @@ class Bridge final { void RemoveUser(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; void ConfigureUserAppleMail(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest* request, ::google::protobuf::Empty* response, std::function) override; void ConfigureUserAppleMail(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; + void ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function) override; + void ReportBugClicked(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; + void AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function) override; + void AutoconfigClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; + void KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, std::function) override; + void KBArticleClicked(::grpc::ClientContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; void RunEventStream(::grpc::ClientContext* context, const ::grpc::EventStreamRequest* request, ::grpc::ClientReadReactor< ::grpc::StreamEvent>* reactor) override; void StopEventStream(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, std::function) override; void StopEventStream(::grpc::ClientContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) override; @@ -1355,6 +1417,12 @@ class Bridge final { ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncRemoveUserRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncConfigureUserAppleMailRaw(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncConfigureUserAppleMailRaw(::grpc::ClientContext* context, const ::grpc::ConfigureAppleMailRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncReportBugClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncReportBugClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::Empty& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncAutoconfigClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncAutoconfigClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* AsyncKBArticleClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::google::protobuf::Empty>* PrepareAsyncKBArticleClickedRaw(::grpc::ClientContext* context, const ::google::protobuf::StringValue& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientReader< ::grpc::StreamEvent>* RunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request) override; ::grpc::ClientAsyncReader< ::grpc::StreamEvent>* AsyncRunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::grpc::StreamEvent>* PrepareAsyncRunEventStreamRaw(::grpc::ClientContext* context, const ::grpc::EventStreamRequest& request, ::grpc::CompletionQueue* cq) override; @@ -1415,6 +1483,9 @@ class Bridge final { const ::grpc::internal::RpcMethod rpcmethod_LogoutUser_; const ::grpc::internal::RpcMethod rpcmethod_RemoveUser_; const ::grpc::internal::RpcMethod rpcmethod_ConfigureUserAppleMail_; + const ::grpc::internal::RpcMethod rpcmethod_ReportBugClicked_; + const ::grpc::internal::RpcMethod rpcmethod_AutoconfigClicked_; + const ::grpc::internal::RpcMethod rpcmethod_KBArticleClicked_; const ::grpc::internal::RpcMethod rpcmethod_RunEventStream_; const ::grpc::internal::RpcMethod rpcmethod_StopEventStream_; }; @@ -1487,6 +1558,10 @@ class Bridge final { virtual ::grpc::Status LogoutUser(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response); virtual ::grpc::Status RemoveUser(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response); virtual ::grpc::Status ConfigureUserAppleMail(::grpc::ServerContext* context, const ::grpc::ConfigureAppleMailRequest* request, ::google::protobuf::Empty* response); + // Telemetry + virtual ::grpc::Status ReportBugClicked(::grpc::ServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response); + virtual ::grpc::Status AutoconfigClicked(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response); + virtual ::grpc::Status KBArticleClicked(::grpc::ServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response); // Server -> Client event stream virtual ::grpc::Status RunEventStream(::grpc::ServerContext* context, const ::grpc::EventStreamRequest* request, ::grpc::ServerWriter< ::grpc::StreamEvent>* writer); // Keep streaming until StopEventStream is called. @@ -2593,12 +2668,72 @@ class Bridge final { } }; template + class WithAsyncMethod_ReportBugClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_ReportBugClicked() { + ::grpc::Service::MarkMethodAsync(55); + } + ~WithAsyncMethod_ReportBugClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportBugClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestReportBugClicked(::grpc::ServerContext* context, ::google::protobuf::Empty* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(55, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_AutoconfigClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_AutoconfigClicked() { + ::grpc::Service::MarkMethodAsync(56); + } + ~WithAsyncMethod_AutoconfigClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status AutoconfigClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestAutoconfigClicked(::grpc::ServerContext* context, ::google::protobuf::StringValue* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(56, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_KBArticleClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_KBArticleClicked() { + ::grpc::Service::MarkMethodAsync(57); + } + ~WithAsyncMethod_KBArticleClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status KBArticleClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestKBArticleClicked(::grpc::ServerContext* context, ::google::protobuf::StringValue* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(57, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithAsyncMethod_RunEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_RunEventStream() { - ::grpc::Service::MarkMethodAsync(55); + ::grpc::Service::MarkMethodAsync(58); } ~WithAsyncMethod_RunEventStream() override { BaseClassMustBeDerivedFromService(this); @@ -2609,7 +2744,7 @@ class Bridge final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestRunEventStream(::grpc::ServerContext* context, ::grpc::EventStreamRequest* request, ::grpc::ServerAsyncWriter< ::grpc::StreamEvent>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(55, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(58, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -2618,7 +2753,7 @@ class Bridge final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_StopEventStream() { - ::grpc::Service::MarkMethodAsync(56); + ::grpc::Service::MarkMethodAsync(59); } ~WithAsyncMethod_StopEventStream() override { BaseClassMustBeDerivedFromService(this); @@ -2629,10 +2764,10 @@ class Bridge final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestStopEventStream(::grpc::ServerContext* context, ::google::protobuf::Empty* request, ::grpc::ServerAsyncResponseWriter< ::google::protobuf::Empty>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(56, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(59, context, request, response, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > AsyncService; + typedef WithAsyncMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > AsyncService; template class WithCallbackMethod_CheckTokens : public BaseClass { private: @@ -4119,12 +4254,93 @@ class Bridge final { ::grpc::CallbackServerContext* /*context*/, const ::grpc::ConfigureAppleMailRequest* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } }; template + class WithCallbackMethod_ReportBugClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_ReportBugClicked() { + ::grpc::Service::MarkMethodCallback(55, + new ::grpc::internal::CallbackUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>( + [this]( + ::grpc::CallbackServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response) { return this->ReportBugClicked(context, request, response); }));} + void SetMessageAllocatorFor_ReportBugClicked( + ::grpc::MessageAllocator< ::google::protobuf::Empty, ::google::protobuf::Empty>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(55); + static_cast<::grpc::internal::CallbackUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_ReportBugClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportBugClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* ReportBugClicked( + ::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_AutoconfigClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_AutoconfigClicked() { + ::grpc::Service::MarkMethodCallback(56, + new ::grpc::internal::CallbackUnaryHandler< ::google::protobuf::StringValue, ::google::protobuf::Empty>( + [this]( + ::grpc::CallbackServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response) { return this->AutoconfigClicked(context, request, response); }));} + void SetMessageAllocatorFor_AutoconfigClicked( + ::grpc::MessageAllocator< ::google::protobuf::StringValue, ::google::protobuf::Empty>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(56); + static_cast<::grpc::internal::CallbackUnaryHandler< ::google::protobuf::StringValue, ::google::protobuf::Empty>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_AutoconfigClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status AutoconfigClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* AutoconfigClicked( + ::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_KBArticleClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_KBArticleClicked() { + ::grpc::Service::MarkMethodCallback(57, + new ::grpc::internal::CallbackUnaryHandler< ::google::protobuf::StringValue, ::google::protobuf::Empty>( + [this]( + ::grpc::CallbackServerContext* context, const ::google::protobuf::StringValue* request, ::google::protobuf::Empty* response) { return this->KBArticleClicked(context, request, response); }));} + void SetMessageAllocatorFor_KBArticleClicked( + ::grpc::MessageAllocator< ::google::protobuf::StringValue, ::google::protobuf::Empty>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(57); + static_cast<::grpc::internal::CallbackUnaryHandler< ::google::protobuf::StringValue, ::google::protobuf::Empty>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_KBArticleClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status KBArticleClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* KBArticleClicked( + ::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } + }; + template class WithCallbackMethod_RunEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_RunEventStream() { - ::grpc::Service::MarkMethodCallback(55, + ::grpc::Service::MarkMethodCallback(58, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::EventStreamRequest, ::grpc::StreamEvent>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::EventStreamRequest* request) { return this->RunEventStream(context, request); })); @@ -4146,13 +4362,13 @@ class Bridge final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_StopEventStream() { - ::grpc::Service::MarkMethodCallback(56, + ::grpc::Service::MarkMethodCallback(59, new ::grpc::internal::CallbackUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>( [this]( ::grpc::CallbackServerContext* context, const ::google::protobuf::Empty* request, ::google::protobuf::Empty* response) { return this->StopEventStream(context, request, response); }));} void SetMessageAllocatorFor_StopEventStream( ::grpc::MessageAllocator< ::google::protobuf::Empty, ::google::protobuf::Empty>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(56); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(59); static_cast<::grpc::internal::CallbackUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>*>(handler) ->SetMessageAllocator(allocator); } @@ -4167,7 +4383,7 @@ class Bridge final { virtual ::grpc::ServerUnaryReactor* StopEventStream( ::grpc::CallbackServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } }; - typedef WithCallbackMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > CallbackService; + typedef WithCallbackMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_CheckTokens : public BaseClass { @@ -5105,12 +5321,63 @@ class Bridge final { } }; template + class WithGenericMethod_ReportBugClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_ReportBugClicked() { + ::grpc::Service::MarkMethodGeneric(55); + } + ~WithGenericMethod_ReportBugClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportBugClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_AutoconfigClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_AutoconfigClicked() { + ::grpc::Service::MarkMethodGeneric(56); + } + ~WithGenericMethod_AutoconfigClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status AutoconfigClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_KBArticleClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_KBArticleClicked() { + ::grpc::Service::MarkMethodGeneric(57); + } + ~WithGenericMethod_KBArticleClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status KBArticleClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template class WithGenericMethod_RunEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_RunEventStream() { - ::grpc::Service::MarkMethodGeneric(55); + ::grpc::Service::MarkMethodGeneric(58); } ~WithGenericMethod_RunEventStream() override { BaseClassMustBeDerivedFromService(this); @@ -5127,7 +5394,7 @@ class Bridge final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_StopEventStream() { - ::grpc::Service::MarkMethodGeneric(56); + ::grpc::Service::MarkMethodGeneric(59); } ~WithGenericMethod_StopEventStream() override { BaseClassMustBeDerivedFromService(this); @@ -6239,12 +6506,72 @@ class Bridge final { } }; template + class WithRawMethod_ReportBugClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_ReportBugClicked() { + ::grpc::Service::MarkMethodRaw(55); + } + ~WithRawMethod_ReportBugClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportBugClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestReportBugClicked(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(55, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_AutoconfigClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_AutoconfigClicked() { + ::grpc::Service::MarkMethodRaw(56); + } + ~WithRawMethod_AutoconfigClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status AutoconfigClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestAutoconfigClicked(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(56, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_KBArticleClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_KBArticleClicked() { + ::grpc::Service::MarkMethodRaw(57); + } + ~WithRawMethod_KBArticleClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status KBArticleClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestKBArticleClicked(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(57, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithRawMethod_RunEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_RunEventStream() { - ::grpc::Service::MarkMethodRaw(55); + ::grpc::Service::MarkMethodRaw(58); } ~WithRawMethod_RunEventStream() override { BaseClassMustBeDerivedFromService(this); @@ -6255,7 +6582,7 @@ class Bridge final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestRunEventStream(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(55, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(58, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -6264,7 +6591,7 @@ class Bridge final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_StopEventStream() { - ::grpc::Service::MarkMethodRaw(56); + ::grpc::Service::MarkMethodRaw(59); } ~WithRawMethod_StopEventStream() override { BaseClassMustBeDerivedFromService(this); @@ -6275,7 +6602,7 @@ class Bridge final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestStopEventStream(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(56, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(59, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -7489,12 +7816,78 @@ class Bridge final { ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template + class WithRawCallbackMethod_ReportBugClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_ReportBugClicked() { + ::grpc::Service::MarkMethodRawCallback(55, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ReportBugClicked(context, request, response); })); + } + ~WithRawCallbackMethod_ReportBugClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportBugClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* ReportBugClicked( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_AutoconfigClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_AutoconfigClicked() { + ::grpc::Service::MarkMethodRawCallback(56, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->AutoconfigClicked(context, request, response); })); + } + ~WithRawCallbackMethod_AutoconfigClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status AutoconfigClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* AutoconfigClicked( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_KBArticleClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_KBArticleClicked() { + ::grpc::Service::MarkMethodRawCallback(57, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->KBArticleClicked(context, request, response); })); + } + ~WithRawCallbackMethod_KBArticleClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status KBArticleClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* KBArticleClicked( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template class WithRawCallbackMethod_RunEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_RunEventStream() { - ::grpc::Service::MarkMethodRawCallback(55, + ::grpc::Service::MarkMethodRawCallback(58, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->RunEventStream(context, request); })); @@ -7516,7 +7909,7 @@ class Bridge final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_StopEventStream() { - ::grpc::Service::MarkMethodRawCallback(56, + ::grpc::Service::MarkMethodRawCallback(59, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->StopEventStream(context, request, response); })); @@ -9018,12 +9411,93 @@ class Bridge final { virtual ::grpc::Status StreamedConfigureUserAppleMail(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::grpc::ConfigureAppleMailRequest,::google::protobuf::Empty>* server_unary_streamer) = 0; }; template + class WithStreamedUnaryMethod_ReportBugClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_ReportBugClicked() { + ::grpc::Service::MarkMethodStreamed(55, + new ::grpc::internal::StreamedUnaryHandler< + ::google::protobuf::Empty, ::google::protobuf::Empty>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::google::protobuf::Empty, ::google::protobuf::Empty>* streamer) { + return this->StreamedReportBugClicked(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_ReportBugClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status ReportBugClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::Empty* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedReportBugClicked(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::protobuf::Empty,::google::protobuf::Empty>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_AutoconfigClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_AutoconfigClicked() { + ::grpc::Service::MarkMethodStreamed(56, + new ::grpc::internal::StreamedUnaryHandler< + ::google::protobuf::StringValue, ::google::protobuf::Empty>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::google::protobuf::StringValue, ::google::protobuf::Empty>* streamer) { + return this->StreamedAutoconfigClicked(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_AutoconfigClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status AutoconfigClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedAutoconfigClicked(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::protobuf::StringValue,::google::protobuf::Empty>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_KBArticleClicked : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_KBArticleClicked() { + ::grpc::Service::MarkMethodStreamed(57, + new ::grpc::internal::StreamedUnaryHandler< + ::google::protobuf::StringValue, ::google::protobuf::Empty>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::google::protobuf::StringValue, ::google::protobuf::Empty>* streamer) { + return this->StreamedKBArticleClicked(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_KBArticleClicked() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status KBArticleClicked(::grpc::ServerContext* /*context*/, const ::google::protobuf::StringValue* /*request*/, ::google::protobuf::Empty* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedKBArticleClicked(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::protobuf::StringValue,::google::protobuf::Empty>* server_unary_streamer) = 0; + }; + template class WithStreamedUnaryMethod_StopEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_StopEventStream() { - ::grpc::Service::MarkMethodStreamed(56, + ::grpc::Service::MarkMethodStreamed(59, new ::grpc::internal::StreamedUnaryHandler< ::google::protobuf::Empty, ::google::protobuf::Empty>( [this](::grpc::ServerContext* context, @@ -9044,14 +9518,14 @@ class Bridge final { // replace default version of method with streamed unary virtual ::grpc::Status StreamedStopEventStream(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::protobuf::Empty,::google::protobuf::Empty>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedUnaryService; + typedef WithStreamedUnaryMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedUnaryService; template class WithSplitStreamingMethod_RunEventStream : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_RunEventStream() { - ::grpc::Service::MarkMethodStreamed(55, + ::grpc::Service::MarkMethodStreamed(58, new ::grpc::internal::SplitServerStreamingHandler< ::grpc::EventStreamRequest, ::grpc::StreamEvent>( [this](::grpc::ServerContext* context, @@ -9073,7 +9547,7 @@ class Bridge final { virtual ::grpc::Status StreamedRunEventStream(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::grpc::EventStreamRequest,::grpc::StreamEvent>* server_split_streamer) = 0; }; typedef WithSplitStreamingMethod_RunEventStream SplitStreamedService; - typedef WithStreamedUnaryMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedService; + typedef WithStreamedUnaryMethod_CheckTokens > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > StreamedService; }; } // namespace grpc diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.pb.cc b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.pb.cc index 9d8a5043..180ce6be 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.pb.cc +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/bridge.pb.cc @@ -1673,7 +1673,7 @@ const char descriptor_table_protodef_bridge_2eproto[] PROTOBUF_SECTION_VARIABLE( "!SMTP_CONNECTION_MODE_CHANGE_ERROR\020\005*S\n\t" "ErrorCode\022\021\n\rUNKNOWN_ERROR\020\000\022\031\n\025TLS_CERT" "_EXPORT_ERROR\020\001\022\030\n\024TLS_KEY_EXPORT_ERROR\020" - "\0022\211\037\n\006Bridge\022I\n\013CheckTokens\022\034.google.pro" + "\0022\342 \n\006Bridge\022I\n\013CheckTokens\022\034.google.pro" "tobuf.StringValue\032\034.google.protobuf.Stri" "ngValue\022\?\n\013AddLogEntry\022\030.grpc.AddLogEntr" "yRequest\032\026.google.protobuf.Empty\022:\n\010GuiR" @@ -1769,12 +1769,17 @@ const char descriptor_table_protodef_bridge_2eproto[] PROTOBUF_SECTION_VARIABLE( "e.protobuf.StringValue\032\026.google.protobuf" ".Empty\022Q\n\026ConfigureUserAppleMail\022\037.grpc." "ConfigureAppleMailRequest\032\026.google.proto" - "buf.Empty\022\?\n\016RunEventStream\022\030.grpc.Event" - "StreamRequest\032\021.grpc.StreamEvent0\001\022A\n\017St" - "opEventStream\022\026.google.protobuf.Empty\032\026." - "google.protobuf.EmptyB6Z4github.com/Prot" - "onMail/proton-bridge/v3/internal/grpcb\006p" - "roto3" + "buf.Empty\022B\n\020ReportBugClicked\022\026.google.p" + "rotobuf.Empty\032\026.google.protobuf.Empty\022I\n" + "\021AutoconfigClicked\022\034.google.protobuf.Str" + "ingValue\032\026.google.protobuf.Empty\022H\n\020KBAr" + "ticleClicked\022\034.google.protobuf.StringVal" + "ue\032\026.google.protobuf.Empty\022\?\n\016RunEventSt" + "ream\022\030.grpc.EventStreamRequest\032\021.grpc.St" + "reamEvent0\001\022A\n\017StopEventStream\022\026.google." + "protobuf.Empty\032\026.google.protobuf.EmptyB6" + "Z4github.com/ProtonMail/proton-bridge/v3" + "/internal/grpcb\006proto3" ; static const ::_pbi::DescriptorTable* const descriptor_table_bridge_2eproto_deps[2] = { &::descriptor_table_google_2fprotobuf_2fempty_2eproto, @@ -1782,7 +1787,7 @@ static const ::_pbi::DescriptorTable* const descriptor_table_bridge_2eproto_deps }; static ::_pbi::once_flag descriptor_table_bridge_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_bridge_2eproto = { - false, false, 10685, descriptor_table_protodef_bridge_2eproto, + false, false, 10902, descriptor_table_protodef_bridge_2eproto, "bridge.proto", &descriptor_table_bridge_2eproto_once, descriptor_table_bridge_2eproto_deps, 2, 64, schemas, file_default_instances, TableStruct_bridge_2eproto::offsets, diff --git a/internal/frontend/grpc/bridge.pb.go b/internal/frontend/grpc/bridge.pb.go index 9ccae52b..2e6d375f 100644 --- a/internal/frontend/grpc/bridge.pb.go +++ b/internal/frontend/grpc/bridge.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.21.3 +// protoc v3.21.12 // source: bridge.proto package grpc @@ -4803,8 +4803,8 @@ var file_bridge_proto_rawDesc = []byte{ 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x4c, 0x53, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x5f, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, - 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0x89, - 0x1f, 0x0a, 0x06, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x0b, 0x43, 0x68, 0x65, + 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0xe2, + 0x20, 0x0a, 0x06, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, @@ -5044,19 +5044,33 @@ var file_bridge_proto_rawDesc = []byte{ 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x42, 0x75, 0x67, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x4d, - 0x61, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2d, 0x62, 0x72, 0x69, 0x64, 0x67, - 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x11, 0x41, 0x75, + 0x74, 0x6f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x12, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x48, 0x0a, 0x10, 0x4b, 0x42, 0x41, 0x72, 0x74, 0x69, 0x63, + 0x6c, 0x65, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x3f, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, + 0x12, 0x41, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x4d, 0x61, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x6e, 0x2d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -5266,67 +5280,73 @@ var file_bridge_proto_depIdxs = []int32{ 71, // 112: grpc.Bridge.LogoutUser:input_type -> google.protobuf.StringValue 71, // 113: grpc.Bridge.RemoveUser:input_type -> google.protobuf.StringValue 18, // 114: grpc.Bridge.ConfigureUserAppleMail:input_type -> grpc.ConfigureAppleMailRequest - 19, // 115: grpc.Bridge.RunEventStream:input_type -> grpc.EventStreamRequest - 72, // 116: grpc.Bridge.StopEventStream:input_type -> google.protobuf.Empty - 71, // 117: grpc.Bridge.CheckTokens:output_type -> google.protobuf.StringValue - 72, // 118: grpc.Bridge.AddLogEntry:output_type -> google.protobuf.Empty - 8, // 119: grpc.Bridge.GuiReady:output_type -> grpc.GuiReadyResponse - 72, // 120: grpc.Bridge.Quit:output_type -> google.protobuf.Empty - 72, // 121: grpc.Bridge.Restart:output_type -> google.protobuf.Empty - 73, // 122: grpc.Bridge.ShowOnStartup:output_type -> google.protobuf.BoolValue - 72, // 123: grpc.Bridge.SetIsAutostartOn:output_type -> google.protobuf.Empty - 73, // 124: grpc.Bridge.IsAutostartOn:output_type -> google.protobuf.BoolValue - 72, // 125: grpc.Bridge.SetIsBetaEnabled:output_type -> google.protobuf.Empty - 73, // 126: grpc.Bridge.IsBetaEnabled:output_type -> google.protobuf.BoolValue - 72, // 127: grpc.Bridge.SetIsAllMailVisible:output_type -> google.protobuf.Empty - 73, // 128: grpc.Bridge.IsAllMailVisible:output_type -> google.protobuf.BoolValue - 72, // 129: grpc.Bridge.SetIsTelemetryDisabled:output_type -> google.protobuf.Empty - 73, // 130: grpc.Bridge.IsTelemetryDisabled:output_type -> google.protobuf.BoolValue - 71, // 131: grpc.Bridge.GoOs:output_type -> google.protobuf.StringValue - 72, // 132: grpc.Bridge.TriggerReset:output_type -> google.protobuf.Empty - 71, // 133: grpc.Bridge.Version:output_type -> google.protobuf.StringValue - 71, // 134: grpc.Bridge.LogsPath:output_type -> google.protobuf.StringValue - 71, // 135: grpc.Bridge.LicensePath:output_type -> google.protobuf.StringValue - 71, // 136: grpc.Bridge.ReleaseNotesPageLink:output_type -> google.protobuf.StringValue - 71, // 137: grpc.Bridge.DependencyLicensesLink:output_type -> google.protobuf.StringValue - 71, // 138: grpc.Bridge.LandingPageLink:output_type -> google.protobuf.StringValue - 72, // 139: grpc.Bridge.SetColorSchemeName:output_type -> google.protobuf.Empty - 71, // 140: grpc.Bridge.ColorSchemeName:output_type -> google.protobuf.StringValue - 71, // 141: grpc.Bridge.CurrentEmailClient:output_type -> google.protobuf.StringValue - 72, // 142: grpc.Bridge.ReportBug:output_type -> google.protobuf.Empty - 72, // 143: grpc.Bridge.ExportTLSCertificates:output_type -> google.protobuf.Empty - 72, // 144: grpc.Bridge.ForceLauncher:output_type -> google.protobuf.Empty - 72, // 145: grpc.Bridge.SetMainExecutable:output_type -> google.protobuf.Empty - 72, // 146: grpc.Bridge.Login:output_type -> google.protobuf.Empty - 72, // 147: grpc.Bridge.Login2FA:output_type -> google.protobuf.Empty - 72, // 148: grpc.Bridge.Login2Passwords:output_type -> google.protobuf.Empty - 72, // 149: grpc.Bridge.LoginAbort:output_type -> google.protobuf.Empty - 72, // 150: grpc.Bridge.CheckUpdate:output_type -> google.protobuf.Empty - 72, // 151: grpc.Bridge.InstallUpdate:output_type -> google.protobuf.Empty - 72, // 152: grpc.Bridge.SetIsAutomaticUpdateOn:output_type -> google.protobuf.Empty - 73, // 153: grpc.Bridge.IsAutomaticUpdateOn:output_type -> google.protobuf.BoolValue - 71, // 154: grpc.Bridge.DiskCachePath:output_type -> google.protobuf.StringValue - 72, // 155: grpc.Bridge.SetDiskCachePath:output_type -> google.protobuf.Empty - 72, // 156: grpc.Bridge.SetIsDoHEnabled:output_type -> google.protobuf.Empty - 73, // 157: grpc.Bridge.IsDoHEnabled:output_type -> google.protobuf.BoolValue - 12, // 158: grpc.Bridge.MailServerSettings:output_type -> grpc.ImapSmtpSettings - 72, // 159: grpc.Bridge.SetMailServerSettings:output_type -> google.protobuf.Empty - 71, // 160: grpc.Bridge.Hostname:output_type -> google.protobuf.StringValue - 73, // 161: grpc.Bridge.IsPortFree:output_type -> google.protobuf.BoolValue - 13, // 162: grpc.Bridge.AvailableKeychains:output_type -> grpc.AvailableKeychainsResponse - 72, // 163: grpc.Bridge.SetCurrentKeychain:output_type -> google.protobuf.Empty - 71, // 164: grpc.Bridge.CurrentKeychain:output_type -> google.protobuf.StringValue - 17, // 165: grpc.Bridge.GetUserList:output_type -> grpc.UserListResponse - 14, // 166: grpc.Bridge.GetUser:output_type -> grpc.User - 72, // 167: grpc.Bridge.SetUserSplitMode:output_type -> google.protobuf.Empty - 72, // 168: grpc.Bridge.SendBadEventUserFeedback:output_type -> google.protobuf.Empty - 72, // 169: grpc.Bridge.LogoutUser:output_type -> google.protobuf.Empty - 72, // 170: grpc.Bridge.RemoveUser:output_type -> google.protobuf.Empty - 72, // 171: grpc.Bridge.ConfigureUserAppleMail:output_type -> google.protobuf.Empty - 20, // 172: grpc.Bridge.RunEventStream:output_type -> grpc.StreamEvent - 72, // 173: grpc.Bridge.StopEventStream:output_type -> google.protobuf.Empty - 117, // [117:174] is the sub-list for method output_type - 60, // [60:117] is the sub-list for method input_type + 72, // 115: grpc.Bridge.ReportBugClicked:input_type -> google.protobuf.Empty + 71, // 116: grpc.Bridge.AutoconfigClicked:input_type -> google.protobuf.StringValue + 71, // 117: grpc.Bridge.KBArticleClicked:input_type -> google.protobuf.StringValue + 19, // 118: grpc.Bridge.RunEventStream:input_type -> grpc.EventStreamRequest + 72, // 119: grpc.Bridge.StopEventStream:input_type -> google.protobuf.Empty + 71, // 120: grpc.Bridge.CheckTokens:output_type -> google.protobuf.StringValue + 72, // 121: grpc.Bridge.AddLogEntry:output_type -> google.protobuf.Empty + 8, // 122: grpc.Bridge.GuiReady:output_type -> grpc.GuiReadyResponse + 72, // 123: grpc.Bridge.Quit:output_type -> google.protobuf.Empty + 72, // 124: grpc.Bridge.Restart:output_type -> google.protobuf.Empty + 73, // 125: grpc.Bridge.ShowOnStartup:output_type -> google.protobuf.BoolValue + 72, // 126: grpc.Bridge.SetIsAutostartOn:output_type -> google.protobuf.Empty + 73, // 127: grpc.Bridge.IsAutostartOn:output_type -> google.protobuf.BoolValue + 72, // 128: grpc.Bridge.SetIsBetaEnabled:output_type -> google.protobuf.Empty + 73, // 129: grpc.Bridge.IsBetaEnabled:output_type -> google.protobuf.BoolValue + 72, // 130: grpc.Bridge.SetIsAllMailVisible:output_type -> google.protobuf.Empty + 73, // 131: grpc.Bridge.IsAllMailVisible:output_type -> google.protobuf.BoolValue + 72, // 132: grpc.Bridge.SetIsTelemetryDisabled:output_type -> google.protobuf.Empty + 73, // 133: grpc.Bridge.IsTelemetryDisabled:output_type -> google.protobuf.BoolValue + 71, // 134: grpc.Bridge.GoOs:output_type -> google.protobuf.StringValue + 72, // 135: grpc.Bridge.TriggerReset:output_type -> google.protobuf.Empty + 71, // 136: grpc.Bridge.Version:output_type -> google.protobuf.StringValue + 71, // 137: grpc.Bridge.LogsPath:output_type -> google.protobuf.StringValue + 71, // 138: grpc.Bridge.LicensePath:output_type -> google.protobuf.StringValue + 71, // 139: grpc.Bridge.ReleaseNotesPageLink:output_type -> google.protobuf.StringValue + 71, // 140: grpc.Bridge.DependencyLicensesLink:output_type -> google.protobuf.StringValue + 71, // 141: grpc.Bridge.LandingPageLink:output_type -> google.protobuf.StringValue + 72, // 142: grpc.Bridge.SetColorSchemeName:output_type -> google.protobuf.Empty + 71, // 143: grpc.Bridge.ColorSchemeName:output_type -> google.protobuf.StringValue + 71, // 144: grpc.Bridge.CurrentEmailClient:output_type -> google.protobuf.StringValue + 72, // 145: grpc.Bridge.ReportBug:output_type -> google.protobuf.Empty + 72, // 146: grpc.Bridge.ExportTLSCertificates:output_type -> google.protobuf.Empty + 72, // 147: grpc.Bridge.ForceLauncher:output_type -> google.protobuf.Empty + 72, // 148: grpc.Bridge.SetMainExecutable:output_type -> google.protobuf.Empty + 72, // 149: grpc.Bridge.Login:output_type -> google.protobuf.Empty + 72, // 150: grpc.Bridge.Login2FA:output_type -> google.protobuf.Empty + 72, // 151: grpc.Bridge.Login2Passwords:output_type -> google.protobuf.Empty + 72, // 152: grpc.Bridge.LoginAbort:output_type -> google.protobuf.Empty + 72, // 153: grpc.Bridge.CheckUpdate:output_type -> google.protobuf.Empty + 72, // 154: grpc.Bridge.InstallUpdate:output_type -> google.protobuf.Empty + 72, // 155: grpc.Bridge.SetIsAutomaticUpdateOn:output_type -> google.protobuf.Empty + 73, // 156: grpc.Bridge.IsAutomaticUpdateOn:output_type -> google.protobuf.BoolValue + 71, // 157: grpc.Bridge.DiskCachePath:output_type -> google.protobuf.StringValue + 72, // 158: grpc.Bridge.SetDiskCachePath:output_type -> google.protobuf.Empty + 72, // 159: grpc.Bridge.SetIsDoHEnabled:output_type -> google.protobuf.Empty + 73, // 160: grpc.Bridge.IsDoHEnabled:output_type -> google.protobuf.BoolValue + 12, // 161: grpc.Bridge.MailServerSettings:output_type -> grpc.ImapSmtpSettings + 72, // 162: grpc.Bridge.SetMailServerSettings:output_type -> google.protobuf.Empty + 71, // 163: grpc.Bridge.Hostname:output_type -> google.protobuf.StringValue + 73, // 164: grpc.Bridge.IsPortFree:output_type -> google.protobuf.BoolValue + 13, // 165: grpc.Bridge.AvailableKeychains:output_type -> grpc.AvailableKeychainsResponse + 72, // 166: grpc.Bridge.SetCurrentKeychain:output_type -> google.protobuf.Empty + 71, // 167: grpc.Bridge.CurrentKeychain:output_type -> google.protobuf.StringValue + 17, // 168: grpc.Bridge.GetUserList:output_type -> grpc.UserListResponse + 14, // 169: grpc.Bridge.GetUser:output_type -> grpc.User + 72, // 170: grpc.Bridge.SetUserSplitMode:output_type -> google.protobuf.Empty + 72, // 171: grpc.Bridge.SendBadEventUserFeedback:output_type -> google.protobuf.Empty + 72, // 172: grpc.Bridge.LogoutUser:output_type -> google.protobuf.Empty + 72, // 173: grpc.Bridge.RemoveUser:output_type -> google.protobuf.Empty + 72, // 174: grpc.Bridge.ConfigureUserAppleMail:output_type -> google.protobuf.Empty + 72, // 175: grpc.Bridge.ReportBugClicked:output_type -> google.protobuf.Empty + 72, // 176: grpc.Bridge.AutoconfigClicked:output_type -> google.protobuf.Empty + 72, // 177: grpc.Bridge.KBArticleClicked:output_type -> google.protobuf.Empty + 20, // 178: grpc.Bridge.RunEventStream:output_type -> grpc.StreamEvent + 72, // 179: grpc.Bridge.StopEventStream:output_type -> google.protobuf.Empty + 120, // [120:180] is the sub-list for method output_type + 60, // [60:120] is the sub-list for method input_type 60, // [60:60] is the sub-list for extension type_name 60, // [60:60] is the sub-list for extension extendee 0, // [0:60] is the sub-list for field type_name diff --git a/internal/frontend/grpc/bridge.proto b/internal/frontend/grpc/bridge.proto index 2a3e024b..3a91546f 100644 --- a/internal/frontend/grpc/bridge.proto +++ b/internal/frontend/grpc/bridge.proto @@ -98,6 +98,11 @@ service Bridge { rpc RemoveUser(google.protobuf.StringValue) returns (google.protobuf.Empty); rpc ConfigureUserAppleMail(ConfigureAppleMailRequest) returns (google.protobuf.Empty); + // Telemetry + rpc ReportBugClicked(google.protobuf.Empty) returns (google.protobuf.Empty); + rpc AutoconfigClicked(google.protobuf.StringValue) returns (google.protobuf.Empty); + rpc KBArticleClicked(google.protobuf.StringValue) returns (google.protobuf.Empty); + // Server -> Client event stream rpc RunEventStream(EventStreamRequest) returns (stream StreamEvent); // Keep streaming until StopEventStream is called. rpc StopEventStream(google.protobuf.Empty) returns (google.protobuf.Empty); diff --git a/internal/frontend/grpc/bridge_grpc.pb.go b/internal/frontend/grpc/bridge_grpc.pb.go index fdddee0e..4767c41a 100644 --- a/internal/frontend/grpc/bridge_grpc.pb.go +++ b/internal/frontend/grpc/bridge_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.3 +// - protoc v3.21.12 // source: bridge.proto package grpc @@ -86,6 +86,10 @@ type BridgeClient interface { LogoutUser(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) RemoveUser(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) ConfigureUserAppleMail(ctx context.Context, in *ConfigureAppleMailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Telemetry + ReportBugClicked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + AutoconfigClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) + KBArticleClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) // Server -> Client event stream RunEventStream(ctx context.Context, in *EventStreamRequest, opts ...grpc.CallOption) (Bridge_RunEventStreamClient, error) StopEventStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -594,6 +598,33 @@ func (c *bridgeClient) ConfigureUserAppleMail(ctx context.Context, in *Configure return out, nil } +func (c *bridgeClient) ReportBugClicked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/grpc.Bridge/ReportBugClicked", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bridgeClient) AutoconfigClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/grpc.Bridge/AutoconfigClicked", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bridgeClient) KBArticleClicked(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/grpc.Bridge/KBArticleClicked", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *bridgeClient) RunEventStream(ctx context.Context, in *EventStreamRequest, opts ...grpc.CallOption) (Bridge_RunEventStreamClient, error) { stream, err := c.cc.NewStream(ctx, &Bridge_ServiceDesc.Streams[0], "/grpc.Bridge/RunEventStream", opts...) if err != nil { @@ -701,6 +732,10 @@ type BridgeServer interface { LogoutUser(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) RemoveUser(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) ConfigureUserAppleMail(context.Context, *ConfigureAppleMailRequest) (*emptypb.Empty, error) + // Telemetry + ReportBugClicked(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + AutoconfigClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) + KBArticleClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) // Server -> Client event stream RunEventStream(*EventStreamRequest, Bridge_RunEventStreamServer) error StopEventStream(context.Context, *emptypb.Empty) (*emptypb.Empty, error) @@ -876,6 +911,15 @@ func (UnimplementedBridgeServer) RemoveUser(context.Context, *wrapperspb.StringV func (UnimplementedBridgeServer) ConfigureUserAppleMail(context.Context, *ConfigureAppleMailRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ConfigureUserAppleMail not implemented") } +func (UnimplementedBridgeServer) ReportBugClicked(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReportBugClicked not implemented") +} +func (UnimplementedBridgeServer) AutoconfigClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AutoconfigClicked not implemented") +} +func (UnimplementedBridgeServer) KBArticleClicked(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method KBArticleClicked not implemented") +} func (UnimplementedBridgeServer) RunEventStream(*EventStreamRequest, Bridge_RunEventStreamServer) error { return status.Errorf(codes.Unimplemented, "method RunEventStream not implemented") } @@ -1885,6 +1929,60 @@ func _Bridge_ConfigureUserAppleMail_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Bridge_ReportBugClicked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BridgeServer).ReportBugClicked(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.Bridge/ReportBugClicked", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BridgeServer).ReportBugClicked(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Bridge_AutoconfigClicked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(wrapperspb.StringValue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BridgeServer).AutoconfigClicked(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.Bridge/AutoconfigClicked", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BridgeServer).AutoconfigClicked(ctx, req.(*wrapperspb.StringValue)) + } + return interceptor(ctx, in, info, handler) +} + +func _Bridge_KBArticleClicked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(wrapperspb.StringValue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BridgeServer).KBArticleClicked(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.Bridge/KBArticleClicked", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BridgeServer).KBArticleClicked(ctx, req.(*wrapperspb.StringValue)) + } + return interceptor(ctx, in, info, handler) +} + func _Bridge_RunEventStream_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(EventStreamRequest) if err := stream.RecvMsg(m); err != nil { @@ -2151,6 +2249,18 @@ var Bridge_ServiceDesc = grpc.ServiceDesc{ MethodName: "ConfigureUserAppleMail", Handler: _Bridge_ConfigureUserAppleMail_Handler, }, + { + MethodName: "ReportBugClicked", + Handler: _Bridge_ReportBugClicked_Handler, + }, + { + MethodName: "AutoconfigClicked", + Handler: _Bridge_AutoconfigClicked_Handler, + }, + { + MethodName: "KBArticleClicked", + Handler: _Bridge_KBArticleClicked_Handler, + }, { MethodName: "StopEventStream", Handler: _Bridge_StopEventStream_Handler, diff --git a/internal/frontend/grpc/service_telemetry.go b/internal/frontend/grpc/service_telemetry.go new file mode 100644 index 00000000..bbabf488 --- /dev/null +++ b/internal/frontend/grpc/service_telemetry.go @@ -0,0 +1,40 @@ +// Copyright (c) 2023 Proton AG +// +// This file is part of Proton Mail Bridge. +// +// Proton Mail Bridge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Proton Mail Bridge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Proton Mail Bridge. If not, see . + +package grpc + +import ( + "context" + + "google.golang.org/protobuf/types/known/emptypb" + "google.golang.org/protobuf/types/known/wrapperspb" +) + +func (s *Service) ReportBugClicked(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + s.bridge.ReportBugClicked() + return &emptypb.Empty{}, nil +} + +func (s *Service) AutoconfigClicked(_ context.Context, client *wrapperspb.StringValue) (*emptypb.Empty, error) { + s.bridge.AutoconfigUsed(client.Value) + return &emptypb.Empty{}, nil +} + +func (s *Service) KBArticleClicked(_ context.Context, article *wrapperspb.StringValue) (*emptypb.Empty, error) { + s.bridge.KBArticleOpened(article.Value) + return &emptypb.Empty{}, nil +} diff --git a/internal/user/config_status.go b/internal/user/config_status.go index febcdf57..ab604181 100644 --- a/internal/user/config_status.go +++ b/internal/user/config_status.go @@ -154,3 +154,58 @@ func (user *User) ReportConfigStatusFailure(errDetails string) { user.log.Info("Configuration Status is back to Pending due to Failure.") } } + +func (user *User) ReportBugClicked() { + if !user.configStatus.IsPending() { + return + } + + if err := user.configStatus.ReportClicked(); err != nil { + user.log.WithError(err).Error("Failed to log ReportClicked in config_status.") + } +} + +func (user *User) ReportBugSent() { + if !user.configStatus.IsPending() { + return + } + + if err := user.configStatus.ReportSent(); err != nil { + user.log.WithError(err).Error("Failed to log ReportSent in config_status.") + } +} + +func (user *User) AutoconfigUsed(client string) { + if !user.configStatus.IsPending() { + return + } + + if err := user.configStatus.AutoconfigUsed(client); err != nil { + user.log.WithError(err).Error("Failed to log Autoconf in config_status.") + } +} + +func (user *User) KBArticleOpened(article string) { + if !user.configStatus.IsPending() { + return + } + + var kb_articles_to_track = [...]string{ + "https://proton.me/support/bridge", + "https://proton.me/support/protonmail-bridge-clients-apple-mail", + "https://proton.me/support/protonmail-bridge-clients-macos-outlook-2019", + "https://proton.me/support/protonmail-bridge-clients-windows-outlook-2019", + "https://proton.me/support/protonmail-bridge-clients-windows-thunderbird", + "https://proton.me/support/protonmail-bridge-configure-client", + } + + for id, url := range kb_articles_to_track { + if url == article { + if err := user.configStatus.RecordLinkClicked(uint(id)); err != nil { + user.log.WithError(err).Error("Failed to log LinkClicked in config_status.") + } + return + } + } + user.log.WithField("article", article).Error("Failed to find KB article id.") +}