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
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_requiredtoo_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
cursorframe 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 settingnotify.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
filesby 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
createFileTicketby 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 itsrevoked_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 (
Groupwithoutmember_count) by ID.final - hashCode → int
-
The hash code for this object.
no setterinherited
- headSeq ↔ int
-
The
seqof 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
enableUseranswers409 i1_violation(10 5.4), a switch of the tests.final -
idempotency
→ Map<
String, StoredResponse> -
Stored answers of
Idempotency-Keywrites by<principal>|<key>.final - instanceId ↔ String
-
The instance ID.
latefinal
- limits → JsonMap
-
The
InstanceLimitsthatgetInstancereports (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
seqorder; dropEventsUpTo removes old entries.final - logo ↔ Uint8List?
-
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
seqstill in the log after a retention cut, orheadSeq + 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) orno_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 ofexcerptin 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 sendsquiet_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
@handletokens of the content intomention_idswhen 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 -
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): thebucketsand, for costs, thecurrency; 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,getStatsLiveandstats.subscribeanswerfeature_disabled.getter/setter pair - statsTimelineMaxRange ↔ Duration
-
stats.timeline_max_range(25 15): the longest rangegetStatsTimelineaccepts.getter/setter pair - statsTimeZone ↔ String
-
stats.time_zoneof the server, whichgetInstancereports 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_urlof the server:getInstancenames 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(receivedfor 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 becomesfailed(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
spaceIdthat the principals ofaccesssee 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
spaceIdthat the principals ofaccesssee with their level, sorted bydefaultSort(forum_default_sort); returns the channel ID. -
addForumTag(
String channelId, String name, {String? color, bool restricted = false}) → String -
Adds the tag
nameto forumchannelIdwith the categorycolor; returns its ID. -
addIdentity(
String userId, {required String subject}) → String -
Links an OIDC identity with
subjecttouserIdand 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 channelchannelId, names it in the channel'smain_thread_idand returns its ID. -
addPasskey(
String userId, {required String name}) → String -
Adds a passkey named
nametouserIdand 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 ofuploaderIdinchannelIdthat is uploaded and checked already, for tests that start with attachments:scanStatusanduploadStateset its state (12 2); returns its ID. Attach it withcreateMessageandattachment_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 ofscope(personalofownerId, orchannelofchannelId) and returns it. -
addTerminalHost(
{String? id, required String name, required String noisePublicKey, Map< String, String> sessionUsers = const {}, Map<String, List< workdirs = const {}, List<String> >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 namednamewith the static keynoisePublicKey, the session userssessionUsers(person to name; every name is reported), the working directoriesworkdirsof the profileclaudeper name,profiles(defaultshelland, with any working directory,claude), the assigneeassignedUserId, and a valid grantterminalfor each ofgrantees; returns the host.idis 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
channelIdand 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 stampslast_heartbeat_at. -
agentJson(
FakeAgent a) → JsonMap -
The API
Agentofa: its person's handle, name and status, the configured policy (credential_holder_idonly withpersonal) 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.warningsforaas the server computes them at each heartbeat (10 8, 09 4.8), only while the runtime isonlineordegraded. -
append(
String type, {required JsonMap resource, required JsonMap payload, JsonMap scope = const {}, String? actor, String? audience, String? clientMsgId}) → FakeEvent -
Appends a durable event of
typeaboutresourceinscopewithpayload, raisingseq, 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_requiredwithepoch_changed. -
channelTemplates(
String principalId, String channelId) → List< JsonMap> -
Available on FakeWorld, provided by the ThreadViewWorld extension
listTemplates: the templates ofchannelIdwhenprincipalIdsees it. -
channelView(
String principalId, String channelId) → JsonMap -
The API
ChannelViewofchannelIdforprincipalId. -
channelViews(
String principalId, {String? spaceId}) → List< JsonMap> -
The visible channels of
principalId, optionally of one space, asChannelViews. -
closeThread(
String threadId, {String? actor}) → void -
Marks
threadIddone (thread.close) and appendsthread.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 theFile. 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 ofvariant(originalor a thumbnail) offileIdforprincipalId(12 9.3). -
createMessage(
String authorId, String threadId, JsonMap body, {String origin = 'human'}) → ({JsonMap message, bool replay}) -
Creates a message of
authorIdinthreadIdfrom aMessageCreatebody(04 5.1): returns the message and whether it was a replay of the sameclient_msg_id. -
createQuietHoursRule(
String userId, JsonMap body) → JsonMap -
Adds a rule of
userIdfrom aQuietHoursRuleInputbodyand appends the complete list inquiet_hours.updated(createQuietHoursRule, 13 3.4). Throws400 validation_failedfor weekdays outside 1 to 127 or a time that is notHH:MM. -
createRun(
{required String agentId, required String triggeringMessageId, required String triggeredBy}) → JsonMap -
Creates a queued run of
agentIdfortriggeringMessageIdand appendsrun.state_changed; returns the run document. -
createThread(
String principalId, String channelId, JsonMap body) → JsonMap -
Creates a forum post of
principalIdinchannelIdfrom aThreadCreatebody: the thread,thread.created, then its first message through createMessage; returns the APIThreadCreated. -
createThreadFromMessage(
String principalId, String channelId, JsonMap body) → JsonMap -
Available on FakeWorld, provided by the ThreadViewWorld extension
createThreadwithparent_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 APIThreadCreated. -
createTicket(
String principalId, String sessionId, String fileId, String variant) → JsonMap -
Available on FakeWorld, provided by the FilesWorld extension
createFileTicket(12 9.2): a ticket ofvariantbound tosessionId, valid for five minutes; returns the APIFileTicketwith 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 anUploadCreatebodyofprincipalIdinchannelId, with the parts of FakeFileSettings.partBytes. -
deleteDraft(
String principalId, String threadId) → void -
Deletes the draft of
principalIdinthreadId; nothing happens without one. -
deleteMessage(
String principalId, String messageId) → void -
Deletes
messageIdas a tombstone (03 6.5); a second delete changes nothing (idempotent204). Throws404or403 forbiddenfor another author's message. -
deleteNotificationPref(
String userId, String targetKind, String targetId) → void -
Removes the preference of
userIdfortargetKindtargetId; 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 conflictfor an attached one. -
deleteQuietHoursRule(
String userId, String ruleId) → void -
Deletes rule
ruleIdofuserIdand appends the remaining list (deleteQuietHoursRule). Throws404for an unknown rule. -
deleteSetting(
String principalId, String key) → void -
Deletes the setting
keyofprincipalId;404when it does not exist. -
disablePerson(
String userId) → void -
Disables the person
userIdas 08 11 does: statusdisabled, every session revoked (user_disabled), every device revoked (user_disabled). -
dropEventsUpTo(
int seq) → void -
Removes the events up to
seqfrom the log, assync.event_retentiondoes, so a cursor below them getsresync_requiredwithretention(04 7.3). -
effectiveLevel(
String userId, String threadId) → String -
The effective level (
all,mentionsormute) ofuserIdforthreadId(13 3.1): the first existing value of the own preference for the thread, the channel and the space, the channel'sdefault_notification_level,allin a DM channel, the settingnotify.default_leveland userDefaultLevel. A selected preference withmuted_untilafter now givesmute. -
endTerminalSession(
FakeTerminalSession s, String reason) → void -
Available on FakeWorld, provided by the FakeWorldTerminal extension
Endsswithreason: stateclosed, the event, and the open stream closed with4100and the reason (24 8.3, 10.3). -
eventsAfter(
int after, {int? upTo}) → Iterable< FakeEvent> -
The events with
after < seq <= upTostill in the log. -
expirePairing(
String pairingId) → void -
Lets the pairing
pairingIdexpire (auth.pairing_code_ttl, 08 5.3). -
expirePendingDevice(
String deviceId) → void -
Lets the pending device
deviceIdexpire (auth.device_pending_ttl, 08 5.2). -
finishScan(
String fileId, {String? result}) → void -
Available on FakeWorld, provided by the FilesWorld extension
Ends the scan offileIdwithresult(default FakeFileSettings.scanResult): the file becomescomplete; a servable image gets thumbnails and a voice file its duration; appendsfile.updated(12 3.4). -
grantCapability(
String principalId, String channelId, String capability) → void -
Available on FakeWorld, provided by the ThreadViewWorld extension
GivesprincipalIdthe capabilitycapability(APICapability) inchannelId. -
grantHostAccess(
String userId, String hostId) → void -
Available on FakeWorld, provided by the FakeWorldTerminal extension
userIdgot the capabilityterminalon hosthostId: the personalaccess.changedwith the host inadded(04 8.2). -
hostUpdated(
FakeHost h, {bool keyChanged = false}) → void -
Available on FakeWorld, provided by the FakeWorldTerminal extension
Raises the version ofhand appendshost.updated(04 2.1);keyChangedafter a re-pairing (24 3.3). -
hostViewers(
FakeHost h) → Set< String> -
Available on FakeWorld, provided by the FakeWorldTerminal extension
The people who seeh(07 2.12): owners, the assignee and the holders of a valid grantterminalon it. -
i1Conflicts(
) → Map< String, List< String> > -
The I1 conflicts of the world (10 5.4): for every active agent on
personalwhose 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
principalIdinchannelId, or null when it does not see it. -
manages(
String principalId, String channelId) → bool -
Whether
principalIdholds the capabilitymanageinchannelId. -
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 ofprincipalIdinthreadIdback tolastReadwhenexpectedVersionis the version of its read state (04 14), and appendsread_state.updated. Throws412 version_conflictwith the current state. -
mayReceive(
String principalId, FakeEvent event) → bool -
Whether
principalIdmay receiveevent(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
userIdingroupId(group_memberships.id, 03), which "Expiring soon" names but the APIGroupMemberdoes not carry, so groupMembers stays as the group handlers return it. -
messagesOf(
String threadId) → List< JsonMap> -
The messages of
threadIdinthread_seqorder. -
moveThread(
String principalId, String threadId, String targetChannelId) → JsonMap -
Available on FakeWorld, provided by the ThreadViewWorld extension
moveThread: movesthreadIdintotargetChannelId(05thread.move:manageon source and target; the same effective operator, else422 operator_mismatch); the ID stays andthread.movednames 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
userIdon 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 threadthreadId: 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 paironhostId(24 3.2 item 2): the host stores keys withfingerprintand the reportednames, becomesconfirmingand connected, and its key generation rises. -
patchRun(
String runId, List< JsonMap> ops) → int -
Applies the RFC 6902
ops(add,replace,remove) to the document ofrunId, 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 ofprincipalId. -
pin(
String principalId, String messageId, {required bool pinned}) → void -
Available on FakeWorld, provided by the ThreadViewWorld extension
pinMessageandunpinMessage: pins or unpinsmessageId(05pin.create,pin.delete:manage); a repeat changes nothing. Throws404,403 forbiddenwithoutmanage,410 message_deletedfor a deleted message. -
pinsOf(
String principalId, String threadId) → List< JsonMap> -
Available on FakeWorld, provided by the ThreadViewWorld extension
listPins: the pins ofthreadId. -
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
principalIdinthreadIdfrom aDraftPutbody; returns theDraftPutResult(overwrote_newerwhenbase_versionwas older, 04 14). -
putNotificationPref(
String userId, String targetKind, String targetId, JsonMap body) → JsonMap -
Sets the level of
userIdontargetKindtargetIdfrom aNotificationPreferencePutbodyand appendsnotification_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 partnumberoffileIdafter 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 apresignedsession, 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
ruleIdofuserIdwithbody; equal values keep the version and append nothing (putQuietHoursRule). Throws404for an unknown rule,400as for createQuietHoursRule. -
putReadState(
String principalId, String threadId, int lastRead, {String? deviceId}) → JsonMap -
Sets the read state of
principalIdinthreadIdand appendsread_state.updated. -
putSetting(
String principalId, String key, Object? value, {String? deviceId}) → JsonMap -
Stores the setting
keyofprincipalIdand appendssettings.updated. -
putSidebar(
String principalId, String spaceId, JsonMap body, {String? deviceId}) → JsonMap -
Stores the sidebar state of
principalIdforspaceIdfrom aSidebarStatePutbodyand appends the personalsidebar.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
emojiofprincipalIdonmessageId; a repeat changes nothing. Throws404,410 message_deletedwhen adding to a deleted message. -
rejectPendingDevice(
String deviceId) → void -
Rejects the pending device
deviceIdas a wrong verification code does. -
removeNotificationPref(
String userId, String targetKind, String targetId) → void -
Deletes the level of
userIdontargetKindtargetId:notification_pref.updatedwithdeleted: trueand the last version plus one; nothing when there is no row (deleteNotificationPreference). Throws404for 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 modeservicethe transcript becomespending; otherwise409 conflictwithreasontranscription_unavailable. -
revisionsOf(
String principalId, String messageId) → List< JsonMap> -
Available on FakeWorld, provided by the ThreadViewWorld extension
listMessageRevisions: the earlier revisions ofmessageId, oldest first. -
revokeDevice(
String deviceId, {String reason = 'revoked_by_owner'}) → void -
Revokes
deviceIdwithreason(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
userIdlost the capabilityterminalon hosthostId(04 8.2, 24 8.3): the personalaccess.changedwith the host inremoved, and every open session of the person there ends withaccess_revoked. -
revokeSession(
String sessionId, {String reason = 'admin'}) → void -
Revokes
sessionIdwithreasonand appends the personalsession.revoked(05 6). -
runSummary(
JsonMap run) → JsonMap -
The API
RunSummaryofrun. -
seesChannel(
String principalId, String channelId) → bool -
Whether
principalIdseeschannelId. -
seesSpace(
String principalId, String spaceId) → bool -
Whether
principalIdsees at least one channel ofspaceId. -
seesThread(
String principalId, String threadId) → bool -
Whether
principalIdseesthreadId. -
setAccess(
String principalId, String channelId, String? level) → void -
Gives
principalIdlevelinchannelId, or removes its access with a nulllevel, and appends the personalaccess.changedof 04 8.2 with the new permission version. -
setChannelOperator(
String channelId, String? agentId) → void -
Makes
agentIdthe fixed operator ofchannelId(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 hosthostIdand publishes the ephemeralhost.presence_changedto the devices of everyone who sees the host. -
setNotificationPref(
String userId, String targetKind, String targetId, String level, {DateTime? mutedUntil}) → void -
Stores the preference of
userIdfor the targettargetKind(thread,channelorspace)targetIdatlevel(all,mentionsormute), muted untilmutedUntilwhen 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 ofchannelIdtoagentId(null: no operator). -
setRunState(
String runId, String state, {String? triggerState, String? reason}) → void -
Moves
runIdtostate(running,completed,failed,cancelled) and appendsrun.state_changedwith the summary (04 11.3 item 1). -
setSpaceOperator(
String spaceId, String? agentId) → void -
Makes
agentIdthe default operator ofspaceId(default_operator_agent_id), or removes it for null, and refreshes theoperator.effective_agent_idof the space's channels that inherit (03channels, 10 5.2 point 1). -
setThreadState(
String principalId, String threadId, {required bool closed}) → JsonMap -
Available on FakeWorld, provided by the ThreadViewWorld extension
closeThreadandreopenThreadofprincipalId(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: setstitlewithtitle_source = manualwhenexpectedVersionis the thread's version, and appendsthread.updated. Throws412 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 offileIdtotext(transcript_status = done) and appendsfile.updated(12 8.2). -
setTriggerState(
String messageId, String state, {String? actor}) → void -
Sets
trigger_stateofmessageIdand appendsmessage.updated(04 16.5). -
The sidebar states of
principalIdfor the spaces it sees (APISidebarState). -
snapshot(
String principalId) → JsonMap -
The API
SnapshotofprincipalId(04 6.3 item 4, 04 7.3). -
spaceView(
String principalId, String spaceId) → JsonMap -
The API
SpaceViewofspaceIdforprincipalId: the highest level of its channels. -
spaceViews(
String principalId) → List< JsonMap> -
The visible spaces of
principalId, asSpaceViews. -
stamp(
[DateTime? at]) → String -
The current time as an RFC 3339 timestamp with milliseconds and
Z. -
The tags of forum
channelIdin their order. -
terminalGrantOf(
String userId, String hostId) → String? -
Available on FakeWorld, provided by the FakeWorldTerminalHosts extension
The ID of the valid grantterminalofuserIdonhostId, or null. -
terminalSessionChanged(
FakeTerminalSession s) → void -
Available on FakeWorld, provided by the FakeWorldTerminal extension
Appends the personalterminal_session.changedofs(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 APITranscript;textonly withstatusdone. -
unreadThreads(
String principalId) → List< JsonMap> -
The API
UnreadThreads ofprincipalId: 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
MessageUpdatebodytomessageIdofprincipalIdwhenexpectedVersionmatches (04 13.3, 06If-Match). -
updateMessageFields(
String messageId, JsonMap fields, {String? actor}) → JsonMap -
Merges
fieldsintomessageId, raises its version and appendsmessage.updated(the anchor'srun_idand 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 filefileIdwhenprincipalIdmay read it: the uploader, or anyone who sees the thread of the message it is attached to (12 3.7); else404 not_found. -
visibleMessage(
String principalId, String messageId) → JsonMap -
The message
messageIdwhenprincipalIdsees its thread; else404 not_found. -
visibleThread(
String principalId, String threadId) → JsonMap -
The thread
threadIdwhenprincipalIdsees it; else404 not_found.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited