Collections configuration
Every document carries labels such as relationship:client or channel:mail, derived from its parties and the workspace's relationship directory. A collection with a match holds every document that carries all of its labels, and an only limit narrows who may read the documents it holds. These tools read and change that setup as one document, and explain or correct where a single document sits.
The usual loop: `talonic_collections_get_config` (or `talonic_collections_propose` for a first draft), edit the document, then `talonic_collections_apply_config`. Apply previews by default: it reports every problem at once, what would be created, changed and removed, and for each limit how many documents it hides from how many people. Show that to the user and apply with dry_run: false only once they agree.
talonic_collections_get_config
The workspace's collections as one configuration document: each keyed collection with its name, the labels it sorts by (match, or any for several label sets) and its children, plus relationship kinds, own domains and whether relationships may be inferred. Limits (only), configured directory entries and default views appear for a workspace owner only.
talonic_collections_apply_config
Apply a configuration document. Collections are matched by their path of keys, so applying the same document twice changes nothing; a top-level key left out leaves that part of the workspace as it is. Nothing is saved unless dry_run is false.
| Parameter | Type | Description |
|---|---|---|
| document | object | The configuration document (`version: 1`, `collections`, …). Pass this or `yaml`. |
| yaml | string | The same document as YAML or JSON text. |
| dry_run | boolean | Check and preview only; false saves the change. Default: `true` |
| prune | boolean | Remove keyed collections the document does not name (refused for one that still has a limit or documents placed by hand). |
talonic_collections_propose
A configuration document built from the workspace's own documents, as far as the person may read them: one top-level collection per channel, children for common labels, and suggested relationship kinds. Saves nothing and never proposes a limit.
talonic_collections_explain_document
Why one document sits where it does: each label, whether it was derived or set by a person, the evidence the person may see behind it, and each collection it is in with why (rule, hand or held by a limit while its labels settle).
| Parameter | Type | Description |
|---|---|---|
| document_id * | UUID | The document. |
talonic_collections_set_labels
Add and remove labels on one document by hand. A person's labels are kept whenever the document's labels are derived again. Refused when the change would move the document into or out of a limited collection the person may not manage.
| Parameter | Type | Description |
|---|---|---|
| document_id * | UUID | The document. |
| add | string[] | Labels to add (at most 50). |
| remove | string[] | Labels to remove (at most 50). |
talonic_collections_move_document
Take one document out of a collection, put it into one, or both. A collection that sorts by labels keeps the document out once it is moved out.
| Parameter | Type | Description |
|---|---|---|
| document_id * | UUID | The document. |
| from | UUID | The collection to leave. |
| to | UUID | The collection to join. |
talonic_collections_set_parties
Hand over one document's parties as your system has them, the way a connected mailbox does at import. The document's labels are derived again at once; only a complete list whose every party is the workspace's own makes a document internal.
| Parameter | Type | Description |
|---|---|---|
| document_id * | UUID | The document. |
| parties * | object[] | `{ id, role? }`: `id` is `email:…`, `domain:…`, `phone:…`, `handle:…` or `entity:…`; `role` is from, to, cc, attendee or author. At most 500. |
| complete | boolean | true: the list names every party. |
talonic_collections_list_directory
Who is who: each identifier with what that party is to the workspace and where that came from (person, config, record or read), shown only where the person may see its evidence.
talonic_collections_save_directory
Set directory entries as a person's correction and remove entries by id. The documents of every identifier touched are labelled again.
| Parameter | Type | Description |
|---|---|---|
| entries | object[] | `{ match_value, relationship }`: a typed identifier and a relationship kind's slug, or `own` / `other`. At most 200. |
| remove | UUID[] | Entry ids to remove (from talonic_collections_list_directory). |
| wait | boolean | Wait up to 60 seconds for the documents to be labelled again. |