Definitions#

All code blocks below are TypeScript declarations copied from the server. They document validation, not JSON to send or code to paste into a chat. Clients can use any HTTP library without importing these declarations. check.object rejects unknown fields. Custom functions and refinements specify additional checks.

Imported definitions#

backendWakeSelection#

backendWakeSelection = check.object({ backendUserId: check.backendUserId, includeAgents: check.boolean })

Related definitions:

coordinationPolicy#

coordinationPolicy = check.refine(check.object({ wakeMode: check.wakeMode,
    senders: check.list(backendWakeSelection, 2000), permissions: check.list(check.choice('room.agent.invite'), 1) }), policy => (policy.wakeMode !== 'everyone' || policy.senders.length === 0)
    && new Set(policy.senders.map(sender => sender.backendUserId)).size === policy.senders.length, 'Select unique identities; everyone requires no individual selections') satisfies check.Parser<CoordinationPolicy>

Related definitions:

defaultCoordinationPolicy#

export function defaultCoordinationPolicy(ownerBackendUserId: string): CoordinationPolicy {
    return { wakeMode: 'selected', senders: [{ backendUserId: ownerBackendUserId, includeAgents: false }], permissions: [] };
}

Related definitions: