|
1 | 1 | import { RepoOwnerParamType } from '@/types/platform/github/base' |
| 2 | +import { AccountBaseType } from '@/types/platform/github/user' |
2 | 3 |
|
3 | 4 | /** 创建组织仓库请求参数 */ |
4 | 5 | export interface OrgRepoCreateParamType extends RepoOwnerParamType { |
@@ -49,3 +50,160 @@ export interface OrgRepoCreateParamType extends RepoOwnerParamType { |
49 | 50 | /** 新存储库的自定义属性 */ |
50 | 51 | custom_properties?: { [key: string]: string }; |
51 | 52 | } |
| 53 | + |
| 54 | +/** |
| 55 | + * @description 组织的基本信息 |
| 56 | + */ |
| 57 | +export interface OrganizationBaseType extends AccountBaseType { |
| 58 | + /** 组织的名称 */ |
| 59 | + name?: string; |
| 60 | + /** 组织的描述 */ |
| 61 | + description: string | null; |
| 62 | + /** 组织的公司名称 */ |
| 63 | + company?: string; |
| 64 | + /** 组织的博客 URL */ |
| 65 | + blog: string | null; |
| 66 | + /** 组织的所在地 */ |
| 67 | + location?: string; |
| 68 | + /** 组织的邮箱地址 */ |
| 69 | + email?: string; |
| 70 | + /** 组织的 Twitter 用户名 */ |
| 71 | + twitter_username?: string | null; |
| 72 | + /** 组织是否已验证 */ |
| 73 | + is_verified?: boolean; |
| 74 | + /** 账户类型(例如 "Organization") */ |
| 75 | + type: string; |
| 76 | + /** 创建时间 */ |
| 77 | + created_at: string; |
| 78 | + /** 更新时间 */ |
| 79 | + updated_at: string; |
| 80 | + /** 归档时间 */ |
| 81 | + archived_at: string | null; |
| 82 | +} |
| 83 | +/** |
| 84 | + * @description 组织的计划信息 |
| 85 | + */ |
| 86 | +export interface OrganizationPlanType { |
| 87 | + name: string; |
| 88 | + space: number; |
| 89 | + private_repos: number; |
| 90 | + filled_seats?: number; |
| 91 | + seats?: number; |
| 92 | +} |
| 93 | + |
| 94 | +/** |
| 95 | + * @description 组织的 API URL 信息 |
| 96 | + */ |
| 97 | +export interface OrganizationUrlType { |
| 98 | + /** 组织的 Webhook 列表 API URL */ |
| 99 | + hooks_url: string; |
| 100 | + /** 组织的 Issues 列表 API URL */ |
| 101 | + issues_url: string; |
| 102 | + /** 组织的成员列表 API URL 模板 */ |
| 103 | + members_url: string; |
| 104 | + /** 组织的公开成员列表 API URL 模板 */ |
| 105 | + public_members_url: string; |
| 106 | +} |
| 107 | + |
| 108 | +/** |
| 109 | + * @description 组织的仓库和 Gists 信息 |
| 110 | + */ |
| 111 | +export interface OrganizationRepositoryAndGistsType { |
| 112 | + /** 组织的公开仓库数量 */ |
| 113 | + public_repos: number; |
| 114 | + /** 组织的公开 Gists 数量 */ |
| 115 | + public_gists: number; |
| 116 | + /** 组织的总私有仓库数量 */ |
| 117 | + total_private_repos?: number; |
| 118 | + /** 组织拥有的私有仓库数量 */ |
| 119 | + owned_private_repos?: number; |
| 120 | + /** 组织的私有 Gists 数量 */ |
| 121 | + private_gists?: number | null; |
| 122 | + /** 组织的磁盘使用量 */ |
| 123 | + disk_usage?: number | null; |
| 124 | +} |
| 125 | + |
| 126 | +/** |
| 127 | + * @description 组织的成员信息 |
| 128 | + */ |
| 129 | +export interface OrganizationMemberType { |
| 130 | + /** 组织的关注者数量 */ |
| 131 | + followers: number; |
| 132 | + /** 组织关注的数量 */ |
| 133 | + following: number; |
| 134 | + /** 私有仓库中的协作者数量 */ |
| 135 | + collaborators?: number | null; |
| 136 | +} |
| 137 | + |
| 138 | +/** |
| 139 | + * @description 组织的权限和配置信息 |
| 140 | + */ |
| 141 | +export interface OrganizationPermissionsAndConfigType { |
| 142 | + /** 组织是否启用了组织项目 */ |
| 143 | + has_organization_projects: boolean; |
| 144 | + /** 组织是否启用了仓库项目 */ |
| 145 | + has_repository_projects: boolean; |
| 146 | + /** 组织的账单邮箱地址 */ |
| 147 | + billing_email?: string | null; |
| 148 | + /** 组织的计划信息 */ |
| 149 | + plan?: OrganizationPlanType; |
| 150 | + /** 默认的仓库权限 */ |
| 151 | + default_repository_permission?: string | null; |
| 152 | + /** 成员是否可以创建仓库 */ |
| 153 | + members_can_create_repositories?: boolean | null; |
| 154 | + /** 是否启用了两因素认证要求 */ |
| 155 | + two_factor_requirement_enabled?: boolean | null; |
| 156 | + /** 成员允许的仓库创建类型 */ |
| 157 | + members_allowed_repository_creation_type?: string; |
| 158 | + /** 成员是否可以创建公开仓库 */ |
| 159 | + members_can_create_public_repositories?: boolean; |
| 160 | + /** 成员是否可以创建私有仓库 */ |
| 161 | + members_can_create_private_repositories?: boolean; |
| 162 | + /** 成员是否可以创建内部仓库 */ |
| 163 | + members_can_create_internal_repositories?: boolean; |
| 164 | + /** 成员是否可以创建 Pages */ |
| 165 | + members_can_create_pages?: boolean; |
| 166 | + /** 成员是否可以创建公开 Pages */ |
| 167 | + members_can_create_public_pages?: boolean; |
| 168 | + /** 成员是否可以创建私有 Pages */ |
| 169 | + members_can_create_private_pages?: boolean; |
| 170 | + /** 成员是否可以 Fork 私有仓库 */ |
| 171 | + members_can_fork_private_repositories?: boolean | null; |
| 172 | + /** 是否要求 Web 提交签名 */ |
| 173 | + web_commit_signoff_required?: boolean; |
| 174 | + /** 控制是否允许为组织中的仓库添加和使用部署密钥 */ |
| 175 | + deploy_keys_enabled_for_repositories?: boolean; |
| 176 | +} |
| 177 | + |
| 178 | +/** |
| 179 | + * @description 组织的安全配置信息 |
| 180 | + */ |
| 181 | +export interface OrganizationSecurityConfigType { |
| 182 | + /** 对于新仓库和转移到此组织的仓库,是否启用了 GitHub Advanced Security */ |
| 183 | + advanced_security_enabled_for_new_repositories?: boolean; |
| 184 | + /** 对于新仓库和转移到此组织的仓库,是否自动启用了 Dependabot alerts */ |
| 185 | + dependabot_alerts_enabled_for_new_repositories?: boolean; |
| 186 | + /** 对于新仓库和转移到此组织的仓库,是否自动启用了 Dependabot security updates */ |
| 187 | + dependabot_security_updates_enabled_for_new_repositories?: boolean; |
| 188 | + /** 对于新仓库和转移到此组织的仓库,是否自动启用了 dependency graph */ |
| 189 | + dependency_graph_enabled_for_new_repositories?: boolean; |
| 190 | + /** 对于新仓库和转移到此组织的仓库,是否自动启用了 secret scanning */ |
| 191 | + secret_scanning_enabled_for_new_repositories?: boolean; |
| 192 | + /** 对于新仓库和转移到此组织的仓库,是否自动启用了 secret scanning push protection */ |
| 193 | + secret_scanning_push_protection_enabled_for_new_repositories?: boolean; |
| 194 | + /** 是否向因 push protection 而被阻止推送 secret 的贡献者显示自定义链接 */ |
| 195 | + secret_scanning_push_protection_custom_link_enabled?: boolean; |
| 196 | + /** 显示给因 push protection 而被阻止推送 secret 的贡献者 */ |
| 197 | + secret_scanning_push_protection_custom_link?: string | null; |
| 198 | +} |
| 199 | + |
| 200 | +/** |
| 201 | + * @description GitHub 组织的完整信息 |
| 202 | + */ |
| 203 | +export interface OrganizationInfoType |
| 204 | + extends OrganizationBaseType, |
| 205 | + OrganizationUrlType, |
| 206 | + OrganizationRepositoryAndGistsType, |
| 207 | + OrganizationMemberType, |
| 208 | + OrganizationPermissionsAndConfigType, |
| 209 | + OrganizationSecurityConfigType {} |
0 commit comments