Documentation
¶
Overview ¶
Package config validates and normalizes the public authoring model into a canonical immutable schema manifest.
Index ¶
- Constants
- func Resolve(input Input) (schema.Manifest, error)
- func UploadFields(authored field.Fields, path string) (field.Fields, error)
- type Admin
- type AdminLanguage
- type AdminLocalization
- type AdminTimeZone
- type Collection
- type CollectionAdmin
- type CollectionIndex
- type Endpoint
- type Global
- type GlobalAdmin
- type Graph
- type ImageSize
- type Input
- type LivePreviewConfig
- type Locale
- type Localization
- type Occurrence
- type Plugin
- type PluginAdmin
- type PluginCompatibility
- type PluginEndpoint
- type PluginFieldType
- type PreviewBreakpoint
- type ReferenceBinding
- type RepeatedAxis
- type UploadConfig
- type VersionConfig
Constants ¶
const BlockResource = "block"
BlockResource is the ResourceKind of a block definition's occurrences.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
Resolve performs a complete deterministic validation pass before freezing a manifest. It has no runtime plugin setup, database, filesystem, or network dependency.
func UploadFields ¶ added in v0.2.0
UploadFields completes the graph before plugin edits and occurrence binding. Managed metadata retains its required/index/read-only settings. Declarations may add field-owned behavior and presentation, but cannot change its storage shape or introduce static value constraints that uploads do not support.
Types ¶
type Admin ¶
type Admin struct {
User schema.CollectionSlug
Localization AdminLocalization
}
type AdminLanguage ¶
type AdminLocalization ¶
type AdminLocalization struct {
Languages []AdminLanguage
DefaultLanguage string
TimeZones []AdminTimeZone
DefaultTimeZone string
}
type AdminTimeZone ¶
type Collection ¶
type Collection struct {
Slug schema.CollectionSlug
Labels schema.CollectionLabels
Admin CollectionAdmin
Fields field.Fields
Indexes []CollectionIndex
Auth bool
SessionDuration time.Duration
PasswordMinLength int
PasswordMaxBytes int
PasswordBcryptCost int
MaxLoginAttempts int
LockDuration time.Duration
PasswordReset bool
PasswordResetTTL time.Duration
VerifyEmail bool
VerificationTTL time.Duration
APIKeys bool
Upload bool
UploadConfig UploadConfig
Versions bool
Trash bool
LockDocuments bool
DocumentLockDuration time.Duration
VersionConfig VersionConfig
Endpoints []Endpoint
}
type CollectionAdmin ¶
type CollectionIndex ¶
type Global ¶
type Global struct {
Slug schema.CollectionSlug
Label string
LabelTranslations map[string]string
Admin GlobalAdmin
Fields field.Fields
Versions bool
VersionConfig VersionConfig
Endpoints []Endpoint
}
type GlobalAdmin ¶
type Graph ¶ added in v0.2.0
type Graph struct {
// contains filtered or unexported fields
}
Graph is the private companion to a manifest. Authoring nodes retain their executable attachments here; both remain private. Application construction lowers the companion once; requests never query it.
Each resource's own fields and each block definition's fields are recorded once. A definition is a scope of its own, with definition-relative paths, however many containers select it: the engine binds a definition's field once and resolves each placement from the document it walks, so the graph and everything lowered from it follow definitions, not placements.
func ResolveGraph ¶ added in v0.2.0
ResolveGraph binds field-owned selectors before lowering the manifest and retains their symbolic declarations in immutable occurrence views.
func (Graph) Binding ¶ added in v0.2.0
Binding returns an immutable view, never an executable dispatch table. Only fields with executable behavior, a visibility condition, or a reference target retain a view; the Occurrence alone describes every other field.
func (Graph) Occurrences ¶ added in v0.2.0
func (g Graph) Occurrences() []Occurrence
type Input ¶
type Input struct {
AdminLoaders []schema.AdminLoader
Blocks []field.Block
Name string
NameTranslations map[string]string
AllowIDOnCreate bool
Admin Admin
Localization *Localization
Collections []Collection
Globals []Global
Endpoints []Endpoint
Plugins []Plugin
}
type LivePreviewConfig ¶
type LivePreviewConfig struct {
URL string
Breakpoints []PreviewBreakpoint
}
type Locale ¶
type Locale struct {
Code schema.LocaleCode
Label string
RTL bool
FallbackLocales []schema.LocaleCode
}
type Localization ¶
type Localization struct {
Locales []Locale
DefaultLocale schema.LocaleCode
DisableFallback bool
}
type Occurrence ¶ added in v0.2.0
type Occurrence struct {
ID string `json:"id"`
SchemaID schema.StableID `json:"schemaId,omitempty"`
ResourceKind string `json:"resourceKind"`
Resource string `json:"resource"`
Name string `json:"name,omitempty"`
Kind field.Kind `json:"kind,omitempty"`
Boundary string `json:"boundary"`
Stored bool `json:"stored"`
AuthoredPath string `json:"authoredPath"`
ResolvedPath string `json:"resolvedPath"`
ParentID string `json:"parentId,omitempty"`
ScopeID string `json:"scopeId"`
LocaleOwner string `json:"localeOwner,omitempty"`
Repeated []RepeatedAxis `json:"repeated,omitempty"`
Provenance []string `json:"provenance,omitempty"`
References []ReferenceBinding `json:"references,omitempty"`
Extensions map[string]store.Value `json:"extensions,omitempty"`
}
Occurrence is a field of a resource or of a block definition, not a concrete runtime row. ResourceKind is "collection", "global" or "block"; a block definition's occurrences name its slug as Resource, and their paths are relative to the definition. Repeated axes retain the identity property and case within that scope; LocaleOwner identifies an exact-locale dimension the scope declares. A placement additionally inherits its container's locale scope, which the engine reads from the document walk.
type Plugin ¶
type Plugin struct {
Key string
Version string
GoPackage string
APIVersion uint32
Ridu *PluginCompatibility
Admin *PluginAdmin
FieldTypes []PluginFieldType
Endpoints []PluginEndpoint
}
type PluginAdmin ¶
type PluginCompatibility ¶
type PluginEndpoint ¶
type PluginFieldType ¶
type PluginFieldType struct {
// EmbeddedTypes lists tree.case selectors supplying ordered generic payload type arguments.
EmbeddedTypes []string `json:"embeddedTypes,omitempty"`
Key string
TypeScriptPackage string
TypeScriptOutput string
TypeScriptInput string
TypeScriptWhere string
GoPackage string
GoType string
JSONSchema []byte
}
type PreviewBreakpoint ¶
type ReferenceBinding ¶ added in v0.2.0
type ReferenceBinding struct {
Policy string `json:"policy"`
Scope field.ReferenceScope `json:"scope"`
Path string `json:"path"`
TargetID string `json:"targetId"`
ResolvedPath string `json:"resolvedPath"`
}
ReferenceBinding is a visibility condition's bound target. A root reference from a block definition binds once for each resource that places the definition, since each resolves the path against its own root.