Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
APP_DEBUG="true"
DB_DRIVER="sqlite"
DB_DSN="sqlite/testdb.db?cache=shared&mode=memory"

# Status Mapping Configuration (JSON format)
# Maps database statuses to classified statuses for API responses
# Default mappings: unlisted->removed, yanked->removed, deleted->deleted,
# deprecated->deprecated, unpublished->removed, archived->deprecated, active->active
# STATUS_MAPPING='{"unlisted":"removed","yanked":"removed","deleted":"deleted","deprecated":"deprecated","unpublished":"removed","archived":"deprecated","active":"active"}'
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...


## [0.8.0] - 2026-03-20
### Added
- Added `GetComponentStatus`/`GetComponentsStatus` services for getting single and multiple development life-cycle information
- Added support for custom status mapping for _retrieved_ and _registry-specific_ status
### Changed
- Using **go-component-helper** to get always the right component version based on user request


## [0.7.0] - 2026-01-30
### Added
- Added database version info (`schema_version`, `created_at`) to `StatusResponse` across all component service endpoints
Expand Down Expand Up @@ -38,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.0.1] - ?
### Added
- ?

[0.8.0]: https://github.com/scanoss/components/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/scanoss/components/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/scanoss/components/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/scanoss/components/compare/v0.4.0...v0.5.0
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ DB_SCHEMA=scanoss
DB_SSL_MODE=disable
DB_DSN=
```
## Status mapping
User can define custom status mapping using `STATUS_MAPPING` variable (JSON format)

``` bash
STATUS_MAPPING='{"unlisted":"removed","yanked":"removed","deleted":"deleted","deprecated":"deprecated","unpublished":"removed","archived":"deprecated","active":"active"}'
```

## Docker Environment

Expand Down
11 changes: 11 additions & 0 deletions config/app-config-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,16 @@
"User": "scanoss",
"Passwd": "secret123!",
"Schema": "scanoss"
},
"StatusMapping": {
"Mapping": {
"unlisted": "removed",
"yanked": "removed",
"deleted": "deleted",
"deprecated": "deprecated",
"unpublished": "removed",
"archived": "deprecated",
"active": "active"
}
}
}
69 changes: 38 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module scanoss.com/components

go 1.24
go 1.24.4

toolchain go1.24.6

Expand All @@ -9,24 +9,27 @@ require (
github.com/google/go-cmp v0.7.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/scanoss/go-grpc-helper v0.11.0
github.com/scanoss/go-models v0.4.0
github.com/lib/pq v1.11.2
github.com/scanoss/go-component-helper v0.4.0
github.com/scanoss/go-grpc-helper v0.13.0
github.com/scanoss/go-models v0.7.0
github.com/scanoss/go-purl-helper v0.2.1
github.com/scanoss/papi v0.28.0
github.com/scanoss/papi v0.32.1
github.com/scanoss/zap-logging-helper v0.4.0
go.opentelemetry.io/otel v1.38.0
go.opentelemetry.io/otel/metric v1.38.0
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.75.0
modernc.org/sqlite v1.38.2
go.opentelemetry.io/otel v1.40.0
go.opentelemetry.io/otel/metric v1.40.0
go.uber.org/zap v1.27.1
google.golang.org/grpc v1.79.3
modernc.org/sqlite v1.46.1
)

// replace github.com/scanoss/papi => ../papi

require (
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -35,39 +38,43 @@ require (
github.com/golobby/dotenv v1.3.2 // indirect
github.com/golobby/env/v2 v2.2.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/package-url/packageurl-go v0.1.3 // indirect
github.com/phuslu/iploc v1.0.20230201 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/scanoss/ipfilter/v2 v2.0.2 // indirect
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 // indirect
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.26.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
google.golang.org/protobuf v1.36.6 // indirect
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
golang.org/x/net v0.50.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/text v0.34.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.66.3 // indirect
modernc.org/libc v1.67.6 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
)

// Details of how to use the "replace" command for local development
// https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive
// ie. replace github.com/scanoss/papi => ../papi
// ie.
//replace github.com/scanoss/papi => ../papi

//replace github.com/scanoss/go-component-helper/componenthelper => ../go-component-helper

// require github.com/scanoss/papi v0.0.0-unpublished
//replace github.com/scanoss/go-grpc-helper v0.6.0 => ../go-grpc-helper
Loading
Loading