feat: add session sharing types, API client, and utilities
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user