HOC SiteDocumentation

The object model

Object types, fields, entries, relations, and user kinds. This is the data model behind dynamic pages, forms, and website accounts.

Object types

An object type has a kind:

  • single — at most one entry. Good for a settings-like record.
  • collection — many entries. Good for posts, products, listings.
  • user — website accounts. Entries carry password_hash, role, approved, email_verified, and blocked, and passwords are hashed only for this kind.

An object type declares its field schema, an identifier field, an optional detail-route parameter name, and lifecycle configuration.

Fields

Each field has a key, a label, a type, and constraints such as required, unique, min/max, and allowed mime types. Supported types include text, email, phone, multiline text, rich text, image, file, url, number, boolean, enum, date, dateTime, schedule, password, social link, and the relation types relation_object, relation_user, and relation_role. calculated fields derive their value from a formula instead of user input.

Localizable fields hold one value per locale. Sensitive fields are never returned to callers that lack a field grant.

Entries

An entry stores fieldValues plus localizedValuesByLocale. Reads respect permissions: a caller sees only the entries and fields its grants allow. Deletes are soft, and deleting an object type is reversible with restore.

A single type rejects a second entry. A relation field points at another entry, a website user, or a role, and onDelete decides whether the reference is nullified, restricted, or soft-cascaded.

Finding entries

List endpoints accept free-text search, field filters, and sorting. Filters are AND-combined, and a dotted path reads a field on the related entry. Pagination is page plus pageSize, capped at 100.