FakeWorld class final

The in-memory model of the fake server.

Every write appends the events of 05 section 6 in one step with a new seq and calls the EventHooks, which push them to the gateways that may see them. Reads and writes check only visibility per channel and the level of the principal; there is no other permission logic (README).

Example:

final world = FakeWorld();
final alex = world.addPerson(handle: 'alex', displayName: 'Alex');
final space = world.addSpace('Team');
final channel = world.addChannel(space, 'general', {alex.id: 'write'});
final thread = world.addThread(channel, 'Release notes', createdBy: alex.id);
world.createMessage(alex.id, thread, {'client_msg_id': id, 'content_md': 'Hello'});
Available extensions

Constructors

FakeWorld({DateTime now()?})
Creates an empty world on now (UTC; default the system time).

Properties

agents → Map<String, FakeAgent>
The agent rows by principal ID. An agent person added with addPerson alone has none until agentOf creates it with the defaults (organization), so the worlds of earlier tickets keep working.
final
catchupMaxEvents ↔ int
A larger backlog yields resync_required too_far_behind (sync.catchup_max_events).
getter/setter pair
catchupPageSize ↔ int
Events per catch-up page (sync.catchup_page_size).
getter/setter pair
channels → Map<String, FakeChannel>
Channels by ID.
final
connectedDevices ↔ Set<String> Function(String userId)
The devices of a person that have an open, live gateway connection; the gateway sets it, without one no device has a route (13 4.6).
getter/setter pair
cursorAdvanceEvery ↔ int
One cursor frame after this many skipped events (sync.cursor_advance_every).
getter/setter pair
defaultPreviewMode ↔ String
notify.default_preview_mode, the preview mode of a person without the setting notify.preview_mode (13 6.4).
getter/setter pair
devices → Map<String, FakeDevice>
Devices by ID.
final
drafts → Map<String, JsonMap>
Drafts (API Draft) by <principal>|<thread>.
final
enrollmentCodes → Map<String, String>
The last enrollment code issued per person (only the newest is valid, 08 3.2).
final
eventHooks → List<EventHook>
Listeners of appended events (the gateway).
final
expiryReminderLead ↔ Duration
How long before its expiry a grant, a membership or an agent token shows in "Expiring soon" (authz.expiry_reminder_lead, 07 9.4 and 14); the default of the specification, a test may shorten it.
getter/setter pair
files → Map<String, FakeFile>
The files of 03 files by ID with their bytes, upload session and transcript (M4-22).
final
fileSettings → FakeFileSettings
The settings of the file handlers (part size, scan, transcription, faults).
final
fileTickets → Map<String, FakeFileTicket>
The file tickets of createFileTicket by token (12 9.2).
final
forumTags → Map<String, JsonMap>
Forum tags by ID (API ForumTag).
final
grants → Map<String, JsonMap>
The grants by ID as the API returns them (Grant, brief M4-27); a revoked grant keeps its revoked_at.
final
groupMembers → Map<String, Map<String, JsonMap>>
The members (GroupMember) of each group, by group and person ID.
final
groups → Map<String, JsonMap>
Groups (Group without member_count) by ID.
final
hashCode → int
The hash code for this object.
no setterinherited
headSeq ↔ int
The seq of the newest durable event.
getter/setter pair
hosts → Map<String, FakeHost>
The hosts of the terminal by ID (brief M4-37).
final
i1OnEnable → Set<String>
People whose enableUser answers 409 i1_violation (10 5.4), a switch of the tests.
final
idempotency → Map<String, StoredResponse>
Stored answers of Idempotency-Key writes by <principal>|<key>.
final
instanceId ↔ String
The instance ID.
latefinal
limits → JsonMap
The InstanceLimits that getInstance reports (D-W-115); tests lower them.
final
localProviderId ↔ String
The ID of the local login driver, which discovery lists like the server does (08 2).
latefinal
log → List<FakeEvent>
The durable event log in seq order; dropEventsUpTo removes old entries.
final
The bytes of the instance logo (getBrandingLogo), or null when none is set; discovery names its URL only when set.
getter/setter pair
messageHooks → List<MessageCreatedHook>
Listeners of created messages (the scripted agents), called after message.created.
final
messages → Map<String, JsonMap>
Messages (API Message) by ID.
final
minRetainedSeq ↔ int
The smallest seq still in the log after a retention cut, or headSeq + 1.
getter/setter pair
notifications → List<FakeNotification>
Every hint notify created, in order.
final
notificationSkips → List<({String reason, String userId})>
The recipients notify decided against: level (the effective level is too low) or no_route (no active device with a live connection, 13 4.6 item 4).
final
notifyOnMessages ↔ bool
Whether createMessage calls notify for every new message (not for a replay); off so tests without hints see no extra frames.
getter/setter pair
now → DateTime Function()
The time source.
final
pairings → Map<String, FakePairing>
Pairings by ID.
final
people → Map<String, FakePerson>
People and agents by ID.
final
permissionVersion ↔ int
The permission version of the instance; every access change raises it (04 8.2).
getter/setter pair
pins → Map<String, JsonMap>
Who pinned a message and when (API Pin), by message ID.
final
previewMaxChars ↔ int
notify.preview_max_chars, the length of excerpt in characters (13 6.4).
getter/setter pair
productName ↔ String
The product name the instance reports (branding.product_name).
getter/setter pair
quietHours → Set<String>
The people inside quiet hours right now; their hints carry quiet: true. The fake does not evaluate the rules of quietHoursRules (13 3.4), this is a switch of the tests.
final
quietHoursRules → Map<String, Map<String, JsonMap>>
The quiet hours rules (API QuietHoursRule) per person by rule ID (13 3.4). The fake stores and lists them and sends quiet_hours.updated; it does not evaluate them, the tests list the people inside quiet hours in quietHours.
final
readStates → Map<String, JsonMap>
Read states (API ReadState) by <principal>|<thread>.
final
resolveMentions ↔ bool
Whether createMessage resolves @handle tokens of the content into mention_ids when the body carries none, as the server does (03 content format item 4); off by default, so tests of earlier tickets keep their messages.
getter/setter pair
revisions → Map<String, List<JsonMap>>
The earlier revisions (API MessageRevision) of each edited message, oldest first.
final
runPatchHooks → List<RunPatchHook>
Listeners of run document patches (the gateway).
final
runs → Map<String, JsonMap>
Runs (API Run, the run document of 04 11.1) by ID.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchSettings → FakeSearchSettings
The limits of the search handlers (search.*, 14 15); tests lower them.
final
sessions → Map<String, FakeSession>
Sessions by ID.
final
settings → Map<String, Map<String, JsonMap>>
Settings (API UserSetting) by principal and key.
final
sidebarStates → Map<String, JsonMap>
Sidebar states (API SidebarState) by <principal>|<space>.
final
spaces → Map<String, JsonMap>
Spaces (API Space) by ID.
final
stats → Map<String, JsonMap>
The answers of the statistics operations (M6-06) by operation ID (getUsageStats, getRunStats, getToolCallStats, getErrorStats, getCostStats): the buckets and, for costs, the currency; an operation without an entry answers no buckets. The fake does not compute statistics; tests set the numbers a scope answers.
final
statsLiveEnabled ↔ bool
stats.live_enabled (25 5.1 item 6): off, getStatsLive and stats.subscribe answer feature_disabled.
getter/setter pair
statsTimelineMaxRange ↔ Duration
stats.timeline_max_range (25 15): the longest range getStatsTimeline accepts.
getter/setter pair
statsTimeZone ↔ String
stats.time_zone of the server, which getInstance reports to everyone (M6-06).
getter/setter pair
stepUpChallenges → Map<String, ({String challenge, String sessionId})>
Open step-up challenges (08 6.2) by ID: the random value and the session that asked.
final
syncEpoch ↔ String
The current sync epoch (04 7.5).
getter/setter pair
telemetryDashboardUrl ↔ String?
telemetry.dashboard_url of the server: getInstance names it to owners only, null for no link (M6-06).
getter/setter pair
templateOwners → Map<String, String>
The owner of each personal template, by template ID.
final
templates → Map<String, JsonMap>
Templates (API Template) by ID; a personal template also names its owner in templateOwners.
final
terminal → FakeTerminal
The terminal sessions, the host link and the open device streams (brief M4-36).
final
threads → Map<String, JsonMap>
Threads (API Thread) by ID.
final
triggerChecks → List<String? Function(JsonMap message, FakePerson author)>
Checks before a message is stored: the first non-null answer is its trigger_state (received for a message that triggers an agent, 04 16.5).
final
userDefaultLevel ↔ String
notify.user_default_level, the last step of the effective level (13 3.1, 17).
getter/setter pair

