Skip to main content

is_conversation_reply_vocabulary 0.1.0 copy "is_conversation_reply_vocabulary: ^0.1.0" to clipboard
is_conversation_reply_vocabulary: ^0.1.0 copied to clipboard

A message posted back into the external chat conversation an event came from: where it goes (a web address, or a Slack channel and thread), what it says and the id it was posted under, with their JSON.

is_conversation_reply_vocabulary #

A reply into a conversation: a message posted back into the external chat conversation an event came from, such as a Slack thread or a Teams chat. Not an HTTP response, and not a model's output until it is sent there.

These are where such a reply goes, what it says and the message it posted, as values that name exactly one conversation, with their JSON. It holds types and does nothing, and depends on nothing but dart:core, is_web_address_vocabulary and checked_json.

It was published as is_reply_vocabulary up to 0.2.1, which is discontinued. The two names declare different types, so a package moves its dependency and every import to this name in one change.

  • ReplyEndpoint: where replies to an event go, sealed, one case for each way an external system takes replies.
    • RepliesUnderWebAddress: an AddressPrefix that names the conversation, as Teams' Bot Connector takes replies.
    • RepliesInSlackConversation: Slack's Origin, a SlackChannelId and the thread's SlackMessageTimestamp, null only for a direct message.
    • admitsAddress(to, path) says whether a request goes to an address the endpoint's replies are sent to: under the prefix for a web address, exactly /api/chat.postMessage on its origin for Slack. It checks the address, never the conversation. redirectsStayUnder bounds where a redirect of an admitted request may go.
  • ReplyContent: a reply's ReplyText and an optional footer, such as a turn's usage. Its JSON is {"text": …, "footer": …?}.
  • PostedMessage: the message a reply posted, sealed, with one case for each ReplyEndpoint case. Each case is made only by answering, which takes the endpoint it answers and its conversation from it, or by decodePostedMessage.
    • PostedUnderWebAddress: the conversation's AddressPrefix and the ServerAssignedMessageId its server gave the message.
    • PostedInSlackConversation: the SlackChannelId and the posted message's SlackMessageTimestamp, which a later reply can thread under.
  • ReplyText: what a reply says, never only whitespace or Unicode format characters (such as U+200B), kept exactly as given. It has no length limit; a driver splits a long text. Its JSON is a plain string.
  • SlackChannelId (C…, D… or G…), SlackMessageTimestamp (1700000000.000100) and ServerAssignedMessageId (non-empty, no whitespace) are made only by parse, which returns null for anything else.

Each sealed type has an encodeX / decodeX pair. A decode throws a FormatException naming the field for an unknown case or a field that is missing, extra or malformed. Both name their cases the same way:

{"case":"in-slack-conversation","origin":"https://slack.com","channel":"C0123ABC","thread":"1700000000.000100"}
{"case":"in-slack-conversation","channel":"C0123ABC","timestamp":"1700000000.000200"}

is_docking_station_api re-exports ReplyEndpoint and its JSON from 0.6.0, so its ReplyEndpoint and this one are the same type. A package that uses both must require is_docking_station_api: ^0.6.0; 0.5.0 declares its own.

0
likes
140
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A message posted back into the external chat conversation an event came from: where it goes (a web address, or a Slack channel and thread), what it says and the id it was posted under, with their JSON.

License

Apache-2.0 (license)

Dependencies

checked_json, is_web_address_vocabulary

More

Packages that depend on is_conversation_reply_vocabulary