From d8f9194b1bcf84bd3b9de1bd2c4be94155dc3e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Go=C3=B1i?= Date: Thu, 12 Feb 2026 16:44:13 -0300 Subject: [PATCH 1/7] Add support for health data --- api/componentsv2/scanoss-components.pb.go | 419 +++++++++++++++--- api/componentsv2/scanoss-components.pb.gw.go | 140 ++++++ .../scanoss-components_grpc.pb.go | 80 ++++ .../components/v2/scanoss-components.proto | 73 +++ .../v2/scanoss-components.swagger.json | 183 ++++++++ 5 files changed, 829 insertions(+), 66 deletions(-) diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index a3c4057..8ec2deb 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -265,6 +265,121 @@ func (x *ComponentsStatisticResponse) GetStatus() *commonv2.StatusResponse { return nil } +type ComponentStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Purl string `protobuf:"bytes,1,opt,name=purl,proto3" json:"purl,omitempty"` + VersionStatus *ComponentStatusResponse_VersionStatus `protobuf:"bytes,2,opt,name=version_status,proto3" json:"version_status,omitempty"` + ComponentStatus *ComponentStatusResponse_ComponentStatus `protobuf:"bytes,3,opt,name=component_status,proto3" json:"component_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComponentStatusResponse) Reset() { + *x = ComponentStatusResponse{} + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComponentStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComponentStatusResponse) ProtoMessage() {} + +func (x *ComponentStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComponentStatusResponse.ProtoReflect.Descriptor instead. +func (*ComponentStatusResponse) Descriptor() ([]byte, []int) { + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3} +} + +func (x *ComponentStatusResponse) GetPurl() string { + if x != nil { + return x.Purl + } + return "" +} + +func (x *ComponentStatusResponse) GetVersionStatus() *ComponentStatusResponse_VersionStatus { + if x != nil { + return x.VersionStatus + } + return nil +} + +func (x *ComponentStatusResponse) GetComponentStatus() *ComponentStatusResponse_ComponentStatus { + if x != nil { + return x.ComponentStatus + } + return nil +} + +// Component Statistics response data (JSON payload) +type ComponentsStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Component status + ComponentStatus []*ComponentStatusResponse `protobuf:"bytes,1,rep,name=component_status,json=components,proto3" json:"component_status,omitempty"` + // Response status + Status *commonv2.StatusResponse `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComponentsStatusResponse) Reset() { + *x = ComponentsStatusResponse{} + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComponentsStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComponentsStatusResponse) ProtoMessage() {} + +func (x *ComponentsStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComponentsStatusResponse.ProtoReflect.Descriptor instead. +func (*ComponentsStatusResponse) Descriptor() ([]byte, []int) { + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{4} +} + +func (x *ComponentsStatusResponse) GetComponentStatus() []*ComponentStatusResponse { + if x != nil { + return x.ComponentStatus + } + return nil +} + +func (x *ComponentsStatusResponse) GetStatus() *commonv2.StatusResponse { + if x != nil { + return x.Status + } + return nil +} + // Component Search response data (JSON payload) type CompSearchResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -278,7 +393,7 @@ type CompSearchResponse struct { func (x *CompSearchResponse) Reset() { *x = CompSearchResponse{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[3] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -290,7 +405,7 @@ func (x *CompSearchResponse) String() string { func (*CompSearchResponse) ProtoMessage() {} func (x *CompSearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[3] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -303,7 +418,7 @@ func (x *CompSearchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CompSearchResponse.ProtoReflect.Descriptor instead. func (*CompSearchResponse) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{5} } func (x *CompSearchResponse) GetComponents() []*CompSearchResponse_Component { @@ -333,7 +448,7 @@ type CompVersionRequest struct { func (x *CompVersionRequest) Reset() { *x = CompVersionRequest{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[4] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -345,7 +460,7 @@ func (x *CompVersionRequest) String() string { func (*CompVersionRequest) ProtoMessage() {} func (x *CompVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[4] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -358,7 +473,7 @@ func (x *CompVersionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CompVersionRequest.ProtoReflect.Descriptor instead. func (*CompVersionRequest) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{4} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{6} } func (x *CompVersionRequest) GetPurl() string { @@ -388,7 +503,7 @@ type CompVersionResponse struct { func (x *CompVersionResponse) Reset() { *x = CompVersionResponse{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[5] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -400,7 +515,7 @@ func (x *CompVersionResponse) String() string { func (*CompVersionResponse) ProtoMessage() {} func (x *CompVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[5] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -413,7 +528,7 @@ func (x *CompVersionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CompVersionResponse.ProtoReflect.Descriptor instead. func (*CompVersionResponse) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{5} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{7} } func (x *CompVersionResponse) GetComponent() *CompVersionResponse_Component { @@ -440,7 +555,7 @@ type CompStatistic_Language struct { func (x *CompStatistic_Language) Reset() { *x = CompStatistic_Language{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[6] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -452,7 +567,7 @@ func (x *CompStatistic_Language) String() string { func (*CompStatistic_Language) ProtoMessage() {} func (x *CompStatistic_Language) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[6] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -493,7 +608,7 @@ type ComponentsStatisticResponse_ComponentStatistics struct { func (x *ComponentsStatisticResponse_ComponentStatistics) Reset() { *x = ComponentsStatisticResponse_ComponentStatistics{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[7] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -505,7 +620,7 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) String() string { func (*ComponentsStatisticResponse_ComponentStatistics) ProtoMessage() {} func (x *ComponentsStatisticResponse_ComponentStatistics) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[7] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -542,6 +657,142 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) GetStatistics() *CompS return nil } +type ComponentStatusResponse_VersionStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + IndexedDate string `protobuf:"bytes,3,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` + CheckDate string `protobuf:"bytes,4,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComponentStatusResponse_VersionStatus) Reset() { + *x = ComponentStatusResponse_VersionStatus{} + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComponentStatusResponse_VersionStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComponentStatusResponse_VersionStatus) ProtoMessage() {} + +func (x *ComponentStatusResponse_VersionStatus) ProtoReflect() protoreflect.Message { + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComponentStatusResponse_VersionStatus.ProtoReflect.Descriptor instead. +func (*ComponentStatusResponse_VersionStatus) Descriptor() ([]byte, []int) { + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ComponentStatusResponse_VersionStatus) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ComponentStatusResponse_VersionStatus) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ComponentStatusResponse_VersionStatus) GetIndexedDate() string { + if x != nil { + return x.IndexedDate + } + return "" +} + +func (x *ComponentStatusResponse_VersionStatus) GetCheckDate() string { + if x != nil { + return x.CheckDate + } + return "" +} + +type ComponentStatusResponse_ComponentStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + FirstIndexedDate string `protobuf:"bytes,3,opt,name=first_indexed_date,json=firstIndexedDate,proto3" json:"first_indexed_date,omitempty"` + LastIndexedDate string `protobuf:"bytes,4,opt,name=last_indexed_date,json=lastIndexedDate,proto3" json:"last_indexed_date,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComponentStatusResponse_ComponentStatus) Reset() { + *x = ComponentStatusResponse_ComponentStatus{} + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComponentStatusResponse_ComponentStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComponentStatusResponse_ComponentStatus) ProtoMessage() {} + +func (x *ComponentStatusResponse_ComponentStatus) ProtoReflect() protoreflect.Message { + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComponentStatusResponse_ComponentStatus.ProtoReflect.Descriptor instead. +func (*ComponentStatusResponse_ComponentStatus) Descriptor() ([]byte, []int) { + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *ComponentStatusResponse_ComponentStatus) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ComponentStatusResponse_ComponentStatus) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ComponentStatusResponse_ComponentStatus) GetFirstIndexedDate() string { + if x != nil { + return x.FirstIndexedDate + } + return "" +} + +func (x *ComponentStatusResponse_ComponentStatus) GetLastIndexedDate() string { + if x != nil { + return x.LastIndexedDate + } + return "" +} + // Component details type CompSearchResponse_Component struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -556,7 +807,7 @@ type CompSearchResponse_Component struct { func (x *CompSearchResponse_Component) Reset() { *x = CompSearchResponse_Component{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[8] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -568,7 +819,7 @@ func (x *CompSearchResponse_Component) String() string { func (*CompSearchResponse_Component) ProtoMessage() {} func (x *CompSearchResponse_Component) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[8] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -581,7 +832,7 @@ func (x *CompSearchResponse_Component) ProtoReflect() protoreflect.Message { // Deprecated: Use CompSearchResponse_Component.ProtoReflect.Descriptor instead. func (*CompSearchResponse_Component) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3, 0} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{5, 0} } // Deprecated: Marked as deprecated in scanoss/api/components/v2/scanoss-components.proto. @@ -626,7 +877,7 @@ type CompVersionResponse_License struct { func (x *CompVersionResponse_License) Reset() { *x = CompVersionResponse_License{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[9] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -638,7 +889,7 @@ func (x *CompVersionResponse_License) String() string { func (*CompVersionResponse_License) ProtoMessage() {} func (x *CompVersionResponse_License) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[9] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -651,7 +902,7 @@ func (x *CompVersionResponse_License) ProtoReflect() protoreflect.Message { // Deprecated: Use CompVersionResponse_License.ProtoReflect.Descriptor instead. func (*CompVersionResponse_License) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{5, 0} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{7, 0} } func (x *CompVersionResponse_License) GetName() string { @@ -695,7 +946,7 @@ type CompVersionResponse_Version struct { func (x *CompVersionResponse_Version) Reset() { *x = CompVersionResponse_Version{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[10] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -707,7 +958,7 @@ func (x *CompVersionResponse_Version) String() string { func (*CompVersionResponse_Version) ProtoMessage() {} func (x *CompVersionResponse_Version) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[10] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -720,7 +971,7 @@ func (x *CompVersionResponse_Version) ProtoReflect() protoreflect.Message { // Deprecated: Use CompVersionResponse_Version.ProtoReflect.Descriptor instead. func (*CompVersionResponse_Version) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{5, 1} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{7, 1} } func (x *CompVersionResponse_Version) GetVersion() string { @@ -759,7 +1010,7 @@ type CompVersionResponse_Component struct { func (x *CompVersionResponse_Component) Reset() { *x = CompVersionResponse_Component{} - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[11] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -771,7 +1022,7 @@ func (x *CompVersionResponse_Component) String() string { func (*CompVersionResponse_Component) ProtoMessage() {} func (x *CompVersionResponse_Component) ProtoReflect() protoreflect.Message { - mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[11] + mi := &file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -784,7 +1035,7 @@ func (x *CompVersionResponse_Component) ProtoReflect() protoreflect.Message { // Deprecated: Use CompVersionResponse_Component.ProtoReflect.Descriptor instead. func (*CompVersionResponse_Component) Descriptor() ([]byte, []int) { - return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{5, 2} + return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{7, 2} } // Deprecated: Marked as deprecated in scanoss/api/components/v2/scanoss-components.proto. @@ -853,7 +1104,28 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\n" + "statistics\x18\x03 \x01(\v2(.scanoss.api.components.v2.CompStatisticR\n" + "statistics:\xea\x02\x92A\xe6\x02\n" + - "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\x8b\x05\n" + + "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xc7\x06\n" + + "\x17ComponentStatusResponse\x12\x12\n" + + "\x04purl\x18\x01 \x01(\tR\x04purl\x12h\n" + + "\x0eversion_status\x18\x02 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + + "\x10component_status\x18\x03 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a}\n" + + "\rVersionStatus\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12!\n" + + "\findexed_date\x18\x03 \x01(\tR\vindexedDate\x12\x1d\n" + + "\n" + + "check_date\x18\x04 \x01(\tR\tcheckDate\x1a\x97\x01\n" + + "\x0fComponentStatus\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12,\n" + + "\x12first_indexed_date\x18\x03 \x01(\tR\x10firstIndexedDate\x12*\n" + + "\x11last_indexed_date\x18\x04 \x01(\tR\x0flastIndexedDate:\xa4\x02\x92A\xa0\x02\n" + + "\x9d\x02J\x9a\x02 { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } \"\xeb\x03\n" + + "\x18ComponentsStatusResponse\x12X\n" + + "\x10component_status\x18\x01 \x03(\v22.scanoss.api.components.v2.ComponentStatusResponseR\n" + + "components\x12=\n" + + "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xb5\x02\x92A\xb1\x02\n" + + "\xae\x02J\xab\x02{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ]}\"\x8b\x05\n" + "\x12CompSearchResponse\x12W\n" + "\n" + "components\x18\x01 \x03(\v27.scanoss.api.components.v2.CompSearchResponse.ComponentR\n" + @@ -887,13 +1159,15 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\x03url\x18\x03 \x01(\tR\x03url\x12R\n" + "\bversions\x18\x04 \x03(\v26.scanoss.api.components.v2.CompVersionResponse.VersionR\bversions\x12\x12\n" + "\x04name\x18\x05 \x01(\tR\x04name:\xcc\x03\x92A\xc8\x03\n" + - "\xc5\x03J\xc2\x03{\"component\": {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"versions\": [{\"version\": \"5.0.0\", \"licenses\": [{\"name\": \"GNU General Public License v2.0\", \"spdx_id\": \"GPL-2.0\", \"is_spdx_approved\": true, \"url\": \"https://spdx.org/licenses/GPL-2.0.html\"}], \"date\": \"2024-01-15T10:30:00Z\"}], \"component\": \"engine\"}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component versions successfully retrieved\"}}2\xca\x04\n" + + "\xc5\x03J\xc2\x03{\"component\": {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"versions\": [{\"version\": \"5.0.0\", \"licenses\": [{\"name\": \"GNU General Public License v2.0\", \"spdx_id\": \"GPL-2.0\", \"is_spdx_approved\": true, \"url\": \"https://spdx.org/licenses/GPL-2.0.html\"}], \"date\": \"2024-01-15T10:30:00Z\"}], \"component\": \"engine\"}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component versions successfully retrieved\"}}2\xf6\x06\n" + "\n" + "Components\x12o\n" + "\x04Echo\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/v2/components/echo\x12\x8e\x01\n" + "\x10SearchComponents\x12,.scanoss.api.components.v2.CompSearchRequest\x1a-.scanoss.api.components.v2.CompSearchResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v2/components/search\x12\x96\x01\n" + "\x14GetComponentVersions\x12-.scanoss.api.components.v2.CompVersionRequest\x1a..scanoss.api.components.v2.CompVersionResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v2/components/versions\x12\xa0\x01\n" + - "\x16GetComponentStatistics\x12(.scanoss.api.common.v2.ComponentsRequest\x1a6.scanoss.api.components.v2.ComponentsStatisticResponse\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v2/components/statisticsB\x8b\x03\x92A\xd0\x02\x12\x9d\x01\n" + + "\x16GetComponentStatistics\x12(.scanoss.api.common.v2.ComponentsRequest\x1a6.scanoss.api.components.v2.ComponentsStatisticResponse\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v2/components/statistics\x12\x90\x01\n" + + "\x12GetComponentStatus\x12'.scanoss.api.common.v2.ComponentRequest\x1a2.scanoss.api.components.v2.ComponentStatusResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v2/components/status\x12\x96\x01\n" + + "\x13GetComponentsStatus\x12(.scanoss.api.common.v2.ComponentsRequest\x1a3.scanoss.api.components.v2.ComponentsStatusResponse\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/v2/components/statusB\x8b\x03\x92A\xd0\x02\x12\x9d\x01\n" + "\x1aSCANOSS Components Service\x12(Provides component intelligence services\"P\n" + "\x12scanoss-components\x12%https://github.com/scanoss/components\x1a\x13support@scanoss.com2\x032.0\x1a\x0fapi.scanoss.com*\x02\x02\x012\x10application/json:\x10application/jsonR;\n" + "\x03404\x124\n" + @@ -914,49 +1188,62 @@ func file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP() []byt return file_scanoss_api_components_v2_scanoss_components_proto_rawDescData } -var file_scanoss_api_components_v2_scanoss_components_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_scanoss_api_components_v2_scanoss_components_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_scanoss_api_components_v2_scanoss_components_proto_goTypes = []any{ (*CompSearchRequest)(nil), // 0: scanoss.api.components.v2.CompSearchRequest (*CompStatistic)(nil), // 1: scanoss.api.components.v2.CompStatistic (*ComponentsStatisticResponse)(nil), // 2: scanoss.api.components.v2.ComponentsStatisticResponse - (*CompSearchResponse)(nil), // 3: scanoss.api.components.v2.CompSearchResponse - (*CompVersionRequest)(nil), // 4: scanoss.api.components.v2.CompVersionRequest - (*CompVersionResponse)(nil), // 5: scanoss.api.components.v2.CompVersionResponse - (*CompStatistic_Language)(nil), // 6: scanoss.api.components.v2.CompStatistic.Language - (*ComponentsStatisticResponse_ComponentStatistics)(nil), // 7: scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics - (*CompSearchResponse_Component)(nil), // 8: scanoss.api.components.v2.CompSearchResponse.Component - (*CompVersionResponse_License)(nil), // 9: scanoss.api.components.v2.CompVersionResponse.License - (*CompVersionResponse_Version)(nil), // 10: scanoss.api.components.v2.CompVersionResponse.Version - (*CompVersionResponse_Component)(nil), // 11: scanoss.api.components.v2.CompVersionResponse.Component - (*commonv2.StatusResponse)(nil), // 12: scanoss.api.common.v2.StatusResponse - (*commonv2.EchoRequest)(nil), // 13: scanoss.api.common.v2.EchoRequest - (*commonv2.ComponentsRequest)(nil), // 14: scanoss.api.common.v2.ComponentsRequest - (*commonv2.EchoResponse)(nil), // 15: scanoss.api.common.v2.EchoResponse + (*ComponentStatusResponse)(nil), // 3: scanoss.api.components.v2.ComponentStatusResponse + (*ComponentsStatusResponse)(nil), // 4: scanoss.api.components.v2.ComponentsStatusResponse + (*CompSearchResponse)(nil), // 5: scanoss.api.components.v2.CompSearchResponse + (*CompVersionRequest)(nil), // 6: scanoss.api.components.v2.CompVersionRequest + (*CompVersionResponse)(nil), // 7: scanoss.api.components.v2.CompVersionResponse + (*CompStatistic_Language)(nil), // 8: scanoss.api.components.v2.CompStatistic.Language + (*ComponentsStatisticResponse_ComponentStatistics)(nil), // 9: scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics + (*ComponentStatusResponse_VersionStatus)(nil), // 10: scanoss.api.components.v2.ComponentStatusResponse.VersionStatus + (*ComponentStatusResponse_ComponentStatus)(nil), // 11: scanoss.api.components.v2.ComponentStatusResponse.ComponentStatus + (*CompSearchResponse_Component)(nil), // 12: scanoss.api.components.v2.CompSearchResponse.Component + (*CompVersionResponse_License)(nil), // 13: scanoss.api.components.v2.CompVersionResponse.License + (*CompVersionResponse_Version)(nil), // 14: scanoss.api.components.v2.CompVersionResponse.Version + (*CompVersionResponse_Component)(nil), // 15: scanoss.api.components.v2.CompVersionResponse.Component + (*commonv2.StatusResponse)(nil), // 16: scanoss.api.common.v2.StatusResponse + (*commonv2.EchoRequest)(nil), // 17: scanoss.api.common.v2.EchoRequest + (*commonv2.ComponentsRequest)(nil), // 18: scanoss.api.common.v2.ComponentsRequest + (*commonv2.ComponentRequest)(nil), // 19: scanoss.api.common.v2.ComponentRequest + (*commonv2.EchoResponse)(nil), // 20: scanoss.api.common.v2.EchoResponse } var file_scanoss_api_components_v2_scanoss_components_proto_depIdxs = []int32{ - 6, // 0: scanoss.api.components.v2.CompStatistic.languages:type_name -> scanoss.api.components.v2.CompStatistic.Language - 7, // 1: scanoss.api.components.v2.ComponentsStatisticResponse.component_statistics:type_name -> scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics - 12, // 2: scanoss.api.components.v2.ComponentsStatisticResponse.status:type_name -> scanoss.api.common.v2.StatusResponse - 8, // 3: scanoss.api.components.v2.CompSearchResponse.components:type_name -> scanoss.api.components.v2.CompSearchResponse.Component - 12, // 4: scanoss.api.components.v2.CompSearchResponse.status:type_name -> scanoss.api.common.v2.StatusResponse - 11, // 5: scanoss.api.components.v2.CompVersionResponse.component:type_name -> scanoss.api.components.v2.CompVersionResponse.Component - 12, // 6: scanoss.api.components.v2.CompVersionResponse.status:type_name -> scanoss.api.common.v2.StatusResponse - 1, // 7: scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics.statistics:type_name -> scanoss.api.components.v2.CompStatistic - 9, // 8: scanoss.api.components.v2.CompVersionResponse.Version.licenses:type_name -> scanoss.api.components.v2.CompVersionResponse.License - 10, // 9: scanoss.api.components.v2.CompVersionResponse.Component.versions:type_name -> scanoss.api.components.v2.CompVersionResponse.Version - 13, // 10: scanoss.api.components.v2.Components.Echo:input_type -> scanoss.api.common.v2.EchoRequest - 0, // 11: scanoss.api.components.v2.Components.SearchComponents:input_type -> scanoss.api.components.v2.CompSearchRequest - 4, // 12: scanoss.api.components.v2.Components.GetComponentVersions:input_type -> scanoss.api.components.v2.CompVersionRequest - 14, // 13: scanoss.api.components.v2.Components.GetComponentStatistics:input_type -> scanoss.api.common.v2.ComponentsRequest - 15, // 14: scanoss.api.components.v2.Components.Echo:output_type -> scanoss.api.common.v2.EchoResponse - 3, // 15: scanoss.api.components.v2.Components.SearchComponents:output_type -> scanoss.api.components.v2.CompSearchResponse - 5, // 16: scanoss.api.components.v2.Components.GetComponentVersions:output_type -> scanoss.api.components.v2.CompVersionResponse - 2, // 17: scanoss.api.components.v2.Components.GetComponentStatistics:output_type -> scanoss.api.components.v2.ComponentsStatisticResponse - 14, // [14:18] is the sub-list for method output_type - 10, // [10:14] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 8, // 0: scanoss.api.components.v2.CompStatistic.languages:type_name -> scanoss.api.components.v2.CompStatistic.Language + 9, // 1: scanoss.api.components.v2.ComponentsStatisticResponse.component_statistics:type_name -> scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics + 16, // 2: scanoss.api.components.v2.ComponentsStatisticResponse.status:type_name -> scanoss.api.common.v2.StatusResponse + 10, // 3: scanoss.api.components.v2.ComponentStatusResponse.version_status:type_name -> scanoss.api.components.v2.ComponentStatusResponse.VersionStatus + 11, // 4: scanoss.api.components.v2.ComponentStatusResponse.component_status:type_name -> scanoss.api.components.v2.ComponentStatusResponse.ComponentStatus + 3, // 5: scanoss.api.components.v2.ComponentsStatusResponse.component_status:type_name -> scanoss.api.components.v2.ComponentStatusResponse + 16, // 6: scanoss.api.components.v2.ComponentsStatusResponse.status:type_name -> scanoss.api.common.v2.StatusResponse + 12, // 7: scanoss.api.components.v2.CompSearchResponse.components:type_name -> scanoss.api.components.v2.CompSearchResponse.Component + 16, // 8: scanoss.api.components.v2.CompSearchResponse.status:type_name -> scanoss.api.common.v2.StatusResponse + 15, // 9: scanoss.api.components.v2.CompVersionResponse.component:type_name -> scanoss.api.components.v2.CompVersionResponse.Component + 16, // 10: scanoss.api.components.v2.CompVersionResponse.status:type_name -> scanoss.api.common.v2.StatusResponse + 1, // 11: scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics.statistics:type_name -> scanoss.api.components.v2.CompStatistic + 13, // 12: scanoss.api.components.v2.CompVersionResponse.Version.licenses:type_name -> scanoss.api.components.v2.CompVersionResponse.License + 14, // 13: scanoss.api.components.v2.CompVersionResponse.Component.versions:type_name -> scanoss.api.components.v2.CompVersionResponse.Version + 17, // 14: scanoss.api.components.v2.Components.Echo:input_type -> scanoss.api.common.v2.EchoRequest + 0, // 15: scanoss.api.components.v2.Components.SearchComponents:input_type -> scanoss.api.components.v2.CompSearchRequest + 6, // 16: scanoss.api.components.v2.Components.GetComponentVersions:input_type -> scanoss.api.components.v2.CompVersionRequest + 18, // 17: scanoss.api.components.v2.Components.GetComponentStatistics:input_type -> scanoss.api.common.v2.ComponentsRequest + 19, // 18: scanoss.api.components.v2.Components.GetComponentStatus:input_type -> scanoss.api.common.v2.ComponentRequest + 18, // 19: scanoss.api.components.v2.Components.GetComponentsStatus:input_type -> scanoss.api.common.v2.ComponentsRequest + 20, // 20: scanoss.api.components.v2.Components.Echo:output_type -> scanoss.api.common.v2.EchoResponse + 5, // 21: scanoss.api.components.v2.Components.SearchComponents:output_type -> scanoss.api.components.v2.CompSearchResponse + 7, // 22: scanoss.api.components.v2.Components.GetComponentVersions:output_type -> scanoss.api.components.v2.CompVersionResponse + 2, // 23: scanoss.api.components.v2.Components.GetComponentStatistics:output_type -> scanoss.api.components.v2.ComponentsStatisticResponse + 3, // 24: scanoss.api.components.v2.Components.GetComponentStatus:output_type -> scanoss.api.components.v2.ComponentStatusResponse + 4, // 25: scanoss.api.components.v2.Components.GetComponentsStatus:output_type -> scanoss.api.components.v2.ComponentsStatusResponse + 20, // [20:26] is the sub-list for method output_type + 14, // [14:20] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_scanoss_api_components_v2_scanoss_components_proto_init() } @@ -970,7 +1257,7 @@ func file_scanoss_api_components_v2_scanoss_components_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_scanoss_api_components_v2_scanoss_components_proto_rawDesc), len(file_scanoss_api_components_v2_scanoss_components_proto_rawDesc)), NumEnums: 0, - NumMessages: 12, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/api/componentsv2/scanoss-components.pb.gw.go b/api/componentsv2/scanoss-components.pb.gw.go index 0279e70..11d0a33 100644 --- a/api/componentsv2/scanoss-components.pb.gw.go +++ b/api/componentsv2/scanoss-components.pb.gw.go @@ -160,6 +160,68 @@ func local_request_Components_GetComponentStatistics_0(ctx context.Context, mars return msg, metadata, err } +var filter_Components_GetComponentStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + +func request_Components_GetComponentStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq commonv2.ComponentRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Components_GetComponentStatus_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.GetComponentStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Components_GetComponentStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq commonv2.ComponentRequest + metadata runtime.ServerMetadata + ) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Components_GetComponentStatus_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.GetComponentStatus(ctx, &protoReq) + return msg, metadata, err +} + +func request_Components_GetComponentsStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq commonv2.ComponentsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } + msg, err := client.GetComponentsStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Components_GetComponentsStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq commonv2.ComponentsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.GetComponentsStatus(ctx, &protoReq) + return msg, metadata, err +} + // RegisterComponentsHandlerServer registers the http handlers for service Components to "mux". // UnaryRPC :call ComponentsServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -246,6 +308,46 @@ func RegisterComponentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, } forward_Components_GetComponentStatistics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodGet, pattern_Components_GetComponentStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Components_GetComponentStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Components_GetComponentStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Components_GetComponentsStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentsStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Components_GetComponentsStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Components_GetComponentsStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -354,6 +456,40 @@ func RegisterComponentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, } forward_Components_GetComponentStatistics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodGet, pattern_Components_GetComponentStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Components_GetComponentStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Components_GetComponentStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle(http.MethodPost, pattern_Components_GetComponentsStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentsStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Components_GetComponentsStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_Components_GetComponentsStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -362,6 +498,8 @@ var ( pattern_Components_SearchComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "search"}, "")) pattern_Components_GetComponentVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "versions"}, "")) pattern_Components_GetComponentStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "statistics"}, "")) + pattern_Components_GetComponentStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "status"}, "")) + pattern_Components_GetComponentsStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "status"}, "")) ) var ( @@ -369,4 +507,6 @@ var ( forward_Components_SearchComponents_0 = runtime.ForwardResponseMessage forward_Components_GetComponentVersions_0 = runtime.ForwardResponseMessage forward_Components_GetComponentStatistics_0 = runtime.ForwardResponseMessage + forward_Components_GetComponentStatus_0 = runtime.ForwardResponseMessage + forward_Components_GetComponentsStatus_0 = runtime.ForwardResponseMessage ) diff --git a/api/componentsv2/scanoss-components_grpc.pb.go b/api/componentsv2/scanoss-components_grpc.pb.go index 309bc38..0b975ae 100644 --- a/api/componentsv2/scanoss-components_grpc.pb.go +++ b/api/componentsv2/scanoss-components_grpc.pb.go @@ -51,6 +51,8 @@ const ( Components_SearchComponents_FullMethodName = "/scanoss.api.components.v2.Components/SearchComponents" Components_GetComponentVersions_FullMethodName = "/scanoss.api.components.v2.Components/GetComponentVersions" Components_GetComponentStatistics_FullMethodName = "/scanoss.api.components.v2.Components/GetComponentStatistics" + Components_GetComponentStatus_FullMethodName = "/scanoss.api.components.v2.Components/GetComponentStatus" + Components_GetComponentsStatus_FullMethodName = "/scanoss.api.components.v2.Components/GetComponentsStatus" ) // ComponentsClient is the client API for Components service. @@ -67,6 +69,10 @@ type ComponentsClient interface { GetComponentVersions(ctx context.Context, in *CompVersionRequest, opts ...grpc.CallOption) (*CompVersionResponse, error) // Get the statistics for the specified components GetComponentStatistics(ctx context.Context, in *commonv2.ComponentsRequest, opts ...grpc.CallOption) (*ComponentsStatisticResponse, error) + // Get status information for a specific purl + GetComponentStatus(ctx context.Context, in *commonv2.ComponentRequest, opts ...grpc.CallOption) (*ComponentStatusResponse, error) + // Get the statistics for the specified components + GetComponentsStatus(ctx context.Context, in *commonv2.ComponentsRequest, opts ...grpc.CallOption) (*ComponentsStatusResponse, error) } type componentsClient struct { @@ -117,6 +123,26 @@ func (c *componentsClient) GetComponentStatistics(ctx context.Context, in *commo return out, nil } +func (c *componentsClient) GetComponentStatus(ctx context.Context, in *commonv2.ComponentRequest, opts ...grpc.CallOption) (*ComponentStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ComponentStatusResponse) + err := c.cc.Invoke(ctx, Components_GetComponentStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *componentsClient) GetComponentsStatus(ctx context.Context, in *commonv2.ComponentsRequest, opts ...grpc.CallOption) (*ComponentsStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ComponentsStatusResponse) + err := c.cc.Invoke(ctx, Components_GetComponentsStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // ComponentsServer is the server API for Components service. // All implementations must embed UnimplementedComponentsServer // for forward compatibility. @@ -131,6 +157,10 @@ type ComponentsServer interface { GetComponentVersions(context.Context, *CompVersionRequest) (*CompVersionResponse, error) // Get the statistics for the specified components GetComponentStatistics(context.Context, *commonv2.ComponentsRequest) (*ComponentsStatisticResponse, error) + // Get status information for a specific purl + GetComponentStatus(context.Context, *commonv2.ComponentRequest) (*ComponentStatusResponse, error) + // Get the statistics for the specified components + GetComponentsStatus(context.Context, *commonv2.ComponentsRequest) (*ComponentsStatusResponse, error) mustEmbedUnimplementedComponentsServer() } @@ -153,6 +183,12 @@ func (UnimplementedComponentsServer) GetComponentVersions(context.Context, *Comp func (UnimplementedComponentsServer) GetComponentStatistics(context.Context, *commonv2.ComponentsRequest) (*ComponentsStatisticResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetComponentStatistics not implemented") } +func (UnimplementedComponentsServer) GetComponentStatus(context.Context, *commonv2.ComponentRequest) (*ComponentStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetComponentStatus not implemented") +} +func (UnimplementedComponentsServer) GetComponentsStatus(context.Context, *commonv2.ComponentsRequest) (*ComponentsStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetComponentsStatus not implemented") +} func (UnimplementedComponentsServer) mustEmbedUnimplementedComponentsServer() {} func (UnimplementedComponentsServer) testEmbeddedByValue() {} @@ -246,6 +282,42 @@ func _Components_GetComponentStatistics_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _Components_GetComponentStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(commonv2.ComponentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ComponentsServer).GetComponentStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Components_GetComponentStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ComponentsServer).GetComponentStatus(ctx, req.(*commonv2.ComponentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Components_GetComponentsStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(commonv2.ComponentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ComponentsServer).GetComponentsStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Components_GetComponentsStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ComponentsServer).GetComponentsStatus(ctx, req.(*commonv2.ComponentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Components_ServiceDesc is the grpc.ServiceDesc for Components service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -269,6 +341,14 @@ var Components_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetComponentStatistics", Handler: _Components_GetComponentStatistics_Handler, }, + { + MethodName: "GetComponentStatus", + Handler: _Components_GetComponentStatus_Handler, + }, + { + MethodName: "GetComponentsStatus", + Handler: _Components_GetComponentsStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "scanoss/api/components/v2/scanoss-components.proto", diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index 9e8590b..b237fa6 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -103,8 +103,28 @@ service Components { body: "*" }; }; + + // Get status information for a specific purl + rpc GetComponentStatus(scanoss.api.common.v2.ComponentRequest) returns(ComponentStatusResponse) { + option (google.api.http) = { + get: "/v2/components/status" + }; + }; + + // Get the statistics for the specified components + rpc GetComponentsStatus(scanoss.api.common.v2.ComponentsRequest) returns(ComponentsStatusResponse) { + option (google.api.http) = { + post: "/v2/components/status" + body: "*" + }; + }; + + } + + + /* * Component Search request data (JSON payload) */ @@ -159,6 +179,59 @@ message ComponentsStatisticResponse { scanoss.api.common.v2.StatusResponse status = 2; } + +message ComponentStatusResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + example: " { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } " ; + } + }; + + string purl = 1 [json_name = "purl"]; + + message VersionStatus { + string name = 1; + string status = 2; + string indexed_date = 3; + string check_date = 4; + } + message ComponentStatus { + string name = 1; + string status = 2; + string first_indexed_date = 3; + string last_indexed_date = 4; + } + VersionStatus version_status = 2 [json_name = "version_status"]; + ComponentStatus component_status = 3 [json_name = "component_status"]; +} + + + + + +/* + * Component Statistics response data (JSON payload) + */ +message ComponentsStatusResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + example: "{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ]}" ; + } + }; + + + // Component status + repeated ComponentStatusResponse component_status = 1 [json_name = "components"];; + // Response status + scanoss.api.common.v2.StatusResponse status = 2; +} + + + + + + + /* * Component Search response data (JSON payload) */ diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json index c6d8744..7a39721 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -185,6 +185,91 @@ ] } }, + "/v2/components/status": { + "get": { + "summary": "Get status information for a specific purl", + "operationId": "Components_GetComponentStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2ComponentStatusResponse" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "purl", + "description": "Package URL identifying the component to analyze.", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "requirement", + "description": "Version constraint for component resolution when PURL lacks explicit version.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Components" + ] + }, + "post": { + "summary": "Get the statistics for the specified components", + "operationId": "Components_GetComponentsStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2ComponentsStatusResponse" + } + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "Represents a list of software component to be analyzed by SCANOSS API services.\nAllows analysis of multiple software components in a single API call, improving performance over individual requests.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2ComponentsRequest" + } + } + ], + "tags": [ + "Components" + ] + } + }, "/v2/components/versions": { "get": { "summary": "Get all version information for a specific component", @@ -266,6 +351,40 @@ }, "title": "Version details (including license)" }, + "ComponentStatusResponseComponentStatus": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "first_indexed_date": { + "type": "string" + }, + "last_indexed_date": { + "type": "string" + } + } + }, + "ComponentStatusResponseVersionStatus": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "indexed_date": { + "type": "string" + }, + "check_date": { + "type": "string" + } + } + }, "ComponentsStatisticResponseComponentStatistics": { "type": "object", "properties": { @@ -517,6 +636,34 @@ "purl" ] }, + "v2ComponentStatusResponse": { + "type": "object", + "example": { + "purl": "pkg:npm/strive-molu-axios", + "version_status": { + "version": "0.0.1-beta.1", + "status": "deleted", + "indexed_date": "2024-06-21", + "check_date": "2026-02-01" + }, + "component_status": { + "status": "active", + "first_indexed_date": "2022-03-01", + "last_indexed_date": "2026-02-15" + } + }, + "properties": { + "purl": { + "type": "string" + }, + "version_status": { + "$ref": "#/definitions/ComponentStatusResponseVersionStatus" + }, + "component_status": { + "$ref": "#/definitions/ComponentStatusResponseComponentStatus" + } + } + }, "v2ComponentsRequest": { "type": "object", "example": { @@ -589,6 +736,42 @@ }, "title": "Component Statistics response data (JSON payload)" }, + "v2ComponentsStatusResponse": { + "type": "object", + "example": { + "components": [ + { + "purl": "pkg:npm/strive-molu-axios", + "version_status": { + "version": "0.0.1-beta.1", + "status": "deleted", + "indexed_date": "2024-06-21", + "check_date": "2026-02-01" + }, + "component_status": { + "status": "active", + "first_indexed_date": "2022-03-01", + "last_indexed_date": "2026-02-15" + } + } + ] + }, + "properties": { + "component_status": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v2ComponentStatusResponse" + }, + "title": "Component status" + }, + "status": { + "$ref": "#/definitions/v2StatusResponse", + "title": "Response status" + } + }, + "title": "Component Statistics response data (JSON payload)" + }, "v2EchoRequest": { "type": "object", "properties": { From e5a5b5a1f50be992a941cb4e525761e4ce8d9cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Go=C3=B1i?= Date: Thu, 12 Feb 2026 21:10:57 -0300 Subject: [PATCH 2/7] Updated documentation on components/status --- api/componentsv2/scanoss-components.pb.go | 104 +++++++++--------- api/componentsv2/scanoss-components.pb.gw.go | 12 +- .../scanoss-components_grpc.pb.go | 8 +- .../components/v2/scanoss-components.proto | 50 +++++---- .../v2/scanoss-components.swagger.json | 52 +++++---- 5 files changed, 126 insertions(+), 100 deletions(-) diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index 8ec2deb..61eb86a 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -265,11 +265,17 @@ func (x *ComponentsStatisticResponse) GetStatus() *commonv2.StatusResponse { return nil } +// Component development status type ComponentStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Purl string `protobuf:"bytes,1,opt,name=purl,proto3" json:"purl,omitempty"` - VersionStatus *ComponentStatusResponse_VersionStatus `protobuf:"bytes,2,opt,name=version_status,proto3" json:"version_status,omitempty"` - ComponentStatus *ComponentStatusResponse_ComponentStatus `protobuf:"bytes,3,opt,name=component_status,proto3" json:"component_status,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + // Purl requested + Purl string `protobuf:"bytes,1,opt,name=purl,proto3" json:"purl,omitempty"` + // Name of the component + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Information about the requested version. If no requirement is described, the latest version of the component is responded + VersionStatus *ComponentStatusResponse_VersionStatus `protobuf:"bytes,3,opt,name=version_status,proto3" json:"version_status,omitempty"` + // / Information about the current development status of the component + ComponentStatus *ComponentStatusResponse_ComponentStatus `protobuf:"bytes,4,opt,name=component_status,proto3" json:"component_status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -311,6 +317,13 @@ func (x *ComponentStatusResponse) GetPurl() string { return "" } +func (x *ComponentStatusResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + func (x *ComponentStatusResponse) GetVersionStatus() *ComponentStatusResponse_VersionStatus { if x != nil { return x.VersionStatus @@ -658,11 +671,13 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) GetStatistics() *CompS } type ComponentStatusResponse_VersionStatus struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - IndexedDate string `protobuf:"bytes,3,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` - CheckDate string `protobuf:"bytes,4,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + // Development status of the requested version of this component + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Date that the component was indexed + IndexedDate string `protobuf:"bytes,2,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` + // Date that the status was checked + CheckDate string `protobuf:"bytes,3,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -697,13 +712,6 @@ func (*ComponentStatusResponse_VersionStatus) Descriptor() ([]byte, []int) { return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3, 0} } -func (x *ComponentStatusResponse_VersionStatus) GetName() string { - if x != nil { - return x.Name - } - return "" -} - func (x *ComponentStatusResponse_VersionStatus) GetStatus() string { if x != nil { return x.Status @@ -726,13 +734,15 @@ func (x *ComponentStatusResponse_VersionStatus) GetCheckDate() string { } type ComponentStatusResponse_ComponentStatus struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - FirstIndexedDate string `protobuf:"bytes,3,opt,name=first_indexed_date,json=firstIndexedDate,proto3" json:"first_indexed_date,omitempty"` - LastIndexedDate string `protobuf:"bytes,4,opt,name=last_indexed_date,json=lastIndexedDate,proto3" json:"last_indexed_date,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + // Development status of the requested component + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Date of the first time component was indexed + FirstIndexedDate string `protobuf:"bytes,2,opt,name=first_indexed_date,json=firstIndexedDate,proto3" json:"first_indexed_date,omitempty"` + // Date of the last time component was indexed + LastIndexedDate string `protobuf:"bytes,3,opt,name=last_indexed_date,json=lastIndexedDate,proto3" json:"last_indexed_date,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ComponentStatusResponse_ComponentStatus) Reset() { @@ -765,13 +775,6 @@ func (*ComponentStatusResponse_ComponentStatus) Descriptor() ([]byte, []int) { return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3, 1} } -func (x *ComponentStatusResponse_ComponentStatus) GetName() string { - if x != nil { - return x.Name - } - return "" -} - func (x *ComponentStatusResponse_ComponentStatus) GetStatus() string { if x != nil { return x.Status @@ -1104,28 +1107,27 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\n" + "statistics\x18\x03 \x01(\v2(.scanoss.api.components.v2.CompStatisticR\n" + "statistics:\xea\x02\x92A\xe6\x02\n" + - "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xc7\x06\n" + + "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xce\x06\n" + "\x17ComponentStatusResponse\x12\x12\n" + - "\x04purl\x18\x01 \x01(\tR\x04purl\x12h\n" + - "\x0eversion_status\x18\x02 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + - "\x10component_status\x18\x03 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a}\n" + - "\rVersionStatus\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + - "\x06status\x18\x02 \x01(\tR\x06status\x12!\n" + - "\findexed_date\x18\x03 \x01(\tR\vindexedDate\x12\x1d\n" + + "\x04purl\x18\x01 \x01(\tR\x04purl\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12h\n" + + "\x0eversion_status\x18\x03 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + + "\x10component_status\x18\x04 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1ai\n" + + "\rVersionStatus\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12!\n" + + "\findexed_date\x18\x02 \x01(\tR\vindexedDate\x12\x1d\n" + "\n" + - "check_date\x18\x04 \x01(\tR\tcheckDate\x1a\x97\x01\n" + - "\x0fComponentStatus\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + - "\x06status\x18\x02 \x01(\tR\x06status\x12,\n" + - "\x12first_indexed_date\x18\x03 \x01(\tR\x10firstIndexedDate\x12*\n" + - "\x11last_indexed_date\x18\x04 \x01(\tR\x0flastIndexedDate:\xa4\x02\x92A\xa0\x02\n" + - "\x9d\x02J\x9a\x02 { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } \"\xeb\x03\n" + + "check_date\x18\x03 \x01(\tR\tcheckDate\x1a\x83\x01\n" + + "\x0fComponentStatus\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12,\n" + + "\x12first_indexed_date\x18\x02 \x01(\tR\x10firstIndexedDate\x12*\n" + + "\x11last_indexed_date\x18\x03 \x01(\tR\x0flastIndexedDate:\xbf\x02\x92A\xbb\x02\n" + + "\xb8\x02J\xb5\x02 { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } \"\x85\x04\n" + "\x18ComponentsStatusResponse\x12X\n" + "\x10component_status\x18\x01 \x03(\v22.scanoss.api.components.v2.ComponentStatusResponseR\n" + "components\x12=\n" + - "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xb5\x02\x92A\xb1\x02\n" + - "\xae\x02J\xab\x02{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ]}\"\x8b\x05\n" + + "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xcf\x02\x92A\xcb\x02\n" + + "\xc8\x02J\xc5\x02{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }]}\"\x8b\x05\n" + "\x12CompSearchResponse\x12W\n" + "\n" + "components\x18\x01 \x03(\v27.scanoss.api.components.v2.CompSearchResponse.ComponentR\n" + @@ -1159,15 +1161,15 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\x03url\x18\x03 \x01(\tR\x03url\x12R\n" + "\bversions\x18\x04 \x03(\v26.scanoss.api.components.v2.CompVersionResponse.VersionR\bversions\x12\x12\n" + "\x04name\x18\x05 \x01(\tR\x04name:\xcc\x03\x92A\xc8\x03\n" + - "\xc5\x03J\xc2\x03{\"component\": {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"versions\": [{\"version\": \"5.0.0\", \"licenses\": [{\"name\": \"GNU General Public License v2.0\", \"spdx_id\": \"GPL-2.0\", \"is_spdx_approved\": true, \"url\": \"https://spdx.org/licenses/GPL-2.0.html\"}], \"date\": \"2024-01-15T10:30:00Z\"}], \"component\": \"engine\"}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component versions successfully retrieved\"}}2\xf6\x06\n" + + "\xc5\x03J\xc2\x03{\"component\": {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"versions\": [{\"version\": \"5.0.0\", \"licenses\": [{\"name\": \"GNU General Public License v2.0\", \"spdx_id\": \"GPL-2.0\", \"is_spdx_approved\": true, \"url\": \"https://spdx.org/licenses/GPL-2.0.html\"}], \"date\": \"2024-01-15T10:30:00Z\"}], \"component\": \"engine\"}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component versions successfully retrieved\"}}2\x8b\a\n" + "\n" + "Components\x12o\n" + "\x04Echo\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/v2/components/echo\x12\x8e\x01\n" + "\x10SearchComponents\x12,.scanoss.api.components.v2.CompSearchRequest\x1a-.scanoss.api.components.v2.CompSearchResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v2/components/search\x12\x96\x01\n" + "\x14GetComponentVersions\x12-.scanoss.api.components.v2.CompVersionRequest\x1a..scanoss.api.components.v2.CompVersionResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v2/components/versions\x12\xa0\x01\n" + - "\x16GetComponentStatistics\x12(.scanoss.api.common.v2.ComponentsRequest\x1a6.scanoss.api.components.v2.ComponentsStatisticResponse\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v2/components/statistics\x12\x90\x01\n" + - "\x12GetComponentStatus\x12'.scanoss.api.common.v2.ComponentRequest\x1a2.scanoss.api.components.v2.ComponentStatusResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v2/components/status\x12\x96\x01\n" + - "\x13GetComponentsStatus\x12(.scanoss.api.common.v2.ComponentsRequest\x1a3.scanoss.api.components.v2.ComponentsStatusResponse\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/v2/components/statusB\x8b\x03\x92A\xd0\x02\x12\x9d\x01\n" + + "\x16GetComponentStatistics\x12(.scanoss.api.common.v2.ComponentsRequest\x1a6.scanoss.api.components.v2.ComponentsStatisticResponse\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v2/components/statistics\x12\x9a\x01\n" + + "\x12GetComponentStatus\x12'.scanoss.api.common.v2.ComponentRequest\x1a2.scanoss.api.components.v2.ComponentStatusResponse\"'\x82\xd3\xe4\x93\x02!\x12\x1f/v2/components/status/component\x12\xa1\x01\n" + + "\x13GetComponentsStatus\x12(.scanoss.api.common.v2.ComponentsRequest\x1a3.scanoss.api.components.v2.ComponentsStatusResponse\"+\x82\xd3\xe4\x93\x02%:\x01*\" /v2/components/status/componentsB\x8b\x03\x92A\xd0\x02\x12\x9d\x01\n" + "\x1aSCANOSS Components Service\x12(Provides component intelligence services\"P\n" + "\x12scanoss-components\x12%https://github.com/scanoss/components\x1a\x13support@scanoss.com2\x032.0\x1a\x0fapi.scanoss.com*\x02\x02\x012\x10application/json:\x10application/jsonR;\n" + "\x03404\x124\n" + diff --git a/api/componentsv2/scanoss-components.pb.gw.go b/api/componentsv2/scanoss-components.pb.gw.go index 11d0a33..92d25d2 100644 --- a/api/componentsv2/scanoss-components.pb.gw.go +++ b/api/componentsv2/scanoss-components.pb.gw.go @@ -314,7 +314,7 @@ func RegisterComponentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentStatus", runtime.WithHTTPPathPattern("/v2/components/status/component")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -334,7 +334,7 @@ func RegisterComponentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentsStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentsStatus", runtime.WithHTTPPathPattern("/v2/components/status/components")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -460,7 +460,7 @@ func RegisterComponentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentStatus", runtime.WithHTTPPathPattern("/v2/components/status/component")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -477,7 +477,7 @@ func RegisterComponentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentsStatus", runtime.WithHTTPPathPattern("/v2/components/status")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scanoss.api.components.v2.Components/GetComponentsStatus", runtime.WithHTTPPathPattern("/v2/components/status/components")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -498,8 +498,8 @@ var ( pattern_Components_SearchComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "search"}, "")) pattern_Components_GetComponentVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "versions"}, "")) pattern_Components_GetComponentStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "statistics"}, "")) - pattern_Components_GetComponentStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "status"}, "")) - pattern_Components_GetComponentsStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "components", "status"}, "")) + pattern_Components_GetComponentStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "components", "status", "component"}, "")) + pattern_Components_GetComponentsStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"v2", "components", "status"}, "")) ) var ( diff --git a/api/componentsv2/scanoss-components_grpc.pb.go b/api/componentsv2/scanoss-components_grpc.pb.go index 0b975ae..45bab06 100644 --- a/api/componentsv2/scanoss-components_grpc.pb.go +++ b/api/componentsv2/scanoss-components_grpc.pb.go @@ -69,9 +69,9 @@ type ComponentsClient interface { GetComponentVersions(ctx context.Context, in *CompVersionRequest, opts ...grpc.CallOption) (*CompVersionResponse, error) // Get the statistics for the specified components GetComponentStatistics(ctx context.Context, in *commonv2.ComponentsRequest, opts ...grpc.CallOption) (*ComponentsStatisticResponse, error) - // Get status information for a specific purl + // Get status information for a specific purl via a get request GetComponentStatus(ctx context.Context, in *commonv2.ComponentRequest, opts ...grpc.CallOption) (*ComponentStatusResponse, error) - // Get the statistics for the specified components + // Get the status for a list of purls posted in the body GetComponentsStatus(ctx context.Context, in *commonv2.ComponentsRequest, opts ...grpc.CallOption) (*ComponentsStatusResponse, error) } @@ -157,9 +157,9 @@ type ComponentsServer interface { GetComponentVersions(context.Context, *CompVersionRequest) (*CompVersionResponse, error) // Get the statistics for the specified components GetComponentStatistics(context.Context, *commonv2.ComponentsRequest) (*ComponentsStatisticResponse, error) - // Get status information for a specific purl + // Get status information for a specific purl via a get request GetComponentStatus(context.Context, *commonv2.ComponentRequest) (*ComponentStatusResponse, error) - // Get the statistics for the specified components + // Get the status for a list of purls posted in the body GetComponentsStatus(context.Context, *commonv2.ComponentsRequest) (*ComponentsStatusResponse, error) mustEmbedUnimplementedComponentsServer() } diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index b237fa6..1efc6e5 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -104,17 +104,17 @@ service Components { }; }; - // Get status information for a specific purl + // Get status information for a specific purl via a get request rpc GetComponentStatus(scanoss.api.common.v2.ComponentRequest) returns(ComponentStatusResponse) { option (google.api.http) = { - get: "/v2/components/status" + get: "/v2/components/status/component" }; }; - // Get the statistics for the specified components + // Get the status for a list of purls posted in the body rpc GetComponentsStatus(scanoss.api.common.v2.ComponentsRequest) returns(ComponentsStatusResponse) { option (google.api.http) = { - post: "/v2/components/status" + post: "/v2/components/status/components" body: "*" }; }; @@ -179,30 +179,42 @@ message ComponentsStatisticResponse { scanoss.api.common.v2.StatusResponse status = 2; } - +/* + Component development status +*/ message ComponentStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { - example: " { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } " ; + example: " { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } " ; } }; - + // Purl requested string purl = 1 [json_name = "purl"]; - + // Name of the component + string name = 2; + message VersionStatus { - string name = 1; - string status = 2; - string indexed_date = 3; - string check_date = 4; + // Development status of the requested version of this component + string status = 1; + // Date that the component was indexed + string indexed_date = 2; + // Date that the status was checked + string check_date = 3; } + message ComponentStatus { - string name = 1; - string status = 2; - string first_indexed_date = 3; - string last_indexed_date = 4; + // Development status of the requested component + string status = 1; + // Date of the first time component was indexed + string first_indexed_date = 2; + // Date of the last time component was indexed + string last_indexed_date = 3; } - VersionStatus version_status = 2 [json_name = "version_status"]; - ComponentStatus component_status = 3 [json_name = "component_status"]; + + // Information about the requested version. If no requirement is described, the latest version of the component is responded + VersionStatus version_status = 3 [json_name = "version_status"]; + /// Information about the current development status of the component + ComponentStatus component_status = 4 [json_name = "component_status"]; } @@ -215,7 +227,7 @@ message ComponentStatusResponse { message ComponentsStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { - example: "{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ]}" ; + example: "{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }]}" ; } }; diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json index 7a39721..85d5c16 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -185,9 +185,9 @@ ] } }, - "/v2/components/status": { + "/v2/components/status/component": { "get": { - "summary": "Get status information for a specific purl", + "summary": "Get status information for a specific purl via a get request", "operationId": "Components_GetComponentStatus", "responses": { "200": { @@ -229,9 +229,11 @@ "tags": [ "Components" ] - }, + } + }, + "/v2/components/status/components": { "post": { - "summary": "Get the statistics for the specified components", + "summary": "Get the status for a list of purls posted in the body", "operationId": "Components_GetComponentsStatus", "responses": { "200": { @@ -354,34 +356,34 @@ "ComponentStatusResponseComponentStatus": { "type": "object", "properties": { - "name": { - "type": "string" - }, "status": { - "type": "string" + "type": "string", + "title": "Development status of the requested component" }, "first_indexed_date": { - "type": "string" + "type": "string", + "title": "Date of the first time component was indexed" }, "last_indexed_date": { - "type": "string" + "type": "string", + "title": "Date of the last time component was indexed" } } }, "ComponentStatusResponseVersionStatus": { "type": "object", "properties": { - "name": { - "type": "string" - }, "status": { - "type": "string" + "type": "string", + "title": "Development status of the requested version of this component" }, "indexed_date": { - "type": "string" + "type": "string", + "title": "Date that the component was indexed" }, "check_date": { - "type": "string" + "type": "string", + "title": "Date that the status was checked" } } }, @@ -640,6 +642,7 @@ "type": "object", "example": { "purl": "pkg:npm/strive-molu-axios", + "name": "strive-molu-axios", "version_status": { "version": "0.0.1-beta.1", "status": "deleted", @@ -654,15 +657,23 @@ }, "properties": { "purl": { - "type": "string" + "type": "string", + "title": "Purl requested" + }, + "name": { + "type": "string", + "title": "Name of the component" }, "version_status": { - "$ref": "#/definitions/ComponentStatusResponseVersionStatus" + "$ref": "#/definitions/ComponentStatusResponseVersionStatus", + "title": "Information about the requested version. If no requirement is described, the latest version of the component is responded" }, "component_status": { - "$ref": "#/definitions/ComponentStatusResponseComponentStatus" + "$ref": "#/definitions/ComponentStatusResponseComponentStatus", + "title": "/ Information about the current development status of the component" } - } + }, + "title": "Component development status" }, "v2ComponentsRequest": { "type": "object", @@ -742,6 +753,7 @@ "components": [ { "purl": "pkg:npm/strive-molu-axios", + "name": "strive-molu-axios", "version_status": { "version": "0.0.1-beta.1", "status": "deleted", From ba903e2a304c26585f9f0e99e7936c1c4a7beac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Go=C3=B1i?= Date: Fri, 13 Feb 2026 14:24:45 -0300 Subject: [PATCH 3/7] Added status and raw status reported by registry on components service --- api/componentsv2/scanoss-components.pb.go | 149 +++++++++++++----- .../components/v2/scanoss-components.proto | 22 ++- .../v2/scanoss-components.swagger.json | 37 ++++- 3 files changed, 161 insertions(+), 47 deletions(-) diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index 61eb86a..7d65d8f 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -672,12 +672,17 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) GetStatistics() *CompS type ComponentStatusResponse_VersionStatus struct { state protoimpl.MessageState `protogen:"open.v1"` - // Development status of the requested version of this component + // Development status of the requested version of this component classified automatically Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Raw status reported by the registry for this version + RepositoryStatus string `protobuf:"bytes,2,opt,name=repository_status,json=repositoryStatus,proto3" json:"repository_status,omitempty"` // Date that the component was indexed - IndexedDate string `protobuf:"bytes,2,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` + IndexedDate string `protobuf:"bytes,3,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` // Date that the status was checked - CheckDate string `protobuf:"bytes,3,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + CheckDate string `protobuf:"bytes,4,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + // States if something went wrong while seatching the version of this component on DB + ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` + ErrorCode *commonv2.ErrorCode `protobuf:"varint,6,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -719,6 +724,13 @@ func (x *ComponentStatusResponse_VersionStatus) GetStatus() string { return "" } +func (x *ComponentStatusResponse_VersionStatus) GetRepositoryStatus() string { + if x != nil { + return x.RepositoryStatus + } + return "" +} + func (x *ComponentStatusResponse_VersionStatus) GetIndexedDate() string { if x != nil { return x.IndexedDate @@ -733,16 +745,35 @@ func (x *ComponentStatusResponse_VersionStatus) GetCheckDate() string { return "" } +func (x *ComponentStatusResponse_VersionStatus) GetErrorMessage() string { + if x != nil && x.ErrorMessage != nil { + return *x.ErrorMessage + } + return "" +} + +func (x *ComponentStatusResponse_VersionStatus) GetErrorCode() commonv2.ErrorCode { + if x != nil && x.ErrorCode != nil { + return *x.ErrorCode + } + return commonv2.ErrorCode(0) +} + type ComponentStatusResponse_ComponentStatus struct { state protoimpl.MessageState `protogen:"open.v1"` - // Development status of the requested component + // Development status of the requested component classified automatically Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Raw status reported by the registry for this component + RepositoryStatus string `protobuf:"bytes,2,opt,name=repository_status,json=repositoryStatus,proto3" json:"repository_status,omitempty"` // Date of the first time component was indexed - FirstIndexedDate string `protobuf:"bytes,2,opt,name=first_indexed_date,json=firstIndexedDate,proto3" json:"first_indexed_date,omitempty"` + FirstIndexedDate string `protobuf:"bytes,3,opt,name=first_indexed_date,json=firstIndexedDate,proto3" json:"first_indexed_date,omitempty"` // Date of the last time component was indexed - LastIndexedDate string `protobuf:"bytes,3,opt,name=last_indexed_date,json=lastIndexedDate,proto3" json:"last_indexed_date,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + LastIndexedDate string `protobuf:"bytes,4,opt,name=last_indexed_date,json=lastIndexedDate,proto3" json:"last_indexed_date,omitempty"` + // States if something went wrong while seatching the component on DB + ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` + ErrorCode *commonv2.ErrorCode `protobuf:"varint,6,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ComponentStatusResponse_ComponentStatus) Reset() { @@ -782,6 +813,13 @@ func (x *ComponentStatusResponse_ComponentStatus) GetStatus() string { return "" } +func (x *ComponentStatusResponse_ComponentStatus) GetRepositoryStatus() string { + if x != nil { + return x.RepositoryStatus + } + return "" +} + func (x *ComponentStatusResponse_ComponentStatus) GetFirstIndexedDate() string { if x != nil { return x.FirstIndexedDate @@ -796,6 +834,20 @@ func (x *ComponentStatusResponse_ComponentStatus) GetLastIndexedDate() string { return "" } +func (x *ComponentStatusResponse_ComponentStatus) GetErrorMessage() string { + if x != nil && x.ErrorMessage != nil { + return *x.ErrorMessage + } + return "" +} + +func (x *ComponentStatusResponse_ComponentStatus) GetErrorCode() commonv2.ErrorCode { + if x != nil && x.ErrorCode != nil { + return *x.ErrorCode + } + return commonv2.ErrorCode(0) +} + // Component details type CompSearchResponse_Component struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1107,21 +1159,35 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\n" + "statistics\x18\x03 \x01(\v2(.scanoss.api.components.v2.CompStatisticR\n" + "statistics:\xea\x02\x92A\xe6\x02\n" + - "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xce\x06\n" + + "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xcf\t\n" + "\x17ComponentStatusResponse\x12\x12\n" + "\x04purl\x18\x01 \x01(\tR\x04purl\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12h\n" + "\x0eversion_status\x18\x03 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + - "\x10component_status\x18\x04 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1ai\n" + + "\x10component_status\x18\x04 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xa9\x02\n" + "\rVersionStatus\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12!\n" + - "\findexed_date\x18\x02 \x01(\tR\vindexedDate\x12\x1d\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12+\n" + + "\x11repository_status\x18\x02 \x01(\tR\x10repositoryStatus\x12!\n" + + "\findexed_date\x18\x03 \x01(\tR\vindexedDate\x12\x1d\n" + + "\n" + + "check_date\x18\x04 \x01(\tR\tcheckDate\x12)\n" + + "\rerror_message\x18\x05 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + "\n" + - "check_date\x18\x03 \x01(\tR\tcheckDate\x1a\x83\x01\n" + + "error_code\x18\x06 \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + + "error_code\x88\x01\x01B\x10\n" + + "\x0e_error_messageB\r\n" + + "\v_error_code\x1a\xc3\x02\n" + "\x0fComponentStatus\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12,\n" + - "\x12first_indexed_date\x18\x02 \x01(\tR\x10firstIndexedDate\x12*\n" + - "\x11last_indexed_date\x18\x03 \x01(\tR\x0flastIndexedDate:\xbf\x02\x92A\xbb\x02\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12+\n" + + "\x11repository_status\x18\x02 \x01(\tR\x10repositoryStatus\x12,\n" + + "\x12first_indexed_date\x18\x03 \x01(\tR\x10firstIndexedDate\x12*\n" + + "\x11last_indexed_date\x18\x04 \x01(\tR\x0flastIndexedDate\x12)\n" + + "\rerror_message\x18\x05 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + + "\n" + + "error_code\x18\x06 \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + + "error_code\x88\x01\x01B\x10\n" + + "\x0e_error_messageB\r\n" + + "\v_error_code:\xbf\x02\x92A\xbb\x02\n" + "\xb8\x02J\xb5\x02 { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } \"\x85\x04\n" + "\x18ComponentsStatusResponse\x12X\n" + "\x10component_status\x18\x01 \x03(\v22.scanoss.api.components.v2.ComponentStatusResponseR\n" + @@ -1209,10 +1275,11 @@ var file_scanoss_api_components_v2_scanoss_components_proto_goTypes = []any{ (*CompVersionResponse_Version)(nil), // 14: scanoss.api.components.v2.CompVersionResponse.Version (*CompVersionResponse_Component)(nil), // 15: scanoss.api.components.v2.CompVersionResponse.Component (*commonv2.StatusResponse)(nil), // 16: scanoss.api.common.v2.StatusResponse - (*commonv2.EchoRequest)(nil), // 17: scanoss.api.common.v2.EchoRequest - (*commonv2.ComponentsRequest)(nil), // 18: scanoss.api.common.v2.ComponentsRequest - (*commonv2.ComponentRequest)(nil), // 19: scanoss.api.common.v2.ComponentRequest - (*commonv2.EchoResponse)(nil), // 20: scanoss.api.common.v2.EchoResponse + (commonv2.ErrorCode)(0), // 17: scanoss.api.common.v2.ErrorCode + (*commonv2.EchoRequest)(nil), // 18: scanoss.api.common.v2.EchoRequest + (*commonv2.ComponentsRequest)(nil), // 19: scanoss.api.common.v2.ComponentsRequest + (*commonv2.ComponentRequest)(nil), // 20: scanoss.api.common.v2.ComponentRequest + (*commonv2.EchoResponse)(nil), // 21: scanoss.api.common.v2.EchoResponse } var file_scanoss_api_components_v2_scanoss_components_proto_depIdxs = []int32{ 8, // 0: scanoss.api.components.v2.CompStatistic.languages:type_name -> scanoss.api.components.v2.CompStatistic.Language @@ -1227,25 +1294,27 @@ var file_scanoss_api_components_v2_scanoss_components_proto_depIdxs = []int32{ 15, // 9: scanoss.api.components.v2.CompVersionResponse.component:type_name -> scanoss.api.components.v2.CompVersionResponse.Component 16, // 10: scanoss.api.components.v2.CompVersionResponse.status:type_name -> scanoss.api.common.v2.StatusResponse 1, // 11: scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatistics.statistics:type_name -> scanoss.api.components.v2.CompStatistic - 13, // 12: scanoss.api.components.v2.CompVersionResponse.Version.licenses:type_name -> scanoss.api.components.v2.CompVersionResponse.License - 14, // 13: scanoss.api.components.v2.CompVersionResponse.Component.versions:type_name -> scanoss.api.components.v2.CompVersionResponse.Version - 17, // 14: scanoss.api.components.v2.Components.Echo:input_type -> scanoss.api.common.v2.EchoRequest - 0, // 15: scanoss.api.components.v2.Components.SearchComponents:input_type -> scanoss.api.components.v2.CompSearchRequest - 6, // 16: scanoss.api.components.v2.Components.GetComponentVersions:input_type -> scanoss.api.components.v2.CompVersionRequest - 18, // 17: scanoss.api.components.v2.Components.GetComponentStatistics:input_type -> scanoss.api.common.v2.ComponentsRequest - 19, // 18: scanoss.api.components.v2.Components.GetComponentStatus:input_type -> scanoss.api.common.v2.ComponentRequest - 18, // 19: scanoss.api.components.v2.Components.GetComponentsStatus:input_type -> scanoss.api.common.v2.ComponentsRequest - 20, // 20: scanoss.api.components.v2.Components.Echo:output_type -> scanoss.api.common.v2.EchoResponse - 5, // 21: scanoss.api.components.v2.Components.SearchComponents:output_type -> scanoss.api.components.v2.CompSearchResponse - 7, // 22: scanoss.api.components.v2.Components.GetComponentVersions:output_type -> scanoss.api.components.v2.CompVersionResponse - 2, // 23: scanoss.api.components.v2.Components.GetComponentStatistics:output_type -> scanoss.api.components.v2.ComponentsStatisticResponse - 3, // 24: scanoss.api.components.v2.Components.GetComponentStatus:output_type -> scanoss.api.components.v2.ComponentStatusResponse - 4, // 25: scanoss.api.components.v2.Components.GetComponentsStatus:output_type -> scanoss.api.components.v2.ComponentsStatusResponse - 20, // [20:26] is the sub-list for method output_type - 14, // [14:20] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 17, // 12: scanoss.api.components.v2.ComponentStatusResponse.VersionStatus.error_code:type_name -> scanoss.api.common.v2.ErrorCode + 17, // 13: scanoss.api.components.v2.ComponentStatusResponse.ComponentStatus.error_code:type_name -> scanoss.api.common.v2.ErrorCode + 13, // 14: scanoss.api.components.v2.CompVersionResponse.Version.licenses:type_name -> scanoss.api.components.v2.CompVersionResponse.License + 14, // 15: scanoss.api.components.v2.CompVersionResponse.Component.versions:type_name -> scanoss.api.components.v2.CompVersionResponse.Version + 18, // 16: scanoss.api.components.v2.Components.Echo:input_type -> scanoss.api.common.v2.EchoRequest + 0, // 17: scanoss.api.components.v2.Components.SearchComponents:input_type -> scanoss.api.components.v2.CompSearchRequest + 6, // 18: scanoss.api.components.v2.Components.GetComponentVersions:input_type -> scanoss.api.components.v2.CompVersionRequest + 19, // 19: scanoss.api.components.v2.Components.GetComponentStatistics:input_type -> scanoss.api.common.v2.ComponentsRequest + 20, // 20: scanoss.api.components.v2.Components.GetComponentStatus:input_type -> scanoss.api.common.v2.ComponentRequest + 19, // 21: scanoss.api.components.v2.Components.GetComponentsStatus:input_type -> scanoss.api.common.v2.ComponentsRequest + 21, // 22: scanoss.api.components.v2.Components.Echo:output_type -> scanoss.api.common.v2.EchoResponse + 5, // 23: scanoss.api.components.v2.Components.SearchComponents:output_type -> scanoss.api.components.v2.CompSearchResponse + 7, // 24: scanoss.api.components.v2.Components.GetComponentVersions:output_type -> scanoss.api.components.v2.CompVersionResponse + 2, // 25: scanoss.api.components.v2.Components.GetComponentStatistics:output_type -> scanoss.api.components.v2.ComponentsStatisticResponse + 3, // 26: scanoss.api.components.v2.Components.GetComponentStatus:output_type -> scanoss.api.components.v2.ComponentStatusResponse + 4, // 27: scanoss.api.components.v2.Components.GetComponentsStatus:output_type -> scanoss.api.components.v2.ComponentsStatusResponse + 22, // [22:28] is the sub-list for method output_type + 16, // [16:22] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_scanoss_api_components_v2_scanoss_components_proto_init() } @@ -1253,6 +1322,8 @@ func file_scanoss_api_components_v2_scanoss_components_proto_init() { if File_scanoss_api_components_v2_scanoss_components_proto != nil { return } + file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[10].OneofWrappers = []any{} + file_scanoss_api_components_v2_scanoss_components_proto_msgTypes[11].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index 1efc6e5..db9a551 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -194,21 +194,31 @@ message ComponentStatusResponse { string name = 2; message VersionStatus { - // Development status of the requested version of this component + // Development status of the requested version of this component classified automatically string status = 1; + // Raw status reported by the registry for this version + string repository_status = 2; // Date that the component was indexed - string indexed_date = 2; + string indexed_date = 3; // Date that the status was checked - string check_date = 3; + string check_date = 4; + // States if something went wrong while seatching the version of this component on DB + optional string error_message = 5 [json_name = "error_message"]; + optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; } message ComponentStatus { - // Development status of the requested component + // Development status of the requested component classified automatically string status = 1; + // Raw status reported by the registry for this component + string repository_status = 2; // Date of the first time component was indexed - string first_indexed_date = 2; + string first_indexed_date = 3; // Date of the last time component was indexed - string last_indexed_date = 3; + string last_indexed_date = 4; + // States if something went wrong while seatching the component on DB + optional string error_message = 5 [json_name = "error_message"]; + optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; } // Information about the requested version. If no requirement is described, the latest version of the component is responded diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json index 85d5c16..87fdfb5 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -358,7 +358,11 @@ "properties": { "status": { "type": "string", - "title": "Development status of the requested component" + "title": "Development status of the requested component classified automatically" + }, + "repository_status": { + "type": "string", + "title": "Raw status reported by the registry for this component" }, "first_indexed_date": { "type": "string", @@ -367,6 +371,13 @@ "last_indexed_date": { "type": "string", "title": "Date of the last time component was indexed" + }, + "error_message": { + "type": "string", + "title": "States if something went wrong while seatching the component on DB" + }, + "error_code": { + "$ref": "#/definitions/v2ErrorCode" } } }, @@ -375,7 +386,11 @@ "properties": { "status": { "type": "string", - "title": "Development status of the requested version of this component" + "title": "Development status of the requested version of this component classified automatically" + }, + "repository_status": { + "type": "string", + "title": "Raw status reported by the registry for this version" }, "indexed_date": { "type": "string", @@ -384,6 +399,13 @@ "check_date": { "type": "string", "title": "Date that the status was checked" + }, + "error_message": { + "type": "string", + "title": "States if something went wrong while seatching the version of this component on DB" + }, + "error_code": { + "$ref": "#/definitions/v2ErrorCode" } } }, @@ -802,6 +824,17 @@ }, "description": "Echo Message Response." }, + "v2ErrorCode": { + "type": "string", + "enum": [ + "INVALID_PURL", + "COMPONENT_NOT_FOUND", + "NO_INFO", + "INVALID_SEMVER" + ], + "default": "INVALID_PURL", + "description": "Error code enum for component analysis operations.\nRepresents the various error conditions that can occur during component processing and validation.\n\n - INVALID_PURL: The provided Package URL (PURL) is invalid or malformed\n - COMPONENT_NOT_FOUND: The requested component could not be found in the database\n - NO_INFO: No information is available for the requested component\n - INVALID_SEMVER: The provided semantic version (SemVer) is invalid or malformed" + }, "v2StatusCode": { "type": "string", "enum": [ From e3b4ea60f74e885427ba1602f80e130f2c68669d Mon Sep 17 00:00:00 2001 From: eeisegn Date: Mon, 16 Feb 2026 07:37:48 +0000 Subject: [PATCH 4/7] fix some formatting and spelling mistakes --- .../components/v2/scanoss-components.proto | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index db9a551..a7cfcc8 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -122,9 +122,6 @@ service Components { } - - - /* * Component Search request data (JSON payload) */ @@ -180,7 +177,7 @@ message ComponentsStatisticResponse { } /* - Component development status + * Component lifecycle status */ message ComponentStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { @@ -192,7 +189,7 @@ message ComponentStatusResponse { string purl = 1 [json_name = "purl"]; // Name of the component string name = 2; - + // Component version status message VersionStatus { // Development status of the requested version of this component classified automatically string status = 1; @@ -202,11 +199,11 @@ message ComponentStatusResponse { string indexed_date = 3; // Date that the status was checked string check_date = 4; - // States if something went wrong while seatching the version of this component on DB + // States if something went wrong while searching for the version of this component version in the DB optional string error_message = 5 [json_name = "error_message"]; optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; } - + // Component status details (ignoring version) message ComponentStatus { // Development status of the requested component classified automatically string status = 1; @@ -216,21 +213,16 @@ message ComponentStatusResponse { string first_indexed_date = 3; // Date of the last time component was indexed string last_indexed_date = 4; - // States if something went wrong while seatching the component on DB + // States if something went wrong while searching for the version of this component in the DB optional string error_message = 5 [json_name = "error_message"]; optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; } - // Information about the requested version. If no requirement is described, the latest version of the component is responded VersionStatus version_status = 3 [json_name = "version_status"]; /// Information about the current development status of the component ComponentStatus component_status = 4 [json_name = "component_status"]; } - - - - /* * Component Statistics response data (JSON payload) */ @@ -240,20 +232,12 @@ message ComponentsStatusResponse { example: "{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }]}" ; } }; - - // Component status - repeated ComponentStatusResponse component_status = 1 [json_name = "components"];; + repeated ComponentStatusResponse components = 1; // Response status scanoss.api.common.v2.StatusResponse status = 2; } - - - - - - /* * Component Search response data (JSON payload) */ From 025bcd93c70b9b9e0fc2faa672456b0b955d6ecf Mon Sep 17 00:00:00 2001 From: eeisegn Date: Mon, 16 Feb 2026 07:42:38 +0000 Subject: [PATCH 5/7] remove blank lines --- protobuf/scanoss/api/components/v2/scanoss-components.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index a7cfcc8..deb20cb 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -118,8 +118,6 @@ service Components { body: "*" }; }; - - } /* From 7ea488ec397f23795a7ed22bb7ad6c04d79c4456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Go=C3=B1i?= Date: Thu, 19 Feb 2026 14:35:34 -0300 Subject: [PATCH 6/7] Adding requirement to the root of component status. --- api/componentsv2/scanoss-components.pb.go | 52 ++++++++++++------- .../components/v2/scanoss-components.proto | 11 ++-- .../v2/scanoss-components.swagger.json | 20 ++++--- 3 files changed, 54 insertions(+), 29 deletions(-) diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index 7d65d8f..9cef716 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -265,17 +265,19 @@ func (x *ComponentsStatisticResponse) GetStatus() *commonv2.StatusResponse { return nil } -// Component development status +// Component lifecycle status type ComponentStatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Purl requested Purl string `protobuf:"bytes,1,opt,name=purl,proto3" json:"purl,omitempty"` // Name of the component Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Requirement that should be met on the response. + Requirement string `protobuf:"bytes,3,opt,name=requirement,proto3" json:"requirement,omitempty"` // Information about the requested version. If no requirement is described, the latest version of the component is responded - VersionStatus *ComponentStatusResponse_VersionStatus `protobuf:"bytes,3,opt,name=version_status,proto3" json:"version_status,omitempty"` + VersionStatus *ComponentStatusResponse_VersionStatus `protobuf:"bytes,4,opt,name=version_status,proto3" json:"version_status,omitempty"` // / Information about the current development status of the component - ComponentStatus *ComponentStatusResponse_ComponentStatus `protobuf:"bytes,4,opt,name=component_status,proto3" json:"component_status,omitempty"` + ComponentStatus *ComponentStatusResponse_ComponentStatus `protobuf:"bytes,5,opt,name=component_status,proto3" json:"component_status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -324,6 +326,13 @@ func (x *ComponentStatusResponse) GetName() string { return "" } +func (x *ComponentStatusResponse) GetRequirement() string { + if x != nil { + return x.Requirement + } + return "" +} + func (x *ComponentStatusResponse) GetVersionStatus() *ComponentStatusResponse_VersionStatus { if x != nil { return x.VersionStatus @@ -342,7 +351,7 @@ func (x *ComponentStatusResponse) GetComponentStatus() *ComponentStatusResponse_ type ComponentsStatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Component status - ComponentStatus []*ComponentStatusResponse `protobuf:"bytes,1,rep,name=component_status,json=components,proto3" json:"component_status,omitempty"` + Components []*ComponentStatusResponse `protobuf:"bytes,1,rep,name=components,proto3" json:"components,omitempty"` // Response status Status *commonv2.StatusResponse `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields @@ -379,9 +388,9 @@ func (*ComponentsStatusResponse) Descriptor() ([]byte, []int) { return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{4} } -func (x *ComponentsStatusResponse) GetComponentStatus() []*ComponentStatusResponse { +func (x *ComponentsStatusResponse) GetComponents() []*ComponentStatusResponse { if x != nil { - return x.ComponentStatus + return x.Components } return nil } @@ -670,6 +679,7 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) GetStatistics() *CompS return nil } +// Component version status type ComponentStatusResponse_VersionStatus struct { state protoimpl.MessageState `protogen:"open.v1"` // Development status of the requested version of this component classified automatically @@ -680,7 +690,7 @@ type ComponentStatusResponse_VersionStatus struct { IndexedDate string `protobuf:"bytes,3,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` // Date that the status was checked CheckDate string `protobuf:"bytes,4,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` - // States if something went wrong while seatching the version of this component on DB + // States if something went wrong while searching for the version of this component version in the DB ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` ErrorCode *commonv2.ErrorCode `protobuf:"varint,6,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` unknownFields protoimpl.UnknownFields @@ -759,6 +769,7 @@ func (x *ComponentStatusResponse_VersionStatus) GetErrorCode() commonv2.ErrorCod return commonv2.ErrorCode(0) } +// Component status details (ignoring version) type ComponentStatusResponse_ComponentStatus struct { state protoimpl.MessageState `protogen:"open.v1"` // Development status of the requested component classified automatically @@ -769,7 +780,7 @@ type ComponentStatusResponse_ComponentStatus struct { FirstIndexedDate string `protobuf:"bytes,3,opt,name=first_indexed_date,json=firstIndexedDate,proto3" json:"first_indexed_date,omitempty"` // Date of the last time component was indexed LastIndexedDate string `protobuf:"bytes,4,opt,name=last_indexed_date,json=lastIndexedDate,proto3" json:"last_indexed_date,omitempty"` - // States if something went wrong while seatching the component on DB + // States if something went wrong while searching for the version of this component in the DB ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` ErrorCode *commonv2.ErrorCode `protobuf:"varint,6,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` unknownFields protoimpl.UnknownFields @@ -1159,12 +1170,14 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\n" + "statistics\x18\x03 \x01(\v2(.scanoss.api.components.v2.CompStatisticR\n" + "statistics:\xea\x02\x92A\xe6\x02\n" + - "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xcf\t\n" + + "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\x89\n" + + "\n" + "\x17ComponentStatusResponse\x12\x12\n" + "\x04purl\x18\x01 \x01(\tR\x04purl\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12h\n" + - "\x0eversion_status\x18\x03 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + - "\x10component_status\x18\x04 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xa9\x02\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vrequirement\x18\x03 \x01(\tR\vrequirement\x12h\n" + + "\x0eversion_status\x18\x04 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + + "\x10component_status\x18\x05 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xa9\x02\n" + "\rVersionStatus\x12\x16\n" + "\x06status\x18\x01 \x01(\tR\x06status\x12+\n" + "\x11repository_status\x18\x02 \x01(\tR\x10repositoryStatus\x12!\n" + @@ -1187,13 +1200,14 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "error_code\x18\x06 \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + "error_code\x88\x01\x01B\x10\n" + "\x0e_error_messageB\r\n" + - "\v_error_code:\xbf\x02\x92A\xbb\x02\n" + - "\xb8\x02J\xb5\x02 { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } \"\x85\x04\n" + - "\x18ComponentsStatusResponse\x12X\n" + - "\x10component_status\x18\x01 \x03(\v22.scanoss.api.components.v2.ComponentStatusResponseR\n" + + "\v_error_code:\xd7\x02\x92A\xd3\x02\n" + + "\xd0\x02J\xcd\x02{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }\"\x9b\x04\n" + + "\x18ComponentsStatusResponse\x12R\n" + + "\n" + + "components\x18\x01 \x03(\v22.scanoss.api.components.v2.ComponentStatusResponseR\n" + "components\x12=\n" + - "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xcf\x02\x92A\xcb\x02\n" + - "\xc8\x02J\xc5\x02{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }]}\"\x8b\x05\n" + + "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xeb\x02\x92A\xe7\x02\n" + + "\xe4\x02J\xe1\x02{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }\"\x8b\x05\n" + "\x12CompSearchResponse\x12W\n" + "\n" + "components\x18\x01 \x03(\v27.scanoss.api.components.v2.CompSearchResponse.ComponentR\n" + @@ -1287,7 +1301,7 @@ var file_scanoss_api_components_v2_scanoss_components_proto_depIdxs = []int32{ 16, // 2: scanoss.api.components.v2.ComponentsStatisticResponse.status:type_name -> scanoss.api.common.v2.StatusResponse 10, // 3: scanoss.api.components.v2.ComponentStatusResponse.version_status:type_name -> scanoss.api.components.v2.ComponentStatusResponse.VersionStatus 11, // 4: scanoss.api.components.v2.ComponentStatusResponse.component_status:type_name -> scanoss.api.components.v2.ComponentStatusResponse.ComponentStatus - 3, // 5: scanoss.api.components.v2.ComponentsStatusResponse.component_status:type_name -> scanoss.api.components.v2.ComponentStatusResponse + 3, // 5: scanoss.api.components.v2.ComponentsStatusResponse.components:type_name -> scanoss.api.components.v2.ComponentStatusResponse 16, // 6: scanoss.api.components.v2.ComponentsStatusResponse.status:type_name -> scanoss.api.common.v2.StatusResponse 12, // 7: scanoss.api.components.v2.CompSearchResponse.components:type_name -> scanoss.api.components.v2.CompSearchResponse.Component 16, // 8: scanoss.api.components.v2.CompSearchResponse.status:type_name -> scanoss.api.common.v2.StatusResponse diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index deb20cb..937d74c 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -180,13 +180,16 @@ message ComponentsStatisticResponse { message ComponentStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { - example: " { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } " ; + example: "{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }" ; } }; // Purl requested string purl = 1 [json_name = "purl"]; // Name of the component string name = 2; + // Requirement that should be met on the response. + string requirement = 3; + // Component version status message VersionStatus { // Development status of the requested version of this component classified automatically @@ -216,9 +219,9 @@ message ComponentStatusResponse { optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; } // Information about the requested version. If no requirement is described, the latest version of the component is responded - VersionStatus version_status = 3 [json_name = "version_status"]; + VersionStatus version_status = 4 [json_name = "version_status"]; /// Information about the current development status of the component - ComponentStatus component_status = 4 [json_name = "component_status"]; + ComponentStatus component_status = 5 [json_name = "component_status"]; } /* @@ -227,7 +230,7 @@ message ComponentStatusResponse { message ComponentsStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { - example: "{\"components\":[ { \"purl\": \"pkg:npm/strive-molu-axios\",\"name\":\"strive-molu-axios\",\"version_status\": { \"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\",\"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }]}" ; + example: "{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }" ; } }; // Component status diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json index 87fdfb5..d875521 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -374,12 +374,13 @@ }, "error_message": { "type": "string", - "title": "States if something went wrong while seatching the component on DB" + "title": "States if something went wrong while searching for the version of this component in the DB" }, "error_code": { "$ref": "#/definitions/v2ErrorCode" } - } + }, + "title": "Component status details (ignoring version)" }, "ComponentStatusResponseVersionStatus": { "type": "object", @@ -402,12 +403,13 @@ }, "error_message": { "type": "string", - "title": "States if something went wrong while seatching the version of this component on DB" + "title": "States if something went wrong while searching for the version of this component version in the DB" }, "error_code": { "$ref": "#/definitions/v2ErrorCode" } - } + }, + "title": "Component version status" }, "ComponentsStatisticResponseComponentStatistics": { "type": "object", @@ -665,6 +667,7 @@ "example": { "purl": "pkg:npm/strive-molu-axios", "name": "strive-molu-axios", + "requirement": "^0.0.1", "version_status": { "version": "0.0.1-beta.1", "status": "deleted", @@ -686,6 +689,10 @@ "type": "string", "title": "Name of the component" }, + "requirement": { + "type": "string", + "description": "Requirement that should be met on the response." + }, "version_status": { "$ref": "#/definitions/ComponentStatusResponseVersionStatus", "title": "Information about the requested version. If no requirement is described, the latest version of the component is responded" @@ -695,7 +702,7 @@ "title": "/ Information about the current development status of the component" } }, - "title": "Component development status" + "title": "Component lifecycle status" }, "v2ComponentsRequest": { "type": "object", @@ -776,6 +783,7 @@ { "purl": "pkg:npm/strive-molu-axios", "name": "strive-molu-axios", + "requirement": "^0.0.1", "version_status": { "version": "0.0.1-beta.1", "status": "deleted", @@ -791,7 +799,7 @@ ] }, "properties": { - "component_status": { + "components": { "type": "array", "items": { "type": "object", From b83638a9b92660a5dc27fe6d3605b52d10b84bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Go=C3=B1i?= Date: Fri, 20 Feb 2026 07:30:50 -0300 Subject: [PATCH 7/7] fix missing version on VersioStatus --- api/componentsv2/scanoss-components.pb.go | 42 ++++++++++++------- .../components/v2/scanoss-components.proto | 24 ++++++----- .../v2/scanoss-components.swagger.json | 6 ++- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index 9cef716..d4a37bc 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -347,7 +347,7 @@ func (x *ComponentStatusResponse) GetComponentStatus() *ComponentStatusResponse_ return nil } -// Component Statistics response data (JSON payload) +// Component Status response data (JSON payload) type ComponentsStatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Component status @@ -682,17 +682,19 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) GetStatistics() *CompS // Component version status type ComponentStatusResponse_VersionStatus struct { state protoimpl.MessageState `protogen:"open.v1"` + // Version identifier + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Development status of the requested version of this component classified automatically - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // Raw status reported by the registry for this version - RepositoryStatus string `protobuf:"bytes,2,opt,name=repository_status,json=repositoryStatus,proto3" json:"repository_status,omitempty"` + RepositoryStatus string `protobuf:"bytes,3,opt,name=repository_status,json=repositoryStatus,proto3" json:"repository_status,omitempty"` // Date that the component was indexed - IndexedDate string `protobuf:"bytes,3,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` + IndexedDate string `protobuf:"bytes,4,opt,name=indexed_date,json=indexedDate,proto3" json:"indexed_date,omitempty"` // Date that the status was checked - CheckDate string `protobuf:"bytes,4,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` + CheckDate string `protobuf:"bytes,5,opt,name=check_date,json=checkDate,proto3" json:"check_date,omitempty"` // States if something went wrong while searching for the version of this component version in the DB - ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` - ErrorCode *commonv2.ErrorCode `protobuf:"varint,6,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` + ErrorMessage *string `protobuf:"bytes,6,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` + ErrorCode *commonv2.ErrorCode `protobuf:"varint,7,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -727,6 +729,13 @@ func (*ComponentStatusResponse_VersionStatus) Descriptor() ([]byte, []int) { return file_scanoss_api_components_v2_scanoss_components_proto_rawDescGZIP(), []int{3, 0} } +func (x *ComponentStatusResponse_VersionStatus) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + func (x *ComponentStatusResponse_VersionStatus) GetStatus() string { if x != nil { return x.Status @@ -1170,23 +1179,24 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\n" + "statistics\x18\x03 \x01(\v2(.scanoss.api.components.v2.CompStatisticR\n" + "statistics:\xea\x02\x92A\xe6\x02\n" + - "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\x89\n" + + "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xa3\n" + "\n" + "\x17ComponentStatusResponse\x12\x12\n" + "\x04purl\x18\x01 \x01(\tR\x04purl\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + "\vrequirement\x18\x03 \x01(\tR\vrequirement\x12h\n" + "\x0eversion_status\x18\x04 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + - "\x10component_status\x18\x05 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xa9\x02\n" + - "\rVersionStatus\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12+\n" + - "\x11repository_status\x18\x02 \x01(\tR\x10repositoryStatus\x12!\n" + - "\findexed_date\x18\x03 \x01(\tR\vindexedDate\x12\x1d\n" + + "\x10component_status\x18\x05 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xc3\x02\n" + + "\rVersionStatus\x12\x18\n" + + "\aversion\x18\x01 \x01(\tR\aversion\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12+\n" + + "\x11repository_status\x18\x03 \x01(\tR\x10repositoryStatus\x12!\n" + + "\findexed_date\x18\x04 \x01(\tR\vindexedDate\x12\x1d\n" + "\n" + - "check_date\x18\x04 \x01(\tR\tcheckDate\x12)\n" + - "\rerror_message\x18\x05 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + + "check_date\x18\x05 \x01(\tR\tcheckDate\x12)\n" + + "\rerror_message\x18\x06 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + "\n" + - "error_code\x18\x06 \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + + "error_code\x18\a \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + "error_code\x88\x01\x01B\x10\n" + "\x0e_error_messageB\r\n" + "\v_error_code\x1a\xc3\x02\n" + diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index 937d74c..2bbf562 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -192,17 +192,19 @@ message ComponentStatusResponse { // Component version status message VersionStatus { - // Development status of the requested version of this component classified automatically - string status = 1; + // Version identifier + string version = 1; + // Development status of the requested version of this component classified automatically + string status = 2; // Raw status reported by the registry for this version - string repository_status = 2; + string repository_status = 3; // Date that the component was indexed - string indexed_date = 3; + string indexed_date = 4; // Date that the status was checked - string check_date = 4; + string check_date = 5; // States if something went wrong while searching for the version of this component version in the DB - optional string error_message = 5 [json_name = "error_message"]; - optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; + optional string error_message = 6 [json_name = "error_message"]; + optional scanoss.api.common.v2.ErrorCode error_code = 7 [json_name = "error_code"]; } // Component status details (ignoring version) message ComponentStatus { @@ -225,18 +227,18 @@ message ComponentStatusResponse { } /* - * Component Statistics response data (JSON payload) + * Component Status response data (JSON payload) */ message ComponentsStatusResponse { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { example: "{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }" ; } - }; + }; // Component status repeated ComponentStatusResponse components = 1; // Response status - scanoss.api.common.v2.StatusResponse status = 2; + scanoss.api.common.v2.StatusResponse status = 2; } /* diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json index d875521..f00e3e5 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -385,6 +385,10 @@ "ComponentStatusResponseVersionStatus": { "type": "object", "properties": { + "version": { + "type": "string", + "title": "Version identifier" + }, "status": { "type": "string", "title": "Development status of the requested version of this component classified automatically" @@ -812,7 +816,7 @@ "title": "Response status" } }, - "title": "Component Statistics response data (JSON payload)" + "title": "Component Status response data (JSON payload)" }, "v2EchoRequest": { "type": "object",