Methods

abortUpload(String principalId, String fileId) → void

Available on FakeWorld, provided by the FilesWorld extension

abortUpload: ends an open own session; the file becomes failed (12 2).
activeRunOf(String threadId) → JsonMap?
The active run of threadId, or null.
addAgent({required String handle, required String displayName, String billingMode = 'organization', String? credentialHolderId, String? reportedBillingMode, List<String>? billingModesSupported = const ['organization', 'personal'], String adapterKind = 'hermes', String state = 'online', String keyType = 'api_key'}) → FakeAgent
Adds an agent person (through addPerson, kind agent) and its FakeAgent with the given configured and reported values, as if its first heartbeat had just arrived; returns the FakeAgent.
addChannel(String spaceId, String name, Map<String, String> access) → String
Adds a text channel to spaceId that the principals of access see with their level, and its main thread; returns the channel ID.
addForum(String spaceId, String name, Map<String, String> access, {String defaultSort = 'last_activity'}) → String
Adds a forum to spaceId that the principals of access see with their level, sorted by defaultSort (forum_default_sort); returns the channel ID.
addForumTag(String channelId, String name, {String? color, bool restricted = false}) → String
Adds the tag name to forum channelId with the category color; returns its ID.
addIdentity(String userId, {required String subject}) → String
Links an OIDC identity with subject to userId and returns its ID.
addMainThread(String channelId, {required String createdBy}) → String

