api

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 57 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api provides shared schema mapping from Kora field types to JSON Schema. Used by OpenAPI, MCP, and Chat to generate consistent tool/schema definitions.

Index

Constants

This section is empty.

Variables

View Source
var APIDefaultLimit = 50

APIDefaultLimit and APIMaxLimit control pagination (set from common config at startup).

View Source
var APIMaxLimit = 500
View Source
var AppBranding = Branding{AppName: "Kora", PrimaryColor: "#2563eb"}

AppBranding is the global branding config (set from common config at startup).

View Source
var BinaryVersion = "dev"

BinaryVersion is set at startup from cli.Version to avoid circular imports. cli/serve.go sets this to its Version value during initialization.

View Source
var SupportedCurrencies = map[string]struct{}{
	"AUD": {}, "CAD": {}, "CHF": {}, "CNY": {}, "EUR": {}, "GBP": {},
	"GHS": {}, "INR": {}, "JPY": {}, "KES": {}, "NGN": {}, "RWF": {},
	"TZS": {}, "UGX": {}, "USD": {}, "ZAR": {},
}

SupportedCurrencies is intentionally small and explicit. Currency affects financial display across a tenant, so arbitrary values must not reach the UI.

Functions

func DocTypeToJSONSchema

func DocTypeToJSONSchema(dt *doctype.DocType, registry *doctype.Registry) map[string]any

DocTypeToJSONSchema converts a DocType into a JSON Schema object.

func FieldToJSONSchema

func FieldToJSONSchema(f *doctype.Field) map[string]any

FieldToJSONSchema maps a Kora field definition to a JSON Schema property.

func GenerateOpenAPISpec

func GenerateOpenAPISpec(reg *doctype.Registry, siteName string) *openapi3.T

GenerateOpenAPISpec builds the full OpenAPI 3.x document from a registry.

func NewScriptProvider added in v0.9.5

func NewScriptProvider(tx *orm.TxManager, registry *doctype.Registry, site string, secretStore *secret.Store, httpAllowlist []string) script.KoraProvider

NewScriptProvider creates a provider with a scoped HTTP client.

func RegisterAnalyticsRoutes added in v0.9.5

func RegisterAnalyticsRoutes(apiGroup *gin.RouterGroup, registry *doctype.Registry, siteDB *sql.DB, siteBuses map[string]analytics.EventBus, realtimeProviders map[string]*natsprovider.Provider, dialect db.Dialect)

RegisterAnalyticsRoutes registers analytics API endpoints. siteDB is the fallback DB; per-request DB is resolved from gin context. registry is used to auto-generate metrics from DocType metadata. siteBuses maps site name → EventBus.

func RegisterAnalyticsRoutesWithRuntimeServices

func RegisterAnalyticsRoutesWithRuntimeServices(apiGroup *gin.RouterGroup, registry *doctype.Registry, siteDB *sql.DB, siteBuses map[string]analytics.EventBus, realtimeProviders map[string]*natsprovider.Provider, dialect db.Dialect, runtimeServices *SiteRuntimeServices)

func RegisterConversationRoutes

func RegisterConversationRoutes(group *gin.RouterGroup, h *Handler)

func RegisterPublicRoutesOnGroup added in v0.9.5

func RegisterPublicRoutesOnGroup(apiGroup *gin.RouterGroup, registry *doctype.Registry, txManager *orm.TxManager, siteStorages map[string]storage.Backend)

RegisterPublicRoutesOnGroup registers public delivery and provider callback routes. Each route must enforce its own access policy; CRUD authentication is registered separately.

func RegisterPublicRoutesOnGroupWithRuntimeServices

func RegisterPublicRoutesOnGroupWithRuntimeServices(apiGroup *gin.RouterGroup, registry *doctype.Registry, txManager *orm.TxManager, siteStorages map[string]storage.Backend, runtimeServices *SiteRuntimeServices)

func RegisterRoutes

func RegisterRoutes(router *gin.Engine, registry *doctype.Registry, txManager *orm.TxManager)

RegisterRoutes registers all CRUD routes for all DocTypes in the registry on a full Engine.

func RegisterRoutesOnGroup

func RegisterRoutesOnGroup(apiGroup *gin.RouterGroup, registry *doctype.Registry, txManager *orm.TxManager)

RegisterRoutesOnGroup registers all CRUD routes on an existing RouterGroup. This allows the caller to apply middleware (e.g., auth) before the group.

func RegisterRoutesOnGroupWithAnalytics added in v0.9.5

func RegisterRoutesOnGroupWithAnalytics(apiGroup *gin.RouterGroup, registry *doctype.Registry, txManager *orm.TxManager, siteBuses map[string]analytics.EventBus, realtimeProviders map[string]*natsprovider.Provider, scriptRunner script.Runner, siteScriptStores map[string]*script.Store, siteSecretStores map[string]*secret.Store, httpAllowlist []string, siteWebhookWorkers map[string]*webhook.Worker, asyncHookSink orm.AsyncHookSink, siteOutboxes map[string]outbox.Writer, siteStorages map[string]storage.Backend, kernelCommands *kernel.CommandRegistry)

RegisterRoutesOnGroupWithAnalytics registers all CRUD routes with optional analytics event propagation. siteBuses maps site name → EventBus; if nil or empty, analytics event emission is a no-op.

func RegisterRoutesOnGroupWithRuntimeServices

func RegisterRoutesOnGroupWithRuntimeServices(apiGroup *gin.RouterGroup, registry *doctype.Registry, txManager *orm.TxManager, siteBuses map[string]analytics.EventBus, realtimeProviders map[string]*natsprovider.Provider, scriptRunner script.Runner, siteScriptStores map[string]*script.Store, siteSecretStores map[string]*secret.Store, httpAllowlist []string, siteWebhookWorkers map[string]*webhook.Worker, asyncHookSink orm.AsyncHookSink, siteOutboxes map[string]outbox.Writer, siteStorages map[string]storage.Backend, kernelCommands *kernel.CommandRegistry, runtimeServices *SiteRuntimeServices)

RegisterRoutesOnGroupWithRuntimeServices is the directory-aware form of RegisterRoutesOnGroupWithAnalytics. New Engine deployments should pass the shared synchronized service registry so hot-added sites become visible to handlers without mutating maps concurrently.

func RegisterSystemRoutes

func RegisterSystemRoutes(apiGroup *gin.RouterGroup, handler *Handler)

RegisterSystemRoutes registers system endpoints on the given API group.

func SetAPILimits

