feat: New Chat, Search Chat and Master Slave DB Architecture for CRM and Oracle Canvas
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ export interface OracleExecutionState {
|
||||
}) => void;
|
||||
}) => Promise<void>;
|
||||
clearError: () => void;
|
||||
resetHistory: () => void;
|
||||
}
|
||||
|
||||
export function useOracleExecution(): OracleExecutionState {
|
||||
@@ -126,5 +127,12 @@ export function useOracleExecution(): OracleExecutionState {
|
||||
[],
|
||||
);
|
||||
|
||||
return { history, inFlight, lastError, submit, clearError: () => setLastError(null) };
|
||||
return {
|
||||
history,
|
||||
inFlight,
|
||||
lastError,
|
||||
submit,
|
||||
clearError: () => setLastError(null),
|
||||
resetHistory: () => setHistory([]),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -81,6 +81,32 @@ export async function fetchCanvasPage(pageId: string): Promise<CanvasPage> {
|
||||
return apiFetch<CanvasPage>(`/canvas-pages/${pageId}`);
|
||||
}
|
||||
|
||||
export async function listCanvasPages(search?: string): Promise<CanvasPage[]> {
|
||||
const qs = new URLSearchParams();
|
||||
if (search?.trim()) qs.set('search', search.trim());
|
||||
return apiFetch<CanvasPage[]>(`/canvas-pages${qs.toString() ? `?${qs.toString()}` : ''}`);
|
||||
}
|
||||
|
||||
export async function createCanvasPage(title = 'Untitled Canvas'): Promise<CanvasPage> {
|
||||
return apiFetch<CanvasPage>('/canvas-pages', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ title }),
|
||||
});
|
||||
}
|
||||
|
||||
export async function renameCanvasPage(pageId: string, title: string): Promise<CanvasPage> {
|
||||
return apiFetch<CanvasPage>(`/canvas-pages/${pageId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({ title }),
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteCanvasPage(pageId: string): Promise<{ pageId: string; deleted: boolean }> {
|
||||
return apiFetch<{ pageId: string; deleted: boolean }>(`/canvas-pages/${pageId}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
export async function submitPrompt(
|
||||
pageId: string,
|
||||
payload: PromptSubmitRequest,
|
||||
|
||||
Reference in New Issue
Block a user