admin

package
v0.140.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 182 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ActionDisabledReasonCodeTranslationMissing     = string(translationcore.DisabledReasonTranslationMissing)
	ActionDisabledReasonCodeInvalidStatus          = string(translationcore.DisabledReasonInvalidStatus)
	ActionDisabledReasonCodePermissionDenied       = string(translationcore.DisabledReasonPermissionDenied)
	ActionDisabledReasonCodeMissingContext         = string(translationcore.DisabledReasonMissingContext)
	ActionDisabledReasonCodeFeatureDisabled        = TextCodeFeatureDisabled
	ActionDisabledReasonCodeResourceInUse          = TextCodeResourceInUse
	ActionDisabledReasonCodePreconditionFailed     = TextCodePreconditionFailed
	ActionDisabledReasonCodeInvalidSelection       = TextCodeInvalidSelection
	ActionDisabledReasonCodeRateLimited            = TextCodeRateLimited
	ActionDisabledReasonCodeTemporarilyUnavailable = TextCodeTemporarilyUnavailable
)

Canonical action disabled reason codes consumed by frontend action renderers.

View Source
const (
	ActivityActorTypeKey       = "actor_type"
	ActivityActorTypeKeyLegacy = "actorType"
	ActivityActorTypeSystem    = "system"
	ActivityActorTypeJob       = "job"
	ActivityActorTypeTask      = "task"
)
View Source
const (
	ActivityObjectTypeUser             = "user"
	ActivityObjectTypeRole             = "role"
	ActivityObjectTypeTenant           = "tenant"
	ActivityObjectTypeOrganization     = "organization"
	ActivityObjectTypeSettings         = "settings"
	ActivityObjectTypeDashboard        = "dashboard"
	ActivityObjectTypePanel            = "panel"
	ActivityObjectTypeNotification     = "notification"
	ActivityObjectTypePreferences      = "preferences"
	ActivityObjectTypeProfile          = "profile"
	ActivityObjectTypeJob              = "job"
	ActivityObjectTypeWidgetArea       = "widget_area"
	ActivityObjectTypeWidgetDefinition = "widget_def"
	ActivityObjectTypeWidgetInstance   = "widget_instance"
	ActivityObjectTypeMenu             = "menu"
	ActivityObjectTypeMenuItem         = "menu_item"
	ActivityObjectTypePage             = "page"
	ActivityObjectTypeContent          = "content"
	ActivityObjectTypeBlockDefinition  = "block_def"
	ActivityObjectTypeBlock            = "block"
)
View Source
const (
	BrowserCSRFErrorQueryKey      = "csrf_error"
	BrowserCSRFFormExpiredCode    = "form_expired"
	BrowserCSRFErrorMessageLocal  = "csrf_error_message"
	BrowserCSRFFormExpiredMessage = "The form expired. Please review your changes and try again."
)
View Source
const (
	WidgetDefinitionSyncStatusCreated   = cmsboot.WidgetDefinitionSyncStatusCreated
	WidgetDefinitionSyncStatusUpdated   = cmsboot.WidgetDefinitionSyncStatusUpdated
	WidgetDefinitionSyncStatusUnchanged = cmsboot.WidgetDefinitionSyncStatusUnchanged
)
View Source
const (
	// CMSPagePolicyEntity is the translation-policy and family entity for the
	// first-class go-cms Pages service. It is plural because policy inputs and
	// family records identify the service surface, not the backing content type.
	CMSPagePolicyEntity = "pages"

	// CMSPageContentTypeSlug is the backing go-cms content type slug used by
	// Pages service records when they are bridged through generic content APIs.
	CMSPageContentTypeSlug = "page"
)
View Source
const (
	DefaultIconoirCSSAssetPath    = "assets/dist/third-party/iconoir/iconoir.css"
	DefaultDataTablesCSSAssetPath = "assets/dist/third-party/simple-datatables/style.css"
	DefaultEChartsJSAssetPath     = "assets/dist/third-party/echarts/echarts.min.js"
)

Default third-party asset paths are relative to the configured admin asset base and are rendered through asset_base_path in the shared templates.

View Source
const (
	NavigationOverrideInherit = "inherit"
	NavigationOverrideShow    = "show"
	NavigationOverrideHide    = "hide"

	DefaultEntryNavigationActivityAction = "content.navigation_visibility.update"
)
View Source
const (
	ContentTypeCapabilityKeyBlocks          = "blocks"
	ContentTypeCapabilityKeyBlockTypes      = "block_types"
	ContentTypeCapabilityKeyI18N            = "i18n"
	ContentTypeCapabilityKeyLocalized       = "localized"
	ContentTypeCapabilityKeyMenuLabel       = "menu_label"
	ContentTypeCapabilityKeyNavigationLabel = "navigation_label"
	ContentTypeCapabilityKeyPanelLabel      = "panel_label"
	ContentTypeCapabilityKeyPanelPreset     = "panel_preset"
	ContentTypeCapabilityKeyPanelSlug       = "panel_slug"
	ContentTypeCapabilityKeyPanelTraits     = "panel_traits"
	ContentTypeCapabilityKeyPermission      = "permission"
	ContentTypeCapabilityKeyPermissions     = "permissions"
	ContentTypeCapabilityKeySEO             = "seo"
	ContentTypeCapabilityKeySearchContent   = "search_content_type"
	ContentTypeCapabilityKeyTranslation     = "translation"
	ContentTypeCapabilityKeyTranslations    = "translations"
	ContentTypeCapabilityKeyTree            = "tree"
	ContentTypeCapabilityKeyTreeView        = "tree_view"
	ContentTypeCapabilityKeyUseSEO          = "use_seo"
	ContentTypeCapabilityKeyWorkflow        = "workflow"
	ContentTypeCapabilityKeyWorkflowID      = "workflow_id"
	ContentTypeCapabilityKeyWorkflowKey     = "workflow_key"
)
View Source
const (
	DataPanelOverview     = "overview"
	DataPanelScenarios    = "scenarios"
	DataPanelOperations   = "operations"
	DataPanelVerification = "verification"
	DataPanelCoverage     = "coverage"
	// DataPanelDatasets names the panel that serves the dataset catalog records.
	//
	// Deprecated: the catalog is served by DataPanelExplore.
	DataPanelDatasets = DataPanelExplore
)

Data console panel IDs, in tab order. The dataset catalog is the Explore panel's record set, so there is no separate Datasets tab.

View Source
const (
	DebugPanelTemplate   = "template"
	DebugPanelSession    = "session"
	DebugPanelRequests   = "requests"
	DebugPanelSQL        = "sql"
	DebugPanelLogs       = "logs"
	DebugPanelConfig     = "config"
	DebugPanelRoutes     = "routes"
	DebugPanelCustom     = "custom"
	DebugPanelJSErrors   = "jserrors"
	DebugPanelShell      = "shell"
	DebugPanelConsole    = "console"
	DebugPanelCommands   = DebugPanelCommandLauncher
	DebugPanelDoctor     = "doctor"
	DebugPanelDeployment = "deployment"
)
View Source
const (
	DebugREPLKindShell = "shell"
	DebugREPLKindApp   = "app"
)
View Source
const (
	DebugREPLOverrideKeyMetadata   = "override_key"
	DebugREPLOverrideTokenMetadata = "override_token"
)
View Source
const (
	DeploymentPersonaVisualMonogram = deploymentidentity.VisualKindMonogram
	DeploymentPersonaVisualImage    = deploymentidentity.VisualKindImage
	DeploymentPersonaMediaTypePNG   = deploymentidentity.MediaTypePNG
)
View Source
const (
	EnhancedFragmentModeReplace = "replace"
	EnhancedMutationMediaType   = "application/vnd.admin.enhanced+json"
)
View Source
const (
	TextCodeValidationError                      = string(translationcore.ErrorValidation)
	TextCodeAdminCSRFInvalid                     = "ADMIN_CSRF_INVALID"
	TextCodeInvalidFeatureConfig                 = "INVALID_FEATURE_CONFIG"
	TextCodeForbidden                            = "FORBIDDEN"
	TextCodeNotFound                             = string(translationcore.ErrorNotFound)
	TextCodeInvalidStatus                        = string(translationcore.DisabledReasonInvalidStatus)
	TextCodeMissingContext                       = string(translationcore.DisabledReasonMissingContext)
	TextCodeFeatureDisabled                      = string(translationcore.DisabledReasonFeatureDisabled)
	TextCodeResourceInUse                        = "RESOURCE_IN_USE"
	TextCodePreconditionFailed                   = "PRECONDITION_FAILED"
	TextCodeInvalidSelection                     = "INVALID_SELECTION"
	TextCodeRateLimited                          = "RATE_LIMITED"
	TextCodeTemporarilyUnavailable               = "TEMPORARILY_UNAVAILABLE"
	TextCodeReplSessionLimit                     = "REPL_SESSION_LIMIT"
	TextCodeWorkflowNotFound                     = "WORKFLOW_NOT_FOUND"
	TextCodeWorkflowInvalidTransition            = "WORKFLOW_INVALID_TRANSITION"
	TextCodeTranslationMissing                   = string(translationcore.DisabledReasonTranslationMissing)
	TextCodeTranslationExists                    = "TRANSLATION_EXISTS"
	TextCodeAutosaveConflict                     = "AUTOSAVE_CONFLICT"
	TextCodeTranslationQueueConflict             = "TRANSLATION_QUEUE_CONFLICT"
	TextCodeTranslationQueueVersionConflict      = "TRANSLATION_QUEUE_VERSION_CONFLICT"
	TextCodeTranslationExchangeUnsupportedFormat = "TRANSLATION_EXCHANGE_UNSUPPORTED_FORMAT"
	TextCodeTranslationExchangeInvalidPayload    = "TRANSLATION_EXCHANGE_INVALID_PAYLOAD"
	TextCodeTranslationExchangeMissingLinkage    = "TRANSLATION_EXCHANGE_MISSING_LINKAGE"
	TextCodeTranslationExchangeDuplicateRow      = "TRANSLATION_EXCHANGE_DUPLICATE_ROW"
	TextCodeTranslationExchangeStaleSourceHash   = "TRANSLATION_EXCHANGE_STALE_SOURCE_HASH"
	TextCodeContentTypeSchemaBreaking            = "CONTENT_TYPE_SCHEMA_BREAKING"
	TextCodeFeatureEnabledRequired               = "FEATURE_ENABLED_REQUIRED"
	TextCodeFeatureAliasDisabled                 = "FEATURE_ALIAS_DISABLED"
	TextCodeMissingPanel                         = "MISSING_PANEL"
	TextCodeRawUINotSupported                    = "RAW_UI_NOT_SUPPORTED"
	TextCodeClearKeysNotSupported                = "CLEAR_KEYS_NOT_SUPPORTED"
	TextCodeReplDebugDisabled                    = "REPL_DEBUG_DISABLED"
	TextCodeReplShellDisabled                    = "REPL_SHELL_DISABLED"
	TextCodeReplAppDisabled                      = "REPL_APP_DISABLED"
	TextCodeReplDisabled                         = "REPL_DISABLED"
	TextCodeReplOverrideDenied                   = "REPL_OVERRIDE_DENIED"
	TextCodeReplRoleDenied                       = "REPL_ROLE_DENIED"
	TextCodeReplPermissionDenied                 = "REPL_PERMISSION_DENIED"
	TextCodeReplExecPermissionDenied             = "REPL_EXEC_PERMISSION_DENIED"
	TextCodeReplReadOnly                         = "REPL_READ_ONLY"
	TextCodeReplIPDenied                         = "REPL_IP_DENIED"
	TextCodePathConflict                         = "PATH_CONFLICT"
	TextCodeConflict                             = "CONFLICT"
	TextCodeServiceUnavailable                   = "SERVICE_UNAVAILABLE"
	TextCodeActivityActorContextInvalid          = "ACTIVITY_ACTOR_CONTEXT_INVALID"
	TextCodeConsoleClientOutdated                = "CONSOLE_CLIENT_OUTDATED"
	TextCodeMenuValidationCycle                  = "MENU_VALIDATION_CYCLE"
	TextCodeMenuValidationDepth                  = "MENU_VALIDATION_DEPTH"
	TextCodeMenuValidationInvalidTarget          = "MENU_VALIDATION_INVALID_TARGET"
)
View Source
const (
	MenuRecordStatusDraft     = "draft"
	MenuRecordStatusPublished = "published"
)
View Source
const (
	NavigationClassificationRendered              = navcontract.ClassificationRendered
	NavigationClassificationPersistedMissing      = navcontract.ClassificationPersistedMissing
	NavigationClassificationRawPresentNotRendered = navcontract.ClassificationRawPresentNotRendered
	NavigationClassificationPermissionFiltered    = navcontract.ClassificationPermissionFiltered
	NavigationClassificationCapabilityOmitted     = navcontract.ClassificationCapabilityOmitted
	NavigationClassificationRouteMissing          = navcontract.ClassificationRouteMissing
	NavigationClassificationStaleFields           = navcontract.ClassificationStaleFields
	NavigationClassificationAmbiguousDuplicate    = navcontract.ClassificationAmbiguousDuplicate
	NavigationClassificationRetired               = navcontract.ClassificationRetired
	NavigationClassificationCustom                = navcontract.ClassificationCustom
	NavigationClassificationUnsafeBroadMatch      = navcontract.ClassificationUnsafeBroadMatch
)
View Source
const (
	NavigationOwnerQuickstart = navcontract.OwnerQuickstart
	NavigationOwnerModule     = navcontract.OwnerModule
	NavigationOwnerHost       = navcontract.OwnerHost
	NavigationOwnerUser       = navcontract.OwnerUser
)
View Source
const (
	MenuItemTypeItem      = navinternal.MenuItemTypeItem
	MenuItemTypeGroup     = navinternal.MenuItemTypeGroup
	MenuItemTypeSeparator = navinternal.MenuItemTypeSeparator

	NavigationPermissionDeniedModeHide    = navinternal.NavigationPermissionDeniedModeHide
	NavigationPermissionDeniedModeDisable = navinternal.NavigationPermissionDeniedModeDisable

	NavigationDisabledReasonCodePermissionDenied = navinternal.NavigationDisabledReasonCodePermissionDenied

	ResolveSourceCMS                 = navinternal.ResolveSourceCMS
	ResolveSourceFallbackNoCMS       = navinternal.ResolveSourceFallbackNoCMS
	ResolveSourceFallbackCMSDisabled = navinternal.ResolveSourceFallbackCMSDisabled
	ResolveSourceFallbackCMSError    = navinternal.ResolveSourceFallbackCMSError
	ResolveSourceFallbackCMSMissing  = navinternal.ResolveSourceFallbackCMSMissing
)
View Source
const (
	PermAdminWildcard = "admin.*"

	PermAdminDashboardView = "admin.dashboard.view"

	PermAdminUsersView   = "admin.users.view"
	PermAdminUsersCreate = "admin.users.create"
	PermAdminUsersImport = "admin.users.import"
	PermAdminUsersEdit   = "admin.users.edit"
	PermAdminUsersDelete = "admin.users.delete"

	PermAdminRolesView   = "admin.roles.view"
	PermAdminRolesCreate = "admin.roles.create"
	PermAdminRolesEdit   = "admin.roles.edit"
	PermAdminRolesDelete = "admin.roles.delete"

	PermAdminTenantsView   = "admin.tenants.view"
	PermAdminTenantsCreate = "admin.tenants.create"
	PermAdminTenantsEdit   = "admin.tenants.edit"
	PermAdminTenantsDelete = "admin.tenants.delete"

	PermAdminOrganizationsView   = "admin.organizations.view"
	PermAdminOrganizationsCreate = "admin.organizations.create"
	PermAdminOrganizationsEdit   = "admin.organizations.edit"
	PermAdminOrganizationsDelete = "admin.organizations.delete"

	PermAdminMediaView   = "admin.media.view"
	PermAdminMediaCreate = "admin.media.create"
	PermAdminMediaEdit   = "admin.media.edit"
	PermAdminMediaDelete = "admin.media.delete"

	PermAdminActivityView = "admin.activity.view"

	PermAdminSettingsView = "admin.settings.view"
	PermAdminSettingsEdit = "admin.settings.edit"

	PermAdminFeatureFlagsView   = "admin.feature_flags.view"
	PermAdminFeatureFlagsUpdate = "admin.feature_flags.update"

	PermAdminNotificationsView           = "admin.notifications.view"
	PermAdminNotificationsUpdate         = "admin.notifications.update"
	PermAdminNotificationsInspect        = "admin.notifications.inspect"
	PermAdminNotificationsReceiptsView   = "admin.notifications.receipts.view"
	PermAdminNotificationsRetentionPurge = "admin.notifications.retention.purge"

	PermAdminJobsView    = "admin.jobs.view"
	PermAdminJobsEdit    = "admin.jobs.edit"
	PermAdminJobsTrigger = "admin.jobs.trigger"

	PermAdminSearchView = "admin.search.view"

	PermAdminPreferencesView         = "admin.preferences.view"
	PermAdminPreferencesEdit         = "admin.preferences.edit"
	PermAdminPreferencesManageTenant = "admin.preferences.manage_tenant"
	PermAdminPreferencesManageOrg    = "admin.preferences.manage_org"
	PermAdminPreferencesManageSystem = "admin.preferences.manage_system"

	PermAdminProfileView = "admin.profile.view"
	PermAdminProfileEdit = "admin.profile.edit"

	PermAdminDebugView          = "admin.debug.view"
	PermAdminDebugRepl          = "admin.debug.repl"
	PermAdminDebugReplExec      = "admin.debug.repl.exec"
	PermAdminDebugSessionView   = "admin.debug.session.view"
	PermAdminDebugSessionAttach = "admin.debug.session.attach"

	PermAdminMenusView    = "admin.menus.view"
	PermAdminMenusEdit    = "admin.menus.edit"
	PermAdminMenusPublish = "admin.menus.publish"

	PermAdminSiteRead                = "admin.site.read"
	PermAdminSiteReadDrafts          = "admin.site.read_drafts"
	PermAdminSiteViewProfileOverride = "admin.site.view_profile_override"

	PermAdminPagesView    = "admin.pages.view"
	PermAdminPagesCreate  = "admin.pages.create"
	PermAdminPagesEdit    = "admin.pages.edit"
	PermAdminPagesDelete  = "admin.pages.delete"
	PermAdminPagesPublish = "admin.pages.publish"

	PermAdminPostsView    = "admin.posts.view"
	PermAdminPostsCreate  = "admin.posts.create"
	PermAdminPostsEdit    = "admin.posts.edit"
	PermAdminPostsDelete  = "admin.posts.delete"
	PermAdminPostsPublish = "admin.posts.publish"

	PermAdminContentTypesView      = "admin.content_types.view"
	PermAdminBlockDefinitionsView  = "admin.block_definitions.view"
	PermAdminContentModelingManage = "admin.content_modeling.manage"

	PermAdminIntegrationsManage = "admin.integrations.manage"
	PermAdminTranscriptsIngest  = "admin.transcripts.ingest"

	PermAdminArchiveView     = "admin.archive.view"
	PermAdminArchiveCreate   = "admin.archive.create"
	PermAdminArchiveEdit     = "admin.archive.edit"
	PermAdminArchiveDelete   = "admin.archive.delete"
	PermAdminArchivePublish  = "admin.archive.publish"
	PermAdminArchiveDiagnose = "admin.archive.diagnose"
)
View Source
const (
	RolesOpenAPISource  = "roles.json"
	CreateRoleOperation = "createRole"
	UpdateRoleOperation = "updateRole"
)
View Source
const (
	// RPCMethodCommandDispatch dispatches a named command through the admin command bus.
	RPCMethodCommandDispatch = "admin.commands.dispatch"
	// RPCMethodCommandList returns registered command names available for dispatch.
	RPCMethodCommandList = "admin.commands.list"
)
View Source
const (
	RPCMethodWorkflowBindingsList    = "fsm.bindings.list"
	RPCMethodWorkflowBindingsUpsert  = "fsm.bindings.upsert"
	RPCMethodWorkflowBindingsDelete  = "fsm.bindings.delete"
	RPCMethodWorkflowBindingsResolve = "fsm.bindings.resolve"
)
View Source
const (
	// DefaultSchemaMaxSizeBytes is the maximum JSON schema size in bytes (1MB)
	DefaultSchemaMaxSizeBytes = 1 * 1024 * 1024
	// DefaultSchemaMaxFields is the maximum number of fields allowed in a schema
	DefaultSchemaMaxFields = 200
	// DefaultSchemaMaxDepth is the maximum nesting depth for properties/items
	DefaultSchemaMaxDepth = 10
	// DefaultUISchemaMaxSizeBytes is the maximum UI schema overlay size (512KB)
	DefaultUISchemaMaxSizeBytes = 512 * 1024
	// DefaultPreviewHTMLMaxSizeBytes is the maximum generated HTML preview size (2MB)
	DefaultPreviewHTMLMaxSizeBytes = 2 * 1024 * 1024
)

Schema validation limits

View Source
const (
	// SchemaFormatOpenAPI identifies OpenAPI documents for formgen.
	SchemaFormatOpenAPI = formgenopenapi.DefaultAdapterName
	// SchemaFormatJSONSchema identifies JSON Schema documents for formgen.
	SchemaFormatJSONSchema = formgenjsonschema.DefaultAdapterName
)
View Source
const (
	// ScopeTenantIDKey and ScopeOrgIDKey are the canonical tenant/org keys used
	// in scope metadata maps, request filters, and Bun column references.
	ScopeTenantIDKey = adminkeys.KeyTenantID
	ScopeOrgIDKey    = adminkeys.KeyOrgID

	ScopeTenantKey          = "tenant"
	ScopeOrgKey             = "org"
	ScopeOrganizationIDKey  = adminkeys.KeyOrganizationID
	ScopeDefaultTenantKey   = "default_tenant"
	ScopeDefaultTenantIDKey = "default_tenant_id"
	ScopeDefaultOrgIDKey    = "default_org_id"
)
View Source
const (
	SiteRouteContentList      = "site.content.type"
	SiteRouteContentDetail    = "site.content.item"
	SiteRouteNavigationLegacy = "site.navigation"
	SiteRouteMenuByLocation   = "site.menus.location"
	SiteRouteMenuByCode       = "site.menus.code"
)

SiteRouteKey constants map to URL manager route keys for normalized site endpoints.

View Source
const (
	AdminPartialShellSidebar    = "admin.shell.sidebar"
	AdminPartialPageBreadcrumbs = "admin.page.breadcrumbs"
	AdminPartialShellFooter     = "admin.shell.footer"

	AdminPartialInvalidIdentifier = "invalid_identifier"
	AdminPartialUnavailable       = "template_unavailable"
	AdminPartialUnsupportedKey    = "unsupported_admin_key"
)
View Source
const (
	PermAdminTranslationsView           = "admin.translations.view"
	PermAdminTranslationsEdit           = "admin.translations.edit"
	PermAdminTranslationsManage         = "admin.translations.manage"
	PermAdminTranslationsAssign         = "admin.translations.assign"
	PermAdminTranslationsApprove        = "admin.translations.approve"
	PermAdminTranslationsClaim          = "admin.translations.claim"
	PermAdminTranslationsSuggest        = "admin.translations.suggest"
	PermAdminTranslationsSync           = "admin.translations.sync"
	PermAdminTranslationsExport         = "admin.translations.export"
	PermAdminTranslationsImportView     = "admin.translations.import.view"
	PermAdminTranslationsImportValidate = "admin.translations.import.validate"
	PermAdminTranslationsImportApply    = "admin.translations.import.apply"
)
View Source
const (
	TranslationSSRSurfaceDashboard         = "dashboard"
	TranslationSSRSurfaceQueue             = "queue"
	TranslationSSRSurfaceFamilyList        = "family_list"
	TranslationSSRSurfaceFamilyDetail      = "family_detail"
	TranslationSSRSurfaceFamilyAssignments = "family_assignments"
	TranslationSSRSurfaceEditor            = "editor"
	TranslationSSRSurfaceMatrix            = "matrix"
	TranslationSSRSurfaceExchange          = "exchange"
)
View Source
const (
	TranslationSuggestionGenerateCommandName = "translations.suggestions.generate"

	TranslationSuggestionReasonServiceUnavailable  = "service_unavailable"
	TranslationSuggestionReasonPermissionDenied    = "permission_denied"
	TranslationSuggestionReasonReadOnlyAssignment  = "read_only_assignment"
	TranslationSuggestionReasonFieldUnsupported    = "field_unsupported"
	TranslationSuggestionReasonEmptySource         = "empty_source"
	TranslationSuggestionReasonProviderUnavailable = "provider_unavailable"
	TranslationSuggestionReasonPolicyDenied        = "provider_policy_denied"
	TranslationSuggestionReasonQuotaExceeded       = "quota_exceeded"
	TranslationSuggestionReasonRateLimited         = "rate_limited"
)
View Source
const (
	NotificationRouteDeliveries      = "notifications.deliveries"
	NotificationRouteDeliveryEvent   = "notifications.deliveries.event"
	NotificationRouteDeliveryMessage = "notifications.deliveries.message"
	NotificationRouteReceiptLookup   = "notifications.receipts.lookup"
	NotificationRouteRetentionPurge  = "notifications.retention.purge"
)
View Source
const (
	NotificationDeliveryEventParameter   = "event_id"
	NotificationDeliveryMessageParameter = "message_id"
)
View Source
const (
	WidgetUserStats           = widgetcodes.WidgetUserStats
	WidgetActivityFeed        = widgetcodes.WidgetActivityFeed
	WidgetUserActivityFeed    = widgetcodes.WidgetUserActivityFeed
	WidgetQuickActions        = widgetcodes.WidgetQuickActions
	WidgetNotifications       = widgetcodes.WidgetNotifications
	WidgetSettingsOverview    = widgetcodes.WidgetSettingsOverview
	WidgetUserProfileOverview = widgetcodes.WidgetUserProfileOverview
	WidgetTranslationProgress = widgetcodes.WidgetTranslationProgress
	WidgetContentStats        = widgetcodes.WidgetContentStats
	WidgetStorageStats        = widgetcodes.WidgetStorageStats
	WidgetSystemHealth        = widgetcodes.WidgetSystemHealth
	WidgetChartSample         = widgetcodes.WidgetChartSample
	WidgetBarChart            = widgetcodes.WidgetBarChart
	WidgetLineChart           = widgetcodes.WidgetLineChart
	WidgetPieChart            = widgetcodes.WidgetPieChart
	WidgetGaugeChart          = widgetcodes.WidgetGaugeChart
	WidgetScatterChart        = widgetcodes.WidgetScatterChart
)

Canonical dashboard widget definition codes.

View Source
const (
	WorkflowStatusDraft      = workflowcore.WorkflowStatusDraft
	WorkflowStatusActive     = workflowcore.WorkflowStatusActive
	WorkflowStatusDeprecated = workflowcore.WorkflowStatusDeprecated
)
View Source
const (
	WorkflowBindingScopeTrait       = workflowcore.WorkflowBindingScopeTrait
	WorkflowBindingScopeContentType = workflowcore.WorkflowBindingScopeContentType
	WorkflowBindingScopeGlobal      = workflowcore.WorkflowBindingScopeGlobal
)
View Source
const (
	WorkflowBindingStatusActive   = workflowcore.WorkflowBindingStatusActive
	WorkflowBindingStatusInactive = workflowcore.WorkflowBindingStatusInactive
)
View Source
const (
	ActivityActorTypeUser = "user"
)
View Source
const (
	// CommandRunSchemaVersion is the current cross-process JSON contract version.
	CommandRunSchemaVersion = 1
)
View Source
const ConsolePageTemplate = "resources/console/base"

ConsolePageTemplate is the packaged neutral console page shell. Hosts may pass a template that extends it to change wording or chrome.

View Source
const ContentChannelScopeQueryParam = adminkeys.KeyChannelScope

ContentChannelScopeQueryParam is the canonical query-string key used to carry content channel scope through list/read routes.

View Source
const (
	// CreateTranslationKey is the payload flag that explicitly allows creating a missing translation.
	CreateTranslationKey = "create_translation"
)
View Source
const DataOverviewRecordKey = "summary"

DataOverviewRecordKey identifies the overview's single summary record.

View Source
const DataPageTemplate = "resources/data/index"

DataPageTemplate is the packaged Data console page. It extends the neutral console shell, so the module renders it with ConsolePageRenderer.

View Source
const DataPanelExplore = "explore"

DataPanelExplore is the read-only dataset explorer panel.

View Source
const (
	DebugPanelActions = "actions"
)
View Source
const (
	DebugPanelCommandLauncher = "commands"
)
View Source
const (
	DebugPanelCommandRuns = "command_runs"
)
View Source
const (
	DebugPanelPermissions = "permissions"
)
View Source
const DefaultIconLibrary = "iconoir"

DefaultIconLibrary is the library used when no prefix is specified.

View Source
const EnhancedMutationResponseVersion = 1
View Source
const NotificationMarkCommandName = "notifications.mark"

NotificationMarkCommandName is the registered command for marking notifications read/unread.

View Source
const NotificationRetentionPurgeCommandName = "notifications.retention.purge"

NotificationRetentionPurgeCommandName is the stable public retention command identity.

View Source
const NotificationSystemAuthorityMetadataKey = "go_admin.notifications.system_authority"

NotificationSystemAuthorityMetadataKey is the trusted actor-metadata flag used to opt an authenticated operator into global notification operations. A dedicated permission is still required by the transport.

Variables

View Source
var (
	ErrCommandRunTransportClosed       = errors.New("command-run transport is closed")
	ErrCommandRunTransportBackpressure = errors.New("command-run transport backpressure")
	ErrCommandRunHandlerFailed         = errors.New("command-run handler failed")
)
View Source
var (
	ErrInvalidCommandRunRuntimeConfig = errors.New("invalid command-run runtime configuration")
	ErrCommandRunRuntimeClosed        = errors.New("command-run runtime is closed")
)
View Source
var (
	// ErrCommandRunPublishFailed is the provider-neutral remote publish category.
	ErrCommandRunPublishFailed = errors.New("command-run publish failed")
	// ErrCommandRunSubscriptionFailed is the provider-neutral subscription category.
	ErrCommandRunSubscriptionFailed = errors.New("command-run subscription failed")
	// ErrCommandRunEnvelopeRejected identifies an untrusted transport envelope.
	ErrCommandRunEnvelopeRejected = errors.New("command-run envelope rejected")
	// ErrCommandRunScopeRejected identifies an identity or selector rejection.
	ErrCommandRunScopeRejected = errors.New("command-run scope rejected")
	// ErrCommandRunDeliveryDropped identifies a bounded delivery loss.
	ErrCommandRunDeliveryDropped = errors.New("command-run delivery dropped")
)
View Source
var (
	// ErrInvalidCommandRunUpdate identifies updates that do not satisfy the
	// canonical command-run contract.
	ErrInvalidCommandRunUpdate = errors.New("invalid command-run update")
	// ErrInvalidCommandRunSelector identifies ambiguous or malformed selectors.
	ErrInvalidCommandRunSelector = errors.New("invalid command-run selector")
)
View Source
var (
	ErrDoctorCheckNotFound     = errors.New("doctor check not found")
	ErrDoctorActionUnavailable = errors.New("doctor action unavailable")
	ErrDoctorActionNotRunnable = errors.New("doctor action not runnable")
)
View Source
var (
	// ErrPreferencesStoreRequired indicates a missing preferences store.
	ErrPreferencesStoreRequired = optionsadapter.ErrPreferencesStoreRequired
	// ErrPreferencesScopeMetadataInvalid indicates malformed options scope metadata.
	ErrPreferencesScopeMetadataInvalid = optionsadapter.ErrPreferencesScopeMetadataInvalid
	// ErrPreferencesPathInvalid indicates an invalid flatten/unflatten path.
	ErrPreferencesPathInvalid = optionsadapter.ErrPreferencesPathInvalid
)
View Source
var (
	ErrForbidden = errors.New("forbidden")
	ErrNotFound  = errors.New("not found")
)

Standard errors to allow HTTP helpers to map to status codes.

View Source
var (
	// ErrTranslationAssignmentConflict indicates an active assignment uniqueness conflict.
	ErrTranslationAssignmentConflict = errors.New("translation assignment conflict")
	// ErrTranslationAssignmentVersionConflict indicates optimistic locking/version mismatch.
	ErrTranslationAssignmentVersionConflict = errors.New("translation assignment version conflict")
)
View Source
var (
	// ErrTranslationExchangeUnsupportedFormat indicates a format outside CSV/JSON v1 support.
	ErrTranslationExchangeUnsupportedFormat = errors.New("translation exchange unsupported format")
	// ErrTranslationExchangeInvalidPayload indicates malformed exchange payloads.
	ErrTranslationExchangeInvalidPayload = errors.New("translation exchange invalid payload")
	// ErrTranslationExchangeMissingLinkage indicates unresolved deterministic linkage.
	ErrTranslationExchangeMissingLinkage = errors.New("translation exchange missing linkage")
	// ErrTranslationExchangeStaleSourceHash indicates stale source hash conflicts.
	ErrTranslationExchangeStaleSourceHash = errors.New("translation exchange stale source hash")
)
View Source
var (
	ErrWorkflowNotFound          = errors.New("workflow not found for entity type")
	ErrWorkflowInvalidTransition = errors.New("invalid transition")
)
View Source
var (
	ErrWorkflowVersionConflict         = workflowcore.ErrWorkflowVersionConflict
	ErrWorkflowBindingConflict         = workflowcore.ErrWorkflowBindingConflict
	ErrWorkflowBindingVersionConflict  = workflowcore.ErrWorkflowBindingVersionConflict
	ErrWorkflowRollbackVersionNotFound = workflowcore.ErrWorkflowRollbackVersionNotFound
)
View Source
var ErrAutosaveConflict = errors.New("autosave conflict")

ErrAutosaveConflict marks optimistic concurrency conflicts reported by autosave-aware updates.

View Source
var ErrCommandAlreadyRegistered = errors.New("command already registered")

ErrCommandAlreadyRegistered identifies a duplicate legacy command handler or message factory. Ownership conflicts and invalid registrations do not match it.

View Source
var ErrFeatureDisabled = errors.New("feature disabled")

ErrFeatureDisabled signals a disabled feature gate.

View Source
var ErrInvalidCommandRunMemoryStoreConfig = errors.New("invalid command-run memory store configuration")
View Source
var ErrInvalidDependencies = errors.New("invalid dependencies")

InvalidDependenciesError aggregates one or more dependency validation failures.

View Source
var ErrInvalidFeatureConfig = errors.New("invalid feature configuration")

ErrInvalidFeatureConfig signals invalid or conflicting feature selections.

View Source
var ErrMenuSlugConflict = errors.New("menu slug already exists")

ErrMenuSlugConflict signals an attempt to create a menu with a duplicate slug.

View Source
var ErrMenuTargetNotFound = errors.New("menu target not found")

ErrMenuTargetNotFound signals that a menu mutation targeted a missing menu or menu item.

View Source
var ErrMissingTranslations = errors.New("missing required translations")

ErrMissingTranslations marks translation policy failures due to missing locales.

View Source
var ErrPathConflict = errors.New("path conflict")

ErrPathConflict signals a page path/slug collision.

View Source
var ErrREPLSessionLimit = errors.New("repl session limit reached")
View Source
var ErrTranslationAlreadyExists = errors.New("translation already exists")

ErrTranslationAlreadyExists marks duplicate translation creation attempts.

View Source
var ErrTranslationAssignmentFamilyBlockersUnavailable = errors.New("translation assignment family blocker aggregates unavailable")
View Source
var ErrTranslationAssignmentQueryUnsupported = errors.New("translation assignment query unsupported")
View Source
var ErrTranslationCreateUnsupported = errors.New("translation create unsupported")

ErrTranslationCreateUnsupported indicates the backing provider does not expose a first-class translation create command.

View Source
var (
	// ErrTranslationExchangeLinkageNotFound indicates missing deterministic row linkage.
	ErrTranslationExchangeLinkageNotFound = errors.New("translation exchange linkage not found")
)
View Source
var ErrTranslationSourceNotFound = errors.New("translation source not found")

ErrTranslationSourceNotFound marks translation policy failures caused by the source record disappearing before readiness checks can resolve it.

Functions

func ActionDisabledReasonCodes added in v0.25.0

func ActionDisabledReasonCodes() []string

ActionDisabledReasonCodes returns the canonical disabled reason-code vocabulary.

func AdminSemanticProfile added in v0.125.0

func AdminSemanticProfile() gotheme.TokenProfile

AdminSemanticProfile returns the portable semantic profile extended with the package tokens transported or consumed by go-admin.

func ApplyEntryNavigationReadContract added in v0.111.0

func ApplyEntryNavigationReadContract(record map[string]any, policy EntryNavigationPolicy) map[string]any

ApplyEntryNavigationReadContract returns a cloned record with normalized _navigation, effective_menu_locations, and effective_navigation_visibility.

func ApplyEntryNavigationWriteContract added in v0.111.0

func ApplyEntryNavigationWriteContract(record map[string]any, policy EntryNavigationPolicy, always bool) error

ApplyEntryNavigationWriteContract normalizes _navigation and writes the effective visibility fields onto a mutable record before persistence.

func AttachErrorContext added in v0.24.0

func AttachErrorContext(err error, mapped *goerrors.Error) *goerrors.Error

AttachErrorContext ensures stack trace + location are present for API responses.

func AuthenticatedRequestFromContext added in v0.66.0

func AuthenticatedRequestFromContext(ctx context.Context) bool

AuthenticatedRequestFromContext reports whether the request has passed admin authentication middleware.

func BackfillContentTypeNavigationDefaults added in v0.26.0

func BackfillContentTypeNavigationDefaults(ctx context.Context, service CMSContentTypeService) (int, error)

BackfillContentTypeNavigationDefaults updates existing content types so canonical navigation defaults are persisted for legacy capability payloads.

func BlockEditorDescriptor added in v0.23.0

func BlockEditorDescriptor(basePath string) components.Descriptor

BlockEditorDescriptor returns the component descriptor for registration.

func BlockLibraryPickerDescriptor added in v0.24.0

func BlockLibraryPickerDescriptor(basePath string) components.Descriptor

BlockLibraryPickerDescriptor returns the component descriptor for registration.

func BlockLibraryPickerDescriptorWithAPIBase added in v0.24.0

func BlockLibraryPickerDescriptorWithAPIBase(basePath, apiBase string) components.Descriptor

BlockLibraryPickerDescriptorWithAPIBase returns the component descriptor with an explicit API base. apiBase should point to the admin API root (e.g. /admin/api or /admin/api/v0).

func BoolPtr added in v0.16.0

func BoolPtr(value bool) *bool

BoolPtr returns a pointer to the provided boolean.

func BuildSitePreviewURL added in v0.86.0

func BuildSitePreviewURL(targetPath, token string) string

BuildSitePreviewURL adds or replaces preview_token on a public preview path. Absolute HTTP(S) preview URLs require BuildSitePreviewURLWithAllowedHosts.

func BuildSitePreviewURLWithAllowedHosts added in v0.86.0

func BuildSitePreviewURLWithAllowedHosts(targetPath, token string, allowedHosts []string) string

BuildSitePreviewURLWithAllowedHosts adds or replaces preview_token on a preview path. Relative paths are always allowed; absolute HTTP(S) URLs are allowed only when their host is present in allowedHosts.

func CMSBlockDefinitionChannel added in v0.54.0

func CMSBlockDefinitionChannel(def CMSBlockDefinition) string

func CMSContentTypeChannel added in v0.27.0

func CMSContentTypeChannel(ct CMSContentType) string

func CanAll added in v0.25.0

func CanAll(authorizer Authorizer, ctx context.Context, resource string, permissions ...string) bool

CanAll returns true when all provided permissions are allowed.

func CanAny added in v0.25.0

func CanAny(authorizer Authorizer, ctx context.Context, resource string, permissions ...string) bool

CanAny returns true when any provided permission is allowed.

func CanonicalContentPath added in v0.26.0

func CanonicalContentPath(contentType, slug string) string

CanonicalContentPath builds a canonical content path from content type and slug.

func CanonicalContentURL added in v0.26.0

func CanonicalContentURL(baseURL, contentType, slug string) string

CanonicalContentURL builds a canonical URL from base URL and content path.

func CanonicalPath added in v0.26.0

func CanonicalPath(path, fallback string) string

CanonicalPath normalizes path with leading slash and fallback slug support.

func CanonicalPolicyEntityKey added in v0.25.0

func CanonicalPolicyEntityKey(value string) string

CanonicalPolicyEntityKey performs structural normalization for policy entities. Semantic aliasing (for example singular/plural preferences) is resolved by policy-level lookup code where configured entity keys are available.

func CaptureJSErrorContext added in v0.24.0

func CaptureJSErrorContext(collector *DebugCollector, c router.Context, viewCtx router.ViewContext) router.ViewContext

CaptureJSErrorContext injects JS error collector variables into the view context without capturing template data or injecting toolbar variables. Use this on non-admin pages (public site, login) that need the global error collector but not the full debug integration.

func CaptureViewContext added in v0.14.0

func CaptureViewContext(collector *DebugCollector, viewCtx router.ViewContext) router.ViewContext

CaptureViewContext stores template data in the debug collector and returns the view context. When the debug collector has ToolbarMode enabled, it also injects toolbar template variables: - debug_toolbar_enabled: true when toolbar should be shown - debug_path: the canonical debug module base path - debug_toolbar_panels: comma-separated list of panels for the toolbar - debug_slow_threshold_ms: slow query threshold in milliseconds - debug_toolbar_ws_path: canonical debug toolbar websocket path - debug_toolbar_transport_base_path: canonical transport base path used by live toolbars - debug_toolbar_errors_path: JS error ingestion path when enabled - debug_toolbar_live_enabled: true when live toolbar transport is available - debug_preferences_namespace: identity namespace for toolbar browser state ("" keeps legacy keys)

Note: this variant cannot inject JS error nonce cookies because it does not have access to the router.Context. Use CaptureViewContextForRequest when possible to get full JS error collector support.

func CaptureViewContextForRequest added in v0.16.0

func CaptureViewContextForRequest(collector *DebugCollector, c router.Context, viewCtx router.ViewContext) router.ViewContext

CaptureViewContextForRequest is like CaptureViewContext but honors ToolbarExcludePaths and injects JS error collector variables (with nonce) when CaptureJSErrors is enabled.

func CollectIconContributions added in v0.25.0

func CollectIconContributions(contributor IconContributor, callbacks IconContributorCallbacks) error

CollectIconContributions processes icon contributions from a module.

func CommandLauncherActionID added in v0.120.0

func CommandLauncherActionID(commandID string) string

CommandLauncherActionID returns the stable panel action identifier for a command descriptor. Integrations can use it to navigate to and preselect a command without duplicating the launcher's collision-safe encoding.

func CommandResultFailure added in v0.113.13

func CommandResultFailure(result any) error

CommandResultFailure returns an operational failure reported by an inline command result. Results that do not implement CommandResultFailureReporter are treated as successful transport outcomes.

func ConfigureTranslationSuggestionServiceDependencies added in v0.110.0

func ConfigureTranslationSuggestionServiceDependencies(service TranslationSuggestionService, deps TranslationSuggestionServiceDependencies)

ConfigureTranslationSuggestionServiceDependencies fills missing host-provided dependencies on services that opt into late configuration.

func ConsolePageRenderer added in v0.139.0

func ConsolePageRenderer(adm *Admin, template string, chrome AdminPageChrome) func(router.Context, console.Bootstrap) error

ConsolePageRenderer returns a ConsoleHostConfig.RenderPage adapter that renders the console shell inside the admin layout. The bootstrap is serialized once with encoding/json, whose default HTML escaping keeps it safe inside the page's JSON script element.

func ContentChannelFromContext added in v0.26.0

func ContentChannelFromContext(ctx context.Context) string

ContentChannelFromContext returns the active content channel stored on the context.

func ContentTypeCapabilityString added in v0.75.0

func ContentTypeCapabilityString(capabilities map[string]any, keys ...string) string

ContentTypeCapabilityString returns the first non-empty string value for the canonical capability keys, accepting snake_case, camelCase, and kebab-case spellings for compatibility with legacy payloads. Identifier-like capabilities are normalized to lowercase; display strings preserve case.

func ContentTypeCapabilityValue added in v0.75.0

func ContentTypeCapabilityValue(capabilities map[string]any, keys ...string) (any, bool)

ContentTypeCapabilityValue returns the first capability value for the canonical capability keys, accepting snake_case, camelCase, and kebab-case spellings for compatibility with legacy payloads.

func ContentTypeCapabilityValues added in v0.75.0

func ContentTypeCapabilityValues(capabilities map[string]any, keys ...string) []any

ContentTypeCapabilityValues returns all values found for the canonical capability keys and their supported legacy spellings.

func ContextWithActionDiagnostics added in v0.27.0

func ContextWithActionDiagnostics(ctx context.Context, sink ActionDiagnosticSink) context.Context

func ContextWithActionResponseCollector added in v0.27.0

func ContextWithActionResponseCollector(ctx context.Context, collector *ActionResponseCollector) context.Context

ContextWithActionResponseCollector injects a collector into context for command handlers.

func DashboardPageAreaByCode added in v0.34.0

func DashboardPageAreaByCode(page dashcmp.Page, areaCode string) (dashcmp.PageArea, bool)

DashboardPageAreaByCode resolves an area by canonical area code first and falls back to slot matching when callers only know the page slot.

func DashboardPageWidgetsForAreaCode added in v0.34.0

func DashboardPageWidgetsForAreaCode(page dashcmp.Page, areaCode string) []dashcmp.WidgetFrame

DashboardPageWidgetsForAreaCode returns a copy of the widget frames rendered for a canonical area code.

func DataActionID added in v0.139.4

func DataActionID(choice DataActionChoice) string

DataActionID is the stable action ID the Data panels declare for a choice, so projections and hosts can reference declared actions from rows.

func DataActionKind added in v0.139.0

func DataActionKind(actionID string) (admindata.Kind, bool)

DataActionKind returns the lifecycle kind of a Data action ID so module policy can authorize declared actions by kind.

func DataActionResult added in v0.139.0

func DataActionResult(kind admindata.Kind, result admindata.Result, err error) (console.PanelActionResult, error)

DataActionResult presents the outcome of dispatching kind on the console action route. See DataActionResultFor.

func DataActionResultFor added in v0.139.4

func DataActionResultFor(kind admindata.Kind, result admindata.Result, err error, labels DataActionLabels) (console.PanelActionResult, error)

DataActionResultFor presents the outcome of dispatching kind on the console action route. Denials and errors outside the Data contract stay errors, so the host answers with their status and the client revalidates access; every other typed failure becomes a safe, field-addressable result. Success wording never calls accepted, prepared or verified work active, and every outcome refreshes the panels so the operation row and active state come from the read model. Outcomes link to their operation row and carry a tone; planned outcomes are marked so they never read as executed.

func DataCheckRecord added in v0.139.0

func DataCheckRecord(view DataCheckView, revision uint64) console.Record

DataCheckRecord projects one check row.

func DataCoverageRecord added in v0.139.0

func DataCoverageRecord(view DataCoverageView, revision uint64) console.Record

DataCoverageRecord projects one coverage period row.

func DataDatasetRecord added in v0.139.0

func DataDatasetRecord(descriptor admindata.Descriptor, revision uint64) console.Record

DataDatasetRecord projects one catalog dataset version for the Explore panel.

func DataOperationRecord added in v0.139.0

func DataOperationRecord(operation admindata.Operation) console.Record

DataOperationRecord projects one operation; its revision is the operation's.

func DataOperationViewRecord added in v0.139.4

func DataOperationViewRecord(view DataOperationView) console.Record

DataOperationViewRecord projects one operation with its presentation.

func DataOverviewRecord added in v0.139.0

func DataOverviewRecord(view DataOverviewView, revision uint64) console.Record

DataOverviewRecord projects the overview summary record.

func DataPanelIDs added in v0.139.0

func DataPanelIDs() []string

DataPanelIDs returns the Data panels in display order.

func DataScenarioRecord added in v0.139.0

func DataScenarioRecord(view DataScenarioView, revision uint64) console.Record

DataScenarioRecord projects one scenario row.

func DebugRequestMiddleware added in v0.14.0

func DebugRequestMiddleware(collector *DebugCollector) router.MiddlewareFunc

DebugRequestMiddleware captures request metadata for the debug collector.

func DecodeWidgetConfig added in v0.25.0

func DecodeWidgetConfig[T any](cfg map[string]any) (T, error)

DecodeWidgetConfig strictly decodes provider config into a typed struct. Unknown fields are rejected.

func DefaultDebugPanels added in v0.24.0

func DefaultDebugPanels() []string

DefaultDebugPanels returns the default debug panel IDs.

func DefaultDebugToolbarPanels added in v0.24.0

func DefaultDebugToolbarPanels() []string

DefaultDebugToolbarPanels returns the default toolbar panel IDs.

func DeliveryGraphQLControllers added in v0.23.0

func DeliveryGraphQLControllers() []registrar.Controller

DeliveryGraphQLControllers exposes delivery schema controllers for go-crud/gql registration.

func EffectivePreferencesPermission added in v0.122.0

func EffectivePreferencesPermission(cfg Config) string

EffectivePreferencesPermission returns the permission enforced by preferences routes and navigation when the caller leaves it unset.

func EffectiveProfilePermission added in v0.122.0

func EffectiveProfilePermission(cfg Config) string

EffectiveProfilePermission returns the permission enforced by profile routes and navigation when the caller leaves it unset.

func EffectiveSettingsPermission added in v0.122.0

func EffectiveSettingsPermission(cfg Config) string

EffectiveSettingsPermission returns the permission enforced by settings routes and navigation when the caller leaves SettingsPermission unset.

func EnrichLayoutViewContext added in v0.25.0

func EnrichLayoutViewContext(adm *Admin, c router.Context, view router.ViewContext, active string) router.ViewContext

EnrichLayoutViewContext injects standard layout keys (paths, nav, session, theme, capabilities). It is intended for module/host handlers rendering templates that extend layout.html.

func EnrichLayoutViewContextWithChrome added in v0.132.0

func EnrichLayoutViewContextWithChrome(adm *Admin, c router.Context, view router.ViewContext, chrome AdminPageChrome) router.ViewContext

EnrichLayoutViewContextWithChrome projects typed page presentation into a cloned view context, then adds request-scoped shell dependencies. Non-zero typed page values win over legacy page keys; arbitrary action markup remains owned by the page_header_actions template block.

func EnsureMenuParents

func EnsureMenuParents(ctx context.Context, opts EnsureMenuParentsOptions) error

EnsureMenuParents upserts parent/group/collapsible nodes with deterministic IDs before children are added. It tolerates existing menus/items (idempotent) and maps IDs/parents to UUIDs for adapter compatibility.

func EnsureSettingsDocumentSchema added in v0.140.0

func EnsureSettingsDocumentSchema(ctx context.Context, db bun.IDB) error

EnsureSettingsDocumentSchema is an explicit host migration/bootstrap seam. Constructors never create this table: durable applications own its lifecycle.

func EnsureWorkflowAuthoringCutover added in v0.27.0

func EnsureWorkflowAuthoringCutover(ctx context.Context, db *bun.DB) error

EnsureWorkflowAuthoringCutover migrates legacy workflow rows into canonical authoring stores and hard-fails when required schema objects are missing.

func EnvironmentFromContext added in v0.24.0

func EnvironmentFromContext(ctx context.Context) string

EnvironmentFromContext returns the active environment stored on the context.

func EvaluateEntryNavigationVisibility added in v0.111.0

func EvaluateEntryNavigationVisibility(eligible []string, overrides map[string]string, defaultSet map[string]struct{}, policy EntryNavigationPolicy) (map[string]bool, []string)

EvaluateEntryNavigationVisibility computes effective visibility for all eligible locations using normalized overrides and defaults.

func ExtractContentPath added in v0.26.0

func ExtractContentPath(data, metadata map[string]any, fallback string) string

ExtractContentPath resolves canonical content path from data/metadata maps with fallback support.

func FamilyDetailFragmentSelector added in v0.86.0

func FamilyDetailFragmentSelector(target FamilyDetailFragmentTarget) (string, bool)

func GetSVGFieldTypeMapping added in v0.25.0

func GetSVGFieldTypeMapping() map[string]string

GetSVGFieldTypeMapping returns the svgFieldTypeKeys map for backward compatibility.

func GetSettingsDocumentMigrationsFS added in v0.140.0

func GetSettingsDocumentMigrationsFS() fs.FS

GetSettingsDocumentMigrationsFS exposes portable up/down migrations. Hosts using SkipSchemaEnsure install them through their own migration runner.

func GetTranslationAssignmentMigrationsFS added in v0.25.0

func GetTranslationAssignmentMigrationsFS() fs.FS

GetTranslationAssignmentMigrationsFS returns the legacy queue assignment migration set.

func GetTranslationFlowMigrationsFS added in v0.27.0

func GetTranslationFlowMigrationsFS() fs.FS

GetTranslationFlowMigrationsFS returns the full translation-flow migration set.

func GetTranslationFlowSQLiteMigrationsFS added in v0.27.0

func GetTranslationFlowSQLiteMigrationsFS() fs.FS

GetTranslationFlowSQLiteMigrationsFS returns the sqlite-compatible translation-flow migrations.

func GetWorkflowRuntimeMigrationsFS added in v0.25.0

func GetWorkflowRuntimeMigrationsFS() fs.FS

GetWorkflowRuntimeMigrationsFS returns runtime workflow migrations rooted for sqlite usage.

func IsCMSPageContentRecord added in v0.84.0

func IsCMSPageContentRecord(contentType, contentTypeSlug string) bool

IsCMSPageContentRecord reports whether either content type field identifies a generic content record that should be treated as a CMS page bridge record.

func IsCMSPageContentTypeSlug added in v0.84.0

func IsCMSPageContentTypeSlug(value string) bool

IsCMSPageContentTypeSlug reports whether value identifies the backing content type slug used by go-cms page records.

func IsCMSPagePolicyEntity added in v0.84.0

func IsCMSPagePolicyEntity(value string) bool

IsCMSPagePolicyEntity reports whether value identifies the go-cms Pages service entity used by policy and translation-family code.

func IsTranslationMissing added in v0.24.0

func IsTranslationMissing(err error) bool

IsTranslationMissing reports whether an error indicates a missing translation.

func LocaleFallbackAllowed added in v0.26.0

func LocaleFallbackAllowed(ctx context.Context) bool

LocaleFallbackAllowed reports locale fallback policy from context. When no explicit value exists, fallback remains enabled.

func LocaleFromContext added in v0.23.0

func LocaleFromContext(ctx context.Context) string

LocaleFromContext exposes locale lookup for external adapters.

func ManagementGraphQLControllers added in v0.23.0

func ManagementGraphQLControllers() []registrar.Controller

ManagementGraphQLControllers exposes management schema controllers for go-crud/gql registration.

func MenuUUIDFromSlug(slug string) string

MenuUUIDFromSlug derives a deterministic UUID string from a menu slug/name.

func NavigationOverrideModes() []string

NavigationOverrideModes returns the supported tri-state override values.

func NewAdminActivityEnricher added in v0.22.0

func NewAdminActivityEnricher(cfg AdminActivityEnricherConfig) usersactivity.ActivityEnricher

NewAdminActivityEnricher builds an activity enricher that adds missing metadata keys.

func NewAdminObjectResolver added in v0.22.0

func NewAdminObjectResolver(cfg AdminObjectResolverConfig) usersactivity.ObjectResolver

NewAdminObjectResolver returns an object resolver map for admin object types.

func NewCRUDContext added in v0.24.0

func NewCRUDContext(ctx context.Context) crud.Context

NewCRUDContext builds a minimal crud.Context backed by the provided context.

func NewDomainError added in v0.24.0

func NewDomainError(code, message string, meta map[string]any) *goerrors.Error

NewDomainError builds a go-errors Error from a registered domain error code.

func NewRoleFormGenerator added in v0.22.0

func NewRoleFormGenerator(cfg Config) (*formgenorchestrator.Orchestrator, error)

NewRoleFormGenerator builds a roles form generator using embedded OpenAPI + UI schema.

func NormalizeBasePath added in v0.24.0

func NormalizeBasePath(basePath string) string

NormalizeBasePath exposes admin base-path normalization.

func NormalizeContentTypeCapabilities added in v0.26.0

func NormalizeContentTypeCapabilities(capabilities map[string]any) (map[string]any, map[string]string)

NormalizeContentTypeCapabilities returns canonical capability objects and validation metadata without mutating the input payload.

func NormalizeFilterType added in v0.24.0

func NormalizeFilterType(raw string) string

NormalizeFilterType normalizes field/filter input types into UI filter types.

func NormalizeMenuItemTranslationFields added in v0.24.0

func NormalizeMenuItemTranslationFields(item MenuItem) (label, labelKey, groupTitle, groupTitleKey string)

NormalizeMenuItemTranslationFields trims menu translation fields without synthesizing display values from translation keys.

func NormalizeMenuItemType added in v0.24.0

func NormalizeMenuItemType(raw string) string

NormalizeMenuItemType normalizes menu item type values.

func NormalizeMenuSlug

func NormalizeMenuSlug(raw string) string

NormalizeMenuSlug converts an arbitrary name/code into a normalized slug. It lowercases, trims whitespace, and replaces non slug characters with '-'.

func NormalizeNavigationOverrideMap added in v0.111.0

func NormalizeNavigationOverrideMap(raw any) (map[string]string, error)

NormalizeNavigationOverrideMap validates and normalizes an entry _navigation payload. Nil or empty maps return nil.

func NormalizeNavigationOverrideMode added in v0.111.0

func NormalizeNavigationOverrideMode(raw string) string

NormalizeNavigationOverrideMode normalizes a raw override value to inherit, show, or hide. Invalid values return an empty string.

func NotificationSystemAuthorityFromContext added in v0.130.0

func NotificationSystemAuthorityFromContext(ctx context.Context) bool

NotificationSystemAuthorityFromContext reports whether trusted middleware or authenticated actor metadata explicitly granted system authority.

func ParseListPredicateKey added in v0.24.0

func ParseListPredicateKey(key string) (string, string)

ParseListPredicateKey splits field operator keys like "status__in".

func PermissionGrantMatches added in v0.110.0

func PermissionGrantMatches(grant, permission string) bool

PermissionGrantMatches reports whether a granted permission covers a required permission using go-admin grant semantics. Exact grants match literally, and admin namespace wildcards such as "admin.*" or "admin.translations.*" cover concrete descendant admin permissions.

func PermissionMatrixDescriptor added in v0.22.0

func PermissionMatrixDescriptor(basePath string) components.Descriptor

PermissionMatrixDescriptor returns the component descriptor for registration.

func PrefixBasePath added in v0.24.0

func PrefixBasePath(basePath, routePath string) string

PrefixBasePath exposes admin path prefix behavior.

func RateLimitError added in v0.23.0

func RateLimitError() error

RateLimitError creates an error for rate limit violations

func RegisterActionDiagnosticsDebugPanel added in v0.27.0

func RegisterActionDiagnosticsDebugPanel(admin *Admin)

func RegisterBuiltinIconLibraries added in v0.25.0

func RegisterBuiltinIconLibraries(svc *IconService) error

RegisterBuiltinIconLibraries registers all built-in icon libraries.

func RegisterCommand added in v0.12.0

func RegisterCommand[T any](bus *CommandBus, cmd command.Commander[T], runnerOpts ...runner.Option) (dispatcher.Subscription, error)

RegisterCommand wires a command handler into the go-command registry and dispatcher.

func RegisterCommandLauncherDebugPanel added in v0.97.0

func RegisterCommandLauncherDebugPanel(adm *Admin)

RegisterCommandLauncherDebugPanel registers the generic command catalog launcher. It is inert when no command catalog provider is configured.

func RegisterCommandLauncherDoctorCheck added in v0.97.0

func RegisterCommandLauncherDoctorCheck(adm *Admin)

RegisterCommandLauncherDoctorCheck exposes launcher readiness through the Doctor panel so an empty command launcher is not reported as healthy.

func RegisterCommandRunsDebugPanel added in v0.121.3

func RegisterCommandRunsDebugPanel(adm *Admin)

RegisterCommandRunsDebugPanel registers the stable panel only for a running gateway with snapshot storage. Publisher-only and disabled runtimes stay inert.

func RegisterContextMessageFactory added in v0.126.8

func RegisterContextMessageFactory[T any](bus *CommandBus, name string, build contextMessageBuilder[T]) error

RegisterContextMessageFactory registers a context-aware factory and typed dispatcher for name-based routing.

func RegisterContextMessageResultFactory added in v0.126.8

func RegisterContextMessageResultFactory[T any, R any](bus *CommandBus, name string, build contextMessageBuilder[T]) error

RegisterContextMessageResultFactory registers a context-aware name-based command dispatcher that can return inline result data.

func RegisterCoreCommandFactories added in v0.12.0

func RegisterCoreCommandFactories(bus *CommandBus) error

RegisterCoreCommandFactories installs factories for built-in commands.

func RegisterDashboardProviderFactory added in v0.12.0

func RegisterDashboardProviderFactory(bus *CommandBus, commandName, code string, defaultConfig map[string]any) error

RegisterDashboardProviderFactory registers a factory for a dashboard provider command name.

func RegisterDataPanels added in v0.139.0

func RegisterDataPanels(registry *console.PanelRegistry, actions ...DataPanelActions) error

RegisterDataPanels declares the Data views on a registry owned by the Data module. The module's snapshot source supplies records built with the Data*Record projections after its read and record policy selected them. Without DataPanelActions every panel is read-only.

func RegisterDefaultCMSWorkflows added in v0.24.0

func RegisterDefaultCMSWorkflows(registrar WorkflowRegistrar)

RegisterDefaultCMSWorkflows registers the default CMS workflow definitions. If the registrar supports WorkflowDefinitionChecker, existing definitions are preserved.

func RegisterDeliveryGraphQLSchemas added in v0.23.0

func RegisterDeliveryGraphQLSchemas()

RegisterDeliveryGraphQLSchemas registers delivery schemas into the go-crud registry.

func RegisterDeploymentDebugPanel added in v0.122.0

func RegisterDeploymentDebugPanel(adm *Admin)

RegisterDeploymentDebugPanel registers an admin-scoped snapshot provider. The global registry receives metadata only so multiple Admin instances never capture each other's identity through a process-global closure.

func RegisterDoctorDebugPanel added in v0.25.0

func RegisterDoctorDebugPanel(admin *Admin)

RegisterDoctorDebugPanel registers the doctor panel with the debug collector.

func RegisterDomainErrorCodes added in v0.24.0

func RegisterDomainErrorCodes(codes ...DomainErrorCode)

RegisterDomainErrorCodes adds or replaces domain error code metadata.

func RegisterManagementGraphQLSchemas added in v0.23.0

func RegisterManagementGraphQLSchemas()

RegisterManagementGraphQLSchemas registers management schemas into the go-crud registry.

func RegisterMessageFactory added in v0.12.0

func RegisterMessageFactory[T any](bus *CommandBus, name string, build messageBuilder[T]) error

RegisterMessageFactory registers both a factory and a typed dispatcher for name-based routing.

func RegisterMessageResultFactory added in v0.88.0

func RegisterMessageResultFactory[T any, R any](bus *CommandBus, name string, build messageBuilder[T]) error

RegisterMessageResultFactory registers a name-based command dispatcher that can return inline result data.

func RegisterPermissionsDebugPanel added in v0.25.0

func RegisterPermissionsDebugPanel(admin *Admin)

RegisterPermissionsDebugPanel registers the permissions panel with the debug collector.

func RegisterQuery added in v0.12.0

func RegisterQuery[T any, R any](bus *CommandBus, qry command.Querier[T, R], runnerOpts ...runner.Option) (dispatcher.Subscription, error)

RegisterQuery wires a query handler into the go-command registry and dispatcher.

func RegisterSetCommand added in v0.126.8

func RegisterSetCommand[T any](set *CommandRegistrationSet, handler command.Commander[T], opts ...runner.Option) error

RegisterSetCommand stages a typed command handler and its runner options.

func RegisterSetContextMessageFactory added in v0.126.8

func RegisterSetContextMessageFactory[T any](set *CommandRegistrationSet, name string, build contextMessageBuilder[T]) error

RegisterSetContextMessageFactory stages a context-aware named factory.

func RegisterSetContextMessageResultFactory added in v0.126.8

func RegisterSetContextMessageResultFactory[T any, R any](set *CommandRegistrationSet, name string, build contextMessageBuilder[T]) error

RegisterSetContextMessageResultFactory stages a context-aware named factory that can retrieve an inline typed result.

func RegisterSetMessageFactory added in v0.126.8

func RegisterSetMessageFactory[T any](set *CommandRegistrationSet, name string, build messageBuilder[T]) error

RegisterSetMessageFactory stages a context-free named factory.

func RegisterSetMessageResultFactory added in v0.126.8

func RegisterSetMessageResultFactory[T any, R any](set *CommandRegistrationSet, name string, build messageBuilder[T]) error

RegisterSetMessageResultFactory stages a context-free named result factory.

func RegisterTranslationExchangeCommandFactories added in v0.25.0

func RegisterTranslationExchangeCommandFactories(bus *CommandBus) error

RegisterTranslationExchangeCommandFactories installs name-based factory dispatch for exchange commands.

func RegisterTranslationProgressWidget added in v0.25.0

func RegisterTranslationProgressWidget(dash *Dashboard, stats TranslationQueueStatsService, urls urlkit.Resolver)

RegisterTranslationProgressWidget registers queue progress dashboard provider.

func RegisterTranslationQueueCommandFactories added in v0.25.0

func RegisterTranslationQueueCommandFactories(bus *CommandBus) error

RegisterTranslationQueueCommandFactories installs name-based message factories for queue commands.

func RegisterTranslationQueueCommands added in v0.25.0

func RegisterTranslationQueueCommands(bus *CommandBus, service TranslationQueueService) error

RegisterTranslationQueueCommands registers typed queue handlers and name-based factories.

func RegisterTranslationQueueTabs added in v0.25.0

func RegisterTranslationQueueTabs(admin *Admin) error

RegisterTranslationQueueTabs attaches translation queue tabs to translation-enabled detail views.

func RegisterTranslationSuggestionCommandFactories added in v0.110.0

func RegisterTranslationSuggestionCommandFactories(bus *CommandBus) error

RegisterTranslationSuggestionCommandFactories installs name-based factories for translation suggestion commands.

func RegisterTranslationSuggestionCommands added in v0.110.0

func RegisterTranslationSuggestionCommands(bus *CommandBus, service TranslationSuggestionService) error

RegisterTranslationSuggestionCommands registers typed suggestion handlers and name-based factories.

func RenderDataPreviewPage added in v0.139.3

func RenderDataPreviewPage(in DataPreviewPage) ([]byte, error)

RenderDataPreviewPage wraps a host's view fragment in the preview chrome: preview and read-only flags, the exact pinned identity, expiry, Close and Return controls and navigation on the session's preview routes. Every link must resolve to a same-origin path.

func RequestIPFromContext added in v0.27.0

func RequestIPFromContext(ctx context.Context) string

RequestIPFromContext returns the request IP address captured for the active admin context.

func ResolveContentPath added in v0.26.0

func ResolveContentPath(content CMSContent, fallback string) string

ResolveContentPath resolves canonical content path from CMSContent fields.

func ResolveContentPreviewPath added in v0.86.0

func ResolveContentPreviewPath(record map[string]any) string

ResolveContentPreviewPath resolves the public preview path for a content record. It only uses explicit path/preview_url values. Use ResolveContentPreviewPathWithOptions with AllowSlugFallback for routed content types that intentionally derive public paths from slug.

func ResolveContentPreviewPathWithOptions added in v0.96.0

func ResolveContentPreviewPathWithOptions(record map[string]any, opts ContentPreviewPathOptions) string

ResolveContentPreviewPathWithOptions resolves the public preview path for a content record with caller-controlled fallback behavior.

func ResolveEntryNavigationVisibility added in v0.111.0

func ResolveEntryNavigationVisibility(location string, overrides map[string]string, defaultSet map[string]struct{}, policy EntryNavigationPolicy) bool

ResolveEntryNavigationVisibility resolves a single location to its effective visible state.

func ResolvedPermissionsFromAuthorizer added in v0.25.0

func ResolvedPermissionsFromAuthorizer(ctx context.Context, authorizer Authorizer) []string

ResolvedPermissionsFromAuthorizer extracts resolved permissions when supported by the authorizer implementation.

func SchemaEditorDescriptor added in v0.23.0

func SchemaEditorDescriptor(basePath string) components.Descriptor

SchemaEditorDescriptor returns the component descriptor for registration.

func SetDefaultErrorPresenter added in v0.24.0

func SetDefaultErrorPresenter(presenter ErrorPresenter)

SetDefaultErrorPresenter overrides the package-level presenter used by helpers.

func SyncTranslationFamilyStore added in v0.27.0

func SyncTranslationFamilyStore(ctx context.Context, adm *Admin, environment string) error

SyncTranslationFamilyStore rebuilds the canonical family/variant tables from the CMS content service.

func SyncTranslationFamilyStoreForFamily added in v0.80.0

func SyncTranslationFamilyStoreForFamily(ctx context.Context, adm *Admin, environment string, familyID string) error

SyncTranslationFamilyStoreForFamily rebuilds the canonical family/variant tables from the CMS content service. When familyID is non-empty, only that family is saved and recomputed.

func TranslationCapabilities added in v0.25.0

func TranslationCapabilities(adm *Admin) map[string]any

TranslationCapabilities returns a translation capability snapshot for the admin instance. The payload shape is stable for template/frontend gating: - profile - schema_version - modules - features - routes - panels - resolver_keys - warnings - contracts

func TranslationCapabilitiesForContext added in v0.25.0

func TranslationCapabilitiesForContext(adm *Admin, reqCtx context.Context) map[string]any

TranslationCapabilitiesForContext returns a translation capability snapshot with request-scoped permission states when context is available.

func TranslationDashboardContractPayload added in v0.27.0

func TranslationDashboardContractPayload() map[string]any

func TranslationDashboardQueryModels added in v0.27.0

func TranslationDashboardQueryModels() map[string]any

func TranslationEditorContractPayload added in v0.27.0

func TranslationEditorContractPayload() map[string]any

TranslationEditorContractPayload documents the editor-side field and assist envelopes shared by backend payloads and frontend parsers.

func TranslationExchangeContractPayload added in v0.27.0

func TranslationExchangeContractPayload() map[string]any

func TranslationMatrixContractPayload added in v0.27.0

func TranslationMatrixContractPayload() map[string]any

func TranslationMatrixQueryModel added in v0.27.0

func TranslationMatrixQueryModel() map[string]any

func TranslationQueueContractPayload added in v0.27.0

func TranslationQueueContractPayload() map[string]any

func TranslationQueuePresetQuery added in v0.86.0

func TranslationQueuePresetQuery(presetID string) map[string]string

func TranslationQueueReviewAggregateCountKeys added in v0.27.0

func TranslationQueueReviewAggregateCountKeys() []string

func TranslationQueueSavedFilterPresets added in v0.27.0

func TranslationQueueSavedFilterPresets() []map[string]any

func TranslationQueueSavedReviewFilterPresets added in v0.27.0

func TranslationQueueSavedReviewFilterPresets() []map[string]any

func TranslationQueueSupportedFilterKeys added in v0.27.0

func TranslationQueueSupportedFilterKeys() []string

func TranslationQueueSupportedReviewStates added in v0.27.0

func TranslationQueueSupportedReviewStates() []string

func TranslationQueueSupportedSortKeys added in v0.27.0

func TranslationQueueSupportedSortKeys() []string

func TranslationSharedContractsPayload added in v0.25.0

func TranslationSharedContractsPayload() map[string]any

TranslationSharedContractsPayload returns the canonical shared translation contracts consumed by frontend status/reason renderers.

func TranslationSourceTargetDriftContract added in v0.25.0

func TranslationSourceTargetDriftContract() map[string]any

TranslationSourceTargetDriftContract documents the source-target drift metadata contract expected by side-by-side editor surfaces.

func TranslationStatusEnumContract added in v0.25.0

func TranslationStatusEnumContract() map[string]any

TranslationStatusEnumContract returns stable status enums shared across core translation readiness, queue, and exchange payloads.

func ValidateAndNormalizeContentTypeCapabilities added in v0.26.0

func ValidateAndNormalizeContentTypeCapabilities(capabilities map[string]any) (map[string]any, error)

ValidateAndNormalizeContentTypeCapabilities validates and normalizes capabilities via the canonical go-cms implementation.

func ValidateCommandRunRuntimeConfig added in v0.121.3

func ValidateCommandRunRuntimeConfig(config CommandRunRuntimeConfig) error

ValidateCommandRunRuntimeConfig checks an already normalized configuration.

func ValidateCommandRunUpdate added in v0.121.3

func ValidateCommandRunUpdate(update CommandRunUpdate, limits CommandRunContractLimits) error

ValidateCommandRunUpdate validates an update without exposing a normalized copy.

func ValidateEntryNavigationOverrides added in v0.111.0

func ValidateEntryNavigationOverrides(overrides map[string]string, eligible []string, strict bool) (map[string]string, error)

ValidateEntryNavigationOverrides ensures override locations are eligible for a policy. Strict mode returns a validation error; non-strict mode drops ineligible locations.

func ValidateJSONPointerFormat added in v0.23.0

func ValidateJSONPointerFormat(pointer string) bool

ValidateJSONPointerFormat checks if a string is a valid JSON Pointer

func WithActivityRetention

func WithActivityRetention(limit int) func(*ActivityFeed)

WithActivityRetention caps the number of stored entries (0 = unlimited).

func WithAuthenticatedRequest added in v0.32.0

func WithAuthenticatedRequest(ctx context.Context) context.Context

func WithContentChannel added in v0.26.0

func WithContentChannel(ctx context.Context, channel string) context.Context

WithContentChannel stores the active content channel on the context.

func WithEnvironment added in v0.24.0

func WithEnvironment(ctx context.Context, environment string) context.Context

WithEnvironment stores the active environment on the context.

func WithLocale added in v0.24.0

func WithLocale(ctx context.Context, locale string) context.Context

WithLocale stores the active locale on the context.

func WithLocaleFallback added in v0.26.0

func WithLocaleFallback(ctx context.Context, allow bool) context.Context

WithLocaleFallback stores locale fallback policy on the context. The default behavior remains enabled when this value is not set.

func WithMutationFocus added in v0.86.0

func WithMutationFocus(selector string) func(*MutationPresentation)

func WithMutationFragment added in v0.86.0

func WithMutationFragment(fragment EnhancedFragment) func(*MutationPresentation)

func WithMutationRedirect added in v0.86.0

func WithMutationRedirect(redirect string) func(*MutationPresentation)

func WithMutationStatus added in v0.86.0

func WithMutationStatus(status int) func(*MutationPresentation)

func WithMutationToast added in v0.86.0

func WithMutationToast(toast EnhancedToast) func(*MutationPresentation)

func WithNotificationSystemAuthority added in v0.130.0

func WithNotificationSystemAuthority(ctx context.Context) context.Context

WithNotificationSystemAuthority marks a trusted service/authentication context as authorized to perform global notification operations. Request payloads and query parameters cannot set this value.

func WithRequestIP added in v0.27.0

func WithRequestIP(ctx context.Context, requestIP string) context.Context

WithRequestIP stores the request IP on the context for downstream modules/services.

func WithResolvedPermissionsCache added in v0.25.0

func WithResolvedPermissionsCache(ctx context.Context) context.Context

WithResolvedPermissionsCache injects a request-scoped permission resolution cache into context.

func WithStack added in v0.24.0

func WithStack(err error) error

WithStack wraps an error with a captured stack trace for later mapping.

func WithThemeSelection

func WithThemeSelection(ctx context.Context, selector ThemeSelector) context.Context

WithThemeSelection stores a theme selector on the context for downstream resolution.

func WithThemeSelectionFromRequest added in v0.134.0

func WithThemeSelectionFromRequest(ctx context.Context, c RouterContext) context.Context

WithThemeSelectionFromRequest applies the supported query/header theme overrides to ctx. Query values take precedence over headers, matching the admin request-resolution contract.

Types

type Action

type Action struct {
	Name             string         `json:"name"`
	Label            string         `json:"label,omitempty"`
	LabelKey         string         `json:"label_key,omitempty"`
	CommandName      string         `json:"command_name"`
	Permission       string         `json:"permission,omitempty"`
	PermissionsAll   []string       `json:"permissions_all,omitempty"`
	Type             string         `json:"type,omitempty"`
	Href             string         `json:"href,omitempty"`
	Order            int            `json:"order,omitempty"`
	Scope            ActionScope    `json:"scope,omitempty"`
	ContextRequired  []string       `json:"context_required,omitempty"`
	Icon             string         `json:"icon,omitempty"`
	Confirm          string         `json:"confirm,omitempty"`
	Variant          string         `json:"variant,omitempty"`
	Overflow         bool           `json:"overflow,omitempty"`
	Idempotent       bool           `json:"idempotent,omitempty"`
	IdempotencyField string         `json:"idempotency_field,omitempty"`
	PayloadRequired  []string       `json:"payload_required,omitempty"`
	PayloadSchema    map[string]any `json:"payload_schema,omitempty"`
	Guard            ActionGuard    `json:"-"`
}

Action describes an action or bulk action linked to a command handler.

func DefaultCMSWorkflowActions added in v0.24.0

func DefaultCMSWorkflowActions() []Action

DefaultCMSWorkflowActions returns the default workflow actions for CMS demo panels.

type ActionDiagnosticEntry added in v0.27.0

type ActionDiagnosticEntry struct {
	Timestamp   time.Time      `json:"timestamp"`
	Kind        string         `json:"kind"`
	Panel       string         `json:"panel,omitempty"`
	Action      string         `json:"action,omitempty"`
	ActionNames []string       `json:"action_names,omitempty"`
	Scope       string         `json:"scope,omitempty"`
	Stage       string         `json:"stage,omitempty"`
	RecordID    string         `json:"record_id,omitempty"`
	RecordIDs   []string       `json:"record_ids,omitempty"`
	Permission  string         `json:"permission,omitempty"`
	ReasonCode  string         `json:"reason_code,omitempty"`
	Reason      string         `json:"reason,omitempty"`
	ErrorText   string         `json:"error_text,omitempty"`
	StatusCode  int            `json:"status_code,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

ActionDiagnosticEntry captures server-authored action availability or execution diagnostics for development and QA surfaces.

type ActionDiagnosticSink added in v0.27.0

type ActionDiagnosticSink interface {
	CaptureActionDiagnostic(entry ActionDiagnosticEntry)
}

ActionDiagnosticSink records action diagnostics.

type ActionDiagnosticsDebugPanel added in v0.27.0

type ActionDiagnosticsDebugPanel struct {
	// contains filtered or unexported fields
}

ActionDiagnosticsDebugPanel exposes recent action-state and action-failure diagnostics in the debug dashboard.

func NewActionDiagnosticsDebugPanel added in v0.27.0

func NewActionDiagnosticsDebugPanel(admin *Admin) *ActionDiagnosticsDebugPanel

func (*ActionDiagnosticsDebugPanel) Collect added in v0.27.0

func (*ActionDiagnosticsDebugPanel) ID added in v0.27.0

func (*ActionDiagnosticsDebugPanel) Icon added in v0.27.0

func (*ActionDiagnosticsDebugPanel) Label added in v0.27.0

func (*ActionDiagnosticsDebugPanel) Span added in v0.27.0

func (p *ActionDiagnosticsDebugPanel) Span() int

type ActionDiagnosticsStore added in v0.27.0

type ActionDiagnosticsStore struct {
	// contains filtered or unexported fields
}

ActionDiagnosticsStore keeps a bounded history of recent action diagnostics.

func NewActionDiagnosticsStore added in v0.27.0

func NewActionDiagnosticsStore(capacity int) *ActionDiagnosticsStore

func (*ActionDiagnosticsStore) Capture added in v0.27.0

func (*ActionDiagnosticsStore) Entries added in v0.27.0

type ActionGuard added in v0.27.0

type ActionGuard func(ActionGuardContext) ActionState

ActionGuard evaluates action availability for a single record context.

type ActionGuardContext added in v0.27.0

type ActionGuardContext struct {
	AdminContext AdminContext   `json:"admin_context"`
	Panel        *Panel         `json:"panel"`
	Action       Action         `json:"action"`
	Record       map[string]any `json:"record"`
	Scope        ActionScope    `json:"scope"`
}

ActionGuardContext contains the inputs used to evaluate action availability for a single action against a single record.

type ActionRemediation added in v0.27.0

type ActionRemediation struct {
	Label string `json:"label,omitempty"`
	Href  string `json:"href,omitempty"`
	Kind  string `json:"kind,omitempty"`
}

ActionRemediation describes an optional next step for a blocked action.

type ActionResponse added in v0.27.0

type ActionResponse struct {
	StatusCode int            `json:"status_code"`
	Data       map[string]any `json:"data"`
}

ActionResponse captures structured panel action output and an optional HTTP status override.

type ActionResponseCollector added in v0.27.0

type ActionResponseCollector struct {
	// contains filtered or unexported fields
}

ActionResponseCollector stores the latest action response emitted during a command-backed panel action.

func ActionResponseCollectorFromContext added in v0.27.0

func ActionResponseCollectorFromContext(ctx context.Context) *ActionResponseCollector

ActionResponseCollectorFromContext resolves a collector from context when present.

func (*ActionResponseCollector) Load added in v0.27.0

Load returns a cloned stored action response when present.

func (*ActionResponseCollector) Store added in v0.27.0

func (c *ActionResponseCollector) Store(response ActionResponse)

Store writes the latest action response.

type ActionScope added in v0.25.0

type ActionScope string
const (
	ActionScopeAny    ActionScope = "all"
	ActionScopeRow    ActionScope = "row"
	ActionScopeDetail ActionScope = "detail"
	ActionScopeBulk   ActionScope = "bulk"
)

type ActionState added in v0.27.0

type ActionState struct {
	Enabled              bool               `json:"enabled"`
	ReasonCode           string             `json:"reason_code,omitempty"`
	Reason               string             `json:"reason,omitempty"`
	Severity             string             `json:"severity,omitempty"`
	Kind                 string             `json:"kind,omitempty"`
	Permission           string             `json:"permission,omitempty"`
	Metadata             map[string]any     `json:"metadata,omitempty"`
	Remediation          *ActionRemediation `json:"remediation,omitempty"`
	AvailableTransitions []string           `json:"available_transitions,omitempty"`
}

ActionState is the canonical server-authored availability payload for an action in a specific record or list context.

type ActivityDisplayHintPolicy added in v0.133.0

type ActivityDisplayHintPolicy interface {
	AllowStoredDisplayHint(context.Context, ActivityReadContext, userstypes.ActivityRecord, string, string) bool
}

ActivityDisplayHintPolicy decides whether a stored display hint may be used when current resolution does not return a display value. A nil policy denies all stored hints.

type ActivityDisplayHintPolicyFunc added in v0.133.0

type ActivityDisplayHintPolicyFunc func(context.Context, ActivityReadContext, userstypes.ActivityRecord, string, string) bool

ActivityDisplayHintPolicyFunc adapts a function into an ActivityDisplayHintPolicy.

func (ActivityDisplayHintPolicyFunc) AllowStoredDisplayHint added in v0.133.0

func (f ActivityDisplayHintPolicyFunc) AllowStoredDisplayHint(ctx context.Context, readCtx ActivityReadContext, record userstypes.ActivityRecord, field, value string) bool

AllowStoredDisplayHint implements ActivityDisplayHintPolicy.

type ActivityEntry

type ActivityEntry struct {
	ID        string         `json:"id"`
	Actor     string         `json:"actor,omitempty"`
	Action    string         `json:"action,omitempty"`
	ActionKey string         `json:"action_key,omitempty"`
	Object    string         `json:"object,omitempty"`
	Channel   string         `json:"channel,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	CreatedAt time.Time      `json:"created_at"`
}

ActivityEntry represents an activity feed entry.

type ActivityFeed

type ActivityFeed struct {
	// contains filtered or unexported fields
}

ActivityFeed stores activities in memory.

func NewActivityFeed

func NewActivityFeed(opts ...func(*ActivityFeed)) *ActivityFeed

NewActivityFeed constructs a feed.

func (*ActivityFeed) List

func (f *ActivityFeed) List(ctx context.Context, limit int, filters ...ActivityFilter) ([]ActivityEntry, error)

List returns the most recent entries.

func (*ActivityFeed) ListRecords

func (f *ActivityFeed) ListRecords(ctx context.Context, limit int, filters ...ActivityFilter) ([]ActivityRecord, error)

ListRecords returns ActivityRecords for adapter use.

func (*ActivityFeed) Log

func (f *ActivityFeed) Log(ctx context.Context, record ActivityRecord) error

Log implements a go-users-compatible logger.

func (*ActivityFeed) Record

func (f *ActivityFeed) Record(ctx context.Context, entry ActivityEntry) error

Record appends an activity entry.

type ActivityFeedQuerier added in v0.14.0

type ActivityFeedQuerier interface {
	Query(context.Context, types.ActivityFilter) (types.ActivityPage, error)
}

ActivityFeedQuerier represents the go-users activity feed query contract.

type ActivityFeedWidgetPayload added in v0.25.0

type ActivityFeedWidgetPayload struct {
	Entries []ActivityEntry `json:"entries"`
}

type ActivityFilter

type ActivityFilter struct {
	Actor   string `json:"actor"`
	Action  string `json:"action"`
	Object  string `json:"object"`
	Channel string `json:"channel"`
}

ActivityFilter narrows feed listings.

type ActivityFilterOption added in v0.134.0

type ActivityFilterOption struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

ActivityFilterOption is one stable machine value and its display label.

type ActivityFilterOptions added in v0.134.0

type ActivityFilterOptions struct {
	Verbs       []ActivityFilterOption `json:"verbs"`
	Channels    []ActivityFilterOption `json:"channels"`
	ObjectTypes []ActivityFilterOption `json:"object_types"`
	Revision    string                 `json:"revision,omitempty"`
}

ActivityFilterOptions is the normalized Activity filter catalog returned to the browser. Revision is opaque provider metadata, not a response validator.

type ActivityFilterOptionsConfig added in v0.134.0

type ActivityFilterOptionsConfig struct {
	Verbs       []ActivityFilterOption `json:"verbs"`
	Channels    []ActivityFilterOption `json:"channels"`
	ObjectTypes []ActivityFilterOption `json:"object_types"`
	MaxOptions  int                    `json:"max_options,omitempty"`
}

ActivityFilterOptionsConfig declares host-curated baseline options.

type ActivityFilterOptionsPolicy added in v0.134.0

type ActivityFilterOptionsPolicy interface {
	FilterActivityFilterOptions(context.Context, ActivityFilterOptionsQuery, ActivityFilterOptions) (ActivityFilterOptions, error)
}

ActivityFilterOptionsPolicy applies host guards to the complete Config and provider result. Errors fail closed.

type ActivityFilterOptionsPolicyFunc added in v0.134.0

ActivityFilterOptionsPolicyFunc adapts a function into a policy.

func (ActivityFilterOptionsPolicyFunc) FilterActivityFilterOptions added in v0.134.0

FilterActivityFilterOptions implements ActivityFilterOptionsPolicy.

type ActivityFilterOptionsProvider added in v0.134.0

type ActivityFilterOptionsProvider interface {
	ActivityFilterOptions(context.Context, ActivityFilterOptionsQuery) (ActivityFilterOptions, error)
}

ActivityFilterOptionsProvider returns a request-time authorized option snapshot. Implementations are trusted backend integrations.

type ActivityFilterOptionsProviderFunc added in v0.134.0

type ActivityFilterOptionsProviderFunc func(context.Context, ActivityFilterOptionsQuery) (ActivityFilterOptions, error)

ActivityFilterOptionsProviderFunc adapts a function into a provider.

func (ActivityFilterOptionsProviderFunc) ActivityFilterOptions added in v0.134.0

ActivityFilterOptions implements ActivityFilterOptionsProvider.

type ActivityFilterOptionsQuery added in v0.134.0

type ActivityFilterOptionsQuery struct {
	ReadContext     ActivityReadContext
	EffectiveFilter usertypes.ActivityFilter
	Selected        ActivityFilterSelection
}

ActivityFilterOptionsQuery contains trusted request context for providers and policies. Callers receive detached values that are safe to mutate.

type ActivityFilterSelection added in v0.134.0

type ActivityFilterSelection struct {
	Verbs      []string `json:"verbs,omitempty"`
	Channels   []string `json:"channels,omitempty"`
	ObjectType string   `json:"object_type,omitempty"`
}

ActivityFilterSelection carries browser-owned values independently from the trusted visibility filter used for option discovery.

type ActivityLogger

type ActivityLogger interface {
	Log(context.Context, ActivityRecord) error
}

ActivityLogger matches the go-users ActivitySink shape (`Log` + ActivityRecord).

type ActivityModule added in v0.14.0

type ActivityModule struct {
	// contains filtered or unexported fields
}

ActivityModule registers the activity log navigation and user detail tab.

func NewActivityModule added in v0.14.0

func NewActivityModule() *ActivityModule

NewActivityModule constructs the default activity module.

func (*ActivityModule) Manifest added in v0.14.0

func (m *ActivityModule) Manifest() ModuleManifest

Manifest describes the module metadata.

func (*ActivityModule) MenuItems added in v0.14.0

func (m *ActivityModule) MenuItems(locale string) []MenuItem

MenuItems contributes navigation for the activity module.

func (*ActivityModule) Register added in v0.14.0

func (m *ActivityModule) Register(ctx ModuleContext) error

Register wires the activity module metadata and user tab integration.

func (*ActivityModule) RouteContract added in v0.27.0

func (m *ActivityModule) RouteContract() routing.ModuleContract

func (*ActivityModule) WithMenuParent added in v0.14.0

func (m *ActivityModule) WithMenuParent(parent string) *ActivityModule

WithMenuParent nests the activity navigation under a parent menu item ID.

type ActivityNavigation added in v0.133.1

type ActivityNavigation struct {
	ActorHref  string
	ObjectHref string
}

ActivityNavigation contains optional host-owned navigation targets for one Activity record. Hrefs are presentation-only and are never persisted.

type ActivityNavigationError added in v0.133.1

type ActivityNavigationError struct {
	ActivityID uuid.UUID
	Target     ActivityNavigationTarget
	Err        error
}

ActivityNavigationError describes one fail-open navigation projection failure without conflating it with Activity page enrichment errors.

func (ActivityNavigationError) Error added in v0.133.1

func (e ActivityNavigationError) Error() string

Error implements error.

func (ActivityNavigationError) Unwrap added in v0.133.1

func (e ActivityNavigationError) Unwrap() error

Unwrap exposes the underlying resolver or href validation error.

type ActivityNavigationErrorHandler added in v0.133.1

type ActivityNavigationErrorHandler func(context.Context, ActivityReadContext, ActivityNavigationError)

ActivityNavigationErrorHandler observes fail-open navigation projection errors independently of page enrichment observability.

type ActivityNavigationResolver added in v0.133.1

type ActivityNavigationResolver interface {
	ResolveActivityNavigation(context.Context, ActivityReadContext, []types.ActivityRecord) ([]ActivityNavigation, error)
}

ActivityNavigationResolver derives host-specific navigation for one authorized canonical Activity page. The result must preserve record order. Implementations must not treat record metadata as URL authority and should batch any request-level permission policy evaluation.

type ActivityNavigationResolverFunc added in v0.133.1

type ActivityNavigationResolverFunc func(context.Context, ActivityReadContext, []types.ActivityRecord) ([]ActivityNavigation, error)

ActivityNavigationResolverFunc adapts a function into an ActivityNavigationResolver.

func (ActivityNavigationResolverFunc) ResolveActivityNavigation added in v0.133.1

func (f ActivityNavigationResolverFunc) ResolveActivityNavigation(ctx context.Context, readCtx ActivityReadContext, records []types.ActivityRecord) ([]ActivityNavigation, error)

ResolveActivityNavigation implements ActivityNavigationResolver.

type ActivityNavigationTarget added in v0.133.1

type ActivityNavigationTarget string

ActivityNavigationTarget identifies the navigation projection stage that failed while preserving fail-open Activity reads.

const (
	ActivityNavigationTargetResolver ActivityNavigationTarget = "resolver"
	ActivityNavigationTargetActor    ActivityNavigationTarget = "actor"
	ActivityNavigationTargetObject   ActivityNavigationTarget = "object"
)

type ActivityPageEnricher added in v0.133.0

type ActivityPageEnricher interface {
	EnrichActivityPage(context.Context, ActivityReadContext, types.ActivityPage) (types.ActivityPage, error)
}

ActivityPageEnricher enriches one authorized and sanitized activity page.

func NewResolverActivityPageEnricher added in v0.133.0

func NewResolverActivityPageEnricher(cfg ResolverActivityPageEnricherConfig) ActivityPageEnricher

NewResolverActivityPageEnricher builds a generic, repository-agnostic page enricher. Resolver calls receive only the trusted request scope.

type ActivityPageEnricherFunc added in v0.133.0

type ActivityPageEnricherFunc func(context.Context, ActivityReadContext, types.ActivityPage) (types.ActivityPage, error)

ActivityPageEnricherFunc adapts a function into an ActivityPageEnricher.

func (ActivityPageEnricherFunc) EnrichActivityPage added in v0.133.0

EnrichActivityPage implements ActivityPageEnricher.

type ActivityReadContext added in v0.133.0

type ActivityReadContext struct {
	Actor types.ActorRef
	Scope types.ScopeFilter
}

ActivityReadContext carries trusted request authority into page enrichment. Scope is derived from the authenticated request and must never be inferred from activity metadata.

type ActivityReadEntry added in v0.133.1

type ActivityReadEntry struct {
	ActivityEntry
	ActorHref  string `json:"actor_href,omitempty"`
	ObjectHref string `json:"object_href,omitempty"`
}

ActivityReadEntry is the read-only API projection of an ActivityEntry. Navigation fields are deliberately excluded from the write-side entry so presentation state cannot cross a persistence boundary.

type ActivityReadErrorHandler added in v0.133.0

type ActivityReadErrorHandler func(context.Context, ActivityReadContext, error)

ActivityReadErrorHandler observes fail-open read-enrichment errors.

type ActivityRecord

type ActivityRecord struct {
	ID         string         `json:"id"`
	UserID     string         `json:"user_id,omitempty"`
	ActorID    string         `json:"actor_id,omitempty"`
	Verb       string         `json:"verb,omitempty"`
	ObjectType string         `json:"object_type,omitempty"`
	ObjectID   string         `json:"object_id,omitempty"`
	Channel    string         `json:"channel,omitempty"`
	IP         string         `json:"ip,omitempty"`
	TenantID   string         `json:"tenant_id,omitempty"`
	OrgID      string         `json:"org_id,omitempty"`
	Data       map[string]any `json:"data,omitempty"`
	OccurredAt time.Time      `json:"occurred_at"`
}

ActivityRecord mirrors the go-users activity record contract for compatibility.

type ActivityRecordLister

type ActivityRecordLister interface {
	ListRecords(context.Context, int, ...ActivityFilter) ([]ActivityRecord, error)
}

ActivityRecordLister exposes listing ActivityRecords (for adapters backed by go-users).

type ActivitySink

type ActivitySink interface {
	Record(ctx context.Context, entry ActivityEntry) error
	List(ctx context.Context, limit int, filters ...ActivityFilter) ([]ActivityEntry, error)
}

ActivitySink records activity entries.

type ActivitySinkAdapter

type ActivitySinkAdapter struct {
	// contains filtered or unexported fields
}

ActivitySinkAdapter bridges a go-users style logger into the ActivitySink contract.

func NewActivitySinkAdapter

func NewActivitySinkAdapter(logger ActivityLogger, lister ActivityRecordLister) *ActivitySinkAdapter

NewActivitySinkAdapter builds an adapter that logs via the provided logger and, when possible, lists via lister; a fallback in-memory buffer preserves UI feeds.

func (*ActivitySinkAdapter) List

func (a *ActivitySinkAdapter) List(ctx context.Context, limit int, filters ...ActivityFilter) ([]ActivityEntry, error)

List returns entries from the lister when present, otherwise from the fallback buffer.

func (*ActivitySinkAdapter) Record

func (a *ActivitySinkAdapter) Record(ctx context.Context, entry ActivityEntry) error

Record converts ActivityEntry to ActivityRecord before delegating to the logger.

type ActivityUserBatchReader added in v0.133.0

type ActivityUserBatchReader interface {
	ReadActivityUsers(context.Context, []uuid.UUID, usersactivity.ResolveContext) (map[uuid.UUID]UserRecord, error)
}

ActivityUserBatchReader supplies a true set-based user projection for Activity actor enrichment. The legacy UserRepository.Get path remains a compatibility fallback when this optional contract is absent.

type Admin

type Admin struct {
	// contains filtered or unexported fields
}

Admin orchestrates CMS-backed admin features and adapters.

func New

func New(cfg Config, deps Dependencies) (*Admin, error)

New constructs an Admin orchestrator with explicit dependencies.

func (*Admin) ActivityFeatureEnabled added in v0.32.0

func (a *Admin) ActivityFeatureEnabled() bool

ActivityFeatureEnabled reports whether the activity feature gate is enabled.

func (*Admin) ActivityFeed

func (a *Admin) ActivityFeed() ActivitySink

ActivityFeed returns the activity sink.

func (*Admin) ActivityReadEnabled added in v0.25.0

func (a *Admin) ActivityReadEnabled() bool

ActivityReadEnabled reports whether the activity read API is both enabled and wired.

func (*Admin) ActivityWidget

func (a *Admin) ActivityWidget() error

ActivityWidget registers the activity widget provider.

func (*Admin) AddCMSBootstrapHook added in v0.36.0

func (a *Admin) AddCMSBootstrapHook(hook CMSBootstrapHook)

AddCMSBootstrapHook registers a hook that can create or repair CMS content types before dynamic CMS reconciliation runs during admin initialization.

func (*Admin) AddInitHook added in v0.24.0

func (a *Admin) AddInitHook(hook func(AdminRouter) error)

AddInitHook registers a hook that runs after Initialize sets the router.

func (*Admin) AddPreviewURLAllowedHost added in v0.86.0

func (a *Admin) AddPreviewURLAllowedHost(host string)

AddPreviewURLAllowedHost adds a host or URL host to the external preview URL allowlist.

func (*Admin) AdminAPIBasePath added in v0.24.0

func (a *Admin) AdminAPIBasePath() string

AdminAPIBasePath returns the base path for admin API routes (including version when configured).

func (*Admin) AdminAPIGroup added in v0.24.0

func (a *Admin) AdminAPIGroup() string

AdminAPIGroup exposes the URLKit admin API group path.

func (*Admin) AdminUIGroup added in v0.27.0

func (a *Admin) AdminUIGroup() string

AdminUIGroup exposes the URLKit admin UI group path.

func (*Admin) ApplyMediaSchemaHints added in v0.53.0

func (a *Admin) ApplyMediaSchemaHints(schema map[string]any) int

ApplyMediaSchemaHints enriches plain JSON Schema media fields with the endpoint contract expected by go-formgen's media picker component.

func (*Admin) AttachDebugLogBridge added in v0.25.0

func (a *Admin) AttachDebugLogBridge()

AttachDebugLogBridge wraps the admin DI logger/provider so application logs are captured by the debug collector in addition to any slog capture path.

func (*Admin) AuthWrapper

func (a *Admin) AuthWrapper() boot.HandlerWrapper

AuthWrapper returns the configured auth wrapper for boot steps.

func (*Admin) Authenticator added in v0.27.0

func (a *Admin) Authenticator() Authenticator

Authenticator exposes the configured authenticator (if any).

func (*Admin) AuthorizedPanelBulkActions added in v0.130.0

func (a *Admin) AuthorizedPanelBulkActions(ctx context.Context, panelName string, actions []Action) []Action

AuthorizedPanelBulkActions filters panel bulk actions using every normalized required permission. A missing authorizer preserves the existing permissive compatibility behavior.

func (*Admin) Authorizer added in v0.22.0

func (a *Admin) Authorizer() Authorizer

Authorizer exposes the configured authorizer (if any).

func (*Admin) BasePath

func (a *Admin) BasePath() string

BasePath exposes the configured base path.

func (*Admin) Boot

func (a *Admin) Boot(steps ...boot.Step) error

Boot runs the admin boot pipeline with the given steps or the defaults.

func (*Admin) BootActivity

func (a *Admin) BootActivity() boot.ActivityBinding

BootActivity exposes the activity binding.

func (*Admin) BootBulk

func (a *Admin) BootBulk() boot.BulkBinding

BootBulk exposes the bulk binding.

func (*Admin) BootDashboard

func (a *Admin) BootDashboard() boot.DashboardBinding

BootDashboard exposes the dashboard binding.

func (*Admin) BootFeatureOverrides added in v0.20.0

func (a *Admin) BootFeatureOverrides() boot.FeatureOverridesBinding

BootFeatureOverrides exposes the feature overrides binding.

func (*Admin) BootIcons added in v0.25.0

func (a *Admin) BootIcons() boot.IconsBinding

BootIcons exposes the icons binding for icon discovery and rendering.

func (*Admin) BootJobs

func (a *Admin) BootJobs() boot.JobsBinding

BootJobs exposes the jobs binding.

func (*Admin) BootMedia

func (a *Admin) BootMedia() boot.MediaBinding

BootMedia exposes the media binding.

func (*Admin) BootNavigation

func (a *Admin) BootNavigation() boot.NavigationBinding

BootNavigation exposes the navigation binding.

func (*Admin) BootNotifications

func (a *Admin) BootNotifications() boot.NotificationsBinding

BootNotifications exposes the notifications binding.

func (*Admin) BootSchemaRegistry added in v0.23.0

func (a *Admin) BootSchemaRegistry() boot.SchemaRegistryBinding

BootSchemaRegistry exposes schema registry bindings.

func (*Admin) BootSearch

func (a *Admin) BootSearch() boot.SearchBinding

BootSearch exposes the search binding.

func (*Admin) BootSettings

func (a *Admin) BootSettings() boot.SettingsBinding

BootSettings exposes the settings binding.

func (*Admin) BootTranslationExchange added in v0.25.0

func (a *Admin) BootTranslationExchange() boot.TranslationExchangeBinding

BootTranslationExchange exposes translation exchange bindings.

func (*Admin) BootTranslationFamilies added in v0.27.0

func (a *Admin) BootTranslationFamilies() boot.TranslationFamiliesBinding

BootTranslationFamilies exposes translation family list/detail bindings.

func (*Admin) BootTranslationQueue added in v0.25.0

func (a *Admin) BootTranslationQueue() boot.TranslationQueueBinding

BootTranslationQueue exposes translation queue aggregate bindings.

func (*Admin) BootUserImport added in v0.22.0

func (a *Admin) BootUserImport() boot.UserImportBinding

BootUserImport exposes the user import binding.

func (*Admin) BootWithContext added in v0.32.0

func (a *Admin) BootWithContext(ctx context.Context, steps ...boot.Step) error

BootWithContext runs the admin boot pipeline with the given lifecycle context and steps. Nested lifecycle execution must pass the active lifecycle context explicitly.

func (*Admin) BootWorkflows added in v0.25.0

func (a *Admin) BootWorkflows() boot.WorkflowManagementBinding

BootWorkflows exposes persisted workflow management bindings.

func (*Admin) Bootstrap

func (a *Admin) Bootstrap(ctx context.Context) error

Bootstrap initializes CMS seed data (CMS container, admin menu, settings defaults).

func (*Admin) BuildSitePreviewURL added in v0.86.0

func (a *Admin) BuildSitePreviewURL(targetPath, token string) string

BuildSitePreviewURL applies this admin instance's external preview URL policy.

func (*Admin) BulkService

func (a *Admin) BulkService() BulkService

BulkService exposes the bulk adapter.

func (*Admin) CloseCommandRunRuntime added in v0.121.3

func (a *Admin) CloseCommandRunRuntime(ctx context.Context) error

CloseCommandRunRuntime is the explicit host cleanup path. Hosts should call it before closing injected transport drivers or routers.

func (*Admin) CloseNavigationContributions added in v0.90.0

func (a *Admin) CloseNavigationContributions() NavigationLifecycleReport

func (*Admin) CommandRunRuntime added in v0.121.3

func (a *Admin) CommandRunRuntime() *CommandRunRuntime

CommandRunRuntime returns the configured runtime for diagnostics, snapshots, and explicit host shutdown.

func (*Admin) Commands

func (a *Admin) Commands() *CommandBus

Commands exposes the go-command registry hook.

func (*Admin) ConfigureTranslationSuggestionServiceDependencies added in v0.110.0

func (a *Admin) ConfigureTranslationSuggestionServiceDependencies(deps TranslationSuggestionServiceDependencies) *Admin

ConfigureTranslationSuggestionServiceDependencies records host-owned suggestion service dependencies and applies them to the current service.

func (*Admin) ContentService added in v0.24.0

func (a *Admin) ContentService() CMSContentService

ContentService exposes the configured CMS content service.

func (*Admin) ContentTypeService added in v0.24.0

func (a *Admin) ContentTypeService() CMSContentTypeService

ContentTypeService exposes the configured CMS content type service.

func (*Admin) Dashboard

func (a *Admin) Dashboard() *Dashboard

Dashboard exposes the dashboard orchestration service.

func (*Admin) DashboardService

func (a *Admin) DashboardService() *Dashboard

DashboardService exposes the dashboard orchestration.

func (*Admin) Debug added in v0.14.0

func (a *Admin) Debug() *DebugCollector

Debug exposes the debug collector when the module is enabled.

func (*Admin) DebugQueryHook added in v0.14.0

func (a *Admin) DebugQueryHook() bun.QueryHook

DebugQueryHook returns a Bun query hook for capturing SQL in the debug collector.

func (*Admin) DebugQueryHookOptions added in v0.14.0

func (a *Admin) DebugQueryHookOptions() []repository.Option

DebugQueryHookOptions returns repository options for wiring SQL capture hooks.

func (*Admin) DebugREPLSessionManager added in v0.16.0

func (a *Admin) DebugREPLSessionManager() *DebugREPLSessionManager

DebugREPLSessionManager exposes the REPL session lifecycle manager.

func (*Admin) DebugREPLSessions added in v0.16.0

func (a *Admin) DebugREPLSessions() DebugREPLSessionStore

DebugREPLSessions exposes the REPL session store.

func (*Admin) DebugUserSessions added in v0.24.0

func (a *Admin) DebugUserSessions() DebugUserSessionStore

DebugUserSessions exposes the debug user session store.

func (*Admin) DefaultLocale

func (a *Admin) DefaultLocale() string

DefaultLocale exposes the configured default locale.

func (*Admin) DeploymentIdentity added in v0.122.0

func (a *Admin) DeploymentIdentity() DeploymentIdentity

DeploymentIdentity returns the immutable identity resolved for this Admin.

func (*Admin) DiagnoseNavigation added in v0.90.0

func (a *Admin) DiagnoseNavigation(ctx context.Context, opts NavigationDoctorOptions) (NavigationDoctorReport, error)

func (*Admin) DoctorChecks added in v0.25.0

func (a *Admin) DoctorChecks() []DoctorCheck

DoctorChecks returns a stable, sorted copy of registered doctor checks.

func (*Admin) EffectiveScope added in v0.83.0

func (a *Admin) EffectiveScope(ctx context.Context, input ScopeInput) EffectiveScope

EffectiveScope resolves trusted input, context actor scope, and configured single-tenant defaults into one scope value.

func (*Admin) EffectiveScopeFromRequest added in v0.83.0

func (a *Admin) EffectiveScopeFromRequest(c router.Context, input ScopeInput) EffectiveScope

EffectiveScopeFromRequest resolves scope from trusted request actor/claims plus optional trusted service input. Browser query parameters are ignored.

func (*Admin) EnforceDashboardAreas

func (a *Admin) EnforceDashboardAreas(enable bool)

EnforceDashboardAreas toggles validation for unknown widget areas.

func (*Admin) EnhancedActionRuntimeOptions added in v0.86.0

func (a *Admin) EnhancedActionRuntimeOptions() EnhancedActionRuntimeOptions

func (*Admin) ErrorPresenter added in v0.122.0

func (a *Admin) ErrorPresenter() ErrorPresenter

ErrorPresenter returns the Admin-scoped presenter used by its registered request handlers and development error surfaces.

func (*Admin) ExportAPIAvailable added in v0.130.0

func (a *Admin) ExportAPIAvailable() bool

ExportAPIAvailable reports whether export routes were successfully registered by the boot pipeline.

func (*Admin) ExportHTTPRegistrar

func (a *Admin) ExportHTTPRegistrar() ExportHTTPRegistrar

ExportHTTPRegistrar exposes the export HTTP registrar.

func (*Admin) ExportMetadataProvider

func (a *Admin) ExportMetadataProvider() ExportMetadataProvider

ExportMetadataProvider exposes export metadata resolution.

func (*Admin) ExportRegistrar

func (a *Admin) ExportRegistrar() boot.ExportRegistrar

ExportRegistrar exposes the export HTTP registrar.

func (*Admin) ExportRegistry

func (a *Admin) ExportRegistry() ExportRegistry

ExportRegistry exposes the export definition registry.

func (*Admin) FeatureCatalog added in v0.22.0

func (a *Admin) FeatureCatalog() catalog.Catalog

FeatureCatalog exposes the configured feature catalog.

func (*Admin) FeatureGate added in v0.20.0

func (a *Admin) FeatureGate() fggate.FeatureGate

FeatureGate exposes the configured feature gate.

func (*Admin) FlushQueuedNavigationContributions added in v0.90.0

func (a *Admin) FlushQueuedNavigationContributions(ctx context.Context) error

func (*Admin) FormTheme added in v0.126.0

func (a *Admin) FormTheme(ctx context.Context) *formrender.ThemeConfig

FormTheme resolves the request-scoped admin theme and projects it into the typed go-formgen contract. Callers receive defensive map copies and may safely customize the returned config for one render.

func (*Admin) Gates

func (a *Admin) Gates() boot.FeatureGates

Gates exposes feature gates.

func (*Admin) HasAuthenticator added in v0.27.0

func (a *Admin) HasAuthenticator() bool

HasAuthenticator reports whether an authenticator is configured.

func (*Admin) IconService added in v0.25.0

func (a *Admin) IconService() *IconService

IconService returns the icon service for icon resolution and rendering.

func (*Admin) Initialize

func (a *Admin) Initialize(r AdminRouter) error

Initialize attaches the router, bootstraps, and mounts base routes.

func (*Admin) InitializeWithContext added in v0.32.0

func (a *Admin) InitializeWithContext(ctx context.Context, r AdminRouter) error

InitializeWithContext attaches the router, bootstraps, and mounts base routes with a lifecycle context.

func (*Admin) Jobs

func (a *Admin) Jobs() *JobRegistry

Jobs exposes the job registry.

func (*Admin) LifecycleContext added in v0.32.0

func (a *Admin) LifecycleContext() context.Context

LifecycleContext exposes the current boot lifecycle context to boot steps.

func (*Admin) Logger added in v0.25.0

func (a *Admin) Logger() Logger

Logger exposes the base configured logger.

func (*Admin) LoggerProvider added in v0.25.0

func (a *Admin) LoggerProvider() LoggerProvider

LoggerProvider exposes the configured logger provider.

func (*Admin) MediaDeliveryURLs added in v0.62.0

func (a *Admin) MediaDeliveryURLs(id string) MediaDeliveryURLs

MediaDeliveryURLs resolves app-owned delivery URLs for an item ID.

func (*Admin) MediaLibrary

func (a *Admin) MediaLibrary() MediaLibrary

MediaLibrary exposes the media library adapter.

func (*Admin) Menu

func (a *Admin) Menu() *Navigation

Menu exposes the navigation resolver and fallback menu builder.

func (*Admin) MenuService

func (a *Admin) MenuService() CMSMenuService

MenuService exposes the configured CMS menu service for host seeding.

func (*Admin) NamedLogger added in v0.25.0

func (a *Admin) NamedLogger(name string) Logger

NamedLogger resolves a named logger via the configured provider.

func (*Admin) NavMenuCode

func (a *Admin) NavMenuCode() string

NavMenuCode returns the default navigation menu code.

func (*Admin) Navigation

func (a *Admin) Navigation() *Navigation

Navigation returns the navigation resolver (alias for Menu).

func (*Admin) NavigationLifecycleReport added in v0.90.0

func (a *Admin) NavigationLifecycleReport() NavigationLifecycleReport

func (*Admin) NavigationPermissionRegistry added in v0.111.0

func (a *Admin) NavigationPermissionRegistry() *NavigationPermissionRegistry

func (*Admin) NotificationDeliveries added in v0.130.0

func (a *Admin) NotificationDeliveries() NotificationDeliveryInspector

NotificationDeliveries exposes privacy-safe delivery inspection.

func (*Admin) NotificationEvents added in v0.130.0

func (a *Admin) NotificationEvents() NotificationEventService

NotificationEvents exposes typed notification dispatch and recovery.

func (*Admin) NotificationReceipts added in v0.130.0

func (a *Admin) NotificationReceipts() NotificationReceiptService

NotificationReceipts exposes side-effect-free idempotent receipt lookup.

func (*Admin) NotificationRetention added in v0.130.0

func (a *Admin) NotificationRetention() NotificationRetentionService

NotificationRetention exposes one bounded retention purge pass.

func (*Admin) NotificationService

func (a *Admin) NotificationService() NotificationService

NotificationService returns the inbox service.

func (*Admin) NotificationsWidget

func (a *Admin) NotificationsWidget() error

NotificationsWidget registers the notifications widget provider.

func (*Admin) OrganizationService

func (a *Admin) OrganizationService() *OrganizationService

OrganizationService exposes the organization management service.

func (*Admin) Panel

func (a *Admin) Panel(_ string) *PanelBuilder

Panel returns a panel builder pre-wired with the command registry. The caller configures fields/actions/hooks and registers the panel via RegisterPanel.

func (*Admin) PanelAPIAvailable added in v0.126.6

func (a *Admin) PanelAPIAvailable(panelName string) bool

PanelAPIAvailable reports whether the boot pipeline successfully registered API routes for the named panel.

func (*Admin) Panels

func (a *Admin) Panels() []boot.PanelBinding

Panels exposes panel bindings.

func (*Admin) ParseBody

func (a *Admin) ParseBody(c router.Context) (map[string]any, error)

ParseBody parses JSON into a map.

func (*Admin) PreferencesAPIAvailable added in v0.126.4

func (a *Admin) PreferencesAPIAvailable() bool

PreferencesAPIAvailable reports whether the Preferences service is enabled and its panel routes were successfully mounted.

func (*Admin) PreferencesAPICapabilities added in v0.126.6

func (a *Admin) PreferencesAPICapabilities(ctx context.Context) PreferencesAPICapabilities

PreferencesAPICapabilities returns request-scoped Preferences API capabilities using the same configured permissions as the Preferences panel.

func (*Admin) PreferencesAPIRequestCapabilities added in v0.126.6

func (a *Admin) PreferencesAPIRequestCapabilities(ctx context.Context) (readable, writable bool)

PreferencesAPIRequestCapabilities is a compatibility-friendly projection for consumers that need request-scoped read/write booleans without sharing the capability struct type.

func (*Admin) PreferencesService

func (a *Admin) PreferencesService() *PreferencesService

PreferencesService exposes the user preferences service.

func (*Admin) Prepare

func (a *Admin) Prepare(ctx context.Context) error

Prepare runs the pre-route initialization pipeline (bootstrap, module loading).

func (*Admin) Preview added in v0.22.0

func (a *Admin) Preview() *PreviewService

Preview returns the preview service.

func (*Admin) PreviewURLAllowedHosts added in v0.86.0

func (a *Admin) PreviewURLAllowedHosts() []string

PreviewURLAllowedHosts returns the normalized external preview URL host allowlist.

func (*Admin) ProfileService

func (a *Admin) ProfileService() *ProfileService

ProfileService exposes the user profile service.

func (*Admin) ProtectedRouter added in v0.25.0

func (a *Admin) ProtectedRouter() AdminRouter

ProtectedRouter exposes the admin router wrapped with auth middleware when configured.

func (*Admin) PublicRouter added in v0.14.0

func (a *Admin) PublicRouter() AdminRouter

PublicRouter exposes the configured admin router for module route registration.

func (*Admin) PublishCommandStatus added in v0.99.0

func (a *Admin) PublishCommandStatus(event CommandStatusEvent)

PublishCommandStatus broadcasts a command status transition to connected debug clients over the debug WebSocket. The command launcher publishes dispatch-time states automatically; queue/async workers can call this when a queued command finishes so the launcher result panel updates live without a refresh.

func (*Admin) PublishCommandStatusContext added in v0.121.3

func (a *Admin) PublishCommandStatusContext(ctx context.Context, event CommandStatusEvent)

PublishCommandStatusContext preserves the legacy command_status surface and, when possible, forwards the transition through the canonical command-run runtime so snapshots and live rows converge on the same projection.

func (*Admin) RPCServer added in v0.27.0

func (a *Admin) RPCServer() *cmdrpc.Server

RPCServer exposes the command RPC server bound to this admin instance.

func (*Admin) ReconcileDynamicCMS added in v0.36.0

func (a *Admin) ReconcileDynamicCMS(ctx context.Context) error

ReconcileDynamicCMS synchronizes dynamic CMS-backed panels with the current content type snapshot after modules have been loaded.

func (*Admin) RefreshRoutingReport added in v0.36.0

func (a *Admin) RefreshRoutingReport() routing.StartupReport

RefreshRoutingReport recomputes the cached routing report after planner mutations.

func (*Admin) RegisterCMSDemoPanels

func (a *Admin) RegisterCMSDemoPanels() error

RegisterCMSDemoPanels seeds CMS-backed panels (content/tree/blocks/widgets/menus) using the configured CMS services. It provides tree/blocks/SEO metadata needed for the CMS management UI and demo block editor routes.

func (*Admin) RegisterDashboardProviders

func (a *Admin) RegisterDashboardProviders() error

RegisterDashboardProviders registers built-in dashboard providers.

func (*Admin) RegisterDoctorChecks added in v0.25.0

func (a *Admin) RegisterDoctorChecks(checks ...DoctorCheck) *Admin

RegisterDoctorChecks registers checks used by RunDoctor and the doctor debug panel.

func (*Admin) RegisterMediaDeliveryAdapter added in v0.62.0

func (a *Admin) RegisterMediaDeliveryAdapter(provider string, adapter MediaDeliveryAdapter) error

RegisterMediaDeliveryAdapter registers a provider delivery adapter and reports invalid input.

func (*Admin) RegisterModule

func (a *Admin) RegisterModule(module Module) error

RegisterModule registers a pluggable module before initialization. Duplicate IDs are rejected to preserve ordering and idempotency.

func (*Admin) RegisterNavigationPermissions added in v0.111.0

func (a *Admin) RegisterNavigationPermissions(declarations ...NavigationPermissionDeclaration) *Admin

func (*Admin) RegisterPanel

func (a *Admin) RegisterPanel(name string, builder *PanelBuilder) (*Panel, error)

RegisterPanel registers a built panel with the admin.

func (*Admin) RegisterPanelTab added in v0.2.0

func (a *Admin) RegisterPanelTab(panelName string, tab PanelTab) error

RegisterPanelTab attaches a tab to an existing or future panel.

func (*Admin) RegisterPublicAPI added in v0.22.0

func (a *Admin) RegisterPublicAPI(r AdminRouter)

RegisterPublicAPI registers read-only endpoints for content delivery.

func (*Admin) RegisterWidgetArea

func (a *Admin) RegisterWidgetArea(def WidgetAreaDefinition)

RegisterWidgetArea registers an additional dashboard widget area.

func (*Admin) RegisterWidgetAreas

func (a *Admin) RegisterWidgetAreas() error

RegisterWidgetAreas registers default dashboard widget areas.

func (*Admin) RegisterWidgetDefinitions

func (a *Admin) RegisterWidgetDefinitions() error

RegisterWidgetDefinitions registers default widget definitions.

func (*Admin) Registry

func (a *Admin) Registry() *Registry

Registry exposes the central registry for panels/modules/widgets/settings.

func (*Admin) RemovePreviewURLAllowedHost added in v0.86.0

func (a *Admin) RemovePreviewURLAllowedHost(host string)

RemovePreviewURLAllowedHost removes a host or URL host from the external preview URL allowlist.

func (*Admin) ResolveLocaleFromRequest added in v0.27.0

func (a *Admin) ResolveLocaleFromRequest(c router.Context, fallback string) string

ResolveLocaleFromRequest resolves the effective request locale using explicit query parameters first and Accept-Language against the active CMS locale catalog when one is available.

func (*Admin) ResolvePanelExportConfig added in v0.130.0

func (a *Admin) ResolvePanelExportConfig(ctx context.Context, definition, variant string) *ExportConfig

ResolvePanelExportConfig returns usable export metadata for a panel list. Unknown variants fall back to the base definition. Registry errors fail closed and are logged so view/schema rendering does not advertise a broken operation.

func (*Admin) ResolvePanelTabs added in v0.24.0

func (a *Admin) ResolvePanelTabs(ctx AdminContext, panelName string) ([]PanelTab, error)

ResolvePanelTabs returns the effective tabs for a panel using the provided admin context.

func (*Admin) ResolvePanelTabsFromRequest added in v0.24.0

func (a *Admin) ResolvePanelTabsFromRequest(c router.Context, panelName, locale string) ([]PanelTab, error)

ResolvePanelTabsFromRequest resolves panel tabs using request-derived context and permissions.

func (*Admin) Responder

func (a *Admin) Responder() boot.Responder

Responder exposes response helpers.

func (*Admin) Router

func (a *Admin) Router() boot.Router

Router exposes the configured router for boot steps.

func (*Admin) RoutingPlanner added in v0.27.0

func (a *Admin) RoutingPlanner() routing.Planner

RoutingPlanner exposes the current routing planner.

func (*Admin) RoutingReport added in v0.27.0

func (a *Admin) RoutingReport() routing.StartupReport

RoutingReport exposes the current routing diagnostics snapshot.

func (*Admin) RunDoctor added in v0.25.0

func (a *Admin) RunDoctor(ctx context.Context) DoctorReport

RunDoctor executes registered checks and returns a full diagnostics report.

func (*Admin) RunDoctorAction added in v0.25.0

func (a *Admin) RunDoctorAction(ctx context.Context, checkID string, input map[string]any) (DoctorActionExecution, error)

RunDoctorAction executes a check action when configured and runnable.

func (*Admin) ScopeDefaults added in v0.27.0

func (a *Admin) ScopeDefaults() AuthenticatedRequestScopeDefaults

ScopeDefaults returns the admin single-tenant scope defaults when enabled.

func (*Admin) ScopePolicy added in v0.83.0

func (a *Admin) ScopePolicy() ScopePolicy

ScopePolicy returns the configured go-admin scope policy.

func (*Admin) SearchService

func (a *Admin) SearchService() *SearchEngine

SearchService exposes the search engine.

func (*Admin) SetPreviewURLAllowedHosts added in v0.86.0

func (a *Admin) SetPreviewURLAllowedHosts(hosts []string)

SetPreviewURLAllowedHosts replaces the external preview URL host allowlist at runtime.

func (*Admin) SettingsService

func (a *Admin) SettingsService() *SettingsService

SettingsService exposes the settings resolver.

func (*Admin) SettingsWidget

func (a *Admin) SettingsWidget() error

SettingsWidget registers the settings widget provider.

func (*Admin) StartCommandRunRuntime added in v0.121.3

func (a *Admin) StartCommandRunRuntime(ctx context.Context, config CommandRunRuntimeConfig) error

StartCommandRunRuntime constructs and starts the command-run runtime once. Hosts must start injected drivers before calling this method.

func (*Admin) StructuralPartials added in v0.131.10

func (a *Admin) StructuralPartials(ctx context.Context) AdminStructuralPartials

StructuralPartials resolves the bounded admin structural registry. Without a filesystem-aware lookup, raw manifest metadata is deliberately ignored.

func (*Admin) TenantService

func (a *Admin) TenantService() *TenantService

TenantService exposes the tenant management service.

func (*Admin) Theme

func (a *Admin) Theme(ctx context.Context) *ThemeSelection

func (*Admin) ThemePayload

func (a *Admin) ThemePayload(ctx context.Context) map[string]map[string]string

func (*Admin) TranslationActorOptionProvider added in v0.113.6

func (a *Admin) TranslationActorOptionProvider() TranslationActorOptionProvider

TranslationActorOptionProvider exposes the configured actor option provider.

func (*Admin) TranslationSuggestionService added in v0.110.0

func (a *Admin) TranslationSuggestionService() TranslationSuggestionService

TranslationSuggestionService exposes the optional translation suggestion service.

func (*Admin) Translator added in v0.52.0

func (a *Admin) Translator() Translator

Translator returns the configured i18n translator, if any.

func (*Admin) URLs added in v0.21.0

func (a *Admin) URLs() urlkit.Resolver

URLs exposes the URL manager.

func (*Admin) UnregisterPanel added in v0.23.0

func (a *Admin) UnregisterPanel(name string) error

UnregisterPanel removes a previously registered panel.

func (*Admin) UseCMS

func (a *Admin) UseCMS(container CMSContainer) *Admin

UseCMS overrides the default CMS container (menu/widget services). Call before Initialize to wire a real go-cms container.

func (*Admin) UserImportAllowed added in v0.25.0

func (a *Admin) UserImportAllowed(ctx context.Context) bool

UserImportAllowed reports whether the current actor can access users import.

func (*Admin) UserImportEnabled added in v0.25.0

func (a *Admin) UserImportEnabled() bool

UserImportEnabled reports whether the users bulk-import backend is wired.

func (*Admin) UserService

func (a *Admin) UserService() *UserManagementService

UserService exposes the user and role management service.

func (*Admin) ValidateNavigationPolicy added in v0.111.0

func (a *Admin) ValidateNavigationPolicy(roles []RoleRecord) PermissionPolicyReport

func (*Admin) WidgetAreas

func (a *Admin) WidgetAreas() []WidgetAreaDefinition

WidgetAreas returns known dashboard widget areas.

func (*Admin) WithActivitySink

func (a *Admin) WithActivitySink(sink ActivitySink) *Admin

WithActivitySink injects a shared activity sink (go-users compatible via adapter).

func (*Admin) WithAdminStructuralDiagnosticSink added in v0.131.10

func (a *Admin) WithAdminStructuralDiagnosticSink(sink AdminStructuralDiagnosticSink) *Admin

WithAdminStructuralDiagnosticSink installs an optional safe diagnostic sink.

func (*Admin) WithAdminTemplateLookup added in v0.131.10

func (a *Admin) WithAdminTemplateLookup(lookup AdminTemplateLookup) *Admin

WithAdminTemplateLookup installs the configuration-time availability lookup used by StructuralPartials. Replacing it while serving is unsupported.

func (*Admin) WithAdminTheme added in v0.36.0

func (a *Admin) WithAdminTheme(selector gotheme.ThemeSelector) *Admin

WithAdminTheme wires a go-theme selector so CMS templates, dashboard widgets, and forms share the admin selection.

func (*Admin) WithAuth

func (a *Admin) WithAuth(auth Authenticator, cfg *AuthConfig) *Admin

WithAuth attaches an authenticator for route protection.

func (*Admin) WithAuthorizer

func (a *Admin) WithAuthorizer(authz Authorizer) *Admin

WithAuthorizer sets an authorizer for panel permissions.

func (*Admin) WithCMSWorkflowActions added in v0.24.0

func (a *Admin) WithCMSWorkflowActions(actions ...Action) *Admin

WithCMSWorkflowActions overrides the default CMS workflow actions for demo panels.

func (*Admin) WithCMSWorkflowDefaults added in v0.24.0

func (a *Admin) WithCMSWorkflowDefaults() *Admin

WithCMSWorkflowDefaults enables registering default CMS workflows on a custom engine that can report existing definitions.

func (*Admin) WithEnhancedActionNegotiation added in v0.86.0

func (a *Admin) WithEnhancedActionNegotiation(cfg EnhancedActionNegotiationConfig) *Admin

WithEnhancedActionNegotiation configures how enhanced SSR mutation requests are detected and which media type enhanced responses emit.

func (*Admin) WithMediaDeliveryAdapter added in v0.62.0

func (a *Admin) WithMediaDeliveryAdapter(provider string, adapter MediaDeliveryAdapter) *Admin

WithMediaDeliveryAdapter registers a provider delivery adapter.

func (*Admin) WithMediaDeliveryConfig added in v0.62.0

func (a *Admin) WithMediaDeliveryConfig(cfg MediaDeliveryConfig) *Admin

WithMediaDeliveryConfig configures media delivery route exposure before initialization.

func (*Admin) WithMediaDeliveryCredentialResolver added in v0.62.0

func (a *Admin) WithMediaDeliveryCredentialResolver(resolver MediaDeliveryCredentialResolver) *Admin

WithMediaDeliveryCredentialResolver configures provider credential resolution.

func (*Admin) WithMediaDeliveryReferenceProjector added in v0.62.0

func (a *Admin) WithMediaDeliveryReferenceProjector(projector MediaDeliveryReferenceProjector) *Admin

WithMediaDeliveryReferenceProjector replaces the item-to-delivery-reference projector.

func (*Admin) WithMediaDeliveryRegistry added in v0.62.0

func (a *Admin) WithMediaDeliveryRegistry(registry *MediaDeliveryRegistry) *Admin

WithMediaDeliveryRegistry replaces the provider delivery adapter registry.

func (*Admin) WithMediaLibrary added in v0.61.0

func (a *Admin) WithMediaLibrary(lib MediaLibrary) *Admin

WithMediaLibrary overrides the media library used by media module routes.

func (*Admin) WithModuleStartupPolicy added in v0.25.0

func (a *Admin) WithModuleStartupPolicy(policy ModuleStartupPolicy) *Admin

WithModuleStartupPolicy configures how module startup validation errors are handled.

func (*Admin) WithNavigationContributionPolicy added in v0.90.0

func (a *Admin) WithNavigationContributionPolicy(policy NavigationContributionPolicy) *Admin

func (*Admin) WithNavigationRouteMissingPolicy added in v0.90.0

func (a *Admin) WithNavigationRouteMissingPolicy(policy NavigationRouteMissingPolicy) *Admin

func (*Admin) WithOrganizationManagement

func (a *Admin) WithOrganizationManagement(repo OrganizationRepository) *Admin

WithOrganizationManagement overrides the organization repository.

func (*Admin) WithPanelTabCollisionHandler added in v0.2.0

func (a *Admin) WithPanelTabCollisionHandler(fn PanelTabCollisionHandler) *Admin

WithPanelTabCollisionHandler sets a collision handler for tab registrations.

func (*Admin) WithPanelTabPermissionEvaluator added in v0.2.0

func (a *Admin) WithPanelTabPermissionEvaluator(fn PanelTabPermissionEvaluator) *Admin

WithPanelTabPermissionEvaluator sets a custom permission evaluator for tabs.

func (*Admin) WithPreviewURLAllowedHosts added in v0.86.0

func (a *Admin) WithPreviewURLAllowedHosts(hosts ...string) *Admin

WithPreviewURLAllowedHosts replaces the external preview URL host allowlist. Relative preview paths do not require allowlisting.

func (*Admin) WithRoleAssignmentLookup added in v0.2.0

func (a *Admin) WithRoleAssignmentLookup(lookup RoleAssignmentLookup) *Admin

WithRoleAssignmentLookup sets the lookup used to validate custom role assignments.

func (*Admin) WithTenantManagement

func (a *Admin) WithTenantManagement(repo TenantRepository) *Admin

WithTenantManagement overrides the tenant repository (go-users adapters or custom stores).

func (*Admin) WithThemeManifest added in v0.24.0

func (a *Admin) WithThemeManifest(manifest *theme.Manifest) *Admin

WithThemeManifest wires the active go-theme manifest for runtime variant reconciliation and downstream UI option building.

func (*Admin) WithThemeProvider

func (a *Admin) WithThemeProvider(provider ThemeProvider) *Admin

WithThemeProvider wires a theme selector/registry to downstream renderers.

func (*Admin) WithTraitWorkflowDefaults added in v0.25.0

func (a *Admin) WithTraitWorkflowDefaults(defaults map[string]string) *Admin

WithTraitWorkflowDefaults sets default workflow IDs by panel trait.

func (*Admin) WithTranslationActorOptionProvider added in v0.113.6

func (a *Admin) WithTranslationActorOptionProvider(provider TranslationActorOptionProvider) *Admin

WithTranslationActorOptionProvider wires host-owned assignee/reviewer option lookup.

func (*Admin) WithTranslationExchangeRuntime added in v0.27.0

func (a *Admin) WithTranslationExchangeRuntime(runtime *TranslationExchangeRuntime) *Admin

WithTranslationExchangeRuntime wires the exchange job runtime used by transport bindings.

func (*Admin) WithTranslationFamilyStore added in v0.27.0

func (a *Admin) WithTranslationFamilyStore(store translationservices.FamilyStore) *Admin

WithTranslationFamilyStore wires the canonical translation family store used by family bindings.

func (*Admin) WithTranslationPolicy added in v0.24.0

func (a *Admin) WithTranslationPolicy(policy TranslationPolicy) *Admin

WithTranslationPolicy attaches a translation policy used during workflow transitions.

func (*Admin) WithTranslationSuggestionService added in v0.110.0

func (a *Admin) WithTranslationSuggestionService(service TranslationSuggestionService) *Admin

WithTranslationSuggestionService wires optional translation suggestion generation.

func (*Admin) WithTranslator

func (a *Admin) WithTranslator(t Translator) *Admin

WithTranslator wires an i18n translator for modules and UI surfaces.

func (*Admin) WithUserManagement

func (a *Admin) WithUserManagement(users UserRepository, roles RoleRepository) *Admin

WithUserManagement overrides the user and role repositories (go-users adapters or custom stores).

func (*Admin) WithWorkflow added in v0.22.0

func (a *Admin) WithWorkflow(w WorkflowEngine) *Admin

WithWorkflow attaches a workflow engine to the admin orchestrator.

func (*Admin) WithWorkflowRuntime added in v0.25.0

func (a *Admin) WithWorkflowRuntime(runtime WorkflowRuntime) *Admin

WithWorkflowRuntime wires persisted workflow definitions/bindings.

type AdminActivityEnricherConfig added in v0.22.0

type AdminActivityEnricherConfig struct {
	ActorResolver   usersactivity.ActorResolver  `json:"actor_resolver"`
	ObjectResolver  usersactivity.ObjectResolver `json:"object_resolver"`
	EnricherVersion string                       `json:"enricher_version"`
	Now             func() time.Time             `json:"now"`
}

AdminActivityEnricherConfig wires the actor/object resolvers for activity enrichment.

type AdminActorResolver added in v0.22.0

type AdminActorResolver struct {
	Users      UserRepository          `json:"users"`
	BatchUsers ActivityUserBatchReader `json:"batch_users"`
	Profiles   ProfileStore            `json:"profiles"`
}

AdminActorResolver enriches actor details using admin user sources.

func (AdminActorResolver) ResolveActors added in v0.22.0

ResolveActors resolves actor details in batch.

type AdminBlockReadService added in v0.32.0

type AdminBlockReadService interface {
	ListDefinitions(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)
	GetDefinition(ctx context.Context, id string) (map[string]any, error)
	ListBlocks(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)
	GetBlock(ctx context.Context, id string) (map[string]any, error)
}

AdminBlockReadService provides admin-shaped read operations for CMS blocks and block definitions.

func NewAdminBlockReadService added in v0.32.0

func NewAdminBlockReadService(content CMSContentService, types ...CMSContentTypeService) AdminBlockReadService

NewAdminBlockReadService builds the local admin block read-service boundary.

type AdminBlockWriteService added in v0.32.0

type AdminBlockWriteService interface {
	CreateDefinition(ctx context.Context, record map[string]any) (map[string]any, error)
	UpdateDefinition(ctx context.Context, id string, record map[string]any) (map[string]any, error)
	DeleteDefinition(ctx context.Context, id string) error
	CreateBlock(ctx context.Context, record map[string]any) (map[string]any, error)
	UpdateBlock(ctx context.Context, id string, record map[string]any) (map[string]any, error)
	DeleteBlock(ctx context.Context, id string) error
}

AdminBlockWriteService provides admin-shaped write operations for CMS blocks and block definitions.

func NewAdminBlockWriteService added in v0.32.0

func NewAdminBlockWriteService(content CMSContentService) AdminBlockWriteService

NewAdminBlockWriteService builds the local admin block write-service boundary.

type AdminChromeState added in v0.34.0

type AdminChromeState struct {
	Page                         AdminPageChrome              `json:"page"`
	Title                        string                       `json:"title,omitempty"`
	PageHeader                   AdminPageHeader              `json:"page_header"`
	BasePath                     string                       `json:"base_path,omitempty"`
	AssetBasePath                string                       `json:"asset_base_path,omitempty"`
	APIBasePath                  string                       `json:"api_base_path,omitempty"`
	BodyClasses                  string                       `json:"body_classes,omitempty"`
	Active                       string                       `json:"active,omitempty"`
	NavItems                     []any                        `json:"nav_items,omitempty"`
	NavUtilityItems              []any                        `json:"nav_utility_items,omitempty"`
	SessionUser                  map[string]any               `json:"session_user,omitempty"`
	Theme                        map[string]map[string]string `json:"theme,omitempty"`
	ExternalAssets               map[string]string            `json:"external_assets,omitempty"`
	CSRFTemplateHelpers          map[string]string            `json:"csrf_template_helpers,omitempty"`
	SidebarHideSearch            bool                         `json:"sidebar_hide_search,omitempty"`
	SidebarCollapsePlacement     SidebarCollapsePlacement     `json:"sidebar_collapse_placement,omitempty"`
	SidebarCompactFooter         bool                         `json:"sidebar_compact_footer,omitempty"`
	SidebarHidePresence          bool                         `json:"sidebar_hide_presence,omitempty"`
	SidebarHideUserMenuIndicator bool                         `json:"sidebar_hide_user_menu_indicator,omitempty"`
	TranslationCapabilities      map[string]any               `json:"translation_capabilities,omitempty"`
	UsersImportAvailable         bool                         `json:"users_import_available,omitempty"`
	UsersImportEnabled           bool                         `json:"users_import_enabled,omitempty"`
	NavDebug                     bool                         `json:"nav_debug,omitempty"`
	NavItemsJSON                 string                       `json:"nav_items_json,omitempty"`
	AdminPartials                AdminStructuralPartials      `json:"admin_partials"`
}

AdminChromeState captures host chrome metadata needed by go-admin templates.

func (AdminChromeState) Empty added in v0.34.0

func (state AdminChromeState) Empty() bool

type AdminContentReadService added in v0.32.0

type AdminContentReadService interface {
	List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)
	Get(ctx context.Context, id string) (map[string]any, error)
	ListForContentType(ctx context.Context, contentType CMSContentType, opts ListOptions) ([]map[string]any, int, error)
	GetForContentType(ctx context.Context, contentType CMSContentType, id string) (map[string]any, error)
}

AdminContentReadService provides admin-shaped read operations for CMS content.

func NewAdminContentReadService added in v0.32.0

func NewAdminContentReadService(content CMSContentService, contentTypes ...CMSContentTypeService) AdminContentReadService

NewAdminContentReadService builds the local admin content read-service boundary.

func NewAdminContentReadServiceWithEntryNavigationOptions added in v0.111.0

func NewAdminContentReadServiceWithEntryNavigationOptions(content CMSContentService, options EntryNavigationOptions, contentTypes ...CMSContentTypeService) AdminContentReadService

NewAdminContentReadServiceWithEntryNavigationOptions builds the admin read boundary using the final merged entry-navigation policy.

type AdminContentWriteService added in v0.32.0

type AdminContentWriteService interface {
	Create(ctx context.Context, record map[string]any) (map[string]any, error)
	Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)
	Delete(ctx context.Context, id string) error
	CreateTranslation(ctx context.Context, input TranslationCreateInput) (map[string]any, error)
	CreateForContentType(ctx context.Context, contentType CMSContentType, record map[string]any) (map[string]any, error)
	UpdateForContentType(ctx context.Context, contentType CMSContentType, id string, record map[string]any) (map[string]any, error)
	DeleteForContentType(ctx context.Context, contentType CMSContentType, id string) error
	CreateTranslationForContentType(ctx context.Context, contentType CMSContentType, input TranslationCreateInput) (map[string]any, error)
}

AdminContentWriteService provides admin-shaped write operations for CMS content.

func NewAdminContentWriteService added in v0.32.0

func NewAdminContentWriteService(content CMSContentService, contentTypes ...CMSContentTypeService) AdminContentWriteService

NewAdminContentWriteService builds the local admin content write-service boundary.

func NewAdminContentWriteServiceWithEntryNavigationOptions added in v0.111.0

func NewAdminContentWriteServiceWithEntryNavigationOptions(content CMSContentService, options EntryNavigationOptions, contentTypes ...CMSContentTypeService) AdminContentWriteService

NewAdminContentWriteServiceWithEntryNavigationOptions builds the admin write boundary using the final merged entry-navigation policy.

type AdminContext

type AdminContext struct {
	Context         context.Context `json:"context"`
	UserID          string          `json:"user_id"`
	TenantID        string          `json:"tenant_id"`
	OrgID           string          `json:"org_id"`
	Channel         string          `json:"channel"`
	Environment     string          `json:"environment"`
	Locale          string          `json:"locale"`
	FallbackLocales []string        `json:"fallback_locales,omitempty"`
	Theme           *ThemeSelection `json:"theme"`
	Translator      Translator      `json:"translator"`
}

AdminContext carries request-scoped information into panel operations.

type AdminDashboardPage added in v0.34.0

type AdminDashboardPage struct {
	Dashboard dashcmp.Page     `json:"dashboard"`
	Chrome    AdminChromeState `json:"chrome"`
}

AdminDashboardPage is the route/template-edge wrapper around the canonical typed go-dashboard page.

func ComposeAdminDashboardPage added in v0.34.0

func ComposeAdminDashboardPage(page dashcmp.Page) AdminDashboardPage

ComposeAdminDashboardPage rebuilds the typed admin route wrapper from the raw go-dashboard page. Route/page decoration stores host chrome in page metadata so renderers can reconstruct it without reintroducing payload-map mutation.

func (AdminDashboardPage) LayoutJSON added in v0.34.0

func (page AdminDashboardPage) LayoutJSON() string

LayoutJSON derives the dashboard state JSON from the canonical typed page.

func (AdminDashboardPage) PageChrome added in v0.132.0

func (page AdminDashboardPage) PageChrome() AdminPageChrome

PageChrome returns the normalized presentation projection used by dashboard templates. The typed page wins, followed by compatibility page-header/title fields, the go-dashboard page title, and finally the Dashboard default.

func (AdminDashboardPage) Title added in v0.34.0

func (page AdminDashboardPage) Title() string

Title returns the preferred page title after host composition.

type AdminMenuBindingRecord added in v0.26.0

type AdminMenuBindingRecord struct {
	ID              string     `json:"id"`
	Location        string     `json:"location"`
	MenuCode        string     `json:"menu_code"`
	ViewProfileCode string     `json:"view_profile_code,omitempty"`
	Locale          string     `json:"locale,omitempty"`
	Priority        int        `json:"priority"`
	Status          string     `json:"status"`
	CreatedAt       time.Time  `json:"created_at"`
	UpdatedAt       time.Time  `json:"updated_at"`
	PublishedAt     *time.Time `json:"published_at,omitempty"`
}

AdminMenuBindingRecord describes a menu location binding record.

type AdminMenuContracts added in v0.26.0

type AdminMenuContracts struct {
	Endpoints         map[string]string `json:"endpoints"`
	ErrorCode         map[string]string `json:"error_codes"`
	ContentNavigation map[string]any    `json:"content_navigation,omitempty"`
}

AdminMenuContracts exposes endpoint metadata and machine-readable menu error mapping.

type AdminMenuPreviewSimulation added in v0.26.0

type AdminMenuPreviewSimulation struct {
	RequestedID         string                      `json:"requested_id"`
	Location            string                      `json:"location,omitempty"`
	Locale              string                      `json:"locale,omitempty"`
	ViewProfile         string                      `json:"view_profile,omitempty"`
	IncludeDrafts       bool                        `json:"include_drafts"`
	PreviewTokenPresent bool                        `json:"preview_token_present"`
	Binding             *AdminMenuBindingRecord     `json:"binding,omitempty"`
	Profile             *AdminMenuViewProfileRecord `json:"profile,omitempty"`
}

AdminMenuPreviewSimulation captures preview-specific location/profile context.

type AdminMenuRecord added in v0.26.0

type AdminMenuRecord struct {
	ID          string     `json:"id"`
	Code        string     `json:"code"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Status      string     `json:"status"`
	Locale      string     `json:"locale,omitempty"`
	FamilyID    string     `json:"family_id,omitempty"`
	Archived    bool       `json:"archived,omitempty"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	PublishedAt *time.Time `json:"published_at,omitempty"`
	ArchivedAt  *time.Time `json:"archived_at,omitempty"`
}

AdminMenuRecord is the normalized menu contract used by admin menu builder APIs.

type AdminMenuViewProfileRecord added in v0.26.0

type AdminMenuViewProfileRecord struct {
	Code           string     `json:"code"`
	Name           string     `json:"name"`
	Mode           string     `json:"mode"`
	MaxTopLevel    *int       `json:"max_top_level,omitempty"`
	MaxDepth       *int       `json:"max_depth,omitempty"`
	IncludeItemIDs []string   `json:"include_item_ids,omitempty"`
	ExcludeItemIDs []string   `json:"exclude_item_ids,omitempty"`
	Status         string     `json:"status"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	PublishedAt    *time.Time `json:"published_at,omitempty"`
}

AdminMenuViewProfileRecord describes a menu projection profile record.

type AdminObjectResolverConfig added in v0.22.0

type AdminObjectResolverConfig struct {
	Users         UserRepository               `json:"users"`
	Roles         RoleRepository               `json:"roles"`
	Tenants       TenantRepository             `json:"tenants"`
	Organizations OrganizationRepository       `json:"organizations"`
	Profiles      ProfileStore                 `json:"profiles"`
	Settings      *SettingsService             `json:"settings"`
	Jobs          *JobRegistry                 `json:"jobs"`
	Widgets       CMSWidgetService             `json:"widgets"`
	Menus         CMSMenuService               `json:"menus"`
	Content       CMSContentService            `json:"content"`
	Fallback      usersactivity.ObjectResolver `json:"fallback"`
}

AdminObjectResolverConfig wires admin object resolvers.

type AdminPageChrome added in v0.132.0

type AdminPageChrome struct {
	Header      AdminPageHeader `json:"header"`
	Active      string          `json:"active,omitempty"`
	BodyClasses string          `json:"body_classes,omitempty"`
}

AdminPageChrome is the presentation-only page contract used by authenticated route authors. Request/session/theme state is added by the layout enrichment boundary, while arbitrary action markup remains template-owned.

func (AdminPageChrome) Clone added in v0.132.0

func (chrome AdminPageChrome) Clone() AdminPageChrome

Clone returns an independent page-chrome value suitable for request storage.

func (AdminPageChrome) Empty added in v0.132.0

func (chrome AdminPageChrome) Empty() bool

Empty reports whether no page presentation has been supplied.

func (AdminPageChrome) TemplateContext added in v0.132.0

func (chrome AdminPageChrome) TemplateContext() map[string]any

TemplateContext returns the lowercase, presentation-only projection consumed by authenticated templates. Values are cloned and hook identifiers are normalized once so normal and dashboard renderers share identical behavior.

type AdminPageGetOptions added in v0.24.0

type AdminPageGetOptions struct {
	Locale                   string `json:"locale"`
	FallbackLocale           string `json:"fallback_locale"`
	AllowMissingTranslations bool   `json:"allow_missing_translations"`
	IncludeContent           bool   `json:"include_content"`
	IncludeBlocks            bool   `json:"include_blocks"`
	IncludeData              bool   `json:"include_data"`
	EnvironmentKey           string `json:"environment_key"`
}

AdminPageGetOptions configures admin page detail reads.

type AdminPageHeader added in v0.131.10

type AdminPageHeader struct {
	Title           string                      `json:"title,omitempty"`
	Pretitle        string                      `json:"pretitle,omitempty"`
	Subtitle        string                      `json:"subtitle,omitempty"`
	Breadcrumbs     []AdminPageHeaderBreadcrumb `json:"breadcrumbs,omitempty"`
	HideHeader      bool                        `json:"hide_header,omitempty"`
	HideBreadcrumbs bool                        `json:"hide_breadcrumbs,omitempty"`
	Hooks           map[string]string           `json:"hooks,omitempty"`
}

AdminPageHeader is the presentation-only model for handlers that need a typed page-header boundary. Action markup remains template-owned.

type AdminPageHeaderBreadcrumb added in v0.131.10

type AdminPageHeaderBreadcrumb struct {
	Label   string `json:"label"`
	Href    string `json:"href,omitempty"`
	Current bool   `json:"current,omitempty"`
}

AdminPageHeaderBreadcrumb is already-resolved breadcrumb presentation data.

type AdminPageListOptions added in v0.24.0

type AdminPageListOptions struct {
	Locale                    string         `json:"locale"`
	FallbackLocale            string         `json:"fallback_locale"`
	AllowMissingTranslations  bool           `json:"allow_missing_translations"`
	ExpandTranslationFamilies bool           `json:"expand_translation_families"`
	IncludeContent            bool           `json:"include_content"`
	IncludeBlocks             bool           `json:"include_blocks"`
	IncludeData               bool           `json:"include_data"`
	EnvironmentKey            string         `json:"environment_key"`
	Page                      int            `json:"page"`
	PerPage                   int            `json:"per_page"`
	SortBy                    string         `json:"sort_by"`
	SortDesc                  bool           `json:"sort_desc"`
	Search                    string         `json:"search"`
	Filters                   map[string]any `json:"filters"`
}

AdminPageListOptions configures admin page list reads.

type AdminPageReadService added in v0.24.0

type AdminPageReadService interface {
	List(ctx context.Context, opts AdminPageListOptions) ([]AdminPageRecord, int, error)
	Get(ctx context.Context, id string, opts AdminPageGetOptions) (*AdminPageRecord, error)
}

AdminPageReadService provides list/detail admin read operations.

func NewGoCMSAdminPageReadAdapter added in v0.24.0

func NewGoCMSAdminPageReadAdapter(service cms.AdminPageReadService) AdminPageReadService

NewGoCMSAdminPageReadAdapter wraps a go-cms admin read service.

func NewGoCMSAdminPageReadAdapterWithContent added in v0.43.0

func NewGoCMSAdminPageReadAdapterWithContent(service cms.AdminPageReadService, content CMSContentService) AdminPageReadService

NewGoCMSAdminPageReadAdapterWithContent wraps a go-cms admin read service and optional CMS content service. When sibling-expanded translation families are requested, the content service is used to emit one page record per locale sibling.

type AdminPageRecord added in v0.24.0

type AdminPageRecord struct {
	ID                 string                                `json:"id"`
	ContentID          string                                `json:"content_id"`
	FamilyID           string                                `json:"family_id"`
	RouteKey           string                                `json:"route_key"`
	TemplateID         string                                `json:"template_id"`
	Title              string                                `json:"title"`
	Slug               string                                `json:"slug"`
	Path               string                                `json:"path"`
	RequestedLocale    string                                `json:"requested_locale"`
	ResolvedLocale     string                                `json:"resolved_locale"`
	Translation        TranslationBundle[PageTranslation]    `json:"translation"`
	ContentTranslation TranslationBundle[ContentTranslation] `json:"content_translation"`
	Status             string                                `json:"status"`
	ParentID           string                                `json:"parent_id"`
	MetaTitle          string                                `json:"meta_title"`
	MetaDescription    string                                `json:"meta_description"`
	Summary            *string                               `json:"summary"`
	Tags               []string                              `json:"tags"`
	SchemaVersion      string                                `json:"schema_version"`
	Data               map[string]any                        `json:"data"`
	Content            any                                   `json:"content"`
	Blocks             any                                   `json:"blocks"`
	PreviewURL         string                                `json:"preview_url"`
	PublishedAt        *time.Time                            `json:"published_at"`
	CreatedAt          *time.Time                            `json:"created_at"`
	UpdatedAt          *time.Time                            `json:"updated_at"`
}

AdminPageRecord mirrors the admin read model contract for page data.

type AdminPageWriteService added in v0.24.0

type AdminPageWriteService interface {
	Create(ctx context.Context, payload map[string]any) (*AdminPageRecord, error)
	Update(ctx context.Context, id string, payload map[string]any) (*AdminPageRecord, error)
	Delete(ctx context.Context, id string) error
	Publish(ctx context.Context, id string, payload map[string]any) (*AdminPageRecord, error)
	Unpublish(ctx context.Context, id string, payload map[string]any) (*AdminPageRecord, error)
}

AdminPageWriteService provides admin write operations for pages.

type AdminRouter

type AdminRouter interface {
	Handle(method router.HTTPMethod, path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
	Get(path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
	Post(path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
	Put(path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
	Delete(path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
	Patch(path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
	Head(path string, handler router.HandlerFunc, mw ...router.MiddlewareFunc) router.RouteInfo
}

AdminRouter exposes an expressive routing surface used by admin and quickstart.

type AdminStaticRouter added in v0.84.0

type AdminStaticRouter[T any] interface {
	AdminRouter
	Static(prefix, root string, config ...router.Static) router.Router[T]
}

AdminStaticRouter extends AdminRouter with typed static asset registration.

type AdminStructuralDiagnosticSink added in v0.131.10

type AdminStructuralDiagnosticSink interface {
	RecordAdminStructuralPartialDiagnostics(context.Context, []AdminStructuralPartialDiagnostic)
}

AdminStructuralDiagnosticSink receives the same bounded records projected to the view context.

type AdminStructuralDiagnosticSinkFunc added in v0.131.10

type AdminStructuralDiagnosticSinkFunc func(context.Context, []AdminStructuralPartialDiagnostic)

AdminStructuralDiagnosticSinkFunc adapts a function to the optional sink.

func (AdminStructuralDiagnosticSinkFunc) RecordAdminStructuralPartialDiagnostics added in v0.131.10

func (fn AdminStructuralDiagnosticSinkFunc) RecordAdminStructuralPartialDiagnostics(ctx context.Context, diagnostics []AdminStructuralPartialDiagnostic)

type AdminStructuralPartialDiagnostic added in v0.131.10

type AdminStructuralPartialDiagnostic struct {
	Key                  string `json:"key"`
	ReasonCode           string `json:"reason_code"`
	CandidateFingerprint string `json:"candidate_fingerprint"`
	CandidateBasename    string `json:"candidate_basename,omitempty"`
}

AdminStructuralPartialDiagnostic is safe to project into a debug/view context. Candidate values are represented only by a bounded basename and a stable fingerprint.

type AdminStructuralPartials added in v0.131.10

type AdminStructuralPartials struct {
	Sidebar     string                             `json:"sidebar"`
	Breadcrumbs string                             `json:"breadcrumbs"`
	Footer      string                             `json:"footer"`
	Diagnostics []AdminStructuralPartialDiagnostic `json:"diagnostics,omitempty"`
}

AdminStructuralPartials is the immutable request-scoped structural selection shared by ordinary views and dashboard chrome.

func DefaultAdminStructuralPartials added in v0.131.10

func DefaultAdminStructuralPartials() AdminStructuralPartials

DefaultAdminStructuralPartials returns a fresh packaged-default selection.

func (AdminStructuralPartials) Clone added in v0.131.10

Clone returns an independent selection suitable for request/view storage.

func (AdminStructuralPartials) TemplateContext added in v0.131.10

func (selection AdminStructuralPartials) TemplateContext() map[string]any

TemplateContext returns the serialized, lowercase view contract consumed by Pongo templates. Using the JSON-shaped map here keeps direct view rendering and router-serialized rendering identical.

type AdminTemplateLookup added in v0.131.10

type AdminTemplateLookup interface {
	TemplateExists(identifier string) bool
}

AdminTemplateLookup reports whether an identifier is present in the exact registered admin view stack. Implementations must not interpret URLs.

type AdminTemplateLookupFunc added in v0.131.10

type AdminTemplateLookupFunc func(identifier string) bool

AdminTemplateLookupFunc adapts a function to AdminTemplateLookup.

func (AdminTemplateLookupFunc) TemplateExists added in v0.131.10

func (fn AdminTemplateLookupFunc) TemplateExists(identifier string) bool

type AssignmentStatus added in v0.25.0

type AssignmentStatus string

AssignmentStatus captures the translation queue lifecycle.

const (
	AssignmentStatusOpen             AssignmentStatus = "open"
	AssignmentStatusAssigned         AssignmentStatus = "assigned"
	AssignmentStatusInProgress       AssignmentStatus = "in_progress"
	AssignmentStatusInReview         AssignmentStatus = "in_review"
	AssignmentStatusChangesRequested AssignmentStatus = "changes_requested"
	AssignmentStatusApproved         AssignmentStatus = "approved"
	AssignmentStatusArchived         AssignmentStatus = "archived"

	// Deprecated legacy aliases kept so older fixtures and persisted values can
	// be normalized to the canonical translation vocabulary.
	AssignmentStatusPending   AssignmentStatus = AssignmentStatusOpen
	AssignmentStatusReview    AssignmentStatus = AssignmentStatusInReview
	AssignmentStatusRejected  AssignmentStatus = AssignmentStatusChangesRequested
	AssignmentStatusPublished AssignmentStatus = "published"
)

func (AssignmentStatus) IsActive added in v0.27.0

func (s AssignmentStatus) IsActive() bool

func (AssignmentStatus) IsTerminal added in v0.25.0

func (s AssignmentStatus) IsTerminal() bool

func (AssignmentStatus) IsValid added in v0.25.0

func (s AssignmentStatus) IsValid() bool

type AssignmentType added in v0.25.0

type AssignmentType string

AssignmentType controls how an assignment is picked up.

const (
	AssignmentTypeDirect   AssignmentType = "assigned"
	AssignmentTypeOpenPool AssignmentType = "open_pool"
)

func (AssignmentType) IsValid added in v0.25.0

func (t AssignmentType) IsValid() bool

type AuthConfig

type AuthConfig struct {
	LoginPath    string `json:"login_path"`
	LogoutPath   string `json:"logout_path"`
	RedirectPath string `json:"redirect_path"`
	// AllowUnauthenticatedRoutes explicitly opts out of the default admin
	// route-auth requirement. Leave false to require an authenticator before
	// Initialize mounts the protected admin surface.
	AllowUnauthenticatedRoutes bool `json:"allow_unauthenticated_routes,omitempty"`
}

AuthConfig captures login/logout endpoints and redirect defaults.

type AuthenticatedRequestIdentity added in v0.27.0

type AuthenticatedRequestIdentity struct {
	ActorID       string `json:"actor_id"`
	Subject       string `json:"subject"`
	TenantID      string `json:"tenant_id"`
	OrgID         string `json:"org_id"`
	RequestID     string `json:"request_id"`
	CorrelationID string `json:"correlation_id"`
	TraceID       string `json:"trace_id"`
}

AuthenticatedRequestIdentity captures trusted actor, scope, and trace fields resolved from authenticated admin request context.

func ResolveAuthenticatedRequestIdentity added in v0.27.0

func ResolveAuthenticatedRequestIdentity(c router.Context, defaults AuthenticatedRequestScopeDefaults) AuthenticatedRequestIdentity

ResolveAuthenticatedRequestIdentity returns trusted actor, scope, and trace metadata without consulting browser-supplied user/tenant/org parameters.

type AuthenticatedRequestScopeDefaults added in v0.27.0

type AuthenticatedRequestScopeDefaults struct {
	TenantID string `json:"tenant_id"`
	OrgID    string `json:"org_id"`
	Enabled  bool   `json:"enabled"`
}

AuthenticatedRequestScopeDefaults captures single-tenant scope defaults for consumers that resolve scope strictly from authenticated request context.

type Authenticator

type Authenticator interface {
	Wrap(ctx router.Context) error
}

Authenticator wraps HTTP handlers with auth checks.

type Authorizer

type Authorizer interface {
	Can(ctx context.Context, action string, resource string) bool
}

Authorizer determines whether a subject can perform an action on a resource.

type AutosaveConflictError added in v0.25.0

type AutosaveConflictError struct {
	Panel             string         `json:"panel"`
	EntityID          string         `json:"entity_id"`
	Version           string         `json:"version"`
	ExpectedVersion   string         `json:"expected_version"`
	LatestStatePath   string         `json:"latest_state_path"`
	LatestServerState map[string]any `json:"latest_server_state"`
}

AutosaveConflictError captures the typed autosave conflict contract returned to clients.

func (AutosaveConflictError) Error added in v0.25.0

func (e AutosaveConflictError) Error() string

func (AutosaveConflictError) Unwrap added in v0.25.0

func (e AutosaveConflictError) Unwrap() error

type BatchActionStateResolver added in v0.27.0

type BatchActionStateResolver func(
	ctx AdminContext,
	records []map[string]any,
	actions []Action,
	scope ActionScope,
) (map[string]map[string]ActionState, error)

BatchActionStateResolver evaluates action availability for a record batch. The first key in the result map is the canonical record ID, the second key is the action name.

type BatchAuthorizer added in v0.25.0

type BatchAuthorizer interface {
	Authorizer
	CanAny(ctx context.Context, resource string, permissions ...string) bool
	CanAll(ctx context.Context, resource string, permissions ...string) bool
}

BatchAuthorizer allows evaluating multiple permissions in one call.

type BrowserCSRFProtector added in v0.32.0

type BrowserCSRFProtector interface {
	UsesBrowserSession(c router.Context) bool
	EnforceBrowserCSRF(c router.Context) error
}

BrowserCSRFProtector exposes browser-session detection and CSRF enforcement for mutating routes that need browser-grade CSRF semantics without depending on a specific authenticator implementation.

type BulkActionStateConfig added in v0.27.0

type BulkActionStateConfig struct {
	SelectionSensitive     bool   `json:"selection_sensitive,omitempty"`
	SelectionStateEndpoint string `json:"selection_state_endpoint,omitempty"`
	DebounceMS             int    `json:"debounce_ms,omitempty"`
}

BulkActionStateConfig advertises bulk action availability capabilities to shared clients.

type BulkActionStateResolver added in v0.27.0

type BulkActionStateResolver func(
	ctx AdminContext,
	actions []Action,
	listOpts ListOptions,
) (map[string]ActionState, error)

BulkActionStateResolver evaluates availability for list-level bulk actions.

type BulkCommand

type BulkCommand struct {
	Service BulkService `json:"service"`
}

BulkCommand triggers a bulk job via the command bus.

func (*BulkCommand) CLIHandler added in v0.12.0

func (c *BulkCommand) CLIHandler() any

func (*BulkCommand) CLIOptions

func (c *BulkCommand) CLIOptions() command.CLIConfig

func (*BulkCommand) Execute

func (c *BulkCommand) Execute(ctx context.Context, msg BulkStartMsg) error

type BulkConfig

type BulkConfig struct {
	Endpoint         string `json:"endpoint"`
	SupportsRollback bool   `json:"supports_rollback,omitempty"`
}

BulkConfig captures bulk endpoint metadata and capabilities.

type BulkJob

type BulkJob struct {
	ID                string         `json:"id"`
	Name              string         `json:"name"`
	Action            string         `json:"action,omitempty"`
	Status            string         `json:"status"`
	Total             int            `json:"total"`
	Processed         int            `json:"processed"`
	Progress          float64        `json:"progress,omitempty"`
	Payload           map[string]any `json:"payload,omitempty"`
	Errors            []string       `json:"errors,omitempty"`
	StartedAt         time.Time      `json:"started_at"`
	CompletedAt       time.Time      `json:"completed_at"`
	RollbackAvailable bool           `json:"rollback_available,omitempty"`
}

BulkJob captures bulk job state for UI/progress.

type BulkRequest

type BulkRequest struct {
	Name   string `json:"name"`
	Action string `json:"action"`
	Total  int    `json:"total"`
	// Payload carries optional job metadata for downstream processors.
	Payload map[string]any `json:"payload"`
}

BulkRequest describes a requested bulk job.

type BulkRoleChangeRequest added in v0.25.0

type BulkRoleChangeRequest struct {
	UserIDs []string `json:"user_ids"`
	RoleID  string   `json:"role_id"`
	Assign  bool     `json:"assign"`
	Replace bool     `json:"replace"`
}

BulkRoleChangeRequest captures inputs for bulk role assignment operations.

type BulkRoleChangeResponse added in v0.25.0

type BulkRoleChangeResponse struct {
	Summary BulkRoleChangeSummary  `json:"summary"`
	Results []BulkRoleChangeResult `json:"results"`
	RoleID  string                 `json:"role_id"`
	Action  string                 `json:"action"`
	Replace bool                   `json:"replace"`
}

BulkRoleChangeResponse is the public API contract returned by bulk role endpoints.

type BulkRoleChangeResult added in v0.25.0

type BulkRoleChangeResult struct {
	UserID string `json:"user_id"`
	Status string `json:"status"`
	Error  string `json:"error,omitempty"`
}

BulkRoleChangeResult captures per-user execution details for bulk role changes.

type BulkRoleChangeSummary added in v0.25.0

type BulkRoleChangeSummary struct {
	Processed int `json:"processed"`
	Succeeded int `json:"succeeded"`
	Failed    int `json:"failed"`
	Skipped   int `json:"skipped"`
}

BulkRoleChangeSummary aggregates per-user execution status for bulk role changes.

type BulkRollbacker

type BulkRollbacker interface {
	Rollback(ctx context.Context, id string) (BulkJob, error)
}

BulkRollbacker optionally supports rollback operations.

type BulkService

type BulkService interface {
	Start(ctx context.Context, req BulkRequest) (BulkJob, error)
	List(ctx context.Context) []BulkJob
}

BulkService manages bulk jobs.

type BulkStartMsg added in v0.12.0

type BulkStartMsg struct {
	Name    string         `json:"name"`
	Action  string         `json:"action"`
	Total   int            `json:"total"`
	Payload map[string]any `json:"payload"`
}

BulkStartMsg triggers a bulk job.

func (BulkStartMsg) Type added in v0.12.0

func (BulkStartMsg) Type() string

func (BulkStartMsg) Validate added in v0.12.0

func (m BulkStartMsg) Validate() error

type BunRecordMapper

type BunRecordMapper[T any] struct {
	ToRecord func(map[string]any) (T, error) `json:"to_record"`
	ToMap    func(T) (map[string]any, error) `json:"to_map"`
}

BunRecordMapper converts between map payloads and repository models.

type BunRepositoryAdapter

type BunRepositoryAdapter[T any] struct {
	// contains filtered or unexported fields
}

BunRepositoryAdapter wraps a go-repository-bun Repository to satisfy the admin Repository interface.

func NewBunRepositoryAdapter

func NewBunRepositoryAdapter[T any](repo repository.Repository[T], opts ...BunRepositoryOption[T]) *BunRepositoryAdapter[T]

NewBunRepositoryAdapter constructs an adapter around a go-repository-bun Repository.

func (*BunRepositoryAdapter[T]) Create

func (a *BunRepositoryAdapter[T]) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts a new record.

func (*BunRepositoryAdapter[T]) Delete

func (a *BunRepositoryAdapter[T]) Delete(ctx context.Context, id string) error

Delete removes a record by id.

func (*BunRepositoryAdapter[T]) Get

func (a *BunRepositoryAdapter[T]) Get(ctx context.Context, id string) (map[string]any, error)

Get retrieves a single record by id.

func (*BunRepositoryAdapter[T]) List

func (a *BunRepositoryAdapter[T]) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List delegates to the underlying repository with translated pagination/sort/filter/search.

func (*BunRepositoryAdapter[T]) Update

func (a *BunRepositoryAdapter[T]) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies an existing record by id.

type BunRepositoryOption

type BunRepositoryOption[T any] func(*BunRepositoryAdapter[T])

BunRepositoryOption configures the BunRepositoryAdapter.

func WithBunBaseCriteria

func WithBunBaseCriteria[T any](criteria ...repository.SelectCriteria) BunRepositoryOption[T]

WithBunBaseCriteria applies select criteria to every list/get call.

func WithBunDeleteCriteria

func WithBunDeleteCriteria[T any](criteria ...repository.DeleteCriteria) BunRepositoryOption[T]

WithBunDeleteCriteria applies delete criteria to every delete call.

func WithBunFilterMapping

func WithBunFilterMapping[T any](builders map[string]func(any) repository.SelectCriteria) BunRepositoryOption[T]

WithBunFilterMapping configures per-field filter builders (fallback is equality).

func WithBunPatchAllowedFields added in v0.24.0

func WithBunPatchAllowedFields[T any](fields ...string) BunRepositoryOption[T]

WithBunPatchAllowedFields restricts update patch payloads to a known allowlist.

func WithBunRecordMapper

func WithBunRecordMapper[T any](mapper BunRecordMapper[T]) BunRepositoryOption[T]

WithBunRecordMapper overrides the default map-native mapper.

func WithBunSearchColumns

func WithBunSearchColumns[T any](columns ...string) BunRepositoryOption[T]

WithBunSearchColumns configures case-insensitive LIKE queries for the provided columns.

func WithBunUpdateCriteria

func WithBunUpdateCriteria[T any](criteria ...repository.UpdateCriteria) BunRepositoryOption[T]

WithBunUpdateCriteria applies update criteria to every update call.

type BunSettingsAdapter

type BunSettingsAdapter struct {
	// contains filtered or unexported fields
}

BunSettingsAdapter persists settings using go-repository-bun and resolves values through go-options to preserve provenance and validation surface.

func NewBunSettingsAdapter

func NewBunSettingsAdapter(db *bun.DB, repoOptions ...repository.Option) (*BunSettingsAdapter, error)

func NewBunSettingsAdapterWithConfig added in v0.140.0

func NewBunSettingsAdapterWithConfig(db *bun.DB, config BunSettingsAdapterConfig, repoOptions ...repository.Option) (*BunSettingsAdapter, error)

func (*BunSettingsAdapter) Apply

func (a *BunSettingsAdapter) Apply(ctx context.Context, bundle SettingsBundle) error

Apply validates and persists scoped settings.

func (*BunSettingsAdapter) ApplyDocument added in v0.140.0

func (*BunSettingsAdapter) ApplyDocumentTx added in v0.140.0

func (*BunSettingsAdapter) Definitions

func (a *BunSettingsAdapter) Definitions() []SettingDefinition

Definitions returns sorted definitions.

func (*BunSettingsAdapter) ReadDocument added in v0.140.0

func (*BunSettingsAdapter) ReadDocumentWithDB added in v0.140.0

func (*BunSettingsAdapter) RegisterDefinition

func (a *BunSettingsAdapter) RegisterDefinition(def SettingDefinition)

RegisterDefinition records a setting definition.

func (*BunSettingsAdapter) Resolve

func (a *BunSettingsAdapter) Resolve(key, userID string) ResolvedSetting

Resolve returns a setting value with provenance.

func (*BunSettingsAdapter) ResolveAll

func (a *BunSettingsAdapter) ResolveAll(userID string) map[string]ResolvedSetting

ResolveAll retains the legacy error-suppressing contract. Durable callers should use ResolveAllContext or named document snapshots.

func (*BunSettingsAdapter) ResolveAllContext added in v0.140.0

func (a *BunSettingsAdapter) ResolveAllContext(ctx context.Context, userID string) (map[string]ResolvedSetting, error)

func (*BunSettingsAdapter) ResolveContext added in v0.140.0

func (a *BunSettingsAdapter) ResolveContext(ctx context.Context, key, userID string) (ResolvedSetting, error)

func (*BunSettingsAdapter) Schema

func (a *BunSettingsAdapter) Schema(ctx context.Context, userID string) (opts.SchemaDocument, error)

Schema returns the go-options schema document for UI renderers.

func (*BunSettingsAdapter) WithSchemaOptions

func (a *BunSettingsAdapter) WithSchemaOptions(options ...opts.Option)

WithSchemaOptions appends schema merge options used during resolution.

type BunSettingsAdapterConfig added in v0.140.0

type BunSettingsAdapterConfig struct {
	SkipSchemaEnsure bool
	DocumentMaxBytes int
}

BunSettingsAdapterConfig controls legacy startup DDL and document size bounds. Named document schema is always explicitly installed by the host.

type BunTranslationAssignmentRepository added in v0.27.0

type BunTranslationAssignmentRepository struct {
	// contains filtered or unexported fields
}

func NewBunTranslationAssignmentRepository added in v0.27.0

func NewBunTranslationAssignmentRepository(db *bun.DB) *BunTranslationAssignmentRepository

func (*BunTranslationAssignmentRepository) AssignmentDashboardSummary added in v0.80.0

func (*BunTranslationAssignmentRepository) AssignmentMyWorkSummary added in v0.80.0

func (*BunTranslationAssignmentRepository) AssignmentQueueSummary added in v0.80.0

func (*BunTranslationAssignmentRepository) AssignmentReviewerAggregateCounts added in v0.80.0

func (*BunTranslationAssignmentRepository) AssignmentReviewerAggregateSummary added in v0.91.0

func (*BunTranslationAssignmentRepository) Create added in v0.27.0

func (*BunTranslationAssignmentRepository) CreateOrReuseActive added in v0.27.0

func (*BunTranslationAssignmentRepository) DistinctAssignmentEntityTypes added in v0.100.0

func (r *BunTranslationAssignmentRepository) DistinctAssignmentEntityTypes(ctx context.Context) ([]string, error)

func (*BunTranslationAssignmentRepository) DistinctAssignmentLocales added in v0.100.0

func (r *BunTranslationAssignmentRepository) DistinctAssignmentLocales(ctx context.Context, filters map[string]any) ([]string, error)

func (*BunTranslationAssignmentRepository) DistinctAssignmentTranslationGroups added in v0.100.0

func (r *BunTranslationAssignmentRepository) DistinctAssignmentTranslationGroups(ctx context.Context, filters map[string]any) ([]TranslationAssignmentGroupOption, error)

func (*BunTranslationAssignmentRepository) Get added in v0.27.0

func (*BunTranslationAssignmentRepository) List added in v0.27.0

func (*BunTranslationAssignmentRepository) ListAssignmentFamilyGroups added in v0.82.1

func (*BunTranslationAssignmentRepository) ListAssignmentFamilyOptions added in v0.113.5

func (*BunTranslationAssignmentRepository) ListAssignmentPage added in v0.80.0

func (*BunTranslationAssignmentRepository) ListAssignmentSnapshot added in v0.82.1

func (*BunTranslationAssignmentRepository) ListFamilyAssignments added in v0.82.1

func (*BunTranslationAssignmentRepository) Update added in v0.27.0

type BunTranslationExchangeRuntimeStore added in v0.27.0

type BunTranslationExchangeRuntimeStore struct {
	// contains filtered or unexported fields
}

func NewBunTranslationExchangeRuntimeStore added in v0.27.0

func NewBunTranslationExchangeRuntimeStore(db *bun.DB) *BunTranslationExchangeRuntimeStore

func (*BunTranslationExchangeRuntimeStore) ClaimJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) ClaimJob(ctx context.Context, jobID, workerID string, now, leaseUntil time.Time) (translationExchangeAsyncJob, bool, error)

func (*BunTranslationExchangeRuntimeStore) CommitApplyRecord added in v0.132.1

func (s *BunTranslationExchangeRuntimeStore) CommitApplyRecord(ctx context.Context, reservation translationExchangeApplyReservation, record translationExchangeAppliedRecord) (translationExchangeAppliedRecord, error)

func (*BunTranslationExchangeRuntimeStore) CompleteJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) CompleteJob(ctx context.Context, jobID, workerID string, progress, result, retention map[string]any, now time.Time) (translationExchangeAsyncJob, error)

func (*BunTranslationExchangeRuntimeStore) CreateJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) CreateJob(ctx context.Context, job translationExchangeAsyncJob) (translationExchangeAsyncJob, error)

func (*BunTranslationExchangeRuntimeStore) CreateOrGetApplyJob added in v0.132.1

func (s *BunTranslationExchangeRuntimeStore) CreateOrGetApplyJob(ctx context.Context, identity translationTransportIdentity, job translationExchangeAsyncJob, rows []TranslationExchangeRow) (translationExchangeAsyncJob, bool, error)

func (*BunTranslationExchangeRuntimeStore) DeleteJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) DeleteJob(ctx context.Context, identity translationTransportIdentity, id string) (translationExchangeAsyncJob, bool, error)

func (*BunTranslationExchangeRuntimeStore) FailJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) FailJob(ctx context.Context, jobID, workerID string, progress map[string]any, failure error, now time.Time) (translationExchangeAsyncJob, error)

func (*BunTranslationExchangeRuntimeStore) FindJobByRequestHash added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) FindJobByRequestHash(ctx context.Context, kind string, identity translationTransportIdentity, requestHash string) (translationExchangeAsyncJob, bool, error)

func (*BunTranslationExchangeRuntimeStore) GetJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) GetJob(ctx context.Context, identity translationTransportIdentity, id string) (translationExchangeAsyncJob, bool, error)

func (*BunTranslationExchangeRuntimeStore) HeartbeatJob added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) HeartbeatJob(ctx context.Context, jobID, workerID string, progress map[string]any, now, leaseUntil time.Time) error

func (*BunTranslationExchangeRuntimeStore) ListJobRows added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) ListJobRows(ctx context.Context, jobID string) ([]translationExchangeStoredRow, error)

func (*BunTranslationExchangeRuntimeStore) ListJobs added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) ListJobs(ctx context.Context, query translationExchangeJobQuery) ([]translationExchangeAsyncJob, int, error)

func (*BunTranslationExchangeRuntimeStore) ListRecoverableJobs added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) ListRecoverableJobs(ctx context.Context, now time.Time, limit int) ([]translationExchangeAsyncJob, error)

func (*BunTranslationExchangeRuntimeStore) LookupApplyRecord added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) LookupApplyRecord(ctx context.Context, identity translationTransportIdentity, linkageKey, payloadHash string) (translationExchangeAppliedRecord, bool, error)

func (*BunTranslationExchangeRuntimeStore) RecordApplyRecord added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) RecordApplyRecord(ctx context.Context, identity translationTransportIdentity, record translationExchangeAppliedRecord) (translationExchangeAppliedRecord, bool, error)

func (*BunTranslationExchangeRuntimeStore) ReleaseApplyRecord added in v0.132.1

func (s *BunTranslationExchangeRuntimeStore) ReleaseApplyRecord(ctx context.Context, reservation translationExchangeApplyReservation) error

func (*BunTranslationExchangeRuntimeStore) ReplaceJobArtifacts added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) ReplaceJobArtifacts(ctx context.Context, job translationExchangeAsyncJob, artifacts []translationExchangeJobArtifact) error

func (*BunTranslationExchangeRuntimeStore) ReserveApplyRecord added in v0.132.1

func (s *BunTranslationExchangeRuntimeStore) ReserveApplyRecord(ctx context.Context, identity translationTransportIdentity, linkageKey, payloadHash string, now, leaseUntil time.Time) (translationExchangeApplyReservation, translationExchangeAppliedRecord, string, error)

func (*BunTranslationExchangeRuntimeStore) SaveJobRows added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) SaveJobRows(ctx context.Context, job translationExchangeAsyncJob, rows []TranslationExchangeRow) error

func (*BunTranslationExchangeRuntimeStore) UpsertJobRow added in v0.27.0

func (s *BunTranslationExchangeRuntimeStore) UpsertJobRow(ctx context.Context, jobID string, row translationExchangeStoredRow) error

type BunTranslationFamilyStore added in v0.27.0

type BunTranslationFamilyStore struct {
	// contains filtered or unexported fields
}

func NewBunTranslationFamilyStore added in v0.27.0

func NewBunTranslationFamilyStore(db *bun.DB) *BunTranslationFamilyStore

func (*BunTranslationFamilyStore) Families added in v0.27.0

func (*BunTranslationFamilyStore) Family added in v0.27.0

func (*BunTranslationFamilyStore) FamilyQuery added in v0.83.0

func (*BunTranslationFamilyStore) ListFamiliesQuery added in v0.80.0

func (*BunTranslationFamilyStore) SaveFamily added in v0.27.0

func (*BunTranslationFamilyStore) TranslationDashboardFamilyMetrics added in v0.80.0

func (*BunTranslationFamilyStore) TranslationEditorMemorySuggestions added in v0.80.0

type BunWorkflowAuthoringStore added in v0.27.0

type BunWorkflowAuthoringStore struct {
	// contains filtered or unexported fields
}

BunWorkflowAuthoringStore persists flow authoring state and version history.

func NewBunWorkflowAuthoringStore added in v0.27.0

func NewBunWorkflowAuthoringStore(db *bun.DB) *BunWorkflowAuthoringStore

func (*BunWorkflowAuthoringStore) Delete added in v0.27.0

func (s *BunWorkflowAuthoringStore) Delete(ctx context.Context, machineID string, expectedVersion string, hardDelete bool) (bool, error)

func (*BunWorkflowAuthoringStore) List added in v0.27.0

func (*BunWorkflowAuthoringStore) ListVersions added in v0.27.0

func (s *BunWorkflowAuthoringStore) ListVersions(ctx context.Context, machineID string, limit int, offset int) ([]*flow.AuthoringMachineRecord, bool, error)

func (*BunWorkflowAuthoringStore) Load added in v0.27.0

func (*BunWorkflowAuthoringStore) LoadAny added in v0.27.0

func (*BunWorkflowAuthoringStore) LoadVersion added in v0.27.0

func (s *BunWorkflowAuthoringStore) LoadVersion(ctx context.Context, machineID string, version string) (*flow.AuthoringMachineRecord, error)

func (*BunWorkflowAuthoringStore) Save added in v0.27.0

type BunWorkflowBindingRepository added in v0.25.0

type BunWorkflowBindingRepository struct {
	// contains filtered or unexported fields
}

BunWorkflowBindingRepository persists workflow bindings with active uniqueness checks.

func NewBunWorkflowBindingRepository added in v0.25.0

func NewBunWorkflowBindingRepository(db *bun.DB) *BunWorkflowBindingRepository

NewBunWorkflowBindingRepository constructs a Bun-backed binding repository.

func (*BunWorkflowBindingRepository) Create added in v0.25.0

func (*BunWorkflowBindingRepository) Delete added in v0.25.0

func (*BunWorkflowBindingRepository) Get added in v0.25.0

func (*BunWorkflowBindingRepository) List added in v0.25.0

func (*BunWorkflowBindingRepository) ListByScope added in v0.25.0

func (*BunWorkflowBindingRepository) Update added in v0.25.0

func (r *BunWorkflowBindingRepository) Update(ctx context.Context, binding WorkflowBinding, expectedVersion int) (WorkflowBinding, error)

type BunWorkflowDefinitionRepository added in v0.25.0

type BunWorkflowDefinitionRepository struct {
	// contains filtered or unexported fields
}

BunWorkflowDefinitionRepository persists workflow definitions and version snapshots.

func NewBunWorkflowDefinitionRepository added in v0.25.0

func NewBunWorkflowDefinitionRepository(db *bun.DB) *BunWorkflowDefinitionRepository

NewBunWorkflowDefinitionRepository constructs a Bun-backed workflow repository.

func (*BunWorkflowDefinitionRepository) Create added in v0.25.0

func (*BunWorkflowDefinitionRepository) Get added in v0.25.0

func (*BunWorkflowDefinitionRepository) GetVersion added in v0.25.0

func (*BunWorkflowDefinitionRepository) List added in v0.25.0

func (*BunWorkflowDefinitionRepository) Update added in v0.25.0

func (r *BunWorkflowDefinitionRepository) Update(ctx context.Context, workflow PersistedWorkflow, expectedVersion int) (PersistedWorkflow, error)

type CLIConfig added in v0.12.0

type CLIConfig = command.CLIConfig

type CLIGroup added in v0.12.0

type CLIGroup = command.CLIGroup

type CMSBlock

type CMSBlock = cmsboot.CMSBlock

CMSBlock represents a block instance attached to content/pages.

type CMSBlockConflictRepository added in v0.23.0

type CMSBlockConflictRepository struct {
	// contains filtered or unexported fields
}

CMSBlockConflictRepository reports mismatches between embedded and legacy blocks.

func NewCMSBlockConflictRepository added in v0.23.0

func NewCMSBlockConflictRepository(content CMSContentService) *CMSBlockConflictRepository

NewCMSBlockConflictRepository builds a conflict repository.

func (*CMSBlockConflictRepository) Create added in v0.23.0

func (r *CMSBlockConflictRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create is not supported.

func (*CMSBlockConflictRepository) Delete added in v0.23.0

Delete is not supported.

func (*CMSBlockConflictRepository) Get added in v0.23.0

Get returns conflict detail by id.

func (*CMSBlockConflictRepository) List added in v0.23.0

List returns block conflicts.

func (*CMSBlockConflictRepository) Update added in v0.23.0

func (r *CMSBlockConflictRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update is not supported.

type CMSBlockDefinition

type CMSBlockDefinition = cmsboot.CMSBlockDefinition

CMSBlockDefinition describes a reusable block schema.

type CMSBlockDefinitionRepository

type CMSBlockDefinitionRepository struct {
	// contains filtered or unexported fields
}

CMSBlockDefinitionRepository manages block definitions through CMSContentService.

func NewCMSBlockDefinitionRepository

func NewCMSBlockDefinitionRepository(content CMSContentService, types CMSContentTypeService) *CMSBlockDefinitionRepository

NewCMSBlockDefinitionRepository builds a block definition repository.

func (*CMSBlockDefinitionRepository) Create

func (r *CMSBlockDefinitionRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create adds a block definition.

func (*CMSBlockDefinitionRepository) Delete

Delete removes a block definition.

func (*CMSBlockDefinitionRepository) Get

Get returns a single block definition.

func (*CMSBlockDefinitionRepository) List

List returns block definitions.

func (*CMSBlockDefinitionRepository) Update

func (r *CMSBlockDefinitionRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a block definition.

type CMSBlockDefinitionVersion added in v0.24.0

type CMSBlockDefinitionVersion = cmsboot.CMSBlockDefinitionVersion

CMSBlockDefinitionVersion captures a block definition schema version.

type CMSBlockRepository

type CMSBlockRepository struct {
	// contains filtered or unexported fields
}

CMSBlockRepository manages blocks assigned to content/pages.

func NewCMSBlockRepository

func NewCMSBlockRepository(content CMSContentService) *CMSBlockRepository

NewCMSBlockRepository builds a block repository.

func (*CMSBlockRepository) Create

func (r *CMSBlockRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create saves a new block.

func (*CMSBlockRepository) Delete

func (r *CMSBlockRepository) Delete(ctx context.Context, id string) error

Delete removes a block.

func (*CMSBlockRepository) Get

func (r *CMSBlockRepository) Get(ctx context.Context, id string) (map[string]any, error)

Get returns a block by id.

func (*CMSBlockRepository) List

func (r *CMSBlockRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns blocks for a content ID (or all when unspecified).

func (*CMSBlockRepository) Update

func (r *CMSBlockRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies an existing block.

type CMSBootstrapHook added in v0.36.0

type CMSBootstrapHook func(context.Context, *Admin) error

CMSBootstrapHook runs after CMS services are prepared and before module loading.

type CMSContainer

type CMSContainer = cmsboot.CMSContainer

CMSContainer abstracts CMS services used by admin.

func BuildGoCMSContainer

func BuildGoCMSContainer(ctx context.Context, cfg Config) (CMSContainer, error)

BuildGoCMSContainer constructs a CMSContainer from go-cms configuration or module values.

type CMSContainerBuilder

type CMSContainerBuilder func(ctx context.Context, cfg Config) (CMSContainer, error)

CMSContainerBuilder constructs a CMSContainer from admin configuration.

type CMSContainerUnwrapper added in v0.46.0

type CMSContainerUnwrapper interface {
	UnwrapCMSContainer() CMSContainer
}

CMSContainerUnwrapper allows wrapped CMS containers to expose the underlying container for optional capability discovery.

type CMSContent

type CMSContent = cmsboot.CMSContent

CMSContent represents structured content managed by the CMS.

type CMSContentListOption added in v0.24.0

type CMSContentListOption = cmscontracts.CMSContentListOption

CMSContentListOption represents list option tokens understood by go-cms List. It remains re-exported from the root package for compatibility.

func WithContentTypeID added in v0.54.0

func WithContentTypeID(id string) CMSContentListOption

WithContentTypeID requests that upstream content list reads scope rows to the supplied content type before loading translations or projections.

func WithDerivedFields added in v0.25.0

func WithDerivedFields() CMSContentListOption

WithDerivedFields requests canonical top-level derived content fields from go-cms.

func WithFamilyID added in v0.105.0

func WithFamilyID(id string) CMSContentListOption

WithFamilyID requests that upstream content list reads scope rows to one canonical translation family before loading variants.

func WithFamilyIDs added in v0.113.10

func WithFamilyIDs(ids ...string) CMSContentListOption

WithFamilyIDs requests one bounded upstream read for multiple canonical translation families.

func WithLocaleVariants added in v0.42.0

func WithLocaleVariants() CMSContentListOption

WithLocaleVariants requests one list item per locale sibling for translation-enabled content. This is handled inside go-admin's CMS adapter and is not forwarded to go-cms.

func WithTranslations added in v0.24.0

func WithTranslations() CMSContentListOption

WithTranslations requests that list operations preload translations for CMS content. This opt-in token mirrors the go-cms list option of the same name.

type CMSContentRepository

type CMSContentRepository struct {
	// contains filtered or unexported fields
}

CMSContentRepository adapts CMSContentService for structured content entities.

func NewCMSContentRepository

func NewCMSContentRepository(content CMSContentService) *CMSContentRepository

NewCMSContentRepository builds a content repository.

func NewCMSContentRepositoryWithEntryNavigationOptions added in v0.111.0

func NewCMSContentRepositoryWithEntryNavigationOptions(content CMSContentService, options EntryNavigationOptions) *CMSContentRepository

NewCMSContentRepositoryWithEntryNavigationOptions builds a content repository using the final merged entry-navigation policy.

func (*CMSContentRepository) Create

func (r *CMSContentRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts new content.

func (*CMSContentRepository) CreateTranslation added in v0.25.0

func (r *CMSContentRepository) CreateTranslation(ctx context.Context, input TranslationCreateInput) (map[string]any, error)

CreateTranslation creates a locale variant through a first-class translation command.

func (*CMSContentRepository) Delete

func (r *CMSContentRepository) Delete(ctx context.Context, id string) error

Delete removes a content item.

func (*CMSContentRepository) Get

func (r *CMSContentRepository) Get(ctx context.Context, id string) (map[string]any, error)

Get retrieves content by id.

func (*CMSContentRepository) List

func (r *CMSContentRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns content filtered by locale and search query.

func (*CMSContentRepository) Update

func (r *CMSContentRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies content.

type CMSContentService

type CMSContentService = cmsboot.CMSContentService

CMSContentService manages pages/blocks backed by the CMS.

func NewGoCMSContentAdapter added in v0.23.0

func NewGoCMSContentAdapter(contentSvc any, blockSvc any, contentTypeSvc CMSContentTypeService) CMSContentService

NewGoCMSContentAdapter wraps go-cms services into the admin CMSContentService contract.

type CMSContentServiceUnwrapper added in v0.46.0

type CMSContentServiceUnwrapper interface {
	UnwrapCMSContentService() CMSContentService
}

CMSContentServiceUnwrapper allows wrappers to expose their underlying content service so optional capabilities remain discoverable.

type CMSContentTranslationCreator added in v0.25.0

type CMSContentTranslationCreator interface {
	CreateTranslation(ctx context.Context, input TranslationCreateInput) (*CMSContent, error)
}

CMSContentTranslationCreator allows CMS content services/adapters to expose a first-class translation creation command.

type CMSContentType added in v0.23.0

type CMSContentType = cmsboot.CMSContentType

CMSContentType represents a content type definition.

type CMSContentTypeEntryRepository added in v0.23.0

type CMSContentTypeEntryRepository struct {
	// contains filtered or unexported fields
}

CMSContentTypeEntryRepository scopes content CRUD to a specific content type.

func NewCMSContentTypeEntryRepository added in v0.23.0

func NewCMSContentTypeEntryRepository(content CMSContentService, contentType CMSContentType) *CMSContentTypeEntryRepository

NewCMSContentTypeEntryRepository builds a content repository scoped to the supplied content type.

func NewCMSContentTypeEntryRepositoryWithEntryNavigationOptions added in v0.111.0

func NewCMSContentTypeEntryRepositoryWithEntryNavigationOptions(content CMSContentService, contentType CMSContentType, options EntryNavigationOptions) *CMSContentTypeEntryRepository

NewCMSContentTypeEntryRepositoryWithEntryNavigationOptions builds a scoped content repository using the final merged entry-navigation policy.

func (*CMSContentTypeEntryRepository) Create added in v0.23.0

func (r *CMSContentTypeEntryRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts new content with the bound content type.

func (*CMSContentTypeEntryRepository) CreateTranslation added in v0.25.0

func (r *CMSContentTypeEntryRepository) CreateTranslation(ctx context.Context, input TranslationCreateInput) (map[string]any, error)

CreateTranslation creates a locale variant through a first-class translation command.

func (*CMSContentTypeEntryRepository) Delete added in v0.23.0

Delete removes a content item after validating its type.

func (*CMSContentTypeEntryRepository) Get added in v0.23.0

Get retrieves content by id, enforcing content type membership.

func (*CMSContentTypeEntryRepository) List added in v0.23.0

List returns content filtered by the bound content type.

func (*CMSContentTypeEntryRepository) ListTranslationFamilies added in v0.103.0

func (r *CMSContentTypeEntryRepository) ListTranslationFamilies(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

ListTranslationFamilies returns optimized grouped family rows when supported by the backing service.

func (*CMSContentTypeEntryRepository) Update added in v0.23.0

func (r *CMSContentTypeEntryRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies content with the bound content type.

type CMSContentTypeRepository added in v0.23.0

type CMSContentTypeRepository struct {
	// contains filtered or unexported fields
}

CMSContentTypeRepository adapts CMSContentTypeService for content type definitions.

func NewCMSContentTypeRepository added in v0.23.0

func NewCMSContentTypeRepository(types CMSContentTypeService) *CMSContentTypeRepository

NewCMSContentTypeRepository builds a repository backed by a CMSContentTypeService.

func (*CMSContentTypeRepository) Create added in v0.23.0

func (r *CMSContentTypeRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts a content type.

func (*CMSContentTypeRepository) Delete added in v0.23.0

Delete removes a content type.

func (*CMSContentTypeRepository) Get added in v0.23.0

Get returns a single content type by slug (preferred) or id.

func (*CMSContentTypeRepository) List added in v0.23.0

func (r *CMSContentTypeRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns content types filtered by search query.

func (*CMSContentTypeRepository) Update added in v0.23.0

func (r *CMSContentTypeRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a content type (slug preferred, id fallback).

type CMSContentTypeService added in v0.23.0

type CMSContentTypeService = cmsboot.CMSContentTypeService

CMSContentTypeService manages content type definitions.

func NewGoCMSContentTypeAdapter added in v0.23.0

func NewGoCMSContentTypeAdapter(service any) CMSContentTypeService

NewGoCMSContentTypeAdapter wraps a typed go-cms content type service.

type CMSLegacyBlockService added in v0.23.0

type CMSLegacyBlockService interface {
	LegacyBlocksForContent(ctx context.Context, contentID, locale string) ([]CMSBlock, error)
}

CMSLegacyBlockService exposes legacy block retrieval for conflict reports.

type CMSMenuRepository

type CMSMenuRepository struct {
	// contains filtered or unexported fields
}

CMSMenuRepository manages menu items for CMS-backed navigation.

func NewCMSMenuRepository

func NewCMSMenuRepository(menu CMSMenuService, defaultCode string) *CMSMenuRepository

NewCMSMenuRepository builds a menu repository with a default menu code.

func (*CMSMenuRepository) Create

func (r *CMSMenuRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts a menu item.

func (*CMSMenuRepository) Delete

func (r *CMSMenuRepository) Delete(ctx context.Context, id string) error

Delete removes a menu item.

func (*CMSMenuRepository) Get

func (r *CMSMenuRepository) Get(ctx context.Context, id string) (map[string]any, error)

Get returns a single menu item by id.

func (*CMSMenuRepository) List

func (r *CMSMenuRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns menu items for a menu code and locale.

func (*CMSMenuRepository) Update

func (r *CMSMenuRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a menu item.

type CMSMenuService

type CMSMenuService = cmsboot.CMSMenuService

CMSMenuService manages CMS-backed menus.

type CMSOptions

type CMSOptions struct {
	Container        CMSContainer        `json:"container"`
	ContainerBuilder CMSContainerBuilder `json:"container_builder"`
	GoCMSConfig      any                 `json:"go_cms_config"`
}

CMSOptions configures how the CMS container is resolved (in-memory, go-cms, or host-provided).

type CMSPage

type CMSPage = cmsboot.CMSPage

CMSPage represents a page managed by the CMS.

type CMSPageRepository

type CMSPageRepository struct {
	// contains filtered or unexported fields
}

CMSPageRepository adapts a CMSContentService to the admin Repository contract. It supports locale-aware listings, basic search, parent/child metadata for tree views, and slug uniqueness validation for preview links.

func NewCMSPageRepository

func NewCMSPageRepository(content CMSContentService) *CMSPageRepository

NewCMSPageRepository builds a repository backed by a CMSContentService.

func (*CMSPageRepository) Create

func (r *CMSPageRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts a page with path collision checks.

func (*CMSPageRepository) Delete

func (r *CMSPageRepository) Delete(ctx context.Context, id string) error

Delete removes a page.

func (*CMSPageRepository) Get

func (r *CMSPageRepository) Get(ctx context.Context, id string) (map[string]any, error)

Get returns a page by id.

func (*CMSPageRepository) List

func (r *CMSPageRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns CMS pages filtered by locale and simple search.

func (*CMSPageRepository) Update

func (r *CMSPageRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a page while preventing slug/path collisions.

type CMSWidgetService

type CMSWidgetService = cmsboot.CMSWidgetService

CMSWidgetService registers dashboard widget areas/definitions.

type CRUDRepositoryAdapter

type CRUDRepositoryAdapter struct {
	// contains filtered or unexported fields
}

CRUDRepositoryAdapter wraps a go-crud Service so panels can target Bun-backed repos.

func NewCRUDRepositoryAdapter

func NewCRUDRepositoryAdapter(service crud.Service[map[string]any]) *CRUDRepositoryAdapter

NewCRUDRepositoryAdapter constructs the adapter.

func (*CRUDRepositoryAdapter) Create

func (r *CRUDRepositoryAdapter) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create inserts a record.

func (*CRUDRepositoryAdapter) Delete

func (r *CRUDRepositoryAdapter) Delete(ctx context.Context, id string) error

Delete removes a record by id.

func (*CRUDRepositoryAdapter) Get

func (r *CRUDRepositoryAdapter) Get(ctx context.Context, id string) (map[string]any, error)

Get retrieves a single record by id.

func (*CRUDRepositoryAdapter) List

func (r *CRUDRepositoryAdapter) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List delegates to the go-crud service using translated list options.

func (*CRUDRepositoryAdapter) Update

func (r *CRUDRepositoryAdapter) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a record.

type CanonicalURLResolver added in v0.26.0

type CanonicalURLResolver struct {
	BaseURL string `json:"base_url"`
}

CanonicalURLResolver resolves canonical paths and URLs with an optional base URL prefix.

func (CanonicalURLResolver) ContentPath added in v0.26.0

func (r CanonicalURLResolver) ContentPath(contentType, slug string) string

ContentPath returns a canonical content path for (type, slug).

func (CanonicalURLResolver) ContentURL added in v0.26.0

func (r CanonicalURLResolver) ContentURL(contentType, slug string) string

ContentURL returns a canonical absolute/relative URL for (type, slug).

func (CanonicalURLResolver) NormalizePath added in v0.26.0

func (r CanonicalURLResolver) NormalizePath(path, fallback string) string

NormalizePath returns a normalized path with leading slash and fallback support.

type ChartPointWidgetPayload added in v0.25.0

type ChartPointWidgetPayload struct {
	Label string `json:"label"`
	Value int    `json:"value"`
}

type CommandBus added in v0.12.0

type CommandBus struct {
	// contains filtered or unexported fields
}

CommandBus registers command/query handlers and dispatches by name.

func NewCommandBus added in v0.12.0

func NewCommandBus(enabled bool) *CommandBus

NewCommandBus constructs a command bus that can be toggled off.

func (*CommandBus) Close added in v0.12.0

func (b *CommandBus) Close()

Close is an alias for Reset.

func (*CommandBus) CommandDescriptors added in v0.126.8

func (b *CommandBus) CommandDescriptors() []command.CommandDescriptor

CommandDescriptors returns the deterministic catalog snapshot contributed by all currently committed owner generations.

func (*CommandBus) CommandRegistration added in v0.110.0

func (b *CommandBus) CommandRegistration(name string) CommandRegistrationState

CommandRegistration returns the registration state for name-based dispatch.

func (*CommandBus) DispatchByName added in v0.12.0

func (b *CommandBus) DispatchByName(ctx context.Context, name string, payload map[string]any, ids []string) error

DispatchByName routes a named command through the dispatcher.

func (*CommandBus) DispatchByNameWithOptions added in v0.27.0

func (b *CommandBus) DispatchByNameWithOptions(ctx context.Context, name string, payload map[string]any, ids []string, opts command.DispatchOptions) (command.DispatchReceipt, error)

DispatchByNameWithOptions routes a named command through the dispatcher using explicit dispatch options.

func (*CommandBus) DispatchByNameWithOutcome added in v0.88.0

func (b *CommandBus) DispatchByNameWithOutcome(ctx context.Context, name string, payload map[string]any, ids []string, opts command.DispatchOptions) (DispatchOutcome, error)

DispatchByNameWithOutcome routes a named command and returns an optional inline result.

func (*CommandBus) Enable added in v0.12.0

func (b *CommandBus) Enable(enabled bool)

Enable toggles the command bus on/off.

func (*CommandBus) ExecutionPolicy added in v0.27.0

func (b *CommandBus) ExecutionPolicy() CommandExecutionPolicy

ExecutionPolicy returns the current command execution policy snapshot.

func (*CommandBus) HasFactory added in v0.25.0

func (b *CommandBus) HasFactory(name string) bool

HasFactory reports whether a named message factory is registered.

func (*CommandBus) MarkCommandHandlerRegistered added in v0.110.0

func (b *CommandBus) MarkCommandHandlerRegistered(name string)

MarkCommandHandlerRegistered records that a typed command handler exists for a public command name. This is used by capability checks before advertising browser-dispatchable actions.

func (*CommandBus) Names added in v0.27.0

func (b *CommandBus) Names() []string

Names returns a sorted snapshot of command names known to the bus.

func (*CommandBus) NewRegistrationSet added in v0.126.8

func (b *CommandBus) NewRegistrationSet(owner string) (*CommandRegistrationSet, error)

NewRegistrationSet creates a single-use owner-scoped registration builder.

func (*CommandBus) RegisterFactory added in v0.12.0

func (b *CommandBus) RegisterFactory(name string, factory MessageFactory) error

RegisterFactory stores a message factory for name-based dispatch.

func (*CommandBus) Reset added in v0.12.0

func (b *CommandBus) Reset()

Reset unsubscribes registered handlers and clears factories.

func (*CommandBus) SetExecutionPolicy added in v0.27.0

func (b *CommandBus) SetExecutionPolicy(policy CommandExecutionPolicy) error

SetExecutionPolicy replaces command dispatch policy for name-based dispatch.

func (*CommandBus) SetOwnedRuntimeConfig added in v0.126.8

func (b *CommandBus) SetOwnedRuntimeConfig(config OwnedCommandRuntimeConfig) error

SetOwnedRuntimeConfig replaces the snapshot used by future registration-set commits. Existing owner generations are unchanged.

type CommandConfig added in v0.27.0

type CommandConfig struct {
	Execution CommandExecutionPolicy `json:"execution"`
	RPC       RPCCommandConfig       `json:"rpc"`
}

CommandConfig controls command subsystem behavior.

type CommandExecutionPolicy added in v0.27.0

type CommandExecutionPolicy struct {
	DefaultMode command.ExecutionMode            `json:"default_mode"`
	PerCommand  map[string]command.ExecutionMode `json:"per_command"`
}

CommandExecutionPolicy controls dispatch mode resolution for name-based command dispatch.

func (CommandExecutionPolicy) Clone added in v0.27.0

Clone returns a deep copy of the policy.

func (CommandExecutionPolicy) Resolve added in v0.27.0

func (p CommandExecutionPolicy) Resolve(commandID string) (command.ExecutionMode, bool)

Resolve returns the configured mode for a command id.

type CommandLauncherDiagnostic added in v0.97.0

type CommandLauncherDiagnostic struct {
	Code     string         `json:"code"`
	Severity string         `json:"severity"`
	Message  string         `json:"message"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

type CommandLauncherSnapshot added in v0.97.0

type CommandLauncherSnapshot struct {
	Commands    []gocommand.CommandDescriptor `json:"commands"`
	Diagnostics []CommandLauncherDiagnostic   `json:"diagnostics,omitempty"`
}

type CommandRegistrationHandle added in v0.126.8

type CommandRegistrationHandle interface {
	Owner() string
	Close() error
}

CommandRegistrationHandle owns one committed registration generation.

func RegisterDataCommands added in v0.139.0

func RegisterDataCommands(bus *CommandBus, service *data.Service) (CommandRegistrationHandle, error)

RegisterDataCommands owns the sole lifecycle handler/factory generation. The service resolves current trusted actor and delegated identity for every call.

func RegisterDataExplorationQueries added in v0.139.3

func RegisterDataExplorationQueries(bus *CommandBus, service *data.Service) (CommandRegistrationHandle, error)

func RegisterDataMaintenanceCommands added in v0.139.4

func RegisterDataMaintenanceCommands(bus *CommandBus, service *data.MaintenanceService) (CommandRegistrationHandle, error)

RegisterDataMaintenanceCommands registers optional native maintenance without enabling it or granting domain permissions. Factories accept no actor/scope.

type CommandRegistrationSet added in v0.126.8

type CommandRegistrationSet struct {
	// contains filtered or unexported fields
}

CommandRegistrationSet stages one owner's handlers and factories before publishing them atomically to a CommandBus.

func (*CommandRegistrationSet) Commit added in v0.126.8

Commit validates and publishes the complete owner generation.

type CommandRegistrationState added in v0.110.0

type CommandRegistrationState struct {
	Handler          bool
	Factory          bool
	Dispatcher       bool
	ResultDispatcher bool
}

CommandRegistrationState describes how a command name can be dispatched.

func (CommandRegistrationState) CanDispatch added in v0.110.0

func (s CommandRegistrationState) CanDispatch() bool

CanDispatch reports whether the command can be executed by name.

func (CommandRegistrationState) Registered added in v0.110.0

func (s CommandRegistrationState) Registered() bool

Registered reports whether the command name is known to the command bus.

func (CommandRegistrationState) SupportsInlineResult added in v0.110.0

func (s CommandRegistrationState) SupportsInlineResult() bool

SupportsInlineResult reports whether the command can return an inline result.

type CommandResultFailureReporter added in v0.113.13

type CommandResultFailureReporter interface {
	CommandResultFailure() error
}

CommandResultFailureReporter lets an inline command result report an operational failure while remaining available to outcome-aware callers. Dispatch APIs that discard inline results return this failure to the caller.

type CommandRunAtomicClearStore added in v0.124.0

type CommandRunAtomicClearStore interface {
	SnapshotForCommandRunClear(context.Context, CommandRunSelector) (CommandRunClearSnapshot, error)
	ClearCommandRunsIfUnchanged(context.Context, CommandRunSelector, uint64) (bool, error)
}

CommandRunAtomicClearStore closes the authorization/mutation race for stores whose base CommandRunStore clear operation is selector-wide. Implementations must compare version and mutate under one consistency boundary.

type CommandRunClearSnapshot added in v0.124.0

type CommandRunClearSnapshot struct {
	Records []CommandRunRecord
	Version uint64
}

CommandRunClearSnapshot is an isolated candidate set plus the opaque store version that produced it.

type CommandRunContractLimits added in v0.121.3

type CommandRunContractLimits struct {
	MaxIDLength       int
	MaxTextLength     int
	MaxMetadataKeys   int
	MaxMetadataDepth  int
	MaxMetadataBytes  int
	MaxMetadataString int
}

CommandRunContractLimits bounds normalization at trust and transport boundaries.

func DefaultCommandRunContractLimits added in v0.121.3

func DefaultCommandRunContractLimits() CommandRunContractLimits

DefaultCommandRunContractLimits returns conservative contract limits.

type CommandRunDiagnosticStatus added in v0.121.3

type CommandRunDiagnosticStatus string

CommandRunDiagnosticStatus is a provider-neutral runtime readiness state.

const (
	CommandRunDiagnosticDisabled   CommandRunDiagnosticStatus = "disabled"
	CommandRunDiagnosticNotStarted CommandRunDiagnosticStatus = "not_started"
	CommandRunDiagnosticReady      CommandRunDiagnosticStatus = "ready"
	CommandRunDiagnosticDegraded   CommandRunDiagnosticStatus = "degraded"
	CommandRunDiagnosticClosed     CommandRunDiagnosticStatus = "closed"
)

type CommandRunDiagnostics added in v0.121.3

type CommandRunDiagnostics struct {
	Enabled      bool                            `json:"enabled"`
	Role         string                          `json:"role"`
	Status       CommandRunDiagnosticStatus      `json:"status"`
	Ready        bool                            `json:"ready"`
	Started      bool                            `json:"started"`
	Closed       bool                            `json:"closed"`
	Local        bool                            `json:"local"`
	Transport    string                          `json:"transport"`
	Capabilities CommandRunTransportCapabilities `json:"capabilities"`

	PublishFailures      uint64 `json:"publish_failures"`
	SubscriptionFailures uint64 `json:"subscription_failures"`
	RejectedEvents       uint64 `json:"rejected_events"`
	DroppedEvents        uint64 `json:"dropped_events"`
	ProjectionFailures   uint64 `json:"projection_failures"`
	ProjectionCount      uint64 `json:"projection_count"`
	OtherFailures        uint64 `json:"other_failures"`

	LastSuccessfulEventAt *time.Time `json:"last_successful_event_at,omitempty"`
	LastFailureAt         *time.Time `json:"last_failure_at,omitempty"`
	LastFailureCode       string     `json:"last_failure_code,omitempty"`
}

CommandRunDiagnostics is a bounded, operator-safe runtime snapshot.

type CommandRunFailure added in v0.121.3

type CommandRunFailure struct {
	Category string `json:"category,omitempty"`
	Code     string `json:"code,omitempty"`
}

CommandRunFailure is a bounded, operator-safe failure classification. It must not contain a raw error, stack trace, payload, or provider cause.

type CommandRunHandler added in v0.121.3

type CommandRunHandler func(context.Context, CommandRunUpdate) error

CommandRunHandler consumes one isolated update. Returning an error reports a delivery failure; publishers and command execution remain fail-open.

type CommandRunMemoryStoreConfig added in v0.121.3

type CommandRunMemoryStoreConfig struct {
	Retention      int
	DedupeLimit    int
	ContractLimits CommandRunContractLimits
}

CommandRunMemoryStoreConfig controls independent record and event-ID bounds.

type CommandRunObserverBridge added in v0.121.3

type CommandRunObserverBridge struct {
	// contains filtered or unexported fields
}

CommandRunObserverBridge maps go-command lifecycle events into the canonical go-admin contract and owns only its dispatcher observer registration.

func NewCommandRunObserverBridge added in v0.121.3

func NewCommandRunObserverBridge(config CommandRunObserverConfig) (*CommandRunObserverBridge, error)

func (*CommandRunObserverBridge) Close added in v0.121.3

func (b *CommandRunObserverBridge) Close()

Close unregisters the package-global observer. It is idempotent and the bridge may be started again without retaining duplicate callbacks.

func (*CommandRunObserverBridge) OnCommandRunEvent added in v0.121.3

func (b *CommandRunObserverBridge) OnCommandRunEvent(ctx context.Context, event command.CommandRunEvent) error

OnCommandRunEvent implements command.CommandRunObserver. Dispatcher treats returned errors as diagnostics and never changes command execution results.

func (*CommandRunObserverBridge) Start added in v0.121.3

Start registers the bridge only for roles that publish command lifecycle. Repeated starts do not duplicate the package-global observer.

type CommandRunObserverConfig added in v0.121.3

type CommandRunObserverConfig struct {
	Publisher      CommandRunPublisher
	PublishTimeout time.Duration
	RevisionLimit  int
	ContractLimits CommandRunContractLimits
	ApplicationID  string
	EnvironmentID  string
	ScopeResolver  CommandRunScopeResolver
	OnError        func(error)
}

CommandRunObserverConfig configures lifecycle mapping and bounded publication.

type CommandRunOutcome added in v0.124.0

type CommandRunOutcome struct {
	Summary string         `json:"summary,omitempty"`
	Fields  map[string]any `json:"fields,omitempty"`
}

CommandRunOutcome is an explicitly approved operator-facing result projection. Fields are limited to named scalar values during normalization; generic Metadata is never promoted into this view.

type CommandRunPhase added in v0.121.3

type CommandRunPhase string

CommandRunPhase identifies one canonical command lifecycle transition.

const (
	CommandRunPhaseSubmitted  CommandRunPhase = "submitted"
	CommandRunPhaseStarted    CommandRunPhase = "started"
	CommandRunPhaseCheckpoint CommandRunPhase = "checkpoint"
	CommandRunPhaseProgress   CommandRunPhase = "progress"
	CommandRunPhaseSucceeded  CommandRunPhase = "succeeded"
	CommandRunPhaseFailed     CommandRunPhase = "failed"
	CommandRunPhaseCanceled   CommandRunPhase = "canceled"
	CommandRunPhaseRejected   CommandRunPhase = "rejected"
)

func (CommandRunPhase) Terminal added in v0.121.3

func (p CommandRunPhase) Terminal() bool

Terminal reports whether later non-terminal updates must not regress this phase.

func (CommandRunPhase) Valid added in v0.121.3

func (p CommandRunPhase) Valid() bool

Valid reports whether the phase is part of the current schema.

type CommandRunProcessRole added in v0.121.3

type CommandRunProcessRole uint8

CommandRunProcessRole is a bitmask so publisher and gateway responsibilities can be assembled independently.

const (
	CommandRunRolePublisher CommandRunProcessRole = 1 << iota
	CommandRunRoleGateway
	CommandRunRoleMonolith = CommandRunRolePublisher | CommandRunRoleGateway
)

func (CommandRunProcessRole) Has added in v0.121.3

Has reports whether the role includes every requested responsibility.

func (CommandRunProcessRole) String added in v0.121.3

func (r CommandRunProcessRole) String() string

func (CommandRunProcessRole) Valid added in v0.121.3

func (r CommandRunProcessRole) Valid() bool

Valid reports whether the bitmask contains one or both known responsibilities.

type CommandRunProjection added in v0.121.3

type CommandRunProjection interface {
	ProjectCommandRun(context.Context, CommandRunUpdate) (CommandRunRecord, bool, error)
}

CommandRunProjection applies one update and returns a complete row when the update changed current state.

type CommandRunProjectionFunc added in v0.121.3

type CommandRunProjectionFunc func(context.Context, CommandRunUpdate) (CommandRunRecord, bool, error)

CommandRunProjectionFunc adapts a function into CommandRunProjection.

func (CommandRunProjectionFunc) ProjectCommandRun added in v0.121.3

type CommandRunProjector added in v0.121.3

type CommandRunProjector struct {
	// contains filtered or unexported fields
}

CommandRunProjector validates updates before applying them to any store.

func NewCommandRunProjector added in v0.121.3

func NewCommandRunProjector(store CommandRunStore, limits CommandRunContractLimits) (*CommandRunProjector, error)

func (*CommandRunProjector) ProjectCommandRun added in v0.121.3

func (p *CommandRunProjector) ProjectCommandRun(ctx context.Context, update CommandRunUpdate) (CommandRunRecord, bool, error)

type CommandRunPublisher added in v0.121.3

type CommandRunPublisher interface {
	PublishCommandRun(context.Context, CommandRunUpdate) error
}

CommandRunPublisher publishes canonical command-run updates.

type CommandRunRecord added in v0.121.3

type CommandRunRecord struct {
	CommandRunUpdate
	FirstOccurredAt time.Time `json:"first_occurred_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

CommandRunRecord is the complete current projection for one run. The embedded update is the latest accepted lifecycle state and marshals as a flat JSON row.

func (CommandRunRecord) Clone added in v0.121.3

Clone returns an isolated snapshot row.

type CommandRunRecordAuthorizer added in v0.124.0

type CommandRunRecordAuthorizer interface {
	AuthorizeCommandRunRecord(context.Context, CommandRunRecord) (bool, error)
}

CommandRunRecordAuthorizer provides an additive host policy for complete command-run records. The Command Runs panel applies catalog eligibility before this policy for known descriptors; hosts may only use it to further restrict eligible records or explicitly authorize otherwise unknown records.

type CommandRunRecordAuthorizerFunc added in v0.124.0

type CommandRunRecordAuthorizerFunc func(context.Context, CommandRunRecord) (bool, error)

CommandRunRecordAuthorizerFunc adapts a function into a record authorizer. A nil adapter fails closed.

func (CommandRunRecordAuthorizerFunc) AuthorizeCommandRunRecord added in v0.124.0

func (f CommandRunRecordAuthorizerFunc) AuthorizeCommandRunRecord(ctx context.Context, record CommandRunRecord) (bool, error)

type CommandRunRecordHandler added in v0.121.3

type CommandRunRecordHandler func(context.Context, CommandRunRecord) error

CommandRunRecordHandler receives a complete accepted projection row.

type CommandRunRuntime added in v0.121.3

type CommandRunRuntime struct {
	// contains filtered or unexported fields
}

CommandRunRuntime composes observation, transport subscription, projection, and lifecycle ownership for one process role.

func NewCommandRunRuntime added in v0.121.3

func NewCommandRunRuntime(config CommandRunRuntimeConfig) (*CommandRunRuntime, error)

NewCommandRunRuntime resolves local defaults without starting injected drivers.

func (*CommandRunRuntime) Capabilities added in v0.121.3

func (*CommandRunRuntime) Close added in v0.121.3

func (r *CommandRunRuntime) Close(ctx context.Context) error

Close stops observation before subscriptions, waits within the configured bound, and closes only the runtime-owned local transport.

func (*CommandRunRuntime) Diagnostics added in v0.121.3

func (r *CommandRunRuntime) Diagnostics() CommandRunDiagnostics

Diagnostics returns an isolated, provider-neutral runtime snapshot.

func (*CommandRunRuntime) Publisher added in v0.121.3

func (r *CommandRunRuntime) Publisher() CommandRunPublisher

func (*CommandRunRuntime) Ready added in v0.121.3

func (r *CommandRunRuntime) Ready() <-chan struct{}

Ready closes after successful startup (or immediately when disabled).

func (*CommandRunRuntime) Start added in v0.121.3

func (r *CommandRunRuntime) Start(ctx context.Context) error

Start creates runtime-owned subscriptions and observer registrations. It is concurrency-safe and idempotent; external transports must already be ready.

func (*CommandRunRuntime) Store added in v0.121.3

func (*CommandRunRuntime) Subscriber added in v0.121.3

func (r *CommandRunRuntime) Subscriber() CommandRunSubscriber

type CommandRunRuntimeConfig added in v0.121.3

type CommandRunRuntimeConfig struct {
	Enabled bool                  `json:"enabled"`
	Role    CommandRunProcessRole `json:"role"`

	Transport  CommandRunTransport  `json:"-"`
	Publisher  CommandRunPublisher  `json:"-"`
	Subscriber CommandRunSubscriber `json:"-"`
	Store      CommandRunStore      `json:"-"`
	Projection CommandRunProjection `json:"-"`

	ApplicationID string `json:"application_id,omitempty"`
	EnvironmentID string `json:"environment_id,omitempty"`
	InstanceID    string `json:"instance_id,omitempty"`

	Retention   int `json:"retention,omitempty"`
	DedupeLimit int `json:"dedupe_limit,omitempty"`
	BufferSize  int `json:"buffer_size,omitempty"`

	PublishTimeout time.Duration            `json:"publish_timeout,omitempty"`
	CloseTimeout   time.Duration            `json:"close_timeout,omitempty"`
	ContractLimits CommandRunContractLimits `json:"contract_limits"`

	ScopeResolver    CommandRunScopeResolver    `json:"-"`
	ScopeAuthorizer  CommandRunScopeAuthorizer  `json:"-"`
	RecordAuthorizer CommandRunRecordAuthorizer `json:"-"`
	OnProjected      CommandRunRecordHandler    `json:"-"`
	OnError          func(error)                `json:"-"`

	RequireFanout     bool `json:"require_fanout,omitempty"`
	RequireDurability bool `json:"require_durability,omitempty"`
	RequireReplay     bool `json:"require_replay,omitempty"`
}

CommandRunRuntimeConfig configures the go-admin-owned observer, subscriptions, projection, and local defaults. Injected publishers, subscribers, transports, and stores remain host-owned; the runtime closes only observer registrations and subscriptions it creates.

func DefaultCommandRunRuntimeConfig added in v0.121.3

func DefaultCommandRunRuntimeConfig() CommandRunRuntimeConfig

DefaultCommandRunRuntimeConfig returns a zero-service monolith configuration.

func NormalizeCommandRunRuntimeConfig added in v0.121.3

func NormalizeCommandRunRuntimeConfig(config CommandRunRuntimeConfig) (CommandRunRuntimeConfig, error)

NormalizeCommandRunRuntimeConfig applies local-safe defaults and validates role, ownership, and requested delivery semantics. Missing transport/store dependencies intentionally select runtime-owned local implementations later.

type CommandRunScope added in v0.121.3

type CommandRunScope struct {
	ApplicationID  string `json:"application_id,omitempty"`
	EnvironmentID  string `json:"environment_id,omitempty"`
	TenantID       string `json:"tenant_id,omitempty"`
	OrganizationID string `json:"organization_id,omitempty"`
}

CommandRunScope carries trusted isolation identifiers. Values are opaque and case-sensitive; normalization only trims surrounding whitespace.

func (CommandRunScope) Empty added in v0.121.3

func (s CommandRunScope) Empty() bool

Empty reports whether no scope dimension is configured.

func (CommandRunScope) Normalize added in v0.121.3

func (s CommandRunScope) Normalize() CommandRunScope

Normalize returns a scope with whitespace removed from its opaque identifiers.

type CommandRunScopeAuthorizer added in v0.121.3

type CommandRunScopeAuthorizer interface {
	CommandRunSelector(context.Context) (CommandRunSelector, error)
	AuthorizeCommandRun(context.Context, CommandRunScope) (bool, error)
}

CommandRunScopeAuthorizer resolves one authenticated request selector and authorizes live event scopes through the same policy.

type CommandRunScopeAuthorizerFuncs added in v0.121.3

type CommandRunScopeAuthorizerFuncs struct {
	Selector  func(context.Context) (CommandRunSelector, error)
	Authorize func(context.Context, CommandRunScope) (bool, error)
}

CommandRunScopeAuthorizerFuncs adapts request-scoped functions into an authorizer.

func (CommandRunScopeAuthorizerFuncs) AuthorizeCommandRun added in v0.121.3

func (f CommandRunScopeAuthorizerFuncs) AuthorizeCommandRun(ctx context.Context, scope CommandRunScope) (bool, error)

func (CommandRunScopeAuthorizerFuncs) CommandRunSelector added in v0.121.3

type CommandRunScopeResolver added in v0.121.3

type CommandRunScopeResolver interface {
	ResolveCommandRunScope(context.Context, CommandRunUpdate) (CommandRunScope, error)
}

CommandRunScopeResolver derives trusted scope before an update crosses a transport boundary. Implementations must not trust command payload fields.

type CommandRunScopeResolverFunc added in v0.121.3

type CommandRunScopeResolverFunc func(context.Context, CommandRunUpdate) (CommandRunScope, error)

CommandRunScopeResolverFunc adapts a function into CommandRunScopeResolver.

func (CommandRunScopeResolverFunc) ResolveCommandRunScope added in v0.121.3

func (f CommandRunScopeResolverFunc) ResolveCommandRunScope(ctx context.Context, update CommandRunUpdate) (CommandRunScope, error)

type CommandRunSelector added in v0.121.3

type CommandRunSelector struct {
	Scope  CommandRunScope `json:"scope"`
	Global bool            `json:"global,omitempty"`
}

CommandRunSelector limits records and live updates to an authorized scope. Global must be granted explicitly; an empty selector matches only unscoped data.

func (CommandRunSelector) Matches added in v0.121.3

func (s CommandRunSelector) Matches(scope CommandRunScope) bool

Matches reports whether a trusted scope is visible through this selector. A missing selector dimension never grants access to data scoped by that dimension.

func (CommandRunSelector) Normalize added in v0.121.3

func (s CommandRunSelector) Normalize() CommandRunSelector

Normalize returns a selector with a normalized scope.

func (CommandRunSelector) Validate added in v0.121.3

func (s CommandRunSelector) Validate() error

Validate rejects global selectors combined with narrower filters.

type CommandRunStore added in v0.121.3

CommandRunStore persists the complete current projection independently from transient transport delivery. Implementations must return isolated records.

type CommandRunSubscriber added in v0.121.3

type CommandRunSubscriber interface {
	SubscribeCommandRuns(context.Context, CommandRunSelector, CommandRunHandler) (CommandRunSubscription, error)
}

CommandRunSubscriber creates scope-limited command-run subscriptions.

type CommandRunSubscription added in v0.121.3

type CommandRunSubscription interface {
	Ready() <-chan struct{}
	Errors() <-chan error
	Close(context.Context) error
}

CommandRunSubscription is owned by the runtime that creates it. Closing a subscription must not close an injected driver, router, or transport.

type CommandRunTransport added in v0.121.3

type CommandRunTransport interface {
	CommandRunPublisher
	CommandRunSubscriber
	Capabilities() CommandRunTransportCapabilities
}

CommandRunTransport combines publishing, subscribing, and capability reporting.

type CommandRunTransportCapabilities added in v0.121.3

type CommandRunTransportCapabilities struct {
	Name       string                        `json:"name"`
	Fanout     bool                          `json:"fanout"`
	Durability CommandRunTransportDurability `json:"durability"`
	Replay     bool                          `json:"replay"`
}

CommandRunTransportCapabilities describes delivery semantics for validation and diagnostics without exposing provider-specific types.

func DefaultLocalCommandRunTransportCapabilities added in v0.121.3

func DefaultLocalCommandRunTransportCapabilities() CommandRunTransportCapabilities

DefaultLocalCommandRunTransportCapabilities describes the zero-service hub.

func (CommandRunTransportCapabilities) Validate added in v0.121.3

Validate rejects incomplete or contradictory capability declarations.

type CommandRunTransportDurability added in v0.121.3

type CommandRunTransportDurability string

CommandRunTransportDurability describes whether transport delivery survives process or broker interruption. Snapshot persistence remains a store concern.

const (
	CommandRunTransportDurabilityEphemeral CommandRunTransportDurability = "ephemeral"
	CommandRunTransportDurabilityDurable   CommandRunTransportDurability = "durable"
)

type CommandRunUpdate added in v0.121.3

type CommandRunUpdate struct {
	SchemaVersion int                `json:"schema_version"`
	EventID       string             `json:"event_id"`
	RunID         string             `json:"run_id"`
	Revision      uint64             `json:"revision"`
	CommandID     string             `json:"command_id"`
	DispatchID    string             `json:"dispatch_id,omitempty"`
	CorrelationID string             `json:"correlation_id,omitempty"`
	Phase         CommandRunPhase    `json:"phase"`
	OccurredAt    time.Time          `json:"occurred_at"`
	StartedAt     *time.Time         `json:"started_at,omitempty"`
	DurationMS    *int64             `json:"duration_ms,omitempty"`
	Mode          string             `json:"mode,omitempty"`
	Checkpoint    string             `json:"checkpoint,omitempty"`
	Message       string             `json:"message,omitempty"`
	Current       *int64             `json:"current,omitempty"`
	Total         *int64             `json:"total,omitempty"`
	Attempt       int                `json:"attempt,omitempty"`
	MaxAttempts   int                `json:"max_attempts,omitempty"`
	Failure       *CommandRunFailure `json:"failure,omitempty"`
	Outcome       *CommandRunOutcome `json:"outcome,omitempty"`
	Scope         CommandRunScope    `json:"scope"`
	Metadata      map[string]any     `json:"metadata,omitempty"`
}

CommandRunUpdate is the transport-independent versioned lifecycle delta.

func NormalizeCommandRunUpdate added in v0.121.3

func NormalizeCommandRunUpdate(update CommandRunUpdate, limits CommandRunContractLimits) (CommandRunUpdate, error)

NormalizeCommandRunUpdate validates and normalizes a command-run update.

func (CommandRunUpdate) Clone added in v0.121.3

Clone returns a deep copy across ownership boundaries.

type CommandRunsDebugPanel added in v0.121.3

type CommandRunsDebugPanel struct {
	// contains filtered or unexported fields
}

CommandRunsDebugPanel exposes scoped command-run snapshots and lookup.

func NewCommandRunsDebugPanel added in v0.121.3

func NewCommandRunsDebugPanel(adm *Admin) *CommandRunsDebugPanel

func (*CommandRunsDebugPanel) Clear added in v0.121.3

Clear removes records only after repeating the complete authorization preflight immediately before the scope-wide store mutation.

func (*CommandRunsDebugPanel) ClearCheck added in v0.124.0

func (p *CommandRunsDebugPanel) ClearCheck(ctx context.Context) error

ClearCheck rejects scope-wide clear when any selected record is hidden.

func (*CommandRunsDebugPanel) Lookup added in v0.121.3

Lookup resolves an authorized row by run ID, dispatch ID, then correlation ID.

func (*CommandRunsDebugPanel) Snapshot added in v0.121.3

Snapshot returns only records visible to the authenticated request selector.

type CommandRunsSnapshot added in v0.121.3

type CommandRunsSnapshot []CommandRunRecord

CommandRunsSnapshot is the stable Command Runs panel snapshot payload. Every element is a complete row suitable for keyed replacement by run_id.

type CommandStatusEvent added in v0.99.0

type CommandStatusEvent struct {
	RunID           string `json:"run_id,omitempty"`
	Revision        uint64 `json:"revision,omitempty"`
	CorrelationID   string `json:"correlation_id,omitempty"`
	DispatchID      string `json:"dispatch_id,omitempty"`
	CommandID       string `json:"command_id,omitempty"`
	State           string `json:"state"`
	Mode            string `json:"mode,omitempty"`
	Message         string `json:"message,omitempty"`
	Code            string `json:"code,omitempty"`
	StatusReference string `json:"status_reference,omitempty"`
	At              string `json:"at,omitempty"`
}

CommandStatusEvent is broadcast over the debug WebSocket when a command is dispatched or transitions state, so the launcher reflects live status across every connected debug client. Host queue/async workers may publish these directly (see Admin.PublishCommandStatus) to report true completion of queued commands, which core go-admin cannot observe on its own.

type Config

type Config struct {
	Title               string            `json:"title"`
	BasePath            string            `json:"base_path"`
	URLs                URLConfig         `json:"urls"`
	DefaultLocale       string            `json:"default_locale"`
	Theme               string            `json:"theme"`
	ThemeVariant        string            `json:"theme_variant"`
	ThemeTokens         map[string]string `json:"theme_tokens"`
	ThemeTokenOverrides map[string]string `json:"theme_token_overrides,omitempty"`
	// ThemeAssets carries final resolved asset URLs/paths that override themed assets
	// after go-theme selection. Use reserved keys like "logo", "icon", and "favicon".
	ThemeAssets            map[string]string        `json:"theme_assets,omitempty"`
	ThemeAssetPrefix       string                   `json:"theme_asset_prefix"`
	PreviewSecret          string                   `json:"preview_secret"`
	PreviewURLAllowedHosts []string                 `json:"preview_url_allowed_hosts,omitempty"`
	CMSConfig              any                      `json:"cms_config"`
	CMS                    CMSOptions               `json:"cms"`
	Debug                  DebugConfig              `json:"debug"`
	Errors                 ErrorConfig              `json:"errors"`
	Deployment             DeploymentIdentityConfig `json:"deployment"`

	// LogoURL is the legacy override for the expanded/admin lockup asset.
	// Prefer ThemeAssets["logo"] for new integrations.
	LogoURL string `json:"logo_url"`
	// FaviconURL is the legacy override for the browser/app icon asset.
	// Prefer ThemeAssets["favicon"] for new integrations.
	FaviconURL string `json:"favicon_url"`
	CustomCSS  string `json:"custom_css"`
	CustomJS   string `json:"custom_js"`

	// LoginLogoPlacement changes only the login page composition. The selected
	// theme continues to own the logo/icon assets. Empty defaults to
	// "outside-card" for backward compatibility.
	LoginLogoPlacement LoginLogoPlacement `json:"login_logo_placement,omitempty"`

	// SidebarHideSearch removes the sidebar search slot from the admin shell.
	// It defaults to false so existing consumers keep the search field; set it
	// when the approved navigation design has no search affordance.
	SidebarHideSearch bool `json:"sidebar_hide_search,omitempty"`
	// SidebarCollapsePlacement moves the existing desktop collapse action
	// without changing its interaction contract. Empty defaults to "header".
	SidebarCollapsePlacement SidebarCollapsePlacement `json:"sidebar_collapse_placement,omitempty"`
	// SidebarUseInitialsAvatar keeps an empty avatar URL so the shared template
	// renders the identity initials fallback instead of the packaged image.
	SidebarUseInitialsAvatar bool `json:"sidebar_use_initials_avatar,omitempty"`
	// SidebarHidePresence suppresses the optional online/presence indicator.
	SidebarHidePresence bool `json:"sidebar_hide_presence,omitempty"`
	// SidebarHideUserMenuIndicator suppresses the optional disclosure arrow.
	SidebarHideUserMenuIndicator bool `json:"sidebar_hide_user_menu_indicator,omitempty"`
	// SidebarCompactFooter enables the compact shared utility/identity layout.
	SidebarCompactFooter bool `json:"sidebar_compact_footer,omitempty"`
	// DisabledDefaultModules lets hosts omit built-in product surfaces that are
	// outside their approved application composition. Empty preserves all
	// legacy default-module behavior.
	DisabledDefaultModules []DefaultModuleID `json:"disabled_default_modules,omitempty"`

	// ExternalAssets overrides the packaged third-party stylesheets and scripts
	// the admin document loads. Empty fields use the pinned copies embedded in
	// go-admin, so the default shell has no public-CDN dependency.
	ExternalAssets ExternalAssetConfig `json:"external_assets"`

	SettingsPermission                    string            `json:"settings_permission"`
	SettingsUpdatePermission              string            `json:"settings_update_permission"`
	FeatureFlagsViewPermission            string            `json:"feature_flags_view_permission"`
	FeatureFlagsUpdatePermission          string            `json:"feature_flags_update_permission"`
	SettingsThemeTokens                   map[string]string `json:"settings_theme_tokens"`
	NotificationsPermission               string            `json:"notifications_permission"`
	NotificationsUpdatePermission         string            `json:"notifications_update_permission"`
	NotificationsInspectPermission        string            `json:"notifications_inspect_permission"`
	NotificationsReceiptPermission        string            `json:"notifications_receipt_permission"`
	NotificationsRetentionPurgePermission string            `json:"notifications_retention_purge_permission"`
	ActivityPermission                    string            `json:"activity_permission"`
	// ActivityTabPermissionFailureMode controls how users detail activity tab handles
	// activity permission failures. Supported values:
	// - "strict": return a 403 error
	// - "inline": render tab-level unavailable state
	// - "": auto mode (strict in dev, inline otherwise)
	ActivityTabPermissionFailureMode     string                      `json:"activity_tab_permission_failure_mode"`
	ActivityActionLabels                 map[string]string           `json:"activity_action_labels"`
	ActivityFilterOptions                ActivityFilterOptionsConfig `json:"activity_filter_options"`
	JobsPermission                       string                      `json:"jobs_permission"`
	JobsTriggerPermission                string                      `json:"jobs_trigger_permission"`
	PreferencesPermission                string                      `json:"preferences_permission"`
	PreferencesUpdatePermission          string                      `json:"preferences_update_permission"`
	DashboardPreferencesPermission       string                      `json:"dashboard_preferences_permission"`
	DashboardPreferencesUpdatePermission string                      `json:"dashboard_preferences_update_permission"`
	PreferencesManageTenantPermission    string                      `json:"preferences_manage_tenant_permission"`
	PreferencesManageOrgPermission       string                      `json:"preferences_manage_org_permission"`
	PreferencesManageSystemPermission    string                      `json:"preferences_manage_system_permission"`
	ProfilePermission                    string                      `json:"profile_permission"`
	ProfileUpdatePermission              string                      `json:"profile_update_permission"`
	UsersPermission                      string                      `json:"users_permission"`
	UsersCreatePermission                string                      `json:"users_create_permission"`
	UsersImportPermission                string                      `json:"users_import_permission"`
	UsersUpdatePermission                string                      `json:"users_update_permission"`
	UsersDeletePermission                string                      `json:"users_delete_permission"`
	RolesPermission                      string                      `json:"roles_permission"`
	RolesCreatePermission                string                      `json:"roles_create_permission"`
	RolesUpdatePermission                string                      `json:"roles_update_permission"`
	RolesDeletePermission                string                      `json:"roles_delete_permission"`
	TenantsPermission                    string                      `json:"tenants_permission"`
	TenantsCreatePermission              string                      `json:"tenants_create_permission"`
	TenantsUpdatePermission              string                      `json:"tenants_update_permission"`
	TenantsDeletePermission              string                      `json:"tenants_delete_permission"`
	OrganizationsPermission              string                      `json:"organizations_permission"`
	OrganizationsCreatePermission        string                      `json:"organizations_create_permission"`
	OrganizationsUpdatePermission        string                      `json:"organizations_update_permission"`
	OrganizationsDeletePermission        string                      `json:"organizations_delete_permission"`
	MenuBuilderPermission                string                      `json:"menu_builder_permission"`
	MenuBuilderEditPermission            string                      `json:"menu_builder_edit_permission"`
	MenuBuilderPublishPermission         string                      `json:"menu_builder_publish_permission"`
	EntryNavigation                      EntryNavigationOptions      `json:"entry_navigation"`
	MediaPermission                      string                      `json:"media_permission"`
	MediaCreatePermission                string                      `json:"media_create_permission"`
	MediaUpdatePermission                string                      `json:"media_update_permission"`
	MediaDeletePermission                string                      `json:"media_delete_permission"`
	MediaDelivery                        MediaDeliveryConfig         `json:"media_delivery"`

	AuthConfig *AuthConfig `json:"auth_config"`

	EnhancedActions EnhancedActionNegotiationConfig `json:"enhanced_actions"`

	NavMenuCode string `json:"nav_menu_code"`
	NavDebug    bool   `json:"nav_debug"`
	NavDebugLog bool   `json:"nav_debug_log"`
	// NavEnvironment scopes managed admin navigation convergence and diagnostics.
	// Empty values fall back to Debug.Environment, then "default".
	NavEnvironment string `json:"nav_environment"`
	// NavPermissionDeniedMode controls whether denied navigation entries are
	// hidden or retained as disabled diagnostics. Empty and unknown values
	// normalize to "hide".
	NavPermissionDeniedMode NavigationPermissionDeniedMode `json:"nav_permission_denied_mode"`
	// NavRouteMissingPolicy controls route-missing module menu behavior.
	// Empty auto mode is strict in dev/test-like environments and report-only
	// otherwise. Explicit "strict" and "report" override auto behavior.
	NavRouteMissingPolicy NavigationRouteMissingPolicy `json:"nav_route_missing_policy"`

	FeatureFlagKeys    []string   `json:"feature_flag_keys"`
	FeatureCatalogPath string     `json:"feature_catalog_path"`
	EnablePublicAPI    bool       `json:"enable_public_api"`
	Site               SiteConfig `json:"site"`

	ScopeMode       string `json:"scope_mode"`
	DefaultTenantID string `json:"default_tenant_id"`
	DefaultOrgID    string `json:"default_org_id"`

	Commands CommandConfig  `json:"commands"`
	Routing  routing.Config `json:"routing"`
}

Config holds core admin settings and feature flags.

type ConsoleAccess added in v0.139.0

type ConsoleAccess struct {
	Resolve func(context.Context, console.Identity) (context.Context, console.Identity, error)
	Read    func(context.Context, console.Identity) error
	Panel   func(context.Context, console.Identity, console.PanelDefinition) bool
	Action  func(context.Context, console.Identity, string, string) bool
	Record  func(context.Context, console.Identity, string, console.Record) bool
	// DeliverRecord optionally replaces Record at the final delivery boundary.
	// It checks current policy and may redact Data, without loading source data
	// or running the potentially slow Project callback again. A false result
	// hides the record; an error fails delivery instead of masquerading as denial.
	DeliverRecord func(context.Context, console.Identity, string, console.Record) (console.Record, bool, error)
	// Project prepares detached presentation data before final authorization.
	Project func(context.Context, console.Identity, string, console.Record) console.Record
}

ConsoleAccess resolves current identity/grants on every operation and idle delivery tick. Resolve must consult current trusted session/account state; returning the original request's claims without revalidation is insufficient. Resolve must derive its returned context from the supplied context to retain request cancellation, snapshot deadlines and host shutdown.

type ConsoleDashboardConfig added in v0.139.0

type ConsoleDashboardConfig struct {
	Identity       func(AdminContext) (console.Identity, error)
	WidgetTemplate string
}

ConsoleDashboardConfig adapts the existing dashboard renderer and providers. Identity must resolve trusted viewer scope; the host then reloads current grants.

type ConsoleHost added in v0.139.0

type ConsoleHost struct {
	// contains filtered or unexported fields
}

ConsoleHost owns delivery and lifecycle, not the router or application's bus. Routes are registered once at startup; Close denies handlers without unmounting.

func NewConsoleHost added in v0.139.0

func NewConsoleHost(config ConsoleHostConfig) (*ConsoleHost, error)

func (*ConsoleHost) Close added in v0.139.0

func (h *ConsoleHost) Close() error

func (*ConsoleHost) DashboardArea added in v0.139.0

func (h *ConsoleHost) DashboardArea() string

func (*ConsoleHost) DashboardPage added in v0.139.0

func (h *ConsoleHost) DashboardPage(viewer AdminContext, identity console.Identity, template string) (AdminDashboardPage, error)

DashboardPage isolates layout preferences by the same full identity as records. It uses the existing service, renderer and typed page/chrome adapter.

func (*ConsoleHost) Events added in v0.139.0

func (h *ConsoleHost) Events() *console.EventStream

func (*ConsoleHost) Lookup added in v0.139.0

func (h *ConsoleHost) Lookup(ctx context.Context, identity console.Identity, panelID, recordKey string) (console.Record, error)

func (*ConsoleHost) Manifest added in v0.139.0

func (h *ConsoleHost) Manifest() ModuleManifest

func (*ConsoleHost) Options added in v0.139.2

Options serves one page of a paginated option source. The action must be executable for this actor and client, and the field must declare the source.

func (*ConsoleHost) Register added in v0.139.0

func (h *ConsoleHost) Register(ctx ModuleContext) error

func (*ConsoleHost) RegisterDashboard added in v0.139.0

func (h *ConsoleHost) RegisterDashboard(admin *Admin, config ConsoleDashboardConfig) error

RegisterDashboard registers before Admin.Initialize. Areas and providers are instance-namespaced; a collision fails instead of replacing another callback.

func (*ConsoleHost) RequestStatus added in v0.139.2

RequestStatus looks up the current actor's own submitted request. It needs panel read access, not the action's current declaration, because a submitted request can outlive the choice that produced it.

func (*ConsoleHost) RouteContract added in v0.139.0

func (h *ConsoleHost) RouteContract() routing.ModuleContract

func (*ConsoleHost) RunAction added in v0.139.0

RunAction dispatches one executable declaration for the request's client. Unavailable, hidden, undeclared, withdrawn and foreign-panel actions are refused; capability-dependent work additionally needs an advertised client handshake, so a page served to stale cached assets cannot execute it.

func (*ConsoleHost) SaveDashboardLayout added in v0.139.0

func (h *ConsoleHost) SaveDashboardLayout(ctx context.Context, identity console.Identity, overrides dashcmp.LayoutOverrides) error

func (*ConsoleHost) Snapshot added in v0.139.0

func (h *ConsoleHost) Snapshot(ctx context.Context, identity console.Identity) (console.Snapshot, error)

func (*ConsoleHost) Watch added in v0.139.0

func (h *ConsoleHost) Watch(ctx context.Context, identity console.Identity, panels []string, send func(any) error) error

Watch is the shared page/dashboard delivery adapter. Subscription precedes loading the snapshot; newer events are buffered. Every reconnect loads a fresh authorized snapshot, so no client cursor can replay retained foreign records.

type ConsoleHostConfig added in v0.139.0

type ConsoleHostConfig struct {
	ID, Title, FeatureKey string
	// RouteNamespace defaults to ID and isolates named routes from module identity.
	RouteNamespace  string
	Registry        *console.PanelRegistry
	Events          *console.EventStream
	Access          ConsoleAccess
	Enabled         func() bool
	RequestIdentity func(router.Context) (console.Identity, error)
	Snapshot        console.SnapshotSource
	// PrepareSnapshot optionally loads an invocation-owned projection shared by
	// panel sources and definition filters. It must preserve context cancellation.
	// Its context is never mutation authority or a cache of grants.
	PrepareSnapshot func(context.Context, console.Identity) (context.Context, error)
	// PrepareLookup supplies invocation-owned read data for lookup delivery.
	// Like PrepareSnapshot it must retain cancellation and never cache grants.
	PrepareLookup func(context.Context, console.Identity) (context.Context, error)
	// PrepareOptions loads and validates option declarations before registry
	// filtering, so provider/policy failures are not mistaken for missing actions.
	// It follows the same bounded, invocation-owned contract as PrepareLookup.
	PrepareOptions       func(context.Context, console.Identity) (context.Context, error)
	Lookup               console.LookupSource
	RenderPage           func(router.Context, console.Bootstrap) error
	PreferencesNamespace string
	LoadPreferences      func(context.Context, string) ([]string, error)
	SavePreferences      func(context.Context, string, []string) error
	RevalidateInterval   time.Duration
	SnapshotTimeout      time.Duration
	// Invalidated may be a broadcast host signal. Idle checks remain mandatory.
	Invalidated <-chan struct{}
}

ConsoleHostConfig composes services and policy with an independent console. Page rendering remains an adapter so shared hosting never owns product markup.

type ConsolePanelWidgetPayload added in v0.139.0

type ConsolePanelWidgetPayload struct {
	console.Identity
	Panel     console.PanelSnapshot `json:"panel"`
	Watermark uint64                `json:"watermark"`
}

type ContentPreviewPathOptions added in v0.96.0

type ContentPreviewPathOptions struct {
	// AllowSlugFallback permits deriving a public preview path from record.slug.
	// Callers should only enable this for routed/deliverable content types.
	AllowSlugFallback bool
}

ContentPreviewPathOptions controls how preview URLs are inferred from content records when no explicit path or preview_url is present.

type ContentTranslation added in v0.24.0

type ContentTranslation = cmsinterfaces.ContentTranslation

ContentTranslation mirrors the go-cms content translation DTO.

type ContentTypeBuilderModule added in v0.23.0

type ContentTypeBuilderModule struct {
	// contains filtered or unexported fields
}

ContentTypeBuilderModule wires the content type builder UI and dynamic panels.

func NewContentTypeBuilderModule added in v0.23.0

func NewContentTypeBuilderModule(opts ...ContentTypeBuilderOption) *ContentTypeBuilderModule

NewContentTypeBuilderModule constructs a content type builder module.

func (*ContentTypeBuilderModule) AfterMenuSeed added in v0.24.0

func (m *ContentTypeBuilderModule) AfterMenuSeed(ctx context.Context, admin *Admin) error

AfterMenuSeed refreshes panels/navigation after menu seeding.

func (*ContentTypeBuilderModule) Manifest added in v0.23.0

Manifest describes the module metadata.

func (*ContentTypeBuilderModule) MenuItems added in v0.23.0

func (m *ContentTypeBuilderModule) MenuItems(locale string) []MenuItem

MenuItems contributes navigation for content modeling. TODO: we should be able to configure menu icons

func (*ContentTypeBuilderModule) Register added in v0.23.0

func (m *ContentTypeBuilderModule) Register(ctx ModuleContext) error

Register wires the module panels, commands, and dynamic panel registration.

func (*ContentTypeBuilderModule) RouteContract added in v0.27.0

func (m *ContentTypeBuilderModule) RouteContract() routing.ModuleContract

type ContentTypeBuilderOption added in v0.23.0

type ContentTypeBuilderOption func(*ContentTypeBuilderModule)

ContentTypeBuilderOption configures the content type builder module.

func WithContentTypeBuilderBasePath added in v0.23.0

func WithContentTypeBuilderBasePath(path string) ContentTypeBuilderOption

WithContentTypeBuilderBasePath configures the module base path.

func WithContentTypeBuilderEntryMenuParent added in v0.24.0

func WithContentTypeBuilderEntryMenuParent(menuParent string) ContentTypeBuilderOption

WithContentTypeBuilderEntryMenuParent configures the menu parent for content type entry panels.

func WithContentTypeBuilderGuardrails added in v0.23.0

func WithContentTypeBuilderGuardrails(guardrails *SchemaGuardrails) ContentTypeBuilderOption

WithContentTypeBuilderGuardrails sets custom schema guardrails.

func WithContentTypeBuilderMenu added in v0.23.0

func WithContentTypeBuilderMenu(menuCode, menuParent string) ContentTypeBuilderOption

WithContentTypeBuilderMenu configures the menu code + parent.

func WithContentTypeBuilderPanelFactory added in v0.23.0

func WithContentTypeBuilderPanelFactory(factory *DynamicPanelFactory) ContentTypeBuilderOption

WithContentTypeBuilderPanelFactory injects a custom panel factory.

func WithContentTypeBuilderPermission added in v0.23.0

func WithContentTypeBuilderPermission(permission string) ContentTypeBuilderOption

WithContentTypeBuilderPermission sets the module permission guard.

func WithContentTypeBuilderPreviewFallback added in v0.24.0

func WithContentTypeBuilderPreviewFallback(fallback SchemaPreviewFallback) ContentTypeBuilderOption

WithContentTypeBuilderPreviewFallback sets a fallback renderer for preview errors.

func WithContentTypeBuilderRateLimiter added in v0.23.0

func WithContentTypeBuilderRateLimiter(limiter *RateLimiter) ContentTypeBuilderOption

WithContentTypeBuilderRateLimiter sets a custom rate limiter.

func WithContentTypeBuilderSchemaValidator added in v0.23.0

func WithContentTypeBuilderSchemaValidator(validator SchemaValidator) ContentTypeBuilderOption

WithContentTypeBuilderSchemaValidator injects a schema validator.

func WithContentTypeBuilderWorkflow added in v0.24.0

func WithContentTypeBuilderWorkflow(workflow WorkflowEngine) ContentTypeBuilderOption

WithContentTypeBuilderWorkflow sets a workflow engine for content type builder panels.

func WithContentTypeBuilderWorkflowAuthorizer added in v0.24.0

func WithContentTypeBuilderWorkflowAuthorizer(authorizer WorkflowAuthorizer) ContentTypeBuilderOption

WithContentTypeBuilderWorkflowAuthorizer sets a workflow authorizer for builder panels.

type ContentTypeCapabilityContracts added in v0.26.0

type ContentTypeCapabilityContracts struct {
	Normalized           map[string]any    `json:"normalized"`
	Delivery             map[string]any    `json:"delivery"`
	Navigation           map[string]any    `json:"navigation"`
	Search               map[string]any    `json:"search"`
	Validation           map[string]string `json:"validation"`
	MigratedDeliveryMenu bool              `json:"migrated_delivery_menu"`
}

ContentTypeCapabilityContracts captures normalized capability payloads and validation metadata used by admin and quickstart callers.

func ParseContentTypeCapabilityContracts added in v0.26.0

func ParseContentTypeCapabilityContracts(capabilities map[string]any) ContentTypeCapabilityContracts

ParseContentTypeCapabilityContracts resolves normalized capability contracts from a raw capabilities payload.

func ReadContentTypeCapabilityContracts added in v0.26.0

func ReadContentTypeCapabilityContracts(contentType CMSContentType) ContentTypeCapabilityContracts

ReadContentTypeCapabilityContracts resolves normalized capability contracts from a full CMS content type payload.

type ContentTypeCreateMsg added in v0.23.0

type ContentTypeCreateMsg struct {
	ContentType CMSContentType `json:"content_type"`
}

ContentTypeCreateMsg is a command payload for creating content types.

func (ContentTypeCreateMsg) Type added in v0.23.0

func (ContentTypeCreateMsg) Validate added in v0.23.0

func (m ContentTypeCreateMsg) Validate() error

type ContentTypeDeleteMsg added in v0.23.0

type ContentTypeDeleteMsg struct {
	ID string `json:"id"`
}

ContentTypeDeleteMsg is a command payload for deleting content types.

func (ContentTypeDeleteMsg) Type added in v0.23.0

func (ContentTypeDeleteMsg) Validate added in v0.23.0

func (m ContentTypeDeleteMsg) Validate() error

type ContentTypePublishMsg added in v0.23.0

type ContentTypePublishMsg struct {
	ID                   string `json:"id"`
	Status               string `json:"status"`
	AllowBreakingChanges bool   `json:"allow_breaking_changes"`
}

ContentTypePublishMsg is a command payload for publishing content types.

func (ContentTypePublishMsg) Type added in v0.23.0

func (ContentTypePublishMsg) Validate added in v0.23.0

func (m ContentTypePublishMsg) Validate() error

type ContentTypeUpdateMsg added in v0.23.0

type ContentTypeUpdateMsg struct {
	ContentType CMSContentType `json:"content_type"`
}

ContentTypeUpdateMsg is a command payload for updating content types.

func (ContentTypeUpdateMsg) Type added in v0.23.0

func (ContentTypeUpdateMsg) Validate added in v0.23.0

func (m ContentTypeUpdateMsg) Validate() error

type ContextMessageFactory added in v0.126.8

type ContextMessageFactory func(ctx context.Context, payload map[string]any, ids []string) (command.Message, error)

ContextMessageFactory builds typed command messages from request data and the effective dispatch context.

type ContextSettingsAdapter added in v0.140.0

type ContextSettingsAdapter interface {
	ResolveContext(context.Context, string, string) (ResolvedSetting, error)
	ResolveAllContext(context.Context, string) (map[string]ResolvedSetting, error)
}

ContextSettingsAdapter optionally propagates resolution errors and cancellation.

type ConvertedFields added in v0.23.0

type ConvertedFields struct {
	List    []Field  `json:"list"`
	Form    []Field  `json:"form"`
	Detail  []Field  `json:"detail"`
	Filters []Filter `json:"filters"`
}

ConvertedFields captures the derived list/form/detail fields and filters.

type CountTranslator added in v0.52.0

type CountTranslator interface {
	TranslateCount(locale, key string, count int, args ...any) (string, error)
}

CountTranslator resolves pluralized i18n keys into localized strings. Implementations can opt into this richer contract without replacing the baseline Translator interface.

type CurrentContextResolver added in v0.139.0

type CurrentContextResolver interface {
	ResolveCurrentContext(context.Context) (context.Context, error)
}

CurrentContextResolver is an optional authenticator capability for long-lived delivery. It reloads current account/session/grants from trusted host state.

type CustomLogEntry added in v0.14.0

type CustomLogEntry struct {
	Timestamp time.Time      `json:"timestamp"`
	Category  string         `json:"category"`
	Message   string         `json:"message"`
	Fields    map[string]any `json:"fields,omitempty"`
}

CustomLogEntry captures custom debug logs.

type Dashboard

type Dashboard struct {
	// contains filtered or unexported fields
}

Dashboard orchestrates widget providers and instances.

func NewDashboard

func NewDashboard() *Dashboard

NewDashboard constructs a dashboard registry with in-memory defaults.

func (*Dashboard) AddDefaultInstance

func (d *Dashboard) AddDefaultInstance(area, defCode string, cfg map[string]any, span int, locale string)

AddDefaultInstance stores a default widget instance (used when no CMS/prefs are present).

func (*Dashboard) Areas

func (d *Dashboard) Areas() []WidgetAreaDefinition

Areas returns known widget areas sorted by code.

func (*Dashboard) EnforceKnownAreas

func (d *Dashboard) EnforceKnownAreas(enable bool)

EnforceKnownAreas toggles validation to prevent default instances from using unknown areas.

func (*Dashboard) HasProvider added in v0.28.0

func (d *Dashboard) HasProvider(code string) bool

HasProvider reports whether a provider with the given code is already registered.

func (*Dashboard) HasRenderer

func (d *Dashboard) HasRenderer() bool

HasRenderer returns true if a renderer is configured.

func (*Dashboard) Page added in v0.34.0

func (d *Dashboard) Page(ctx AdminContext) (dashcmp.Page, error)

Page resolves the canonical typed dashboard page for the current viewer.

func (*Dashboard) Providers

func (d *Dashboard) Providers() []DashboardProviderSpec

Providers returns registered provider metadata.

func (*Dashboard) RegisterArea

func (d *Dashboard) RegisterArea(def WidgetAreaDefinition)

RegisterArea registers a dashboard widget area for provider/default-instance use.

func (*Dashboard) RegisterManifest

func (d *Dashboard) RegisterManifest(providers []DashboardProviderSpec)

RegisterManifest bulk registers providers (lightweight manifest discovery hook).

func (*Dashboard) RegisterProvider

func (d *Dashboard) RegisterProvider(spec DashboardProviderSpec)

RegisterProvider registers a widget provider and optional default instance.

Invalid specifications retain the historical best-effort behavior and are ignored. Hosts that need registration failures surfaced during startup should use RegisterProviderChecked.

func (*Dashboard) RegisterProviderChecked added in v0.126.7

func (d *Dashboard) RegisterProviderChecked(spec DashboardProviderSpec) error

RegisterProviderChecked registers a widget provider and reports invalid provider metadata to the host.

func (*Dashboard) Resolve

func (d *Dashboard) Resolve(ctx AdminContext) ([]map[string]any, error)

Resolve returns widgets for a viewer, applying per-user preferences when present.

func (*Dashboard) SetUserLayout

func (d *Dashboard) SetUserLayout(userID string, instances []DashboardWidgetInstance)

SetUserLayout stores per-user layout/preferences.

func (*Dashboard) SetUserLayoutWithContext

func (d *Dashboard) SetUserLayoutWithContext(ctx AdminContext, instances []DashboardWidgetInstance)

SetUserLayoutWithContext stores layouts with actor metadata for activity sinks.

func (*Dashboard) WithActivitySink

func (d *Dashboard) WithActivitySink(sink ActivitySink)

WithActivitySink wires an activity sink for layout or widget changes.

func (*Dashboard) WithAuthorizer

func (d *Dashboard) WithAuthorizer(authz Authorizer)

WithAuthorizer sets the authorizer for role/permission visibility.

func (*Dashboard) WithCommandBus

func (d *Dashboard) WithCommandBus(bus *CommandBus)

WithCommandBus wires the command bus so providers can expose commands.

func (*Dashboard) WithLogger added in v0.25.0

func (d *Dashboard) WithLogger(logger Logger)

WithLogger sets the runtime logger used by dashboard internals.

func (*Dashboard) WithPreferenceService

func (d *Dashboard) WithPreferenceService(service *PreferencesService)

WithPreferenceService wires the PreferencesService used for go-dashboard overrides.

func (*Dashboard) WithPreferences

func (d *Dashboard) WithPreferences(store DashboardPreferences)

WithPreferences sets the preference store used for per-user layouts.

func (*Dashboard) WithRegistry

func (d *Dashboard) WithRegistry(reg *Registry)

WithRegistry wires the shared registry for discovery/use by other transports.

func (*Dashboard) WithRenderer

func (d *Dashboard) WithRenderer(renderer DashboardRenderer)

WithRenderer sets the dashboard renderer for HTML generation. When set, enables server-side rendering of dashboard HTML.

func (*Dashboard) WithWidgetService

func (d *Dashboard) WithWidgetService(svc CMSWidgetService)

WithWidgetService wires a CMS widget service for definitions/instances.

type DashboardAssetOwnershipProvider added in v0.120.3

type DashboardAssetOwnershipProvider interface {
	DashboardAssetsManagedExternally() bool
}

DashboardAssetOwnershipProvider is an optional router capability for hosts that mount go-dashboard's embedded assets on a dedicated static surface. Admin dashboard initialization uses it to avoid registering duplicate static routes through the admin surface.

type DashboardDiagnosticsMsg added in v0.24.0

type DashboardDiagnosticsMsg struct {
	Locale string `json:"locale,omitempty"`
	Area   string `json:"area,omitempty"`
}

DashboardDiagnosticsMsg requests dashboard diagnostics for a locale/area.

func (DashboardDiagnosticsMsg) Type added in v0.24.0

Type identifies the dashboard diagnostics query.

type DashboardDiagnosticsReport added in v0.24.0

type DashboardDiagnosticsReport struct {
	Locale           string                       `json:"locale"`
	Diagnostics      dashcmp.DashboardDiagnostics `json:"diagnostics"`
	Catalog          dashcmp.CatalogSnapshot      `json:"catalog"`
	Page             *AdminDashboardPage          `json:"page,omitempty"`
	Providers        int                          `json:"providers"`
	Definitions      int                          `json:"definitions"`
	Instances        int                          `json:"instances"`
	InstancesByArea  map[string]int               `json:"instances_by_area"`
	WidgetService    string                       `json:"widget_service,omitempty"`
	HasWidgetService bool                         `json:"has_widget_service"`
}

DashboardDiagnosticsReport captures resolved dashboard state for troubleshooting.

type DashboardHandle

type DashboardHandle = Dashboard

DashboardHandle and MenuHandle are kept for API compatibility and now alias real services.

type DashboardLayoutOverrides

type DashboardLayoutOverrides struct {
	Locale        string                          `json:"locale,omitempty"`
	AreaOrder     map[string][]string             `json:"area_order,omitempty"`
	AreaRows      map[string][]DashboardLayoutRow `json:"area_rows,omitempty"`
	HiddenWidgets map[string]bool                 `json:"hidden_widgets,omitempty"`
}

DashboardLayoutOverrides persists go-dashboard layout adjustments.

type DashboardLayoutRow

type DashboardLayoutRow struct {
	Widgets []DashboardLayoutSlot `json:"widgets,omitempty"`
}

DashboardLayoutRow captures widget slots on a single row.

type DashboardLayoutSlot

type DashboardLayoutSlot struct {
	ID    string `json:"id,omitempty"`
	Width int    `json:"width,omitempty"`
}

DashboardLayoutSlot describes a widget placement and width.

type DashboardPreferences

type DashboardPreferences = dashinternal.DashboardPreferences

DashboardPreferences stores per-user layouts.

func NewDashboardPreferencesAdapter

func NewDashboardPreferencesAdapter(service *PreferencesService) DashboardPreferences

NewDashboardPreferencesAdapter bridges PreferencesService into the DashboardPreferences contract. When the service is nil, it falls back to in-memory preferences.

type DashboardPreferencesWithContext

type DashboardPreferencesWithContext = dashinternal.DashboardPreferencesWithContext

DashboardPreferencesWithContext allows contextual access to preferences (for activity/locale-aware stores).

type DashboardProviderMsg added in v0.12.0

type DashboardProviderMsg struct {
	CommandName string         `json:"command_name"`
	Code        string         `json:"code"`
	Config      map[string]any `json:"config"`
}

DashboardProviderMsg routes dashboard provider commands.

func (DashboardProviderMsg) Type added in v0.12.0

func (DashboardProviderMsg) Validate added in v0.12.0

func (m DashboardProviderMsg) Validate() error

type DashboardProviderSpec

type DashboardProviderSpec struct {
	Code           string         `json:"code"`
	Name           string         `json:"name"`
	Template       string         `json:"template,omitempty"`
	Schema         map[string]any `json:"schema,omitempty"`
	DefaultArea    string         `json:"default_area,omitempty"`
	DefaultConfig  map[string]any `json:"default_config,omitempty"`
	DefaultSpan    int            `json:"default_span,omitempty"`
	Permission     string         `json:"permission,omitempty"`
	Schedule       string         `json:"schedule,omitempty"`
	Description    string         `json:"description,omitempty"`
	CommandName    string         `json:"command_name,omitempty"`
	VisibilityRole []string       `json:"visibility_role,omitempty"`
	Handler        WidgetProvider `json:"-"`
}

DashboardProviderSpec captures provider metadata and behavior.

type DashboardRenderer

type DashboardRenderer interface {
	RenderPage(name string, page AdminDashboardPage, out ...io.Writer) (string, error)
}

DashboardRenderer defines the typed renderer contract used by go-admin. Host chrome is composed at the route edge and passed alongside the canonical go-dashboard page model.

type DashboardRendererFunc added in v0.34.0

type DashboardRendererFunc func(name string, page AdminDashboardPage, out ...io.Writer) (string, error)

DashboardRendererFunc adapts a function to DashboardRenderer.

func (DashboardRendererFunc) RenderPage added in v0.34.0

func (fn DashboardRendererFunc) RenderPage(name string, page AdminDashboardPage, out ...io.Writer) (string, error)

RenderPage implements DashboardRenderer.

type DashboardWidgetInstance

type DashboardWidgetInstance = dashinternal.DashboardWidgetInstance

DashboardWidgetInstance represents a widget placed in an area.

type DataActionChoice added in v0.139.0

type DataActionChoice struct {
	Kind  admindata.Kind
	Label string
	Input admindata.Input
	// ReceiptInput lets an operator choose a retained receipt from a paginated
	// picker. Service policy and receipt identity remain authoritative.
	ReceiptInput bool
	// DefaultReceiptID preselects the picker (the scenario's latest receipt).
	DefaultReceiptID string
	// Title and DatasetTitle are the human names of the selected scenario and dataset.
	Title, DatasetTitle string
	// Availability marks a visible, disabled declaration (not permitted or
	// unsupported) explained by Reason. Empty means executable.
	Availability, Reason string
	// RetryOf is the terminal failed or canceled operation Try again repeats
	// as new work with the same input.
	RetryOf string
	// Steps are the scenario's lifecycle position shown in the drawer.
	Steps []console.PanelUIStep
	// Current is the target's current activation, for before/after confirmations.
	Current *DataTargetSummary
}

DataActionChoice is one lifecycle action the current actor may start, or a visible unavailable one. The module derives choices from authorized reads and current capabilities; Input binds the selected work; the operator supplies request options and, for ReceiptInput actions, a retained receipt. Generation is captured in the action payload. The presentation fields are optional: they name the work for people and feed drawers and confirmations.

type DataActionLabels added in v0.139.4

type DataActionLabels struct {
	Scenario string
	Target   string
}

DataActionLabels name the work an outcome describes, for people.

type DataCheckView added in v0.139.0

type DataCheckView struct {
	Origin         admindata.Kind
	OperationID    string
	VerificationID string
	ReceiptID      string
	DryRun         bool
	Check          admindata.Check
	Scenario       admindata.ScenarioRef
	ScenarioTitle  string
}

DataCheckView is one check from a validation, verification or dry-run plan. Checks from a dry run are always presented as planned, never as executed.

type DataCoverageView added in v0.139.0

type DataCoverageView struct {
	VerificationID string
	ReceiptID      string
	Coverage       admindata.Coverage
	Scenario       admindata.ScenarioRef
	ScenarioTitle  string
}

DataCoverageView is one verified sample period.

type DataExplorationURLs added in v0.139.3

type DataExplorationURLs struct {
	Insights string `json:"-"`
	Compare  string `json:"-"`
	Metadata string `json:"metadata"`
	Samples  string `json:"samples"`
	Related  string `json:"related"`
}

type DataInsightsURLs added in v0.139.3

type DataInsightsURLs struct {
	Insights string `json:"insights"`
	Compare  string `json:"compare"`
}

type DataModule added in v0.139.0

type DataModule struct {
	// contains filtered or unexported fields
}

DataModule owns its console and command registrations, never the provider, target or operation store. Close it before closing those application resources.

func NewDataModule added in v0.139.0

func NewDataModule(cfg DataModuleConfig) (*DataModule, error)

func (*DataModule) Close added in v0.139.0

func (m *DataModule) Close() error

func (*DataModule) Console added in v0.139.0

func (m *DataModule) Console() *ConsoleHost

Console exposes the instance host for authorized snapshots and dashboard adapters.

func (*DataModule) Maintenance added in v0.139.4

func (m *DataModule) Maintenance() *data.MaintenanceService

Maintenance exposes optional native status/commands for application chrome.

func (*DataModule) Manifest added in v0.139.0

func (m *DataModule) Manifest() ModuleManifest

func (*DataModule) MenuItems added in v0.139.0

func (m *DataModule) MenuItems(locale string) []MenuItem

func (*DataModule) Register added in v0.139.0

func (m *DataModule) Register(ctx ModuleContext) error

func (*DataModule) RouteContract added in v0.139.0

func (m *DataModule) RouteContract() routing.ModuleContract

type DataModuleConfig added in v0.139.0

type DataModuleConfig struct {
	// Maintenance is opt-in. Hosts retain controller lifetime and domain adapters.
	Maintenance     *data.MaintenanceService
	PreviewSurfaces map[string]DataPreviewSurface
	Service         *data.Service
	TargetID        string
	BasePath        string
	Enabled         func() bool
	ResolveIdentity func(context.Context) (console.Identity, error)
	MenuParent      string
	// ReceiptLimit bounds overview/action evidence. Older retained receipts remain
	// usable through the explicit receipt controls; the active receipt is pinned.
	ReceiptLimit int
}

DataModuleConfig binds application-owned lifecycle adapters to the Data UI. ResolveIdentity must revalidate current account/session state on every call; Service must use the same trusted actor/scope and independently enforce policy. Enabled is a current Data feature gate, independent of Debug.

type DataOperationView added in v0.139.4

type DataOperationView struct {
	Operation                   admindata.Operation
	ScenarioTitle, DatasetTitle string
	Actions                     []console.PanelUIActionRef
}

DataOperationView is one operation with optional presentation.

type DataOverviewCounts added in v0.139.0

type DataOverviewCounts struct {
	Datasets  int
	Scenarios int
	Running   int
	Failed    int
}

DataOverviewCounts are totals over records the current actor may read.

type DataOverviewView added in v0.139.0

type DataOverviewView struct {
	Targets         []DataTargetView
	Capabilities    map[admindata.Kind]admindata.Capability
	LatestOperation *admindata.Operation
	Counts          DataOverviewCounts
	// UpNext are the scenarios waiting on a lifecycle step, most ready first.
	UpNext []DataScenarioView
	// Recent are the most recent operations the actor may read, newest first.
	Recent []DataOperationView
}

DataOverviewView supplies the overview's single record: managed targets, the scenarios waiting on a step, the most recent operations and anything that needs attention, which the projection derives from those.

type DataPanelActions added in v0.139.0

type DataPanelActions struct {
	Choices  func(context.Context) ([]DataActionChoice, error)
	Dispatch func(context.Context, admindata.Kind, admindata.Input) (admindata.Result, error)
	Options  console.PanelOptionResolver
	Requests console.PanelRequestResolver
}

DataPanelActions binds module dispatch to the Data presentation. Choices is called for every authorized definition and again before dispatch, so a choice that is no longer offered cannot run. Dispatch runs the registered typed command for the current trusted actor. Options and Requests are the module's receipt picker and pending-request resolvers.

type DataPreviewPage added in v0.139.3

type DataPreviewPage struct {
	Session data.ApplicationPreviewSession
	// Title names the application view; it defaults to the surface ID.
	Title string
	// ScenarioTitle and DatasetTitle are the declared human names of the pinned
	// selection; they default to its identifiers.
	ScenarioTitle, DatasetTitle string
	// Routes are the module's resolved preview route templates.
	Routes DataPreviewURLs
	// DataPage is the Data page path; the Return link adds the exact selection.
	DataPage string
	// AssetBase is the admin asset base path (the layout's asset_base_path).
	AssetBase string
	// CSRFToken is the page's CSRF form token; Close sends it.
	CSRFToken string
	// Now is the server clock, so the page can show expiry on it.
	Now time.Time
	// Body is trusted host-rendered HTML from an escaping template.
	// Never pass raw user input or unescaped model values here.
	Body []byte
}

DataPreviewPage is the input of one preview page: the delivered session, the host's view fragment and the module routes the chrome links to. Custom preview transports render HTML surfaces through RenderDataPreviewPage too.

type DataPreviewSurface added in v0.139.3

type DataPreviewSurface struct {
	Read   func(context.Context, data.PreviewReadContext) (any, error)
	Render func(context.Context, data.PreviewReadContext, any) ([]byte, error)
	Label  string
}

Render builds bytes without writing a response. Authorization is sealed AFTER all application query and template work, before the transport discloses bytes. Read must require the installed isolated context, never use a default route. Render returns the application's view as an HTML fragment; the module wraps it in the preview chrome (see data_preview_panels.go). Label names the view in that chrome and defaults to the surface ID.

type DataPreviewURLs added in v0.139.3

type DataPreviewURLs struct {
	Capabilities string `json:"capabilities"`
	Open         string `json:"open"`
	Session      string `json:"session"`
	Close        string `json:"close"`
	Surface      string `json:"surface"`
	API          string `json:"api"`
}

type DataScenarioView added in v0.139.0

type DataScenarioView struct {
	Scenario admindata.ScenarioRef
	TargetID string
	Receipt  *admindata.PreparationReceipt
	Active   bool
	// Title, Summary and DatasetTitle are the declared names; empty falls back
	// to identifiers.
	Title, Summary, DatasetTitle string
	// UpdatedAt is the latest operation on this scenario and target, if known.
	UpdatedAt time.Time
	// Actions are the scenario's declared action references for its panel.
	Actions []console.PanelUIActionRef
}

DataScenarioView is one scenario, optionally with its latest preparation on a target. Active reports that the receipt is the target's active receipt.

type DataTargetSummary added in v0.139.4

type DataTargetSummary struct {
	TargetID      string
	ScenarioTitle string
	ReceiptID     string
	Generation    uint64
	Ready         bool
}

DataTargetSummary is the safe current state of a target for confirmations.

type DataTargetView added in v0.139.0

type DataTargetView struct {
	State   admindata.ActiveState
	Receipt *admindata.PreparationReceipt
	// ScenarioTitle and DatasetTitle name the active receipt for people.
	ScenarioTitle, DatasetTitle string
	// Actions are this target's declared action references (recover, reset).
	Actions []console.PanelUIActionRef
}

DataTargetView is one managed target from the service's safe ActiveState read model. Receipt is the target's active receipt when known; a receipt that is not the active one is ignored. Titles and Actions are optional presentation supplied by the module.

type DebugCollector added in v0.14.0

type DebugCollector struct {
	// contains filtered or unexported fields
}

DebugCollector aggregates debug data from multiple sources.

func NewDebugCollector added in v0.14.0

func NewDebugCollector(cfg DebugConfig) *DebugCollector

NewDebugCollector initializes a collector with the provided configuration.

func (*DebugCollector) CaptureConfigSnapshot added in v0.14.0

func (c *DebugCollector) CaptureConfigSnapshot(snapshot map[string]any)

CaptureConfigSnapshot stores a config snapshot for the config panel.

func (*DebugCollector) CaptureJSError added in v0.24.0

func (c *DebugCollector) CaptureJSError(entry JSErrorEntry)

CaptureJSError records a frontend JavaScript error.

func (*DebugCollector) CaptureLog added in v0.14.0

func (c *DebugCollector) CaptureLog(entry LogEntry)

CaptureLog adds a log entry.

func (*DebugCollector) CaptureRequest added in v0.14.0

func (c *DebugCollector) CaptureRequest(entry RequestEntry)

CaptureRequest logs an HTTP request.

func (*DebugCollector) CaptureRoutes added in v0.14.0

func (c *DebugCollector) CaptureRoutes(routes []RouteEntry)

CaptureRoutes stores a routes snapshot for the routes panel.

func (*DebugCollector) CaptureSQL added in v0.14.0

func (c *DebugCollector) CaptureSQL(entry SQLEntry)

CaptureSQL logs a database query.

func (*DebugCollector) CaptureSession added in v0.14.0

func (c *DebugCollector) CaptureSession(session map[string]any)

CaptureSession stores session information.

func (*DebugCollector) CaptureTemplateData added in v0.14.0

func (c *DebugCollector) CaptureTemplateData(viewCtx router.ViewContext)

CaptureTemplateData stores the current template context.

func (*DebugCollector) Clear added in v0.14.0

func (c *DebugCollector) Clear()

Clear removes all stored debug data across panels.

func (*DebugCollector) ClearPanel added in v0.14.0

func (c *DebugCollector) ClearPanel(panelID string) bool

ClearPanel removes stored data for a single panel.

func (*DebugCollector) ClearPanelStrictWithContext added in v0.124.0

func (c *DebugCollector) ClearPanelStrictWithContext(ctx context.Context, panelID string) (bool, error)

ClearPanelStrictWithContext clears one panel and returns any registered authorization or mutation error to the initiating client.

func (*DebugCollector) ClearPanelWithContext added in v0.121.3

func (c *DebugCollector) ClearPanelWithContext(ctx context.Context, panelID string) bool

ClearPanelWithContext clears a panel while retaining authenticated scope for registered clear hooks.

func (*DebugCollector) ClearPanelsStrictWithContext added in v0.124.0

func (c *DebugCollector) ClearPanelsStrictWithContext(ctx context.Context, panelIDs []string) (bool, error)

ClearPanelsStrictWithContext clears an explicit panel batch as one collector transaction. All targets and clear checks are resolved before mutation. Batches with more than one external registered clear are rejected because the collector cannot provide an atomic transaction across independent stores.

func (*DebugCollector) ClearStrictWithContext added in v0.124.0

func (c *DebugCollector) ClearStrictWithContext(ctx context.Context) error

ClearStrictWithContext preflights every enabled registered panel before mutating any collector state, then propagates clear failures to the caller.

func (*DebugCollector) ClearWithContext added in v0.121.3

func (c *DebugCollector) ClearWithContext(ctx context.Context)

ClearWithContext removes stored debug data and preserves request scope for registered panel clear hooks.

func (*DebugCollector) Get added in v0.14.0

func (c *DebugCollector) Get(key string) (any, bool)

Get retrieves custom debug data.

func (*DebugCollector) Log added in v0.14.0

func (c *DebugCollector) Log(category, message string, fields ...any)

Log adds a custom debug message.

func (*DebugCollector) PanelDefinitions added in v0.17.0

func (c *DebugCollector) PanelDefinitions() []debugregistry.PanelDefinition

PanelDefinitions returns metadata for enabled panels.

func (*DebugCollector) PanelDefinitionsWithContext added in v0.88.0

func (c *DebugCollector) PanelDefinitionsWithContext(ctx context.Context) []debugregistry.PanelDefinition

PanelDefinitionsWithContext returns metadata for enabled panels using the provided context.

func (*DebugCollector) PublishEvent added in v0.17.0

func (c *DebugCollector) PublishEvent(eventType string, payload any)

PublishEvent emits a custom debug event by event type.

func (*DebugCollector) PublishPanel added in v0.16.0

func (c *DebugCollector) PublishPanel(panelID string, payload any)

PublishPanel stores a custom panel snapshot and publishes it to subscribers.

func (*DebugCollector) RegisterPanel added in v0.14.0

func (c *DebugCollector) RegisterPanel(panel DebugPanel)

RegisterPanel adds a custom debug panel.

func (*DebugCollector) RunPanelAction added in v0.69.0

RunPanelAction dispatches a schema-declared action to its registered handler.

func (*DebugCollector) SessionSnapshot added in v0.24.0

func (c *DebugCollector) SessionSnapshot(sessionID string, opts DebugSessionSnapshotOptions) map[string]any

SessionSnapshot returns session-scoped debug data filtered by session ID using a background context for global panel collection.

func (*DebugCollector) SessionSnapshotWithContext added in v0.121.3

func (c *DebugCollector) SessionSnapshotWithContext(ctx context.Context, sessionID string, opts DebugSessionSnapshotOptions) map[string]any

SessionSnapshotWithContext returns session-scoped debug data and, when requested, collects global panels through the authenticated caller context. Session-owned request, SQL, and log rows always replace their global counterparts so enabling global panels cannot widen those data sets.

func (*DebugCollector) Set added in v0.14.0

func (c *DebugCollector) Set(key string, value any)

Set adds custom debug data.

func (*DebugCollector) SetDeliveryFailureHandler added in v0.121.3

func (c *DebugCollector) SetDeliveryFailureHandler(handler func(DebugEvent)) *DebugCollector

SetDeliveryFailureHandler installs a bounded callback for browser-edge delivery recoveries. The callback must not block; it is invoked after a slow subscriber queue is compacted into an authoritative snapshot invalidation.

func (*DebugCollector) SetJSErrorRouteEnabled added in v0.32.0

func (c *DebugCollector) SetJSErrorRouteEnabled(enabled bool) *DebugCollector

func (*DebugCollector) SetLiveTransportEnabled added in v0.51.0

func (c *DebugCollector) SetLiveTransportEnabled(enabled bool) *DebugCollector

func (*DebugCollector) Snapshot added in v0.14.0

func (c *DebugCollector) Snapshot() map[string]any

Snapshot returns current state of all panels using a background context.

func (*DebugCollector) SnapshotWithContext added in v0.25.0

func (c *DebugCollector) SnapshotWithContext(ctx context.Context) map[string]any

SnapshotWithContext returns current state of all panels using the provided context.

func (*DebugCollector) Subscribe added in v0.14.0

func (c *DebugCollector) Subscribe(id string) <-chan DebugEvent

Subscribe creates a WebSocket subscriber channel.

func (*DebugCollector) Unsubscribe added in v0.14.0

func (c *DebugCollector) Unsubscribe(id string)

Unsubscribe removes a WebSocket subscriber.

func (*DebugCollector) WithSessionStore added in v0.24.0

func (c *DebugCollector) WithSessionStore(store DebugUserSessionStore) *DebugCollector

WithSessionStore configures the debug user session store.

func (*DebugCollector) WithURLs added in v0.24.0

func (c *DebugCollector) WithURLs(urls urlkit.Resolver) *DebugCollector

WithURLs sets the URL resolver used for debug integrations.

type DebugCollectorProvider added in v0.119.0

type DebugCollectorProvider func() *DebugCollector

DebugCollectorProvider resolves the active collector at log handling time. Returning nil is valid during startup, shutdown, or when debug capture is disabled.

type DebugConfig added in v0.14.0

type DebugConfig struct {
	// ResolveCurrentContext refreshes current account/session/scope/grants for live
	// delivery. When omitted, current authorizer resolution and claim expiry still
	// run on every event and at the idle interval. Hosts with mutable session or
	// scope state should supply this hook or implement CurrentContextResolver.
	ResolveCurrentContext  func(context.Context) (context.Context, error) `json:"-"`
	LiveRevalidateInterval time.Duration                                  `json:"live_revalidate_interval,omitempty"`
	Enabled                bool                                           `json:"enabled"`
	CaptureSQL             bool                                           `json:"capture_sql"`
	CaptureLogs            bool                                           `json:"capture_logs"`
	CaptureRequestBody     bool                                           `json:"capture_request_body"`
	// CaptureJSErrors enables the global JS error collector on all pages.
	// When true, an inline script is injected into every page <head> that
	// captures uncaught exceptions, unhandled rejections, and console.error
	// calls, then reports them to the debug backend. This flag is independent
	// of ToolbarMode — the collector works in production without the toolbar.
	CaptureJSErrors  bool              `json:"capture_js_errors"`
	StrictQueryHooks bool              `json:"strict_query_hooks"`
	MaxLogEntries    int               `json:"max_log_entries"`
	MaxSQLQueries    int               `json:"max_sql_queries"`
	MaskFieldTypes   map[string]string `json:"mask_field_types"`
	MaskPlaceholder  string            `json:"mask_placeholder"`
	Panels           []string          `json:"panels"`
	FeatureKey       string            `json:"feature_key"`
	Permission       string            `json:"permission"`
	BasePath         string            `json:"base_path"`
	// AppID identifies the running application instance for remote debug clients.
	AppID string `json:"app_id"`
	// AppName is a human-friendly application name for remote debug clients.
	AppName string `json:"app_name"`
	// Environment labels the current deployment (e.g., "staging", "prod").
	Environment string `json:"environment"`
	// RemoteEnabled toggles the remote debug identity/token endpoints.
	RemoteEnabled bool `json:"remote_enabled"`
	// TokenTTL overrides the default TTL for debug exchange tokens.
	TokenTTL time.Duration `json:"token_ttl"`
	// AllowedOrigins restricts remote debug origins (identity/token/ws).
	AllowedOrigins []string `json:"allowed_origins"`
	// CommandLauncherDoctorEnabled registers command-launcher readiness checks even
	// when the generic command launcher panel is not registered.
	CommandLauncherDoctorEnabled bool `json:"command_launcher_doctor_enabled"`
	// CommandRuns enables transport-neutral live command lifecycle projection.
	CommandRuns CommandRunRuntimeConfig `json:"command_runs"`
	// LayoutMode controls which debug template is rendered for the HTML route.
	LayoutMode DebugLayoutMode `json:"layout_mode"`
	// PageTemplate is the primary debug template used for HTML rendering.
	PageTemplate string `json:"page_template"`
	// StandaloneTemplate is used when forcing a standalone render via query param.
	StandaloneTemplate string `json:"standalone_template"`
	// DashboardTemplate overrides the go-dashboard HTML template for debug routes.
	DashboardTemplate string `json:"dashboard_template"`
	// ViewContextBuilder can inject navigation/session data for admin-layout templates.
	ViewContextBuilder DebugViewContextBuilder `json:"view_context_builder"`
	// SecureRequestResolver determines secure transport checks for debug cookies/nonces.
	// When nil, debug secure detection only trusts direct TLS.
	SecureRequestResolver DebugSecureRequestResolver `json:"secure_request_resolver"`
	SlowQueryThreshold    time.Duration              `json:"slow_query_threshold"`
	// SnapshotTimeout bounds initial and requested Debug snapshot collection.
	SnapshotTimeout time.Duration   `json:"snapshot_timeout"`
	AllowedIPs      []string        `json:"allowed_ips"`
	PersistLayout   bool            `json:"persist_layout"`
	Repl            DebugREPLConfig `json:"repl"`
	// ToolbarMode injects a debug toolbar at the bottom of all admin pages.
	// When true, the toolbar is shown in addition to the /admin/debug page.
	ToolbarMode bool `json:"toolbar_mode"`
	// ToolbarPanels specifies which panels appear in the toolbar.
	// Defaults to ["requests", "sql", "logs", "routes", "config"] if empty.
	ToolbarPanels []string `json:"toolbar_panels"`
	// ToolbarExcludePaths disables the toolbar on matching paths.
	// Use exact paths ("/admin/debug") or prefix wildcards ("/admin/debug/*").
	ToolbarExcludePaths []string `json:"toolbar_exclude_paths"`
	// SessionTracking enables debug session tracking with optional cookie fallback.
	SessionTracking bool `json:"session_tracking"`
	// SessionIncludeGlobalPanels controls whether global panels are included in session views.
	SessionIncludeGlobalPanels *bool `json:"session_include_global_panels"`
	// SessionCookieName controls the debug session cookie name.
	SessionCookieName string `json:"session_cookie_name"`
	// SessionInactivityExpiry controls the TTL for session cookies and session registry expiry.
	SessionInactivityExpiry time.Duration `json:"session_inactivity_expiry"`
}

DebugConfig controls the debug module behavior and feature flags.

func (DebugConfig) SessionIncludeGlobalPanelsEnabled added in v0.24.0

func (cfg DebugConfig) SessionIncludeGlobalPanelsEnabled() bool

SessionIncludeGlobalPanelsEnabled returns the effective session global panel toggle.

type DebugEvent added in v0.14.0

type DebugEvent struct {
	Type      string    `json:"type"`
	Payload   any       `json:"payload"`
	Timestamp time.Time `json:"timestamp"`
	// contains filtered or unexported fields
}

DebugEvent is sent to WebSocket subscribers.

type DebugLayoutMode added in v0.16.0

type DebugLayoutMode string

DebugLayoutMode controls how the debug UI is rendered.

const (
	DebugLayoutStandalone DebugLayoutMode = "standalone"
	DebugLayoutAdmin      DebugLayoutMode = "admin"
	DebugLayoutDashboard  DebugLayoutMode = "dashboard"
)

type DebugLogContext added in v0.119.0

type DebugLogContext struct {
	RequestID string
	TraceID   string
	SpanID    string
}

DebugLogContext contains optional request and trace correlation metadata.

type DebugLogContextResolver added in v0.119.0

type DebugLogContextResolver func(context.Context) DebugLogContext

DebugLogContextResolver extracts correlation metadata from a log context.

type DebugLogHandler added in v0.14.0

type DebugLogHandler struct {
	// contains filtered or unexported fields
}

DebugLogHandler forwards final slog records into the debug collector.

func NewDebugLogHandler added in v0.14.0

func NewDebugLogHandler(collector *DebugCollector, next slog.Handler) *DebugLogHandler

NewDebugLogHandler creates a slog.Handler that forwards to the debug collector and an optional delegate.

func NewDebugLogHandlerProvider added in v0.119.0

func NewDebugLogHandlerProvider(provider DebugCollectorProvider, next slog.Handler, options ...DebugLogHandlerOption) *DebugLogHandler

NewDebugLogHandlerProvider creates a handler that resolves its collector for every record.

func (*DebugLogHandler) Enabled added in v0.14.0

func (h *DebugLogHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*DebugLogHandler) Handle added in v0.14.0

func (h *DebugLogHandler) Handle(ctx context.Context, r slog.Record) error

func (*DebugLogHandler) WithAttrs added in v0.14.0

func (h *DebugLogHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*DebugLogHandler) WithGroup added in v0.14.0

func (h *DebugLogHandler) WithGroup(name string) slog.Handler

type DebugLogHandlerOption added in v0.119.0

type DebugLogHandlerOption func(*debugLogHandlerConfig)

DebugLogHandlerOption configures final-record normalization and metadata.

func WithDebugLogContextResolver added in v0.119.0

func WithDebugLogContextResolver(resolver DebugLogContextResolver) DebugLogHandlerOption

WithDebugLogContextResolver overrides request/trace metadata extraction.

func WithDebugLogLimits added in v0.119.0

func WithDebugLogLimits(limits DebugLogLimits) DebugLogHandlerOption

WithDebugLogLimits overrides normalization limits. Non-positive fields use defaults.

type DebugLogLimits added in v0.119.0

type DebugLogLimits struct {
	MaxDepth           int
	MaxCollectionItems int
	MaxStringBytes     int
	MaxStackBytes      int
	MaxEventBytes      int
}

DebugLogLimits bounds normalized values retained by the debug collector.

type DebugModule added in v0.14.0

type DebugModule struct {
	// contains filtered or unexported fields
}

DebugModule registers the debug dashboard integration and menu entry.

func NewDebugModule added in v0.14.0

func NewDebugModule(config DebugConfig) *DebugModule

NewDebugModule constructs a debug module with the provided configuration.

func (*DebugModule) Close added in v0.139.0

func (m *DebugModule) Close() error

Close releases Debug-owned delivery without stopping a shared command runtime or dashboard. The router retains startup routes, which now deny access.

func (*DebugModule) Manifest added in v0.14.0

func (m *DebugModule) Manifest() ModuleManifest

func (*DebugModule) MenuItems added in v0.14.0

func (m *DebugModule) MenuItems(locale string) []MenuItem

func (*DebugModule) Register added in v0.14.0

func (m *DebugModule) Register(ctx ModuleContext) error

func (*DebugModule) RouteContract added in v0.27.0

func (m *DebugModule) RouteContract() routing.ModuleContract

func (*DebugModule) WithMenuParent added in v0.24.0

func (m *DebugModule) WithMenuParent(parent string) *DebugModule

WithMenuParent nests the debug navigation under a parent menu item ID.

type DebugPanel added in v0.14.0

type DebugPanel interface {
	ID() string
	Label() string
	Icon() string
	Collect(ctx context.Context) map[string]any
}

DebugPanel defines a pluggable debug panel.

type DebugPanelActionProvider added in v0.69.0

type DebugPanelActionProvider interface {
	Actions() map[string]debugregistry.PanelActionHandler
}

DebugPanelActionProvider optionally adds action handlers to a rich panel.

type DebugPanelUIProvider added in v0.69.0

type DebugPanelUIProvider interface {
	UI() *debugregistry.PanelUI
}

DebugPanelUIProvider optionally adds a declarative rich UI schema to a panel.

type DebugPanelWidgetPayload added in v0.25.0

type DebugPanelWidgetPayload struct {
	Panel string `json:"panel"`
	Label string `json:"label"`
	Icon  string `json:"icon,omitempty"`
	Data  any    `json:"data"`
}

type DebugQueryHook added in v0.14.0

type DebugQueryHook struct {
	Collector         *DebugCollector        `json:"collector"`
	CollectorProvider func() *DebugCollector `json:"collector_provider"`
}

DebugQueryHook captures Bun query events and forwards them to the debug collector.

func NewDebugQueryHook added in v0.14.0

func NewDebugQueryHook(collector *DebugCollector) *DebugQueryHook

NewDebugQueryHook builds a query hook bound to a specific collector.

func NewDebugQueryHookProvider added in v0.14.0

func NewDebugQueryHookProvider(provider func() *DebugCollector) *DebugQueryHook

NewDebugQueryHookProvider builds a query hook that resolves the collector at runtime.

func (*DebugQueryHook) AfterQuery added in v0.14.0

func (h *DebugQueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)

AfterQuery captures query details after execution.

func (*DebugQueryHook) BeforeQuery added in v0.14.0

func (h *DebugQueryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context

BeforeQuery preserves the context; Bun requires the hook contract.

func (*DebugQueryHook) QueryHookKey added in v0.14.0

func (h *DebugQueryHook) QueryHookKey() string

QueryHookKey provides a stable identity for hook deduplication.

type DebugREPLCommand added in v0.16.0

type DebugREPLCommand struct {
	Command     string   `json:"command"`
	Path        []string `json:"path,omitempty"`
	Description string   `json:"description,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Aliases     []string `json:"aliases,omitempty"`
	Mutates     bool     `json:"mutates"`
	Permissions []string `json:"-"`
	Roles       []string `json:"-"`
	MessageType string   `json:"-"`
}

DebugREPLCommand describes a CLI command exposed to the REPL UI.

type DebugREPLCommandCatalog added in v0.16.0

type DebugREPLCommandCatalog struct {
	// contains filtered or unexported fields
}

DebugREPLCommandCatalog collects exposed CLI commands via go-command resolvers.

func NewDebugREPLCommandCatalog added in v0.16.0

func NewDebugREPLCommandCatalog() *DebugREPLCommandCatalog

NewDebugREPLCommandCatalog constructs a catalog and attaches its resolver.

func (*DebugREPLCommandCatalog) List added in v0.16.0

List returns all captured commands sorted by command path.

func (*DebugREPLCommandCatalog) VisibleCommands added in v0.16.0

func (c *DebugREPLCommandCatalog) VisibleCommands(admin *Admin, adminCtx AdminContext, cfg DebugREPLConfig) []DebugREPLCommand

VisibleCommands filters commands for a specific admin context + REPL config.

type DebugREPLConfig added in v0.16.0

type DebugREPLConfig struct {
	Enabled            bool                      `json:"enabled"`
	ShellEnabled       bool                      `json:"shell_enabled"`
	AppEnabled         bool                      `json:"app_enabled"`
	Permission         string                    `json:"permission"`
	ExecPermission     string                    `json:"exec_permission"`
	ReadOnly           *bool                     `json:"read_only"`
	AllowedRoles       []string                  `json:"allowed_roles"`
	AllowedIPs         []string                  `json:"allowed_ips"`
	ShellCommand       string                    `json:"shell_command"`
	ShellArgs          []string                  `json:"shell_args"`
	WorkingDir         string                    `json:"working_dir"`
	Environment        []string                  `json:"environment"`
	MaxSessionSeconds  int                       `json:"max_session_seconds"`
	AppEvalTimeoutMs   int                       `json:"app_eval_timeout_ms"`
	AppAllowedPackages []string                  `json:"app_allowed_packages"`
	OverrideStrategy   DebugREPLOverrideStrategy `json:"override_strategy"`
	MaxSessionsPerUser int                       `json:"max_sessions_per_user"`
}

DebugREPLConfig controls shell + app console access.

func (DebugREPLConfig) ReadOnlyEnabled added in v0.16.0

func (cfg DebugREPLConfig) ReadOnlyEnabled() bool

type DebugREPLOverrideStrategy added in v0.16.0

type DebugREPLOverrideStrategy interface {
	Allows(ctx context.Context, req DebugREPLRequest) (bool, error)
}

DebugREPLOverrideStrategy decides whether a request can override a disabled REPL.

type DebugREPLRequest added in v0.16.0

type DebugREPLRequest struct {
	UserID      string         `json:"user_id"`
	IP          string         `json:"ip"`
	UserAgent   string         `json:"user_agent"`
	Kind        string         `json:"kind"`
	RequestedAt time.Time      `json:"requested_at"`
	Metadata    map[string]any `json:"metadata"`
}

DebugREPLRequest captures request metadata for override strategies.

type DebugREPLSession added in v0.16.0

type DebugREPLSession struct {
	ID        string         `json:"id"`
	UserID    string         `json:"user_id"`
	Username  string         `json:"username"`
	IP        string         `json:"ip"`
	UserAgent string         `json:"user_agent"`
	Kind      string         `json:"kind"`
	ReadOnly  bool           `json:"read_only"`
	StartedAt time.Time      `json:"started_at"`
	ExpiresAt time.Time      `json:"expires_at"`
	ClosedAt  *time.Time     `json:"closed_at"`
	Metadata  map[string]any `json:"metadata"`
}

DebugREPLSession tracks an active REPL session.

type DebugREPLSessionManager added in v0.16.0

type DebugREPLSessionManager struct {
	// contains filtered or unexported fields
}

DebugREPLSessionManager enforces REPL session lifecycle rules.

func NewDebugREPLSessionManager added in v0.16.0

func NewDebugREPLSessionManager(store DebugREPLSessionStore, cfg DebugREPLConfig) *DebugREPLSessionManager

NewDebugREPLSessionManager constructs a lifecycle manager.

func (*DebugREPLSessionManager) Active added in v0.16.0

Active returns sessions that are still active.

func (*DebugREPLSessionManager) Close added in v0.16.0

func (m *DebugREPLSessionManager) Close(ctx context.Context, id string, closedAt time.Time) error

Close marks a session as closed.

func (*DebugREPLSessionManager) Start added in v0.16.0

Start creates a new session after enforcing limits.

type DebugREPLSessionStore added in v0.16.0

type DebugREPLSessionStore interface {
	Create(ctx context.Context, session DebugREPLSession) error
	Close(ctx context.Context, id string, closedAt time.Time) error
	Get(ctx context.Context, id string) (DebugREPLSession, bool, error)
	ListActive(ctx context.Context) ([]DebugREPLSession, error)
}

DebugREPLSessionStore persists REPL sessions.

type DebugSecureRequestResolver added in v0.27.0

type DebugSecureRequestResolver func(c router.Context) bool

DebugSecureRequestResolver determines whether a request should be treated as secure.

type DebugSessionSnapshotOptions added in v0.24.0

type DebugSessionSnapshotOptions struct {
	IncludeGlobalPanels bool `json:"include_global_panels"`
}

DebugSessionSnapshotOptions controls session-scoped snapshot behavior.

type DebugUserSession added in v0.24.0

type DebugUserSession struct {
	SessionID    string         `json:"session_id"`
	UserID       string         `json:"user_id"`
	Username     string         `json:"username"`
	IP           string         `json:"ip"`
	UserAgent    string         `json:"user_agent"`
	CurrentPage  string         `json:"current_page"`
	StartedAt    time.Time      `json:"started_at"`
	LastActivity time.Time      `json:"last_activity"`
	RequestCount int            `json:"request_count"`
	Metadata     map[string]any `json:"metadata,omitempty"`
}

DebugUserSession tracks an active user session for session-scoped debug views.

type DebugUserSessionStore added in v0.24.0

type DebugUserSessionStore interface {
	Upsert(ctx context.Context, session DebugUserSession) error
	Get(ctx context.Context, sessionID string) (DebugUserSession, bool, error)
	ListActive(ctx context.Context) ([]DebugUserSession, error)
	Expire(ctx context.Context, olderThan time.Duration) (int, error)
}

DebugUserSessionStore persists active debug user sessions.

type DebugViewContextBuilder added in v0.16.0

type DebugViewContextBuilder func(adm *Admin, cfg DebugConfig, c router.Context, view router.ViewContext) router.ViewContext

DebugViewContextBuilder can augment the view context for debug templates.

type DefaultIconRenderer added in v0.25.0

type DefaultIconRenderer struct {
	// CDNURLs maps library IDs to their CDN stylesheet URLs.
	CDNURLs map[string]string `json:"cdnur_ls"`
	// ClassPatterns maps library IDs to class patterns (e.g., "iconoir-{name}").
	ClassPatterns map[string]string `json:"class_patterns"`
	// DefaultSize is the default icon size CSS value.
	DefaultSize string `json:"default_size"`
	// SecurityValidator validates and sanitizes icon content.
	SecurityValidator *IconSecurityValidator `json:"security_validator"`
}

DefaultIconRenderer implements IconRenderer with standard HTML output.

func NewDefaultIconRenderer added in v0.25.0

func NewDefaultIconRenderer(policy IconSecurityPolicy) *DefaultIconRenderer

NewDefaultIconRenderer creates a new DefaultIconRenderer with sensible defaults.

func (*DefaultIconRenderer) Render added in v0.25.0

Render produces HTML for the given icon reference.

type DefaultMediaDeliveryReferenceProjector added in v0.62.0

type DefaultMediaDeliveryReferenceProjector struct{}

DefaultMediaDeliveryReferenceProjector reads common provenance fields from item metadata.

func (DefaultMediaDeliveryReferenceProjector) ProjectMediaDeliveryReference added in v0.62.0

type DefaultModuleID added in v0.126.3

type DefaultModuleID string

DefaultModuleID identifies a module registered automatically by Admin.

const (
	DefaultModuleActivity      DefaultModuleID = "activity"
	DefaultModuleFeatureFlags  DefaultModuleID = "feature_flags"
	DefaultModuleMedia         DefaultModuleID = "media"
	DefaultModuleOrganizations DefaultModuleID = "organizations"
	DefaultModulePreferences   DefaultModuleID = "preferences"
	DefaultModuleProfile       DefaultModuleID = "profile"
	DefaultModuleTenants       DefaultModuleID = "tenants"
	DefaultModuleUsers         DefaultModuleID = "users"
)

type DefaultPageMapper added in v0.24.0

type DefaultPageMapper struct{}

DefaultPageMapper provides a baseline mapping of admin read models to form values.

func (DefaultPageMapper) ToFormValues added in v0.24.0

func (DefaultPageMapper) ToFormValues(record AdminPageRecord) map[string]any

ToFormValues maps an admin record into form values.

type DefaultTranslationQueueAutoCreateHook added in v0.25.0

type DefaultTranslationQueueAutoCreateHook struct {
	Repository TranslationAssignmentRepository `json:"repository"`
	Logger     Logger                          `json:"logger"`
}

DefaultTranslationQueueAutoCreateHook implements auto-create using the assignment repository.

func (*DefaultTranslationQueueAutoCreateHook) OnTranslationBlocker added in v0.25.0

OnTranslationBlocker creates or reuses queue assignments for missing locales. Errors are logged but not propagated to preserve primary policy response.

type DefaultTranslationQueueService added in v0.25.0

type DefaultTranslationQueueService struct {
	Repository    TranslationAssignmentRepository `json:"repository"`
	Activity      ActivitySink                    `json:"activity"`
	Notifications NotificationService             `json:"notifications"`
	URLs          urlkit.Resolver                 `json:"urls"`
}

DefaultTranslationQueueService implements queue lifecycle transitions over a repository.

func (*DefaultTranslationQueueService) Approve added in v0.25.0

func (*DefaultTranslationQueueService) Archive added in v0.25.0

func (*DefaultTranslationQueueService) Assign added in v0.25.0

func (*DefaultTranslationQueueService) BulkArchive added in v0.25.0

func (*DefaultTranslationQueueService) BulkAssign added in v0.25.0

func (*DefaultTranslationQueueService) BulkPriority added in v0.25.0

func (*DefaultTranslationQueueService) BulkRelease added in v0.25.0

func (*DefaultTranslationQueueService) Claim added in v0.25.0

func (*DefaultTranslationQueueService) Reject added in v0.25.0

func (*DefaultTranslationQueueService) Release added in v0.25.0

func (*DefaultTranslationQueueService) SubmitReview added in v0.25.0

type DefaultTranslationSuggestionService added in v0.110.0

type DefaultTranslationSuggestionService struct {
	Repository    TranslationAssignmentRepository
	ContextLoader TranslationSuggestionContextLoader
	Authorizer    Authorizer
	Permission    string
	Resource      string
	Eligibility   TranslationSuggestionEligibilityChecker
	AssistContext TranslationSuggestionAssistContextExtractor
	Provider      TranslationSuggestionProvider
}

DefaultTranslationSuggestionService orchestrates server-side checks and a provider-neutral suggestion provider.

func (*DefaultTranslationSuggestionService) ConfigureTranslationSuggestionServiceDependencies added in v0.110.0

func (s *DefaultTranslationSuggestionService) ConfigureTranslationSuggestionServiceDependencies(deps TranslationSuggestionServiceDependencies)

func (*DefaultTranslationSuggestionService) EvaluateTranslationSuggestionAction added in v0.110.0

func (*DefaultTranslationSuggestionService) SuggestTranslation added in v0.110.0

type DeliveryContentService added in v0.23.0

type DeliveryContentService struct {
	// contains filtered or unexported fields
}

DeliveryContentService adapts CMS content for delivery.

func NewDeliveryContentService added in v0.23.0

func NewDeliveryContentService(container CMSContainer, opts DeliveryOptions) *DeliveryContentService

NewDeliveryContentService constructs a delivery content service.

func (DeliveryContentService) Create added in v0.23.0

func (s DeliveryContentService) Create(crud.Context, T) (T, error)

func (DeliveryContentService) Delete added in v0.23.0

func (s DeliveryContentService) Delete(crud.Context, T) error

func (*DeliveryContentService) Index added in v0.23.0

func (*DeliveryContentService) Show added in v0.23.0

func (DeliveryContentService) Update added in v0.23.0

func (s DeliveryContentService) Update(crud.Context, T) (T, error)

type DeliveryMenuService added in v0.23.0

type DeliveryMenuService struct {
	// contains filtered or unexported fields
}

DeliveryMenuService adapts CMS menus for delivery.

func NewDeliveryMenuService added in v0.23.0

func NewDeliveryMenuService(container CMSContainer, opts DeliveryOptions) *DeliveryMenuService

NewDeliveryMenuService constructs a delivery menu service.

func (DeliveryMenuService) Create added in v0.23.0

func (s DeliveryMenuService) Create(crud.Context, T) (T, error)

func (DeliveryMenuService) Delete added in v0.23.0

func (s DeliveryMenuService) Delete(crud.Context, T) error

func (*DeliveryMenuService) Index added in v0.23.0

func (*DeliveryMenuService) Show added in v0.23.0

func (DeliveryMenuService) Update added in v0.23.0

func (s DeliveryMenuService) Update(crud.Context, T) (T, error)

type DeliveryOptions added in v0.23.0

type DeliveryOptions struct {
	DefaultLocale string `json:"default_locale"`
}

DeliveryOptions configures delivery adapters.

type DeliveryPageService added in v0.23.0

type DeliveryPageService struct {
	// contains filtered or unexported fields
}

DeliveryPageService adapts CMS pages for delivery.

func NewDeliveryPageService added in v0.23.0

func NewDeliveryPageService(container CMSContainer, opts DeliveryOptions) *DeliveryPageService

NewDeliveryPageService constructs a delivery page service.

func (DeliveryPageService) Create added in v0.23.0

func (s DeliveryPageService) Create(crud.Context, T) (T, error)

func (DeliveryPageService) Delete added in v0.23.0

func (s DeliveryPageService) Delete(crud.Context, T) error

func (*DeliveryPageService) Index added in v0.23.0

func (*DeliveryPageService) Show added in v0.23.0

func (DeliveryPageService) Update added in v0.23.0

func (s DeliveryPageService) Update(crud.Context, T) (T, error)

type DeliveryServices added in v0.23.0

type DeliveryServices struct {
	Contents crud.Service[delivery.Content] `json:"contents"`
	Pages    crud.Service[delivery.Page]    `json:"pages"`
	Menus    crud.Service[delivery.Menu]    `json:"menus"`
}

DeliveryServices bundles CRUD-compatible services for GraphQL resolvers.

func NewDeliveryServices added in v0.23.0

func NewDeliveryServices(container CMSContainer, opts DeliveryOptions) DeliveryServices

NewDeliveryServices builds read-only services backed by CMS adapters.

type DenyAllStrategy added in v0.16.0

type DenyAllStrategy struct{}

DenyAllStrategy denies all override attempts.

func (DenyAllStrategy) Allows added in v0.16.0

type Dependencies

type Dependencies struct {
	Router AdminRouter `json:"router"`
	Logger Logger      `json:"logger"`

	LoggerProvider LoggerProvider `json:"logger_provider"`

	DeploymentPersonaGenerator deploymentidentity.Generator `json:"-"`

	CMSContainer        CMSContainer        `json:"cms_container"`
	CMSContainerBuilder CMSContainerBuilder `json:"cms_container_builder"`

	Registry              *Registry                       `json:"registry"`
	CommandBus            *CommandBus                     `json:"command_bus"`
	CommandCatalog        gocommand.CatalogProvider       `json:"command_catalog"`
	CommandOptionProvider gocommand.CommandOptionProvider `json:"command_option_provider"`
	RPCServer             *cmdrpc.Server                  `json:"rpc_server"`
	RPCCommandPolicyHook  RPCCommandPolicyHook            `json:"rpc_command_policy_hook"`
	JobRegistry           *JobRegistry                    `json:"job_registry"`
	URLManager            *urlkit.RouteManager            `json:"url_manager"`

	Authorizer                     Authorizer                      `json:"authorizer"`
	Authenticator                  Authenticator                   `json:"authenticator"`
	Translator                     Translator                      `json:"translator"`
	Workflow                       WorkflowEngine                  `json:"workflow"`
	WorkflowRuntime                WorkflowRuntime                 `json:"workflow_runtime"`
	TranslationPolicy              TranslationPolicy               `json:"translation_policy"`
	TranslationFamilyStore         translationservices.FamilyStore `json:"translation_family_store"`
	ActivitySink                   ActivitySink                    `json:"activity_sink"`
	ActivityRepository             types.ActivityRepository        `json:"activity_repository"`
	ActivityAccessPolicy           activity.ActivityAccessPolicy   `json:"activity_access_policy"`
	ActivityFeedQuery              ActivityFeedQuerier             `json:"activity_feed_query"`
	ActivityService                ActivityFeedQuerier             `json:"activity_service"`
	ActivityFilterOptionsProvider  ActivityFilterOptionsProvider   `json:"activity_filter_options_provider"`
	ActivityFilterOptionsPolicy    ActivityFilterOptionsPolicy     `json:"activity_filter_options_policy"`
	ActivityPageEnricher           ActivityPageEnricher            `json:"activity_page_enricher"`
	ActivityNavigationResolver     ActivityNavigationResolver      `json:"activity_navigation_resolver"`
	ActivityNavigationErrorHandler ActivityNavigationErrorHandler  `json:"activity_navigation_error_handler"`
	ActivityReadErrorHandler       ActivityReadErrorHandler        `json:"activity_read_error_handler"`
	ActivityEnricher               activity.ActivityEnricher       `json:"activity_enricher"`
	ActivityEnrichmentErrorHandler activity.EnrichmentErrorHandler `json:"activity_enrichment_error_handler"`
	ActivityEnrichmentWriteMode    activity.EnrichmentWriteMode    `json:"activity_enrichment_write_mode"`
	ActivitySessionIDProvider      activity.SessionIDProvider      `json:"activity_session_id_provider"`
	ActivitySessionIDKey           string                          `json:"activity_session_id_key"`
	DebugREPLSessionStore          DebugREPLSessionStore           `json:"debug_repl_session_store"`
	DebugUserSessionStore          DebugUserSessionStore           `json:"debug_user_session_store"`

	NotificationService             NotificationService             `json:"notification_service"`
	NotificationRuntime             *NotificationRuntimeOptions     `json:"notification_runtime"`
	ExportRegistry                  ExportRegistry                  `json:"export_registry"`
	ExportRegistrar                 ExportHTTPRegistrar             `json:"export_registrar"`
	ExportMetadata                  ExportMetadataProvider          `json:"export_metadata"`
	BulkService                     BulkService                     `json:"bulk_service"`
	MediaLibrary                    MediaLibrary                    `json:"media_library"`
	MediaActivityHook               MediaActivityHook               `json:"media_activity_hook"`
	MediaDeliveryRegistry           *MediaDeliveryRegistry          `json:"media_delivery_registry"`
	MediaDeliveryReferenceProjector MediaDeliveryReferenceProjector `json:"media_delivery_reference_projector"`
	MediaDeliveryCredentialResolver MediaDeliveryCredentialResolver `json:"media_delivery_credential_resolver"`

	PreferencesStore PreferencesStore `json:"preferences_store"`
	ProfileStore     ProfileStore     `json:"profile_store"`

	UserRepository         UserRepository                 `json:"user_repository"`
	RoleRepository         RoleRepository                 `json:"role_repository"`
	TenantRepository       TenantRepository               `json:"tenant_repository"`
	OrganizationRepository OrganizationRepository         `json:"organization_repository"`
	BulkUserImport         *command.BulkUserImportCommand `json:"bulk_user_import"`

	SettingsService *SettingsService `json:"settings_service"`

	IconService *IconService `json:"icon_service"`

	FeatureGate            fggate.FeatureGate      `json:"feature_gate"`
	FeatureCatalog         catalog.Catalog         `json:"feature_catalog"`
	FeatureCatalogResolver catalog.MessageResolver `json:"feature_catalog_resolver"`
}

Dependencies captures host-provided integrations and storage adapters. Optional dependencies fall back to in-memory defaults when omitted.

type DeploymentBuildInfo added in v0.122.0

type DeploymentBuildInfo struct {
	MainVersion string
	GoVersion   string
	VCSRevision string
	VCSTime     string
	VCSModified bool
}

DeploymentBuildInfo is the bounded build metadata consumed by the resolver.

type DeploymentDebugPanel added in v0.122.0

type DeploymentDebugPanel struct {
	// contains filtered or unexported fields
}

DeploymentDebugPanel exposes the allowlisted identity for one Admin instance.

func NewDeploymentDebugPanel added in v0.122.0

func NewDeploymentDebugPanel(adm *Admin) *DeploymentDebugPanel

func (*DeploymentDebugPanel) Collect added in v0.122.0

func (p *DeploymentDebugPanel) Collect(context.Context) map[string]any

func (*DeploymentDebugPanel) ID added in v0.122.0

func (p *DeploymentDebugPanel) ID() string

func (*DeploymentDebugPanel) Icon added in v0.122.0

func (p *DeploymentDebugPanel) Icon() string

func (*DeploymentDebugPanel) Label added in v0.122.0

func (p *DeploymentDebugPanel) Label() string

func (*DeploymentDebugPanel) Span added in v0.122.0

func (p *DeploymentDebugPanel) Span() int

func (*DeploymentDebugPanel) UI added in v0.122.0

type DeploymentIdentity added in v0.122.0

type DeploymentIdentity struct {
	AppID            string                      `json:"app_id,omitempty"`
	AppName          string                      `json:"app_name,omitempty"`
	AppVersion       string                      `json:"app_version,omitempty"`
	Environment      string                      `json:"environment,omitempty"`
	EnvironmentColor string                      `json:"environment_color,omitempty"`
	InstanceName     string                      `json:"instance_name"`
	InstanceID       string                      `json:"instance_id"`
	Hostname         string                      `json:"hostname,omitempty"`
	CommitSHA        string                      `json:"commit_sha,omitempty"`
	CommitShort      string                      `json:"commit_short,omitempty"`
	GitRef           string                      `json:"git_ref,omitempty"`
	BuildTime        *time.Time                  `json:"build_time,omitempty"`
	BuildModified    bool                        `json:"build_modified,omitempty"`
	BuildSource      string                      `json:"build_source,omitempty"`
	InstanceSource   string                      `json:"instance_source,omitempty"`
	StartedAt        time.Time                   `json:"started_at"`
	GoVersion        string                      `json:"go_version,omitempty"`
	Persona          *deploymentidentity.Persona `json:"persona,omitempty"`
}

DeploymentIdentity is the immutable deployment identity resolved for one Admin instance.

func ResolveDeploymentIdentity added in v0.122.0

func ResolveDeploymentIdentity(cfg Config, options ...DeploymentIdentityResolverOption) DeploymentIdentity

ResolveDeploymentIdentity resolves allowlisted metadata using field-level precedence: typed config, compatibility config, APP_* environment, build information, then safe generated/runtime fallbacks.

func (DeploymentIdentity) Snapshot added in v0.122.0

Snapshot derives time-varying display fields without mutating the identity.

type DeploymentIdentityConfig added in v0.122.0

type DeploymentIdentityConfig struct {
	AppID             string                  `json:"app_id"`
	AppName           string                  `json:"app_name"`
	AppVersion        string                  `json:"app_version"`
	Environment       string                  `json:"environment"`
	EnvironmentColors map[string]string       `json:"environment_colors,omitempty"`
	FallbackColor     string                  `json:"fallback_color,omitempty"`
	InstanceName      string                  `json:"instance_name,omitempty"`
	InstanceID        string                  `json:"instance_id,omitempty"`
	CommitSHA         string                  `json:"commit_sha,omitempty"`
	GitRef            string                  `json:"git_ref,omitempty"`
	BuildTime         string                  `json:"build_time,omitempty"`
	Persona           DeploymentPersonaConfig `json:"persona"`
}

DeploymentIdentityConfig configures application, build, environment, and process identity metadata. Empty fields are resolved independently.

type DeploymentIdentityResolverOption added in v0.122.0

type DeploymentIdentityResolverOption func(*deploymentIdentityResolver)

DeploymentIdentityResolverOption makes resolver dependencies deterministic for hosts and tests without changing the default runtime behavior.

func WithDeploymentBuildInfo added in v0.122.0

func WithDeploymentBuildInfo(lookup func() (DeploymentBuildInfo, bool)) DeploymentIdentityResolverOption

func WithDeploymentClock added in v0.122.0

func WithDeploymentClock(now func() time.Time) DeploymentIdentityResolverOption

func WithDeploymentEnvironmentLookup added in v0.122.0

func WithDeploymentEnvironmentLookup(lookup func(string) (string, bool)) DeploymentIdentityResolverOption

func WithDeploymentHostnameLookup added in v0.122.0

func WithDeploymentHostnameLookup(lookup func() (string, error)) DeploymentIdentityResolverOption

func WithDeploymentPersonaGenerator added in v0.123.1

func WithDeploymentPersonaGenerator(generator deploymentidentity.Generator) DeploymentIdentityResolverOption

WithDeploymentPersonaGenerator supplies an application-defined generator.

func WithDeploymentRandomSource added in v0.122.0

func WithDeploymentRandomSource(source io.Reader) DeploymentIdentityResolverOption

type DeploymentIdentitySnapshot added in v0.122.0

type DeploymentIdentitySnapshot struct {
	DeploymentIdentity
	Uptime string `json:"uptime"`
}

DeploymentIdentitySnapshot is the JSON-safe diagnostic view of an identity.

type DeploymentPersona added in v0.123.1

type DeploymentPersona = deploymentidentity.Persona

Maintained aliases keep persona contracts available through both admin import paths while the independent package remains usable without core.

func ValidateDeploymentPersona added in v0.123.1

func ValidateDeploymentPersona(persona DeploymentPersona) (DeploymentPersona, error)

type DeploymentPersonaConfig added in v0.123.1

type DeploymentPersonaConfig struct {
	Enabled   bool    `json:"enabled,omitempty"`
	Seed      string  `json:"seed,omitempty"`
	Namespace *string `json:"namespace,omitempty"`
	Name      string  `json:"name,omitempty"`
}

DeploymentPersonaConfig opts into a deterministic artifact persona. Namespace nil defaults to AppID; a non-nil empty value explicitly disables namespacing.

type DeploymentPersonaGenerator added in v0.123.1

type DeploymentPersonaGenerator = deploymentidentity.Generator

Maintained aliases keep persona contracts available through both admin import paths while the independent package remains usable without core.

func NewDefaultDeploymentPersonaGenerator added in v0.123.1

func NewDefaultDeploymentPersonaGenerator() DeploymentPersonaGenerator

type DeploymentPersonaGeneratorFunc added in v0.123.1

type DeploymentPersonaGeneratorFunc = deploymentidentity.GeneratorFunc

Maintained aliases keep persona contracts available through both admin import paths while the independent package remains usable without core.

type DeploymentPersonaInput added in v0.123.1

type DeploymentPersonaInput = deploymentidentity.Input

Maintained aliases keep persona contracts available through both admin import paths while the independent package remains usable without core.

type DeploymentPersonaVisual added in v0.123.1

type DeploymentPersonaVisual = deploymentidentity.Visual

Maintained aliases keep persona contracts available through both admin import paths while the independent package remains usable without core.

type DevErrorContext added in v0.24.0

type DevErrorContext struct {
	ErrorMessage    string           `json:"error_message"`
	ErrorType       string           `json:"error_type,omitempty"`
	TextCode        string           `json:"text_code,omitempty"`
	Category        string           `json:"category,omitempty"`
	PrimarySource   *SourceContext   `json:"primary_source,omitempty"`
	StackFrames     []StackFrameInfo `json:"stack_frames,omitempty"`
	RequestInfo     *RequestInfo     `json:"request_info,omitempty"`
	EnvironmentInfo *EnvironmentInfo `json:"environment_info,omitempty"`
	Metadata        map[string]any   `json:"metadata,omitempty"`
}

DevErrorContext holds all developer-friendly error context.

type DisabledBulkService

type DisabledBulkService struct{}

DisabledBulkService returns explicit errors when bulk is disabled.

func (DisabledBulkService) List

func (DisabledBulkService) Rollback

func (DisabledBulkService) Rollback(ctx context.Context, id string) (BulkJob, error)

func (DisabledBulkService) Start

type DisabledMediaLibrary

type DisabledMediaLibrary struct{}

DisabledMediaLibrary returns feature disabled errors.

func (DisabledMediaLibrary) QueryMedia added in v0.61.0

func (DisabledMediaLibrary) QueryMedia(ctx context.Context, query MediaQuery) (MediaPage, error)

type DisabledNotificationService

type DisabledNotificationService struct{}

DisabledNotificationService returns explicit errors when notifications are disabled.

func (DisabledNotificationService) Add

func (DisabledNotificationService) List

func (DisabledNotificationService) Mark

type DispatchFactory added in v0.12.0

type DispatchFactory func(ctx context.Context, payload map[string]any, ids []string, opts command.DispatchOptions) (command.DispatchReceipt, error)

DispatchFactory executes a typed dispatch using the provided payload.

type DispatchOutcome added in v0.88.0

type DispatchOutcome struct {
	Receipt command.DispatchReceipt
	Result  any
}

DispatchOutcome contains the receipt and optional inline result from a dispatch.

type DoctorAction added in v0.25.0

type DoctorAction struct {
	Label                string           `json:"label,omitempty"`
	CTA                  string           `json:"cta,omitempty"`
	Description          string           `json:"description,omitempty"`
	Kind                 DoctorActionKind `json:"kind,omitempty"`
	AllowedStatuses      []DoctorSeverity `json:"allowed_statuses,omitempty"`
	RequiresConfirmation bool             `json:"requires_confirmation,omitempty"`
	ConfirmText          string           `json:"confirm_text,omitempty"`
	Metadata             map[string]any   `json:"metadata,omitempty"`
	Run                  DoctorActionRun  `json:"-"`
}

DoctorAction describes the "how to fix" metadata for a check and optional executable action.

func NewManualDoctorAction added in v0.25.0

func NewManualDoctorAction(description, cta string) *DoctorAction

NewManualDoctorAction returns a manual CTA descriptor for checks that require human intervention.

type DoctorActionExecution added in v0.25.0

type DoctorActionExecution struct {
	CheckID  string            `json:"check_id"`
	Status   string            `json:"status,omitempty"`
	Message  string            `json:"message,omitempty"`
	Metadata map[string]any    `json:"metadata,omitempty"`
	Snapshot DoctorCheckResult `json:"snapshot"`
}

DoctorActionExecution is returned when a doctor action is invoked.

type DoctorActionKind added in v0.25.0

type DoctorActionKind string

DoctorActionKind indicates whether a doctor action is automated or manual guidance.

const (
	DoctorActionKindManual   DoctorActionKind = "manual"
	DoctorActionKindAuto     DoctorActionKind = "auto"
	DoctorActionKindNavigate DoctorActionKind = "navigate"
)

type DoctorActionRun added in v0.25.0

type DoctorActionRun func(ctx context.Context, adm *Admin, check DoctorCheckResult, input map[string]any) (DoctorActionExecution, error)

DoctorActionRun executes a doctor action handler.

type DoctorActionState added in v0.25.0

type DoctorActionState struct {
	Label                string           `json:"label,omitempty"`
	CTA                  string           `json:"cta,omitempty"`
	Description          string           `json:"description,omitempty"`
	Kind                 DoctorActionKind `json:"kind,omitempty"`
	AllowedStatuses      []DoctorSeverity `json:"allowed_statuses,omitempty"`
	RequiresConfirmation bool             `json:"requires_confirmation,omitempty"`
	ConfirmText          string           `json:"confirm_text,omitempty"`
	Applicable           bool             `json:"applicable"`
	Runnable             bool             `json:"runnable"`
	Metadata             map[string]any   `json:"metadata,omitempty"`
}

DoctorActionState is the frontend-safe action descriptor for an evaluated check result.

type DoctorCheck added in v0.25.0

type DoctorCheck struct {
	ID          string                                                  `json:"id"`
	Label       string                                                  `json:"label,omitempty"`
	Description string                                                  `json:"description,omitempty"`
	Help        string                                                  `json:"help,omitempty"`
	Action      *DoctorAction                                           `json:"action,omitempty"`
	Run         func(ctx context.Context, adm *Admin) DoctorCheckOutput `json:"run"`
}

DoctorCheck defines a diagnostic check that can run in the debug doctor panel.

type DoctorCheckOutput added in v0.25.0

type DoctorCheckOutput struct {
	Summary  string          `json:"summary,omitempty"`
	Findings []DoctorFinding `json:"findings,omitempty"`
	Action   *DoctorAction   `json:"action,omitempty"`
	Metadata map[string]any  `json:"metadata,omitempty"`
}

DoctorCheckOutput is produced by a single diagnostic check.

type DoctorCheckResult added in v0.25.0

type DoctorCheckResult struct {
	ID          string             `json:"id"`
	Label       string             `json:"label"`
	Description string             `json:"description,omitempty"`
	Help        string             `json:"help,omitempty"`
	Status      DoctorSeverity     `json:"status"`
	Summary     string             `json:"summary,omitempty"`
	DurationMS  int64              `json:"duration_ms"`
	Findings    []DoctorFinding    `json:"findings,omitempty"`
	Action      *DoctorActionState `json:"action,omitempty"`
	Metadata    map[string]any     `json:"metadata,omitempty"`
}

DoctorCheckResult is the rendered output for a check run.

type DoctorDebugPanel added in v0.25.0

type DoctorDebugPanel struct {
	// contains filtered or unexported fields
}

DoctorDebugPanel implements the DebugPanel interface for setup diagnostics.

func NewDoctorDebugPanel added in v0.25.0

func NewDoctorDebugPanel(admin *Admin) *DoctorDebugPanel

NewDoctorDebugPanel creates a new doctor debug panel.

func (*DoctorDebugPanel) Collect added in v0.25.0

func (p *DoctorDebugPanel) Collect(ctx context.Context) map[string]any

Collect gathers doctor diagnostics for the current request context.

func (*DoctorDebugPanel) ID added in v0.25.0

func (p *DoctorDebugPanel) ID() string

ID returns the panel identifier.

func (*DoctorDebugPanel) Icon added in v0.25.0

func (p *DoctorDebugPanel) Icon() string

Icon returns the panel icon class.

func (*DoctorDebugPanel) Label added in v0.25.0

func (p *DoctorDebugPanel) Label() string

Label returns the panel display label.

func (*DoctorDebugPanel) Span added in v0.25.0

func (p *DoctorDebugPanel) Span() int

Span returns the panel grid span.

type DoctorFinding added in v0.25.0

type DoctorFinding struct {
	CheckID   string         `json:"check_id,omitempty"`
	Severity  DoctorSeverity `json:"severity"`
	Code      string         `json:"code,omitempty"`
	Component string         `json:"component,omitempty"`
	Message   string         `json:"message"`
	Hint      string         `json:"hint,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
}

DoctorFinding captures one actionable diagnostic item.

type DoctorReport added in v0.25.0

type DoctorReport struct {
	GeneratedAt time.Time           `json:"generated_at"`
	Verdict     DoctorSeverity      `json:"verdict"`
	Summary     DoctorSummary       `json:"summary"`
	Checks      []DoctorCheckResult `json:"checks"`
	Findings    []DoctorFinding     `json:"findings,omitempty"`
	NextActions []string            `json:"next_actions,omitempty"`
}

DoctorReport is the complete diagnostics snapshot for the app setup.

type DoctorSeverity added in v0.25.0

type DoctorSeverity string

DoctorSeverity describes diagnostic severity levels.

const (
	DoctorSeverityOK    DoctorSeverity = "ok"
	DoctorSeverityInfo  DoctorSeverity = "info"
	DoctorSeverityWarn  DoctorSeverity = "warn"
	DoctorSeverityError DoctorSeverity = "error"
)

type DoctorSummary added in v0.25.0

type DoctorSummary struct {
	Checks int `json:"checks"`
	OK     int `json:"ok"`
	Info   int `json:"info"`
	Warn   int `json:"warn"`
	Error  int `json:"error"`
}

DoctorSummary aggregates overall doctor counts.

type DomainErrorCode added in v0.24.0

type DomainErrorCode struct {
	Code        string            `json:"code"`
	Description string            `json:"description"`
	Category    goerrors.Category `json:"category"`
	HTTPStatus  int               `json:"http_status"`
}

DomainErrorCode describes a text code exposed to clients.

func DomainErrorCodeFor added in v0.24.0

func DomainErrorCodeFor(code string) (DomainErrorCode, bool)

DomainErrorCodeFor returns metadata for a registered domain error code.

func DomainErrorCodes added in v0.24.0

func DomainErrorCodes() []DomainErrorCode

DomainErrorCodes returns all registered codes sorted by code.

type DynamicPanelFactory added in v0.23.0

type DynamicPanelFactory struct {
	// contains filtered or unexported fields
}

DynamicPanelFactory builds CRUD panels from CMS content types.

func NewDynamicPanelFactory added in v0.23.0

func NewDynamicPanelFactory(admin *Admin, opts ...DynamicPanelFactoryOption) *DynamicPanelFactory

NewDynamicPanelFactory constructs a factory for dynamic content type panels.

func (*DynamicPanelFactory) CreatePanelFromContentType added in v0.23.0

func (f *DynamicPanelFactory) CreatePanelFromContentType(ctx context.Context, contentType *CMSContentType) (*Panel, error)

CreatePanelFromContentType generates and registers a panel for a content type.

func (*DynamicPanelFactory) RefreshPanel added in v0.23.0

func (f *DynamicPanelFactory) RefreshPanel(ctx context.Context, contentType *CMSContentType) error

RefreshPanel updates an existing panel when the content type changes.

func (*DynamicPanelFactory) RemovePanel added in v0.23.0

func (f *DynamicPanelFactory) RemovePanel(ctx context.Context, slugOrID string) error

RemovePanel removes a panel when a content type is deleted.

type DynamicPanelFactoryOption added in v0.23.0

type DynamicPanelFactoryOption func(*DynamicPanelFactory)

DynamicPanelFactoryOption customizes the factory.

func WithDynamicPanelHooks added in v0.23.0

func WithDynamicPanelHooks(hooks DynamicPanelHooks) DynamicPanelFactoryOption

WithDynamicPanelHooks sets lifecycle hooks for the factory.

func WithDynamicPanelMenu added in v0.23.0

func WithDynamicPanelMenu(basePath, menuCode, menuParent, locale string) DynamicPanelFactoryOption

WithDynamicPanelMenu configures navigation defaults for dynamic panels.

func WithDynamicPanelSchemaConverter added in v0.23.0

func WithDynamicPanelSchemaConverter(converter *SchemaToFieldsConverter) DynamicPanelFactoryOption

WithDynamicPanelSchemaConverter sets a schema converter.

func WithDynamicPanelSchemaValidator added in v0.23.0

func WithDynamicPanelSchemaValidator(validator SchemaValidator) DynamicPanelFactoryOption

WithDynamicPanelSchemaValidator sets a schema validator.

type DynamicPanelHooks added in v0.23.0

type DynamicPanelHooks struct {
	BeforeCreate func(ctx context.Context, contentType *CMSContentType) error `json:"before_create"`
	AfterCreate  func(ctx context.Context, panel *Panel) error                `json:"after_create"`
	BeforeUpdate func(ctx context.Context, contentType *CMSContentType) error `json:"before_update"`
	AfterUpdate  func(ctx context.Context, panel *Panel) error                `json:"after_update"`
}

DynamicPanelHooks exposes lifecycle callbacks for panel creation.

type EffectiveScope added in v0.83.0

type EffectiveScope struct {
	TenantID string `json:"tenant_id"`
	OrgID    string `json:"org_id"`
	Source   string `json:"source,omitempty"`
}

EffectiveScope is the resolved tenant/org scope for a request or background operation.

type EnhancedActionNegotiationConfig added in v0.86.0

type EnhancedActionNegotiationConfig struct {
	RequestHeader      string   `json:"request_header,omitempty"`
	RequestHeaderValue string   `json:"request_header_value,omitempty"`
	RequestMediaTypes  []string `json:"request_media_types,omitempty"`
	ResponseMediaType  string   `json:"response_media_type,omitempty"`
}

func DefaultEnhancedActionNegotiationConfig added in v0.86.0

func DefaultEnhancedActionNegotiationConfig() EnhancedActionNegotiationConfig

type EnhancedActionRuntimeOptions added in v0.86.0

type EnhancedActionRuntimeOptions struct {
	RequestHeader      string `json:"request_header,omitempty"`
	RequestHeaderValue string `json:"request_header_value,omitempty"`
	Accept             string `json:"accept,omitempty"`
}

func EnhancedActionRuntimeOptionsFromConfig added in v0.86.0

func EnhancedActionRuntimeOptionsFromConfig(cfg EnhancedActionNegotiationConfig) EnhancedActionRuntimeOptions

type EnhancedFragment added in v0.86.0

type EnhancedFragment struct {
	Selector string `json:"selector"`
	Mode     string `json:"mode"`
	HTML     string `json:"html"`
}

func RenderFamilyDetailFragments added in v0.86.0

func RenderFamilyDetailFragments(targets []FamilyDetailFragmentTarget, renderer FamilyDetailFragmentRenderer) ([]EnhancedFragment, error)

RenderFamilyDetailFragments renders server-authored family detail fragments. The first enhanced SSR convention supports only known targets and replace mode.

func RenderFamilyDetailFragmentsFromData added in v0.86.0

func RenderFamilyDetailFragmentsFromData(data map[string]any) ([]EnhancedFragment, error)

type EnhancedMutationError added in v0.86.0

type EnhancedMutationError struct {
	Message  string            `json:"message"`
	Code     int               `json:"code,omitempty"`
	TextCode string            `json:"text_code,omitempty"`
	Category string            `json:"category,omitempty"`
	Fields   map[string]string `json:"fields,omitempty"`
	Meta     map[string]any    `json:"meta,omitempty"`
}

type EnhancedMutationResponder added in v0.86.0

type EnhancedMutationResponder struct {
	ErrorPresenter ErrorPresenter
	MediaType      string
}

func NewEnhancedMutationResponder added in v0.86.0

func NewEnhancedMutationResponder(presenter ...ErrorPresenter) EnhancedMutationResponder

func (EnhancedMutationResponder) Respond added in v0.86.0

func (EnhancedMutationResponder) RespondError added in v0.86.0

func (EnhancedMutationResponder) WithMediaType added in v0.86.0

func (r EnhancedMutationResponder) WithMediaType(mediaType string) EnhancedMutationResponder

type EnhancedToast added in v0.86.0

type EnhancedToast struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

type EnsureMenuParentsOptions

type EnsureMenuParentsOptions struct {
	MenuSvc  CMSMenuService `json:"menu_svc"`
	MenuCode string         `json:"menu_code"`
	Parents  []MenuItem     `json:"parents"`
	Locale   string         `json:"locale"`
}

EnsureMenuParentsOptions controls how parent/group menu items are scaffolded.

type EntryNavigationEvaluation added in v0.111.0

type EntryNavigationEvaluation struct {
	Overrides           map[string]string `json:"overrides"`
	EffectiveLocations  []string          `json:"effective_locations"`
	EffectiveVisibility map[string]bool   `json:"effective_visibility"`
}

EntryNavigationEvaluation is the normalized read/write contract for an entry.

func EvaluateEntryNavigation added in v0.111.0

func EvaluateEntryNavigation(rawOverrides any, policy EntryNavigationPolicy, strict bool) (EntryNavigationEvaluation, error)

EvaluateEntryNavigation normalizes overrides and computes effective menu locations and visibility for a policy. Strict mode rejects invalid locations and disabled policies; non-strict mode drops invalid locations and returns an empty result for disabled policies.

func EvaluateEntryNavigationFromRecord added in v0.111.0

func EvaluateEntryNavigationFromRecord(record map[string]any, policy EntryNavigationPolicy) (EntryNavigationEvaluation, bool)

EvaluateEntryNavigationFromRecord extracts _navigation from a record and computes the effective entry-navigation contract.

type EntryNavigationOptions added in v0.111.0

type EntryNavigationOptions struct {
	Enabled               *bool                                 `json:"enabled,omitempty"`
	EligibleLocations     []string                              `json:"eligible_locations,omitempty"`
	DefaultLocations      []string                              `json:"default_locations,omitempty"`
	DefaultVisible        *bool                                 `json:"default_visible,omitempty"`
	AllowInstanceOverride *bool                                 `json:"allow_instance_override,omitempty"`
	ViewPermission        string                                `json:"view_permission,omitempty"`
	EditPermission        string                                `json:"edit_permission,omitempty"`
	PermissionResource    string                                `json:"permission_resource,omitempty"`
	ActivityAction        string                                `json:"activity_action,omitempty"`
	ExcludedContentTypes  []string                              `json:"excluded_content_types,omitempty"`
	ContentTypes          map[string]EntryNavigationTypeOptions `json:"content_types,omitempty"`
}

EntryNavigationOptions configures reusable entry navigation visibility.

type EntryNavigationPolicy added in v0.111.0

type EntryNavigationPolicy struct {
	Enabled               bool     `json:"enabled"`
	EligibleLocations     []string `json:"eligible_locations"`
	DefaultLocations      []string `json:"default_locations"`
	DefaultVisible        bool     `json:"default_visible"`
	AllowInstanceOverride bool     `json:"allow_instance_override"`
	ViewPermission        string   `json:"view_permission,omitempty"`
	EditPermission        string   `json:"edit_permission,omitempty"`
	PermissionResource    string   `json:"permission_resource,omitempty"`
	ActivityAction        string   `json:"activity_action,omitempty"`
	Excluded              bool     `json:"excluded,omitempty"`
}

EntryNavigationPolicy declares the content-type policy used to evaluate entry-level navigation visibility.

func EntryNavigationPolicyFromContentType added in v0.111.0

func EntryNavigationPolicyFromContentType(contentType CMSContentType) EntryNavigationPolicy

EntryNavigationPolicyFromContentType builds the entry-navigation policy from a CMS content type's capabilities.navigation contract.

func EntryNavigationPolicyFromOptions added in v0.111.0

func EntryNavigationPolicyFromOptions(contentType CMSContentType, options EntryNavigationOptions) EntryNavigationPolicy

EntryNavigationPolicyFromOptions builds the merged entry-navigation policy for a content type using global options, capabilities.navigation, per-type options, and exclusions in that order.

func ResolveEntryNavigationPolicy added in v0.111.0

func ResolveEntryNavigationPolicy(ctx context.Context, service CMSContentTypeService, contentTypeKey string) (EntryNavigationPolicy, bool)

ResolveEntryNavigationPolicy resolves a content type by slug or ID and returns its entry-navigation policy.

func ResolveEntryNavigationPolicyWithOptions added in v0.111.0

func ResolveEntryNavigationPolicyWithOptions(ctx context.Context, service CMSContentTypeService, contentTypeKey string, options EntryNavigationOptions) (EntryNavigationPolicy, bool)

ResolveEntryNavigationPolicyWithOptions resolves and merges entry navigation options for a content type.

type EntryNavigationTypeOptions added in v0.111.0

type EntryNavigationTypeOptions struct {
	Excluded              bool     `json:"excluded,omitempty"`
	EligibleLocations     []string `json:"eligible_locations,omitempty"`
	DefaultLocations      []string `json:"default_locations,omitempty"`
	DefaultVisible        *bool    `json:"default_visible,omitempty"`
	AllowInstanceOverride *bool    `json:"allow_instance_override,omitempty"`
	ViewPermission        string   `json:"view_permission,omitempty"`
	EditPermission        string   `json:"edit_permission,omitempty"`
	PermissionResource    string   `json:"permission_resource,omitempty"`
	ActivityAction        string   `json:"activity_action,omitempty"`
}

EntryNavigationTypeOptions narrows or disables entry navigation for a content type.

type EntryNavigationViewModel added in v0.111.0

type EntryNavigationViewModel struct {
	Visible                bool              `json:"visible"`
	Editable               bool              `json:"editable"`
	ReadOnly               bool              `json:"read_only"`
	ContentType            string            `json:"content_type"`
	Panel                  string            `json:"panel"`
	RecordID               string            `json:"record_id"`
	Endpoint               string            `json:"endpoint"`
	EligibleLocations      []string          `json:"eligible_locations"`
	DefaultLocations       []string          `json:"default_locations"`
	Overrides              map[string]string `json:"overrides"`
	EffectiveVisibility    map[string]bool   `json:"effective_visibility"`
	EffectiveMenuLocations []string          `json:"effective_menu_locations"`
	AllowInstanceOverride  bool              `json:"allow_instance_override"`
	ViewPermission         string            `json:"view_permission,omitempty"`
	EditPermission         string            `json:"edit_permission,omitempty"`
	PermissionResource     string            `json:"permission_resource,omitempty"`
	PanelViewPermission    string            `json:"panel_view_permission,omitempty"`
	PanelEditPermission    string            `json:"panel_edit_permission,omitempty"`
	ActivityAction         string            `json:"activity_action,omitempty"`
	Reason                 string            `json:"reason,omitempty"`
	Debug                  map[string]any    `json:"debug,omitempty"`
}

EntryNavigationViewModel is the server-authored state used by templates and progressive enhancement code.

func BuildEntryNavigationViewModel added in v0.111.0

func BuildEntryNavigationViewModel(input EntryNavigationViewModelInput) (EntryNavigationViewModel, error)

BuildEntryNavigationViewModel resolves visibility, editability, and effective navigation state for a content entry.

func (EntryNavigationViewModel) ToMap added in v0.111.0

func (m EntryNavigationViewModel) ToMap() map[string]any

ToMap returns a template-friendly map using the JSON field names.

type EntryNavigationViewModelInput added in v0.111.0

type EntryNavigationViewModelInput struct {
	Context     context.Context
	Authorizer  Authorizer
	Panel       *Panel
	PanelName   string
	ContentType *CMSContentType
	Record      map[string]any
	Policy      EntryNavigationPolicy
	Endpoint    string
}

EntryNavigationViewModelInput contains server state needed to build a view model.

type EnvironmentInfo added in v0.24.0

type EnvironmentInfo struct {
	GoVersion   string                      `json:"go_version,omitempty"`
	AppVersion  string                      `json:"app_version,omitempty"`
	Environment string                      `json:"environment,omitempty"`
	Debug       bool                        `json:"debug"`
	ConfigVars  map[string]string           `json:"config_vars,omitempty"`
	Deployment  *DeploymentIdentitySnapshot `json:"deployment,omitempty"`
}

EnvironmentInfo holds runtime environment details.

type ErrorConfig added in v0.24.0

type ErrorConfig struct {
	// DevMode enables developer-friendly error responses.
	DevMode bool `json:"dev_mode"`
	// IncludeStackTrace controls stack trace inclusion when DevMode is false.
	IncludeStackTrace bool `json:"include_stack_trace"`
	// ExposeInternalMessages allows internal error messages to reach clients.
	ExposeInternalMessages bool `json:"expose_internal_messages"`
	// InternalMessage is the default message for internal errors when not exposed.
	InternalMessage string `json:"internal_message"`
	// SourceContextLines controls how many lines of source code to show around errors.
	// Default is 7 lines before and after.
	SourceContextLines int `json:"source_context_lines"`
	// MaxStackFrames limits the number of stack frames to display.
	// Default is 20 frames.
	MaxStackFrames int `json:"max_stack_frames"`
	// ShowRequestHeaders includes HTTP headers in dev error pages.
	ShowRequestHeaders bool `json:"show_request_headers"`
	// ShowRequestBody includes request body in dev error pages.
	ShowRequestBody bool `json:"show_request_body"`
	// ShowEnvironment includes environment info in dev error pages.
	ShowEnvironment bool `json:"show_environment"`
	// AppVersion is displayed in the error page environment section.
	AppVersion string `json:"app_version"`
	// AppRoots ranks host application source paths ahead of framework paths in dev error pages.
	AppRoots []string `json:"app_roots,omitempty"`
}

ErrorConfig controls how errors are presented to clients.

type ErrorPresenter added in v0.24.0

type ErrorPresenter struct {
	Config  ErrorConfig            `json:"config"`
	Mappers []goerrors.ErrorMapper `json:"mappers"`
	// contains filtered or unexported fields
}

func DefaultErrorPresenter added in v0.24.0

func DefaultErrorPresenter() ErrorPresenter

DefaultErrorPresenter returns the presenter used by writeError.

func NewErrorPresenter added in v0.24.0

func NewErrorPresenter(cfg ErrorConfig, mappers ...goerrors.ErrorMapper) ErrorPresenter

NewErrorPresenter constructs an error presenter with default mappers.

func (ErrorPresenter) BuildDevErrorContext added in v0.24.0

func (p ErrorPresenter) BuildDevErrorContext(err error, reqInfo *RequestInfo) *DevErrorContext

BuildDevErrorContext creates an enriched error context for developer error pages.

func (ErrorPresenter) DeploymentIdentity added in v0.122.0

func (p ErrorPresenter) DeploymentIdentity() DeploymentIdentity

DeploymentIdentity returns the identity attached to this presenter.

func (ErrorPresenter) ErrorResponse added in v0.116.0

func (p ErrorPresenter) ErrorResponse(mapped *goerrors.Error) ErrorResponse

ErrorResponse converts a presenter-normalized error into go-admin's API contract. Diagnostic source locations and stacks remain opt-in.

func (ErrorPresenter) IncludeStackTrace added in v0.24.0

func (p ErrorPresenter) IncludeStackTrace() bool

IncludeStackTrace returns whether stack traces should be included in responses.

func (ErrorPresenter) Present added in v0.24.0

func (p ErrorPresenter) Present(err error) (*goerrors.Error, int)

Present maps an error to a go-errors error and status code.

func (ErrorPresenter) PresentWithContext added in v0.24.0

func (p ErrorPresenter) PresentWithContext(c router.Context, err error) (*goerrors.Error, int)

PresentWithContext maps an error and enriches it with request metadata.

func (ErrorPresenter) WithDeploymentIdentity added in v0.122.0

func (p ErrorPresenter) WithDeploymentIdentity(identity DeploymentIdentity) ErrorPresenter

WithDeploymentIdentity returns a presenter carrying the already-resolved process identity. It does not perform metadata discovery.

type ErrorResponse added in v0.116.0

type ErrorResponse struct {
	Error *PresentedError `json:"error"`
}

ErrorResponse is the go-admin API error envelope. ErrorPresenter mappers own the client-safe message and metadata contract exposed by this response.

type ExportColumn

type ExportColumn struct {
	Key   string `json:"key"`
	Label string `json:"label,omitempty"`
}

ExportColumn describes a column available for export.

type ExportConfig

type ExportConfig struct {
	Definition string `json:"definition"`
	Variant    string `json:"variant,omitempty"`
	Endpoint   string `json:"endpoint"`
}

ExportConfig captures export metadata for UI consumers.

type ExportDefinition

type ExportDefinition struct {
	Name     string   `json:"name"`
	Label    string   `json:"label,omitempty"`
	Variants []string `json:"variants,omitempty"`
}

ExportDefinition is the minimal shape surfaced by the export registry.

type ExportHTTPRegistrar

type ExportHTTPRegistrar interface {
	RegisterExportRoutes(router AdminRouter, opts ExportRouteOptions) error
}

ExportHTTPRegistrar registers export HTTP endpoints on a router.

type ExportMetadata

type ExportMetadata struct {
	Formats []string       `json:"formats,omitempty"`
	Columns []ExportColumn `json:"columns,omitempty"`
}

ExportMetadata captures UI-facing export metadata.

type ExportMetadataProvider

type ExportMetadataProvider interface {
	ExportMetadata(ctx context.Context, definition, variant string) (ExportMetadata, error)
}

ExportMetadataProvider fetches formats/columns for a definition and variant.

type ExportRegistry

type ExportRegistry interface {
	ListDefinitions(ctx context.Context) ([]ExportDefinition, error)
	GetDefinition(ctx context.Context, name string) (ExportDefinition, error)
}

ExportRegistry lists or fetches export definitions.

type ExportRouteOptions

type ExportRouteOptions struct {
	BasePath string             `json:"base_path"`
	Wrap     ExportRouteWrapper `json:"wrap"`
}

ExportRouteOptions configures export route registration.

type ExportRouteWrapper

type ExportRouteWrapper func(router.HandlerFunc) router.HandlerFunc

ExportRouteWrapper wraps export handlers with auth or middleware.

type ExternalAssetConfig added in v0.126.1

type ExternalAssetConfig struct {
	// IconoirCSS supplies the Iconoir icon stylesheet used by menu and control
	// glyphs that no theme asset role covers.
	IconoirCSS string `json:"iconoir_css,omitempty"`
	// DataTablesCSS supplies the simple-datatables stylesheet.
	DataTablesCSS string `json:"datatables_css,omitempty"`
	// EChartsJS supplies the ECharts runtime used by dashboard charts.
	EChartsJS string `json:"echarts_js,omitempty"`
}

ExternalAssetConfig points the admin document at specific copies of the third-party assets it renders with. Empty fields select the packaged default.

func (ExternalAssetConfig) Resolve added in v0.126.1

Resolve returns normalized explicit overrides. Empty fields intentionally remain empty so templates can resolve the packaged defaults against the request's base-path-aware asset_base_path.

func (ExternalAssetConfig) Validate added in v0.126.2

func (c ExternalAssetConfig) Validate() error

Validate rejects asset overrides that browsers could interpret as executable or scheme-relative URLs. Deployments may use an http(s) URL or a path relative to the current origin.

type FSMLifecycleActivitySinkAdapter added in v0.26.0

type FSMLifecycleActivitySinkAdapter struct {
	// contains filtered or unexported fields
}

FSMLifecycleActivitySinkAdapter bridges go-command FSM lifecycle envelopes into admin activity entries.

func NewFSMLifecycleActivitySinkAdapter added in v0.26.0

func NewFSMLifecycleActivitySinkAdapter(sink ActivitySink) *FSMLifecycleActivitySinkAdapter

NewFSMLifecycleActivitySinkAdapter creates an adapter that forwards FSM lifecycle activity to an ActivitySink.

func (*FSMLifecycleActivitySinkAdapter) LogLifecycleActivity added in v0.26.0

func (a *FSMLifecycleActivitySinkAdapter) LogLifecycleActivity(ctx context.Context, envelope flow.LifecycleActivityEnvelope) error

LogLifecycleActivity maps a lifecycle envelope into an admin activity entry.

type FSMWorkflowEngine added in v0.26.0

type FSMWorkflowEngine struct {
	// contains filtered or unexported fields
}

FSMWorkflowEngine is the canonical go-admin workflow adapter backed by go-command/flow.

func NewFSMWorkflowEngine added in v0.26.0

func NewFSMWorkflowEngine(opts ...FSMWorkflowEngineOption) *FSMWorkflowEngine

NewFSMWorkflowEngine creates a workflow engine backed by go-command/flow state machines.

func (*FSMWorkflowEngine) ApplyEvent added in v0.26.0

ApplyEvent applies an event using canonical FSM envelopes.

func (*FSMWorkflowEngine) AttachActivitySink added in v0.26.0

func (e *FSMWorkflowEngine) AttachActivitySink(sink ActivitySink) error

AttachActivitySink wires lifecycle activity projection and refreshes existing machines.

func (*FSMWorkflowEngine) HasWorkflow added in v0.26.0

func (e *FSMWorkflowEngine) HasWorkflow(entityType string) bool

HasWorkflow reports whether a workflow definition exists for an entity type.

func (*FSMWorkflowEngine) RegisterAction added in v0.26.0

func (e *FSMWorkflowEngine) RegisterAction(name string, action WorkflowActionFunc) error

RegisterAction registers a workflow action handler.

func (*FSMWorkflowEngine) RegisterDynamicTarget added in v0.26.0

func (e *FSMWorkflowEngine) RegisterDynamicTarget(ref string, resolver WorkflowDynamicTargetResolver) error

RegisterDynamicTarget registers a named dynamic target resolver.

func (*FSMWorkflowEngine) RegisterGuard added in v0.26.0

func (e *FSMWorkflowEngine) RegisterGuard(ref string, guard WorkflowGuardFunc) error

RegisterGuard registers a named guard resolver.

func (*FSMWorkflowEngine) RegisterWorkflow added in v0.26.0

func (e *FSMWorkflowEngine) RegisterWorkflow(entityType string, definition WorkflowDefinition) error

RegisterWorkflow installs or replaces a workflow definition for an entity type.

func (*FSMWorkflowEngine) Snapshot added in v0.26.0

Snapshot returns current state plus transition availability/rejections.

func (*FSMWorkflowEngine) UnregisterWorkflow added in v0.27.0

func (e *FSMWorkflowEngine) UnregisterWorkflow(entityType string) error

UnregisterWorkflow removes a registered machine definition and state machine.

func (*FSMWorkflowEngine) WorkflowDefinition added in v0.26.0

func (e *FSMWorkflowEngine) WorkflowDefinition(entityType string) (WorkflowDefinition, bool)

WorkflowDefinition returns the currently registered workflow definition.

type FSMWorkflowEngineOption added in v0.26.0

type FSMWorkflowEngineOption func(*FSMWorkflowEngine)

FSMWorkflowEngineOption customizes FSMWorkflowEngine behavior.

func WithFSMWorkflowActivitySink added in v0.26.0

func WithFSMWorkflowActivitySink(sink ActivitySink) FSMWorkflowEngineOption

WithFSMWorkflowActivitySink projects lifecycle events into admin activity sink.

func WithFSMWorkflowExecutionPolicy added in v0.26.0

func WithFSMWorkflowExecutionPolicy(policy flow.ExecutionPolicy) FSMWorkflowEngineOption

WithFSMWorkflowExecutionPolicy sets execution policy used by compiled machines.

func WithFSMWorkflowHookFailureMode added in v0.26.0

func WithFSMWorkflowHookFailureMode(mode flow.HookFailureMode) FSMWorkflowEngineOption

WithFSMWorkflowHookFailureMode sets lifecycle hook failure mode.

func WithFSMWorkflowIdempotencyStore added in v0.26.0

func WithFSMWorkflowIdempotencyStore(store flow.IdempotencyStore[WorkflowMessage]) FSMWorkflowEngineOption

WithFSMWorkflowIdempotencyStore sets an explicit idempotency store.

func WithFSMWorkflowLifecycleHooks added in v0.26.0

func WithFSMWorkflowLifecycleHooks(hooks ...flow.TransitionLifecycleHook[WorkflowMessage]) FSMWorkflowEngineOption

WithFSMWorkflowLifecycleHooks appends lifecycle hooks.

func WithFSMWorkflowLogger added in v0.26.0

func WithFSMWorkflowLogger(logger flow.Logger) FSMWorkflowEngineOption

WithFSMWorkflowLogger sets a flow logger used by state machines.

func WithFSMWorkflowStateStore added in v0.26.0

func WithFSMWorkflowStateStore(store flow.StateStore) FSMWorkflowEngineOption

WithFSMWorkflowStateStore sets an explicit state store.

type FamilyDetailFragmentRenderer added in v0.86.0

type FamilyDetailFragmentRenderer func(FamilyDetailFragmentTarget) (string, error)

type FamilyDetailFragmentTarget added in v0.86.0

type FamilyDetailFragmentTarget string
const (
	FamilyDetailFragmentLocaleCoverage FamilyDetailFragmentTarget = "locale_coverage"
	FamilyDetailFragmentAssignments    FamilyDetailFragmentTarget = "assignments"
	FamilyDetailFragmentPublishGate    FamilyDetailFragmentTarget = "publish_gate"
	FamilyDetailFragmentActivity       FamilyDetailFragmentTarget = "activity"
)

func FamilyDetailFragmentTargets added in v0.86.0

func FamilyDetailFragmentTargets() []FamilyDetailFragmentTarget

type FeatureDependencyError

type FeatureDependencyError struct {
	Feature string   `json:"feature"`
	Missing []string `json:"missing"`
}

FeatureDependencyError captures missing dependencies for an enabled feature.

func (FeatureDependencyError) Error

func (e FeatureDependencyError) Error() string

func (FeatureDependencyError) Unwrap

func (e FeatureDependencyError) Unwrap() error

type FeatureDisabledError

type FeatureDisabledError struct {
	Feature string `json:"feature"`
	Reason  string `json:"reason"`
}

FeatureDisabledError includes the specific feature name and optional reason.

func (FeatureDisabledError) Error

func (e FeatureDisabledError) Error() string

func (FeatureDisabledError) Unwrap

func (e FeatureDisabledError) Unwrap() error

type FeatureFlagsModule added in v0.21.0

type FeatureFlagsModule struct {
	// contains filtered or unexported fields
}

FeatureFlagsModule registers the feature flags UI navigation entry.

func NewFeatureFlagsModule added in v0.21.0

func NewFeatureFlagsModule() *FeatureFlagsModule

NewFeatureFlagsModule constructs the default feature flags module.

func (*FeatureFlagsModule) Manifest added in v0.21.0

func (m *FeatureFlagsModule) Manifest() ModuleManifest

func (*FeatureFlagsModule) MenuItems added in v0.21.0

func (m *FeatureFlagsModule) MenuItems(locale string) []MenuItem

func (*FeatureFlagsModule) Register added in v0.21.0

func (m *FeatureFlagsModule) Register(ctx ModuleContext) error

func (*FeatureFlagsModule) RouteContract added in v0.27.0

func (m *FeatureFlagsModule) RouteContract() routing.ModuleContract

func (*FeatureFlagsModule) WithBasePath added in v0.24.0

func (m *FeatureFlagsModule) WithBasePath(basePath string) *FeatureFlagsModule

WithBasePath sets the base path used for menu item targets (e.g., /admin).

func (*FeatureFlagsModule) WithMenuParent added in v0.21.0

func (m *FeatureFlagsModule) WithMenuParent(parent string) *FeatureFlagsModule

WithMenuParent nests the feature flags navigation under a parent menu item ID.

type FeatureKey

type FeatureKey string

FeatureKey enumerates supported feature flag keys.

const (
	FeatureDashboard           FeatureKey = "dashboard"
	FeatureActivity            FeatureKey = "activity"
	FeaturePreview             FeatureKey = "preview"
	FeatureSearch              FeatureKey = "search"
	FeatureExport              FeatureKey = "export"
	FeatureCMS                 FeatureKey = "cms"
	FeatureJobs                FeatureKey = "jobs"
	FeatureCommands            FeatureKey = "commands"
	FeatureSettings            FeatureKey = "settings"
	FeatureNotifications       FeatureKey = "notifications"
	FeatureMedia               FeatureKey = "media"
	FeatureBulk                FeatureKey = "bulk"
	FeaturePreferences         FeatureKey = "preferences"
	FeatureProfile             FeatureKey = "profile"
	FeatureUsers               FeatureKey = "users"
	FeatureTenants             FeatureKey = "tenants"
	FeatureOrganizations       FeatureKey = "organizations"
	FeatureTranslationExchange FeatureKey = "translations.exchange"
	FeatureTranslationQueue    FeatureKey = "translations.queue"
	FeatureTranslationQAStyle  FeatureKey = "translations.qa.style"
	FeatureTranslationQATerms  FeatureKey = "translations.qa.terminology"
)

type Field

type Field struct {
	Name       string   `json:"name"`
	Label      string   `json:"label"`
	LabelKey   string   `json:"label_key,omitempty"`
	Type       string   `json:"type"`
	Required   bool     `json:"required"`
	ReadOnly   bool     `json:"read_only"`
	Hidden     bool     `json:"hidden"`
	Options    []Option `json:"options,omitempty"`
	Validation string   `json:"validation,omitempty"`
}

Field describes a panel field.

type FieldTypeCategory added in v0.24.0

type FieldTypeCategory struct {
	ID        string `json:"id"`
	Label     string `json:"label"`
	Icon      string `json:"icon,omitempty"`
	Order     int    `json:"order"`
	Collapsed bool   `json:"collapsed,omitempty"`
}

FieldTypeCategory describes a palette group.

type FieldTypeCategoryGroup added in v0.24.0

type FieldTypeCategoryGroup struct {
	Category   FieldTypeCategory     `json:"category"`
	FieldTypes []FieldTypeDefinition `json:"field_types"`
}

FieldTypeCategoryGroup bundles field types by category.

func BlockFieldTypeGroups added in v0.24.0

func BlockFieldTypeGroups() []FieldTypeCategoryGroup

BlockFieldTypeGroups exposes the default grouped palette for the Block IDE.

type FieldTypeDefinition added in v0.24.0

type FieldTypeDefinition struct {
	Type        string         `json:"type"`
	Label       string         `json:"label"`
	Description string         `json:"description,omitempty"`
	Category    string         `json:"category"`
	Icon        string         `json:"icon,omitempty"`
	Defaults    map[string]any `json:"defaults,omitempty"`
	Order       int            `json:"order"`
}

FieldTypeDefinition describes a single field option in the Block Library palette.

type FieldTypeRegistry added in v0.24.0

type FieldTypeRegistry struct {
	// contains filtered or unexported fields
}

FieldTypeRegistry stores field type metadata for the Block Library palette.

func DefaultBlockFieldTypeRegistry added in v0.24.0

func DefaultBlockFieldTypeRegistry() *FieldTypeRegistry

DefaultBlockFieldTypeRegistry returns the default block field type registry.

func NewFieldTypeRegistry added in v0.24.0

func NewFieldTypeRegistry() *FieldTypeRegistry

NewFieldTypeRegistry constructs an empty registry.

func (*FieldTypeRegistry) Categories added in v0.24.0

func (r *FieldTypeRegistry) Categories() []FieldTypeCategory

Categories returns registered categories ordered by position then ID.

func (*FieldTypeRegistry) FieldTypes added in v0.24.0

func (r *FieldTypeRegistry) FieldTypes() []FieldTypeDefinition

FieldTypes returns registered field types ordered by category then position.

func (*FieldTypeRegistry) Groups added in v0.24.0

Groups returns field types grouped by category in order.

func (*FieldTypeRegistry) Register added in v0.24.0

func (r *FieldTypeRegistry) Register(def FieldTypeDefinition)

Register adds or replaces a field type definition.

func (*FieldTypeRegistry) RegisterCategory added in v0.24.0

func (r *FieldTypeRegistry) RegisterCategory(category FieldTypeCategory)

RegisterCategory adds or replaces a category definition.

type FieldsLogger added in v0.25.0

type FieldsLogger = glog.FieldsLogger

FieldsLogger is an optional structured logging extension.

type Filter

type Filter struct {
	Name            string   `json:"name"`
	Label           string   `json:"label,omitempty"`
	LabelKey        string   `json:"label_key,omitempty"`
	Type            string   `json:"type"`
	Operators       []string `json:"operators,omitempty"`
	DefaultOperator string   `json:"default_operator,omitempty"`
	Options         []Option `json:"options,omitempty"`
}

Filter defines a filter input.

type FilterOnlyRequestValidator added in v0.117.0

type FilterOnlyRequestValidator interface {
	ValidateFilterOnlyRequest(ctx context.Context, req SearchRequest) error
}

FilterOnlyRequestValidator is an optional capability for providers that can prove a blank-query request retains at least one effective bounded constraint.

type FormgenSchemaValidator added in v0.23.0

type FormgenSchemaValidator struct {
	// contains filtered or unexported fields
}

func NewFormgenSchemaValidator added in v0.23.0

func NewFormgenSchemaValidator(basePath string) (*FormgenSchemaValidator, error)

NewFormgenSchemaValidator builds a formgen-backed schema validator/previewer.

func NewFormgenSchemaValidatorWithAPIBase added in v0.24.0

func NewFormgenSchemaValidatorWithAPIBase(basePath, apiBase string) (*FormgenSchemaValidator, error)

NewFormgenSchemaValidatorWithAPIBase builds a formgen-backed schema validator/previewer with an explicit API base.

func (*FormgenSchemaValidator) Preview added in v0.23.0

func (v *FormgenSchemaValidator) Preview(ctx context.Context, schema map[string]any, opts SchemaValidationOptions) ([]byte, error)

Preview renders a form preview from a schema.

func (*FormgenSchemaValidator) RenderForm added in v0.24.0

func (v *FormgenSchemaValidator) RenderForm(ctx context.Context, schema map[string]any, opts SchemaValidationOptions, renderOpts formgenrender.RenderOptions) (string, error)

RenderForm renders HTML for a schema using formgen with custom render options.

func (*FormgenSchemaValidator) Validate added in v0.23.0

func (v *FormgenSchemaValidator) Validate(ctx context.Context, schema map[string]any, opts SchemaValidationOptions) error

Validate verifies that a schema can be normalized by go-formgen.

type GoAuthAuthenticator

type GoAuthAuthenticator struct {
	// contains filtered or unexported fields
}

GoAuthAuthenticator adapts a go-auth RouteAuthenticator to the Authenticator contract.

func NewGoAuthAuthenticator

func NewGoAuthAuthenticator(routeAuth *auth.RouteAuthenticator, cfg auth.Config, opts ...GoAuthAuthenticatorOption) *GoAuthAuthenticator

NewGoAuthAuthenticator builds an Authenticator that executes the protected go-auth middleware.

func NewProtectedSurfaceAuthenticator added in v0.58.0

func NewProtectedSurfaceAuthenticator(routeAuth *auth.RouteAuthenticator, cfg auth.Config, scope ProtectedSurfaceScope, opts ...GoAuthAuthenticatorOption) *GoAuthAuthenticator

NewProtectedSurfaceAuthenticator builds an authenticator for a named protected surface.

func (*GoAuthAuthenticator) AuthenticateRequest added in v0.48.0

func (a *GoAuthAuthenticator) AuthenticateRequest(ctx router.Context) error

AuthenticateRequest enforces authentication without browser redirects. This is suitable for websocket upgrades and other non-HTML transports.

func (*GoAuthAuthenticator) EnforceBrowserCSRF added in v0.32.0

func (a *GoAuthAuthenticator) EnforceBrowserCSRF(c router.Context) error

func (*GoAuthAuthenticator) UsesBrowserSession added in v0.32.0

func (a *GoAuthAuthenticator) UsesBrowserSession(c router.Context) bool

func (*GoAuthAuthenticator) Wrap

func (a *GoAuthAuthenticator) Wrap(ctx router.Context) error

Wrap runs the underlying go-auth middleware to enforce authentication.

func (*GoAuthAuthenticator) WrapHandler

func (a *GoAuthAuthenticator) WrapHandler(handler router.HandlerFunc) router.HandlerFunc

WrapHandler runs the go-auth middleware around the provided handler.

type GoAuthAuthenticatorOption

type GoAuthAuthenticatorOption func(*GoAuthAuthenticator)

GoAuthAuthenticatorOption configures the go-auth authenticator adapter.

func WithAuthErrorHandler

func WithAuthErrorHandler(handler func(router.Context, error) error) GoAuthAuthenticatorOption

WithAuthErrorHandler overrides the error handler used by the wrapped go-auth middleware.

func WithBrowserProtectionConfig added in v0.131.6

func WithBrowserProtectionConfig(config auth.BrowserProtectionConfig) GoAuthAuthenticatorOption

WithBrowserProtectionConfig overrides the browser CSRF/origin protection contract while retaining controlled go-admin defaults for omitted handlers.

func WithOptionalAuth

func WithOptionalAuth(optional bool) GoAuthAuthenticatorOption

WithOptionalAuth allows requests without a valid token to proceed (client-side guards).

func WithProtectedSurfaceRoots added in v0.58.0

func WithProtectedSurfaceRoots(browserRoots, apiRoots []string) GoAuthAuthenticatorOption

WithProtectedSurfaceRoots overrides the browser and API roots used to choose protected-surface browser vs API auth behavior.

type GoAuthAuthorizer

type GoAuthAuthorizer struct {
	// contains filtered or unexported fields
}

GoAuthAuthorizer adapts auth claims/resource roles to the admin Authorizer contract.

func NewGoAuthAuthorizer

func NewGoAuthAuthorizer(cfg GoAuthAuthorizerConfig) *GoAuthAuthorizer

NewGoAuthAuthorizer builds an Authorizer backed by go-auth claims.

func (*GoAuthAuthorizer) Can

func (a *GoAuthAuthorizer) Can(ctx context.Context, permission string, resource string) bool

Can evaluates permission strings (admin.<resource>.<action>) against go-auth claims. It normalizes the action (e.g., "view" → "read") and checks if the user's resource role grants that capability using the AuthClaims interface methods.

func (*GoAuthAuthorizer) CanAll added in v0.25.0

func (a *GoAuthAuthorizer) CanAll(ctx context.Context, resource string, permissions ...string) bool

CanAll returns true when all permissions are allowed.

func (*GoAuthAuthorizer) CanAny added in v0.25.0

func (a *GoAuthAuthorizer) CanAny(ctx context.Context, resource string, permissions ...string) bool

CanAny returns true when at least one permission is allowed.

func (*GoAuthAuthorizer) PermissionResolverMetrics added in v0.25.0

func (a *GoAuthAuthorizer) PermissionResolverMetrics() PermissionResolverMetrics

PermissionResolverMetrics exposes resolver/caching runtime counters.

func (*GoAuthAuthorizer) ResolvedPermissions added in v0.25.0

func (a *GoAuthAuthorizer) ResolvedPermissions(ctx context.Context) []string

ResolvedPermissions returns the deduplicated permission set resolved for the request context.

type GoAuthAuthorizerConfig

type GoAuthAuthorizerConfig struct {
	DefaultResource      string                 `json:"default_resource"`
	AdminResourceAliases []string               `json:"admin_resource_aliases,omitempty"`
	Debug                bool                   `json:"debug"`
	Logger               Logger                 `json:"logger"`
	StrictResolver       bool                   `json:"strict_resolver"`
	ResolvePermissions   PermissionResolverFunc `json:"resolve_permissions"`
}

GoAuthAuthorizerConfig configures resource resolution.

type GoCMSContainerAdapter

type GoCMSContainerAdapter struct {
	// contains filtered or unexported fields
}

GoCMSContainerAdapter maps go-cms containers/modules into the admin CMSContainer contract.

func NewGoCMSContainerAdapter

func NewGoCMSContainerAdapter(container any) *GoCMSContainerAdapter

NewGoCMSContainerAdapter inspects a go-cms module or container and wraps available services.

func (*GoCMSContainerAdapter) ActiveLocales added in v0.27.0

func (c *GoCMSContainerAdapter) ActiveLocales(ctx context.Context) ([]string, error)

func (*GoCMSContainerAdapter) ContentService

func (c *GoCMSContainerAdapter) ContentService() CMSContentService

func (*GoCMSContainerAdapter) ContentTypeService added in v0.23.0

func (c *GoCMSContainerAdapter) ContentTypeService() CMSContentTypeService

func (*GoCMSContainerAdapter) MenuService

func (c *GoCMSContainerAdapter) MenuService() CMSMenuService

func (*GoCMSContainerAdapter) WidgetService

func (c *GoCMSContainerAdapter) WidgetService() CMSWidgetService

type GoCMSContentAdapter added in v0.23.0

type GoCMSContentAdapter struct {
	// contains filtered or unexported fields
}

GoCMSContentAdapter maps go-cms content/block services into CMSContentService. It uses the typed public go-cms contracts.

func (*GoCMSContentAdapter) BlockDefinitionVersions added in v0.24.0

func (a *GoCMSContentAdapter) BlockDefinitionVersions(ctx context.Context, id string) ([]CMSBlockDefinitionVersion, error)

BlockDefinitionVersions returns the schema version history for a block definition.

func (*GoCMSContentAdapter) BlockDefinitions added in v0.23.0

func (a *GoCMSContentAdapter) BlockDefinitions(ctx context.Context) ([]CMSBlockDefinition, error)

func (*GoCMSContentAdapter) BlocksForContent added in v0.23.0

func (a *GoCMSContentAdapter) BlocksForContent(ctx context.Context, contentID, locale string) ([]CMSBlock, error)

func (*GoCMSContentAdapter) Content added in v0.23.0

func (a *GoCMSContentAdapter) Content(ctx context.Context, id, locale string) (*CMSContent, error)

func (*GoCMSContentAdapter) Contents added in v0.23.0

func (a *GoCMSContentAdapter) Contents(ctx context.Context, locale string) ([]CMSContent, error)

func (*GoCMSContentAdapter) ContentsWithOptions added in v0.24.0

func (a *GoCMSContentAdapter) ContentsWithOptions(ctx context.Context, locale string, opts ...CMSContentListOption) ([]CMSContent, error)

func (*GoCMSContentAdapter) CreateBlockDefinition added in v0.23.0

func (a *GoCMSContentAdapter) CreateBlockDefinition(ctx context.Context, def CMSBlockDefinition) (*CMSBlockDefinition, error)

func (*GoCMSContentAdapter) CreateContent added in v0.23.0

func (a *GoCMSContentAdapter) CreateContent(ctx context.Context, content CMSContent) (*CMSContent, error)

func (*GoCMSContentAdapter) CreatePage added in v0.23.0

func (a *GoCMSContentAdapter) CreatePage(ctx context.Context, page CMSPage) (*CMSPage, error)

func (*GoCMSContentAdapter) CreateTranslation added in v0.25.0

func (a *GoCMSContentAdapter) CreateTranslation(ctx context.Context, input TranslationCreateInput) (*CMSContent, error)

CreateTranslation uses the typed go-cms admin write service. Older dynamic ContentTranslations/CreateTranslation shapes are intentionally unsupported so GoCMS wiring fails clearly instead of falling back to reflective shims.

func (*GoCMSContentAdapter) DeleteBlock added in v0.23.0

func (a *GoCMSContentAdapter) DeleteBlock(ctx context.Context, id string) error

func (*GoCMSContentAdapter) DeleteBlockDefinition added in v0.23.0

func (a *GoCMSContentAdapter) DeleteBlockDefinition(ctx context.Context, id string) error

func (*GoCMSContentAdapter) DeleteContent added in v0.23.0

func (a *GoCMSContentAdapter) DeleteContent(ctx context.Context, id string) error

func (*GoCMSContentAdapter) DeletePage added in v0.23.0

func (a *GoCMSContentAdapter) DeletePage(ctx context.Context, id string) error

func (*GoCMSContentAdapter) LegacyBlocksForContent added in v0.23.0

func (a *GoCMSContentAdapter) LegacyBlocksForContent(ctx context.Context, contentID, locale string) ([]CMSBlock, error)

func (*GoCMSContentAdapter) ListContentTypeFamilies added in v0.103.0

func (a *GoCMSContentAdapter) ListContentTypeFamilies(ctx context.Context, contentType CMSContentType, opts ListOptions) ([]map[string]any, int, error)

func (*GoCMSContentAdapter) ListContentTypeRecords added in v0.103.0

func (a *GoCMSContentAdapter) ListContentTypeRecords(ctx context.Context, contentType CMSContentType, opts ListOptions) ([]map[string]any, int, error)

func (*GoCMSContentAdapter) Page added in v0.23.0

func (a *GoCMSContentAdapter) Page(ctx context.Context, id, locale string) (*CMSPage, error)

func (*GoCMSContentAdapter) Pages added in v0.23.0

func (a *GoCMSContentAdapter) Pages(ctx context.Context, locale string) ([]CMSPage, error)

func (*GoCMSContentAdapter) PagesWithOptions added in v0.43.0

func (a *GoCMSContentAdapter) PagesWithOptions(ctx context.Context, locale string, opts ...CMSContentListOption) ([]CMSPage, error)

func (*GoCMSContentAdapter) SaveBlock added in v0.23.0

func (a *GoCMSContentAdapter) SaveBlock(ctx context.Context, block CMSBlock) (*CMSBlock, error)

func (*GoCMSContentAdapter) SupportsContentListOption added in v0.113.10

func (a *GoCMSContentAdapter) SupportsContentListOption(option CMSContentListOption) bool

SupportsContentListOption lets hosts negotiate optional bounded list capabilities without sending unknown tokens to older adapters.

func (*GoCMSContentAdapter) UpdateBlockDefinition added in v0.23.0

func (a *GoCMSContentAdapter) UpdateBlockDefinition(ctx context.Context, def CMSBlockDefinition) (*CMSBlockDefinition, error)

func (*GoCMSContentAdapter) UpdateContent added in v0.23.0

func (a *GoCMSContentAdapter) UpdateContent(ctx context.Context, content CMSContent) (*CMSContent, error)

func (*GoCMSContentAdapter) UpdatePage added in v0.23.0

func (a *GoCMSContentAdapter) UpdatePage(ctx context.Context, page CMSPage) (*CMSPage, error)

type GoCMSContentTypeAdapter added in v0.23.0

type GoCMSContentTypeAdapter struct {
	// contains filtered or unexported fields
}

GoCMSContentTypeAdapter maps go-cms content type service into CMSContentTypeService.

func (*GoCMSContentTypeAdapter) ContentType added in v0.23.0

func (a *GoCMSContentTypeAdapter) ContentType(ctx context.Context, id string) (*CMSContentType, error)

func (*GoCMSContentTypeAdapter) ContentTypeBySlug added in v0.23.0

func (a *GoCMSContentTypeAdapter) ContentTypeBySlug(ctx context.Context, slug string) (*CMSContentType, error)

func (*GoCMSContentTypeAdapter) ContentTypes added in v0.23.0

func (a *GoCMSContentTypeAdapter) ContentTypes(ctx context.Context) ([]CMSContentType, error)

func (*GoCMSContentTypeAdapter) CreateContentType added in v0.23.0

func (a *GoCMSContentTypeAdapter) CreateContentType(ctx context.Context, contentType CMSContentType) (*CMSContentType, error)

func (*GoCMSContentTypeAdapter) DeleteContentType added in v0.23.0

func (a *GoCMSContentTypeAdapter) DeleteContentType(ctx context.Context, id string) error

func (*GoCMSContentTypeAdapter) UpdateContentType added in v0.23.0

func (a *GoCMSContentTypeAdapter) UpdateContentType(ctx context.Context, contentType CMSContentType) (*CMSContentType, error)

type GoCMSMenuAdapter

type GoCMSMenuAdapter struct {
	// contains filtered or unexported fields
}

GoCMSMenuAdapter maps the go-cms menu service into the Admin CMSMenuService contract.

It enforces a string-first identity: - menu identity: menu code (sanitized to satisfy go-cms menu code validation) - item identity: dot-paths (menuCode + "." + segments)

UUIDs remain a go-cms persistence detail and are never supplied by go-admin.

func NewGoCMSMenuAdapter

func NewGoCMSMenuAdapter(service cms.MenuService) *GoCMSMenuAdapter

NewGoCMSMenuAdapter wraps a go-cms MenuService.

func NewGoCMSMenuAdapterFromAny

func NewGoCMSMenuAdapterFromAny(service any) *GoCMSMenuAdapter

NewGoCMSMenuAdapterFromAny wraps a go-cms MenuService exposed as any (used by adapter hooks).

func (*GoCMSMenuAdapter) AddMenuItem

func (a *GoCMSMenuAdapter) AddMenuItem(ctx context.Context, menuCode string, item MenuItem) error

AddMenuItem upserts an item using go-cms path-based APIs.

func (*GoCMSMenuAdapter) CreateMenu

func (a *GoCMSMenuAdapter) CreateMenu(ctx context.Context, code string) (*Menu, error)

CreateMenu ensures a menu exists.

func (*GoCMSMenuAdapter) DeleteMenuItem

func (a *GoCMSMenuAdapter) DeleteMenuItem(ctx context.Context, menuCode, id string) error

DeleteMenuItem removes an item via go-cms path-based APIs.

func (*GoCMSMenuAdapter) GoCMSMenuService

func (a *GoCMSMenuAdapter) GoCMSMenuService() cms.MenuService

GoCMSMenuService exposes the underlying go-cms menu service (used by quickstart seeding).

func (*GoCMSMenuAdapter) Menu

func (a *GoCMSMenuAdapter) Menu(ctx context.Context, code, locale string) (*Menu, error)

Menu resolves a localized navigation tree from go-cms.

func (*GoCMSMenuAdapter) MenuByCodeWithOptions added in v0.26.0

func (a *GoCMSMenuAdapter) MenuByCodeWithOptions(ctx context.Context, code, locale string, opts SiteMenuReadOptions) (*Menu, error)

MenuByCodeWithOptions resolves a localized navigation tree by code using draft/preview/profile options when supported by the underlying go-cms service.

func (*GoCMSMenuAdapter) MenuByLocation added in v0.22.0

func (a *GoCMSMenuAdapter) MenuByLocation(ctx context.Context, location, locale string) (*Menu, error)

MenuByLocation resolves a localized navigation tree using menu locations.

func (*GoCMSMenuAdapter) MenuByLocationWithOptions added in v0.26.0

func (a *GoCMSMenuAdapter) MenuByLocationWithOptions(ctx context.Context, location, locale string, opts SiteMenuReadOptions) (*Menu, error)

MenuByLocationWithOptions resolves a localized navigation tree by location using draft/preview/profile options when supported by the underlying go-cms service.

func (*GoCMSMenuAdapter) MenuExists added in v0.122.0

func (a *GoCMSMenuAdapter) MenuExists(ctx context.Context, code string) (bool, error)

MenuExists reports whether go-cms has a persistent menu record for code.

func (*GoCMSMenuAdapter) NavigationCoordinationReport added in v0.111.0

func (a *GoCMSMenuAdapter) NavigationCoordinationReport() NavigationCoordinationReport

func (*GoCMSMenuAdapter) NavigationPersistenceReport added in v0.111.0

func (a *GoCMSMenuAdapter) NavigationPersistenceReport() NavigationPersistenceReport

func (*GoCMSMenuAdapter) RawMenuItems added in v0.85.0

func (a *GoCMSMenuAdapter) RawMenuItems(ctx context.Context, code string) ([]MenuItem, error)

RawMenuItems returns persisted go-cms menu rows without localized navigation filtering. It is intentionally separate from Menu, which remains the renderable navigation API.

func (*GoCMSMenuAdapter) RawMenuItemsWithOptions added in v0.111.0

func (a *GoCMSMenuAdapter) RawMenuItemsWithOptions(ctx context.Context, opts NavigationRawInventoryOptions) ([]MenuItem, error)

func (*GoCMSMenuAdapter) ReorderMenu

func (a *GoCMSMenuAdapter) ReorderMenu(ctx context.Context, menuCode string, orderedIDs []string) error

ReorderMenu updates item positions while preserving their parents.

orderedIDs are treated as item paths (preferred) or relative item IDs.

func (*GoCMSMenuAdapter) ResetMenuContext

func (a *GoCMSMenuAdapter) ResetMenuContext(ctx context.Context, code string) error

ResetMenuContext resets the menu contents. It is used by quickstart navigation tooling to allow rebuilds during development.

func (*GoCMSMenuAdapter) String

func (a *GoCMSMenuAdapter) String() string

func (*GoCMSMenuAdapter) UpdateMenuItem

func (a *GoCMSMenuAdapter) UpdateMenuItem(ctx context.Context, menuCode string, item MenuItem) error

UpdateMenuItem updates an item by path and refreshes its translation for the provided locale.

type GoCMSTranslationPolicy added in v0.24.0

type GoCMSTranslationPolicy struct {
	Pages    cmsinterfaces.PageService       `json:"pages"`
	Content  cmsinterfaces.ContentService    `json:"content"`
	Resolver TranslationRequirementsResolver `json:"resolver"`
}

GoCMSTranslationPolicy enforces translation requirements using go-cms checks.

func (GoCMSTranslationPolicy) Requirements added in v0.25.0

Requirements resolves transition requirements when the policy exposes a resolver.

func (GoCMSTranslationPolicy) Validate added in v0.24.0

Validate enforces the translation requirements resolved for the transition.

type GoCMSWidgetAdapter

type GoCMSWidgetAdapter struct {
	// contains filtered or unexported fields
}

GoCMSWidgetAdapter maps go-cms widgets.Service into CMSWidgetService.

func NewGoCMSWidgetAdapter

func NewGoCMSWidgetAdapter(service any) *GoCMSWidgetAdapter

NewGoCMSWidgetAdapter wraps a go-cms widgets.Service (or compatible typed service).

func (*GoCMSWidgetAdapter) Areas

func (*GoCMSWidgetAdapter) Definitions

func (a *GoCMSWidgetAdapter) Definitions() []WidgetDefinition

func (*GoCMSWidgetAdapter) DeleteDefinition

func (a *GoCMSWidgetAdapter) DeleteDefinition(ctx context.Context, code string) error

func (*GoCMSWidgetAdapter) DeleteInstance

func (a *GoCMSWidgetAdapter) DeleteInstance(ctx context.Context, id string) error

func (*GoCMSWidgetAdapter) HasInstanceForDefinition added in v0.24.0

func (a *GoCMSWidgetAdapter) HasInstanceForDefinition(ctx context.Context, definitionCode string, filter WidgetInstanceFilter) (bool, error)

HasInstanceForDefinition reports whether at least one instance exists for the given definition code.

func (*GoCMSWidgetAdapter) ListInstances

func (a *GoCMSWidgetAdapter) ListInstances(ctx context.Context, filter WidgetInstanceFilter) ([]WidgetInstance, error)

func (*GoCMSWidgetAdapter) RegisterAreaDefinition

func (a *GoCMSWidgetAdapter) RegisterAreaDefinition(ctx context.Context, def WidgetAreaDefinition) error

func (*GoCMSWidgetAdapter) RegisterDefinition

func (a *GoCMSWidgetAdapter) RegisterDefinition(ctx context.Context, def WidgetDefinition) error

func (*GoCMSWidgetAdapter) SaveInstance

func (a *GoCMSWidgetAdapter) SaveInstance(ctx context.Context, instance WidgetInstance) (*WidgetInstance, error)

func (*GoCMSWidgetAdapter) SyncDefinition added in v0.52.0

type GoOptionsSettingsAdapter

type GoOptionsSettingsAdapter struct {
	// contains filtered or unexported fields
}

GoOptionsSettingsAdapter persists settings using go-options layering semantics. It mirrors the in-memory SettingsService storage but annotates scopes with snapshot metadata so provenance is visible in schemas and traces.

func NewGoOptionsSettingsAdapter

func NewGoOptionsSettingsAdapter() *GoOptionsSettingsAdapter

NewGoOptionsSettingsAdapter constructs an adapter with default schema options.

func (*GoOptionsSettingsAdapter) Apply

Apply validates and stores values for the requested scope.

func (*GoOptionsSettingsAdapter) Definitions

func (a *GoOptionsSettingsAdapter) Definitions() []SettingDefinition

Definitions returns the sorted definitions known to the adapter.

func (*GoOptionsSettingsAdapter) RegisterDefinition

func (a *GoOptionsSettingsAdapter) RegisterDefinition(def SettingDefinition)

RegisterDefinition stores a setting definition on the adapter.

func (*GoOptionsSettingsAdapter) Resolve

func (a *GoOptionsSettingsAdapter) Resolve(key, userID string) ResolvedSetting

Resolve returns a single resolved setting with provenance.

func (*GoOptionsSettingsAdapter) ResolveAll

func (a *GoOptionsSettingsAdapter) ResolveAll(userID string) map[string]ResolvedSetting

ResolveAll returns resolved values for every definition.

func (*GoOptionsSettingsAdapter) ResolveAllContext added in v0.140.0

func (a *GoOptionsSettingsAdapter) ResolveAllContext(ctx context.Context, userID string) (map[string]ResolvedSetting, error)

func (*GoOptionsSettingsAdapter) ResolveContext added in v0.140.0

func (a *GoOptionsSettingsAdapter) ResolveContext(ctx context.Context, key, userID string) (ResolvedSetting, error)

func (*GoOptionsSettingsAdapter) Schema

Schema emits the go-options schema document including scope descriptors.

func (*GoOptionsSettingsAdapter) WithSchemaOptions

func (a *GoOptionsSettingsAdapter) WithSchemaOptions(options ...opts.Option)

WithSchemaOptions appends schema generation options.

type GoSearchBundle added in v0.52.0

type GoSearchBundle struct {
	SiteProvider  *GoSearchSiteProvider
	GlobalAdapter *GoSearchGlobalAdapter
	Operations    *GoSearchOperations
}

func NewGoSearchBundle added in v0.52.0

func NewGoSearchBundle(cfg GoSearchBundleConfig) *GoSearchBundle

func (*GoSearchBundle) AttachAdminSearch added in v0.52.0

func (b *GoSearchBundle) AttachAdminSearch(engine *SearchEngine, key string, setPrimary bool)

type GoSearchBundleConfig added in v0.52.0

type GoSearchBundleConfig struct {
	Search         goSearchQuerier
	Suggest        goSuggestQuerier
	Health         goHealthQuerier
	Stats          goStatsQuerier
	EnsureIndex    goEnsureCommander
	Reindex        goReindexCommander
	Indexes        []string
	PermissionName string
	FallbackType   string
}

type GoSearchGlobalAdapter added in v0.27.0

type GoSearchGlobalAdapter struct {
	// contains filtered or unexported fields
}

func NewGoSearchGlobalAdapter added in v0.27.0

func NewGoSearchGlobalAdapter(cfg GoSearchGlobalAdapterConfig) *GoSearchGlobalAdapter

func (*GoSearchGlobalAdapter) Permission added in v0.27.0

func (a *GoSearchGlobalAdapter) Permission() string

func (*GoSearchGlobalAdapter) Search added in v0.27.0

func (a *GoSearchGlobalAdapter) Search(ctx context.Context, query string, limit int) ([]SearchResult, error)

type GoSearchGlobalAdapterConfig added in v0.27.0

type GoSearchGlobalAdapterConfig struct {
	Search         goSearchQuerier
	Indexes        []string
	PermissionName string
	FallbackType   string
}

type GoSearchOperations added in v0.27.0

type GoSearchOperations struct {
	Health      goHealthQuerier
	Stats       goStatsQuerier
	EnsureIndex goEnsureCommander
	Reindex     goReindexCommander
	Indexes     []string
}

func (*GoSearchOperations) Ensure added in v0.27.0

func (*GoSearchOperations) HealthStatus added in v0.27.0

func (*GoSearchOperations) ReindexAll added in v0.27.0

func (o *GoSearchOperations) ReindexAll(ctx context.Context, index string, batchSize int) error

func (*GoSearchOperations) StatsSnapshot added in v0.27.0

type GoSearchSiteProvider added in v0.27.0

type GoSearchSiteProvider struct {
	// contains filtered or unexported fields
}

func NewGoSearchSiteProvider added in v0.27.0

func NewGoSearchSiteProvider(cfg GoSearchSiteProviderConfig) *GoSearchSiteProvider

func (*GoSearchSiteProvider) Search added in v0.27.0

func (*GoSearchSiteProvider) Suggest added in v0.27.0

type GoSearchSiteProviderConfig added in v0.27.0

type GoSearchSiteProviderConfig struct {
	Search  goSearchQuerier
	Suggest goSuggestQuerier
	Indexes []string
}

type GoUsersProfileStore

type GoUsersProfileStore struct {
	// contains filtered or unexported fields
}

GoUsersProfileStore adapts a go-users ProfileRepository to the admin profile store contract.

func NewGoUsersProfileStore

func NewGoUsersProfileStore(repo users.ProfileRepository, scopeResolver func(context.Context) users.ScopeFilter) *GoUsersProfileStore

NewGoUsersProfileStore builds an adapter for go-users profile repositories.

func (*GoUsersProfileStore) Get

func (s *GoUsersProfileStore) Get(ctx context.Context, userID string) (UserProfile, error)

Get returns a user profile via the go-users repository.

func (*GoUsersProfileStore) Save

Save upserts a user profile via the go-users repository.

type GoUsersRoleRepository

type GoUsersRoleRepository struct {
	// contains filtered or unexported fields
}

GoUsersRoleRepository adapts a go-users RoleRegistry to the admin contract.

func NewGoUsersRoleRepository

func NewGoUsersRoleRepository(registry users.RoleRegistry, scopeResolver func(context.Context) users.ScopeFilter) *GoUsersRoleRepository

NewGoUsersRoleRepository constructs a role adapter.

func (*GoUsersRoleRepository) Assign

func (r *GoUsersRoleRepository) Assign(ctx context.Context, userID, roleID string) error

Assign a role to a user.

func (*GoUsersRoleRepository) Create

Create inserts a role.

func (*GoUsersRoleRepository) Delete

func (r *GoUsersRoleRepository) Delete(ctx context.Context, id string) error

Delete removes a role via go-users registry.

func (*GoUsersRoleRepository) Get

Get role by ID.

func (*GoUsersRoleRepository) List

List roles via go-users.

func (*GoUsersRoleRepository) RolesForUser

func (r *GoUsersRoleRepository) RolesForUser(ctx context.Context, userID string) ([]RoleRecord, error)

RolesForUser lists assignments.

func (*GoUsersRoleRepository) Unassign

func (r *GoUsersRoleRepository) Unassign(ctx context.Context, userID, roleID string) error

Unassign removes a role assignment.

func (*GoUsersRoleRepository) Update

Update modifies a role.

type GoUsersUserRepository

type GoUsersUserRepository struct {
	// contains filtered or unexported fields
}

GoUsersUserRepository adapts go-users auth/inventory repositories to the admin contract.

func NewGoUsersUserRepository

func NewGoUsersUserRepository(auth users.AuthRepository, inventory users.UserInventoryRepository, scopeResolver func(context.Context) users.ScopeFilter) *GoUsersUserRepository

NewGoUsersUserRepository builds a repository using go-users collaborators.

func (*GoUsersUserRepository) Create

Create inserts a new user via go-users.

func (*GoUsersUserRepository) Delete

func (r *GoUsersUserRepository) Delete(ctx context.Context, id string) error

Delete marks a user as disabled (go-users does not hard delete via AuthRepository).

func (*GoUsersUserRepository) Get

Get fetches a user by ID.

func (*GoUsersUserRepository) List

List delegates to the go-users inventory repository.

func (*GoUsersUserRepository) Search

func (r *GoUsersUserRepository) Search(ctx context.Context, query string, limit int) ([]UserRecord, error)

Search proxies to List with a keyword.

func (*GoUsersUserRepository) Update

Update modifies a user via go-users.

type GuardrailedSchemaValidator added in v0.23.0

type GuardrailedSchemaValidator struct {
	// contains filtered or unexported fields
}

GuardrailedSchemaValidator wraps a SchemaValidator with guardrail checks

func NewGuardrailedSchemaValidator added in v0.23.0

func NewGuardrailedSchemaValidator(inner SchemaValidator, guardrails *SchemaGuardrails) *GuardrailedSchemaValidator

NewGuardrailedSchemaValidator creates a validator with guardrail checks

func (*GuardrailedSchemaValidator) Guardrails added in v0.23.0

Guardrails returns the underlying guardrails instance

func (*GuardrailedSchemaValidator) Preview added in v0.23.0

func (v *GuardrailedSchemaValidator) Preview(ctx context.Context, schema map[string]any, opts SchemaValidationOptions) ([]byte, error)

Preview renders a form preview after guardrail validation

func (*GuardrailedSchemaValidator) Validate added in v0.23.0

Validate applies guardrails then delegates to the inner validator

type HandlerAuthenticator

type HandlerAuthenticator interface {
	WrapHandler(handler router.HandlerFunc) router.HandlerFunc
}

HandlerAuthenticator can wrap handlers directly to preserve middleware semantics.

type IconCategory added in v0.25.0

type IconCategory struct {
	// ID is the unique identifier for this category.
	ID string `json:"id"`
	// Label is the human-readable display name.
	Label string `json:"label"`
	// LabelKey is the i18n translation key for the label.
	LabelKey string `json:"label_key,omitempty"`
	// Count is the number of icons in this category (populated at runtime).
	Count int `json:"count,omitempty"`
}

IconCategory groups related icons within a library.

type IconContributor added in v0.25.0

type IconContributor interface {
	// IconLibraries returns icon libraries this module provides.
	// Libraries are registered during module loading and available for
	// icon resolution and rendering.
	IconLibraries() []IconLibrary

	// IconDefinitions returns standalone icon definitions.
	// Icons without an explicit library are added to the "custom" library.
	IconDefinitions() []IconDefinition
}

IconContributor allows modules to contribute icon libraries and definitions. Modules implementing this interface can register custom icon sets that will be available for icon pickers and rendering throughout the admin panel.

type IconContributorAdapter added in v0.25.0

type IconContributorAdapter struct {
	// contains filtered or unexported fields
}

IconContributorAdapter provides a simple way to create an IconContributor from functions or static data.

func NewIconContributorAdapter added in v0.25.0

func NewIconContributorAdapter(libraries []IconLibrary, icons []IconDefinition) *IconContributorAdapter

NewIconContributorAdapter creates a new adapter with the given libraries and icons.

func (*IconContributorAdapter) IconDefinitions added in v0.25.0

func (a *IconContributorAdapter) IconDefinitions() []IconDefinition

IconDefinitions implements IconContributor.

func (*IconContributorAdapter) IconLibraries added in v0.25.0

func (a *IconContributorAdapter) IconLibraries() []IconLibrary

IconLibraries implements IconContributor.

func (*IconContributorAdapter) WithIcon added in v0.25.0

WithIcon adds an icon to the adapter.

func (*IconContributorAdapter) WithLibrary added in v0.25.0

WithLibrary adds a library to the adapter.

type IconContributorCallbacks added in v0.25.0

type IconContributorCallbacks struct {
	// OnLibrary is called for each library contributed by a module.
	OnLibrary func(lib IconLibrary) error `json:"on_library"`
	// OnIcon is called for each standalone icon contributed by a module.
	OnIcon func(icon IconDefinition) error `json:"on_icon"`
}

IconContributorCallbacks holds callbacks for processing icon contributions.

type IconDefinition added in v0.25.0

type IconDefinition struct {
	// ID is the unique identifier for this icon (e.g., "iconoir:settings").
	ID string `json:"id"`
	// Name is the short key used in menus/panels (e.g., "settings").
	Name string `json:"name"`
	// Label is the human-readable display name.
	Label string `json:"label,omitempty"`
	// LabelKey is the i18n translation key for the label.
	LabelKey string `json:"label_key,omitempty"`
	// Type categorizes the icon source.
	Type IconType `json:"type"`
	// Library identifies the icon library (e.g., "iconoir", "lucide", "custom").
	Library string `json:"library,omitempty"`
	// Content holds the icon data: emoji char, SVG markup, or URL.
	Content string `json:"content,omitempty"`
	// Keywords for search/filtering.
	Keywords []string `json:"keywords,omitempty"`
	// Category groups related icons.
	Category string `json:"category,omitempty"`
	// Variants maps variant names to alternate content (e.g., "dark" -> SVG with fill:#fff).
	Variants map[string]string `json:"variants,omitempty"`
	// Trusted indicates whether this icon definition comes from a trusted source.
	Trusted bool `json:"trusted,omitempty"`
	// Metadata for additional icon properties.
	Metadata map[string]any `json:"metadata,omitempty"`
}

IconDefinition represents a single icon with metadata.

type IconLibrary added in v0.25.0

type IconLibrary struct {
	// ID is the unique library identifier (e.g., "iconoir", "lucide", "app-icons").
	ID string `json:"id"`
	// Name is the display name.
	Name string `json:"name"`
	// Description explains the library.
	Description string `json:"description,omitempty"`
	// Version tracks library version for cache invalidation.
	Version string `json:"version,omitempty"`
	// CDN is the optional CSS/JS CDN URL for library icons.
	CDN string `json:"cdn,omitempty"`
	// CSSClass is the class prefix pattern (e.g., "iconoir-{name}").
	CSSClass string `json:"css_class,omitempty"`
	// RenderMode specifies how to render icons from this library.
	RenderMode IconRenderMode `json:"render_mode,omitempty"`
	// Priority determines sort order in picker (lower = first).
	Priority int `json:"priority,omitempty"`
	// Icons contains all icons in this library.
	Icons []IconDefinition `json:"icons,omitempty"`
	// Categories groups icons within the library.
	Categories []IconCategory `json:"categories,omitempty"`
	// Trusted indicates whether icons from this library are trusted.
	Trusted bool `json:"trusted,omitempty"`
}

IconLibrary represents a collection of icons from a single source.

func BuiltinEmojiLibrary added in v0.25.0

func BuiltinEmojiLibrary() IconLibrary

BuiltinEmojiLibrary returns the emoji "library" configuration. Emojis are detected automatically; this library provides metadata.

func BuiltinIconoirLibrary added in v0.25.0

func BuiltinIconoirLibrary() IconLibrary

BuiltinIconoirLibrary returns the default Iconoir library configuration with a curated set of sidebar/navigation icons.

func BuiltinLucideLibrary added in v0.25.0

func BuiltinLucideLibrary() IconLibrary

BuiltinLucideLibrary returns the Lucide icon library configuration.

type IconReference added in v0.25.0

type IconReference struct {
	// Raw is the original input string.
	Raw string `json:"raw"`
	// Type is the resolved icon type.
	Type IconType `json:"type"`
	// Library is the resolved library ID for library icons.
	Library string `json:"library,omitempty"`
	// Value is the resolved icon value (name, emoji, SVG content, or URL).
	Value string `json:"value"`
	// Qualified indicates whether the input used explicit prefix syntax.
	Qualified bool `json:"qualified,omitempty"`
	// LegacyMapped indicates whether svgFieldTypeKeys mapping was applied.
	LegacyMapped bool `json:"legacy_mapped,omitempty"`
}

IconReference is a parsed icon string with resolved type and library.

func ParseIconReference added in v0.25.0

func ParseIconReference(value string) IconReference

ParseIconReference parses an icon string into a structured reference.

Parsing precedence (strict order):

  1. Empty string -> empty reference
  2. emoji:<value> -> emoji
  3. svg:<svg...> -> svg
  4. url:<value> -> url
  5. Raw <svg...> -> svg (legacy convenience)
  6. Raw http://, https://, or data: -> url
  7. Qualified <library>:<name> -> library
  8. Legacy iconoir-<name> -> library iconoir, name stripped
  9. Legacy svgFieldTypeKeys mapping -> mapped Iconoir name with LegacyMapped=true
  10. Bare name -> default library (iconoir)

func (IconReference) IsEmpty added in v0.25.0

func (r IconReference) IsEmpty() bool

IsEmpty returns true if the reference represents an empty icon.

type IconRenderMode added in v0.25.0

type IconRenderMode string

IconRenderMode specifies how an icon should be rendered to HTML.

const (
	// IconRenderModeUnknown indicates the render mode is not specified.
	IconRenderModeUnknown IconRenderMode = ""
	// IconRenderModeCSS renders as <i class="prefix-{name}">.
	IconRenderModeCSS IconRenderMode = "css-class"
	// IconRenderModeSVG renders as inline <svg>...</svg>.
	IconRenderModeSVG IconRenderMode = "inline-svg"
	// IconRenderModeImg renders as <img src="...">.
	IconRenderModeImg IconRenderMode = "img-url"
	// IconRenderModeSpan renders as <span>content</span>.
	IconRenderModeSpan IconRenderMode = "span"
)

type IconRenderOptions added in v0.25.0

type IconRenderOptions struct {
	// Variant selects a specific icon variant (e.g., "dark", "light").
	Variant string `json:"variant"`
	// TrustedInput indicates the icon value comes from a trusted source.
	TrustedInput bool `json:"trusted_input"`
	// AllowCustomUntrusted permits custom SVG/URL for untrusted input.
	AllowCustomUntrusted bool `json:"allow_custom_untrusted"`
	// Size is the CSS size value (e.g., "20px", "1.5rem").
	Size string `json:"size"`
	// Classes are additional CSS classes to apply.
	Classes []string `json:"classes"`
	// Style is additional inline CSS.
	Style string `json:"style"`
	// AriaLabel sets the aria-label for accessibility.
	AriaLabel string `json:"aria_label"`
	// AriaHidden hides the icon from screen readers.
	AriaHidden bool `json:"aria_hidden"`
}

IconRenderOptions configures icon rendering behavior.

func RenderOptionsForAPI added in v0.25.0

func RenderOptionsForAPI(trusted bool) IconRenderOptions

RenderOptionsForAPI returns render options for API-requested icon rendering.

func RenderOptionsForModule added in v0.25.0

func RenderOptionsForModule() IconRenderOptions

RenderOptionsForModule returns render options for module-contributed icons.

func RenderOptionsForTemplate added in v0.25.0

func RenderOptionsForTemplate() IconRenderOptions

RenderOptions returns the render options for a specific context.

type IconRenderer added in v0.25.0

type IconRenderer interface {
	// Render produces HTML for the given icon reference.
	Render(ref IconReference, def *IconDefinition, opts IconRenderOptions) string
}

IconRenderer produces HTML output for icons.

type IconSecurityPolicy added in v0.25.0

type IconSecurityPolicy struct {
	// AllowUntrustedCustom permits custom SVG/URL for untrusted input.
	// Default: false
	AllowUntrustedCustom bool `json:"allow_untrusted_custom"`

	// AllowDataURI permits data: URIs.
	// For trusted input, default is true. For untrusted, follows AllowUntrustedCustom.
	AllowDataURI bool `json:"allow_data_uri"`

	// AllowedExternalSchemes lists permitted URL schemes.
	// Default: ["https"]
	AllowedExternalSchemes []string `json:"allowed_external_schemes"`

	// AllowedDataMIMEs lists permitted MIME types for data URIs.
	// Default: ["image/svg+xml", "image/png", "image/jpeg", "image/webp", "image/gif"]
	AllowedDataMIMEs []string `json:"allowed_data_mim_es"`

	// MaxSVGBytes is the maximum allowed size for SVG content.
	// Default: 65536 (64KB)
	MaxSVGBytes int `json:"max_svg_bytes"`

	// MaxDataURIBytes is the maximum allowed size for data URI payloads.
	// Default: 131072 (128KB)
	MaxDataURIBytes int `json:"max_data_uri_bytes"`

	// AllowedExternalHosts is an optional allowlist of external hosts.
	// Empty means any host with allowed scheme is permitted.
	AllowedExternalHosts []string `json:"allowed_external_hosts"`
}

IconSecurityPolicy configures security restrictions for icon rendering.

func DefaultIconSecurityPolicy added in v0.25.0

func DefaultIconSecurityPolicy() IconSecurityPolicy

DefaultIconSecurityPolicy returns the default security policy.

type IconSecurityResult added in v0.25.0

type IconSecurityResult struct {
	// Allowed indicates whether the icon can be rendered.
	Allowed bool `json:"allowed"`
	// Reason explains why the icon was blocked (empty if allowed).
	Reason string `json:"reason"`
	// SanitizedContent contains sanitized SVG content (if applicable).
	SanitizedContent string `json:"sanitized_content"`
	// ValidatedURL contains the validated URL (if applicable).
	ValidatedURL string `json:"validated_url"`
}

IconSecurityResult represents the result of security validation.

type IconSecurityValidator added in v0.25.0

type IconSecurityValidator struct {
	// contains filtered or unexported fields
}

IconSecurityValidator validates and sanitizes icon content.

func NewIconSecurityValidator added in v0.25.0

func NewIconSecurityValidator(policy IconSecurityPolicy) *IconSecurityValidator

NewIconSecurityValidator creates a new validator with the given policy.

func (*IconSecurityValidator) ValidateIcon added in v0.25.0

ValidateIcon validates an icon reference based on trust level.

type IconService added in v0.25.0

type IconService struct {
	// contains filtered or unexported fields
}

IconService manages icon libraries and provides icon resolution and rendering.

func NewIconService added in v0.25.0

func NewIconService(opts ...IconServiceOption) *IconService

NewIconService creates a new IconService with optional configuration.

func (*IconService) Categories added in v0.25.0

func (s *IconService) Categories(libraryID string) []IconCategory

Categories returns the categories for a library with icon counts.

func (*IconService) Defaults added in v0.25.0

func (s *IconService) Defaults() IconServiceDefaults

Defaults returns the current default settings.

func (*IconService) Libraries added in v0.25.0

func (s *IconService) Libraries() []IconLibrary

Libraries returns all registered libraries sorted by priority then ID.

func (*IconService) Library added in v0.25.0

func (s *IconService) Library(id string) (IconLibrary, bool)

Library returns a library by ID.

func (*IconService) LibraryIcons added in v0.25.0

func (s *IconService) LibraryIcons(libraryID, category string) []IconDefinition

LibraryIcons returns icons from a specific library, optionally filtered by category.

func (*IconService) RegisterIcon added in v0.25.0

func (s *IconService) RegisterIcon(icon IconDefinition) error

RegisterIcon adds a single icon definition, using the "custom" library if no library is specified.

func (*IconService) RegisterLibrary added in v0.25.0

func (s *IconService) RegisterLibrary(lib IconLibrary) error

RegisterLibrary adds an icon library to the service.

func (*IconService) Render added in v0.25.0

func (s *IconService) Render(ref IconReference, opts IconRenderOptions) string

Render produces HTML for the given icon reference.

func (*IconService) RenderFromString added in v0.25.0

func (s *IconService) RenderFromString(rawRef string, trusted bool, variant string) string

RenderFromString parses and renders an icon string with explicit trust and variant. This method satisfies the quickstart.TemplateIconRenderer interface for template integration.

func (*IconService) RenderString added in v0.25.0

func (s *IconService) RenderString(value string, opts IconRenderOptions) string

RenderString parses and renders an icon string.

func (*IconService) Renderer added in v0.25.0

func (s *IconService) Renderer() *DefaultIconRenderer

Renderer returns the icon renderer.

func (*IconService) Resolve added in v0.25.0

func (s *IconService) Resolve(ref IconReference) (*IconDefinition, error)

Resolve returns the icon definition for a reference.

func (*IconService) ResolveString added in v0.25.0

func (s *IconService) ResolveString(value string) (*IconDefinition, error)

ResolveString parses and resolves an icon string.

func (*IconService) Search added in v0.25.0

func (s *IconService) Search(ctx context.Context, query string, limit int, libraryIDs ...string) []IconDefinition

Search finds icons matching a query across all or specified libraries.

func (*IconService) SecurityPolicy added in v0.25.0

func (s *IconService) SecurityPolicy() IconSecurityPolicy

SecurityPolicy returns the current security policy.

func (*IconService) UnregisterLibrary added in v0.25.0

func (s *IconService) UnregisterLibrary(id string) error

UnregisterLibrary removes a library and its icons from the service.

type IconServiceDefaults added in v0.25.0

type IconServiceDefaults struct {
	// DefaultLibrary is used when no library prefix is specified.
	DefaultLibrary string `json:"default_library"`
	// FallbackIcon is rendered when an icon cannot be resolved.
	FallbackIcon string `json:"fallback_icon"`
	// DefaultVariant is the default theme variant.
	DefaultVariant string `json:"default_variant"`
}

IconServiceDefaults configures fallback behavior for icon resolution.

type IconServiceOption added in v0.25.0

type IconServiceOption func(*IconService)

IconServiceOption configures the icon service.

func WithDefaultLibrary added in v0.25.0

func WithDefaultLibrary(library string) IconServiceOption

WithDefaultLibrary sets the default library for bare icon names.

func WithDefaultVariant added in v0.25.0

func WithDefaultVariant(variant string) IconServiceOption

WithDefaultVariant sets the default theme variant.

func WithFallbackIcon added in v0.25.0

func WithFallbackIcon(icon string) IconServiceOption

WithFallbackIcon sets the fallback icon for unresolved references.

func WithIconSecurityPolicy added in v0.25.0

func WithIconSecurityPolicy(policy IconSecurityPolicy) IconServiceOption

WithIconSecurityPolicy sets the security policy.

func WithIconServiceLogger added in v0.25.0

func WithIconServiceLogger(logger Logger) IconServiceOption

WithIconServiceLogger sets the logger for the icon service.

type IconType added in v0.25.0

type IconType string

IconType categorizes the source/format of an icon.

const (
	// IconTypeUnknown indicates the icon type could not be determined.
	IconTypeUnknown IconType = ""
	// IconTypeEmoji represents a Unicode emoji character.
	IconTypeEmoji IconType = "emoji"
	// IconTypeLibrary represents a named icon from an icon library.
	IconTypeLibrary IconType = "library"
	// IconTypeSVG represents inline SVG markup.
	IconTypeSVG IconType = "svg"
	// IconTypeURL represents an external URL or data URI.
	IconTypeURL IconType = "url"
)

type InMemoryBulkService

type InMemoryBulkService struct {
	// contains filtered or unexported fields
}

InMemoryBulkService stores jobs in memory and marks them completed immediately.

func NewInMemoryBulkService

func NewInMemoryBulkService() *InMemoryBulkService

NewInMemoryBulkService constructs a bulk service with a sample job.

func (*InMemoryBulkService) List

func (s *InMemoryBulkService) List(ctx context.Context) []BulkJob

List returns recorded jobs newest first.

func (*InMemoryBulkService) Rollback

func (s *InMemoryBulkService) Rollback(ctx context.Context, id string) (BulkJob, error)

Rollback marks a job as rolled back.

func (*InMemoryBulkService) Start

Start records a bulk job and immediately completes it for demo purposes.

type InMemoryContentService

type InMemoryContentService struct {
	// contains filtered or unexported fields
}

InMemoryContentService stores CMS pages/content/blocks in memory for tests/demos.

func NewInMemoryContentService

func NewInMemoryContentService() *InMemoryContentService

NewInMemoryContentService constructs a content service.

func (*InMemoryContentService) BlockDefinitionVersions added in v0.24.0

func (s *InMemoryContentService) BlockDefinitionVersions(ctx context.Context, id string) ([]CMSBlockDefinitionVersion, error)

BlockDefinitionVersions returns the schema versions for a definition.

func (*InMemoryContentService) BlockDefinitions

func (s *InMemoryContentService) BlockDefinitions(ctx context.Context) ([]CMSBlockDefinition, error)

BlockDefinitions returns registered block definitions.

func (*InMemoryContentService) BlocksForContent

func (s *InMemoryContentService) BlocksForContent(_ context.Context, contentID, locale string) ([]CMSBlock, error)

BlocksForContent returns blocks attached to a content/page.

func (*InMemoryContentService) Content

func (s *InMemoryContentService) Content(_ context.Context, id, locale string) (*CMSContent, error)

Content returns a content entry by id and locale.

func (*InMemoryContentService) ContentType added in v0.23.0

func (s *InMemoryContentService) ContentType(ctx context.Context, id string) (*CMSContentType, error)

ContentType returns a content type by id.

func (*InMemoryContentService) ContentTypeBySlug added in v0.23.0

func (s *InMemoryContentService) ContentTypeBySlug(ctx context.Context, slug string) (*CMSContentType, error)

ContentTypeBySlug returns a content type by slug.

func (*InMemoryContentService) ContentTypes added in v0.23.0

func (s *InMemoryContentService) ContentTypes(ctx context.Context) ([]CMSContentType, error)

ContentTypes returns all content type definitions.

func (*InMemoryContentService) Contents

func (s *InMemoryContentService) Contents(_ context.Context, locale string) ([]CMSContent, error)

Contents returns structured content filtered by locale.

func (*InMemoryContentService) CreateBlockDefinition

func (s *InMemoryContentService) CreateBlockDefinition(ctx context.Context, def CMSBlockDefinition) (*CMSBlockDefinition, error)

CreateBlockDefinition adds a block definition.

func (*InMemoryContentService) CreateContent

func (s *InMemoryContentService) CreateContent(ctx context.Context, content CMSContent) (*CMSContent, error)

CreateContent inserts a content entry.

func (*InMemoryContentService) CreateContentType added in v0.23.0

func (s *InMemoryContentService) CreateContentType(ctx context.Context, contentType CMSContentType) (*CMSContentType, error)

CreateContentType inserts a content type definition.

func (*InMemoryContentService) CreatePage

func (s *InMemoryContentService) CreatePage(ctx context.Context, page CMSPage) (*CMSPage, error)

CreatePage inserts a page.

func (*InMemoryContentService) CreateTranslation added in v0.46.0

func (s *InMemoryContentService) CreateTranslation(ctx context.Context, input TranslationCreateInput) (*CMSContent, error)

CreateTranslation clones an existing content entry into a target locale.

func (*InMemoryContentService) DeleteBlock

func (s *InMemoryContentService) DeleteBlock(ctx context.Context, id string) error

DeleteBlock removes a block.

func (*InMemoryContentService) DeleteBlockDefinition

func (s *InMemoryContentService) DeleteBlockDefinition(ctx context.Context, id string) error

DeleteBlockDefinition removes a block definition.

func (*InMemoryContentService) DeleteContent

func (s *InMemoryContentService) DeleteContent(ctx context.Context, id string) error

DeleteContent removes a content entry.

func (*InMemoryContentService) DeleteContentType added in v0.23.0

func (s *InMemoryContentService) DeleteContentType(ctx context.Context, id string) error

DeleteContentType removes a content type definition.

func (*InMemoryContentService) DeletePage

func (s *InMemoryContentService) DeletePage(ctx context.Context, id string) error

DeletePage removes a page.

func (*InMemoryContentService) LegacyBlocksForContent added in v0.23.0

func (s *InMemoryContentService) LegacyBlocksForContent(_ context.Context, contentID, locale string) ([]CMSBlock, error)

LegacyBlocksForContent returns legacy block instances without embedded fallback.

func (*InMemoryContentService) Page

func (s *InMemoryContentService) Page(_ context.Context, id, locale string) (*CMSPage, error)

Page returns a page by id and locale.

func (*InMemoryContentService) Pages

func (s *InMemoryContentService) Pages(_ context.Context, locale string) ([]CMSPage, error)

Pages returns all pages for a locale (or all when locale empty).

func (*InMemoryContentService) SaveBlock

func (s *InMemoryContentService) SaveBlock(ctx context.Context, block CMSBlock) (*CMSBlock, error)

SaveBlock creates or updates a block.

func (*InMemoryContentService) UpdateBlockDefinition

func (s *InMemoryContentService) UpdateBlockDefinition(ctx context.Context, def CMSBlockDefinition) (*CMSBlockDefinition, error)

UpdateBlockDefinition updates an existing block definition.

func (*InMemoryContentService) UpdateContent

func (s *InMemoryContentService) UpdateContent(ctx context.Context, content CMSContent) (*CMSContent, error)

UpdateContent updates an existing content entry.

func (*InMemoryContentService) UpdateContentType added in v0.23.0

func (s *InMemoryContentService) UpdateContentType(ctx context.Context, contentType CMSContentType) (*CMSContentType, error)

UpdateContentType updates an existing content type definition.

func (*InMemoryContentService) UpdatePage

func (s *InMemoryContentService) UpdatePage(ctx context.Context, page CMSPage) (*CMSPage, error)

UpdatePage updates an existing page.

func (*InMemoryContentService) WithActivitySink

func (s *InMemoryContentService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission for CMS content changes.

type InMemoryDashboardPreferences

type InMemoryDashboardPreferences = dashinternal.InMemoryDashboardPreferences

InMemoryDashboardPreferences stores layouts in memory.

func NewInMemoryDashboardPreferences

func NewInMemoryDashboardPreferences() *InMemoryDashboardPreferences

NewInMemoryDashboardPreferences constructs a preference store.

type InMemoryDebugREPLSessionStore added in v0.16.0

type InMemoryDebugREPLSessionStore struct {
	// contains filtered or unexported fields
}

InMemoryDebugREPLSessionStore keeps sessions in memory.

func NewInMemoryDebugREPLSessionStore added in v0.16.0

func NewInMemoryDebugREPLSessionStore() *InMemoryDebugREPLSessionStore

NewInMemoryDebugREPLSessionStore constructs a memory-backed store.

func (*InMemoryDebugREPLSessionStore) Close added in v0.16.0

func (*InMemoryDebugREPLSessionStore) Create added in v0.16.0

func (*InMemoryDebugREPLSessionStore) Get added in v0.16.0

func (*InMemoryDebugREPLSessionStore) ListActive added in v0.16.0

type InMemoryDebugUserSessionStore added in v0.24.0

type InMemoryDebugUserSessionStore struct {
	// contains filtered or unexported fields
}

InMemoryDebugUserSessionStore keeps sessions in memory.

func NewInMemoryDebugUserSessionStore added in v0.24.0

func NewInMemoryDebugUserSessionStore() *InMemoryDebugUserSessionStore

NewInMemoryDebugUserSessionStore constructs a memory-backed store.

func (*InMemoryDebugUserSessionStore) Expire added in v0.24.0

func (s *InMemoryDebugUserSessionStore) Expire(_ context.Context, olderThan time.Duration) (int, error)

Expire removes sessions whose last activity is older than the threshold.

func (*InMemoryDebugUserSessionStore) Get added in v0.24.0

Get returns a session by session ID.

func (*InMemoryDebugUserSessionStore) ListActive added in v0.24.0

ListActive returns active session snapshots.

func (*InMemoryDebugUserSessionStore) Upsert added in v0.24.0

Upsert inserts or updates a session entry, deduping by user_id + session_id.

type InMemoryMediaLibrary

type InMemoryMediaLibrary struct {
	// contains filtered or unexported fields
}

InMemoryMediaLibrary stores media items in memory.

func NewInMemoryMediaLibrary

func NewInMemoryMediaLibrary(baseURL string) *InMemoryMediaLibrary

NewInMemoryMediaLibrary seeds a few sample assets.

func (*InMemoryMediaLibrary) GetMedia added in v0.61.0

func (m *InMemoryMediaLibrary) GetMedia(ctx context.Context, id string) (MediaItem, error)

GetMedia resolves an item by ID.

func (*InMemoryMediaLibrary) QueryMedia added in v0.61.0

func (m *InMemoryMediaLibrary) QueryMedia(ctx context.Context, query MediaQuery) (MediaPage, error)

QueryMedia returns items matching query filters.

func (*InMemoryMediaLibrary) ResolveMedia added in v0.61.0

func (m *InMemoryMediaLibrary) ResolveMedia(ctx context.Context, ref MediaReference) (MediaItem, error)

ResolveMedia resolves an item from picker reference values.

type InMemoryMenuService

type InMemoryMenuService struct {
	// contains filtered or unexported fields
}

InMemoryMenuService stores menus in memory.

func NewInMemoryMenuService

func NewInMemoryMenuService() *InMemoryMenuService

NewInMemoryMenuService constructs a memory-backed menu service.

func (*InMemoryMenuService) AddMenuItem

func (s *InMemoryMenuService) AddMenuItem(ctx context.Context, menuCode string, item MenuItem) error

AddMenuItem appends an item to a menu identified by code.

func (*InMemoryMenuService) CreateMenu

func (s *InMemoryMenuService) CreateMenu(ctx context.Context, code string) (*Menu, error)

CreateMenu makes a menu entry if it does not exist.

func (*InMemoryMenuService) DeleteMenuItem

func (s *InMemoryMenuService) DeleteMenuItem(ctx context.Context, menuCode, id string) error

DeleteMenuItem deletes an item and its children.

func (*InMemoryMenuService) Menu

func (s *InMemoryMenuService) Menu(_ context.Context, code, locale string) (*Menu, error)

Menu returns a menu for a given locale. Items with locale match or empty locale are returned.

func (*InMemoryMenuService) MenuByCodeWithOptions added in v0.26.0

func (s *InMemoryMenuService) MenuByCodeWithOptions(ctx context.Context, code, locale string, _ SiteMenuReadOptions) (*Menu, error)

MenuByCodeWithOptions supports site menu reads with explicit query options.

func (*InMemoryMenuService) MenuByLocation added in v0.22.0

func (s *InMemoryMenuService) MenuByLocation(ctx context.Context, location, locale string) (*Menu, error)

MenuByLocation returns a menu resolved by location.

func (*InMemoryMenuService) MenuByLocationWithOptions added in v0.26.0

func (s *InMemoryMenuService) MenuByLocationWithOptions(ctx context.Context, location, locale string, _ SiteMenuReadOptions) (*Menu, error)

MenuByLocationWithOptions supports site menu reads with explicit query options.

func (*InMemoryMenuService) MenuExists added in v0.122.0

func (s *InMemoryMenuService) MenuExists(_ context.Context, code string) (bool, error)

MenuExists reports whether a menu has been explicitly created.

func (*InMemoryMenuService) NavigationCoordinationReport added in v0.111.0

func (s *InMemoryMenuService) NavigationCoordinationReport() NavigationCoordinationReport

func (*InMemoryMenuService) NavigationPersistenceReport added in v0.111.0

func (s *InMemoryMenuService) NavigationPersistenceReport() NavigationPersistenceReport

func (*InMemoryMenuService) RawMenuItems added in v0.90.0

func (s *InMemoryMenuService) RawMenuItems(_ context.Context, code string) ([]MenuItem, error)

RawMenuItems returns persisted in-memory rows without locale or render filtering.

func (*InMemoryMenuService) RawMenuItemsWithOptions added in v0.111.0

func (s *InMemoryMenuService) RawMenuItemsWithOptions(ctx context.Context, opts NavigationRawInventoryOptions) ([]MenuItem, error)

func (*InMemoryMenuService) ReorderMenu

func (s *InMemoryMenuService) ReorderMenu(ctx context.Context, menuCode string, orderedIDs []string) error

ReorderMenu applies a positional ordering to menu items.

func (*InMemoryMenuService) ResetMenu

func (s *InMemoryMenuService) ResetMenu(code string)

ResetMenu removes all items for the given menu code (debug/reset helper).

func (*InMemoryMenuService) ResetMenuContext

func (s *InMemoryMenuService) ResetMenuContext(ctx context.Context, code string) error

ResetMenuContext implements the MenuResetterWithContext interface used by quickstart helpers.

func (*InMemoryMenuService) UpdateMenuItem

func (s *InMemoryMenuService) UpdateMenuItem(ctx context.Context, menuCode string, item MenuItem) error

UpdateMenuItem updates an existing menu item.

func (*InMemoryMenuService) WithActivitySink

func (s *InMemoryMenuService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission for menu operations.

func (*InMemoryMenuService) WithNavigationConvergence added in v0.111.0

func (s *InMemoryMenuService) WithNavigationConvergence(ctx context.Context, _ NavigationConvergenceScope, fn func(context.Context) error) error

type InMemoryNotificationService

type InMemoryNotificationService struct {
	// contains filtered or unexported fields
}

InMemoryNotificationService stores notifications in memory.

func NewInMemoryNotificationService

func NewInMemoryNotificationService() *InMemoryNotificationService

NewInMemoryNotificationService builds an inbox service.

func (*InMemoryNotificationService) Add

Add stores a notification.

func (*InMemoryNotificationService) List

List returns all notifications newest first.

func (*InMemoryNotificationService) Mark

func (s *InMemoryNotificationService) Mark(ctx context.Context, ids []string, read bool) error

Mark toggles read state for ids.

func (*InMemoryNotificationService) WithActivitySink

func (s *InMemoryNotificationService) WithActivitySink(sink ActivitySink)

WithActivitySink wires an activity sink for notification events.

type InMemoryOrganizationStore

type InMemoryOrganizationStore struct {
	// contains filtered or unexported fields
}

InMemoryOrganizationStore keeps organizations and memberships in memory.

func NewInMemoryOrganizationStore

func NewInMemoryOrganizationStore() *InMemoryOrganizationStore

NewInMemoryOrganizationStore builds an empty org store.

func (*InMemoryOrganizationStore) Create

Create inserts an organization.

func (*InMemoryOrganizationStore) Delete

Delete removes an organization.

func (*InMemoryOrganizationStore) Get

Get returns an organization by ID.

func (*InMemoryOrganizationStore) List

List returns organizations with search and status filtering.

func (*InMemoryOrganizationStore) Search

func (s *InMemoryOrganizationStore) Search(ctx context.Context, query string, limit int) ([]OrganizationRecord, error)

Search performs a simple keyword search.

func (*InMemoryOrganizationStore) Update

Update modifies an organization.

type InMemoryPreferencesStore

type InMemoryPreferencesStore struct {
	// contains filtered or unexported fields
}

InMemoryPreferencesStore keeps preferences per-scope in memory.

func NewInMemoryPreferencesStore

func NewInMemoryPreferencesStore() *InMemoryPreferencesStore

NewInMemoryPreferencesStore builds an empty in-memory preference store.

func (*InMemoryPreferencesStore) Delete added in v0.11.0

Delete removes stored preferences for a scoped level.

func (*InMemoryPreferencesStore) Resolve added in v0.11.0

Resolve returns stored preferences across scopes.

func (*InMemoryPreferencesStore) Upsert added in v0.11.0

Upsert stores preferences for a scoped level.

type InMemoryProfileStore

type InMemoryProfileStore struct {
	// contains filtered or unexported fields
}

InMemoryProfileStore stores profiles keyed by user ID.

func NewInMemoryProfileStore

func NewInMemoryProfileStore() *InMemoryProfileStore

NewInMemoryProfileStore constructs an empty profile store.

func (*InMemoryProfileStore) Get

Get returns the stored profile for a user.

func (*InMemoryProfileStore) Save

Save upserts the stored profile for a user.

type InMemoryTenantStore

type InMemoryTenantStore struct {
	// contains filtered or unexported fields
}

InMemoryTenantStore keeps tenants and memberships in memory.

func NewInMemoryTenantStore

func NewInMemoryTenantStore() *InMemoryTenantStore

NewInMemoryTenantStore builds an empty tenant store.

func (*InMemoryTenantStore) Create

Create inserts a tenant.

func (*InMemoryTenantStore) Delete

func (s *InMemoryTenantStore) Delete(ctx context.Context, id string) error

Delete removes a tenant.

func (*InMemoryTenantStore) Get

Get returns a tenant by ID.

func (*InMemoryTenantStore) List

List returns tenants with search and status filtering.

func (*InMemoryTenantStore) Search

func (s *InMemoryTenantStore) Search(ctx context.Context, query string, limit int) ([]TenantRecord, error)

Search performs a simple keyword search.

func (*InMemoryTenantStore) Update

Update modifies a tenant.

type InMemoryTranslationAssignmentRepository added in v0.25.0

type InMemoryTranslationAssignmentRepository struct {
	// contains filtered or unexported fields
}

InMemoryTranslationAssignmentRepository provides active-key uniqueness and optimistic locking constraints.

func NewInMemoryTranslationAssignmentRepository added in v0.25.0

func NewInMemoryTranslationAssignmentRepository() *InMemoryTranslationAssignmentRepository

NewInMemoryTranslationAssignmentRepository builds an empty in-memory queue store.

func (*InMemoryTranslationAssignmentRepository) AssignmentReviewerAggregateSummary added in v0.114.1

AssignmentReviewerAggregateSummary returns the reviewer counts that can be derived from assignment state alone. QA-blocked counts require the queue's family/editor runtime, so the repository reports that key as unavailable.

func (*InMemoryTranslationAssignmentRepository) Create added in v0.25.0

Create inserts a new assignment and enforces one active assignment per canonical key.

func (*InMemoryTranslationAssignmentRepository) CreateOrReuseActive added in v0.25.0

CreateOrReuseActive inserts a new assignment or reuses/refreshed an existing active one.

func (*InMemoryTranslationAssignmentRepository) DistinctAssignmentEntityTypes added in v0.100.0

func (r *InMemoryTranslationAssignmentRepository) DistinctAssignmentEntityTypes(_ context.Context) ([]string, error)

func (*InMemoryTranslationAssignmentRepository) DistinctAssignmentLocales added in v0.100.0

func (r *InMemoryTranslationAssignmentRepository) DistinctAssignmentLocales(_ context.Context, filters map[string]any) ([]string, error)

func (*InMemoryTranslationAssignmentRepository) DistinctAssignmentTranslationGroups added in v0.100.0

func (r *InMemoryTranslationAssignmentRepository) DistinctAssignmentTranslationGroups(_ context.Context, filters map[string]any) ([]TranslationAssignmentGroupOption, error)

func (*InMemoryTranslationAssignmentRepository) Get added in v0.25.0

Get retrieves an assignment by id.

func (*InMemoryTranslationAssignmentRepository) List added in v0.25.0

List returns queue assignments filtered by list options.

func (*InMemoryTranslationAssignmentRepository) ListAssignmentFamilyGroups added in v0.82.1

func (*InMemoryTranslationAssignmentRepository) ListAssignmentFamilyOptions added in v0.113.5

func (*InMemoryTranslationAssignmentRepository) ListAssignmentPage added in v0.114.1

ListAssignmentPage evaluates the canonical queue query contract in memory. Keeping this repository on the optimized interface prevents development and test environments from falling back to an unbounded broad read.

func (*InMemoryTranslationAssignmentRepository) ListAssignmentSnapshot added in v0.82.1

func (*InMemoryTranslationAssignmentRepository) ListFamilyAssignments added in v0.82.1

func (*InMemoryTranslationAssignmentRepository) Update added in v0.25.0

Update updates an assignment when the expected version matches the current stored version.

type InMemoryUserStore

type InMemoryUserStore struct {
	// contains filtered or unexported fields
}

InMemoryUserStore provides an in-memory implementation for users and roles.

func NewInMemoryUserStore

func NewInMemoryUserStore() *InMemoryUserStore

NewInMemoryUserStore constructs an empty in-memory store.

func (*InMemoryUserStore) Assign

func (s *InMemoryUserStore) Assign(ctx context.Context, userID, roleID string) error

Assign adds a role assignment for a user.

func (*InMemoryUserStore) Create

func (s *InMemoryUserStore) Create(ctx context.Context, role RoleRecord) (RoleRecord, error)

Create inserts a role (implements RoleRepository.Create).

func (*InMemoryUserStore) CreateUser

func (s *InMemoryUserStore) CreateUser(ctx context.Context, user UserRecord) (UserRecord, error)

CreateUser inserts a new user (implements UserRepository.Create).

func (*InMemoryUserStore) Delete

func (s *InMemoryUserStore) Delete(ctx context.Context, id string) error

Delete removes a role if not system-protected (implements RoleRepository.Delete).

func (*InMemoryUserStore) DeleteUser

func (s *InMemoryUserStore) DeleteUser(ctx context.Context, id string) error

DeleteUser removes a user (implements UserRepository.Delete).

func (*InMemoryUserStore) Get

Get returns a role by ID (implements RoleRepository.Get).

func (*InMemoryUserStore) GetUser

func (s *InMemoryUserStore) GetUser(ctx context.Context, id string) (UserRecord, error)

GetUser returns a user by ID (implements UserRepository.Get).

func (*InMemoryUserStore) List

func (s *InMemoryUserStore) List(ctx context.Context, opts ListOptions) ([]RoleRecord, int, error)

List roles (implements RoleRepository.List).

func (*InMemoryUserStore) ListUsers

func (s *InMemoryUserStore) ListUsers(ctx context.Context, opts ListOptions) ([]UserRecord, int, error)

ListUsers returns paginated users with simple search/filter support (implements UserRepository.List).

func (*InMemoryUserStore) RolesForUser

func (s *InMemoryUserStore) RolesForUser(ctx context.Context, userID string) ([]RoleRecord, error)

RolesForUser lists assigned roles.

func (*InMemoryUserStore) Search

func (s *InMemoryUserStore) Search(ctx context.Context, query string, limit int) ([]UserRecord, error)

Search performs a simple keyword search across users.

func (*InMemoryUserStore) Unassign

func (s *InMemoryUserStore) Unassign(ctx context.Context, userID, roleID string) error

Unassign removes a role assignment.

func (*InMemoryUserStore) Update

func (s *InMemoryUserStore) Update(ctx context.Context, role RoleRecord) (RoleRecord, error)

Update updates an existing role (implements RoleRepository.Update).

func (*InMemoryUserStore) UpdateUser

func (s *InMemoryUserStore) UpdateUser(ctx context.Context, user UserRecord) (UserRecord, error)

UpdateUser modifies an existing user (implements UserRepository.Update).

type InMemoryWidgetService

type InMemoryWidgetService struct {
	// contains filtered or unexported fields
}

InMemoryWidgetService stores widget areas/definitions/instances in memory.

func NewInMemoryWidgetService

func NewInMemoryWidgetService() *InMemoryWidgetService

NewInMemoryWidgetService constructs a memory-backed widget service.

func (*InMemoryWidgetService) Areas

Areas returns all registered areas.

func (*InMemoryWidgetService) Definitions

func (s *InMemoryWidgetService) Definitions() []WidgetDefinition

Definitions returns all registered widget definitions.

func (*InMemoryWidgetService) DeleteDefinition

func (s *InMemoryWidgetService) DeleteDefinition(ctx context.Context, code string) error

DeleteDefinition removes a widget definition.

func (*InMemoryWidgetService) DeleteInstance

func (s *InMemoryWidgetService) DeleteInstance(ctx context.Context, id string) error

DeleteInstance removes a widget instance.

func (*InMemoryWidgetService) HasInstanceForDefinition added in v0.24.0

func (s *InMemoryWidgetService) HasInstanceForDefinition(_ context.Context, definitionCode string, filter WidgetInstanceFilter) (bool, error)

HasInstanceForDefinition reports whether a widget instance exists for a definition.

func (*InMemoryWidgetService) ListInstances

ListInstances returns widget instances filtered by area/page/locale.

func (*InMemoryWidgetService) RegisterAreaDefinition

func (s *InMemoryWidgetService) RegisterAreaDefinition(ctx context.Context, def WidgetAreaDefinition) error

RegisterAreaDefinition saves/overwrites a widget area.

func (*InMemoryWidgetService) RegisterDefinition

func (s *InMemoryWidgetService) RegisterDefinition(ctx context.Context, def WidgetDefinition) error

RegisterDefinition saves/overwrites a widget definition.

func (*InMemoryWidgetService) SaveInstance

func (s *InMemoryWidgetService) SaveInstance(ctx context.Context, instance WidgetInstance) (*WidgetInstance, error)

SaveInstance stores or updates a widget instance.

func (*InMemoryWidgetService) SyncDefinition added in v0.52.0

SyncDefinition creates, updates, or no-ops a widget definition based on content fingerprint equality.

func (*InMemoryWidgetService) WithActivitySink

func (s *InMemoryWidgetService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission for widget events.

type InMemoryWorkflowBindingRepository added in v0.25.0

type InMemoryWorkflowBindingRepository struct {
	// contains filtered or unexported fields
}

InMemoryWorkflowBindingRepository stores scope bindings with active uniqueness.

func NewInMemoryWorkflowBindingRepository added in v0.25.0

func NewInMemoryWorkflowBindingRepository() *InMemoryWorkflowBindingRepository

NewInMemoryWorkflowBindingRepository constructs an empty binding store.

func (*InMemoryWorkflowBindingRepository) Create added in v0.25.0

func (*InMemoryWorkflowBindingRepository) Delete added in v0.25.0

func (*InMemoryWorkflowBindingRepository) Get added in v0.25.0

func (*InMemoryWorkflowBindingRepository) List added in v0.25.0

func (*InMemoryWorkflowBindingRepository) ListByScope added in v0.25.0

func (*InMemoryWorkflowBindingRepository) Update added in v0.25.0

func (r *InMemoryWorkflowBindingRepository) Update(_ context.Context, binding WorkflowBinding, expectedVersion int) (WorkflowBinding, error)

type InMemoryWorkflowDefinitionRepository added in v0.25.0

type InMemoryWorkflowDefinitionRepository struct {
	// contains filtered or unexported fields
}

InMemoryWorkflowDefinitionRepository stores workflows with revision snapshots.

func NewInMemoryWorkflowDefinitionRepository added in v0.25.0

func NewInMemoryWorkflowDefinitionRepository() *InMemoryWorkflowDefinitionRepository

NewInMemoryWorkflowDefinitionRepository constructs an empty workflow definition store.

func (*InMemoryWorkflowDefinitionRepository) Create added in v0.25.0

func (*InMemoryWorkflowDefinitionRepository) Get added in v0.25.0

func (*InMemoryWorkflowDefinitionRepository) GetVersion added in v0.25.0

func (*InMemoryWorkflowDefinitionRepository) List added in v0.25.0

func (*InMemoryWorkflowDefinitionRepository) Update added in v0.25.0

type InvalidDependenciesError

type InvalidDependenciesError struct {
	Issues []error `json:"issues"`
}

func (InvalidDependenciesError) Error

func (e InvalidDependenciesError) Error() string

func (InvalidDependenciesError) Unwrap

func (e InvalidDependenciesError) Unwrap() error

type InvalidFeatureConfigError

type InvalidFeatureConfigError struct {
	Issues []FeatureDependencyError `json:"issues"`
}

InvalidFeatureConfigError aggregates dependency validation failures.

func (InvalidFeatureConfigError) Error

func (InvalidFeatureConfigError) Unwrap

func (e InvalidFeatureConfigError) Unwrap() error

type JSErrorEntry added in v0.24.0

type JSErrorEntry struct {
	ID        string         `json:"id"`
	Timestamp time.Time      `json:"timestamp"`
	Type      string         `json:"type"`
	Message   string         `json:"message"`
	Source    string         `json:"source,omitempty"`
	Line      int            `json:"line,omitempty"`
	Column    int            `json:"column,omitempty"`
	Stack     string         `json:"stack,omitempty"`
	URL       string         `json:"url,omitempty"`
	UserAgent string         `json:"user_agent,omitempty"`
	Extra     map[string]any `json:"extra,omitempty"`
}

JSErrorEntry captures a frontend JavaScript error reported by the browser.

type Job

type Job struct {
	Name      string    `json:"name"`
	Schedule  string    `json:"schedule,omitempty"`
	LastRun   time.Time `json:"last_run"`
	NextRun   time.Time `json:"next_run"`
	Status    string    `json:"status,omitempty"`
	LastError string    `json:"last_error,omitempty"`
}

Job represents a scheduled or triggerable job.

type JobErrorEvent added in v0.127.1

type JobErrorEvent struct {
	Job         string
	Schedule    string
	Stage       JobErrorStage
	Attempt     int
	MaxAttempts int
	Error       error
}

JobErrorEvent carries the original typed scheduler error with stable job identity. Durable Job state remains a separate safe string projection.

type JobErrorObserver added in v0.127.1

type JobErrorObserver func(context.Context, JobErrorEvent)

JobErrorObserver receives typed retry and terminal scheduler failures.

type JobErrorStage added in v0.127.1

type JobErrorStage string

JobErrorStage distinguishes bounded retry observations from the single terminal scheduler failure.

const (
	JobErrorStageRetry    JobErrorStage = "retry"
	JobErrorStageTerminal JobErrorStage = "terminal"
)

type JobRegistry

type JobRegistry struct {
	// contains filtered or unexported fields
}

JobRegistry keeps track of jobs registered via commands with cron metadata.

func NewJobRegistry

func NewJobRegistry() *JobRegistry

NewJobRegistry captures cron-enabled go-command registrations.

func (*JobRegistry) Enable

func (j *JobRegistry) Enable(enabled bool)

Enable toggles whether jobs are available.

func (*JobRegistry) List

func (j *JobRegistry) List() []Job

List returns registered cron jobs.

func (*JobRegistry) Sync

func (j *JobRegistry) Sync(ctx context.Context) error

Sync registers cron-capable commands with the go-job dispatcher and scheduler.

func (*JobRegistry) Trigger

func (j *JobRegistry) Trigger(ctx AdminContext, name string) error

Trigger dispatches a job by name through the go-job dispatcher.

func (*JobRegistry) WithActivitySink

func (j *JobRegistry) WithActivitySink(sink ActivitySink)

WithActivitySink records job triggers to the shared activity sink.

func (*JobRegistry) WithErrorObserver added in v0.127.1

func (j *JobRegistry) WithErrorObserver(observer JobErrorObserver)

WithErrorObserver installs a typed scheduler error observer. Passing nil disables only the external callback; safe job state remains active.

func (*JobRegistry) WithGoJob

func (j *JobRegistry) WithGoJob(registry gojob.Registry, scheduler goJobScheduler)

WithGoJob allows callers to inject a go-job registry and scheduler.

type LegacyChartSampleWidgetPayload added in v0.25.0

type LegacyChartSampleWidgetPayload struct {
	Title string                    `json:"title"`
	Type  string                    `json:"type"`
	Data  []ChartPointWidgetPayload `json:"data"`
}

type ListOptions

type ListOptions struct {
	Page       int             `json:"page"`
	PerPage    int             `json:"per_page"`
	SortBy     string          `json:"sort_by"`
	SortDesc   bool            `json:"sort_desc"`
	Filters    map[string]any  `json:"filters"`
	Predicates []ListPredicate `json:"predicates"`
	Fields     []string        `json:"fields"`
	Search     string          `json:"search"`
}

ListOptions holds pagination and filtering input.

type ListPredicate added in v0.24.0

type ListPredicate struct {
	Field    string   `json:"field"`
	Operator string   `json:"operator"`
	Values   []string `json:"values,omitempty"`
}

ListPredicate defines an operator-aware list filter predicate.

func NormalizeListPredicates added in v0.24.0

func NormalizeListPredicates(opts ListOptions) []ListPredicate

NormalizeListPredicates returns operator-aware predicates for list filtering. It prefers explicit opts.Predicates and falls back to legacy opts.Filters.

type LocalCommandRunTransport added in v0.121.3

type LocalCommandRunTransport struct {
	// contains filtered or unexported fields
}

LocalCommandRunTransport is a concurrency-safe ephemeral fanout hub.

func NewLocalCommandRunTransport added in v0.121.3

func NewLocalCommandRunTransport(config LocalCommandRunTransportConfig) *LocalCommandRunTransport

NewLocalCommandRunTransport constructs the zero-service transport.

func (*LocalCommandRunTransport) Capabilities added in v0.121.3

func (*LocalCommandRunTransport) Close added in v0.121.3

Close stops local subscriptions. It is idempotent and owns no external driver.

func (*LocalCommandRunTransport) PublishCommandRun added in v0.121.3

func (t *LocalCommandRunTransport) PublishCommandRun(ctx context.Context, update CommandRunUpdate) error

func (*LocalCommandRunTransport) SubscribeCommandRuns added in v0.121.3

func (t *LocalCommandRunTransport) SubscribeCommandRuns(
	ctx context.Context,
	selector CommandRunSelector,
	handler CommandRunHandler,
) (CommandRunSubscription, error)

type LocalCommandRunTransportConfig added in v0.121.3

type LocalCommandRunTransportConfig struct {
	BufferSize     int
	ErrorBuffer    int
	PublishTimeout time.Duration
	ContractLimits CommandRunContractLimits
}

LocalCommandRunTransportConfig controls bounded in-process delivery.

type LocalePathMigrationApplyResult added in v0.36.0

type LocalePathMigrationApplyResult struct {
	Updated []LocalePathMigrationRewrite `json:"updated"`
	Skipped []LocalePathMigrationRewrite `json:"skipped,omitempty"`
}

func ApplyLocalePathMigration added in v0.36.0

type LocalePathMigrationFamilyPlan added in v0.36.0

type LocalePathMigrationFamilyPlan struct {
	ResourceKind      string                          `json:"resource_kind"`
	ContentType       string                          `json:"content_type,omitempty"`
	IdentityKey       string                          `json:"identity_key"`
	FamilyID          string                          `json:"family_id,omitempty"`
	RouteKeyReadiness LocalePathRouteKeyReadiness     `json:"route_key_readiness"`
	ProposedRouteKey  string                          `json:"proposed_route_key,omitempty"`
	Records           []LocalePathMigrationRecordPlan `json:"records"`
	Rewrites          []LocalePathMigrationRewrite    `json:"rewrites,omitempty"`
	Warnings          []string                        `json:"warnings,omitempty"`
}

type LocalePathMigrationOptions added in v0.36.0

type LocalePathMigrationOptions struct {
	SupportedLocales []string
	DefaultLocale    string
	IncludePages     bool
	IncludeContents  bool
}

type LocalePathMigrationRecordPlan added in v0.36.0

type LocalePathMigrationRecordPlan struct {
	ID              string                         `json:"id"`
	Locale          string                         `json:"locale"`
	Path            string                         `json:"path,omitempty"`
	RouteKey        string                         `json:"route_key,omitempty"`
	Classification  LocalePathRecordClassification `json:"classification"`
	ProposedPath    string                         `json:"proposed_path,omitempty"`
	DerivedRouteKey string                         `json:"derived_route_key,omitempty"`
}

type LocalePathMigrationReport added in v0.36.0

type LocalePathMigrationReport struct {
	Options  LocalePathMigrationOptions      `json:"options"`
	Summary  LocalePathMigrationSummary      `json:"summary"`
	Families []LocalePathMigrationFamilyPlan `json:"families"`
}

func AuditLocalePathMigration added in v0.36.0

type LocalePathMigrationRewrite added in v0.36.0

type LocalePathMigrationRewrite struct {
	ResourceKind string   `json:"resource_kind"`
	ContentType  string   `json:"content_type,omitempty"`
	ID           string   `json:"id"`
	Locale       string   `json:"locale"`
	PathFrom     string   `json:"path_from,omitempty"`
	PathTo       string   `json:"path_to,omitempty"`
	RouteKeyFrom string   `json:"route_key_from,omitempty"`
	RouteKeyTo   string   `json:"route_key_to,omitempty"`
	Reasons      []string `json:"reasons,omitempty"`
}

type LocalePathMigrationSummary added in v0.36.0

type LocalePathMigrationSummary struct {
	TotalFamilies             int `json:"total_families"`
	LegacyPrefixedRecords     int `json:"legacy_prefixed_records"`
	TranslatedLocalizedPaths  int `json:"translated_localized_paths"`
	AmbiguousRecords          int `json:"ambiguous_records"`
	MissingRouteKeyFamilies   int `json:"missing_route_key_families"`
	AmbiguousRouteKeyFamilies int `json:"ambiguous_route_key_families"`
	ProposedRewrites          int `json:"proposed_rewrites"`
}

type LocalePathRecordClassification added in v0.36.0

type LocalePathRecordClassification string
const (
	LocalePathRecordCanonicalUnprefixed LocalePathRecordClassification = "canonical_unprefixed"
	LocalePathRecordLegacyPrefixed      LocalePathRecordClassification = "legacy_prefixed"
	LocalePathRecordTranslatedLocalized LocalePathRecordClassification = "translated_localized"
	LocalePathRecordAmbiguousLocaleLike LocalePathRecordClassification = "ambiguous_locale_like"
	LocalePathRecordMissing             LocalePathRecordClassification = "missing"
)

type LocalePathRouteKeyReadiness added in v0.36.0

type LocalePathRouteKeyReadiness string
const (
	LocalePathRouteKeyPresentConsistent LocalePathRouteKeyReadiness = "present_consistent"
	LocalePathRouteKeyMissingDerivable  LocalePathRouteKeyReadiness = "missing_derivable"
	LocalePathRouteKeyAmbiguous         LocalePathRouteKeyReadiness = "ambiguous"
)

type LogCaller added in v0.119.0

type LogCaller struct {
	Function string `json:"function,omitempty"`
	File     string `json:"file,omitempty"`
	Line     int    `json:"line,omitempty"`
}

LogCaller identifies the application frame associated with a log record.

type LogEntry added in v0.14.0

type LogEntry struct {
	ID        string         `json:"id,omitempty"`
	Timestamp time.Time      `json:"timestamp"`
	SessionID string         `json:"session_id,omitempty"`
	UserID    string         `json:"user_id,omitempty"`
	Level     string         `json:"level"`
	Message   string         `json:"message"`
	Logger    string         `json:"logger,omitempty"`
	Caller    *LogCaller     `json:"caller,omitempty"`
	TraceID   string         `json:"trace_id,omitempty"`
	SpanID    string         `json:"span_id,omitempty"`
	RequestID string         `json:"request_id,omitempty"`
	Fields    map[string]any `json:"fields,omitempty"`
	Source    string         `json:"source,omitempty"`
}

LogEntry captures server log messages.

type Logger added in v0.25.0

type Logger = glog.Logger

Logger is a go-logger compatible leveled logger contract.

type LoggerProvider added in v0.25.0

type LoggerProvider = glog.LoggerProvider

LoggerProvider resolves named loggers.

type LoginLogoPlacement added in v0.128.5

type LoginLogoPlacement string

LoginLogoPlacement controls whether the login identity mark renders above the card or inside it. The empty value preserves the legacy outside-card composition.

const (
	LoginLogoPlacementOutsideCard LoginLogoPlacement = "outside-card"
	LoginLogoPlacementInsideCard  LoginLogoPlacement = "inside-card"
)

func NormalizeLoginLogoPlacement added in v0.128.5

func NormalizeLoginLogoPlacement(value LoginLogoPlacement) LoginLogoPlacement

NormalizeLoginLogoPlacement returns a supported login logo placement while preserving the legacy outside-card composition for empty/unknown input.

type ManagementContentService added in v0.23.0

type ManagementContentService struct {
	// contains filtered or unexported fields
}

ManagementContentService adapts CMS content for management APIs.

func NewManagementContentService added in v0.23.0

func NewManagementContentService(container CMSContainer, opts DeliveryOptions) *ManagementContentService

func (*ManagementContentService) Create added in v0.23.0

func (ManagementContentService) CreateBatch added in v0.23.0

func (s ManagementContentService) CreateBatch(crud.Context, []T) ([]T, error)

func (*ManagementContentService) Delete added in v0.23.0

func (ManagementContentService) DeleteBatch added in v0.23.0

func (s ManagementContentService) DeleteBatch(crud.Context, []T) error

func (*ManagementContentService) Index added in v0.23.0

func (*ManagementContentService) Show added in v0.23.0

func (*ManagementContentService) Update added in v0.23.0

func (ManagementContentService) UpdateBatch added in v0.23.0

func (s ManagementContentService) UpdateBatch(crud.Context, []T) ([]T, error)

type ManagementContentTypeService added in v0.23.0

type ManagementContentTypeService struct {
	// contains filtered or unexported fields
}

ManagementContentTypeService adapts CMS content types for management APIs.

func NewManagementContentTypeService added in v0.23.0

func NewManagementContentTypeService(container CMSContainer) *ManagementContentTypeService

func (*ManagementContentTypeService) Create added in v0.23.0

func (ManagementContentTypeService) CreateBatch added in v0.23.0

func (s ManagementContentTypeService) CreateBatch(crud.Context, []T) ([]T, error)

func (*ManagementContentTypeService) Delete added in v0.23.0

func (ManagementContentTypeService) DeleteBatch added in v0.23.0

func (s ManagementContentTypeService) DeleteBatch(crud.Context, []T) error

func (*ManagementContentTypeService) Index added in v0.23.0

func (*ManagementContentTypeService) Show added in v0.23.0

func (*ManagementContentTypeService) Update added in v0.23.0

func (ManagementContentTypeService) UpdateBatch added in v0.23.0

func (s ManagementContentTypeService) UpdateBatch(crud.Context, []T) ([]T, error)

type ManagementPageService added in v0.23.0

type ManagementPageService struct {
	// contains filtered or unexported fields
}

ManagementPageService adapts CMS pages for management APIs.

func NewManagementPageService added in v0.23.0

func NewManagementPageService(container CMSContainer, opts DeliveryOptions) *ManagementPageService

func (*ManagementPageService) Create added in v0.23.0

func (ManagementPageService) CreateBatch added in v0.23.0

func (s ManagementPageService) CreateBatch(crud.Context, []T) ([]T, error)

func (*ManagementPageService) Delete added in v0.23.0

func (s *ManagementPageService) Delete(ctx crud.Context, record admingraphql.Page) error

func (ManagementPageService) DeleteBatch added in v0.23.0

func (s ManagementPageService) DeleteBatch(crud.Context, []T) error

func (*ManagementPageService) Index added in v0.23.0

func (*ManagementPageService) Show added in v0.23.0

func (*ManagementPageService) Update added in v0.23.0

func (ManagementPageService) UpdateBatch added in v0.23.0

func (s ManagementPageService) UpdateBatch(crud.Context, []T) ([]T, error)

type ManagementServices added in v0.23.0

type ManagementServices struct {
	Contents     crud.Service[admingraphql.Content]     `json:"contents"`
	Pages        crud.Service[admingraphql.Page]        `json:"pages"`
	ContentTypes crud.Service[admingraphql.ContentType] `json:"content_types"`
}

ManagementServices bundles CRUD-compatible services for management GraphQL.

func NewManagementServices added in v0.23.0

func NewManagementServices(container CMSContainer, opts DeliveryOptions) ManagementServices

NewManagementServices builds management services backed by CMS adapters.

type MediaActivityDecision added in v0.51.0

type MediaActivityDecision struct {
	SuppressDefault bool            `json:"suppress_default,omitempty"`
	Primary         *ActivityEntry  `json:"primary,omitempty"`
	Additional      []ActivityEntry `json:"additional,omitempty"`
}

MediaActivityDecision allows hosts to override, suppress, or append activity entries without taking over the core mutation path.

type MediaActivityHook added in v0.51.0

type MediaActivityHook func(context.Context, MediaMutationEvent) (MediaActivityDecision, error)

MediaActivityHook optionally customizes default media mutation activity.

type MediaCapabilities added in v0.51.0

type MediaCapabilities struct {
	Operations MediaOperationCapabilities `json:"operations"`
	Upload     MediaUploadCapabilities    `json:"upload"`
	Picker     MediaPickerCapabilities    `json:"picker"`
}

MediaCapabilities aggregates request-scoped media capabilities.

type MediaCapabilityOverrideProvider added in v0.51.0

type MediaCapabilityOverrideProvider interface {
	MediaCapabilityOverrides(ctx context.Context) (MediaCapabilityOverrides, error)
}

MediaCapabilityOverrideProvider exposes partial request-scoped capability overrides layered on top of the built-in supported capability set.

type MediaCapabilityOverrides added in v0.51.0

type MediaCapabilityOverrides struct {
	Operations MediaOperationCapabilityOverrides `json:"operations"`
	Upload     MediaUploadCapabilityOverrides    `json:"upload"`
	Picker     MediaPickerCapabilityOverrides    `json:"picker"`
}

MediaCapabilityOverrides carries partial capability overrides. Use this when callers only need to tune a subset of the capability payload.

type MediaCapabilityProvider added in v0.51.0

type MediaCapabilityProvider interface {
	MediaCapabilities(ctx context.Context) (MediaCapabilities, error)
}

MediaCapabilityProvider exposes request-scoped media capability information. Implementations should return the full capability payload for the current request, not a partial patch.

type MediaConfig

type MediaConfig struct {
	LibraryPath         string         `json:"library_path"`
	ItemPath            string         `json:"item_path,omitempty"`
	ResolvePath         string         `json:"resolve_path,omitempty"`
	UploadPath          string         `json:"upload_path,omitempty"`
	PresignPath         string         `json:"presign_path,omitempty"`
	ConfirmPath         string         `json:"confirm_path,omitempty"`
	CapabilitiesPath    string         `json:"capabilities_path,omitempty"`
	AssetURLTemplate    string         `json:"asset_url_template,omitempty"`
	StreamURLTemplate   string         `json:"stream_url_template,omitempty"`
	PosterURLTemplate   string         `json:"poster_url_template,omitempty"`
	DownloadURLTemplate string         `json:"download_url_template,omitempty"`
	DefaultValueMode    MediaValueMode `json:"default_value_mode,omitempty"`
}

MediaConfig surfaces media library configuration for form widgets.

type MediaConfirmRequest added in v0.51.0

type MediaConfirmRequest struct {
	UploadID    string         `json:"upload_id,omitempty"`
	Name        string         `json:"name,omitempty"`
	URL         string         `json:"url,omitempty"`
	FileName    string         `json:"file_name,omitempty"`
	ContentType string         `json:"content_type,omitempty"`
	Size        int64          `json:"size,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

MediaConfirmRequest finalizes an upload after direct or presigned transfer.

type MediaConfirmer added in v0.51.0

type MediaConfirmer interface {
	ConfirmMedia(ctx context.Context, req MediaConfirmRequest) (MediaItem, error)
}

MediaConfirmer finalizes a previously uploaded media asset.

type MediaDeleter added in v0.51.0

type MediaDeleter interface {
	DeleteMedia(ctx context.Context, id string) error
}

MediaDeleter removes a media item.

type MediaDeliveryAdapter added in v0.62.0

type MediaDeliveryAdapter interface {
	ResolveMediaDelivery(context.Context, MediaDeliveryRequest) (MediaDeliveryResponse, error)
}

MediaDeliveryAdapter resolves provider-specific delivery behavior.

type MediaDeliveryCacheConfig added in v0.62.0

type MediaDeliveryCacheConfig struct {
	Control string        `json:"control,omitempty"`
	MaxAge  time.Duration `json:"max_age,omitempty"`
}

MediaDeliveryCacheConfig carries default cache response policy for delivery handlers.

type MediaDeliveryCapability added in v0.62.0

type MediaDeliveryCapability string

MediaDeliveryCapability describes delivery behavior available for an item/provider.

const (
	MediaDeliveryCapabilityStream       MediaDeliveryCapability = "stream"
	MediaDeliveryCapabilityDownload     MediaDeliveryCapability = "download"
	MediaDeliveryCapabilityPoster       MediaDeliveryCapability = "poster"
	MediaDeliveryCapabilityRedirect     MediaDeliveryCapability = "redirect"
	MediaDeliveryCapabilityProxy        MediaDeliveryCapability = "proxy"
	MediaDeliveryCapabilityImport       MediaDeliveryCapability = "import"
	MediaDeliveryCapabilityRange        MediaDeliveryCapability = "range"
	MediaDeliveryCapabilityAuthRequired MediaDeliveryCapability = "auth_required"
)

func NormalizeMediaDeliveryCapabilities added in v0.62.0

func NormalizeMediaDeliveryCapabilities(values ...MediaDeliveryCapability) []MediaDeliveryCapability

type MediaDeliveryConfig added in v0.62.0

type MediaDeliveryConfig struct {
	AdminEnabled *bool                         `json:"admin_enabled,omitempty"`
	Public       MediaPublicDeliveryConfig     `json:"public"`
	Cache        MediaDeliveryCacheConfig      `json:"cache"`
	Redirect     MediaDeliveryRedirectConfig   `json:"redirect"`
	Proxy        MediaDeliveryProxyLimitConfig `json:"proxy"`
}

MediaDeliveryConfig controls browser-consumable media delivery routes.

type MediaDeliveryCredential added in v0.62.0

type MediaDeliveryCredential struct {
	AccessToken string            `json:"access_token,omitempty"`
	TokenType   string            `json:"token_type,omitempty"`
	Headers     map[string]string `json:"headers,omitempty"`
	ExpiresAt   *time.Time        `json:"expires_at,omitempty"`
}

MediaDeliveryCredential carries host-resolved provider credentials.

type MediaDeliveryCredentialRequest added in v0.62.0

type MediaDeliveryCredentialRequest struct {
	Provider  string                 `json:"provider,omitempty"`
	MediaID   string                 `json:"media_id,omitempty"`
	Intent    MediaDeliveryIntent    `json:"intent,omitempty"`
	Reference MediaDeliveryReference `json:"reference"`
	Scopes    []string               `json:"scopes,omitempty"`
}

MediaDeliveryCredentialRequest asks a host credential resolver for provider access.

type MediaDeliveryCredentialResolver added in v0.62.0

type MediaDeliveryCredentialResolver interface {
	ResolveMediaDeliveryCredential(context.Context, MediaDeliveryCredentialRequest) (MediaDeliveryCredential, error)
}

MediaDeliveryCredentialResolver keeps OAuth/token ownership outside the media module.

type MediaDeliveryCredentialResolverFunc added in v0.62.0

type MediaDeliveryCredentialResolverFunc func(context.Context, MediaDeliveryCredentialRequest) (MediaDeliveryCredential, error)

MediaDeliveryCredentialResolverFunc adapts a function to MediaDeliveryCredentialResolver.

func (MediaDeliveryCredentialResolverFunc) ResolveMediaDeliveryCredential added in v0.62.0

type MediaDeliveryImported added in v0.62.0

type MediaDeliveryImported struct {
	Reader        io.ReadSeeker `json:"-"`
	ContentType   string        `json:"content_type,omitempty"`
	ContentLength int64         `json:"content_length,omitempty"`
	FileName      string        `json:"file_name,omitempty"`
	ModTime       time.Time     `json:"mod_time"`
	Headers       http.Header   `json:"-"`
}

MediaDeliveryImported describes app-owned imported/local delivery.

func NewLocalMediaDeliveryImported added in v0.62.0

func NewLocalMediaDeliveryImported(path string, roots []string, contentType string) (*MediaDeliveryImported, error)

type MediaDeliveryInfo added in v0.62.0

type MediaDeliveryInfo struct {
	State        MediaDeliveryState        `json:"state,omitempty"`
	Reason       string                    `json:"reason,omitempty"`
	Capabilities []MediaDeliveryCapability `json:"capabilities,omitempty"`
}

MediaDeliveryInfo is safe delivery metadata for normal media payloads.

type MediaDeliveryIntent added in v0.62.0

type MediaDeliveryIntent string

MediaDeliveryIntent identifies the browser delivery purpose.

const (
	MediaDeliveryIntentAsset    MediaDeliveryIntent = "asset"
	MediaDeliveryIntentStream   MediaDeliveryIntent = "stream"
	MediaDeliveryIntentPoster   MediaDeliveryIntent = "poster"
	MediaDeliveryIntentDownload MediaDeliveryIntent = "download"
)

func ParseMediaDeliveryIntent added in v0.62.0

func ParseMediaDeliveryIntent(raw string) (MediaDeliveryIntent, bool)

type MediaDeliveryMode added in v0.62.0

type MediaDeliveryMode string

MediaDeliveryMode describes how a delivery adapter satisfied a request.

const (
	MediaDeliveryModeRedirect    MediaDeliveryMode = "redirect"
	MediaDeliveryModeProxy       MediaDeliveryMode = "proxy"
	MediaDeliveryModeImported    MediaDeliveryMode = "imported"
	MediaDeliveryModeUnavailable MediaDeliveryMode = "unavailable"
)

type MediaDeliveryProxy added in v0.62.0

type MediaDeliveryProxy struct {
	Reader        io.ReadCloser `json:"-"`
	ContentType   string        `json:"content_type,omitempty"`
	ContentLength int64         `json:"content_length,omitempty"`
	FileName      string        `json:"file_name,omitempty"`
	ModTime       time.Time     `json:"mod_time"`
	Range         bool          `json:"range,omitempty"`
	Headers       http.Header   `json:"-"`
}

MediaDeliveryProxy describes stream/proxy-mode delivery.

type MediaDeliveryProxyLimitConfig added in v0.62.0

type MediaDeliveryProxyLimitConfig struct {
	Timeout      time.Duration `json:"timeout,omitempty"`
	MaxBytes     int64         `json:"max_bytes,omitempty"`
	BufferBytes  int           `json:"buffer_bytes,omitempty"`
	AllowedHosts []string      `json:"allowed_hosts,omitempty"`
}

MediaDeliveryProxyLimitConfig carries proxy-mode limits.

type MediaDeliveryRange added in v0.62.0

type MediaDeliveryRange struct {
	Start int64
	End   int64
}

MediaDeliveryRange describes a satisfiable single byte range.

func ParseMediaDeliveryRange added in v0.62.0

func ParseMediaDeliveryRange(header string, size int64) (MediaDeliveryRange, bool, error)

type MediaDeliveryRedirect added in v0.62.0

type MediaDeliveryRedirect struct {
	URL       string      `json:"url"`
	Status    int         `json:"status,omitempty"`
	Headers   http.Header `json:"-"`
	Cache     string      `json:"cache,omitempty"`
	ExpiresAt *time.Time  `json:"expires_at,omitempty"`
}

MediaDeliveryRedirect describes redirect-mode delivery.

type MediaDeliveryRedirectConfig added in v0.62.0

type MediaDeliveryRedirectConfig struct {
	Enabled         *bool    `json:"enabled,omitempty"`
	AllowedHosts    []string `json:"allowed_hosts,omitempty"`
	PreferTemporary bool     `json:"prefer_temporary,omitempty"`
}

MediaDeliveryRedirectConfig carries redirect-mode policy.

type MediaDeliveryReference added in v0.62.0

type MediaDeliveryReference struct {
	ID         string         `json:"id,omitempty"`
	Name       string         `json:"name,omitempty"`
	Provider   string         `json:"provider,omitempty"`
	SourceURL  string         `json:"source_url,omitempty"`
	ExternalID string         `json:"external_id,omitempty"`
	StorageKey string         `json:"storage_key,omitempty"`
	PosterKey  string         `json:"poster_key,omitempty"`
	MIMEType   string         `json:"mime_type,omitempty"`
	Size       int64          `json:"size,omitempty"`
	Metadata   map[string]any `json:"metadata,omitempty"`
}

MediaDeliveryReference is internal provider/provenance data used by adapters.

type MediaDeliveryReferenceProjector added in v0.62.0

type MediaDeliveryReferenceProjector interface {
	ProjectMediaDeliveryReference(context.Context, MediaItem) (MediaDeliveryReference, error)
}

MediaDeliveryReferenceProjector converts media items into internal delivery references.

type MediaDeliveryReferenceProjectorFunc added in v0.62.0

type MediaDeliveryReferenceProjectorFunc func(context.Context, MediaItem) (MediaDeliveryReference, error)

MediaDeliveryReferenceProjectorFunc adapts a function to MediaDeliveryReferenceProjector.

func (MediaDeliveryReferenceProjectorFunc) ProjectMediaDeliveryReference added in v0.62.0

func (f MediaDeliveryReferenceProjectorFunc) ProjectMediaDeliveryReference(ctx context.Context, item MediaItem) (MediaDeliveryReference, error)

type MediaDeliveryRegistry added in v0.62.0

type MediaDeliveryRegistry struct {
	// contains filtered or unexported fields
}

MediaDeliveryRegistry stores provider-specific delivery adapters.

func NewMediaDeliveryRegistry added in v0.62.0

func NewMediaDeliveryRegistry() *MediaDeliveryRegistry

NewMediaDeliveryRegistry constructs an empty delivery adapter registry.

func (*MediaDeliveryRegistry) Adapter added in v0.62.0

func (r *MediaDeliveryRegistry) Adapter(provider string) (MediaDeliveryAdapter, bool)

func (*MediaDeliveryRegistry) Register added in v0.62.0

func (r *MediaDeliveryRegistry) Register(provider string, adapter MediaDeliveryAdapter) error

func (*MediaDeliveryRegistry) Resolve added in v0.62.0

type MediaDeliveryRequest added in v0.62.0

type MediaDeliveryRequest struct {
	Item               MediaItem                       `json:"item"`
	Reference          MediaDeliveryReference          `json:"reference"`
	Intent             MediaDeliveryIntent             `json:"intent"`
	Request            *http.Request                   `json:"-"`
	CredentialResolver MediaDeliveryCredentialResolver `json:"-"`
}

MediaDeliveryRequest is passed to delivery adapters.

func (MediaDeliveryRequest) ResolveCredential added in v0.62.0

func (req MediaDeliveryRequest) ResolveCredential(ctx context.Context, scopes ...string) (MediaDeliveryCredential, error)

ResolveCredential asks the host-owned resolver for provider credentials.

type MediaDeliveryResponse added in v0.62.0

type MediaDeliveryResponse struct {
	Mode        MediaDeliveryMode         `json:"mode"`
	Redirect    *MediaDeliveryRedirect    `json:"redirect,omitempty"`
	Proxy       *MediaDeliveryProxy       `json:"proxy,omitempty"`
	Imported    *MediaDeliveryImported    `json:"imported,omitempty"`
	Unavailable *MediaDeliveryUnavailable `json:"unavailable,omitempty"`
}

MediaDeliveryResponse is returned by delivery adapters.

type MediaDeliveryState added in v0.62.0

type MediaDeliveryState string

MediaDeliveryState describes delivery readiness without exposing provider details.

const (
	MediaDeliveryStateReady              MediaDeliveryState = "ready"
	MediaDeliveryStateProcessing         MediaDeliveryState = "processing"
	MediaDeliveryStateExternalSourceOnly MediaDeliveryState = "external_source_only"
	MediaDeliveryStateNeedsImport        MediaDeliveryState = "needs_import"
	MediaDeliveryStateNotPlayable        MediaDeliveryState = "not_playable"
	MediaDeliveryStateUnavailable        MediaDeliveryState = "unavailable"
	MediaDeliveryStateFailed             MediaDeliveryState = "failed"
)

func NormalizeMediaDeliveryState added in v0.62.0

func NormalizeMediaDeliveryState(raw string) MediaDeliveryState

type MediaDeliveryURLBuildOptions added in v0.62.0

type MediaDeliveryURLBuildOptions struct {
	IncludeAdmin  bool `json:"include_admin,omitempty"`
	IncludePublic bool `json:"include_public,omitempty"`
}

type MediaDeliveryURLs added in v0.62.0

type MediaDeliveryURLs struct {
	AssetURL          string `json:"asset_url,omitempty"`
	StreamURL         string `json:"stream_url,omitempty"`
	PosterURL         string `json:"poster_url,omitempty"`
	DownloadURL       string `json:"download_url,omitempty"`
	PublicAssetURL    string `json:"public_asset_url,omitempty"`
	PublicStreamURL   string `json:"public_stream_url,omitempty"`
	PublicPosterURL   string `json:"public_poster_url,omitempty"`
	PublicDownloadURL string `json:"public_download_url,omitempty"`
}

MediaDeliveryURLs carries app-owned delivery URLs for a media item.

func BuildMediaDeliveryURLs added in v0.62.0

func BuildMediaDeliveryURLs(urls urlkit.Resolver, adminGroup, publicGroup, id string, includePublic bool) MediaDeliveryURLs

func BuildMediaDeliveryURLsWithOptions added in v0.62.0

func BuildMediaDeliveryURLsWithOptions(urls urlkit.Resolver, adminGroup, publicGroup, id string, opts MediaDeliveryURLBuildOptions) MediaDeliveryURLs

type MediaDeliveryUnavailable added in v0.62.0

type MediaDeliveryUnavailable struct {
	State  MediaDeliveryState `json:"state,omitempty"`
	Reason string             `json:"reason,omitempty"`
	Code   int                `json:"code,omitempty"`
}

MediaDeliveryUnavailable describes a typed unavailable delivery outcome.

type MediaDeliveryUnavailableError added in v0.62.0

type MediaDeliveryUnavailableError struct {
	State    MediaDeliveryState `json:"state,omitempty"`
	Reason   string             `json:"reason,omitempty"`
	Code     int                `json:"code,omitempty"`
	Provider string             `json:"provider,omitempty"`
}

MediaDeliveryUnavailableError is returned for typed unavailable outcomes.

func (MediaDeliveryUnavailableError) Error added in v0.62.0

type MediaGetter added in v0.51.0

type MediaGetter interface {
	GetMedia(ctx context.Context, id string) (MediaItem, error)
}

MediaGetter resolves a media item by ID.

type MediaItem

type MediaItem struct {
	ID             string            `json:"id"`
	Name           string            `json:"name"`
	URL            string            `json:"url"`
	AssetURL       string            `json:"asset_url,omitempty"`
	StreamURL      string            `json:"stream_url,omitempty"`
	PosterURL      string            `json:"poster_url,omitempty"`
	DownloadURL    string            `json:"download_url,omitempty"`
	Thumbnail      string            `json:"thumbnail,omitempty"`
	Type           string            `json:"type,omitempty"`
	MIMEType       string            `json:"mime_type,omitempty"`
	Size           int64             `json:"size,omitempty"`
	Status         string            `json:"status,omitempty"`
	WorkflowStatus string            `json:"workflow_status,omitempty"`
	WorkflowError  string            `json:"workflow_error,omitempty"`
	Delivery       MediaDeliveryInfo `json:"delivery"`
	Metadata       map[string]any    `json:"metadata,omitempty"`
	CreatedAt      time.Time         `json:"created_at"`
}

MediaItem describes a stored asset.

func (MediaItem) MarshalJSON added in v0.62.0

func (item MediaItem) MarshalJSON() ([]byte, error)

type MediaLibrary

type MediaLibrary interface {
	MediaQueryProvider
}

MediaLibrary exposes the required query-aware media listing surface.

type MediaLocalFileDeliveryAdapter added in v0.62.0

type MediaLocalFileDeliveryAdapter struct {
	Roots []string `json:"roots,omitempty"`
}

MediaLocalFileDeliveryAdapter serves files from configured local roots.

func (MediaLocalFileDeliveryAdapter) ResolveMediaDelivery added in v0.62.0

type MediaModule added in v0.51.0

type MediaModule struct {
	// contains filtered or unexported fields
}

MediaModule exposes the media library as a module-owned admin page.

func NewMediaModule added in v0.51.0

func NewMediaModule() *MediaModule

NewMediaModule constructs the default media module.

func (*MediaModule) Manifest added in v0.51.0

func (m *MediaModule) Manifest() ModuleManifest

Manifest describes the module metadata.

func (*MediaModule) MenuItems added in v0.51.0

func (m *MediaModule) MenuItems(locale string) []MenuItem

MenuItems contributes navigation for the media module.

func (*MediaModule) Register added in v0.51.0

func (m *MediaModule) Register(ctx ModuleContext) error

Register wires the module-owned gallery and list pages.

func (*MediaModule) RouteContract added in v0.51.0

func (m *MediaModule) RouteContract() routing.ModuleContract

RouteContract declares the UI and admin API routes owned by the media module.

func (*MediaModule) ValidateStartup added in v0.62.0

func (m *MediaModule) ValidateStartup(ctx context.Context) error

ValidateStartup rejects public delivery requests that cannot be authorized.

func (*MediaModule) WithDeliveryConfig added in v0.62.0

func (m *MediaModule) WithDeliveryConfig(cfg MediaDeliveryConfig) *MediaModule

WithDeliveryConfig configures route exposure before module route planning.

func (*MediaModule) WithMenuParent added in v0.51.0

func (m *MediaModule) WithMenuParent(parent string) *MediaModule

WithMenuParent nests the media navigation under a parent menu item ID.

func (*MediaModule) WithMenuPosition added in v0.51.0

func (m *MediaModule) WithMenuPosition(position int) *MediaModule

WithMenuPosition sets the media navigation sort position.

type MediaMutationEvent added in v0.51.0

type MediaMutationEvent struct {
	Operation    MediaMutationOperation `json:"operation"`
	MediaID      string                 `json:"media_id,omitempty"`
	Reference    MediaReference         `json:"reference"`
	Before       *MediaItem             `json:"before,omitempty"`
	After        *MediaItem             `json:"after,omitempty"`
	Request      map[string]any         `json:"request,omitempty"`
	DefaultEntry *ActivityEntry         `json:"default_entry,omitempty"`
}

MediaMutationEvent describes a media mutation before activity projection.

type MediaMutationOperation added in v0.51.0

type MediaMutationOperation string

MediaMutationOperation describes the mutation being applied to media.

const (
	MediaMutationCreate  MediaMutationOperation = "create"
	MediaMutationUpload  MediaMutationOperation = "upload"
	MediaMutationConfirm MediaMutationOperation = "confirm"
	MediaMutationUpdate  MediaMutationOperation = "update"
	MediaMutationDelete  MediaMutationOperation = "delete"
)

type MediaOperationCapabilities added in v0.51.0

type MediaOperationCapabilities struct {
	List    bool `json:"list"`
	Get     bool `json:"get"`
	Resolve bool `json:"resolve"`
	Upload  bool `json:"upload"`
	Presign bool `json:"presign"`
	Confirm bool `json:"confirm"`
	Update  bool `json:"update"`
	Delete  bool `json:"delete"`
}

MediaOperationCapabilities describes which high-level operations are available for the current request.

type MediaOperationCapabilityOverrides added in v0.51.0

type MediaOperationCapabilityOverrides struct {
	List    *bool `json:"list,omitempty"`
	Get     *bool `json:"get,omitempty"`
	Resolve *bool `json:"resolve,omitempty"`
	Upload  *bool `json:"upload,omitempty"`
	Presign *bool `json:"presign,omitempty"`
	Confirm *bool `json:"confirm,omitempty"`
	Update  *bool `json:"update,omitempty"`
	Delete  *bool `json:"delete,omitempty"`
}

MediaOperationCapabilityOverrides applies partial request-scoped operation overrides without requiring callers to populate a full capability payload.

type MediaPage added in v0.51.0

type MediaPage struct {
	Items  []MediaItem `json:"items"`
	Total  int         `json:"total"`
	Limit  int         `json:"limit,omitempty"`
	Offset int         `json:"offset,omitempty"`
}

MediaPage represents a paginated media result set.

type MediaPickerCapabilities added in v0.51.0

type MediaPickerCapabilities struct {
	ValueModes       []MediaValueMode `json:"value_modes,omitempty"`
	DefaultValueMode MediaValueMode   `json:"default_value_mode,omitempty"`
}

MediaPickerCapabilities describes picker value-mode behavior.

type MediaPickerCapabilityOverrides added in v0.51.0

type MediaPickerCapabilityOverrides struct {
	ValueModes       *[]MediaValueMode `json:"value_modes,omitempty"`
	DefaultValueMode *MediaValueMode   `json:"default_value_mode,omitempty"`
}

MediaPickerCapabilityOverrides applies partial request-scoped picker overrides without requiring callers to republish unchanged fields.

type MediaPresignRequest added in v0.51.0

type MediaPresignRequest struct {
	Name        string         `json:"name,omitempty"`
	FileName    string         `json:"file_name,omitempty"`
	ContentType string         `json:"content_type,omitempty"`
	Size        int64          `json:"size,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

MediaPresignRequest captures the metadata needed to prepare an upload.

type MediaPresignResponse added in v0.51.0

type MediaPresignResponse struct {
	UploadURL string            `json:"upload_url,omitempty"`
	Method    string            `json:"method,omitempty"`
	Headers   map[string]string `json:"headers,omitempty"`
	Fields    map[string]string `json:"fields,omitempty"`
	UploadID  string            `json:"upload_id,omitempty"`
}

MediaPresignResponse returns the upload target and any required request data.

type MediaPresigner added in v0.51.0

type MediaPresigner interface {
	PresignMedia(ctx context.Context, req MediaPresignRequest) (MediaPresignResponse, error)
}

MediaPresigner prepares an upload target for client-side transfer.

type MediaPublicDeliveryAuthorization added in v0.62.0

type MediaPublicDeliveryAuthorization struct {
	MediaID string        `json:"media_id,omitempty"`
	Intent  string        `json:"intent,omitempty"`
	Request *http.Request `json:"-"`
}

MediaPublicDeliveryAuthorization carries public-route authorization context.

type MediaPublicDeliveryAuthorizer added in v0.62.0

type MediaPublicDeliveryAuthorizer func(context.Context, MediaPublicDeliveryAuthorization) error

MediaPublicDeliveryAuthorizer authorizes an unauthenticated public media delivery request.

type MediaPublicDeliveryConfig added in v0.62.0

type MediaPublicDeliveryConfig struct {
	Enabled            bool                             `json:"enabled,omitempty"`
	Authorizer         MediaPublicDeliveryAuthorizer    `json:"-"`
	TokenVerifier      MediaPublicDeliveryTokenVerifier `json:"-"`
	AllowAdapterPolicy bool                             `json:"allow_adapter_policy,omitempty"`
}

MediaPublicDeliveryConfig controls opt-in public delivery route exposure.

type MediaPublicDeliveryTokenVerifier added in v0.62.0

type MediaPublicDeliveryTokenVerifier func(context.Context, string, MediaPublicDeliveryAuthorization) error

MediaPublicDeliveryTokenVerifier validates signed public delivery tokens.

type MediaQuery added in v0.51.0

type MediaQuery struct {
	Search         string `json:"search,omitempty"`
	Type           string `json:"type,omitempty"`
	MIMEFamily     string `json:"mime_family,omitempty"`
	Status         string `json:"status,omitempty"`
	WorkflowStatus string `json:"workflow_status,omitempty"`
	Sort           string `json:"sort,omitempty"`
	Limit          int    `json:"limit,omitempty"`
	Offset         int    `json:"offset,omitempty"`
}

MediaQuery carries list filtering and pagination hints.

type MediaQueryProvider added in v0.51.0

type MediaQueryProvider interface {
	QueryMedia(ctx context.Context, query MediaQuery) (MediaPage, error)
}

MediaQueryProvider exposes paginated/query-aware listing.

type MediaRedirectDeliveryAdapter added in v0.62.0

type MediaRedirectDeliveryAdapter struct {
	AllowedHosts []string `json:"allowed_hosts,omitempty"`
	Status       int      `json:"status,omitempty"`
	Cache        string   `json:"cache,omitempty"`
}

MediaRedirectDeliveryAdapter redirects to app-approved provider or CDN URLs.

func (MediaRedirectDeliveryAdapter) ResolveMediaDelivery added in v0.62.0

type MediaReference added in v0.51.0

type MediaReference struct {
	ID   string `json:"id,omitempty"`
	URL  string `json:"url,omitempty"`
	Name string `json:"name,omitempty"`
}

MediaReference identifies a media item by the stable value modes exposed to form widgets and APIs.

type MediaResolver added in v0.51.0

type MediaResolver interface {
	ResolveMedia(ctx context.Context, ref MediaReference) (MediaItem, error)
}

MediaResolver resolves a picker reference into a media item.

type MediaUpdateInput added in v0.51.0

type MediaUpdateInput struct {
	Name           string         `json:"name,omitempty"`
	Thumbnail      string         `json:"thumbnail,omitempty"`
	Type           string         `json:"type,omitempty"`
	MIMEType       string         `json:"mime_type,omitempty"`
	Status         string         `json:"status,omitempty"`
	WorkflowStatus string         `json:"workflow_status,omitempty"`
	WorkflowError  string         `json:"workflow_error,omitempty"`
	Metadata       map[string]any `json:"metadata,omitempty"`
}

MediaUpdateInput applies mutable metadata updates to an existing media item.

type MediaUpdater added in v0.51.0

type MediaUpdater interface {
	UpdateMedia(ctx context.Context, id string, input MediaUpdateInput) (MediaItem, error)
}

MediaUpdater mutates an existing media item's metadata.

type MediaUploadCapabilities added in v0.51.0

type MediaUploadCapabilities struct {
	DirectUpload      bool     `json:"direct_upload"`
	Presign           bool     `json:"presign"`
	MaxSize           int64    `json:"max_size,omitempty"`
	AcceptedKinds     []string `json:"accepted_kinds,omitempty"`
	AcceptedMIMETypes []string `json:"accepted_mime_types,omitempty"`
}

MediaUploadCapabilities describes available upload modes and limits.

type MediaUploadCapabilityOverrides added in v0.51.0

type MediaUploadCapabilityOverrides struct {
	DirectUpload      *bool     `json:"direct_upload,omitempty"`
	Presign           *bool     `json:"presign,omitempty"`
	MaxSize           *int64    `json:"max_size,omitempty"`
	AcceptedKinds     *[]string `json:"accepted_kinds,omitempty"`
	AcceptedMIMETypes *[]string `json:"accepted_mime_types,omitempty"`
}

MediaUploadCapabilityOverrides applies partial request-scoped upload overrides without requiring callers to republish unchanged fields.

type MediaUploadInput added in v0.51.0

type MediaUploadInput struct {
	MediaUploadRequest
	Reader io.Reader `json:"-"`
}

MediaUploadInput carries the service-layer upload request with a reader-backed payload.

type MediaUploadRequest added in v0.51.0

type MediaUploadRequest struct {
	Name        string         `json:"name,omitempty"`
	FileName    string         `json:"file_name,omitempty"`
	ContentType string         `json:"content_type,omitempty"`
	Size        int64          `json:"size,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

MediaUploadRequest captures transport-layer upload metadata from HTTP callers.

type MediaUploader added in v0.51.0

type MediaUploader interface {
	UploadMedia(ctx context.Context, input MediaUploadInput) (MediaItem, error)
}

MediaUploader stores a new media asset from a reader-backed upload payload.

type MediaValueMode added in v0.51.0

type MediaValueMode string

MediaValueMode defines how media picker fields persist values.

const (
	MediaValueModeURL MediaValueMode = "url"
	MediaValueModeID  MediaValueMode = "id"
)

type MemoryCommandRunStore added in v0.121.3

type MemoryCommandRunStore struct {
	// contains filtered or unexported fields
}

MemoryCommandRunStore is a bounded concurrency-safe current-state projection.

func NewMemoryCommandRunStore added in v0.121.3

func NewMemoryCommandRunStore(config CommandRunMemoryStoreConfig) (*MemoryCommandRunStore, error)

NewMemoryCommandRunStore constructs a bounded default store.

func (*MemoryCommandRunStore) Apply added in v0.121.3

Apply validates and projects one update. Duplicate, stale, equal-revision, and terminal-regressing deliveries return changed=false.

func (*MemoryCommandRunStore) Clear added in v0.121.3

Clear removes only rows visible through the selector. Recent event IDs stay deduplicated so delayed redelivery does not resurrect a cleared row.

func (*MemoryCommandRunStore) ClearCommandRunsIfUnchanged added in v0.124.0

func (s *MemoryCommandRunStore) ClearCommandRunsIfUnchanged(ctx context.Context, selector CommandRunSelector, version uint64) (bool, error)

ClearCommandRunsIfUnchanged clears selector-matching rows only when no store mutation occurred after the supplied snapshot was captured.

func (*MemoryCommandRunStore) Count added in v0.121.3

func (s *MemoryCommandRunStore) Count() int

Count returns the current bounded projection size for diagnostics.

func (*MemoryCommandRunStore) List added in v0.121.3

List returns newest-first isolated rows authorized by the selector.

func (*MemoryCommandRunStore) SnapshotForCommandRunClear added in v0.124.0

func (s *MemoryCommandRunStore) SnapshotForCommandRunClear(ctx context.Context, selector CommandRunSelector) (CommandRunClearSnapshot, error)

SnapshotForCommandRunClear returns a versioned, newest-first candidate set.

type MemoryRepository

type MemoryRepository struct {
	// contains filtered or unexported fields
}

MemoryRepository is an in-memory implementation of Repository for testing/demo.

func NewMemoryRepository

func NewMemoryRepository() *MemoryRepository

NewMemoryRepository constructs a MemoryRepository.

func (*MemoryRepository) Create

func (r *MemoryRepository) Create(_ context.Context, record map[string]any) (map[string]any, error)

Create inserts a new record.

func (*MemoryRepository) Delete

func (r *MemoryRepository) Delete(_ context.Context, id string) error

Delete removes a record by id.

func (*MemoryRepository) Get

func (r *MemoryRepository) Get(_ context.Context, id string) (map[string]any, error)

Get retrieves a record by id.

func (*MemoryRepository) List

func (r *MemoryRepository) List(_ context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns paginated records with simple filtering and sorting.

func (*MemoryRepository) Update

func (r *MemoryRepository) Update(_ context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies an existing record.

type MemoryTranslationExchangeRuntimeStore added in v0.27.0

type MemoryTranslationExchangeRuntimeStore struct {
	// contains filtered or unexported fields
}

MemoryTranslationExchangeRuntimeStore provides a non-persistent runtime store used by tests and fallback wiring.

func NewMemoryTranslationExchangeRuntimeStore added in v0.27.0

func NewMemoryTranslationExchangeRuntimeStore(nowFn func() time.Time) *MemoryTranslationExchangeRuntimeStore

func (*MemoryTranslationExchangeRuntimeStore) ClaimJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) ClaimJob(_ context.Context, jobID, workerID string, now, leaseUntil time.Time) (translationExchangeAsyncJob, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) CommitApplyRecord added in v0.132.1

func (s *MemoryTranslationExchangeRuntimeStore) CommitApplyRecord(_ context.Context, reservation translationExchangeApplyReservation, record translationExchangeAppliedRecord) (translationExchangeAppliedRecord, error)

func (*MemoryTranslationExchangeRuntimeStore) CompleteJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) CompleteJob(_ context.Context, jobID, workerID string, progress, result, retention map[string]any, now time.Time) (translationExchangeAsyncJob, error)

func (*MemoryTranslationExchangeRuntimeStore) CreateJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) CreateJob(_ context.Context, job translationExchangeAsyncJob) (translationExchangeAsyncJob, error)

func (*MemoryTranslationExchangeRuntimeStore) CreateOrGetApplyJob added in v0.132.1

func (s *MemoryTranslationExchangeRuntimeStore) CreateOrGetApplyJob(_ context.Context, identity translationTransportIdentity, job translationExchangeAsyncJob, rows []TranslationExchangeRow) (translationExchangeAsyncJob, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) DeleteJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) DeleteJob(_ context.Context, identity translationTransportIdentity, id string) (translationExchangeAsyncJob, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) FailJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) FailJob(_ context.Context, jobID, workerID string, progress map[string]any, failure error, now time.Time) (translationExchangeAsyncJob, error)

func (*MemoryTranslationExchangeRuntimeStore) FindJobByRequestHash added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) FindJobByRequestHash(_ context.Context, kind string, identity translationTransportIdentity, requestHash string) (translationExchangeAsyncJob, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) GetJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) GetJob(_ context.Context, identity translationTransportIdentity, id string) (translationExchangeAsyncJob, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) HeartbeatJob added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) HeartbeatJob(_ context.Context, jobID, workerID string, progress map[string]any, now, leaseUntil time.Time) error

func (*MemoryTranslationExchangeRuntimeStore) ListJobRows added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) ListJobRows(_ context.Context, jobID string) ([]translationExchangeStoredRow, error)

func (*MemoryTranslationExchangeRuntimeStore) ListJobs added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) ListJobs(_ context.Context, query translationExchangeJobQuery) ([]translationExchangeAsyncJob, int, error)

func (*MemoryTranslationExchangeRuntimeStore) ListRecoverableJobs added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) ListRecoverableJobs(_ context.Context, now time.Time, limit int) ([]translationExchangeAsyncJob, error)

func (*MemoryTranslationExchangeRuntimeStore) LookupApplyRecord added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) LookupApplyRecord(_ context.Context, identity translationTransportIdentity, linkageKey, payloadHash string) (translationExchangeAppliedRecord, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) RecordApplyRecord added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) RecordApplyRecord(_ context.Context, identity translationTransportIdentity, record translationExchangeAppliedRecord) (translationExchangeAppliedRecord, bool, error)

func (*MemoryTranslationExchangeRuntimeStore) ReleaseApplyRecord added in v0.132.1

func (s *MemoryTranslationExchangeRuntimeStore) ReleaseApplyRecord(_ context.Context, reservation translationExchangeApplyReservation) error

func (*MemoryTranslationExchangeRuntimeStore) ReplaceJobArtifacts added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) ReplaceJobArtifacts(_ context.Context, job translationExchangeAsyncJob, artifacts []translationExchangeJobArtifact) error

func (*MemoryTranslationExchangeRuntimeStore) ReserveApplyRecord added in v0.132.1

func (s *MemoryTranslationExchangeRuntimeStore) ReserveApplyRecord(_ context.Context, identity translationTransportIdentity, linkageKey, payloadHash string, now, leaseUntil time.Time) (translationExchangeApplyReservation, translationExchangeAppliedRecord, string, error)

func (*MemoryTranslationExchangeRuntimeStore) SaveJobRows added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) SaveJobRows(_ context.Context, job translationExchangeAsyncJob, rows []TranslationExchangeRow) error

func (*MemoryTranslationExchangeRuntimeStore) UpsertJobRow added in v0.27.0

func (s *MemoryTranslationExchangeRuntimeStore) UpsertJobRow(_ context.Context, jobID string, row translationExchangeStoredRow) error
type Menu = cmsboot.Menu

Menu represents a simple CMS menu tree.

func LocalizeMenu added in v0.52.0

func LocalizeMenu(menu *Menu, t Translator, locale string) *Menu

LocalizeMenu returns a cloned menu tree with labels resolved through the configured translator when available. When no translator is configured it preserves literal labels and does not leak raw label keys into display fields.

type MenuBuilderService struct {
	// contains filtered or unexported fields
}

MenuBuilderService stores admin menu-builder metadata and coordinates menu mutations.

func NewMenuBuilderService added in v0.26.0

func NewMenuBuilderService() *MenuBuilderService
func (s *MenuBuilderService) ArchiveMenu(id string, archived bool) (AdminMenuRecord, error)
func (s *MenuBuilderService) CloneMenu(ctx context.Context, svc CMSMenuService, sourceCode, targetCode string, defaultLocale string) (AdminMenuRecord, error)
func (s *MenuBuilderService) Contracts(endpoints map[string]string) AdminMenuContracts
func (s *MenuBuilderService) CreateMenu(ctx context.Context, svc CMSMenuService, input map[string]any, defaultLocale string) (AdminMenuRecord, error)
func (s *MenuBuilderService) DeleteMenu(id string, force bool) error
func (s *MenuBuilderService) DeleteViewProfile(code string) error
func (s *MenuBuilderService) GetMenu(id string) (AdminMenuRecord, bool)
func (s *MenuBuilderService) GetViewProfile(code string) (AdminMenuViewProfileRecord, bool)
func (s *MenuBuilderService) ListBindings() []AdminMenuBindingRecord
func (s *MenuBuilderService) ListMenus() []AdminMenuRecord
func (s *MenuBuilderService) ListViewProfiles() []AdminMenuViewProfileRecord
func (s *MenuBuilderService) PublishViewProfile(code string, publish bool) (AdminMenuViewProfileRecord, error)
func (s *MenuBuilderService) ResolveBinding(location string, locale string) *AdminMenuBindingRecord
func (s *MenuBuilderService) SetMenuStatus(id, status string) (AdminMenuRecord, error)
func (s *MenuBuilderService) UpdateMenu(id string, input map[string]any) (AdminMenuRecord, error)
func (s *MenuBuilderService) UpsertBinding(location string, input map[string]any) (AdminMenuBindingRecord, error)
func (s *MenuBuilderService) UpsertMenuItems(ctx context.Context, svc CMSMenuService, menuCode string, tree []MenuItem, defaultLocale string) (*Menu, error)
func (s *MenuBuilderService) UpsertViewProfile(code string, input map[string]any) (AdminMenuViewProfileRecord, error)
type MenuContributor = modinternal.MenuContributor

MenuContributor optionally lets a module contribute navigation items.

type MenuHandle = Navigation
type MenuItem = cmsboot.MenuItem

MenuItem describes a single navigation node.

func LocalizeMenuItems added in v0.52.0

func LocalizeMenuItems(items []MenuItem, t Translator, locale string) []MenuItem

LocalizeMenuItems returns a cloned slice of menu items with resolved display labels suitable for public and site consumers.

type MessageFactory added in v0.12.0

type MessageFactory func(payload map[string]any, ids []string) (command.Message, error)

MessageFactory builds typed command messages from request data.

type MissingTranslationsError added in v0.24.0

type MissingTranslationsError struct {
	EntityType              string              `json:"entity_type"`
	PolicyEntity            string              `json:"policy_entity"`
	EntityID                string              `json:"entity_id"`
	Transition              string              `json:"transition"`
	Environment             string              `json:"environment"`
	RequestedLocale         string              `json:"requested_locale"`
	MissingLocales          []string            `json:"missing_locales"`
	MissingFieldsByLocale   map[string][]string `json:"missing_fields_by_locale"`
	RequiredFieldsEvaluated bool                `json:"required_fields_evaluated"`
}

MissingTranslationsError reports which locales are required but absent.

func (MissingTranslationsError) Error added in v0.24.0

func (e MissingTranslationsError) Error() string

func (MissingTranslationsError) Unwrap added in v0.24.0

func (e MissingTranslationsError) Unwrap() error

type Module

type Module interface {
	Manifest() ModuleManifest
	Register(ctx ModuleContext) error
}

Module defines the minimal contract for pluggable slices. Modules should be registered before Admin.Initialize is called.

type ModuleContext

type ModuleContext struct {
	Admin *Admin `json:"admin"`
	// Router is the default module router and is auth-protected when auth is configured.
	Router AdminRouter `json:"router"`
	// ProtectedRouter always wraps routes with admin auth middleware when auth is configured.
	ProtectedRouter AdminRouter `json:"protected_router"`
	// PublicRouter bypasses auth middleware and must be used explicitly for public endpoints.
	PublicRouter AdminRouter `json:"public_router"`
	// AuthMiddleware exposes the admin auth middleware for selective route protection.
	AuthMiddleware router.MiddlewareFunc `json:"auth_middleware"`
	Locale         string                `json:"locale"`
	Translator     Translator            `json:"translator"`
	Routing        routing.ModuleContext `json:"routing"`
	// MountRouters exposes host-authorized named routing surfaces declared in
	// Routing. Modules should resolve paths through Routing.MountRoutePath.
	MountRouters map[string]AdminRouter `json:"-"`
}

ModuleContext is passed to modules so they can register panels, routes, commands, and other contributions against the admin orchestrator.

func (ModuleContext) MountRouter added in v0.119.0

func (c ModuleContext) MountRouter(name string) (AdminRouter, bool)

type ModuleManifest

type ModuleManifest = modinternal.Manifest

ModuleManifest captures identifying metadata and dependencies for a module. Labels/description keys are i18n-friendly and resolved by the host.

type ModuleMountRouterProvider added in v0.119.0

type ModuleMountRouterProvider interface {
	ModuleMountRouter(surface string) (AdminRouter, bool)
}

ModuleMountRouterProvider is implemented by host routers that can resolve a validated routing surface to its concrete registration router.

type ModuleStartupPolicy added in v0.25.0

type ModuleStartupPolicy string

ModuleStartupPolicy controls how startup validation errors are handled.

const (
	// ModuleStartupPolicyEnforce treats module startup validation errors as fatal.
	ModuleStartupPolicyEnforce ModuleStartupPolicy = "enforce"
	// ModuleStartupPolicyWarn logs module startup validation errors and continues.
	ModuleStartupPolicyWarn ModuleStartupPolicy = "warn"
)

type ModuleStartupValidator added in v0.25.0

type ModuleStartupValidator interface {
	ValidateStartup(ctx context.Context) error
}

ModuleStartupValidator can run additional startup checks after module registration.

type MutationFallback added in v0.86.0

type MutationFallback struct {
	Redirect string
	Status   int
	Toast    *EnhancedToast
	JSON     any
}

type MutationPresentation added in v0.86.0

type MutationPresentation struct {
	Version   int                    `json:"version"`
	OK        bool                   `json:"ok"`
	Status    int                    `json:"-"`
	Toasts    []EnhancedToast        `json:"toasts,omitempty"`
	Fragments []EnhancedFragment     `json:"fragments,omitempty"`
	Focus     string                 `json:"focus,omitempty"`
	Redirect  string                 `json:"redirect,omitempty"`
	Error     *EnhancedMutationError `json:"error,omitempty"`
	Meta      map[string]any         `json:"meta,omitempty"`
}

func NewMutationPresentation added in v0.86.0

func NewMutationPresentation(opts ...func(*MutationPresentation)) MutationPresentation
type Navigation = navinternal.Navigation

Navigation resolves menus from CMS or in-memory sources.

func NewNavigation

func NewNavigation(menuSvc CMSMenuService, authorizer Authorizer) *Navigation

NewNavigation builds a navigation helper.

type NavigationClassification = navcontract.Classification
func NavigationClassifications() []NavigationClassification
type NavigationContributionPolicy string
const (
	NavigationContributionPolicyStrict   NavigationContributionPolicy = "strict"
	NavigationContributionPolicyTolerant NavigationContributionPolicy = "tolerant"
)
type NavigationConvergenceCoordinator interface {
	WithNavigationConvergence(ctx context.Context, scope NavigationConvergenceScope, fn func(context.Context) error) error
}
type NavigationConvergenceScope struct {
	MenuCode          string
	Environment       string
	EnvironmentSource string
	EngineIdentity    string
	EngineVersion     string
}
type NavigationCoordinationReport struct {
	Backend   string
	Scope     string
	Supported bool
	Warning   string
}
type NavigationDoctorExpectedItem struct {
	Item               MenuItem
	Owner              NavigationOwner
	OwnerID            string
	Retired            bool
	RouteMissing       bool
	CapabilityOmitted  bool
	PermissionFiltered bool
}
type NavigationDoctorItem = navcontract.ClassifiedItem
type NavigationDoctorOptions struct {
	MenuCode string
	Locale   string
	Expected []NavigationDoctorExpectedItem
}
type NavigationDoctorReport = navcontract.ClassificationReport

func ClassifyNavigation added in v0.90.0

func ClassifyNavigation(expected []NavigationDoctorExpectedItem, rendered, raw []MenuItem) NavigationDoctorReport
type NavigationItem = navinternal.NavigationItem

NavigationItem represents a node in the admin navigation tree.

type NavigationLifecycleReport struct {
	ContributionsClosed        bool                         `json:"contributions_closed"`
	Policy                     NavigationContributionPolicy `json:"policy"`
	ContributionPolicyEnforced bool                         `json:"contribution_policy_enforced"`
	RouteMissingPolicy         NavigationRouteMissingPolicy `json:"route_missing_policy"`
	Environment                string                       `json:"environment"`
	EnvironmentSource          string                       `json:"environment_source"`
	CoordinationBackend        string                       `json:"coordination_backend"`
	CoordinationScope          string                       `json:"coordination_scope"`
	CoordinationSupported      bool                         `json:"coordination_supported"`
	PersistenceBackend         string                       `json:"persistence_backend,omitempty"`
	RawInventoryScope          string                       `json:"raw_inventory_scope,omitempty"`
	RawInventoryBounded        bool                         `json:"raw_inventory_bounded"`
	RawInventoryEnvScoped      bool                         `json:"raw_inventory_env_scoped"`
	SoftDeletedRowsVisible     bool                         `json:"soft_deleted_rows_visible"`
	TransactionalApply         bool                         `json:"transactional_apply"`
	QueuedItems                int                          `json:"queued_items"`
	EngineIdentity             string                       `json:"engine_identity,omitempty"`
	EngineVersion              string                       `json:"engine_version,omitempty"`
	RouteMissingItems          []string                     `json:"route_missing_items,omitempty"`
	RawInventoryErrors         []string                     `json:"raw_inventory_errors,omitempty"`
	CoordinationWarnings       []string                     `json:"coordination_warnings,omitempty"`
	PersistenceWarnings        []string                     `json:"persistence_warnings,omitempty"`
}
type NavigationOwner = navcontract.Owner
type NavigationPermissionDeclaration struct {
	Permission string   `json:"permission"`
	Owner      string   `json:"owner,omitempty"`
	Resource   string   `json:"resource,omitempty"`
	Renames    []string `json:"renames,omitempty"`
}
type NavigationPermissionDeniedMode = navinternal.NavigationPermissionDeniedMode

NavigationPermissionDeniedMode controls how denied navigation entries resolve.

func NormalizeNavigationPermissionDeniedMode added in v0.82.0

func NormalizeNavigationPermissionDeniedMode(mode NavigationPermissionDeniedMode) NavigationPermissionDeniedMode

NormalizeNavigationPermissionDeniedMode returns the canonical navigation permission-denial mode.

type NavigationPermissionRegistry struct {
	// contains filtered or unexported fields
}

func DefaultNavigationPermissionRegistry added in v0.111.0

func DefaultNavigationPermissionRegistry(cfg Config) *NavigationPermissionRegistry

func NewNavigationPermissionRegistry added in v0.111.0

func NewNavigationPermissionRegistry(declarations ...NavigationPermissionDeclaration) *NavigationPermissionRegistry
type NavigationPersistenceReport struct {
	Backend                string
	RawInventoryScope      string
	RawInventoryBounded    bool
	RawInventoryEnvScoped  bool
	SoftDeletedRowsVisible bool
	TransactionalApply     bool
	Warnings               []string
}
type NavigationRawInventoryOptions struct {
	MenuCode          string
	Environment       string
	EnvironmentSource string
}
type NavigationRouteMissingPolicy string
const (
	NavigationRouteMissingPolicyAuto   NavigationRouteMissingPolicy = ""
	NavigationRouteMissingPolicyStrict NavigationRouteMissingPolicy = "strict"
	NavigationRouteMissingPolicyReport NavigationRouteMissingPolicy = "report"
)

type NoopCLIHandler added in v0.12.0

type NoopCLIHandler struct{}

NoopCLIHandler is a placeholder for CLI commands without a dedicated CLI implementation.

func (NoopCLIHandler) Run added in v0.12.0

func (NoopCLIHandler) Run() error

type NoopCMSContainer

type NoopCMSContainer struct {
	// contains filtered or unexported fields
}

NoopCMSContainer returns in-memory services that satisfy the CMS contracts.

func NewNoopCMSContainer

func NewNoopCMSContainer() *NoopCMSContainer

NewNoopCMSContainer builds a container with in-memory services.

func (*NoopCMSContainer) ContentService

func (c *NoopCMSContainer) ContentService() CMSContentService

func (*NoopCMSContainer) ContentTypeService added in v0.23.0

func (c *NoopCMSContainer) ContentTypeService() CMSContentTypeService

func (*NoopCMSContainer) MenuService

func (c *NoopCMSContainer) MenuService() CMSMenuService

func (*NoopCMSContainer) WidgetService

func (c *NoopCMSContainer) WidgetService() CMSWidgetService

type NoopTranslator

type NoopTranslator struct{}

NoopTranslator returns the key unchanged.

func (NoopTranslator) Translate

func (NoopTranslator) Translate(locale, key string, args ...any) (string, error)

func (NoopTranslator) TranslateCount added in v0.52.0

func (NoopTranslator) TranslateCount(locale, key string, count int, args ...any) (string, error)

type Notification

type Notification struct {
	ID        string         `json:"id"`
	Title     string         `json:"title"`
	Message   string         `json:"message"`
	Locale    string         `json:"locale,omitempty"`
	ActionURL string         `json:"action_url,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	UserID    string         `json:"user_id,omitempty"`
	Read      bool           `json:"read"`
	CreatedAt time.Time      `json:"created_at"`
}

Notification represents an inbox item.

type NotificationCapabilityUnavailableError added in v0.130.0

type NotificationCapabilityUnavailableError struct {
	Capability string `json:"capability"`
}

NotificationCapabilityUnavailableError distinguishes an enabled feature whose legacy integration does not expose an optional capability.

func (NotificationCapabilityUnavailableError) Error added in v0.130.0

type NotificationDeliveryInspector added in v0.130.0

type NotificationDeliveryInspector interface {
	GetDelivery(context.Context, deliveries.GetQuery) (deliveries.View, error)
	ListDeliveries(context.Context, deliveries.ListQuery) (deliveries.Page, error)
}

NotificationDeliveryInspector exposes privacy-safe, scope-bound delivery projections from go-notifications.

type NotificationEventService added in v0.130.0

type NotificationEventService interface {
	DispatchWithReceipt(context.Context, notifier.Event) (events.DispatchReceipt, error)
	RetryWithReceipt(context.Context, events.RetryRequest) (events.DispatchReceipt, error)
	RecoverPending(context.Context, int) error
}

NotificationEventService exposes typed event intake and recovery without expanding the legacy inbox-only NotificationService contract.

type NotificationMarkCommand

type NotificationMarkCommand struct {
	Service NotificationService `json:"service"`
}

NotificationMarkCommand toggles read state for notifications via the command bus.

func (*NotificationMarkCommand) Execute

type NotificationMarkMsg added in v0.12.0

type NotificationMarkMsg struct {
	IDs  []string `json:"i_ds"`
	Read bool     `json:"read"`
}

NotificationMarkMsg toggles notification read state.

func (NotificationMarkMsg) Type added in v0.12.0

func (NotificationMarkMsg) Type() string

func (NotificationMarkMsg) Validate added in v0.12.0

func (m NotificationMarkMsg) Validate() error

type NotificationReceiptService added in v0.130.0

type NotificationReceiptService interface {
	LookupReceipt(context.Context, events.ReceiptLookup) (events.DispatchReceipt, error)
}

NotificationReceiptService recovers an existing idempotent receipt without dispatching or otherwise mutating notification state.

type NotificationRetentionPurgeCommand added in v0.130.0

type NotificationRetentionPurgeCommand struct {
	Service  NotificationRetentionService
	Activity ActivitySink
	Logger   Logger
	Metrics  notifstorage.MetricsCollector
	// contains filtered or unexported fields
}

NotificationRetentionPurgeCommand delegates one bounded pass to the configured application service and records only aggregate operational data.

func (*NotificationRetentionPurgeCommand) Execute added in v0.130.0

func (*NotificationRetentionPurgeCommand) Run added in v0.130.0

func (*NotificationRetentionPurgeCommand) WithActivitySink added in v0.130.0

func (c *NotificationRetentionPurgeCommand) WithActivitySink(sink ActivitySink)

WithActivitySink updates the operational activity destination used by future purge executions. It is safe to call while commands are being dispatched.

type NotificationRetentionPurgeMsg added in v0.130.0

type NotificationRetentionPurgeMsg struct {
	retention.Request
	Confirm bool   `json:"confirm"`
	Scope   string `json:"-"`
	ActorID string `json:"-"`
}

NotificationRetentionPurgeMsg carries one confirmed, trusted-scope purge request.

func (NotificationRetentionPurgeMsg) Type added in v0.130.0

func (NotificationRetentionPurgeMsg) Validate added in v0.130.0

func (m NotificationRetentionPurgeMsg) Validate() error

type NotificationRetentionService added in v0.130.0

type NotificationRetentionService interface {
	Purge(context.Context, retention.Request) (retention.Result, error)
}

NotificationRetentionService performs one bounded retention pass.

type NotificationRuntimeOptions added in v0.130.0

type NotificationRuntimeOptions struct {
	Storage         notifstorage.Providers             `json:"storage"`
	Retention       notifstore.RetentionRepository     `json:"retention"`
	DeliveryQueries notifstore.DeliveryQueryRepository `json:"delivery_queries"`
}

NotificationRuntimeOptions configures one coherent go-notifications repository graph. Storage is required when the options are supplied; focused repositories may override the matching entries before validation.

func NewBunNotificationRuntime added in v0.130.0

func NewBunNotificationRuntime(ctx context.Context, db *bun.DB, opts ...notifstorage.Option) (*NotificationRuntimeOptions, error)

NewBunNotificationRuntime builds a coherent persistent notification runtime after the go-notifications migrations have been applied. It fails before provider construction when the required schema is unavailable.

type NotificationService

type NotificationService interface {
	List(ctx context.Context) ([]Notification, error)
	Add(ctx context.Context, n Notification) (Notification, error)
	Mark(ctx context.Context, ids []string, read bool) error
}

NotificationService manages inbox items.

type NotificationsWidgetPayload added in v0.25.0

type NotificationsWidgetPayload struct {
	Notifications []Notification `json:"notifications"`
	Unread        int            `json:"unread"`
}

type ObjectResolverFunc added in v0.22.0

type ObjectResolverFunc func(ctx context.Context, objectType string, ids []string, meta usersactivity.ResolveContext) (map[string]usersactivity.ObjectInfo, error)

ObjectResolverFunc adapts a function into an ObjectResolver.

func (ObjectResolverFunc) ResolveObjects added in v0.22.0

func (f ObjectResolverFunc) ResolveObjects(ctx context.Context, objectType string, ids []string, meta usersactivity.ResolveContext) (map[string]usersactivity.ObjectInfo, error)

ResolveObjects satisfies usersactivity.ObjectResolver.

type ObjectResolverMap added in v0.22.0

type ObjectResolverMap struct {
	Resolvers map[string]usersactivity.ObjectResolver `json:"resolvers"`
	Fallback  usersactivity.ObjectResolver            `json:"fallback"`
}

ObjectResolverMap dispatches object resolution by object type.

func (ObjectResolverMap) ResolveObjects added in v0.22.0

func (m ObjectResolverMap) ResolveObjects(ctx context.Context, objectType string, ids []string, meta usersactivity.ResolveContext) (map[string]usersactivity.ObjectInfo, error)

ResolveObjects resolves objects by type, falling back when needed.

type Option

type Option struct {
	Value    any    `json:"value"`
	Label    string `json:"label"`
	LabelKey string `json:"label_key,omitempty"`
}

Option is a select/choice option.

type OrganizationMember

type OrganizationMember struct {
	UserID      string   `json:"user_id"`
	Roles       []string `json:"roles,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
}

OrganizationMember captures membership assignments for an organization.

type OrganizationPanelRepository

type OrganizationPanelRepository = genericPanelRepository[OrganizationRecord]

OrganizationPanelRepository adapts OrganizationService to the panel Repository contract.

func NewOrganizationPanelRepository

func NewOrganizationPanelRepository(service *OrganizationService) *OrganizationPanelRepository

NewOrganizationPanelRepository constructs a repository backed by OrganizationService.

type OrganizationRecord

type OrganizationRecord struct {
	ID        string               `json:"id"`
	Name      string               `json:"name"`
	Slug      string               `json:"slug,omitempty"`
	Status    string               `json:"status,omitempty"`
	TenantID  string               `json:"tenant_id,omitempty"`
	Members   []OrganizationMember `json:"members,omitempty"`
	Metadata  map[string]any       `json:"metadata,omitempty"`
	CreatedAt time.Time            `json:"created_at"`
	UpdatedAt time.Time            `json:"updated_at"`
}

OrganizationRecord represents an organization managed by the admin.

type OrganizationRepository

type OrganizationRepository interface {
	List(ctx context.Context, opts ListOptions) ([]OrganizationRecord, int, error)
	Get(ctx context.Context, id string) (OrganizationRecord, error)
	Create(ctx context.Context, org OrganizationRecord) (OrganizationRecord, error)
	Update(ctx context.Context, org OrganizationRecord) (OrganizationRecord, error)
	Delete(ctx context.Context, id string) error
	Search(ctx context.Context, query string, limit int) ([]OrganizationRecord, error)
}

OrganizationRepository exposes CRUD/search operations for organizations with membership awareness.

type OrganizationService

type OrganizationService struct {
	// contains filtered or unexported fields
}

OrganizationService orchestrates organization management and activity emission.

func NewOrganizationService

func NewOrganizationService(repo OrganizationRepository) *OrganizationService

NewOrganizationService constructs a service with the provided repository or an in-memory fallback.

func (*OrganizationService) AssignMember

func (s *OrganizationService) AssignMember(ctx context.Context, orgID string, member OrganizationMember) (OrganizationRecord, error)

AssignMember adds or updates an organization membership.

func (*OrganizationService) DeleteOrganization

func (s *OrganizationService) DeleteOrganization(ctx context.Context, id string) error

DeleteOrganization removes an organization by ID.

func (*OrganizationService) GetOrganization

func (s *OrganizationService) GetOrganization(ctx context.Context, id string) (OrganizationRecord, error)

GetOrganization fetches an organization by ID.

func (*OrganizationService) ListOrganizations

func (s *OrganizationService) ListOrganizations(ctx context.Context, opts ListOptions) ([]OrganizationRecord, int, error)

ListOrganizations returns organizations with filters applied.

func (*OrganizationService) RemoveMember

func (s *OrganizationService) RemoveMember(ctx context.Context, orgID, userID string) (OrganizationRecord, error)

RemoveMember detaches a user from an organization.

func (*OrganizationService) SaveOrganization

SaveOrganization creates or updates an organization record.

func (*OrganizationService) SearchOrganizations

func (s *OrganizationService) SearchOrganizations(ctx context.Context, query string, limit int) ([]OrganizationRecord, error)

SearchOrganizations performs a keyword search against organizations.

func (*OrganizationService) WithActivitySink

func (s *OrganizationService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission for organization mutations.

type OrganizationsModule

type OrganizationsModule struct {
	// contains filtered or unexported fields
}

OrganizationsModule registers the organizations panel and navigation.

func NewOrganizationsModule

func NewOrganizationsModule() *OrganizationsModule

NewOrganizationsModule constructs the default organizations module.

func (*OrganizationsModule) Manifest

func (m *OrganizationsModule) Manifest() ModuleManifest

Manifest describes the module metadata.

func (*OrganizationsModule) MenuItems

func (m *OrganizationsModule) MenuItems(locale string) []MenuItem

MenuItems contributes navigation for organizations.

func (*OrganizationsModule) Register

func (m *OrganizationsModule) Register(ctx ModuleContext) error

Register wires the organizations panel and search adapter.

func (*OrganizationsModule) RouteContract added in v0.27.0

func (m *OrganizationsModule) RouteContract() routing.ModuleContract

func (*OrganizationsModule) WithMenuParent

func (m *OrganizationsModule) WithMenuParent(parent string) *OrganizationsModule

WithMenuParent nests organization navigation under a parent menu item ID.

type OwnedCommandRuntimeConfig added in v0.126.8

type OwnedCommandRuntimeConfig struct {
	Executors      map[command.ExecutionMode]dispatcher.CommandExecutor
	Placement      command.PlacementResolver
	Remote         command.RemoteDispatcher
	RunnerDefaults []runner.Option
}

OwnedCommandRuntimeConfig is the explicit execution-capability snapshot inherited by owner-scoped command runtimes.

Queued executors receive an observed context containing the safe command.DispatchRunContext that must be persisted with queued work. Workers rehydrate that value and invoke dispatcher.RunObservedCommand; arbitrary request-context values and raw secrets are not queue payload contracts.

type PageApplicationService added in v0.24.0

type PageApplicationService struct {
	Read              AdminPageReadService  `json:"read"`
	Write             AdminPageWriteService `json:"write"`
	Mapper            PageMapper            `json:"mapper"`
	Workflow          WorkflowEngine        `json:"workflow"`
	TranslationPolicy TranslationPolicy     `json:"translation_policy"`
	IncludeDefaults   *PageReadDefaults     `json:"include_defaults"`
}

PageApplicationService orchestrates admin page reads/writes plus mapping/workflow.

func (PageApplicationService) Create added in v0.24.0

func (s PageApplicationService) Create(ctx context.Context, payload map[string]any) (*AdminPageRecord, error)

Create writes a new page record, applying workflow transitions when configured.

func (PageApplicationService) Delete added in v0.24.0

Delete removes a page record.

func (PageApplicationService) Get added in v0.24.0

Get retrieves a single admin page record using get include defaults.

func (PageApplicationService) List added in v0.24.0

List returns admin page records using list include defaults.

func (PageApplicationService) Publish added in v0.24.0

func (s PageApplicationService) Publish(ctx context.Context, id string, payload map[string]any) (*AdminPageRecord, error)

Publish applies the publish transition before delegating to the write service.

func (PageApplicationService) ToFormValues added in v0.24.0

func (s PageApplicationService) ToFormValues(record AdminPageRecord) map[string]any

ToFormValues maps an admin record into form values.

func (PageApplicationService) Unpublish added in v0.24.0

func (s PageApplicationService) Unpublish(ctx context.Context, id string, payload map[string]any) (*AdminPageRecord, error)

Unpublish applies the unpublish transition before delegating to the write service.

func (PageApplicationService) Update added in v0.24.0

func (s PageApplicationService) Update(ctx context.Context, id string, payload map[string]any) (*AdminPageRecord, error)

Update writes an existing page record, applying workflow transitions when configured.

type PageGetOptions added in v0.24.0

type PageGetOptions struct {
	PageReadOptions
}

PageGetOptions captures get options plus read overrides.

type PageIncludeDefaults added in v0.24.0

type PageIncludeDefaults struct {
	IncludeContent bool `json:"include_content"`
	IncludeBlocks  bool `json:"include_blocks"`
	IncludeData    bool `json:"include_data"`
}

PageIncludeDefaults defines default include flags for read operations.

type PageListOptions added in v0.24.0

type PageListOptions struct {
	PageReadOptions
	Page     int            `json:"page"`
	PerPage  int            `json:"per_page"`
	SortBy   string         `json:"sort_by"`
	SortDesc bool           `json:"sort_desc"`
	Search   string         `json:"search"`
	Filters  map[string]any `json:"filters"`
}

PageListOptions captures list options plus read overrides.

type PageMapper added in v0.24.0

type PageMapper interface {
	ToFormValues(record AdminPageRecord) map[string]any
}

PageMapper centralizes mapping between admin read models and form values.

type PageReadDefaults added in v0.24.0

type PageReadDefaults struct {
	List PageIncludeDefaults `json:"list"`
	Get  PageIncludeDefaults `json:"get"`
}

PageReadDefaults captures include defaults for list/get endpoints.

type PageReadOptions added in v0.24.0

type PageReadOptions struct {
	Locale                   string `json:"locale"`
	FallbackLocale           string `json:"fallback_locale"`
	AllowMissingTranslations bool   `json:"allow_missing_translations"`
	IncludeContent           *bool  `json:"include_content"`
	IncludeBlocks            *bool  `json:"include_blocks"`
	IncludeData              *bool  `json:"include_data"`
	EnvironmentKey           string `json:"environment_key"`
}

PageReadOptions captures caller overrides for read behavior.

type PageTranslation added in v0.24.0

type PageTranslation = cmsinterfaces.PageTranslation

PageTranslation mirrors the go-cms page translation DTO.

type Panel

type Panel struct {
	// contains filtered or unexported fields
}

Panel represents a registered panel.

func RegisterTranslationQueuePanel added in v0.25.0

func RegisterTranslationQueuePanel(admin *Admin, repo TranslationAssignmentRepository) (*Panel, error)

RegisterTranslationQueuePanel registers the translation queue panel.

func (*Panel) Authorizer added in v0.111.0

func (p *Panel) Authorizer() Authorizer

Authorizer returns the authorizer used by panel CRUD operations.

func (*Panel) Breadcrumbs added in v0.27.0

func (p *Panel) Breadcrumbs() PanelBreadcrumbConfig

Breadcrumbs returns the panel breadcrumb contract.

func (*Panel) Create

func (p *Panel) Create(ctx AdminContext, record map[string]any) (map[string]any, error)

Create inserts a record with hooks and permissions.

func (*Panel) Delete

func (p *Panel) Delete(ctx AdminContext, id string) error

Delete removes a record with hooks and permissions.

func (*Panel) EntryMode added in v0.25.0

func (p *Panel) EntryMode() PanelEntryMode

EntryMode returns the canonical panel entry behavior.

func (*Panel) Get

func (p *Panel) Get(ctx AdminContext, id string) (map[string]any, error)

Get returns a single record if permitted.

func (*Panel) List

func (p *Panel) List(ctx AdminContext, opts ListOptions) ([]map[string]any, int, error)

List retrieves records with permissions enforced.

func (*Panel) RunAction

func (p *Panel) RunAction(ctx AdminContext, name string, payload map[string]any, ids []string) (map[string]any, error)

RunAction dispatches a command-backed action.

func (*Panel) RunActionResponse added in v0.27.0

func (p *Panel) RunActionResponse(ctx AdminContext, name string, payload map[string]any, ids []string) (ActionResponse, error)

RunActionResponse dispatches a command-backed action and returns a structured response.

func (*Panel) RunBulkAction

func (p *Panel) RunBulkAction(ctx AdminContext, name string, payload map[string]any, ids []string) error

RunBulkAction dispatches a command-backed bulk action.

func (*Panel) Schema

func (p *Panel) Schema() Schema

Schema returns a basic schema description.

func (*Panel) SchemaWithTheme

func (p *Panel) SchemaWithTheme(theme map[string]map[string]string) Schema

SchemaWithTheme attaches the resolved theme payload for UI renderers.

func (*Panel) ServeSubresource added in v0.25.0

func (p *Panel) ServeSubresource(ctx AdminContext, c router.Context, id, subresource, value string) error

ServeSubresource resolves a panel subresource request.

func (*Panel) Subresources added in v0.25.0

func (p *Panel) Subresources() []PanelSubresource

Subresources returns normalized panel subresource declarations.

func (*Panel) UIRouteMode added in v0.25.0

func (p *Panel) UIRouteMode() PanelUIRouteMode

UIRouteMode returns the panel UI route ownership mode.

func (*Panel) Update

func (p *Panel) Update(ctx AdminContext, id string, record map[string]any) (map[string]any, error)

Update modifies a record with hooks and permissions.

type PanelActionDefaultsMode added in v0.27.0

type PanelActionDefaultsMode string

PanelActionDefaultsMode controls which implicit row/bulk actions are added when rendering panel schema contracts.

const (
	// PanelActionDefaultsModeConservative keeps implicit defaults minimal.
	// Row defaults: view, edit.
	PanelActionDefaultsModeConservative PanelActionDefaultsMode = "conservative"
	// PanelActionDefaultsModeCRUD enables full CRUD defaults.
	// Row defaults: view, edit, delete. Bulk defaults: delete.
	PanelActionDefaultsModeCRUD PanelActionDefaultsMode = "crud"
	// PanelActionDefaultsModeNone disables implicit action defaults.
	PanelActionDefaultsModeNone PanelActionDefaultsMode = "none"
)

type PanelBreadcrumbConfig added in v0.27.0

type PanelBreadcrumbConfig struct {
	ListLabel           string                             `json:"list_label"`
	RootLabel           string                             `json:"root_label"`
	RootHref            string                             `json:"root_href"`
	ShowCurrentOnDetail bool                               `json:"show_current_on_detail"`
	DetailLabelResolver func(record map[string]any) string `json:"detail_label_resolver"`
}

PanelBreadcrumbConfig controls breadcrumb rendering for panel-backed routes.

type PanelBuilder

type PanelBuilder struct {
	// contains filtered or unexported fields
}

PanelBuilder configures a panel before registration.

func NewTranslationQueuePanel added in v0.25.0

func NewTranslationQueuePanel(repo Repository) *PanelBuilder

NewTranslationQueuePanel builds the translation queue panel schema and actions.

func (*PanelBuilder) Actions

func (b *PanelBuilder) Actions(actions ...Action) *PanelBuilder

Actions sets row-level actions.

func (*PanelBuilder) Build

func (b *PanelBuilder) Build() (*Panel, error)

Build finalizes the panel.

func (*PanelBuilder) BulkActions

func (b *PanelBuilder) BulkActions(actions ...Action) *PanelBuilder

BulkActions sets bulk actions.

func (*PanelBuilder) DetailFields

func (b *PanelBuilder) DetailFields(fields ...Field) *PanelBuilder

DetailFields configures detail fields.

func (*PanelBuilder) Filters

func (b *PanelBuilder) Filters(filters ...Filter) *PanelBuilder

Filters sets filters.

func (*PanelBuilder) FormFields

func (b *PanelBuilder) FormFields(fields ...Field) *PanelBuilder

FormFields configures form fields.

func (*PanelBuilder) FormSchema added in v0.23.0

func (b *PanelBuilder) FormSchema(schema map[string]any) *PanelBuilder

FormSchema overrides the generated form schema for the panel.

func (*PanelBuilder) Hooks

func (b *PanelBuilder) Hooks(h PanelHooks) *PanelBuilder

Hooks sets lifecycle hooks.

func (*PanelBuilder) ListFields

func (b *PanelBuilder) ListFields(fields ...Field) *PanelBuilder

ListFields configures list fields.

func (*PanelBuilder) Permissions

func (b *PanelBuilder) Permissions(p PanelPermissions) *PanelBuilder

Permissions sets panel permissions.

func (*PanelBuilder) Subresources added in v0.25.0

func (b *PanelBuilder) Subresources(subresources ...PanelSubresource) *PanelBuilder

Subresources sets panel subresource route declarations.

func (*PanelBuilder) Tabs added in v0.2.0

func (b *PanelBuilder) Tabs(tabs ...PanelTab) *PanelBuilder

Tabs sets owner tabs for the panel.

func (*PanelBuilder) TreeView

func (b *PanelBuilder) TreeView(enabled bool) *PanelBuilder

TreeView toggles hierarchical view.

func (*PanelBuilder) UseBlocks

func (b *PanelBuilder) UseBlocks(enabled bool) *PanelBuilder

UseBlocks enables block editing for CMS-backed panels.

func (*PanelBuilder) UseSEO

func (b *PanelBuilder) UseSEO(enabled bool) *PanelBuilder

UseSEO enables SEO metadata for CMS-backed panels.

func (*PanelBuilder) WithActionDefaults added in v0.27.0

func (b *PanelBuilder) WithActionDefaults(mode PanelActionDefaultsMode) *PanelBuilder

WithActionDefaults configures implicit action defaults for schema/runtime action contracts.

func (*PanelBuilder) WithActionStateResolver added in v0.27.0

func (b *PanelBuilder) WithActionStateResolver(resolver BatchActionStateResolver) *PanelBuilder

WithActionStateResolver attaches a batch resolver for row/detail action state.

func (*PanelBuilder) WithActivitySink

func (b *PanelBuilder) WithActivitySink(sink ActivitySink) *PanelBuilder

WithActivitySink wires the activity sink used to record panel events.

func (*PanelBuilder) WithAuthorizer

func (b *PanelBuilder) WithAuthorizer(a Authorizer) *PanelBuilder

WithAuthorizer sets an authorizer for permission checks.

func (*PanelBuilder) WithBreadcrumbs added in v0.27.0

func (b *PanelBuilder) WithBreadcrumbs(cfg PanelBreadcrumbConfig) *PanelBuilder

WithBreadcrumbs configures package-level breadcrumb defaults for the panel.

func (*PanelBuilder) WithBulkActionStateResolver added in v0.27.0

func (b *PanelBuilder) WithBulkActionStateResolver(resolver BulkActionStateResolver) *PanelBuilder

WithBulkActionStateResolver attaches a resolver for static list bulk action state.

func (*PanelBuilder) WithCRUDService

func (b *PanelBuilder) WithCRUDService(service crud.Service[map[string]any]) *PanelBuilder

WithCRUDService configures the panel to use a go-crud service (Bun-backed).

func (*PanelBuilder) WithCommandBus

func (b *PanelBuilder) WithCommandBus(bus *CommandBus) *PanelBuilder

WithCommandBus attaches the command bus.

func (*PanelBuilder) WithEntryMode added in v0.25.0

func (b *PanelBuilder) WithEntryMode(mode PanelEntryMode) *PanelBuilder

WithEntryMode configures how the panel resolves its canonical entry route.

func (*PanelBuilder) WithRepository

func (b *PanelBuilder) WithRepository(repo Repository) *PanelBuilder

WithRepository sets the panel repository.

func (*PanelBuilder) WithTranslationPolicy added in v0.24.0

func (b *PanelBuilder) WithTranslationPolicy(policy TranslationPolicy) *PanelBuilder

WithTranslationPolicy attaches a translation policy to the panel.

func (*PanelBuilder) WithTranslationQueueAutoCreateHook added in v0.25.0

func (b *PanelBuilder) WithTranslationQueueAutoCreateHook(hook TranslationQueueAutoCreateHook) *PanelBuilder

WithTranslationQueueAutoCreateHook attaches a queue auto-create hook to the panel. When set, workflow transitions blocked by missing translations will automatically create/reuse queue assignments for the missing locales.

func (*PanelBuilder) WithUIRouteMode added in v0.25.0

func (b *PanelBuilder) WithUIRouteMode(mode PanelUIRouteMode) *PanelBuilder

WithUIRouteMode configures whether canonical panel UI routes should be auto-wired.

func (*PanelBuilder) WithWorkflow added in v0.22.0

func (b *PanelBuilder) WithWorkflow(w WorkflowEngine) *PanelBuilder

WithWorkflow attaches a workflow engine to the panel.

func (*PanelBuilder) WithWorkflowAuthorizer added in v0.22.0

func (b *PanelBuilder) WithWorkflowAuthorizer(auth WorkflowAuthorizer) *PanelBuilder

WithWorkflowAuthorizer attaches a workflow authorizer to the panel.

type PanelEntryMode added in v0.25.0

type PanelEntryMode string

PanelEntryMode declares which surface a panel should use as its canonical entry point when the base panel route (for example /admin/<panel>) is opened.

const (
	// PanelEntryModeList renders the panel list/datagrid view.
	PanelEntryModeList PanelEntryMode = "list"
	// PanelEntryModeDetailCurrentUser renders the detail view for the current
	// authenticated user ID from request context.
	PanelEntryModeDetailCurrentUser PanelEntryMode = "detail_current_user"
)

type PanelFormAdapter

type PanelFormAdapter struct {
	ThemeResolver func(context.Context) *ThemeSelection `json:"theme_resolver"`
}

PanelFormAdapter maps panel definitions into a form request, injecting theme tokens and context. This is intentionally light so hosts can pass the payload to go-formgen orchestrators.

func (*PanelFormAdapter) Build

func (a *PanelFormAdapter) Build(panel *Panel, ctx AdminContext, values map[string]any, errors map[string]string) PanelFormRequest

Build assembles a PanelFormRequest for a panel and locale, merging theme payload and provided values/errors.

type PanelFormRequest

type PanelFormRequest struct {
	Schema Schema                       `json:"schema"`
	Values map[string]any               `json:"values"`
	Errors map[string]string            `json:"errors"`
	Locale string                       `json:"locale"`
	Theme  map[string]map[string]string `json:"theme"`
	// RenderTheme carries the typed go-formgen theme contract for in-process
	// renderers. It stays out of the wire payload because AssetURL is a function.
	RenderTheme *formrender.ThemeConfig `json:"-"`
	Metadata    map[string]any          `json:"metadata"`
}

PanelFormRequest captures the data needed to render a panel form via go-formgen.

type PanelHooks

type PanelHooks struct {
	BeforeCreate       func(ctx AdminContext, record map[string]any) error            `json:"before_create"`
	AfterCreate        func(ctx AdminContext, record map[string]any) error            `json:"after_create"`
	BeforeUpdate       func(ctx AdminContext, record map[string]any) error            `json:"before_update"`
	BeforeUpdateWithID func(ctx AdminContext, id string, record map[string]any) error `json:"before_update_with_id"`
	AfterUpdate        func(ctx AdminContext, record map[string]any) error            `json:"after_update"`
	BeforeDelete       func(ctx AdminContext, id string) error                        `json:"before_delete"`
	AfterDelete        func(ctx AdminContext, id string) error                        `json:"after_delete"`
}

PanelHooks contains lifecycle callbacks.

type PanelListCapabilities added in v0.130.0

type PanelListCapabilities struct {
	Selection bool `json:"selection"`
	Bulk      bool `json:"bulk"`
	Export    bool `json:"export"`
}

PanelListCapabilities describes the optional operations supported by a panel list. Selection is derived from operations that consume selected record IDs.

func ResolvePanelListCapabilities added in v0.130.0

func ResolvePanelListCapabilities(bulk, export bool) PanelListCapabilities

ResolvePanelListCapabilities returns a normalized list capability projection.

func (PanelListCapabilities) Normalized added in v0.130.0

Normalized enforces the selection invariant for public callers.

type PanelPermissions

type PanelPermissions struct {
	View   string `json:"view"`
	Create string `json:"create"`
	Edit   string `json:"edit"`
	Delete string `json:"delete"`
}

PanelPermissions declares resource actions.

type PanelSubresource added in v0.25.0

type PanelSubresource struct {
	Name       string `json:"name"`
	Label      string `json:"label,omitempty"`
	Method     string `json:"method,omitempty"`
	Permission string `json:"permission,omitempty"`
}

PanelSubresource defines a panel-owned HTTP subresource endpoint addressable as /:panel/:id/:name/:value.

type PanelSubresourceRepository added in v0.25.0

type PanelSubresourceRepository interface {
	ResolvePanelSubresource(ctx context.Context, id, subresource, value string) (any, error)
}

PanelSubresourceRepository resolves panel subresource payloads. Responses are JSON encoded by the default panel route handler.

type PanelSubresourceResponder added in v0.25.0

type PanelSubresourceResponder interface {
	ServePanelSubresource(ctx AdminContext, c router.Context, id, subresource, value string) error
}

PanelSubresourceResponder writes panel subresource responses directly. This is useful for non-JSON responses such as binary file downloads.

type PanelTab added in v0.2.0

type PanelTab struct {
	ID         string            `json:"id"`
	Label      string            `json:"label,omitempty"`
	LabelKey   string            `json:"label_key,omitempty"`
	Icon       string            `json:"icon,omitempty"`
	Position   int               `json:"position,omitempty"`
	Permission string            `json:"permission,omitempty"`
	Scope      PanelTabScope     `json:"scope,omitempty"`
	Target     PanelTabTarget    `json:"target"`
	Filters    map[string]string `json:"filters,omitempty"`
	Query      map[string]string `json:"query,omitempty"`
	Contexts   []string          `json:"contexts,omitempty"`
}

PanelTab defines panel tab metadata for list/detail/form views.

type PanelTabCollisionHandler added in v0.2.0

type PanelTabCollisionHandler func(panelName string, existing PanelTab, incoming PanelTab) (PanelTab, error)

PanelTabCollisionHandler is invoked when a duplicate tab ID is detected. Return the chosen tab, or an error to abort registration/merge.

type PanelTabPermissionEvaluator added in v0.2.0

type PanelTabPermissionEvaluator func(ctx AdminContext, tab PanelTab, panelName string) bool

PanelTabPermissionEvaluator allows custom permission checks for tabs.

type PanelTabScope added in v0.2.0

type PanelTabScope string

PanelTabScope defines where a tab is intended to render.

const (
	PanelTabScopeList   PanelTabScope = "list"
	PanelTabScopeDetail PanelTabScope = "detail"
	PanelTabScopeForm   PanelTabScope = "form"
)

type PanelTabTarget added in v0.2.0

type PanelTabTarget struct {
	Type  string `json:"type"`            // "panel" | "path" | "external"
	Panel string `json:"panel,omitempty"` // when Type == "panel"
	Path  string `json:"path,omitempty"`  // when Type == "path" or "external"
}

PanelTabTarget describes the navigation target for a tab.

type PanelUIRouteMode added in v0.25.0

type PanelUIRouteMode string

PanelUIRouteMode declares who owns the panel's HTML UI route surface.

const (
	// PanelUIRouteModeCanonical means generic canonical UI routes may be auto-wired.
	PanelUIRouteModeCanonical PanelUIRouteMode = "canonical"
	// PanelUIRouteModeCustom means module-specific handlers own the panel UI routes.
	PanelUIRouteModeCustom PanelUIRouteMode = "custom"
)

type PermissionDeniedError added in v0.8.0

type PermissionDeniedError struct {
	Permission     string `json:"permission"`
	Resource       string `json:"resource"`
	Hint           string `json:"hint"`
	ReauthRequired bool   `json:"reauth_required"`
}

PermissionDeniedError describes a missing authorization permission.

func (PermissionDeniedError) Error added in v0.8.0

func (e PermissionDeniedError) Error() string

func (PermissionDeniedError) Unwrap added in v0.8.0

func (e PermissionDeniedError) Unwrap() error

type PermissionEntry added in v0.25.0

type PermissionEntry struct {
	Permission     string `json:"permission"`
	Required       bool   `json:"required"`
	InClaims       bool   `json:"in_claims"`
	CoveredByGrant bool   `json:"covered_by_grant,omitempty"`
	CoveringGrant  string `json:"covering_grant,omitempty"`
	Allows         bool   `json:"allows"`
	Diagnosis      string `json:"diagnosis"`
	Status         string `json:"status"` // ok, error, warning, info
	Module         string `json:"module,omitempty"`
}

PermissionEntry represents a single permission with its diagnostic status.

type PermissionPolicyFinding added in v0.111.0

type PermissionPolicyFinding struct {
	Permission string   `json:"permission"`
	Owner      string   `json:"owner,omitempty"`
	Resource   string   `json:"resource,omitempty"`
	Missing    []string `json:"missing,omitempty"`
	RenamedBy  string   `json:"renamed_by,omitempty"`
}

type PermissionPolicyReport added in v0.111.0

type PermissionPolicyReport struct {
	Declared int                       `json:"declared"`
	Roles    int                       `json:"roles"`
	Missing  []PermissionPolicyFinding `json:"missing,omitempty"`
	Stale    []PermissionPolicyFinding `json:"stale,omitempty"`
}

type PermissionResolverFunc added in v0.25.0

type PermissionResolverFunc func(context.Context) ([]string, error)

PermissionResolverFunc resolves the effective permission set for a request context.

type PermissionResolverMetrics added in v0.25.0

type PermissionResolverMetrics struct {
	Calls              uint64 `json:"calls"`
	ResolverRuns       uint64 `json:"resolver_runs"`
	CacheHits          uint64 `json:"cache_hits"`
	CacheMisses        uint64 `json:"cache_misses"`
	Errors             uint64 `json:"errors"`
	ContextCacheAbsent uint64 `json:"context_cache_absent"`
}

PermissionResolverMetrics captures resolver/caching behavior counters.

type PermissionsDebugPanel added in v0.25.0

type PermissionsDebugPanel struct {
	// contains filtered or unexported fields
}

PermissionsDebugPanel implements the DebugPanel interface for permissions diagnostics.

func NewPermissionsDebugPanel added in v0.25.0

func NewPermissionsDebugPanel(admin *Admin) *PermissionsDebugPanel

NewPermissionsDebugPanel creates a new permissions debug panel.

func (*PermissionsDebugPanel) Collect added in v0.25.0

func (p *PermissionsDebugPanel) Collect(ctx context.Context) map[string]any

Collect gathers permissions diagnostic data.

func (*PermissionsDebugPanel) ID added in v0.25.0

func (p *PermissionsDebugPanel) ID() string

ID returns the panel identifier.

func (*PermissionsDebugPanel) Icon added in v0.25.0

func (p *PermissionsDebugPanel) Icon() string

Icon returns the panel icon class.

func (*PermissionsDebugPanel) Label added in v0.25.0

func (p *PermissionsDebugPanel) Label() string

Label returns the panel display label.

func (*PermissionsDebugPanel) Span added in v0.25.0

func (p *PermissionsDebugPanel) Span() int

Span returns the panel grid span.

type PermissionsDebugSnapshot added in v0.25.0

type PermissionsDebugSnapshot struct {
	Verdict             string            `json:"verdict"`
	EnabledModules      []string          `json:"enabled_modules"`
	RequiredPermissions map[string]string `json:"required_permissions"` // permission -> module
	ClaimsPermissions   []string          `json:"claims_permissions"`
	PermissionChecks    map[string]bool   `json:"permission_checks"`
	MissingPermissions  []string          `json:"missing_permissions"`
	Entries             []PermissionEntry `json:"entries"`
	Summary             struct {
		ModuleCount  int `json:"module_count"`
		RequiredKeys int `json:"required_keys"`
		ClaimsKeys   int `json:"claims_keys"`
		MissingKeys  int `json:"missing_keys"`
	} `json:"summary"`
	NextActions []string `json:"next_actions"`
	UserInfo    struct {
		UserID   string `json:"user_id,omitempty"`
		Username string `json:"username,omitempty"`
		Role     string `json:"role,omitempty"`
		TenantID string `json:"tenant_id,omitempty"`
		OrgID    string `json:"org_id,omitempty"`
	} `json:"user_info"`
}

PermissionsDebugSnapshot contains the full permissions diagnostic data.

type PersistedWorkflow added in v0.25.0

type PersistedWorkflow = workflowcore.PersistedWorkflow

type PersistedWorkflowListOptions added in v0.25.0

type PersistedWorkflowListOptions = workflowcore.PersistedWorkflowListOptions

type PersistedWorkflowStatus added in v0.25.0

type PersistedWorkflowStatus = workflowcore.PersistedWorkflowStatus

PersistedWorkflowStatus controls rollout state for stored workflow definitions.

type PreferenceLevel added in v0.11.0

type PreferenceLevel string

PreferenceLevel represents the scope level for resolved preferences.

const (
	PreferenceLevelSystem PreferenceLevel = "system"
	PreferenceLevelTenant PreferenceLevel = "tenant"
	PreferenceLevelOrg    PreferenceLevel = "org"
	PreferenceLevelUser   PreferenceLevel = "user"
)

type PreferenceScope added in v0.11.0

type PreferenceScope struct {
	UserID   string `json:"user_id,omitempty"`
	TenantID string `json:"tenant_id,omitempty"`
	OrgID    string `json:"org_id,omitempty"`
}

PreferenceScope captures scope identifiers used during resolution.

type PreferenceSnapshot added in v0.11.0

type PreferenceSnapshot struct {
	Effective map[string]any    `json:"effective"`
	Traces    []PreferenceTrace `json:"traces"`
	Versions  map[string]int    `json:"versions"`
}

PreferenceSnapshot returns effective values plus optional metadata.

type PreferenceTrace added in v0.11.0

type PreferenceTrace struct {
	Key    string                 `json:"key"`
	Layers []PreferenceTraceLayer `json:"layers"`
}

PreferenceTrace records provenance for a single key.

type PreferenceTraceLayer added in v0.11.0

type PreferenceTraceLayer struct {
	Level   PreferenceLevel `json:"level"`
	Scope   PreferenceScope `json:"scope"`
	Found   bool            `json:"found"`
	Value   any             `json:"value,omitempty"`
	Version int             `json:"version,omitempty"`
}

PreferenceTraceLayer records a resolved value at a specific level.

type PreferencesAPICapabilities added in v0.126.6

type PreferencesAPICapabilities struct {
	Available bool `json:"available"`
	Readable  bool `json:"readable"`
	Writable  bool `json:"writable"`
}

PreferencesAPICapabilities describes route and request authorization for the shared Preferences panel.

type PreferencesDeleteInput added in v0.11.0

type PreferencesDeleteInput struct {
	Scope PreferenceScope `json:"scope"`
	Level PreferenceLevel `json:"level"`
	Keys  []string        `json:"keys"`
}

PreferencesDeleteInput represents a scoped preference delete.

type PreferencesModule

type PreferencesModule struct {
	// contains filtered or unexported fields
}

PreferencesModule registers a user preferences panel and navigation entry. It is feature-gated via FeaturePreferences and backed by PreferencesService.

func NewPreferencesModule

func NewPreferencesModule() *PreferencesModule

NewPreferencesModule constructs the default preferences module.

func (*PreferencesModule) Manifest

func (m *PreferencesModule) Manifest() ModuleManifest

func (*PreferencesModule) MenuItems

func (m *PreferencesModule) MenuItems(locale string) []MenuItem

func (*PreferencesModule) Register

func (m *PreferencesModule) Register(ctx ModuleContext) error

func (*PreferencesModule) RouteContract added in v0.27.0

func (m *PreferencesModule) RouteContract() routing.ModuleContract

func (*PreferencesModule) WithBasePath added in v0.24.0

func (m *PreferencesModule) WithBasePath(basePath string) *PreferencesModule

WithBasePath sets the base path used for menu item targets (e.g., /admin).

func (*PreferencesModule) WithJSONEditorStrict added in v0.24.0

func (m *PreferencesModule) WithJSONEditorStrict(strict bool) *PreferencesModule

WithJSONEditorStrict toggles client-side JSON editor strictness.

func (*PreferencesModule) WithMenuParent

func (m *PreferencesModule) WithMenuParent(parent string) *PreferencesModule

WithMenuParent nests the preferences navigation under a parent menu item ID.

func (*PreferencesModule) WithSchemaPath added in v0.24.0

func (m *PreferencesModule) WithSchemaPath(path string) *PreferencesModule

WithSchemaPath overrides the default preferences form schema path.

func (*PreferencesModule) WithSkipMenu added in v0.24.0

func (m *PreferencesModule) WithSkipMenu(skip bool) *PreferencesModule

WithSkipMenu suppresses navigation menu contribution while keeping panel registration.

func (*PreferencesModule) WithViewContextBuilder added in v0.24.0

func (m *PreferencesModule) WithViewContextBuilder(builder PreferencesViewContextBuilder) *PreferencesModule

WithViewContextBuilder injects navigation/session/theme data for the preferences UI.

type PreferencesOption added in v0.20.0

type PreferencesOption func(*PreferencesStoreAdapter)

PreferencesOption customizes the PreferencesStore adapter.

func WithDeleteMissing added in v0.24.0

func WithDeleteMissing(enabled bool) PreferencesOption

WithDeleteMissing controls whether Save deletes persisted keys missing in snapshot.

func WithKeyPrefix added in v0.20.0

func WithKeyPrefix(prefix string) PreferencesOption

WithKeyPrefix overrides the key prefix used for domain names.

func WithKeys added in v0.20.0

func WithKeys(keys ...string) PreferencesOption

WithKeys restricts loads to the provided feature keys (without prefix).

type PreferencesRepository

type PreferencesRepository struct {
	// contains filtered or unexported fields
}

PreferencesRepository adapts PreferencesService to the panel Repository contract.

func NewPreferencesRepository

func NewPreferencesRepository(admin *Admin) *PreferencesRepository

NewPreferencesRepository constructs a repository backed by PreferencesService.

func (*PreferencesRepository) Create

func (r *PreferencesRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

func (*PreferencesRepository) Delete

func (r *PreferencesRepository) Delete(ctx context.Context, id string) error

func (*PreferencesRepository) Get

func (r *PreferencesRepository) Get(ctx context.Context, id string) (map[string]any, error)

func (*PreferencesRepository) List

func (r *PreferencesRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

func (*PreferencesRepository) Update

func (r *PreferencesRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

type PreferencesResolveInput added in v0.11.0

type PreferencesResolveInput struct {
	Scope          PreferenceScope   `json:"scope"`
	Keys           []string          `json:"keys"`
	Levels         []PreferenceLevel `json:"levels"`
	Base           map[string]any    `json:"base"`
	IncludeTraces  bool              `json:"include_traces"`
	IncludeVersion bool              `json:"include_version"`
}

PreferencesResolveInput configures preference resolution.

type PreferencesService

type PreferencesService struct {
	// contains filtered or unexported fields
}

PreferencesService orchestrates access to the PreferencesStore and applies defaults.

func NewPreferencesService

func NewPreferencesService(store PreferencesStore) *PreferencesService

NewPreferencesService constructs a service with the provided store (or in-memory fallback).

func (*PreferencesService) Clear added in v0.10.0

func (s *PreferencesService) Clear(ctx context.Context, userID string, keys []string) (UserPreferences, error)

Clear removes stored preference keys for a user.

func (*PreferencesService) DashboardLayout

func (s *PreferencesService) DashboardLayout(ctx context.Context, userID string) []DashboardWidgetInstance

DashboardLayout returns the stored dashboard layout, if any.

func (*PreferencesService) DashboardOverrides

func (s *PreferencesService) DashboardOverrides(ctx context.Context, userID string) DashboardLayoutOverrides

DashboardOverrides returns persisted go-dashboard layout overrides, if any.

func (*PreferencesService) Get

Get returns preferences for a user with defaults applied.

func (*PreferencesService) Resolve added in v0.11.0

Resolve returns an effective snapshot for the provided scope and options.

func (*PreferencesService) Save

Save updates preferences for a user, merging with existing values.

func (*PreferencesService) SaveDashboardLayout

func (s *PreferencesService) SaveDashboardLayout(ctx context.Context, userID string, layout []DashboardWidgetInstance) (UserPreferences, error)

SaveDashboardLayout stores dashboard layout preferences for a user.

func (*PreferencesService) SaveDashboardOverrides

func (s *PreferencesService) SaveDashboardOverrides(ctx context.Context, userID string, overrides DashboardLayoutOverrides) (UserPreferences, error)

SaveDashboardOverrides stores go-dashboard layout overrides for a user.

func (*PreferencesService) Store

Store returns the underlying preferences store (useful for adapters).

func (*PreferencesService) ThemeSelectorForUser

func (s *PreferencesService) ThemeSelectorForUser(ctx context.Context, userID string) ThemeSelector

ThemeSelectorForUser builds a ThemeSelector using stored preferences when present.

func (*PreferencesService) WithActivitySink

func (s *PreferencesService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission on preference updates.

func (*PreferencesService) WithDefaults

func (s *PreferencesService) WithDefaults(theme, variant string) *PreferencesService

WithDefaults sets the default theme selection used when user preferences are empty.

func (*PreferencesService) WithStore

WithStore swaps the underlying preferences store.

type PreferencesStore

type PreferencesStore interface {
	Resolve(ctx context.Context, input PreferencesResolveInput) (PreferenceSnapshot, error)
	Upsert(ctx context.Context, input PreferencesUpsertInput) (PreferenceSnapshot, error)
	Delete(ctx context.Context, input PreferencesDeleteInput) error
}

PreferencesStore defines the resolver-based preference contract.

type PreferencesStoreAdapter added in v0.20.0

type PreferencesStoreAdapter struct {
	// contains filtered or unexported fields
}

PreferencesStoreAdapter adapts admin.PreferencesStore into a state.Store.

func NewPreferencesStoreAdapter added in v0.20.0

func NewPreferencesStoreAdapter(store PreferencesStore, opts ...PreferencesOption) *PreferencesStoreAdapter

NewPreferencesStoreAdapter constructs a new adapter for PreferencesStore.

func (*PreferencesStoreAdapter) Load added in v0.20.0

Load implements state.Store.

func (*PreferencesStoreAdapter) Save added in v0.20.0

func (a *PreferencesStoreAdapter) Save(ctx context.Context, ref state.Ref, snapshot map[string]any, meta state.Meta) (state.Meta, error)

Save implements state.Store.

type PreferencesUpsertInput added in v0.11.0

type PreferencesUpsertInput struct {
	Scope  PreferenceScope `json:"scope"`
	Level  PreferenceLevel `json:"level"`
	Values map[string]any  `json:"values"`
}

PreferencesUpsertInput represents a scoped preference update.

type PreferencesViewContextBuilder added in v0.24.0

type PreferencesViewContextBuilder func(adm *Admin, c router.Context, view router.ViewContext, active string) router.ViewContext

PreferencesViewContextBuilder augments the view context for the preferences UI.

type PresentedError added in v0.116.0

type PresentedError struct {
	Category         goerrors.Category                `json:"category,omitempty"`
	Code             int                              `json:"code,omitempty"`
	TextCode         string                           `json:"text_code,omitempty"`
	Message          string                           `json:"message,omitempty"`
	ValidationErrors []goerrors.PublicValidationError `json:"validation_errors,omitempty"`
	Metadata         map[string]any                   `json:"metadata,omitempty"`
	RequestID        string                           `json:"request_id,omitempty"`
	Timestamp        time.Time                        `json:"timestamp"`
	Severity         goerrors.Severity                `json:"severity,omitempty"`
	Location         *goerrors.ErrorLocation          `json:"location,omitempty"`
	StackTrace       goerrors.StackTrace              `json:"stack_trace,omitempty"`
}

PresentedError contains the fields go-admin deliberately exposes to API clients. Causes and validation values are never included.

type PreviewService added in v0.22.0

type PreviewService struct {
	// contains filtered or unexported fields
}

PreviewService manages generation and validation of preview tokens.

func NewPreviewService added in v0.22.0

func NewPreviewService(secret string) *PreviewService

NewPreviewService creates a new preview service.

func (*PreviewService) Generate added in v0.22.0

func (s *PreviewService) Generate(entityType, contentID string, duration time.Duration) (string, error)

Generate creates a signed preview token for a record.

func (*PreviewService) GenerateJWT added in v0.22.0

func (s *PreviewService) GenerateJWT(entityType, contentID string, duration time.Duration) (string, error)

GenerateJWT creates a JWT-formatted preview token.

func (*PreviewService) Validate added in v0.22.0

func (s *PreviewService) Validate(tokenString string) (*PreviewToken, error)

Validate parses and verifies a preview token.

type PreviewToken added in v0.22.0

type PreviewToken struct {
	ContentID  string `json:"content_id"`
	EntityType string `json:"entity_type"`
	Expiry     int64  `json:"expiry"`
}

PreviewToken carries metadata for content preview.

type Priority added in v0.25.0

type Priority string

Priority controls assignment urgency.

const (
	PriorityLow    Priority = "low"
	PriorityNormal Priority = "normal"
	PriorityHigh   Priority = "high"
	PriorityUrgent Priority = "urgent"
)

func (Priority) IsValid added in v0.25.0

func (p Priority) IsValid() bool

type ProfileModule

type ProfileModule struct {
	// contains filtered or unexported fields
}

ProfileModule registers a user profile panel and navigation entry. Feature-gated via FeatureProfile and backed by ProfileService.

func NewProfileModule

func NewProfileModule() *ProfileModule

NewProfileModule constructs the default profile module.

func (*ProfileModule) Manifest

func (m *ProfileModule) Manifest() ModuleManifest

func (*ProfileModule) MenuItems

func (m *ProfileModule) MenuItems(locale string) []MenuItem

func (*ProfileModule) Register

func (m *ProfileModule) Register(ctx ModuleContext) error

func (*ProfileModule) RouteContract added in v0.27.0

func (m *ProfileModule) RouteContract() routing.ModuleContract

func (*ProfileModule) WithMenuParent

func (m *ProfileModule) WithMenuParent(parent string) *ProfileModule

WithMenuParent nests the profile navigation under a parent menu item ID.

func (*ProfileModule) WithSkipMenu added in v0.24.0

func (m *ProfileModule) WithSkipMenu(skip bool) *ProfileModule

WithSkipMenu suppresses navigation menu contribution while keeping panel registration.

type ProfileRepository

type ProfileRepository struct {
	// contains filtered or unexported fields
}

ProfileRepository adapts ProfileService to the panel Repository contract.

func NewProfileRepository

func NewProfileRepository(service *ProfileService, defaultLocale string) *ProfileRepository

NewProfileRepository constructs a repository backed by ProfileService.

func (*ProfileRepository) Create

func (r *ProfileRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

func (*ProfileRepository) Delete

func (r *ProfileRepository) Delete(ctx context.Context, id string) error

func (*ProfileRepository) Get

func (r *ProfileRepository) Get(ctx context.Context, id string) (map[string]any, error)

func (*ProfileRepository) List

func (r *ProfileRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

func (*ProfileRepository) Update

func (r *ProfileRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

type ProfileService

type ProfileService struct {
	// contains filtered or unexported fields
}

ProfileService orchestrates profile retrieval and persistence.

func NewProfileService

func NewProfileService(store ProfileStore) *ProfileService

NewProfileService constructs a service with the provided store (or in-memory fallback).

func (*ProfileService) Get

func (s *ProfileService) Get(ctx context.Context, userID string) (UserProfile, error)

Get returns the profile for a user, applying defaults.

func (*ProfileService) Save

func (s *ProfileService) Save(ctx context.Context, userID string, profile UserProfile) (UserProfile, error)

Save merges and persists a profile for a user.

func (*ProfileService) Store

func (s *ProfileService) Store() ProfileStore

Store exposes the underlying profile store (useful for adapters).

func (*ProfileService) WithActivitySink

func (s *ProfileService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission on profile updates.

func (*ProfileService) WithStore

func (s *ProfileService) WithStore(store ProfileStore) *ProfileService

WithStore swaps the underlying profile store.

type ProfileStore

type ProfileStore interface {
	Get(ctx context.Context, userID string) (UserProfile, error)
	Save(ctx context.Context, profile UserProfile) (UserProfile, error)
}

ProfileStore persists profile data.

type ProtectedSurfaceScope added in v0.58.0

type ProtectedSurfaceScope string
const (
	ProtectedSurfaceScopeAdmin        ProtectedSurfaceScope = "admin"
	ProtectedSurfaceScopeProtectedApp ProtectedSurfaceScope = "protected_app"
)

type QuickActionWidgetPayload added in v0.25.0

type QuickActionWidgetPayload struct {
	Label       string `json:"label"`
	URL         string `json:"url"`
	Icon        string `json:"icon,omitempty"`
	Method      string `json:"method,omitempty"`
	Description string `json:"description,omitempty"`
}

type QuickActionsWidgetPayload added in v0.25.0

type QuickActionsWidgetPayload struct {
	Actions []QuickActionWidgetPayload `json:"actions"`
}

type RPCCommandConfig added in v0.27.0

type RPCCommandConfig struct {
	DiscoveryEnabled  bool                      `json:"discovery_enabled,omitempty"`
	PermissionMode    RPCCommandPermissionMode  `json:"permission_mode,omitempty"`
	Commands          map[string]RPCCommandRule `json:"commands,omitempty"`
	MetadataAllowlist []string                  `json:"metadata_allowlist,omitempty"`
}

RPCCommandConfig controls command RPC exposure and authorization behavior.

func (RPCCommandConfig) ResolveRule added in v0.27.0

func (c RPCCommandConfig) ResolveRule(commandName string) (RPCCommandRule, bool)

ResolveRule returns the configured rule for the given command id.

type RPCCommandDispatchRequest added in v0.27.0

type RPCCommandDispatchRequest = command.CommandDispatchRequest

RPCCommandDispatchRequest is a compatibility alias for the canonical go-command generic dispatch payload.

type RPCCommandDispatchResponse added in v0.27.0

type RPCCommandDispatchResponse = command.CommandDispatchResponse

RPCCommandDispatchResponse is a compatibility alias for the canonical go-command generic dispatch response.

type RPCCommandListResponse added in v0.27.0

type RPCCommandListResponse struct {
	Commands []string `json:"commands,omitempty"`
}

RPCCommandListResponse describes available command names.

type RPCCommandPermissionMode added in v0.89.0

type RPCCommandPermissionMode string

RPCCommandPermissionMode selects how RPC command permissions are evaluated.

const (
	// RPCCommandPermissionModeResourceRole uses the configured Authorizer's
	// resource/action semantics. This preserves the historical behavior where
	// permissions such as admin.posts.publish can authorize through an edit role
	// on the posts resource.
	RPCCommandPermissionModeResourceRole RPCCommandPermissionMode = "resource_role"
	// RPCCommandPermissionModeExact requires the exact permission string to be
	// present in the authorizer's resolved permission set.
	RPCCommandPermissionModeExact RPCCommandPermissionMode = "exact"
)

type RPCCommandPolicyHook added in v0.27.0

type RPCCommandPolicyHook func(context.Context, RPCCommandPolicyInput) error

RPCCommandPolicyHook runs host-level business rule checks for allowed RPC commands.

type RPCCommandPolicyInput added in v0.27.0

type RPCCommandPolicyInput struct {
	Method         string                  `json:"method,omitempty"`
	CommandName    string                  `json:"command_name,omitempty"`
	Payload        map[string]any          `json:"payload,omitempty"`
	IDs            []string                `json:"ids,omitempty"`
	Rule           RPCCommandRule          `json:"rule"`
	Dispatch       command.DispatchOptions `json:"dispatch"`
	ActorID        string                  `json:"actor_id,omitempty"`
	Subject        string                  `json:"subject,omitempty"`
	TenantID       string                  `json:"tenant_id,omitempty"`
	OrganizationID string                  `json:"organization_id,omitempty"`
	RequestID      string                  `json:"request_id,omitempty"`
	CorrelationID  string                  `json:"correlation_id,omitempty"`
	Metadata       map[string]any          `json:"metadata,omitempty"`
}

RPCCommandPolicyInput contains trusted request data used by host business-rule checks.

type RPCCommandRule added in v0.27.0

type RPCCommandRule struct {
	Permission           string                   `json:"permission,omitempty"`
	Resource             string                   `json:"resource,omitempty"`
	PermissionMode       RPCCommandPermissionMode `json:"permission_mode,omitempty"`
	AllowUnauthenticated bool                     `json:"allow_unauthenticated,omitempty"`
}

RPCCommandRule maps a command id to the permission/resource required for RPC dispatch.

func DefaultTranslationSuggestionRPCCommandRule added in v0.110.0

func DefaultTranslationSuggestionRPCCommandRule() RPCCommandRule

DefaultTranslationSuggestionRPCCommandRule returns the default RPC exposure rule for translation suggestion generation.

type RateLimiter added in v0.23.0

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter provides simple rate limiting for schema validation endpoints

func DefaultSchemaRateLimiter added in v0.23.0

func DefaultSchemaRateLimiter() *RateLimiter

DefaultSchemaRateLimiter returns a rate limiter with default settings (30 requests per minute per client)

func NewRateLimiter added in v0.23.0

func NewRateLimiter(maxRequests int, window time.Duration) *RateLimiter

NewRateLimiter creates a rate limiter with the specified limits

func (*RateLimiter) Allow added in v0.23.0

func (r *RateLimiter) Allow(key string) bool

Allow checks if a request from the given key should be allowed

func (*RateLimiter) Cleanup added in v0.23.0

func (r *RateLimiter) Cleanup()

Cleanup removes expired entries from the rate limiter

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry stores registered panels, modules, dashboard providers, and settings.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

func (*Registry) DashboardProviders

func (r *Registry) DashboardProviders() []DashboardProviderSpec

DashboardProviders returns provider specs sorted by code.

func (*Registry) Module

func (r *Registry) Module(id string) (Module, bool)

Module returns a module by ID when present.

func (*Registry) Modules

func (r *Registry) Modules() []Module

Modules returns modules in registration order.

func (*Registry) Panel

func (r *Registry) Panel(name string) (*Panel, bool)

Panel returns a single panel by name.

func (*Registry) PanelTabs added in v0.2.0

func (r *Registry) PanelTabs(panelName string) []PanelTab

PanelTabs returns registered tabs for a panel, ordered by position then ID.

func (*Registry) Panels

func (r *Registry) Panels() map[string]*Panel

Panels returns a copy of registered panels keyed by name.

func (*Registry) RegisterDashboardProvider

func (r *Registry) RegisterDashboardProvider(spec DashboardProviderSpec)

RegisterDashboardProvider records a provider manifest for discovery/lookups.

func (*Registry) RegisterModule

func (r *Registry) RegisterModule(module Module) error

RegisterModule records a module in registration order; duplicate IDs are rejected.

func (*Registry) RegisterPanel

func (r *Registry) RegisterPanel(name string, panel *Panel) error

RegisterPanel stores a panel by name; duplicate names are rejected.

func (*Registry) RegisterPanelTab added in v0.2.0

func (r *Registry) RegisterPanelTab(panelName string, tab PanelTab) error

RegisterPanelTab records a panel tab for the named panel.

func (*Registry) RegisterSetting

func (r *Registry) RegisterSetting(def SettingDefinition)

RegisterSetting tracks a setting definition for lookups.

func (*Registry) SetPanelTab added in v0.2.0

func (r *Registry) SetPanelTab(panelName string, tab PanelTab) error

SetPanelTab upserts a panel tab for the named panel.

func (*Registry) Settings

func (r *Registry) Settings() []SettingDefinition

Settings returns registered setting definitions sorted by key.

func (*Registry) UnregisterPanel added in v0.23.0

func (r *Registry) UnregisterPanel(name string) error

UnregisterPanel removes a panel by name and clears associated tab registrations.

func (*Registry) UpsertPanel added in v0.36.0

func (r *Registry) UpsertPanel(name string, panel *Panel) error

UpsertPanel stores or replaces a panel by name.

func (*Registry) WithLogger added in v0.25.0

func (r *Registry) WithLogger(logger Logger) *Registry

WithLogger sets the registry logger used for runtime diagnostics.

type Repository

type Repository interface {
	List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)
	Get(ctx context.Context, id string) (map[string]any, error)
	Create(ctx context.Context, record map[string]any) (map[string]any, error)
	Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)
	Delete(ctx context.Context, id string) error
}

Repository provides CRUD operations for panel data.

type RepositoryTranslationCreator added in v0.25.0

type RepositoryTranslationCreator interface {
	CreateTranslation(ctx context.Context, input TranslationCreateInput) (map[string]any, error)
}

RepositoryTranslationCreator allows repositories to provide a first-class translation creation command.

type RequestAuthenticator added in v0.48.0

type RequestAuthenticator interface {
	AuthenticateRequest(c router.Context) error
}

RequestAuthenticator performs request authentication without relying on browser-oriented redirect handlers. This is required for transports like WebSocket upgrades where redirects are not a valid auth response.

type RequestEntry added in v0.14.0

type RequestEntry struct {
	ID              string            `json:"id"`
	Timestamp       time.Time         `json:"timestamp"`
	SessionID       string            `json:"session_id,omitempty"`
	UserID          string            `json:"user_id,omitempty"`
	Method          string            `json:"method"`
	Path            string            `json:"path"`
	Status          int               `json:"status"`
	Duration        time.Duration     `json:"duration"`
	Headers         map[string]string `json:"headers,omitempty"`
	Query           map[string]string `json:"query,omitempty"`
	ContentType     string            `json:"content_type,omitempty"`
	RequestBody     string            `json:"request_body,omitempty"`
	RequestSize     int64             `json:"request_size,omitempty"`
	BodyTruncated   bool              `json:"body_truncated,omitempty"`
	ResponseHeaders map[string]string `json:"response_headers,omitempty"`
	ResponseBody    string            `json:"response_body,omitempty"`
	ResponseSize    int64             `json:"response_size,omitempty"`
	RemoteIP        string            `json:"remote_ip,omitempty"`
	Error           string            `json:"error,omitempty"`
}

RequestEntry captures HTTP request details.

type RequestInfo added in v0.24.0

type RequestInfo struct {
	Method      string            `json:"method"`
	Path        string            `json:"path"`
	FullURL     string            `json:"full_url,omitempty"`
	Headers     map[string]string `json:"headers,omitempty"`
	QueryParams map[string]string `json:"query_params,omitempty"`
	FormData    map[string]string `json:"form_data,omitempty"`
	Body        string            `json:"body,omitempty"`
	ContentType string            `json:"content_type,omitempty"`
	RemoteIP    string            `json:"remote_ip,omitempty"`
	UserAgent   string            `json:"user_agent,omitempty"`
}

RequestInfo holds HTTP request details.

type RequiredFieldsValidationStrategy added in v0.24.0

type RequiredFieldsValidationStrategy = cmsinterfaces.RequiredFieldsValidationStrategy

RequiredFieldsValidationStrategy mirrors go-cms required field validation strategy.

type ResolveOptions added in v0.82.0

type ResolveOptions = navinternal.ResolveOptions

ResolveOptions controls navigation resolution behavior.

type ResolveResult added in v0.82.0

type ResolveResult = navinternal.ResolveResult

ResolveResult carries resolved navigation items plus source diagnostics.

type ResolveSource added in v0.82.0

type ResolveSource = navinternal.ResolveSource

ResolveSource identifies which backing source produced a navigation result.

type ResolvedSetting

type ResolvedSetting struct {
	Key        string            `json:"key"`
	Value      any               `json:"value"`
	Scope      SettingsScope     `json:"scope"`
	Provenance string            `json:"provenance"`
	Definition SettingDefinition `json:"definition"`
}

ResolvedSetting contains a resolved value and provenance.

type ResolverActivityPageEnricherConfig added in v0.133.0

type ResolverActivityPageEnricherConfig struct {
	ActorResolver  usersactivity.ActorResolver
	ObjectResolver usersactivity.ObjectResolver
	HintPolicy     ActivityDisplayHintPolicy
	ActionLabels   map[string]string
}

ResolverActivityPageEnricherConfig wires generic batch resolvers into the Activity page enrichment contract.

type ResultDispatchFactory added in v0.88.0

type ResultDispatchFactory func(ctx context.Context, payload map[string]any, ids []string, opts command.DispatchOptions) (command.DispatchReceipt, any, error)

ResultDispatchFactory executes a typed dispatch and returns an inline result when available.

type RingBuffer added in v0.14.0

type RingBuffer[T any] struct {
	// contains filtered or unexported fields
}

RingBuffer stores the most recent values up to a fixed capacity.

func NewRingBuffer added in v0.14.0

func NewRingBuffer[T any](capacity int) *RingBuffer[T]

NewRingBuffer creates a ring buffer with the provided capacity.

func (*RingBuffer[T]) Add added in v0.14.0

func (r *RingBuffer[T]) Add(value T)

Add appends a value, overwriting the oldest when full.

func (*RingBuffer[T]) Cap added in v0.14.0

func (r *RingBuffer[T]) Cap() int

Cap returns the buffer capacity.

func (*RingBuffer[T]) Clear added in v0.14.0

func (r *RingBuffer[T]) Clear()

Clear removes all buffered values.

func (*RingBuffer[T]) Len added in v0.14.0

func (r *RingBuffer[T]) Len() int

Len returns the current number of stored values.

func (*RingBuffer[T]) Values added in v0.14.0

func (r *RingBuffer[T]) Values() []T

Values returns the buffered values ordered from oldest to newest.

type RoleAssignmentLookup added in v0.2.0

type RoleAssignmentLookup interface {
	IsAssignable(ctx context.Context, roleID string) (bool, error)
}

RoleAssignmentLookup decides whether a role ID should be treated as an assignable custom role.

type RolePanelRepository

type RolePanelRepository = genericPanelRepository[RoleRecord]

RolePanelRepository adapts roles to the panel Repository contract.

func NewRolePanelRepository

func NewRolePanelRepository(service *UserManagementService) *RolePanelRepository

NewRolePanelRepository constructs a repository backed by UserManagementService roles.

type RoleRecord

type RoleRecord struct {
	ID          string         `json:"id"`
	Name        string         `json:"name"`
	RoleKey     string         `json:"role_key"`
	Description string         `json:"description"`
	Permissions []string       `json:"permissions"`
	Metadata    map[string]any `json:"metadata"`
	IsSystem    bool           `json:"is_system"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

RoleRecord captures custom roles and their permissions.

type RoleRepository

type RoleRepository interface {
	List(ctx context.Context, opts ListOptions) ([]RoleRecord, int, error)
	Get(ctx context.Context, id string) (RoleRecord, error)
	Create(ctx context.Context, role RoleRecord) (RoleRecord, error)
	Update(ctx context.Context, role RoleRecord) (RoleRecord, error)
	Delete(ctx context.Context, id string) error
	Assign(ctx context.Context, userID, roleID string) error
	Unassign(ctx context.Context, userID, roleID string) error
	RolesForUser(ctx context.Context, userID string) ([]RoleRecord, error)
}

RoleRepository exposes CRUD and assignment helpers for custom roles.

type RoleRepositoryLookup added in v0.2.0

type RoleRepositoryLookup struct {
	Roles RoleRepository `json:"roles"`
}

RoleRepositoryLookup uses a RoleRepository to validate assignable IDs.

func (RoleRepositoryLookup) IsAssignable added in v0.2.0

func (l RoleRepositoryLookup) IsAssignable(ctx context.Context, roleID string) (bool, error)

type RoleWorkflowAuthorizer added in v0.24.0

type RoleWorkflowAuthorizer struct {
	MinRole    string                                                `json:"min_role"`
	Resource   string                                                `json:"resource"`
	Permission string                                                `json:"permission"`
	Extra      func(context.Context, WorkflowApplyEventRequest) bool `json:"extra"`
}

RoleWorkflowAuthorizer enforces minimum role requirements and optional permission checks.

func (*RoleWorkflowAuthorizer) CanApplyEvent added in v0.26.0

CanApplyEvent validates the workflow transition against role + optional permission checks.

type RoleWorkflowAuthorizerOption added in v0.24.0

type RoleWorkflowAuthorizerOption func(*RoleWorkflowAuthorizer)

RoleWorkflowAuthorizerOption customizes a RoleWorkflowAuthorizer.

func WithWorkflowExtraCheck added in v0.24.0

WithWorkflowExtraCheck adds an extra custom check for workflow transitions.

func WithWorkflowPermission added in v0.24.0

func WithWorkflowPermission(resource, permission string) RoleWorkflowAuthorizerOption

WithWorkflowPermission adds a permission check using authlib.Can.

type RouteContractProvider added in v0.27.0

type RouteContractProvider interface {
	RouteContract() routing.ModuleContract
}

RouteContractProvider exposes the explicit routing contract required for mounted modules.

type RouteEntry added in v0.14.0

type RouteEntry struct {
	Method     string   `json:"method"`
	Path       string   `json:"path"`
	Name       string   `json:"name,omitempty"`
	Handler    string   `json:"handler,omitempty"`
	Middleware []string `json:"middleware,omitempty"`
	Summary    string   `json:"summary,omitempty"`
	Tags       []string `json:"tags,omitempty"`
}

RouteEntry captures router information for the routes panel.

type RouterContext

type RouterContext interface {
	Query(name string, defaultValue ...string) string
	Header(string) string
}

type SQLEntry added in v0.14.0

type SQLEntry struct {
	ID        string        `json:"id"`
	Timestamp time.Time     `json:"timestamp"`
	SessionID string        `json:"session_id,omitempty"`
	UserID    string        `json:"user_id,omitempty"`
	Query     string        `json:"query"`
	Args      []any         `json:"args,omitempty"`
	Duration  time.Duration `json:"duration"`
	RowCount  int           `json:"row_count"`
	Error     string        `json:"error,omitempty"`
}

SQLEntry captures database query details.

type Schema

type Schema struct {
	ListFields            []Field                      `json:"list_fields"`
	FormFields            []Field                      `json:"form_fields"`
	DetailFields          []Field                      `json:"detail_fields"`
	Filters               []Filter                     `json:"filters,omitempty"`
	Actions               []Action                     `json:"actions,omitempty"`
	BulkActions           []Action                     `json:"bulk_actions,omitempty"`
	BulkActionStateConfig *BulkActionStateConfig       `json:"bulk_action_state_config,omitempty"`
	Subresources          []PanelSubresource           `json:"subresources,omitempty"`
	Tabs                  []PanelTab                   `json:"tabs,omitempty"`
	FormSchema            map[string]any               `json:"form_schema,omitempty"`
	UseBlocks             bool                         `json:"use_blocks,omitempty"`
	UseSEO                bool                         `json:"use_seo,omitempty"`
	TreeView              bool                         `json:"tree_view,omitempty"`
	Permissions           PanelPermissions             `json:"permissions"`
	Theme                 map[string]map[string]string `json:"theme,omitempty"`
	Export                *ExportConfig                `json:"export,omitempty"`
	Bulk                  *BulkConfig                  `json:"bulk,omitempty"`
	Media                 *MediaConfig                 `json:"media,omitempty"`
}

Schema renders list/form/detail schema descriptions.

type SchemaGuardrails added in v0.23.0

type SchemaGuardrails struct {
	MaxSizeBytes            int             `json:"max_size_bytes"`
	MaxFields               int             `json:"max_fields"`
	MaxDepth                int             `json:"max_depth"`
	UISchemaMaxSizeBytes    int             `json:"ui_schema_max_size_bytes"`
	PreviewHTMLMaxSizeBytes int             `json:"preview_html_max_size_bytes"`
	ReservedFields          map[string]bool `json:"reserved_fields"`
}

SchemaGuardrails provides validation and security checks for content type schemas

func NewSchemaGuardrails added in v0.23.0

func NewSchemaGuardrails() *SchemaGuardrails

NewSchemaGuardrails creates guardrails with default limits

func (*SchemaGuardrails) IsReservedFieldName added in v0.23.0

func (g *SchemaGuardrails) IsReservedFieldName(name string) bool

IsReservedFieldName checks if a field name is reserved

func (*SchemaGuardrails) ValidatePreviewHTML added in v0.23.0

func (g *SchemaGuardrails) ValidatePreviewHTML(html []byte) error

ValidatePreviewHTML checks generated HTML size limits

func (*SchemaGuardrails) ValidateSchema added in v0.23.0

func (g *SchemaGuardrails) ValidateSchema(schema map[string]any) (*SchemaValidationResult, error)

ValidateSchema performs comprehensive schema validation

func (*SchemaGuardrails) ValidateUISchema added in v0.23.0

func (g *SchemaGuardrails) ValidateUISchema(uiSchema map[string]any, jsonSchema map[string]any) error

ValidateUISchema validates UI schema overlay format and JSON Pointer targets

type SchemaGuardrailsOption added in v0.23.0

type SchemaGuardrailsOption func(*SchemaGuardrails)

SchemaGuardrailsOption configures guardrails

func WithSchemaMaxDepth added in v0.23.0

func WithSchemaMaxDepth(depth int) SchemaGuardrailsOption

WithSchemaMaxDepth sets the maximum nesting depth

func WithSchemaMaxFields added in v0.23.0

func WithSchemaMaxFields(count int) SchemaGuardrailsOption

WithSchemaMaxFields sets the maximum number of fields

func WithSchemaMaxSize added in v0.23.0

func WithSchemaMaxSize(bytes int) SchemaGuardrailsOption

WithSchemaMaxSize sets the maximum schema size in bytes

type SchemaPreviewFallback added in v0.24.0

type SchemaPreviewFallback func(ctx AdminContext, schema map[string]any, opts SchemaValidationOptions, err error) (html string, handled bool)

SchemaPreviewFallback renders preview HTML when preview generation fails.

type SchemaPreviewer added in v0.23.0

type SchemaPreviewer interface {
	Preview(ctx context.Context, schema map[string]any, opts SchemaValidationOptions) ([]byte, error)
}

SchemaPreviewer renders preview output for a schema.

type SchemaRegistryEntry added in v0.23.0

type SchemaRegistryEntry struct {
	Resource     string         `json:"resource"`
	Plural       string         `json:"plural,omitempty"`
	SchemaFormat string         `json:"schema_format"`
	Document     map[string]any `json:"document"`
	UpdatedAt    time.Time      `json:"updated_at"`
}

SchemaRegistryEntry captures a projected schema document from the registry.

type SchemaRegistryPayload added in v0.23.0

type SchemaRegistryPayload struct {
	Schemas []SchemaRegistryEntry `json:"schemas"`
}

SchemaRegistryPayload wraps schema registry entries for UI consumption.

type SchemaToFieldsConverter added in v0.23.0

type SchemaToFieldsConverter struct {
	// contains filtered or unexported fields
}

SchemaToFieldsConverter maps JSON Schema properties into panel field definitions.

func NewSchemaToFieldsConverter added in v0.23.0

func NewSchemaToFieldsConverter() *SchemaToFieldsConverter

NewSchemaToFieldsConverter builds a converter with default mappings.

func (*SchemaToFieldsConverter) Convert added in v0.23.0

func (c *SchemaToFieldsConverter) Convert(schema map[string]any, uiSchema map[string]any) ConvertedFields

Convert maps a JSON schema + UI overlay into panel fields.

type SchemaValidationOptions added in v0.23.0

type SchemaValidationOptions struct {
	Slug     string         `json:"slug"`
	FormID   string         `json:"form_id"`
	UISchema map[string]any `json:"ui_schema"`
}

SchemaValidationOptions captures schema validation/preview context.

type SchemaValidationResult added in v0.23.0

type SchemaValidationResult struct {
	Valid      bool              `json:"valid"`
	FieldCount int               `json:"field_count,omitempty"`
	MaxDepth   int               `json:"max_depth,omitempty"`
	SizeBytes  int               `json:"size_bytes,omitempty"`
	Errors     map[string]string `json:"errors,omitempty"`
}

SchemaValidationResult holds validation results

type SchemaValidator added in v0.23.0

type SchemaValidator interface {
	Validate(ctx context.Context, schema map[string]any, opts SchemaValidationOptions) error
}

SchemaValidator validates JSON schema input for content types.

type ScopeInput added in v0.83.0

type ScopeInput struct {
	TenantID string `json:"tenant_id"`
	OrgID    string `json:"org_id"`
}

ScopeInput carries trusted scope values supplied by a service path.

type ScopePolicy added in v0.83.0

type ScopePolicy struct {
	Mode            ScopePolicyMode `json:"mode"`
	DefaultTenantID string          `json:"default_tenant_id"`
	DefaultOrgID    string          `json:"default_org_id"`
}

ScopePolicy captures the go-admin tenant/org scope policy.

type ScopePolicyMode added in v0.83.0

type ScopePolicyMode string

ScopePolicyMode controls how effective tenant/org scope is resolved.

const (
	ScopePolicySingle ScopePolicyMode = "single"
	ScopePolicyMulti  ScopePolicyMode = "multi"
)

type SearchAdapter

type SearchAdapter interface {
	Search(ctx context.Context, query string, limit int) ([]SearchResult, error)
	Permission() string
}

SearchAdapter performs a search for a specific entity type.

type SearchCount added in v0.117.0

type SearchCount struct {
	Value      int                 `json:"value"`
	Accuracy   SearchCountAccuracy `json:"accuracy"`
	Diagnostic string              `json:"diagnostic,omitempty"`
}

type SearchCountAccuracy added in v0.117.0

type SearchCountAccuracy string
const (
	SearchCountAccuracyExact       SearchCountAccuracy = "exact"
	SearchCountAccuracyLowerBound  SearchCountAccuracy = "lower_bound"
	SearchCountAccuracyApproximate SearchCountAccuracy = "approximate"
	SearchCountAccuracyUnavailable SearchCountAccuracy = "unavailable"
)

type SearchEngine

type SearchEngine struct {
	// contains filtered or unexported fields
}

SearchEngine aggregates adapters and executes queries across them.

func NewSearchEngine

func NewSearchEngine(authorizer Authorizer) *SearchEngine

NewSearchEngine constructs a search engine.

func (*SearchEngine) Enable

func (s *SearchEngine) Enable(enabled bool)

Enable toggles whether search is available.

func (*SearchEngine) Query

func (s *SearchEngine) Query(ctx AdminContext, query string, limit int) ([]SearchResult, error)

Query searches all adapters respecting permissions.

func (*SearchEngine) Register

func (s *SearchEngine) Register(key string, adapter SearchAdapter)

Register registers a search adapter under a key.

func (*SearchEngine) SetPrimary added in v0.27.0

func (s *SearchEngine) SetPrimary(adapter SearchAdapter)

SetPrimary installs the canonical search adapter. When configured, Query routes all requests through the primary adapter instead of fanout across the legacy registry.

func (*SearchEngine) Unregister added in v0.36.0

func (s *SearchEngine) Unregister(key string)

Unregister removes a search adapter by key.

type SearchEvidence added in v0.117.0

type SearchEvidence struct {
	Exact      bool                     `json:"exact"`
	Status     SearchEvidenceStatus     `json:"status,omitempty"`
	Locations  []SearchEvidenceLocation `json:"locations"`
	Diagnostic string                   `json:"diagnostic,omitempty"`
}

type SearchEvidenceLocation added in v0.117.0

type SearchEvidenceLocation struct {
	Location string                 `json:"location"`
	Count    int                    `json:"count"`
	Samples  []SearchEvidenceSample `json:"samples,omitempty"`
}

type SearchEvidenceSample added in v0.117.0

type SearchEvidenceSample struct {
	DocumentID   string                 `json:"document_id"`
	Field        string                 `json:"field,omitempty"`
	Locale       string                 `json:"locale,omitempty"`
	Snippet      *SearchEvidenceSnippet `json:"snippet,omitempty"`
	ChunkOrdinal *int                   `json:"chunk_ordinal,omitempty"`
	Anchor       any                    `json:"anchor,omitempty"`
}

type SearchEvidenceSnippet added in v0.117.0

type SearchEvidenceSnippet struct {
	Text        string `json:"text"`
	Highlighted string `json:"highlighted"`
}

type SearchEvidenceStatus added in v0.117.0

type SearchEvidenceStatus string
const (
	SearchEvidenceStatusComplete    SearchEvidenceStatus = "complete"
	SearchEvidenceStatusPartial     SearchEvidenceStatus = "partial"
	SearchEvidenceStatusUnsupported SearchEvidenceStatus = "unsupported"
	SearchEvidenceStatusUnavailable SearchEvidenceStatus = "unavailable"
)

type SearchFacet added in v0.26.0

type SearchFacet struct {
	Name        string            `json:"name"`
	Kind        string            `json:"kind,omitempty"`
	Disjunctive bool              `json:"disjunctive,omitempty"`
	Buckets     []SearchFacetTerm `json:"buckets,omitempty"`
	Metadata    map[string]any    `json:"metadata,omitempty"`
}

SearchFacet describes one facet dimension and value buckets.

type SearchFacetTerm added in v0.26.0

type SearchFacetTerm struct {
	Value       string         `json:"value"`
	Label       string         `json:"label,omitempty"`
	Count       int            `json:"count"`
	Selected    bool           `json:"selected,omitempty"`
	Path        []string       `json:"path,omitempty"`
	Level       int            `json:"level,omitempty"`
	ParentValue string         `json:"parent_value,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

SearchFacetTerm describes one facet value bucket.

type SearchHit added in v0.26.0

type SearchHit struct {
	ID              string          `json:"id"`
	Type            string          `json:"type,omitempty"`
	Title           string          `json:"title,omitempty"`
	Summary         string          `json:"summary,omitempty"`
	URL             string          `json:"url,omitempty"`
	Locale          string          `json:"locale,omitempty"`
	PublishedAt     *time.Time      `json:"published_at,omitempty"`
	Score           float64         `json:"score,omitempty"`
	Fields          map[string]any  `json:"fields,omitempty"`
	Snippet         string          `json:"snippet,omitempty"`
	Highlighted     string          `json:"highlighted,omitempty"`
	ParentID        string          `json:"parent_id,omitempty"`
	ParentTitle     string          `json:"parent_title,omitempty"`
	ParentURL       string          `json:"parent_url,omitempty"`
	ParentThumbnail string          `json:"parent_thumbnail,omitempty"`
	ParentSummary   string          `json:"parent_summary,omitempty"`
	Anchor          any             `json:"anchor,omitempty"`
	Metadata        map[string]any  `json:"metadata,omitempty"`
	Evidence        *SearchEvidence `json:"match_evidence,omitempty"`
}

SearchHit represents one normalized search document hit.

type SearchProvider added in v0.26.0

type SearchProvider interface {
	Search(ctx context.Context, req SearchRequest) (SearchResultPage, error)
	Suggest(ctx context.Context, req SuggestRequest) (SuggestResult, error)
}

SearchProvider defines the minimal site-search integration contract.

type SearchRange added in v0.27.0

type SearchRange struct {
	Field string `json:"field"`
	GTE   any    `json:"gte,omitempty"`
	LTE   any    `json:"lte,omitempty"`
}

SearchRange describes one provider-neutral range constraint.

type SearchRequest added in v0.26.0

type SearchRequest struct {
	Query         string              `json:"q"`
	Locale        string              `json:"locale,omitempty"`
	Page          int                 `json:"page,omitempty"`
	PerPage       int                 `json:"per_page,omitempty"`
	Sort          string              `json:"sort,omitempty"`
	Filters       map[string][]string `json:"filters,omitempty"`
	Ranges        []SearchRange       `json:"ranges,omitempty"`
	Actor         any                 `json:"actor,omitempty"`
	Request       any                 `json:"request,omitempty"`
	Metadata      map[string]any      `json:"metadata,omitempty"`
	Variant       SearchVariant       `json:"variant,omitempty"`
	MaxCandidates int                 `json:"max_candidates,omitempty"`
}

SearchRequest is a backend-agnostic site search request envelope.

type SearchResult

type SearchResult struct {
	Type        string `json:"type"`
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	URL         string `json:"url,omitempty"`
	Icon        string `json:"icon,omitempty"`
	Thumbnail   string `json:"thumbnail,omitempty"`
}

SearchResult represents a single search hit.

type SearchResultPage added in v0.26.0

type SearchResultPage struct {
	Hits          []SearchHit            `json:"hits"`
	Facets        []SearchFacet          `json:"facets,omitempty"`
	Page          int                    `json:"page"`
	PerPage       int                    `json:"per_page"`
	Total         int                    `json:"total"`
	TotalAccuracy SearchTotalAccuracy    `json:"total_accuracy,omitempty"`
	Counts        map[string]SearchCount `json:"counts,omitempty"`
	Metadata      map[string]any         `json:"metadata,omitempty"`
}

SearchResultPage captures paginated search hits plus facets.

type SearchTotalAccuracy added in v0.117.0

type SearchTotalAccuracy string
const (
	SearchTotalAccuracyExact       SearchTotalAccuracy = "exact"
	SearchTotalAccuracyLowerBound  SearchTotalAccuracy = "lower_bound"
	SearchTotalAccuracyApproximate SearchTotalAccuracy = "approximate"
)

type SearchVariant added in v0.117.0

type SearchVariant string

SearchVariant is an application-defined product variant. It is intentionally distinct from provider retrieval modes such as lexical or semantic search.

type SettingDefinition

type SettingDefinition struct {
	// ApplicationManaged requires host service/command writes; legacy bundles reject it.
	ApplicationManaged bool                   `json:"application_managed,omitempty"`
	Key                string                 `json:"key"`
	Title              string                 `json:"title,omitempty"`
	Description        string                 `json:"description,omitempty"`
	Default            any                    `json:"default,omitempty"`
	Type               string                 `json:"type,omitempty"`
	Group              string                 `json:"group,omitempty"`
	AllowedScopes      []SettingsScope        `json:"allowed_scopes,omitempty"`
	Enum               []any                  `json:"enum,omitempty"`
	Widget             string                 `json:"widget,omitempty"`
	VisibilityRule     string                 `json:"visibility_rule,omitempty"`
	Options            []SettingOption        `json:"options,omitempty"`
	OptionsProvider    SettingOptionsProvider `json:"-"`
	Enrichers          []SettingFieldEnricher `json:"-"`
	Validator          SettingValidator       `json:"-"`
}

SettingDefinition describes a single setting and its defaults.

type SettingFieldEnricher

type SettingFieldEnricher func(ctx context.Context, field map[string]any)

SettingFieldEnricher can mutate the schema payload for a definition.

type SettingOption

type SettingOption struct {
	Label       string `json:"label,omitempty"`
	Value       any    `json:"value"`
	Description string `json:"description,omitempty"`
}

SettingOption represents an allowed value for select-like controls.

type SettingOptionsProvider

type SettingOptionsProvider func(ctx context.Context) ([]SettingOption, error)

SettingOptionsProvider dynamically resolves options for a definition.

type SettingOverviewValuePayload added in v0.25.0

type SettingOverviewValuePayload struct {
	Value      any    `json:"value"`
	Provenance string `json:"provenance"`
}

type SettingRecord

type SettingRecord struct {
	bun.BaseModel `bun:"table:admin_settings"`

	ID        uuid.UUID       `bun:",pk,type:uuid" json:"id"`
	Key       string          `bun:",notnull,unique:admin_settings_scope" json:"key"`
	Scope     string          `bun:",notnull,unique:admin_settings_scope" json:"scope"`
	UserID    string          `bun:",nullzero,unique:admin_settings_scope" json:"user_id"`
	Value     json.RawMessage `bun:"type:jsonb,nullzero" json:"value"`
	CreatedAt time.Time       `bun:",nullzero,notnull,default:current_timestamp" json:"created_at"`
	UpdatedAt time.Time       `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at"`
}

type SettingValidator

type SettingValidator func(ctx context.Context, value any) error

SettingValidator applies custom validation logic for a definition.

type SettingsAdapter

type SettingsAdapter interface {
	RegisterDefinition(def SettingDefinition)
	Definitions() []SettingDefinition
	Apply(ctx context.Context, bundle SettingsBundle) error
	Resolve(key, userID string) ResolvedSetting
	ResolveAll(userID string) map[string]ResolvedSetting
	Schema(ctx context.Context, userID string) (opts.SchemaDocument, error)
	WithSchemaOptions(opts ...opts.Option)
}

SettingsAdapter allows the settings service to delegate persistence and resolution.

type SettingsBundle

type SettingsBundle struct {
	Scope  SettingsScope  `json:"scope"`
	UserID string         `json:"user_id"`
	Values map[string]any `json:"values"`
}

SettingsBundle captures a bulk mutation request.

type SettingsDocumentAdapter added in v0.140.0

type SettingsDocumentAdapter interface {
	ReadDocument(context.Context, SettingsDocumentTarget) (SettingsDocumentSnapshot, error)
	ApplyDocument(context.Context, SettingsDocumentMutation) (SettingsDocumentSnapshot, error)
}

SettingsDocumentAdapter is optional; SettingsAdapter remains source-compatible. Document methods do not emit best-effort activity. Hosts own audit/idempotency.

type SettingsDocumentMutation added in v0.140.0

type SettingsDocumentMutation struct {
	Target           SettingsDocumentTarget `json:"target"`
	ExpectedRevision int64                  `json:"expected_revision"`
	Values           map[string]any         `json:"values,omitempty"`
	Reset            []string               `json:"reset,omitempty"`
	Touch            bool                   `json:"touch,omitempty"`
}

SettingsDocumentMutation patches overrides. Reset removes an override; it does not erase revision history. Touch advances revision even with unchanged values when another host-owned domain mutation shares this transaction.

func (SettingsDocumentMutation) Validate added in v0.140.0

func (m SettingsDocumentMutation) Validate() error

type SettingsDocumentRecord added in v0.140.0

type SettingsDocumentRecord struct {
	bun.BaseModel `bun:"table:admin_settings_documents"`
	Namespace     string          `bun:",pk,notnull"`
	Scope         string          `bun:",pk,notnull"`
	UserID        string          `bun:",pk,notnull"`
	Revision      int64           `bun:",notnull"`
	Overrides     json.RawMessage `bun:"type:jsonb,notnull"`
	UpdatedAt     time.Time       `bun:",notnull"`
}

SettingsDocumentRecord is a portable named document. The primary key has no nullable components, so guarded creation has the same semantics on both DBs.

type SettingsDocumentSnapshot added in v0.140.0

type SettingsDocumentSnapshot struct {
	Target      SettingsDocumentTarget     `json:"target"`
	Revision    int64                      `json:"revision"`
	Overrides   map[string]any             `json:"overrides"`
	Values      map[string]ResolvedSetting `json:"values"`
	Identity    string                     `json:"identity"`
	ChangedKeys []string                   `json:"changed_keys,omitempty"`
}

SettingsDocumentSnapshot is a detached, coherent document read. Values resolves this document's overrides over registered defaults; other documents are not implicitly inherited. Identity also covers effective defaults for cache use.

type SettingsDocumentTarget added in v0.140.0

type SettingsDocumentTarget struct {
	Namespace string        `json:"namespace"`
	Scope     SettingsScope `json:"scope"`
	UserID    string        `json:"user_id,omitempty"`
}

SettingsDocumentTarget identifies an independent application-owned document. Namespace is bound by the host (for example "crm.company"), never inferred from caller input. Scope describes the document, not an inheritance request.

func (SettingsDocumentTarget) Validate added in v0.140.0

func (t SettingsDocumentTarget) Validate() error

type SettingsForm

type SettingsForm struct {
	Schema       map[string]any               `json:"schema"`
	SchemaFormat opts.SchemaFormat            `json:"schema_format,omitempty"`
	Scopes       []opts.SchemaScope           `json:"scopes,omitempty"`
	Values       map[string]ResolvedSetting   `json:"values"`
	Theme        map[string]map[string]string `json:"theme,omitempty"`
}

SettingsForm bundles schema, values, and theme for rendering.

type SettingsFormAdapter

type SettingsFormAdapter struct {
	// contains filtered or unexported fields
}

SettingsFormAdapter maps definitions to a form-like payload with theme tokens.

func NewSettingsFormAdapter

func NewSettingsFormAdapter(service *SettingsService, theme string, tokens map[string]string) *SettingsFormAdapter

NewSettingsFormAdapter constructs a form adapter for settings.

func (*SettingsFormAdapter) Form

func (a *SettingsFormAdapter) Form(userID string) SettingsForm

Form returns a schema/value payload suitable for feeding form renderers.

func (*SettingsFormAdapter) FormWithContext

func (a *SettingsFormAdapter) FormWithContext(ctx context.Context, userID string) SettingsForm

FormWithContext is context-aware to allow theme providers to resolve per-request.

func (*SettingsFormAdapter) WithThemeResolver

func (a *SettingsFormAdapter) WithThemeResolver(resolver func(ctx context.Context) *ThemeSelection) *SettingsFormAdapter

WithThemeResolver injects a resolver that can fetch the current theme selection.

type SettingsOverviewWidgetPayload added in v0.25.0

type SettingsOverviewWidgetPayload struct {
	Values map[string]SettingOverviewValuePayload `json:"values"`
}

type SettingsRevisionConflict added in v0.140.0

type SettingsRevisionConflict struct{ ExpectedRevision int64 }

SettingsRevisionConflict is returned for guarded creation or stale updates. It contains only the expected revision; hosts may re-read after rollback.

func (*SettingsRevisionConflict) Error added in v0.140.0

func (e *SettingsRevisionConflict) Error() string

func (*SettingsRevisionConflict) Unwrap added in v0.140.0

func (e *SettingsRevisionConflict) Unwrap() error

type SettingsScope

type SettingsScope string

SettingsScope represents the provenance of a setting value.

const (
	SettingsScopeSystem  SettingsScope = "system"
	SettingsScopeSite    SettingsScope = "site"
	SettingsScopeUser    SettingsScope = "user"
	SettingsScopeDefault SettingsScope = "default"
)

type SettingsService

type SettingsService struct {
	// contains filtered or unexported fields
}

SettingsService stores definitions and layered values (system/site/user).

func NewSettingsService

func NewSettingsService() *SettingsService

NewSettingsService constructs an empty settings service.

func (*SettingsService) Apply

func (s *SettingsService) Apply(ctx context.Context, bundle SettingsBundle) error

Apply validates and persists a bundle of settings.

func (*SettingsService) ApplyDocument added in v0.140.0

func (*SettingsService) ApplyDocumentTx added in v0.140.0

func (*SettingsService) Definitions

func (s *SettingsService) Definitions() []SettingDefinition

Definitions returns all registered definitions sorted by key.

func (*SettingsService) Enable

func (s *SettingsService) Enable(enabled bool)

Enable toggles whether settings are available.

func (*SettingsService) ReadDocument added in v0.140.0

func (*SettingsService) ReadDocumentWithDB added in v0.140.0

func (s *SettingsService) ReadDocumentWithDB(ctx context.Context, db bun.IDB, target SettingsDocumentTarget) (SettingsDocumentSnapshot, error)

func (*SettingsService) RegisterDefinition

func (s *SettingsService) RegisterDefinition(def SettingDefinition)

RegisterDefinition adds or updates a definition.

func (*SettingsService) Resolve

func (s *SettingsService) Resolve(key, userID string) ResolvedSetting

Resolve returns a setting value with provenance.

func (*SettingsService) ResolveAll

func (s *SettingsService) ResolveAll(userID string) map[string]ResolvedSetting

ResolveAll returns all settings with provenance.

func (*SettingsService) ResolveAllContext added in v0.140.0

func (s *SettingsService) ResolveAllContext(ctx context.Context, userID string) (map[string]ResolvedSetting, error)

ResolveAllContext fails explicitly when an installed adapter has no error-aware read capability; it never silently degrades a durable read to defaults.

func (*SettingsService) ResolveContext added in v0.140.0

func (s *SettingsService) ResolveContext(ctx context.Context, key, userID string) (ResolvedSetting, error)

func (*SettingsService) Schema

func (s *SettingsService) Schema(ctx context.Context, userID string) (opts.SchemaDocument, error)

Schema returns the go-options schema document for the current settings stack.

func (*SettingsService) UseAdapter

func (s *SettingsService) UseAdapter(adapter SettingsAdapter)

UseAdapter delegates settings persistence and resolution to an external adapter.

func (*SettingsService) WithActivitySink

func (s *SettingsService) WithActivitySink(sink ActivitySink)

WithActivitySink wires a shared activity sink for settings mutations.

func (*SettingsService) WithRegistry

func (s *SettingsService) WithRegistry(reg *Registry)

WithRegistry wires the shared registry so definitions are discoverable.

func (*SettingsService) WithSchemaOptions

func (s *SettingsService) WithSchemaOptions(opts ...opts.Option)

WithSchemaOptions appends options used when generating schemas from go-options.

type SettingsUpdateCommand

type SettingsUpdateCommand struct {
	Service    *SettingsService `json:"service"`
	Permission string           `json:"permission"`
}

SettingsUpdateCommand wraps settings mutations in a go-command handler.

func (*SettingsUpdateCommand) CLIHandler added in v0.12.0

func (c *SettingsUpdateCommand) CLIHandler() any

CLIOptions exposes CLI metadata for the update command.

func (*SettingsUpdateCommand) CLIOptions

func (c *SettingsUpdateCommand) CLIOptions() command.CLIConfig

CLIOptions exposes CLI metadata for the update command.

func (*SettingsUpdateCommand) Execute

Execute applies the bundle found in the message.

type SettingsUpdateMsg added in v0.12.0

type SettingsUpdateMsg struct {
	Bundle SettingsBundle `json:"bundle"`
}

SettingsUpdateMsg updates settings via the command bus.

func (SettingsUpdateMsg) Type added in v0.12.0

func (SettingsUpdateMsg) Type() string

func (SettingsUpdateMsg) Validate added in v0.12.0

func (m SettingsUpdateMsg) Validate() error

type SettingsValidationErrors

type SettingsValidationErrors struct {
	Fields map[string]string `json:"fields"`
	Scope  SettingsScope     `json:"scope,omitempty"`
}

SettingsValidationErrors aggregates field-level validation issues.

func (SettingsValidationErrors) Error

func (e SettingsValidationErrors) Error() string

type SidebarCollapsePlacement added in v0.126.3

type SidebarCollapsePlacement string

SidebarCollapsePlacement controls where the desktop collapse action renders. The empty value normalizes to the legacy header placement.

const (
	SidebarCollapsePlacementHeader SidebarCollapsePlacement = "header"
	SidebarCollapsePlacementFooter SidebarCollapsePlacement = "footer"
)

func NormalizeSidebarCollapsePlacement added in v0.126.3

func NormalizeSidebarCollapsePlacement(value SidebarCollapsePlacement) SidebarCollapsePlacement

NormalizeSidebarCollapsePlacement returns a supported sidebar collapse placement while preserving the legacy header behavior for empty/unknown input.

type SignedTokenStrategy added in v0.16.0

type SignedTokenStrategy struct {
	Secret   []byte `json:"secret"`
	Audience string `json:"audience"`
	Issuer   string `json:"issuer"`
}

SignedTokenStrategy allows overrides when a signed token validates.

func (SignedTokenStrategy) Allows added in v0.16.0

type SiteAPIClient added in v0.26.0

type SiteAPIClient interface {
	ContentList(ctx context.Context, contentType string, query SiteQuery) (*SiteContentListResponse, error)
	ContentDetail(ctx context.Context, contentType, slug string, query SiteQuery) (*SiteContentDetailResponse, error)
	MenuByLocation(ctx context.Context, location string, query SiteQuery) (*SiteMenuResponse, error)
	MenuByCode(ctx context.Context, code string, query SiteQuery) (*SiteMenuResponse, error)
}

SiteAPIClient defines typed client methods for normalized site endpoints.

type SiteAPIError added in v0.26.0

type SiteAPIError struct {
	Code     int            `json:"code,omitempty"`
	TextCode string         `json:"text_code,omitempty"`
	Message  string         `json:"message,omitempty"`
	Category string         `json:"category,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

SiteAPIError mirrors machine-readable error payloads consumed by clients.

type SiteAPIErrorResponse added in v0.26.0

type SiteAPIErrorResponse struct {
	Error SiteAPIError `json:"error"`
}

SiteAPIErrorResponse wraps SiteAPIError payloads.

type SiteConfig added in v0.26.0

type SiteConfig struct {
	// AllowLocaleFallback controls missing translation fallback behavior for site APIs.
	// Nil defaults to true.
	AllowLocaleFallback *bool `json:"allow_locale_fallback"`
	// AllowUnauthenticatedReads explicitly opts into anonymous public-site reads.
	// Leave false to require an authenticated actor for the public API surface.
	AllowUnauthenticatedReads bool `json:"allow_unauthenticated_reads,omitempty"`
	// Protected forces authenticated site reads even when anonymous reads would
	// otherwise be allowed by configuration.
	Protected bool `json:"protected"`
	// ReadPermission guards authenticated site endpoint reads.
	ReadPermission string `json:"read_permission"`
	// DraftReadPermission optionally guards include_drafts access.
	DraftReadPermission string `json:"draft_read_permission"`
	// TrustPrivateNetworkDraftReads allows include_drafts reads from private/loopback
	// network origins without actor permission checks. Disabled by default to avoid
	// network-topology-based authorization.
	TrustPrivateNetworkDraftReads bool `json:"trust_private_network_draft_reads"`
	// ViewProfileOverridePermission optionally guards view_profile overrides.
	ViewProfileOverridePermission string `json:"view_profile_override_permission"`
}

SiteConfig controls public site API behavior exposed by go-admin.

type SiteContentDetailResponse added in v0.26.0

type SiteContentDetailResponse struct {
	Data map[string]any   `json:"data"`
	Meta SiteResponseMeta `json:"meta"`
}

SiteContentDetailResponse is the normalized detail response for site content routes.

type SiteContentListResponse added in v0.26.0

type SiteContentListResponse struct {
	Data []map[string]any `json:"data"`
	Meta SiteResponseMeta `json:"meta"`
}

SiteContentListResponse is the normalized list response for site content routes.

type SiteMenuReadOptions struct {
	Locale               string `json:"locale,omitempty"`
	IncludeDrafts        bool   `json:"include_drafts,omitempty"`
	IncludeContributions bool   `json:"include_contributions,omitempty"`
	PreviewToken         string `json:"preview_token,omitempty"`
	ViewProfile          string `json:"view_profile,omitempty"`
}

SiteMenuReadOptions captures menu-specific query options.

type SiteMenuResponse struct {
	Data *Menu            `json:"data"`
	Meta SiteResponseMeta `json:"meta"`
}

SiteMenuResponse is the normalized response for site menu routes.

type SiteQuery added in v0.26.0

type SiteQuery struct {
	Locale               string              `json:"locale,omitempty"`
	Page                 int                 `json:"page,omitempty"`
	PerPage              int                 `json:"per_page,omitempty"`
	Sort                 string              `json:"sort,omitempty"`
	SortDesc             bool                `json:"sort_desc,omitempty"`
	Fields               []string            `json:"fields,omitempty"`
	Filters              map[string][]string `json:"filters,omitempty"`
	Q                    string              `json:"q,omitempty"`
	IncludeDrafts        bool                `json:"include_drafts,omitempty"`
	IncludeContributions bool                `json:"include_contributions,omitempty"`
	PreviewToken         string              `json:"preview_token,omitempty"`
	ViewProfile          string              `json:"view_profile,omitempty"`
}

SiteQuery defines normalized site endpoint query parameters.

type SiteResponseMeta added in v0.26.0

type SiteResponseMeta struct {
	RequestedLocale string    `json:"requested_locale,omitempty"`
	ResolvedLocale  string    `json:"resolved_locale,omitempty"`
	Page            int       `json:"page,omitempty"`
	PerPage         int       `json:"per_page,omitempty"`
	Total           int       `json:"total,omitempty"`
	Query           SiteQuery `json:"query"`
}

SiteResponseMeta provides stable response metadata for site endpoints.

type SiteTranslationMissingDetails added in v0.26.0

type SiteTranslationMissingDetails struct {
	RequestedLocale  string   `json:"requested_locale,omitempty"`
	AvailableLocales []string `json:"available_locales,omitempty"`
	ContentType      string   `json:"content_type,omitempty"`
	Slug             string   `json:"slug,omitempty"`
}

SiteTranslationMissingDetails exposes structured metadata for translation_missing errors.

type SiteURLResolver added in v0.26.0

type SiteURLResolver interface {
	ContentPath(contentType, slug string) string
	ContentURL(contentType, slug string) string
	NormalizePath(path, fallback string) string
}

SiteURLResolver resolves canonical site paths and URLs used by delivery/search integrations.

type SourceContext added in v0.24.0

type SourceContext struct {
	File       string       `json:"file"`
	Line       int          `json:"line"`
	StartLine  int          `json:"start_line"`
	Lines      []SourceLine `json:"lines"`
	Function   string       `json:"function,omitempty"`
	Language   string       `json:"language,omitempty"`
	Snippet    string       `json:"snippet,omitempty"`
	RelPath    string       `json:"rel_path,omitempty"`
	IsAppCode  bool         `json:"is_app_code"`
	CanOpenIDE bool         `json:"can_open_ide"`
}

SourceContext holds source code lines around an error location.

func ExtractSourceContext added in v0.24.0

func ExtractSourceContext(filePath string, errorLine, contextLines int) *SourceContext

ExtractSourceContext reads source code around the given file and line. contextLines specifies how many lines to show before and after the error line.

type SourceLine added in v0.24.0

type SourceLine struct {
	Number    int    `json:"number"`
	Content   string `json:"content"`
	IsError   bool   `json:"is_error"`
	IsContext bool   `json:"is_context"`
}

SourceLine represents a single line of source code.

type StackFrameInfo added in v0.24.0

type StackFrameInfo struct {
	File       string         `json:"file"`
	Line       int            `json:"line"`
	Function   string         `json:"function"`
	Package    string         `json:"package,omitempty"`
	IsAppCode  bool           `json:"is_app_code"`
	IsExpanded bool           `json:"is_expanded"`
	Source     *SourceContext `json:"source,omitempty"`
	IDELink    string         `json:"ide_link,omitempty"`
}

StackFrameInfo holds enriched stack frame data.

func EnrichStackFrames added in v0.24.0

func EnrichStackFrames(frames []StackFrameInfo, contextLines int, maxFrames int) []StackFrameInfo

EnrichStackFrames adds source context to stack frames.

func EnrichStackFramesWithConfig added in v0.73.0

func EnrichStackFramesWithConfig(frames []StackFrameInfo, cfg ErrorConfig) []StackFrameInfo

type StaticKeyStrategy added in v0.16.0

type StaticKeyStrategy struct {
	Key       string    `json:"key"`
	ExpiresAt time.Time `json:"expires_at"`
}

StaticKeyStrategy allows overrides when a shared key matches.

func (StaticKeyStrategy) Allows added in v0.16.0

type SuggestRequest added in v0.26.0

type SuggestRequest struct {
	Query    string              `json:"q"`
	Locale   string              `json:"locale,omitempty"`
	Limit    int                 `json:"limit,omitempty"`
	Filters  map[string][]string `json:"filters,omitempty"`
	Actor    any                 `json:"actor,omitempty"`
	Request  any                 `json:"request,omitempty"`
	Metadata map[string]any      `json:"metadata,omitempty"`
	Variant  SearchVariant       `json:"variant,omitempty"`
}

SuggestRequest is a backend-agnostic suggest request envelope.

type SuggestResult added in v0.26.0

type SuggestResult struct {
	Suggestions []string       `json:"suggestions"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

SuggestResult captures typeahead suggestions with optional metadata.

type SyncTransportAdapter added in v0.27.0

type SyncTransportAdapter struct {
	ScopeDefaults AuthenticatedRequestScopeDefaults `json:"scope_defaults"`
	ResolveScope  SyncTransportScopeResolver        `json:"resolve_scope"`
}

SyncTransportAdapter resolves authenticated actor, scope, and trace metadata for go-admin consumers that expose pkg/go-sync transports.

func (SyncTransportAdapter) Resolve added in v0.27.0

Resolve returns trusted sync transport metadata without consulting browser-supplied actor or scope overrides.

type SyncTransportRequestMetadata added in v0.27.0

type SyncTransportRequestMetadata struct {
	ActorID       string            `json:"actor_id"`
	RequestID     string            `json:"request_id"`
	CorrelationID string            `json:"correlation_id"`
	TraceID       string            `json:"trace_id"`
	Scope         map[string]string `json:"scope"`
}

SyncTransportRequestMetadata captures trusted sync transport metadata that a consumer can adapt into its package-specific transport layer.

type SyncTransportScopeResolver added in v0.27.0

type SyncTransportScopeResolver func(router.Context, AuthenticatedRequestIdentity) (map[string]string, error)

SyncTransportScopeResolver resolves consumer-owned canonical scope metadata from an authenticated admin request.

type TenantMember

type TenantMember struct {
	UserID      string   `json:"user_id"`
	Roles       []string `json:"roles,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
}

TenantMember captures membership assignments for a tenant, including scoped roles/permissions.

type TenantPanelRepository

type TenantPanelRepository = genericPanelRepository[TenantRecord]

TenantPanelRepository adapts TenantService to the panel Repository contract.

func NewTenantPanelRepository

func NewTenantPanelRepository(service *TenantService) *TenantPanelRepository

NewTenantPanelRepository constructs a repository backed by TenantService.

type TenantRecord

type TenantRecord struct {
	ID        string         `json:"id"`
	Name      string         `json:"name"`
	Slug      string         `json:"slug,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Status    string         `json:"status,omitempty"`
	Members   []TenantMember `json:"members,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
}

TenantRecord represents a managed tenant.

type TenantRepository

type TenantRepository interface {
	List(ctx context.Context, opts ListOptions) ([]TenantRecord, int, error)
	Get(ctx context.Context, id string) (TenantRecord, error)
	Create(ctx context.Context, tenant TenantRecord) (TenantRecord, error)
	Update(ctx context.Context, tenant TenantRecord) (TenantRecord, error)
	Delete(ctx context.Context, id string) error
	Search(ctx context.Context, query string, limit int) ([]TenantRecord, error)
}

TenantRepository exposes CRUD/search operations for tenants with membership awareness.

type TenantService

type TenantService struct {
	// contains filtered or unexported fields
}

TenantService orchestrates tenant management and activity emission.

func NewTenantService

func NewTenantService(repo TenantRepository) *TenantService

NewTenantService constructs a service with the provided repository or an in-memory fallback.

func (*TenantService) AssignMember

func (s *TenantService) AssignMember(ctx context.Context, tenantID string, member TenantMember) (TenantRecord, error)

AssignMember adds or updates a tenant membership.

func (*TenantService) DeleteTenant

func (s *TenantService) DeleteTenant(ctx context.Context, id string) error

DeleteTenant removes a tenant by ID.

func (*TenantService) GetTenant

func (s *TenantService) GetTenant(ctx context.Context, id string) (TenantRecord, error)

GetTenant fetches a tenant by ID.

func (*TenantService) ListTenants

func (s *TenantService) ListTenants(ctx context.Context, opts ListOptions) ([]TenantRecord, int, error)

ListTenants returns tenants with filters applied.

func (*TenantService) RemoveMember

func (s *TenantService) RemoveMember(ctx context.Context, tenantID, userID string) (TenantRecord, error)

RemoveMember detaches a user from a tenant.

func (*TenantService) SaveTenant

func (s *TenantService) SaveTenant(ctx context.Context, tenant TenantRecord) (TenantRecord, error)

SaveTenant creates or updates a tenant record.

func (*TenantService) SearchTenants

func (s *TenantService) SearchTenants(ctx context.Context, query string, limit int) ([]TenantRecord, error)

SearchTenants performs a keyword search against tenants.

func (*TenantService) WithActivitySink

func (s *TenantService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission for tenant mutations.

type TenantsModule

type TenantsModule struct {
	// contains filtered or unexported fields
}

TenantsModule registers the tenants panel and navigation.

func NewTenantsModule

func NewTenantsModule() *TenantsModule

NewTenantsModule constructs the default tenants module.

func (*TenantsModule) Manifest

func (m *TenantsModule) Manifest() ModuleManifest

Manifest describes the module metadata.

func (*TenantsModule) MenuItems

func (m *TenantsModule) MenuItems(locale string) []MenuItem

MenuItems contributes navigation for tenants.

func (*TenantsModule) Register

func (m *TenantsModule) Register(ctx ModuleContext) error

Register wires the tenants panel and search adapter.

func (*TenantsModule) RouteContract added in v0.27.0

func (m *TenantsModule) RouteContract() routing.ModuleContract

func (*TenantsModule) WithMenuParent

func (m *TenantsModule) WithMenuParent(parent string) *TenantsModule

WithMenuParent nests tenant navigation under a parent menu item ID.

type ThemeProvider

type ThemeProvider func(ctx context.Context, selector ThemeSelector) (*ThemeSelection, error)

ThemeProvider resolves the theme selection, typically backed by go-theme.

func ThemeProviderFromGoThemeSelector added in v0.36.0

func ThemeProviderFromGoThemeSelector(selector gotheme.ThemeSelector) ThemeProvider

ThemeProviderFromGoThemeSelector adapts a go-theme selector into the admin theme provider contract.

type ThemeSelection

type ThemeSelection struct {
	Name    string `json:"name"`
	Variant string `json:"variant"`
	// VariantResolved marks Variant and ChartTheme as authoritative even when empty.
	VariantResolved   bool                   `json:"-"`
	Tokens            map[string]string      `json:"tokens"`
	CSSVars           map[string]string      `json:"css_vars"`
	SemanticTokens    map[string]string      `json:"semantic_tokens,omitempty"`
	RootCSSVarsInline string                 `json:"root_css_vars_inline,omitempty"`
	Diagnostics       []ThemeTokenDiagnostic `json:"diagnostics,omitempty"`
	Assets            map[string]string      `json:"assets"`
	Partials          map[string]string      `json:"partials"`
	ChartTheme        string                 `json:"chart_theme"`
	AssetPrefix       string                 `json:"asset_prefix"`
}

ThemeSelection captures resolved theme assets/tokens.

func (*ThemeSelection) Payload added in v0.36.0

func (t *ThemeSelection) Payload() map[string]map[string]string

Payload returns a cloned theme payload suitable for JSON/view contexts.

type ThemeSelector

type ThemeSelector struct {
	Name    string `json:"name"`
	Variant string `json:"variant"`
}

ThemeSelector describes the requested theme/variant.

func ThemeSelectorFromContext

func ThemeSelectorFromContext(ctx context.Context) ThemeSelector

ThemeSelectorFromContext extracts a theme selector override from context, if present.

type ThemeTokenDiagnostic added in v0.125.0

type ThemeTokenDiagnostic struct {
	Token      string `json:"token"`
	Canonical  string `json:"canonical,omitempty"`
	Variable   string `json:"variable,omitempty"`
	Constraint string `json:"constraint,omitempty"`
	Status     string `json:"status"`
	Consumer   string `json:"consumer,omitempty"`
	Reason     string `json:"reason,omitempty"`
}

ThemeTokenDiagnostic mirrors go-theme's renderer-neutral token lifecycle without changing the legacy view payload shape.

type TransactionalSettingsDocumentAdapter added in v0.140.0

type TransactionalSettingsDocumentAdapter interface {
	SettingsDocumentAdapter
	ReadDocumentWithDB(context.Context, bun.IDB, SettingsDocumentTarget) (SettingsDocumentSnapshot, error)
	ApplyDocumentTx(context.Context, bun.Tx, SettingsDocumentMutation) (SettingsDocumentSnapshot, error)
}

TransactionalSettingsDocumentAdapter joins a host-owned Bun transaction. Reads accept bun.IDB for use in existing query transactions. ApplyDocumentTx requires a real transaction and never commits/rolls it back. On ANY error the caller must roll back the transaction; returned success is provisional until host commit.

type TranslationActorOption added in v0.113.6

type TranslationActorOption struct {
	Value       string         `json:"value"`
	Label       string         `json:"label"`
	Description string         `json:"description,omitempty"`
	DisplayName string         `json:"display_name,omitempty"`
	AvatarURL   string         `json:"avatar_url,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

type TranslationActorOptionProvider added in v0.113.6

type TranslationActorOptionProvider interface {
	ListTranslationActorOptions(context.Context, TranslationActorOptionQuery) ([]TranslationActorOption, error)
}

type TranslationActorOptionPurpose added in v0.113.6

type TranslationActorOptionPurpose string
const (
	TranslationActorOptionPurposeAssignee TranslationActorOptionPurpose = "assignee"
	TranslationActorOptionPurposeReviewer TranslationActorOptionPurpose = "reviewer"
)

type TranslationActorOptionQuery added in v0.113.6

type TranslationActorOptionQuery struct {
	Purpose        TranslationActorOptionPurpose `json:"purpose"`
	Search         string                        `json:"search,omitempty"`
	SelectedIDs    []string                      `json:"selected_ids,omitempty"`
	Page           int                           `json:"page,omitempty"`
	PerPage        int                           `json:"per_page,omitempty"`
	Channel        string                        `json:"channel,omitempty"`
	EntityType     string                        `json:"entity_type,omitempty"`
	SourceRecordID string                        `json:"source_record_id,omitempty"`
	FamilyID       string                        `json:"family_id,omitempty"`
	TargetLocale   string                        `json:"target_locale,omitempty"`
	AdminContext   AdminContext                  `json:"-"`
}

type TranslationAlreadyExistsError added in v0.25.0

type TranslationAlreadyExistsError struct {
	Panel        string `json:"panel"`
	EntityID     string `json:"entity_id"`
	SourceLocale string `json:"source_locale"`
	Locale       string `json:"locale"`
	FamilyID     string `json:"family_id"`
}

TranslationAlreadyExistsError reports locale-level duplicate translation attempts.

func (TranslationAlreadyExistsError) Error added in v0.25.0

func (TranslationAlreadyExistsError) Unwrap added in v0.25.0

type TranslationAssignment added in v0.25.0

type TranslationAssignment struct {
	ID         string `json:"id"`
	FamilyID   string `json:"family_id"`
	VariantID  string `json:"variant_id,omitempty"`
	EntityType string `json:"entity_type"`
	TenantID   string `json:"tenant_id,omitempty"`
	OrgID      string `json:"org_id,omitempty"`

	SourceRecordID string `json:"source_record_id"`
	SourceLocale   string `json:"source_locale"`
	TargetLocale   string `json:"target_locale"`
	TargetRecordID string `json:"target_record_id,omitempty"`

	SourceTitle string `json:"source_title,omitempty"`
	SourcePath  string `json:"source_path,omitempty"`
	WorkScope   string `json:"work_scope,omitempty"`

	AssignmentType      AssignmentType   `json:"assignment_type"`
	Status              AssignmentStatus `json:"status"`
	Priority            Priority         `json:"priority"`
	DueDate             *time.Time       `json:"due_date,omitempty"`
	AssigneeID          string           `json:"assignee_id,omitempty"`
	ReviewerID          string           `json:"reviewer_id,omitempty"`
	AssignerID          string           `json:"assigner_id,omitempty"`
	LastReviewerID      string           `json:"last_reviewer_id,omitempty"`
	LastRejectionReason string           `json:"last_rejection_reason,omitempty"`
	AssignedAt          *time.Time       `json:"assigned_at,omitempty"`

	Version int64 `json:"version"`

	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	ClaimedAt   *time.Time `json:"claimed_at,omitempty"`
	SubmittedAt *time.Time `json:"submitted_at,omitempty"`
	ApprovedAt  *time.Time `json:"approved_at,omitempty"`
	PublishedAt *time.Time `json:"published_at,omitempty"`
	ArchivedAt  *time.Time `json:"archived_at,omitempty"`
}

TranslationAssignment coordinates translation work for one target locale.

func (TranslationAssignment) ActiveUniquenessKey added in v0.25.0

func (a TranslationAssignment) ActiveUniquenessKey() string

ActiveUniquenessKey returns the canonical active-assignment uniqueness key.

func (TranslationAssignment) Validate added in v0.25.0

func (a TranslationAssignment) Validate() error

Validate ensures required model fields and enum values are present.

type TranslationAssignmentConflictError added in v0.25.0

type TranslationAssignmentConflictError struct {
	AssignmentID         string `json:"assignment_id"`
	ExistingAssignmentID string `json:"existing_assignment_id"`
	FamilyID             string `json:"family_id"`
	EntityType           string `json:"entity_type"`
	SourceLocale         string `json:"source_locale"`
	TargetLocale         string `json:"target_locale"`
	WorkScope            string `json:"work_scope"`
}

TranslationAssignmentConflictError captures active uniqueness conflicts.

func (TranslationAssignmentConflictError) Error added in v0.25.0

func (TranslationAssignmentConflictError) Unwrap added in v0.25.0

type TranslationAssignmentDashboardSummary added in v0.80.0

type TranslationAssignmentDashboardSummary struct {
	MyTasks             int
	MyInProgress        int
	MyDueSoon           int
	MyOverdue           int
	NeedsReview         int
	NeedsReviewOverdue  int
	OverdueTasks        int
	HighPriorityOverdue int
	TopOverdue          []TranslationAssignment
}

type TranslationAssignmentDashboardSummaryInput added in v0.80.0

type TranslationAssignmentDashboardSummaryInput struct {
	TenantID     string
	OrgID        string
	ActorID      string
	Now          time.Time
	OverdueLimit int
}

type TranslationAssignmentFamilyAssignmentsQueryInput added in v0.82.1

type TranslationAssignmentFamilyAssignmentsQueryInput struct {
	FamilyID    string
	Filter      translationAssignmentListFilter
	Page        int
	PerPage     int
	Environment string
	Now         time.Time
}

type TranslationAssignmentFamilyAssignmentsQueryResult added in v0.82.1

type TranslationAssignmentFamilyAssignmentsQueryResult struct {
	Items   []TranslationAssignment
	Total   int
	HasNext bool
}

type TranslationAssignmentFamilyGroup added in v0.82.1

type TranslationAssignmentFamilyGroup struct {
	FamilyID                    string
	FamilyLabel                 string
	EntityType                  string
	SourceRecordID              string
	SourceLocale                string
	SourceTitle                 string
	SourcePath                  string
	AssignmentCount             int
	LocaleCount                 int
	TargetLocales               []string
	StatusCounts                map[string]int
	DueStateCounts              map[string]int
	PriorityCounts              map[string]int
	FamilyBlockerCount          *int
	FamilyBlockerCountAvailable bool
	FamilyBlockerCountReason    string
	ActionHints                 map[string]int
	CreatedAt                   time.Time
	UpdatedAt                   time.Time
	DueDate                     *time.Time
	DueState                    string
	Priority                    Priority
}

type TranslationAssignmentFamilyGroupQueryInput added in v0.82.1

type TranslationAssignmentFamilyGroupQueryInput struct {
	Filter      translationAssignmentListFilter
	Page        int
	PerPage     int
	Environment string
	Now         time.Time
}

type TranslationAssignmentFamilyGroupQueryResult added in v0.82.1

type TranslationAssignmentFamilyGroupQueryResult struct {
	Families        []TranslationAssignmentFamilyGroup
	FamilyTotal     int
	AssignmentTotal int
}

type TranslationAssignmentFamilyOptionQueryInput added in v0.113.5

type TranslationAssignmentFamilyOptionQueryInput struct {
	Filters           map[string]any
	Search            string
	SelectedFamilyIDs []string
	Page              int
	PerPage           int
	Now               time.Time
}

type TranslationAssignmentFamilyOptionQueryResult added in v0.113.5

type TranslationAssignmentFamilyOptionQueryResult struct {
	Options []TranslationAssignmentGroupOption
}

type TranslationAssignmentFamilyOptionQueryStore added in v0.113.5

type TranslationAssignmentFamilyOptionQueryStore interface {
	ListAssignmentFamilyOptions(ctx context.Context, input TranslationAssignmentFamilyOptionQueryInput) (TranslationAssignmentFamilyOptionQueryResult, error)
}

type TranslationAssignmentGroupOption added in v0.100.0

type TranslationAssignmentGroupOption struct {
	FamilyID    string
	SourceTitle string
	SourcePath  string
	EntityType  string
}

type TranslationAssignmentMyWorkSummaryInput added in v0.80.0

type TranslationAssignmentMyWorkSummaryInput struct {
	Filters map[string]any
	Now     time.Time
}

type TranslationAssignmentOptionStore added in v0.100.0

type TranslationAssignmentOptionStore interface {
	DistinctAssignmentEntityTypes(ctx context.Context) ([]string, error)
	DistinctAssignmentLocales(ctx context.Context, filters map[string]any) ([]string, error)
	DistinctAssignmentTranslationGroups(ctx context.Context, filters map[string]any) ([]TranslationAssignmentGroupOption, error)
}

type TranslationAssignmentPageQueryInput added in v0.80.0

type TranslationAssignmentPageQueryInput struct {
	Filter      translationAssignmentListFilter
	Page        int
	PerPage     int
	Environment string
	Now         time.Time
}

type TranslationAssignmentPageQueryResult added in v0.80.0

type TranslationAssignmentPageQueryResult struct {
	Items []TranslationAssignment
	Total int
}

type TranslationAssignmentPageQueryStore added in v0.80.0

type TranslationAssignmentPageQueryStore interface {
	ListAssignmentPage(ctx context.Context, input TranslationAssignmentPageQueryInput) (TranslationAssignmentPageQueryResult, error)
}

type TranslationAssignmentPanelRepository added in v0.25.0

type TranslationAssignmentPanelRepository struct {
	// contains filtered or unexported fields
}

TranslationAssignmentPanelRepository adapts typed queue storage to panel CRUD contracts.

func NewTranslationAssignmentPanelRepository added in v0.25.0

func NewTranslationAssignmentPanelRepository(repo TranslationAssignmentRepository) *TranslationAssignmentPanelRepository

NewTranslationAssignmentPanelRepository wraps a typed assignment repository for panel usage.

func (*TranslationAssignmentPanelRepository) Create added in v0.25.0

func (r *TranslationAssignmentPanelRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

func (*TranslationAssignmentPanelRepository) Delete added in v0.25.0

func (*TranslationAssignmentPanelRepository) Get added in v0.25.0

func (*TranslationAssignmentPanelRepository) List added in v0.25.0

func (*TranslationAssignmentPanelRepository) Update added in v0.25.0

func (r *TranslationAssignmentPanelRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

type TranslationAssignmentQueueSummary added in v0.80.0

type TranslationAssignmentQueueSummary struct {
	Total        int
	ByQueueState map[string]int
	ByDueState   map[string]int
}

type TranslationAssignmentQueueSummaryInput added in v0.80.0

type TranslationAssignmentQueueSummaryInput struct {
	Filters map[string]any
	Now     time.Time
}

type TranslationAssignmentRepository added in v0.25.0

type TranslationAssignmentRepository interface {
	List(ctx context.Context, opts ListOptions) ([]TranslationAssignment, int, error)
	Create(ctx context.Context, assignment TranslationAssignment) (TranslationAssignment, error)
	CreateOrReuseActive(ctx context.Context, assignment TranslationAssignment) (TranslationAssignment, bool, error)
	Get(ctx context.Context, id string) (TranslationAssignment, error)
	Update(ctx context.Context, assignment TranslationAssignment, expectedVersion int64) (TranslationAssignment, error)
}

TranslationAssignmentRepository stores translation queue assignments.

type TranslationAssignmentResourceAdapter added in v0.86.0

type TranslationAssignmentResourceAdapter struct {
	// contains filtered or unexported fields
}

func NewTranslationAssignmentResourceAdapter added in v0.86.0

func NewTranslationAssignmentResourceAdapter(a *Admin) *TranslationAssignmentResourceAdapter

func (*TranslationAssignmentResourceAdapter) FamilyAssignments added in v0.93.0

func (*TranslationAssignmentResourceAdapter) Index added in v0.86.0

func (*TranslationAssignmentResourceAdapter) Show added in v0.86.0

type TranslationAssignmentReviewerAggregateInput added in v0.80.0

type TranslationAssignmentReviewerAggregateInput struct {
	TenantID string
	OrgID    string
	ActorID  string
	Now      time.Time
}

type TranslationAssignmentReviewerAggregateStore added in v0.91.0

type TranslationAssignmentReviewerAggregateStore interface {
	AssignmentReviewerAggregateSummary(ctx context.Context, input TranslationAssignmentReviewerAggregateInput) (TranslationAssignmentReviewerAggregateSummary, error)
}

type TranslationAssignmentReviewerAggregateSummary added in v0.91.0

type TranslationAssignmentReviewerAggregateSummary struct {
	Counts      map[string]int
	Unavailable []string
	Degraded    []string
}

type TranslationAssignmentReviewerSummaryStore added in v0.80.0

type TranslationAssignmentReviewerSummaryStore interface {
	AssignmentReviewerAggregateCounts(ctx context.Context, input TranslationAssignmentReviewerAggregateInput) (map[string]int, error)
}

type TranslationAssignmentSnapshotQueryInput added in v0.82.1

type TranslationAssignmentSnapshotQueryInput struct {
	Filter      translationAssignmentListFilter
	Environment string
	Now         time.Time
	Limit       int
}

type TranslationAssignmentSnapshotQueryResult added in v0.82.1

type TranslationAssignmentSnapshotQueryResult struct {
	Selections []TranslationAssignmentSnapshotSelection
	Total      int
}

type TranslationAssignmentSnapshotQueryStore added in v0.82.1

type TranslationAssignmentSnapshotQueryStore interface {
	ListAssignmentSnapshot(ctx context.Context, input TranslationAssignmentSnapshotQueryInput) (TranslationAssignmentSnapshotQueryResult, error)
}

type TranslationAssignmentSnapshotSelection added in v0.82.1

type TranslationAssignmentSnapshotSelection struct {
	AssignmentID     string
	ExpectedVersion  int64
	OriginalPosition int
}

type TranslationAssignmentSummaryStore added in v0.80.0

type TranslationAssignmentSummaryStore interface {
	AssignmentQueueSummary(ctx context.Context, input TranslationAssignmentQueueSummaryInput) (TranslationAssignmentQueueSummary, error)
	AssignmentMyWorkSummary(ctx context.Context, input TranslationAssignmentMyWorkSummaryInput) (map[string]int, error)
	AssignmentDashboardSummary(ctx context.Context, input TranslationAssignmentDashboardSummaryInput) (TranslationAssignmentDashboardSummary, error)
}

type TranslationAssignmentVersionConflictError added in v0.25.0

type TranslationAssignmentVersionConflictError struct {
	AssignmentID    string `json:"assignment_id"`
	ExpectedVersion int64  `json:"expected_version"`
	ActualVersion   int64  `json:"actual_version"`
}

TranslationAssignmentVersionConflictError captures optimistic locking conflicts.

func (TranslationAssignmentVersionConflictError) Error added in v0.25.0

func (TranslationAssignmentVersionConflictError) Unwrap added in v0.25.0

type TranslationBundle added in v0.24.0

type TranslationBundle[T any] = cmsinterfaces.TranslationBundle[T]

TranslationBundle wraps requested/resolved translations with locale metadata.

type TranslationCheckOptions added in v0.24.0

type TranslationCheckOptions = cmsinterfaces.TranslationCheckOptions

TranslationCheckOptions mirrors go-cms translation check options.

type TranslationCreateInput added in v0.25.0

type TranslationCreateInput struct {
	SourceID     string         `json:"source_id"`
	Locale       string         `json:"locale"`
	Environment  string         `json:"environment"`
	PolicyEntity string         `json:"policy_entity"`
	ContentType  string         `json:"content_type"`
	Status       string         `json:"status"`
	Path         string         `json:"path"`
	RouteKey     string         `json:"route_key"`
	Metadata     map[string]any `json:"metadata"`
}

TranslationCreateInput captures canonical translation creation intent.

type TranslationDashboardFamilyMetrics added in v0.80.0

type TranslationDashboardFamilyMetrics struct {
	BlockedFamilies         int
	MissingRequiredFamilies int
	TopBlocked              []translationservices.FamilyRecord
}

type TranslationDashboardFamilyMetricsInput added in v0.80.0

type TranslationDashboardFamilyMetricsInput struct {
	TenantID     string
	OrgID        string
	BlockedLimit int
}

type TranslationDashboardFamilyMetricsStore added in v0.80.0

type TranslationDashboardFamilyMetricsStore interface {
	TranslationDashboardFamilyMetrics(context.Context, TranslationDashboardFamilyMetricsInput) (TranslationDashboardFamilyMetrics, error)
}

type TranslationEditorMemorySuggestion added in v0.80.0

type TranslationEditorMemorySuggestion struct {
	Family        translationservices.FamilyRecord
	SourceVariant translationservices.FamilyVariant
	TargetVariant translationservices.FamilyVariant
	FieldPath     string
	SourceText    string
	SuggestedText string
}

type TranslationEditorMemorySuggestionInput added in v0.80.0

type TranslationEditorMemorySuggestionInput struct {
	TenantID          string
	OrgID             string
	ContentType       string
	SourceLocale      string
	TargetLocale      string
	ExcludeFamilyID   string
	FieldSources      map[string]string
	Limit             int
	CandidateRowLimit int
}

type TranslationEditorMemorySuggestionStore added in v0.80.0

type TranslationEditorMemorySuggestionStore interface {
	TranslationEditorMemorySuggestions(context.Context, TranslationEditorMemorySuggestionInput) ([]TranslationEditorMemorySuggestion, error)
}

type TranslationExchangeApplier added in v0.25.0

type TranslationExchangeApplier interface {
	ApplyImport(ctx context.Context, input TranslationImportApplyInput) (TranslationExchangeResult, error)
}

TranslationExchangeApplier defines import apply behavior for command handlers.

type TranslationExchangeApplyDefaults added in v0.92.0

type TranslationExchangeApplyDefaults struct {
	AllowCreateMissing      *bool `koanf:"allow_create_missing" json:"allow_create_missing,omitempty" yaml:"allow_create_missing,omitempty"`
	AllowSourceHashOverride *bool `koanf:"allow_source_hash_override" json:"allow_source_hash_override,omitempty" yaml:"allow_source_hash_override,omitempty"`
	ContinueOnError         *bool `koanf:"continue_on_error" json:"continue_on_error,omitempty" yaml:"continue_on_error,omitempty"`
	DryRun                  *bool `koanf:"dry_run" json:"dry_run,omitempty" yaml:"dry_run,omitempty"`
}

TranslationExchangeApplyDefaults configures import/apply wizard option defaults.

type TranslationExchangeApplyRequest added in v0.25.0

type TranslationExchangeApplyRequest struct {
	Key               TranslationExchangeLinkageKey `json:"key"`
	TranslatedText    string                        `json:"translated_text"`
	CreateTranslation bool                          `json:"create_translation"`
	WorkflowStatus    string                        `json:"workflow_status"`
	Path              string                        `json:"path,omitempty"`
	RouteKey          string                        `json:"route_key,omitempty"`
}

type TranslationExchangeConflictError added in v0.25.0

type TranslationExchangeConflictError struct {
	Type               string `json:"type"`
	Index              int    `json:"index"`
	Resource           string `json:"resource"`
	EntityID           string `json:"entity_id"`
	FamilyID           string `json:"family_id"`
	TargetLocale       string `json:"target_locale"`
	FieldPath          string `json:"field_path"`
	CurrentSourceHash  string `json:"current_source_hash"`
	ProvidedSourceHash string `json:"provided_source_hash"`
}

TranslationExchangeConflictError captures row-level deterministic linkage conflicts.

func (TranslationExchangeConflictError) Error added in v0.25.0

func (TranslationExchangeConflictError) Unwrap added in v0.25.0

type TranslationExchangeConflictInfo added in v0.25.0

type TranslationExchangeConflictInfo struct {
	Type               string `json:"type"`
	Message            string `json:"message,omitempty"`
	CurrentSourceHash  string `json:"current_source_hash,omitempty"`
	ProvidedSourceHash string `json:"provided_source_hash,omitempty"`
}

TranslationExchangeConflictInfo captures deterministic row conflict metadata.

type TranslationExchangeConflictResolution added in v0.27.0

type TranslationExchangeConflictResolution struct {
	Row          int    `json:"row"`
	Decision     string `json:"decision"`
	ConflictType string `json:"conflict_type,omitempty"`
}

TranslationExchangeConflictResolution captures an explicit row-level retry decision.

type TranslationExchangeExporter added in v0.25.0

type TranslationExchangeExporter interface {
	Export(ctx context.Context, input TranslationExportInput) (TranslationExportResult, error)
}

TranslationExchangeExporter defines export behavior for command handlers.

type TranslationExchangeInvalidPayloadError added in v0.25.0

type TranslationExchangeInvalidPayloadError struct {
	Message  string         `json:"message"`
	Field    string         `json:"field"`
	Format   string         `json:"format"`
	Metadata map[string]any `json:"metadata"`
}

TranslationExchangeInvalidPayloadError captures invalid payload details.

func (TranslationExchangeInvalidPayloadError) Error added in v0.25.0

func (TranslationExchangeInvalidPayloadError) Unwrap added in v0.25.0

type TranslationExchangeLinkage added in v0.25.0

type TranslationExchangeLinkage struct {
	Key          TranslationExchangeLinkageKey `json:"key"`
	SourceHash   string                        `json:"source_hash"`
	TargetExists bool                          `json:"target_exists"`
}

type TranslationExchangeLinkageKey added in v0.25.0

type TranslationExchangeLinkageKey struct {
	Resource     string `json:"resource"`
	EntityID     string `json:"entity_id"`
	FamilyID     string `json:"family_id"`
	TargetLocale string `json:"target_locale"`
	FieldPath    string `json:"field_path"`
}

func ResolveTranslationExchangeLinkageKey added in v0.25.0

func ResolveTranslationExchangeLinkageKey(row TranslationExchangeRow) (TranslationExchangeLinkageKey, error)

ResolveTranslationExchangeLinkageKey canonicalizes deterministic row linkage identifiers.

func (TranslationExchangeLinkageKey) String added in v0.25.0

type TranslationExchangeLocaleOption added in v0.92.0

type TranslationExchangeLocaleOption struct {
	Code  string `koanf:"code" json:"code" yaml:"code"`
	Label string `koanf:"label" json:"label,omitempty" yaml:"label,omitempty"`
}

TranslationExchangeLocaleOption describes a selectable locale.

type TranslationExchangeResourceOption added in v0.92.0

type TranslationExchangeResourceOption struct {
	ID    string `koanf:"id" json:"id" yaml:"id"`
	Label string `koanf:"label" json:"label,omitempty" yaml:"label,omitempty"`
}

TranslationExchangeResourceOption describes a selectable exchange resource.

type TranslationExchangeResult added in v0.25.0

type TranslationExchangeResult struct {
	Summary   TranslationExchangeSummary     `json:"summary"`
	Results   []TranslationExchangeRowResult `json:"results"`
	TotalRows int                            `json:"total_rows,omitempty"`
}

TranslationExchangeResult captures structured validate/apply responses.

func (*TranslationExchangeResult) Add added in v0.25.0

Add appends a row result and updates aggregate counters.

type TranslationExchangeRow added in v0.25.0

type TranslationExchangeRow struct {
	Index             int            `json:"index,omitempty"`
	Resource          string         `json:"resource"`
	EntityID          string         `json:"entity_id"`
	FamilyID          string         `json:"family_id"`
	SourceLocale      string         `json:"source_locale,omitempty"`
	TargetLocale      string         `json:"target_locale"`
	FieldPath         string         `json:"field_path"`
	SourceText        string         `json:"source_text,omitempty"`
	TranslatedText    string         `json:"translated_text,omitempty"`
	SourceHash        string         `json:"source_hash,omitempty"`
	CreateTranslation bool           `json:"create_translation,omitempty"`
	Path              string         `json:"path,omitempty"`
	RouteKey          string         `json:"route_key,omitempty"`
	Title             string         `json:"title,omitempty"`
	Status            string         `json:"status,omitempty"`
	Notes             string         `json:"notes,omitempty"`
	Metadata          map[string]any `json:"metadata,omitempty"`
}

TranslationExchangeRow defines a normalized translation row used by command handlers.

type TranslationExchangeRowResult added in v0.25.0

type TranslationExchangeRowResult struct {
	Index        int                              `json:"index"`
	Resource     string                           `json:"resource"`
	EntityID     string                           `json:"entity_id"`
	FamilyID     string                           `json:"family_id"`
	TargetLocale string                           `json:"target_locale"`
	FieldPath    string                           `json:"field_path"`
	Status       string                           `json:"status"`
	Error        string                           `json:"error,omitempty"`
	Conflict     *TranslationExchangeConflictInfo `json:"conflict,omitempty"`
	Metadata     map[string]any                   `json:"metadata,omitempty"`
}

TranslationExchangeRowResult captures per-row validate/apply status.

type TranslationExchangeRuntime added in v0.27.0

type TranslationExchangeRuntime struct {
	// contains filtered or unexported fields
}

func NewTranslationExchangeRuntime added in v0.27.0

func (*TranslationExchangeRuntime) Configure added in v0.27.0

func (*TranslationExchangeRuntime) DeleteJob added in v0.27.0

func (r *TranslationExchangeRuntime) DeleteJob(ctx context.Context, identity translationTransportIdentity, id string) (translationExchangeAsyncJob, bool, error)

func (*TranslationExchangeRuntime) GetJob added in v0.27.0

func (r *TranslationExchangeRuntime) GetJob(ctx context.Context, identity translationTransportIdentity, id string) (translationExchangeAsyncJob, bool, error)

func (*TranslationExchangeRuntime) ListJobs added in v0.27.0

func (r *TranslationExchangeRuntime) ListJobs(ctx context.Context, query translationExchangeJobQuery) ([]translationExchangeAsyncJob, int, error)

func (*TranslationExchangeRuntime) QueueApply added in v0.27.0

func (r *TranslationExchangeRuntime) QueueApply(ctx context.Context, identity translationTransportIdentity, job translationExchangeAsyncJob, rows []TranslationExchangeRow) (translationExchangeAsyncJob, bool, error)

func (*TranslationExchangeRuntime) QueueExport added in v0.27.0

func (r *TranslationExchangeRuntime) QueueExport(ctx context.Context, job translationExchangeAsyncJob) (translationExchangeAsyncJob, error)

func (*TranslationExchangeRuntime) RecordCompletedJob added in v0.27.0

func (r *TranslationExchangeRuntime) RecordCompletedJob(ctx context.Context, job translationExchangeAsyncJob, rows []TranslationExchangeRow, result map[string]any) (translationExchangeAsyncJob, error)

func (*TranslationExchangeRuntime) Start added in v0.27.0

type TranslationExchangeRuntimeStore added in v0.27.0

type TranslationExchangeRuntimeStore interface {
	CreateJob(context.Context, translationExchangeAsyncJob) (translationExchangeAsyncJob, error)
	CreateOrGetApplyJob(context.Context, translationTransportIdentity, translationExchangeAsyncJob, []TranslationExchangeRow) (translationExchangeAsyncJob, bool, error)
	FindJobByRequestHash(context.Context, string, translationTransportIdentity, string) (translationExchangeAsyncJob, bool, error)
	GetJob(context.Context, translationTransportIdentity, string) (translationExchangeAsyncJob, bool, error)
	ListJobs(context.Context, translationExchangeJobQuery) ([]translationExchangeAsyncJob, int, error)
	DeleteJob(context.Context, translationTransportIdentity, string) (translationExchangeAsyncJob, bool, error)
	SaveJobRows(context.Context, translationExchangeAsyncJob, []TranslationExchangeRow) error
	ListJobRows(context.Context, string) ([]translationExchangeStoredRow, error)
	UpsertJobRow(context.Context, string, translationExchangeStoredRow) error
	ReplaceJobArtifacts(context.Context, translationExchangeAsyncJob, []translationExchangeJobArtifact) error
	ClaimJob(context.Context, string, string, time.Time, time.Time) (translationExchangeAsyncJob, bool, error)
	HeartbeatJob(context.Context, string, string, map[string]any, time.Time, time.Time) error
	CompleteJob(context.Context, string, string, map[string]any, map[string]any, map[string]any, time.Time) (translationExchangeAsyncJob, error)
	FailJob(context.Context, string, string, map[string]any, error, time.Time) (translationExchangeAsyncJob, error)
	ListRecoverableJobs(context.Context, time.Time, int) ([]translationExchangeAsyncJob, error)
	LookupApplyRecord(context.Context, translationTransportIdentity, string, string) (translationExchangeAppliedRecord, bool, error)
	RecordApplyRecord(context.Context, translationTransportIdentity, translationExchangeAppliedRecord) (translationExchangeAppliedRecord, bool, error)
	ReserveApplyRecord(context.Context, translationTransportIdentity, string, string, time.Time, time.Time) (translationExchangeApplyReservation, translationExchangeAppliedRecord, string, error)
	CommitApplyRecord(context.Context, translationExchangeApplyReservation, translationExchangeAppliedRecord) (translationExchangeAppliedRecord, error)
	ReleaseApplyRecord(context.Context, translationExchangeApplyReservation) error
}

TranslationExchangeRuntimeStore persists async exchange jobs, artifacts, row state, and apply dedupe records.

type TranslationExchangeService added in v0.25.0

type TranslationExchangeService struct {
	// contains filtered or unexported fields
}

TranslationExchangeService contains transport-agnostic exchange domain behavior.

func NewTranslationExchangeService added in v0.25.0

func NewTranslationExchangeService(store TranslationExchangeStore, opts ...TranslationExchangeServiceOption) *TranslationExchangeService

func (*TranslationExchangeService) ApplyImport added in v0.25.0

func (*TranslationExchangeService) Export added in v0.25.0

func (*TranslationExchangeService) ValidateImport added in v0.25.0

type TranslationExchangeServiceOption added in v0.27.0

type TranslationExchangeServiceOption func(*TranslationExchangeService)

func WithTranslationExchangeApplyRecordStore added in v0.27.0

func WithTranslationExchangeApplyRecordStore(store translationExchangeApplyRecordStore) TranslationExchangeServiceOption

type TranslationExchangeStore added in v0.25.0

type TranslationExchangeStore interface {
	ExportRows(ctx context.Context, filter TranslationExportFilter) ([]TranslationExchangeRow, error)
	ResolveLinkage(ctx context.Context, key TranslationExchangeLinkageKey) (TranslationExchangeLinkage, error)
	ApplyTranslation(ctx context.Context, req TranslationExchangeApplyRequest) error
}

TranslationExchangeStore abstracts deterministic linkage resolution and row writes.

type TranslationExchangeSummary added in v0.25.0

type TranslationExchangeSummary struct {
	Processed      int            `json:"processed"`
	Succeeded      int            `json:"succeeded"`
	Failed         int            `json:"failed"`
	Conflicts      int            `json:"conflicts,omitempty"`
	Skipped        int            `json:"skipped,omitempty"`
	PartialSuccess bool           `json:"partial_success,omitempty"`
	ByStatus       map[string]int `json:"by_status,omitempty"`
	ByConflict     map[string]int `json:"by_conflict,omitempty"`
}

TranslationExchangeSummary captures aggregate validate/apply outcomes.

type TranslationExchangeTemplateOption added in v0.92.0

type TranslationExchangeTemplateOption struct {
	Label    string `koanf:"label" json:"label,omitempty" yaml:"label,omitempty"`
	Format   string `koanf:"format" json:"format,omitempty" yaml:"format,omitempty"`
	Href     string `koanf:"href" json:"href,omitempty" yaml:"href,omitempty"`
	Filename string `koanf:"filename" json:"filename,omitempty" yaml:"filename,omitempty"`
}

TranslationExchangeTemplateOption configures the template download affordance.

type TranslationExchangeUIConfig added in v0.92.0

type TranslationExchangeUIConfig struct {
	Configured           bool                                `koanf:"configured" json:"configured,omitempty" yaml:"configured,omitempty"`
	SourceLocale         string                              `koanf:"source_locale" json:"source_locale,omitempty" yaml:"source_locale,omitempty"`
	SourceLocales        []TranslationExchangeLocaleOption   `koanf:"source_locales" json:"source_locales,omitempty" yaml:"source_locales,omitempty"`
	TargetLocales        []TranslationExchangeLocaleOption   `koanf:"target_locales" json:"target_locales,omitempty" yaml:"target_locales,omitempty"`
	LocaleLabels         map[string]string                   `koanf:"locale_labels" json:"locale_labels,omitempty" yaml:"locale_labels,omitempty"`
	Resources            []TranslationExchangeResourceOption `koanf:"resources" json:"resources,omitempty" yaml:"resources,omitempty"`
	DefaultResources     []string                            `koanf:"default_resources" json:"default_resources,omitempty" yaml:"default_resources,omitempty"`
	DefaultTargetLocales []string                            `koanf:"default_target_locales" json:"default_target_locales,omitempty" yaml:"default_target_locales,omitempty"`
	IncludeSourceHash    *bool                               `koanf:"include_source_hash" json:"include_source_hash,omitempty" yaml:"include_source_hash,omitempty"`
	IncludeExamples      *bool                               `koanf:"include_examples" json:"include_examples,omitempty" yaml:"include_examples,omitempty"`
	Template             TranslationExchangeTemplateOption   `koanf:"template" json:"template" yaml:"template,omitempty"`
	Apply                TranslationExchangeApplyDefaults    `koanf:"apply" json:"apply" yaml:"apply,omitempty"`
}

TranslationExchangeUIConfig carries JSON-safe exchange wizard settings for SSR and client enhancement. Host-facing packages may alias this type.

type TranslationExchangeUnsupportedFormatError added in v0.25.0

type TranslationExchangeUnsupportedFormatError struct {
	Format    string   `json:"format"`
	Supported []string `json:"supported"`
}

TranslationExchangeUnsupportedFormatError captures unsupported upload format details.

func (TranslationExchangeUnsupportedFormatError) Error added in v0.25.0

func (TranslationExchangeUnsupportedFormatError) Unwrap added in v0.25.0

type TranslationExchangeValidator added in v0.25.0

type TranslationExchangeValidator interface {
	ValidateImport(ctx context.Context, input TranslationImportValidateInput) (TranslationExchangeResult, error)
}

TranslationExchangeValidator defines import validate behavior for command handlers.

type TranslationExportCommand added in v0.25.0

type TranslationExportCommand struct {
	Service TranslationExchangeExporter `json:"service"`
}

func (*TranslationExportCommand) CLIHandler added in v0.25.0

func (c *TranslationExportCommand) CLIHandler() any

func (*TranslationExportCommand) CLIOptions added in v0.25.0

func (*TranslationExportCommand) Execute added in v0.25.0

type TranslationExportFilter added in v0.25.0

type TranslationExportFilter struct {
	Resources         []string       `json:"resources"`
	EntityIDs         []string       `json:"entity_ids,omitempty"`
	SourceLocale      string         `json:"source_locale,omitempty"`
	TargetLocales     []string       `json:"target_locales,omitempty"`
	FieldPaths        []string       `json:"field_paths,omitempty"`
	IncludeSourceHash bool           `json:"include_source_hash,omitempty"`
	Options           map[string]any `json:"options,omitempty"`
}

TranslationExportFilter captures normalized export criteria.

type TranslationExportInput added in v0.25.0

type TranslationExportInput struct {
	Filter TranslationExportFilter  `json:"filter"`
	Output *TranslationExportResult `json:"-"`
}

TranslationExportInput is the typed export command input.

func (TranslationExportInput) Type added in v0.25.0

func (TranslationExportInput) Validate added in v0.25.0

func (m TranslationExportInput) Validate() error

type TranslationExportResult added in v0.25.0

type TranslationExportResult struct {
	RowCount int                      `json:"row_count"`
	Format   string                   `json:"format,omitempty"`
	Rows     []TranslationExchangeRow `json:"rows,omitempty"`
}

TranslationExportResult captures exported rows and aggregate metadata.

type TranslationFamilyAssignCommand added in v0.86.0

type TranslationFamilyAssignCommand struct {
	Binding *translationFamilyBinding `json:"binding"`
}

func (*TranslationFamilyAssignCommand) Execute added in v0.86.0

type TranslationFamilyAssignInput added in v0.86.0

type TranslationFamilyAssignInput struct {
	FamilyID     string                         `json:"family_id"`
	Scope        translationservices.Scope      `json:"scope"`
	ActorID      string                         `json:"actor_id"`
	TargetLocale string                         `json:"target_locale"`
	AssigneeID   string                         `json:"assignee_id"`
	OpenPool     bool                           `json:"open_pool"`
	Priority     Priority                       `json:"priority"`
	PrioritySet  bool                           `json:"-"`
	DueDate      *time.Time                     `json:"due_date"`
	WorkScope    string                         `json:"work_scope"`
	Channel      string                         `json:"channel"`
	Result       *TranslationFamilyAssignResult `json:"-"`
}

TranslationFamilyAssignInput is the transport-neutral command input for assigning or creating one translation-family assignment.

func (TranslationFamilyAssignInput) Validate added in v0.86.0

func (msg TranslationFamilyAssignInput) Validate() error

type TranslationFamilyAssignResult added in v0.86.0

type TranslationFamilyAssignResult struct {
	Family           translationservices.FamilyRecord `json:"family"`
	Assignment       TranslationAssignment            `json:"assignment"`
	AssignmentReused bool                             `json:"assignment_reused"`
}

TranslationFamilyAssignResult contains only domain data produced by the command; presentation payloads are built by route responders.

type TranslationFamilyResourceAdapter added in v0.86.0

type TranslationFamilyResourceAdapter struct {
	// contains filtered or unexported fields
}

func NewTranslationFamilyResourceAdapter added in v0.86.0

func NewTranslationFamilyResourceAdapter(a *Admin) *TranslationFamilyResourceAdapter

func (*TranslationFamilyResourceAdapter) Index added in v0.86.0

func (*TranslationFamilyResourceAdapter) Show added in v0.86.0

type TranslationImportApplyCommand added in v0.25.0

type TranslationImportApplyCommand struct {
	Service TranslationExchangeApplier `json:"service"`
}

func (*TranslationImportApplyCommand) CLIHandler added in v0.25.0

func (c *TranslationImportApplyCommand) CLIHandler() any

func (*TranslationImportApplyCommand) CLIOptions added in v0.25.0

func (*TranslationImportApplyCommand) Execute added in v0.25.0

type TranslationImportApplyInput added in v0.25.0

type TranslationImportApplyInput struct {
	Rows                    []TranslationExchangeRow                `json:"rows"`
	AllowCreateMissing      bool                                    `json:"allow_create_missing,omitempty"`
	AllowSourceHashOverride bool                                    `json:"allow_source_hash_override,omitempty"`
	ContinueOnError         bool                                    `json:"continue_on_error,omitempty"`
	DryRun                  bool                                    `json:"dry_run,omitempty"`
	RetryJobID              string                                  `json:"retry_job_id,omitempty"`
	Resolutions             []TranslationExchangeConflictResolution `json:"resolutions,omitempty"`
	Result                  *TranslationExchangeResult              `json:"-"`
}

TranslationImportApplyInput is the typed import-apply command input.

func (TranslationImportApplyInput) Type added in v0.25.0

func (TranslationImportApplyInput) Validate added in v0.25.0

func (m TranslationImportApplyInput) Validate() error

type TranslationImportRunCommand added in v0.25.0

type TranslationImportRunCommand struct {
	Validator TranslationExchangeValidator `json:"validator"`
	Applier   TranslationExchangeApplier   `json:"applier"`
}

func (*TranslationImportRunCommand) CLIHandler added in v0.25.0

func (c *TranslationImportRunCommand) CLIHandler() any

func (*TranslationImportRunCommand) CLIOptions added in v0.25.0

func (*TranslationImportRunCommand) Execute added in v0.25.0

type TranslationImportRunInput added in v0.25.0

type TranslationImportRunInput struct {
	ValidateInput TranslationImportValidateInput `json:"validate"`
	ApplyInput    TranslationImportApplyInput    `json:"apply"`
	Result        *TranslationImportRunResult    `json:"-"`
}

TranslationImportRunInput is an optional typed wrapper that composes validate+apply.

func (TranslationImportRunInput) Type added in v0.25.0

func (TranslationImportRunInput) Validate added in v0.25.0

func (m TranslationImportRunInput) Validate() error

type TranslationImportRunResult added in v0.25.0

type TranslationImportRunResult struct {
	Validate TranslationExchangeResult `json:"validate"`
	Apply    TranslationExchangeResult `json:"apply"`
}

TranslationImportRunResult captures the optional run-command two-step result.

type TranslationImportRunTriggerBuilder added in v0.25.0

type TranslationImportRunTriggerBuilder func(context.Context, TranslationImportRunTriggerInput) (TranslationImportRunInput, error)

TranslationImportRunTriggerBuilder resolves scheduled/manual trigger input into a typed run input.

type TranslationImportRunTriggerCommand added in v0.25.0

type TranslationImportRunTriggerCommand struct {
	Schedule   string                             `json:"schedule"`
	BuildInput TranslationImportRunTriggerBuilder `json:"build_input"`
}

TranslationImportRunTriggerCommand composes run input and dispatches the run command.

func (*TranslationImportRunTriggerCommand) CronHandler added in v0.25.0

func (c *TranslationImportRunTriggerCommand) CronHandler() func() error

func (*TranslationImportRunTriggerCommand) CronOptions added in v0.25.0

func (*TranslationImportRunTriggerCommand) Execute added in v0.25.0

type TranslationImportRunTriggerInput added in v0.25.0

type TranslationImportRunTriggerInput struct {
	RunInput *TranslationImportRunInput `json:"run_input,omitempty"`
}

TranslationImportRunTriggerInput is a typed trigger message for scheduled imports.

func (TranslationImportRunTriggerInput) Type added in v0.25.0

func (TranslationImportRunTriggerInput) Validate added in v0.25.0

type TranslationImportValidateCommand added in v0.25.0

type TranslationImportValidateCommand struct {
	Service TranslationExchangeValidator `json:"service"`
}

func (*TranslationImportValidateCommand) CLIHandler added in v0.25.0

func (c *TranslationImportValidateCommand) CLIHandler() any

func (*TranslationImportValidateCommand) CLIOptions added in v0.25.0

func (*TranslationImportValidateCommand) Execute added in v0.25.0

type TranslationImportValidateInput added in v0.25.0

type TranslationImportValidateInput struct {
	Rows   []TranslationExchangeRow   `json:"rows"`
	Result *TranslationExchangeResult `json:"-"`
}

TranslationImportValidateInput is the typed import-validate command input.

func (TranslationImportValidateInput) Type added in v0.25.0

func (TranslationImportValidateInput) Validate added in v0.25.0

type TranslationLinkWidgetPayload added in v0.25.0

type TranslationLinkWidgetPayload struct {
	Label       string            `json:"label"`
	ResolverKey string            `json:"resolver_key,omitempty"`
	Group       string            `json:"group,omitempty"`
	Route       string            `json:"route,omitempty"`
	URL         string            `json:"url,omitempty"`
	Query       map[string]string `json:"query,omitempty"`
}

type TranslationMeta added in v0.24.0

type TranslationMeta = cmsinterfaces.TranslationMeta

TranslationMeta mirrors the go-cms translation metadata contract.

type TranslationMetrics added in v0.25.0

type TranslationMetrics interface {
	IncrementBlockedTransition(ctx context.Context, tags map[string]string)
	IncrementCreateAction(ctx context.Context, tags map[string]string)
	IncrementCreateLocaleAction(ctx context.Context, tags map[string]string)
	IncrementReviewAction(ctx context.Context, tags map[string]string)
	IncrementQAOutcome(ctx context.Context, tags map[string]string)
}

TranslationMetrics captures counters for translation workflow observability.

type TranslationPolicy added in v0.24.0

type TranslationPolicy interface {
	Validate(ctx context.Context, input TranslationPolicyInput) error
}

TranslationPolicy validates workflow transitions against translation requirements.

type TranslationPolicyFunc added in v0.24.0

type TranslationPolicyFunc func(context.Context, TranslationPolicyInput) error

TranslationPolicyFunc adapts a function into a TranslationPolicy.

func (TranslationPolicyFunc) Validate added in v0.24.0

Validate executes the policy function.

type TranslationPolicyInput added in v0.24.0

type TranslationPolicyInput struct {
	EntityType      string `json:"entity_type"`
	EntityID        string `json:"entity_id"`
	Transition      string `json:"transition"`
	Environment     string `json:"environment"`
	State           string `json:"state"`
	PolicyEntity    string `json:"policy_entity"`
	RequestedLocale string `json:"requested_locale"`
}

TranslationPolicyInput captures workflow context needed for translation checks.

type TranslationProgressWidgetPayload added in v0.25.0

type TranslationProgressWidgetPayload struct {
	Summary      TranslationSummaryWidgetPayload `json:"summary"`
	StatusCounts map[string]int                  `json:"status_counts"`
	LocaleCounts map[string]int                  `json:"locale_counts"`
	UpdatedAt    string                          `json:"updated_at"`
	// UpdatedAtLabel is a human-readable rendering of UpdatedAt for templates
	// without client-side relative-time enhancement.
	UpdatedAtLabel string                         `json:"updated_at_label,omitempty"`
	Links          []TranslationLinkWidgetPayload `json:"links"`
}

type TranslationQueueApproveCommand added in v0.25.0

type TranslationQueueApproveCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueApproveCommand dispatches approve lifecycle actions.

func (*TranslationQueueApproveCommand) Execute added in v0.25.0

type TranslationQueueApproveInput added in v0.25.0

type TranslationQueueApproveInput struct {
	AssignmentID     string                 `json:"assignment_id"`
	ReviewerID       string                 `json:"reviewer_id"`
	Comment          string                 `json:"comment,omitempty"`
	TerminologyNotes []string               `json:"terminology_notes,omitempty"`
	StyleNotes       []string               `json:"style_notes,omitempty"`
	ExpectedVersion  int64                  `json:"expected_version"`
	Result           *TranslationAssignment `json:"-"`
}

TranslationQueueApproveInput approves a review item.

func (TranslationQueueApproveInput) Type added in v0.25.0

func (TranslationQueueApproveInput) Validate added in v0.25.0

func (m TranslationQueueApproveInput) Validate() error

type TranslationQueueArchiveCommand added in v0.25.0

type TranslationQueueArchiveCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueArchiveCommand dispatches archive lifecycle actions.

func (*TranslationQueueArchiveCommand) Execute added in v0.25.0

type TranslationQueueArchiveInput added in v0.25.0

type TranslationQueueArchiveInput struct {
	AssignmentID    string                 `json:"assignment_id"`
	ActorID         string                 `json:"actor_id"`
	ExpectedVersion int64                  `json:"expected_version"`
	Result          *TranslationAssignment `json:"-"`
}

TranslationQueueArchiveInput archives a queue assignment.

func (TranslationQueueArchiveInput) Type added in v0.25.0

func (TranslationQueueArchiveInput) Validate added in v0.25.0

func (m TranslationQueueArchiveInput) Validate() error

type TranslationQueueAssignCommand added in v0.25.0

type TranslationQueueAssignCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueAssignCommand dispatches assign lifecycle actions.

func (*TranslationQueueAssignCommand) Execute added in v0.25.0

type TranslationQueueAssignInput added in v0.25.0

type TranslationQueueAssignInput struct {
	AssignmentID    string                 `json:"assignment_id"`
	AssigneeID      string                 `json:"assignee_id"`
	AssignerID      string                 `json:"assigner_id"`
	Priority        Priority               `json:"priority,omitempty"`
	DueDate         *time.Time             `json:"due_date,omitempty"`
	ExpectedVersion int64                  `json:"expected_version"`
	Result          *TranslationAssignment `json:"-"`
}

TranslationQueueAssignInput assigns an item to a translator.

func (TranslationQueueAssignInput) Type added in v0.25.0

func (TranslationQueueAssignInput) Validate added in v0.25.0

func (m TranslationQueueAssignInput) Validate() error

type TranslationQueueAutoCreateHook added in v0.25.0

type TranslationQueueAutoCreateHook interface {
	// OnTranslationBlocker is called when a workflow transition is blocked
	// due to missing required translations. It creates or reuses queue assignments
	// for each missing locale. This is a side-effect hook that must not alter
	// the primary policy response - errors are logged but not returned.
	OnTranslationBlocker(ctx context.Context, input TranslationQueueAutoCreateInput) TranslationQueueAutoCreateResult
}

TranslationQueueAutoCreateHook handles automatic queue item creation when translation policy blocks a transition due to missing locales.

type TranslationQueueAutoCreateInput added in v0.25.0

type TranslationQueueAutoCreateInput struct {
	FamilyID       string   `json:"family_id"`
	EntityType     string   `json:"entity_type"`
	EntityID       string   `json:"entity_id"`
	SourceLocale   string   `json:"source_locale"`
	MissingLocales []string `json:"missing_locales"`
	Transition     string   `json:"transition"`
	Environment    string   `json:"environment"`
	SourceTitle    string   `json:"source_title"`
	SourcePath     string   `json:"source_path"`
	ActorID        string   `json:"actor_id"`
	Priority       Priority `json:"priority"`
}

TranslationQueueAutoCreateInput captures the context needed to create queue items.

type TranslationQueueAutoCreateResult added in v0.25.0

type TranslationQueueAutoCreateResult struct {
	Created     int                     `json:"created"`
	Reused      int                     `json:"reused"`
	Failed      int                     `json:"failed"`
	Errors      []error                 `json:"errors"`
	Assignments []TranslationAssignment `json:"assignments"`
}

TranslationQueueAutoCreateResult captures the outcome of auto-create operations.

type TranslationQueueBulkArchiveCommand added in v0.25.0

type TranslationQueueBulkArchiveCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueBulkArchiveCommand dispatches bulk-archive lifecycle actions.

func (*TranslationQueueBulkArchiveCommand) Execute added in v0.25.0

type TranslationQueueBulkArchiveInput added in v0.25.0

type TranslationQueueBulkArchiveInput struct {
	AssignmentIDs []string                 `json:"assignment_ids"`
	ActorID       string                   `json:"actor_id"`
	Result        *[]TranslationAssignment `json:"-"`
}

TranslationQueueBulkArchiveInput bulk-archives queue items.

func (TranslationQueueBulkArchiveInput) Type added in v0.25.0

func (TranslationQueueBulkArchiveInput) Validate added in v0.25.0

type TranslationQueueBulkAssignCommand added in v0.25.0

type TranslationQueueBulkAssignCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueBulkAssignCommand dispatches bulk-assign lifecycle actions.

func (*TranslationQueueBulkAssignCommand) Execute added in v0.25.0

type TranslationQueueBulkAssignInput added in v0.25.0

type TranslationQueueBulkAssignInput struct {
	AssignmentIDs []string                 `json:"assignment_ids"`
	AssigneeID    string                   `json:"assignee_id"`
	AssignerID    string                   `json:"assigner_id"`
	Priority      Priority                 `json:"priority,omitempty"`
	DueDate       *time.Time               `json:"due_date,omitempty"`
	Result        *[]TranslationAssignment `json:"-"`
}

TranslationQueueBulkAssignInput bulk-assigns queue items.

func (TranslationQueueBulkAssignInput) Type added in v0.25.0

func (TranslationQueueBulkAssignInput) Validate added in v0.25.0

type TranslationQueueBulkPriorityCommand added in v0.25.0

type TranslationQueueBulkPriorityCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueBulkPriorityCommand dispatches bulk-priority lifecycle actions.

func (*TranslationQueueBulkPriorityCommand) Execute added in v0.25.0

type TranslationQueueBulkPriorityInput added in v0.25.0

type TranslationQueueBulkPriorityInput struct {
	AssignmentIDs []string                 `json:"assignment_ids"`
	Priority      Priority                 `json:"priority"`
	ActorID       string                   `json:"actor_id"`
	Result        *[]TranslationAssignment `json:"-"`
}

TranslationQueueBulkPriorityInput bulk-updates priority.

func (TranslationQueueBulkPriorityInput) Type added in v0.25.0

func (TranslationQueueBulkPriorityInput) Validate added in v0.25.0

type TranslationQueueBulkReleaseCommand added in v0.25.0

type TranslationQueueBulkReleaseCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueBulkReleaseCommand dispatches bulk-release lifecycle actions.

func (*TranslationQueueBulkReleaseCommand) Execute added in v0.25.0

type TranslationQueueBulkReleaseInput added in v0.25.0

type TranslationQueueBulkReleaseInput struct {
	AssignmentIDs []string                 `json:"assignment_ids"`
	ActorID       string                   `json:"actor_id"`
	Result        *[]TranslationAssignment `json:"-"`
}

TranslationQueueBulkReleaseInput bulk-releases queue items.

func (TranslationQueueBulkReleaseInput) Type added in v0.25.0

func (TranslationQueueBulkReleaseInput) Validate added in v0.25.0

type TranslationQueueClaimCommand added in v0.25.0

type TranslationQueueClaimCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueClaimCommand dispatches claim lifecycle actions.

func (*TranslationQueueClaimCommand) Execute added in v0.25.0

type TranslationQueueClaimInput added in v0.25.0

type TranslationQueueClaimInput struct {
	AssignmentID    string                 `json:"assignment_id"`
	ClaimerID       string                 `json:"claimer_id"`
	ExpectedVersion int64                  `json:"expected_version"`
	Result          *TranslationAssignment `json:"-"`
}

TranslationQueueClaimInput claims or starts an assignment in progress.

func (TranslationQueueClaimInput) Type added in v0.25.0

func (TranslationQueueClaimInput) Validate added in v0.25.0

func (m TranslationQueueClaimInput) Validate() error

type TranslationQueueRejectCommand added in v0.25.0

type TranslationQueueRejectCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueRejectCommand dispatches reject lifecycle actions.

func (*TranslationQueueRejectCommand) Execute added in v0.25.0

type TranslationQueueRejectInput added in v0.25.0

type TranslationQueueRejectInput struct {
	AssignmentID     string                 `json:"assignment_id"`
	ReviewerID       string                 `json:"reviewer_id"`
	Reason           string                 `json:"reason"`
	Comment          string                 `json:"comment,omitempty"`
	TerminologyNotes []string               `json:"terminology_notes,omitempty"`
	StyleNotes       []string               `json:"style_notes,omitempty"`
	ExpectedVersion  int64                  `json:"expected_version"`
	Result           *TranslationAssignment `json:"-"`
}

TranslationQueueRejectInput rejects a review item with required reason.

func (TranslationQueueRejectInput) Type added in v0.25.0

func (TranslationQueueRejectInput) Validate added in v0.25.0

func (m TranslationQueueRejectInput) Validate() error

type TranslationQueueReleaseCommand added in v0.25.0

type TranslationQueueReleaseCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueReleaseCommand dispatches release lifecycle actions.

func (*TranslationQueueReleaseCommand) Execute added in v0.25.0

type TranslationQueueReleaseInput added in v0.25.0

type TranslationQueueReleaseInput struct {
	AssignmentID    string                 `json:"assignment_id"`
	ActorID         string                 `json:"actor_id"`
	ExpectedVersion int64                  `json:"expected_version"`
	Result          *TranslationAssignment `json:"-"`
}

TranslationQueueReleaseInput returns an assignment back to open pool.

func (TranslationQueueReleaseInput) Type added in v0.25.0

func (TranslationQueueReleaseInput) Validate added in v0.25.0

func (m TranslationQueueReleaseInput) Validate() error

type TranslationQueueStatsFromRepository added in v0.25.0

type TranslationQueueStatsFromRepository struct {
	Repository TranslationAssignmentRepository `json:"repository"`
}

TranslationQueueStatsFromRepository computes queue stats from assignment storage.

func (*TranslationQueueStatsFromRepository) Snapshot added in v0.25.0

type TranslationQueueStatsService added in v0.25.0

type TranslationQueueStatsService interface {
	Snapshot(ctx context.Context) (TranslationQueueStatsSnapshot, error)
}

TranslationQueueStatsService provides aggregate queue metrics for dashboard providers.

type TranslationQueueStatsSnapshot added in v0.25.0

type TranslationQueueStatsSnapshot struct {
	Summary        map[string]int `json:"summary"`
	StatusCounts   map[string]int `json:"status_counts"`
	LocaleCounts   map[string]int `json:"locale_counts"`
	UpdatedAt      time.Time      `json:"updated_at"`
	AssignmentRows int            `json:"assignment_rows"`
}

TranslationQueueStatsSnapshot captures queue dashboard aggregate counts.

type TranslationQueueSubmitCommand added in v0.25.0

type TranslationQueueSubmitCommand struct {
	Service TranslationQueueService `json:"service"`
}

TranslationQueueSubmitCommand dispatches submit-review lifecycle actions.

func (*TranslationQueueSubmitCommand) Execute added in v0.25.0

type TranslationQueueSubmitInput added in v0.25.0

type TranslationQueueSubmitInput struct {
	AssignmentID    string                 `json:"assignment_id"`
	TranslatorID    string                 `json:"translator_id"`
	ExpectedVersion int64                  `json:"expected_version"`
	Result          *TranslationAssignment `json:"-"`
}

TranslationQueueSubmitInput submits in-progress work for review.

func (TranslationQueueSubmitInput) Type added in v0.25.0

func (TranslationQueueSubmitInput) Validate added in v0.25.0

func (m TranslationQueueSubmitInput) Validate() error

type TranslationQueueUIOptions added in v0.113.5

type TranslationQueueUIOptions struct {
	EnhancedFilterSelects  bool `json:"enhanced_filter_selects"`
	ReviewerOptionEndpoint bool `json:"reviewer_option_endpoint,omitempty"`
}

type TranslationRequirements added in v0.24.0

type TranslationRequirements struct {
	Locales                 []string                         `json:"locales"`
	SourceLocale            string                           `json:"source_locale,omitempty"`
	RequiredFields          map[string][]string              `json:"required_fields"`
	RequiredFieldsStrategy  RequiredFieldsValidationStrategy `json:"required_fields_strategy"`
	ReviewRequired          bool                             `json:"review_required"`
	AllowPublishOverride    bool                             `json:"allow_publish_override"`
	AssignmentLifecycleMode string                           `json:"assignment_lifecycle_mode"`
	DefaultWorkScope        string                           `json:"default_work_scope"`
}

TranslationRequirements captures required locales and optional field checks.

type TranslationRequirementsResolver added in v0.24.0

type TranslationRequirementsResolver interface {
	Requirements(ctx context.Context, input TranslationPolicyInput) (TranslationRequirements, bool, error)
}

TranslationRequirementsResolver resolves translation requirements for a transition.

type TranslationRequirementsResolverFunc added in v0.24.0

type TranslationRequirementsResolverFunc func(context.Context, TranslationPolicyInput) (TranslationRequirements, bool, error)

TranslationRequirementsResolverFunc adapts a function into a requirements resolver.

func (TranslationRequirementsResolverFunc) Requirements added in v0.24.0

Requirements executes the resolver function.

type TranslationSSRPage added in v0.86.0

type TranslationSSRPage struct {
	Surface      string         `json:"surface"`
	Title        string         `json:"title,omitempty"`
	Data         map[string]any `json:"data,omitempty"`
	Meta         map[string]any `json:"meta,omitempty"`
	DataGrid     map[string]any `json:"datagrid,omitempty"`
	Actions      map[string]any `json:"actions,omitempty"`
	Links        map[string]any `json:"links,omitempty"`
	Enhancement  map[string]any `json:"enhancement,omitempty"`
	Assignee     map[string]any `json:"assignee,omitempty"`
	EmptyState   map[string]any `json:"empty_state,omitempty"`
	ErrorState   map[string]any `json:"error_state,omitempty"`
	ResourceName string         `json:"resource_name,omitempty"`
}

type TranslationSSRPresenter added in v0.86.0

TranslationSSRPresenter is the exported boundary consumed by UI route wiring. It keeps translation SSR hydration owned by admin, where permissions, scope, action-state, lifecycle, and binding contracts already live.

func NewTranslationSSRPresenter added in v0.86.0

func NewTranslationSSRPresenter(a *Admin) TranslationSSRPresenter

type TranslationSSRPresenterInput added in v0.86.0

type TranslationSSRPresenterInput struct {
	BasePath           string
	APIBasePath        string
	DashboardPath      string
	QueuePath          string
	FamilyListPath     string
	FamilyBasePath     string
	MatrixPath         string
	ExchangePath       string
	EditorBasePath     string
	ContentBasePath    string
	MatrixAPIPath      string
	ExchangeAPIPath    string
	BulkActionAPIPath  string
	AssignmentID       string
	FamilyID           string
	Channel            string
	Query              map[string]string
	ExchangeUIConfig   TranslationExchangeUIConfig
	InitialPresetID    string
	SyncClientBasePath string
	EnhancedAction     EnhancedActionRuntimeOptions
	QueueUI            TranslationQueueUIOptions
}

type TranslationSSRResourceResult added in v0.86.0

type TranslationSSRResourceResult struct {
	Data     map[string]any `json:"data,omitempty"`
	Meta     map[string]any `json:"meta,omitempty"`
	DataGrid map[string]any `json:"datagrid,omitempty"`
}

type TranslationSuggestionActionEvaluator added in v0.110.0

type TranslationSuggestionActionEvaluator interface {
	EvaluateTranslationSuggestionAction(context.Context, TranslationSuggestionInput, TranslationSuggestionAssignmentContext) (TranslationSuggestionDecision, error)
}

TranslationSuggestionActionEvaluator can report safe field-level availability without invoking a provider.

type TranslationSuggestionAllowAllEligibility added in v0.110.0

type TranslationSuggestionAllowAllEligibility struct{}

TranslationSuggestionAllowAllEligibility is an explicit opt-in eligibility checker for tests or hosts that perform policy checks outside this service.

type TranslationSuggestionAssignmentContext added in v0.110.0

type TranslationSuggestionAssignmentContext struct {
	Assignment       TranslationAssignment `json:"assignment"`
	Environment      string                `json:"environment,omitempty"`
	EntityType       string                `json:"entity_type,omitempty"`
	SourceLocale     string                `json:"source_locale,omitempty"`
	TargetLocale     string                `json:"target_locale,omitempty"`
	SourceFields     map[string]string     `json:"source_fields,omitempty"`
	TargetFields     map[string]string     `json:"target_fields,omitempty"`
	SourceRecordID   string                `json:"source_record_id,omitempty"`
	TargetRecordID   string                `json:"target_record_id,omitempty"`
	SourceVersion    string                `json:"source_version,omitempty"`
	TargetRowVersion int64                 `json:"target_row_version,omitempty"`
}

TranslationSuggestionAssignmentContext is the server-loaded editor state needed by the suggestion service. Implementations should populate it from trusted repositories/loaders, not browser payloads.

type TranslationSuggestionAssistContextExtractor added in v0.110.0

type TranslationSuggestionAssistContextExtractor interface {
	TranslationSuggestionAssistContext(context.Context, TranslationSuggestionInput, TranslationSuggestionAssignmentContext) (map[string]any, error)
}

TranslationSuggestionAssistContextExtractor builds glossary/style/TM context that may be sent to the provider after eligibility checks pass.

type TranslationSuggestionContextLoader added in v0.110.0

type TranslationSuggestionContextLoader interface {
	LoadTranslationSuggestionContext(context.Context, TranslationAssignment, string) (TranslationSuggestionAssignmentContext, error)
}

TranslationSuggestionContextLoader reloads assignment/editor state from trusted server-side storage.

func NewTranslationSuggestionContextLoader added in v0.110.0

func NewTranslationSuggestionContextLoader(adm *Admin) TranslationSuggestionContextLoader

NewTranslationSuggestionContextLoader returns the built-in server-side editor context loader used by the default translation suggestion service.

type TranslationSuggestionDecision added in v0.110.0

type TranslationSuggestionDecision struct {
	Allowed     bool           `json:"allowed"`
	ReasonCode  string         `json:"reason_code,omitempty"`
	Reason      string         `json:"reason,omitempty"`
	Diagnostics map[string]any `json:"diagnostics,omitempty"`
}

TranslationSuggestionDecision describes a safe allow/deny outcome from provider policy, tenant opt-out, quota, and rate-limit checks.

type TranslationSuggestionDependencyConfigurer added in v0.110.0

type TranslationSuggestionDependencyConfigurer interface {
	ConfigureTranslationSuggestionServiceDependencies(TranslationSuggestionServiceDependencies)
}

TranslationSuggestionDependencyConfigurer is implemented by suggestion services that can receive admin/quickstart-owned dependencies after construction. Implementations should only fill unset dependencies.

type TranslationSuggestionEligibilityChecker added in v0.110.0

type TranslationSuggestionEligibilityChecker interface {
	EvaluateTranslationSuggestion(context.Context, TranslationSuggestionInput, TranslationSuggestionAssignmentContext) (TranslationSuggestionDecision, error)
}

TranslationSuggestionEligibilityChecker enforces provider policy, tenant opt-out, data residency, quota, and rate-limit rules before provider calls.

type TranslationSuggestionGenerateCommand added in v0.110.0

type TranslationSuggestionGenerateCommand struct {
	Service TranslationSuggestionService `json:"service"`
}

TranslationSuggestionGenerateCommand dispatches suggestion generation.

func (*TranslationSuggestionGenerateCommand) Execute added in v0.110.0

type TranslationSuggestionInput added in v0.110.0

type TranslationSuggestionInput struct {
	AssignmentID   string         `json:"assignment_id"`
	FieldPath      string         `json:"field_path"`
	ActorID        string         `json:"actor_id,omitempty"`
	TenantID       string         `json:"tenant_id,omitempty"`
	OrgID          string         `json:"org_id,omitempty"`
	Channel        string         `json:"channel,omitempty"`
	Environment    string         `json:"environment,omitempty"`
	RequestID      string         `json:"request_id,omitempty"`
	CorrelationID  string         `json:"correlation_id,omitempty"`
	IdempotencyKey string         `json:"idempotency_key,omitempty"`
	Metadata       map[string]any `json:"metadata,omitempty"`

	// SourceText is accepted only for compatibility/correlation diagnostics.
	// The default service ignores it and reloads source text server-side.
	SourceText string `json:"source_text,omitempty"`

	Result *TranslationSuggestionResult `json:"-"`
}

TranslationSuggestionInput is the transport-neutral command/service payload for generating a suggestion for one assignment field.

func (TranslationSuggestionInput) Type added in v0.110.0

func (TranslationSuggestionInput) Validate added in v0.110.0

func (m TranslationSuggestionInput) Validate() error

type TranslationSuggestionProvider added in v0.110.0

type TranslationSuggestionProvider interface {
	SuggestTranslation(context.Context, TranslationSuggestionProviderInput) (TranslationSuggestionProviderResult, error)
}

TranslationSuggestionProvider generates suggested text from sanitized input.

type TranslationSuggestionProviderInput added in v0.110.0

type TranslationSuggestionProviderInput struct {
	AssignmentID   string         `json:"assignment_id"`
	FieldPath      string         `json:"field_path"`
	EntityType     string         `json:"entity_type,omitempty"`
	SourceLocale   string         `json:"source_locale,omitempty"`
	TargetLocale   string         `json:"target_locale,omitempty"`
	SourceText     string         `json:"source_text"`
	TargetText     string         `json:"target_text,omitempty"`
	AssistContext  map[string]any `json:"assist_context,omitempty"`
	ActorID        string         `json:"actor_id,omitempty"`
	TenantID       string         `json:"tenant_id,omitempty"`
	OrgID          string         `json:"org_id,omitempty"`
	Channel        string         `json:"channel,omitempty"`
	CorrelationID  string         `json:"correlation_id,omitempty"`
	IdempotencyKey string         `json:"idempotency_key,omitempty"`
}

TranslationSuggestionProviderInput is the sanitized provider request built after assignment, scope, permission, policy, quota, and rate-limit checks.

type TranslationSuggestionProviderResult added in v0.110.0

type TranslationSuggestionProviderResult struct {
	Text        string         `json:"text"`
	Provider    string         `json:"provider,omitempty"`
	Model       string         `json:"model,omitempty"`
	Diagnostics map[string]any `json:"diagnostics,omitempty"`
}

TranslationSuggestionProviderResult is the provider-facing result before it is normalized into the command response.

type TranslationSuggestionResult added in v0.110.0

type TranslationSuggestionResult struct {
	AssignmentID  string         `json:"assignment_id"`
	FieldPath     string         `json:"field_path"`
	SuggestedText string         `json:"suggested_text"`
	Provider      string         `json:"provider,omitempty"`
	Model         string         `json:"model,omitempty"`
	SourceLocale  string         `json:"source_locale,omitempty"`
	TargetLocale  string         `json:"target_locale,omitempty"`
	Diagnostics   map[string]any `json:"diagnostics,omitempty"`
}

TranslationSuggestionResult is safe to return to browser/RPC callers.

type TranslationSuggestionService added in v0.110.0

type TranslationSuggestionService interface {
	SuggestTranslation(context.Context, TranslationSuggestionInput) (TranslationSuggestionResult, error)
}

TranslationSuggestionService contains suggestion generation behavior used by commands and transports.

type TranslationSuggestionServiceDependencies added in v0.110.0

type TranslationSuggestionServiceDependencies struct {
	Repository    TranslationAssignmentRepository
	ContextLoader TranslationSuggestionContextLoader
	Authorizer    Authorizer
	Permission    string
	Resource      string
	Eligibility   TranslationSuggestionEligibilityChecker
	AssistContext TranslationSuggestionAssistContextExtractor
}

TranslationSuggestionServiceDependencies contains host-owned dependencies that complete a provider-backed suggestion service without duplicating editor context loading logic in each host application.

type TranslationSummaryWidgetPayload added in v0.25.0

type TranslationSummaryWidgetPayload struct {
	Total    int `json:"total"`
	Active   int `json:"active"`
	Overdue  int `json:"overdue"`
	Review   int `json:"review"`
	Approved int `json:"approved"`
}

type Translator

type Translator = helpers.Translator

Translator resolves i18n keys into localized strings. Implementations can wrap go-i18n or any translation engine.

type TranslatorAware

type TranslatorAware = modinternal.TranslatorAware

TranslatorAware is implemented by modules that want a translator injected before registration.

type URLConfig added in v0.21.0

type URLConfig struct {
	Admin  URLNamespaceConfig `json:"admin"`
	Public URLNamespaceConfig `json:"public"`
	URLKit *urlkit.Config     `json:"url_kit"`
}

URLConfig controls admin URL generation defaults.

type URLNamespaceConfig added in v0.24.0

type URLNamespaceConfig struct {
	BasePath     string            `json:"base_path"`
	APIPrefix    string            `json:"api_prefix"`
	APIVersion   string            `json:"api_version"`
	URLTemplate  string            `json:"url_template"`
	TemplateVars map[string]string `json:"template_vars"`
}

URLNamespaceConfig defines URL defaults for a namespace (admin or public).

type UUIDRoleAssignmentLookup added in v0.2.0

type UUIDRoleAssignmentLookup struct{}

UUIDRoleAssignmentLookup treats only UUID role IDs as assignable.

func (UUIDRoleAssignmentLookup) IsAssignable added in v0.2.0

func (UUIDRoleAssignmentLookup) IsAssignable(_ context.Context, roleID string) (bool, error)

type UserActivateMsg added in v0.12.0

type UserActivateMsg struct {
	IDs []string `json:"i_ds"`
}

UserActivateMsg updates users to active state.

func (UserActivateMsg) Type added in v0.12.0

func (UserActivateMsg) Type() string

func (UserActivateMsg) Validate added in v0.12.0

func (m UserActivateMsg) Validate() error

type UserArchiveMsg added in v0.12.0

type UserArchiveMsg struct {
	IDs []string `json:"i_ds"`
}

UserArchiveMsg updates users to archived state.

func (UserArchiveMsg) Type added in v0.12.0

func (UserArchiveMsg) Type() string

func (UserArchiveMsg) Validate added in v0.12.0

func (m UserArchiveMsg) Validate() error

type UserBulkAssignRoleMsg added in v0.25.0

type UserBulkAssignRoleMsg struct {
	IDs     []string `json:"i_ds"`
	RoleID  string   `json:"role_id"`
	Replace bool     `json:"replace"`
}

UserBulkAssignRoleMsg assigns a role for multiple users.

func (UserBulkAssignRoleMsg) Type added in v0.25.0

func (UserBulkAssignRoleMsg) Validate added in v0.25.0

func (m UserBulkAssignRoleMsg) Validate() error

type UserBulkUnassignRoleMsg added in v0.25.0

type UserBulkUnassignRoleMsg struct {
	IDs    []string `json:"i_ds"`
	RoleID string   `json:"role_id"`
}

UserBulkUnassignRoleMsg unassigns a role for multiple users.

func (UserBulkUnassignRoleMsg) Type added in v0.25.0

func (UserBulkUnassignRoleMsg) Validate added in v0.25.0

func (m UserBulkUnassignRoleMsg) Validate() error

type UserDisableMsg added in v0.12.0

type UserDisableMsg struct {
	IDs []string `json:"i_ds"`
}

UserDisableMsg updates users to disabled state.

func (UserDisableMsg) Type added in v0.12.0

func (UserDisableMsg) Type() string

func (UserDisableMsg) Validate added in v0.12.0

func (m UserDisableMsg) Validate() error

type UserManagementModule

type UserManagementModule struct {
	// contains filtered or unexported fields
}

UserManagementModule registers user and role management panels and navigation.

func NewUserManagementModule

func NewUserManagementModule(opts ...UserManagementModuleOption) *UserManagementModule

NewUserManagementModule constructs the default user management module.

func (*UserManagementModule) Manifest

func (m *UserManagementModule) Manifest() ModuleManifest

Manifest describes the module metadata.

func (*UserManagementModule) MenuItems

func (m *UserManagementModule) MenuItems(locale string) []MenuItem

MenuItems contributes navigation for users and roles.

func (*UserManagementModule) Register

func (m *UserManagementModule) Register(ctx ModuleContext) error

Register wires the users and roles panels, search adapter, and permissions.

func (*UserManagementModule) RouteContract added in v0.27.0

func (m *UserManagementModule) RouteContract() routing.ModuleContract

func (*UserManagementModule) WithMenuParent

func (m *UserManagementModule) WithMenuParent(parent string) *UserManagementModule

WithMenuParent nests the module navigation under a parent menu item ID.

type UserManagementModuleOption added in v0.24.0

type UserManagementModuleOption func(*UserManagementModule)

UserManagementModuleOption configures a UserManagementModule.

func WithAdditionalRolePermissionMatrixResources added in v0.126.12

func WithAdditionalRolePermissionMatrixResources(resources ...string) UserManagementModuleOption

WithAdditionalRolePermissionMatrixResources appends application resources to the framework's main role permission matrix defaults.

func WithMenuPositions added in v0.24.0

func WithMenuPositions(usersPos, rolesPos *int) UserManagementModuleOption

WithMenuPositions overrides menu positions for users and roles.

func WithRolePermissionMatrixResources added in v0.126.12

func WithRolePermissionMatrixResources(resources ...string) UserManagementModuleOption

WithRolePermissionMatrixResources replaces the resources shown by the main role permission matrix. Applications can expose their own permission namespace without changing framework defaults.

func WithRolesPanelConfigurer added in v0.24.0

func WithRolesPanelConfigurer(fn func(*PanelBuilder) *PanelBuilder) UserManagementModuleOption

WithRolesPanelConfigurer customizes the roles panel builder after defaults are set.

func WithUserMenuParent added in v0.24.0

func WithUserMenuParent(parent string) UserManagementModuleOption

WithUserMenuParent nests menu items under the provided parent ID.

func WithUserPanelTabs added in v0.24.0

func WithUserPanelTabs(tabs ...PanelTab) UserManagementModuleOption

WithUserPanelTabs appends tabs to the users panel.

func WithUserProfilesPanel added in v0.24.0

func WithUserProfilesPanel() UserManagementModuleOption

WithUserProfilesPanel enables the managed user profiles panel.

func WithUserProfilesPanelConfigurer added in v0.24.0

func WithUserProfilesPanelConfigurer(fn func(*PanelBuilder) *PanelBuilder) UserManagementModuleOption

WithUserProfilesPanelConfigurer customizes the user profiles panel builder when enabled.

func WithUsersPanelConfigurer added in v0.24.0

func WithUsersPanelConfigurer(fn func(*PanelBuilder) *PanelBuilder) UserManagementModuleOption

WithUsersPanelConfigurer customizes the users panel builder after defaults are set.

type UserManagementService

type UserManagementService struct {
	// contains filtered or unexported fields
}

UserManagementService orchestrates user/role management and activity emission.

func NewUserManagementService

func NewUserManagementService(users UserRepository, roles RoleRepository) *UserManagementService

NewUserManagementService constructs a service with the provided repositories or in-memory defaults.

func (*UserManagementService) AssignRole added in v0.22.0

func (s *UserManagementService) AssignRole(ctx context.Context, userID, roleID string) error

AssignRole assigns a role to a user.

func (*UserManagementService) BulkRoleChange added in v0.25.0

BulkRoleChange applies assign/unassign role mutations for multiple users.

func (*UserManagementService) DeleteRole

func (s *UserManagementService) DeleteRole(ctx context.Context, id string) error

DeleteRole removes a role and related assignments.

func (*UserManagementService) DeleteUser

func (s *UserManagementService) DeleteUser(ctx context.Context, id string) error

DeleteUser removes a user and related assignments.

func (*UserManagementService) GetRole added in v0.22.0

GetRole fetches a role by ID.

func (*UserManagementService) GetUser

GetUser fetches a user and attached roles.

func (*UserManagementService) ListRoles

func (s *UserManagementService) ListRoles(ctx context.Context, opts ListOptions) ([]RoleRecord, int, error)

ListRoles returns registered roles.

func (*UserManagementService) ListUsers

func (s *UserManagementService) ListUsers(ctx context.Context, opts ListOptions) ([]UserRecord, int, error)

ListUsers returns users with role assignments populated.

func (*UserManagementService) RolesForUser added in v0.22.0

func (s *UserManagementService) RolesForUser(ctx context.Context, userID string) ([]RoleRecord, error)

RolesForUser returns assigned roles for the given user.

func (*UserManagementService) SaveRole

func (s *UserManagementService) SaveRole(ctx context.Context, role RoleRecord) (RoleRecord, error)

SaveRole creates or updates a role.

func (*UserManagementService) SaveUser

func (s *UserManagementService) SaveUser(ctx context.Context, user UserRecord) (UserRecord, error)

SaveUser creates or updates a user and syncs role assignments.

func (*UserManagementService) SearchUsers

func (s *UserManagementService) SearchUsers(ctx context.Context, query string, limit int) ([]UserRecord, error)

SearchUsers performs a keyword search against users.

func (*UserManagementService) TransitionUser

func (s *UserManagementService) TransitionUser(ctx context.Context, id string, status string) (UserRecord, error)

TransitionUser updates the lifecycle state for a user and records activity.

func (*UserManagementService) UnassignRole added in v0.22.0

func (s *UserManagementService) UnassignRole(ctx context.Context, userID, roleID string) error

UnassignRole removes a role assignment from a user.

func (*UserManagementService) WithActivitySink

func (s *UserManagementService) WithActivitySink(sink ActivitySink)

WithActivitySink wires activity emission for user and role mutations.

func (*UserManagementService) WithRoleAssignmentLookup added in v0.2.0

func (s *UserManagementService) WithRoleAssignmentLookup(lookup RoleAssignmentLookup) *UserManagementService

WithRoleAssignmentLookup sets the lookup used to validate custom role assignments.

type UserPanelRepository

type UserPanelRepository = genericPanelRepository[UserRecord]

UserPanelRepository adapts UserManagementService to the panel Repository contract.

func NewUserPanelRepository

func NewUserPanelRepository(service *UserManagementService) *UserPanelRepository

NewUserPanelRepository constructs a new panel repository.

type UserPreferences

type UserPreferences struct {
	UserID          string                    `json:"user_id,omitempty"`
	Theme           string                    `json:"theme,omitempty"`
	ThemeVariant    string                    `json:"theme_variant,omitempty"`
	DashboardLayout []DashboardWidgetInstance `json:"dashboard_layout,omitempty"`
	DashboardPrefs  DashboardLayoutOverrides  `json:"dashboard_overrides"`
	Raw             map[string]any            `json:"raw,omitempty"`
}

UserPreferences captures persisted preferences along with derived defaults.

type UserProfile

type UserProfile struct {
	UserID      string         `json:"user_id"`
	DisplayName string         `json:"display_name"`
	Email       string         `json:"email"`
	AvatarURL   string         `json:"avatar_url"`
	Locale      string         `json:"locale"`
	Timezone    string         `json:"timezone"`
	Bio         string         `json:"bio"`
	Contact     map[string]any `json:"contact"`
	Metadata    map[string]any `json:"metadata"`
	Raw         map[string]any `json:"raw"`
}

UserProfile mirrors the go-users profile model using string IDs for admin context.

type UserProfilesPanelRepository added in v0.24.0

type UserProfilesPanelRepository struct {
	// contains filtered or unexported fields
}

UserProfilesPanelRepository adapts ProfileStore to managed user profile panels.

func NewUserProfilesPanelRepository added in v0.24.0

func NewUserProfilesPanelRepository(users *UserManagementService, profiles ProfileStore, defaultLocale string) *UserProfilesPanelRepository

NewUserProfilesPanelRepository constructs a repository backed by UserManagementService and ProfileStore.

func (*UserProfilesPanelRepository) Create added in v0.24.0

func (r *UserProfilesPanelRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create adds a user profile.

func (*UserProfilesPanelRepository) Delete added in v0.24.0

Delete removes a user profile if supported by the backing store.

func (*UserProfilesPanelRepository) Get added in v0.24.0

Get fetches a single user profile.

func (*UserProfilesPanelRepository) List added in v0.24.0

List returns user profiles for managed users.

func (*UserProfilesPanelRepository) Update added in v0.24.0

func (r *UserProfilesPanelRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a user profile.

type UserRecord

type UserRecord struct {
	ID          string         `json:"id"`
	Email       string         `json:"email"`
	Username    string         `json:"username"`
	FirstName   string         `json:"first_name"`
	LastName    string         `json:"last_name"`
	Status      string         `json:"status"`
	Role        string         `json:"role"`
	Roles       []string       `json:"roles"`
	RoleDisplay string         `json:"role_display"`
	RoleLabels  []string       `json:"role_labels"`
	Permissions []string       `json:"permissions"`
	Metadata    map[string]any `json:"metadata"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

UserRecord captures the fields managed by the user administration module.

type UserRepository

type UserRepository interface {
	List(ctx context.Context, opts ListOptions) ([]UserRecord, int, error)
	Get(ctx context.Context, id string) (UserRecord, error)
	Create(ctx context.Context, user UserRecord) (UserRecord, error)
	Update(ctx context.Context, user UserRecord) (UserRecord, error)
	Delete(ctx context.Context, id string) error
	Search(ctx context.Context, query string, limit int) ([]UserRecord, error)
}

UserRepository exposes CRUD operations for auth users.

type UserStatsWidgetPayload added in v0.25.0

type UserStatsWidgetPayload struct {
	Title  string `json:"title"`
	Metric string `json:"metric"`
	Value  int    `json:"value"`
}

type UserSuspendMsg added in v0.12.0

type UserSuspendMsg struct {
	IDs []string `json:"i_ds"`
}

UserSuspendMsg updates users to suspended state.

func (UserSuspendMsg) Type added in v0.12.0

func (UserSuspendMsg) Type() string

func (UserSuspendMsg) Validate added in v0.12.0

func (m UserSuspendMsg) Validate() error

type WidgetAreaDefinition

type WidgetAreaDefinition = cmsboot.WidgetAreaDefinition

WidgetAreaDefinition captures CMS widget area metadata.

type WidgetDefinition

type WidgetDefinition = cmsboot.WidgetDefinition

WidgetDefinition captures admin widget metadata.

type WidgetDefinitionRepository

type WidgetDefinitionRepository struct {
	// contains filtered or unexported fields
}

WidgetDefinitionRepository manages widget definitions through CMSWidgetService.

func NewWidgetDefinitionRepository

func NewWidgetDefinitionRepository(widgets CMSWidgetService) *WidgetDefinitionRepository

NewWidgetDefinitionRepository builds a widget definition repository.

func (*WidgetDefinitionRepository) Create

func (r *WidgetDefinitionRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create registers a widget definition.

func (*WidgetDefinitionRepository) Delete

Delete removes a widget definition.

func (*WidgetDefinitionRepository) Get

Get returns a widget definition by code.

func (*WidgetDefinitionRepository) List

List returns widget definitions.

func (*WidgetDefinitionRepository) Update

func (r *WidgetDefinitionRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update updates a widget definition (overwrites).

type WidgetDefinitionSyncResult added in v0.52.0

type WidgetDefinitionSyncResult = cmsboot.WidgetDefinitionSyncResult

WidgetDefinitionSyncResult reports the synced definition and resulting status.

type WidgetDefinitionSyncStatus added in v0.52.0

type WidgetDefinitionSyncStatus = cmsboot.WidgetDefinitionSyncStatus

WidgetDefinitionSyncStatus describes how a definition sync changed persistent state.

type WidgetInstance

type WidgetInstance = cmsboot.WidgetInstance

WidgetInstance links a widget definition to a specific area/page.

type WidgetInstanceFilter

type WidgetInstanceFilter = cmsboot.WidgetInstanceFilter

WidgetInstanceFilter narrows widget instance queries.

type WidgetInstanceRepository

type WidgetInstanceRepository struct {
	// contains filtered or unexported fields
}

WidgetInstanceRepository manages widget instances.

func NewWidgetInstanceRepository

func NewWidgetInstanceRepository(widgets CMSWidgetService) *WidgetInstanceRepository

NewWidgetInstanceRepository builds a widget instance repository.

func (*WidgetInstanceRepository) Create

func (r *WidgetInstanceRepository) Create(ctx context.Context, record map[string]any) (map[string]any, error)

Create saves a widget instance.

func (*WidgetInstanceRepository) Delete

Delete removes a widget instance.

func (*WidgetInstanceRepository) Get

Get returns a widget instance by id.

func (*WidgetInstanceRepository) List

func (r *WidgetInstanceRepository) List(ctx context.Context, opts ListOptions) ([]map[string]any, int, error)

List returns widget instances filtered by area/page/locale.

func (*WidgetInstanceRepository) Update

func (r *WidgetInstanceRepository) Update(ctx context.Context, id string, record map[string]any) (map[string]any, error)

Update modifies a widget instance.

type WidgetPayload added in v0.25.0

type WidgetPayload struct {
	// contains filtered or unexported fields
}

WidgetPayload is the canonical widget payload container. Providers must return typed structs (or pointers to structs) wrapped in WidgetPayload.

func EmptyWidgetPayload added in v0.25.0

func EmptyWidgetPayload() WidgetPayload

EmptyWidgetPayload returns an empty payload object.

func WidgetPayloadOf added in v0.25.0

func WidgetPayloadOf[T any](value T) WidgetPayload

WidgetPayloadOf wraps a typed payload for dashboard providers.

func (WidgetPayload) Value added in v0.25.0

func (p WidgetPayload) Value() any

Value returns the wrapped payload value.

type WidgetProvider

type WidgetProvider func(ctx AdminContext, cfg map[string]any) (WidgetPayload, error)

WidgetProvider produces data for a widget given viewer context/config. Providers must return a canonical WidgetPayload.

type WorkflowActionFunc added in v0.26.0

type WorkflowActionFunc func(context.Context, WorkflowMessage) error

WorkflowActionFunc executes a workflow action.

type WorkflowApplyEventRequest added in v0.26.0

type WorkflowApplyEventRequest = cmsboot.WorkflowApplyEventRequest

WorkflowApplyEventRequest is the canonical transition envelope.

type WorkflowApplyEventResponse added in v0.26.0

type WorkflowApplyEventResponse = cmsboot.WorkflowApplyEventResponse

WorkflowApplyEventResponse is the canonical transition response envelope.

type WorkflowAuthoringVersionStore added in v0.27.0

type WorkflowAuthoringVersionStore interface {
	flow.AuthoringStore
	ListVersions(ctx context.Context, machineID string, limit int, offset int) ([]*flow.AuthoringMachineRecord, bool, error)
	LoadVersion(ctx context.Context, machineID string, version string) (*flow.AuthoringMachineRecord, error)
}

WorkflowAuthoringVersionStore extends flow.AuthoringStore with version-history lookup.

type WorkflowAuthorizer added in v0.22.0

type WorkflowAuthorizer interface {
	CanApplyEvent(ctx context.Context, input WorkflowApplyEventRequest) bool
}

WorkflowAuthorizer optionally guards workflow transitions.

func NewRoleWorkflowAuthorizer added in v0.24.0

func NewRoleWorkflowAuthorizer(minRole string, opts ...RoleWorkflowAuthorizerOption) WorkflowAuthorizer

NewRoleWorkflowAuthorizer builds a WorkflowAuthorizer enforcing a minimum role with optional checks.

type WorkflowBinding added in v0.25.0

type WorkflowBinding = workflowcore.WorkflowBinding

type WorkflowBindingConflictError added in v0.25.0

type WorkflowBindingConflictError = workflowcore.WorkflowBindingConflictError

type WorkflowBindingListOptions added in v0.25.0

type WorkflowBindingListOptions = workflowcore.WorkflowBindingListOptions

type WorkflowBindingRepository added in v0.25.0

type WorkflowBindingRepository interface {
	List(ctx context.Context, opts WorkflowBindingListOptions) ([]WorkflowBinding, int, error)
	ListByScope(ctx context.Context, scopeType WorkflowBindingScopeType, scopeRef string, status WorkflowBindingStatus) ([]WorkflowBinding, error)
	Get(ctx context.Context, id string) (WorkflowBinding, error)
	Create(ctx context.Context, binding WorkflowBinding) (WorkflowBinding, error)
	Update(ctx context.Context, binding WorkflowBinding, expectedVersion int) (WorkflowBinding, error)
	Delete(ctx context.Context, id string) error
}

WorkflowBindingRepository stores workflow scope bindings.

type WorkflowBindingResolution added in v0.25.0

type WorkflowBindingResolution = workflowcore.WorkflowBindingResolution

type WorkflowBindingResolveInput added in v0.25.0

type WorkflowBindingResolveInput = workflowcore.WorkflowBindingResolveInput

type WorkflowBindingScopeType added in v0.25.0

type WorkflowBindingScopeType = workflowcore.WorkflowBindingScopeType

WorkflowBindingScopeType identifies where a binding applies.

type WorkflowBindingStatus added in v0.25.0

type WorkflowBindingStatus = workflowcore.WorkflowBindingStatus

WorkflowBindingStatus controls whether a binding participates in resolution.

type WorkflowBindingVersionConflictError added in v0.25.0

type WorkflowBindingVersionConflictError = workflowcore.WorkflowBindingVersionConflictError

type WorkflowDefinition added in v0.22.0

type WorkflowDefinition = workflowcore.WorkflowDefinition

WorkflowDefinition describes a state machine for a specific entity type.

type WorkflowDefinitionChecker added in v0.24.0

type WorkflowDefinitionChecker interface {
	HasWorkflow(entityType string) bool
}

WorkflowDefinitionChecker reports whether a workflow exists for an entity type.

type WorkflowDefinitionProvider added in v0.26.0

type WorkflowDefinitionProvider interface {
	WorkflowDefinition(entityType string) (WorkflowDefinition, bool)
}

WorkflowDefinitionProvider exposes registered workflow definitions for introspection.

type WorkflowDefinitionRepository added in v0.25.0

type WorkflowDefinitionRepository interface {
	List(ctx context.Context, opts PersistedWorkflowListOptions) ([]PersistedWorkflow, int, error)
	Get(ctx context.Context, id string) (PersistedWorkflow, error)
	GetVersion(ctx context.Context, id string, version int) (PersistedWorkflow, error)
	Create(ctx context.Context, workflow PersistedWorkflow) (PersistedWorkflow, error)
	Update(ctx context.Context, workflow PersistedWorkflow, expectedVersion int) (PersistedWorkflow, error)
}

WorkflowDefinitionRepository stores persisted workflow definitions.

type WorkflowDynamicTargetResolver added in v0.26.0

type WorkflowDynamicTargetResolver = flow.DynamicTargetResolver[WorkflowMessage]

WorkflowDynamicTargetResolver resolves a workflow dynamic target.

type WorkflowEngine added in v0.22.0

type WorkflowEngine = cmsboot.WorkflowEngine

WorkflowEngine coordinates lifecycle transitions for domain entities.

type WorkflowExecutionContext added in v0.26.0

type WorkflowExecutionContext = cmsboot.WorkflowExecutionContext

WorkflowExecutionContext captures workflow actor/tenant context.

type WorkflowGuardFunc added in v0.26.0

type WorkflowGuardFunc = flow.Guard[WorkflowMessage]

WorkflowGuardFunc evaluates a workflow guard.

type WorkflowGuardRejection added in v0.26.0

type WorkflowGuardRejection = cmsboot.WorkflowGuardRejection

WorkflowGuardRejection captures blocked transition details.

type WorkflowMessage added in v0.26.0

type WorkflowMessage = cmsboot.WorkflowMessage

WorkflowMessage captures workflow event payload for guards/resolvers/hooks.

type WorkflowRegistrar added in v0.24.0

type WorkflowRegistrar interface {
	RegisterWorkflow(entityType string, definition WorkflowDefinition) error
}

WorkflowRegistrar registers workflow definitions for entity types.

type WorkflowRuntime added in v0.25.0

type WorkflowRuntime interface {
	ListWorkflows(ctx context.Context, opts PersistedWorkflowListOptions) ([]PersistedWorkflow, int, error)
	CreateWorkflow(ctx context.Context, workflow PersistedWorkflow) (PersistedWorkflow, error)
	UpdateWorkflow(ctx context.Context, workflow PersistedWorkflow, expectedVersion int) (PersistedWorkflow, error)
	RollbackWorkflow(ctx context.Context, id string, targetVersion, expectedVersion int) (PersistedWorkflow, error)

	ListBindings(ctx context.Context, opts WorkflowBindingListOptions) ([]WorkflowBinding, int, error)
	CreateBinding(ctx context.Context, binding WorkflowBinding) (WorkflowBinding, error)
	UpdateBinding(ctx context.Context, binding WorkflowBinding, expectedVersion int) (WorkflowBinding, error)
	DeleteBinding(ctx context.Context, id string) error

	ResolveBinding(ctx context.Context, input WorkflowBindingResolveInput) (WorkflowBindingResolution, error)
	BindWorkflowEngine(engine WorkflowEngine) error
}

WorkflowRuntime exposes persisted workflow definition/binding operations.

type WorkflowRuntimeService added in v0.25.0

type WorkflowRuntimeService struct {
	// contains filtered or unexported fields
}

WorkflowRuntimeService orchestrates persisted workflow definitions + bindings.

func NewWorkflowRuntimeService added in v0.25.0

func NewWorkflowRuntimeService(workflows WorkflowDefinitionRepository, bindings WorkflowBindingRepository) *WorkflowRuntimeService

NewWorkflowRuntimeService constructs a runtime service (in-memory when nil repos are passed).

func (*WorkflowRuntimeService) AuthoringStore added in v0.27.0

func (s *WorkflowRuntimeService) AuthoringStore() flow.AuthoringStore

AuthoringStore exposes the canonical authoring persistence backend used by RPC authoring APIs.

func (*WorkflowRuntimeService) BindWorkflowEngine added in v0.25.0

func (s *WorkflowRuntimeService) BindWorkflowEngine(engine WorkflowEngine) error

func (*WorkflowRuntimeService) CreateBinding added in v0.25.0

func (s *WorkflowRuntimeService) CreateBinding(ctx context.Context, binding WorkflowBinding) (WorkflowBinding, error)

func (*WorkflowRuntimeService) CreateWorkflow added in v0.25.0

func (s *WorkflowRuntimeService) CreateWorkflow(ctx context.Context, workflow PersistedWorkflow) (PersistedWorkflow, error)

func (*WorkflowRuntimeService) DeleteBinding added in v0.25.0

func (s *WorkflowRuntimeService) DeleteBinding(ctx context.Context, id string) error

func (*WorkflowRuntimeService) ListBindings added in v0.25.0

func (*WorkflowRuntimeService) ListWorkflows added in v0.25.0

func (*WorkflowRuntimeService) ResolveBinding added in v0.25.0

func (*WorkflowRuntimeService) RollbackWorkflow added in v0.25.0

func (s *WorkflowRuntimeService) RollbackWorkflow(ctx context.Context, id string, targetVersion, expectedVersion int) (PersistedWorkflow, error)

func (*WorkflowRuntimeService) SetAuthoringStore added in v0.27.0

func (s *WorkflowRuntimeService) SetAuthoringStore(store flow.AuthoringStore)

SetAuthoringStore overrides the authoring store implementation.

func (*WorkflowRuntimeService) UpdateBinding added in v0.25.0

func (s *WorkflowRuntimeService) UpdateBinding(ctx context.Context, binding WorkflowBinding, expectedVersion int) (WorkflowBinding, error)

func (*WorkflowRuntimeService) UpdateWorkflow added in v0.25.0

func (s *WorkflowRuntimeService) UpdateWorkflow(ctx context.Context, workflow PersistedWorkflow, expectedVersion int) (PersistedWorkflow, error)

type WorkflowSnapshot added in v0.26.0

type WorkflowSnapshot = cmsboot.WorkflowSnapshot

WorkflowSnapshot reports current state and transition availability.

type WorkflowSnapshotRequest added in v0.26.0

type WorkflowSnapshotRequest = cmsboot.WorkflowSnapshotRequest

WorkflowSnapshotRequest requests workflow snapshot/transition availability.

type WorkflowTransition added in v0.22.0

type WorkflowTransition = cmsboot.WorkflowTransition

WorkflowTransition declares an allowed transition between two states.

type WorkflowTransitionInfo added in v0.26.0

type WorkflowTransitionInfo = cmsboot.WorkflowTransitionInfo

WorkflowTransitionInfo describes one transition in snapshot output.

type WorkflowTransitionResult added in v0.26.0

type WorkflowTransitionResult = cmsboot.WorkflowTransitionResult

WorkflowTransitionResult describes the transition mutation result.

type WorkflowUnregistrar added in v0.27.0

type WorkflowUnregistrar interface {
	UnregisterWorkflow(entityType string) error
}

WorkflowUnregistrar removes workflow definitions for entity types.

type WorkflowValidationErrors added in v0.25.0

type WorkflowValidationErrors = workflowcore.WorkflowValidationErrors

type WorkflowVersionConflictError added in v0.25.0

type WorkflowVersionConflictError = workflowcore.WorkflowVersionConflictError

Source Files

Directories

Path Synopsis
cms
Package commandruntest provides transport-neutral contract tests for go-admin command-run transport implementations.
Package commandruntest provides transport-neutral contract tests for go-admin command-run transport implementations.
internal
cmsadapter
Package cmsadapter contains internal CMS adapter helper families that can live outside the top-level admin package without pulling receiver-bound adapter types or admin-only orchestration state with them.
Package cmsadapter contains internal CMS adapter helper families that can live outside the top-level admin package without pulling receiver-bound adapter types or admin-only orchestration state with them.
Package txoutbox provides reusable transaction hook and outbox dispatch helpers.
Package txoutbox provides reusable transaction hook and outbox dispatch helpers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL