feat: Puente Mayúscula-Minúscula + TTS SpeechSynthesis + E2E fixes

This commit is contained in:
renato97
2026-07-21 15:31:46 -03:00
commit fa8e0c58ce
120 changed files with 16013 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
"use client"
export interface SkillAttemptPayload {
skillCode: string
promptLevel: number
correct: boolean
responseMs: number
}
export interface SessionPayload {
childId: string
startedAt: string
endedAt: string
durationSec: number
skillsPracticed: string
attempts: SkillAttemptPayload[]
}
export async function syncSession(payload: SessionPayload): Promise<string | null> {
try {
const res = await fetch("/api/sessions/sync", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
childId: payload.childId,
session: {
startedAt: payload.startedAt,
endedAt: payload.endedAt,
durationSec: payload.durationSec,
skillsPracticed: payload.skillsPracticed,
},
attempts: payload.attempts,
}),
})
const data = await res.json()
return data.sessionId ?? null
} catch {
return null
}
}
export async function createMilestone(childId: string, skillCode: string): Promise<boolean> {
try {
const res = await fetch("/api/milestones", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ childId, skillCode }),
})
return res.ok
} catch {
return false
}
}