feat(gtm): add session history, database loading, and markdown file import
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Phase1Data, Phase2Data, Phase3Data, Phase4Data, Phase6Data, Phase7Data, Phase8Data, Phase9Data, Language } from "./types";
|
||||
import { Phase1Data, Phase2Data, Phase3Data, Phase4Data, Phase6Data, Phase7Data, Phase8Data, Phase9Data, Language, ProjectHistoryItem } from "./types";
|
||||
|
||||
const API_BASE_URL = './api'; // Relative path to respect Nginx /gtm/ routing
|
||||
|
||||
@@ -100,4 +100,16 @@ export const translateReportToEnglish = async (reportMarkdown: string): Promise<
|
||||
export const generateConceptImage = async (prompt: string, referenceImagesBase64?: string[]): Promise<string> => {
|
||||
const result = await callApi<{ imageBase64: string }>('run', 'image', { prompt, referenceImagesBase64 });
|
||||
return result.imageBase64;
|
||||
};
|
||||
|
||||
export const listSessions = async (): Promise<{ projects: ProjectHistoryItem[] }> => {
|
||||
return callApi('run', 'list_history', {});
|
||||
};
|
||||
|
||||
export const loadSession = async (projectId: string): Promise<any> => {
|
||||
return callApi('run', 'load_history', { projectId });
|
||||
};
|
||||
|
||||
export const deleteSession = async (projectId: string): Promise<any> => {
|
||||
return callApi('run', 'delete_session', { projectId });
|
||||
};
|
||||
Reference in New Issue
Block a user