diff --git a/types/Dojo/AssignmentFile.ts b/types/Dojo/AssignmentFile.ts index 61c826cfe7576927fb2a19f9eaeada9f696fb16c..71e8c0d16eb06d6138e0a13fff39c77fa8bf0abe 100644 --- a/types/Dojo/AssignmentFile.ts +++ b/types/Dojo/AssignmentFile.ts @@ -1,16 +1,19 @@ -import ImmutableFileDescriptor from './ImmutableFileDescriptor'; +import { ImmutableFileDescriptor, immutableFileDescriptorSchema } from './ImmutableFileDescriptor'; +import { z } from 'zod'; -interface AssignmentFile { - dojoAssignmentVersion: number, - version: number, +const AssignmentFile = z.object({ + dojoAssignmentVersion: z.number(), + version : z.number(), + immutable : z.array(immutableFileDescriptorSchema.transform(value => value as ImmutableFileDescriptor)), + result : z.object({ + container: z.string(), + volume : z.string().optional() + }) + }).strict(); - immutable: Array<ImmutableFileDescriptor> - result: { - container: string, volume?: string - } -} +type AssignmentFile = z.infer<typeof AssignmentFile>; export default AssignmentFile; \ No newline at end of file