UNPKG

@secustor/backstage-plugin-renovate-common

Version:

Common functionalities for the renovate plugin

89 lines (85 loc) 2.75 kB
'use strict'; var zod = require('zod'); const targetRepo = zod.z.object({ host: zod.z.string(), repository: zod.z.string() }); const problem = zod.z.any(); const NullishString = zod.z.coerce.string().optional().catch((ctx) => { if (ctx.input === null) return void 0; throw ctx.error; }); const update = zod.z.object({ updateType: zod.z.string(), newVersion: NullishString, lockedVersion: NullishString, newValue: NullishString, newMajor: zod.z.number().nullish(), newMinor: zod.z.number().nullish(), newPatch: zod.z.number().nullish() }).passthrough(); const dependency = zod.z.object({ depName: NullishString, datasource: NullishString, packageName: NullishString, depType: NullishString, currentValue: NullishString, skipReason: NullishString, currentVersion: NullishString, updates: zod.z.array(update).optional(), registryUrl: NullishString, sourceUrl: NullishString, currentVersionTimestamp: zod.z.coerce.date().optional() }).passthrough(); const packageFile = zod.z.object({ packageFile: zod.z.string(), packageFileVersion: NullishString, datasource: NullishString, deps: zod.z.array(dependency) }).passthrough(); const branch = zod.z.object({ prNo: zod.z.number().nullish(), upgrades: zod.z.array(zod.z.any()) }).passthrough(); const packageFiles = zod.z.record(zod.z.string(), zod.z.array(packageFile)); const libYears = zod.z.object({ managerLibYears: zod.z.record(zod.z.string(), zod.z.number()), totalLibYears: zod.z.number(), totalDepsCount: zod.z.number(), outdatedDepsCount: zod.z.number() }); const repositoryReport = zod.z.object({ problems: zod.z.array(problem), branches: zod.z.array(branch), packageFiles, libYears: libYears.optional() }).passthrough(); const renovateReport = zod.z.object({ problems: zod.z.array(problem), repositories: zod.z.record(zod.z.string(), repositoryReport) }); const repositoryReportResponseElement = zod.z.object({ runID: zod.z.string(), taskID: zod.z.string(), timestamp: zod.z.coerce.date(), host: zod.z.string(), repository: zod.z.string(), report: repositoryReport }).passthrough(); const repositoryReportResponse = zod.z.array( repositoryReportResponseElement ); exports.NullishString = NullishString; exports.branch = branch; exports.dependency = dependency; exports.libYears = libYears; exports.packageFile = packageFile; exports.packageFiles = packageFiles; exports.problem = problem; exports.renovateReport = renovateReport; exports.repositoryReport = repositoryReport; exports.repositoryReportResponse = repositoryReportResponse; exports.repositoryReportResponseElement = repositoryReportResponseElement; exports.targetRepo = targetRepo; exports.update = update; //# sourceMappingURL=schema.cjs.js.map