This commit is contained in:
14
models/addonDependency.go
Normal file
14
models/addonDependency.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AddonDependency is a directed edge: AddonID depends on DependencyID.
|
||||
// No soft delete - edges are replaced wholesale on every report.
|
||||
type AddonDependency struct {
|
||||
AddonID string `gorm:"primaryKey;size:64" json:"addonId"`
|
||||
DependencyID string `gorm:"primaryKey;size:64;index:idx_addon_dependencies_dependency_id" json:"dependencyId"`
|
||||
Version string `json:"version"`
|
||||
DependencyName string `json:"dependencyName"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
@@ -53,6 +53,33 @@ type AddonSearchResult struct {
|
||||
Author string `json:"author"`
|
||||
}
|
||||
|
||||
// DependencyReportItem is one dependency entry reported by the scraper
|
||||
type DependencyReportItem struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// DependencyReport is the scraper payload that replaces all edges for an addon
|
||||
type DependencyReport struct {
|
||||
AddonID string `json:"addonId"`
|
||||
Dependencies []DependencyReportItem `json:"dependencies"`
|
||||
}
|
||||
|
||||
// DependentsResponse lists the addons that depend on a given addon
|
||||
type DependentsResponse struct {
|
||||
AddonID string `json:"addonId"`
|
||||
Dependents []AddonSearchResult `json:"dependents"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// DependenciesResponse lists the addons a given addon depends on
|
||||
type DependenciesResponse struct {
|
||||
AddonID string `json:"addonId"`
|
||||
Dependencies []AddonSearchResult `json:"dependencies"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// SearchResponse contains the search results
|
||||
type SearchResponse struct {
|
||||
Query string `json:"query"`
|
||||
|
||||
Reference in New Issue
Block a user