package mru

import (
	"regexp"
)

// MRU limits - these are configuration constants, not database specific
const (
	// MaxRecentItemsPerObject is the maximum number of recent items to keep per object per user
	MaxRecentItemsPerObject = 50
	// MaxScopeOrderResults is the maximum number of objects to return in scope order
	MaxScopeOrderResults = 50
	// MaxRelevantItemsTotal is the maximum total number of relevant items to return
	MaxRelevantItemsTotal = 2000
)

// objectAPINameRegex validates object API names (alphanumeric + underscore)
// Exported for use by infrastructure layer and testing
var objectAPINameRegex = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)

// ValidateObjectAPIName checks if an object API name is valid
func ValidateObjectAPIName(name string) bool {
	return objectAPINameRegex.MatchString(name)
}
