feat: integrate AI growth analyst experience

This commit is contained in:
2026-08-21 01:16:57 +03:30
parent 7a495b04c2
commit c79a1219bf
12 changed files with 2441 additions and 1421 deletions

View File

@@ -11,6 +11,7 @@ export type SessionStatus = components['schemas']['SessionStatus'];
export type DetailView = components['schemas']['DetailView'];
export type FailureStage = components['schemas']['FailureStage'];
export type Problem = components['schemas']['Problem'];
export type GrowthReport = components['schemas']['GrowthReport'];
const apiBase = (import.meta.env.PUBLIC_API_BASE_URL || '/api/v1').replace(/\/$/, '');
@@ -119,6 +120,23 @@ export const api = {
sessionDetail(sessionId: string) {
return request<SessionDetail>(`/analytics/sessions/${encodeURIComponent(sessionId)}`);
},
latestGrowthReport(terminalId?: string) {
const query = terminalId ? `?terminalId=${encodeURIComponent(terminalId)}` : '';
return request<GrowthReport>(`/analytics/growth-reports/latest${query}`);
},
createGrowthReport(csrfToken: string, options: { terminalId?: string; refresh?: boolean } = {}) {
return request<GrowthReport>('/analytics/growth-reports', {
method: 'POST',
headers: {
'X-CSRF-Token': csrfToken,
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify(options),
});
},
growthReport(reportId: string) {
return request<GrowthReport>(`/analytics/growth-reports/${encodeURIComponent(reportId)}`);
},
exportUrl(
periodId: string,
view: DetailView,