Available on FakeWorld, provided by the ThreadViewWorld extension

Adds the main thread (kind = main) of the text channel channelId, names it in the channel's main_thread_id and returns its ID.
addPasskey(String userId, {required String name}) → String
Adds a passkey named name to userId and returns its ID.
addPerson({required String handle, required String displayName, String kind = 'user', String? loginName, String? password, String? totpCode, bool isOwner = false, bool newDevicesPending = false, String? id}) → FakePerson
Adds a person or agent and returns it.
addReadyFile({required String uploaderId, required String channelId, required String name, required String mimeType, required List<int> bytes, String scanStatus = 'clean', String uploadState = 'complete'}) → String

Available on FakeWorld, provided by the FilesWorld extension

A file of uploaderId in channelId that is uploaded and checked already, for tests that start with attachments: scanStatus and uploadState set its state (12 2); returns its ID. Attach it with createMessage and attachment_file_ids.
addSpace(String name) → String
Adds a space and returns its ID.
addTemplate({required String scope, required String name, required String contentMd, String? ownerId, String? channelId}) → JsonMap

Available on FakeWorld, provided by the ThreadViewWorld extension

Adds a template of scope (personal of ownerId, or channel of channelId) and returns it.
addTerminalHost({String? id, required String name, required String noisePublicKey, Map<String, String> sessionUsers = const {}, Map<String, List<String>> workdirs = const {}, List<JsonMap>? profiles, String? assignedUserId, List<String> grantees = const [], String llmCredentials = 'organization', String fingerprint = '7KQ2-9XTA-M4PB-1C8D-0000-0000-0000-0000-0000-0000-0000-0000-0000'}) → FakeHost

Available on FakeWorld, provided by the FakeWorldTerminalHosts extension

