feat: improve timeline/admin flows and ingest projection repairs

This commit is contained in:
2026-03-01 00:21:31 +03:00
parent c805daabcf
commit 229db81229
26 changed files with 2873 additions and 270 deletions

View File

@@ -30,6 +30,24 @@ func RegisterAssetComponentRoutes(mux *http.ServeMux, deps AssetComponentDepende
}
func (h assetComponentHandlers) handleAsset(w http.ResponseWriter, r *http.Request) {
if strings.HasSuffix(r.URL.Path, "/imports") {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
if h.deps.Timeline == nil {
writeError(w, http.StatusInternalServerError, "import history unavailable")
return
}
id, ok := parseSubresourceID(r.URL.Path, "/assets/", "/imports")
if !ok {
writeError(w, http.StatusNotFound, "asset import history not found")
return
}
writeImportHistoryResponse(w, r, h.deps.Timeline, "asset", id)
return
}
if strings.HasSuffix(r.URL.Path, "/timeline") {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
@@ -107,6 +125,24 @@ func (h assetComponentHandlers) handleAsset(w http.ResponseWriter, r *http.Reque
}
func (h assetComponentHandlers) handleComponent(w http.ResponseWriter, r *http.Request) {
if strings.HasSuffix(r.URL.Path, "/imports") {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
if h.deps.Timeline == nil {
writeError(w, http.StatusInternalServerError, "import history unavailable")
return
}
id, ok := parseSubresourceID(r.URL.Path, "/components/", "/imports")
if !ok {
writeError(w, http.StatusNotFound, "component import history not found")
return
}
writeImportHistoryResponse(w, r, h.deps.Timeline, "component", id)
return
}
if strings.HasSuffix(r.URL.Path, "/timeline") {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)