Class: InMemoryManagementStore
@roomful/relay / InMemoryManagementStore
Class: InMemoryManagementStore
Section titled “Class: InMemoryManagementStore”Defined in: packages/relay/src/management/store.ts:81
A fully synchronous in-memory store suitable for single-process relays and development. All operations are O(1) lookups on Maps.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryManagementStore(
defaults):InMemoryManagementStore
Defined in: packages/relay/src/management/store.ts:86
Parameters
Section titled “Parameters”defaults
Section titled “defaults”Returns
Section titled “Returns”InMemoryManagementStore
Methods
Section titled “Methods”createProject()
Section titled “createProject()”createProject(
input):Project
Defined in: packages/relay/src/management/store.ts:102
Creates a project and returns the stored record.
Parameters
Section titled “Parameters”description?
Section titled “description?”string = ...
string = ...
Optional id; auto-generated when omitted. Must be unique.
metadata?
Section titled “metadata?”Record<string, unknown> = ...
string = ...
ownerId
Section titled “ownerId”string = ...
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”createRoom()
Section titled “createRoom()”createRoom(
projectId,input):RoomRecord
Defined in: packages/relay/src/management/store.ts:165
Creates a room record. Throws when the project does not exist.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
ephemeral?
Section titled “ephemeral?”boolean = ...
string = ...
Optional id; auto-generated when omitted.
metadata?
Section titled “metadata?”Record<string, unknown> = ...
string = ...
ttlMs?
Section titled “ttlMs?”number = ...
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”deleteProject()
Section titled “deleteProject()”deleteProject(
projectId):boolean
Defined in: packages/relay/src/management/store.ts:143
Deletes a project and all associated rooms + quota. Returns true if it existed.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”deleteQuota()
Section titled “deleteQuota()”deleteQuota(
projectId):boolean
Defined in: packages/relay/src/management/store.ts:220
Removes the explicit quota for a project so it falls back to relay defaults.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”deleteRoom()
Section titled “deleteRoom()”deleteRoom(
roomId):boolean
Defined in: packages/relay/src/management/store.ts:193
Deletes a room. Returns true if it existed.
Parameters
Section titled “Parameters”roomId
Section titled “roomId”string
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”getDefaults()
Section titled “getDefaults()”getDefaults():
RelayDefaults
Defined in: packages/relay/src/management/store.ts:243
Returns the relay defaults the store was created with. Used by the management API to resolve effective quotas.
Returns
Section titled “Returns”getProject()
Section titled “getProject()”getProject(
projectId):Project|null
Defined in: packages/relay/src/management/store.ts:98
Returns a single project, or null when not found.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”Project | null
Implementation of
Section titled “Implementation of”getQuota()
Section titled “getQuota()”getQuota(
projectId):ProjectQuota|null
Defined in: packages/relay/src/management/store.ts:199
Returns the quota for a project, or null when the project has no explicit quota.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”ProjectQuota | null
Implementation of
Section titled “Implementation of”getRoom()
Section titled “getRoom()”getRoom(
roomId):RoomRecord|null
Defined in: packages/relay/src/management/store.ts:161
Returns a single room, or null when not found.
Parameters
Section titled “Parameters”roomId
Section titled “roomId”string
Returns
Section titled “Returns”RoomRecord | null
Implementation of
Section titled “Implementation of”getUsage()
Section titled “getUsage()”getUsage(
projectId):ProjectUsage
Defined in: packages/relay/src/management/store.ts:226
Returns a point-in-time usage snapshot for a project.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”listProjects()
Section titled “listProjects()”listProjects(
ownerId):Project[]
Defined in: packages/relay/src/management/store.ts:90
Lists all projects visible to ownerId. Pass '*' to bypass filtering.
Parameters
Section titled “Parameters”ownerId
Section titled “ownerId”string
Returns
Section titled “Returns”Project[]
Implementation of
Section titled “Implementation of”listRooms()
Section titled “listRooms()”listRooms(
projectId):RoomRecord[]
Defined in: packages/relay/src/management/store.ts:157
Lists all rooms belonging to a project.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”setQuota()
Section titled “setQuota()”setQuota(
projectId,input):ProjectQuota
Defined in: packages/relay/src/management/store.ts:203
Creates or replaces the quota for a project.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
maxEphemeralTtlMs?
Section titled “maxEphemeralTtlMs?”number = ...
maxPeersPerRoom?
Section titled “maxPeersPerRoom?”number = ...
maxRooms?
Section titled “maxRooms?”number = ...
maxTotalPeers?
Section titled “maxTotalPeers?”number = ...
maxTotalStateBytes?
Section titled “maxTotalStateBytes?”number = ...
messageRateIntervalMs?
Section titled “messageRateIntervalMs?”number = ...
messageRateLimit?
Section titled “messageRateLimit?”number = ...
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”updateProject()
Section titled “updateProject()”updateProject(
projectId,input):Project|null
Defined in: packages/relay/src/management/store.ts:125
Updates a project in-place. Returns the updated record or null when not found.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
description?
Section titled “description?”string = ...
metadata?
Section titled “metadata?”Record<string, unknown> = ...
string = ...
Returns
Section titled “Returns”Project | null