(
sessionId: string,
data: Omit<Annotation, "id" | "sessionId" | "status" | "createdAt">
)
| 127 | }, |
| 128 | |
| 129 | addAnnotation( |
| 130 | sessionId: string, |
| 131 | data: Omit<Annotation, "id" | "sessionId" | "status" | "createdAt"> |
| 132 | ): Annotation | undefined { |
| 133 | const session = sessions.get(sessionId); |
| 134 | if (!session) return undefined; |
| 135 | |
| 136 | const annotation: Annotation = { |
| 137 | ...data, |
| 138 | id: generateId(), |
| 139 | sessionId, |
| 140 | status: "pending", |
| 141 | createdAt: new Date().toISOString(), |
| 142 | }; |
| 143 | |
| 144 | annotations.set(annotation.id, annotation); |
| 145 | |
| 146 | const event = eventBus.emit("annotation.created", sessionId, annotation); |
| 147 | events.push(event); |
| 148 | |
| 149 | return annotation; |
| 150 | }, |
| 151 | |
| 152 | getAnnotation(id: string): Annotation | undefined { |
| 153 | return annotations.get(id); |
no test coverage detected
searching dependent graphs…