Expand description
Slack connector shapes that cross a crate boundary: the [[slack]]
config entry an operator writes, the conversation shape
users.conversations reports, and the subscription record a session
creates.
Re-exports§
use std::collections::HashMap;🔒use std::time::SystemTime;🔒use serde::Deserialize;🔒use serde::Deserialize;🔒use serde::Serialize;🔒use serde::Serialize;🔒use uuid::Uuid;🔒
Structs§
- Slack
Bookmark - One channel bookmark as
bookmarks.listreports it. - Slack
Config - One
[[slack]]entry. The token is a credential, so it lives inforge.tomlrather than in the state DB beside the subscriptions. - Slack
Conversation - A conversation as
users.conversationsreports it. Fields Slack omits per conversation type default rather than failing the whole decode. - Slack
Conversation Text - Slack sends
purposeandtopicas objects carrying their text invalue, and omits both on a DM. - Slack
Draft - A composed but unsent Slack message. The workspace holds it until the user approves it in the dock prompt; nothing reaches Slack otherwise.
- Slack
File - A file as
files.inforeports it.url_privateis a bearer fetch, not a URL, andnameis whatever the uploader chose to call it - untrusted input as far as this code is concerned. - Slack
File Share - One message a file was shared as, in one conversation.
- Slack
File Shares - A file’s shares, keyed by visibility and then by conversation id.
- Slack
Followed Thread - One followed thread as the pump sees it, minus the cursor it reads through its own port method.
- Slack
Message - One message as the pump sees it, after matching. Carries what delivery needs and nothing the wire happened to include.
- Slack
Person - One person a held draft tags.
nameis the resolved display name;Nonewhen the lookup failed, and the card draws the id rather than a guess. - Slack
Pin - One pinned message as
pins.listreports it. Pins are messages, and Slack omits the message object on any other row, which carries nothing readable. - Slack
PinMessage - The message body of a pinned row.
- Slack
Search Match - One hit from
search.messages.conversation_nameis absent on a DM, which has no name rather than an empty one.useris the author’s id, which the delivered block carries -usernameis only a handle. A file-share with no text is a real hit, so the files ride along for delivery andslack__attachment. - Slack
Subscription - One watched target, owned by one session.
- Slack
Thread Name - The thread a held draft replies into, named for the card: the parent’s author and one flattened line of its text, so the reader is not asked to read a ts.
- Slack
Thread Owner - One session’s ownership of a followed thread, named after the
SlackSubscriptionfields it is taken from. - Slack
Thread Record - What the store keeps about one followed thread: how far its replies have been read, the newest edit already handed over, and the sessions whose subscriptions put the thread on their radar.
- Slack
User - One user as
users.infoandusers.listreport them. Every optional field is optional because Slack omits fields per user type rather than sending nulls. - Slack
User Profile - The part of a user’s profile a name lookup needs.
display_nameis what people call themselves, which is often neither the handle nor the legal name.
Enums§
- Slack
Draft Answer - The reader’s answer to a held draft, which is what the blocked call receives.
- Slack
Draft Ending - What ended a held draft, which a view that did not answer it has no other way to learn.
- Slack
Draft Operation - What a held draft would do in Slack.
- Slack
Subscription Target - What one subscription watches inside a workspace.
- Slack
Watch Mode - What a conversation subscription lets through.
Constants§
- DEFAULT_
DM_ POLL_ SECONDS - DM-class sweep interval a workspace gets when it names none.
- DEFAULT_
POLL_ SECONDS - Sweep interval a workspace gets when it names none. Slack’s API
allowance is per workspace, and the DM class costs one history call per
DM conversation it covers, so a workspace with a large inbox wants its
own
poll_seconds. - DEFAULT_
STALE_ AFTER_ HOURS - Age a delivered block may reach before its header says so.
- DEFAULT_
THREAD_ IDLE_ DAYS - Idle window a workspace gets when it names none.
- MIN_
DM_ POLL_ SECONDS - The slowest a workspace may set the DM clock to. Below this the class outruns the allowance it shares with the conversation pass, which is the overrun the key exists to prevent.
Functions§
- default_
dm_ 🔒poll_ seconds - default_
poll_ 🔒seconds - default_
stale_ 🔒after_ hours - default_
thread_ 🔒idle_ days - shares_
or_ 🔒null - Slack sends
shares: nullon a file it has not shared; that is not an object, and it reads as no shares rather than failing the whole file.