|
| 1 | +/* eslint-disable */ |
| 2 | +// @ts-ignore |
| 3 | +import request from 'axios'; |
| 4 | +import { createUniAppAxiosAdapter } from '@uni-helper/axios-adapter'; |
| 5 | +request.defaults.baseURL = 'https://gitee.com/api'; |
| 6 | +request.defaults.adapter = createUniAppAxiosAdapter(); |
| 7 | + |
| 8 | +import * as API from './types'; |
| 9 | + |
| 10 | +/** 创建检查项 创建检查项 POST /v5/repos/${param0}/${param1}/check-runs */ |
| 11 | +export async function postV5ReposOwnerRepoCheckRuns( |
| 12 | + // 叠加生成的 Param 类型 (非 body 参数 openapi 默认没有生成对象) |
| 13 | + params: API.postV5ReposOwnerRepoCheckRunsParams, |
| 14 | + body: { |
| 15 | + /** 用户授权码 */ |
| 16 | + access_token?: string; |
| 17 | + /** PullRequest ID */ |
| 18 | + pull_request_id?: number; |
| 19 | + /** 详情链接 */ |
| 20 | + details_url?: string; |
| 21 | + /** 状态 */ |
| 22 | + status?: 'queued' | 'in_progress' | 'completed'; |
| 23 | + /** 开始时间 */ |
| 24 | + started_at?: string; |
| 25 | + /** 结论 */ |
| 26 | + conclusion?: |
| 27 | + | 'neutral' |
| 28 | + | 'success' |
| 29 | + | 'failure' |
| 30 | + | 'cancelled' |
| 31 | + | 'action_required' |
| 32 | + | 'timed_out' |
| 33 | + | 'skipped'; |
| 34 | + /** 完成时间 */ |
| 35 | + completed_at?: string; |
| 36 | + /** 标题 */ |
| 37 | + 'output[title]': string; |
| 38 | + /** 概论 */ |
| 39 | + 'output[summary]': string; |
| 40 | + /** 详细信息 */ |
| 41 | + 'output[text]'?: string; |
| 42 | + /** 路径 */ |
| 43 | + 'output[annotations][path]': string[]; |
| 44 | + /** 开始行 */ |
| 45 | + 'output[annotations][start_line]': number[]; |
| 46 | + /** 结束行 */ |
| 47 | + 'output[annotations][end_line]': number[]; |
| 48 | + /** 开始列 */ |
| 49 | + 'output[annotations][start_column]'?: number[]; |
| 50 | + /** 结束列 */ |
| 51 | + 'output[annotations][end_column]'?: number[]; |
| 52 | + /** 注释级别 */ |
| 53 | + 'output[annotations][annotation_level]': 'notice' | 'warning' | 'failure'; |
| 54 | + /** 注释信息 */ |
| 55 | + 'output[annotations][message]': string[]; |
| 56 | + /** 标题 */ |
| 57 | + 'output[annotations][title]'?: string[]; |
| 58 | + /** 详情内容 */ |
| 59 | + 'output[annotations][raw_details]'?: string[]; |
| 60 | + /** 注释 */ |
| 61 | + 'output[images][alt]': string[]; |
| 62 | + /** URL */ |
| 63 | + 'output[images][image_url]': string[]; |
| 64 | + /** 描述 */ |
| 65 | + 'output[images][caption]'?: string[]; |
| 66 | + /** 文本 */ |
| 67 | + 'actions[label]': string[]; |
| 68 | + /** 描述 */ |
| 69 | + 'actions[description]': string[]; |
| 70 | + /** 标识 */ |
| 71 | + 'actions[identifier]': string[]; |
| 72 | + /** 名字 */ |
| 73 | + name: string; |
| 74 | + /** 提交的 sha 值(必须是完整的) */ |
| 75 | + head_sha: string; |
| 76 | + }, |
| 77 | + options?: { [key: string]: unknown } |
| 78 | +) { |
| 79 | + const { owner: param0, repo: param1, ...queryParams } = params; |
| 80 | + return request<API.CheckRun>(`/v5/repos/${param0}/${param1}/check-runs`, { |
| 81 | + method: 'POST', |
| 82 | + headers: { |
| 83 | + 'Content-Type': 'application/x-www-form-urlencoded', |
| 84 | + }, |
| 85 | + params: { ...queryParams }, |
| 86 | + data: body, |
| 87 | + ...(options || {}), |
| 88 | + }); |
| 89 | +} |
| 90 | + |
| 91 | +/** 获取检查项详情 获取检查项详情 GET /v5/repos/${param0}/${param1}/check-runs/${param2} */ |
| 92 | +export async function getV5ReposOwnerRepoCheckRunsCheckRunId( |
| 93 | + // 叠加生成的 Param 类型 (非 body 参数 openapi 默认没有生成对象) |
| 94 | + params: API.getV5ReposOwnerRepoCheckRunsCheckRunIdParams, |
| 95 | + options?: { [key: string]: unknown } |
| 96 | +) { |
| 97 | + const { |
| 98 | + owner: param0, |
| 99 | + repo: param1, |
| 100 | + check_run_id: param2, |
| 101 | + ...queryParams |
| 102 | + } = params; |
| 103 | + return request<API.CheckRun>( |
| 104 | + `/v5/repos/${param0}/${param1}/check-runs/${param2}`, |
| 105 | + { |
| 106 | + method: 'GET', |
| 107 | + params: { |
| 108 | + ...queryParams, |
| 109 | + }, |
| 110 | + ...(options || {}), |
| 111 | + } |
| 112 | + ); |
| 113 | +} |
| 114 | + |
| 115 | +/** 更新检查项 更新检查项 PATCH /v5/repos/${param0}/${param1}/check-runs/${param2} */ |
| 116 | +export async function patchV5ReposOwnerRepoCheckRunsCheckRunId( |
| 117 | + // 叠加生成的 Param 类型 (非 body 参数 openapi 默认没有生成对象) |
| 118 | + params: API.patchV5ReposOwnerRepoCheckRunsCheckRunIdParams, |
| 119 | + body: { |
| 120 | + /** 用户授权码 */ |
| 121 | + access_token?: string; |
| 122 | + /** 关联 pull_request 的 ID */ |
| 123 | + pull_request_id?: number; |
| 124 | + /** 详情链接 */ |
| 125 | + details_url?: string; |
| 126 | + /** 状态 */ |
| 127 | + status?: 'queued' | 'in_progress' | 'completed'; |
| 128 | + /** 开始时间 */ |
| 129 | + started_at?: string; |
| 130 | + /** 结论 */ |
| 131 | + conclusion?: |
| 132 | + | 'neutral' |
| 133 | + | 'success' |
| 134 | + | 'failure' |
| 135 | + | 'cancelled' |
| 136 | + | 'action_required' |
| 137 | + | 'timed_out' |
| 138 | + | 'skipped'; |
| 139 | + /** 完成时间 */ |
| 140 | + completed_at?: string; |
| 141 | + /** 标题 */ |
| 142 | + 'output[title]': string; |
| 143 | + /** 概论 */ |
| 144 | + 'output[summary]': string; |
| 145 | + /** 详细信息 */ |
| 146 | + 'output[text]'?: string; |
| 147 | + /** 路径 */ |
| 148 | + 'output[annotations][path]': string[]; |
| 149 | + /** 开始行 */ |
| 150 | + 'output[annotations][start_line]': number[]; |
| 151 | + /** 结束行 */ |
| 152 | + 'output[annotations][end_line]': number[]; |
| 153 | + /** 开始列 */ |
| 154 | + 'output[annotations][start_column]'?: number[]; |
| 155 | + /** 结束列 */ |
| 156 | + 'output[annotations][end_column]'?: number[]; |
| 157 | + /** 注释级别 */ |
| 158 | + 'output[annotations][annotation_level]': 'notice' | 'warning' | 'failure'; |
| 159 | + /** 注释信息 */ |
| 160 | + 'output[annotations][message]': string[]; |
| 161 | + /** 标题 */ |
| 162 | + 'output[annotations][title]'?: string[]; |
| 163 | + /** 详情内容 */ |
| 164 | + 'output[annotations][raw_details]'?: string[]; |
| 165 | + /** 注释 */ |
| 166 | + 'output[images][alt]': string[]; |
| 167 | + /** URL */ |
| 168 | + 'output[images][image_url]': string[]; |
| 169 | + /** 描述 */ |
| 170 | + 'output[images][caption]'?: string[]; |
| 171 | + /** 文本 */ |
| 172 | + 'actions[label]': string[]; |
| 173 | + /** 描述 */ |
| 174 | + 'actions[description]': string[]; |
| 175 | + /** 标识 */ |
| 176 | + 'actions[identifier]': string[]; |
| 177 | + /** 名字 */ |
| 178 | + name?: string; |
| 179 | + }, |
| 180 | + options?: { [key: string]: unknown } |
| 181 | +) { |
| 182 | + const { |
| 183 | + owner: param0, |
| 184 | + repo: param1, |
| 185 | + check_run_id: param2, |
| 186 | + ...queryParams |
| 187 | + } = params; |
| 188 | + return request<API.CheckRun>( |
| 189 | + `/v5/repos/${param0}/${param1}/check-runs/${param2}`, |
| 190 | + { |
| 191 | + method: 'PATCH', |
| 192 | + headers: { |
| 193 | + 'Content-Type': 'application/x-www-form-urlencoded', |
| 194 | + }, |
| 195 | + params: { ...queryParams }, |
| 196 | + data: body, |
| 197 | + ...(options || {}), |
| 198 | + } |
| 199 | + ); |
| 200 | +} |
| 201 | + |
| 202 | +/** 获取检查项代码注释 获取检查项代码注释 GET /v5/repos/${param0}/${param1}/check-runs/${param2}/annotations */ |
| 203 | +export async function getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotations( |
| 204 | + // 叠加生成的 Param 类型 (非 body 参数 openapi 默认没有生成对象) |
| 205 | + params: API.getV5ReposOwnerRepoCheckRunsCheckRunIdAnnotationsParams, |
| 206 | + options?: { [key: string]: unknown } |
| 207 | +) { |
| 208 | + const { |
| 209 | + owner: param0, |
| 210 | + repo: param1, |
| 211 | + check_run_id: param2, |
| 212 | + ...queryParams |
| 213 | + } = params; |
| 214 | + return request<API.CheckAnnotation>( |
| 215 | + `/v5/repos/${param0}/${param1}/check-runs/${param2}/annotations`, |
| 216 | + { |
| 217 | + method: 'GET', |
| 218 | + params: { |
| 219 | + // page has a default value: 1 |
| 220 | + page: '1', |
| 221 | + // per_page has a default value: 20 |
| 222 | + per_page: '20', |
| 223 | + ...queryParams, |
| 224 | + }, |
| 225 | + ...(options || {}), |
| 226 | + } |
| 227 | + ); |
| 228 | +} |
| 229 | + |
| 230 | +/** 获取某个提交的检查项 获取某个提交的检查项 GET /v5/repos/${param0}/${param1}/commits/${param2}/check-runs */ |
| 231 | +export async function getV5ReposOwnerRepoCommitsRefCheckRuns( |
| 232 | + // 叠加生成的 Param 类型 (非 body 参数 openapi 默认没有生成对象) |
| 233 | + params: API.getV5ReposOwnerRepoCommitsRefCheckRunsParams, |
| 234 | + options?: { [key: string]: unknown } |
| 235 | +) { |
| 236 | + const { owner: param0, repo: param1, ref: param2, ...queryParams } = params; |
| 237 | + return request<API.CheckRun>( |
| 238 | + `/v5/repos/${param0}/${param1}/commits/${param2}/check-runs`, |
| 239 | + { |
| 240 | + method: 'GET', |
| 241 | + params: { |
| 242 | + // page has a default value: 1 |
| 243 | + page: '1', |
| 244 | + // per_page has a default value: 20 |
| 245 | + per_page: '20', |
| 246 | + |
| 247 | + // filter has a default value: latest |
| 248 | + filter: 'latest', |
| 249 | + ...queryParams, |
| 250 | + }, |
| 251 | + ...(options || {}), |
| 252 | + } |
| 253 | + ); |
| 254 | +} |
0 commit comments