Files
renovate/lib/modules/datasource/node-version/schema.ts
T
Sebastian Poxhofer c908d078ef fix(datasource): replace getJsonUnchecked in npm/Node/PyPI/Go (#43699)
* fix(datasource): replace getJsonUnchecked with validated getJson in npm/Node/PyPI/Go

Replace all getJsonUnchecked calls in npm, Node.js, PyPI, and Go datasources
with Zod-validated getJson calls:

- datasource/npm: add NpmResponseSchema to schema.ts (shared with presets)
- config/presets/npm: migrate to NpmResponseSchema with passthrough version fields
- datasource/node-version: add NodeReleasesSchema using LooseArray
- datasource/pypi: add PypiJSONSchema (nullable+catch for lenient empty-body handling)
- datasource/go: add VersionInfoSchema for both versionInfo and getLatestVersion calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* some manual cleaning up

* removing schema level catch

* removing some more types

* refactor: rename schema

* fix linter errors

* remove schema suffix which hasn't been catched by linter

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 19:14:50 +00:00

16 lines
417 B
TypeScript

import { z } from 'zod/v4';
import { LooseArray } from '../../../util/schema-utils/index.ts';
export const NodeRelease = z.object({
/** node version */
version: z.string(),
/** release date */
date: z.string().optional(),
/** Is LTS release */
lts: z.union([z.literal(false), z.string()]),
});
export type NodeRelease = z.infer<typeof NodeRelease>;
export const NodeReleases = LooseArray(NodeRelease);