Adds an active, connected host named name with the static key noisePublicKey, the session users sessionUsers (person to name; every name is reported), the working directories workdirs of the profile claude per name, profiles (default shell and, with any working directory, claude), the assignee assignedUserId, and a valid grant terminal for each of grantees; returns the host. id is the host ID (a new one when null), so a test can give the in-process host the same ID for the Noise prologue.
addThread(String channelId, String title, {required String createdBy}) → String
Adds a thread to channelId and returns its ID.
agentHeartbeat(String agentId, {String? reportedBillingMode, List<String>? billingModesSupported, String? keyType, String? state, bool clearReported = false}) → void
The fake's heartbeat of agentId (09 4.8): changes the reported values that are given and stamps last_heartbeat_at.
agentJson(FakeAgent a) → JsonMap
The API Agent of a: its person's handle, name and status, the configured policy (credential_holder_id only with personal) and the presence (AgentRuntimeStatus) with the reported values, billing_evidence, billing_mode_matches (only with a reported mode) and the agentWarnings.
agentOf(String agentId) → FakeAgent?
The FakeAgent of agentId: the stored one, or a new one with the defaults for an agent person without a row; null for an unknown ID or a principal that is not an agent.
agentTriggerers(String agentId) → List<String>
The I1 trigger set of agentId (10 5.2 and 5.3, simplified): the active people who may trigger it, in the order of people.
agentWarnings(FakeAgent a) → List<String>
The codes of AgentRuntimeStatus.warnings for a as the server computes them at each heartbeat (10 8, 09 4.8), only while the runtime is online or degraded.
append(String type, {required JsonMap resource, required JsonMap payload, JsonMap scope = const {}, String? actor, String? audience, String? clientMsgId}) → FakeEvent
Appends a durable event of type about resource in scope with payload, raising seq, and calls the eventHooks; returns it.
approveDevice(String deviceId) → void
Approves the waiting device deviceId (08 5.2).
changeEpoch() → void
Starts a new time line as the final step of a restore does (04 7.5): a new epoch, so a client with the old one gets resync_required with epoch_changed.
channelTemplates(String principalId, String channelId) → List<JsonMap>

Available on FakeWorld, provided by the ThreadViewWorld extension

listTemplates: the templates of channelId when principalId sees it.
channelView(String principalId, String channelId) → JsonMap
The API ChannelView of channelId for principalId.
channelViews(String principalId, {String? spaceId}) → List<JsonMap>
The visible channels of principalId, optionally of one space, as ChannelViews.
closeThread(String threadId, {String? actor}) → void
Marks threadId done (thread.close) and appends thread.closed.
completeUpload(String principalId, String fileId, JsonMap body) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

completeUpload (12 3.4): checks the listed parts, joins them, checks size and SHA-256 and scans (or holds the scan, FakeFileSettings.holdScan); returns the File. A completed session answers the file again.
content(String principalId, String fileId, String variant) → (Uint8List, String)

Available on FakeWorld, provided by the FilesWorld extension

The bytes and type of variant (original or a thumbnail) of fileId for principalId (12 9.3).
createMessage(String authorId, String threadId, JsonMap body, {String origin = 'human'}) → ({JsonMap message, bool replay})
Creates a message of authorId in threadId from a MessageCreate body (04 5.1): returns the message and whether it was a replay of the same client_msg_id.
createQuietHoursRule(String userId, JsonMap body) → JsonMap
Adds a rule of userId from a QuietHoursRuleInput body and appends the complete list in quiet_hours.updated (createQuietHoursRule, 13 3.4). Throws 400 validation_failed for weekdays outside 1 to 127 or a time that is not HH:MM.
createRun({required String agentId, required String triggeringMessageId, required String triggeredBy}) → JsonMap
Creates a queued run of agentId for triggeringMessageId and appends run.state_changed; returns the run document.
createThread(String principalId, String channelId, JsonMap body) → JsonMap
Creates a forum post of principalId in channelId from a ThreadCreate body: the thread, thread.created, then its first message through createMessage; returns the API ThreadCreated.
createThreadFromMessage(String principalId, String channelId, JsonMap body) → JsonMap

Available on FakeWorld, provided by the ThreadViewWorld extension

