V0.38.2 library packages (#235)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-25 14:09:05 +00:00
committed by xcaliber
parent 6943c91f40
commit 2136535176
22 changed files with 1233 additions and 6 deletions

View File

@@ -66,6 +66,7 @@ type Stores struct {
RateLimits RateLimitStore // v0.32.0: Distributed rate limiting
Export ExportStore // v0.34.0: Data portability batch reads + GDPR ops
Connections ConnectionStore // v0.38.1: Extension connection credentials
Dependencies DependencyStore // v0.38.2: Library package dependency graph
}
// =========================================
@@ -1396,6 +1397,35 @@ type ConnectionStore interface {
DeleteByIDAndScope(ctx context.Context, id, scope, ownerID string) (int64, error)
}
// =========================================
// DEPENDENCY STORE (v0.38.2)
// =========================================
type DependencyStore interface {
// Create records that consumerID depends on libraryID.
Create(ctx context.Context, dep *models.ExtDependency) error
// Delete removes a single dependency record.
Delete(ctx context.Context, consumerID, libraryID string) error
// DeleteAllForConsumer removes all dependency records for a consumer.
// Called when uninstalling a consumer package.
DeleteAllForConsumer(ctx context.Context, consumerID string) error
// ListByConsumer returns all libraries that consumerID depends on.
ListByConsumer(ctx context.Context, consumerID string) ([]models.ExtDependency, error)
// ListByLibrary returns all consumers that depend on libraryID.
ListByLibrary(ctx context.Context, libraryID string) ([]models.ExtDependency, error)
// ListAll returns the full dependency graph.
ListAll(ctx context.Context) ([]models.ExtDependency, error)
// HasConsumers returns true if any package depends on libraryID.
// Used for uninstall protection.
HasConsumers(ctx context.Context, libraryID string) (bool, error)
}
// =========================================
// ListOptions provides standard pagination/sort for list queries.