(userId: string, url: string, projectId?: string)
| 806 | |
| 807 | // User-scoped sessions |
| 808 | createSessionForUser(userId: string, url: string, projectId?: string): Session { |
| 809 | const session: Session = { |
| 810 | id: generateId(), |
| 811 | url, |
| 812 | status: "active", |
| 813 | createdAt: new Date().toISOString(), |
| 814 | projectId, |
| 815 | }; |
| 816 | |
| 817 | tenantStmts.insertSessionForUser.run({ |
| 818 | id: session.id, |
| 819 | url: session.url, |
| 820 | status: session.status, |
| 821 | createdAt: session.createdAt, |
| 822 | projectId: session.projectId ?? null, |
| 823 | metadata: null, |
| 824 | userId, |
| 825 | }); |
| 826 | |
| 827 | const event = eventBus.emit("session.created", session.id, session); |
| 828 | persistEventForUser(event, userId); |
| 829 | |
| 830 | return session; |
| 831 | }, |
| 832 | |
| 833 | listSessionsForUser(userId: string): Session[] { |
| 834 | const rows = tenantStmts.listSessionsForUser.all(userId) as Record<string, unknown>[]; |
nothing calls this directly
no test coverage detected
searching dependent graphs…