createThread with parent_message_id: a thread from a message of the main thread of a text channel, titled from the message (title_source = auto), with an optional first message. Returns the API ThreadCreated.
createTicket(String principalId, String sessionId, String fileId, String variant) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

createFileTicket (12 9.2): a ticket of variant bound to sessionId, valid for five minutes; returns the API FileTicket with a path below the origin.
createUploadSession(String principalId, String channelId, JsonMap body) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

createUpload (12 3.1): a session for an UploadCreate body of principalId in channelId, with the parts of FakeFileSettings.partBytes.
deleteDraft(String principalId, String threadId) → void
Deletes the draft of principalId in threadId; nothing happens without one.
deleteMessage(String principalId, String messageId) → void
Deletes messageId as a tombstone (03 6.5); a second delete changes nothing (idempotent 204). Throws 404 or 403 forbidden for another author's message.
deleteNotificationPref(String userId, String targetKind, String targetId) → void
Removes the preference of userId for targetKind targetId; nothing happens when there is none. No event, as for setNotificationPref.
deleteOwnFile(String principalId, String fileId) → void

Available on FakeWorld, provided by the FilesWorld extension

deleteFile: deletes an own file that is not attached; 409 conflict for an attached one.
deleteQuietHoursRule(String userId, String ruleId) → void
Deletes rule ruleId of userId and appends the remaining list (deleteQuietHoursRule). Throws 404 for an unknown rule.
deleteSetting(String principalId, String key) → void
Deletes the setting key of principalId; 404 when it does not exist.
disablePerson(String userId) → void
Disables the person userId as 08 11 does: status disabled, every session revoked (user_disabled), every device revoked (user_disabled).
dropEventsUpTo(int seq) → void
Removes the events up to seq from the log, as sync.event_retention does, so a cursor below them gets resync_required with retention (04 7.3).
effectiveLevel(String userId, String threadId) → String
The effective level (all, mentions or mute) of userId for threadId (13 3.1): the first existing value of the own preference for the thread, the channel and the space, the channel's default_notification_level, all in a DM channel, the setting notify.default_level and userDefaultLevel. A selected preference with muted_until after now gives mute.
endTerminalSession(FakeTerminalSession s, String reason) → void

Available on FakeWorld, provided by the FakeWorldTerminal extension

Ends s with reason: state closed, the event, and the open stream closed with 4100 and the reason (24 8.3, 10.3).
eventsAfter(int after, {int? upTo}) → Iterable<FakeEvent>
The events with after < seq <= upTo still in the log.
expirePairing(String pairingId) → void
Lets the pairing pairingId expire (auth.pairing_code_ttl, 08 5.3).
expirePendingDevice(String deviceId) → void
Lets the pending device deviceId expire (auth.device_pending_ttl, 08 5.2).
finishScan(String fileId, {String? result}) → void

Available on FakeWorld, provided by the FilesWorld extension

Ends the scan of fileId with result (default FakeFileSettings.scanResult): the file becomes complete; a servable image gets thumbnails and a voice file its duration; appends file.updated (12 3.4).
grantCapability(String principalId, String channelId, String capability) → void

Available on FakeWorld, provided by the ThreadViewWorld extension

Gives principalId the capability capability (API Capability) in channelId.
grantHostAccess(String userId, String hostId) → void

Available on FakeWorld, provided by the FakeWorldTerminal extension

userId got the capability terminal on host hostId: the personal access.changed with the host in added (04 8.2).
hostUpdated(FakeHost h, {bool keyChanged = false}) → void

Available on FakeWorld, provided by the FakeWorldTerminal extension

Raises the version of h and appends host.updated (04 2.1); keyChanged after a re-pairing (24 3.3).
hostViewers(FakeHost h) → Set<String>

Available on FakeWorld, provided by the FakeWorldTerminal extension

