mirror of
https://github.com/catdevnull/transicion-desordenada-diablo
synced 2024-11-15 02:21:39 +00:00
37 lines
942 B
TypeScript
37 lines
942 B
TypeScript
|
import z from "zod";
|
||
|
|
||
|
export const zPublisher = z.object({
|
||
|
mbox: z.string().optional(),
|
||
|
name: z.string(),
|
||
|
});
|
||
|
export const zDistribution = z.object({
|
||
|
identifier: z.string(),
|
||
|
downloadURL: z.string(),
|
||
|
fileName: z.string().optional(),
|
||
|
format: z.string().optional(),
|
||
|
title: z.string(),
|
||
|
description: z.string().optional(),
|
||
|
});
|
||
|
export type Distribution = z.infer<typeof zDistribution>;
|
||
|
export const zDataset = z.object({
|
||
|
identifier: z.string(),
|
||
|
title: z.string(),
|
||
|
description: z.string(),
|
||
|
publisher: zPublisher,
|
||
|
distribution: z.array(zDistribution),
|
||
|
});
|
||
|
export const zData = z.object({
|
||
|
title: z.string(),
|
||
|
description: z.string(),
|
||
|
homepage: z.string(),
|
||
|
dataset: z.array(zDataset),
|
||
|
});
|
||
|
|
||
|
export const zError = z.object({
|
||
|
url: z.string(),
|
||
|
datasetIdentifier: z.string(),
|
||
|
distributionIdentifier: z.string(),
|
||
|
kind: z.enum(["generic_error", "http_error", "infinite_redirect"]),
|
||
|
error: z.string().optional(),
|
||
|
});
|