Changeset 0.11.0 (#62)
This commit is contained in:
@@ -536,6 +536,49 @@ func (m *JSONMap) Scan(src interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ── Extensions ──────────────────────────────
|
||||
|
||||
// Extension tier constants
|
||||
const (
|
||||
ExtTierBrowser = "browser"
|
||||
ExtTierStarlark = "starlark"
|
||||
ExtTierSidecar = "sidecar"
|
||||
)
|
||||
|
||||
// Extension represents an installed extension in the registry.
|
||||
type Extension struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
ExtID string `json:"ext_id" db:"ext_id"` // manifest id
|
||||
Name string `json:"name" db:"name"`
|
||||
Version string `json:"version" db:"version"`
|
||||
Tier string `json:"tier" db:"tier"`
|
||||
Description string `json:"description" db:"description"`
|
||||
Author string `json:"author" db:"author"`
|
||||
Manifest json.RawMessage `json:"manifest" db:"manifest"`
|
||||
IsSystem bool `json:"is_system" db:"is_system"`
|
||||
IsEnabled bool `json:"is_enabled" db:"is_enabled"`
|
||||
Scope string `json:"scope" db:"scope"`
|
||||
TeamID *string `json:"team_id,omitempty" db:"team_id"`
|
||||
InstalledBy *string `json:"installed_by,omitempty" db:"installed_by"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
||||
}
|
||||
|
||||
// ExtensionUserSettings stores per-user overrides for an extension.
|
||||
type ExtensionUserSettings struct {
|
||||
ExtensionID string `json:"extension_id" db:"extension_id"`
|
||||
UserID string `json:"user_id" db:"user_id"`
|
||||
Settings json.RawMessage `json:"settings" db:"settings"`
|
||||
IsEnabled bool `json:"is_enabled" db:"is_enabled"`
|
||||
}
|
||||
|
||||
// UserExtension combines extension info with user-specific settings for API responses.
|
||||
type UserExtension struct {
|
||||
Extension
|
||||
UserEnabled *bool `json:"user_enabled,omitempty"`
|
||||
UserSettings *json.RawMessage `json:"user_settings,omitempty"`
|
||||
}
|
||||
|
||||
func NullString(s *string) sql.NullString {
|
||||
if s == nil {
|
||||
return sql.NullString{}
|
||||
|
||||
Reference in New Issue
Block a user