The people who see h (07 2.12): owners, the assignee and the holders of a valid grant terminal on it.
i1Conflicts() → Map<String, List<String>>
The I1 conflicts of the world (10 5.4): for every active agent on personal whose trigger set (agentTriggerers) is not exactly its credential holder, the other principals of the set, by agent ID in the order of agents.
levelOf(String principalId, String channelId) → String?
The level of principalId in channelId, or null when it does not see it.
manages(String principalId, String channelId) → bool
Whether principalId holds the capability manage in channelId.
markUnread(String principalId, String threadId, int lastRead, int expectedVersion, {String? deviceId}) → JsonMap

Available on FakeWorld, provided by the ThreadViewWorld extension

markThreadUnread: moves the read position of principalId in threadId back to lastRead when expectedVersion is the version of its read state (04 14), and appends read_state.updated. Throws 412 version_conflict with the current state.
mayReceive(String principalId, FakeEvent event) → bool
Whether principalId may receive event (04 7.2, 05 6): a personal event only its audience, a channel event those who see the channel, a space event those who see a channel of the space, an instance event everyone.
membershipId(String groupId, String userId) → String
The ID of the membership of userId in groupId (group_memberships.id, 03), which "Expiring soon" names but the API GroupMember does not carry, so groupMembers stays as the group handlers return it.
messagesOf(String threadId) → List<JsonMap>
The messages of threadId in thread_seq order.
moveThread(String principalId, String threadId, String targetChannelId) → JsonMap

Available on FakeWorld, provided by the ThreadViewWorld extension

moveThread: moves threadId into targetChannelId (05 thread.move: manage on source and target; the same effective operator, else 422 operator_mismatch); the ID stays and thread.moved names the source channel.
nextId() → String
A new UUIDv7-shaped ID; deterministic per world, so faults and assertions repeat.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notificationPrefsOf(String userId) → List<JsonMap>
The preferences of userId on targets it can still read, ordered by target kind, then target ID (listMyNotificationPreferences).
notify(String messageId) → List<FakeNotification>
Decides the hints of the message messageId (13 2) and delivers them (13 4.6, 6.3); returns the hints created by this call, which notifications also records.
operatorOf(String threadId) → String?

Available on FakeWorld, provided by the ThreadViewWorld extension

The effective operator of the thread threadId: its own operator, else its channel's.
pairHost(String hostId, List<String> names, {String fingerprint = '7KQ2-9XTA-M4PB-1C8D-0000-0000-0000-0000-0000-0000-0000-0000-0000'}) → void
Simulates bothy-host pair on hostId (24 3.2 item 2): the host stores keys with fingerprint and the reported names, becomes confirming and connected, and its key generation rises.
patchRun(String runId, List<JsonMap> ops) → int
Applies the RFC 6902 ops (add, replace, remove) to the document of runId, raises its version and returns the previous version (04 11.2).
personalTemplates(String principalId) → List<JsonMap>

Available on FakeWorld, provided by the ThreadViewWorld extension

listMyTemplates: the personal templates of principalId.
pin(String principalId, String messageId, {required bool pinned}) → void

Available on FakeWorld, provided by the ThreadViewWorld extension

pinMessage and unpinMessage: pins or unpins messageId (05 pin.create, pin.delete: manage); a repeat changes nothing. Throws 404, 403 forbidden without manage, 410 message_deleted for a deleted message.
pinsOf(String principalId, String threadId) → List<JsonMap>

Available on FakeWorld, provided by the ThreadViewWorld extension

listPins: the pins of threadId.
publishEphemeral(String type, {required JsonMap resource, required JsonMap payload, JsonMap scope = const {}, String? audience, Set<String>? devices}) → FakeEvent
Publishes an ephemeral event (no seq, never in the log) to the eventHooks.
putDraft(String principalId, String threadId, JsonMap body, {String? deviceId}) → JsonMap
Stores the draft of principalId in threadId from a DraftPut body; returns the DraftPutResult (overwrote_newer when base_version was older, 04 14).
putNotificationPref(String userId, String targetKind, String targetId, JsonMap body) → JsonMap
Sets the level of userId on targetKind targetId from a NotificationPreferencePut body and appends notification_pref.updated (putNotificationPreference, 13 3.1).
putPart(String principalId, String fileId, int number, String? contentDigest, Uint8List bytes) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

