Skip to content

Commit

Permalink
Merge pull request #22 from puerco/update-response
Browse files Browse the repository at this point in the history
Update API response types
  • Loading branch information
JAORMX authored Jul 19, 2024
2 parents 9849be4 + c9794d8 commit 128e30e
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 128e30e

Please sign in to comment.