app(...). You call it at a path in your own tree, and it places its
tables, functions, reactions and operator role under that path. The
guides below describe each mode the connector catalog implements. The
catalog lists every provider and mode and links
its guide.
Mount an app
Every connector app follows the same shape:- Declare the
labelits rows live under, or uselabel.public. - Declare a
secret()for each credential and place it in your tree. - Bind a receiver with the app’s binder: the endpoint, the credential and the label. A binder takes no name, because its path in your tree names it.
- Call the app at a path, passing
dataand the receiver.
bijection/app.ts
box.source.initialize,
box.source.health, box.records.list. They allow the app’s operator
role, box.operator, which clears data. The same role holds the app’s clock
reactions. Set the credential, grant the role, and start the source:
box.operator is granted from code: ctx.grant(box.operator, { to, under }) in one of your
mutations (Grants).
Each provider guide gives the binder call and the initialization arguments
for its modes. Call the app’s functions from your own code with
ctx.call(box.source.health, {}), where box is the value the app returned,
or expose your own functions over them.
Provider writes
Bind a writer receiver at the samedata label and pass it to the app. The
app places its write functions under the mount, allowed only to its
operator role. Each accepted command is a row under data. The app’s clock
submits one task per command with the command’s key as its once, and the
writer’s contract decides the task’s result. The app records the provider’s
evidence under the same label. An accepted answer means the command is
queued. A provider reply that never arrives leaves the result Unknown.
For a native REST write mode, bind providerWriter(mode, { endpoint, auth, scope? }, data)
and pass it as receivers.writers[mode]:
<mount>.writes.submit({ key, mode, command }) and read
its state with <mount>.writes.get.
Installer-bound labels
Every connector app takes itsdata label from you. Pass label.public for
public data. For protected data, declare a label, pass it as data and as the
binder’s label argument. The app’s operator role clears data, and every
row, position, task and File the app keeps lives under it. A provider that
returns personal or tenant data refuses ProtectedLabelRequired under
label.public.
A protected SFTP source mounts as follows:
bijection/app.ts