uploadPart (12 3.2): stores part number of fileId after the length and digest checks; the same part with the same digest answers again without new work.
putPresignedPart(String fileId, int number, Uint8List bytes) → String

Available on FakeWorld, provided by the FilesWorld extension

A part of a presigned session, PUT to the object store URL of the session (12 3.3); returns the ETag. Throws like putPart.
putQuietHoursRule(String userId, String ruleId, JsonMap body) → JsonMap
Replaces rule ruleId of userId with body; equal values keep the version and append nothing (putQuietHoursRule). Throws 404 for an unknown rule, 400 as for createQuietHoursRule.
putReadState(String principalId, String threadId, int lastRead, {String? deviceId}) → JsonMap
Sets the read state of principalId in threadId and appends read_state.updated.
putSetting(String principalId, String key, Object? value, {String? deviceId}) → JsonMap
Stores the setting key of principalId and appends settings.updated.
putSidebar(String principalId, String spaceId, JsonMap body, {String? deviceId}) → JsonMap
Stores the sidebar state of principalId for spaceId from a SidebarStatePut body and appends the personal sidebar.updated (04 14: last write wins per space).
quietHoursOf(String userId) → List<JsonMap>
The quiet hours rules of userId, ascending by ID (listMyQuietHours).
react(String principalId, String messageId, String emoji, {required bool add}) → void
Adds or removes the reaction emoji of principalId on messageId; a repeat changes nothing. Throws 404, 410 message_deleted when adding to a deleted message.
rejectPendingDevice(String deviceId) → void
Rejects the pending device deviceId as a wrong verification code does.
removeNotificationPref(String userId, String targetKind, String targetId) → void
Deletes the level of userId on targetKind targetId: notification_pref.updated with deleted: true and the last version plus one; nothing when there is no row (deleteNotificationPreference). Throws 404 for a target the person cannot read.
requestTranscription(String principalId, String fileId) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

requestTranscription (12 8.2): in mode service the transcript becomes pending; otherwise 409 conflict with reason transcription_unavailable.
revisionsOf(String principalId, String messageId) → List<JsonMap>

Available on FakeWorld, provided by the ThreadViewWorld extension

listMessageRevisions: the earlier revisions of messageId, oldest first.
revokeDevice(String deviceId, {String reason = 'revoked_by_owner'}) → void
Revokes deviceId with reason (revoked_by_owner, verification_failed, pending_expired, pairing_expired) and every session on it.
revokeHostAccess(String userId, String hostId) → void

Available on FakeWorld, provided by the FakeWorldTerminal extension

userId lost the capability terminal on host hostId (04 8.2, 24 8.3): the personal access.changed with the host in removed, and every open session of the person there ends with access_revoked.
revokeSession(String sessionId, {String reason = 'admin'}) → void
Revokes sessionId with reason and appends the personal session.revoked (05 6).
runSummary(JsonMap run) → JsonMap
The API RunSummary of run.
seesChannel(String principalId, String channelId) → bool
Whether principalId sees channelId.
seesSpace(String principalId, String spaceId) → bool
Whether principalId sees at least one channel of spaceId.
seesThread(String principalId, String threadId) → bool
Whether principalId sees threadId.
setAccess(String principalId, String channelId, String? level) → void
Gives principalId level in channelId, or removes its access with a null level, and appends the personal access.changed of 04 8.2 with the new permission version.
setChannelOperator(String channelId, String? agentId) → void
Makes agentId the fixed operator of channelId (mode: agent), or lets the channel inherit the default of its space again for null.
setHostConnected(String hostId, {required bool connected}) → void

Available on FakeWorld, provided by the FakeWorldTerminal extension

Sets the connection of host hostId and publishes the ephemeral host.presence_changed to the devices of everyone who sees the host.
setNotificationPref(String userId, String targetKind, String targetId, String level, {DateTime? mutedUntil}) → void
Stores the preference of userId for the target targetKind (thread, channel or space) targetId at level (all, mentions or mute), muted until mutedUntil when given (13 3.1). A later call replaces it.
setOperator(String channelId, String? agentId) → void

