| 71 | * } |
| 72 | */ |
| 73 | export interface SessionStoreContract { |
| 74 | /** |
| 75 | * Reads session data for a given session ID from the persistence store |
| 76 | * |
| 77 | * @param sessionId - Unique identifier for the session |
| 78 | */ |
| 79 | read(sessionId: string): Promise<SessionData | null> | SessionData | null |
| 80 | |
| 81 | /** |
| 82 | * Writes session data for a given session ID to the persistence store |
| 83 | * |
| 84 | * @param sessionId - Unique identifier for the session |
| 85 | * @param data - Session data to store |
| 86 | */ |
| 87 | write(sessionId: string, data: SessionData): Promise<void> | void |
| 88 | |
| 89 | /** |
| 90 | * Removes session data for a given session ID from the persistence store |
| 91 | * |
| 92 | * @param sessionId - Unique identifier for the session to remove |
| 93 | */ |
| 94 | destroy(sessionId: string): Promise<void> | void |
| 95 | |
| 96 | /** |
| 97 | * Updates the lifetime/expiry of a session without modifying the session data |
| 98 | * |
| 99 | * @param sessionId - Unique identifier for the session to touch |
| 100 | */ |
| 101 | touch(sessionId: string): Promise<void> | void |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Extended session store contract that supports tagging sessions with user IDs. |
no outgoing calls
no test coverage detected