CMS / foldkit-cms-drizzle

CmsServerConfig

interface · packages/cms-drizzle/src/index.ts:154

interface CmsServerConfig<User> {
  readonly tables: CmsTables
  readonly content: ReadonlyArray<ServedContent<Option.Option<User>>>
  readonly transaction: Transaction
  readonly policy: Policy<User>
  readonly authors: ReadonlyArray<PrincipalGuard<User>>
  readonly transitions?:
    | {
        readonly [T in Transition]?:
          ReadonlyArray<PrincipalGuard<User>> | undefined
      }
    | undefined
  readonly allow?: (
    principal: Option.Option<User>,
    transition: Transition,
    entry: EntryRow,
  ) => boolean
  readonly now?: () => Date
  readonly maxDraftSize?: number
  readonly nameOf?: (principal: Option.Option<User>) => string | null
}

Members

CmsServerConfig.tables

property · packages/cms-drizzle/src/index.ts:155

readonly tables: CmsTables

CmsServerConfig.content

property · packages/cms-drizzle/src/index.ts:156

readonly content: ReadonlyArray<ServedContent<Option.Option<User>>>

CmsServerConfig.transaction

property · packages/cms-drizzle/src/index.ts:158

readonly transaction: Transaction

How a publish is made whole: Transaction.statements or Transaction.drizzle.

CmsServerConfig.policy

property · packages/cms-drizzle/src/index.ts:160

readonly policy: Policy<User>

The guard set's bodies, which decide authors and transitions.

CmsServerConfig.authors

property · packages/cms-drizzle/src/index.ts:165

readonly authors: ReadonlyArray<PrincipalGuard<User>>

Who reads and writes unpublished work: a principal any of these lets. Everyone else is a visitor.

CmsServerConfig.transitions

property · packages/cms-drizzle/src/index.ts:170

readonly transitions?:
  | {
      readonly [T in Transition]?:
        ReadonlyArray<PrincipalGuard<User>> | undefined
    }
  | undefined

Who of the authors may make a transition: any of its guards lets. One not named is any author's.

CmsServerConfig.allow

property · packages/cms-drizzle/src/index.ts:177

readonly allow?: (
  principal: Option.Option<User>,
  transition: Transition,
  entry: EntryRow,
) => boolean

Whether this author may make this transition of this entry, for a rule about the entry itself: asked after the entry is found, the transition is one its state offers, and transitions let. Default: they may.

CmsServerConfig.now

property · packages/cms-drizzle/src/index.ts:183

readonly now?: () => Date

The server's clock, passed in so a test can hold it.

CmsServerConfig.maxDraftSize

property · packages/cms-drizzle/src/index.ts:189

readonly maxDraftSize?: number

The most a draft may hold, as the characters of its JSON: its values and its form's Model together. An author is trusted with their own content, not with the database's disk. Default: one million.

CmsServerConfig.nameOf

property · packages/cms-drizzle/src/index.ts:191

readonly nameOf?: (principal: Option.Option<User>) => string | null

Who a principal is, for createdBy and updatedBy.