node-cnb 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/client.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import {
2
+ DtoCreateGroupReq,
2
3
  DtoUsersResultForSelf,
4
+ HttpUpdateUserInfoPayload,
3
5
  DtoOrganizationAccess,
4
6
  DtoRepos4User,
5
7
  DtoRepos4UserBase,
@@ -7,42 +9,72 @@ import {
7
9
  DtoUserFollowResult,
8
10
  DtoOrganizationUnion,
9
11
  DtoWorkspaceDeleteResult,
12
+ DtoWorkspaceDeleteReq,
10
13
  DtoWorkspaceListResult,
14
+ DtoUpdateGroupAvatarReq,
11
15
  DtoListInheritMembers,
12
16
  DtoUsersWithAccessLevelInSlug,
13
17
  DtoMemberAccessLevelInSlugUnion,
14
18
  DtoMemberAccessLevel,
19
+ DtoUpdateMembersRequest,
20
+ DtoCreateRepoReq,
15
21
  DtoOrganizationSettingWithParent,
22
+ DtoGroupSettingReq,
16
23
  DtoUploadAssetsResponse,
24
+ DtoUploadRequestParams,
17
25
  DtoBuildLogsResult,
18
26
  DtoBuildResult,
27
+ DtoStartBuildReq,
19
28
  DtoBuildStatusResult,
20
29
  DtoForks,
30
+ DtoForkReq,
21
31
  ApiBranch,
32
+ OpenapiCreateBranchForm,
22
33
  ApiBranchDetail,
23
34
  WebCommitAnnotationInBatch,
35
+ WebGetCommitAnnotationsInBatchForm,
24
36
  WebCommitAnnotation,
37
+ OpenapiPutCommitAnnotationsForm,
25
38
  ApiCommitAsset,
39
+ OpenapiPostCommitAssetUploadUrlForm,
26
40
  ApiCommitStatus,
27
41
  ApiCommit,
28
42
  ApiCompareResponse,
29
43
  ApiContent,
30
44
  OpenapiHeadRef,
31
45
  WebTagAnnotation,
46
+ OpenapiPutTagAnnotationsForm,
32
47
  ApiTag,
33
48
  ApiIssue,
49
+ ApiPostIssueForm,
34
50
  ApiIssueDetail,
51
+ ApiPatchIssueForm,
35
52
  ApiIssueComment,
53
+ ApiPostIssueCommentForm,
54
+ ApiPatchIssueCommentForm,
36
55
  ApiLabel,
56
+ ApiPostLabelForm,
57
+ ApiPatchLabelForm,
37
58
  DtoOutsideCollaboratorInRepo,
38
59
  ApiPullRequest,
60
+ ApiPullCreationForm,
39
61
  ApiPull,
62
+ ApiPatchPullRequest,
40
63
  ApiPullRequestComment,
64
+ ApiPullCommentCreationForm,
65
+ ApiPostPullLabelsForm,
66
+ ApiPutPullLabelsForm,
41
67
  ApiMergePullResponse,
68
+ ApiMergePullRequest,
69
+ ApiPullReviewCreationForm,
42
70
  ApiRelease,
71
+ OpenapiPostReleaseForm,
72
+ OpenapiPatchReleaseForm,
73
+ OpenapiPostReleaseAssetUploadUrlForm,
43
74
  ApiReleaseAsset,
44
75
  ApiBranchProtection,
45
76
  ApiPipelineSettings,
77
+ WebPipelineSettings,
46
78
  ApiPullRequestSettings,
47
79
  ApiPushLimitSettings,
48
80
  DtoRepoStarUsers,
@@ -51,32 +83,80 @@ import {
51
83
 
52
84
  export interface Client {
53
85
  groups: {
54
- post: (params: { request: any }) => Promise<any>;
86
+ /***
87
+ * 创建新组织
88
+ *
89
+ * 访问令牌调用此接口需包含以下权限
90
+ * group-manage:rw
91
+ *
92
+ * /groups
93
+ */
94
+ post: (params: { request: DtoCreateGroupReq }) => Promise<any>;
55
95
  };
56
96
 
57
97
  user: {
98
+ /***
99
+ * 获取指定用户的详情信息
100
+ *
101
+ * 访问令牌调用此接口需包含以下权限
102
+ * account-profile:r
103
+ *
104
+ * /user
105
+ */
58
106
  get: (params: {}) => Promise<DtoUsersResultForSelf>;
59
107
 
60
- post: (params: { request: any }) => Promise<any>;
108
+ /***
109
+ * 更新指定用户的详情信息, 可更新内容为: 昵称, 个人签名, 微信公众号名称, 微信公众号二维码链接, 个人网站, 个人地址, 公司名称
110
+ *
111
+ * 访问令牌调用此接口需包含以下权限
112
+ * account-profile:rw
113
+ *
114
+ * /user
115
+ */
116
+ post: (params: { request: HttpUpdateUserInfoPayload }) => Promise<any>;
61
117
 
62
118
  autocompleteSource: {
119
+ /***
120
+ * 查询当前用户用户拥有指定权限的所有资源列表
121
+ *
122
+ * 访问令牌调用此接口需包含以下权限
123
+ * account-engage:r
124
+ *
125
+ * /user/autocomplete_source
126
+ */
63
127
  list: (params: {
64
- source_type?: string;
128
+ source_type?: "Group" | "Repo";
65
129
  page?: number;
66
130
  page_size?: number;
67
131
  search?: string;
68
- access?: string;
132
+ access?: "Reporter" | "Developer" | "Master" | "Owner";
69
133
  }) => Promise<string[]>;
70
134
  };
71
135
 
72
136
  groups: {
137
+ /***
138
+ * 获取当前用户拥有权限的顶层组织列表
139
+ *
140
+ * 访问令牌调用此接口需包含以下权限
141
+ * account-engage:r
142
+ *
143
+ * /user/groups
144
+ */
73
145
  list: (params: {
74
146
  page?: number;
75
147
  page_size?: number;
76
148
  search?: string;
77
- role?: string;
149
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
78
150
  }) => Promise<DtoOrganizationAccess[]>;
79
151
 
152
+ /***
153
+ * 查询当前用户在指定组织下拥有指定权限的子组织列表
154
+ *
155
+ * 访问令牌调用此接口需包含以下权限
156
+ * account-engage:r
157
+ *
158
+ * /user/groups/{group}
159
+ */
80
160
  listByGroup: (params: {
81
161
  group: string;
82
162
  page?: number;
@@ -86,36 +166,76 @@ export interface Client {
86
166
  };
87
167
 
88
168
  repos: {
169
+ /***
170
+ * 获取当前用户拥有指定权限及其以上权限的仓库
171
+ *
172
+ * 访问令牌调用此接口需包含以下权限
173
+ * account-engage:r
174
+ *
175
+ * /user/repos
176
+ */
89
177
  list: (params: {
90
178
  page?: number;
91
179
  page_size?: number;
92
180
  search?: string;
93
- filter_type?: string;
94
- role?: string;
95
- order_by?: string;
181
+ filter_type?: "private" | "public" | "encrypted";
182
+ role?: "Reporter" | "Developer" | "Master" | "Owner";
183
+ order_by?: "created_at" | "last_updated_at" | "stars";
96
184
  desc?: boolean;
97
185
  }) => Promise<DtoRepos4User[]>;
98
186
  };
99
187
 
100
188
  staredRepos: {
189
+ /***
190
+ * 获取当前用户 star 的仓库列表
191
+ *
192
+ * 访问令牌调用此接口需包含以下权限
193
+ * account-engage:r
194
+ *
195
+ * /user/stared-repos
196
+ */
101
197
  list: (params: {
102
198
  page?: number;
103
199
  page_size?: number;
104
200
  search?: string;
105
201
  desc?: boolean;
106
- order_by?: string;
202
+ order_by?: "created_at" | "last_updated_at" | "stars";
107
203
  }) => Promise<DtoRepos4UserBase[]>;
108
204
  };
109
205
  };
110
206
 
111
207
  users: {
208
+ /***
209
+ * 获取指定用户的详情信息
210
+ *
211
+ * 访问令牌调用此接口需包含以下权限
212
+ * account-profile:r
213
+ *
214
+ * /users/{username}
215
+ */
112
216
  get: (params: { username: string }) => Promise<DtoUsersResult>;
113
217
 
114
218
  avatar: {
219
+ /***
220
+ * 获取指定用户的用户头像
221
+ *
222
+ * 访问令牌调用此接口需包含以下权限
223
+ * account-profile:r
224
+ *
225
+ * /users/{username}/avatar/{size}
226
+ */
115
227
  get: (params: { username: string; size: string }) => Promise<any>;
116
228
  };
117
229
 
118
230
  followers: {
231
+ /***
232
+ * 获取指定用户的粉丝列表
233
+ *
234
+ * 访问令牌调用此接口需包含以下权限
235
+ * account-engage:r
236
+ *
237
+ * /users/{username}/followers
238
+ */
119
239
  list: (params: {
120
240
  username: string;
121
241
  page?: number;
@@ -124,6 +244,14 @@ export interface Client {
124
244
  };
125
245
 
126
246
  following: {
247
+ /***
248
+ * 获取指定用户的关注人列表
249
+ *
250
+ * 访问令牌调用此接口需包含以下权限
251
+ * account-engage:r
252
+ *
253
+ * /users/{username}/following
254
+ */
127
255
  list: (params: {
128
256
  username: string;
129
257
  page?: number;
@@ -132,50 +260,100 @@ export interface Client {
132
260
  };
133
261
 
134
262
  groups: {
263
+ /***
264
+ * 获取指定用户拥有权限的顶层组织列表
265
+ *
266
+ * 访问令牌调用此接口需包含以下权限
267
+ * account-engage:r
268
+ *
269
+ * /users/{username}/groups
270
+ */
135
271
  get: (params: {
136
272
  username: string;
137
273
  search?: string;
138
274
  page?: number;
139
275
  page_size?: number;
140
276
  desc?: boolean;
141
- order_by?: string;
277
+ order_by?: "join_time" | "created_at";
142
278
  }) => Promise<DtoOrganizationUnion>;
143
279
  };
144
280
 
145
281
  pinnedRepos: {
282
+ /***
283
+ * 获取指定用户的用户仓库墙
284
+ *
285
+ * 访问令牌调用此接口需包含以下权限
286
+ * account-engage:r
287
+ *
288
+ * /users/{username}/pinned-repos
289
+ */
146
290
  list: (params: { username: string }) => Promise<DtoRepos4User[]>;
147
291
  };
148
292
 
149
293
  repos: {
294
+ /***
295
+ * 获取指定用户有指定以上权限并且客人态可见的仓库
296
+ *
297
+ * 访问令牌调用此接口需包含以下权限
298
+ * account-engage:r
299
+ *
300
+ * /users/{username}/repos
301
+ */
150
302
  list: (params: {
151
303
  username: string;
152
304
  search?: string;
153
- role?: string;
305
+ role?: "Reporter" | "Developer" | "Master" | "Owner";
154
306
  page?: number;
155
307
  page_size?: number;
156
308
  desc?: boolean;
157
- order_by?: string;
309
+ order_by?: "created_at" | "last_updated_at" | "stars";
158
310
  }) => Promise<DtoRepos4User[]>;
159
311
  };
160
312
 
161
313
  staredRepos: {
314
+ /***
315
+ * 获取指定用户的 star 仓库列表
316
+ *
317
+ * 访问令牌调用此接口需包含以下权限
318
+ * account-engage:r
319
+ *
320
+ * /users/{username}/stared-repos
321
+ */
162
322
  list: (params: {
163
323
  username: string;
164
324
  search?: string;
165
325
  page?: number;
166
326
  page_size?: number;
167
327
  desc?: boolean;
168
- order_by?: string;
328
+ order_by?: "created_at" | "last_updated_at" | "stars";
169
329
  }) => Promise<DtoRepos4User[]>;
170
330
  };
171
331
  };
172
332
 
173
333
  workspace: {
174
334
  delete: {
175
- post: (params: { request: any }) => Promise<DtoWorkspaceDeleteResult>;
335
+ /***
336
+ * 删除我的云原生开发环境
337
+ *
338
+ * 访问令牌调用此接口需包含以下权限
339
+ * account-engage:rw
340
+ *
341
+ * /workspace/delete
342
+ */
343
+ post: (params: {
344
+ request: DtoWorkspaceDeleteReq;
345
+ }) => Promise<DtoWorkspaceDeleteResult>;
176
346
  };
177
347
 
178
348
  list: {
349
+ /***
350
+ * 获取我的云原生开发环境列表
351
+ *
352
+ * 访问令牌调用此接口需包含以下权限
353
+ * account-engage:r
354
+ *
355
+ * /workspace/list
356
+ */
179
357
  get: (params: {
180
358
  branch?: string;
181
359
  end?: string;
@@ -189,104 +367,257 @@ export interface Client {
189
367
  };
190
368
 
191
369
  group: {
370
+ /***
371
+ * 获取指定组织信息
372
+ *
373
+ * 访问令牌调用此接口需包含以下权限
374
+ * group-resource:r
375
+ *
376
+ * /{group}
377
+ */
192
378
  get: (params: { group: string }) => Promise<DtoOrganizationAccess>;
193
379
 
194
380
  avatar: {
195
- put: (params: { group: string; request: any }) => Promise<any>;
381
+ /***
382
+ * 更新组织头像 URL 地址
383
+ *
384
+ * 访问令牌调用此接口需包含以下权限
385
+ * group-manage:rw
386
+ *
387
+ * /{group}/-/avatar
388
+ */
389
+ put: (params: {
390
+ group: string;
391
+ request: DtoUpdateGroupAvatarReq;
392
+ }) => Promise<any>;
196
393
  };
197
394
 
198
395
  inheritMembers: {
396
+ /***
397
+ * 获取指定组织或仓库内的继承成员
398
+ *
399
+ * 访问令牌调用此接口需包含以下权限
400
+ * group-manage:r
401
+ *
402
+ * /{group}/-/inherit-members
403
+ */
199
404
  list: (params: {
200
405
  group: string;
201
406
  search?: string;
202
- role?: string;
407
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
203
408
  page?: number;
204
409
  page_size?: number;
205
410
  }) => Promise<DtoListInheritMembers[]>;
206
411
  };
207
412
 
208
413
  listMembers: {
414
+ /***
415
+ * 获取指定组织或仓库内的有效成员列表,包含继承成员
416
+ *
417
+ * 访问令牌调用此接口需包含以下权限
418
+ * group-manage:r
419
+ *
420
+ * /{group}/-/list-members
421
+ */
209
422
  list: (params: {
210
423
  group: string;
211
424
  page?: number;
212
425
  page_size?: number;
213
- role?: string;
426
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
214
427
  search?: string;
215
428
  names?: string;
216
- order_by?: string;
429
+ order_by?: "created_at" | "stars" | "follower";
217
430
  desc?: boolean;
218
431
  }) => Promise<DtoUsersWithAccessLevelInSlug[]>;
219
432
  };
220
433
 
221
434
  logos: {
435
+ /***
436
+ * 确认上传的logo
437
+ *
438
+ * 访问令牌调用此接口需包含以下权限
439
+ * group-manage:rw
440
+ *
441
+ * /{group}/-/logos
442
+ */
222
443
  put: (params: { group: string; token: string }) => Promise<any>;
223
444
 
445
+ /***
446
+ * 发起一个获取 logo 的请求,返回内容或者 302 到某个地址
447
+ *
448
+ * 访问令牌调用此接口需包含以下权限
449
+ * group-resource:r
450
+ *
451
+ * /{group}/-/logos/{size}
452
+ */
224
453
  get: (params: { group: string; size?: string }) => Promise<any>;
225
454
  };
226
455
 
227
456
  members: {
457
+ /***
458
+ * 获取指定组织或仓库内的所有直接成员
459
+ *
460
+ * 访问令牌调用此接口需包含以下权限
461
+ * group-manage:r
462
+ *
463
+ * /{group}/-/members
464
+ */
228
465
  list: (params: {
229
466
  group: string;
230
467
  page?: number;
231
468
  page_size?: number;
232
- role?: string;
469
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
233
470
  search?: string;
234
471
  }) => Promise<DtoUsersWithAccessLevelInSlug[]>;
235
472
 
236
473
  accessLevel: {
474
+ /***
475
+ * 获取指定组织或仓库内, 访问成员在当前层级内的权限信息
476
+ *
477
+ * 访问令牌调用此接口需包含以下权限
478
+ * group-manage:r
479
+ *
480
+ * /{group}/-/members/access-level
481
+ */
237
482
  get: (params: {
238
483
  group: string;
239
484
  include_inherit?: boolean;
240
485
  }) => Promise<DtoMemberAccessLevelInSlugUnion>;
241
486
 
487
+ /***
488
+ * 获取指定组织或仓库内指定成员的权限信息, 结果按组织层级来展示, 包含上层组织的权限继承信息
489
+ *
490
+ * 访问令牌调用此接口需包含以下权限
491
+ * group-manage:r
492
+ *
493
+ * /{group}/-/members/{username}/access-level
494
+ */
242
495
  list: (params: {
243
496
  group: string;
244
497
  username: string;
245
498
  }) => Promise<DtoMemberAccessLevel[]>;
246
499
  };
247
500
 
501
+ /***
502
+ * 删除指定组织或仓库的直接成员, 包含两种场景: 1. 作为直接成员的用户自己退出 2. 由管理者移除指定的直接成员
503
+ *
504
+ * 访问令牌调用此接口需包含以下权限
505
+ * group-manage:rw
506
+ *
507
+ * /{group}/-/members/{username}
508
+ */
248
509
  delete: (params: { group: string; username: string }) => Promise<any>;
249
510
 
511
+ /***
512
+ * 更新指定组织或仓库内的直接成员权限信息
513
+ *
514
+ * 访问令牌调用此接口需包含以下权限
515
+ * group-manage:rw
516
+ *
517
+ * /{group}/-/members/{username}
518
+ */
250
519
  put: (params: {
251
520
  group: string;
252
521
  username: string;
253
- request: any;
522
+ request: DtoUpdateMembersRequest;
254
523
  }) => Promise<any>;
255
524
  };
256
525
 
257
526
  pinnedRepos: {
527
+ /***
528
+ * 获取指定组织的仓库墙列表
529
+ *
530
+ * 访问令牌调用此接口需包含以下权限
531
+ * group-manage:r
532
+ *
533
+ * /{group}/-/pinned-repos
534
+ */
258
535
  list: (params: { group: string }) => Promise<DtoRepos4UserBase[]>;
259
536
 
537
+ /***
538
+ * 更新指定组织仓库墙
539
+ *
540
+ * 访问令牌调用此接口需包含以下权限
541
+ * group-manage:rw
542
+ *
543
+ * /{group}/-/pinned-repos
544
+ */
260
545
  put: (params: {
261
546
  group: string;
262
- request: any;
547
+ request: string[];
263
548
  }) => Promise<DtoRepos4UserBase[]>;
264
549
  };
265
550
 
266
551
  repos: {
552
+ /***
553
+ * 查询组织下访问用户有权限查看到仓库
554
+ *
555
+ * 访问令牌调用此接口需包含以下权限
556
+ * group-resource:r
557
+ *
558
+ * /{group}/-/repos
559
+ */
267
560
  list: (params: {
268
561
  group: string;
269
562
  page?: number;
270
563
  page_size?: number;
271
- filter_type?: string;
272
- order_by?: string;
564
+ filter_type?: "private" | "public" | "encrypted";
565
+ order_by?: "created_at" | "last_updated_at" | "stars";
273
566
  desc?: boolean;
274
- descendant?: string;
567
+ descendant?: "all" | "sub" | "grand";
275
568
  search?: string;
276
569
  }) => Promise<DtoRepos4UserBase[]>;
277
570
 
278
- post: (params: { group: string; request: any }) => Promise<any>;
571
+ /***
572
+ * 创建仓库
573
+ *
574
+ * 访问令牌调用此接口需包含以下权限
575
+ * group-resource:rw
576
+ *
577
+ * /{group}/-/repos
578
+ */
579
+ post: (params: {
580
+ group: string;
581
+ request: DtoCreateRepoReq;
582
+ }) => Promise<any>;
279
583
  };
280
584
 
281
585
  settings: {
586
+ /***
587
+ * 获取指定组织的配置详情
588
+ *
589
+ * 访问令牌调用此接口需包含以下权限
590
+ * group-manage:r
591
+ *
592
+ * /{group}/-/settings
593
+ */
282
594
  get: (params: {
283
595
  group: string;
284
596
  }) => Promise<DtoOrganizationSettingWithParent>;
285
597
 
286
- put: (params: { group: string; request: any }) => Promise<any>;
598
+ /***
599
+ * 更新指定组织的配置, 可更新内容为: 是否对外隐藏组织成员
600
+ *
601
+ * 访问令牌调用此接口需包含以下权限
602
+ * group-manage:rw
603
+ *
604
+ * /{group}/-/settings
605
+ */
606
+ put: (params: {
607
+ group: string;
608
+ request: DtoGroupSettingReq;
609
+ }) => Promise<any>;
287
610
  };
288
611
 
289
612
  subGroups: {
613
+ /***
614
+ * 获取指定组织下的子组织列表
615
+ *
616
+ * 访问令牌调用此接口需包含以下权限
617
+ * group-resource:r
618
+ *
619
+ * /{group}/-/sub-groups
620
+ */
290
621
  list: (params: {
291
622
  group: string;
292
623
  search?: string;
@@ -297,9 +628,17 @@ export interface Client {
297
628
 
298
629
  upload: {
299
630
  logos: {
631
+ /***
632
+ * 发起一个上传 logo 的请求,返回上传 cos 的 url 和 form 内容
633
+ *
634
+ * 访问令牌调用此接口需包含以下权限
635
+ * group-manage:rw
636
+ *
637
+ * /{group}/-/upload/logos
638
+ */
300
639
  post: (params: {
301
640
  group: string;
302
- request: any;
641
+ request: DtoUploadRequestParams;
303
642
  }) => Promise<DtoUploadAssetsResponse>;
304
643
  };
305
644
  };
@@ -309,9 +648,17 @@ export interface Client {
309
648
  packages: {
310
649
  name: {
311
650
  tag: {
651
+ /***
652
+ * Delete the specific tag
653
+ *
654
+ * 访问令牌调用此接口需包含以下权限
655
+ * repo-registry-delete:rw
656
+ *
657
+ * /{registry}/-/packages/{type}/{name}/-/tag/{tag}
658
+ */
312
659
  delete: (params: {
313
660
  registry: string;
314
- type: string;
661
+ type: "docker" | "helm";
315
662
  name: string;
316
663
  tag: string;
317
664
  }) => Promise<any>;
@@ -321,10 +668,26 @@ export interface Client {
321
668
  };
322
669
 
323
670
  repo: {
671
+ /***
672
+ * 获取指定仓库信息
673
+ *
674
+ * 访问令牌调用此接口需包含以下权限
675
+ * repo-basic-info:r
676
+ *
677
+ * /{repo}
678
+ */
324
679
  get: (params: { repo: string }) => Promise<DtoRepos4User>;
325
680
 
326
681
  build: {
327
682
  logs: {
683
+ /***
684
+ * 查询流水线构建列表
685
+ *
686
+ * 访问令牌调用此接口需包含以下权限
687
+ * repo-cnb-trigger:r
688
+ *
689
+ * /{repo}/-/build/logs
690
+ */
328
691
  get: (params: {
329
692
  repo: string;
330
693
  createTime?: string;
@@ -343,13 +706,29 @@ export interface Client {
343
706
  };
344
707
 
345
708
  start: {
709
+ /***
710
+ * 开始一个构建
711
+ *
712
+ * 访问令牌调用此接口需包含以下权限
713
+ * repo-cnb-trigger:rw
714
+ *
715
+ * /{repo}/-/build/start
716
+ */
346
717
  post: (params: {
347
718
  repo: string;
348
- request: any;
719
+ request: DtoStartBuildReq;
349
720
  }) => Promise<DtoBuildResult[]>;
350
721
  };
351
722
 
352
723
  status: {
724
+ /***
725
+ * 查询流水线构建状态
726
+ *
727
+ * 访问令牌调用此接口需包含以下权限
728
+ * repo-cnb-trigger:r
729
+ *
730
+ * /{repo}/-/build/status/{sn}
731
+ */
353
732
  get: (params: {
354
733
  repo: string;
355
734
  sn: string;
@@ -357,6 +736,14 @@ export interface Client {
357
736
  };
358
737
 
359
738
  stop: {
739
+ /***
740
+ * 停止一个构建
741
+ *
742
+ * 访问令牌调用此接口需包含以下权限
743
+ * repo-cnb-trigger:rw
744
+ *
745
+ * /{repo}/-/build/stop/{sn}
746
+ */
360
747
  post: (params: {
361
748
  repo: string;
362
749
  sn: string;
@@ -366,11 +753,27 @@ export interface Client {
366
753
 
367
754
  commitAssets: {
368
755
  download: {
756
+ /***
757
+ * 发起一个获取 commits 附件的请求,返回内容或者 302 到某个地址
758
+ *
759
+ * 访问令牌调用此接口需包含以下权限
760
+ * repo-contents:r
761
+ *
762
+ * /{repo}/-/commit-assets/download/{fileName}
763
+ */
369
764
  get: (params: { repo: string; fileName: string }) => Promise<any>;
370
765
  };
371
766
  };
372
767
 
373
768
  files: {
769
+ /***
770
+ * 发起一个获取 files 的请求,返回内容或者 302 到某个地址
771
+ *
772
+ * 访问令牌调用此接口需包含以下权限
773
+ * repo-contents:r
774
+ *
775
+ * /{repo}/-/files/{userIdKey}/{randomUUID}/{fileName}
776
+ */
374
777
  get: (params: {
375
778
  repo: string;
376
779
  userIdKey: string;
@@ -378,6 +781,14 @@ export interface Client {
378
781
  fileName: string;
379
782
  }) => Promise<any>;
380
783
 
784
+ /***
785
+ * 发起一个确认 files 的请求,上传的图片要调用此接口才能生效
786
+ *
787
+ * 访问令牌调用此接口需包含以下权限
788
+ * repo-contents:rw
789
+ *
790
+ * /{repo}/-/files/{userIdKey}/{randomUUID}/{fileName}
791
+ */
381
792
  put: (params: {
382
793
  repo: string;
383
794
  userIdKey: string;
@@ -388,30 +799,78 @@ export interface Client {
388
799
  };
389
800
 
390
801
  forks: {
802
+ /***
803
+ * 获取指定仓库的 fork 列表
804
+ *
805
+ * 访问令牌调用此接口需包含以下权限
806
+ * repo-base-info:r
807
+ *
808
+ * /{repo}/-/forks
809
+ */
391
810
  list: (params: {
392
811
  repo: string;
393
812
  page: number;
394
813
  page_size: number;
395
814
  }) => Promise<DtoForks[]>;
396
815
 
397
- post: (params: { repo: string; request: any }) => Promise<any>;
816
+ /***
817
+ * fork 仓库
818
+ *
819
+ * 访问令牌调用此接口需包含以下权限
820
+ * group-resource:rw
821
+ *
822
+ * /{repo}/-/forks
823
+ */
824
+ post: (params: { repo: string; request: DtoForkReq }) => Promise<any>;
398
825
  };
399
826
 
400
827
  git: {
401
828
  branches: {
829
+ /***
830
+ * 查询分支列表
831
+ *
832
+ * 访问令牌调用此接口需包含以下权限
833
+ * repo-code:r
834
+ *
835
+ * /{repo}/-/git/branches
836
+ */
402
837
  list: (params: {
403
838
  repo: string;
404
839
  page?: number;
405
840
  page_size?: number;
406
841
  }) => Promise<ApiBranch[]>;
407
842
 
843
+ /***
844
+ * 创建新分支
845
+ *
846
+ * 访问令牌调用此接口需包含以下权限
847
+ * repo-code:rw
848
+ *
849
+ * /{repo}/-/git/branches
850
+ */
408
851
  post: (params: {
409
852
  repo: string;
410
- create_branch_form: any;
853
+ create_branch_form: OpenapiCreateBranchForm;
411
854
  }) => Promise<any>;
412
855
 
856
+ /***
857
+ * 删除指定分支
858
+ *
859
+ * 访问令牌调用此接口需包含以下权限
860
+ * repo-code:rw
861
+ *
862
+ * /{repo}/-/git/branches/{branch}
863
+ */
413
864
  delete: (params: { repo: string; branch: string }) => Promise<any>;
414
865
 
866
+ /***
867
+ * 查询指定分支
868
+ *
869
+ * 访问令牌调用此接口需包含以下权限
870
+ * repo-code:r
871
+ *
872
+ * /{repo}/-/git/branches/{branch}
873
+ */
415
874
  get: (params: {
416
875
  repo: string;
417
876
  branch?: string;
@@ -419,24 +878,56 @@ export interface Client {
419
878
  };
420
879
 
421
880
  commitAnnotationsInBatch: {
881
+ /***
882
+ * 查询指定 commit 的元数据
883
+ *
884
+ * 访问令牌调用此接口需包含以下权限
885
+ * repo-code:r
886
+ *
887
+ * /{repo}/-/git/commit-annotations-in-batch
888
+ */
422
889
  post: (params: {
423
890
  repo: string;
424
- get_commit_annotations_form: any;
891
+ get_commit_annotations_form: WebGetCommitAnnotationsInBatchForm;
425
892
  }) => Promise<WebCommitAnnotationInBatch[]>;
426
893
  };
427
894
 
428
895
  commitAnnotations: {
896
+ /***
897
+ * 查询指定 commit 的元数据
898
+ *
899
+ * 访问令牌调用此接口需包含以下权限
900
+ * repo-code:r
901
+ *
902
+ * /{repo}/-/git/commit-annotations/{sha}
903
+ */
429
904
  list: (params: {
430
905
  repo: string;
431
906
  sha: string;
432
907
  }) => Promise<WebCommitAnnotation[]>;
433
908
 
909
+ /***
910
+ * 设定指定 commit 的元数据
911
+ *
912
+ * 访问令牌调用此接口需包含以下权限
913
+ * repo-code:rw
914
+ *
915
+ * /{repo}/-/git/commit-annotations/{sha}
916
+ */
434
917
  put: (params: {
435
918
  repo: string;
436
919
  sha: string;
437
- put_commit_annotations_form: any;
920
+ put_commit_annotations_form: OpenapiPutCommitAnnotationsForm;
438
921
  }) => Promise<any>;
439
922
 
923
+ /***
924
+ * 删除指定 commit 的元数据
925
+ *
926
+ * 访问令牌调用此接口需包含以下权限
927
+ * repo-code:rw
928
+ *
929
+ * /{repo}/-/git/commit-annotations/{sha}/{key}
930
+ */
440
931
  delete: (params: {
441
932
  repo: string;
442
933
  sha: string;
@@ -445,12 +936,28 @@ export interface Client {
445
936
  };
446
937
 
447
938
  commitAssets: {
939
+ /***
940
+ * 查询指定 commit 的附件
941
+ *
942
+ * 访问令牌调用此接口需包含以下权限
943
+ * repo-code:r
944
+ *
945
+ * /{repo}/-/git/commit-assets/{sha1}
946
+ */
448
947
  list: (params: {
449
948
  repo: string;
450
949
  sha1: string;
451
950
  }) => Promise<ApiCommitAsset[]>;
452
951
 
453
952
  assetUploadConfirmation: {
953
+ /***
954
+ * 确认 Commit asset 上传完成
955
+ *
956
+ * 访问令牌调用此接口需包含以下权限
957
+ * repo-code:rw
958
+ *
959
+ * /{repo}/-/git/commit-assets/{sha1}/asset-upload-confirmation/{token}/{asset_path}
960
+ */
454
961
  post: (params: {
455
962
  repo: string;
456
963
  sha1: number;
@@ -460,13 +967,29 @@ export interface Client {
460
967
  };
461
968
 
462
969
  assetUploadUrl: {
970
+ /***
971
+ * 新增一个 Commit asset
972
+ *
973
+ * 访问令牌调用此接口需包含以下权限
974
+ * repo-code:rw
975
+ *
976
+ * /{repo}/-/git/commit-assets/{sha1}/asset-upload-url
977
+ */
463
978
  post: (params: {
464
979
  repo: string;
465
980
  sha1: number;
466
- create_commit_asset_upload_url_form: any;
981
+ create_commit_asset_upload_url_form: OpenapiPostCommitAssetUploadUrlForm;
467
982
  }) => Promise<any>;
468
983
  };
469
984
 
985
+ /***
986
+ * 删除指定 commit 的附件
987
+ *
988
+ * 访问令牌调用此接口需包含以下权限
989
+ * repo-code:rw
990
+ *
991
+ * /{repo}/-/git/commit-assets/{sha1}/{asset_id}
992
+ */
470
993
  delete: (params: {
471
994
  repo: string;
472
995
  sha1: string;
@@ -475,6 +998,14 @@ export interface Client {
475
998
  };
476
999
 
477
1000
  commitStatuses: {
1001
+ /***
1002
+ * 查询指定 commit 的 check statuses
1003
+ *
1004
+ * 访问令牌调用此接口需包含以下权限
1005
+ * repo-code:r
1006
+ *
1007
+ * /{repo}/-/git/commit-statuses/{commitish}
1008
+ */
478
1009
  list: (params: {
479
1010
  repo: string;
480
1011
  sha: string;
@@ -482,6 +1013,14 @@ export interface Client {
482
1013
  };
483
1014
 
484
1015
  commits: {
1016
+ /***
1017
+ * 查询 commit 列表
1018
+ *
1019
+ * 访问令牌调用此接口需包含以下权限
1020
+ * repo-code:r
1021
+ *
1022
+ * /{repo}/-/git/commits
1023
+ */
485
1024
  list: (params: {
486
1025
  repo: string;
487
1026
  sha?: string;
@@ -493,10 +1032,26 @@ export interface Client {
493
1032
  page_size?: number;
494
1033
  }) => Promise<ApiCommit[]>;
495
1034
 
1035
+ /***
1036
+ * 查询指定 commit
1037
+ *
1038
+ * 访问令牌调用此接口需包含以下权限
1039
+ * repo-code:r
1040
+ *
1041
+ * /{repo}/-/git/commits/{ref}
1042
+ */
496
1043
  get: (params: { repo: string; ref: string }) => Promise<ApiCommit>;
497
1044
  };
498
1045
 
499
1046
  compare: {
1047
+ /***
1048
+ * 对比 base...head
1049
+ *
1050
+ * 访问令牌调用此接口需包含以下权限
1051
+ * repo-code:r
1052
+ *
1053
+ * /{repo}/-/git/compare/{base_head}
1054
+ */
500
1055
  get: (params: {
501
1056
  repo: string;
502
1057
  base_head: string;
@@ -504,6 +1059,14 @@ export interface Client {
504
1059
  };
505
1060
 
506
1061
  contents: {
1062
+ /***
1063
+ * 查询仓库文件列表或文件
1064
+ *
1065
+ * 访问令牌调用此接口需包含以下权限
1066
+ * repo-code:r
1067
+ *
1068
+ * /{repo}/-/git/contents/{file_path}
1069
+ */
507
1070
  get: (params: {
508
1071
  repo: string;
509
1072
  file_path: string;
@@ -512,47 +1075,119 @@ export interface Client {
512
1075
  };
513
1076
 
514
1077
  head: {
1078
+ /***
1079
+ * 获取仓库默认分支
1080
+ *
1081
+ * 访问令牌调用此接口需包含以下权限
1082
+ * repo-code:r
1083
+ *
1084
+ * /{repo}/-/git/head
1085
+ */
515
1086
  get: (params: { repo: string }) => Promise<OpenapiHeadRef>;
516
1087
  };
517
1088
 
518
1089
  tagAnnotations: {
1090
+ /***
1091
+ * 删除指定 tag 的元数据
1092
+ *
1093
+ * 访问令牌调用此接口需包含以下权限
1094
+ * repo-code:rw
1095
+ *
1096
+ * /{repo}/-/git/tag-annotations/{tag_with_key}
1097
+ */
519
1098
  delete: (params: {
520
1099
  repo: string;
521
1100
  tag_with_key: string;
522
1101
  }) => Promise<any>;
523
1102
 
1103
+ /***
1104
+ * 查询指定 tag 的元数据
1105
+ *
1106
+ * 访问令牌调用此接口需包含以下权限
1107
+ * repo-code:r
1108
+ *
1109
+ * /{repo}/-/git/tag-annotations/{tag}
1110
+ */
524
1111
  list: (params: {
525
1112
  repo: string;
526
1113
  tag: string;
527
1114
  }) => Promise<WebTagAnnotation[]>;
528
1115
 
1116
+ /***
1117
+ * 设定指定 tag 的元数据
1118
+ *
1119
+ * 访问令牌调用此接口需包含以下权限
1120
+ * repo-code:rw
1121
+ *
1122
+ * /{repo}/-/git/tag-annotations/{tag}
1123
+ */
529
1124
  put: (params: {
530
1125
  repo: string;
531
1126
  tag: string;
532
- put_tag_annotations_form: any;
1127
+ put_tag_annotations_form: OpenapiPutTagAnnotationsForm;
533
1128
  }) => Promise<any>;
534
1129
  };
535
1130
 
536
1131
  tags: {
1132
+ /***
1133
+ * 查询标签列表
1134
+ *
1135
+ * 访问令牌调用此接口需包含以下权限
1136
+ * repo-code:r
1137
+ *
1138
+ * /{repo}/-/git/tags
1139
+ */
537
1140
  list: (params: {
538
1141
  repo: string;
539
1142
  page?: number;
540
1143
  page_size?: number;
541
1144
  }) => Promise<ApiTag[]>;
542
1145
 
1146
+ /***
1147
+ * 删除指定标签
1148
+ *
1149
+ * 访问令牌调用此接口需包含以下权限
1150
+ * repo-code:rw
1151
+ *
1152
+ * /{repo}/-/git/tags/{tag}
1153
+ */
543
1154
  delete: (params: { repo: string; tag: string }) => Promise<any>;
544
1155
 
1156
+ /***
1157
+ * 查询指定 Tag
1158
+ *
1159
+ * 访问令牌调用此接口需包含以下权限
1160
+ * repo-code:r
1161
+ *
1162
+ * /{repo}/-/git/tags/{tag}
1163
+ */
545
1164
  get: (params: { repo: string; tag: string }) => Promise<ApiTag>;
546
1165
  };
547
1166
  };
548
1167
 
549
1168
  imgs: {
1169
+ /***
1170
+ * 发起一个获取 imgs 的请求,返回内容或者 302 到某个地址
1171
+ *
1172
+ * 访问令牌调用此接口需包含以下权限
1173
+ * repo-contents:r
1174
+ *
1175
+ * /{repo}/-/imgs/{userIdKey}/{fileName}
1176
+ */
550
1177
  get: (params: {
551
1178
  repo: string;
552
1179
  userIdKey: string;
553
1180
  fileName: string;
554
1181
  }) => Promise<any>;
555
1182
 
1183
+ /***
1184
+ * 发起一个确认 imgs 的请求,上传的图片要调用此接口才能生效
1185
+ *
1186
+ * 访问令牌调用此接口需包含以下权限
1187
+ * repo-contents:rw
1188
+ *
1189
+ * /{repo}/-/imgs/{userIdKey}/{fileName}
1190
+ */
556
1191
  put: (params: {
557
1192
  repo: string;
558
1193
  userIdKey: string;
@@ -562,16 +1197,32 @@ export interface Client {
562
1197
  };
563
1198
 
564
1199
  inheritMembers: {
1200
+ /***
1201
+ * 获取指定组织或仓库内的继承成员
1202
+ *
1203
+ * 访问令牌调用此接口需包含以下权限
1204
+ * repo-manage:r
1205
+ *
1206
+ * /{repo}/-/inherit-members
1207
+ */
565
1208
  list: (params: {
566
1209
  repo: string;
567
1210
  search?: string;
568
- role?: string;
1211
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
569
1212
  page?: number;
570
1213
  page_size?: number;
571
1214
  }) => Promise<DtoListInheritMembers[]>;
572
1215
  };
573
1216
 
574
1217
  issues: {
1218
+ /***
1219
+ * 查询仓库的 Issues
1220
+ *
1221
+ * 访问令牌调用此接口需包含以下权限
1222
+ * repo-notes:r
1223
+ *
1224
+ * /{repo}/-/issues
1225
+ */
575
1226
  list: (params: {
576
1227
  repo: string;
577
1228
  page?: number;
@@ -587,15 +1238,42 @@ export interface Client {
587
1238
  order_by?: string;
588
1239
  }) => Promise<ApiIssue[]>;
589
1240
 
590
- post: (params: { repo: string; post_issue_form: any }) => Promise<any>;
1241
+ /***
1242
+ * 创建一个 Issue
1243
+ *
1244
+ * 访问令牌调用此接口需包含以下权限
1245
+ * repo-notes:rw
1246
+ *
1247
+ * /{repo}/-/issues
1248
+ */
1249
+ post: (params: {
1250
+ repo: string;
1251
+ post_issue_form: ApiPostIssueForm;
1252
+ }) => Promise<any>;
591
1253
 
1254
+ /***
1255
+ * 更新一个 Issue
1256
+ *
1257
+ * 访问令牌调用此接口需包含以下权限
1258
+ * repo-notes:rw
1259
+ *
1260
+ * /{repo}/-/issues/{number}
1261
+ */
592
1262
  patch: (params: {
593
1263
  repo: string;
594
1264
  number: number;
595
- patch_issue_form: any;
1265
+ patch_issue_form: ApiPatchIssueForm;
596
1266
  }) => Promise<ApiIssueDetail>;
597
1267
 
598
1268
  comments: {
1269
+ /***
1270
+ * 查询仓库的 Issue 评论列表
1271
+ *
1272
+ * 访问令牌调用此接口需包含以下权限
1273
+ * repo-notes:r
1274
+ *
1275
+ * /{repo}/-/issues/{number}/comments
1276
+ */
599
1277
  list: (params: {
600
1278
  repo: string;
601
1279
  number: number;
@@ -603,29 +1281,69 @@ export interface Client {
603
1281
  page_size?: number;
604
1282
  }) => Promise<ApiIssueComment[]>;
605
1283
 
1284
+ /***
1285
+ * 创建一个 Issue Comment
1286
+ *
1287
+ * 访问令牌调用此接口需包含以下权限
1288
+ * repo-notes:rw
1289
+ *
1290
+ * /{repo}/-/issues/{number}/comments
1291
+ */
606
1292
  post: (params: {
607
1293
  repo: string;
608
1294
  number: number;
609
- post_issue_comment_form: any;
1295
+ post_issue_comment_form: ApiPostIssueCommentForm;
610
1296
  }) => Promise<any>;
611
1297
 
1298
+ /***
1299
+ * 获取一个 Issue Comment
1300
+ *
1301
+ * 访问令牌调用此接口需包含以下权限
1302
+ * repo-notes:r
1303
+ *
1304
+ * /{repo}/-/issues/{number}/comments/{comment_id}
1305
+ */
612
1306
  get: (params: {
613
1307
  repo: string;
614
1308
  number: number;
615
1309
  comment_id: number;
616
1310
  }) => Promise<ApiIssueComment>;
617
1311
 
1312
+ /***
1313
+ * 修改一个 Issue Comment
1314
+ *
1315
+ * 访问令牌调用此接口需包含以下权限
1316
+ * repo-notes:rw
1317
+ *
1318
+ * /{repo}/-/issues/{number}/comments/{comment_id}
1319
+ */
618
1320
  patch: (params: {
619
1321
  repo: string;
620
1322
  number: number;
621
1323
  comment_id: number;
622
- patch_issue_comment_form: any;
1324
+ patch_issue_comment_form: ApiPatchIssueCommentForm;
623
1325
  }) => Promise<ApiIssueComment>;
624
1326
  };
625
1327
 
626
1328
  labels: {
1329
+ /***
1330
+ * 清空 Issue 标签
1331
+ *
1332
+ * 访问令牌调用此接口需包含以下权限
1333
+ * repo-notes:rw
1334
+ *
1335
+ * /{repo}/-/issues/{number}/labels
1336
+ */
627
1337
  delete: (params: { repo: string; number: number }) => Promise<any>;
628
1338
 
1339
+ /***
1340
+ * 删除 Issue 标签
1341
+ *
1342
+ * 访问令牌调用此接口需包含以下权限
1343
+ * repo-notes:rw
1344
+ *
1345
+ * /{repo}/-/issues/{number}/labels/{name}
1346
+ */
629
1347
  deleteByName: (params: {
630
1348
  repo: string;
631
1349
  number: number;
@@ -635,6 +1353,14 @@ export interface Client {
635
1353
  };
636
1354
 
637
1355
  labels: {
1356
+ /***
1357
+ * 查询仓库的标签(label) 列表
1358
+ *
1359
+ * 访问令牌调用此接口需包含以下权限
1360
+ * repo-notes:r
1361
+ *
1362
+ * /{repo}/-/labels
1363
+ */
638
1364
  list: (params: {
639
1365
  repo: string;
640
1366
  page?: number;
@@ -642,79 +1368,186 @@ export interface Client {
642
1368
  keyword?: string;
643
1369
  }) => Promise<ApiLabel[]>;
644
1370
 
645
- post: (params: { repo: string; post_label_form: any }) => Promise<any>;
1371
+ /***
1372
+ * 创建一个 标签
1373
+ *
1374
+ * 访问令牌调用此接口需包含以下权限
1375
+ * repo-notes:rw
1376
+ *
1377
+ * /{repo}/-/labels
1378
+ */
1379
+ post: (params: {
1380
+ repo: string;
1381
+ post_label_form: ApiPostLabelForm;
1382
+ }) => Promise<any>;
646
1383
 
1384
+ /***
1385
+ * 删除指定的仓库标签 label
1386
+ *
1387
+ * 访问令牌调用此接口需包含以下权限
1388
+ * repo-notes:rw
1389
+ *
1390
+ * /{repo}/-/labels/{name}
1391
+ */
647
1392
  delete: (params: { repo: string; name: string }) => Promise<any>;
648
1393
 
1394
+ /***
1395
+ * 更新标签信息
1396
+ *
1397
+ * 访问令牌调用此接口需包含以下权限
1398
+ * repo-notes:rw
1399
+ *
1400
+ * /{repo}/-/labels/{name}
1401
+ */
649
1402
  patch: (params: {
650
1403
  repo: string;
651
1404
  name: string;
652
- patch_label_form: any;
1405
+ patch_label_form: ApiPatchLabelForm;
653
1406
  }) => Promise<ApiLabel>;
654
1407
  };
655
1408
 
656
1409
  listMembers: {
1410
+ /***
1411
+ * 获取指定组织或仓库内的有效成员列表,包含继承成员
1412
+ *
1413
+ * 访问令牌调用此接口需包含以下权限
1414
+ * repo-manage:r
1415
+ *
1416
+ * /{repo}/-/list-members
1417
+ */
657
1418
  list: (params: {
658
1419
  repo: string;
659
1420
  page?: number;
660
1421
  page_size?: number;
661
- role?: string;
1422
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
662
1423
  search?: string;
663
1424
  names?: string;
664
- order_by?: string;
1425
+ order_by?: "created_at" | "stars" | "follower";
665
1426
  desc?: boolean;
666
1427
  }) => Promise<DtoUsersWithAccessLevelInSlug[]>;
667
1428
  };
668
1429
 
669
1430
  members: {
1431
+ /***
1432
+ * 获取指定组织或仓库内的所有直接成员
1433
+ *
1434
+ * 访问令牌调用此接口需包含以下权限
1435
+ * repo-manage:r
1436
+ *
1437
+ * /{repo}/-/members
1438
+ */
670
1439
  list: (params: {
671
1440
  repo: string;
672
1441
  page?: number;
673
1442
  page_size?: number;
674
- role?: string;
1443
+ role?: "Guest" | "Reporter" | "Developer" | "Master" | "Owner";
675
1444
  search?: string;
676
1445
  }) => Promise<DtoUsersWithAccessLevelInSlug[]>;
677
1446
 
678
1447
  accessLevel: {
1448
+ /***
1449
+ * 获取指定组织或仓库内, 访问成员在当前层级内的权限信息
1450
+ *
1451
+ * 访问令牌调用此接口需包含以下权限
1452
+ * repo-manage:r
1453
+ *
1454
+ * /{repo}/-/members/access-level
1455
+ */
679
1456
  get: (params: {
680
1457
  repo: string;
681
1458
  include_inherit?: boolean;
682
1459
  }) => Promise<DtoMemberAccessLevelInSlugUnion>;
683
1460
 
1461
+ /***
1462
+ * 获取指定组织或仓库内指定成员的权限信息, 结果按组织层级来展示, 包含上层组织的权限继承信息
1463
+ *
1464
+ * 访问令牌调用此接口需包含以下权限
1465
+ * repo-manage:r
1466
+ *
1467
+ * /{repo}/-/members/{username}/access-level
1468
+ */
684
1469
  list: (params: {
685
1470
  repo: string;
686
1471
  username: string;
687
1472
  }) => Promise<DtoMemberAccessLevel[]>;
688
1473
  };
689
1474
 
1475
+ /***
1476
+ * 删除指定组织或仓库的直接成员, 包含两种场景: 1. 作为直接成员的用户自己退出 2. 由管理者移除指定的直接成员
1477
+ *
1478
+ * 访问令牌调用此接口需包含以下权限
1479
+ * repo-manage:rw
1480
+ *
1481
+ * /{repo}/-/members/{username}
1482
+ */
690
1483
  delete: (params: { repo: string; username: string }) => Promise<any>;
691
1484
 
1485
+ /***
1486
+ * 更新指定组织或仓库内的直接成员权限信息
1487
+ *
1488
+ * 访问令牌调用此接口需包含以下权限
1489
+ * repo-manage:rw
1490
+ *
1491
+ * /{repo}/-/members/{username}
1492
+ */
692
1493
  put: (params: {
693
1494
  repo: string;
694
1495
  username: string;
695
- request: any;
1496
+ request: DtoUpdateMembersRequest;
696
1497
  }) => Promise<any>;
697
1498
  };
698
1499
 
699
1500
  outsideCollaborators: {
1501
+ /***
1502
+ * 获取指定仓库内的外部贡献者
1503
+ *
1504
+ * 访问令牌调用此接口需包含以下权限
1505
+ * repo-manage:r
1506
+ *
1507
+ * /{repo}/-/outside-collaborators
1508
+ */
700
1509
  list: (params: {
701
1510
  repo: string;
702
1511
  page?: number;
703
1512
  page_size?: number;
704
- role?: string;
1513
+ role?: "Guest" | "Reporter" | "Developer" | "Master";
705
1514
  search?: string;
706
1515
  }) => Promise<DtoOutsideCollaboratorInRepo[]>;
707
1516
 
1517
+ /***
1518
+ * 删除指定仓库的外部贡献者, 包含两种场景: 1. 作为外部贡献者的用户自己退出仓库 2. 由仓库管理者移除指定的外部贡献者
1519
+ *
1520
+ * 访问令牌调用此接口需包含以下权限
1521
+ * repo-manage:rw
1522
+ *
1523
+ * /{repo}/-/outside-collaborators/{username}
1524
+ */
708
1525
  delete: (params: { repo: string; username: string }) => Promise<any>;
709
1526
 
1527
+ /***
1528
+ * 更新指定仓库的外部贡献者权限信息
1529
+ *
1530
+ * 访问令牌调用此接口需包含以下权限
1531
+ * repo-manage:rw
1532
+ *
1533
+ * /{repo}/-/outside-collaborators/{username}
1534
+ */
710
1535
  put: (params: {
711
1536
  repo: string;
712
1537
  username: string;
713
- role: string;
1538
+ role: "Guest" | "Reporter" | "Developer";
714
1539
  }) => Promise<any>;
715
1540
  };
716
1541
 
717
1542
  pulls: {
1543
+ /***
1544
+ * [openapi] 查询 Pull 列表
1545
+ *
1546
+ * 访问令牌调用此接口需包含以下权限
1547
+ * repo-pr:r
1548
+ *
1549
+ * /{repo}/-/pulls
1550
+ */
718
1551
  list: (params: {
719
1552
  repo: string;
720
1553
  page?: number;
@@ -725,33 +1558,92 @@ export interface Client {
725
1558
  assignees?: string;
726
1559
  }) => Promise<ApiPullRequest[]>;
727
1560
 
728
- post: (params: { repo: string; post_pull_form: any }) => Promise<any>;
1561
+ /***
1562
+ * [openapi] 新增一个 Pull
1563
+ *
1564
+ * 访问令牌调用此接口需包含以下权限
1565
+ * repo-pr:rw
1566
+ *
1567
+ * /{repo}/-/pulls
1568
+ */
1569
+ post: (params: {
1570
+ repo: string;
1571
+ post_pull_form: ApiPullCreationForm;
1572
+ }) => Promise<any>;
729
1573
 
1574
+ /***
1575
+ * [openapi] 查询指定 Pull
1576
+ *
1577
+ * 访问令牌调用此接口需包含以下权限
1578
+ * repo-pr:r
1579
+ *
1580
+ * /{repo}/-/pulls/{number}
1581
+ */
730
1582
  get: (params: { repo: string; number: number }) => Promise<ApiPull>;
731
1583
 
1584
+ /***
1585
+ * [openapi] 更新一个 Pull Request
1586
+ *
1587
+ * 访问令牌调用此接口需包含以下权限
1588
+ * repo-pr:rw
1589
+ *
1590
+ * /{repo}/-/pulls/{number}
1591
+ */
732
1592
  patch: (params: {
733
1593
  repo: string;
734
1594
  number: number;
735
- update_pull_request_form: any;
1595
+ update_pull_request_form: ApiPatchPullRequest;
736
1596
  }) => Promise<ApiPull>;
737
1597
 
738
1598
  comments: {
1599
+ /***
1600
+ * [openapi] 查询 Pull Comments 列表
1601
+ *
1602
+ * 访问令牌调用此接口需包含以下权限
1603
+ * repo-notes:r
1604
+ *
1605
+ * /{repo}/-/pulls/{number}/comments
1606
+ */
739
1607
  list: (params: {
740
1608
  repo: string;
741
1609
  page?: number;
742
1610
  page_size?: number;
743
1611
  }) => Promise<ApiPullRequestComment[]>;
744
1612
 
1613
+ /***
1614
+ * [openapi] 新增一个 Pull Comment
1615
+ *
1616
+ * 访问令牌调用此接口需包含以下权限
1617
+ * repo-notes:rw
1618
+ *
1619
+ * /{repo}/-/pulls/{number}/comments
1620
+ */
745
1621
  post: (params: {
746
1622
  repo: string;
747
1623
  number: number;
748
- post_pull_comment_form: any;
1624
+ post_pull_comment_form: ApiPullCommentCreationForm;
749
1625
  }) => Promise<any>;
750
1626
  };
751
1627
 
752
1628
  labels: {
1629
+ /***
1630
+ * 清空 Pull 标签
1631
+ *
1632
+ * 访问令牌调用此接口需包含以下权限
1633
+ * repo-notes:rw
1634
+ *
1635
+ * /{repo}/-/pulls/{number}/labels
1636
+ */
753
1637
  delete: (params: { repo: string; number: number }) => Promise<any>;
754
1638
 
1639
+ /***
1640
+ * 查询 Pull 的标签(label) 列表
1641
+ *
1642
+ * 访问令牌调用此接口需包含以下权限
1643
+ * repo-notes:r
1644
+ *
1645
+ * /{repo}/-/pulls/{number}/labels
1646
+ */
755
1647
  list: (params: {
756
1648
  repo: string;
757
1649
  number: number;
@@ -759,18 +1651,42 @@ export interface Client {
759
1651
  page_size?: number;
760
1652
  }) => Promise<ApiLabel[]>;
761
1653
 
1654
+ /***
1655
+ * 新增 Pull 标签
1656
+ *
1657
+ * 访问令牌调用此接口需包含以下权限
1658
+ * repo-notes:rw
1659
+ *
1660
+ * /{repo}/-/pulls/{number}/labels
1661
+ */
762
1662
  post: (params: {
763
1663
  repo: string;
764
1664
  number: number;
765
- post_pull_labels_form: any;
1665
+ post_pull_labels_form: ApiPostPullLabelsForm;
766
1666
  }) => Promise<ApiLabel>;
767
1667
 
1668
+ /***
1669
+ * 设置 Pull 标签
1670
+ *
1671
+ * 访问令牌调用此接口需包含以下权限
1672
+ * repo-notes:rw
1673
+ *
1674
+ * /{repo}/-/pulls/{number}/labels
1675
+ */
768
1676
  put: (params: {
769
1677
  repo: string;
770
1678
  number: number;
771
- put_pull_labels_form: any;
1679
+ put_pull_labels_form: ApiPutPullLabelsForm;
772
1680
  }) => Promise<ApiLabel>;
773
1681
 
1682
+ /***
1683
+ * 删除 Pull 标签
1684
+ *
1685
+ * 访问令牌调用此接口需包含以下权限
1686
+ * repo-notes:rw
1687
+ *
1688
+ * /{repo}/-/pulls/{number}/labels/{name}
1689
+ */
774
1690
  deleteByName: (params: {
775
1691
  repo: string;
776
1692
  number: number;
@@ -779,56 +1695,136 @@ export interface Client {
779
1695
  };
780
1696
 
781
1697
  merge: {
1698
+ /***
1699
+ * [openapi] 合并一个 Pull Request
1700
+ *
1701
+ * 访问令牌调用此接口需包含以下权限
1702
+ * repo-pr:rw
1703
+ *
1704
+ * /{repo}/-/pulls/{number}/merge
1705
+ */
782
1706
  put: (params: {
783
1707
  repo: string;
784
1708
  number: number;
785
- merge_pull_request_form: any;
1709
+ merge_pull_request_form: ApiMergePullRequest;
786
1710
  }) => Promise<ApiMergePullResponse>;
787
1711
  };
788
1712
 
789
1713
  reviews: {
1714
+ /***
1715
+ * [openapi] 新增一个 Pull Review
1716
+ *
1717
+ * 访问令牌调用此接口需包含以下权限
1718
+ * repo-notes:rw
1719
+ *
1720
+ * /{repo}/-/pulls/{number}/reviews
1721
+ */
790
1722
  post: (params: {
791
1723
  repo: string;
792
1724
  number: number;
793
- post_pull_review_form: any;
1725
+ post_pull_review_form: ApiPullReviewCreationForm;
794
1726
  }) => Promise<any>;
795
1727
  };
796
1728
  };
797
1729
 
798
1730
  releases: {
1731
+ /***
1732
+ * [openapi] 查询 release 列表
1733
+ *
1734
+ * 访问令牌调用此接口需包含以下权限
1735
+ * repo-code:r
1736
+ *
1737
+ * /{repo}/-/releases
1738
+ */
799
1739
  list: (params: {
800
1740
  repo: string;
801
1741
  page?: number;
802
1742
  page_size?: number;
803
1743
  }) => Promise<ApiRelease[]>;
804
1744
 
1745
+ /***
1746
+ * [openapi] 新增一个 Release
1747
+ *
1748
+ * 访问令牌调用此接口需包含以下权限
1749
+ * repo-code:rw
1750
+ *
1751
+ * /{repo}/-/releases
1752
+ */
805
1753
  post: (params: {
806
1754
  repo: string;
807
- create_release_form: any;
1755
+ create_release_form: OpenapiPostReleaseForm;
808
1756
  }) => Promise<any>;
809
1757
 
810
1758
  download: {
1759
+ /***
1760
+ * 发起一个获取 release 附件的请求,返回内容或者 302 到某个地址
1761
+ *
1762
+ * 访问令牌调用此接口需包含以下权限
1763
+ * repo-contents:r
1764
+ *
1765
+ * /{repo}/-/releases/download/{fileName}
1766
+ */
811
1767
  get: (params: { repo: string; fileName: string }) => Promise<any>;
812
1768
  };
813
1769
 
814
1770
  tags: {
1771
+ /***
1772
+ * [openapi] 通过 tag 查询指定 release
1773
+ *
1774
+ * 访问令牌调用此接口需包含以下权限
1775
+ * repo-code:r
1776
+ *
1777
+ * /{repo}/-/releases/tags/{tag}
1778
+ */
815
1779
  get: (params: { repo: string; tag: string }) => Promise<ApiRelease>;
816
1780
  };
817
1781
 
1782
+ /***
1783
+ * [openapi] 删除指定的 release
1784
+ *
1785
+ * 访问令牌调用此接口需包含以下权限
1786
+ * repo-code:rw
1787
+ *
1788
+ * /{repo}/-/releases/{release_id}
1789
+ */
818
1790
  delete: (params: { repo: string; release_id: number }) => Promise<any>;
819
1791
 
1792
+ /***
1793
+ * [openapi] 根据 id 查询指定 release
1794
+ *
1795
+ * 访问令牌调用此接口需包含以下权限
1796
+ * repo-code:r
1797
+ *
1798
+ * /{repo}/-/releases/{release_id}
1799
+ */
820
1800
  get: (params: {
821
1801
  repo: string;
822
1802
  release_id: number;
823
1803
  }) => Promise<ApiRelease>;
824
1804
 
1805
+ /***
1806
+ * [openapi] 更新 release
1807
+ *
1808
+ * 访问令牌调用此接口需包含以下权限
1809
+ * repo-code:rw
1810
+ *
1811
+ * /{repo}/-/releases/{release_id}
1812
+ */
825
1813
  patch: (params: {
826
1814
  repo: string;
827
1815
  release_id: number;
828
- patch_release_form: any;
1816
+ patch_release_form: OpenapiPatchReleaseForm;
829
1817
  }) => Promise<any>;
830
1818
 
831
1819
  assetUploadConfirmation: {
1820
+ /***
1821
+ * [openapi] 确认 Release asset 上传完成
1822
+ *
1823
+ * 访问令牌调用此接口需包含以下权限
1824
+ * repo-code:rw
1825
+ *
1826
+ * /{repo}/-/releases/{release_id}/asset-upload-confirmation/{token}/{asset_path}
1827
+ */
832
1828
  post: (params: {
833
1829
  repo: string;
834
1830
  release_id: number;
@@ -838,20 +1834,44 @@ export interface Client {
838
1834
  };
839
1835
 
840
1836
  assetUploadUrl: {
1837
+ /***
1838
+ * [openapi] 新增一个 Release asset
1839
+ *
1840
+ * 访问令牌调用此接口需包含以下权限
1841
+ * repo-code:rw
1842
+ *
1843
+ * /{repo}/-/releases/{release_id}/asset-upload-url
1844
+ */
841
1845
  post: (params: {
842
1846
  repo: string;
843
1847
  release_id: number;
844
- create_release_asset_upload_url_form: any;
1848
+ create_release_asset_upload_url_form: OpenapiPostReleaseAssetUploadUrlForm;
845
1849
  }) => Promise<any>;
846
1850
  };
847
1851
 
848
1852
  assets: {
1853
+ /***
1854
+ * [openapi] 删除指定的 release asset
1855
+ *
1856
+ * 访问令牌调用此接口需包含以下权限
1857
+ * repo-code:rw
1858
+ *
1859
+ * /{repo}/-/releases/{release_id}/assets/{asset_id}
1860
+ */
849
1861
  delete: (params: {
850
1862
  repo: string;
851
1863
  release_id: number;
852
1864
  asset_id: number;
853
1865
  }) => Promise<any>;
854
1866
 
1867
+ /***
1868
+ * [openapi] 查询指定的 release asset
1869
+ *
1870
+ * 访问令牌调用此接口需包含以下权限
1871
+ * repo-code:r
1872
+ *
1873
+ * /{repo}/-/releases/{release_id}/assets/{asset_id}
1874
+ */
855
1875
  get: (params: {
856
1876
  repo: string;
857
1877
  release_id: number;
@@ -862,56 +1882,169 @@ export interface Client {
862
1882
 
863
1883
  settings: {
864
1884
  branchProtections: {
1885
+ /***
1886
+ * 查询仓库保护分支规则列表(openapi)
1887
+ *
1888
+ * 访问令牌调用此接口需包含以下权限
1889
+ * repo-manage:r
1890
+ *
1891
+ * /{repo}/-/settings/branch-protections
1892
+ */
865
1893
  list: (params: { repo: string }) => Promise<ApiBranchProtection[]>;
866
1894
 
1895
+ /***
1896
+ * 新增仓库保护分支规则(openapi)
1897
+ *
1898
+ * 访问令牌调用此接口需包含以下权限
1899
+ * repo-manage:rw
1900
+ *
1901
+ * /{repo}/-/settings/branch-protections
1902
+ */
867
1903
  post: (params: {
868
1904
  repo: string;
869
- branch_protection_form: any;
1905
+ branch_protection_form: ApiBranchProtection;
870
1906
  }) => Promise<any>;
871
1907
 
1908
+ /***
1909
+ * 删除仓库保护分支规则(openapi)
1910
+ *
1911
+ * 访问令牌调用此接口需包含以下权限
1912
+ * repo-manage:rw
1913
+ *
1914
+ * /{repo}/-/settings/branch-protections/{id}
1915
+ */
872
1916
  delete: (params: { repo: string; id: string }) => Promise<any>;
873
1917
 
1918
+ /***
1919
+ * 查询仓库保护分支规则(openapi)
1920
+ *
1921
+ * 访问令牌调用此接口需包含以下权限
1922
+ * repo-manage:r
1923
+ *
1924
+ * /{repo}/-/settings/branch-protections/{id}
1925
+ */
874
1926
  get: (params: {
875
1927
  repo: string;
876
1928
  id: string;
877
1929
  }) => Promise<ApiBranchProtection>;
878
1930
 
1931
+ /***
1932
+ * 更新仓库保护分支规则(openapi)
1933
+ *
1934
+ * 访问令牌调用此接口需包含以下权限
1935
+ * repo-manage:rw
1936
+ *
1937
+ * /{repo}/-/settings/branch-protections/{id}
1938
+ */
879
1939
  patch: (params: {
880
1940
  repo: string;
881
1941
  id: string;
882
- branch_protection_form: any;
1942
+ branch_protection_form: ApiBranchProtection;
883
1943
  }) => Promise<any>;
884
1944
  };
885
1945
 
886
1946
  cloudNativeBuild: {
1947
+ /***
1948
+ * 查询仓库云原生构建设置(openapi)
1949
+ *
1950
+ * 访问令牌调用此接口需包含以下权限
1951
+ * repo-manage:r
1952
+ *
1953
+ * /{repo}/-/settings/cloud-native-build
1954
+ */
887
1955
  get: (params: { repo: string }) => Promise<ApiPipelineSettings>;
888
1956
 
889
- put: (params: { repo: string; pipeline_form: any }) => Promise<any>;
1957
+ /***
1958
+ * 更新仓库云原生构建设置(openapi)
1959
+ *
1960
+ * 访问令牌调用此接口需包含以下权限
1961
+ * repo-manage:rw
1962
+ *
1963
+ * /{repo}/-/settings/cloud-native-build
1964
+ */
1965
+ put: (params: {
1966
+ repo: string;
1967
+ pipeline_form: WebPipelineSettings;
1968
+ }) => Promise<any>;
890
1969
  };
891
1970
 
892
1971
  pullRequest: {
1972
+ /***
1973
+ * 查询仓库合并请求设置(openapi)
1974
+ *
1975
+ * 访问令牌调用此接口需包含以下权限
1976
+ * repo-manage:r
1977
+ *
1978
+ * /{repo}/-/settings/pull-request
1979
+ */
893
1980
  get: (params: { repo: string }) => Promise<ApiPullRequestSettings>;
894
1981
 
895
- put: (params: { repo: string; pull_request_form: any }) => Promise<any>;
1982
+ /***
1983
+ * 设置仓库推送设置(openapi)
1984
+ *
1985
+ * 访问令牌调用此接口需包含以下权限
1986
+ * repo-manage:rw
1987
+ *
1988
+ * /{repo}/-/settings/pull-request
1989
+ */
1990
+ put: (params: {
1991
+ repo: string;
1992
+ pull_request_form: ApiPullRequestSettings;
1993
+ }) => Promise<any>;
896
1994
  };
897
1995
 
898
1996
  pushLimit: {
1997
+ /***
1998
+ * 查询仓库推送设置(openapi)
1999
+ *
2000
+ * 访问令牌调用此接口需包含以下权限
2001
+ * repo-manage:r
2002
+ *
2003
+ * /{repo}/-/settings/push-limit
2004
+ */
899
2005
  get: (params: { repo: string }) => Promise<ApiPushLimitSettings>;
900
2006
 
901
- put: (params: { repo: string; push_limit_form: any }) => Promise<any>;
2007
+ /***
2008
+ * 设置仓库推送设置(openapi)
2009
+ *
2010
+ * 访问令牌调用此接口需包含以下权限
2011
+ * repo-manage:rw
2012
+ *
2013
+ * /{repo}/-/settings/push-limit
2014
+ */
2015
+ put: (params: {
2016
+ repo: string;
2017
+ push_limit_form: ApiPushLimitSettings;
2018
+ }) => Promise<any>;
902
2019
  };
903
2020
  };
904
2021
 
905
2022
  stars: {
2023
+ /***
2024
+ * 获取指定仓库的star用户列表
2025
+ *
2026
+ * 访问令牌调用此接口需包含以下权限
2027
+ * repo-basic-info:r
2028
+ *
2029
+ * /{repo}/-/stars
2030
+ */
906
2031
  get: (params: {
907
2032
  repo: string;
908
- filter_type: string;
2033
+ filter_type: "all" | "followed";
909
2034
  page: number;
910
2035
  page_size: number;
911
2036
  }) => Promise<DtoRepoStarUsers>;
912
2037
  };
913
2038
 
914
2039
  topActivityUsers: {
2040
+ /***
2041
+ * 获取 top 贡献用户
2042
+ *
2043
+ * 访问令牌调用此接口需包含以下权限
2044
+ * repo-base-info:r
2045
+ *
2046
+ * /{repo}/-/top-activity-users
2047
+ */
915
2048
  list: (params: {
916
2049
  repo: string;
917
2050
  top?: number;
@@ -920,30 +2053,62 @@ export interface Client {
920
2053
 
921
2054
  upload: {
922
2055
  files: {
2056
+ /***
2057
+ * 发起一个上传 files(issue,pr 及其评论中文档,压缩包等)的请求,返回上传 cos 的 url 和 form 内容
2058
+ *
2059
+ * 访问令牌调用此接口需包含以下权限
2060
+ * repo-contents:rw
2061
+ *
2062
+ * /{repo}/-/upload/files
2063
+ */
923
2064
  post: (params: {
924
2065
  repo: string;
925
- request: any;
2066
+ request: DtoUploadRequestParams;
926
2067
  }) => Promise<DtoUploadAssetsResponse>;
927
2068
  };
928
2069
 
929
2070
  imgs: {
2071
+ /***
2072
+ * 发起一个上传 imgs 的请求,返回上传 cos 的 url 和 form 内容
2073
+ *
2074
+ * 访问令牌调用此接口需包含以下权限
2075
+ * repo-contents:rw
2076
+ *
2077
+ * /{repo}/-/upload/imgs
2078
+ */
930
2079
  post: (params: {
931
2080
  repo: string;
932
- request: any;
2081
+ request: DtoUploadRequestParams;
933
2082
  }) => Promise<DtoUploadAssetsResponse>;
934
2083
  };
935
2084
 
936
2085
  releases: {
2086
+ /***
2087
+ * 发起一个上传 release 附件的请求,返回上传 cos 的 url 和 form 内容
2088
+ *
2089
+ * 访问令牌调用此接口需包含以下权限
2090
+ * repo-contents:rw
2091
+ *
2092
+ * /{repo}/-/upload/releases/{tagName}
2093
+ */
937
2094
  post: (params: {
938
2095
  repo: string;
939
2096
  tagName: string;
940
- request: any;
2097
+ request: DtoUploadRequestParams;
941
2098
  }) => Promise<DtoUploadAssetsResponse>;
942
2099
  };
943
2100
  };
944
2101
 
945
2102
  workspace: {
946
2103
  detail: {
2104
+ /***
2105
+ * 根据流水线sn查询云原生开发访问地址
2106
+ *
2107
+ * 访问令牌调用此接口需包含以下权限
2108
+ * repo-cnb-detail:r
2109
+ *
2110
+ * /{repo}/-/workspace/detail/{sn}
2111
+ */
947
2112
  get: (params: {
948
2113
  repo: string;
949
2114
  sn: string;