Skip to main content

Module slack

Module slack 

Source
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§

SlackBookmark
One channel bookmark as bookmarks.list reports it.
SlackConfig
One [[slack]] entry. The token is a credential, so it lives in forge.toml rather than in the state DB beside the subscriptions.
SlackConversation
A conversation as users.conversations reports it. Fields Slack omits per conversation type default rather than failing the whole decode.
SlackConversationText
Slack sends purpose and topic as objects carrying their text in value, and omits both on a DM.
SlackDraft
A composed but unsent Slack message. The workspace holds it until the user approves it in the dock prompt; nothing reaches Slack otherwise.
SlackFile
A file as files.info reports it. url_private is a bearer fetch, not a URL, and name is whatever the uploader chose to call it - untrusted input as far as this code is concerned.
SlackFileShare
One message a file was shared as, in one conversation.
SlackFileShares
A file’s shares, keyed by visibility and then by conversation id.
SlackFollowedThread
One followed thread as the pump sees it, minus the cursor it reads through its own port method.
SlackMessage
One message as the pump sees it, after matching. Carries what delivery needs and nothing the wire happened to include.
SlackPerson
One person a held draft tags. name is the resolved display name; None when the lookup failed, and the card draws the id rather than a guess.
SlackPin
One pinned message as pins.list reports it. Pins are messages, and Slack omits the message object on any other row, which carries nothing readable.
SlackPinMessage
The message body of a pinned row.
SlackSearchMatch
One hit from search.messages. conversation_name is absent on a DM, which has no name rather than an empty one. user is the author’s id, which the delivered block carries - username is only a handle. A file-share with no text is a real hit, so the files ride along for delivery and slack__attachment.
SlackSubscription
One watched target, owned by one session.
SlackThreadName
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.
SlackThreadOwner
One session’s ownership of a followed thread, named after the SlackSubscription fields it is taken from.
SlackThreadRecord
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.
SlackUser
One user as users.info and users.list report them. Every optional field is optional because Slack omits fields per user type rather than sending nulls.
SlackUserProfile
The part of a user’s profile a name lookup needs. display_name is what people call themselves, which is often neither the handle nor the legal name.

Enums§

SlackDraftAnswer
The reader’s answer to a held draft, which is what the blocked call receives.
SlackDraftEnding
What ended a held draft, which a view that did not answer it has no other way to learn.
SlackDraftOperation
What a held draft would do in Slack.
SlackSubscriptionTarget
What one subscription watches inside a workspace.
SlackWatchMode
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: null on a file it has not shared; that is not an object, and it reads as no shares rather than failing the whole file.