@@ -34,5 +34,89 @@ export const GiteeUserSchema = z.object({
34
34
email : z . string ( ) . email ( ) . nullable ( ) . optional ( ) ,
35
35
} ) ;
36
36
37
+ // Declare a type and then define it to avoid circular references.
38
+ export type GiteeRepositorySchemaType = z . ZodObject < any > ;
39
+ export let GiteeRepositorySchema : GiteeRepositorySchemaType ;
40
+
41
+ GiteeRepositorySchema = z . object ( {
42
+ id : z . number ( ) ,
43
+ full_name : z . string ( ) ,
44
+ human_name : z . string ( ) ,
45
+ url : z . string ( ) . url ( ) ,
46
+ namespace : z . object ( {
47
+ id : z . number ( ) ,
48
+ name : z . string ( ) ,
49
+ path : z . string ( ) ,
50
+ type : z . string ( ) ,
51
+ } ) ,
52
+ path : z . string ( ) ,
53
+ name : z . string ( ) ,
54
+ owner : GiteeUserSchema ,
55
+ assigner : GiteeUserSchema . nullable ( ) ,
56
+ description : z . string ( ) . nullable ( ) ,
57
+ private : z . boolean ( ) ,
58
+ public : z . boolean ( ) ,
59
+ internal : z . boolean ( ) ,
60
+ fork : z . boolean ( ) ,
61
+ html_url : z . string ( ) . url ( ) ,
62
+ ssh_url : z . string ( ) ,
63
+ forks_url : z . string ( ) . url ( ) . optional ( ) ,
64
+ keys_url : z . string ( ) . url ( ) . optional ( ) ,
65
+ collaborators_url : z . string ( ) . url ( ) . optional ( ) ,
66
+ hooks_url : z . string ( ) . url ( ) . optional ( ) ,
67
+ branches_url : z . string ( ) . url ( ) . optional ( ) ,
68
+ tags_url : z . string ( ) . url ( ) . optional ( ) ,
69
+ blobs_url : z . string ( ) . url ( ) . optional ( ) ,
70
+ stargazers_url : z . string ( ) . url ( ) . optional ( ) ,
71
+ contributors_url : z . string ( ) . url ( ) . optional ( ) ,
72
+ commits_url : z . string ( ) . url ( ) . optional ( ) ,
73
+ comments_url : z . string ( ) . url ( ) . optional ( ) ,
74
+ issue_comment_url : z . string ( ) . url ( ) . optional ( ) ,
75
+ issues_url : z . string ( ) . url ( ) . optional ( ) ,
76
+ pulls_url : z . string ( ) . url ( ) . optional ( ) ,
77
+ milestones_url : z . string ( ) . url ( ) . optional ( ) ,
78
+ notifications_url : z . string ( ) . url ( ) . optional ( ) ,
79
+ labels_url : z . string ( ) . url ( ) . optional ( ) ,
80
+ releases_url : z . string ( ) . url ( ) . optional ( ) ,
81
+ recommend : z . boolean ( ) . optional ( ) ,
82
+ gvp : z . boolean ( ) . optional ( ) ,
83
+ homepage : z . string ( ) . nullable ( ) . optional ( ) ,
84
+ language : z . string ( ) . nullable ( ) . optional ( ) ,
85
+ forks_count : z . number ( ) . optional ( ) ,
86
+ stargazers_count : z . number ( ) . optional ( ) ,
87
+ watchers_count : z . number ( ) . optional ( ) ,
88
+ default_branch : z . string ( ) . nullable ( ) . optional ( ) ,
89
+ open_issues_count : z . number ( ) . optional ( ) ,
90
+ has_issues : z . boolean ( ) . optional ( ) ,
91
+ has_wiki : z . boolean ( ) . optional ( ) ,
92
+ issue_comment : z . boolean ( ) . nullable ( ) . optional ( ) ,
93
+ can_comment : z . boolean ( ) . optional ( ) ,
94
+ pull_requests_enabled : z . boolean ( ) . optional ( ) ,
95
+ has_page : z . boolean ( ) . optional ( ) ,
96
+ license : z . string ( ) . nullable ( ) . optional ( ) ,
97
+ outsourced : z . boolean ( ) . optional ( ) ,
98
+ project_creator : z . string ( ) . optional ( ) ,
99
+ members : z . array ( z . string ( ) ) . optional ( ) ,
100
+ pushed_at : z . string ( ) . nullable ( ) . optional ( ) ,
101
+ created_at : z . string ( ) . optional ( ) ,
102
+ updated_at : z . string ( ) . optional ( ) ,
103
+ parent : z . lazy ( ( ) => GiteeRepositorySchema ) . nullable ( ) . optional ( ) ,
104
+ paas : z . string ( ) . nullable ( ) . optional ( ) ,
105
+ assignees_number : z . number ( ) . optional ( ) ,
106
+ testers_number : z . number ( ) . optional ( ) ,
107
+ assignee : z . union ( [ GiteeUserSchema , z . array ( z . any ( ) ) , z . null ( ) ] ) . optional ( ) ,
108
+ enterprise : z . object ( {
109
+ id : z . number ( ) ,
110
+ name : z . string ( ) ,
111
+ url : z . string ( ) . url ( ) ,
112
+ } ) . nullable ( ) . optional ( ) ,
113
+ permission : z . object ( {
114
+ pull : z . boolean ( ) ,
115
+ push : z . boolean ( ) ,
116
+ admin : z . boolean ( ) ,
117
+ } ) . optional ( ) ,
118
+ } ) ;
119
+
37
120
// Type Exports
38
121
export type GiteeUser = z . infer < typeof GiteeUserSchema > ;
122
+ export type GiteeRepository = z . infer < typeof GiteeRepositorySchema > ;
0 commit comments