func SetAPILimits(def, max int)

SetAPILimits sets pagination limits from config.

Types

type Branding

type Branding struct {
	AppName      string `json:"app_name"`
	ShortName    string `json:"short_name,omitempty"`
	LogoURL      string `json:"logo_url,omitempty"`
	LogoDarkURL  string `json:"logo_dark_url,omitempty"`
	FaviconURL   string `json:"favicon_url,omitempty"`
	PrimaryColor string `json:"primary_color"`
	AccentColor  string `json:"accent_color,omitempty"`
	FontFamily   string `json:"font_family,omitempty"`
	HeadingFont  string `json:"heading_font,omitempty"`
	DefaultMode  string `json:"default_mode,omitempty"`
}

Branding holds per-site branding configuration.

type ConfigurationCheckResult

type ConfigurationCheckResult struct {
	Valid             bool                      `json:"valid"`
	OrderedDocTypes   []string                  `json:"ordered_doctypes"`
	BaseConfigVersion string                    `json:"base_config_version_id,omitempty"`
	Errors            []string                  `json:"errors,omitempty"`
	Warnings          []string                  `json:"warnings,omitempty"`
	Conflicts         []ConfigurationConflict   `json:"conflicts,omitempty"`
	Impact            []ConfigurationImpactItem `json:"impact,omitempty"`
}

ConfigurationCheckResult is the read-only contract used by conversational clients before they ask the Engine to create a draft ConfigVersion.

type ConfigurationConflict

type ConfigurationConflict struct {
	Kind   string `json:"kind"`
	Name   string `json:"name"`
	Detail string `json:"detail"`
}

type ConfigurationImpactItem

type ConfigurationImpactItem struct {
	Name   string `json:"name"`
	Kind   string `json:"kind"`
	Action string `json:"action"`
	Safe   bool   `json:"safe"`
}

type ConsoleHandler

type ConsoleHandler struct {
	SystemGuard       *auth.SystemGuard
	SiteRouter        *net.SiteRouter
	ProvisioningStore *site.OnboardingStore
	AllowOnboarding   bool
	SiteStorages      map[string]storage.Backend
	RuntimeServices   *SiteRuntimeServices
	// PrepareRuntime installs the same sidecars used for directory hot-add before
	// a newly-created site becomes routable.
	PrepareRuntime func(site.DBSiteInfo, *net.LoadedSite) error
	// DiscardRuntime releases any sidecars installed by PrepareRuntime when the
	// router rejects the new site.
	DiscardRuntime func(*net.LoadedSite)
	ResolveStorage func(*site.SiteConfig) (storage.Backend, error)

	PlatformDBType     string
	PlatformDBHost     string
	PlatformDBPort     int
	PlatformDBUser     string
	PlatformDBPassword string
	PlatformDB         *sql.DB // Existing platform DB connection (for LibSQL reuse)
	// contains filtered or unexported fields
}

ConsoleHandler holds dependencies for console API endpoints.

func NewConsoleHandler

func NewConsoleHandler(guard *auth.SystemGuard, sr *net.SiteRouter, dbType, dbHost, dbUser, dbPassword string, dbPort int, platformDB *sql.DB, allowOnboarding bool) *ConsoleHandler

NewConsoleHandler creates a console API handler.

func (*ConsoleHandler) HandleChangePassword

func (h *ConsoleHandler) HandleChangePassword(c *gin.Context)

HandleChangePassword forces a password change (required on first login with default creds). POST /api/console/change-password

func (*ConsoleHandler) HandleCreateSite

func (h *ConsoleHandler) HandleCreateSite(c *gin.Context)

HandleCreateSite creates a new site: database, config, bootstrap, admin user. POST /api/console/sites Only hostname, admin_email, and admin_password are required. DB fields are optional — platform defaults from env vars are used when empty.

func (*ConsoleHandler) HandleDeleteSite

func (h *ConsoleHandler) HandleDeleteSite(c *gin.Context)

HandleDeleteSite deletes a site and all its data. DELETE /api/console/sites/:name Requires confirmation: {"confirm": "<hostname>"}

func (*ConsoleHandler) HandleListSites

func (h *ConsoleHandler) HandleListSites(c *gin.Context)

HandleListSites returns all loaded sites with status. Falls back to querying the database directly when no sites are loaded (e.g. after container redeploy where site_config.yaml files were lost but DB data persists). GET /api/console/sites

func (*ConsoleHandler) HandleLogin

func (h *ConsoleHandler) HandleLogin(c *gin.Context)

HandleLogin authenticates a console super-admin. POST /api/console/login

func (*ConsoleHandler) HandleOnboard added in v0.9.5

func (h *ConsoleHandler) HandleOnboard(c *gin.Context)

HandleOnboard creates a site via public self-service (no console auth). POST /api/console/sites/onboard Rate limited: 3 per hour per IP.

func (*ConsoleHandler) HandleOnboardJobs added in v0.9.5

func (h *ConsoleHandler) HandleOnboardJobs(c *gin.Context)

HandleOnboardJobs lists provisioning jobs for the console. GET /api/console/sites/onboard

func (*ConsoleHandler) HandleOnboardStatus added in v0.9.5

func (h *ConsoleHandler) HandleOnboardStatus(c *gin.Context)

HandleOnboardStatus returns the current state of a provisioning job. GET /api/console/sites/onboard/:job_id

func (*ConsoleHandler) HandleResetSitePassword

func (h *ConsoleHandler) HandleResetSitePassword(c *gin.Context)

HandleResetSitePassword resets a site user's password. POST /api/console/sites/:name/reset-password

func (*ConsoleHandler) HandleUpdateSite

func (h *ConsoleHandler) HandleUpdateSite(c *gin.Context)

HandleUpdateSite updates site metadata and file storage settings. PUT /api/console/sites/:name

func (*ConsoleHandler) RequireConsoleAuth

func (h *ConsoleHandler) RequireConsoleAuth(c *gin.Context)

RequireConsoleAuth is middleware that validates the console session. Accepts Authorization: Bearer <token> header OR kora_console_sid cookie.

func (*ConsoleHandler) Start added in v0.9.5

func (h *ConsoleHandler) Start()

Start begins the background rate limiter reset loop for self-service onboarding.

type DocTypeNavItem

type DocTypeNavItem struct {
	Name         string `json:"name"`
	ResourceName string `json:"resource_name"`
	Label        string `json:"label"`
	Icon         string `json:"icon,omitempty"`
	IsChild      bool   `json:"is_child"`
}

