mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
feat(api): add kind field to sync, audit, check, update, and install handlers
handler_sync: add Kind field to diff stream item struct. handler_audit: add Kind field to audit stream result. handler_check: add Kind field to check stream result. handler_update: add Kind field to update stream result. handler_install: add Kind field to install request for agent support.
This commit is contained in:
@@ -40,6 +40,7 @@ type auditResultResponse struct {
|
||||
AuditableBytes int64 `json:"auditableBytes"`
|
||||
Analyzability float64 `json:"analyzability"`
|
||||
TierProfile audit.TierProfile `json:"tierProfile"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
|
||||
type auditSummary struct {
|
||||
|
||||
@@ -23,6 +23,7 @@ type skillCheckResult struct {
|
||||
Version string `json:"version"`
|
||||
Status string `json:"status"`
|
||||
InstalledAt string `json:"installed_at,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
|
||||
func (s *Server) handleCheck(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@@ -91,6 +91,7 @@ func (s *Server) handleInstallBatch(w http.ResponseWriter, r *http.Request) {
|
||||
SkipAudit bool `json:"skipAudit"`
|
||||
Into string `json:"into"`
|
||||
Name string `json:"name"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
||||
writeError(w, http.StatusBadRequest, "invalid JSON body")
|
||||
@@ -251,6 +252,7 @@ func (s *Server) handleInstall(w http.ResponseWriter, r *http.Request) {
|
||||
SkipAudit bool `json:"skipAudit"`
|
||||
Track bool `json:"track"`
|
||||
Into string `json:"into"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
||||
writeError(w, http.StatusBadRequest, "invalid JSON body")
|
||||
|
||||
@@ -181,6 +181,7 @@ type diffItem struct {
|
||||
Skill string `json:"skill"`
|
||||
Action string `json:"action"` // "link", "update", "skip", "prune", "local"
|
||||
Reason string `json:"reason"` // human-readable description
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
|
||||
type diffTarget struct {
|
||||
|
||||
@@ -28,6 +28,7 @@ type updateResultItem struct {
|
||||
IsRepo bool `json:"isRepo"`
|
||||
AuditRiskScore int `json:"auditRiskScore,omitempty"`
|
||||
AuditRiskLabel string `json:"auditRiskLabel,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
|
||||
func (s *Server) updateAuditThreshold() string {
|
||||
|
||||
Reference in New Issue
Block a user