feat: publish sanitized custom.97 source

This commit is contained in:
cneicy committed 2026-10-27 20:43:39 +08:00
1 parent 8e6ed0317b
commit 86c0276156
1022 files changed
+69903 -19207

No files matched your search

+6 -7
View File
@@ -13,6 +13,7 @@ import (
"github.com/QuantumNous/new-api/common"
"github.com/QuantumNous/new-api/dto"
pluginruntime "github.com/QuantumNous/new-api/pkg/jsplugin"
)
const (
@@ -101,15 +102,13 @@ type ProtocolState struct {
Value json.RawMessage
}
func (s ProtocolState) PluginValue() (any, error) {
// PluginValue returns the state as a hook argument: nil when it is absent or
// null, otherwise its JSON text for the hook to receive parsed.
func (s ProtocolState) PluginValue() any {
if !s.Present || s.Null {
return nil, nil
return nil
}
var value any
if err := common.Unmarshal(s.Value, &value); err != nil {
return nil, err
}
return value, nil
return pluginruntime.RawJSON(s.Value)
}
type ProtocolSemanticEvent struct {