DocTypeNavItem is a single DocType entry in the navigation.

type DraftConfigurationRequest

type DraftConfigurationRequest struct {
	ProposalID           string                `json:"proposal_id"`
	DraftConfigVersionID string                `json:"draft_config_version_id,omitempty"`
	ConversationID       string                `json:"conversation_id,omitempty"`
	InterviewSnapshot    map[string]any        `json:"interview_snapshot,omitempty"`
	PrimaryWorkflow      string                `json:"primary_workflow,omitempty"`
	StructuredInput      map[string]any        `json:"structured_input,omitempty"`
	OpenQuestions        []string              `json:"open_questions,omitempty"`
	ChannelOrigin        string                `json:"channel_origin,omitempty"`
	BaseConfigVersionID  string                `json:"base_config_version_id,omitempty"`
	CreatedBy            string                `json:"created_by,omitempty"`
	DocTypes             []*doctype.DocType    `json:"doctypes"`
	Roles                []*doctype.Role       `json:"roles,omitempty"`
	Permissions          []*doctype.Permission `json:"permissions,omitempty"`
	Workflows            []*doctype.Workflow   `json:"workflows,omitempty"`
	Views                []*doctype.View       `json:"views,omitempty"`
	Scripts              []*ScriptCandidate    `json:"scripts,omitempty"`
}

DraftConfigurationRequest is the Engine boundary for Cloud-generated onboarding configuration. The complete package is composed into one draft; callers must not create each DocType independently.

type ErrorBody added in v0.9.5

type ErrorBody struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Details map[string]any `json:"details,omitempty"`
}

ErrorBody is the machine-readable error envelope returned to the frontend.

type ErrorResponse

type ErrorResponse struct {
	Error any   `json:"error"`
	Meta  *Meta `json:"meta,omitempty"`
}

ErrorResponse is the standard error response envelope.

type ExperienceCopy

type ExperienceCopy struct {
	LoginTitle       string `json:"login_title"`
	LoginDescription string `json:"login_description"`
	LoginHelp        string `json:"login_help"`
	WorkspaceLoading string `json:"workspace_loading"`
	EmptyRecords     string `json:"empty_records"`
	SupportLabel     string `json:"support_label"`
}

type Handler

type Handler struct {
	Registry        *doctype.Registry
	TxManager       *orm.TxManager
	AuthProviders   *auth.ProviderRegistry
	RuntimeServices *SiteRuntimeServices

	// SiteEventBuses maps site name → EventBus for analytics/realtime services.
	SiteEventBuses map[string]analytics.EventBus

	// SiteOutboxes maps site name → outbox.Writer for transactional outbox recording.
	// When a site has a writer, its document writes record an event in _kora_outbox
	// within the same transaction. Nil for sites (or deployments) without the outbox.
	SiteOutboxes map[string]outbox.Writer

	// SiteRealtimeProviders maps site name → NATS provider used to source realtime events.
	SiteRealtimeProviders map[string]*natsprovider.Provider

	// ScriptRunner executes JavaScript hooks (shared across all sites).
	ScriptRunner script.Runner

	// SiteScriptStores maps site name → *script.Store for script persistence.
	SiteScriptStores map[string]*script.Store

	// SiteSecretStores maps site name → *secret.Store for secret access from scripts.
	SiteSecretStores map[string]*secret.Store

	// ScriptHTTPAllowlist controls which domains scripts can call via kora.http.
	ScriptHTTPAllowlist []string

	// SiteWebhookWorkers maps site name → *webhook.Worker for webhook delivery.
	SiteWebhookWorkers map[string]*webhook.Worker

	// AsyncHookSink receives after_* hooks for fire-and-forget execution.
	AsyncHookSink orm.AsyncHookSink

	// SiteStorages maps site name → storage backend for attachments. Storage is a
	// fallback used when no site-specific backend is configured.
	SiteStorages map[string]storage.Backend
	Storage      storage.Backend

	// KernelCommands carries config-defined command resources (KERNEL-008)
	// loaded at startup from application configuration. Nil = built-ins only;
	// GET /api/v1/kernel/_registry then reports an empty list.
	KernelCommands *kernel.CommandRegistry
	AgentStores    map[string]*org.AgentStore
}

Handler holds dependencies for API handlers. Registry and TxManager are fallbacks; handlers read site context from the request.

func NewHandler

func NewHandler(registry *doctype.Registry, txManager *orm.TxManager) *Handler

NewHandler creates a new API handler.

func (*Handler) HandleAICancel added in v0.9.5

func (h *Handler) HandleAICancel(c *gin.Context)

HandleAICancel marks a durable AI run as cancelled.

func (*Handler) HandleAIGrantApproval added in v0.9.5

func (h *Handler) HandleAIGrantApproval(c *gin.Context)

HandleAIGrantApproval transitions a durable approval row from pending_approval to granted.

func (*Handler) HandleAIListApprovals added in v0.9.5

func (h *Handler) HandleAIListApprovals(c *gin.Context)

HandleAIListApprovals returns approval rows for the current site.

func (*Handler) HandleAIResume added in v0.9.5

func (h *Handler) HandleAIResume(c *gin.Context)

HandleAIResume transitions a durable AI run back into planning if it is not terminal.

func (*Handler) HandleAIRetentionCleanup added in v0.9.5

func (h *Handler) HandleAIRetentionCleanup(c *gin.Context)

HandleAIRetentionCleanup removes expired AI conversations, runs, messages, and steps.

func (*Handler) HandleAgentEffectivePermissions

func (h *Handler) HandleAgentEffectivePermissions(c *gin.Context)

HandleAgentEffectivePermissions returns the permission matrix result for an agent.

func (*Handler) HandleAgentManifest

func (h *Handler) HandleAgentManifest(c *gin.Context)

func (*Handler) HandleAgentPermissionCatalog

func (h *Handler) HandleAgentPermissionCatalog(c *gin.Context)

HandleAgentPermissionCatalog exposes DocType-derived operations to Studio.

func (*Handler) HandleAgentRuns

func (h *Handler) HandleAgentRuns(c *gin.Context)

func (*Handler) HandleAuthProviders

func (h *Handler) HandleAuthProviders(c *gin.Context)

HandleAuthProviders returns enabled authentication providers. Public endpoint — no auth required.

func (*Handler) HandleChannelMutate added in v0.9.5

func (h *Handler) HandleChannelMutate(c *gin.Context)

func (*Handler) HandleChannelQuery added in v0.9.5

