This commit is contained in:
2026-08-17 21:20:45 +02:00
parent 321f11e817
commit 6fcdc74843
157 changed files with 2895 additions and 7544 deletions
+15
View File
@@ -31,6 +31,21 @@ type LocalizedFields struct {
// LocalizedContent is language-code → per-language product output fields.
type LocalizedContent map[string]LocalizedFields
// Public returns a copy safe for API/UI clients. Drops enhance_input_hash
// (pipeline cache key) so GET product payloads cannot leak job internals.
// UpdateProcessedProduct merges from DB, so omitting the hash on GET is safe.
func (c LocalizedContent) Public() LocalizedContent {
if len(c) == 0 {
return c
}
out := make(LocalizedContent, len(c))
for lang, fields := range c {
fields.EnhanceInputHash = ""
out[lang] = fields
}
return out
}
// SanitizeLangPromptMap validates language codes, sanitizes prompts, and drops empties.
// Accepts LangPromptAny ("*") as a shared any-language prompt key.
func SanitizeLangPromptMap(in map[string]string, maxRunes int) (LangPromptMap, error) {