Packages@robojs/mock
SessionManager
Class: SessionManager
Manages session lifecycle and storage
Constructors
new SessionManager()
new SessionManager(options?): SessionManagerParameters
| Parameter | Type |
|---|---|
options? | SessionManagerOptions |
Returns
Accessors
size
Get Signature
get size(): numberGet the number of active sessions
Returns
number
Methods
create()
create(options?): Promise<Session>Create a new isolated session
Parameters
| Parameter | Type |
|---|---|
options? | CreateSessionOptions |
Returns
Promise<Session>
delete()
delete(sessionId): Promise<boolean>Delete a session
Parameters
| Parameter | Type |
|---|---|
sessionId | string |
Returns
Promise<boolean>
destroy()
destroy(): Promise<void>Destroy the session manager and clean up all resources
Returns
Promise<void>
findSessionByInteractionToken()
findSessionByInteractionToken(token): undefined | SessionFind a session containing an interaction with the given token Used by interaction callback endpoint to route responses to correct session
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
undefined | Session
get()
get(sessionId): undefined | SessionGet a session by ID
Parameters
| Parameter | Type |
|---|---|
sessionId | string |
Returns
undefined | Session
getAll()
getAll(): Session[]Get all active sessions
Returns
Session[]
getByToken()
getByToken(token): undefined | SessionGet a session by token (parses "mock:<session_id>" format)
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
undefined | Session
