mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 23:11:31 +00:00
4a2578d18d
* build(deps): update dependency zod to v4 | datasource | package | from | to | | ---------- | ------- | ------- | ----- | | npm | zod | 3.25.76 | 4.3.6 | * fix: zod migration --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { z } from 'zod/v3';
|
|
import type { LongCommitSha } from '../../../util/git/types.ts';
|
|
import { LooseArray } from '../../../util/schema-utils/index.ts';
|
|
|
|
export const LastPipelineId = z
|
|
.object({
|
|
last_pipeline: z.object({
|
|
id: z.number(),
|
|
}),
|
|
})
|
|
.transform(({ last_pipeline }) => last_pipeline.id);
|
|
|
|
const GitlabUserSchema = z.object({
|
|
id: z.number(),
|
|
username: z.string(),
|
|
});
|
|
|
|
const LongCommitShaSchema = z.string().transform((val) => val as LongCommitSha);
|
|
|
|
export const GitLabMergeRequestSchema = z.object({
|
|
iid: z.number(),
|
|
title: z.string(),
|
|
description: z.string().nullable(),
|
|
state: z.string(),
|
|
source_branch: z.string(),
|
|
target_branch: z.string(),
|
|
created_at: z.string(),
|
|
updated_at: z.string(),
|
|
diverged_commits_count: z.number().optional(),
|
|
merge_status: z.string().optional(),
|
|
assignee: GitlabUserSchema.nullish(),
|
|
assignees: LooseArray(GitlabUserSchema).catch([]),
|
|
reviewers: LooseArray(GitlabUserSchema).catch([]),
|
|
labels: z.array(z.string()).optional(),
|
|
sha: LongCommitShaSchema.nullish(),
|
|
head_pipeline: z
|
|
.object({
|
|
status: z.string(),
|
|
sha: LongCommitShaSchema,
|
|
})
|
|
.nullish(),
|
|
});
|
|
|
|
export const GitLabMergeRequestsSchema = z.array(GitLabMergeRequestSchema);
|
|
export type GitLabMergeRequest = z.infer<typeof GitLabMergeRequestSchema>;
|