@@ -271,9 +271,15 @@ export const CreateMergeRequestOptionsSchema = z.object({
271271 draft : z . boolean ( ) . optional ( ) ,
272272} ) ;
273273
274- export const CreateBranchOptionsSchema = z . object ( {
275- name : z . string ( ) , // Changed from ref to match GitLab API
276- ref : z . string ( ) , // The source branch/commit for the new branch
274+ export const GitLabDiffSchema = z . object ( {
275+ old_path : z . string ( ) ,
276+ new_path : z . string ( ) ,
277+ a_mode : z . string ( ) ,
278+ b_mode : z . string ( ) ,
279+ diff : z . string ( ) ,
280+ new_file : z . boolean ( ) ,
281+ renamed_file : z . boolean ( ) ,
282+ deleted_file : z . boolean ( ) ,
277283} ) ;
278284
279285// Response schemas for operations
@@ -291,6 +297,27 @@ export const GitLabSearchResponseSchema = z.object({
291297 items : z . array ( GitLabRepositorySchema ) ,
292298} ) ;
293299
300+ // create branch schemas
301+ export const CreateBranchOptionsSchema = z . object ( {
302+ name : z . string ( ) , // Changed from ref to match GitLab API
303+ ref : z . string ( ) , // The source branch/commit for the new branch
304+ } ) ;
305+
306+ export const GitLabCompareResultSchema = z . object ( {
307+ commit : z . object ( {
308+ id : z . string ( ) . optional ( ) ,
309+ short_id : z . string ( ) . optional ( ) ,
310+ title : z . string ( ) . optional ( ) ,
311+ author_name : z . string ( ) . optional ( ) ,
312+ author_email : z . string ( ) . optional ( ) ,
313+ created_at : z . string ( ) . optional ( ) ,
314+ } ) . optional ( ) ,
315+ commits : z . array ( GitLabCommitSchema ) ,
316+ diffs : z . array ( GitLabDiffSchema ) ,
317+ compare_timeout : z . boolean ( ) . optional ( ) ,
318+ compare_same_ref : z . boolean ( ) . optional ( ) ,
319+ } ) ;
320+
294321// Issue related schemas
295322export const GitLabLabelSchema = z . object ( {
296323 id : z . number ( ) ,
@@ -596,20 +623,16 @@ export const ForkRepositorySchema = ProjectParamsSchema.extend({
596623 namespace : z . string ( ) . optional ( ) . describe ( "Namespace to fork to (full path)" ) ,
597624} ) ;
598625
626+ // Branch related schemas
599627export const CreateBranchSchema = ProjectParamsSchema . extend ( {
600628 branch : z . string ( ) . describe ( "Name for the new branch" ) ,
601629 ref : z . string ( ) . optional ( ) . describe ( "Source branch/commit for new branch" ) ,
602630} ) ;
603631
604- export const GitLabMergeRequestDiffSchema = z . object ( {
605- old_path : z . string ( ) ,
606- new_path : z . string ( ) ,
607- a_mode : z . string ( ) ,
608- b_mode : z . string ( ) ,
609- diff : z . string ( ) ,
610- new_file : z . boolean ( ) ,
611- renamed_file : z . boolean ( ) ,
612- deleted_file : z . boolean ( ) ,
632+ export const GetBranchDiffsSchema = ProjectParamsSchema . extend ( {
633+ from : z . string ( ) . describe ( "The base branch or commit SHA to compare from" ) ,
634+ to : z . string ( ) . describe ( "The target branch or commit SHA to compare to" ) ,
635+ straight : z . boolean ( ) . optional ( ) . describe ( "Comparison method: false for '...' (default), true for '--'" ) ,
613636} ) ;
614637
615638export const GetMergeRequestSchema = ProjectParamsSchema . extend ( {
@@ -1082,6 +1105,7 @@ export type GitLabDirectoryContent = z.infer<
10821105export type GitLabContent = z . infer < typeof GitLabContentSchema > ;
10831106export type FileOperation = z . infer < typeof FileOperationSchema > ;
10841107export type GitLabTree = z . infer < typeof GitLabTreeSchema > ;
1108+ export type GitLabCompareResult = z . infer < typeof GitLabCompareResultSchema > ;
10851109export type GitLabCommit = z . infer < typeof GitLabCommitSchema > ;
10861110export type GitLabReference = z . infer < typeof GitLabReferenceSchema > ;
10871111export type CreateRepositoryOptions = z . infer <
@@ -1097,7 +1121,7 @@ export type GitLabCreateUpdateFileResponse = z.infer<
10971121> ;
10981122export type GitLabSearchResponse = z . infer < typeof GitLabSearchResponseSchema > ;
10991123export type GitLabMergeRequestDiff = z . infer <
1100- typeof GitLabMergeRequestDiffSchema
1124+ typeof GitLabDiffSchema
11011125> ;
11021126export type CreateNoteOptions = z . infer < typeof CreateNoteSchema > ;
11031127export type GitLabIssueLink = z . infer < typeof GitLabIssueLinkSchema > ;
0 commit comments