Skip to content

Class: ContextManager ​

Context manager for the session: query context sync status and trigger sync (upload/download).

Table of contents ​

Methods ​

Methods ​

info ​

▸ info(contextId?, path?, taskType?): Promise<ContextInfoResult>

Get context sync status (optionally filtered by contextId, path, taskType).

Parameters ​

NameTypeDescription
contextId?stringOptional context ID filter
path?stringOptional path filter
taskType?stringOptional task type filter

Returns ​

Promise<ContextInfoResult>

Promise resolving to ContextInfoResult with items (contextId, path, status, etc.)


sync ​

▸ sync(contextId?, path?, mode?, maxRetries?, retryInterval?, callback?): Promise<ContextSyncResult>

Trigger context sync (upload or download). Omit contextId and path to sync all contexts.

Parameters ​

NameTypeDefault valueDescription
contextId?stringundefinedOptional; if provided, path must also be provided
path?stringundefinedOptional; sync only this context path
mode?stringundefinedOptional sync mode
maxRetriesnumber150Max poll retries (default 150)
retryIntervalnumber1500Poll interval ms (default 1500)
callback?(success: boolean) => voidundefinedOptional callback with success

Returns ​

Promise<ContextSyncResult>

Promise resolving to ContextSyncResult


toJSON ​

▸ toJSON(): Record<string, unknown>

Returns ​

Record<string, unknown>