Available on FakeWorld, provided by the ThreadViewWorld extension

Sets the effective operator of channelId to agentId (null: no operator).
setRunState(String runId, String state, {String? triggerState, String? reason}) → void
Moves runId to state (running, completed, failed, cancelled) and appends run.state_changed with the summary (04 11.3 item 1).
setSpaceOperator(String spaceId, String? agentId) → void
Makes agentId the default operator of spaceId (default_operator_agent_id), or removes it for null, and refreshes the operator.effective_agent_id of the space's channels that inherit (03 channels, 10 5.2 point 1).
setThreadState(String principalId, String threadId, {required bool closed}) → JsonMap

Available on FakeWorld, provided by the ThreadViewWorld extension

closeThread and reopenThread of principalId (05: write); a thread already in the state changes nothing. Returns the thread.
setTitle(String principalId, String threadId, int expectedVersion, String title) → JsonMap

Available on FakeWorld, provided by the ThreadViewWorld extension

setThreadTitle: sets title with title_source = manual when expectedVersion is the thread's version, and appends thread.updated. Throws 412 version_conflict.
setTranscript(String fileId, String text, {String language = 'en', String source = 'agent'}) → void

Available on FakeWorld, provided by the FilesWorld extension

Sets the transcript of fileId to text (transcript_status = done) and appends file.updated (12 8.2).
setTriggerState(String messageId, String state, {String? actor}) → void
Sets trigger_state of messageId and appends message.updated (04 16.5).
sidebarOf(String principalId) → List<JsonMap>
The sidebar states of principalId for the spaces it sees (API SidebarState).
snapshot(String principalId) → JsonMap
The API Snapshot of principalId (04 6.3 item 4, 04 7.3).
spaceView(String principalId, String spaceId) → JsonMap
The API SpaceView of spaceId for principalId: the highest level of its channels.
spaceViews(String principalId) → List<JsonMap>
The visible spaces of principalId, as SpaceViews.
stamp([DateTime? at]) → String
The current time as an RFC 3339 timestamp with milliseconds and Z.
tagsOf(String channelId) → List<JsonMap>
The tags of forum channelId in their order.
terminalGrantOf(String userId, String hostId) → String?

Available on FakeWorld, provided by the FakeWorldTerminalHosts extension

The ID of the valid grant terminal of userId on hostId, or null.
terminalSessionChanged(FakeTerminalSession s) → void

Available on FakeWorld, provided by the FakeWorldTerminal extension

Appends the personal terminal_session.changed of s (04 2.1, 24 10.2).
toString() → String
A string representation of this object.
inherited
transcriptOf(String principalId, String fileId) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

getTranscript (12 8.2): the API Transcript; text only with status done.
unreadThreads(String principalId) → List<JsonMap>
The API UnreadThreads of principalId: every visible thread with unread messages, with the counts after its read state (04 14).
updateMessage(String principalId, String messageId, int expectedVersion, JsonMap body) → JsonMap
Applies a MessageUpdate body to messageId of principalId when expectedVersion matches (04 13.3, 06 If-Match).
updateMessageFields(String messageId, JsonMap fields, {String? actor}) → JsonMap
Merges fields into messageId, raises its version and appends message.updated (the anchor's run_id and the components of a card, M4-21).
uploadState(String principalId, String fileId) → JsonMap

Available on FakeWorld, provided by the FilesWorld extension

getUpload (12 3.2 item 5): the confirmed parts of an own session.
visibleFile(String principalId, String fileId) → FakeFile

Available on FakeWorld, provided by the FilesWorld extension

The file fileId when principalId may read it: the uploader, or anyone who sees the thread of the message it is attached to (12 3.7); else 404 not_found.
visibleMessage(String principalId, String messageId) → JsonMap
The message messageId when principalId sees its thread; else 404 not_found.
visibleThread(String principalId, String threadId) → JsonMap
The thread threadId when principalId sees it; else 404 not_found.

Operators

operator ==(Object other) → bool
The equality operator.
inherited