func (h *Handler) HandleChannelQuery(c *gin.Context)

func (*Handler) HandleChannelSessionIssue added in v0.9.5

func (h *Handler) HandleChannelSessionIssue(c *gin.Context)

func (*Handler) HandleChannelSessionRevoke added in v0.9.5

func (h *Handler) HandleChannelSessionRevoke(c *gin.Context)

func (*Handler) HandleChannelTools added in v0.9.5

func (h *Handler) HandleChannelTools(c *gin.Context)

func (*Handler) HandleChat

func (h *Handler) HandleChat(c *gin.Context)

HandleChat processes a chat message, calls the AI provider with function definitions, executes any tool calls via the ORM, and returns the AI's response. POST /api/chat

func (*Handler) HandleConfigDiff

func (h *Handler) HandleConfigDiff(c *gin.Context)

HandleConfigDiff returns the diff between two config versions.

func (*Handler) HandleConfigImport

func (h *Handler) HandleConfigImport(c *gin.Context)

HandleConfigImport imports a YAML config file and returns parsed DocType JSON. POST /api/system/config/import

func (*Handler) HandleConfigVersion

func (h *Handler) HandleConfigVersion(c *gin.Context)

HandleConfigVersion gets a single config version snapshot.

func (*Handler) HandleConfigVersionActivate

func (h *Handler) HandleConfigVersionActivate(c *gin.Context)

HandleConfigVersionActivate activates a Draft version. POST /api/system/config/versions/:id/activate

func (*Handler) HandleConfigVersionDiscard

func (h *Handler) HandleConfigVersionDiscard(c *gin.Context)

HandleConfigVersionDiscard discards a Draft version. POST /api/system/config/versions/:id/discard

func (*Handler) HandleConfigVersionPreview added in v0.9.5

func (h *Handler) HandleConfigVersionPreview(c *gin.Context)

HandleConfigVersionPreview returns a preview of what activating a version will change. GET /api/system/config/versions/:id/preview

func (*Handler) HandleConfigVersionRollback

func (h *Handler) HandleConfigVersionRollback(c *gin.Context)

HandleConfigVersionRollback activates a Superseded version (rollback). POST /api/system/config/versions/:id/rollback

func (*Handler) HandleConfigVersionRollbackPreview added in v0.9.5

func (h *Handler) HandleConfigVersionRollbackPreview(c *gin.Context)

HandleConfigVersionRollbackPreview returns a preview of what rolling back to a version will change. GET /api/system/config/versions/:id/rollback-preview

func (*Handler) HandleConfigVersionSnapshot added in v0.9.5

func (h *Handler) HandleConfigVersionSnapshot(c *gin.Context)

HandleConfigVersionSnapshot returns the full ConfigSnapshot for a version, including ready-to-use YAML pack files for the Template Pack workflow. GET /api/system/config/versions/:id/snapshot

func (*Handler) HandleConfigVersions

func (h *Handler) HandleConfigVersions(c *gin.Context)

HandleConfigVersions lists all config versions.

func (*Handler) HandleConfigurationDraft

func (h *Handler) HandleConfigurationDraft(c *gin.Context)

HandleConfigurationDraft composes an ordered, validated package into one Draft ConfigVersion. It never writes live DocType tables or activates code.

func (*Handler) HandleConfigurationDryRun

func (h *Handler) HandleConfigurationDryRun(c *gin.Context)

HandleConfigurationDryRun adds impact information to the same read-only check. It deliberately does not create a ConfigVersion.

func (*Handler) HandleConfigurationValidate

func (h *Handler) HandleConfigurationValidate(c *gin.Context)

HandleConfigurationValidate checks a complete candidate without writing a version, live table, migration, or external side effect.

func (*Handler) HandleConversationConfirm

func (h *Handler) HandleConversationConfirm(c *gin.Context)

func (*Handler) HandleConversationCreate

func (h *Handler) HandleConversationCreate(c *gin.Context)

func (*Handler) HandleConversationGet

func (h *Handler) HandleConversationGet(c *gin.Context)

func (*Handler) HandleConversationMessage

func (h *Handler) HandleConversationMessage(c *gin.Context)

func (*Handler) HandleConversationProgress

func (h *Handler) HandleConversationProgress(c *gin.Context)

func (*Handler) HandleConversationSupport

func (h *Handler) HandleConversationSupport(c *gin.Context)

func (*Handler) HandleCreate

func (h *Handler) HandleCreate(c *gin.Context)

HandleCreate handles POST /api/resource/{doctype}

func (*Handler) HandleDelete

func (h *Handler) HandleDelete(c *gin.Context)

HandleDelete handles DELETE /api/resource/{doctype}/{name}

func (*Handler) HandleDigiTaxWebhook added in v0.9.5

func (h *Handler) HandleDigiTaxWebhook(c *gin.Context)

HandleDigiTaxWebhook receives DigiTax's asynchronous sale.sync callback. It is intentionally registered on the public route group: DigiTax cannot maintain a Kora session or CSRF token. Authentication is done with the site secret digitax_webhook_secret in either the X-DigiTax-Webhook-Secret header or the token query parameter.

func (*Handler) HandleExtensionCreate added in v0.9.5

func (h *Handler) HandleExtensionCreate(c *gin.Context)

HandleExtensionCreate registers a new extension.

func (*Handler) HandleExtensionDelete added in v0.9.5

func (h *Handler) HandleExtensionDelete(c *gin.Context)

HandleExtensionDelete removes an extension.

func (*Handler) HandleExtensionDeliveries added in v0.9.5

func (h *Handler) HandleExtensionDeliveries(c *gin.Context)

HandleExtensionDeliveries returns the delivery log for an extension.

func (*Handler) HandleExtensionGet added in v0.9.5

func (h *Handler) HandleExtensionGet(c *gin.Context)

HandleExtensionGet returns a single extension.

func (*Handler) HandleExtensionList added in v0.9.5

func (h *Handler) HandleExtensionList(c *gin.Context)

HandleExtensionList returns all extensions for the current site.

func (*Handler) HandleExtensionReplay added in v0.9.5

func (h *Handler) HandleExtensionReplay(c *gin.Context)

HandleExtensionReplay replays a specific delivery or all dead-lettered deliveries.

func (*Handler) HandleExtensionRotateSecret added in v0.9.5

func (h *Handler) HandleExtensionRotateSecret(c *gin.Context)

HandleExtensionRotateSecret generates a new signing secret for an extension.

func (*Handler) HandleExtensionUpdate added in v0.9.5

