From f970e94cca2a67687ff0f0eb7419958f97f1f49f Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Tue, 26 Mar 2024 09:01:21 +0000 Subject: [PATCH] Show version in UI (for admin users). Closes #73 and #158. --- api/csharp/Chirpstack/api/Internal.cs | 255 +++++++++++++++--- api/csharp/Chirpstack/api/InternalGrpc.cs | 74 ++++- api/grpc-web/api/internal_grpc_web_pb.d.ts | 12 + api/grpc-web/api/internal_grpc_web_pb.js | 61 +++++ api/grpc-web/api/internal_pb.d.ts | 18 ++ api/grpc-web/api/internal_pb.js | 152 +++++++++++ api/js/api/internal_grpc_pb.d.ts | 5 + api/js/api/internal_grpc_pb.js | 23 ++ api/js/api/internal_pb.d.ts | 20 ++ api/js/api/internal_pb.js | 152 +++++++++++ api/proto/api/internal.proto | 8 + .../proto/chirpstack-api/api/internal.proto | 8 + .../src/chirpstack_api/api/application_pb2.py | 2 +- .../src/chirpstack_api/api/device_pb2.py | 2 +- .../chirpstack_api/api/device_profile_pb2.py | 2 +- .../api/device_profile_template_pb2.py | 2 +- .../src/chirpstack_api/api/gateway_pb2.py | 2 +- .../src/chirpstack_api/api/internal_pb2.py | 10 +- .../src/chirpstack_api/api/internal_pb2.pyi | 6 + .../chirpstack_api/api/internal_pb2_grpc.py | 34 +++ .../chirpstack_api/api/multicast_group_pb2.py | 2 +- .../src/chirpstack_api/api/relay_pb2.py | 2 +- .../src/chirpstack_api/api/tenant_pb2.py | 2 +- api/python/src/chirpstack_api/api/user_pb2.py | 2 +- .../src/chirpstack_api/common/common_pb2.py | 2 +- api/python/src/chirpstack_api/gw/gw_pb2.py | 2 +- .../integration/integration_pb2.py | 2 +- .../chirpstack_api/stream/api_request_pb2.py | 2 +- .../stream/backend_interfaces_pb2.py | 2 +- .../src/chirpstack_api/stream/frame_pb2.py | 2 +- .../src/chirpstack_api/stream/meta_pb2.py | 2 +- api/rust/proto/chirpstack/api/internal.proto | 8 + chirpstack/src/api/internal.rs | 13 + ui/src/components/Menu.tsx | 20 +- ui/src/index.css | 8 +- ui/src/stores/InternalStore.ts | 12 + 36 files changed, 877 insertions(+), 54 deletions(-) diff --git a/api/csharp/Chirpstack/api/Internal.cs b/api/csharp/Chirpstack/api/Internal.cs index 93293b95..8718068f 100644 --- a/api/csharp/Chirpstack/api/Internal.cs +++ b/api/csharp/Chirpstack/api/Internal.cs @@ -91,35 +91,37 @@ namespace Chirpstack.Api { "DRIcChRjbGFzc19iX3Bpbmdfc2xvdF9kchgJIAEoDRIjChtjbGFzc19iX3Bp", "bmdfc2xvdF9mcmVxdWVuY3kYCiABKA0SEwoLZGVzY3JpcHRpb24YCyABKAki", "QgoNUmVnaW9uQ2hhbm5lbBIRCglmcmVxdWVuY3kYASABKA0SDgoGZHJfbWlu", - "GAIgASgNEg4KBmRyX21heBgDIAEoDTL4CAoPSW50ZXJuYWxTZXJ2aWNlEjAK", - "BUxvZ2luEhEuYXBpLkxvZ2luUmVxdWVzdBoSLmFwaS5Mb2dpblJlc3BvbnNl", - "IgASOQoHUHJvZmlsZRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoULmFwaS5Q", - "cm9maWxlUmVzcG9uc2UiABJFCgxHbG9iYWxTZWFyY2gSGC5hcGkuR2xvYmFs", - "U2VhcmNoUmVxdWVzdBoZLmFwaS5HbG9iYWxTZWFyY2hSZXNwb25zZSIAEkUK", - "DENyZWF0ZUFwaUtleRIYLmFwaS5DcmVhdGVBcGlLZXlSZXF1ZXN0GhkuYXBp", - "LkNyZWF0ZUFwaUtleVJlc3BvbnNlIgASQgoMRGVsZXRlQXBpS2V5EhguYXBp", - "LkRlbGV0ZUFwaUtleVJlcXVlc3QaFi5nb29nbGUucHJvdG9idWYuRW1wdHki", - "ABJCCgtMaXN0QXBpS2V5cxIXLmFwaS5MaXN0QXBpS2V5c1JlcXVlc3QaGC5h", - "cGkuTGlzdEFwaUtleXNSZXNwb25zZSIAEjsKCFNldHRpbmdzEhYuZ29vZ2xl", - "LnByb3RvYnVmLkVtcHR5GhUuYXBpLlNldHRpbmdzUmVzcG9uc2UiABJXChJP", - "cGVuSWRDb25uZWN0TG9naW4SHi5hcGkuT3BlbklkQ29ubmVjdExvZ2luUmVx", - "dWVzdBofLmFwaS5PcGVuSWRDb25uZWN0TG9naW5SZXNwb25zZSIAEkIKC09B", - "dXRoMkxvZ2luEhcuYXBpLk9BdXRoMkxvZ2luUmVxdWVzdBoYLmFwaS5PQXV0", - "aDJMb2dpblJlc3BvbnNlIgASVAoRR2V0RGV2aWNlc1N1bW1hcnkSHS5hcGku", - "R2V0RGV2aWNlc1N1bW1hcnlSZXF1ZXN0Gh4uYXBpLkdldERldmljZXNTdW1t", - "YXJ5UmVzcG9uc2UiABJXChJHZXRHYXRld2F5c1N1bW1hcnkSHi5hcGkuR2V0", - "R2F0ZXdheXNTdW1tYXJ5UmVxdWVzdBofLmFwaS5HZXRHYXRld2F5c1N1bW1h", - "cnlSZXNwb25zZSIAEkgKE1N0cmVhbUdhdGV3YXlGcmFtZXMSHy5hcGkuU3Ry", - "ZWFtR2F0ZXdheUZyYW1lc1JlcXVlc3QaDC5hcGkuTG9nSXRlbSIAMAESRgoS", - "U3RyZWFtRGV2aWNlRnJhbWVzEh4uYXBpLlN0cmVhbURldmljZUZyYW1lc1Jl", - "cXVlc3QaDC5hcGkuTG9nSXRlbSIAMAESRgoSU3RyZWFtRGV2aWNlRXZlbnRz", - "Eh4uYXBpLlN0cmVhbURldmljZUV2ZW50c1JlcXVlc3QaDC5hcGkuTG9nSXRl", - "bSIAMAESQQoLTGlzdFJlZ2lvbnMSFi5nb29nbGUucHJvdG9idWYuRW1wdHka", - "GC5hcGkuTGlzdFJlZ2lvbnNSZXNwb25zZSIAEjwKCUdldFJlZ2lvbhIVLmFw", - "aS5HZXRSZWdpb25SZXF1ZXN0GhYuYXBpLkdldFJlZ2lvblJlc3BvbnNlIgBC", - "ZQoRaW8uY2hpcnBzdGFjay5hcGlCDUludGVybmFsUHJvdG9QAVouZ2l0aHVi", - "LmNvbS9jaGlycHN0YWNrL2NoaXJwc3RhY2svYXBpL2dvL3Y0L2FwaaoCDkNo", - "aXJwc3RhY2suQXBpYgZwcm90bzM=")); + "GAIgASgNEg4KBmRyX21heBgDIAEoDSIlChJHZXRWZXJzaW9uUmVzcG9uc2US", + "DwoHdmVyc2lvbhgBIAEoCTK5CQoPSW50ZXJuYWxTZXJ2aWNlEjAKBUxvZ2lu", + "EhEuYXBpLkxvZ2luUmVxdWVzdBoSLmFwaS5Mb2dpblJlc3BvbnNlIgASOQoH", + "UHJvZmlsZRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoULmFwaS5Qcm9maWxl", + "UmVzcG9uc2UiABJFCgxHbG9iYWxTZWFyY2gSGC5hcGkuR2xvYmFsU2VhcmNo", + "UmVxdWVzdBoZLmFwaS5HbG9iYWxTZWFyY2hSZXNwb25zZSIAEkUKDENyZWF0", + "ZUFwaUtleRIYLmFwaS5DcmVhdGVBcGlLZXlSZXF1ZXN0GhkuYXBpLkNyZWF0", + "ZUFwaUtleVJlc3BvbnNlIgASQgoMRGVsZXRlQXBpS2V5EhguYXBpLkRlbGV0", + "ZUFwaUtleVJlcXVlc3QaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJCCgtM", + "aXN0QXBpS2V5cxIXLmFwaS5MaXN0QXBpS2V5c1JlcXVlc3QaGC5hcGkuTGlz", + "dEFwaUtleXNSZXNwb25zZSIAEjsKCFNldHRpbmdzEhYuZ29vZ2xlLnByb3Rv", + "YnVmLkVtcHR5GhUuYXBpLlNldHRpbmdzUmVzcG9uc2UiABJXChJPcGVuSWRD", + "b25uZWN0TG9naW4SHi5hcGkuT3BlbklkQ29ubmVjdExvZ2luUmVxdWVzdBof", + "LmFwaS5PcGVuSWRDb25uZWN0TG9naW5SZXNwb25zZSIAEkIKC09BdXRoMkxv", + "Z2luEhcuYXBpLk9BdXRoMkxvZ2luUmVxdWVzdBoYLmFwaS5PQXV0aDJMb2dp", + "blJlc3BvbnNlIgASVAoRR2V0RGV2aWNlc1N1bW1hcnkSHS5hcGkuR2V0RGV2", + "aWNlc1N1bW1hcnlSZXF1ZXN0Gh4uYXBpLkdldERldmljZXNTdW1tYXJ5UmVz", + "cG9uc2UiABJXChJHZXRHYXRld2F5c1N1bW1hcnkSHi5hcGkuR2V0R2F0ZXdh", + "eXNTdW1tYXJ5UmVxdWVzdBofLmFwaS5HZXRHYXRld2F5c1N1bW1hcnlSZXNw", + "b25zZSIAEkgKE1N0cmVhbUdhdGV3YXlGcmFtZXMSHy5hcGkuU3RyZWFtR2F0", + "ZXdheUZyYW1lc1JlcXVlc3QaDC5hcGkuTG9nSXRlbSIAMAESRgoSU3RyZWFt", + "RGV2aWNlRnJhbWVzEh4uYXBpLlN0cmVhbURldmljZUZyYW1lc1JlcXVlc3Qa", + "DC5hcGkuTG9nSXRlbSIAMAESRgoSU3RyZWFtRGV2aWNlRXZlbnRzEh4uYXBp", + "LlN0cmVhbURldmljZUV2ZW50c1JlcXVlc3QaDC5hcGkuTG9nSXRlbSIAMAES", + "QQoLTGlzdFJlZ2lvbnMSFi5nb29nbGUucHJvdG9idWYuRW1wdHkaGC5hcGku", + "TGlzdFJlZ2lvbnNSZXNwb25zZSIAEjwKCUdldFJlZ2lvbhIVLmFwaS5HZXRS", + "ZWdpb25SZXF1ZXN0GhYuYXBpLkdldFJlZ2lvblJlc3BvbnNlIgASPwoKR2V0", + "VmVyc2lvbhIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoXLmFwaS5HZXRWZXJz", + "aW9uUmVzcG9uc2UiAEJlChFpby5jaGlycHN0YWNrLmFwaUINSW50ZXJuYWxQ", + "cm90b1ABWi5naXRodWIuY29tL2NoaXJwc3RhY2svY2hpcnBzdGFjay9hcGkv", + "Z28vdjQvYXBpqgIOQ2hpcnBzdGFjay5BcGliBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Chirpstack.Common.CommonReflection.Descriptor, global::Chirpstack.Api.UserReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -155,7 +157,8 @@ namespace Chirpstack.Api { new pbr::GeneratedClrTypeInfo(typeof(global::Chirpstack.Api.RegionListItem), global::Chirpstack.Api.RegionListItem.Parser, new[]{ "Id", "Region", "Description" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Chirpstack.Api.GetRegionRequest), global::Chirpstack.Api.GetRegionRequest.Parser, new[]{ "Id" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Chirpstack.Api.GetRegionResponse), global::Chirpstack.Api.GetRegionResponse.Parser, new[]{ "Id", "Region", "UserInfo", "UplinkChannels", "Rx1Delay", "Rx1DrOffset", "Rx2Dr", "Rx2Frequency", "ClassBPingSlotDr", "ClassBPingSlotFrequency", "Description" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Chirpstack.Api.RegionChannel), global::Chirpstack.Api.RegionChannel.Parser, new[]{ "Frequency", "DrMin", "DrMax" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Chirpstack.Api.RegionChannel), global::Chirpstack.Api.RegionChannel.Parser, new[]{ "Frequency", "DrMin", "DrMax" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Chirpstack.Api.GetVersionResponse), global::Chirpstack.Api.GetVersionResponse.Parser, new[]{ "Version" }, null, null, null, null) })); } #endregion @@ -8886,6 +8889,198 @@ namespace Chirpstack.Api { } + public sealed partial class GetVersionResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetVersionResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Chirpstack.Api.InternalReflection.Descriptor.MessageTypes[33]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetVersionResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetVersionResponse(GetVersionResponse other) : this() { + version_ = other.version_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GetVersionResponse Clone() { + return new GetVersionResponse(this); + } + + /// Field number for the "version" field. + public const int VersionFieldNumber = 1; + private string version_ = ""; + /// + /// version + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Version { + get { return version_; } + set { + version_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GetVersionResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GetVersionResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Version != other.Version) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Version.Length != 0) hash ^= Version.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Version.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Version); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Version.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Version); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Version.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Version); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GetVersionResponse other) { + if (other == null) { + return; + } + if (other.Version.Length != 0) { + Version = other.Version; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Version = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Version = input.ReadString(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/api/csharp/Chirpstack/api/InternalGrpc.cs b/api/csharp/Chirpstack/api/InternalGrpc.cs index 1b55f082..a0530b9b 100644 --- a/api/csharp/Chirpstack/api/InternalGrpc.cs +++ b/api/csharp/Chirpstack/api/InternalGrpc.cs @@ -102,6 +102,8 @@ namespace Chirpstack.Api { static readonly grpc::Marshaller __Marshaller_api_GetRegionRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Chirpstack.Api.GetRegionRequest.Parser)); [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Marshaller __Marshaller_api_GetRegionResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Chirpstack.Api.GetRegionResponse.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_api_GetVersionResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Chirpstack.Api.GetVersionResponse.Parser)); [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Method __Method_Login = new grpc::Method( @@ -231,6 +233,14 @@ namespace Chirpstack.Api { __Marshaller_api_GetRegionRequest, __Marshaller_api_GetRegionResponse); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_GetVersion = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetVersion", + __Marshaller_google_protobuf_Empty, + __Marshaller_api_GetVersionResponse); + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { @@ -436,6 +446,18 @@ namespace Chirpstack.Api { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } + /// + /// GetVersion returns the ChirpStack version. + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::System.Threading.Tasks.Task GetVersion(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + } /// Client for InternalService @@ -1161,6 +1183,54 @@ namespace Chirpstack.Api { { return CallInvoker.AsyncUnaryCall(__Method_GetRegion, null, options, request); } + /// + /// GetVersion returns the ChirpStack version. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::Chirpstack.Api.GetVersionResponse GetVersion(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetVersion(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// GetVersion returns the ChirpStack version. + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::Chirpstack.Api.GetVersionResponse GetVersion(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetVersion, null, options, request); + } + /// + /// GetVersion returns the ChirpStack version. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall GetVersionAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetVersionAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// GetVersion returns the ChirpStack version. + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall GetVersionAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetVersion, null, options, request); + } /// Creates a new instance of client from given ClientBaseConfiguration. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] protected override InternalServiceClient NewInstance(ClientBaseConfiguration configuration) @@ -1190,7 +1260,8 @@ namespace Chirpstack.Api { .AddMethod(__Method_StreamDeviceFrames, serviceImpl.StreamDeviceFrames) .AddMethod(__Method_StreamDeviceEvents, serviceImpl.StreamDeviceEvents) .AddMethod(__Method_ListRegions, serviceImpl.ListRegions) - .AddMethod(__Method_GetRegion, serviceImpl.GetRegion).Build(); + .AddMethod(__Method_GetRegion, serviceImpl.GetRegion) + .AddMethod(__Method_GetVersion, serviceImpl.GetVersion).Build(); } /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. @@ -1216,6 +1287,7 @@ namespace Chirpstack.Api { serviceBinder.AddMethod(__Method_StreamDeviceEvents, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.StreamDeviceEvents)); serviceBinder.AddMethod(__Method_ListRegions, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.ListRegions)); serviceBinder.AddMethod(__Method_GetRegion, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.GetRegion)); + serviceBinder.AddMethod(__Method_GetVersion, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.GetVersion)); } } diff --git a/api/grpc-web/api/internal_grpc_web_pb.d.ts b/api/grpc-web/api/internal_grpc_web_pb.d.ts index 1a9f3e9f..641b27f5 100644 --- a/api/grpc-web/api/internal_grpc_web_pb.d.ts +++ b/api/grpc-web/api/internal_grpc_web_pb.d.ts @@ -115,6 +115,13 @@ export class InternalServiceClient { response: api_internal_pb.GetRegionResponse) => void ): grpcWeb.ClientReadableStream; + getVersion( + request: google_protobuf_empty_pb.Empty, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: api_internal_pb.GetVersionResponse) => void + ): grpcWeb.ClientReadableStream; + } export class InternalServicePromiseClient { @@ -202,5 +209,10 @@ export class InternalServicePromiseClient { metadata?: grpcWeb.Metadata ): Promise; + getVersion( + request: google_protobuf_empty_pb.Empty, + metadata?: grpcWeb.Metadata + ): Promise; + } diff --git a/api/grpc-web/api/internal_grpc_web_pb.js b/api/grpc-web/api/internal_grpc_web_pb.js index 555eac2e..6ae1f6a0 100644 --- a/api/grpc-web/api/internal_grpc_web_pb.js +++ b/api/grpc-web/api/internal_grpc_web_pb.js @@ -1043,5 +1043,66 @@ proto.api.InternalServicePromiseClient.prototype.getRegion = }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.google.protobuf.Empty, + * !proto.api.GetVersionResponse>} + */ +const methodDescriptor_InternalService_GetVersion = new grpc.web.MethodDescriptor( + '/api.InternalService/GetVersion', + grpc.web.MethodType.UNARY, + google_protobuf_empty_pb.Empty, + proto.api.GetVersionResponse, + /** + * @param {!proto.google.protobuf.Empty} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.GetVersionResponse.deserializeBinary +); + + +/** + * @param {!proto.google.protobuf.Empty} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.api.GetVersionResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.InternalServiceClient.prototype.getVersion = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.InternalService/GetVersion', + request, + metadata || {}, + methodDescriptor_InternalService_GetVersion, + callback); +}; + + +/** + * @param {!proto.google.protobuf.Empty} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.InternalServicePromiseClient.prototype.getVersion = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.InternalService/GetVersion', + request, + metadata || {}, + methodDescriptor_InternalService_GetVersion); +}; + + module.exports = proto.api; diff --git a/api/grpc-web/api/internal_pb.d.ts b/api/grpc-web/api/internal_pb.d.ts index de165fdb..d9ef0228 100644 --- a/api/grpc-web/api/internal_pb.d.ts +++ b/api/grpc-web/api/internal_pb.d.ts @@ -864,3 +864,21 @@ export namespace RegionChannel { } } +export class GetVersionResponse extends jspb.Message { + getVersion(): string; + setVersion(value: string): GetVersionResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetVersionResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetVersionResponse): GetVersionResponse.AsObject; + static serializeBinaryToWriter(message: GetVersionResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetVersionResponse; + static deserializeBinaryFromReader(message: GetVersionResponse, reader: jspb.BinaryReader): GetVersionResponse; +} + +export namespace GetVersionResponse { + export type AsObject = { + version: string, + } +} + diff --git a/api/grpc-web/api/internal_pb.js b/api/grpc-web/api/internal_pb.js index 4f34266f..db981e12 100644 --- a/api/grpc-web/api/internal_pb.js +++ b/api/grpc-web/api/internal_pb.js @@ -30,6 +30,7 @@ goog.exportSymbol('proto.api.GetGatewaysSummaryRequest', null, global); goog.exportSymbol('proto.api.GetGatewaysSummaryResponse', null, global); goog.exportSymbol('proto.api.GetRegionRequest', null, global); goog.exportSymbol('proto.api.GetRegionResponse', null, global); +goog.exportSymbol('proto.api.GetVersionResponse', null, global); goog.exportSymbol('proto.api.GlobalSearchRequest', null, global); goog.exportSymbol('proto.api.GlobalSearchResponse', null, global); goog.exportSymbol('proto.api.GlobalSearchResult', null, global); @@ -746,6 +747,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.api.RegionChannel.displayName = 'proto.api.RegionChannel'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetVersionResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetVersionResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetVersionResponse.displayName = 'proto.api.GetVersionResponse'; +} @@ -7139,4 +7161,134 @@ proto.api.RegionChannel.prototype.setDrMax = function(value) { }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetVersionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetVersionResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetVersionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVersionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetVersionResponse} + */ +proto.api.GetVersionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetVersionResponse; + return proto.api.GetVersionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetVersionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetVersionResponse} + */ +proto.api.GetVersionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetVersionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetVersionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetVersionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVersionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string version = 1; + * @return {string} + */ +proto.api.GetVersionResponse.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.GetVersionResponse} returns this + */ +proto.api.GetVersionResponse.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + goog.object.extend(exports, proto.api); diff --git a/api/js/api/internal_grpc_pb.d.ts b/api/js/api/internal_grpc_pb.d.ts index 836af221..74db7c22 100644 --- a/api/js/api/internal_grpc_pb.d.ts +++ b/api/js/api/internal_grpc_pb.d.ts @@ -24,6 +24,7 @@ interface IInternalServiceService extends grpc.ServiceDefinition; listRegions: grpc.MethodDefinition; getRegion: grpc.MethodDefinition; + getVersion: grpc.MethodDefinition; } export const InternalServiceService: IInternalServiceService; @@ -45,6 +46,7 @@ export interface IInternalServiceServer extends grpc.UntypedServiceImplementatio streamDeviceEvents: grpc.handleServerStreamingCall; listRegions: grpc.handleUnaryCall; getRegion: grpc.handleUnaryCall; + getVersion: grpc.handleUnaryCall; } export class InternalServiceClient extends grpc.Client { @@ -94,4 +96,7 @@ export class InternalServiceClient extends grpc.Client { getRegion(argument: api_internal_pb.GetRegionRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; getRegion(argument: api_internal_pb.GetRegionRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; getRegion(argument: api_internal_pb.GetRegionRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getVersion(argument: google_protobuf_empty_pb.Empty, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getVersion(argument: google_protobuf_empty_pb.Empty, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getVersion(argument: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; } diff --git a/api/js/api/internal_grpc_pb.js b/api/js/api/internal_grpc_pb.js index b3cab0b4..0b4c8a86 100644 --- a/api/js/api/internal_grpc_pb.js +++ b/api/js/api/internal_grpc_pb.js @@ -107,6 +107,17 @@ function deserialize_api_GetRegionResponse(buffer_arg) { return api_internal_pb.GetRegionResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_api_GetVersionResponse(arg) { + if (!(arg instanceof api_internal_pb.GetVersionResponse)) { + throw new Error('Expected argument of type api.GetVersionResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetVersionResponse(buffer_arg) { + return api_internal_pb.GetVersionResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_api_GlobalSearchRequest(arg) { if (!(arg instanceof api_internal_pb.GlobalSearchRequest)) { throw new Error('Expected argument of type api.GlobalSearchRequest'); @@ -500,6 +511,18 @@ getRegion: { responseSerialize: serialize_api_GetRegionResponse, responseDeserialize: deserialize_api_GetRegionResponse, }, + // GetVersion returns the ChirpStack version. +getVersion: { + path: '/api.InternalService/GetVersion', + requestStream: false, + responseStream: false, + requestType: google_protobuf_empty_pb.Empty, + responseType: api_internal_pb.GetVersionResponse, + requestSerialize: serialize_google_protobuf_Empty, + requestDeserialize: deserialize_google_protobuf_Empty, + responseSerialize: serialize_api_GetVersionResponse, + responseDeserialize: deserialize_api_GetVersionResponse, + }, }; exports.InternalServiceClient = grpc.makeGenericClientConstructor(InternalServiceService); diff --git a/api/js/api/internal_pb.d.ts b/api/js/api/internal_pb.d.ts index 5a9bdf87..217ba316 100644 --- a/api/js/api/internal_pb.d.ts +++ b/api/js/api/internal_pb.d.ts @@ -929,3 +929,23 @@ export namespace RegionChannel { } } +export class GetVersionResponse extends jspb.Message { + getVersion(): string; + setVersion(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetVersionResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetVersionResponse): GetVersionResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetVersionResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetVersionResponse; + static deserializeBinaryFromReader(message: GetVersionResponse, reader: jspb.BinaryReader): GetVersionResponse; +} + +export namespace GetVersionResponse { + export type AsObject = { + version: string, + } +} + diff --git a/api/js/api/internal_pb.js b/api/js/api/internal_pb.js index 4f34266f..db981e12 100644 --- a/api/js/api/internal_pb.js +++ b/api/js/api/internal_pb.js @@ -30,6 +30,7 @@ goog.exportSymbol('proto.api.GetGatewaysSummaryRequest', null, global); goog.exportSymbol('proto.api.GetGatewaysSummaryResponse', null, global); goog.exportSymbol('proto.api.GetRegionRequest', null, global); goog.exportSymbol('proto.api.GetRegionResponse', null, global); +goog.exportSymbol('proto.api.GetVersionResponse', null, global); goog.exportSymbol('proto.api.GlobalSearchRequest', null, global); goog.exportSymbol('proto.api.GlobalSearchResponse', null, global); goog.exportSymbol('proto.api.GlobalSearchResult', null, global); @@ -746,6 +747,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.api.RegionChannel.displayName = 'proto.api.RegionChannel'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetVersionResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetVersionResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetVersionResponse.displayName = 'proto.api.GetVersionResponse'; +} @@ -7139,4 +7161,134 @@ proto.api.RegionChannel.prototype.setDrMax = function(value) { }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetVersionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetVersionResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetVersionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVersionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetVersionResponse} + */ +proto.api.GetVersionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetVersionResponse; + return proto.api.GetVersionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetVersionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetVersionResponse} + */ +proto.api.GetVersionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetVersionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetVersionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetVersionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetVersionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string version = 1; + * @return {string} + */ +proto.api.GetVersionResponse.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.GetVersionResponse} returns this + */ +proto.api.GetVersionResponse.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + goog.object.extend(exports, proto.api); diff --git a/api/proto/api/internal.proto b/api/proto/api/internal.proto index 0b72d54c..d033e252 100644 --- a/api/proto/api/internal.proto +++ b/api/proto/api/internal.proto @@ -66,6 +66,9 @@ service InternalService { // GetRegion returns the region details for the given region. rpc GetRegion(GetRegionRequest) returns (GetRegionResponse) {} + + // GetVersion returns the ChirpStack version. + rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse) {} } message ApiKey { @@ -414,3 +417,8 @@ message RegionChannel { // Max DR. uint32 dr_max = 3; } + +message GetVersionResponse { + // version + string version = 1; +} diff --git a/api/python/proto/chirpstack-api/api/internal.proto b/api/python/proto/chirpstack-api/api/internal.proto index 216d5a2b..be7812bf 100644 --- a/api/python/proto/chirpstack-api/api/internal.proto +++ b/api/python/proto/chirpstack-api/api/internal.proto @@ -66,6 +66,9 @@ service InternalService { // GetRegion returns the region details for the given region. rpc GetRegion(GetRegionRequest) returns (GetRegionResponse) {} + + // GetVersion returns the ChirpStack version. + rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse) {} } message ApiKey { @@ -414,3 +417,8 @@ message RegionChannel { // Max DR. uint32 dr_max = 3; } + +message GetVersionResponse { + // version + string version = 1; +} diff --git a/api/python/src/chirpstack_api/api/application_pb2.py b/api/python/src/chirpstack_api/api/application_pb2.py index cda27adf..1a23c71b 100644 --- a/api/python/src/chirpstack_api/api/application_pb2.py +++ b/api/python/src/chirpstack_api/api/application_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/application.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/device_pb2.py b/api/python/src/chirpstack_api/api/device_pb2.py index 662d86b7..e5619a7e 100644 --- a/api/python/src/chirpstack_api/api/device_pb2.py +++ b/api/python/src/chirpstack_api/api/device_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/device.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/device_profile_pb2.py b/api/python/src/chirpstack_api/api/device_profile_pb2.py index 7101f0ea..4c8c73f7 100644 --- a/api/python/src/chirpstack_api/api/device_profile_pb2.py +++ b/api/python/src/chirpstack_api/api/device_profile_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/device_profile.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/device_profile_template_pb2.py b/api/python/src/chirpstack_api/api/device_profile_template_pb2.py index 4e28cd6c..7c4aa076 100644 --- a/api/python/src/chirpstack_api/api/device_profile_template_pb2.py +++ b/api/python/src/chirpstack_api/api/device_profile_template_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/device_profile_template.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/gateway_pb2.py b/api/python/src/chirpstack_api/api/gateway_pb2.py index 6bab4ef5..dfb6e177 100644 --- a/api/python/src/chirpstack_api/api/gateway_pb2.py +++ b/api/python/src/chirpstack_api/api/gateway_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/gateway.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/internal_pb2.py b/api/python/src/chirpstack_api/api/internal_pb2.py index 077ca322..ec0dbf6d 100644 --- a/api/python/src/chirpstack_api/api/internal_pb2.py +++ b/api/python/src/chirpstack_api/api/internal_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/internal.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -18,7 +18,7 @@ from chirpstack_api.common import common_pb2 as chirpstack__api_dot_common_dot_c from chirpstack_api.api import user_pb2 as chirpstack__api_dot_api_dot_user__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!chirpstack-api/api/internal.proto\x12\x03\x61pi\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\"chirpstack-api/common/common.proto\x1a\x1d\x63hirpstack-api/api/user.proto\"G\n\x06\x41piKey\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08is_admin\x18\x03 \x01(\x08\x12\x11\n\ttenant_id\x18\x04 \x01(\t\"3\n\x13\x43reateApiKeyRequest\x12\x1c\n\x07\x61pi_key\x18\x01 \x01(\x0b\x32\x0b.api.ApiKey\"1\n\x14\x43reateApiKeyResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"!\n\x13\x44\x65leteApiKeyRequest\x12\n\n\x02id\x18\x01 \x01(\t\"X\n\x12ListApiKeysRequest\x12\r\n\x05limit\x18\x01 \x01(\r\x12\x0e\n\x06offset\x18\x02 \x01(\r\x12\x10\n\x08is_admin\x18\x03 \x01(\x08\x12\x11\n\ttenant_id\x18\x04 \x01(\t\"G\n\x13ListApiKeysResponse\x12\x13\n\x0btotal_count\x18\x01 \x01(\r\x12\x1b\n\x06result\x18\x02 \x03(\x0b\x32\x0b.api.ApiKey\"\xc8\x01\n\x0eUserTenantLink\x12.\n\ncreated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\ttenant_id\x18\x03 \x01(\t\x12\x10\n\x08is_admin\x18\x04 \x01(\x08\x12\x17\n\x0fis_device_admin\x18\x05 \x01(\x08\x12\x18\n\x10is_gateway_admin\x18\x06 \x01(\x08\"/\n\x0cLoginRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\x1c\n\rLoginResponse\x12\x0b\n\x03jwt\x18\x01 \x01(\t\"P\n\x0fProfileResponse\x12\x17\n\x04user\x18\x01 \x01(\x0b\x32\t.api.User\x12$\n\x07tenants\x18\x03 \x03(\x0b\x32\x13.api.UserTenantLink\"D\n\x13GlobalSearchRequest\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x03\x12\x0e\n\x06offset\x18\x03 \x01(\x03\"?\n\x14GlobalSearchResponse\x12\'\n\x06result\x18\x01 \x03(\x0b\x32\x17.api.GlobalSearchResult\"\xe2\x01\n\x12GlobalSearchResult\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x11\n\ttenant_id\x18\x03 \x01(\t\x12\x13\n\x0btenant_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x06 \x01(\t\x12\x16\n\x0e\x64\x65vice_dev_eui\x18\x07 \x01(\t\x12\x13\n\x0b\x64\x65vice_name\x18\x08 \x01(\t\x12\x12\n\ngateway_id\x18\t \x01(\t\x12\x14\n\x0cgateway_name\x18\n \x01(\t\"[\n\x10SettingsResponse\x12*\n\x0eopenid_connect\x18\x01 \x01(\x0b\x32\x12.api.OpenIdConnect\x12\x1b\n\x06oauth2\x18\x02 \x01(\x0b\x32\x0b.api.OAuth2\"t\n\rOpenIdConnect\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x11\n\tlogin_url\x18\x02 \x01(\t\x12\x13\n\x0blogin_label\x18\x03 \x01(\t\x12\x12\n\nlogout_url\x18\x04 \x01(\t\x12\x16\n\x0elogin_redirect\x18\x05 \x01(\x08\"m\n\x06OAuth2\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x11\n\tlogin_url\x18\x02 \x01(\t\x12\x13\n\x0blogin_label\x18\x03 \x01(\t\x12\x12\n\nlogout_url\x18\x04 \x01(\t\x12\x16\n\x0elogin_redirect\x18\x05 \x01(\x08\"8\n\x19OpenIdConnectLoginRequest\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\r\n\x05state\x18\x02 \x01(\t\"+\n\x1aOpenIdConnectLoginResponse\x12\r\n\x05token\x18\x01 \x01(\t\"1\n\x12OAuth2LoginRequest\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\r\n\x05state\x18\x02 \x01(\t\"$\n\x13OAuth2LoginResponse\x12\r\n\x05token\x18\x01 \x01(\t\"-\n\x18GetDevicesSummaryRequest\x12\x11\n\ttenant_id\x18\x01 \x01(\t\"\xd2\x01\n\x19GetDevicesSummaryResponse\x12\x14\n\x0c\x61\x63tive_count\x18\x01 \x01(\r\x12\x16\n\x0einactive_count\x18\x02 \x01(\r\x12=\n\x08\x64r_count\x18\x03 \x03(\x0b\x32+.api.GetDevicesSummaryResponse.DrCountEntry\x12\x18\n\x10never_seen_count\x18\x04 \x01(\r\x1a.\n\x0c\x44rCountEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\".\n\x19GetGatewaysSummaryRequest\x12\x11\n\ttenant_id\x18\x01 \x01(\t\"c\n\x1aGetGatewaysSummaryResponse\x12\x14\n\x0conline_count\x18\x01 \x01(\r\x12\x15\n\roffline_count\x18\x02 \x01(\r\x12\x18\n\x10never_seen_count\x18\x03 \x01(\r\"\xc7\x01\n\x07LogItem\x12\n\n\x02id\x18\x01 \x01(\t\x12(\n\x04time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x30\n\nproperties\x18\x05 \x03(\x0b\x32\x1c.api.LogItem.PropertiesEntry\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\x1aStreamGatewayFramesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\",\n\x19StreamDeviceFramesRequest\x12\x0f\n\x07\x64\x65v_eui\x18\x01 \x01(\t\",\n\x19StreamDeviceEventsRequest\x12\x0f\n\x07\x64\x65v_eui\x18\x01 \x01(\t\";\n\x13ListRegionsResponse\x12$\n\x07regions\x18\x01 \x03(\x0b\x32\x13.api.RegionListItem\"Q\n\x0eRegionListItem\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x06region\x18\x02 \x01(\x0e\x32\x0e.common.Region\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"\x1e\n\x10GetRegionRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\xa8\x02\n\x11GetRegionResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x06region\x18\x02 \x01(\x0e\x32\x0e.common.Region\x12\x11\n\tuser_info\x18\x03 \x01(\t\x12+\n\x0fuplink_channels\x18\x04 \x03(\x0b\x32\x12.api.RegionChannel\x12\x11\n\trx1_delay\x18\x05 \x01(\r\x12\x15\n\rrx1_dr_offset\x18\x06 \x01(\r\x12\x0e\n\x06rx2_dr\x18\x07 \x01(\r\x12\x15\n\rrx2_frequency\x18\x08 \x01(\r\x12\x1c\n\x14\x63lass_b_ping_slot_dr\x18\t \x01(\r\x12#\n\x1b\x63lass_b_ping_slot_frequency\x18\n \x01(\r\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\"B\n\rRegionChannel\x12\x11\n\tfrequency\x18\x01 \x01(\r\x12\x0e\n\x06\x64r_min\x18\x02 \x01(\r\x12\x0e\n\x06\x64r_max\x18\x03 \x01(\r2\xf8\x08\n\x0fInternalService\x12\x30\n\x05Login\x12\x11.api.LoginRequest\x1a\x12.api.LoginResponse\"\x00\x12\x39\n\x07Profile\x12\x16.google.protobuf.Empty\x1a\x14.api.ProfileResponse\"\x00\x12\x45\n\x0cGlobalSearch\x12\x18.api.GlobalSearchRequest\x1a\x19.api.GlobalSearchResponse\"\x00\x12\x45\n\x0c\x43reateApiKey\x12\x18.api.CreateApiKeyRequest\x1a\x19.api.CreateApiKeyResponse\"\x00\x12\x42\n\x0c\x44\x65leteApiKey\x12\x18.api.DeleteApiKeyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x42\n\x0bListApiKeys\x12\x17.api.ListApiKeysRequest\x1a\x18.api.ListApiKeysResponse\"\x00\x12;\n\x08Settings\x12\x16.google.protobuf.Empty\x1a\x15.api.SettingsResponse\"\x00\x12W\n\x12OpenIdConnectLogin\x12\x1e.api.OpenIdConnectLoginRequest\x1a\x1f.api.OpenIdConnectLoginResponse\"\x00\x12\x42\n\x0bOAuth2Login\x12\x17.api.OAuth2LoginRequest\x1a\x18.api.OAuth2LoginResponse\"\x00\x12T\n\x11GetDevicesSummary\x12\x1d.api.GetDevicesSummaryRequest\x1a\x1e.api.GetDevicesSummaryResponse\"\x00\x12W\n\x12GetGatewaysSummary\x12\x1e.api.GetGatewaysSummaryRequest\x1a\x1f.api.GetGatewaysSummaryResponse\"\x00\x12H\n\x13StreamGatewayFrames\x12\x1f.api.StreamGatewayFramesRequest\x1a\x0c.api.LogItem\"\x00\x30\x01\x12\x46\n\x12StreamDeviceFrames\x12\x1e.api.StreamDeviceFramesRequest\x1a\x0c.api.LogItem\"\x00\x30\x01\x12\x46\n\x12StreamDeviceEvents\x12\x1e.api.StreamDeviceEventsRequest\x1a\x0c.api.LogItem\"\x00\x30\x01\x12\x41\n\x0bListRegions\x12\x16.google.protobuf.Empty\x1a\x18.api.ListRegionsResponse\"\x00\x12<\n\tGetRegion\x12\x15.api.GetRegionRequest\x1a\x16.api.GetRegionResponse\"\x00\x42\x65\n\x11io.chirpstack.apiB\rInternalProtoP\x01Z.github.com/chirpstack/chirpstack/api/go/v4/api\xaa\x02\x0e\x43hirpstack.Apib\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!chirpstack-api/api/internal.proto\x12\x03\x61pi\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\"chirpstack-api/common/common.proto\x1a\x1d\x63hirpstack-api/api/user.proto\"G\n\x06\x41piKey\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08is_admin\x18\x03 \x01(\x08\x12\x11\n\ttenant_id\x18\x04 \x01(\t\"3\n\x13\x43reateApiKeyRequest\x12\x1c\n\x07\x61pi_key\x18\x01 \x01(\x0b\x32\x0b.api.ApiKey\"1\n\x14\x43reateApiKeyResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"!\n\x13\x44\x65leteApiKeyRequest\x12\n\n\x02id\x18\x01 \x01(\t\"X\n\x12ListApiKeysRequest\x12\r\n\x05limit\x18\x01 \x01(\r\x12\x0e\n\x06offset\x18\x02 \x01(\r\x12\x10\n\x08is_admin\x18\x03 \x01(\x08\x12\x11\n\ttenant_id\x18\x04 \x01(\t\"G\n\x13ListApiKeysResponse\x12\x13\n\x0btotal_count\x18\x01 \x01(\r\x12\x1b\n\x06result\x18\x02 \x03(\x0b\x32\x0b.api.ApiKey\"\xc8\x01\n\x0eUserTenantLink\x12.\n\ncreated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\ttenant_id\x18\x03 \x01(\t\x12\x10\n\x08is_admin\x18\x04 \x01(\x08\x12\x17\n\x0fis_device_admin\x18\x05 \x01(\x08\x12\x18\n\x10is_gateway_admin\x18\x06 \x01(\x08\"/\n\x0cLoginRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\x1c\n\rLoginResponse\x12\x0b\n\x03jwt\x18\x01 \x01(\t\"P\n\x0fProfileResponse\x12\x17\n\x04user\x18\x01 \x01(\x0b\x32\t.api.User\x12$\n\x07tenants\x18\x03 \x03(\x0b\x32\x13.api.UserTenantLink\"D\n\x13GlobalSearchRequest\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x03\x12\x0e\n\x06offset\x18\x03 \x01(\x03\"?\n\x14GlobalSearchResponse\x12\'\n\x06result\x18\x01 \x03(\x0b\x32\x17.api.GlobalSearchResult\"\xe2\x01\n\x12GlobalSearchResult\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x11\n\ttenant_id\x18\x03 \x01(\t\x12\x13\n\x0btenant_name\x18\x04 \x01(\t\x12\x16\n\x0e\x61pplication_id\x18\x05 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x06 \x01(\t\x12\x16\n\x0e\x64\x65vice_dev_eui\x18\x07 \x01(\t\x12\x13\n\x0b\x64\x65vice_name\x18\x08 \x01(\t\x12\x12\n\ngateway_id\x18\t \x01(\t\x12\x14\n\x0cgateway_name\x18\n \x01(\t\"[\n\x10SettingsResponse\x12*\n\x0eopenid_connect\x18\x01 \x01(\x0b\x32\x12.api.OpenIdConnect\x12\x1b\n\x06oauth2\x18\x02 \x01(\x0b\x32\x0b.api.OAuth2\"t\n\rOpenIdConnect\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x11\n\tlogin_url\x18\x02 \x01(\t\x12\x13\n\x0blogin_label\x18\x03 \x01(\t\x12\x12\n\nlogout_url\x18\x04 \x01(\t\x12\x16\n\x0elogin_redirect\x18\x05 \x01(\x08\"m\n\x06OAuth2\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x11\n\tlogin_url\x18\x02 \x01(\t\x12\x13\n\x0blogin_label\x18\x03 \x01(\t\x12\x12\n\nlogout_url\x18\x04 \x01(\t\x12\x16\n\x0elogin_redirect\x18\x05 \x01(\x08\"8\n\x19OpenIdConnectLoginRequest\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\r\n\x05state\x18\x02 \x01(\t\"+\n\x1aOpenIdConnectLoginResponse\x12\r\n\x05token\x18\x01 \x01(\t\"1\n\x12OAuth2LoginRequest\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\r\n\x05state\x18\x02 \x01(\t\"$\n\x13OAuth2LoginResponse\x12\r\n\x05token\x18\x01 \x01(\t\"-\n\x18GetDevicesSummaryRequest\x12\x11\n\ttenant_id\x18\x01 \x01(\t\"\xd2\x01\n\x19GetDevicesSummaryResponse\x12\x14\n\x0c\x61\x63tive_count\x18\x01 \x01(\r\x12\x16\n\x0einactive_count\x18\x02 \x01(\r\x12=\n\x08\x64r_count\x18\x03 \x03(\x0b\x32+.api.GetDevicesSummaryResponse.DrCountEntry\x12\x18\n\x10never_seen_count\x18\x04 \x01(\r\x1a.\n\x0c\x44rCountEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\".\n\x19GetGatewaysSummaryRequest\x12\x11\n\ttenant_id\x18\x01 \x01(\t\"c\n\x1aGetGatewaysSummaryResponse\x12\x14\n\x0conline_count\x18\x01 \x01(\r\x12\x15\n\roffline_count\x18\x02 \x01(\r\x12\x18\n\x10never_seen_count\x18\x03 \x01(\r\"\xc7\x01\n\x07LogItem\x12\n\n\x02id\x18\x01 \x01(\t\x12(\n\x04time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x30\n\nproperties\x18\x05 \x03(\x0b\x32\x1c.api.LogItem.PropertiesEntry\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\x1aStreamGatewayFramesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\",\n\x19StreamDeviceFramesRequest\x12\x0f\n\x07\x64\x65v_eui\x18\x01 \x01(\t\",\n\x19StreamDeviceEventsRequest\x12\x0f\n\x07\x64\x65v_eui\x18\x01 \x01(\t\";\n\x13ListRegionsResponse\x12$\n\x07regions\x18\x01 \x03(\x0b\x32\x13.api.RegionListItem\"Q\n\x0eRegionListItem\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x06region\x18\x02 \x01(\x0e\x32\x0e.common.Region\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"\x1e\n\x10GetRegionRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\xa8\x02\n\x11GetRegionResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x06region\x18\x02 \x01(\x0e\x32\x0e.common.Region\x12\x11\n\tuser_info\x18\x03 \x01(\t\x12+\n\x0fuplink_channels\x18\x04 \x03(\x0b\x32\x12.api.RegionChannel\x12\x11\n\trx1_delay\x18\x05 \x01(\r\x12\x15\n\rrx1_dr_offset\x18\x06 \x01(\r\x12\x0e\n\x06rx2_dr\x18\x07 \x01(\r\x12\x15\n\rrx2_frequency\x18\x08 \x01(\r\x12\x1c\n\x14\x63lass_b_ping_slot_dr\x18\t \x01(\r\x12#\n\x1b\x63lass_b_ping_slot_frequency\x18\n \x01(\r\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\"B\n\rRegionChannel\x12\x11\n\tfrequency\x18\x01 \x01(\r\x12\x0e\n\x06\x64r_min\x18\x02 \x01(\r\x12\x0e\n\x06\x64r_max\x18\x03 \x01(\r\"%\n\x12GetVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t2\xb9\t\n\x0fInternalService\x12\x30\n\x05Login\x12\x11.api.LoginRequest\x1a\x12.api.LoginResponse\"\x00\x12\x39\n\x07Profile\x12\x16.google.protobuf.Empty\x1a\x14.api.ProfileResponse\"\x00\x12\x45\n\x0cGlobalSearch\x12\x18.api.GlobalSearchRequest\x1a\x19.api.GlobalSearchResponse\"\x00\x12\x45\n\x0c\x43reateApiKey\x12\x18.api.CreateApiKeyRequest\x1a\x19.api.CreateApiKeyResponse\"\x00\x12\x42\n\x0c\x44\x65leteApiKey\x12\x18.api.DeleteApiKeyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x42\n\x0bListApiKeys\x12\x17.api.ListApiKeysRequest\x1a\x18.api.ListApiKeysResponse\"\x00\x12;\n\x08Settings\x12\x16.google.protobuf.Empty\x1a\x15.api.SettingsResponse\"\x00\x12W\n\x12OpenIdConnectLogin\x12\x1e.api.OpenIdConnectLoginRequest\x1a\x1f.api.OpenIdConnectLoginResponse\"\x00\x12\x42\n\x0bOAuth2Login\x12\x17.api.OAuth2LoginRequest\x1a\x18.api.OAuth2LoginResponse\"\x00\x12T\n\x11GetDevicesSummary\x12\x1d.api.GetDevicesSummaryRequest\x1a\x1e.api.GetDevicesSummaryResponse\"\x00\x12W\n\x12GetGatewaysSummary\x12\x1e.api.GetGatewaysSummaryRequest\x1a\x1f.api.GetGatewaysSummaryResponse\"\x00\x12H\n\x13StreamGatewayFrames\x12\x1f.api.StreamGatewayFramesRequest\x1a\x0c.api.LogItem\"\x00\x30\x01\x12\x46\n\x12StreamDeviceFrames\x12\x1e.api.StreamDeviceFramesRequest\x1a\x0c.api.LogItem\"\x00\x30\x01\x12\x46\n\x12StreamDeviceEvents\x12\x1e.api.StreamDeviceEventsRequest\x1a\x0c.api.LogItem\"\x00\x30\x01\x12\x41\n\x0bListRegions\x12\x16.google.protobuf.Empty\x1a\x18.api.ListRegionsResponse\"\x00\x12<\n\tGetRegion\x12\x15.api.GetRegionRequest\x1a\x16.api.GetRegionResponse\"\x00\x12?\n\nGetVersion\x12\x16.google.protobuf.Empty\x1a\x17.api.GetVersionResponse\"\x00\x42\x65\n\x11io.chirpstack.apiB\rInternalProtoP\x01Z.github.com/chirpstack/chirpstack/api/go/v4/api\xaa\x02\x0e\x43hirpstack.Apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -100,6 +100,8 @@ if _descriptor._USE_C_DESCRIPTORS == False: _globals['_GETREGIONRESPONSE']._serialized_end=3014 _globals['_REGIONCHANNEL']._serialized_start=3016 _globals['_REGIONCHANNEL']._serialized_end=3082 - _globals['_INTERNALSERVICE']._serialized_start=3085 - _globals['_INTERNALSERVICE']._serialized_end=4229 + _globals['_GETVERSIONRESPONSE']._serialized_start=3084 + _globals['_GETVERSIONRESPONSE']._serialized_end=3121 + _globals['_INTERNALSERVICE']._serialized_start=3124 + _globals['_INTERNALSERVICE']._serialized_end=4333 # @@protoc_insertion_point(module_scope) diff --git a/api/python/src/chirpstack_api/api/internal_pb2.pyi b/api/python/src/chirpstack_api/api/internal_pb2.pyi index 7cebd6ca..576de429 100644 --- a/api/python/src/chirpstack_api/api/internal_pb2.pyi +++ b/api/python/src/chirpstack_api/api/internal_pb2.pyi @@ -340,3 +340,9 @@ class RegionChannel(_message.Message): dr_min: int dr_max: int def __init__(self, frequency: _Optional[int] = ..., dr_min: _Optional[int] = ..., dr_max: _Optional[int] = ...) -> None: ... + +class GetVersionResponse(_message.Message): + __slots__ = ("version",) + VERSION_FIELD_NUMBER: _ClassVar[int] + version: str + def __init__(self, version: _Optional[str] = ...) -> None: ... diff --git a/api/python/src/chirpstack_api/api/internal_pb2_grpc.py b/api/python/src/chirpstack_api/api/internal_pb2_grpc.py index 806b11ef..a84a2ddb 100644 --- a/api/python/src/chirpstack_api/api/internal_pb2_grpc.py +++ b/api/python/src/chirpstack_api/api/internal_pb2_grpc.py @@ -96,6 +96,11 @@ class InternalServiceStub(object): request_serializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionRequest.SerializeToString, response_deserializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionResponse.FromString, ) + self.GetVersion = channel.unary_unary( + '/api.InternalService/GetVersion', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=chirpstack__api_dot_api_dot_internal__pb2.GetVersionResponse.FromString, + ) class InternalServiceServicer(object): @@ -214,6 +219,13 @@ class InternalServiceServicer(object): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetVersion(self, request, context): + """GetVersion returns the ChirpStack version. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_InternalServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -297,6 +309,11 @@ def add_InternalServiceServicer_to_server(servicer, server): request_deserializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionRequest.FromString, response_serializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionResponse.SerializeToString, ), + 'GetVersion': grpc.unary_unary_rpc_method_handler( + servicer.GetVersion, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=chirpstack__api_dot_api_dot_internal__pb2.GetVersionResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'api.InternalService', rpc_method_handlers) @@ -579,3 +596,20 @@ class InternalService(object): chirpstack__api_dot_api_dot_internal__pb2.GetRegionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetVersion(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.InternalService/GetVersion', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + chirpstack__api_dot_api_dot_internal__pb2.GetVersionResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/api/python/src/chirpstack_api/api/multicast_group_pb2.py b/api/python/src/chirpstack_api/api/multicast_group_pb2.py index 81a02f4e..57658b33 100644 --- a/api/python/src/chirpstack_api/api/multicast_group_pb2.py +++ b/api/python/src/chirpstack_api/api/multicast_group_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/multicast_group.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/relay_pb2.py b/api/python/src/chirpstack_api/api/relay_pb2.py index c92daffb..e03974dd 100644 --- a/api/python/src/chirpstack_api/api/relay_pb2.py +++ b/api/python/src/chirpstack_api/api/relay_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/relay.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/tenant_pb2.py b/api/python/src/chirpstack_api/api/tenant_pb2.py index f354f506..4e0d98fe 100644 --- a/api/python/src/chirpstack_api/api/tenant_pb2.py +++ b/api/python/src/chirpstack_api/api/tenant_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/tenant.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/api/user_pb2.py b/api/python/src/chirpstack_api/api/user_pb2.py index a9d1a5bf..4a483cec 100644 --- a/api/python/src/chirpstack_api/api/user_pb2.py +++ b/api/python/src/chirpstack_api/api/user_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/api/user.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/common/common_pb2.py b/api/python/src/chirpstack_api/common/common_pb2.py index 0ed65ee7..915eb8c6 100644 --- a/api/python/src/chirpstack_api/common/common_pb2.py +++ b/api/python/src/chirpstack_api/common/common_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/common/common.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/gw/gw_pb2.py b/api/python/src/chirpstack_api/gw/gw_pb2.py index 9be173b7..f4ed07f4 100644 --- a/api/python/src/chirpstack_api/gw/gw_pb2.py +++ b/api/python/src/chirpstack_api/gw/gw_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/gw/gw.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/integration/integration_pb2.py b/api/python/src/chirpstack_api/integration/integration_pb2.py index 79adafc6..f6ddabf3 100644 --- a/api/python/src/chirpstack_api/integration/integration_pb2.py +++ b/api/python/src/chirpstack_api/integration/integration_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/integration/integration.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/stream/api_request_pb2.py b/api/python/src/chirpstack_api/stream/api_request_pb2.py index 90dd3369..362ade4b 100644 --- a/api/python/src/chirpstack_api/stream/api_request_pb2.py +++ b/api/python/src/chirpstack_api/stream/api_request_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/stream/api_request.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/stream/backend_interfaces_pb2.py b/api/python/src/chirpstack_api/stream/backend_interfaces_pb2.py index 783eb8ef..82bb123e 100644 --- a/api/python/src/chirpstack_api/stream/backend_interfaces_pb2.py +++ b/api/python/src/chirpstack_api/stream/backend_interfaces_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/stream/backend_interfaces.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/stream/frame_pb2.py b/api/python/src/chirpstack_api/stream/frame_pb2.py index 73287e5b..09f291bb 100644 --- a/api/python/src/chirpstack_api/stream/frame_pb2.py +++ b/api/python/src/chirpstack_api/stream/frame_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/stream/frame.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/python/src/chirpstack_api/stream/meta_pb2.py b/api/python/src/chirpstack_api/stream/meta_pb2.py index 09beffca..d7018a26 100644 --- a/api/python/src/chirpstack_api/stream/meta_pb2.py +++ b/api/python/src/chirpstack_api/stream/meta_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: chirpstack-api/stream/meta.proto -# Protobuf Python Version: 4.25.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool diff --git a/api/rust/proto/chirpstack/api/internal.proto b/api/rust/proto/chirpstack/api/internal.proto index 0b72d54c..d033e252 100644 --- a/api/rust/proto/chirpstack/api/internal.proto +++ b/api/rust/proto/chirpstack/api/internal.proto @@ -66,6 +66,9 @@ service InternalService { // GetRegion returns the region details for the given region. rpc GetRegion(GetRegionRequest) returns (GetRegionResponse) {} + + // GetVersion returns the ChirpStack version. + rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse) {} } message ApiKey { @@ -414,3 +417,8 @@ message RegionChannel { // Max DR. uint32 dr_max = 3; } + +message GetVersionResponse { + // version + string version = 1; +} diff --git a/chirpstack/src/api/internal.rs b/chirpstack/src/api/internal.rs index 1add5f7e..456aa8b1 100644 --- a/chirpstack/src/api/internal.rs +++ b/chirpstack/src/api/internal.rs @@ -963,4 +963,17 @@ impl InternalService for Internal { Ok(Response::new(out)) } + + async fn get_version( + &self, + request: Request<()>, + ) -> Result, Status> { + self.validator + .validate(request.extensions(), validator::ValidateIsAdmin::new()) + .await?; + + Ok(Response::new(api::GetVersionResponse { + version: env!("CARGO_PKG_VERSION").to_string(), + })) + } } diff --git a/ui/src/components/Menu.tsx b/ui/src/components/Menu.tsx index 73da121e..52e77b1c 100644 --- a/ui/src/components/Menu.tsx +++ b/ui/src/components/Menu.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from "react"; import { Link, useLocation, useNavigate } from "react-router-dom"; -import { Menu, MenuProps } from "antd"; +import { Menu, MenuProps, Typography } from "antd"; import { CloudOutlined, HomeOutlined, @@ -20,13 +20,18 @@ import { ListTenantsResponse, } from "@chirpstack/chirpstack-api-grpc-web/api/tenant_pb"; +import { GetVersionResponse } from "@chirpstack/chirpstack-api-grpc-web/api/internal_pb"; + import Autocomplete, { OptionCallbackFunc, OptionsCallbackFunc } from "../components/Autocomplete"; +import Admin from "../components/Admin"; import TenantStore from "../stores/TenantStore"; import SessionStore from "../stores/SessionStore"; +import InternalStore from "../stores/InternalStore"; function SideMenu() { const [tenantId, setTenantId] = useState(""); const [selectedKey, setSelectedKey] = useState(""); + const [version, setVersion] = useState(""); const location = useLocation(); const navigate = useNavigate(); @@ -136,6 +141,12 @@ function SideMenu() { setTenant(); parseLocation(); + if (SessionStore.isAdmin()) { + InternalStore.getVersion((resp: GetVersionResponse) => { + setVersion(resp.getVersion()); + }); + } + return () => { SessionStore.removeListener("tenant.change", setTenant); }; @@ -244,7 +255,7 @@ function SideMenu() {
} items={items} /> + + + Version: v{version} + + ); } diff --git a/ui/src/index.css b/ui/src/index.css index 19ae77a8..6d8b8d6f 100644 --- a/ui/src/index.css +++ b/ui/src/index.css @@ -36,12 +36,18 @@ left: 0; } -.layout-menu .organiation-select { +.layout-menu .tenant-select { margin-left: 24px; margin-bottom: 12px; width: 252px; } +.layout-menu .version { + display: block; + margin-left: 24px; + margin-top: 12px; +} + .layout-content { margin-top: 65px; } diff --git a/ui/src/stores/InternalStore.ts b/ui/src/stores/InternalStore.ts index 43293f61..650ac29c 100644 --- a/ui/src/stores/InternalStore.ts +++ b/ui/src/stores/InternalStore.ts @@ -24,6 +24,7 @@ import { ListRegionsResponse, GetRegionRequest, GetRegionResponse, + GetVersionResponse, } from "@chirpstack/chirpstack-api-grpc-web/api/internal_pb"; import SessionStore from "./SessionStore"; @@ -224,6 +225,17 @@ class InternalStore extends EventEmitter { callbackFunc(resp); }); }; + + getVersion = (callbackFunc: (resp: GetVersionResponse) => void) => { + this.client.getVersion(new google_protobuf_empty_pb.Empty(), SessionStore.getMetadata(), (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + }; } const internalStore = new InternalStore();