Liking cljdoc? Tell your friends :D

com.blockether.vis.contract.app

Pure rules of app attachments: threads, drafts and Send receipts.

An app attachment is a live view with the attachment placement. The engine and the TUI apply these rules to the same engine-shaped maps, so both paint the same threads and receipts. Every function here is pure: ids, authors and times come from the caller.

Pure rules of app attachments: threads, drafts and Send receipts.

An app attachment is a live view with the `attachment` placement. The engine
and the TUI apply these rules to the same engine-shaped maps, so both paint the
same threads and receipts. Every function here is pure: ids, authors and times
come from the caller.
raw docstring

agent-note-errorclj

(agent-note-error view text)

nil when text can be the note of view for the model, otherwise the reason. Only an app takes a note. A blank text is valid: it removes the note.

nil when `text` can be the note of `view` for the model, otherwise the reason.
Only an app takes a note. A blank text is valid: it removes the note.
sourceraw docstring

app?clj

(app? view)

True when view is an app attachment.

True when `view` is an app attachment.
sourceraw docstring

append-logclj

(append-log view {:keys [level at source] :as entry})

App view with entry at the end of its log. The entry takes the next seq. :at and :source come from the caller. Long texts are cut by cut-log-texts, so an entry is never lost. The log keeps only its newest entries.

App `view` with `entry` at the end of its log. The entry takes the next `seq`.
`:at` and `:source` come from the caller. Long texts are cut by
[[cut-log-texts]], so an entry is never lost. The log keeps only its newest
entries.
sourceraw docstring

blank-text?clj

(blank-text? text)

True for nil or text with only whitespace.

True for nil or text with only whitespace.
sourceraw docstring

boundsclj

How many receipts, threads, messages, Send values and Send comments an app holds, and the longest texts: a message body, a Send note and the note for the model.

How many receipts, threads, messages, Send values and Send comments an app
holds, and the longest texts: a message body, a Send note and the note for the
model.
sourceraw docstring

cut-log-textsclj

(cut-log-texts {:keys [message detail] :as entry})

Log op or entry entry with its texts inside the schema bounds. The message is trimmed and cut at its end. A long detail loses its middle, and a blank detail is dropped. Other values stay as they are.

Log op or entry `entry` with its texts inside the schema bounds. The message is
trimmed and cut at its end. A long detail loses its middle, and a blank detail
is dropped. Other values stay as they are.
sourceraw docstring

draft-opclj

(draft-op node {:keys [thread-id anchor body]} new-id)

The patch operation that saves body as the draft of a thread in node, or nil when nothing changes. action holds :thread-id, :anchor and :body. A new thread takes new-id. Blank text removes a draft, and a new blank thread is never created.

The patch operation that saves `body` as the draft of a thread in `node`, or
nil when nothing changes. `action` holds `:thread-id`, `:anchor` and `:body`.
A new thread takes `new-id`. Blank text removes a draft, and a new blank thread
is never created.
sourceraw docstring

effective-surfacesclj

(effective-surfaces view setting)

The surfaces that a reader of app view gets. setting answers the value of a setting id, or nil when the setting does not exist. apps_inline and apps_session turn a surface off for every app. The app's own settings win over what the app declared.

The surfaces that a reader of app `view` gets. `setting` answers the value of a
setting id, or nil when the setting does not exist. `apps_inline` and
`apps_session` turn a surface off for every app. The app's own settings win
over what the app declared.
sourceraw docstring

find-shortcutclj

(find-shortcut view k)

The shortcut of view that binds key k, or nil.

The shortcut of `view` that binds key `k`, or nil.
sourceraw docstring

find-submissionclj

(find-submission view submission-id)

Receipt submission-id of view, or nil.

Receipt `submission-id` of `view`, or nil.
sourceraw docstring

find-threadclj

(find-thread node thread-id)

Thread thread-id of node node, or nil.

Thread `thread-id` of node `node`, or nil.
sourceraw docstring

global?clj

(global? view)

True when app view belongs to no session. Only an SDK program opens one.

True when app `view` belongs to no session. Only an SDK program opens one.
sourceraw docstring

idempotency-key?clj

(idempotency-key? k)

True when k is a valid idempotency key of a Send.

True when `k` is a valid idempotency key of a Send.
sourceraw docstring

log-entry-errorclj

(log-entry-error view {:keys [level message detail]})

nil when entry can go into the log of view, otherwise the reason. Only an app takes a log entry, and an entry needs a known level and a message.

nil when `entry` can go into the log of `view`, otherwise the reason. Only an
app takes a log entry, and an entry needs a known level and a message.
sourceraw docstring

log-levelsclj

How serious an app log entry can be.

How serious an app log entry can be.
sourceraw docstring

log-sourcesclj

Who can write an app log entry.

Who can write an app log entry.
sourceraw docstring

media-typeclj

Media type of the attachment row that lists an app.

Media type of the attachment row that lists an app.
sourceraw docstring

owner-threadclj

(owner-thread node thread)

Thread thread of an owner's thread op on node node as it lands: a message that the host stored keeps the stored copy, found by id, and the saved draft of the human stays. An owner never writes a draft.

