← @mortar-kit/core

ContentWriteinterface

import { ContentWrite } from '@mortar-kit/core'

interface ContentWrite<User>

One write, as canWrite sees it.

Properties

user: User

Who is writing: what auth.require returned (undefined with auth: false).

action: ContentWriteAction

The function called.

collection?: string

The collection a document write touches; undefined for asset writes.

id?: string

The document's id (save, remove, move), the asset's key (removeAsset, updateAsset) or the folder's id (folders; undefined for a new one).

doc?: Doc<Record<string, unknown>>

The document being saved (save only).

stored?: Doc<Record<string, unknown>> | null

The document as stored now (document writes; null when a save creates it).