Something went wrong. Try again.
Synapse is a study workspace. Organize courses read and annotate the material, train with generated exercises and watch your progress forked from denishovart.com/synapse
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152import { IsArray, IsBoolean, IsIn, IsInt, IsOptional, IsString, IsUUID, Matches, MaxLength,} from 'class-validator';
export class UpdateAiSettingsDto { @IsOptional() @IsBoolean() enabled?: boolean; @IsOptional() @IsIn(['claude', 'openai', 'local']) provider?: 'claude' | 'openai' | 'local'; @IsOptional() @IsString() model?: string; @IsOptional() @IsString() baseUrl?: string; @IsOptional() @IsString() apiKey?: string;}
export class UpdateSsoSettingsDto { @IsOptional() @IsBoolean() enabled?: boolean; @IsOptional() @IsString() issuer?: string; @IsOptional() @IsString() clientId?: string; @IsOptional() @IsString() clientSecret?: string; @IsOptional() @IsString() label?: string; @IsOptional() @IsString() publicUrl?: string;}
const EXERCISE_TYPES = ['mcq', 'true_false', 'open'] as const;type ExType = (typeof EXERCISE_TYPES)[number];
// Course and topic context travels with the request: those entities live in// the clients' workspace docs, the server only holds the document text.export class GenerateExercisesDto { @IsOptional() @IsUUID() document_id?: string; @IsOptional() @IsInt() count?: number; @IsOptional() @IsArray() @IsIn(EXERCISE_TYPES, { each: true }) types?: ExType[]; @IsOptional() @IsIn(['easy', 'medium', 'hard', 'mixed']) difficulty?: 'easy' | 'medium' | 'hard' | 'mixed'; @IsOptional() @IsUUID() course_id?: string; @IsOptional() @IsUUID() topic_id?: string; @IsOptional() @IsString() course_name?: string; @IsOptional() @IsString() topic_name?: string; // A custom prompt body from the client; bounded so a request can't carry an // unbounded string. The JSON output contract is appended server-side. @IsOptional() @IsString() @MaxLength(20000) promptTemplate?: string; // Fallback source text for documents that have no server row: the hash of // a text blob the device pushed earlier. @IsOptional() @Matches(/^[a-f0-9]{64}$/) text_hash?: string;}