Thread `thread` of an owner's thread op on node `node` as it lands: a message that
the host stored keeps the stored copy, found by id, and the saved draft of the human
stays. An owner never writes a draft.
sourceraw docstring

persistent?clj

(persistent? view)

True when global app view comes back after a gateway restart. A session app always comes back.

True when global app `view` comes back after a gateway restart. A session app
always comes back.
sourceraw docstring

placementclj

Internal placement of an app attachment.

Internal placement of an app attachment.
sourceraw docstring

post-draftsclj

(post-drafts nodes {:keys [author at submission-id new-id]})

Post every saved draft of the thread nodes in nodes as a message. post holds :author, :at, :submission-id and :new-id, a function that gives one fresh message id per call. Answers {:ops [...] :comments [...]}.

Post every saved draft of the thread nodes in `nodes` as a message. `post`
holds `:author`, `:at`, `:submission-id` and `:new-id`, a function that gives
one fresh message id per call. Answers `{:ops [...] :comments [...]}`.
sourceraw docstring

remove-threadsclj

(remove-threads node thread-ids)

Diff node node without the threads in thread-ids. A missing id changes nothing.

Diff node `node` without the threads in `thread-ids`. A missing id changes nothing.
sourceraw docstring

reply-opclj

(reply-op node {:keys [thread-id anchor new-thread-id]} message)

The patch operation that adds message to a thread of node. Without :thread-id, a diff starts thread :new-thread-id at :anchor.

The patch operation that adds `message` to a thread of `node`. Without
`:thread-id`, a diff starts thread `:new-thread-id` at `:anchor`.
sourceraw docstring

revisionclj

(revision node)

The reviewed revision of node node: the new_revision of a diff, else nil.

The reviewed revision of node `node`: the `new_revision` of a diff, else nil.
sourceraw docstring

scopesclj

Who an app can belong to: its session, or no session at all.

Who an app can belong to: its session, or no session at all.
sourceraw docstring

session-surfacesclj

Where the session apps button can open an app, off included.

Where the session apps button can open an app, `off` included.
sourceraw docstring

set-agent-noteclj

(set-agent-note view text)

App view with text as its note for the model. The model reads the note with the next user message. A blank text removes the note.

App `view` with `text` as its note for the model. The model reads the note
with the next user message. A blank text removes the note.
sourceraw docstring

set-shortcutsclj

(set-shortcuts view shortcuts)

App view with shortcuts in place of its old list. An empty list removes every shortcut. The shared check of the patched view owns their rules.

App `view` with `shortcuts` in place of its old list. An empty list removes
every shortcut. The shared check of the patched view owns their rules.
sourceraw docstring

settings-keyclj

(settings-key view)

The id prefix of the settings of app view, or nil for an app without a key. It joins the owning extension (or sandbox) and the key. A long prefix keeps its start and ends in a hash, so two apps never share one.

The id prefix of the settings of app `view`, or nil for an app without a key.
It joins the owning extension (or `sandbox`) and the key. A long prefix keeps
its start and ends in a hash, so two apps never share one.
sourceraw docstring

settled-statusesclj

Stages after which a receipt no longer changes.

Stages after which a receipt no longer changes.
sourceraw docstring

shortcut-key-textclj

The valid shortcut keys, as one sentence part that a refusal can quote.

The valid shortcut keys, as one sentence part that a refusal can quote.
sourceraw docstring

shortcut-key?clj

(shortcut-key? k)

True when k is a key that an app shortcut can bind.

True when `k` is a key that an app shortcut can bind.
sourceraw docstring

shortcut-namesclj

Named keys that an app shortcut can bind, besides one printable character.

Named keys that an app shortcut can bind, besides one printable character.
sourceraw docstring

submission-for-keyclj

(submission-for-key view k)

The receipt that idempotency key k made in view, or nil.

The receipt that idempotency key `k` made in `view`, or nil.
sourceraw docstring

submission-statusesclj

Delivery stages of a Send, in order.

Delivery stages of a Send, in order.
sourceraw docstring

surface-defaultsclj

The surfaces of an app that declares none: {:inline true :session "sidebar"}.

The surfaces of an app that declares none: `{:inline true :session "sidebar"}`.
sourceraw docstring

thread-typesclj

Node types that hold threads.

Node types that hold threads.
sourceraw docstring

threadsclj

(threads node)

The threads of node node: every thread of a diff, or the thread node itself.

The threads of node `node`: every thread of a diff, or the thread node itself.
sourceraw docstring

upsert-submissionclj

(upsert-submission view submission)

View view with receipt submission in place. When the view holds too many receipts, the oldest settled receipt goes first, then the oldest receipt.

View `view` with receipt `submission` in place. When the view holds too many
receipts, the oldest settled receipt goes first, then the oldest receipt.
sourceraw docstring

upsert-threadclj

(upsert-thread node thread)

Diff or thread node node with thread in place. A diff replaces the thread with the same id or adds it. A thread node takes the messages, draft, anchor and resolution. The patch target table and the node check of the host own the rules.

Diff or thread node `node` with `thread` in place. A diff replaces the thread
with the same id or adds it. A thread node takes the messages, draft, anchor and
resolution. The patch target table and the node check of the host own the rules.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close