Remote / foldkit-remote-domain

Import a Domain command without a declared Write

When a Domain command has no Foldkit Write declaration, wrap it with Imported.mutation so pages can still invoke it and audit its schema and field footprint:

ts
import { Footprint } from 'foldkit-entity'
import { Imported } from 'foldkit-remote-domain/imported'

const ImportedRename = Imported.mutation(NotesApi, 'Rename', {
  entity: NoteEntity,
  footprint: Footprint.declared({ writes: [NoteEntity.fields.name], by: 'the notes team' }),
})

const description = Imported.describe(NotesApi, {
  views: [NoteReads],
  commands: [
    DomainRemote.command(ImportedRename, NotesApi, 'Rename', {
      entity: NoteEntity,
      target: input => input.target,
      input: input => input.input,
    }),
  ],
})
console.log(Imported.show(description))

A command's footprint is Derived (from a Write), Declared (explicitly listed with by), or Unknown (conservatively treated as able to write any field). Imported.show renders a Markdown summary of schemas, rejections, and footprints that you can snapshot-test to catch upstream Domain schema changes.