func (h *Handler) HandleExtensionUpdate(c *gin.Context)

HandleExtensionUpdate updates an extension.

func (*Handler) HandleFileDelete added in v0.9.5

func (h *Handler) HandleFileDelete(c *gin.Context)

HandleFileDelete removes an uploaded attachment. DELETE /files/*path

func (*Handler) HandleFileServe added in v0.9.5

func (h *Handler) HandleFileServe(c *gin.Context)

HandleFileServe serves an uploaded attachment with HTTP Range support so browsers can seek within audio/video. Access is enforced by the SiteGuard middleware. GET /files/*path

func (*Handler) HandleGet

func (h *Handler) HandleGet(c *gin.Context)

HandleGet handles GET /api/resource/{doctype}/{name}

func (*Handler) HandleKernelOperation added in v0.9.5

func (h *Handler) HandleKernelOperation(c *gin.Context)

HandleKernelOperation routes a canonical command through the operation kernel (first vertical slice: record.create, record.update). All sources share this path; there is no per-adapter mutation logic here.

func (*Handler) HandleKernelRegistry added in v0.9.5

func (h *Handler) HandleKernelRegistry(c *gin.Context)

HandleKernelRegistry lists config-defined command resources available on this runtime (KERNEL-008 introspection): name, version, permission operation, input record, and touched records with their required operations. MCP/AI/SDK catalogs derive from this surface.

func (*Handler) HandleList

func (h *Handler) HandleList(c *gin.Context)

HandleList handles GET /api/resource/{doctype}

func (*Handler) HandleMPesaSTKCallback

func (h *Handler) HandleMPesaSTKCallback(c *gin.Context)

HandleMPesaSTKCallback accepts Safaricom's asynchronous STK callback. The callback is site-scoped by the public route group and matched by the provider CheckoutRequestID. It is intentionally idempotent: once an operation is terminal, repeated callbacks are recorded but do not mutate the payment again.

func (*Handler) HandleManagedChannelClientRotate

func (h *Handler) HandleManagedChannelClientRotate(c *gin.Context)

HandleManagedChannelClientRotate is the narrow Engine-owned provisioning operation used by Cloud to install or rotate its site-scoped access token. The dedicated service token is accepted only for this exact route by SiteGuard; the credential is returned once and is never logged.

func (*Handler) HandleManagedSiteIdentity

func (h *Handler) HandleManagedSiteIdentity(c *gin.Context)

HandleManagedSiteIdentity returns the live runtime identity through the site-scoped route. A successful response includes a tenant DB ping, so Cloud can distinguish a directory row from a serving, healthy Engine runtime.

func (*Handler) HandleMethod added in v0.9.5

func (h *Handler) HandleMethod(c *gin.Context)

HandleMethod handles POST/GET /api/method/{name} — user-defined custom API endpoints. Scripts registered with script_type='api_method' and matching method_path are executed.

func (*Handler) HandleOpenAPI

func (h *Handler) HandleOpenAPI(c *gin.Context)

HandleOpenAPI returns the OpenAPI 3.x spec for the current site.

func (*Handler) HandlePageManifestByRoute added in v0.9.5

func (h *Handler) HandlePageManifestByRoute(c *gin.Context)

HandlePageManifestByRoute resolves a manifest by runtime route. GET /api/v1/page-manifests?route=/orders

func (*Handler) HandlePublicCreate added in v0.9.5

func (h *Handler) HandlePublicCreate(c *gin.Context)

HandlePublicCreate handles unauthenticated document creation. POST /v?route=/apply

func (*Handler) HandlePublicFileServe added in v0.9.5

func (h *Handler) HandlePublicFileServe(c *gin.Context)

HandlePublicFileServe serves a site attachment without auth for public assets. GET /public/files/*path

func (*Handler) HandlePublicGet added in v0.9.5

func (h *Handler) HandlePublicGet(c *gin.Context)

func (*Handler) HandlePublicList added in v0.9.5

func (h *Handler) HandlePublicList(c *gin.Context)

func (*Handler) HandlePublicView added in v0.9.5

func (h *Handler) HandlePublicView(c *gin.Context)

HandlePublicView resolves a view by route for unauthenticated users. GET /v?route=/catalog Three-layer security check:

  1. View allows public access for the component
  2. Component's source doctype has public access enabled
  3. Component bindings only reference public fields

func (*Handler) HandleScriptCreate added in v0.9.5

func (h *Handler) HandleScriptCreate(c *gin.Context)

HandleScriptCreate creates a new script.

func (*Handler) HandleScriptDelete added in v0.9.5

func (h *Handler) HandleScriptDelete(c *gin.Context)

HandleScriptDelete deletes a script.

func (*Handler) HandleScriptExecutions added in v0.9.5

func (h *Handler) HandleScriptExecutions(c *gin.Context)

HandleScriptExecutions returns the execution log for a script.

func (*Handler) HandleScriptGet added in v0.9.5

func (h *Handler) HandleScriptGet(c *gin.Context)

HandleScriptGet returns a single script.

func (*Handler) HandleScriptList added in v0.9.5

func (h *Handler) HandleScriptList(c *gin.Context)

HandleScriptList returns all scripts for the current site.

func (*Handler) HandleScriptUpdate added in v0.9.5

func (h *Handler) HandleScriptUpdate(c *gin.Context)

HandleScriptUpdate updates an existing script.

func (*Handler) HandleScriptValidate added in v0.9.5

func (h *Handler) HandleScriptValidate(c *gin.Context)

HandleScriptValidate validates a script without saving it.

func (*Handler) HandleSecretDelete

func (h *Handler) HandleSecretDelete(c *gin.Context)

HandleSecretDelete deletes a secret by key name. DELETE /api/system/secrets/:key

func (*Handler) HandleSecretList

func (h *Handler) HandleSecretList(c *gin.Context)

HandleSecretList returns all secret key names and timestamps for the current site. Values are NEVER returned. GET /api/system/secrets

func (*Handler) HandleSecretSet

func (h *Handler) HandleSecretSet(c *gin.Context)

HandleSecretSet creates or updates a secret. POST /api/system/secrets

func (*Handler) HandleSiteSettings

func (h *Handler) HandleSiteSettings(c *gin.Context)

HandleSiteSettings returns safe, non-secret settings for the current site. GET /api/system/settings

func (*Handler) HandleSiteSettingsUpdate

func (h *Handler) HandleSiteSettingsUpdate(c *gin.Context)

HandleSiteSettingsUpdate updates tenant-scoped settings. Settings are kept separate from infrastructure site_config.yaml and from versioned schema. PUT /api/system/settings

func (*Handler) HandleSwaggerUI

func (h *Handler) HandleSwaggerUI(c *gin.Context)

HandleSwaggerUI serves the Swagger UI HTML page.

func (*Handler) HandleSystemAudit

func (h *Handler) HandleSystemAudit(c *gin.Context)

HandleSystemAudit returns a redacted operation-audit projection for authorized Studio inspection. It never returns command arguments or business payloads; hashes and actor metadata explain an operation without leaking tenant data.

func (*Handler) HandleSystemBranding

func (h *Handler) HandleSystemBranding(c *gin.Context)

func (*Handler) HandleSystemDoctype

func (h *Handler) HandleSystemDoctype(c *gin.Context)

HandleSystemDoctype returns the full DocType schema with workflow and permissions. GET /api/system/doctype/:doctype Optional query param: ?format=yaml to get raw YAML output. Optional query param: ?state=current_state to get available transitions.

func (*Handler) HandleSystemDoctypeCreate

func (h *Handler) HandleSystemDoctypeCreate(c *gin.Context)

HandleSystemDoctypeCreate creates a new DocType from JSON body. POST /api/system/doctype?activate=true|false

func (*Handler) HandleSystemDoctypeDelete

func (h *Handler) HandleSystemDoctypeDelete(c *gin.Context)

HandleSystemDoctypeDelete removes a DocType configuration. DELETE /api/system/doctype/:doctype?cleanup=config|full

cleanup=config (default): Delete config rows only. Business tables, analytics, permissions survive.
cleanup=full: Full cleanup — also deletes analytics, permissions, workflows, and clears Link fields.
cleanup=none: Soft delete — only remove from registry.

func (*Handler) HandleSystemDoctypeDryRun

func (h *Handler) HandleSystemDoctypeDryRun(c *gin.Context)

HandleSystemDoctypeDryRun returns the impact analysis for a proposed doctype change. POST /api/system/doctype/dry-run

func (*Handler) HandleSystemDoctypeReferences

func (h *Handler) HandleSystemDoctypeReferences(c *gin.Context)

HandleSystemDoctypeReferences returns other doctypes that link to the given doctype. GET /api/system/doctype/:doctype/references

func (*Handler) HandleSystemDoctypeUpdate

func (h *Handler) HandleSystemDoctypeUpdate(c *gin.Context)

HandleSystemDoctypeUpdate updates an existing DocType. PUT /api/system/doctype/:doctype?activate=true|false

func (*Handler) HandleSystemDoctypeValidate

func (h *Handler) HandleSystemDoctypeValidate(c *gin.Context)

HandleSystemDoctypeValidate validates a DocType JSON or YAML body without saving. POST /api/system/doctype/validate Accepts JSON (Content-Type: application/json) or YAML (Content-Type: application/x-yaml). Returns structured errors with line numbers for unknown keys and validation issues.

func (*Handler) HandleSystemDoctypes

func (h *Handler) HandleSystemDoctypes(c *gin.Context)

HandleSystemDoctypes returns a flat list of all DocTypes with status. GET /api/system/doctypes

func (*Handler) HandleSystemExperienceUpdate

func (h *Handler) HandleSystemExperienceUpdate(c *gin.Context)

func (*Handler) HandleSystemGraph

func (h *Handler) HandleSystemGraph(c *gin.Context)

HandleSystemGraph returns the canonical DocType-backed inspection graph. GET /api/system/graph

func (*Handler) HandleSystemNavigation

func (h *Handler) HandleSystemNavigation(c *gin.Context)

HandleSystemNavigation returns the navigation config (sidebar, branding, user). GET /api/system/navigation

func (*Handler) HandleSystemPageManifest added in v0.9.5

func (h *Handler) HandleSystemPageManifest(c *gin.Context)

HandleSystemPageManifest returns a single RFC page manifest by name. GET /api/v1/system/page-manifests/:name

func (*Handler) HandleSystemPageManifestCreate added in v0.9.5

func (h *Handler) HandleSystemPageManifestCreate(c *gin.Context)

HandleSystemPageManifestCreate creates a new RFC page manifest. POST /api/v1/system/page-manifests

func (*Handler) HandleSystemPageManifestDelete added in v0.9.5

func (h *Handler) HandleSystemPageManifestDelete(c *gin.Context)

HandleSystemPageManifestDelete removes a page manifest by name. DELETE /api/v1/system/page-manifests/:name

func (*Handler) HandleSystemPageManifestUpdate added in v0.9.5

func (h *Handler) HandleSystemPageManifestUpdate(c *gin.Context)

HandleSystemPageManifestUpdate updates an existing RFC page manifest. PUT /api/v1/system/page-manifests/:name

func (*Handler) HandleSystemPageManifests added in v0.9.5

func (h *Handler) HandleSystemPageManifests(c *gin.Context)

HandleSystemPageManifests lists RFC-native page manifests. GET /api/v1/system/page-manifests

func (*Handler) HandleSystemPermissions

func (h *Handler) HandleSystemPermissions(c *gin.Context)

HandleSystemPermissions returns all permissions. GET /api/system/permissions

func (*Handler) HandleSystemPermissionsSave

func (h *Handler) HandleSystemPermissionsSave(c *gin.Context)

HandleSystemPermissionsSave replaces all permissions. PUT /api/system/permissions

func (*Handler) HandleSystemRealtime added in v0.9.5

func (h *Handler) HandleSystemRealtime(c *gin.Context)

HandleSystemRealtime streams authenticated realtime connection events. It supports WebSocket when the client upgrades, and SSE as a read-only fallback.

func (*Handler) HandleSystemRoleCreate

func (h *Handler) HandleSystemRoleCreate(c *gin.Context)

HandleSystemRoleCreate creates a new role. POST /api/system/roles

func (*Handler) HandleSystemRoleDelete

func (h *Handler) HandleSystemRoleDelete(c *gin.Context)

HandleSystemRoleDelete deletes a role. DELETE /api/system/roles/:name

func (*Handler) HandleSystemRoleUpdate

func (h *Handler) HandleSystemRoleUpdate(c *gin.Context)

HandleSystemRoleUpdate updates an existing role. PUT /api/system/roles/:name

func (*Handler) HandleSystemRoles

func (h *Handler) HandleSystemRoles(c *gin.Context)

HandleSystemRoles returns all roles. GET /api/system/roles

func (*Handler) HandleSystemView added in v0.9.5

func (h *Handler) HandleSystemView(c *gin.Context)

HandleSystemView returns a single view by name. GET /api/v1/system/views/:name

func (*Handler) HandleSystemViewCreate added in v0.9.5

func (h *Handler) HandleSystemViewCreate(c *gin.Context)

HandleSystemViewCreate creates a new view and returns a config version. POST /api/v1/system/views

func (*Handler) HandleSystemViewDelete added in v0.9.5

func (h *Handler) HandleSystemViewDelete(c *gin.Context)

HandleSystemViewDelete removes a view and returns a config version. DELETE /api/v1/system/views/:name

func (*Handler) HandleSystemViewUpdate added in v0.9.5

func (h *Handler) HandleSystemViewUpdate(c *gin.Context)

HandleSystemViewUpdate updates an existing view and returns a config version. PUT /api/v1/system/views/:name

func (*Handler) HandleSystemViews added in v0.9.5

func (h *Handler) HandleSystemViews(c *gin.Context)

HandleSystemViews returns all views for the current site. GET /api/v1/system/views

func (*Handler) HandleSystemWorkflowByDoctype

func (h *Handler) HandleSystemWorkflowByDoctype(c *gin.Context)

HandleSystemWorkflowByDoctype returns the workflow for a specific doctype. GET /api/system/workflows/:doctype

func (*Handler) HandleSystemWorkflowDelete

func (h *Handler) HandleSystemWorkflowDelete(c *gin.Context)

HandleSystemWorkflowDelete removes a workflow for a doctype. DELETE /api/system/workflows/:doctype

func (*Handler) HandleSystemWorkflowSave

func (h *Handler) HandleSystemWorkflowSave(c *gin.Context)

HandleSystemWorkflowSave creates or updates a workflow. POST /api/system/workflows

func (*Handler) HandleSystemWorkflows

func (h *Handler) HandleSystemWorkflows(c *gin.Context)

HandleSystemWorkflows returns all workflows. GET /api/system/workflows

func (*Handler) HandleUpdate

func (h *Handler) HandleUpdate(c *gin.Context)

HandleUpdate handles PUT /api/resource/{doctype}/{name}

func (*Handler) HandleUpload

func (h *Handler) HandleUpload(c *gin.Context)

HandleUpload handles file uploads via multipart form. POST /upload Stores files via the configured storage backend and returns a file reference (path + metadata) for storage in an Attach / Attach Image / Attach Audio field.

func (*Handler) HandleUserCreate

func (h *Handler) HandleUserCreate(c *gin.Context)

HandleUserCreate creates a new user. POST /api/system/users

func (*Handler) HandleUserDelete

func (h *Handler) HandleUserDelete(c *gin.Context)

HandleUserDelete deletes a user and their sessions. DELETE /api/system/users/:name

func (*Handler) HandleUserGet

func (h *Handler) HandleUserGet(c *gin.Context)

HandleUserGet returns a single user by name (ULID). GET /api/system/users/:name

func (*Handler) HandleUserList

func (h *Handler) HandleUserList(c *gin.Context)

HandleUserList returns all users for the current site. GET /api/system/users

func (*Handler) HandleUserResetPassword

func (h *Handler) HandleUserResetPassword(c *gin.Context)

HandleUserResetPassword sets a new password for a user and invalidates all their sessions. POST /api/system/users/:name/reset-password

func (*Handler) HandleUserUpdate

func (h *Handler) HandleUserUpdate(c *gin.Context)

HandleUserUpdate updates a user's profile fields. PUT /api/system/users/:name

func (*Handler) HandleViewAction added in v0.9.5

func (h *Handler) HandleViewAction(c *gin.Context)

HandleViewAction executes a view action server-side. POST /api/v1/view/action/:actionId The server resolves the action type and config from the stored view config. The client sends only context data — never chooses the action type.

func (*Handler) HandleViewByRoute added in v0.9.5

func (h *Handler) HandleViewByRoute(c *gin.Context)

HandleViewByRoute resolves a view by its route for authenticated users. GET /api/v1/views?route=/pos/register Optional: ?version=draft to preview the latest Draft version.

func (*Handler) HandleViewData added in v0.9.5

func (h *Handler) HandleViewData(c *gin.Context)

HandleViewData returns aggregated data for dashboard/metric components. GET /api/v1/view/data?view=Name&component=id

func (*Handler) HandleViewValidate added in v0.9.5

func (h *Handler) HandleViewValidate(c *gin.Context)

HandleViewValidate validates a view config against the registry's doctypes. POST /api/v1/system/views/validate

func (*Handler) HandleWorkflowAction

func (h *Handler) HandleWorkflowAction(c *gin.Context)

HandleWorkflowAction handles POST /api/resource/{doctype}/{name}/workflow_action

type Meta

type Meta struct {
	ConfigVersion int    `json:"config_version,omitempty"`
	DocType       string `json:"doctype,omitempty"`
	Total         int    `json:"total,omitempty"`
}

Meta holds response metadata.

type ModuleGroup

type ModuleGroup struct {
	Module   string           `json:"module"`
	Label    string           `json:"label"`
	DocTypes []DocTypeNavItem `json:"doctypes"`
}

ModuleGroup is a group of DocTypes under a module.

type NavigationResponse struct {
	Modules           []ModuleGroup  `json:"modules"`
	Views             []ViewNavItem  `json:"views,omitempty"`
	Branding          Branding       `json:"branding"`
	Copy              ExperienceCopy `json:"copy"`
	User              UserInfo       `json:"user"`
	AdminCapabilities []string       `json:"admin_capabilities"`
}

NavigationResponse is the full navigation config for the SPA sidebar.

type ReferenceInfo

type ReferenceInfo struct {
	Doctype   string `json:"doctype"`
	Fieldname string `json:"fieldname"`
	Label     string `json:"label"`
}

ReferenceInfo describes a doctype that links to the current doctype via a Link field.

type Response

type Response struct {
	Data any   `json:"data,omitempty"`
	Meta *Meta `json:"meta,omitempty"`
}

Response is the standard API response envelope.

type ScriptCandidate

type ScriptCandidate struct {
	Name           string `json:"name"`
	ScriptType     string `json:"script_type"`
	DocType        string `json:"doctype,omitempty"`
	Event          string `json:"event,omitempty"`
	MethodPath     string `json:"method_path,omitempty"`
	WorkflowAction string `json:"workflow_action,omitempty"`
	Schedule       string `json:"schedule,omitempty"`
	RunAs          string `json:"run_as,omitempty"`
	TimeoutMs      int    `json:"timeout_ms,omitempty"`
	Source         string `json:"source"`
}

type SecretEntry

type SecretEntry struct {
	KeyName   string `json:"key_name"`
	UpdatedAt string `json:"updated_at"`
}

SecretEntry represents a secret in list responses (value never exposed).

type SiteRuntimeService

type SiteRuntimeService struct {
	EventBus       analytics.EventBus
	AnalyticsRelay *analytics.CloudRelay
	Realtime       *natsprovider.Provider
	ScriptStore    *script.Store
	SecretStore    *secret.Store
	WebhookWorker  *webhook.Worker
	Outbox         outbox.Writer
	Storage        storage.Backend
}

SiteRuntimeService is the process-local service bundle for one loaded site.

func RuntimeServiceForContext

func RuntimeServiceForContext(c *gin.Context, registry *SiteRuntimeServices, site string) SiteRuntimeService

RuntimeServiceForContext returns the immutable bundle captured by routing middleware for this request, falling back to the live registry for system handlers that are not bound to a tenant runtime.

type SiteRuntimeServices

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

SiteRuntimeServices is the concurrency-safe, replaceable set of per-site services used by HTTP handlers. Directory updates publish a complete service bundle under one lock; request handlers never read a map while it is being mutated. It intentionally contains process-local services, not registry data.

func NewSiteRuntimeServices

func NewSiteRuntimeServices() *SiteRuntimeServices

func (*SiteRuntimeServices) Get

func (*SiteRuntimeServices) Remove

func (s *SiteRuntimeServices) Remove(site string)

Remove atomically retires the handler-visible service bundle for a site.

func (*SiteRuntimeServices) Replace

func (s *SiteRuntimeServices) Replace(site string, services SiteRuntimeService)

Replace publishes the complete bundle for a site atomically.

func (*SiteRuntimeServices) SetStorage

func (s *SiteRuntimeServices) SetStorage(site string, backend storage.Backend)

type SystemAuditEntry

type SystemAuditEntry struct {
	ID            string `json:"id"`
	OperationID   string `json:"operation_id"`
	CorrelationID string `json:"correlation_id,omitempty"`
	CausationID   string `json:"causation_id,omitempty"`
	Source        string `json:"source,omitempty"`
	PrincipalType string `json:"principal_type,omitempty"`
	PrincipalID   string `json:"principal_id,omitempty"`
	ActorUser     string `json:"actor_user,omitempty"`
	Command       string `json:"command"`
	Doctype       string `json:"doctype,omitempty"`
	DocName       string `json:"doc_name,omitempty"`
	Status        string `json:"status"`
	ErrorCode     string `json:"error_code,omitempty"`
	PayloadHash   string `json:"payload_hash,omitempty"`
	BeforeHash    string `json:"before_hash,omitempty"`
	AfterHash     string `json:"after_hash,omitempty"`
	CreatedAt     string `json:"created_at"`
}

SystemAuditEntry is the redacted, read-only projection of the operation ledger exposed to authorized Studio users. It intentionally excludes command arguments and business payloads; hashes and actor metadata are sufficient to explain an operation without leaking tenant data.

type SystemDoctypeResponse

type SystemDoctypeResponse struct {
	DocType      *doctype.DocType             `json:"doctype"`
	Status       string                       `json:"status"` // "Active" or "Draft"
	Workflow     *WorkflowResponse            `json:"workflow,omitempty"`
	Permissions  map[string]bool              `json:"permissions"`
	Transitions  []doctype.WorkflowTransition `json:"transitions,omitempty"`
	ReferencedBy []ReferenceInfo              `json:"referenced_by,omitempty"`
}

SystemDoctypeResponse is the full schema response for a single DocType.

type SystemGraphEdge

type SystemGraphEdge struct {
	From     string `json:"from"`
	To       string `json:"to"`
	Relation string `json:"relation"`
	Via      string `json:"via,omitempty"`
}

type SystemGraphNode

type SystemGraphNode struct {
	ID      string `json:"id"`
	Kind    string `json:"kind"`
	Label   string `json:"label"`
	Detail  string `json:"detail"`
	Doctype string `json:"doctype,omitempty"`
}

SystemGraphNode is the canonical, read-only projection used by inspection clients. Business schema nodes are always DocTypes; "entity" is not a registrable runtime kind.

type SystemGraphResponse

type SystemGraphResponse struct {
	Nodes []SystemGraphNode `json:"nodes"`
	Edges []SystemGraphEdge `json:"edges"`
}

func BuildSystemGraph

func BuildSystemGraph(reg *doctype.Registry, workflows []*doctype.Workflow) SystemGraphResponse

BuildSystemGraph projects the active DocType registry and workflows into a stable inspection graph. It intentionally has no second Entity schema.

type TenantExperience

type TenantExperience struct {
	Branding Branding       `json:"branding"`
	Copy     ExperienceCopy `json:"copy"`
}

type UserInfo

type UserInfo struct {
	Name     string   `json:"name"`
	FullName string   `json:"full_name"`
	Email    string   `json:"email"`
	Roles    []string `json:"roles"`
}

UserInfo is the current user's public info for the UI.

type UserRequest

type UserRequest struct {
	Email    string   `json:"email"`
	Password string   `json:"password,omitempty"`
	FullName string   `json:"full_name"`
	Roles    []string `json:"roles"`
	Enabled  *bool    `json:"enabled,omitempty"`
}

UserRequest is the request body for create/update user.

type UserResponse

type UserResponse struct {
	Name     string   `json:"name"`
	Email    string   `json:"email"`
	FullName string   `json:"full_name"`
	Roles    []string `json:"roles"`
	Enabled  bool     `json:"enabled"`
	Created  string   `json:"created"`
	Modified string   `json:"modified"`
}

UserResponse is the public representation of a user (no password_hash).

type ViewNavItem added in v0.9.5

type ViewNavItem struct {
	Name   string `json:"name"`
	Label  string `json:"label"`
	Route  string `json:"route"`
	Type   string `json:"type"`
	Module string `json:"module"`
	Icon   string `json:"icon,omitempty"`
}

ViewNavItem is a configured workspace view entry in the navigation.

type WorkflowResponse

type WorkflowResponse struct {
	States      []doctype.WorkflowState      `json:"states"`
	Transitions []doctype.WorkflowTransition `json:"transitions"`
	StateField  string                       `json:"state_field"`
}

WorkflowResponse holds the workflow definition for a DocType.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL