Returns a Date or null, including relative expressions.
formatIsoDate(input)
Returns normalized ISO date/time output or throws.
addDuration(date, duration)
Adds a duration and returns an ISO string.
diffDuration(start, end)
Returns the difference as an ISO duration.
DurationInput, DurationObject
Public duration input types.
referenceDate controls only a direct parseDate() call. Relative values passed through
builders or formatIsoDate() use the live execution-time clock; prefer explicit ISO input
for reproducible output.
Typed relation input: a compatible entity, an ID string, or an explicit { '@id' } object.
EntityIdReference
Shape of an explicit { '@id': string } relation pointer.
entityRef({ schemas, types?, fallbackType? })
Creates the shared Zod relation schema used by built-in builders.
createSearchAction(options)
Creates a SearchAction and EntryPoint for a URL template.
Use a specialized schema for each property instead of accepting every Schema.org entity:
const PublisherSchema = entityRef({
schemas: [OrganizationSchema, PersonSchema],
types: ['Organization', 'Person'],
fallbackType: 'Organization',
});
The same primitive preserves direct builder entities, normalizes ID strings to { '@id' },
and expands plain strings with fallbackType. Without a fallback type, plain strings are
rejected; pass a direct entity, an explicit ID-looking string, or an { '@id' } object.
Value objects such as addresses remain separate schemas so free-form strings are not
mistaken for entity references.
Import getHtmlFiles, auditHtmlContent, auditHtmlDirectory, AuditError, and AuditResult from
@unschema-graph/core/audit. This entry point uses Node.js filesystem modules and should only run in
build tooling or server code.