mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 02:00:10 +00:00
15f4bd8eff
* chore: migrate from zod/v3 to zod/v4 This commit contains the logic changes * chore: migrate imports from zod/v3 to zod/v4 This contains import updates and adds explicit record keys as zod/v4 requires these now * ci: enforce usage of zod/v4
32 lines
684 B
TypeScript
32 lines
684 B
TypeScript
import { z } from 'zod/v4';
|
|
|
|
export const File = z.object({
|
|
version: z.string(),
|
|
createdAt: z.string().nullable(),
|
|
yankedReason: z.string().nullable(),
|
|
urls: z
|
|
.array(z.object({ url: z.string(), kind: z.string() }))
|
|
.optional()
|
|
.default([])
|
|
.transform((urls) => {
|
|
return Object.fromEntries(urls.map((url) => [url.kind, url.url]));
|
|
}),
|
|
});
|
|
|
|
export type File = z.infer<typeof File>;
|
|
|
|
export const PagedResponse = z.object({
|
|
data: z.object({
|
|
package: z
|
|
.object({
|
|
variants: z
|
|
.object({
|
|
pages: z.number(),
|
|
page: z.array(File),
|
|
})
|
|
.nullable(),
|
|
})
|
|
.nullable(),
|
|
}),
|
|
});
|