feat: add VoicePrint tRPC router with service, ML engine, and storage modules
- Create voiceprint router with 7 protected procedures: getEnrollments, createEnrollment, deleteEnrollment, analyzeAudio, getAnalyses, getAnalysisResult, getJobStatus - Create voiceprint service with core business logic: enrollment CRUD, audio analysis pipeline, alert creation, batch jobs - Create ML engine with placeholder implementations for audio preprocessing, synthetic detection, voice matching, embedding - Create storage module for audio file persistence on disk - Add valibot schemas for input validation - Wire voiceprint router into root tRPC router - Add comprehensive unit tests (33 tests, all passing)
This commit is contained in:
29
web/src/server/api/schemas/voiceprint.ts
Normal file
29
web/src/server/api/schemas/voiceprint.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { object, string, minLength, optional, number, picklist } from "valibot";
|
||||
|
||||
export const CreateEnrollmentSchema = object({
|
||||
name: string([minLength(1)]),
|
||||
audioBase64: string([minLength(1)]),
|
||||
});
|
||||
|
||||
export const DeleteEnrollmentSchema = object({
|
||||
enrollmentId: string([minLength(1)]),
|
||||
});
|
||||
|
||||
export const AnalyzeAudioSchema = object({
|
||||
audioBase64: string([minLength(1)]),
|
||||
enrollmentId: optional(string()),
|
||||
});
|
||||
|
||||
export const AnalysisFilterSchema = object({
|
||||
page: optional(number(), 1),
|
||||
limit: optional(number(), 20),
|
||||
verdict: optional(picklist(["NATURAL", "SYNTHETIC", "UNCERTAIN"])),
|
||||
});
|
||||
|
||||
export const AnalysisResultSchema = object({
|
||||
analysisId: string([minLength(1)]),
|
||||
});
|
||||
|
||||
export const JobStatusSchema = object({
|
||||
jobId: string([minLength(1)]),
|
||||
});
|
||||
Reference in New Issue
Block a user