Skip to content

Commit

Permalink
Update API response types
Browse files Browse the repository at this point in the history
This commit updates the Trusty API response types to add some missing
fields added since the first client was created.

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
  • Loading branch information
puerco committed Jul 19, 2024
1 parent 2e2c233 commit c9794d8
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions pkg/types/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ import "time"

// Reply is the response from the package report API
type Reply struct {
PackageName string `json:"package_name"`
PackageType string `json:"package_type"`
Summary ScoreSummary `json:"summary"`
Alternatives AlternativesList `json:"alternatives"`
PackageData PackageData `json:"package_data"`
Provenance *Provenance `json:"provenance"`
PackageName string `json:"package_name"`
PackageType string `json:"package_type"`
PackageVersion string `json:"package_version"`
Status string `json:"status"`
Summary ScoreSummary `json:"summary"`
Provenance *Provenance `json:"provenance"`
Activity *Activity `json:"activity"`
Typosquatting *Typosquatting `json:"typosquatting"`
Alternatives AlternativesList `json:"alternatives"`
PackageData PackageData `json:"package_data"`
}

// Activity captures a package's activity score
type Activity struct {
Score float64 `json:"score"`
Description string `json:"description"`
}

// Typosquatting score for the package's name
type Typosquatting struct {
Score float64 `json:"score"`
Description string `json:"description"`
}

// Alternative is an alternative package returned from the package intelligence API
Expand Down

0 comments on commit c9794d8

Please sign in to comment.