nitori library
Umbrella package re-exporting all Nitori sub-packages.
Classes
- Anchor
- Represents an ` element.
- Argv
-
Command invocation carried by
interaction/commandevents. - At
-
Represents an
<at>element. - Audio
-
Represents an
<audio>element. - Author
-
Represents an
<author>element. - Base
- A base class for nodes that can have attributes and children in a tree structure.
-
BidiList<
T> -
The
BidiListpayload shape: a page that can be walked in both directions. - Bold
-
Represents a
<b>element. - BridgeEventDispatcher
- BridgeEventDispatcher implements the upstream dispatch semantics for the bridge.
- Button
- Channel
- ChannelInterface
- Code
-
Represents a
<code>element. - Command
-
A command the bot exposes to the platform, as advertised by
updateCommands. - CommandDeclaration
- A single argument or option of a Command.
- CommandInterface
- Interface for command management (slash commands).
- ElementNode
- A node of the Satori element DSL.
- Emoji
- Event
- File
-
Represents a
<file>element. - Friend
- Guild
- GuildInterface
- GuildMember
- GuildMemberInterface
- GuildRole
- GuildRoleInterface
- Idiomatic
-
Represents an
<i>element. - Image
-
Represents an
<img>element. - InMemoryAdapter
- Serves one InMemoryBot and exposes emit to push gateway events.
- InMemoryBot
- An in-memory bot backed by plain maps.
- InternalRequest
- Framework-neutral inbound request seen by InternalRouter.handle.
- InternalResponse
- Framework-neutral outbound response returned by an InternalRouteCallback.
-
InternalRoute<
B> - A registered route: pattern plus its precompiled pattern and callback.
-
InternalRouter<
B> -
Minimal rooted path-pattern router, mirroring upstream
InternalRouter. - JsonBlob
- A binary file part carried through JsonForm.
- JsonForm
-
Hybrid JSON +
multipart/form-datacodec, mirroring upstreamJsonForm. - JsonFormBody
- Serialized body produced by JsonForm.encode.
- JsonFormParts
- Map-backed JsonFormSink / JsonFormSource pair.
- JsonFormSink
- Sink receiving the file parts split out by JsonForm.dump.
- JsonFormSource
- Source consulted by JsonForm.load when re-attaching file parts.
- LineBreak
-
Represents a
<br>element. - Login
- LoginInterface
- Message
- MessageInterface
- Meta
-
Server metadata pushed with the
metaopcode: the login registry and the upload proxy endpoints. - Method
-
A single entry of the upstream
Methodstable. - Modifier
-
Base class for inline modifier elements such as
<b>and<u>. - NitoriBot
- A single login: carries the identity headers and exposes the full HTTP API.
- NitoriClient
- Connects to a Satori server and exposes its bots and event stream.
- Node
- A base class for nodes in Satori message elements.
-
Pagination<
T> -
The
List/BidiListpayload shape of the protocol. - Paragraph
-
Represents a
<p>element. - Parser
- A parser that parses tokens into a tree of nodes
- Quote
-
Represents a
<quote>element. - RateLimiter
- A rate limiter that uses token buckets per scope key.
- RateLimiterConfig
- Configuration for a rate limiter.
- RemoteSatoriAdapter
- A SatoriAdapter that bridges to a remote Satori server.
- RemoteSatoriBot
- A SatoriBot backed by a remote NitoriBot.
- SatoriAdapter
- Owns the bots of one platform integration and the event stream they emit.
- SatoriApiClient
- The HTTP API of a Satori server.
- SatoriApiIdentity
- The identity a request is made on behalf of.
- SatoriBot
- One login served through the HTTP API and the WebSocket gateway.
- SatoriGatewayClient
-
A single
/v1/eventsconnection lifecycle. - SatoriGatewayEvent
- One EVENT frame received from the gateway.
- SatoriServer
- Serves the Satori HTTP API and WebSocket gateway for adapter.
- SatoriWebhook
- A webhook configuration for event delivery.
- Session
- The context of a message dispatch: the Event under handling plus the host it arrived through.
- SessionHost
- Host context that backs a Session.
- Sharp
-
Represents a
<sharp>element. - Spoiler
-
Represents a
<spl>element. - Strikethrough
-
Represents an
<s>element. - Subscript
-
Represents a
<sub>element. - Superscript
-
Represents a
<sup>element. - Text
- A node that represents text in Satori message elements.
- Tokenizer
- A tokenizer that splits the input into tokens
- Underline
-
Represents a
<u>element. - User
- UserInterface
- Video
-
Represents a
<video>element.
Enums
- ChannelType
- Direction
-
Direction of a paginated request, carried by the
directionfield. - EventName
- The complete set of event names the protocol can emit, exactly as they appear on the wire.
- Opcode
- Opcodes of the Satori WebSocket payloads.
- Order
-
Sorting order of a paginated request, carried by the
orderfield. - RateLimitScope
- Scope of rate limiting.
- Status
Extensions
Constants
-
eventAliases
→ const List<
List< String> > - Event-name groups that adapters emit under two spellings.
-
methodKeys
→ const List<
String> -
Every
resource.methodkey that must be present in methods. -
methods
→ const Map<
String, Method> -
resourceAttrs
→ const Map<
String, List< String> > -
Attribute lists mirroring the upstream
Definitionstable, in wire (snake_case) spelling, including the deliberate omissions:membercarries no id because the id lives on its user, andChannel.parentId/Channel.positionare never resource attributes.
Functions
-
cashConvertCamelToSnake(
String key) → String -
Converts a
camelCaseDart field name to itssnake_casewire key. -
cashConvertSnakeToCamel(
String key) → String -
Converts a
snake_casewire key to thecamelCaseDart field name. -
createTag(
String tag, Map< String, Object> attributes, List<Node> children) → Node? -
Create a Node from a tag name, attributes, and children, using the same
Satori element mapping as the string parser so wire decoding stays
consistent with
parse. -
decodeElementNode(
Map< String, Object?> data) → ElementNode - Converts a wire-form element into a structural node.
-
decodeElementNodes(
List< Map< maps) → List<String, Object?> >ElementNode> - Converts wire-form elements into structural nodes.
-
decodeResource(
ElementNode element) → Object? - Decodes a resource element back into its data.
-
encodeElementNode(
ElementNode node) → Map< String, Object?> - Converts a structural element node into its wire form.
-
encodeElementNodes(
List< ElementNode> nodes) → List<Map< String, Object?> > - Converts structural element nodes into their wire form.
-
encodeResource(
String type, Object resource) → ElementNode - Encodes a resource into its element form.
-
encodeWireElements(
List< Node> nodes) → List<Map< String, Object?> > - Converts typed nodes back to the protocol wire element form.
-
escape(
String text) → String -
Escapes special characters in the given
textto their corresponding HTML entities. -
escapeAttribute(
String value) → String - Escapes a value for use inside a quoted attribute.
-
escapeText(
String value) → String - Escapes a text run.
-
expandEventAliases(
String type) → List< String> -
Every event name
typeshould be dispatched under. -
omitNull(
Map< String?, Object?> map) → Map<String, Object> ? -
Returns a new map with all null entries removed from the given
map. -
parse(
String input) → List< Node> - Parses the input into a tree of nodes
-
parseElements(
String content) → List< ElementNode> - Parses the element DSL of a raw content string.
-
parseWireElements(
List< Map< data) → List<String, Object?> >Node> -
Converts protocol wire elements (
{type, attrs, children}) to typed nodes. -
symbolName(
Symbol symbol) → String - Extracts the bare member name from a Symbol.
-
transformKey(
dynamic source, dynamic callback(String key)) → dynamic - Recursively rewrites the keys of a JSON object.
-
unescape(
String text) → String -
Reverts the escaping of special characters in the given
text.
Typedefs
- Gateway = SatoriGatewayClient
-
A single
/v1/eventsconnection lifecycle. - GatewayEvent = SatoriGatewayEvent
- One EVENT frame received from the gateway.
- GatewayException = SatoriGatewayException
- Thrown when the gateway gives up reconnecting after too many failed initial attempts.
-
InternalRouteCallback<
B> = Future< InternalResponse> Function(InternalRequest request, B bot) -
Callback invoked by a matching InternalRoute;
Bis the bot type the router hands back unchanged.
Exceptions / Errors
- SatoriApiException
- Thrown when the server answers with a non-200 status.
- SatoriGatewayException
- Thrown when the gateway gives up reconnecting after SatoriGatewayClient.retryTimes failed initial attempts.