(hostIdentifier?: string)
| 244 | } |
| 245 | |
| 246 | async getActiveSessions(hostIdentifier?: string): Promise<SiSession[]> { |
| 247 | let sql = "SELECT * FROM si_sessions WHERE status = 'active'"; |
| 248 | const params: string[] = []; |
| 249 | |
| 250 | if (hostIdentifier) { |
| 251 | sql += " AND host_identifier = $1"; |
| 252 | params.push(hostIdentifier); |
| 253 | } |
| 254 | |
| 255 | sql += " ORDER BY last_activity_at DESC"; |
| 256 | |
| 257 | const result = await query(sql, params); |
| 258 | return result.rows.map((row) => this.deserializeSession(row)); |
| 259 | } |
| 260 | |
| 261 | async getSessionsByUser( |
| 262 | userIdentifier: string, |
nothing calls this directly
no test coverage detected