feat: add session sharing types, API client, and utilities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-14 16:06:31 -05:00
parent 6b4304ab92
commit c24e84d8a0
3 changed files with 90 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
import apiClient from './client'
import type { Session, SessionCreate, SessionUpdate, SessionExport, SaveAsTreeRequest, SaveAsTreeResponse, SessionComplete, RedactionSummary } from '@/types'
import type { Session, SessionCreate, SessionUpdate, SessionExport, SaveAsTreeRequest, SaveAsTreeResponse, SessionComplete, RedactionSummary, SessionShareCreate, SessionShare, SharedSessionView } from '@/types'
export interface SessionListParams {
page?: number
@@ -85,6 +85,26 @@ export const sessionsApi = {
const response = await apiClient.post<SaveAsTreeResponse>(`/sessions/${id}/save-as-tree`, data)
return response.data
},
// Session Sharing
async createShare(sessionId: string, data: SessionShareCreate): Promise<SessionShare> {
const response = await apiClient.post<SessionShare>(`/sessions/${sessionId}/shares`, data)
return response.data
},
async listMyShares(): Promise<SessionShare[]> {
const response = await apiClient.get<SessionShare[]>('/shares/my-shares')
return response.data
},
async revokeShare(shareId: string): Promise<void> {
await apiClient.delete(`/shares/${shareId}`)
},
async getSharedSession(shareToken: string): Promise<SharedSessionView> {
const response = await apiClient.get<SharedSessionView>(`/share/${shareToken}`)
return response.data
},
}
export default sessionsApi