feat(l1): frontend api/types for next-node, intake outcome, categories
Add IntakeOutcome/IntakeResult/NearMiss, TreeNode union, NextNodeRequest/Result, L1Categories types; add ai_build to SessionKind; retype intake() to IntakeResult and add nextNode/escalations/getCategories/setCategories methods. nextNode body carries node_text (backend advance_ai_build stores it). tsc -b clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { apiClient } from './client'
|
||||
import type {
|
||||
IntakeRequest,
|
||||
IntakeResponse,
|
||||
IntakeResult,
|
||||
L1Categories,
|
||||
NextNodeRequest,
|
||||
NextNodeResult,
|
||||
QueueRow,
|
||||
WalkSession,
|
||||
AdhocNote,
|
||||
@@ -9,7 +12,23 @@ import type {
|
||||
|
||||
export const l1Api = {
|
||||
intake: (body: IntakeRequest) =>
|
||||
apiClient.post<IntakeResponse>('/l1/intake', body).then(r => r.data),
|
||||
apiClient.post<IntakeResult>('/l1/intake', body).then(r => r.data),
|
||||
|
||||
nextNode: (sessionId: string, body: NextNodeRequest) =>
|
||||
apiClient
|
||||
.post<NextNodeResult>(`/l1/sessions/${sessionId}/next-node`, body)
|
||||
.then(r => r.data),
|
||||
|
||||
escalations: () =>
|
||||
apiClient.get<WalkSession[]>('/l1/escalations').then(r => r.data),
|
||||
|
||||
getCategories: () =>
|
||||
apiClient.get<L1Categories>('/accounts/me/l1-categories').then(r => r.data),
|
||||
|
||||
setCategories: (enabled: string[]) =>
|
||||
apiClient
|
||||
.patch<L1Categories>('/accounts/me/l1-categories', { enabled })
|
||||
.then(r => r.data),
|
||||
|
||||
queue: (statusFilter?: string) =>
|
||||
apiClient.get<QueueRow[]>('/l1/queue', {
|
||||
|
||||
Reference in New Issue
Block a user