CMS / foldkit-cms

The lifecycle

State is derived from facts and a clock. Nothing stores a status, so it cannot disagree with what is true.

ts
Cms.state({ archivedAt: null, row: 'visible', draft: { scheduledFor, scheduleError: null } }, now)
// { _tag: 'Changed', schedule: { at, overdue: false, error: null } }
StateFacts
Newno row yet
Publisheda row a visitor sees, and no draft
Changeda row a visitor sees, and unpublished work beside it
Unpublisheda row hidden by its published role
Archivedthe entry was archived; nothing else applies until it is restored

A schedule rides beside a state that has a draft. A scheduled publish that did not happen reads overdue, with the reason, because that is true; it does not read Published.

Cms.offers(facts, now, content) is the transitions an entry offers now: save, discard, publish, schedule, unschedule, unpublish, archive, unarchive, restore. It is what a view enables and what a server checks before it asks who is asking. unpublish is offered only to a content type with a published role.