diff --git a/package.json b/package.json index 45ec859..b325ae9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "cheerio": "^1.0.0-rc.12", "path": "^0.12.7", "unzip-stream": "^0.3.1", - "xmldom": "^0.6.0" + "xmldom": "^0.6.0", + "zod": "^3.22.4" }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.0.0", diff --git a/src/types.ts b/src/types.ts index 15bfecb..bf21db9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,31 @@ +import { z } from 'zod'; + +const languageSchema = z.object({ + name: z.string(), + code: z.string(), + level: z.string(), +}); + +const countrySchema = z.object({ + name: z.string(), + code: z.string(), +}); + +export const versionInfoSchema = z.object({ + id: z.string(), + version: z.string(), + description: z.string(), + scope: z.string(), + language: languageSchema, + country: countrySchema, + numeralSystem: z.string(), + script: z.string(), + archivist: z.string(), + copyright: z.string(), + localVersionName: z.string(), + localVersionAbbreviation: z.string(), +}); + export interface Verse { book: string | undefined chapter: string | undefined