UNPKG

renovate

Version:

Automated dependency updates. Flexible so you don't need to be.

91 lines (90 loc) 2.7 kB
import { LooseArray } from "../../../util/schema-utils/index.js"; import { z } from "zod/v4"; //#region lib/modules/platform/gerrit/schema.ts /** * The Schemas for the Gerrit API Responses ({@link https://gerrit-review.googlesource.com/Documentation/rest-api.html | REST-API}) * minimized to only needed properties. * * @packageDocumentation */ const GerritAccountInfo = z.object({ _account_id: z.number(), username: z.string().optional() }); const GerritLabelInfo = z.object({ approved: GerritAccountInfo.optional(), rejected: GerritAccountInfo.optional(), blocking: z.boolean().optional() }); const GerritActionInfo = z.object({ method: z.string().optional(), enabled: z.boolean().optional() }); const GerritRevisionInfo = z.object({ uploader: GerritAccountInfo, ref: z.string(), created: z.string(), actions: z.record(z.string(), GerritActionInfo).optional(), commit_with_footers: z.string().optional() }); const GerritChangeMessageInfo = z.object({ id: z.string(), message: z.string(), tag: z.string().optional() }); const GerritChange = z.object({ branch: z.string(), change_id: z.string(), subject: z.string(), status: z.enum([ "NEW", "MERGED", "ABANDONED" ]), created: z.string(), hashtags: z.array(z.string()), submittable: z.boolean().optional(), _number: z.number(), labels: z.record(z.string(), GerritLabelInfo).optional(), reviewers: z.object({ REVIEWER: LooseArray(GerritAccountInfo).optional() }).optional(), messages: LooseArray(GerritChangeMessageInfo).optional(), current_revision: z.string().optional(), revisions: z.record(z.string(), GerritRevisionInfo).optional(), problems: z.array(z.unknown()).optional(), _more_changes: z.boolean().optional() }); const GerritChanges = LooseArray(GerritChange); const GerritLabelTypeInfo = z.object({ values: z.record(z.coerce.number(), z.string()), default_value: z.number() }); const GerritProjectInfo = z.object({ id: z.string(), name: z.string(), state: z.enum([ "ACTIVE", "READ_ONLY", "HIDDEN" ]).optional(), labels: z.record(z.string(), GerritLabelTypeInfo).optional() }); const GerritBranchInfo = z.object({ ref: z.string(), revision: z.string() }); const GerritMergeableInfo = z.object({ submit_type: z.enum([ "MERGE_IF_NECESSARY", "FAST_FORWARD_ONLY", "REBASE_IF_NECESSARY", "REBASE_ALWAYS", "MERGE_ALWAYS", "CHERRY_PICK" ]), mergeable: z.boolean() }); const GerritRepos = z.record(z.string(), z.object({}).loose()); const GerritChangeMessages = LooseArray(GerritChangeMessageInfo); //#endregion export { GerritBranchInfo, GerritChange, GerritChangeMessages, GerritChanges, GerritMergeableInfo, GerritProjectInfo, GerritRepos }; //# sourceMappingURL=schema.js.map