Skip to content

Reference

The reference describes the Builder calls that declare an App and the members a handler uses on what they declare. An entry gives the signature, what it declares, its arguments, what it returns, a sample from an App in the Tutorial or the Examples, and how it behaves when the App runs.

Call What it does Page
addState, addTransition Declares a state of a Template, and a move from it to another state. States and transitions
state.value The state an Item is in. States and transitions
state.transitions The transitions an Item offers from its state. States and transitions
execute Moves an Item to the state a transition leads to. States and transitions
addTemplate Declares a Template: a kind of Item. Templates, Properties, Relations
addProperty Declares a Property of a Template, of one data type. Templates, Properties, Relations
addRelation Declares a Relation from the Items of a Template to the Items of another. Templates, Properties, Relations
addUnion Declares a Union: a group of Templates that a Relation leads to. Templates, Properties, Relations
properties, propertyValues The Properties of an Item, as values and as values with their data types. Templates, Properties, Relations
createChild Creates an Item as a child of another Item. Templates, Properties, Relations
updateProperties Saves new values for Properties of an Item. Templates, Properties, Relations
upsertChildByKey Creates the child that has a key, or writes to it. Templates, Properties, Relations
getItem, getItemByKeyPath Finds an Item by its Identifier, or by the keys that lead to it. Templates, Properties, Relations
getParent, selectChildren The Item above an Item, and the Items below it. Templates, Properties, Relations
get, set, clear Reads and writes the side of a Relation that leads to one Item. Templates, Properties, Relations
select, add, remove Reads and writes the side of a Relation that leads to many Items. Templates, Properties, Relations
addMutation Declares a Mutation: an operation that writes. Mutations and Queries
addQuery Declares a Query: an operation that reads. Mutations and Queries
input.addProperty Declares a value of the input of an operation, of one data type. Mutations and Queries
input.addArray Declares a list in the input of an operation. Mutations and Queries
input.addObject Declares an object in the input of an operation. Mutations and Queries
output.item Declares that an operation returns an Item, a list of Items or a page of them. Mutations and Queries
output.value Declares that an operation returns a value, or a list of values. Mutations and Queries
output.object, output.void Declares that an operation returns an object, or no value. Mutations and Queries
handler Runs a Mutation or a Query, from a script or from another handler. Mutations and Queries
addEvent Declares an Event of a Template or of the App, and its payload. Events, Listeners, schedules
addListener Declares a Listener: a function that runs for each Event published. Events, Listeners, schedules
template.events The Events of a Template, of an imported App too, and the Event created. Events, Listeners, schedules
addParentListener Declares a Listener on a Template for an Event of the Items below its Items. Events, Listeners, schedules
addSchedule Declares a schedule, which publishes an Event by the clock. Events, Listeners, schedules
publish Publishes an Event from a handler. Events, Listeners, schedules
event.payload The Event a Listener gets: its payload, its Identifier, its time and its PRN. Events, Listeners, schedules
delay, cancel Publishes an Event after a length of time, and takes it back before then. Events, Listeners, schedules
app.addRole Declares an App Role: a Role that is assigned to people. Roles and Grants
addGrant Declares a Grant on an operation: who calls a Mutation or a Query. Roles and Grants
template.addRole Declares a Template Role: a Role a person holds on one Item at a time. Roles and Grants
template.addGrant Declares a Grant on a Template: who gets its Items. Roles and Grants
checkRole, assertRole Checks in a handler whether the person the call runs as holds an App Role. Roles and Grants
item.checkRole, item.assertRole Checks in a handler whether that person holds a Template Role on an Item. Roles and Grants
assign, revoke Assigns an App Role to a person, and takes it away. Roles and Grants
ctx.principalId The Identifier of the person the call runs as. Roles and Grants
ctx.sudo Runs a function with a context that no Grant limits. Roles and Grants
ctx.now The time of the call a Mutation or a Query runs in. Inside a handler
ctx.getWorkspaceItem The Workspace Item, and the Workspace Template an App declares Properties on. Inside a handler
ctx.apps, ctx.root Every App of the Definition by its canonical name, and the root App. Inside a handler
ctx.hashKey Makes a key from a text that is no key itself. Inside a handler
current.templates The Templates of an App, and whether a value is an Item of one. Inside a handler
current.unions The Unions of an App, which select and find Items across their Templates. Inside a handler
selectItems Starts a selector over the Items of a Template, or of every Template. Inside a handler
execute, first, iterator Runs a selection: one page of Items, one Item, or every Item. Inside a handler
key, state Narrows a selection by key, by state, by Identifier and by parent. Inside a handler
filter Narrows a selection by the values of Properties and by Relations. Inside a handler
sort Orders a selection by one term or by two. Inside a handler
join, joinChildren, joinParents Turns a selection into the Items a Relation leads to, their children or their parents. Inside a handler
paginate Turns a selection into numbered pages with their counts. Inside a handler
cursor Begins a selection after a page it gave before. Inside a handler
archive, archived Archives an Item, and says what a selector does with archived Items. Inside a handler
selectEvents Starts a selector over the Events saved in a Workspace, for the system. Inside a handler
app.addMetric Declares a Metric: a count of the Events it names. Metrics and Dimensions
app.addMetricDimension Declares a Dimension: what a Metric counts by. Metrics and Dimensions
metric.addDimension Attaches a Dimension to a Metric, with the function that finds the Item an Event counts for. Metrics and Dimensions
current.metrics The Metrics of an App, and the Dimensions of each. Metrics and Dimensions
metric.query Begins a query of a Metric: a count of its Events. Metrics and Dimensions
interval, period Sets the interval of time a query counts in, and the period of its report. Metrics and Dimensions
query.execute Runs a query, and returns the report with its counts. Metrics and Dimensions
app.configure Gives an App its key, by which the Definition and every handler know it. Apps, importing, App Hooks
app.addDependency Imports an App into another, and returns it as the importing App reads it. Apps, importing, App Hooks
imported.templates The Templates of an imported App, which the importing App uses as its own. Apps, importing, App Hooks
imported.roles The App Roles of an imported App, which the importing App names in Grants and Roles. Apps, importing, App Hooks
imported.events The Events of an imported App, which the importing App adds a Listener to. Apps, importing, App Hooks
app.onCreate Adds an App Hook, which runs when a Workspace is created. Apps, importing, App Hooks
app.onSeed Adds an App Hook that runs when a Source Workspace is created. Apps, importing, App Hooks
ctx.seed Saves in an App Hook the Items a Workspace starts with. Apps, importing, App Hooks

The Glossary defines each term. The generated API reference lists every type and member.