Changeset 0.30.0 (#199)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit is contained in:
@@ -66,6 +66,23 @@ type PackageStore interface {
|
||||
|
||||
// DeleteUserSettings removes per-user settings, reverting to defaults.
|
||||
DeleteUserSettings(ctx context.Context, pkgID, userID string) error
|
||||
|
||||
// ── Scoped visibility (v0.30.0) ────────────────
|
||||
|
||||
// ListVisiblePackages returns packages visible to the given user:
|
||||
// global packages + team packages for user's teams + personal packages.
|
||||
ListVisiblePackages(ctx context.Context, userID string) ([]PackageRegistration, error)
|
||||
|
||||
// ── Package lifecycle (v0.30.0) ─────────────────
|
||||
|
||||
// SetSchemaVersion updates the current schema version for a package.
|
||||
SetSchemaVersion(ctx context.Context, id string, version int) error
|
||||
|
||||
// GetPackageSettings returns the admin-configured package-level settings.
|
||||
GetPackageSettings(ctx context.Context, id string) (json.RawMessage, error)
|
||||
|
||||
// SetPackageSettings stores admin-configured package-level settings.
|
||||
SetPackageSettings(ctx context.Context, id string, settings json.RawMessage) error
|
||||
}
|
||||
|
||||
// PackageRegistration is a row from the packages table.
|
||||
@@ -84,9 +101,11 @@ type PackageRegistration struct {
|
||||
Manifest map[string]any `json:"manifest" db:"manifest"`
|
||||
Enabled bool `json:"enabled" db:"enabled"`
|
||||
Status string `json:"status" db:"status"`
|
||||
Source string `json:"source" db:"source"`
|
||||
InstalledAt string `json:"installed_at" db:"installed_at"`
|
||||
UpdatedAt string `json:"updated_at" db:"updated_at"`
|
||||
SchemaVersion int `json:"schema_version" db:"schema_version"`
|
||||
PackageSettings json.RawMessage `json:"package_settings" db:"package_settings"`
|
||||
Source string `json:"source" db:"source"`
|
||||
InstalledAt string `json:"installed_at" db:"installed_at"`
|
||||
UpdatedAt string `json:"updated_at" db:"updated_at"`
|
||||
}
|
||||
|
||||
// UserPackage combines package info with per-user settings for API responses.
|
||||
|
||||
Reference in New Issue
Block a user