diff --git a/CHANGELOG.md b/CHANGELOG.md index 58f8a86..1a7ea11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.31.0] - 2026-02-24 +### Added +- Added gRPC `GetComponentStatus` and REST endpoint GET `/v2/components/status/component` for retrieving lifecycle status of a single component +- Added gRPC `GetComponentsStatus` and REST endpoint POST `/v2/components/status/components` for retrieving lifecycle status of multiple components in a single request +- Added `ComponentStatusResponse` message with `VersionStatus` and `ComponentStatus` nested messages providing version-specific and overall component lifecycle information (status, repository status, indexed dates, error handling) +- Added `ComponentsStatusResponse` message for bulk component status responses + ## [0.30.0] - 2026-02-23 ### Added - Added `VERSION_NOT_FOUND` error code to `ErrorCode` enum for handling cases where a component version is not found @@ -231,6 +238,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Vulnerabilities - Added REST endpoint support for each service also +[0.31.0]: https://github.com/scanoss/papi/compare/v0.30.0...v0.31.0 [0.30.0]: https://github.com/scanoss/papi/compare/v0.29.0...v0.30.0 [0.29.0]: https://github.com/scanoss/papi/compare/v0.28.0...v0.29.0 [0.28.0]: https://github.com/scanoss/papi/compare/v0.27.0...v0.28.0 diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index a3c4057..38b2667 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -265,6 +265,143 @@ func (x *ComponentsStatisticResponse) GetStatus() *commonv2.StatusResponse { return nil } +// 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,4,opt,name=version_status,proto3" json:"version_status,omitempty"` + // / Information about the current development status of the component + ComponentStatus *ComponentStatusResponse_ComponentStatus `protobuf:"bytes,5,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) GetName() string { + if x != nil { + return x.Name + } + 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 + } + 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 + 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 + 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) GetComponents() []*ComponentStatusResponse { + if x != nil { + return x.Components + } + 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 +415,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 +427,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 +440,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 +470,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 +482,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 +495,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 +525,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 +537,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 +550,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 +577,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 +589,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 +630,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 +642,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 +679,195 @@ func (x *ComponentsStatisticResponse_ComponentStatistics) GetStatistics() *CompS return nil } +// Component version status +type ComponentStatusResponse_VersionStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Specific version name + 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,2,opt,name=status,proto3" json:"status,omitempty"` + // Raw status reported by the registry for this version + RepositoryStatus string `protobuf:"bytes,3,opt,name=repository_status,proto3" json:"repository_status,omitempty"` + // Date that the component was indexed + IndexedDate string `protobuf:"bytes,4,opt,name=indexed_date,proto3" json:"indexed_date,omitempty"` + // Date that the status was checked + CheckDate string `protobuf:"bytes,5,opt,name=check_date,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,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 +} + +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) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ComponentStatusResponse_VersionStatus) GetStatus() string { + if x != nil { + return x.Status + } + 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 + } + return "" +} + +func (x *ComponentStatusResponse_VersionStatus) GetCheckDate() string { + if x != nil { + return x.CheckDate + } + 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) +} + +// Component status details (ignoring version) +type ComponentStatusResponse_ComponentStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + // 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,proto3" json:"repository_status,omitempty"` + // Date of the first time component was indexed + FirstIndexedDate string `protobuf:"bytes,3,opt,name=first_indexed_date,proto3" json:"first_indexed_date,omitempty"` + // Date of the last time component was indexed + LastIndexedDate string `protobuf:"bytes,4,opt,name=last_indexed_date,proto3" json:"last_indexed_date,omitempty"` + // 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 + 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) GetStatus() string { + if x != nil { + return x.Status + } + 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 + } + return "" +} + +func (x *ComponentStatusResponse_ComponentStatus) GetLastIndexedDate() string { + if x != nil { + return x.LastIndexedDate + } + 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"` @@ -556,7 +882,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 +894,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 +907,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 +952,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 +964,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 +977,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 +1021,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 +1033,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 +1046,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 +1085,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 +1097,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 +1110,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 +1179,46 @@ 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\"}}\"\xab\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\xc6\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\x11repository_status\x12\"\n" + + "\findexed_date\x18\x04 \x01(\tR\findexed_date\x12\x1e\n" + + "\n" + + "check_date\x18\x05 \x01(\tR\n" + + "check_date\x12)\n" + + "\rerror_message\x18\x06 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + + "\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\xc8\x02\n" + + "\x0fComponentStatus\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12,\n" + + "\x11repository_status\x18\x02 \x01(\tR\x11repository_status\x12.\n" + + "\x12first_indexed_date\x18\x03 \x01(\tR\x12first_indexed_date\x12,\n" + + "\x11last_indexed_date\x18\x04 \x01(\tR\x11last_indexed_date\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:\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:\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" + @@ -887,13 +1252,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\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/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\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" + @@ -914,49 +1281,65 @@ 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.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{ - 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.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 + 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 + 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() } @@ -964,13 +1347,15 @@ 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{ 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..92d25d2 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/component")) + 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/components")) + 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/component")) + 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/components")) + 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, 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 ( @@ -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..45bab06 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 via a get request + GetComponentStatus(ctx context.Context, in *commonv2.ComponentRequest, opts ...grpc.CallOption) (*ComponentStatusResponse, error) + // Get the status for a list of purls posted in the body + 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 via a get request + GetComponentStatus(context.Context, *commonv2.ComponentRequest) (*ComponentStatusResponse, error) + // Get the status for a list of purls posted in the body + 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..5063560 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -103,6 +103,21 @@ service Components { body: "*" }; }; + + // 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/component" + }; + }; + + // 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/components" + body: "*" + }; + }; } /* @@ -159,6 +174,74 @@ message ComponentsStatisticResponse { scanoss.api.common.v2.StatusResponse status = 2; } +/* + * Component lifecycle status +*/ +message ComponentStatusResponse { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + 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 { + // Specific version name + 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 = 3[json_name = "repository_status"]; + // Date that the component was indexed + string indexed_date = 4 [json_name = "indexed_date"]; + // Date that the status was checked + string check_date = 5 [json_name = "check_date"]; + // States if something went wrong while searching for the version of this component version in the DB + optional string error_message = 6[json_name = "error_message"]; + optional common.v2.ErrorCode error_code = 7 [json_name = "error_code"]; + } + // Component status details (ignoring version) + message ComponentStatus { + // Development status of the requested component classified automatically + string status = 1; + // Raw status reported by the registry for this component + string repository_status = 2 [json_name = "repository_status"]; + // Date of the first time component was indexed + string first_indexed_date = 3 [json_name = "first_indexed_date"]; + // Date of the last time component was indexed + string last_indexed_date = 4 [json_name = "last_indexed_date"]; + // 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 = 4 [json_name = "version_status"]; + /// Information about the current development status of the component + ComponentStatus component_status = 5 [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\",\"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; +} + /* * 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..343b8d1 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -185,6 +185,93 @@ ] } }, + "/v2/components/status/component": { + "get": { + "summary": "Get status information for a specific purl via a get request", + "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" + ] + } + }, + "/v2/components/status/components": { + "post": { + "summary": "Get the status for a list of purls posted in the body", + "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 +353,68 @@ }, "title": "Version details (including license)" }, + "ComponentStatusResponseComponentStatus": { + "type": "object", + "properties": { + "status": { + "type": "string", + "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", + "title": "Date of the first time component was indexed" + }, + "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 searching for the version of this component in the DB" + }, + "error_code": { + "$ref": "#/definitions/v2ErrorCode" + } + }, + "title": "Component status details (ignoring version)" + }, + "ComponentStatusResponseVersionStatus": { + "type": "object", + "properties": { + "version": { + "type": "string", + "title": "Specific version name" + }, + "status": { + "type": "string", + "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", + "title": "Date that the component was indexed" + }, + "check_date": { + "type": "string", + "title": "Date that the status was checked" + }, + "error_message": { + "type": "string", + "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", "properties": { @@ -517,6 +666,48 @@ "purl" ] }, + "v2ComponentStatusResponse": { + "type": "object", + "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" + } + }, + "properties": { + "purl": { + "type": "string", + "title": "Purl requested" + }, + "name": { + "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" + }, + "component_status": { + "$ref": "#/definitions/ComponentStatusResponseComponentStatus", + "title": "/ Information about the current development status of the component" + } + }, + "title": "Component lifecycle status" + }, "v2ComponentsRequest": { "type": "object", "example": { @@ -589,6 +780,44 @@ }, "title": "Component Statistics response data (JSON payload)" }, + "v2ComponentsStatusResponse": { + "type": "object", + "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" + } + } + ] + }, + "properties": { + "components": { + "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": { @@ -607,6 +836,18 @@ }, "description": "Echo Message Response." }, + "v2ErrorCode": { + "type": "string", + "enum": [ + "INVALID_PURL", + "COMPONENT_NOT_FOUND", + "NO_INFO", + "INVALID_SEMVER", + "VERSION_NOT_FOUND" + ], + "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\n - VERSION_NOT_FOUND: Component version not found" + }, "v2StatusCode": { "type": "string", "enum": [