Skip to content

Verb Function

A Verb Function is the code that runs one Verb, named for its Noun and Verb, so the file name binds it with no registration.

PropertyValue
Pathnouns/[Noun].[verb].ts
HoldsFunction
Kindfile
Leadersdb-first, git-first
TeamEngineering Team
Written byChange.merge
Compiled bySoftwareBuilder

Example

nouns/Close.reconcile.ts in a Startup repository. Closewise, a sample business, declares a Close Noun.

nouns/Close.reconcile.ts
export default async (close: Close, input: CloseReconcileInput, $: $) => {
  const open = await $.Transaction.list({ where: `receipt = null and settledAt <= '${input.through}'` })
  return $.Close.update({ id: close.$id, balanced: open.length === 0 })
}

Exports

ExportKindType
defaultdefault(thing: Noun, input: NounVerbInput, $: $) => Promise<Output>

Signature

TypeScript
(thing: Noun, input: NounVerbInput, $: $) => Promise<Output>

Generates

SoftwareBuilder compiles it into these records, Verbs and routes.

KindWhat
RecordsFunction, Action
VerbsNone.
RoutesPOST /{ns}/{nouns}/{noun}/{verb}